@dss-kit/ui-kit 0.1.25 → 0.1.26

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.
@@ -10,7 +10,7 @@
10
10
  ${p}px !important;
11
11
  top: ${d}px !important;
12
12
  }
13
- `),()=>{x.contains(g)&&x.removeChild(g)}},[t]),m.jsx(uc,{isPresent:t,childRef:o,sizeRef:r,children:M.cloneElement(e,{ref:l})})}const dc=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:s,presenceAffectsLayout:o,mode:r,anchorX:a,root:l})=>{const c=ai(fc),u=w.useId();let d=!0,f=w.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:s,onExitComplete:h=>{c.set(h,!0);for(const p of c.values())if(!p)return;i&&i()},register:h=>(c.set(h,!1),()=>c.delete(h))}),[n,c,i]);return o&&d&&(f={...f}),w.useMemo(()=>{c.forEach((h,p)=>c.set(p,!1))},[n]),M.useEffect(()=>{!n&&!c.size&&i&&i()},[n]),r==="popLayout"&&(e=m.jsx(cc,{isPresent:n,anchorX:a,root:l,children:e})),m.jsx(qt.Provider,{value:f,children:e})};function fc(){return new Map}function Cr(e=!0){const t=w.useContext(qt);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=t,o=w.useId();w.useEffect(()=>{if(e)return s(o)},[e]);const r=w.useCallback(()=>e&&i&&i(o),[o,i,e]);return!n&&i?[!1,r]:[!0]}const Vt=e=>e.key||"";function Cs(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const hc=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:o="sync",propagate:r=!1,anchorX:a="left",root:l})=>{const[c,u]=Cr(r),d=w.useMemo(()=>Cs(e),[e]),f=r&&!c?[]:d.map(Vt),h=w.useRef(!0),p=w.useRef(d),g=ai(()=>new Map),[x,v]=w.useState(d),[C,y]=w.useState(d);Eo(()=>{h.current=!1,p.current=d;for(let b=0;b<C.length;b++){const T=Vt(C[b]);f.includes(T)?g.delete(T):g.get(T)!==!0&&g.set(T,!1)}},[C,f.length,f.join("-")]);const S=[];if(d!==x){let b=[...d];for(let T=0;T<C.length;T++){const R=C[T],k=Vt(R);f.includes(k)||(b.splice(T,0,R),S.push(R))}return o==="wait"&&S.length&&(b=S),y(Cs(b)),v(d),null}process.env.NODE_ENV!=="production"&&o==="wait"&&C.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:_}=w.useContext(ri);return m.jsx(m.Fragment,{children:C.map(b=>{const T=Vt(b),R=r&&!c?!1:d===C||f.includes(T),k=()=>{if(g.has(T))g.set(T,!0);else return;let F=!0;g.forEach(O=>{O||(F=!1)}),F&&(_?.(),y(p.current),r&&u?.(),i&&i())};return m.jsx(dc,{isPresent:R,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:l,onExitComplete:R?void 0:k,anchorX:a,children:b},T)})})},Sr=w.createContext({strict:!1}),Ss={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"]},Ye={};for(const e in Ss)Ye[e]={isEnabled:t=>Ss[e].some(n=>!!t[n])};function gc(e){for(const t in e)Ye[t]={...Ye[t],...e[t]}}const pc=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 Ht(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||pc.has(e)}let _r=e=>!Ht(e);function mc(e){typeof e=="function"&&(_r=t=>t.startsWith("on")?!Ht(t):e(t))}try{mc(require("@emotion/is-prop-valid").default)}catch{}function vc(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(_r(s)||n===!0&&Ht(s)||!t&&!Ht(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}const Xt=w.createContext({});function Yt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function yt(e){return typeof e=="string"||Array.isArray(e)}const Ai=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Di=["initial",...Ai];function Zt(e){return Yt(e.animate)||Di.some(t=>yt(e[t]))}function br(e){return!!(Zt(e)||e.variants)}function yc(e,t){if(Zt(e)){const{initial:n,animate:i}=e;return{initial:n===!1||yt(n)?n:void 0,animate:yt(i)?i:void 0}}return e.inherit!==!1?t:{}}function xc(e){const{initial:t,animate:n}=yc(e,w.useContext(Xt));return w.useMemo(()=>({initial:t,animate:n}),[_s(t),_s(n)])}function _s(e){return Array.isArray(e)?e.join(" "):e}const xt={};function wc(e){for(const t in e)xt[t]=e[t],mi(t)&&(xt[t].isCSSVariable=!0)}function Rr(e,{layout:t,layoutId:n}){return tt.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!xt[e]||e==="opacity")}const Cc={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Sc=et.length;function _c(e,t,n){let i="",s=!0;for(let o=0;o<Sc;o++){const r=et[o],a=e[r];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(r.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=pr(a,Pi[r]);if(!l){s=!1;const u=Cc[r]||r;i+=`${u}(${c}) `}n&&(t[r]=c)}}return i=i.trim(),n?i=n(t,s?"":i):s&&(i="none"),i}function Fi(e,t,n){const{style:i,vars:s,transformOrigin:o}=e;let r=!1,a=!1;for(const l in t){const c=t[l];if(tt.has(l)){r=!0;continue}else if(mi(l)){s[l]=c;continue}else{const u=pr(c,Pi[l]);l.startsWith("origin")?(a=!0,o[l]=u):i[l]=u}}if(t.transform||(r||n?i.transform=_c(t,e.transform,n):i.transform&&(i.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;i.transformOrigin=`${l} ${c} ${u}`}}const ki=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Mr(e,t,n){for(const i in t)!ee(t[i])&&!Rr(i,n)&&(e[i]=t[i])}function bc({transformTemplate:e},t){return w.useMemo(()=>{const n=ki();return Fi(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Rc(e,t){const n=e.style||{},i={};return Mr(i,n,e),Object.assign(i,bc(e,t)),i}function Mc(e,t){const n={},i=Rc(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.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=i,n}const Pc={offset:"stroke-dashoffset",array:"stroke-dasharray"},Tc={offset:"strokeDashoffset",array:"strokeDasharray"};function Vc(e,t,n=1,i=0,s=!0){e.pathLength=1;const o=s?Pc:Tc;e[o.offset]=D.transform(-i);const r=D.transform(t),a=D.transform(n);e[o.array]=`${r} ${a}`}function Pr(e,{attrX:t,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(Fi(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),i!==void 0&&(d.scale=i),s!==void 0&&Vc(d,s,o,r,!1)}const Tr=()=>({...ki(),attrs:{}}),Vr=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ec(e,t,n,i){const s=w.useMemo(()=>{const o=Tr();return Pr(o,t,Vr(i),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Mr(o,e.style,e),s.style={...o,...s.style}}return s}const Ac=["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 Ii(e){return typeof e!="string"||e.includes("-")?!1:!!(Ac.indexOf(e)>-1||/[A-Z]/u.test(e))}function Dc(e,t,n,{latestValues:i},s,o=!1){const a=(Ii(e)?Ec:Mc)(t,i,s,e),l=vc(t,typeof e=="string",o),c=e!==w.Fragment?{...l,...a,ref:n}:{},{children:u}=t,d=w.useMemo(()=>ee(u)?u.get():u,[u]);return w.createElement(e,{...c,children:d})}function bs(e){const t=[{},{}];return e?.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function Li(e,t,n,i){if(typeof t=="function"){const[s,o]=bs(i);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=bs(i);t=t(n!==void 0?n:e.custom,s,o)}return t}function jt(e){return ee(e)?e.get():e}function Fc({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,s){return{latestValues:kc(n,i,s,e),renderState:t()}}function kc(e,t,n,i){const s={},o=i(e,{});for(const f in o)s[f]=jt(o[f]);let{initial:r,animate:a}=e;const l=Zt(e),c=br(e);t&&c&&!l&&e.inherit!==!1&&(r===void 0&&(r=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||r===!1;const d=u?a:r;if(d&&typeof d!="boolean"&&!Yt(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const p=Li(e,f[h]);if(p){const{transitionEnd:g,transition:x,...v}=p;for(const C in v){let y=v[C];if(Array.isArray(y)){const S=u?y.length-1:0;y=y[S]}y!==null&&(s[C]=y)}for(const C in g)s[C]=g[C]}}}return s}const Er=e=>(t,n)=>{const i=w.useContext(Xt),s=w.useContext(qt),o=()=>Fc(e,t,i,s);return n?o():ai(o)};function ji(e,t,n){const{style:i}=e,s={};for(const o in i)(ee(i[o])||t.style&&ee(t.style[o])||Rr(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(s[o]=i[o]);return s}const Ic=Er({scrapeMotionValuesFromProps:ji,createRenderState:ki});function Ar(e,t,n){const i=ji(e,t,n);for(const s in e)if(ee(e[s])||ee(t[s])){const o=et.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[o]=e[s]}return i}const Lc=Er({scrapeMotionValuesFromProps:Ar,createRenderState:Tr}),jc=Symbol.for("motionComponentSymbol");function Ge(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function $c(e,t,n){return w.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):Ge(n)&&(n.current=i))},[t])}const $i=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Oc="framerAppearId",Dr="data-"+$i(Oc),Fr=w.createContext({});function zc(e,t,n,i,s){const{visualElement:o}=w.useContext(Xt),r=w.useContext(Sr),a=w.useContext(qt),l=w.useContext(Ei).reducedMotion,c=w.useRef(null);i=i||r.renderer,!c.current&&i&&(c.current=i(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=w.useContext(Fr);u&&!u.projection&&s&&(u.type==="html"||u.type==="svg")&&Bc(c.current,n,s,d);const f=w.useRef(!1);w.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const h=n[Dr],p=w.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return Eo(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),p.current&&u.animationState&&u.animationState.animateChanges())}),w.useEffect(()=>{u&&(!p.current&&u.animationState&&u.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),p.current=!1),u.enteringChildren=void 0)}),u}function Bc(e,t,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:kr(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!r||a&&Ge(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:c})}function kr(e){if(e)return e.options.allowProjection!==!1?e.projection:kr(e.parent)}function mn(e,{forwardMotionProps:t=!1}={},n,i){n&&gc(n);const s=Ii(e)?Lc:Ic;function o(a,l){let c;const u={...w.useContext(Ei),...a,layoutId:Nc(a)},{isStatic:d}=u,f=xc(a),h=s(a,d);if(!d&&li){Hc(u,n);const p=Gc(u);c=p.MeasureLayout,f.visualElement=zc(e,h,u,i,p.ProjectionNode)}return m.jsxs(Xt.Provider,{value:f,children:[c&&f.visualElement?m.jsx(c,{visualElement:f.visualElement,...u}):null,Dc(e,a,$c(h,f.visualElement,l),h,d,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const r=w.forwardRef(o);return r[jc]=e,r}function Nc({layoutId:e}){const t=w.useContext(ri).id;return t&&e!==void 0?t+"-"+e:e}function Hc(e,t){const n=w.useContext(Sr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const i="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Je(!1,i,"lazy-strict-mode"):Se(!1,i,"lazy-strict-mode")}}function Gc(e){const{drag:t,layout:n}=Ye;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Wc(e,t){if(typeof Proxy>"u")return mn;const n=new Map,i=(o,r)=>mn(o,r,e,t),s=(o,r)=>(process.env.NODE_ENV!=="production"&&hi(!1,"motion() is deprecated. Use motion.create() instead."),i(o,r));return new Proxy(s,{get:(o,r)=>r==="create"?i:(n.has(r)||n.set(r,mn(r,void 0,e,t)),n.get(r))})}function Ir({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function Uc({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Kc(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function vn(e){return e===void 0||e===1}function Kn({scale:e,scaleX:t,scaleY:n}){return!vn(e)||!vn(t)||!vn(n)}function ke(e){return Kn(e)||Lr(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Lr(e){return Rs(e.x)||Rs(e.y)}function Rs(e){return e&&e!=="0%"}function Gt(e,t,n){const i=e-n,s=t*i;return n+s}function Ms(e,t,n,i,s){return s!==void 0&&(e=Gt(e,s,i)),Gt(e,n,i)+t}function qn(e,t=0,n=1,i,s){e.min=Ms(e.min,t,n,i,s),e.max=Ms(e.max,t,n,i,s)}function jr(e,{x:t,y:n}){qn(e.x,t.translate,t.scale,t.originPoint),qn(e.y,n.translate,n.scale,n.originPoint)}const Ps=.999999999999,Ts=1.0000000000001;function qc(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,r;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ue(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(t.x*=r.x.scale,t.y*=r.y.scale,jr(e,r)),i&&ke(o.latestValues)&&Ue(e,o.latestValues))}t.x<Ts&&t.x>Ps&&(t.x=1),t.y<Ts&&t.y>Ps&&(t.y=1)}function We(e,t){e.min=e.min+t,e.max=e.max+t}function Vs(e,t,n,i,s=.5){const o=G(e.min,e.max,s);qn(e,t,n,o,i)}function Ue(e,t){Vs(e.x,t.x,t.scaleX,t.scale,t.originX),Vs(e.y,t.y,t.scaleY,t.scale,t.originY)}function $r(e,t){return Ir(Kc(e.getBoundingClientRect(),t))}function Xc(e,t,n){const i=$r(e,n),{scroll:s}=t;return s&&(We(i.x,s.offset.x),We(i.y,s.offset.y)),i}const Es=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ke=()=>({x:Es(),y:Es()}),As=()=>({min:0,max:0}),U=()=>({x:As(),y:As()}),Xn={current:null},Or={current:!1};function Yc(){if(Or.current=!0,!!li)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Xn.current=e.matches;e.addEventListener("change",t),t()}else Xn.current=!1}const Zc=new WeakMap;function Jc(e,t,n){for(const i in t){const s=t[i],o=n[i];if(ee(s))e.addValue(i,s);else if(ee(o))e.addValue(i,Xe(s,{owner:e}));else if(o!==s)if(e.hasValue(i)){const r=e.getValue(i);r.liveStyle===!0?r.jump(s):r.hasAnimated||r.set(s)}else{const r=e.getStaticValue(i);e.addValue(i,Xe(r!==void 0?r:s,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const Ds=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Qc{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ri,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 f=re.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,N.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Zt(n),this.isVariantNode=br(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const h=d[f];l[f]!==void 0&&ee(h)&&h.set(l[f])}}mount(t){this.current=t,Zc.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,i)=>this.bindToMotionValue(i,n)),Or.current||Yc(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Xn.current,process.env.NODE_ENV!=="production"&&hi(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Te(this.notifyUpdate),Te(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(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}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=tt.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",r=>{this.latestValues[t]=r,this.props.onUpdate&&N.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),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 Ye){const n=Ye[t];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):U()}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 i=0;i<Ds.length;i++){const s=Ds[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,r=t[o];r&&(this.propEventSubscriptions[s]=this.on(s,r))}this.prevMotionValues=Jc(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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 i=this.values.get(t);n!==i&&(i&&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 i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Xe(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Ao(i)||Fo(i))?i=parseFloat(i):!rc(i)&&Ve.test(n)&&(i=gr(t,n)),this.setBaseTarget(t,ee(i)?i.get():i)),ee(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=Li(this.props,n,this.presenceContext?.custom);o&&(i=o[t])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!ee(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new fi),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Ti.render(this.render)}}class zr extends Qc{constructor(){super(...arguments),this.KeyframeResolver=qu}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:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ee(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Br(e,{style:t,vars:n},i,s){const o=e.style;let r;for(r in t)o[r]=t[r];s?.applyProjectionStyles(o,i);for(r in n)o.setProperty(r,n[r])}function ed(e){return window.getComputedStyle(e)}class td extends zr{constructor(){super(...arguments),this.type="html",this.renderInstance=Br}readValueFromInstance(t,n){if(tt.has(n))return this.projection?.isProjecting?zn(n):fu(t,n);{const i=ed(t),s=(mi(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return $r(t,n)}build(t,n,i){Fi(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return ji(t,n,i)}}const Nr=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 nd(e,t,n,i){Br(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(Nr.has(s)?s:$i(s),t.attrs[s])}class id extends zr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=U}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(tt.has(n)){const i=hr(n);return i&&i.default||0}return n=Nr.has(n)?n:$i(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return Ar(t,n,i)}build(t,n,i){Pr(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,s){nd(t,n,i,s)}mount(t){this.isSVGTag=Vr(t.tagName),super.mount(t)}}const sd=(e,t)=>Ii(e)?new id(t):new td(t,{allowProjection:e!==w.Fragment});function qe(e,t,n){const i=e.getProps();return Li(i,t,n!==void 0?n:i.custom,e)}const Yn=e=>Array.isArray(e);function od(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xe(n))}function rd(e){return Yn(e)?e[e.length-1]||0:e}function ad(e,t){const n=qe(e,t);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const r in o){const a=rd(o[r]);od(e,r,a)}}function ld(e){return!!(ee(e)&&e.add)}function Zn(e,t){const n=e.getValue("willChange");if(ld(n))return n.add(t);if(!n&&_e.WillChange){const i=new _e.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function Hr(e){return e.props[Dr]}const ud=e=>e!==null;function cd(e,{repeat:t,repeatType:n="loop"},i){const s=e.filter(ud),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const dd={type:"spring",stiffness:500,damping:25,restSpeed:10},fd=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),hd={type:"keyframes",duration:.8},gd={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},pd=(e,{keyframes:t})=>t.length>2?hd:tt.has(e)?e.startsWith("scale")?fd(t[1]):dd:gd;function md({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Oi=(e,t,n,i={},s,o)=>r=>{const a=Mi(i,e)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-me(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:s};md(a)||Object.assign(u,pd(e,u)),u.duration&&(u.duration=me(u.duration)),u.repeatDelay&&(u.repeatDelay=me(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Wn(u),u.delay===0&&(d=!0)),(_e.instantAnimations||_e.skipAnimations)&&(d=!0,Wn(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!o&&t.get()!==void 0){const f=cd(u.keyframes,a);if(f!==void 0){N.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new bi(u):new Iu(u)};function vd({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function Gr(e,t,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:r,...a}=t;i&&(o=i);const l=[],c=s&&e.animationState&&e.animationState.getState()[s];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||c&&vd(c,u))continue;const h={delay:n,...Mi(o||{},u)},p=d.get();if(p!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===p&&!h.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const v=Hr(e);if(v){const C=window.MotionHandoffAnimation(v,u,N);C!==null&&(h.startTime=C,g=!0)}}Zn(e,u),d.start(Oi(u,d,f,e.shouldReduceMotion&&cr.has(u)?{type:!1}:h,e,g));const x=d.animation;x&&l.push(x)}return r&&Promise.all(l).then(()=>{N.update(()=>{r&&ad(e,r)})}),l}function Wr(e,t,n,i=0,s=1){const o=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),r=e.size,a=(r-1)*i;return typeof n=="function"?n(o,r):s===1?o*i:a-o*i}function Jn(e,t,n={}){const i=qe(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(Gr(e,i,n)):()=>Promise.resolve(),r=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=s;return yd(e,t,l,c,u,d,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[o,r]:[r,o];return l().then(()=>c())}else return Promise.all([o(),r(n.delay)])}function yd(e,t,n=0,i=0,s=0,o=1,r){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Jn(l,t,{...r,delay:n+(typeof i=="function"?0:i)+Wr(e.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function xd(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(o=>Jn(e,o,n));i=Promise.all(s)}else if(typeof t=="string")i=Jn(e,t,n);else{const s=typeof t=="function"?qe(e,t,n.custom):t;i=Promise.all(Gr(e,s,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}function Ur(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}const wd=Di.length;function Kr(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Kr(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<wd;n++){const i=Di[n],s=e.props[i];(yt(s)||s===!1)&&(t[i]=s)}return t}const Cd=[...Ai].reverse(),Sd=Ai.length;function _d(e){return t=>Promise.all(t.map(({animation:n,options:i})=>xd(e,n,i)))}function bd(e){let t=_d(e),n=Fs(),i=!0;const s=l=>(c,u)=>{const d=qe(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(d){const{transition:f,transitionEnd:h,...p}=d;c={...c,...p,...h}}return c};function o(l){t=l(e)}function r(l){const{props:c}=e,u=Kr(e.parent)||{},d=[],f=new Set;let h={},p=1/0;for(let x=0;x<Sd;x++){const v=Cd[x],C=n[v],y=c[v]!==void 0?c[v]:u[v],S=yt(y),_=v===l?C.isActive:null;_===!1&&(p=x);let b=y===u[v]&&y!==c[v]&&S;if(b&&i&&e.manuallyAnimateOnMount&&(b=!1),C.protectedKeys={...h},!C.isActive&&_===null||!y&&!C.prevProp||Yt(y)||typeof y=="boolean")continue;const T=Rd(C.prevProp,y);let R=T||v===l&&C.isActive&&!b&&S||x>p&&S,k=!1;const F=Array.isArray(y)?y:[y];let O=F.reduce(s(v),{});_===!1&&(O={});const{prevResolvedValues:X={}}=C,te={...X,...O},se=$=>{R=!0,f.has($)&&(k=!0,f.delete($)),C.needsAnimating[$]=!0;const W=e.getValue($);W&&(W.liveStyle=!1)};for(const $ in te){const W=O[$],Z=X[$];if(h.hasOwnProperty($))continue;let I=!1;Yn(W)&&Yn(Z)?I=!Ur(W,Z):I=W!==Z,I?W!=null?se($):f.add($):W!==void 0&&f.has($)?se($):C.protectedKeys[$]=!0}C.prevProp=y,C.prevResolvedValues=O,C.isActive&&(h={...h,...O}),i&&e.blockInitialAnimation&&(R=!1);const ae=b&&T;R&&(!ae||k)&&d.push(...F.map($=>{const W={type:v};if(typeof $=="string"&&i&&!ae&&e.manuallyAnimateOnMount&&e.parent){const{parent:Z}=e,I=qe(Z,$);if(Z.enteringChildren&&I){const{delayChildren:B}=I.transition||{};W.delay=Wr(Z.enteringChildren,e,B)}}return{animation:$,options:W}}))}if(f.size){const x={};if(typeof c.initial!="boolean"){const v=qe(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(x.transition=v.transition)}f.forEach(v=>{const C=e.getBaseTarget(v),y=e.getValue(v);y&&(y.liveStyle=!0),x[v]=C??null}),d.push({animation:x})}let g=!!d.length;return i&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(g=!1),i=!1,g?t(d):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(d=>d.animationState?.setActive(l,c)),n[l].isActive=c;const u=r(l);for(const d in n)n[d].protectedKeys={};return u}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Fs(),i=!0}}}function Rd(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ur(t,e):!1}function Fe(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Fs(){return{animate:Fe(!0),whileInView:Fe(),whileHover:Fe(),whileTap:Fe(),whileDrag:Fe(),whileFocus:Fe(),exit:Fe()}}class Ae{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Md extends Ae{constructor(t){super(t),t.animationState||(t.animationState=bd(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Yt(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(){this.node.animationState.reset(),this.unmountControls?.()}}let Pd=0;class Td extends Ae{constructor(){super(...arguments),this.id=Pd++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)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 Vd={animation:{Feature:Md},exit:{Feature:Td}};function wt(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function bt(e){return{point:{x:e.pageX,y:e.pageY}}}const Ed=e=>t=>Vi(t)&&e(t,bt(t));function ut(e,t,n,i){return wt(e,t,Ed(n),i)}const qr=1e-4,Ad=1-qr,Dd=1+qr,Xr=.01,Fd=0-Xr,kd=0+Xr;function ie(e){return e.max-e.min}function Id(e,t,n){return Math.abs(e-t)<=n}function ks(e,t,n,i=.5){e.origin=i,e.originPoint=G(t.min,t.max,e.origin),e.scale=ie(n)/ie(t),e.translate=G(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Ad&&e.scale<=Dd||isNaN(e.scale))&&(e.scale=1),(e.translate>=Fd&&e.translate<=kd||isNaN(e.translate))&&(e.translate=0)}function ct(e,t,n,i){ks(e.x,t.x,n.x,i?i.originX:void 0),ks(e.y,t.y,n.y,i?i.originY:void 0)}function Is(e,t,n){e.min=n.min+t.min,e.max=e.min+ie(t)}function Ld(e,t,n){Is(e.x,t.x,n.x),Is(e.y,t.y,n.y)}function Ls(e,t,n){e.min=t.min-n.min,e.max=e.min+ie(t)}function dt(e,t,n){Ls(e.x,t.x,n.x),Ls(e.y,t.y,n.y)}function de(e){return[e("x"),e("y")]}const Yr=({current:e})=>e?e.ownerDocument.defaultView:null,js=(e,t)=>Math.abs(e-t);function jd(e,t){const n=js(e.x,t.x),i=js(e.y,t.y);return Math.sqrt(n**2+i**2)}class Zr{constructor(t,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=xn(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=jd(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!p)return;const{point:g}=f,{timestamp:x}=J;this.history.push({...g,timestamp:x});const{onStart:v,onMove:C}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=yn(h,this.transformPagePoint),N.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=xn(f.type==="pointercancel"?this.lastMoveEventInfo:yn(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,v),g&&g(f,v)},!Vi(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=r,this.contextWindow=s||window;const a=bt(t),l=yn(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=J;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,xn(l,this.history)),this.removeListeners=Ct(ut(this.contextWindow,"pointermove",this.handlePointerMove),ut(this.contextWindow,"pointerup",this.handlePointerUp),ut(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Te(this.updatePoint)}}function yn(e,t){return t?{point:t(e.point)}:e}function $s(e,t){return{x:e.x-t.x,y:e.y-t.y}}function xn({point:e},t){return{point:e,delta:$s(e,Jr(t)),offset:$s(e,$d(t)),velocity:Od(t,.1)}}function $d(e){return e[0]}function Jr(e){return e[e.length-1]}function Od(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=Jr(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>me(t)));)n--;if(!i)return{x:0,y:0};const o=fe(s.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function zd(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?G(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?G(n,e,i.max):Math.min(e,n)),e}function Os(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 Bd(e,{top:t,left:n,bottom:i,right:s}){return{x:Os(e.x,n,s),y:Os(e.y,t,i)}}function zs(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}function Nd(e,t){return{x:zs(e.x,t.x),y:zs(e.y,t.y)}}function Hd(e,t){let n=.5;const i=ie(e),s=ie(t);return s>i?n=pt(t.min,t.max-i,e.min):i>s&&(n=pt(e.min,e.max-s,t.min)),Ce(0,1,n)}function Gd(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 Qn=.35;function Wd(e=Qn){return e===!1?e=0:e===!0&&(e=Qn),{x:Bs(e,"left","right"),y:Bs(e,"top","bottom")}}function Bs(e,t,n){return{min:Ns(e,t),max:Ns(e,n)}}function Ns(e,t){return typeof e=="number"?e:e[t]||0}const Ud=new WeakMap;class Kd{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=U(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(bt(d).point)},r=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ju(h),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),de(v=>{let C=this.getAxisMotionValue(v).get()||0;if(ye.test(C)){const{projection:y}=this.visualElement;if(y&&y.layout){const S=y.layout.layoutBox[v];S&&(C=ie(S)*(parseFloat(C)/100))}}this.originPoint[v]=C}),g&&N.postRender(()=>g(d,f)),Zn(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:g,onDrag:x}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(p&&this.currentDirection===null){this.currentDirection=qd(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),x&&x(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>de(d=>this.getAnimationState(d)==="paused"&&this.getAxisMotionValue(d).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Zr(t,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:i,contextWindow:Yr(this.visualElement)})}stop(t,n){const i=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!i)return;const{velocity:r}=s;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&N.postRender(()=>a(i,s))}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:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!Et(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=zd(r,this.constraints[t],this.elastic[t])),o.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&Ge(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=Bd(i.layoutBox,t):this.constraints=!1,this.elastic=Wd(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&de(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Gd(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ge(t))return!1;const i=t.current;Se(i!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=Xc(i,s.root,this.visualElement.getTransformPagePoint());let r=Nd(s.layout.layoutBox,o);if(n){const a=n(Uc(r));this.hasMutatedConstraints=!!a,a&&(r=Ir(a))}return r}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=de(u=>{if(!Et(u,n,this.currentDirection))return;let d=l&&l[u]||{};r&&(d={min:0,max:0});const f=s?200:1e6,h=s?40:1e7,p={type:"inertia",velocity:i?t[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return Zn(this.visualElement,t),i.start(Oi(t,i,0,n,this.visualElement,!1))}stopAnimation(){de(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){de(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){de(n=>{const{drag:i}=this.getProps();if(!Et(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:r,max:a}=s.layout.layoutBox[n];o.set(t[n]-G(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Ge(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};de(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();s[r]=Hd({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),de(r=>{if(!Et(r,t,null))return;const a=this.getAxisMotionValue(r),{min:l,max:c}=this.constraints[r];a.set(G(l,c,s[r]))})}addListeners(){if(!this.visualElement.current)return;Ud.set(this.visualElement,this);const t=this.visualElement.current,n=ut(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Ge(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),N.read(i);const r=wt(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(de(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())}));return()=>{r(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:r=Qn,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Et(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function qd(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Xd extends Ae{constructor(t){super(t),this.removeGroupControls=he,this.removeListeners=he,this.controls=new Kd(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||he}unmount(){this.removeGroupControls(),this.removeListeners()}}const Hs=e=>(t,n)=>{e&&N.postRender(()=>e(t,n))};class Yd extends Ae{constructor(){super(...arguments),this.removePointerDownListener=he}onPointerDown(t){this.session=new Zr(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Yr(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:Hs(t),onStart:Hs(n),onMove:i,onEnd:(o,r)=>{delete this.session,s&&N.postRender(()=>s(o,r))}}}mount(){this.removePointerDownListener=ut(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 $t={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Gs(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const st={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(D.test(e))e=parseFloat(e);else return e;const n=Gs(e,t.target.x),i=Gs(e,t.target.y);return`${n}% ${i}%`}},Zd={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=Ve.parse(e);if(s.length>5)return i;const o=Ve.createTransformer(e),r=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+r]/=a,s[1+r]/=l;const c=G(a,l,.5);return typeof s[2+r]=="number"&&(s[2+r]/=c),typeof s[3+r]=="number"&&(s[3+r]/=c),o(s)}};let wn=!1;class Jd extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:o}=t;wc(Qd),o&&(n.group&&n.group.add(o),i&&i.register&&s&&i.register(o),wn&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),$t.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:o}=this.props,{projection:r}=i;return r&&(r.isPresent=o,wn=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||N.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ti.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;wn=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Qr(e){const[t,n]=Cr(),i=w.useContext(ri);return m.jsx(Jd,{...e,layoutGroup:i,switchLayoutGroup:w.useContext(Fr),isPresent:t,safeToRemove:n})}const Qd={borderRadius:{...st,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomLeftRadius:st,borderBottomRightRadius:st,boxShadow:Zd};function ef(e,t,n){const i=ee(e)?e:Xe(e);return i.start(Oi("",i,t,n)),i.animation}const tf=(e,t)=>e.depth-t.depth;class nf{constructor(){this.children=[],this.isDirty=!1}add(t){ui(this.children,t),this.isDirty=!0}remove(t){ci(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tf),this.isDirty=!1,this.children.forEach(t)}}function sf(e,t){const n=re.now(),i=({timestamp:s})=>{const o=s-n;o>=t&&(Te(i),e(o-t))};return N.setup(i,!0),()=>Te(i)}const ea=["TopLeft","TopRight","BottomLeft","BottomRight"],of=ea.length,Ws=e=>typeof e=="string"?parseFloat(e):e,Us=e=>typeof e=="number"||D.test(e);function rf(e,t,n,i,s,o){s?(e.opacity=G(0,n.opacity??1,af(i)),e.opacityExit=G(t.opacity??1,0,lf(i))):o&&(e.opacity=G(t.opacity??1,n.opacity??1,i));for(let r=0;r<of;r++){const a=`border${ea[r]}Radius`;let l=Ks(t,a),c=Ks(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Us(l)===Us(c)?(e[a]=Math.max(G(Ws(l),Ws(c),i),0),(ye.test(c)||ye.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=G(t.rotate||0,n.rotate||0,i))}function Ks(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const af=ta(0,.5,Bo),lf=ta(.5,.95,he);function ta(e,t,n){return i=>i<e?0:i>t?1:n(pt(e,t,i))}function qs(e,t){e.min=t.min,e.max=t.max}function ue(e,t){qs(e.x,t.x),qs(e.y,t.y)}function Xs(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ys(e,t,n,i,s){return e-=t,e=Gt(e,1/n,i),s!==void 0&&(e=Gt(e,1/s,i)),e}function uf(e,t=0,n=1,i=.5,s,o=e,r=e){if(ye.test(t)&&(t=parseFloat(t),t=G(r.min,r.max,t/100)-r.min),typeof t!="number")return;let a=G(o.min,o.max,i);e===o&&(a-=t),e.min=Ys(e.min,t,n,a,s),e.max=Ys(e.max,t,n,a,s)}function Zs(e,t,[n,i,s],o,r){uf(e,t[n],t[i],t[s],t.scale,o,r)}const cf=["x","scaleX","originX"],df=["y","scaleY","originY"];function Js(e,t,n,i){Zs(e.x,t,cf,n?n.x:void 0,i?i.x:void 0),Zs(e.y,t,df,n?n.y:void 0,i?i.y:void 0)}function Qs(e){return e.translate===0&&e.scale===1}function na(e){return Qs(e.x)&&Qs(e.y)}function eo(e,t){return e.min===t.min&&e.max===t.max}function ff(e,t){return eo(e.x,t.x)&&eo(e.y,t.y)}function to(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ia(e,t){return to(e.x,t.x)&&to(e.y,t.y)}function no(e){return ie(e.x)/ie(e.y)}function io(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class hf{constructor(){this.members=[]}add(t){ui(this.members,t),t.scheduleRender()}remove(t){if(ci(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 i;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){i=o;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function gf(e,t,n){let i="";const s=e.x.translate/t.x,o=e.y.translate/t.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:h,skewY:p}=n;c&&(i=`perspective(${c}px) ${i}`),u&&(i+=`rotate(${u}deg) `),d&&(i+=`rotateX(${d}deg) `),f&&(i+=`rotateY(${f}deg) `),h&&(i+=`skewX(${h}deg) `),p&&(i+=`skewY(${p}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const Cn=["","X","Y","Z"],pf=1e3;let mf=0;function Sn(e,t,n,i){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),i&&(i[e]=0))}function sa(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Hr(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",N,!(s||o))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&sa(i)}function oa({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(r={},a=t?.()){this.id=mf++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(xf),this.nodes.forEach(_f),this.nodes.forEach(bf),this.nodes.forEach(wf)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,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 nf)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new fi),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=wr(r)&&!sc(r),this.instance=r;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const f=()=>this.root.updateBlockedByResize=!1;N.read(()=>{d=window.innerWidth}),e(r,()=>{const h=window.innerWidth;h!==d&&(d=h,this.root.updateBlockedByResize=!0,u&&u(),u=sf(f,250),$t.hasAnimatedSinceResize&&($t.hasAnimatedSinceResize=!1,this.nodes.forEach(ro)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||Vf,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=c.getProps(),v=!this.targetLayout||!ia(this.targetLayout,h),C=!d&&f;if(this.options.layoutRoot||this.resumeFrom||C||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...Mi(p,"layout"),onPlay:g,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(u,C)}else d||ro(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Te(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:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(so);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(oo);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Sf),this.nodes.forEach(vf),this.nodes.forEach(yf)):this.nodes.forEach(oo),this.clearAllSnapshots();const a=re.now();J.delta=Ce(0,1e3/60,a-J.timestamp),J.timestamp=a,J.isProcessing=!0,cn.update.process(J),cn.preRender.process(J),cn.render.process(J),J.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ti.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Cf),this.sharedNodes.forEach(Mf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,N.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){N.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ie(this.snapshot.measuredBox.x)&&!ie(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 r=this.layout;this.layout=this.measure(!1),this.layoutCorrected=U(),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,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const l=i(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!na(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;r&&this.instance&&(a||ke(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),Ef(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return U();const a=r.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Af))){const{scroll:c}=this.root;c&&(We(a.x,c.offset.x),We(a.y,c.offset.y))}return a}removeElementScroll(r){const a=U();if(ue(a,r),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:d}=c;c!==this.root&&u&&d.layoutScroll&&(u.wasRoot&&ue(a,r),We(a.x,u.offset.x),We(a.y,u.offset.y))}return a}applyTransform(r,a=!1){const l=U();ue(l,r);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ue(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),ke(u.latestValues)&&Ue(l,u.latestValues)}return ke(this.latestValues)&&Ue(l,this.latestValues),l}removeTransform(r){const a=U();ue(a,r);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!ke(c.latestValues))continue;Kn(c.latestValues)&&c.updateSnapshot();const u=U(),d=c.measurePageBox();ue(u,d),Js(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return ke(this.latestValues)&&Js(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.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!==J.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=J.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=U(),this.relativeTargetOrigin=U(),dt(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),ue(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=U(),this.targetWithTransforms=U()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ld(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ue(this.target,this.layout.layoutBox),jr(this.target,this.targetDelta)):ue(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=U(),this.relativeTargetOrigin=U(),dt(this.relativeTargetOrigin,this.target,f.target),ue(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Kn(this.parent.latestValues)||Lr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===J.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;ue(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;qc(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=U());const{target:h}=r;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Xs(this.prevProjectionDelta.x,this.projectionDelta.x),Xs(this.prevProjectionDelta.y,this.projectionDelta.y)),ct(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!io(this.projectionDelta.x,this.prevProjectionDelta.x)||!io(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.visualElement?.scheduleRender(),r){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ke(),this.projectionDelta=Ke(),this.projectionDeltaWithTransform=Ke()}setAnimationOrigin(r,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=Ke();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=U(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=h!==p,x=this.getStack(),v=!x||x.members.length<=1,C=!!(g&&!v&&this.options.crossfade===!0&&!this.path.some(Tf));this.animationProgress=0;let y;this.mixTargetDelta=S=>{const _=S/1e3;ao(d.x,r.x,_),ao(d.y,r.y,_),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(dt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Pf(this.relativeTarget,this.relativeTargetOrigin,f,_),y&&ff(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=U()),ue(y,this.relativeTarget)),g&&(this.animationValues=u,rf(u,c,this.latestValues,_,C,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Te(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=N.update(()=>{$t.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Xe(0)),this.currentAnimation=ef(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.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 r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(pf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=r;if(!(!a||!l||!c)){if(this!==r&&this.layout&&c&&ra(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||U();const d=ie(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+d;const f=ie(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}ue(a,l),Ue(a,u),ct(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new hf),this.sharedNodes.get(r).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){const{layoutId:r}=this.options;return r?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:r}=this.options;return r?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Sn("z",r,c,this.animationValues);for(let u=0;u<Cn.length;u++)Sn(`rotate${Cn[u]}`,r,c,this.animationValues),Sn(`skew${Cn[u]}`,r,c,this.animationValues);r.render();for(const u in c)r.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=jt(a?.pointerEvents)||"",r.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=jt(a?.pointerEvents)||""),this.hasProjected&&!ke(this.latestValues)&&(r.transform=l?l({},""):"none",this.hasProjected=!1);return}r.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=gf(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),r.transform=d;const{x:f,y:h}=this.projectionDelta;r.transformOrigin=`${f.origin*100}% ${h.origin*100}% 0`,c.animationValues?r.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:r.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const p in xt){if(u[p]===void 0)continue;const{correct:g,applyTo:x,isCSSVariable:v}=xt[p],C=d==="none"?u[p]:g(u[p],c);if(x){const y=x.length;for(let S=0;S<y;S++)r[x[S]]=C}else v?this.options.visualElement.renderState.vars[p]=C:r[p]=C}this.options.layoutId&&(r.pointerEvents=c===this?jt(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>r.currentAnimation?.stop()),this.root.nodes.forEach(so),this.root.sharedNodes.clear()}}}function vf(e){e.updateLayout()}function yf(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?de(u=>{const d=o?t.measuredBox[u]:t.layoutBox[u],f=ie(d);d.min=n[u].min,d.max=d.min+f}):ra(s,t.layoutBox,n)&&de(u=>{const d=o?t.measuredBox[u]:t.layoutBox[u],f=ie(n[u]);d.max=d.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+f)});const r=Ke();ct(r,n,t.layoutBox);const a=Ke();o?ct(a,e.applyTransform(i,!0),t.measuredBox):ct(a,n,t.layoutBox);const l=!na(r);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:d,layout:f}=u;if(d&&f){const h=U();dt(h,t.layoutBox,d.layoutBox);const p=U();dt(p,n,f.layoutBox),ia(h,p)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=h,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function xf(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function wf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Cf(e){e.clearSnapshot()}function so(e){e.clearMeasurements()}function oo(e){e.isLayoutDirty=!1}function Sf(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ro(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function _f(e){e.resolveTargetDelta()}function bf(e){e.calcProjection()}function Rf(e){e.resetSkewAndRotation()}function Mf(e){e.removeLeadSnapshot()}function ao(e,t,n){e.translate=G(t.translate,0,n),e.scale=G(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function lo(e,t,n,i){e.min=G(t.min,n.min,i),e.max=G(t.max,n.max,i)}function Pf(e,t,n,i){lo(e.x,t.x,n.x,i),lo(e.y,t.y,n.y,i)}function Tf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Vf={duration:.45,ease:[.4,0,.1,1]},uo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),co=uo("applewebkit/")&&!uo("chrome/")?Math.round:he;function fo(e){e.min=co(e.min),e.max=co(e.max)}function Ef(e){fo(e.x),fo(e.y)}function ra(e,t,n){return e==="position"||e==="preserve-aspect"&&!Id(no(t),no(n),.2)}function Af(e){return e!==e.root&&e.scroll?.wasRoot}const Df=oa({attachResizeListener:(e,t)=>wt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),_n={current:void 0},aa=oa({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_n.current){const e=new Df({});e.mount(window),e.setOptions({layoutScroll:!0}),_n.current=e}return _n.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ff={pan:{Feature:Yd},drag:{Feature:Xd,ProjectionNode:aa,MeasureLayout:Qr}};function ho(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=i[s];o&&N.postRender(()=>o(t,bt(t)))}class kf extends Ae{mount(){const{current:t}=this.node;t&&(this.unmount=Qu(t,(n,i)=>(ho(this.node,i,"Start"),s=>ho(this.node,s,"End"))))}unmount(){}}class If extends Ae{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=Ct(wt(this.node.current,"focus",()=>this.onFocus()),wt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function go(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=i[s];o&&N.postRender(()=>o(t,bt(t)))}class Lf extends Ae{mount(){const{current:t}=this.node;t&&(this.unmount=ic(t,(n,i)=>(go(this.node,i,"Start"),(s,{success:o})=>go(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ei=new WeakMap,bn=new WeakMap,jf=e=>{const t=ei.get(e.target);t&&t(e)},$f=e=>{e.forEach(jf)};function Of({root:e,...t}){const n=e||document;bn.has(n)||bn.set(n,{});const i=bn.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver($f,{root:e,...t})),i[s]}function zf(e,t,n){const i=Of(t);return ei.set(e,n),i.observe(e),()=>{ei.delete(e),i.unobserve(e)}}const Bf={some:0,all:1};class Nf extends Ae{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:o}=t,r={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:Bf[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return zf(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Hf(t,n))&&this.startObserver()}unmount(){}}function Hf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Gf={inView:{Feature:Nf},tap:{Feature:Lf},focus:{Feature:If},hover:{Feature:kf}},Wf={layout:{ProjectionNode:aa,MeasureLayout:Qr}},Uf={...Vd,...Gf,...Ff,...Wf},zi=Wc(Uf,sd),Kf="_primary_13825_8",qf="_secondary_13825_12",Xf="_tertiary_13825_16",Yf="_positive_13825_20",Zf="_negative_13825_24",Jf="_warning_13825_28",Qf="_accent_13825_32",eh="_inverse_13825_36",th="_text_13825_111",nh="_regular_13825_117",ih="_medium_13825_121",sh="_semibold_13825_125",oh="_bold_13825_129",At={primary:Kf,secondary:qf,tertiary:Xf,positive:Yf,negative:Zf,warning:Jf,accent:Qf,inverse:eh,"title-1":"_title-1_13825_41","title-2":"_title-2_13825_51","title-3":"_title-3_13825_61","headline-1":"_headline-1_13825_76","headline-2":"_headline-2_13825_81","headline-3":"_headline-3_13825_86","body-1":"_body-1_13825_91","body-2":"_body-2_13825_96","caption-1":"_caption-1_13825_101","caption-2":"_caption-2_13825_106",text:th,regular:nh,medium:ih,semibold:sh,bold:oh},rh=e=>{let t;e.center?t="center":e.left?t="left":e.right&&(t="right");let n;return e.uppercase?n="uppercase":e.lowercase?n="lowercase":e.capitalize&&(n="capitalize"),P.css({marginTop:e.mt,marginBottom:e.mb,marginRight:e.mr,marginLeft:e.ml,flex:e.flex,cursor:e.cursor,wordBreak:e.wordBreak,whiteSpace:e.whiteSpace,textOverflow:e.textOverflow,textDecoration:e.decoration,textAlign:t,textTransform:n,color:e.color,opacity:e.disabled?.5:void 0,overflow:e.overflow})},j=w.forwardRef(({children:e,className:t,variant:n="body-1",fontWeight:i="medium",tag:s="p",colorName:o="primary",style:r,clickOpacity:a=.5,opacityDuration:l=200,onClick:c,disabled:u,mt:d,mb:f,ml:h,mr:p,flex:g,cursor:x,wordBreak:v,whiteSpace:C,textOverflow:y,decoration:S,color:_,center:b,left:T,right:R,uppercase:k,lowercase:F,capitalize:O,overflow:X,...te},se)=>{const[ae,ne]=w.useState(!1),$=!!c,W=()=>$&&ne(!0),Z=()=>$&&ne(!1),I=rh({mt:d,mb:f,ml:h,mr:p,flex:g,cursor:x,wordBreak:v,whiteSpace:C,textOverflow:y,decoration:S,color:_,center:b,left:T,right:R,uppercase:k,lowercase:F,capitalize:O,overflow:X}),B=s,K=$?P.css({opacity:ae?a:1,transition:`opacity ${l}ms ease`}):"";return m.jsx(B,{ref:se,...te,className:P.cx(At.text,At[n],At[o],At[i],K,t,I),style:r,onClick:c,onMouseDown:W,onMouseUp:Z,onMouseLeave:Z,onTouchStart:W,onTouchEnd:Z,role:$?"button":void 0,tabIndex:$?0:void 0,children:e})});j.displayName="Text";const Wt=zi(j),ah="_loader_1qleq_8",lh={loader:ah},uh=({color:e="var(--text-accent)"})=>m.jsx("span",{className:P.cx(lh.loader,P.css({"--loader-color":e}))}),ch=P.css({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",borderRadius:16,height:48,padding:"0 16px",cursor:"pointer",fontSize:16,fontWeight:600,overflow:"hidden",transition:"all 0.2s ease",gap:8}),ot={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)","full-round":"var(--corner-full-round)"},dh={xs:"var(--height-button-xs)",sm:"var(--height-button-sm)",md:"var(--height-button-md)",lg:"var(--height-button-lg)"},fh={clear:P.css({backgroundColor:"transparent",border:"none"}),filled:P.css({backgroundColor:"var(--fill-accent-primary)",color:"white",border:"none"}),outline:P.css({backgroundColor:"transparent",border:"1px solid var(--border-accent-primary)"})},hh=(e,t,n,i)=>{if(i)return P.css({cursor:"not-allowed",opacity:.7});const s={transition:"all 0.2s ease",borderRadius:"var(--corner-lg)",border:"none",color:e==="filled"?"var(--text-inverse)":`var(--text-${t})`};switch(e){case"filled":return P.css({...s,backgroundColor:`var(--fill-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${t}-${n}-hover)`}});case"outline":return P.css({...s,backgroundColor:"transparent",border:`1px solid var(--border-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});case"clear":return P.css({...s,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});default:return P.css(s)}},gh=({disabled:e,loading:t,onClick:n,wrapperClassName:i,buttonClassName:s,buttonDisabledClassName:o,textClassName:r,children:a,variant:l="filled",backgroundColor:c,textColor:u,textFontWeight:d,borderColor:f,color:h="accent",borderRadius:p,width:g="full",size:x="md",iconLeft:v,iconRight:C,intensity:y="primary",flex:S,..._})=>{const b=w.useMemo(()=>{switch(g){case"full":return"100%";case"auto":return"auto";default:return g}},[g]),T=w.useMemo(()=>c||(l==="filled"?h==="neutral"?"var(--fill-neutral-secondary)":`var(--fill-${h}-${y})`:"transparent"),[l,c,h,y]),R=w.useMemo(()=>{if(y==="primary"){if(h==="neutral")return"var(--text-secondary)";if(l==="filled")return"var(--text-inverse)"}else if(h==="neutral")return"var(--text-secondary)";return`var(--text-${h})`},[y,h,l]),k=w.useMemo(()=>{if(y==="primary"){if(h==="neutral")return"secondary";if(l==="filled")return"inverse"}else if(h==="neutral")return"secondary";return h},[l,h,y]),F=w.useMemo(()=>f||(l==="outline"?`var(--border-${h}-${y})`:"transparent"),[l,f,h,y]),O=w.useMemo(()=>{switch(x){case"lg":return ot.lg;case"md":case"sm":return ot.md;case"xs":return ot.sm;default:return ot.md}},[x]),X=P.cx(ch,hh(l,h,y,e),fh[l],s,e?o:void 0,P.css({borderRadius:p?ot[p]:O,backgroundColor:T,borderColor:F,color:u,width:"100%",height:dh[x],opacity:e?.7:1})),te=w.useMemo(()=>{switch(x){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[x]);return m.jsx(V,{className:P.cx(i),w:b,flex:S,relative:!0,overflow:"hidden",children:m.jsxs(zi.button,{whileTap:!e&&!t?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},className:X,disabled:e||t,onClick:n,..._,children:[t?m.jsx(uh,{color:R}):m.jsxs(m.Fragment,{children:[v,m.jsx(Wt,{style:{color:u},colorName:k,variant:te,className:r,textOverflow:"ellipsis",overflow:"hidden",children:a}),C]}),m.jsx(Ze,{})]})})},ph=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",...e},M.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),mh=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...e},M.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),vh="_checkbox_asmiz_8",yh="_disabled_asmiz_15",xh="_checkbox__ripple_asmiz_15",wh="_checkbox__input_asmiz_27",Ch="_checkbox__box_asmiz_35",Sh="_secondary_asmiz_48",_h="_checked_asmiz_54",bh="_error_asmiz_63",xe={checkbox:vh,disabled:yh,checkbox__ripple:xh,checkbox__input:wh,checkbox__box:Ch,secondary:Sh,checked:_h,error:bh},Rh={sm:20,md:24},Bi=w.forwardRef(({checked:e,onChange:t,disabled:n,error:i,indeterminate:s,size:o="md",title:r,titleColor:a,subtitle:l,subtitleColor:c="secondary",name:u,required:d,variant:f="primary",flex:h},p)=>{const[g,x]=w.useState(!1),v=e!==void 0,C=v?e:g,y=b=>{v||x(b.target.checked),t?.(b)},S=Rh[o],_=C||s;return m.jsxs("label",{className:P.cx(xe.checkbox,P.css({flex:h}),{[xe.disabled]:n}),children:[m.jsxs(V,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${S}px`,"--checkbox-size-double":`${S*2}px`},children:[m.jsx("input",{ref:p,type:"checkbox",checked:C,onChange:y,onClick:b=>b.stopPropagation(),disabled:n,name:u,required:d,className:P.cx(xe.checkbox__input,{[xe.disabled]:n})}),m.jsx("div",{className:P.cx(xe.checkbox__box,xe[f],{[xe.disabled]:n,[xe.error]:i,[xe.checked]:_}),children:_&&(s?m.jsx(mh,{width:S*.75,height:S*.75}):m.jsx(ph,{width:S*.75,height:S*.75}))})]}),(r||l)&&m.jsxs(V,{gap:4,children:[r&&m.jsx(j,{colorName:a,variant:o==="sm"?"body-2":"body-1",children:r}),l&&m.jsx(j,{variant:"body-2",colorName:c,children:l})]})]})});Bi.displayName="Checkbox";const Mh=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{opacity:.5},M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 17.9999C14.4185 17.9999 18.0002 14.4182 18.0002 9.99991C18.0002 5.58163 14.4185 1.99991 10.0002 1.99991C5.58197 1.99991 2.00024 5.58163 2.00024 9.99991C2.00024 14.4182 5.58197 17.9999 10.0002 17.9999ZM6.46514 6.46446C6.85566 6.07393 7.48883 6.07393 7.87935 6.46446L9.64712 8.23222C9.84238 8.42749 10.159 8.42749 10.3542 8.23222L12.122 6.46446C12.5125 6.07393 13.1457 6.07393 13.5362 6.46446C13.9267 6.85498 13.9267 7.48814 13.5362 7.87867L11.7684 9.64644C11.5732 9.8417 11.5732 10.1583 11.7684 10.3535L13.5362 12.1213C13.9267 12.5118 13.9267 13.145 13.5362 13.5355C13.1457 13.926 12.5125 13.926 12.122 13.5355L10.3542 11.7678C10.159 11.5725 9.84238 11.5725 9.64712 11.7678L7.87935 13.5355C7.48883 13.926 6.85566 13.926 6.46514 13.5355C6.07462 13.145 6.07462 12.5118 6.46514 12.1213L8.23291 10.3535C8.42817 10.1583 8.42817 9.8417 8.23291 9.64644L6.46514 7.87867C6.07462 7.48815 6.07462 6.85498 6.46514 6.46446Z",fill:"currentColor"}))),Ph="_disabled_ph9zm_20",Th="_multiline_ph9zm_24",Vh="_input_ph9zm_8",Eh="_sm_ph9zm_74",Ah="_md_ph9zm_79",Dh="_error_ph9zm_84",Fh="_white_ph9zm_88",kh="_gray_ph9zm_92",oe={"input-container":"_input-container_ph9zm_8",disabled:Ph,multiline:Th,input:Vh,"input-text-size_sm":"_input-text-size_sm_ph9zm_55","input-text-size_md":"_input-text-size_md_ph9zm_59","input-text-align_left":"_input-text-align_left_ph9zm_64","input-text-align_center":"_input-text-align_center_ph9zm_67","input-text-align_right":"_input-text-align_right_ph9zm_70",sm:Eh,md:Ah,error:Dh,white:Fh,gray:kh,"clear-button":"_clear-button_ph9zm_96"};function po(e){return{...new Event("input",{bubbles:!0}),target:e,currentTarget:e}}const la=w.forwardRef((e,t)=>{const{label:n,prompt:i,error:s,errorText:o,size:r="md",prefix:a,suffix:l,background:c="white",showClearButton:u,disabled:d,value:f,defaultValue:h,inputClassName:p,textAlign:g="left",...x}=e,v=e.multiline===!0,C=w.useRef(null),y=w.useRef(null),[S,_]=Ut(f!==void 0?String(f):void 0,h!==void 0?String(h):"");w.useImperativeHandle(t,()=>({focus:()=>{C.current?.focus(),y.current?.focus()},blur:()=>{C.current?.blur(),y.current?.blur()},get value(){return C.current?.value||y.current?.value}}));const b=k=>{if(_(k.target.value),v){const F=e.onChange;F?.(k)}else{const F=e.onChange;F?.(k)}};w.useEffect(()=>{v&&e.autoResize&&y.current&&(y.current.style.height="auto",y.current.style.height=`${y.current.scrollHeight}px`)},[S,v,e.autoResize]);const T=()=>{if(_(""),!v){const F=C.current;if(F){F.value="";const O=po(F),X=e.onChange;X?.(O)}return}const k=y.current;if(k){k.value="";const F=po(k),O=e.onChange;O?.(F)}},R=()=>{if(v){const{rows:X,autoResize:te,onChange:se,multiline:ae,...ne}=x;return m.jsx("textarea",{ref:y,rows:e.rows??3,className:P.cx(oe.input,p,{[oe.disabled]:d,[oe[`input-text-align_${g}`]]:!!g}),disabled:d,maxLength:e.maxLength,...ne,value:S,onChange:b})}const{onChange:k,multiline:F,...O}=x;return m.jsx("input",{...O,ref:C,className:P.cx(oe.input,oe[`input-text-size_${r}`],p,{[oe.disabled]:d,[oe[`input-text-align_${g}`]]:!!g}),disabled:d,type:e.type??"text",value:S,onChange:b})};return m.jsxs(V,{w:"full",gap:"var(--spacing-sm)",children:[n&&m.jsx(j,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",children:n}),m.jsxs(V,{row:!0,alignItems:v?"flex-start":"center",w:"full",gap:"var(--spacing-md)",className:P.cx(oe["input-container"],oe[c],oe[r],{[oe.error]:s,[oe.disabled]:d,[oe.multiline]:v}),children:[a&&m.jsx(V,{flex:"none",children:a}),m.jsx(V,{flex:"1",children:R()}),u&&S&&!d&&m.jsx(V,{flex:"none",children:m.jsx("span",{className:oe["clear-button"],onClick:T,children:m.jsx(Mh,{})})}),l&&m.jsx(V,{flex:"none",children:l})]}),(i||v)&&m.jsxs(V,{row:!0,gap:10,w:"full",children:[typeof i=="string"?m.jsx(j,{variant:"caption-1",colorName:"tertiary",children:i}):i,v&&e.maxLength&&m.jsx(j,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${S.length}/${e.maxLength}`})]}),o&&s&&m.jsx(j,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:o})]})});la.displayName="Input";const Ih=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M6 9L12 15L18 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Lh=e=>M.createElement("svg",{fill:"currentColor",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 462.035 462.035",xmlSpace:"preserve",...e},M.createElement("g",null,M.createElement("path",{d:"M457.83,158.441c-0.021-0.028-0.033-0.058-0.057-0.087l-50.184-62.48c-0.564-0.701-1.201-1.305-1.879-1.845 c-2.16-2.562-5.355-4.225-8.967-4.225H65.292c-3.615,0-6.804,1.661-8.965,4.225c-0.678,0.54-1.316,1.138-1.885,1.845l-50.178,62.48 c-0.023,0.029-0.034,0.059-0.057,0.087C1.655,160.602,0,163.787,0,167.39v193.07c0,6.5,5.27,11.771,11.77,11.771h438.496 c6.5,0,11.77-5.271,11.77-11.771V167.39C462.037,163.787,460.381,160.602,457.83,158.441z M408.516,134.615l16.873,21.005h-16.873 V134.615z M384.975,113.345v42.274H296.84c-2.514,0-4.955,0.805-6.979,2.293l-58.837,43.299l-58.849-43.305 c-2.023-1.482-4.466-2.287-6.978-2.287H77.061v-42.274H384.975z M53.523,155.62H36.65l16.873-21.005V155.62z M438.498,348.69H23.54 V179.16h137.796l62.711,46.148c4.15,3.046,9.805,3.052,13.954-0.005l62.698-46.144h137.799V348.69L438.498,348.69z"}))),jh="_avatar_1oe2p_8",$h="_avatar_primary_1oe2p_22",Oh="_avatar_secondary_1oe2p_25",zh="_avatar_negative_1oe2p_28",Bh="_avatar_positive_1oe2p_31",Nh="_avatar_warning_1oe2p_34",Hh="_avatar_lgSize_1oe2p_71",Gh="_avatar_mdSize_1oe2p_85",Wh="_avatar_smSize_1oe2p_99",Rn={avatar:jh,avatar_primary:$h,avatar_secondary:Oh,avatar_negative:zh,avatar_positive:Bh,avatar_warning:Nh,avatar_lgSize:Hh,avatar_mdSize:Gh,avatar_smSize:Wh};function Uh({attr:e,children:t,className:n,color:i="primary",size:s="md",...o}){const r="avatar";return m.jsx("div",{...e,...o,className:Ie(Rn[r],n,ht(Rn,r,s),Kt(Rn,r,i)),children:t})}const Kh=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.15}),M.createElement("path",{d:"M16 9L10.0337 15L8 12.9548",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),mo=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor",fillOpacity:.15}),M.createElement("path",{d:"M12 6C11.4477 6 11 6.44772 11 7V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V7C13 6.44772 12.5523 6 12 6Z",fill:"currentColor"}),M.createElement("path",{d:"M12 15C11.4477 15 11 15.4477 11 16V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16C13 15.4477 12.5523 15 12 15Z",fill:"currentColor"})),qh=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.12}),M.createElement("path",{d:"M16 8L8 16M16 16L8 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),Xh=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"black",...e},M.createElement("path",{d:"M12 2V22M19.0711 4.92893L4.92893 19.0711M22 12H2M19.0711 19.0711L4.92893 4.92893",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Yh="_hint_prca1_8",Zh="_md_prca1_19",Jh="_sm_prca1_24",Qh="_icon_prca1_29",eg="_content_prca1_40",tg="_title_prca1_46",ng="_subtitle_prca1_50",ig="_disabled_prca1_55",sg="_warning_prca1_60",og="_solid_prca1_60",rg="_negative_prca1_65",ag="_positive_prca1_70",lg="_accent_prca1_75",ug="_neutral_prca1_80",cg="_soft_prca1_85",ce={hint:Yh,md:Zh,sm:Jh,icon:Qh,content:eg,title:tg,subtitle:ng,disabled:ig,warning:sg,solid:og,negative:rg,positive:ag,accent:lg,neutral:ug,soft:cg},dg={negative:m.jsx(qh,{}),positive:m.jsx(Kh,{}),accent:m.jsx(mo,{}),warning:m.jsx(mo,{}),neutral:m.jsx(Xh,{})},fg=({title:e,subtitle:t,color:n="warning",variant:i="soft",size:s="md",icon:o,disabled:r=!1,className:a,style:l})=>{const c=o||dg[n];return m.jsxs("div",{className:Ie(ce.hint,ce[n],ce[i],ce[s],r&&ce.disabled,a),style:l,"aria-disabled":r,children:[c&&m.jsx("span",{className:Ie(ce.icon,ce[n]),children:c}),m.jsxs("div",{className:ce.content,children:[e&&m.jsx(j,{className:Ie(ce.title,ht(ce,"title",s)),variant:s==="md"?"body-1":"caption-2",children:e}),t&&m.jsx(j,{className:Ie(ce.subtitle,ht(ce,"subtitle",s)),variant:s==="md"?"body-2":"caption-1",children:t})]})]})},hg={primary:{bg:"var(--status-neutral-tint-low)",color:"var(--text-primary)"},accent:{bg:"var(--status-accent-tint-low)",color:"var(--text-accent)"},warning:{bg:"var(--status-warning-tint-low)",color:"var(--text-warning)"},positive:{bg:"var(--status-positive-tint-low)",color:"var(--text-positive)"},negative:{bg:"var(--status-negative-tint-low)",color:"var(--text-negative)"}},gg={sm:28,md:32,lg:40},Ni=w.forwardRef(({label:e,color:t="primary",size:n="md",onClick:i,onDelete:s,avatar:o,icon:r,disabled:a,className:l},c)=>{const u=w.useRef(null),d=hg[t],f=P.css({cursor:a?"not-allowed":i?"pointer":"default",opacity:a?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s","&:hover":a?void 0:{backgroundColor:d.bg}}),h=P.css({cursor:"pointer",opacity:.6,"&:hover":{opacity:1}});return m.jsxs(V,{ref:p=>{u.current=p,typeof c=="function"?c(p):c&&(c.current=p)},row:!0,alignItems:"center",gap:6,px:10,py:4,h:gg[n],maxWidth:196,overflow:"hidden",borderRadius:"var(--corner-sm)",backgroundColor:d.bg,color:d.color,onClick:i,className:P.cx(f,l),children:[i&&m.jsx(Ze,{}),o&&m.jsx(V,{w:20,h:20,borderRadius:"50%",overflow:"hidden",children:o}),r&&m.jsx(V,{children:r}),m.jsx(j,{variant:"caption-1",colorName:t,textOverflow:"ellipsis",children:e}),s&&!a&&m.jsx(j,{className:h,colorName:t,onClick:p=>{p.stopPropagation(),s(p)},children:"×"})]})});Ni.displayName="Tag";const ua=({children:e})=>{const[t]=w.useState(()=>document.createElement("div"));return w.useEffect(()=>{let n=document.getElementById("portal-root");return n||(n=document.createElement("div"),n.id="portal-root",document.body.appendChild(n)),n.appendChild(t),()=>{n&&n.contains(t)&&n.removeChild(t)}},[t]),Mo.createPortal(e,t)},pg="_disabled_v62jt_40",mg="_open_v62jt_48",vg="_error_v62jt_51",yg="_hidden_v62jt_87",xg="_visible_v62jt_90",wg="_selected_v62jt_163",Y={"select-container":"_select-container_v62jt_8","full-width":"_full-width_v62jt_13","select-input":"_select-input_v62jt_17","size-xs":"_size-xs_v62jt_25","size-sm":"_size-sm_v62jt_30","size-md":"_size-md_v62jt_35",disabled:pg,open:mg,"select-arrow":"_select-arrow_v62jt_48",error:vg,"select-value":"_select-value_v62jt_62","select-value_xs":"_select-value_xs_v62jt_74","select-placeholder":"_select-placeholder_v62jt_81",hidden:yg,visible:xg,"select-arrow_xs":"_select-arrow_xs_v62jt_106","select-dropdown":"_select-dropdown_v62jt_116","select-menu":"_select-menu_v62jt_126","select-menu-item":"_select-menu-item_v62jt_145","select-menu-item-first":"_select-menu-item-first_v62jt_158",selected:wg,"overflow-tooltip-container":"_overflow-tooltip-container_v62jt_167","overflow-tooltip-text":"_overflow-tooltip-text_v62jt_172","empty-block":"_empty-block_v62jt_179"};function ca({value:e,onChange:t,multiple:n=!1,returnedValue:i,renderItem:s,placeholder:o,items:r=[],fullWidth:a,size:l="md",showDefaultItem:c,disabled:u,label:d,firstItem:f,lastItem:h,observer:p,emptyText:g,onBlur:x,prompt:v,error:C,errorText:y}){const[S,_]=Ut(e,n?[]:null),b=w.useRef(null),T=w.useRef(null),[R,k]=w.useState(!1),F=w.useMemo(()=>n?S||[]:S!=null?[S]:[],[S,n]),O=w.useCallback(I=>i?i(I):I,[i]),X=w.useMemo(()=>{const I=new Map;return r.forEach(B=>{I.set(O(B),B)}),I},[r,O]),te=To(b,R),se=!r.length&&!C,ae=I=>{const B=O(I);if(n){const K=F.includes(B)?F.filter(be=>be!==B):[...F,B];_(K),t?.(K)}else _(B),t?.(B),k(!1)},ne=I=>{if(!n)return;const B=F.filter(K=>K!==I);_(B),t?.(B)},$=()=>{const I=n?[]:null;_(I),t?.(I),n||k(!1)};w.useEffect(()=>{if(!R)return;const I=B=>{const K=B.target;!b.current?.contains(K)&&!T.current?.contains(K)&&(k(!1),x?.())};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[R,x]);const W=()=>{if(!F.length)return m.jsx(j,{variant:l==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",colorName:"tertiary",children:o??"Select..."});if(n)return m.jsx(V,{flexWrap:"wrap",row:!0,gap:10,children:F.map(K=>{const be=X.get(K);return be?m.jsx(Ni,{size:"sm",label:s(be),onDelete:nt=>{nt.stopPropagation(),ne(K)}},K):null})});const I=X.get(F[0]);if(!I)return m.jsx(j,{variant:l==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",colorName:"tertiary",children:o});const B=s(I);return typeof B=="string"?m.jsx(j,{variant:l==="xs"?"caption-1":"body-2",tag:"p",textOverflow:"ellipsis",overflow:"hidden",children:B}):m.jsx(m.Fragment,{children:B})},Z=R&&m.jsx(ua,{children:m.jsx(zi.div,{ref:T,className:Y["select-dropdown"],initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{...te,position:"absolute",zIndex:1},children:m.jsxs("ul",{className:Y["select-menu"],children:[c&&!n&&m.jsx(V,{className:Y["select-menu-item"],role:"option",onClick:$,children:m.jsx(j,{variant:"body-2",colorName:"tertiary",children:o})}),f&&m.jsx(V,{className:P.cx(Y["select-menu-item"],Y["select-menu-item-first"]),children:f}),se&&m.jsxs(V,{className:Y["empty-block"],children:[m.jsx(V,{w:20,h:20,children:m.jsx(Lh,{})}),m.jsx(j,{variant:"body-2",children:g??"There is nothing yet"})]}),r.map(I=>{const B=O(I),K=F.includes(B);return m.jsxs(V,{row:!0,gap:10,alignItems:"center",className:P.cx(Y["select-menu-item"],{[Y.selected]:K}),role:"option",relative:!0,onClick:()=>ae(I),children:[n&&m.jsx(Bi,{size:"sm",checked:K}),typeof s(I)=="string"?m.jsx(j,{variant:"body-2",tag:"p",wordBreak:"break-all",whiteSpace:"break-spaces",children:s(I)}):s(I),m.jsx(Ze,{})]},B)}),p,h&&m.jsx(V,{className:P.cx(Y["select-menu-item"],Y["select-menu-item-first"]),children:h})]})},"dropdown")});return m.jsxs(V,{relative:!0,display:"inline-block",minWidth:120,w:a?"full":"auto",children:[typeof d=="string"?m.jsx(j,{variant:"body-2",colorName:"tertiary",fontWeight:"regular",mb:l==="sm"?4:8,children:d}):d,m.jsxs(V,{ref:b,row:!0,gap:10,tabIndex:u?-1:0,role:"button",alignItems:"flex-start","aria-haspopup":"listbox",relative:!0,w:"100%",className:P.cx(Y["select-input"],Y[`size-${l}`],{[Y.error]:C,[Y.disabled]:u,[Y.open]:R}),onClick:()=>!u&&k(I=>!I),onBlur:x,children:[m.jsx(V,{className:P.cx(Y["select-value"]),children:W()}),m.jsx(V,{className:P.cx(Y["select-arrow"],Y[`select-arrow_${l}`]),children:m.jsx(Ih,{})})]}),typeof v=="string"?m.jsx(j,{variant:"caption-1",colorName:"tertiary",mt:4,children:v}):v,C&&y&&m.jsx(j,{tag:"p",colorName:"negative",variant:"body-2",mt:5,children:y}),m.jsx(hc,{initial:!1,children:Z})]})}const Cg=e=>M.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M3.94629 0.220237C3.78013 0.264025 3.64089 0.377624 3.56348 0.53176C3.27371 1.11189 3.05664 1.46395 2.83887 1.74953C2.61807 2.03873 2.38547 2.27579 2.03027 2.63039C1.21079 3.45057 0.799805 4.52619 0.799805 5.60012C0.799838 6.67406 1.21073 7.74968 2.03027 8.56985C3.67062 10.2096 6.32931 10.2095 7.96973 8.56985C8.78929 7.74968 9.20016 6.67408 9.2002 5.60012C9.15131 4.32908 8.43217 3.48543 7.94727 3.05813C7.76902 2.90106 7.40643 3.02424 7.2627 3.2134C7.24031 3.24286 7.21612 3.2739 7.18945 3.30617C6.93211 3.61754 6.56236 3.80807 6.41504 3.83156C6.38264 3.83667 6.36979 3.76513 6.2959 3.58254C5.79455 2.34427 5.78927 2.49365 5.58887 2.01125C5.48847 1.7692 5.05517 1.02727 4.92676 0.828635C4.80206 0.635591 4.64095 0.439873 4.43359 0.301292C4.29028 0.205951 4.1124 0.175957 3.94629 0.220237ZM4.75293 4.17824C5.2689 4.63997 5.60857 5.26651 5.71484 5.95071C6.10631 5.85571 6.46727 5.68318 6.78125 5.45071C6.86578 5.70826 6.89338 5.98123 6.8623 6.25051C6.83115 6.51993 6.74174 6.77966 6.60059 7.01125C6.45944 7.24281 6.27008 7.44117 6.04492 7.59231C5.81977 7.74344 5.56462 7.8443 5.29688 7.88723C5.0292 7.93013 4.75518 7.91446 4.49414 7.84133C4.23299 7.76812 3.99064 7.6383 3.78418 7.46242C3.5778 7.28657 3.41161 7.06792 3.29785 6.8218C3.18419 6.57572 3.12519 6.30771 3.125 6.03664C3.12508 5.58233 3.29054 5.14308 3.58984 4.80129C3.88917 4.4597 4.30271 4.2382 4.75293 4.17824Z",fill:"#FEAD34"})),Sg=e=>M.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M10.1483 8.61509C10.3344 8.26159 9.98299 7.89856 9.58534 7.93723C9.42671 7.95265 9.25857 7.9605 9.07422 7.96035C6.36522 7.9582 4.17129 5.76427 4.16914 3.05527C4.169 2.87115 4.17682 2.70321 4.19221 2.54477C4.23082 2.14712 3.86769 1.79411 3.50976 1.97161C2.03398 2.70343 1.20002 4.02274 1.20002 5.89477C1.20002 8.60377 3.3961 10.7998 6.1051 10.7998C7.97571 10.7998 9.38737 10.06 10.1483 8.61509Z",fill:"white"})),_g="_container_e7tan_8",bg="_disabled_e7tan_17",Rg="_reverse_e7tan_21",Mg="_input_e7tan_25",Pg="_switchContainer_e7tan_35",Tg="_variant_accent_e7tan_43",Vg="_variant_secondary_e7tan_47",Eg="_thumb_e7tan_51",Ag="_variant_theme_e7tan_54",Dg="_moon_e7tan_58",Fg="_fire_e7tan_61",kg="_size_sm_e7tan_74",Ig="_size_md_e7tan_80",Lg="_size_lg_e7tan_86",ge={container:_g,disabled:bg,reverse:Rg,input:Mg,switchContainer:Pg,variant_accent:Tg,variant_secondary:Vg,switch:"_switch_e7tan_35",thumb:Eg,variant_theme:Ag,moon:Dg,fire:Fg,size_sm:kg,size_md:Ig,size_lg:Lg},da=w.forwardRef(({title:e,text:t,icon:n,disabled:i,onChange:s,checked:o,defaultValue:r,className:a,size:l="md",variant:c="accent",reverse:u=!1,w:d="auto",...f},h)=>{const[p,g]=Ut(o,r),x=w.useRef(null);w.useImperativeHandle(h,()=>({focus:()=>{x.current?.focus()},blur:()=>{x.current?.blur()},get checked(){return p??!1},setChecked:S=>{g(S),s?.(S)},toggle:()=>{const S=!p;g(S),s?.(S)},isFocused:()=>document.activeElement===x.current,isDisabled:()=>i??!1,getInputElement:()=>x.current,checkValidity:()=>x.current?.checkValidity()??!0,reset:()=>{const S=r??!1;g(S),s?.(S)}}),[p,g,s,i,r]);const v=w.useCallback(S=>{g(S.target.checked),s?.(S.target.checked)},[s]),C=w.useMemo(()=>typeof e=="string"?m.jsx(j,{variant:"body-1",colorName:"primary",fontWeight:"medium",children:e}):e,[e]),y=w.useMemo(()=>typeof t=="string"?m.jsx(j,{variant:"body-2",colorName:"secondary",fontWeight:"regular",children:t}):t,[t]);return m.jsxs(V,{row:!0,w:d,gap:"var(--spacing-sm)",children:[m.jsxs("label",{className:P.cx(ge.container,a,{[ge.disabled]:i,[ge.reverse]:u}),children:[m.jsxs(V,{className:P.cx(ge.switchContainer,ge[`size_${l}`],ge[`variant_${c}`]),children:[m.jsx("input",{ref:x,type:"checkbox",checked:p,className:ge.input,onChange:v,disabled:i,...f}),m.jsx("div",{className:ge.switch,children:m.jsx("div",{className:ge.thumb,children:c==="theme"&&m.jsxs(m.Fragment,{children:[m.jsx(Sg,{className:ge.moon}),m.jsx(Cg,{className:ge.fire})]})})})]}),m.jsxs(V,{gap:"var(--spacing-xs)",children:[C,y]})]}),n]})});da.displayName="Switch";const jg="_primary_svt6d_8",$g="_secondary_svt6d_13",Og="_button_svt6d_18",Re={primary:jg,secondary:$g,button:Og,"button-active":"_button-active_svt6d_32","icon-container":"_icon-container_svt6d_35","button-primary":"_button-primary_svt6d_47","button-secondary":"_button-secondary_svt6d_51","button-disabled":"_button-disabled_svt6d_55","full-width":"_full-width_svt6d_60"};function zg({value:e,onChange:t,options:n,variant:i="primary",fullWidth:s=!1,className:o}){return m.jsx(V,{row:!0,alignItems:"center",borderRadius:"var(--corner-md)",p:"var(--spacing-xs)",gap:"var(--spacing-md)",className:P.cx(Re[i],s&&Re["full-width"],o),children:n.map(r=>{const a=r.value===e,l=r.disabled,c=r.separatorAfter??!1;return m.jsxs(w.Fragment,{children:[m.jsxs("button",{type:"button",disabled:l,className:P.cx(Re.button,s&&Re["full-width"],a&&Re["button-active"],a&&Re[`button-${i}`],l&&Re["button-disabled"]),onClick:()=>!l&&t(r.value),children:[r.icon&&m.jsx(V,{alignItems:"center",justifyContent:"center",className:Re["icon-container"],children:r.icon}),r.label&&m.jsx(j,{colorName:a?"primary":"tertiary",children:r.label}),!l&&m.jsx(Ze,{color:"var(--fill-bg-overlay-primary)"})]}),c&&m.jsx(V,{w:1,h:24,backgroundColor:"var(--fill-bg-tertiary)"})]},r.value)})})}const Bg="_header_446to_8",Ng={header:Bg},fa=w.forwardRef(({title:e,subtitle:t,onClose:n,w:i="full",p:s,py:o,px:r="var(--spacing-2xl)",pt:a="var(--spacing-2xl)",pb:l="var(--spacing-lg)",row:c=!0,justifyContent:u="space-between",showCloseButton:d=!0},f)=>m.jsxs(V,{w:i,p:s,py:o,px:r,pt:a,pb:l,row:c,justifyContent:u,ref:f,className:Ng.header,children:[m.jsxs(V,{gap:"var(--spacing-sm)",children:[m.jsx(j,{variant:"title-3",colorName:"primary",fontWeight:"semibold",children:e}),m.jsx(j,{variant:"body-1",colorName:"tertiary",fontWeight:"medium",children:t})]}),d&&m.jsx(V,{children:m.jsx(gt,{onClick:n,color:"neutral",children:m.jsx(Po,{})})})]}));fa.displayName="ModalHeader";const Hg="_footer_1bo08_8",Gg={footer:Hg},ha=w.forwardRef(({children:e,row:t=!0,flex:n=!0,gap:i="var(--spacing-lg)",p:s="var(--spacing-2xl)",className:o,...r},a)=>m.jsx(V,{flex:n,row:t,gap:i,p:s,className:P.cx(Gg.footer,o),ref:a,...r,children:e}));ha.displayName="ModalFooter";function Be(e,t,n){let i=n.initialDeps??[],s;function o(){var r,a,l,c;let u;n.key&&((r=n.debug)!=null&&r.call(n))&&(u=Date.now());const d=e();if(!(d.length!==i.length||d.some((p,g)=>i[g]!==p)))return s;i=d;let h;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(h=Date.now()),s=t(...d),n.key&&((l=n.debug)!=null&&l.call(n))){const p=Math.round((Date.now()-u)*100)/100,g=Math.round((Date.now()-h)*100)/100,x=g/16,v=(C,y)=>{for(C=String(C);C.length<y;)C=" "+C;return C};console.info(`%c⏱ ${v(g,5)} /${v(p,5)} ms`,`
13
+ `),()=>{x.contains(g)&&x.removeChild(g)}},[t]),m.jsx(uc,{isPresent:t,childRef:o,sizeRef:r,children:M.cloneElement(e,{ref:l})})}const dc=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:s,presenceAffectsLayout:o,mode:r,anchorX:a,root:l})=>{const c=ai(fc),u=w.useId();let d=!0,f=w.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:s,onExitComplete:h=>{c.set(h,!0);for(const p of c.values())if(!p)return;i&&i()},register:h=>(c.set(h,!1),()=>c.delete(h))}),[n,c,i]);return o&&d&&(f={...f}),w.useMemo(()=>{c.forEach((h,p)=>c.set(p,!1))},[n]),M.useEffect(()=>{!n&&!c.size&&i&&i()},[n]),r==="popLayout"&&(e=m.jsx(cc,{isPresent:n,anchorX:a,root:l,children:e})),m.jsx(qt.Provider,{value:f,children:e})};function fc(){return new Map}function Cr(e=!0){const t=w.useContext(qt);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=t,o=w.useId();w.useEffect(()=>{if(e)return s(o)},[e]);const r=w.useCallback(()=>e&&i&&i(o),[o,i,e]);return!n&&i?[!1,r]:[!0]}const Vt=e=>e.key||"";function Cs(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const hc=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:o="sync",propagate:r=!1,anchorX:a="left",root:l})=>{const[c,u]=Cr(r),d=w.useMemo(()=>Cs(e),[e]),f=r&&!c?[]:d.map(Vt),h=w.useRef(!0),p=w.useRef(d),g=ai(()=>new Map),[x,v]=w.useState(d),[C,y]=w.useState(d);Eo(()=>{h.current=!1,p.current=d;for(let b=0;b<C.length;b++){const T=Vt(C[b]);f.includes(T)?g.delete(T):g.get(T)!==!0&&g.set(T,!1)}},[C,f.length,f.join("-")]);const S=[];if(d!==x){let b=[...d];for(let T=0;T<C.length;T++){const R=C[T],k=Vt(R);f.includes(k)||(b.splice(T,0,R),S.push(R))}return o==="wait"&&S.length&&(b=S),y(Cs(b)),v(d),null}process.env.NODE_ENV!=="production"&&o==="wait"&&C.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:_}=w.useContext(ri);return m.jsx(m.Fragment,{children:C.map(b=>{const T=Vt(b),R=r&&!c?!1:d===C||f.includes(T),k=()=>{if(g.has(T))g.set(T,!0);else return;let F=!0;g.forEach(O=>{O||(F=!1)}),F&&(_?.(),y(p.current),r&&u?.(),i&&i())};return m.jsx(dc,{isPresent:R,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:l,onExitComplete:R?void 0:k,anchorX:a,children:b},T)})})},Sr=w.createContext({strict:!1}),Ss={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"]},Ye={};for(const e in Ss)Ye[e]={isEnabled:t=>Ss[e].some(n=>!!t[n])};function gc(e){for(const t in e)Ye[t]={...Ye[t],...e[t]}}const pc=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 Ht(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||pc.has(e)}let _r=e=>!Ht(e);function mc(e){typeof e=="function"&&(_r=t=>t.startsWith("on")?!Ht(t):e(t))}try{mc(require("@emotion/is-prop-valid").default)}catch{}function vc(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(_r(s)||n===!0&&Ht(s)||!t&&!Ht(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}const Xt=w.createContext({});function Yt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function yt(e){return typeof e=="string"||Array.isArray(e)}const Ai=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Di=["initial",...Ai];function Zt(e){return Yt(e.animate)||Di.some(t=>yt(e[t]))}function br(e){return!!(Zt(e)||e.variants)}function yc(e,t){if(Zt(e)){const{initial:n,animate:i}=e;return{initial:n===!1||yt(n)?n:void 0,animate:yt(i)?i:void 0}}return e.inherit!==!1?t:{}}function xc(e){const{initial:t,animate:n}=yc(e,w.useContext(Xt));return w.useMemo(()=>({initial:t,animate:n}),[_s(t),_s(n)])}function _s(e){return Array.isArray(e)?e.join(" "):e}const xt={};function wc(e){for(const t in e)xt[t]=e[t],mi(t)&&(xt[t].isCSSVariable=!0)}function Rr(e,{layout:t,layoutId:n}){return tt.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!xt[e]||e==="opacity")}const Cc={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Sc=et.length;function _c(e,t,n){let i="",s=!0;for(let o=0;o<Sc;o++){const r=et[o],a=e[r];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(r.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=pr(a,Pi[r]);if(!l){s=!1;const u=Cc[r]||r;i+=`${u}(${c}) `}n&&(t[r]=c)}}return i=i.trim(),n?i=n(t,s?"":i):s&&(i="none"),i}function Fi(e,t,n){const{style:i,vars:s,transformOrigin:o}=e;let r=!1,a=!1;for(const l in t){const c=t[l];if(tt.has(l)){r=!0;continue}else if(mi(l)){s[l]=c;continue}else{const u=pr(c,Pi[l]);l.startsWith("origin")?(a=!0,o[l]=u):i[l]=u}}if(t.transform||(r||n?i.transform=_c(t,e.transform,n):i.transform&&(i.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;i.transformOrigin=`${l} ${c} ${u}`}}const ki=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Mr(e,t,n){for(const i in t)!ee(t[i])&&!Rr(i,n)&&(e[i]=t[i])}function bc({transformTemplate:e},t){return w.useMemo(()=>{const n=ki();return Fi(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Rc(e,t){const n=e.style||{},i={};return Mr(i,n,e),Object.assign(i,bc(e,t)),i}function Mc(e,t){const n={},i=Rc(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.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=i,n}const Pc={offset:"stroke-dashoffset",array:"stroke-dasharray"},Tc={offset:"strokeDashoffset",array:"strokeDasharray"};function Vc(e,t,n=1,i=0,s=!0){e.pathLength=1;const o=s?Pc:Tc;e[o.offset]=D.transform(-i);const r=D.transform(t),a=D.transform(n);e[o.array]=`${r} ${a}`}function Pr(e,{attrX:t,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(Fi(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),i!==void 0&&(d.scale=i),s!==void 0&&Vc(d,s,o,r,!1)}const Tr=()=>({...ki(),attrs:{}}),Vr=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ec(e,t,n,i){const s=w.useMemo(()=>{const o=Tr();return Pr(o,t,Vr(i),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Mr(o,e.style,e),s.style={...o,...s.style}}return s}const Ac=["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 Ii(e){return typeof e!="string"||e.includes("-")?!1:!!(Ac.indexOf(e)>-1||/[A-Z]/u.test(e))}function Dc(e,t,n,{latestValues:i},s,o=!1){const a=(Ii(e)?Ec:Mc)(t,i,s,e),l=vc(t,typeof e=="string",o),c=e!==w.Fragment?{...l,...a,ref:n}:{},{children:u}=t,d=w.useMemo(()=>ee(u)?u.get():u,[u]);return w.createElement(e,{...c,children:d})}function bs(e){const t=[{},{}];return e?.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function Li(e,t,n,i){if(typeof t=="function"){const[s,o]=bs(i);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=bs(i);t=t(n!==void 0?n:e.custom,s,o)}return t}function jt(e){return ee(e)?e.get():e}function Fc({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,s){return{latestValues:kc(n,i,s,e),renderState:t()}}function kc(e,t,n,i){const s={},o=i(e,{});for(const f in o)s[f]=jt(o[f]);let{initial:r,animate:a}=e;const l=Zt(e),c=br(e);t&&c&&!l&&e.inherit!==!1&&(r===void 0&&(r=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||r===!1;const d=u?a:r;if(d&&typeof d!="boolean"&&!Yt(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const p=Li(e,f[h]);if(p){const{transitionEnd:g,transition:x,...v}=p;for(const C in v){let y=v[C];if(Array.isArray(y)){const S=u?y.length-1:0;y=y[S]}y!==null&&(s[C]=y)}for(const C in g)s[C]=g[C]}}}return s}const Er=e=>(t,n)=>{const i=w.useContext(Xt),s=w.useContext(qt),o=()=>Fc(e,t,i,s);return n?o():ai(o)};function ji(e,t,n){const{style:i}=e,s={};for(const o in i)(ee(i[o])||t.style&&ee(t.style[o])||Rr(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(s[o]=i[o]);return s}const Ic=Er({scrapeMotionValuesFromProps:ji,createRenderState:ki});function Ar(e,t,n){const i=ji(e,t,n);for(const s in e)if(ee(e[s])||ee(t[s])){const o=et.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[o]=e[s]}return i}const Lc=Er({scrapeMotionValuesFromProps:Ar,createRenderState:Tr}),jc=Symbol.for("motionComponentSymbol");function Ge(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function $c(e,t,n){return w.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):Ge(n)&&(n.current=i))},[t])}const $i=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Oc="framerAppearId",Dr="data-"+$i(Oc),Fr=w.createContext({});function zc(e,t,n,i,s){const{visualElement:o}=w.useContext(Xt),r=w.useContext(Sr),a=w.useContext(qt),l=w.useContext(Ei).reducedMotion,c=w.useRef(null);i=i||r.renderer,!c.current&&i&&(c.current=i(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=w.useContext(Fr);u&&!u.projection&&s&&(u.type==="html"||u.type==="svg")&&Bc(c.current,n,s,d);const f=w.useRef(!1);w.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const h=n[Dr],p=w.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return Eo(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),p.current&&u.animationState&&u.animationState.animateChanges())}),w.useEffect(()=>{u&&(!p.current&&u.animationState&&u.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),p.current=!1),u.enteringChildren=void 0)}),u}function Bc(e,t,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:kr(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!r||a&&Ge(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:c})}function kr(e){if(e)return e.options.allowProjection!==!1?e.projection:kr(e.parent)}function mn(e,{forwardMotionProps:t=!1}={},n,i){n&&gc(n);const s=Ii(e)?Lc:Ic;function o(a,l){let c;const u={...w.useContext(Ei),...a,layoutId:Nc(a)},{isStatic:d}=u,f=xc(a),h=s(a,d);if(!d&&li){Hc(u,n);const p=Gc(u);c=p.MeasureLayout,f.visualElement=zc(e,h,u,i,p.ProjectionNode)}return m.jsxs(Xt.Provider,{value:f,children:[c&&f.visualElement?m.jsx(c,{visualElement:f.visualElement,...u}):null,Dc(e,a,$c(h,f.visualElement,l),h,d,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const r=w.forwardRef(o);return r[jc]=e,r}function Nc({layoutId:e}){const t=w.useContext(ri).id;return t&&e!==void 0?t+"-"+e:e}function Hc(e,t){const n=w.useContext(Sr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const i="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Je(!1,i,"lazy-strict-mode"):Se(!1,i,"lazy-strict-mode")}}function Gc(e){const{drag:t,layout:n}=Ye;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Wc(e,t){if(typeof Proxy>"u")return mn;const n=new Map,i=(o,r)=>mn(o,r,e,t),s=(o,r)=>(process.env.NODE_ENV!=="production"&&hi(!1,"motion() is deprecated. Use motion.create() instead."),i(o,r));return new Proxy(s,{get:(o,r)=>r==="create"?i:(n.has(r)||n.set(r,mn(r,void 0,e,t)),n.get(r))})}function Ir({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function Uc({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Kc(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function vn(e){return e===void 0||e===1}function Kn({scale:e,scaleX:t,scaleY:n}){return!vn(e)||!vn(t)||!vn(n)}function ke(e){return Kn(e)||Lr(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Lr(e){return Rs(e.x)||Rs(e.y)}function Rs(e){return e&&e!=="0%"}function Gt(e,t,n){const i=e-n,s=t*i;return n+s}function Ms(e,t,n,i,s){return s!==void 0&&(e=Gt(e,s,i)),Gt(e,n,i)+t}function qn(e,t=0,n=1,i,s){e.min=Ms(e.min,t,n,i,s),e.max=Ms(e.max,t,n,i,s)}function jr(e,{x:t,y:n}){qn(e.x,t.translate,t.scale,t.originPoint),qn(e.y,n.translate,n.scale,n.originPoint)}const Ps=.999999999999,Ts=1.0000000000001;function qc(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,r;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ue(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(t.x*=r.x.scale,t.y*=r.y.scale,jr(e,r)),i&&ke(o.latestValues)&&Ue(e,o.latestValues))}t.x<Ts&&t.x>Ps&&(t.x=1),t.y<Ts&&t.y>Ps&&(t.y=1)}function We(e,t){e.min=e.min+t,e.max=e.max+t}function Vs(e,t,n,i,s=.5){const o=G(e.min,e.max,s);qn(e,t,n,o,i)}function Ue(e,t){Vs(e.x,t.x,t.scaleX,t.scale,t.originX),Vs(e.y,t.y,t.scaleY,t.scale,t.originY)}function $r(e,t){return Ir(Kc(e.getBoundingClientRect(),t))}function Xc(e,t,n){const i=$r(e,n),{scroll:s}=t;return s&&(We(i.x,s.offset.x),We(i.y,s.offset.y)),i}const Es=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ke=()=>({x:Es(),y:Es()}),As=()=>({min:0,max:0}),U=()=>({x:As(),y:As()}),Xn={current:null},Or={current:!1};function Yc(){if(Or.current=!0,!!li)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Xn.current=e.matches;e.addEventListener("change",t),t()}else Xn.current=!1}const Zc=new WeakMap;function Jc(e,t,n){for(const i in t){const s=t[i],o=n[i];if(ee(s))e.addValue(i,s);else if(ee(o))e.addValue(i,Xe(s,{owner:e}));else if(o!==s)if(e.hasValue(i)){const r=e.getValue(i);r.liveStyle===!0?r.jump(s):r.hasAnimated||r.set(s)}else{const r=e.getStaticValue(i);e.addValue(i,Xe(r!==void 0?r:s,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const Ds=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Qc{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ri,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 f=re.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,N.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Zt(n),this.isVariantNode=br(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const h=d[f];l[f]!==void 0&&ee(h)&&h.set(l[f])}}mount(t){this.current=t,Zc.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,i)=>this.bindToMotionValue(i,n)),Or.current||Yc(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Xn.current,process.env.NODE_ENV!=="production"&&hi(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Te(this.notifyUpdate),Te(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(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}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=tt.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",r=>{this.latestValues[t]=r,this.props.onUpdate&&N.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),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 Ye){const n=Ye[t];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):U()}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 i=0;i<Ds.length;i++){const s=Ds[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,r=t[o];r&&(this.propEventSubscriptions[s]=this.on(s,r))}this.prevMotionValues=Jc(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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 i=this.values.get(t);n!==i&&(i&&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 i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Xe(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Ao(i)||Fo(i))?i=parseFloat(i):!rc(i)&&Ve.test(n)&&(i=gr(t,n)),this.setBaseTarget(t,ee(i)?i.get():i)),ee(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=Li(this.props,n,this.presenceContext?.custom);o&&(i=o[t])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!ee(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new fi),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Ti.render(this.render)}}class zr extends Qc{constructor(){super(...arguments),this.KeyframeResolver=qu}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:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ee(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Br(e,{style:t,vars:n},i,s){const o=e.style;let r;for(r in t)o[r]=t[r];s?.applyProjectionStyles(o,i);for(r in n)o.setProperty(r,n[r])}function ed(e){return window.getComputedStyle(e)}class td extends zr{constructor(){super(...arguments),this.type="html",this.renderInstance=Br}readValueFromInstance(t,n){if(tt.has(n))return this.projection?.isProjecting?zn(n):fu(t,n);{const i=ed(t),s=(mi(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return $r(t,n)}build(t,n,i){Fi(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return ji(t,n,i)}}const Nr=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 nd(e,t,n,i){Br(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(Nr.has(s)?s:$i(s),t.attrs[s])}class id extends zr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=U}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(tt.has(n)){const i=hr(n);return i&&i.default||0}return n=Nr.has(n)?n:$i(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return Ar(t,n,i)}build(t,n,i){Pr(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,s){nd(t,n,i,s)}mount(t){this.isSVGTag=Vr(t.tagName),super.mount(t)}}const sd=(e,t)=>Ii(e)?new id(t):new td(t,{allowProjection:e!==w.Fragment});function qe(e,t,n){const i=e.getProps();return Li(i,t,n!==void 0?n:i.custom,e)}const Yn=e=>Array.isArray(e);function od(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xe(n))}function rd(e){return Yn(e)?e[e.length-1]||0:e}function ad(e,t){const n=qe(e,t);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const r in o){const a=rd(o[r]);od(e,r,a)}}function ld(e){return!!(ee(e)&&e.add)}function Zn(e,t){const n=e.getValue("willChange");if(ld(n))return n.add(t);if(!n&&_e.WillChange){const i=new _e.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function Hr(e){return e.props[Dr]}const ud=e=>e!==null;function cd(e,{repeat:t,repeatType:n="loop"},i){const s=e.filter(ud),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const dd={type:"spring",stiffness:500,damping:25,restSpeed:10},fd=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),hd={type:"keyframes",duration:.8},gd={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},pd=(e,{keyframes:t})=>t.length>2?hd:tt.has(e)?e.startsWith("scale")?fd(t[1]):dd:gd;function md({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Oi=(e,t,n,i={},s,o)=>r=>{const a=Mi(i,e)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-me(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:s};md(a)||Object.assign(u,pd(e,u)),u.duration&&(u.duration=me(u.duration)),u.repeatDelay&&(u.repeatDelay=me(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Wn(u),u.delay===0&&(d=!0)),(_e.instantAnimations||_e.skipAnimations)&&(d=!0,Wn(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!o&&t.get()!==void 0){const f=cd(u.keyframes,a);if(f!==void 0){N.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new bi(u):new Iu(u)};function vd({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function Gr(e,t,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:r,...a}=t;i&&(o=i);const l=[],c=s&&e.animationState&&e.animationState.getState()[s];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||c&&vd(c,u))continue;const h={delay:n,...Mi(o||{},u)},p=d.get();if(p!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===p&&!h.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const v=Hr(e);if(v){const C=window.MotionHandoffAnimation(v,u,N);C!==null&&(h.startTime=C,g=!0)}}Zn(e,u),d.start(Oi(u,d,f,e.shouldReduceMotion&&cr.has(u)?{type:!1}:h,e,g));const x=d.animation;x&&l.push(x)}return r&&Promise.all(l).then(()=>{N.update(()=>{r&&ad(e,r)})}),l}function Wr(e,t,n,i=0,s=1){const o=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),r=e.size,a=(r-1)*i;return typeof n=="function"?n(o,r):s===1?o*i:a-o*i}function Jn(e,t,n={}){const i=qe(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(Gr(e,i,n)):()=>Promise.resolve(),r=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=s;return yd(e,t,l,c,u,d,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[o,r]:[r,o];return l().then(()=>c())}else return Promise.all([o(),r(n.delay)])}function yd(e,t,n=0,i=0,s=0,o=1,r){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Jn(l,t,{...r,delay:n+(typeof i=="function"?0:i)+Wr(e.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function xd(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(o=>Jn(e,o,n));i=Promise.all(s)}else if(typeof t=="string")i=Jn(e,t,n);else{const s=typeof t=="function"?qe(e,t,n.custom):t;i=Promise.all(Gr(e,s,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}function Ur(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}const wd=Di.length;function Kr(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Kr(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<wd;n++){const i=Di[n],s=e.props[i];(yt(s)||s===!1)&&(t[i]=s)}return t}const Cd=[...Ai].reverse(),Sd=Ai.length;function _d(e){return t=>Promise.all(t.map(({animation:n,options:i})=>xd(e,n,i)))}function bd(e){let t=_d(e),n=Fs(),i=!0;const s=l=>(c,u)=>{const d=qe(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(d){const{transition:f,transitionEnd:h,...p}=d;c={...c,...p,...h}}return c};function o(l){t=l(e)}function r(l){const{props:c}=e,u=Kr(e.parent)||{},d=[],f=new Set;let h={},p=1/0;for(let x=0;x<Sd;x++){const v=Cd[x],C=n[v],y=c[v]!==void 0?c[v]:u[v],S=yt(y),_=v===l?C.isActive:null;_===!1&&(p=x);let b=y===u[v]&&y!==c[v]&&S;if(b&&i&&e.manuallyAnimateOnMount&&(b=!1),C.protectedKeys={...h},!C.isActive&&_===null||!y&&!C.prevProp||Yt(y)||typeof y=="boolean")continue;const T=Rd(C.prevProp,y);let R=T||v===l&&C.isActive&&!b&&S||x>p&&S,k=!1;const F=Array.isArray(y)?y:[y];let O=F.reduce(s(v),{});_===!1&&(O={});const{prevResolvedValues:X={}}=C,te={...X,...O},se=$=>{R=!0,f.has($)&&(k=!0,f.delete($)),C.needsAnimating[$]=!0;const W=e.getValue($);W&&(W.liveStyle=!1)};for(const $ in te){const W=O[$],Z=X[$];if(h.hasOwnProperty($))continue;let I=!1;Yn(W)&&Yn(Z)?I=!Ur(W,Z):I=W!==Z,I?W!=null?se($):f.add($):W!==void 0&&f.has($)?se($):C.protectedKeys[$]=!0}C.prevProp=y,C.prevResolvedValues=O,C.isActive&&(h={...h,...O}),i&&e.blockInitialAnimation&&(R=!1);const ae=b&&T;R&&(!ae||k)&&d.push(...F.map($=>{const W={type:v};if(typeof $=="string"&&i&&!ae&&e.manuallyAnimateOnMount&&e.parent){const{parent:Z}=e,I=qe(Z,$);if(Z.enteringChildren&&I){const{delayChildren:B}=I.transition||{};W.delay=Wr(Z.enteringChildren,e,B)}}return{animation:$,options:W}}))}if(f.size){const x={};if(typeof c.initial!="boolean"){const v=qe(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(x.transition=v.transition)}f.forEach(v=>{const C=e.getBaseTarget(v),y=e.getValue(v);y&&(y.liveStyle=!0),x[v]=C??null}),d.push({animation:x})}let g=!!d.length;return i&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(g=!1),i=!1,g?t(d):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(d=>d.animationState?.setActive(l,c)),n[l].isActive=c;const u=r(l);for(const d in n)n[d].protectedKeys={};return u}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Fs(),i=!0}}}function Rd(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ur(t,e):!1}function Fe(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Fs(){return{animate:Fe(!0),whileInView:Fe(),whileHover:Fe(),whileTap:Fe(),whileDrag:Fe(),whileFocus:Fe(),exit:Fe()}}class Ae{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Md extends Ae{constructor(t){super(t),t.animationState||(t.animationState=bd(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Yt(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(){this.node.animationState.reset(),this.unmountControls?.()}}let Pd=0;class Td extends Ae{constructor(){super(...arguments),this.id=Pd++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)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 Vd={animation:{Feature:Md},exit:{Feature:Td}};function wt(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function bt(e){return{point:{x:e.pageX,y:e.pageY}}}const Ed=e=>t=>Vi(t)&&e(t,bt(t));function ut(e,t,n,i){return wt(e,t,Ed(n),i)}const qr=1e-4,Ad=1-qr,Dd=1+qr,Xr=.01,Fd=0-Xr,kd=0+Xr;function ie(e){return e.max-e.min}function Id(e,t,n){return Math.abs(e-t)<=n}function ks(e,t,n,i=.5){e.origin=i,e.originPoint=G(t.min,t.max,e.origin),e.scale=ie(n)/ie(t),e.translate=G(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Ad&&e.scale<=Dd||isNaN(e.scale))&&(e.scale=1),(e.translate>=Fd&&e.translate<=kd||isNaN(e.translate))&&(e.translate=0)}function ct(e,t,n,i){ks(e.x,t.x,n.x,i?i.originX:void 0),ks(e.y,t.y,n.y,i?i.originY:void 0)}function Is(e,t,n){e.min=n.min+t.min,e.max=e.min+ie(t)}function Ld(e,t,n){Is(e.x,t.x,n.x),Is(e.y,t.y,n.y)}function Ls(e,t,n){e.min=t.min-n.min,e.max=e.min+ie(t)}function dt(e,t,n){Ls(e.x,t.x,n.x),Ls(e.y,t.y,n.y)}function de(e){return[e("x"),e("y")]}const Yr=({current:e})=>e?e.ownerDocument.defaultView:null,js=(e,t)=>Math.abs(e-t);function jd(e,t){const n=js(e.x,t.x),i=js(e.y,t.y);return Math.sqrt(n**2+i**2)}class Zr{constructor(t,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=xn(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=jd(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!p)return;const{point:g}=f,{timestamp:x}=J;this.history.push({...g,timestamp:x});const{onStart:v,onMove:C}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=yn(h,this.transformPagePoint),N.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=xn(f.type==="pointercancel"?this.lastMoveEventInfo:yn(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,v),g&&g(f,v)},!Vi(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=r,this.contextWindow=s||window;const a=bt(t),l=yn(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=J;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,xn(l,this.history)),this.removeListeners=Ct(ut(this.contextWindow,"pointermove",this.handlePointerMove),ut(this.contextWindow,"pointerup",this.handlePointerUp),ut(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Te(this.updatePoint)}}function yn(e,t){return t?{point:t(e.point)}:e}function $s(e,t){return{x:e.x-t.x,y:e.y-t.y}}function xn({point:e},t){return{point:e,delta:$s(e,Jr(t)),offset:$s(e,$d(t)),velocity:Od(t,.1)}}function $d(e){return e[0]}function Jr(e){return e[e.length-1]}function Od(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=Jr(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>me(t)));)n--;if(!i)return{x:0,y:0};const o=fe(s.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function zd(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?G(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?G(n,e,i.max):Math.min(e,n)),e}function Os(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 Bd(e,{top:t,left:n,bottom:i,right:s}){return{x:Os(e.x,n,s),y:Os(e.y,t,i)}}function zs(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}function Nd(e,t){return{x:zs(e.x,t.x),y:zs(e.y,t.y)}}function Hd(e,t){let n=.5;const i=ie(e),s=ie(t);return s>i?n=pt(t.min,t.max-i,e.min):i>s&&(n=pt(e.min,e.max-s,t.min)),Ce(0,1,n)}function Gd(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 Qn=.35;function Wd(e=Qn){return e===!1?e=0:e===!0&&(e=Qn),{x:Bs(e,"left","right"),y:Bs(e,"top","bottom")}}function Bs(e,t,n){return{min:Ns(e,t),max:Ns(e,n)}}function Ns(e,t){return typeof e=="number"?e:e[t]||0}const Ud=new WeakMap;class Kd{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=U(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(bt(d).point)},r=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ju(h),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),de(v=>{let C=this.getAxisMotionValue(v).get()||0;if(ye.test(C)){const{projection:y}=this.visualElement;if(y&&y.layout){const S=y.layout.layoutBox[v];S&&(C=ie(S)*(parseFloat(C)/100))}}this.originPoint[v]=C}),g&&N.postRender(()=>g(d,f)),Zn(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:g,onDrag:x}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(p&&this.currentDirection===null){this.currentDirection=qd(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),x&&x(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>de(d=>this.getAnimationState(d)==="paused"&&this.getAxisMotionValue(d).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Zr(t,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:i,contextWindow:Yr(this.visualElement)})}stop(t,n){const i=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!i)return;const{velocity:r}=s;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&N.postRender(()=>a(i,s))}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:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!Et(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=zd(r,this.constraints[t],this.elastic[t])),o.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&Ge(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=Bd(i.layoutBox,t):this.constraints=!1,this.elastic=Wd(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&de(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Gd(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ge(t))return!1;const i=t.current;Se(i!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=Xc(i,s.root,this.visualElement.getTransformPagePoint());let r=Nd(s.layout.layoutBox,o);if(n){const a=n(Uc(r));this.hasMutatedConstraints=!!a,a&&(r=Ir(a))}return r}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=de(u=>{if(!Et(u,n,this.currentDirection))return;let d=l&&l[u]||{};r&&(d={min:0,max:0});const f=s?200:1e6,h=s?40:1e7,p={type:"inertia",velocity:i?t[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return Zn(this.visualElement,t),i.start(Oi(t,i,0,n,this.visualElement,!1))}stopAnimation(){de(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){de(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){de(n=>{const{drag:i}=this.getProps();if(!Et(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:r,max:a}=s.layout.layoutBox[n];o.set(t[n]-G(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Ge(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};de(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();s[r]=Hd({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),de(r=>{if(!Et(r,t,null))return;const a=this.getAxisMotionValue(r),{min:l,max:c}=this.constraints[r];a.set(G(l,c,s[r]))})}addListeners(){if(!this.visualElement.current)return;Ud.set(this.visualElement,this);const t=this.visualElement.current,n=ut(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Ge(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),N.read(i);const r=wt(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(de(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())}));return()=>{r(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:r=Qn,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Et(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function qd(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Xd extends Ae{constructor(t){super(t),this.removeGroupControls=he,this.removeListeners=he,this.controls=new Kd(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||he}unmount(){this.removeGroupControls(),this.removeListeners()}}const Hs=e=>(t,n)=>{e&&N.postRender(()=>e(t,n))};class Yd extends Ae{constructor(){super(...arguments),this.removePointerDownListener=he}onPointerDown(t){this.session=new Zr(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Yr(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:Hs(t),onStart:Hs(n),onMove:i,onEnd:(o,r)=>{delete this.session,s&&N.postRender(()=>s(o,r))}}}mount(){this.removePointerDownListener=ut(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 $t={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Gs(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const st={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(D.test(e))e=parseFloat(e);else return e;const n=Gs(e,t.target.x),i=Gs(e,t.target.y);return`${n}% ${i}%`}},Zd={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=Ve.parse(e);if(s.length>5)return i;const o=Ve.createTransformer(e),r=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+r]/=a,s[1+r]/=l;const c=G(a,l,.5);return typeof s[2+r]=="number"&&(s[2+r]/=c),typeof s[3+r]=="number"&&(s[3+r]/=c),o(s)}};let wn=!1;class Jd extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:o}=t;wc(Qd),o&&(n.group&&n.group.add(o),i&&i.register&&s&&i.register(o),wn&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),$t.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:o}=this.props,{projection:r}=i;return r&&(r.isPresent=o,wn=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||N.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ti.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;wn=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Qr(e){const[t,n]=Cr(),i=w.useContext(ri);return m.jsx(Jd,{...e,layoutGroup:i,switchLayoutGroup:w.useContext(Fr),isPresent:t,safeToRemove:n})}const Qd={borderRadius:{...st,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomLeftRadius:st,borderBottomRightRadius:st,boxShadow:Zd};function ef(e,t,n){const i=ee(e)?e:Xe(e);return i.start(Oi("",i,t,n)),i.animation}const tf=(e,t)=>e.depth-t.depth;class nf{constructor(){this.children=[],this.isDirty=!1}add(t){ui(this.children,t),this.isDirty=!0}remove(t){ci(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tf),this.isDirty=!1,this.children.forEach(t)}}function sf(e,t){const n=re.now(),i=({timestamp:s})=>{const o=s-n;o>=t&&(Te(i),e(o-t))};return N.setup(i,!0),()=>Te(i)}const ea=["TopLeft","TopRight","BottomLeft","BottomRight"],of=ea.length,Ws=e=>typeof e=="string"?parseFloat(e):e,Us=e=>typeof e=="number"||D.test(e);function rf(e,t,n,i,s,o){s?(e.opacity=G(0,n.opacity??1,af(i)),e.opacityExit=G(t.opacity??1,0,lf(i))):o&&(e.opacity=G(t.opacity??1,n.opacity??1,i));for(let r=0;r<of;r++){const a=`border${ea[r]}Radius`;let l=Ks(t,a),c=Ks(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Us(l)===Us(c)?(e[a]=Math.max(G(Ws(l),Ws(c),i),0),(ye.test(c)||ye.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=G(t.rotate||0,n.rotate||0,i))}function Ks(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const af=ta(0,.5,Bo),lf=ta(.5,.95,he);function ta(e,t,n){return i=>i<e?0:i>t?1:n(pt(e,t,i))}function qs(e,t){e.min=t.min,e.max=t.max}function ue(e,t){qs(e.x,t.x),qs(e.y,t.y)}function Xs(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ys(e,t,n,i,s){return e-=t,e=Gt(e,1/n,i),s!==void 0&&(e=Gt(e,1/s,i)),e}function uf(e,t=0,n=1,i=.5,s,o=e,r=e){if(ye.test(t)&&(t=parseFloat(t),t=G(r.min,r.max,t/100)-r.min),typeof t!="number")return;let a=G(o.min,o.max,i);e===o&&(a-=t),e.min=Ys(e.min,t,n,a,s),e.max=Ys(e.max,t,n,a,s)}function Zs(e,t,[n,i,s],o,r){uf(e,t[n],t[i],t[s],t.scale,o,r)}const cf=["x","scaleX","originX"],df=["y","scaleY","originY"];function Js(e,t,n,i){Zs(e.x,t,cf,n?n.x:void 0,i?i.x:void 0),Zs(e.y,t,df,n?n.y:void 0,i?i.y:void 0)}function Qs(e){return e.translate===0&&e.scale===1}function na(e){return Qs(e.x)&&Qs(e.y)}function eo(e,t){return e.min===t.min&&e.max===t.max}function ff(e,t){return eo(e.x,t.x)&&eo(e.y,t.y)}function to(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ia(e,t){return to(e.x,t.x)&&to(e.y,t.y)}function no(e){return ie(e.x)/ie(e.y)}function io(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class hf{constructor(){this.members=[]}add(t){ui(this.members,t),t.scheduleRender()}remove(t){if(ci(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 i;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){i=o;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function gf(e,t,n){let i="";const s=e.x.translate/t.x,o=e.y.translate/t.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:h,skewY:p}=n;c&&(i=`perspective(${c}px) ${i}`),u&&(i+=`rotate(${u}deg) `),d&&(i+=`rotateX(${d}deg) `),f&&(i+=`rotateY(${f}deg) `),h&&(i+=`skewX(${h}deg) `),p&&(i+=`skewY(${p}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const Cn=["","X","Y","Z"],pf=1e3;let mf=0;function Sn(e,t,n,i){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),i&&(i[e]=0))}function sa(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Hr(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",N,!(s||o))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&sa(i)}function oa({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(r={},a=t?.()){this.id=mf++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(xf),this.nodes.forEach(_f),this.nodes.forEach(bf),this.nodes.forEach(wf)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,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 nf)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new fi),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=wr(r)&&!sc(r),this.instance=r;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const f=()=>this.root.updateBlockedByResize=!1;N.read(()=>{d=window.innerWidth}),e(r,()=>{const h=window.innerWidth;h!==d&&(d=h,this.root.updateBlockedByResize=!0,u&&u(),u=sf(f,250),$t.hasAnimatedSinceResize&&($t.hasAnimatedSinceResize=!1,this.nodes.forEach(ro)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||Vf,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=c.getProps(),v=!this.targetLayout||!ia(this.targetLayout,h),C=!d&&f;if(this.options.layoutRoot||this.resumeFrom||C||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...Mi(p,"layout"),onPlay:g,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(u,C)}else d||ro(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Te(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:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(so);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(oo);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Sf),this.nodes.forEach(vf),this.nodes.forEach(yf)):this.nodes.forEach(oo),this.clearAllSnapshots();const a=re.now();J.delta=Ce(0,1e3/60,a-J.timestamp),J.timestamp=a,J.isProcessing=!0,cn.update.process(J),cn.preRender.process(J),cn.render.process(J),J.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ti.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Cf),this.sharedNodes.forEach(Mf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,N.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){N.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ie(this.snapshot.measuredBox.x)&&!ie(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 r=this.layout;this.layout=this.measure(!1),this.layoutCorrected=U(),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,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const l=i(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!na(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;r&&this.instance&&(a||ke(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),Ef(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return U();const a=r.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Af))){const{scroll:c}=this.root;c&&(We(a.x,c.offset.x),We(a.y,c.offset.y))}return a}removeElementScroll(r){const a=U();if(ue(a,r),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:d}=c;c!==this.root&&u&&d.layoutScroll&&(u.wasRoot&&ue(a,r),We(a.x,u.offset.x),We(a.y,u.offset.y))}return a}applyTransform(r,a=!1){const l=U();ue(l,r);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ue(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),ke(u.latestValues)&&Ue(l,u.latestValues)}return ke(this.latestValues)&&Ue(l,this.latestValues),l}removeTransform(r){const a=U();ue(a,r);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!ke(c.latestValues))continue;Kn(c.latestValues)&&c.updateSnapshot();const u=U(),d=c.measurePageBox();ue(u,d),Js(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return ke(this.latestValues)&&Js(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.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!==J.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=J.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=U(),this.relativeTargetOrigin=U(),dt(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),ue(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=U(),this.targetWithTransforms=U()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ld(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ue(this.target,this.layout.layoutBox),jr(this.target,this.targetDelta)):ue(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=U(),this.relativeTargetOrigin=U(),dt(this.relativeTargetOrigin,this.target,f.target),ue(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Kn(this.parent.latestValues)||Lr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===J.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;ue(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;qc(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=U());const{target:h}=r;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Xs(this.prevProjectionDelta.x,this.projectionDelta.x),Xs(this.prevProjectionDelta.y,this.projectionDelta.y)),ct(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!io(this.projectionDelta.x,this.prevProjectionDelta.x)||!io(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.visualElement?.scheduleRender(),r){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ke(),this.projectionDelta=Ke(),this.projectionDeltaWithTransform=Ke()}setAnimationOrigin(r,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=Ke();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=U(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=h!==p,x=this.getStack(),v=!x||x.members.length<=1,C=!!(g&&!v&&this.options.crossfade===!0&&!this.path.some(Tf));this.animationProgress=0;let y;this.mixTargetDelta=S=>{const _=S/1e3;ao(d.x,r.x,_),ao(d.y,r.y,_),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(dt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Pf(this.relativeTarget,this.relativeTargetOrigin,f,_),y&&ff(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=U()),ue(y,this.relativeTarget)),g&&(this.animationValues=u,rf(u,c,this.latestValues,_,C,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Te(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=N.update(()=>{$t.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Xe(0)),this.currentAnimation=ef(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.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 r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(pf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=r;if(!(!a||!l||!c)){if(this!==r&&this.layout&&c&&ra(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||U();const d=ie(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+d;const f=ie(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}ue(a,l),Ue(a,u),ct(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new hf),this.sharedNodes.get(r).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){const{layoutId:r}=this.options;return r?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:r}=this.options;return r?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Sn("z",r,c,this.animationValues);for(let u=0;u<Cn.length;u++)Sn(`rotate${Cn[u]}`,r,c,this.animationValues),Sn(`skew${Cn[u]}`,r,c,this.animationValues);r.render();for(const u in c)r.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=jt(a?.pointerEvents)||"",r.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=jt(a?.pointerEvents)||""),this.hasProjected&&!ke(this.latestValues)&&(r.transform=l?l({},""):"none",this.hasProjected=!1);return}r.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=gf(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),r.transform=d;const{x:f,y:h}=this.projectionDelta;r.transformOrigin=`${f.origin*100}% ${h.origin*100}% 0`,c.animationValues?r.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:r.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const p in xt){if(u[p]===void 0)continue;const{correct:g,applyTo:x,isCSSVariable:v}=xt[p],C=d==="none"?u[p]:g(u[p],c);if(x){const y=x.length;for(let S=0;S<y;S++)r[x[S]]=C}else v?this.options.visualElement.renderState.vars[p]=C:r[p]=C}this.options.layoutId&&(r.pointerEvents=c===this?jt(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>r.currentAnimation?.stop()),this.root.nodes.forEach(so),this.root.sharedNodes.clear()}}}function vf(e){e.updateLayout()}function yf(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?de(u=>{const d=o?t.measuredBox[u]:t.layoutBox[u],f=ie(d);d.min=n[u].min,d.max=d.min+f}):ra(s,t.layoutBox,n)&&de(u=>{const d=o?t.measuredBox[u]:t.layoutBox[u],f=ie(n[u]);d.max=d.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+f)});const r=Ke();ct(r,n,t.layoutBox);const a=Ke();o?ct(a,e.applyTransform(i,!0),t.measuredBox):ct(a,n,t.layoutBox);const l=!na(r);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:d,layout:f}=u;if(d&&f){const h=U();dt(h,t.layoutBox,d.layoutBox);const p=U();dt(p,n,f.layoutBox),ia(h,p)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=h,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function xf(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function wf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Cf(e){e.clearSnapshot()}function so(e){e.clearMeasurements()}function oo(e){e.isLayoutDirty=!1}function Sf(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ro(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function _f(e){e.resolveTargetDelta()}function bf(e){e.calcProjection()}function Rf(e){e.resetSkewAndRotation()}function Mf(e){e.removeLeadSnapshot()}function ao(e,t,n){e.translate=G(t.translate,0,n),e.scale=G(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function lo(e,t,n,i){e.min=G(t.min,n.min,i),e.max=G(t.max,n.max,i)}function Pf(e,t,n,i){lo(e.x,t.x,n.x,i),lo(e.y,t.y,n.y,i)}function Tf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Vf={duration:.45,ease:[.4,0,.1,1]},uo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),co=uo("applewebkit/")&&!uo("chrome/")?Math.round:he;function fo(e){e.min=co(e.min),e.max=co(e.max)}function Ef(e){fo(e.x),fo(e.y)}function ra(e,t,n){return e==="position"||e==="preserve-aspect"&&!Id(no(t),no(n),.2)}function Af(e){return e!==e.root&&e.scroll?.wasRoot}const Df=oa({attachResizeListener:(e,t)=>wt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),_n={current:void 0},aa=oa({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_n.current){const e=new Df({});e.mount(window),e.setOptions({layoutScroll:!0}),_n.current=e}return _n.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ff={pan:{Feature:Yd},drag:{Feature:Xd,ProjectionNode:aa,MeasureLayout:Qr}};function ho(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=i[s];o&&N.postRender(()=>o(t,bt(t)))}class kf extends Ae{mount(){const{current:t}=this.node;t&&(this.unmount=Qu(t,(n,i)=>(ho(this.node,i,"Start"),s=>ho(this.node,s,"End"))))}unmount(){}}class If extends Ae{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=Ct(wt(this.node.current,"focus",()=>this.onFocus()),wt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function go(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=i[s];o&&N.postRender(()=>o(t,bt(t)))}class Lf extends Ae{mount(){const{current:t}=this.node;t&&(this.unmount=ic(t,(n,i)=>(go(this.node,i,"Start"),(s,{success:o})=>go(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ei=new WeakMap,bn=new WeakMap,jf=e=>{const t=ei.get(e.target);t&&t(e)},$f=e=>{e.forEach(jf)};function Of({root:e,...t}){const n=e||document;bn.has(n)||bn.set(n,{});const i=bn.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver($f,{root:e,...t})),i[s]}function zf(e,t,n){const i=Of(t);return ei.set(e,n),i.observe(e),()=>{ei.delete(e),i.unobserve(e)}}const Bf={some:0,all:1};class Nf extends Ae{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:o}=t,r={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:Bf[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return zf(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Hf(t,n))&&this.startObserver()}unmount(){}}function Hf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Gf={inView:{Feature:Nf},tap:{Feature:Lf},focus:{Feature:If},hover:{Feature:kf}},Wf={layout:{ProjectionNode:aa,MeasureLayout:Qr}},Uf={...Vd,...Gf,...Ff,...Wf},zi=Wc(Uf,sd),Kf="_primary_13825_8",qf="_secondary_13825_12",Xf="_tertiary_13825_16",Yf="_positive_13825_20",Zf="_negative_13825_24",Jf="_warning_13825_28",Qf="_accent_13825_32",eh="_inverse_13825_36",th="_text_13825_111",nh="_regular_13825_117",ih="_medium_13825_121",sh="_semibold_13825_125",oh="_bold_13825_129",At={primary:Kf,secondary:qf,tertiary:Xf,positive:Yf,negative:Zf,warning:Jf,accent:Qf,inverse:eh,"title-1":"_title-1_13825_41","title-2":"_title-2_13825_51","title-3":"_title-3_13825_61","headline-1":"_headline-1_13825_76","headline-2":"_headline-2_13825_81","headline-3":"_headline-3_13825_86","body-1":"_body-1_13825_91","body-2":"_body-2_13825_96","caption-1":"_caption-1_13825_101","caption-2":"_caption-2_13825_106",text:th,regular:nh,medium:ih,semibold:sh,bold:oh},rh=e=>{let t;e.center?t="center":e.left?t="left":e.right&&(t="right");let n;return e.uppercase?n="uppercase":e.lowercase?n="lowercase":e.capitalize&&(n="capitalize"),P.css({marginTop:e.mt,marginBottom:e.mb,marginRight:e.mr,marginLeft:e.ml,flex:e.flex,cursor:e.cursor,wordBreak:e.wordBreak,whiteSpace:e.whiteSpace,textOverflow:e.textOverflow,textDecoration:e.decoration,textAlign:t,textTransform:n,color:e.color,opacity:e.disabled?.5:void 0,overflow:e.overflow})},j=w.forwardRef(({children:e,className:t,variant:n="body-1",fontWeight:i="medium",tag:s="p",colorName:o="primary",style:r,clickOpacity:a=.5,opacityDuration:l=200,onClick:c,disabled:u,mt:d,mb:f,ml:h,mr:p,flex:g,cursor:x,wordBreak:v,whiteSpace:C,textOverflow:y,decoration:S,color:_,center:b,left:T,right:R,uppercase:k,lowercase:F,capitalize:O,overflow:X,...te},se)=>{const[ae,ne]=w.useState(!1),$=!!c,W=()=>$&&ne(!0),Z=()=>$&&ne(!1),I=rh({mt:d,mb:f,ml:h,mr:p,flex:g,cursor:x,wordBreak:v,whiteSpace:C,textOverflow:y,decoration:S,color:_,center:b,left:T,right:R,uppercase:k,lowercase:F,capitalize:O,overflow:X}),B=s,K=$?P.css({opacity:ae?a:1,transition:`opacity ${l}ms ease`}):"";return m.jsx(B,{ref:se,...te,className:P.cx(At.text,At[n],At[o],At[i],K,t,I),style:r,onClick:c,onMouseDown:W,onMouseUp:Z,onMouseLeave:Z,onTouchStart:W,onTouchEnd:Z,role:$?"button":void 0,tabIndex:$?0:void 0,children:e})});j.displayName="Text";const Wt=zi(j),ah="_loader_1qleq_8",lh={loader:ah},uh=({color:e="var(--text-accent)"})=>m.jsx("span",{className:P.cx(lh.loader,P.css({"--loader-color":e}))}),ch=P.css({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",borderRadius:16,height:48,padding:"0 16px",cursor:"pointer",fontSize:16,fontWeight:600,overflow:"hidden",transition:"all 0.2s ease",gap:8}),ot={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)","full-round":"var(--corner-full-round)"},dh={xs:"var(--height-button-xs)",sm:"var(--height-button-sm)",md:"var(--height-button-md)",lg:"var(--height-button-lg)"},fh={clear:P.css({backgroundColor:"transparent",border:"none"}),filled:P.css({backgroundColor:"var(--fill-accent-primary)",color:"white",border:"none"}),outline:P.css({backgroundColor:"transparent",border:"1px solid var(--border-accent-primary)"})},hh=(e,t,n,i)=>{if(i)return P.css({cursor:"not-allowed",opacity:.7});const s={transition:"all 0.2s ease",borderRadius:"var(--corner-lg)",border:"none",color:e==="filled"?"var(--text-inverse)":`var(--text-${t})`};switch(e){case"filled":return P.css({...s,backgroundColor:`var(--fill-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${t}-${n}-hover)`}});case"outline":return P.css({...s,backgroundColor:"transparent",border:`1px solid var(--border-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});case"clear":return P.css({...s,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});default:return P.css(s)}},gh=({disabled:e,loading:t,onClick:n,wrapperClassName:i,buttonClassName:s,buttonDisabledClassName:o,textClassName:r,children:a,variant:l="filled",backgroundColor:c,textColor:u,textFontWeight:d,borderColor:f,color:h="accent",borderRadius:p,width:g="full",size:x="md",iconLeft:v,iconRight:C,intensity:y="primary",flex:S,..._})=>{const b=w.useMemo(()=>{switch(g){case"full":return"100%";case"auto":return"auto";default:return g}},[g]),T=w.useMemo(()=>c||(l==="filled"?h==="neutral"?"var(--fill-neutral-secondary)":`var(--fill-${h}-${y})`:"transparent"),[l,c,h,y]),R=w.useMemo(()=>{if(y==="primary"){if(h==="neutral")return"var(--text-secondary)";if(l==="filled")return"var(--text-inverse)"}else if(h==="neutral")return"var(--text-secondary)";return`var(--text-${h})`},[y,h,l]),k=w.useMemo(()=>{if(y==="primary"){if(h==="neutral")return"secondary";if(l==="filled")return"inverse"}else if(h==="neutral")return"secondary";return h},[l,h,y]),F=w.useMemo(()=>f||(l==="outline"?`var(--border-${h}-${y})`:"transparent"),[l,f,h,y]),O=w.useMemo(()=>{switch(x){case"lg":return ot.lg;case"md":case"sm":return ot.md;case"xs":return ot.sm;default:return ot.md}},[x]),X=P.cx(ch,hh(l,h,y,e),fh[l],s,e?o:void 0,P.css({borderRadius:p?ot[p]:O,backgroundColor:T,borderColor:F,color:u,width:"100%",height:dh[x],opacity:e?.7:1})),te=w.useMemo(()=>{switch(x){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[x]);return m.jsx(V,{className:P.cx(i),w:b,flex:S,relative:!0,overflow:"hidden",children:m.jsxs(zi.button,{whileTap:!e&&!t?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},className:X,disabled:e||t,onClick:n,..._,children:[t?m.jsx(uh,{color:R}):m.jsxs(m.Fragment,{children:[v,m.jsx(Wt,{style:{color:u},colorName:k,variant:te,className:r,textOverflow:"ellipsis",overflow:"hidden",children:a}),C]}),m.jsx(Ze,{})]})})},ph=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",...e},M.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),mh=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...e},M.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),vh="_checkbox_asmiz_8",yh="_disabled_asmiz_15",xh="_checkbox__ripple_asmiz_15",wh="_checkbox__input_asmiz_27",Ch="_checkbox__box_asmiz_35",Sh="_secondary_asmiz_48",_h="_checked_asmiz_54",bh="_error_asmiz_63",xe={checkbox:vh,disabled:yh,checkbox__ripple:xh,checkbox__input:wh,checkbox__box:Ch,secondary:Sh,checked:_h,error:bh},Rh={sm:20,md:24},Bi=w.forwardRef(({checked:e,onChange:t,disabled:n,error:i,indeterminate:s,size:o="md",title:r,titleColor:a,subtitle:l,subtitleColor:c="secondary",name:u,required:d,variant:f="primary",flex:h},p)=>{const[g,x]=w.useState(!1),v=e!==void 0,C=v?e:g,y=b=>{v||x(b.target.checked),t?.(b)},S=Rh[o],_=C||s;return m.jsxs("label",{className:P.cx(xe.checkbox,P.css({flex:h}),{[xe.disabled]:n}),children:[m.jsxs(V,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${S}px`,"--checkbox-size-double":`${S*2}px`},children:[m.jsx("input",{ref:p,type:"checkbox",checked:C,onChange:y,onClick:b=>b.stopPropagation(),disabled:n,name:u,required:d,className:P.cx(xe.checkbox__input,{[xe.disabled]:n})}),m.jsx("div",{className:P.cx(xe.checkbox__box,xe[f],{[xe.disabled]:n,[xe.error]:i,[xe.checked]:_}),children:_&&(s?m.jsx(mh,{width:S*.75,height:S*.75}):m.jsx(ph,{width:S*.75,height:S*.75}))})]}),(r||l)&&m.jsxs(V,{gap:4,children:[r&&m.jsx(j,{colorName:a,variant:o==="sm"?"body-2":"body-1",children:r}),l&&m.jsx(j,{variant:"body-2",colorName:c,children:l})]})]})});Bi.displayName="Checkbox";const Mh=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{opacity:.5},M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 17.9999C14.4185 17.9999 18.0002 14.4182 18.0002 9.99991C18.0002 5.58163 14.4185 1.99991 10.0002 1.99991C5.58197 1.99991 2.00024 5.58163 2.00024 9.99991C2.00024 14.4182 5.58197 17.9999 10.0002 17.9999ZM6.46514 6.46446C6.85566 6.07393 7.48883 6.07393 7.87935 6.46446L9.64712 8.23222C9.84238 8.42749 10.159 8.42749 10.3542 8.23222L12.122 6.46446C12.5125 6.07393 13.1457 6.07393 13.5362 6.46446C13.9267 6.85498 13.9267 7.48814 13.5362 7.87867L11.7684 9.64644C11.5732 9.8417 11.5732 10.1583 11.7684 10.3535L13.5362 12.1213C13.9267 12.5118 13.9267 13.145 13.5362 13.5355C13.1457 13.926 12.5125 13.926 12.122 13.5355L10.3542 11.7678C10.159 11.5725 9.84238 11.5725 9.64712 11.7678L7.87935 13.5355C7.48883 13.926 6.85566 13.926 6.46514 13.5355C6.07462 13.145 6.07462 12.5118 6.46514 12.1213L8.23291 10.3535C8.42817 10.1583 8.42817 9.8417 8.23291 9.64644L6.46514 7.87867C6.07462 7.48815 6.07462 6.85498 6.46514 6.46446Z",fill:"currentColor"}))),Ph="_disabled_ph9zm_20",Th="_multiline_ph9zm_24",Vh="_input_ph9zm_8",Eh="_sm_ph9zm_74",Ah="_md_ph9zm_79",Dh="_error_ph9zm_84",Fh="_white_ph9zm_88",kh="_gray_ph9zm_92",oe={"input-container":"_input-container_ph9zm_8",disabled:Ph,multiline:Th,input:Vh,"input-text-size_sm":"_input-text-size_sm_ph9zm_55","input-text-size_md":"_input-text-size_md_ph9zm_59","input-text-align_left":"_input-text-align_left_ph9zm_64","input-text-align_center":"_input-text-align_center_ph9zm_67","input-text-align_right":"_input-text-align_right_ph9zm_70",sm:Eh,md:Ah,error:Dh,white:Fh,gray:kh,"clear-button":"_clear-button_ph9zm_96"};function po(e){return{...new Event("input",{bubbles:!0}),target:e,currentTarget:e}}const la=w.forwardRef((e,t)=>{const{label:n,prompt:i,error:s,errorText:o,size:r="md",prefix:a,suffix:l,background:c="white",showClearButton:u,disabled:d,value:f,defaultValue:h,inputClassName:p,textAlign:g="left",...x}=e,v=e.multiline===!0,C=w.useRef(null),y=w.useRef(null),[S,_]=Ut(f!==void 0?String(f):void 0,h!==void 0?String(h):"");w.useImperativeHandle(t,()=>({focus:()=>{C.current?.focus(),y.current?.focus()},blur:()=>{C.current?.blur(),y.current?.blur()},get value(){return C.current?.value||y.current?.value}}));const b=k=>{if(_(k.target.value),v){const F=e.onChange;F?.(k)}else{const F=e.onChange;F?.(k)}};w.useEffect(()=>{v&&e.autoResize&&y.current&&(y.current.style.height="auto",y.current.style.height=`${y.current.scrollHeight}px`)},[S,v,e.autoResize]);const T=()=>{if(_(""),!v){const F=C.current;if(F){F.value="";const O=po(F),X=e.onChange;X?.(O)}return}const k=y.current;if(k){k.value="";const F=po(k),O=e.onChange;O?.(F)}},R=()=>{if(v){const{rows:X,autoResize:te,onChange:se,multiline:ae,...ne}=x;return m.jsx("textarea",{ref:y,rows:e.rows??3,className:P.cx(oe.input,p,{[oe.disabled]:d,[oe[`input-text-align_${g}`]]:!!g}),disabled:d,maxLength:e.maxLength,...ne,value:S,onChange:b})}const{onChange:k,multiline:F,...O}=x;return m.jsx("input",{...O,ref:C,className:P.cx(oe.input,oe[`input-text-size_${r}`],p,{[oe.disabled]:d,[oe[`input-text-align_${g}`]]:!!g}),disabled:d,type:e.type??"text",value:S,onChange:b})};return m.jsxs(V,{w:"full",gap:"var(--spacing-sm)",children:[n&&m.jsx(j,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",children:n}),m.jsxs(V,{row:!0,alignItems:v?"flex-start":"center",w:"full",gap:"var(--spacing-md)",className:P.cx(oe["input-container"],oe[c],oe[r],{[oe.error]:s,[oe.disabled]:d,[oe.multiline]:v}),children:[a&&m.jsx(V,{flex:"none",children:a}),m.jsx(V,{flex:"1",children:R()}),u&&S&&!d&&m.jsx(V,{flex:"none",children:m.jsx("span",{className:oe["clear-button"],onClick:T,children:m.jsx(Mh,{})})}),l&&m.jsx(V,{flex:"none",children:l})]}),(i||v)&&m.jsxs(V,{row:!0,gap:10,w:"full",children:[typeof i=="string"?m.jsx(j,{variant:"caption-1",colorName:"tertiary",children:i}):i,v&&e.maxLength&&m.jsx(j,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${S.length}/${e.maxLength}`})]}),o&&s&&m.jsx(j,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:o})]})});la.displayName="Input";const Ih=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M6 9L12 15L18 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Lh=e=>M.createElement("svg",{fill:"currentColor",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 462.035 462.035",xmlSpace:"preserve",...e},M.createElement("g",null,M.createElement("path",{d:"M457.83,158.441c-0.021-0.028-0.033-0.058-0.057-0.087l-50.184-62.48c-0.564-0.701-1.201-1.305-1.879-1.845 c-2.16-2.562-5.355-4.225-8.967-4.225H65.292c-3.615,0-6.804,1.661-8.965,4.225c-0.678,0.54-1.316,1.138-1.885,1.845l-50.178,62.48 c-0.023,0.029-0.034,0.059-0.057,0.087C1.655,160.602,0,163.787,0,167.39v193.07c0,6.5,5.27,11.771,11.77,11.771h438.496 c6.5,0,11.77-5.271,11.77-11.771V167.39C462.037,163.787,460.381,160.602,457.83,158.441z M408.516,134.615l16.873,21.005h-16.873 V134.615z M384.975,113.345v42.274H296.84c-2.514,0-4.955,0.805-6.979,2.293l-58.837,43.299l-58.849-43.305 c-2.023-1.482-4.466-2.287-6.978-2.287H77.061v-42.274H384.975z M53.523,155.62H36.65l16.873-21.005V155.62z M438.498,348.69H23.54 V179.16h137.796l62.711,46.148c4.15,3.046,9.805,3.052,13.954-0.005l62.698-46.144h137.799V348.69L438.498,348.69z"}))),jh="_avatar_1oe2p_8",$h="_avatar_primary_1oe2p_22",Oh="_avatar_secondary_1oe2p_25",zh="_avatar_negative_1oe2p_28",Bh="_avatar_positive_1oe2p_31",Nh="_avatar_warning_1oe2p_34",Hh="_avatar_lgSize_1oe2p_71",Gh="_avatar_mdSize_1oe2p_85",Wh="_avatar_smSize_1oe2p_99",Rn={avatar:jh,avatar_primary:$h,avatar_secondary:Oh,avatar_negative:zh,avatar_positive:Bh,avatar_warning:Nh,avatar_lgSize:Hh,avatar_mdSize:Gh,avatar_smSize:Wh};function Uh({attr:e,children:t,className:n,color:i="primary",size:s="md",...o}){const r="avatar";return m.jsx("div",{...e,...o,className:Ie(Rn[r],n,ht(Rn,r,s),Kt(Rn,r,i)),children:t})}const Kh=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.15}),M.createElement("path",{d:"M16 9L10.0337 15L8 12.9548",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),mo=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor",fillOpacity:.15}),M.createElement("path",{d:"M12 6C11.4477 6 11 6.44772 11 7V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V7C13 6.44772 12.5523 6 12 6Z",fill:"currentColor"}),M.createElement("path",{d:"M12 15C11.4477 15 11 15.4477 11 16V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16C13 15.4477 12.5523 15 12 15Z",fill:"currentColor"})),qh=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.12}),M.createElement("path",{d:"M16 8L8 16M16 16L8 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),Xh=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"black",...e},M.createElement("path",{d:"M12 2V22M19.0711 4.92893L4.92893 19.0711M22 12H2M19.0711 19.0711L4.92893 4.92893",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Yh="_hint_prca1_8",Zh="_md_prca1_19",Jh="_sm_prca1_24",Qh="_icon_prca1_29",eg="_content_prca1_40",tg="_title_prca1_46",ng="_subtitle_prca1_50",ig="_disabled_prca1_55",sg="_warning_prca1_60",og="_solid_prca1_60",rg="_negative_prca1_65",ag="_positive_prca1_70",lg="_accent_prca1_75",ug="_neutral_prca1_80",cg="_soft_prca1_85",ce={hint:Yh,md:Zh,sm:Jh,icon:Qh,content:eg,title:tg,subtitle:ng,disabled:ig,warning:sg,solid:og,negative:rg,positive:ag,accent:lg,neutral:ug,soft:cg},dg={negative:m.jsx(qh,{}),positive:m.jsx(Kh,{}),accent:m.jsx(mo,{}),warning:m.jsx(mo,{}),neutral:m.jsx(Xh,{})},fg=({title:e,subtitle:t,color:n="warning",variant:i="soft",size:s="md",icon:o,disabled:r=!1,className:a,style:l})=>{const c=o||dg[n];return m.jsxs("div",{className:Ie(ce.hint,ce[n],ce[i],ce[s],r&&ce.disabled,a),style:l,"aria-disabled":r,children:[c&&m.jsx("span",{className:Ie(ce.icon,ce[n]),children:c}),m.jsxs("div",{className:ce.content,children:[e&&m.jsx(j,{className:Ie(ce.title,ht(ce,"title",s)),variant:s==="md"?"body-1":"caption-2",children:e}),t&&m.jsx(j,{className:Ie(ce.subtitle,ht(ce,"subtitle",s)),variant:s==="md"?"body-2":"caption-1",children:t})]})]})},hg={primary:{bg:"var(--status-neutral-tint-low)",color:"var(--text-primary)"},accent:{bg:"var(--status-accent-tint-low)",color:"var(--text-accent)"},warning:{bg:"var(--status-warning-tint-low)",color:"var(--text-warning)"},positive:{bg:"var(--status-positive-tint-low)",color:"var(--text-positive)"},negative:{bg:"var(--status-negative-tint-low)",color:"var(--text-negative)"}},gg={sm:28,md:32,lg:40},Ni=w.forwardRef(({label:e,color:t="primary",size:n="md",onClick:i,onDelete:s,avatar:o,icon:r,disabled:a,className:l},c)=>{const u=w.useRef(null),d=hg[t],f=P.css({cursor:a?"not-allowed":i?"pointer":"default",opacity:a?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s","&:hover":a?void 0:{backgroundColor:d.bg}}),h=P.css({cursor:"pointer",opacity:.6,"&:hover":{opacity:1}});return m.jsxs(V,{ref:p=>{u.current=p,typeof c=="function"?c(p):c&&(c.current=p)},row:!0,alignItems:"center",gap:6,px:10,py:4,h:gg[n],maxWidth:196,overflow:"hidden",borderRadius:"var(--corner-sm)",backgroundColor:d.bg,color:d.color,onClick:i,className:P.cx(f,l),children:[i&&m.jsx(Ze,{}),o&&m.jsx(V,{w:20,h:20,borderRadius:"50%",overflow:"hidden",children:o}),r&&m.jsx(V,{children:r}),m.jsx(j,{variant:"caption-1",colorName:t,textOverflow:"ellipsis",overflow:"hidden",children:e}),s&&!a&&m.jsx(j,{className:h,colorName:t,onClick:p=>{p.stopPropagation(),s(p)},children:"×"})]})});Ni.displayName="Tag";const ua=({children:e})=>{const[t]=w.useState(()=>document.createElement("div"));return w.useEffect(()=>{let n=document.getElementById("portal-root");return n||(n=document.createElement("div"),n.id="portal-root",document.body.appendChild(n)),n.appendChild(t),()=>{n&&n.contains(t)&&n.removeChild(t)}},[t]),Mo.createPortal(e,t)},pg="_disabled_v62jt_40",mg="_open_v62jt_48",vg="_error_v62jt_51",yg="_hidden_v62jt_87",xg="_visible_v62jt_90",wg="_selected_v62jt_163",Y={"select-container":"_select-container_v62jt_8","full-width":"_full-width_v62jt_13","select-input":"_select-input_v62jt_17","size-xs":"_size-xs_v62jt_25","size-sm":"_size-sm_v62jt_30","size-md":"_size-md_v62jt_35",disabled:pg,open:mg,"select-arrow":"_select-arrow_v62jt_48",error:vg,"select-value":"_select-value_v62jt_62","select-value_xs":"_select-value_xs_v62jt_74","select-placeholder":"_select-placeholder_v62jt_81",hidden:yg,visible:xg,"select-arrow_xs":"_select-arrow_xs_v62jt_106","select-dropdown":"_select-dropdown_v62jt_116","select-menu":"_select-menu_v62jt_126","select-menu-item":"_select-menu-item_v62jt_145","select-menu-item-first":"_select-menu-item-first_v62jt_158",selected:wg,"overflow-tooltip-container":"_overflow-tooltip-container_v62jt_167","overflow-tooltip-text":"_overflow-tooltip-text_v62jt_172","empty-block":"_empty-block_v62jt_179"};function ca({value:e,onChange:t,multiple:n=!1,returnedValue:i,renderItem:s,placeholder:o,items:r=[],fullWidth:a,size:l="md",showDefaultItem:c,disabled:u,label:d,firstItem:f,lastItem:h,observer:p,emptyText:g,onBlur:x,prompt:v,error:C,errorText:y}){const[S,_]=Ut(e,n?[]:null),b=w.useRef(null),T=w.useRef(null),[R,k]=w.useState(!1),F=w.useMemo(()=>n?S||[]:S!=null?[S]:[],[S,n]),O=w.useCallback(I=>i?i(I):I,[i]),X=w.useMemo(()=>{const I=new Map;return r.forEach(B=>{I.set(O(B),B)}),I},[r,O]),te=To(b,R),se=!r.length&&!C,ae=I=>{const B=O(I);if(n){const K=F.includes(B)?F.filter(be=>be!==B):[...F,B];_(K),t?.(K)}else _(B),t?.(B),k(!1)},ne=I=>{if(!n)return;const B=F.filter(K=>K!==I);_(B),t?.(B)},$=()=>{const I=n?[]:null;_(I),t?.(I),n||k(!1)};w.useEffect(()=>{if(!R)return;const I=B=>{const K=B.target;!b.current?.contains(K)&&!T.current?.contains(K)&&(k(!1),x?.())};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[R,x]);const W=()=>{if(!F.length)return m.jsx(j,{variant:l==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",colorName:"tertiary",children:o??"Select..."});if(n)return m.jsx(V,{flexWrap:"wrap",row:!0,gap:10,children:F.map(K=>{const be=X.get(K);return be?m.jsx(Ni,{size:"sm",label:s(be),onDelete:nt=>{nt.stopPropagation(),ne(K)}},K):null})});const I=X.get(F[0]);if(!I)return m.jsx(j,{variant:l==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",colorName:"tertiary",children:o});const B=s(I);return typeof B=="string"?m.jsx(j,{variant:l==="xs"?"caption-1":"body-2",tag:"p",textOverflow:"ellipsis",overflow:"hidden",children:B}):m.jsx(m.Fragment,{children:B})},Z=R&&m.jsx(ua,{children:m.jsx(zi.div,{ref:T,className:Y["select-dropdown"],initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{...te,position:"absolute",zIndex:1},children:m.jsxs("ul",{className:Y["select-menu"],children:[c&&!n&&m.jsx(V,{className:Y["select-menu-item"],role:"option",onClick:$,children:m.jsx(j,{variant:"body-2",colorName:"tertiary",children:o})}),f&&m.jsx(V,{className:P.cx(Y["select-menu-item"],Y["select-menu-item-first"]),children:f}),se&&m.jsxs(V,{className:Y["empty-block"],children:[m.jsx(V,{w:20,h:20,children:m.jsx(Lh,{})}),m.jsx(j,{variant:"body-2",children:g??"There is nothing yet"})]}),r.map(I=>{const B=O(I),K=F.includes(B);return m.jsxs(V,{row:!0,gap:10,alignItems:"center",className:P.cx(Y["select-menu-item"],{[Y.selected]:K}),role:"option",relative:!0,onClick:()=>ae(I),children:[n&&m.jsx(Bi,{size:"sm",checked:K}),typeof s(I)=="string"?m.jsx(j,{variant:"body-2",tag:"p",wordBreak:"break-all",whiteSpace:"break-spaces",children:s(I)}):s(I),m.jsx(Ze,{})]},B)}),p,h&&m.jsx(V,{className:P.cx(Y["select-menu-item"],Y["select-menu-item-first"]),children:h})]})},"dropdown")});return m.jsxs(V,{relative:!0,display:"inline-block",minWidth:120,w:a?"full":"auto",children:[typeof d=="string"?m.jsx(j,{variant:"body-2",colorName:"tertiary",fontWeight:"regular",mb:l==="sm"?4:8,children:d}):d,m.jsxs(V,{ref:b,row:!0,gap:10,tabIndex:u?-1:0,role:"button",alignItems:"flex-start","aria-haspopup":"listbox",relative:!0,w:"100%",className:P.cx(Y["select-input"],Y[`size-${l}`],{[Y.error]:C,[Y.disabled]:u,[Y.open]:R}),onClick:()=>!u&&k(I=>!I),onBlur:x,children:[m.jsx(V,{className:P.cx(Y["select-value"]),children:W()}),m.jsx(V,{className:P.cx(Y["select-arrow"],Y[`select-arrow_${l}`]),children:m.jsx(Ih,{})})]}),typeof v=="string"?m.jsx(j,{variant:"caption-1",colorName:"tertiary",mt:4,children:v}):v,C&&y&&m.jsx(j,{tag:"p",colorName:"negative",variant:"body-2",mt:5,children:y}),m.jsx(hc,{initial:!1,children:Z})]})}const Cg=e=>M.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M3.94629 0.220237C3.78013 0.264025 3.64089 0.377624 3.56348 0.53176C3.27371 1.11189 3.05664 1.46395 2.83887 1.74953C2.61807 2.03873 2.38547 2.27579 2.03027 2.63039C1.21079 3.45057 0.799805 4.52619 0.799805 5.60012C0.799838 6.67406 1.21073 7.74968 2.03027 8.56985C3.67062 10.2096 6.32931 10.2095 7.96973 8.56985C8.78929 7.74968 9.20016 6.67408 9.2002 5.60012C9.15131 4.32908 8.43217 3.48543 7.94727 3.05813C7.76902 2.90106 7.40643 3.02424 7.2627 3.2134C7.24031 3.24286 7.21612 3.2739 7.18945 3.30617C6.93211 3.61754 6.56236 3.80807 6.41504 3.83156C6.38264 3.83667 6.36979 3.76513 6.2959 3.58254C5.79455 2.34427 5.78927 2.49365 5.58887 2.01125C5.48847 1.7692 5.05517 1.02727 4.92676 0.828635C4.80206 0.635591 4.64095 0.439873 4.43359 0.301292C4.29028 0.205951 4.1124 0.175957 3.94629 0.220237ZM4.75293 4.17824C5.2689 4.63997 5.60857 5.26651 5.71484 5.95071C6.10631 5.85571 6.46727 5.68318 6.78125 5.45071C6.86578 5.70826 6.89338 5.98123 6.8623 6.25051C6.83115 6.51993 6.74174 6.77966 6.60059 7.01125C6.45944 7.24281 6.27008 7.44117 6.04492 7.59231C5.81977 7.74344 5.56462 7.8443 5.29688 7.88723C5.0292 7.93013 4.75518 7.91446 4.49414 7.84133C4.23299 7.76812 3.99064 7.6383 3.78418 7.46242C3.5778 7.28657 3.41161 7.06792 3.29785 6.8218C3.18419 6.57572 3.12519 6.30771 3.125 6.03664C3.12508 5.58233 3.29054 5.14308 3.58984 4.80129C3.88917 4.4597 4.30271 4.2382 4.75293 4.17824Z",fill:"#FEAD34"})),Sg=e=>M.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M10.1483 8.61509C10.3344 8.26159 9.98299 7.89856 9.58534 7.93723C9.42671 7.95265 9.25857 7.9605 9.07422 7.96035C6.36522 7.9582 4.17129 5.76427 4.16914 3.05527C4.169 2.87115 4.17682 2.70321 4.19221 2.54477C4.23082 2.14712 3.86769 1.79411 3.50976 1.97161C2.03398 2.70343 1.20002 4.02274 1.20002 5.89477C1.20002 8.60377 3.3961 10.7998 6.1051 10.7998C7.97571 10.7998 9.38737 10.06 10.1483 8.61509Z",fill:"white"})),_g="_container_e7tan_8",bg="_disabled_e7tan_17",Rg="_reverse_e7tan_21",Mg="_input_e7tan_25",Pg="_switchContainer_e7tan_35",Tg="_variant_accent_e7tan_43",Vg="_variant_secondary_e7tan_47",Eg="_thumb_e7tan_51",Ag="_variant_theme_e7tan_54",Dg="_moon_e7tan_58",Fg="_fire_e7tan_61",kg="_size_sm_e7tan_74",Ig="_size_md_e7tan_80",Lg="_size_lg_e7tan_86",ge={container:_g,disabled:bg,reverse:Rg,input:Mg,switchContainer:Pg,variant_accent:Tg,variant_secondary:Vg,switch:"_switch_e7tan_35",thumb:Eg,variant_theme:Ag,moon:Dg,fire:Fg,size_sm:kg,size_md:Ig,size_lg:Lg},da=w.forwardRef(({title:e,text:t,icon:n,disabled:i,onChange:s,checked:o,defaultValue:r,className:a,size:l="md",variant:c="accent",reverse:u=!1,w:d="auto",...f},h)=>{const[p,g]=Ut(o,r),x=w.useRef(null);w.useImperativeHandle(h,()=>({focus:()=>{x.current?.focus()},blur:()=>{x.current?.blur()},get checked(){return p??!1},setChecked:S=>{g(S),s?.(S)},toggle:()=>{const S=!p;g(S),s?.(S)},isFocused:()=>document.activeElement===x.current,isDisabled:()=>i??!1,getInputElement:()=>x.current,checkValidity:()=>x.current?.checkValidity()??!0,reset:()=>{const S=r??!1;g(S),s?.(S)}}),[p,g,s,i,r]);const v=w.useCallback(S=>{g(S.target.checked),s?.(S.target.checked)},[s]),C=w.useMemo(()=>typeof e=="string"?m.jsx(j,{variant:"body-1",colorName:"primary",fontWeight:"medium",children:e}):e,[e]),y=w.useMemo(()=>typeof t=="string"?m.jsx(j,{variant:"body-2",colorName:"secondary",fontWeight:"regular",children:t}):t,[t]);return m.jsxs(V,{row:!0,w:d,gap:"var(--spacing-sm)",children:[m.jsxs("label",{className:P.cx(ge.container,a,{[ge.disabled]:i,[ge.reverse]:u}),children:[m.jsxs(V,{className:P.cx(ge.switchContainer,ge[`size_${l}`],ge[`variant_${c}`]),children:[m.jsx("input",{ref:x,type:"checkbox",checked:p,className:ge.input,onChange:v,disabled:i,...f}),m.jsx("div",{className:ge.switch,children:m.jsx("div",{className:ge.thumb,children:c==="theme"&&m.jsxs(m.Fragment,{children:[m.jsx(Sg,{className:ge.moon}),m.jsx(Cg,{className:ge.fire})]})})})]}),m.jsxs(V,{gap:"var(--spacing-xs)",children:[C,y]})]}),n]})});da.displayName="Switch";const jg="_primary_svt6d_8",$g="_secondary_svt6d_13",Og="_button_svt6d_18",Re={primary:jg,secondary:$g,button:Og,"button-active":"_button-active_svt6d_32","icon-container":"_icon-container_svt6d_35","button-primary":"_button-primary_svt6d_47","button-secondary":"_button-secondary_svt6d_51","button-disabled":"_button-disabled_svt6d_55","full-width":"_full-width_svt6d_60"};function zg({value:e,onChange:t,options:n,variant:i="primary",fullWidth:s=!1,className:o}){return m.jsx(V,{row:!0,alignItems:"center",borderRadius:"var(--corner-md)",p:"var(--spacing-xs)",gap:"var(--spacing-md)",className:P.cx(Re[i],s&&Re["full-width"],o),children:n.map(r=>{const a=r.value===e,l=r.disabled,c=r.separatorAfter??!1;return m.jsxs(w.Fragment,{children:[m.jsxs("button",{type:"button",disabled:l,className:P.cx(Re.button,s&&Re["full-width"],a&&Re["button-active"],a&&Re[`button-${i}`],l&&Re["button-disabled"]),onClick:()=>!l&&t(r.value),children:[r.icon&&m.jsx(V,{alignItems:"center",justifyContent:"center",className:Re["icon-container"],children:r.icon}),r.label&&m.jsx(j,{colorName:a?"primary":"tertiary",children:r.label}),!l&&m.jsx(Ze,{color:"var(--fill-bg-overlay-primary)"})]}),c&&m.jsx(V,{w:1,h:24,backgroundColor:"var(--fill-bg-tertiary)"})]},r.value)})})}const Bg="_header_446to_8",Ng={header:Bg},fa=w.forwardRef(({title:e,subtitle:t,onClose:n,w:i="full",p:s,py:o,px:r="var(--spacing-2xl)",pt:a="var(--spacing-2xl)",pb:l="var(--spacing-lg)",row:c=!0,justifyContent:u="space-between",showCloseButton:d=!0},f)=>m.jsxs(V,{w:i,p:s,py:o,px:r,pt:a,pb:l,row:c,justifyContent:u,ref:f,className:Ng.header,children:[m.jsxs(V,{gap:"var(--spacing-sm)",children:[m.jsx(j,{variant:"title-3",colorName:"primary",fontWeight:"semibold",children:e}),m.jsx(j,{variant:"body-1",colorName:"tertiary",fontWeight:"medium",children:t})]}),d&&m.jsx(V,{children:m.jsx(gt,{onClick:n,color:"neutral",children:m.jsx(Po,{})})})]}));fa.displayName="ModalHeader";const Hg="_footer_1bo08_8",Gg={footer:Hg},ha=w.forwardRef(({children:e,row:t=!0,flex:n=!0,gap:i="var(--spacing-lg)",p:s="var(--spacing-2xl)",className:o,...r},a)=>m.jsx(V,{flex:n,row:t,gap:i,p:s,className:P.cx(Gg.footer,o),ref:a,...r,children:e}));ha.displayName="ModalFooter";function Be(e,t,n){let i=n.initialDeps??[],s;function o(){var r,a,l,c;let u;n.key&&((r=n.debug)!=null&&r.call(n))&&(u=Date.now());const d=e();if(!(d.length!==i.length||d.some((p,g)=>i[g]!==p)))return s;i=d;let h;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(h=Date.now()),s=t(...d),n.key&&((l=n.debug)!=null&&l.call(n))){const p=Math.round((Date.now()-u)*100)/100,g=Math.round((Date.now()-h)*100)/100,x=g/16,v=(C,y)=>{for(C=String(C);C.length<y;)C=" "+C;return C};console.info(`%c⏱ ${v(g,5)} /${v(p,5)} ms`,`
14
14
  font-size: .6rem;
15
15
  font-weight: bold;
16
16
  color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n?.key)}return(c=n?.onChange)==null||c.call(n,s),s}return o.updateDeps=r=>{i=r},o}function vo(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Wg=(e,t)=>Math.abs(e-t)<1.01,Ug=(e,t,n)=>{let i;return function(...s){e.clearTimeout(i),i=e.setTimeout(()=>t.apply(this,s),n)}},yo=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Kg=e=>e,qg=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),i=[];for(let s=t;s<=n;s++)i.push(s);return i},Xg=(e,t)=>{const n=e.scrollElement;if(!n)return;const i=e.targetWindow;if(!i)return;const s=r=>{const{width:a,height:l}=r;t({width:Math.round(a),height:Math.round(l)})};if(s(yo(n)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(r=>{const a=()=>{const l=r[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){s({width:c.inlineSize,height:c.blockSize});return}}s(yo(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},xo={passive:!0},wo=typeof window>"u"?!0:"onscrollend"in window,Yg=(e,t)=>{const n=e.scrollElement;if(!n)return;const i=e.targetWindow;if(!i)return;let s=0;const o=e.options.useScrollendEvent&&wo?()=>{}:Ug(i,()=>{t(s,!1)},e.options.isScrollingResetDelay),r=u=>()=>{const{horizontal:d,isRtl:f}=e.options;s=d?n.scrollLeft*(f&&-1||1):n.scrollTop,o(),t(s,u)},a=r(!0),l=r(!1);l(),n.addEventListener("scroll",a,xo);const c=e.options.useScrollendEvent&&wo;return c&&n.addEventListener("scrollend",l,xo),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},Zg=(e,t,n)=>{if(t?.borderBoxSize){const i=t.borderBoxSize[0];if(i)return Math.round(i[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Jg=(e,{adjustments:t=0,behavior:n},i)=>{var s,o;const r=e+t;(o=(s=i.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[i.options.horizontal?"left":"top"]:r,behavior:n})};class Qg{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const i=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const r=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var s;(s=i())==null||s.disconnect(),n=null},observe:s=>{var o;return(o=i())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=i())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([i,s])=>{typeof s>"u"&&delete n[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Kg,rangeExtractor:qg,onChange:()=>{},measureElement:Zg,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var i,s;(s=(i=this.options).onChange)==null||s.call(i,this,n)},this.maybeNotify=Be(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,i)=>{const s=new Map,o=new Map;for(let r=i-1;r>=0;r--){const a=n[r];if(s.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&s.set(a.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=Be(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,i,s,o,r)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:i,scrollMargin:s,getItemKey:o,enabled:r}),{key:!1}),this.getMeasurements=Be(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:i,scrollMargin:s,getItemKey:o,enabled:r},a)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=o(u),f=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),h=f?f.end+this.options.gap:i+s,p=a.get(d),g=typeof p=="number"?p:this.options.estimateSize(u),x=h+g,v=f?f.lane:u%this.options.lanes;c[u]={index:u,start:h,size:g,end:x,key:d,lane:v}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Be(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,i,s,o)=>this.range=n.length>0&&i>0?ep({measurements:n,outerSize:i,scrollOffset:s,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Be(()=>{let n=null,i=null;const s=this.calculateRange();return s&&(n=s.startIndex,i=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,i]},(n,i,s,o,r)=>o===null||r===null?[]:n({startIndex:o,endIndex:r,overscan:i,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const i=this.options.indexAttribute,s=n.getAttribute(i);return s?parseInt(s,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this._measureElement=(n,i)=>{const s=this.indexFromElement(n),o=this.measurementsCache[s];if(!o)return;const r=o.key,a=this.elementsCache.get(r);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(r,n)),n.isConnected&&this.resizeItem(s,this.options.measureElement(n,i,this))},this.resizeItem=(n,i)=>{const s=this.measurementsCache[n];if(!s)return;const o=this.itemSizeCache.get(s.key)??s.size,r=i-o;r!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,r,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",r),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,i)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,s)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(s))});return}this._measureElement(n,void 0)},this.getVirtualItems=Be(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,i)=>{const s=[];for(let o=0,r=n.length;o<r;o++){const a=n[o],l=i[a];s.push(l)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const i=this.getMeasurements();if(i.length!==0)return vo(i[ga(0,i.length-1,s=>vo(i[s]).start,n)])},this.getOffsetForAlignment=(n,i,s=0)=>{const o=this.getSize(),r=this.getScrollOffset();i==="auto"&&(i=n>=r+o?"end":"start"),i==="center"?n+=(s-o)/2:i==="end"&&(n-=o);const a=this.getTotalSize()+this.options.scrollMargin-o;return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,i="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.measurementsCache[n];if(!s)return;const o=this.getSize(),r=this.getScrollOffset();if(i==="auto")if(s.end>=r+o-this.options.scrollPaddingEnd)i="end";else if(s.start<=r+this.options.scrollPaddingStart)i="start";else return[r,i];const a=i==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,i,s.size),i]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:i="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,i),{adjustments:void 0,behavior:s})},this.scrollToIndex=(n,{align:i="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let o=0;const r=10,a=c=>{if(!this.targetWindow)return;const u=this.getOffsetForIndex(n,c);if(!u){console.warn("Failed to get offset for index:",n);return}const[d,f]=u;this._scrollToOffset(d,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const h=this.getScrollOffset(),p=this.getOffsetForIndex(n,f);if(!p){console.warn("Failed to get offset for index:",n);return}Wg(p[0],h)||l(f)})},l=c=>{this.targetWindow&&(o++,o<r?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",o,r),this.targetWindow.requestAnimationFrame(()=>a(c))):console.warn(`Failed to scroll to index ${n} after ${r} attempts.`))};a(i)},this.scrollBy=(n,{behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:i})},this.getTotalSize=()=>{var n;const i=this.getMeasurements();let s;if(i.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((n=i[i.length-1])==null?void 0:n.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=i.length-1;for(;r>=0&&o.some(a=>a===null);){const a=i[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}s=Math.max(...o.filter(a=>a!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:i,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const ga=(e,t,n,i)=>{for(;e<=t;){const s=(e+t)/2|0,o=n(s);if(o<i)e=s+1;else if(o>i)t=s-1;else return s}return e>0?e-1:0};function ep({measurements:e,outerSize:t,scrollOffset:n,lanes:i}){const s=e.length-1,o=l=>e[l].start;if(e.length<=i)return{startIndex:0,endIndex:s};let r=ga(0,s,o,n),a=r;if(i===1)for(;a<s&&e[a].end<n+t;)a++;else if(i>1){const l=Array(i).fill(0);for(;a<s&&l.some(u=>u<n+t);){const u=e[a];l[u.lane]=u.end,a++}const c=Array(i).fill(n+t);for(;r>=0&&c.some(u=>u>=n);){const u=e[r];c[u.lane]=u.start,r--}r=Math.max(0,r-r%i),a=Math.min(s,a+(i-1-a%i))}return{startIndex:r,endIndex:a}}const Co=typeof document<"u"?M.useLayoutEffect:M.useEffect;function tp(e){const t=M.useReducer(()=>({}),{})[1],n={...e,onChange:(s,o)=>{var r;o?Mo.flushSync(t):t(),(r=e.onChange)==null||r.call(e,s,o)}},[i]=M.useState(()=>new Qg(n));return i.setOptions(n),Co(()=>i._didMount(),[]),Co(()=>i._willUpdate()),i}function np(e){return tp({observeElementRect:Xg,observeElementOffset:Yg,scrollToFn:Jg,...e})}const ip="_main_pl2ip_8",So={main:ip},pa=w.forwardRef(({children:e,className:t,row:n=!1,estimatedItemHeight:i=100,virtualize:s=!1},o)=>{const r=w.useRef(null),a=w.useMemo(()=>w.Children.toArray(e),[e]),l=np({count:a.length,getScrollElement:()=>r.current,estimateSize:()=>i,measureElement:u=>u.getBoundingClientRect().height});return w.useImperativeHandle(o,()=>({scrollToTop:()=>l.scrollToOffset(0,{behavior:"smooth"}),scrollToBottom:()=>l.scrollToOffset(l.getTotalSize(),{behavior:"smooth"}),scrollToIndex:(u,d={})=>l.scrollToIndex(u,{behavior:"smooth",...d}),scrollToOffset:(u,d={})=>l.scrollToOffset(u,{behavior:"smooth",...d}),scrollBy:u=>{const d=l.scrollOffset||0;l.scrollToOffset(d+u,{behavior:"smooth"})},getElement:()=>r.current,getScrollOffset:()=>l.scrollOffset||0,getTotalSize:()=>l.getTotalSize()}),[l]),w.useMemo(()=>s||a.length>50,[s,a])&&a.length>0?m.jsx(V,{ref:r,className:P.cx(So.main,t),w:"full",row:n,p:"var(--spacing-2xl)",children:m.jsx(V,{style:{height:`${l.getTotalSize()}px`,position:"relative"},children:l.getVirtualItems().map(u=>m.jsx(V,{"data-index":u.index,ref:l.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${u.start}px)`},children:a[u.index]},u.key))})}):m.jsx(V,{ref:r,className:P.cx(So.main,t),w:"full",row:n,pl:"var(--spacing-2xl)",pr:"var(--spacing-xs)",children:m.jsx(V,{py:"var(--spacing-2xl)",pr:"var(--spacing-xl)",children:e})})});pa.displayName="ModalMain";const Jt=Vo;Jt.Header=fa;Jt.Main=pa;Jt.Footer=ha;/**