@dss-kit/ui-kit 0.2.35 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ui-kit.cjs.js
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
${g}px !important;
|
|
32
32
|
top: ${f}px !important;
|
|
33
33
|
}
|
|
34
|
-
`),()=>{m.contains(p)&&m.removeChild(p)}},[t]),C.jsx(ZE,{isPresent:t,childRef:i,sizeRef:s,children:N.cloneElement(e,{ref:l})})}const QE=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s,anchorX:a,root:l})=>{const c=Of(e2),u=S.useId();let f=!0,d=S.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:h=>{c.set(h,!0);for(const g of c.values())if(!g)return;r&&r()},register:h=>(c.set(h,!1),()=>c.delete(h))}),[n,c,r]);return i&&f&&(d={...d}),S.useMemo(()=>{c.forEach((h,g)=>c.set(g,!1))},[n]),N.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=C.jsx(JE,{isPresent:n,anchorX:a,root:l,children:e})),C.jsx(ql.Provider,{value:d,children:e})};function e2(){return new Map}function jx(e=!0){const t=S.useContext(ql);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=S.useId();S.useEffect(()=>{if(e)return o(i)},[e]);const s=S.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const _a=e=>e.key||"";function hp(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const Vx=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=jx(s),f=S.useMemo(()=>hp(e),[e]),d=s&&!c?[]:f.map(_a),h=S.useRef(!0),g=S.useRef(f),p=Of(()=>new Map),[m,v]=S.useState(f),[y,x]=S.useState(f);G0(()=>{h.current=!1,g.current=f;for(let _=0;_<y.length;_++){const E=_a(y[_]);d.includes(E)?p.delete(E):p.get(E)!==!0&&p.set(E,!1)}},[y,d.length,d.join("-")]);const b=[];if(f!==m){let _=[...f];for(let E=0;E<y.length;E++){const R=y[E],k=_a(R);d.includes(k)||(_.splice(E,0,R),b.push(R))}return i==="wait"&&b.length&&(_=b),x(hp(_)),v(f),null}process.env.NODE_ENV!=="production"&&i==="wait"&&y.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}=S.useContext($f);return C.jsx(C.Fragment,{children:y.map(_=>{const E=_a(_),R=s&&!c?!1:f===y||d.includes(E),k=()=>{if(p.has(E))p.set(E,!0);else return;let P=!0;p.forEach(F=>{F||(P=!1)}),P&&(w?.(),x(g.current),s&&u?.(),r&&r())};return C.jsx(QE,{isPresent:R,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,root:l,onExitComplete:R?void 0:k,anchorX:a,children:_},E)})})},Bx=S.createContext({strict:!1}),gp={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"]},Li={};for(const e in gp)Li[e]={isEnabled:t=>gp[e].some(n=>!!t[n])};function t2(e){for(const t in e)Li[t]={...Li[t],...e[t]}}const n2=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 yl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||n2.has(e)}let zx=e=>!yl(e);function r2(e){typeof e=="function"&&(zx=t=>t.startsWith("on")?!yl(t):e(t))}try{r2(require("@emotion/is-prop-valid").default)}catch{}function o2(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(zx(o)||n===!0&&yl(o)||!t&&!yl(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Yl=S.createContext({});function Xl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function js(e){return typeof e=="string"||Array.isArray(e)}const ih=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],sh=["initial",...ih];function Zl(e){return Xl(e.animate)||sh.some(t=>js(e[t]))}function Hx(e){return!!(Zl(e)||e.variants)}function i2(e,t){if(Zl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||js(n)?n:void 0,animate:js(r)?r:void 0}}return e.inherit!==!1?t:{}}function s2(e){const{initial:t,animate:n}=i2(e,S.useContext(Yl));return S.useMemo(()=>({initial:t,animate:n}),[pp(t),pp(n)])}function pp(e){return Array.isArray(e)?e.join(" "):e}function mp(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ss={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=mp(e,t.target.x),r=mp(e,t.target.y);return`${n}% ${r}%`}},a2={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Vr.parse(e);if(o.length>5)return r;const i=Vr.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Je(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}},wd={borderRadius:{...ss,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ss,borderTopRightRadius:ss,borderBottomLeftRadius:ss,borderBottomRightRadius:ss,boxShadow:a2};function Wx(e,{layout:t,layoutId:n}){return Wi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!wd[e]||e==="opacity")}const l2={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},c2=Hi.length;function u2(e,t,n){let r="",o=!0;for(let i=0;i<c2;i++){const s=Hi[i],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Lx(a,th[s]);if(!l){o=!1;const u=l2[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function ah(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Wi.has(l)){s=!0;continue}else if(ux(l)){o[l]=c;continue}else{const u=Lx(c,th[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=u2(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const lh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Kx(e,t,n){for(const r in t)!St(t[r])&&!Wx(r,n)&&(e[r]=t[r])}function d2({transformTemplate:e},t){return S.useMemo(()=>{const n=lh();return ah(n,t,e),Object.assign({},n.vars,n.style)},[t])}function f2(e,t){const n=e.style||{},r={};return Kx(r,n,e),Object.assign(r,d2(e,t)),r}function h2(e,t){const n={},r=f2(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const g2={offset:"stroke-dashoffset",array:"stroke-dasharray"},p2={offset:"strokeDashoffset",array:"strokeDasharray"};function m2(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?g2:p2;e[i.offset]=he.transform(-r);const s=he.transform(t),a=he.transform(n);e[i.array]=`${s} ${a}`}function Ux(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:i=1,pathOffset:s=0,...a},l,c,u){if(ah(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:d}=e;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&m2(f,o,i,s,!1)}const Gx=()=>({...lh(),attrs:{}}),qx=e=>typeof e=="string"&&e.toLowerCase()==="svg";function y2(e,t,n,r){const o=S.useMemo(()=>{const i=Gx();return Ux(i,t,qx(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Kx(i,e.style,e),o.style={...i,...o.style}}return o}const v2=["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 ch(e){return typeof e!="string"||e.includes("-")?!1:!!(v2.indexOf(e)>-1||/[A-Z]/u.test(e))}function x2(e,t,n,{latestValues:r},o,i=!1){const a=(ch(e)?y2:h2)(t,r,o,e),l=o2(t,typeof e=="string",i),c=e!==S.Fragment?{...l,...a,ref:n}:{},{children:u}=t,f=S.useMemo(()=>St(u)?u.get():u,[u]);return S.createElement(e,{...c,children:f})}function yp(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function uh(e,t,n,r){if(typeof t=="function"){const[o,i]=yp(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=yp(r);t=t(n!==void 0?n:e.custom,o,i)}return t}function tl(e){return St(e)?e.get():e}function b2({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:w2(n,r,o,e),renderState:t()}}function w2(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=tl(i[d]);let{initial:s,animate:a}=e;const l=Zl(e),c=Hx(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?a:s;if(f&&typeof f!="boolean"&&!Xl(f)){const d=Array.isArray(f)?f:[f];for(let h=0;h<d.length;h++){const g=uh(e,d[h]);if(g){const{transitionEnd:p,transition:m,...v}=g;for(const y in v){let x=v[y];if(Array.isArray(x)){const b=u?x.length-1:0;x=x[b]}x!==null&&(o[y]=x)}for(const y in p)o[y]=p[y]}}}return o}const Yx=e=>(t,n)=>{const r=S.useContext(Yl),o=S.useContext(ql),i=()=>b2(e,t,r,o);return n?i():Of(i)};function dh(e,t,n){const{style:r}=e,o={};for(const i in r)(St(r[i])||t.style&&St(t.style[i])||Wx(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(o[i]=r[i]);return o}const C2=Yx({scrapeMotionValuesFromProps:dh,createRenderState:lh});function Xx(e,t,n){const r=dh(e,t,n);for(const o in e)if(St(e[o])||St(t[o])){const i=Hi.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const S2=Yx({scrapeMotionValuesFromProps:Xx,createRenderState:Gx}),_2=Symbol.for("motionComponentSymbol");function yi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function T2(e,t,n){return S.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):yi(n)&&(n.current=r))},[t])}const fh=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),E2="framerAppearId",Zx="data-"+fh(E2),Jx=S.createContext({});function R2(e,t,n,r,o){const{visualElement:i}=S.useContext(Yl),s=S.useContext(Bx),a=S.useContext(ql),l=S.useContext(oh).reducedMotion,c=S.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,f=S.useContext(Jx);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&k2(c.current,n,o,f);const d=S.useRef(!1);S.useInsertionEffect(()=>{u&&d.current&&u.update(n,a)});const h=n[Zx],g=S.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return G0(()=>{u&&(d.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),S.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),u.enteringChildren=void 0)}),u}function k2(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Qx(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!s||a&&yi(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Qx(e){if(e)return e.options.allowProjection!==!1?e.projection:Qx(e.parent)}function Wc(e,{forwardMotionProps:t=!1}={},n,r){n&&t2(n);const o=ch(e)?S2:C2;function i(a,l){let c;const u={...S.useContext(oh),...a,layoutId:A2(a)},{isStatic:f}=u,d=s2(a),h=o(a,f);if(!f&&If){N2(u,n);const g=M2(u);c=g.MeasureLayout,d.visualElement=R2(e,h,u,r,g.ProjectionNode)}return C.jsxs(Yl.Provider,{value:d,children:[c&&d.visualElement?C.jsx(c,{visualElement:d.visualElement,...u}):null,x2(e,a,T2(h,d.visualElement,l),h,f,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=S.forwardRef(i);return s[_2]=e,s}function A2({layoutId:e}){const t=S.useContext($f).id;return t&&e!==void 0?t+"-"+e:e}function N2(e,t){const n=S.useContext(Bx).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Bi(!1,r,"lazy-strict-mode"):vr(!1,r,"lazy-strict-mode")}}function M2(e){const{drag:t,layout:n}=Li;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function P2(e,t){if(typeof Proxy>"u")return Wc;const n=new Map,r=(i,s)=>Wc(i,s,e,t),o=(i,s)=>(process.env.NODE_ENV!=="production"&&zf(!1,"motion() is deprecated. Use motion.create() instead."),r(i,s));return new Proxy(o,{get:(i,s)=>s==="create"?r:(n.has(s)||n.set(s,Wc(s,void 0,e,t)),n.get(s))})}function e1({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function L2({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function F2(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Kc(e){return e===void 0||e===1}function Cd({scale:e,scaleX:t,scaleY:n}){return!Kc(e)||!Kc(t)||!Kc(n)}function uo(e){return Cd(e)||t1(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function t1(e){return vp(e.x)||vp(e.y)}function vp(e){return e&&e!=="0%"}function vl(e,t,n){const r=e-n,o=t*r;return n+o}function xp(e,t,n,r,o){return o!==void 0&&(e=vl(e,o,r)),vl(e,n,r)+t}function Sd(e,t=0,n=1,r,o){e.min=xp(e.min,t,n,r,o),e.max=xp(e.max,t,n,r,o)}function n1(e,{x:t,y:n}){Sd(e.x,t.translate,t.scale,t.originPoint),Sd(e.y,n.translate,n.scale,n.originPoint)}const bp=.999999999999,wp=1.0000000000001;function $2(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&xi(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,n1(e,s)),r&&uo(i.latestValues)&&xi(e,i.latestValues))}t.x<wp&&t.x>bp&&(t.x=1),t.y<wp&&t.y>bp&&(t.y=1)}function vi(e,t){e.min=e.min+t,e.max=e.max+t}function Cp(e,t,n,r,o=.5){const i=Je(e.min,e.max,o);Sd(e,t,n,i,r)}function xi(e,t){Cp(e.x,t.x,t.scaleX,t.scale,t.originX),Cp(e.y,t.y,t.scaleY,t.scale,t.originY)}function r1(e,t){return e1(F2(e.getBoundingClientRect(),t))}function O2(e,t,n){const r=r1(e,n),{scroll:o}=t;return o&&(vi(r.x,o.offset.x),vi(r.y,o.offset.y)),r}const Sp=()=>({translate:0,scale:1,origin:0,originPoint:0}),bi=()=>({x:Sp(),y:Sp()}),_p=()=>({min:0,max:0}),ct=()=>({x:_p(),y:_p()}),_d={current:null},o1={current:!1};function I2(){if(o1.current=!0,!!If)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>_d.current=e.matches;e.addEventListener("change",t),t()}else _d.current=!1}const D2=new WeakMap;function j2(e,t,n){for(const r in t){const o=t[r],i=n[r];if(St(o))e.addValue(r,o);else if(St(i))e.addValue(r,Pi(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=e.getStaticValue(r);e.addValue(r,Pi(s!==void 0?s:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Tp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class V2{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Qf,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 d=jt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Ue.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Zl(n),this.isVariantNode=Hx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&St(h)&&h.set(l[d])}}mount(t){this.current=t,D2.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),o1.current||I2(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:_d.current,process.env.NODE_ENV!=="production"&&zf(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(),jr(this.notifyUpdate),jr(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 r=Wi.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i&&i(),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 Li){const n=Li[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ct()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Tp.length;r++){const o=Tp[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,s=t[i];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=j2(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 r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pi(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(q0(r)||X0(r))?r=parseFloat(r):!qE(r)&&Vr.test(n)&&(r=Px(t,n)),this.setBaseTarget(t,St(r)?r.get():r)),St(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=uh(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!St(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Bf),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){nh.render(this.render)}}class i1 extends V2{constructor(){super(...arguments),this.KeyframeResolver=OE}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;St(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function s1(e,{style:t,vars:n},r,o){const i=e.style;let s;for(s in t)i[s]=t[s];o?.applyProjectionStyles(i,r);for(s in n)i.setProperty(s,n[s])}function B2(e){return window.getComputedStyle(e)}class z2 extends i1{constructor(){super(...arguments),this.type="html",this.renderInstance=s1}readValueFromInstance(t,n){if(Wi.has(n))return this.projection?.isProjecting?gd(n):eE(t,n);{const r=B2(t),o=(ux(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return r1(t,n)}build(t,n,r){ah(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return dh(t,n,r)}}const a1=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 H2(e,t,n,r){s1(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(a1.has(o)?o:fh(o),t.attrs[o])}class W2 extends i1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ct}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Wi.has(n)){const r=Mx(n);return r&&r.default||0}return n=a1.has(n)?n:fh(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Xx(t,n,r)}build(t,n,r){Ux(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){H2(t,n,r,o)}mount(t){this.isSVGTag=qx(t.tagName),super.mount(t)}}const K2=(e,t)=>ch(e)?new W2(t):new z2(t,{allowProjection:e!==S.Fragment});function Ci(e,t,n){const r=e.getProps();return uh(r,t,n!==void 0?n:r.custom,e)}const Td=e=>Array.isArray(e);function U2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pi(n))}function G2(e){return Td(e)?e[e.length-1]||0:e}function q2(e,t){const n=Ci(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const s in i){const a=G2(i[s]);U2(e,s,a)}}function Y2(e){return!!(St(e)&&e.add)}function Ed(e,t){const n=e.getValue("willChange");if(Y2(n))return n.add(t);if(!n&&xr.WillChange){const r=new xr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function l1(e){return e.props[Zx]}const X2=e=>e!==null;function Z2(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(X2),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[i]}const J2={type:"spring",stiffness:500,damping:25,restSpeed:10},Q2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),eR={type:"keyframes",duration:.8},tR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nR=(e,{keyframes:t})=>t.length>2?eR:Wi.has(e)?e.startsWith("scale")?Q2(t[1]):J2:tR;function rR({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const hh=(e,t,n,r={},o,i)=>s=>{const a=eh(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Tn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};rR(a)||Object.assign(u,nR(e,u)),u.duration&&(u.duration=Tn(u.duration)),u.repeatDelay&&(u.repeatDelay=Tn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(xd(u),u.delay===0&&(f=!0)),(xr.instantAnimations||xr.skipAnimations)&&(f=!0,xd(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const d=Z2(u.keyframes,a);if(d!==void 0){Ue.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new Jf(u):new SE(u)};function oR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function c1(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(i=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),d=a[u];if(d===void 0||c&&oR(c,u))continue;const h={delay:n,...eh(i||{},u)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===g&&!h.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const v=l1(e);if(v){const y=window.MotionHandoffAnimation(v,u,Ue);y!==null&&(h.startTime=y,p=!0)}}Ed(e,u),f.start(hh(u,f,d,e.shouldReduceMotion&&kx.has(u)?{type:!1}:h,e,p));const m=f.animation;m&&l.push(m)}return s&&Promise.all(l).then(()=>{Ue.update(()=>{s&&q2(e,s)})}),l}function u1(e,t,n,r=0,o=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(i,s):o===1?i*r:a-i*r}function Rd(e,t,n={}){const r=Ci(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(c1(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:f}=o;return iR(e,t,l,c,u,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[i,s]:[s,i];return l().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function iR(e,t,n=0,r=0,o=0,i=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Rd(l,t,{...s,delay:n+(typeof r=="function"?0:r)+u1(e.variantChildren,l,r,o,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function sR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>Rd(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=Rd(e,t,n);else{const o=typeof t=="function"?Ci(e,t,n.custom):t;r=Promise.all(c1(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function d1(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const aR=sh.length;function f1(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?f1(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<aR;n++){const r=sh[n],o=e.props[r];(js(o)||o===!1)&&(t[r]=o)}return t}const lR=[...ih].reverse(),cR=ih.length;function uR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>sR(e,n,r)))}function dR(e){let t=uR(e),n=Ep(),r=!0;const o=l=>(c,u)=>{const f=Ci(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:h,...g}=f;c={...c,...g,...h}}return c};function i(l){t=l(e)}function s(l){const{props:c}=e,u=f1(e.parent)||{},f=[],d=new Set;let h={},g=1/0;for(let m=0;m<cR;m++){const v=lR[m],y=n[v],x=c[v]!==void 0?c[v]:u[v],b=js(x),w=v===l?y.isActive:null;w===!1&&(g=m);let _=x===u[v]&&x!==c[v]&&b;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),y.protectedKeys={...h},!y.isActive&&w===null||!x&&!y.prevProp||Xl(x)||typeof x=="boolean")continue;const E=fR(y.prevProp,x);let R=E||v===l&&y.isActive&&!_&&b||m>g&&b,k=!1;const P=Array.isArray(x)?x:[x];let F=P.reduce(o(v),{});w===!1&&(F={});const{prevResolvedValues:$={}}=y,j={...$,...F},O=I=>{R=!0,d.has(I)&&(k=!0,d.delete(I)),y.needsAnimating[I]=!0;const M=e.getValue(I);M&&(M.liveStyle=!1)};for(const I in j){const M=F[I],H=$[I];if(h.hasOwnProperty(I))continue;let U=!1;Td(M)&&Td(H)?U=!d1(M,H):U=M!==H,U?M!=null?O(I):d.add(I):M!==void 0&&d.has(I)?O(I):y.protectedKeys[I]=!0}y.prevProp=x,y.prevResolvedValues=F,y.isActive&&(h={...h,...F}),r&&e.blockInitialAnimation&&(R=!1);const D=_&&E;R&&(!D||k)&&f.push(...P.map(I=>{const M={type:v};if(typeof I=="string"&&r&&!D&&e.manuallyAnimateOnMount&&e.parent){const{parent:H}=e,U=Ci(H,I);if(H.enteringChildren&&U){const{delayChildren:re}=U.transition||{};M.delay=u1(H.enteringChildren,e,re)}}return{animation:I,options:M}}))}if(d.size){const m={};if(typeof c.initial!="boolean"){const v=Ci(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(m.transition=v.transition)}d.forEach(v=>{const y=e.getBaseTarget(v),x=e.getValue(v);x&&(x.liveStyle=!0),m[v]=y??null}),f.push({animation:m})}let p=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ep()}}}function fR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!d1(t,e):!1}function so(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ep(){return{animate:so(!0),whileInView:so(),whileHover:so(),whileTap:so(),whileDrag:so(),whileFocus:so(),exit:so()}}class Zr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class hR extends Zr{constructor(t){super(t),t.animationState||(t.animationState=dR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Xl(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 gR=0;class pR extends Zr{constructor(){super(...arguments),this.id=gR++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.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 mR={animation:{Feature:hR},exit:{Feature:pR}};function Vs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Qs(e){return{point:{x:e.pageX,y:e.pageY}}}const yR=e=>t=>rh(t)&&e(t,Qs(t));function Es(e,t,n,r){return Vs(e,t,yR(n),r)}const h1=1e-4,vR=1-h1,xR=1+h1,g1=.01,bR=0-g1,wR=0+g1;function Pt(e){return e.max-e.min}function CR(e,t,n){return Math.abs(e-t)<=n}function Rp(e,t,n,r=.5){e.origin=r,e.originPoint=Je(t.min,t.max,e.origin),e.scale=Pt(n)/Pt(t),e.translate=Je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=vR&&e.scale<=xR||isNaN(e.scale))&&(e.scale=1),(e.translate>=bR&&e.translate<=wR||isNaN(e.translate))&&(e.translate=0)}function Rs(e,t,n,r){Rp(e.x,t.x,n.x,r?r.originX:void 0),Rp(e.y,t.y,n.y,r?r.originY:void 0)}function kp(e,t,n){e.min=n.min+t.min,e.max=e.min+Pt(t)}function SR(e,t,n){kp(e.x,t.x,n.x),kp(e.y,t.y,n.y)}function Ap(e,t,n){e.min=t.min-n.min,e.max=e.min+Pt(t)}function xl(e,t,n){Ap(e.x,t.x,n.x),Ap(e.y,t.y,n.y)}function sn(e){return[e("x"),e("y")]}const p1=({current:e})=>e?e.ownerDocument.defaultView:null,Np=(e,t)=>Math.abs(e-t);function _R(e,t){const n=Np(e.x,t.x),r=Np(e.y,t.y);return Math.sqrt(n**2+r**2)}class m1{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:s=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 d=Gc(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=_R(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:p}=d,{timestamp:m}=mt;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Uc(h,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Gc(d.type==="pointercancel"?this.lastMoveEventInfo:Uc(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,v),p&&p(d,v)},!rh(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=o||window;const a=Qs(t),l=Uc(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=mt;this.history=[{...c,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Gc(l,this.history)),this.removeListeners=Xs(Es(this.contextWindow,"pointermove",this.handlePointerMove),Es(this.contextWindow,"pointerup",this.handlePointerUp),Es(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),jr(this.updatePoint)}}function Uc(e,t){return t?{point:t(e.point)}:e}function Mp(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Gc({point:e},t){return{point:e,delta:Mp(e,y1(t)),offset:Mp(e,TR(t)),velocity:ER(t,.1)}}function TR(e){return e[0]}function y1(e){return e[e.length-1]}function ER(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=y1(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Tn(t)));)n--;if(!r)return{x:0,y:0};const i=ln(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function RR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Je(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Je(n,e,r.max):Math.min(e,n)),e}function Pp(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 kR(e,{top:t,left:n,bottom:r,right:o}){return{x:Pp(e.x,n,o),y:Pp(e.y,t,r)}}function Lp(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function AR(e,t){return{x:Lp(e.x,t.x),y:Lp(e.y,t.y)}}function NR(e,t){let n=.5;const r=Pt(e),o=Pt(t);return o>r?n=Os(t.min,t.max-r,e.min):r>o&&(n=Os(e.min,e.max-o,t.min)),yr(0,1,n)}function MR(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 kd=.35;function PR(e=kd){return e===!1?e=0:e===!0&&(e=kd),{x:Fp(e,"left","right"),y:Fp(e,"top","bottom")}}function Fp(e,t,n){return{min:$p(e,t),max:$p(e,n)}}function $p(e,t){return typeof e=="number"?e:e[t]||0}const LR=new WeakMap;class FR{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=ct(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Qs(f).point)},s=(f,d)=>{const{drag:h,dragPropagation:g,onDragStart:p}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=VE(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),sn(v=>{let y=this.getAxisMotionValue(v).get()||0;if(Hn.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const b=x.layout.layoutBox[v];b&&(y=Pt(b)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&Ue.postRender(()=>p(f,d)),Ed(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=d;if(g&&this.currentDirection===null){this.currentDirection=$R(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(f,d)},l=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>sn(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new m1(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:p1(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!r)return;const{velocity:s}=o;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&Ue.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Ta(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=RR(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&yi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=kR(r.layoutBox,t):this.constraints=!1,this.elastic=PR(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&sn(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=MR(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!yi(t))return!1;const r=t.current;vr(r!==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:o}=this.visualElement;if(!o||!o.layout)return!1;const i=O2(r,o.root,this.visualElement.getTransformPagePoint());let s=AR(o.layout.layoutBox,i);if(n){const a=n(L2(s));this.hasMutatedConstraints=!!a,a&&(s=e1(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=sn(u=>{if(!Ta(u,n,this.currentDirection))return;let f=l&&l[u]||{};s&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ed(this.visualElement,t),r.start(hh(t,r,0,n,this.visualElement,!1))}stopAnimation(){sn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){sn(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){sn(n=>{const{drag:r}=this.getProps();if(!Ta(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-Je(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!yi(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};sn(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();o[s]=NR({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),sn(s=>{if(!Ta(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(Je(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;LR.set(this.visualElement,this);const t=this.visualElement.current,n=Es(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();yi(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Ue.read(r);const s=Vs(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(sn(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=kd,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function Ta(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $R(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class OR extends Zr{constructor(t){super(t),this.removeGroupControls=cn,this.removeListeners=cn,this.controls=new FR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Op=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class IR extends Zr{constructor(){super(...arguments),this.removePointerDownListener=cn}onPointerDown(t){this.session=new m1(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:p1(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Op(t),onStart:Op(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&Ue.postRender(()=>o(i,s))}}}mount(){this.removePointerDownListener=Es(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 nl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let qc=!1;class DR extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),qc&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),nl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,qc=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Ue.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),nh.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;qc=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function v1(e){const[t,n]=jx(),r=S.useContext($f);return C.jsx(DR,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(Jx),isPresent:t,safeToRemove:n})}function jR(e,t,n){const r=St(e)?e:Pi(e);return r.start(hh("",r,t,n)),r.animation}const VR=(e,t)=>e.depth-t.depth;class BR{constructor(){this.children=[],this.isDirty=!1}add(t){Df(this.children,t),this.isDirty=!0}remove(t){jf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(VR),this.isDirty=!1,this.children.forEach(t)}}function zR(e,t){const n=jt.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(jr(r),e(i-t))};return Ue.setup(r,!0),()=>jr(r)}const x1=["TopLeft","TopRight","BottomLeft","BottomRight"],HR=x1.length,Ip=e=>typeof e=="string"?parseFloat(e):e,Dp=e=>typeof e=="number"||he.test(e);function WR(e,t,n,r,o,i){o?(e.opacity=Je(0,n.opacity??1,KR(r)),e.opacityExit=Je(t.opacity??1,0,UR(r))):i&&(e.opacity=Je(t.opacity??1,n.opacity??1,r));for(let s=0;s<HR;s++){const a=`border${x1[s]}Radius`;let l=jp(t,a),c=jp(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Dp(l)===Dp(c)?(e[a]=Math.max(Je(Ip(l),Ip(c),r),0),(Hn.test(c)||Hn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Je(t.rotate||0,n.rotate||0,r))}function jp(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const KR=b1(0,.5,ox),UR=b1(.5,.95,cn);function b1(e,t,n){return r=>r<e?0:r>t?1:n(Os(e,t,r))}function Vp(e,t){e.min=t.min,e.max=t.max}function mn(e,t){Vp(e.x,t.x),Vp(e.y,t.y)}function Bp(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function zp(e,t,n,r,o){return e-=t,e=vl(e,1/n,r),o!==void 0&&(e=vl(e,1/o,r)),e}function GR(e,t=0,n=1,r=.5,o,i=e,s=e){if(Hn.test(t)&&(t=parseFloat(t),t=Je(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Je(i.min,i.max,r);e===i&&(a-=t),e.min=zp(e.min,t,n,a,o),e.max=zp(e.max,t,n,a,o)}function Hp(e,t,[n,r,o],i,s){GR(e,t[n],t[r],t[o],t.scale,i,s)}const qR=["x","scaleX","originX"],YR=["y","scaleY","originY"];function Wp(e,t,n,r){Hp(e.x,t,qR,n?n.x:void 0,r?r.x:void 0),Hp(e.y,t,YR,n?n.y:void 0,r?r.y:void 0)}function Kp(e){return e.translate===0&&e.scale===1}function w1(e){return Kp(e.x)&&Kp(e.y)}function Up(e,t){return e.min===t.min&&e.max===t.max}function XR(e,t){return Up(e.x,t.x)&&Up(e.y,t.y)}function Gp(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function C1(e,t){return Gp(e.x,t.x)&&Gp(e.y,t.y)}function qp(e){return Pt(e.x)/Pt(e.y)}function Yp(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class ZR{constructor(){this.members=[]}add(t){Df(this.members,t),t.scheduleRender()}remove(t){if(jf(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(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function JR(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=n?.z||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:d,skewX:h,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Yc=["","X","Y","Z"],QR=1e3;let ek=0;function Xc(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function S1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=l1(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&S1(r)}function _1({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t?.()){this.id=ek++,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.layoutVersion=0,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(rk),this.nodes.forEach(ak),this.nodes.forEach(lk),this.nodes.forEach(ok)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,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 BR)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Bf),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Dx(s)&&!UE(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const d=()=>this.root.updateBlockedByResize=!1;Ue.read(()=>{f=window.innerWidth}),e(s,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=zR(d,250),nl.hasAnimatedSinceResize&&(nl.hasAnimatedSinceResize=!1,this.nodes.forEach(Jp)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||hk,{onLayoutAnimationStart:p,onLayoutAnimationComplete:m}=c.getProps(),v=!this.targetLayout||!C1(this.targetLayout,h),y=!f&&d;if(this.options.layoutRoot||this.resumeFrom||y||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...eh(g,"layout"),onPlay:p,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,y)}else f||Jp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),jr(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(ck),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&S1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Xp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Zp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(sk),this.nodes.forEach(tk),this.nodes.forEach(nk)):this.nodes.forEach(Zp),this.clearAllSnapshots();const a=jt.now();mt.delta=yr(0,1e3/60,a-mt.timestamp),mt.timestamp=a,mt.isProcessing=!0,Dc.update.process(mt),Dc.preRender.process(mt),Dc.render.process(mt),mt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,nh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ik),this.sharedNodes.forEach(uk)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pt(this.snapshot.measuredBox.x)&&!Pt(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 s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ct(),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,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!w1(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||uo(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),gk(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return ct();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(pk))){const{scroll:c}=this.root;c&&(vi(a.x,c.offset.x),vi(a.y,c.offset.y))}return a}removeElementScroll(s){const a=ct();if(mn(a,s),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:f}=c;c!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&mn(a,s),vi(a.x,u.offset.x),vi(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const l=ct();mn(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&xi(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),uo(u.latestValues)&&xi(l,u.latestValues)}return uo(this.latestValues)&&xi(l,this.latestValues),l}removeTransform(s){const a=ct();mn(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!uo(c.latestValues))continue;Cd(c.latestValues)&&c.updateSnapshot();const u=ct(),f=c.measurePageBox();mn(u,f),Wp(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return uo(this.latestValues)&&Wp(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==mt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!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(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=mt.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ct(),this.targetWithTransforms=ct()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),SR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):mn(this.target,this.layout.layoutBox),n1(this.target,this.targetDelta)):mn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Cd(this.parent.latestValues)||t1(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,l){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ct(),this.relativeTargetOrigin=ct(),xl(this.relativeTargetOrigin,a,l),mn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===mt.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;mn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;$2(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=ct());const{target:h}=s;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Bp(this.prevProjectionDelta.x,this.projectionDelta.x),Bp(this.prevProjectionDelta.y,this.projectionDelta.y)),Rs(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!Yp(this.projectionDelta.x,this.prevProjectionDelta.x)||!Yp(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bi(),this.projectionDelta=bi(),this.projectionDeltaWithTransform=bi()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=bi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=ct(),h=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=h!==g,m=this.getStack(),v=!m||m.members.length<=1,y=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(fk));this.animationProgress=0;let x;this.mixTargetDelta=b=>{const w=b/1e3;Qp(f.x,s.x,w),Qp(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xl(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dk(this.relativeTarget,this.relativeTargetOrigin,d,w),x&&XR(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ct()),mn(x,this.relativeTarget)),p&&(this.animationValues=u,WR(u,c,this.latestValues,w,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(jr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{nl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pi(0)),this.currentAnimation=jR(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(QR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&T1(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ct();const f=Pt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const d=Pt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+d}mn(a,l),xi(a,u),Rs(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new ZR),this.sharedNodes.get(s).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 s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Xc("z",s,c,this.animationValues);for(let u=0;u<Yc.length;u++)Xc(`rotate${Yc[u]}`,s,c,this.animationValues),Xc(`skew${Yc[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=tl(a?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=tl(a?.pointerEvents)||""),this.hasProjected&&!uo(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=JR(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),s.transform=f;const{x:d,y:h}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in wd){if(u[g]===void 0)continue;const{correct:p,applyTo:m,isCSSVariable:v}=wd[g],y=f==="none"?u[g]:p(u[g],c);if(m){const x=m.length;for(let b=0;b<x;b++)s[m[b]]=y}else v?this.options.visualElement.renderState.vars[g]=y:s[g]=y}this.options.layoutId&&(s.pointerEvents=c===this?tl(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(Xp),this.root.sharedNodes.clear()}}}function tk(e){e.updateLayout()}function nk(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?sn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=Pt(f);f.min=n[u].min,f.max=f.min+d}):T1(o,t.layoutBox,n)&&sn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=Pt(n[u]);f.max=f.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=bi();Rs(s,n,t.layoutBox);const a=bi();i?Rs(a,e.applyTransform(r,!0),t.measuredBox):Rs(a,n,t.layoutBox);const l=!w1(s);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const h=ct();xl(h,t.layoutBox,f.layoutBox);const g=ct();xl(g,n,d.layoutBox),C1(h,g)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function rk(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 ok(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ik(e){e.clearSnapshot()}function Xp(e){e.clearMeasurements()}function Zp(e){e.isLayoutDirty=!1}function sk(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Jp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ak(e){e.resolveTargetDelta()}function lk(e){e.calcProjection()}function ck(e){e.resetSkewAndRotation()}function uk(e){e.removeLeadSnapshot()}function Qp(e,t,n){e.translate=Je(t.translate,0,n),e.scale=Je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function em(e,t,n,r){e.min=Je(t.min,n.min,r),e.max=Je(t.max,n.max,r)}function dk(e,t,n,r){em(e.x,t.x,n.x,r),em(e.y,t.y,n.y,r)}function fk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const hk={duration:.45,ease:[.4,0,.1,1]},tm=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nm=tm("applewebkit/")&&!tm("chrome/")?Math.round:cn;function rm(e){e.min=nm(e.min),e.max=nm(e.max)}function gk(e){rm(e.x),rm(e.y)}function T1(e,t,n){return e==="position"||e==="preserve-aspect"&&!CR(qp(t),qp(n),.2)}function pk(e){return e!==e.root&&e.scroll?.wasRoot}const mk=_1({attachResizeListener:(e,t)=>Vs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Zc={current:void 0},E1=_1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Zc.current){const e=new mk({});e.mount(window),e.setOptions({layoutScroll:!0}),Zc.current=e}return Zc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),yk={pan:{Feature:IR},drag:{Feature:OR,ProjectionNode:E1,MeasureLayout:v1}};function om(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&Ue.postRender(()=>i(t,Qs(t)))}class vk extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=BE(t,(n,r)=>(om(this.node,r,"Start"),o=>om(this.node,o,"End"))))}unmount(){}}class xk extends Zr{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=Xs(Vs(this.node.current,"focus",()=>this.onFocus()),Vs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function im(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&Ue.postRender(()=>i(t,Qs(t)))}class bk extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=KE(t,(n,r)=>(im(this.node,r,"Start"),(o,{success:i})=>im(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ad=new WeakMap,Jc=new WeakMap,wk=e=>{const t=Ad.get(e.target);t&&t(e)},Ck=e=>{e.forEach(wk)};function Sk({root:e,...t}){const n=e||document;Jc.has(n)||Jc.set(n,{});const r=Jc.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Ck,{root:e,...t})),r[o]}function _k(e,t,n){const r=Sk(t);return Ad.set(e,n),r.observe(e),()=>{Ad.delete(e),r.unobserve(e)}}const Tk={some:0,all:1};class Ek extends Zr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:Tk[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),d=c?u:f;d&&d(l)};return _k(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Rk(t,n))&&this.startObserver()}unmount(){}}function Rk({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const kk={inView:{Feature:Ek},tap:{Feature:bk},focus:{Feature:xk},hover:{Feature:vk}},Ak={layout:{ProjectionNode:E1,MeasureLayout:v1}},Nk={...mR,...kk,...yk,...Ak},ea=P2(Nk,K2),yn={fontFamily:"Inter, sans-serif",wordBreak:"break-word"},xe={common:yn,title1:{...yn,fontSize:32,lineHeight:"36px",[vs.md()]:{fontSize:24}},title2:{...yn,fontSize:24,lineHeight:"28px",[vs.md()]:{fontSize:20}},title3:{...yn,fontSize:20,lineHeight:"28px",[vs.md()]:{fontSize:18},[vs.xs()]:{fontSize:16}},headline1:{...yn,fontSize:22,lineHeight:"26px"},headline2:{...yn,fontSize:18,lineHeight:"22px"},headline3:{...yn,fontSize:16,lineHeight:"20px"},body1:{...yn,fontSize:16,lineHeight:"24px"},body2:{...yn,fontSize:14,lineHeight:"20px"},caption1:{...yn,fontSize:12,lineHeight:"16px"},caption2:{...yn,fontSize:10,lineHeight:"14px"}},{transition:Mk,color:er,fontWeight:Ea}=V,Ra={text:T.css({transition:Mk.general}),inherit:T.css({}),"title-1":T.css({...xe.title1}),"title-2":T.css({...xe.title2}),"title-3":T.css({...xe.title3}),"headline-1":T.css({...xe.headline1}),"headline-2":T.css({...xe.headline2}),"headline-3":T.css({...xe.headline3}),"body-1":T.css({...xe.body1}),"body-2":T.css({...xe.body2}),"caption-1":T.css({...xe.caption1}),"caption-2":T.css({...xe.caption2}),primary:T.css({color:er.text.primary}),secondary:T.css({color:er.text.secondary}),tertiary:T.css({color:er.text.tertiary}),positive:T.css({color:er.text.positive}),negative:T.css({color:er.text.negative}),warning:T.css({color:er.text.warning}),accent:T.css({color:er.text.accent}),inverse:T.css({color:er.text.inverse}),transfer:T.css({color:er.text.transfer}),regular:T.css({fontWeight:Ea.regular}),medium:T.css({fontWeight:Ea.medium}),semibold:T.css({fontWeight:Ea.semibold}),bold:T.css({fontWeight:Ea.bold})},Pk=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"),T.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})},le=S.forwardRef(({children:e,className:t,variant:n="body-1",fontWeight:r="medium",tag:o="p",colorName:i="primary",inherit:s=!1,style:a,clickOpacity:l=.5,opacityDuration:c=200,onClick:u,disabled:f,mt:d,mb:h,ml:g,mr:p,flex:m,cursor:v,wordBreak:y,whiteSpace:x,textOverflow:b,decoration:w,color:_,center:E,left:R,right:k,uppercase:P,lowercase:F,capitalize:$,overflow:j,...O},D)=>{const[K,I]=S.useState(!1),M=!!u,H=()=>M&&I(!0),U=()=>M&&I(!1),re=Pk({mt:d,mb:h,ml:g,mr:p,flex:m,cursor:v,wordBreak:y,whiteSpace:x,textOverflow:b,decoration:w,color:_,center:E,left:R,right:k,uppercase:P,lowercase:F,capitalize:$,overflow:j}),G=o,Y=Ra[s?"inherit":n],Q=Ra[s?"inherit":i],ne=Ra[s?"inherit":r],oe=M?T.css({opacity:K?l:1,transition:`opacity ${c}ms ease`}):"";return C.jsx(G,{ref:D,...O,className:T.cx(Ra.text,Y,Q,ne,oe,t,re),style:a,onClick:u,onMouseDown:H,onMouseUp:U,onMouseLeave:U,onTouchStart:H,onTouchEnd:U,role:M?"button":void 0,tabIndex:M?0:void 0,children:e})});le.displayName="Text";const R1=ea(le),{color:Nd,cornerRadius:Yt,height:ka,transition:Lk}=V,Fk=T.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}),as={zero:Yt.zero,xs:Yt.xs,sm:Yt.sm,md:Yt.md,lg:Yt.lg,xl:Yt.xl,"2xl":Yt["2xl"],"3xl":Yt["3xl"],"4xl":Yt["4xl"],"5xl":Yt["5xl"],"6xl":Yt["6xl"],"full-round":Yt.fullRound},$k={xs:ka.button.xs,sm:ka.button.sm,md:ka.button.md,lg:ka.button.lg},Ok={clear:T.css({backgroundColor:"transparent",border:"none"}),filled:T.css({backgroundColor:Nd.fill.accentPrimary,color:"white",border:"none"}),outline:T.css({backgroundColor:"transparent",border:`1px solid ${Nd.border.accentPrimary}`})},Ik=(e,t,n,r)=>{if(r)return T.css({cursor:"not-allowed",opacity:.7});const o={transition:Lk.general,borderRadius:Yt.lg,border:"none",color:e==="filled"?Nd.text.inverse:`var(--text-${t})`};switch(e){case"filled":return T.css({...o,backgroundColor:`var(--fill-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${t}-${n}-hover)`}});case"outline":return T.css({...o,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 T.css({...o,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});default:return T.css(o)}},{color:Aa}=V,Br=({disabled:e,loading:t,className:n,wrapperClassName:r,buttonClassName:o,buttonDisabledClassName:i,textClassName:s,children:a,variant:l="filled",backgroundColor:c,textColor:u,textFontWeight:f,borderColor:d,color:h="accent",opacity:g,borderRadius:p,width:m="full",size:v="md",iconLeft:y,iconRight:x,intensity:b="primary",flex:w,type:_="button",...E})=>{const R=S.useMemo(()=>{switch(m){case"full":return"100%";case"auto":return"auto";default:return m}},[m]),k=S.useMemo(()=>c||(l==="filled"?h==="neutral"?Aa.fill.neutralSecondary:`var(--fill-${h}-${b})`:"transparent"),[l,c,h,b]),P=S.useMemo(()=>{if(b==="primary"){if(h==="neutral")return Aa.text.secondary;if(l==="filled")return Aa.text.inverse}else if(h==="neutral")return Aa.text.secondary;return`var(--text-${h})`},[b,h,l]),F=S.useMemo(()=>{if(b==="primary"){if(h==="neutral")return"secondary";if(l==="filled")return"inverse"}else if(h==="neutral")return"secondary";return h},[l,h,b]),$=S.useMemo(()=>d||(l==="outline"?`var(--border-${h}-${b})`:"transparent"),[l,d,h,b]),j=S.useMemo(()=>{switch(v){case"lg":return as.lg;case"md":case"sm":return as.md;case"xs":return as.sm;default:return as.md}},[v]),O=T.cx(Fk,Ik(l,h,b,e),Ok[l],e?i:void 0,T.css({borderRadius:p?as[p]:j,backgroundColor:k,borderColor:$,color:u??`var(--text-${F})`,width:"100%",height:$k[v],opacity:g||(e?.7:1)}),o),D=S.useMemo(()=>{switch(v){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[v]);return C.jsx(q,{className:T.cx(r,n),w:R,flex:w,relative:!0,overflow:"hidden",children:C.jsxs(ea.button,{...E,whileTap:!e&&!t?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},disabled:e||t,className:O,type:_,children:[t?C.jsx(z0,{color:P}):C.jsxs(C.Fragment,{children:[y,C.jsx(R1,{style:{color:u},colorName:F,variant:D,className:s,textOverflow:"ellipsis",overflow:"hidden",children:a}),x]}),C.jsx(zo,{})]})})},Dk=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),jk=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),{color:ao}=V,Sr={checkbox:T.css({display:"inline-flex",alignItems:"flex-start",gap:8,userSelect:"none"}),disabled:T.css({cursor:"not-allowed",opacity:.5}),checkbox__input:T.css({position:"absolute",opacity:0,width:"var(--checkbox-size)",height:"var(--checkbox-size)"}),checkbox__box:T.css({width:"var(--checkbox-size)",height:"var(--checkbox-size)",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${ao.border.neutralAlphaHigh}`,backgroundColor:ao.fill.bgSecondary,opacity:1,transition:"all 0.15s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative","& svg":{color:ao.border.accentPrimary}}),checked:T.css({borderColor:`${ao.border.accentPrimary} !important`,backgroundColor:`${ao.fill.accentSecondary} !important`}),error:T.css({borderColor:ao.border.negativePrimary,backgroundColor:ao.fill.negativeSecondary})},Vk={primary:T.css({}),secondary:T.css({backgroundColor:"transparent"})},Bk={sm:20,md:24},gh=S.forwardRef(({checked:e,onChange:t,disabled:n,error:r,indeterminate:o,size:i="md",title:s,titleColor:a,subtitle:l,subtitleColor:c="secondary",name:u,required:f,variant:d="primary",flex:h,readOnly:g,className:p,inputClassName:m,boxClassName:v,titleClassName:y,subtitleClassName:x},b)=>{const[w,_]=S.useState(!1),E=e!==void 0,R=E?e:w,k=O=>{E||_(O.target.checked),t?.(O)},P=Bk[i],F=R||o,$=!!g&&!n,j=n?"not-allowed":$?"auto":"pointer";return C.jsxs("label",{className:T.cx(Sr.checkbox,T.css({flex:h,cursor:j}),{[Sr.disabled]:n},p),children:[C.jsxs(q,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${P}px`,"--checkbox-size-double":`${P*2}px`},children:[C.jsx("input",{ref:b,type:"checkbox",checked:R,onChange:$?void 0:k,onClick:O=>O.stopPropagation(),disabled:n,readOnly:$,name:u,required:f,className:T.cx(Sr.checkbox__input,{[Sr.disabled]:n},T.css({cursor:j}),m)}),C.jsx("div",{className:T.cx(Sr.checkbox__box,Vk[d],{[Sr.disabled]:n,[Sr.error]:r,[Sr.checked]:F},v),children:F&&(o?C.jsx(jk,{width:P*.75,height:P*.75}):C.jsx(Dk,{width:P*.75,height:P*.75}))})]}),(s||l)&&C.jsxs(q,{gap:4,children:[s&&C.jsx(le,{colorName:a,variant:i==="sm"?"body-2":"body-1",className:y,children:s}),l&&C.jsx(le,{variant:"body-2",colorName:c,className:x,children:l})]})]})});gh.displayName="Checkbox";function Jl(){return typeof window<"u"}function Ki(e){return k1(e)?(e.nodeName||"").toLowerCase():"#document"}function Bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jn(e){var t;return(t=(k1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function k1(e){return Jl()?e instanceof Node||e instanceof Bt(e).Node:!1}function De(e){return Jl()?e instanceof Element||e instanceof Bt(e).Element:!1}function Ft(e){return Jl()?e instanceof HTMLElement||e instanceof Bt(e).HTMLElement:!1}function Md(e){return!Jl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bt(e).ShadowRoot}const zk=new Set(["inline","contents"]);function ta(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!zk.has(o)}const Hk=new Set(["table","td","th"]);function Wk(e){return Hk.has(Ki(e))}const Kk=[":popover-open",":modal"];function Ql(e){return Kk.some(t=>{try{return e.matches(t)}catch{return!1}})}const Uk=["transform","translate","scale","rotate","perspective"],Gk=["transform","translate","scale","rotate","perspective","filter"],qk=["paint","layout","strict","content"];function ph(e){const t=ec(),n=De(e)?dn(e):e;return Uk.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Gk.some(r=>(n.willChange||"").includes(r))||qk.some(r=>(n.contain||"").includes(r))}function Yk(e){let t=br(e);for(;Ft(t)&&!mr(t);){if(ph(t))return t;if(Ql(t))return null;t=br(t)}return null}function ec(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Xk=new Set(["html","body","#document"]);function mr(e){return Xk.has(Ki(e))}function dn(e){return Bt(e).getComputedStyle(e)}function tc(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function br(e){if(Ki(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Md(e)&&e.host||Jn(e);return Md(t)?t.host:t}function A1(e){const t=br(e);return mr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ft(t)&&ta(t)?t:A1(t)}function Ir(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=A1(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Bt(o);if(i){const a=Pd(s);return t.concat(s,s.visualViewport||[],ta(o)?o:[],a&&n?Ir(a):[])}return t.concat(o,Ir(o,[],n))}function Pd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const zr=Math.min,Xt=Math.max,bl=Math.round,Na=Math.floor,Wn=e=>({x:e,y:e}),Zk={left:"right",right:"left",bottom:"top",top:"bottom"},Jk={start:"end",end:"start"};function Ld(e,t,n){return Xt(e,zr(t,n))}function Ui(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function Gi(e){return e.split("-")[1]}function N1(e){return e==="x"?"y":"x"}function mh(e){return e==="y"?"height":"width"}const Qk=new Set(["top","bottom"]);function fr(e){return Qk.has(Hr(e))?"y":"x"}function yh(e){return N1(fr(e))}function e3(e,t,n){n===void 0&&(n=!1);const r=Gi(e),o=yh(e),i=mh(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=wl(s)),[s,wl(s)]}function t3(e){const t=wl(e);return[Fd(e),t,Fd(t)]}function Fd(e){return e.replace(/start|end/g,t=>Jk[t])}const sm=["left","right"],am=["right","left"],n3=["top","bottom"],r3=["bottom","top"];function o3(e,t,n){switch(e){case"top":case"bottom":return n?t?am:sm:t?sm:am;case"left":case"right":return t?n3:r3;default:return[]}}function i3(e,t,n,r){const o=Gi(e);let i=o3(Hr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Fd)))),i}function wl(e){return e.replace(/left|right|bottom|top/g,t=>Zk[t])}function s3(e){return{top:0,right:0,bottom:0,left:0,...e}}function M1(e){return typeof e!="number"?s3(e):{top:e,right:e,bottom:e,left:e}}function Cl(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function a3(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function l3(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function c3(){return/apple/i.test(navigator.vendor)}function u3(){return a3().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function d3(){return l3().includes("jsdom/")}const lm="data-floating-ui-focusable",f3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function cm(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Bs(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Md(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ci(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Qc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function h3(e){return e.matches("html,body")}function wo(e){return e?.ownerDocument||document}function P1(e){return Ft(e)&&e.matches(f3)}function g3(e){if(!e||d3())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function p3(e){return e?e.hasAttribute(lm)?e:e.querySelector("["+lm+"]")||e:null}function rl(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...rl(e,o.id,n)])}function m3(e){return"nativeEvent"in e}function zs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var y3=typeof document<"u",v3=function(){},Fi=y3?S.useLayoutEffect:v3;const x3={...N};function Ma(e){const t=N.useRef(e);return Fi(()=>{t.current=e}),t}const b3=x3.useInsertionEffect,w3=b3||(e=>e());function jn(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return w3(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function um(e,t,n){let{reference:r,floating:o}=e;const i=fr(t),s=yh(t),a=mh(s),l=Hr(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Gi(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const C3=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=um(c,r,l),d=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:v}=a[p],{x:y,y:x,data:b,reset:w}=await v({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=x??f,h={...h,[m]:{...h[m],...b}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(d=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:f}=um(c,d,l)),p=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}};async function vh(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Ui(t,e),g=M1(h),m=a[d?f==="floating"?"reference":"floating":f],v=Cl(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},w=Cl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(v.top-w.top+g.top)/b.y,bottom:(w.bottom-v.bottom+g.bottom)/b.y,left:(v.left-w.left+g.left)/b.x,right:(w.right-v.right+g.right)/b.x}}const S3=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Ui(e,t)||{};if(c==null)return{};const f=M1(u),d={x:n,y:r},h=yh(o),g=mh(h),p=await s.getDimensions(c),m=h==="y",v=m?"top":"left",y=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[h]-d[h]-i.floating[g],w=d[h]-i.reference[h],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=_?_[x]:0;(!E||!await(s.isElement==null?void 0:s.isElement(_)))&&(E=a.floating[x]||i.floating[g]);const R=b/2-w/2,k=E/2-p[g]/2-1,P=zr(f[v],k),F=zr(f[y],k),$=P,j=E-p[g]-F,O=E/2-p[g]/2+R,D=Ld($,O,j),K=!l.arrow&&Gi(o)!=null&&O!==D&&i.reference[g]/2-(O<$?P:F)-p[g]/2<0,I=K?O<$?O-$:O-j:0;return{[h]:d[h]+I,data:{[h]:D,centerOffset:O-D-I,...K&&{alignmentOffset:I}},reset:K}}}),_3=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=Ui(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Hr(o),y=fr(a),x=Hr(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=d||(x||!p?[wl(a)]:t3(a)),_=g!=="none";!d&&_&&w.push(...i3(a,p,g,b));const E=[a,...w],R=await vh(t,m),k=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(R[v]),f){const O=e3(o,s,b);k.push(R[O[0]],R[O[1]])}if(P=[...P,{placement:o,overflows:k}],!k.every(O=>O<=0)){var F,$;const O=(((F=i.flip)==null?void 0:F.index)||0)+1,D=E[O];if(D&&(!(f==="alignment"?y!==fr(D):!1)||P.every(M=>fr(M.placement)===y?M.overflows[0]>0:!0)))return{data:{index:O,overflows:P},reset:{placement:D}};let K=($=P.filter(I=>I.overflows[0]<=0).sort((I,M)=>I.overflows[1]-M.overflows[1])[0])==null?void 0:$.placement;if(!K)switch(h){case"bestFit":{var j;const I=(j=P.filter(M=>{if(_){const H=fr(M.placement);return H===y||H==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(H=>H>0).reduce((H,U)=>H+U,0)]).sort((M,H)=>M[1]-H[1])[0])==null?void 0:j[0];I&&(K=I);break}case"initialPlacement":K=a;break}if(o!==K)return{reset:{placement:K}}}return{}}}},T3=new Set(["left","top"]);async function E3(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Hr(n),a=Gi(n),l=fr(n)==="y",c=T3.has(s)?-1:1,u=i&&l?-1:1,f=Ui(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const R3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await E3(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},k3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:v,y}=m;return{x:v,y}}},...l}=Ui(e,t),c={x:n,y:r},u=await vh(t,l),f=fr(Hr(o)),d=N1(f);let h=c[d],g=c[f];if(i){const m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=h+u[m],x=h-u[v];h=Ld(y,h,x)}if(s){const m=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=g+u[m],x=g-u[v];g=Ld(y,g,x)}const p=a.fn({...t,[d]:h,[f]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[d]:i,[f]:s}}}}}},A3=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Ui(e,t),u=await vh(t,c),f=Hr(o),d=Gi(o),h=fr(o)==="y",{width:g,height:p}=i.floating;let m,v;f==="top"||f==="bottom"?(m=f,v=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,m=d==="end"?"top":"bottom");const y=p-u.top-u.bottom,x=g-u.left-u.right,b=zr(p-u[m],y),w=zr(g-u[v],x),_=!t.middlewareData.shift;let E=b,R=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=y),_&&!d){const P=Xt(u.left,0),F=Xt(u.right,0),$=Xt(u.top,0),j=Xt(u.bottom,0);h?R=g-2*(P!==0||F!==0?P+F:Xt(u.left,u.right)):E=p-2*($!==0||j!==0?$+j:Xt(u.top,u.bottom))}await l({...t,availableWidth:R,availableHeight:E});const k=await s.getDimensions(a.floating);return g!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function L1(e){const t=dn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ft(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=bl(n)!==i||bl(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function xh(e){return De(e)?e:e.contextElement}function Si(e){const t=xh(e);if(!Ft(t))return Wn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=L1(t);let s=(i?bl(n.width):n.width)/r,a=(i?bl(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const N3=Wn(0);function F1(e){const t=Bt(e);return!ec()||!t.visualViewport?N3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function M3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bt(e)?!1:t}function ko(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=xh(e);let s=Wn(1);t&&(r?De(r)&&(s=Si(r)):s=Si(e));const a=M3(i,n,r)?F1(i):Wn(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const d=Bt(i),h=r&&De(r)?Bt(r):r;let g=d,p=Pd(g);for(;p&&r&&h!==g;){const m=Si(p),v=p.getBoundingClientRect(),y=dn(p),x=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,b=v.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,f*=m.y,l+=x,c+=b,g=Bt(p),p=Pd(g)}}return Cl({width:u,height:f,x:l,y:c})}function nc(e,t){const n=tc(e).scrollLeft;return t?t.left+n:ko(Jn(e)).left+n}function $1(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-nc(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function P3(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Jn(r),a=t?Ql(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Wn(1);const u=Wn(0),f=Ft(r);if((f||!f&&!i)&&((Ki(r)!=="body"||ta(s))&&(l=tc(r)),Ft(r))){const h=ko(r);c=Si(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!i?$1(s,l):Wn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function L3(e){return Array.from(e.getClientRects())}function F3(e){const t=Jn(e),n=tc(e),r=e.ownerDocument.body,o=Xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+nc(e);const a=-n.scrollTop;return dn(r).direction==="rtl"&&(s+=Xt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const dm=25;function $3(e,t){const n=Bt(e),r=Jn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=ec();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=nc(r);if(c<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=dm&&(i-=g)}else c<=dm&&(i+=c);return{width:i,height:s,x:a,y:l}}const O3=new Set(["absolute","fixed"]);function I3(e,t){const n=ko(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ft(e)?Si(e):Wn(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function fm(e,t,n){let r;if(t==="viewport")r=$3(e,n);else if(t==="document")r=F3(Jn(e));else if(De(t))r=I3(t,n);else{const o=F1(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Cl(r)}function O1(e,t){const n=br(e);return n===t||!De(n)||mr(n)?!1:dn(n).position==="fixed"||O1(n,t)}function D3(e,t){const n=t.get(e);if(n)return n;let r=Ir(e,[],!1).filter(a=>De(a)&&Ki(a)!=="body"),o=null;const i=dn(e).position==="fixed";let s=i?br(e):e;for(;De(s)&&!mr(s);){const a=dn(s),l=ph(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&O3.has(o.position)||ta(s)&&!l&&O1(e,s))?r=r.filter(u=>u!==s):o=a,s=br(s)}return t.set(e,r),r}function j3(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Ql(t)?[]:D3(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=fm(t,u,o);return c.top=Xt(f.top,c.top),c.right=zr(f.right,c.right),c.bottom=zr(f.bottom,c.bottom),c.left=Xt(f.left,c.left),c},fm(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function V3(e){const{width:t,height:n}=L1(e);return{width:t,height:n}}function B3(e,t,n){const r=Ft(t),o=Jn(t),i=n==="fixed",s=ko(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Wn(0);function c(){l.x=nc(o)}if(r||!r&&!i)if((Ki(t)!=="body"||ta(o))&&(a=tc(t)),r){const h=ko(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?$1(o,a):Wn(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function eu(e){return dn(e).position==="static"}function hm(e,t){if(!Ft(e)||dn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Jn(e)===n&&(n=n.ownerDocument.body),n}function I1(e,t){const n=Bt(e);if(Ql(e))return n;if(!Ft(e)){let o=br(e);for(;o&&!mr(o);){if(De(o)&&!eu(o))return o;o=br(o)}return n}let r=hm(e,t);for(;r&&Wk(r)&&eu(r);)r=hm(r,t);return r&&mr(r)&&eu(r)&&!ph(r)?n:r||Yk(e)||n}const z3=async function(e){const t=this.getOffsetParent||I1,n=this.getDimensions,r=await n(e.floating);return{reference:B3(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function H3(e){return dn(e).direction==="rtl"}const W3={convertOffsetParentRelativeRectToViewportRelativeRect:P3,getDocumentElement:Jn,getClippingRect:j3,getOffsetParent:I1,getElementRects:z3,getClientRects:L3,getDimensions:V3,getScale:Si,isElement:De,isRTL:H3};function D1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function K3(e,t){let n=null,r;const o=Jn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=c;if(a||t(),!d||!h)return;const g=Na(f),p=Na(o.clientWidth-(u+d)),m=Na(o.clientHeight-(f+h)),v=Na(u),x={rootMargin:-g+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Xt(0,zr(1,l))||1};let b=!0;function w(_){const E=_[0].intersectionRatio;if(E!==l){if(!b)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!D1(c,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(w,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,x)}n.observe(e)}return s(!0),i}function bh(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=xh(e),u=o||i?[...c?Ir(c):[],...Ir(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const f=c&&a?K3(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(v=>{let[y]=v;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,p=l?ko(e):null;l&&m();function m(){const v=ko(e);p&&!D1(p,v)&&n(),p=v,g=requestAnimationFrame(m)}return n(),()=>{var v;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const U3=R3,G3=k3,q3=_3,Y3=A3,gm=S3,X3=(e,t,n)=>{const r=new Map,o={platform:W3,...n},i={...o.platform,_c:r};return C3(e,t,{...o,platform:i})};var Z3=typeof document<"u",J3=function(){},ol=Z3?S.useLayoutEffect:J3;function Sl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Sl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Sl(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function j1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pm(e,t){const n=j1(e);return Math.round(t*n)/n}function tu(e){const t=N.useRef(e);return ol(()=>{t.current=e}),t}function Q3(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=N.useState(r);Sl(d,r)||h(r);const[g,p]=N.useState(null),[m,v]=N.useState(null),y=N.useCallback(M=>{M!==_.current&&(_.current=M,p(M))},[]),x=N.useCallback(M=>{M!==E.current&&(E.current=M,v(M))},[]),b=i||g,w=s||m,_=N.useRef(null),E=N.useRef(null),R=N.useRef(u),k=l!=null,P=tu(l),F=tu(o),$=tu(c),j=N.useCallback(()=>{if(!_.current||!E.current)return;const M={placement:t,strategy:n,middleware:d};F.current&&(M.platform=F.current),X3(_.current,E.current,M).then(H=>{const U={...H,isPositioned:$.current!==!1};O.current&&!Sl(R.current,U)&&(R.current=U,A_.flushSync(()=>{f(U)}))})},[d,t,n,F,$]);ol(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[c]);const O=N.useRef(!1);ol(()=>(O.current=!0,()=>{O.current=!1}),[]),ol(()=>{if(b&&(_.current=b),w&&(E.current=w),b&&w){if(P.current)return P.current(b,w,j);j()}},[b,w,j,P,k]);const D=N.useMemo(()=>({reference:_,floating:E,setReference:y,setFloating:x}),[y,x]),K=N.useMemo(()=>({reference:b,floating:w}),[b,w]),I=N.useMemo(()=>{const M={position:n,left:0,top:0};if(!K.floating)return M;const H=pm(K.floating,u.x),U=pm(K.floating,u.y);return a?{...M,transform:"translate("+H+"px, "+U+"px)",...j1(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:U}},[n,a,K.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:j,refs:D,elements:K,floatingStyles:I}),[u,j,D,K,I])}const eA=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?gm({element:r.current,padding:o}).fn(n):{}:r?gm({element:r,padding:o}).fn(n):{}}}},wh=(e,t)=>({...U3(e),options:[e,t]}),Ch=(e,t)=>({...G3(e),options:[e,t]}),Sh=(e,t)=>({...q3(e),options:[e,t]}),tA=(e,t)=>({...Y3(e),options:[e,t]}),nA=(e,t)=>({...eA(e),options:[e,t]});function _l(e){const t=N.useRef(void 0),n=N.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i?.())}},e);return N.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const rA="data-floating-ui-focusable",mm="active",ym="selected",oA={...N};let vm=!1,iA=0;const xm=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+iA++;function sA(){const[e,t]=N.useState(()=>vm?xm():void 0);return Fi(()=>{e==null&&t(xm())},[]),N.useEffect(()=>{vm=!0},[]),e}const aA=oA.useId,V1=aA||sA;let $d;process.env.NODE_ENV!=="production"&&($d=new Set);function lA(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=$d)!=null&&e.has(o))){var i;(i=$d)==null||i.add(o),console.error(o)}}function cA(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const uA=N.createContext(null),dA=N.createContext(null),_h=()=>{var e;return((e=N.useContext(uA))==null?void 0:e.id)||null},Th=()=>N.useContext(dA);function Eh(e){return"data-floating-ui-"+e}function on(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const bm=Eh("safe-polygon");function nu(e,t,n){if(n&&!zs(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function ru(e){return typeof e=="function"?e():e}function B1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,h=Th(),g=_h(),p=Ma(c),m=Ma(l),v=Ma(n),y=Ma(f),x=N.useRef(),b=N.useRef(-1),w=N.useRef(),_=N.useRef(-1),E=N.useRef(!0),R=N.useRef(!1),k=N.useRef(()=>{}),P=N.useRef(!1),F=jn(()=>{var I;const M=(I=o.current.openEvent)==null?void 0:I.type;return M?.includes("mouse")&&M!=="mousedown"});N.useEffect(()=>{if(!a)return;function I(M){let{open:H}=M;H||(on(b),on(_),E.current=!0,P.current=!1)}return i.on("openchange",I),()=>{i.off("openchange",I)}},[a,i]),N.useEffect(()=>{if(!a||!p.current||!n)return;function I(H){F()&&r(!1,H,"hover")}const M=wo(s.floating).documentElement;return M.addEventListener("mouseleave",I),()=>{M.removeEventListener("mouseleave",I)}},[s.floating,n,r,a,p,F]);const $=N.useCallback(function(I,M,H){M===void 0&&(M=!0),H===void 0&&(H="hover");const U=nu(m.current,"close",x.current);U&&!w.current?(on(b),b.current=window.setTimeout(()=>r(!1,I,H),U)):M&&(on(b),r(!1,I,H))},[m,r]),j=jn(()=>{k.current(),w.current=void 0}),O=jn(()=>{if(R.current){const I=wo(s.floating).body;I.style.pointerEvents="",I.removeAttribute(bm),R.current=!1}}),D=jn(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);N.useEffect(()=>{if(!a)return;function I(G){if(on(b),E.current=!1,u&&!zs(x.current)||ru(y.current)>0&&!nu(m.current,"open"))return;const Y=nu(m.current,"open",x.current);Y?b.current=window.setTimeout(()=>{v.current||r(!0,G,"hover")},Y):n||r(!0,G,"hover")}function M(G){if(D()){O();return}k.current();const Y=wo(s.floating);if(on(_),P.current=!1,p.current&&o.current.floatingContext){n||on(b),w.current=p.current({...o.current.floatingContext,tree:h,x:G.clientX,y:G.clientY,onClose(){O(),j(),D()||$(G,!0,"safe-polygon")}});const ne=w.current;Y.addEventListener("mousemove",ne),k.current=()=>{Y.removeEventListener("mousemove",ne)};return}(x.current!=="touch"||!Bs(s.floating,G.relatedTarget))&&$(G)}function H(G){D()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:h,x:G.clientX,y:G.clientY,onClose(){O(),j(),D()||$(G)}})(G))}function U(){on(b)}function re(G){D()||$(G,!1)}if(De(s.domReference)){const G=s.domReference,Y=s.floating;return n&&G.addEventListener("mouseleave",H),d&&G.addEventListener("mousemove",I,{once:!0}),G.addEventListener("mouseenter",I),G.addEventListener("mouseleave",M),Y&&(Y.addEventListener("mouseleave",H),Y.addEventListener("mouseenter",U),Y.addEventListener("mouseleave",re)),()=>{n&&G.removeEventListener("mouseleave",H),d&&G.removeEventListener("mousemove",I),G.removeEventListener("mouseenter",I),G.removeEventListener("mouseleave",M),Y&&(Y.removeEventListener("mouseleave",H),Y.removeEventListener("mouseenter",U),Y.removeEventListener("mouseleave",re))}}},[s,a,e,u,d,$,j,O,r,n,v,h,m,p,o,D,y]),Fi(()=>{var I;if(a&&n&&(I=p.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&F()){R.current=!0;const H=s.floating;if(De(s.domReference)&&H){var M;const U=wo(s.floating).body;U.setAttribute(bm,"");const re=s.domReference,G=h==null||(M=h.nodesRef.current.find(Y=>Y.id===g))==null||(M=M.context)==null?void 0:M.elements.floating;return G&&(G.style.pointerEvents=""),U.style.pointerEvents="none",re.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{U.style.pointerEvents="",re.style.pointerEvents="",H.style.pointerEvents=""}}}},[a,n,g,s,h,p,F]),Fi(()=>{n||(x.current=void 0,P.current=!1,j(),O())},[n,j,O]),N.useEffect(()=>()=>{j(),on(b),on(_),O()},[a,s.domReference,j,O]);const K=N.useMemo(()=>{function I(M){x.current=M.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(M){const{nativeEvent:H}=M;function U(){!E.current&&!v.current&&r(!0,H,"hover")}u&&!zs(x.current)||n||ru(y.current)===0||P.current&&M.movementX**2+M.movementY**2<2||(on(_),x.current==="touch"?U():(P.current=!0,_.current=window.setTimeout(U,ru(y.current))))}}},[u,r,n,v,y]);return N.useMemo(()=>a?{reference:K}:{},[a,K])}function wm(e){return Ft(e.target)&&e.target.tagName==="BUTTON"}function fA(e){return Ft(e.target)&&e.target.tagName==="A"}function Cm(e){return P1(e)}function hA(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=N.useRef(),h=N.useRef(!1),g=N.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(zs(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}zs(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||wm(p))&&(p.key===" "&&!Cm(i)&&(p.preventDefault(),h.current=!0),!fA(p)&&p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||wm(p)||Cm(i)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,i,a,c,u,r,n,f,l]);return N.useMemo(()=>s?{reference:g}:{},[s,g])}const gA={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},pA={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Sm=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function z1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:h,capture:g}=t,p=Th(),m=jn(typeof l=="function"?l:()=>!1),v=typeof l=="function"?m:l,y=N.useRef(!1),{escapeKey:x,outsidePress:b}=Sm(h),{escapeKey:w,outsidePress:_}=Sm(g),E=N.useRef(!1),R=jn(O=>{var D;if(!n||!s||!a||O.key!=="Escape"||E.current)return;const K=(D=i.current.floatingContext)==null?void 0:D.nodeId,I=p?rl(p.nodesRef.current,K):[];if(!x&&(O.stopPropagation(),I.length>0)){let M=!0;if(I.forEach(H=>{var U;if((U=H.context)!=null&&U.open&&!H.context.dataRef.current.__escapeKeyBubbles){M=!1;return}}),!M)return}r(!1,m3(O)?O.nativeEvent:O,"escape-key")}),k=jn(O=>{var D;const K=()=>{var I;R(O),(I=ci(O))==null||I.removeEventListener("keydown",K)};(D=ci(O))==null||D.addEventListener("keydown",K)}),P=jn(O=>{var D;const K=i.current.insideReactTree;i.current.insideReactTree=!1;const I=y.current;if(y.current=!1,c==="click"&&I||K||typeof v=="function"&&!v(O))return;const M=ci(O),H="["+Eh("inert")+"]",U=wo(o.floating).querySelectorAll(H);let re=De(M)?M:null;for(;re&&!mr(re);){const ne=br(re);if(mr(ne)||!De(ne))break;re=ne}if(U.length&&De(M)&&!h3(M)&&!Bs(M,o.floating)&&Array.from(U).every(ne=>!Bs(re,ne)))return;if(Ft(M)&&j){const ne=mr(M),oe=dn(M),me=/auto|scroll/,ee=ne||me.test(oe.overflowX),ve=ne||me.test(oe.overflowY),Se=ee&&M.clientWidth>0&&M.scrollWidth>M.clientWidth,Ee=ve&&M.clientHeight>0&&M.scrollHeight>M.clientHeight,ze=oe.direction==="rtl",je=Ee&&(ze?O.offsetX<=M.offsetWidth-M.clientWidth:O.offsetX>M.clientWidth),Rt=Se&&O.offsetY>M.clientHeight;if(je||Rt)return}const G=(D=i.current.floatingContext)==null?void 0:D.nodeId,Y=p&&rl(p.nodesRef.current,G).some(ne=>{var oe;return Qc(O,(oe=ne.context)==null?void 0:oe.elements.floating)});if(Qc(O,o.floating)||Qc(O,o.domReference)||Y)return;const Q=p?rl(p.nodesRef.current,G):[];if(Q.length>0){let ne=!0;if(Q.forEach(oe=>{var me;if((me=oe.context)!=null&&me.open&&!oe.context.dataRef.current.__outsidePressBubbles){ne=!1;return}}),!ne)return}r(!1,O,"outside-press")}),F=jn(O=>{var D;const K=()=>{var I;P(O),(I=ci(O))==null||I.removeEventListener(c,K)};(D=ci(O))==null||D.addEventListener(c,K)});N.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=b;let O=-1;function D(U){r(!1,U,"ancestor-scroll")}function K(){window.clearTimeout(O),E.current=!0}function I(){O=window.setTimeout(()=>{E.current=!1},ec()?5:0)}const M=wo(o.floating);a&&(M.addEventListener("keydown",w?k:R,w),M.addEventListener("compositionstart",K),M.addEventListener("compositionend",I)),v&&M.addEventListener(c,_?F:P,_);let H=[];return d&&(De(o.domReference)&&(H=Ir(o.domReference)),De(o.floating)&&(H=H.concat(Ir(o.floating))),!De(o.reference)&&o.reference&&o.reference.contextElement&&(H=H.concat(Ir(o.reference.contextElement)))),H=H.filter(U=>{var re;return U!==((re=M.defaultView)==null?void 0:re.visualViewport)}),H.forEach(U=>{U.addEventListener("scroll",D,{passive:!0})}),()=>{a&&(M.removeEventListener("keydown",w?k:R,w),M.removeEventListener("compositionstart",K),M.removeEventListener("compositionend",I)),v&&M.removeEventListener(c,_?F:P,_),H.forEach(U=>{U.removeEventListener("scroll",D)}),window.clearTimeout(O)}},[i,o,a,v,c,n,r,d,s,x,b,R,w,k,P,_,F]),N.useEffect(()=>{i.current.insideReactTree=!1},[i,v,c]);const $=N.useMemo(()=>({onKeyDown:R,...u&&{[gA[f]]:O=>{r(!1,O.nativeEvent,"reference-press")},...f!=="click"&&{onClick(O){r(!1,O.nativeEvent,"reference-press")}}}}),[R,r,u,f]),j=N.useMemo(()=>({onKeyDown:R,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[pA[c]]:()=>{i.current.insideReactTree=!0}}),[R,c,i]);return N.useMemo(()=>s?{reference:$,floating:j}:{},[s,$,j])}function mA(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=V1(),i=N.useRef({}),[s]=N.useState(()=>cA()),a=_h()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!De(h)&&lA("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=N.useState(r.reference),u=jn((h,g,p)=>{i.current.openEvent=h?g:void 0,s.emit("openchange",{open:h,event:g,reason:p,nested:a}),n?.(h,g,p)}),f=N.useMemo(()=>({setPositionReference:c}),[]),d=N.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return N.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:o,refs:f}),[t,u,d,s,o,f])}function Rh(e){e===void 0&&(e={});const{nodeId:t}=e,n=mA({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=N.useState(null),[a,l]=N.useState(null),u=o?.domReference||i,f=N.useRef(null),d=Th();Fi(()=>{u&&(f.current=u)},[u]);const h=Q3({...e,elements:{...o,...a&&{reference:a}}}),g=N.useCallback(x=>{const b=De(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;l(b),h.refs.setReference(b)},[h.refs]),p=N.useCallback(x=>{(De(x)||x===null)&&(f.current=x,s(x)),(De(h.refs.reference.current)||h.refs.reference.current===null||x!==null&&!De(x))&&h.refs.setReference(x)},[h.refs]),m=N.useMemo(()=>({...h.refs,setReference:p,setPositionReference:g,domReference:f}),[h.refs,p,g]),v=N.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),y=N.useMemo(()=>({...h,...r,refs:m,elements:v,nodeId:t}),[h,m,v,t,r]);return Fi(()=>{r.dataRef.current.floatingContext=y;const x=d?.nodesRef.current.find(b=>b.id===t);x&&(x.context=y)}),N.useMemo(()=>({...h,context:y,refs:m,elements:v}),[h,m,v,y])}function ou(){return u3()&&c3()}function yA(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=N.useRef(!1),u=N.useRef(-1),f=N.useRef(!0);N.useEffect(()=>{if(!a)return;const h=Bt(s.domReference);function g(){!n&&Ft(s.domReference)&&s.domReference===cm(wo(s.domReference))&&(c.current=!0)}function p(){f.current=!0}function m(){f.current=!1}return h.addEventListener("blur",g),ou()&&(h.addEventListener("keydown",p,!0),h.addEventListener("pointerdown",m,!0)),()=>{h.removeEventListener("blur",g),ou()&&(h.removeEventListener("keydown",p,!0),h.removeEventListener("pointerdown",m,!0))}},[s.domReference,n,a]),N.useEffect(()=>{if(!a)return;function h(g){let{reason:p}=g;(p==="reference-press"||p==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),N.useEffect(()=>()=>{on(u)},[]);const d=N.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const g=ci(h.nativeEvent);if(l&&De(g)){if(ou()&&!h.relatedTarget){if(!f.current&&!P1(g))return}else if(!g3(g))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const g=h.relatedTarget,p=h.nativeEvent,m=De(g)&&g.hasAttribute(Eh("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var v;const y=cm(s.domReference?s.domReference.ownerDocument:document);!g&&y===s.domReference||Bs((v=i.current.floatingContext)==null?void 0:v.refs.floating.current,y)||Bs(s.domReference,y)||m||r(!1,p,"focus")})}}),[i,s.domReference,r,l]);return N.useMemo(()=>a?{reference:d}:{},[a,d])}function iu(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[mm]:s,[ym]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[rA]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[mm,ym].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var d,h=arguments.length,g=new Array(h),p=0;p<h;p++)g[p]=arguments[p];return(d=r.get(c))==null?void 0:d.map(m=>m(...g)).find(m=>m!==void 0)}}}else s[c]=u}),s),{})}}function H1(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=N.useCallback(a=>iu(a,e,"reference"),t),i=N.useCallback(a=>iu(a,e,"floating"),n),s=N.useCallback(a=>iu(a,e,"item"),r);return N.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const vA=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function W1(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=V1(),u=((n=i.domReference)==null?void 0:n.id)||c,f=N.useMemo(()=>{var y;return((y=p3(i.floating))==null?void 0:y.id)||s},[i.floating,s]),d=(r=vA.get(l))!=null?r:l,g=_h()!=null,p=N.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:u},...d==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,g,o,u,l]),m=N.useMemo(()=>{const y={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?y:{...y,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,l]),v=N.useCallback(y=>{let{active:x,selected:b}=y;const w={role:"option",...x&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...w,"aria-selected":b}}return{}},[f,l]);return N.useMemo(()=>a?{reference:p,floating:m,item:v}:{},[a,p,m,v])}const xA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{opacity:.5},N.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"}))),{color:en,spacing:ls}=V,su=T.css({opacity:.6,cursor:"not-allowed"}),xt={"input-container":T.css({backgroundColor:en.fill.accentSecondary,border:`1px solid ${en.border.neutralAlphaBasic}`,padding:`${ls.md} ${ls.lg}`,borderRadius:12,minHeight:40,width:"100%",transition:"border-color 0.2s ease, background-color 0.2s ease","& textarea":{resize:"none"},[`&:not(.${su}):hover`]:{backgroundColor:en.fill.neutralPrimaryHover},"&:focus-within":{borderColor:en.border.accentPrimary,[`&:not(.${su}):hover`]:{borderColor:en.border.accentPrimary}}}),input:T.css({...xe.common,...xe.body1,background:"transparent",width:"100%",color:en.text.primary,"&::placeholder":{color:en.text.tertiary,textOverflow:"ellipsis"}}),"input-text-size_sm":T.css({...xe.body2}),"input-text-size_md":T.css({...xe.body2}),"input-text-align_left":T.css({textAlign:"left"}),"input-text-align_center":T.css({textAlign:"center"}),"input-text-align_right":T.css({textAlign:"right"}),sm:T.css({height:40,padding:ls.md}),md:T.css({height:48,padding:`14px ${ls.lg} 14px ${ls.lg}`}),error:T.css({borderColor:en.border.negativePrimary}),disabled:su,multiline:T.css({height:"auto"}),primary:T.css({background:en.fill.bgPrimary}),secondary:T.css({background:en.fill.bgSecondary}),"clear-button":T.css({cursor:"pointer",color:en.text.tertiary,height:20,"&:hover":{color:en.text.primary}})},{spacing:_m}=V;function Tm(e){return{...new Event("input",{bubbles:!0}),target:e,currentTarget:e}}const $i=S.forwardRef((e,t)=>{const{label:n,prompt:r,error:o,errorText:i,size:s="md",prefix:a,suffix:l,background:c="primary",showClearButton:u,disabled:f,value:d,defaultValue:h,className:g,wrapperClassName:p,labelClassName:m,fieldContainerClassName:v,promptClassName:y,errorClassName:x,textAlign:b="left",...w}=e,_=e.multiline===!0,E=S.useRef(null),R=S.useRef(null),k=_l([E,t]),P=_l([R,t]),{current:F}=S.useRef(d!==void 0),[$,j]=Bo(typeof d=="string"||typeof d=="number"?String(d):void 0,typeof h=="string"||typeof h=="number"?String(h):""),O=M=>{if(j(M.target.value),_){const H=e.onChange;H?.(M)}else{const H=e.onChange;H?.(M)}};S.useEffect(()=>{_&&e.autoResize&&R.current&&(R.current.style.height="auto",R.current.style.height=`${R.current.scrollHeight}px`)},[$,_,e.autoResize]);const D=()=>{if(j(""),!_){const H=E.current;if(H){H.value="";const U=Tm(H),re=e.onChange;re?.(U)}return}const M=R.current;if(M){M.value="";const H=Tm(M),U=e.onChange;U?.(H)}},K=()=>{if(_){const{rows:re,autoResize:G,onChange:Y,multiline:Q,...ne}=w;return C.jsx("textarea",{ref:P,rows:e.rows??3,className:T.cx(xt.input,g,{[xt.disabled]:f,[xt[`input-text-align_${b}`]]:!!b}),disabled:f,maxLength:e.maxLength,...ne,...F?{value:$}:{defaultValue:String(h??"")},onChange:O})}const{onChange:M,multiline:H,...U}=w;return C.jsx("input",{...U,ref:k,className:T.cx(xt.input,xt[`input-text-size_${s}`],g,{[xt.disabled]:f,[xt[`input-text-align_${b}`]]:!!b}),disabled:f,type:e.type??"text",...F?{value:$}:{defaultValue:String(h??"")},onChange:O})},I=S.useMemo(()=>c==="white"?xt.primary:c==="gray"?xt.secondary:xt[c],[c]);return C.jsxs(q,{w:"full",gap:_m.sm,className:p,children:[typeof n=="string"?C.jsx(le,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",className:m,children:n}):n,C.jsxs(q,{row:!0,alignItems:_?"flex-start":"center",w:"full",gap:_m.md,className:T.cx(xt["input-container"],I,xt[s],{[xt.error]:o,[xt.disabled]:f,[xt.multiline]:_},v),children:[a&&C.jsx(q,{flex:"none",children:a}),C.jsx(q,{flex:"1",children:K()}),u&&$&&!f&&C.jsx(q,{flex:"none",children:C.jsx("span",{className:xt["clear-button"],onClick:D,children:C.jsx(xA,{})})}),l&&C.jsx(q,{flex:"none",children:l})]}),(r||_)&&C.jsxs(q,{row:!0,gap:10,w:"full",children:[typeof r=="string"?C.jsx(le,{variant:"caption-1",colorName:"tertiary",className:y,children:r}):r,_&&e.maxLength&&C.jsx(le,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${$.length}/${e.maxLength}`})]}),i&&o&&C.jsx(le,{variant:"body-2",colorName:"negative",fontWeight:"regular",className:x,children:i})]})});$i.displayName="Input";const bA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 8.33333H5M17.5 5H2.5M17.5 11.6667H2.5M15 15H5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),wA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.3333 8.33333H2.5M16.6667 5H2.5M16.6667 11.6667H2.5M13.3333 15H2.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),CA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 8.33333H6.66665M17.5 5H3.33331M17.5 11.6667H3.33331M17.5 15H6.66665",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),SA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 10H11.6667C13.5076 10 15 8.50766 15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H5V10ZM5 10H12.5C14.3409 10 15.8333 11.4924 15.8333 13.3334C15.8333 15.1743 14.3409 16.6667 12.5 16.6667H5V10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),_A=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.5 17.5H5.77614C5.2713 17.5 5.01887 17.5 4.90199 17.4002C4.80056 17.3135 4.74674 17.1836 4.75721 17.0506C4.76927 16.8974 4.94776 16.7189 5.30474 16.3619L12.3905 9.27614C12.7205 8.94613 12.8855 8.78112 13.0758 8.7193C13.2432 8.66492 13.4235 8.66492 13.5908 8.7193C13.7811 8.78112 13.9461 8.94613 14.2761 9.27614L17.5 12.5V13.5M13.5 17.5C14.9001 17.5 15.6002 17.5 16.135 17.2275C16.6054 16.9878 16.9878 16.6054 17.2275 16.135C17.5 15.6002 17.5 14.9001 17.5 13.5M13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5M8.75 7.08333C8.75 8.00381 8.00381 8.75 7.08333 8.75C6.16286 8.75 5.41667 8.00381 5.41667 7.08333C5.41667 6.16286 6.16286 5.41667 7.08333 5.41667C8.00381 5.41667 8.75 6.16286 8.75 7.08333Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),TA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15.8334 3.33337H8.33335M11.6667 16.6667H4.16669M12.5 3.33337L7.50002 16.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),EA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_1571_1710)"},N.createElement("path",{d:"M8.33332 10.8333C8.69119 11.3118 9.14778 11.7077 9.67211 11.9941C10.1964 12.2806 10.7762 12.4509 11.3722 12.4936C11.9681 12.5363 12.5663 12.4503 13.1261 12.2415C13.6859 12.0327 14.1942 11.7059 14.6167 11.2833L17.1167 8.78335C17.8756 7.9975 18.2956 6.94499 18.2861 5.85251C18.2766 4.76002 17.8384 3.71497 17.0659 2.94243C16.2934 2.1699 15.2483 1.7317 14.1558 1.7222C13.0633 1.71271 12.0108 2.13269 11.225 2.89168L9.79165 4.31668M11.6666 9.16668C11.3088 8.68824 10.8522 8.29236 10.3279 8.0059C9.80353 7.71943 9.22373 7.54908 8.62777 7.5064C8.03182 7.46372 7.43366 7.54971 6.87386 7.75853C6.31406 7.96735 5.80572 8.29412 5.38332 8.71668L2.88332 11.2167C2.12432 12.0025 1.70435 13.055 1.71384 14.1475C1.72334 15.24 2.16154 16.2851 2.93407 17.0576C3.70661 17.8301 4.75166 18.2683 5.84414 18.2778C6.93663 18.2873 7.98914 17.8673 8.77498 17.1083L10.2 15.6833",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_1571_1710"},N.createElement("rect",{width:20,height:20,fill:"white"})))),RA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 9.99996L7.5 9.99996M17.5 4.99996L7.5 4.99996M17.5 15L7.5 15M4.16667 9.99996C4.16667 10.4602 3.79357 10.8333 3.33333 10.8333C2.8731 10.8333 2.5 10.4602 2.5 9.99996C2.5 9.53972 2.8731 9.16663 3.33333 9.16663C3.79357 9.16663 4.16667 9.53972 4.16667 9.99996ZM4.16667 4.99996C4.16667 5.4602 3.79357 5.83329 3.33333 5.83329C2.8731 5.83329 2.5 5.4602 2.5 4.99996C2.5 4.53972 2.8731 4.16663 3.33333 4.16663C3.79357 4.16663 4.16667 4.53972 4.16667 4.99996ZM4.16667 15C4.16667 15.4602 3.79357 15.8333 3.33333 15.8333C2.8731 15.8333 2.5 15.4602 2.5 15C2.5 14.5397 2.8731 14.1666 3.33333 14.1666C3.79357 14.1666 4.16667 14.5397 4.16667 15Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),kA=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M14 8.74967C14.4142 8.74967 14.75 8.41389 14.75 7.99967C14.75 7.58546 14.4142 7.24967 14 7.24967V7.99967V8.74967ZM6 7.24967C5.58579 7.24967 5.25 7.58546 5.25 7.99967C5.25 8.41389 5.58579 8.74967 6 8.74967V7.99967V7.24967ZM14 4.74967C14.4142 4.74967 14.75 4.41389 14.75 3.99967C14.75 3.58546 14.4142 3.24967 14 3.24967V3.99967V4.74967ZM6 3.24967C5.58579 3.24967 5.25 3.58546 5.25 3.99967C5.25 4.41389 5.58579 4.74967 6 4.74967V3.99967V3.24967ZM14 12.7497C14.4142 12.7497 14.75 12.4139 14.75 11.9997C14.75 11.5855 14.4142 11.2497 14 11.2497V11.9997V12.7497ZM6 11.2497C5.58579 11.2497 5.25 11.5855 5.25 11.9997C5.25 12.4139 5.58579 12.7497 6 12.7497V11.9997V11.2497ZM1.58967 3.48952C1.24295 3.71614 1.14558 4.18092 1.3722 4.52765C1.59882 4.87437 2.0636 4.97174 2.41033 4.74512L2 4.11732L1.58967 3.48952ZM3.2 3.33301H3.95C3.95 3.05764 3.79909 2.80441 3.5569 2.67337C3.31471 2.54233 3.02018 2.55455 2.78967 2.70521L3.2 3.33301ZM2.4 5.91634C1.98579 5.91634 1.65 6.25213 1.65 6.66634C1.65 7.08055 1.98579 7.41634 2.4 7.41634V6.66634V5.91634ZM4 7.41634C4.41421 7.41634 4.75 7.08055 4.75 6.66634C4.75 6.25213 4.41421 5.91634 4 5.91634V6.66634V7.41634ZM3.73743 10.8967L4.2726 11.4222L4.2726 11.4222L3.73743 10.8967ZM2 12.6663L1.46483 12.1409C1.25318 12.3565 1.19153 12.678 1.30841 12.9565C1.4253 13.2351 1.69791 13.4163 2 13.4163V12.6663ZM4 13.4163C4.41421 13.4163 4.75 13.0806 4.75 12.6663C4.75 12.2521 4.41421 11.9163 4 11.9163V12.6663V13.4163ZM1.25 10.2589C1.25 10.6731 1.58579 11.0089 2 11.0089C2.41421 11.0089 2.75 10.6731 2.75 10.2589H2H1.25ZM14 7.99967V7.24967L6 7.24967V7.99967V8.74967L14 8.74967V7.99967ZM14 3.99967V3.24967H6V3.99967V4.74967H14V3.99967ZM14 11.9997V11.2497L6 11.2497V11.9997V12.7497L14 12.7497V11.9997ZM2 4.11732L2.41033 4.74512L3.61033 3.96081L3.2 3.33301L2.78967 2.70521L1.58967 3.48952L2 4.11732ZM3.2 3.33301H2.45V6.66634H3.2H3.95V3.33301H3.2ZM3.2 6.66634V5.91634H2.4V6.66634V7.41634H3.2V6.66634ZM3.2 6.66634V7.41634H4V6.66634V5.91634H3.2V6.66634ZM3.73743 10.8967L3.20226 10.3713L1.46483 12.1409L2 12.6663L2.53517 13.1918L4.2726 11.4222L3.73743 10.8967ZM2 12.6663V13.4163H4V12.6663V11.9163H2V12.6663ZM4 10.2654H3.25C3.25 10.2957 3.23759 10.3353 3.20225 10.3713L3.73743 10.8967L4.2726 11.4222C4.57518 11.114 4.75 10.7002 4.75 10.2654H4ZM3 9.33301V10.083C3.08406 10.083 3.1515 10.1147 3.19493 10.1553C3.23791 10.1955 3.25 10.2354 3.25 10.2654H4H4.75C4.75 9.29296 3.91808 8.58301 3 8.58301V9.33301ZM2 10.2589H2.75C2.75 10.2299 2.76126 10.1927 2.80245 10.1545C2.84462 10.1155 2.91258 10.083 3 10.083V9.33301V8.58301C2.0889 8.58301 1.25 9.28004 1.25 10.2589H2Z",fill:"currentColor"})),AA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 13.3334C5 15.1743 6.49238 16.6667 8.33333 16.6667H11.6667C13.5076 16.6667 15 15.1743 15 13.3334C15 11.4924 13.5076 10 11.6667 10M15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H8.33333C6.49238 3.33337 5 4.82576 5 6.66671M2.5 10H17.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),NA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M2.5 7.5L17.5 7.5M7.5 2.5L7.5 17.5M6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5C17.5 14.9001 17.5 15.6002 17.2275 16.135C16.9878 16.6054 16.6054 16.9878 16.135 17.2275C15.6002 17.5 14.9001 17.5 13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),MA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 3.33337V9.16671C15 11.9281 12.7614 14.1667 9.99998 14.1667C7.23856 14.1667 4.99998 11.9281 4.99998 9.16671V3.33337M3.33331 17.5H16.6666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),kh=S.createContext(null);function na(){const e=S.useContext(kh);if(!e)throw new Error("useEditorStates must be used within EditorState Provider");return e}const K1=S.createContext(null);function PA(){const e=S.useContext(K1);if(!e)throw new Error("useToolbarContext must be used within ToolbarContext provider");return e}var bs={exports:{}};bs.exports;var Em;function LA(){return Em||(Em=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",p="[object Map]",m="[object Number]",v="[object Null]",y="[object Object]",x="[object Proxy]",b="[object RegExp]",w="[object Set]",_="[object String]",E="[object Undefined]",R="[object WeakMap]",k="[object ArrayBuffer]",P="[object DataView]",F="[object Float32Array]",$="[object Float64Array]",j="[object Int8Array]",O="[object Int16Array]",D="[object Int32Array]",K="[object Uint8Array]",I="[object Uint8ClampedArray]",M="[object Uint16Array]",H="[object Uint32Array]",U=/[\\^$.*+?()[\]{}|]/g,re=/^\[object .+?Constructor\]$/,G=/^(?:0|[1-9]\d*)$/,Y={};Y[F]=Y[$]=Y[j]=Y[O]=Y[D]=Y[K]=Y[I]=Y[M]=Y[H]=!0,Y[a]=Y[l]=Y[k]=Y[u]=Y[P]=Y[f]=Y[d]=Y[h]=Y[p]=Y[m]=Y[y]=Y[b]=Y[w]=Y[_]=Y[R]=!1;var Q=typeof Bn=="object"&&Bn&&Bn.Object===Object&&Bn,ne=typeof self=="object"&&self&&self.Object===Object&&self,oe=Q||ne||Function("return this")(),me=t&&!t.nodeType&&t,ee=me&&!0&&e&&!e.nodeType&&e,ve=ee&&ee.exports===me,Se=ve&&Q.process,Ee=(function(){try{var A=ee&&ee.require&&ee.require("util").types;return A||Se&&Se.binding&&Se.binding("util")}catch{}})(),ze=Ee&&Ee.isTypedArray;function je(A,L,z){switch(z.length){case 0:return A.call(L);case 1:return A.call(L,z[0]);case 2:return A.call(L,z[0],z[1]);case 3:return A.call(L,z[0],z[1],z[2])}return A.apply(L,z)}function Rt(A,L){for(var z=-1,ie=Array(A);++z<A;)ie[z]=L(z);return ie}function gn(A){return function(L){return A(L)}}function ot(A,L){return A?.[L]}function Gt(A,L){return function(z){return A(L(z))}}var Qt=Array.prototype,pt=Function.prototype,se=Object.prototype,Re=oe["__core-js_shared__"],Ye=pt.toString,rt=se.hasOwnProperty,It=(function(){var A=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""})(),to=se.toString,no=Ye.call(Object),pa=RegExp("^"+Ye.call(rt).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qo=ve?oe.Buffer:void 0,Ce=oe.Symbol,Le=oe.Uint8Array;qo&&qo.allocUnsafe;var Yo=Gt(Object.getPrototypeOf,Object),Ag=Object.create,TS=se.propertyIsEnumerable,ES=Qt.splice,ro=Ce?Ce.toStringTag:void 0,ma=(function(){try{var A=kc(Object,"defineProperty");return A({},"",{}),A}catch{}})(),RS=qo?qo.isBuffer:void 0,Ng=Math.max,kS=Date.now,Mg=kc(oe,"Map"),rs=kc(Object,"create"),AS=(function(){function A(){}return function(L){if(!io(L))return{};if(Ag)return Ag(L);A.prototype=L;var z=new A;return A.prototype=void 0,z}})();function oo(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function NS(){this.__data__=rs?rs(null):{},this.size=0}function MS(A){var L=this.has(A)&&delete this.__data__[A];return this.size-=L?1:0,L}function PS(A){var L=this.__data__;if(rs){var z=L[A];return z===r?void 0:z}return rt.call(L,A)?L[A]:void 0}function LS(A){var L=this.__data__;return rs?L[A]!==void 0:rt.call(L,A)}function FS(A,L){var z=this.__data__;return this.size+=this.has(A)?0:1,z[A]=rs&&L===void 0?r:L,this}oo.prototype.clear=NS,oo.prototype.delete=MS,oo.prototype.get=PS,oo.prototype.has=LS,oo.prototype.set=FS;function Qn(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function $S(){this.__data__=[],this.size=0}function OS(A){var L=this.__data__,z=ya(L,A);if(z<0)return!1;var ie=L.length-1;return z==ie?L.pop():ES.call(L,z,1),--this.size,!0}function IS(A){var L=this.__data__,z=ya(L,A);return z<0?void 0:L[z][1]}function DS(A){return ya(this.__data__,A)>-1}function jS(A,L){var z=this.__data__,ie=ya(z,A);return ie<0?(++this.size,z.push([A,L])):z[ie][1]=L,this}Qn.prototype.clear=$S,Qn.prototype.delete=OS,Qn.prototype.get=IS,Qn.prototype.has=DS,Qn.prototype.set=jS;function Xo(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function VS(){this.size=0,this.__data__={hash:new oo,map:new(Mg||Qn),string:new oo}}function BS(A){var L=xa(this,A).delete(A);return this.size-=L?1:0,L}function zS(A){return xa(this,A).get(A)}function HS(A){return xa(this,A).has(A)}function WS(A,L){var z=xa(this,A),ie=z.size;return z.set(A,L),this.size+=z.size==ie?0:1,this}Xo.prototype.clear=VS,Xo.prototype.delete=BS,Xo.prototype.get=zS,Xo.prototype.has=HS,Xo.prototype.set=WS;function Zo(A){var L=this.__data__=new Qn(A);this.size=L.size}function KS(){this.__data__=new Qn,this.size=0}function US(A){var L=this.__data__,z=L.delete(A);return this.size=L.size,z}function GS(A){return this.__data__.get(A)}function qS(A){return this.__data__.has(A)}function YS(A,L){var z=this.__data__;if(z instanceof Qn){var ie=z.__data__;if(!Mg||ie.length<n-1)return ie.push([A,L]),this.size=++z.size,this;z=this.__data__=new Xo(ie)}return z.set(A,L),this.size=z.size,this}Zo.prototype.clear=KS,Zo.prototype.delete=US,Zo.prototype.get=GS,Zo.prototype.has=qS,Zo.prototype.set=YS;function XS(A,L){var z=Mc(A),ie=!z&&Nc(A),_e=!z&&!ie&&Og(A),Oe=!z&&!ie&&!_e&&Dg(A),He=z||ie||_e||Oe,Ae=He?Rt(A.length,String):[],We=Ae.length;for(var pn in A)He&&(pn=="length"||_e&&(pn=="offset"||pn=="parent")||Oe&&(pn=="buffer"||pn=="byteLength"||pn=="byteOffset")||Fg(pn,We))||Ae.push(pn);return Ae}function Ec(A,L,z){(z!==void 0&&!ba(A[L],z)||z===void 0&&!(L in A))&&Rc(A,L,z)}function ZS(A,L,z){var ie=A[L];(!(rt.call(A,L)&&ba(ie,z))||z===void 0&&!(L in A))&&Rc(A,L,z)}function ya(A,L){for(var z=A.length;z--;)if(ba(A[z][0],L))return z;return-1}function Rc(A,L,z){L=="__proto__"&&ma?ma(A,L,{configurable:!0,enumerable:!0,value:z,writable:!0}):A[L]=z}var JS=d_();function va(A){return A==null?A===void 0?E:v:ro&&ro in Object(A)?f_(A):v_(A)}function Pg(A){return os(A)&&va(A)==a}function QS(A){if(!io(A)||m_(A))return!1;var L=Lc(A)?pa:re;return L.test(C_(A))}function e_(A){return os(A)&&Ig(A.length)&&!!Y[va(A)]}function t_(A){if(!io(A))return y_(A);var L=$g(A),z=[];for(var ie in A)ie=="constructor"&&(L||!rt.call(A,ie))||z.push(ie);return z}function Lg(A,L,z,ie,_e){A!==L&&JS(L,function(Oe,He){if(_e||(_e=new Zo),io(Oe))n_(A,L,He,z,Lg,ie,_e);else{var Ae=ie?ie(Ac(A,He),Oe,He+"",A,L,_e):void 0;Ae===void 0&&(Ae=Oe),Ec(A,He,Ae)}},jg)}function n_(A,L,z,ie,_e,Oe,He){var Ae=Ac(A,z),We=Ac(L,z),pn=He.get(We);if(pn){Ec(A,z,pn);return}var qt=Oe?Oe(Ae,We,z+"",A,L,He):void 0,is=qt===void 0;if(is){var Fc=Mc(We),$c=!Fc&&Og(We),Bg=!Fc&&!$c&&Dg(We);qt=We,Fc||$c||Bg?Mc(Ae)?qt=Ae:S_(Ae)?qt=l_(Ae):$c?(is=!1,qt=i_(We)):Bg?(is=!1,qt=a_(We)):qt=[]:__(We)||Nc(We)?(qt=Ae,Nc(Ae)?qt=T_(Ae):(!io(Ae)||Lc(Ae))&&(qt=h_(We))):is=!1}is&&(He.set(We,qt),_e(qt,We,ie,Oe,He),He.delete(We)),Ec(A,z,qt)}function r_(A,L){return b_(x_(A,L,Vg),A+"")}var o_=ma?function(A,L){return ma(A,"toString",{configurable:!0,enumerable:!1,value:R_(L),writable:!0})}:Vg;function i_(A,L){return A.slice()}function s_(A){var L=new A.constructor(A.byteLength);return new Le(L).set(new Le(A)),L}function a_(A,L){var z=s_(A.buffer);return new A.constructor(z,A.byteOffset,A.length)}function l_(A,L){var z=-1,ie=A.length;for(L||(L=Array(ie));++z<ie;)L[z]=A[z];return L}function c_(A,L,z,ie){var _e=!z;z||(z={});for(var Oe=-1,He=L.length;++Oe<He;){var Ae=L[Oe],We=void 0;We===void 0&&(We=A[Ae]),_e?Rc(z,Ae,We):ZS(z,Ae,We)}return z}function u_(A){return r_(function(L,z){var ie=-1,_e=z.length,Oe=_e>1?z[_e-1]:void 0,He=_e>2?z[2]:void 0;for(Oe=A.length>3&&typeof Oe=="function"?(_e--,Oe):void 0,He&&g_(z[0],z[1],He)&&(Oe=_e<3?void 0:Oe,_e=1),L=Object(L);++ie<_e;){var Ae=z[ie];Ae&&A(L,Ae,ie,Oe)}return L})}function d_(A){return function(L,z,ie){for(var _e=-1,Oe=Object(L),He=ie(L),Ae=He.length;Ae--;){var We=He[++_e];if(z(Oe[We],We,Oe)===!1)break}return L}}function xa(A,L){var z=A.__data__;return p_(L)?z[typeof L=="string"?"string":"hash"]:z.map}function kc(A,L){var z=ot(A,L);return QS(z)?z:void 0}function f_(A){var L=rt.call(A,ro),z=A[ro];try{A[ro]=void 0;var ie=!0}catch{}var _e=to.call(A);return ie&&(L?A[ro]=z:delete A[ro]),_e}function h_(A){return typeof A.constructor=="function"&&!$g(A)?AS(Yo(A)):{}}function Fg(A,L){var z=typeof A;return L=L??s,!!L&&(z=="number"||z!="symbol"&&G.test(A))&&A>-1&&A%1==0&&A<L}function g_(A,L,z){if(!io(z))return!1;var ie=typeof L;return(ie=="number"?Pc(z)&&Fg(L,z.length):ie=="string"&&L in z)?ba(z[L],A):!1}function p_(A){var L=typeof A;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?A!=="__proto__":A===null}function m_(A){return!!It&&It in A}function $g(A){var L=A&&A.constructor,z=typeof L=="function"&&L.prototype||se;return A===z}function y_(A){var L=[];if(A!=null)for(var z in Object(A))L.push(z);return L}function v_(A){return to.call(A)}function x_(A,L,z){return L=Ng(L===void 0?A.length-1:L,0),function(){for(var ie=arguments,_e=-1,Oe=Ng(ie.length-L,0),He=Array(Oe);++_e<Oe;)He[_e]=ie[L+_e];_e=-1;for(var Ae=Array(L+1);++_e<L;)Ae[_e]=ie[_e];return Ae[L]=z(He),je(A,this,Ae)}}function Ac(A,L){if(!(L==="constructor"&&typeof A[L]=="function")&&L!="__proto__")return A[L]}var b_=w_(o_);function w_(A){var L=0,z=0;return function(){var ie=kS(),_e=i-(ie-z);if(z=ie,_e>0){if(++L>=o)return arguments[0]}else L=0;return A.apply(void 0,arguments)}}function C_(A){if(A!=null){try{return Ye.call(A)}catch{}try{return A+""}catch{}}return""}function ba(A,L){return A===L||A!==A&&L!==L}var Nc=Pg((function(){return arguments})())?Pg:function(A){return os(A)&&rt.call(A,"callee")&&!TS.call(A,"callee")},Mc=Array.isArray;function Pc(A){return A!=null&&Ig(A.length)&&!Lc(A)}function S_(A){return os(A)&&Pc(A)}var Og=RS||k_;function Lc(A){if(!io(A))return!1;var L=va(A);return L==h||L==g||L==c||L==x}function Ig(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function io(A){var L=typeof A;return A!=null&&(L=="object"||L=="function")}function os(A){return A!=null&&typeof A=="object"}function __(A){if(!os(A)||va(A)!=y)return!1;var L=Yo(A);if(L===null)return!0;var z=rt.call(L,"constructor")&&L.constructor;return typeof z=="function"&&z instanceof z&&Ye.call(z)==no}var Dg=ze?gn(ze):e_;function T_(A){return c_(A,jg(A))}function jg(A){return Pc(A)?XS(A):t_(A)}var E_=u_(function(A,L,z){Lg(A,L,z)});function R_(A){return function(){return A}}function Vg(A){return A}function k_(){return!1}e.exports=E_})(bs,bs.exports)),bs.exports}var FA=LA();const $A=Ff(FA),U1=S.createContext(null);function OA(){return S.useContext(U1)}function IA({children:e,locale:t}){return C.jsx(U1.Provider,{value:t||null,children:e})}function DA({localeKey:e,defaultLocale:t}){const n=S.createContext(t);function r(s){const{extraLocale:a}=s||{},l=OA();return{value:S.useMemo(()=>{const u=l?l[e]:null,f=[{},t];return u&&f.push(u),a&&f.push(a),$A(...f)},[t,a,e,l])}}function o(){return S.useContext(n)}function i({children:s,locale:a}){const{value:l}=r({extraLocale:a});return C.jsx(n.Provider,{value:l,children:s})}return{Context:n,useComposeLocaleProviderValue:r,useLocale:o,Provider:i}}const G1="MarkdownTextEditor",jA={toolbar:{link:{textPlaceholder:"Enter the text to display",linkPlaceholder:"Paste a link",linkErrorText:"Please enter a valid link",buttonText:"Save"},table:{maxRowsErrorText:e=>`Maximum number of rows is ${e.limit}`,maxColumnsErrorText:e=>`Maximum number of columns is ${e.limit}`,minRowsErrorText:e=>`Minimum number of rows is ${e.limit}`,minColumnsErrorText:e=>`Minimum number of columns is ${e.limit}`,rowsPlaceholder:"Rows count",columnsPlaceholder:"Columns count",buttonText:"Create table"},textSize:{paragraph:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3"},preview:{show:"Preview",hide:"Preview"},actions:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",link:"Link",image:"Image",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",table:"Table",bulletList:"Bullet list",numberedList:"Numbered list"}}},{Provider:VA,useLocale:ra}=DA({localeKey:G1,defaultLocale:jA}),q1=S.createContext(null);function BA(e,t){return{getTheme:function(){return t??null}}}function lt(){const e=S.useContext(q1);return e==null&&(function(t,...n){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(const i of n)o.append("v",i);throw r.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),e}function X(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Y1(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Ln=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,zA=Ln&&"documentMode"in document?document.documentMode:null,wn=Ln&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ao=Ln&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Tl=!(!Ln||!("InputEvent"in window)||zA)&&"getTargetRanges"in new window.InputEvent("input"),oa=Ln&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),qi=Ln&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,HA=Ln&&/Android/.test(navigator.userAgent),X1=Ln&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Rm=Ln&&HA&&X1,ia=Ln&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&wn&&!X1;function Z1(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}const WA=0,KA=1,UA=2,J1=128,GA=1,qA=2,YA=3,XA=4,ZA=5,JA=6,rc=oa||qi||ia?" ":"",Wr=`
|
|
34
|
+
`),()=>{m.contains(p)&&m.removeChild(p)}},[t]),C.jsx(ZE,{isPresent:t,childRef:i,sizeRef:s,children:N.cloneElement(e,{ref:l})})}const QE=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s,anchorX:a,root:l})=>{const c=Of(e2),u=S.useId();let f=!0,d=S.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:h=>{c.set(h,!0);for(const g of c.values())if(!g)return;r&&r()},register:h=>(c.set(h,!1),()=>c.delete(h))}),[n,c,r]);return i&&f&&(d={...d}),S.useMemo(()=>{c.forEach((h,g)=>c.set(g,!1))},[n]),N.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=C.jsx(JE,{isPresent:n,anchorX:a,root:l,children:e})),C.jsx(ql.Provider,{value:d,children:e})};function e2(){return new Map}function jx(e=!0){const t=S.useContext(ql);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=S.useId();S.useEffect(()=>{if(e)return o(i)},[e]);const s=S.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const _a=e=>e.key||"";function hp(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const Vx=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=jx(s),f=S.useMemo(()=>hp(e),[e]),d=s&&!c?[]:f.map(_a),h=S.useRef(!0),g=S.useRef(f),p=Of(()=>new Map),[m,v]=S.useState(f),[y,x]=S.useState(f);G0(()=>{h.current=!1,g.current=f;for(let _=0;_<y.length;_++){const E=_a(y[_]);d.includes(E)?p.delete(E):p.get(E)!==!0&&p.set(E,!1)}},[y,d.length,d.join("-")]);const b=[];if(f!==m){let _=[...f];for(let E=0;E<y.length;E++){const R=y[E],k=_a(R);d.includes(k)||(_.splice(E,0,R),b.push(R))}return i==="wait"&&b.length&&(_=b),x(hp(_)),v(f),null}process.env.NODE_ENV!=="production"&&i==="wait"&&y.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}=S.useContext($f);return C.jsx(C.Fragment,{children:y.map(_=>{const E=_a(_),R=s&&!c?!1:f===y||d.includes(E),k=()=>{if(p.has(E))p.set(E,!0);else return;let P=!0;p.forEach(F=>{F||(P=!1)}),P&&(w?.(),x(g.current),s&&u?.(),r&&r())};return C.jsx(QE,{isPresent:R,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,root:l,onExitComplete:R?void 0:k,anchorX:a,children:_},E)})})},Bx=S.createContext({strict:!1}),gp={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"]},Li={};for(const e in gp)Li[e]={isEnabled:t=>gp[e].some(n=>!!t[n])};function t2(e){for(const t in e)Li[t]={...Li[t],...e[t]}}const n2=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 yl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||n2.has(e)}let zx=e=>!yl(e);function r2(e){typeof e=="function"&&(zx=t=>t.startsWith("on")?!yl(t):e(t))}try{r2(require("@emotion/is-prop-valid").default)}catch{}function o2(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(zx(o)||n===!0&&yl(o)||!t&&!yl(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Yl=S.createContext({});function Xl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function js(e){return typeof e=="string"||Array.isArray(e)}const ih=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],sh=["initial",...ih];function Zl(e){return Xl(e.animate)||sh.some(t=>js(e[t]))}function Hx(e){return!!(Zl(e)||e.variants)}function i2(e,t){if(Zl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||js(n)?n:void 0,animate:js(r)?r:void 0}}return e.inherit!==!1?t:{}}function s2(e){const{initial:t,animate:n}=i2(e,S.useContext(Yl));return S.useMemo(()=>({initial:t,animate:n}),[pp(t),pp(n)])}function pp(e){return Array.isArray(e)?e.join(" "):e}function mp(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ss={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=mp(e,t.target.x),r=mp(e,t.target.y);return`${n}% ${r}%`}},a2={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Vr.parse(e);if(o.length>5)return r;const i=Vr.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Je(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}},wd={borderRadius:{...ss,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ss,borderTopRightRadius:ss,borderBottomLeftRadius:ss,borderBottomRightRadius:ss,boxShadow:a2};function Wx(e,{layout:t,layoutId:n}){return Wi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!wd[e]||e==="opacity")}const l2={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},c2=Hi.length;function u2(e,t,n){let r="",o=!0;for(let i=0;i<c2;i++){const s=Hi[i],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Lx(a,th[s]);if(!l){o=!1;const u=l2[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function ah(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Wi.has(l)){s=!0;continue}else if(ux(l)){o[l]=c;continue}else{const u=Lx(c,th[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=u2(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const lh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Kx(e,t,n){for(const r in t)!St(t[r])&&!Wx(r,n)&&(e[r]=t[r])}function d2({transformTemplate:e},t){return S.useMemo(()=>{const n=lh();return ah(n,t,e),Object.assign({},n.vars,n.style)},[t])}function f2(e,t){const n=e.style||{},r={};return Kx(r,n,e),Object.assign(r,d2(e,t)),r}function h2(e,t){const n={},r=f2(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const g2={offset:"stroke-dashoffset",array:"stroke-dasharray"},p2={offset:"strokeDashoffset",array:"strokeDasharray"};function m2(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?g2:p2;e[i.offset]=he.transform(-r);const s=he.transform(t),a=he.transform(n);e[i.array]=`${s} ${a}`}function Ux(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:i=1,pathOffset:s=0,...a},l,c,u){if(ah(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:d}=e;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&m2(f,o,i,s,!1)}const Gx=()=>({...lh(),attrs:{}}),qx=e=>typeof e=="string"&&e.toLowerCase()==="svg";function y2(e,t,n,r){const o=S.useMemo(()=>{const i=Gx();return Ux(i,t,qx(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Kx(i,e.style,e),o.style={...i,...o.style}}return o}const v2=["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 ch(e){return typeof e!="string"||e.includes("-")?!1:!!(v2.indexOf(e)>-1||/[A-Z]/u.test(e))}function x2(e,t,n,{latestValues:r},o,i=!1){const a=(ch(e)?y2:h2)(t,r,o,e),l=o2(t,typeof e=="string",i),c=e!==S.Fragment?{...l,...a,ref:n}:{},{children:u}=t,f=S.useMemo(()=>St(u)?u.get():u,[u]);return S.createElement(e,{...c,children:f})}function yp(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function uh(e,t,n,r){if(typeof t=="function"){const[o,i]=yp(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=yp(r);t=t(n!==void 0?n:e.custom,o,i)}return t}function tl(e){return St(e)?e.get():e}function b2({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:w2(n,r,o,e),renderState:t()}}function w2(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=tl(i[d]);let{initial:s,animate:a}=e;const l=Zl(e),c=Hx(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?a:s;if(f&&typeof f!="boolean"&&!Xl(f)){const d=Array.isArray(f)?f:[f];for(let h=0;h<d.length;h++){const g=uh(e,d[h]);if(g){const{transitionEnd:p,transition:m,...v}=g;for(const y in v){let x=v[y];if(Array.isArray(x)){const b=u?x.length-1:0;x=x[b]}x!==null&&(o[y]=x)}for(const y in p)o[y]=p[y]}}}return o}const Yx=e=>(t,n)=>{const r=S.useContext(Yl),o=S.useContext(ql),i=()=>b2(e,t,r,o);return n?i():Of(i)};function dh(e,t,n){const{style:r}=e,o={};for(const i in r)(St(r[i])||t.style&&St(t.style[i])||Wx(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(o[i]=r[i]);return o}const C2=Yx({scrapeMotionValuesFromProps:dh,createRenderState:lh});function Xx(e,t,n){const r=dh(e,t,n);for(const o in e)if(St(e[o])||St(t[o])){const i=Hi.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const S2=Yx({scrapeMotionValuesFromProps:Xx,createRenderState:Gx}),_2=Symbol.for("motionComponentSymbol");function yi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function T2(e,t,n){return S.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):yi(n)&&(n.current=r))},[t])}const fh=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),E2="framerAppearId",Zx="data-"+fh(E2),Jx=S.createContext({});function R2(e,t,n,r,o){const{visualElement:i}=S.useContext(Yl),s=S.useContext(Bx),a=S.useContext(ql),l=S.useContext(oh).reducedMotion,c=S.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,f=S.useContext(Jx);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&k2(c.current,n,o,f);const d=S.useRef(!1);S.useInsertionEffect(()=>{u&&d.current&&u.update(n,a)});const h=n[Zx],g=S.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return G0(()=>{u&&(d.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),S.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),u.enteringChildren=void 0)}),u}function k2(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Qx(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!s||a&&yi(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Qx(e){if(e)return e.options.allowProjection!==!1?e.projection:Qx(e.parent)}function Wc(e,{forwardMotionProps:t=!1}={},n,r){n&&t2(n);const o=ch(e)?S2:C2;function i(a,l){let c;const u={...S.useContext(oh),...a,layoutId:A2(a)},{isStatic:f}=u,d=s2(a),h=o(a,f);if(!f&&If){N2(u,n);const g=M2(u);c=g.MeasureLayout,d.visualElement=R2(e,h,u,r,g.ProjectionNode)}return C.jsxs(Yl.Provider,{value:d,children:[c&&d.visualElement?C.jsx(c,{visualElement:d.visualElement,...u}):null,x2(e,a,T2(h,d.visualElement,l),h,f,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=S.forwardRef(i);return s[_2]=e,s}function A2({layoutId:e}){const t=S.useContext($f).id;return t&&e!==void 0?t+"-"+e:e}function N2(e,t){const n=S.useContext(Bx).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Bi(!1,r,"lazy-strict-mode"):vr(!1,r,"lazy-strict-mode")}}function M2(e){const{drag:t,layout:n}=Li;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function P2(e,t){if(typeof Proxy>"u")return Wc;const n=new Map,r=(i,s)=>Wc(i,s,e,t),o=(i,s)=>(process.env.NODE_ENV!=="production"&&zf(!1,"motion() is deprecated. Use motion.create() instead."),r(i,s));return new Proxy(o,{get:(i,s)=>s==="create"?r:(n.has(s)||n.set(s,Wc(s,void 0,e,t)),n.get(s))})}function e1({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function L2({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function F2(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Kc(e){return e===void 0||e===1}function Cd({scale:e,scaleX:t,scaleY:n}){return!Kc(e)||!Kc(t)||!Kc(n)}function uo(e){return Cd(e)||t1(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function t1(e){return vp(e.x)||vp(e.y)}function vp(e){return e&&e!=="0%"}function vl(e,t,n){const r=e-n,o=t*r;return n+o}function xp(e,t,n,r,o){return o!==void 0&&(e=vl(e,o,r)),vl(e,n,r)+t}function Sd(e,t=0,n=1,r,o){e.min=xp(e.min,t,n,r,o),e.max=xp(e.max,t,n,r,o)}function n1(e,{x:t,y:n}){Sd(e.x,t.translate,t.scale,t.originPoint),Sd(e.y,n.translate,n.scale,n.originPoint)}const bp=.999999999999,wp=1.0000000000001;function $2(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&xi(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,n1(e,s)),r&&uo(i.latestValues)&&xi(e,i.latestValues))}t.x<wp&&t.x>bp&&(t.x=1),t.y<wp&&t.y>bp&&(t.y=1)}function vi(e,t){e.min=e.min+t,e.max=e.max+t}function Cp(e,t,n,r,o=.5){const i=Je(e.min,e.max,o);Sd(e,t,n,i,r)}function xi(e,t){Cp(e.x,t.x,t.scaleX,t.scale,t.originX),Cp(e.y,t.y,t.scaleY,t.scale,t.originY)}function r1(e,t){return e1(F2(e.getBoundingClientRect(),t))}function O2(e,t,n){const r=r1(e,n),{scroll:o}=t;return o&&(vi(r.x,o.offset.x),vi(r.y,o.offset.y)),r}const Sp=()=>({translate:0,scale:1,origin:0,originPoint:0}),bi=()=>({x:Sp(),y:Sp()}),_p=()=>({min:0,max:0}),ct=()=>({x:_p(),y:_p()}),_d={current:null},o1={current:!1};function I2(){if(o1.current=!0,!!If)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>_d.current=e.matches;e.addEventListener("change",t),t()}else _d.current=!1}const D2=new WeakMap;function j2(e,t,n){for(const r in t){const o=t[r],i=n[r];if(St(o))e.addValue(r,o);else if(St(i))e.addValue(r,Pi(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=e.getStaticValue(r);e.addValue(r,Pi(s!==void 0?s:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Tp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class V2{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Qf,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 d=jt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Ue.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Zl(n),this.isVariantNode=Hx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&St(h)&&h.set(l[d])}}mount(t){this.current=t,D2.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),o1.current||I2(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:_d.current,process.env.NODE_ENV!=="production"&&zf(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(),jr(this.notifyUpdate),jr(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 r=Wi.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i&&i(),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 Li){const n=Li[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ct()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Tp.length;r++){const o=Tp[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,s=t[i];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=j2(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 r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pi(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(q0(r)||X0(r))?r=parseFloat(r):!qE(r)&&Vr.test(n)&&(r=Px(t,n)),this.setBaseTarget(t,St(r)?r.get():r)),St(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=uh(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!St(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Bf),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){nh.render(this.render)}}class i1 extends V2{constructor(){super(...arguments),this.KeyframeResolver=OE}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;St(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function s1(e,{style:t,vars:n},r,o){const i=e.style;let s;for(s in t)i[s]=t[s];o?.applyProjectionStyles(i,r);for(s in n)i.setProperty(s,n[s])}function B2(e){return window.getComputedStyle(e)}class z2 extends i1{constructor(){super(...arguments),this.type="html",this.renderInstance=s1}readValueFromInstance(t,n){if(Wi.has(n))return this.projection?.isProjecting?gd(n):eE(t,n);{const r=B2(t),o=(ux(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return r1(t,n)}build(t,n,r){ah(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return dh(t,n,r)}}const a1=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 H2(e,t,n,r){s1(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(a1.has(o)?o:fh(o),t.attrs[o])}class W2 extends i1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ct}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Wi.has(n)){const r=Mx(n);return r&&r.default||0}return n=a1.has(n)?n:fh(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Xx(t,n,r)}build(t,n,r){Ux(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){H2(t,n,r,o)}mount(t){this.isSVGTag=qx(t.tagName),super.mount(t)}}const K2=(e,t)=>ch(e)?new W2(t):new z2(t,{allowProjection:e!==S.Fragment});function Ci(e,t,n){const r=e.getProps();return uh(r,t,n!==void 0?n:r.custom,e)}const Td=e=>Array.isArray(e);function U2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pi(n))}function G2(e){return Td(e)?e[e.length-1]||0:e}function q2(e,t){const n=Ci(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const s in i){const a=G2(i[s]);U2(e,s,a)}}function Y2(e){return!!(St(e)&&e.add)}function Ed(e,t){const n=e.getValue("willChange");if(Y2(n))return n.add(t);if(!n&&xr.WillChange){const r=new xr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function l1(e){return e.props[Zx]}const X2=e=>e!==null;function Z2(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(X2),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[i]}const J2={type:"spring",stiffness:500,damping:25,restSpeed:10},Q2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),eR={type:"keyframes",duration:.8},tR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nR=(e,{keyframes:t})=>t.length>2?eR:Wi.has(e)?e.startsWith("scale")?Q2(t[1]):J2:tR;function rR({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const hh=(e,t,n,r={},o,i)=>s=>{const a=eh(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Tn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};rR(a)||Object.assign(u,nR(e,u)),u.duration&&(u.duration=Tn(u.duration)),u.repeatDelay&&(u.repeatDelay=Tn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(xd(u),u.delay===0&&(f=!0)),(xr.instantAnimations||xr.skipAnimations)&&(f=!0,xd(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const d=Z2(u.keyframes,a);if(d!==void 0){Ue.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new Jf(u):new SE(u)};function oR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function c1(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(i=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),d=a[u];if(d===void 0||c&&oR(c,u))continue;const h={delay:n,...eh(i||{},u)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===g&&!h.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const v=l1(e);if(v){const y=window.MotionHandoffAnimation(v,u,Ue);y!==null&&(h.startTime=y,p=!0)}}Ed(e,u),f.start(hh(u,f,d,e.shouldReduceMotion&&kx.has(u)?{type:!1}:h,e,p));const m=f.animation;m&&l.push(m)}return s&&Promise.all(l).then(()=>{Ue.update(()=>{s&&q2(e,s)})}),l}function u1(e,t,n,r=0,o=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(i,s):o===1?i*r:a-i*r}function Rd(e,t,n={}){const r=Ci(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(c1(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:f}=o;return iR(e,t,l,c,u,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[i,s]:[s,i];return l().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function iR(e,t,n=0,r=0,o=0,i=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Rd(l,t,{...s,delay:n+(typeof r=="function"?0:r)+u1(e.variantChildren,l,r,o,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function sR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>Rd(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=Rd(e,t,n);else{const o=typeof t=="function"?Ci(e,t,n.custom):t;r=Promise.all(c1(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function d1(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const aR=sh.length;function f1(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?f1(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<aR;n++){const r=sh[n],o=e.props[r];(js(o)||o===!1)&&(t[r]=o)}return t}const lR=[...ih].reverse(),cR=ih.length;function uR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>sR(e,n,r)))}function dR(e){let t=uR(e),n=Ep(),r=!0;const o=l=>(c,u)=>{const f=Ci(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:h,...g}=f;c={...c,...g,...h}}return c};function i(l){t=l(e)}function s(l){const{props:c}=e,u=f1(e.parent)||{},f=[],d=new Set;let h={},g=1/0;for(let m=0;m<cR;m++){const v=lR[m],y=n[v],x=c[v]!==void 0?c[v]:u[v],b=js(x),w=v===l?y.isActive:null;w===!1&&(g=m);let _=x===u[v]&&x!==c[v]&&b;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),y.protectedKeys={...h},!y.isActive&&w===null||!x&&!y.prevProp||Xl(x)||typeof x=="boolean")continue;const E=fR(y.prevProp,x);let R=E||v===l&&y.isActive&&!_&&b||m>g&&b,k=!1;const P=Array.isArray(x)?x:[x];let F=P.reduce(o(v),{});w===!1&&(F={});const{prevResolvedValues:$={}}=y,j={...$,...F},O=I=>{R=!0,d.has(I)&&(k=!0,d.delete(I)),y.needsAnimating[I]=!0;const M=e.getValue(I);M&&(M.liveStyle=!1)};for(const I in j){const M=F[I],H=$[I];if(h.hasOwnProperty(I))continue;let U=!1;Td(M)&&Td(H)?U=!d1(M,H):U=M!==H,U?M!=null?O(I):d.add(I):M!==void 0&&d.has(I)?O(I):y.protectedKeys[I]=!0}y.prevProp=x,y.prevResolvedValues=F,y.isActive&&(h={...h,...F}),r&&e.blockInitialAnimation&&(R=!1);const D=_&&E;R&&(!D||k)&&f.push(...P.map(I=>{const M={type:v};if(typeof I=="string"&&r&&!D&&e.manuallyAnimateOnMount&&e.parent){const{parent:H}=e,U=Ci(H,I);if(H.enteringChildren&&U){const{delayChildren:re}=U.transition||{};M.delay=u1(H.enteringChildren,e,re)}}return{animation:I,options:M}}))}if(d.size){const m={};if(typeof c.initial!="boolean"){const v=Ci(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(m.transition=v.transition)}d.forEach(v=>{const y=e.getBaseTarget(v),x=e.getValue(v);x&&(x.liveStyle=!0),m[v]=y??null}),f.push({animation:m})}let p=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ep()}}}function fR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!d1(t,e):!1}function so(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ep(){return{animate:so(!0),whileInView:so(),whileHover:so(),whileTap:so(),whileDrag:so(),whileFocus:so(),exit:so()}}class Zr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class hR extends Zr{constructor(t){super(t),t.animationState||(t.animationState=dR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Xl(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 gR=0;class pR extends Zr{constructor(){super(...arguments),this.id=gR++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.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 mR={animation:{Feature:hR},exit:{Feature:pR}};function Vs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Qs(e){return{point:{x:e.pageX,y:e.pageY}}}const yR=e=>t=>rh(t)&&e(t,Qs(t));function Es(e,t,n,r){return Vs(e,t,yR(n),r)}const h1=1e-4,vR=1-h1,xR=1+h1,g1=.01,bR=0-g1,wR=0+g1;function Pt(e){return e.max-e.min}function CR(e,t,n){return Math.abs(e-t)<=n}function Rp(e,t,n,r=.5){e.origin=r,e.originPoint=Je(t.min,t.max,e.origin),e.scale=Pt(n)/Pt(t),e.translate=Je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=vR&&e.scale<=xR||isNaN(e.scale))&&(e.scale=1),(e.translate>=bR&&e.translate<=wR||isNaN(e.translate))&&(e.translate=0)}function Rs(e,t,n,r){Rp(e.x,t.x,n.x,r?r.originX:void 0),Rp(e.y,t.y,n.y,r?r.originY:void 0)}function kp(e,t,n){e.min=n.min+t.min,e.max=e.min+Pt(t)}function SR(e,t,n){kp(e.x,t.x,n.x),kp(e.y,t.y,n.y)}function Ap(e,t,n){e.min=t.min-n.min,e.max=e.min+Pt(t)}function xl(e,t,n){Ap(e.x,t.x,n.x),Ap(e.y,t.y,n.y)}function sn(e){return[e("x"),e("y")]}const p1=({current:e})=>e?e.ownerDocument.defaultView:null,Np=(e,t)=>Math.abs(e-t);function _R(e,t){const n=Np(e.x,t.x),r=Np(e.y,t.y);return Math.sqrt(n**2+r**2)}class m1{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:s=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 d=Gc(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=_R(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:p}=d,{timestamp:m}=mt;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Uc(h,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Gc(d.type==="pointercancel"?this.lastMoveEventInfo:Uc(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,v),p&&p(d,v)},!rh(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=o||window;const a=Qs(t),l=Uc(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=mt;this.history=[{...c,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Gc(l,this.history)),this.removeListeners=Xs(Es(this.contextWindow,"pointermove",this.handlePointerMove),Es(this.contextWindow,"pointerup",this.handlePointerUp),Es(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),jr(this.updatePoint)}}function Uc(e,t){return t?{point:t(e.point)}:e}function Mp(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Gc({point:e},t){return{point:e,delta:Mp(e,y1(t)),offset:Mp(e,TR(t)),velocity:ER(t,.1)}}function TR(e){return e[0]}function y1(e){return e[e.length-1]}function ER(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=y1(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Tn(t)));)n--;if(!r)return{x:0,y:0};const i=ln(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function RR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Je(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Je(n,e,r.max):Math.min(e,n)),e}function Pp(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 kR(e,{top:t,left:n,bottom:r,right:o}){return{x:Pp(e.x,n,o),y:Pp(e.y,t,r)}}function Lp(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function AR(e,t){return{x:Lp(e.x,t.x),y:Lp(e.y,t.y)}}function NR(e,t){let n=.5;const r=Pt(e),o=Pt(t);return o>r?n=Os(t.min,t.max-r,e.min):r>o&&(n=Os(e.min,e.max-o,t.min)),yr(0,1,n)}function MR(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 kd=.35;function PR(e=kd){return e===!1?e=0:e===!0&&(e=kd),{x:Fp(e,"left","right"),y:Fp(e,"top","bottom")}}function Fp(e,t,n){return{min:$p(e,t),max:$p(e,n)}}function $p(e,t){return typeof e=="number"?e:e[t]||0}const LR=new WeakMap;class FR{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=ct(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Qs(f).point)},s=(f,d)=>{const{drag:h,dragPropagation:g,onDragStart:p}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=VE(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),sn(v=>{let y=this.getAxisMotionValue(v).get()||0;if(Hn.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const b=x.layout.layoutBox[v];b&&(y=Pt(b)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&Ue.postRender(()=>p(f,d)),Ed(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=d;if(g&&this.currentDirection===null){this.currentDirection=$R(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(f,d)},l=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>sn(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new m1(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:p1(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!r)return;const{velocity:s}=o;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&Ue.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Ta(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=RR(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&yi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=kR(r.layoutBox,t):this.constraints=!1,this.elastic=PR(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&sn(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=MR(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!yi(t))return!1;const r=t.current;vr(r!==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:o}=this.visualElement;if(!o||!o.layout)return!1;const i=O2(r,o.root,this.visualElement.getTransformPagePoint());let s=AR(o.layout.layoutBox,i);if(n){const a=n(L2(s));this.hasMutatedConstraints=!!a,a&&(s=e1(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=sn(u=>{if(!Ta(u,n,this.currentDirection))return;let f=l&&l[u]||{};s&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ed(this.visualElement,t),r.start(hh(t,r,0,n,this.visualElement,!1))}stopAnimation(){sn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){sn(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){sn(n=>{const{drag:r}=this.getProps();if(!Ta(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-Je(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!yi(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};sn(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();o[s]=NR({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),sn(s=>{if(!Ta(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(Je(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;LR.set(this.visualElement,this);const t=this.visualElement.current,n=Es(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();yi(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Ue.read(r);const s=Vs(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(sn(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=kd,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function Ta(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $R(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class OR extends Zr{constructor(t){super(t),this.removeGroupControls=cn,this.removeListeners=cn,this.controls=new FR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Op=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class IR extends Zr{constructor(){super(...arguments),this.removePointerDownListener=cn}onPointerDown(t){this.session=new m1(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:p1(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Op(t),onStart:Op(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&Ue.postRender(()=>o(i,s))}}}mount(){this.removePointerDownListener=Es(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 nl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let qc=!1;class DR extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),qc&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),nl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,qc=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Ue.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),nh.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;qc=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function v1(e){const[t,n]=jx(),r=S.useContext($f);return C.jsx(DR,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(Jx),isPresent:t,safeToRemove:n})}function jR(e,t,n){const r=St(e)?e:Pi(e);return r.start(hh("",r,t,n)),r.animation}const VR=(e,t)=>e.depth-t.depth;class BR{constructor(){this.children=[],this.isDirty=!1}add(t){Df(this.children,t),this.isDirty=!0}remove(t){jf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(VR),this.isDirty=!1,this.children.forEach(t)}}function zR(e,t){const n=jt.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(jr(r),e(i-t))};return Ue.setup(r,!0),()=>jr(r)}const x1=["TopLeft","TopRight","BottomLeft","BottomRight"],HR=x1.length,Ip=e=>typeof e=="string"?parseFloat(e):e,Dp=e=>typeof e=="number"||he.test(e);function WR(e,t,n,r,o,i){o?(e.opacity=Je(0,n.opacity??1,KR(r)),e.opacityExit=Je(t.opacity??1,0,UR(r))):i&&(e.opacity=Je(t.opacity??1,n.opacity??1,r));for(let s=0;s<HR;s++){const a=`border${x1[s]}Radius`;let l=jp(t,a),c=jp(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Dp(l)===Dp(c)?(e[a]=Math.max(Je(Ip(l),Ip(c),r),0),(Hn.test(c)||Hn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Je(t.rotate||0,n.rotate||0,r))}function jp(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const KR=b1(0,.5,ox),UR=b1(.5,.95,cn);function b1(e,t,n){return r=>r<e?0:r>t?1:n(Os(e,t,r))}function Vp(e,t){e.min=t.min,e.max=t.max}function mn(e,t){Vp(e.x,t.x),Vp(e.y,t.y)}function Bp(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function zp(e,t,n,r,o){return e-=t,e=vl(e,1/n,r),o!==void 0&&(e=vl(e,1/o,r)),e}function GR(e,t=0,n=1,r=.5,o,i=e,s=e){if(Hn.test(t)&&(t=parseFloat(t),t=Je(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Je(i.min,i.max,r);e===i&&(a-=t),e.min=zp(e.min,t,n,a,o),e.max=zp(e.max,t,n,a,o)}function Hp(e,t,[n,r,o],i,s){GR(e,t[n],t[r],t[o],t.scale,i,s)}const qR=["x","scaleX","originX"],YR=["y","scaleY","originY"];function Wp(e,t,n,r){Hp(e.x,t,qR,n?n.x:void 0,r?r.x:void 0),Hp(e.y,t,YR,n?n.y:void 0,r?r.y:void 0)}function Kp(e){return e.translate===0&&e.scale===1}function w1(e){return Kp(e.x)&&Kp(e.y)}function Up(e,t){return e.min===t.min&&e.max===t.max}function XR(e,t){return Up(e.x,t.x)&&Up(e.y,t.y)}function Gp(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function C1(e,t){return Gp(e.x,t.x)&&Gp(e.y,t.y)}function qp(e){return Pt(e.x)/Pt(e.y)}function Yp(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class ZR{constructor(){this.members=[]}add(t){Df(this.members,t),t.scheduleRender()}remove(t){if(jf(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(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function JR(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=n?.z||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:d,skewX:h,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Yc=["","X","Y","Z"],QR=1e3;let ek=0;function Xc(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function S1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=l1(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&S1(r)}function _1({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t?.()){this.id=ek++,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.layoutVersion=0,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(rk),this.nodes.forEach(ak),this.nodes.forEach(lk),this.nodes.forEach(ok)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,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 BR)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Bf),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Dx(s)&&!UE(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const d=()=>this.root.updateBlockedByResize=!1;Ue.read(()=>{f=window.innerWidth}),e(s,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=zR(d,250),nl.hasAnimatedSinceResize&&(nl.hasAnimatedSinceResize=!1,this.nodes.forEach(Jp)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||hk,{onLayoutAnimationStart:p,onLayoutAnimationComplete:m}=c.getProps(),v=!this.targetLayout||!C1(this.targetLayout,h),y=!f&&d;if(this.options.layoutRoot||this.resumeFrom||y||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...eh(g,"layout"),onPlay:p,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,y)}else f||Jp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),jr(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(ck),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&S1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Xp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Zp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(sk),this.nodes.forEach(tk),this.nodes.forEach(nk)):this.nodes.forEach(Zp),this.clearAllSnapshots();const a=jt.now();mt.delta=yr(0,1e3/60,a-mt.timestamp),mt.timestamp=a,mt.isProcessing=!0,Dc.update.process(mt),Dc.preRender.process(mt),Dc.render.process(mt),mt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,nh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ik),this.sharedNodes.forEach(uk)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pt(this.snapshot.measuredBox.x)&&!Pt(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 s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ct(),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,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!w1(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||uo(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),gk(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return ct();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(pk))){const{scroll:c}=this.root;c&&(vi(a.x,c.offset.x),vi(a.y,c.offset.y))}return a}removeElementScroll(s){const a=ct();if(mn(a,s),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:f}=c;c!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&mn(a,s),vi(a.x,u.offset.x),vi(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const l=ct();mn(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&xi(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),uo(u.latestValues)&&xi(l,u.latestValues)}return uo(this.latestValues)&&xi(l,this.latestValues),l}removeTransform(s){const a=ct();mn(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!uo(c.latestValues))continue;Cd(c.latestValues)&&c.updateSnapshot();const u=ct(),f=c.measurePageBox();mn(u,f),Wp(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return uo(this.latestValues)&&Wp(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==mt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!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(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=mt.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ct(),this.targetWithTransforms=ct()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),SR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):mn(this.target,this.layout.layoutBox),n1(this.target,this.targetDelta)):mn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Cd(this.parent.latestValues)||t1(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,l){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ct(),this.relativeTargetOrigin=ct(),xl(this.relativeTargetOrigin,a,l),mn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===mt.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;mn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;$2(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=ct());const{target:h}=s;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Bp(this.prevProjectionDelta.x,this.projectionDelta.x),Bp(this.prevProjectionDelta.y,this.projectionDelta.y)),Rs(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!Yp(this.projectionDelta.x,this.prevProjectionDelta.x)||!Yp(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bi(),this.projectionDelta=bi(),this.projectionDeltaWithTransform=bi()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=bi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=ct(),h=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=h!==g,m=this.getStack(),v=!m||m.members.length<=1,y=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(fk));this.animationProgress=0;let x;this.mixTargetDelta=b=>{const w=b/1e3;Qp(f.x,s.x,w),Qp(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xl(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dk(this.relativeTarget,this.relativeTargetOrigin,d,w),x&&XR(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ct()),mn(x,this.relativeTarget)),p&&(this.animationValues=u,WR(u,c,this.latestValues,w,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(jr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{nl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pi(0)),this.currentAnimation=jR(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(QR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&T1(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ct();const f=Pt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const d=Pt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+d}mn(a,l),xi(a,u),Rs(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new ZR),this.sharedNodes.get(s).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 s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Xc("z",s,c,this.animationValues);for(let u=0;u<Yc.length;u++)Xc(`rotate${Yc[u]}`,s,c,this.animationValues),Xc(`skew${Yc[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=tl(a?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=tl(a?.pointerEvents)||""),this.hasProjected&&!uo(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=JR(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),s.transform=f;const{x:d,y:h}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in wd){if(u[g]===void 0)continue;const{correct:p,applyTo:m,isCSSVariable:v}=wd[g],y=f==="none"?u[g]:p(u[g],c);if(m){const x=m.length;for(let b=0;b<x;b++)s[m[b]]=y}else v?this.options.visualElement.renderState.vars[g]=y:s[g]=y}this.options.layoutId&&(s.pointerEvents=c===this?tl(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(Xp),this.root.sharedNodes.clear()}}}function tk(e){e.updateLayout()}function nk(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?sn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=Pt(f);f.min=n[u].min,f.max=f.min+d}):T1(o,t.layoutBox,n)&&sn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=Pt(n[u]);f.max=f.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=bi();Rs(s,n,t.layoutBox);const a=bi();i?Rs(a,e.applyTransform(r,!0),t.measuredBox):Rs(a,n,t.layoutBox);const l=!w1(s);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const h=ct();xl(h,t.layoutBox,f.layoutBox);const g=ct();xl(g,n,d.layoutBox),C1(h,g)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function rk(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 ok(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ik(e){e.clearSnapshot()}function Xp(e){e.clearMeasurements()}function Zp(e){e.isLayoutDirty=!1}function sk(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Jp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ak(e){e.resolveTargetDelta()}function lk(e){e.calcProjection()}function ck(e){e.resetSkewAndRotation()}function uk(e){e.removeLeadSnapshot()}function Qp(e,t,n){e.translate=Je(t.translate,0,n),e.scale=Je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function em(e,t,n,r){e.min=Je(t.min,n.min,r),e.max=Je(t.max,n.max,r)}function dk(e,t,n,r){em(e.x,t.x,n.x,r),em(e.y,t.y,n.y,r)}function fk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const hk={duration:.45,ease:[.4,0,.1,1]},tm=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nm=tm("applewebkit/")&&!tm("chrome/")?Math.round:cn;function rm(e){e.min=nm(e.min),e.max=nm(e.max)}function gk(e){rm(e.x),rm(e.y)}function T1(e,t,n){return e==="position"||e==="preserve-aspect"&&!CR(qp(t),qp(n),.2)}function pk(e){return e!==e.root&&e.scroll?.wasRoot}const mk=_1({attachResizeListener:(e,t)=>Vs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Zc={current:void 0},E1=_1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Zc.current){const e=new mk({});e.mount(window),e.setOptions({layoutScroll:!0}),Zc.current=e}return Zc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),yk={pan:{Feature:IR},drag:{Feature:OR,ProjectionNode:E1,MeasureLayout:v1}};function om(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&Ue.postRender(()=>i(t,Qs(t)))}class vk extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=BE(t,(n,r)=>(om(this.node,r,"Start"),o=>om(this.node,o,"End"))))}unmount(){}}class xk extends Zr{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=Xs(Vs(this.node.current,"focus",()=>this.onFocus()),Vs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function im(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&Ue.postRender(()=>i(t,Qs(t)))}class bk extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=KE(t,(n,r)=>(im(this.node,r,"Start"),(o,{success:i})=>im(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ad=new WeakMap,Jc=new WeakMap,wk=e=>{const t=Ad.get(e.target);t&&t(e)},Ck=e=>{e.forEach(wk)};function Sk({root:e,...t}){const n=e||document;Jc.has(n)||Jc.set(n,{});const r=Jc.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Ck,{root:e,...t})),r[o]}function _k(e,t,n){const r=Sk(t);return Ad.set(e,n),r.observe(e),()=>{Ad.delete(e),r.unobserve(e)}}const Tk={some:0,all:1};class Ek extends Zr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:Tk[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),d=c?u:f;d&&d(l)};return _k(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Rk(t,n))&&this.startObserver()}unmount(){}}function Rk({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const kk={inView:{Feature:Ek},tap:{Feature:bk},focus:{Feature:xk},hover:{Feature:vk}},Ak={layout:{ProjectionNode:E1,MeasureLayout:v1}},Nk={...mR,...kk,...yk,...Ak},ea=P2(Nk,K2),yn={fontFamily:"Inter, sans-serif",wordBreak:"break-word"},xe={common:yn,title1:{...yn,fontSize:32,lineHeight:"36px",[vs.md()]:{fontSize:24}},title2:{...yn,fontSize:24,lineHeight:"28px",[vs.md()]:{fontSize:20}},title3:{...yn,fontSize:20,lineHeight:"28px",[vs.md()]:{fontSize:18},[vs.xs()]:{fontSize:16}},headline1:{...yn,fontSize:22,lineHeight:"26px"},headline2:{...yn,fontSize:18,lineHeight:"22px"},headline3:{...yn,fontSize:16,lineHeight:"20px"},body1:{...yn,fontSize:16,lineHeight:"24px"},body2:{...yn,fontSize:14,lineHeight:"20px"},caption1:{...yn,fontSize:12,lineHeight:"16px"},caption2:{...yn,fontSize:10,lineHeight:"14px"}},{transition:Mk,color:er,fontWeight:Ea}=V,Ra={text:T.css({transition:Mk.general}),inherit:T.css({}),"title-1":T.css({...xe.title1}),"title-2":T.css({...xe.title2}),"title-3":T.css({...xe.title3}),"headline-1":T.css({...xe.headline1}),"headline-2":T.css({...xe.headline2}),"headline-3":T.css({...xe.headline3}),"body-1":T.css({...xe.body1}),"body-2":T.css({...xe.body2}),"caption-1":T.css({...xe.caption1}),"caption-2":T.css({...xe.caption2}),primary:T.css({color:er.text.primary}),secondary:T.css({color:er.text.secondary}),tertiary:T.css({color:er.text.tertiary}),positive:T.css({color:er.text.positive}),negative:T.css({color:er.text.negative}),warning:T.css({color:er.text.warning}),accent:T.css({color:er.text.accent}),inverse:T.css({color:er.text.inverse}),transfer:T.css({color:er.text.transfer}),regular:T.css({fontWeight:Ea.regular}),medium:T.css({fontWeight:Ea.medium}),semibold:T.css({fontWeight:Ea.semibold}),bold:T.css({fontWeight:Ea.bold})},Pk=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"),T.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})},le=S.forwardRef(({children:e,className:t,variant:n="body-1",fontWeight:r="medium",tag:o="p",colorName:i="primary",inherit:s=!1,style:a,clickOpacity:l=.5,opacityDuration:c=200,onClick:u,disabled:f,mt:d,mb:h,ml:g,mr:p,flex:m,cursor:v,wordBreak:y,whiteSpace:x,textOverflow:b,decoration:w,color:_,center:E,left:R,right:k,uppercase:P,lowercase:F,capitalize:$,overflow:j,...O},D)=>{const[K,I]=S.useState(!1),M=!!u,H=()=>M&&I(!0),U=()=>M&&I(!1),re=Pk({mt:d,mb:h,ml:g,mr:p,flex:m,cursor:v,wordBreak:y,whiteSpace:x,textOverflow:b,decoration:w,color:_,center:E,left:R,right:k,uppercase:P,lowercase:F,capitalize:$,overflow:j}),G=o,Y=Ra[s?"inherit":n],Q=Ra[s?"inherit":i],ne=Ra[s?"inherit":r],oe=M?T.css({opacity:K?l:1,transition:`opacity ${c}ms ease`}):"";return C.jsx(G,{ref:D,...O,className:T.cx(Ra.text,Y,Q,ne,oe,t,re),style:a,onClick:u,onMouseDown:H,onMouseUp:U,onMouseLeave:U,onTouchStart:H,onTouchEnd:U,role:M?"button":void 0,tabIndex:M?0:void 0,children:e})});le.displayName="Text";const R1=ea(le),{color:Nd,cornerRadius:Yt,height:ka,transition:Lk}=V,Fk=T.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}),as={zero:Yt.zero,xs:Yt.xs,sm:Yt.sm,md:Yt.md,lg:Yt.lg,xl:Yt.xl,"2xl":Yt["2xl"],"3xl":Yt["3xl"],"4xl":Yt["4xl"],"5xl":Yt["5xl"],"6xl":Yt["6xl"],"full-round":Yt.fullRound},$k={xs:ka.button.xs,sm:ka.button.sm,md:ka.button.md,lg:ka.button.lg},Ok={clear:T.css({backgroundColor:"transparent",border:"none"}),filled:T.css({backgroundColor:Nd.fill.accentPrimary,color:"white",border:"none"}),outline:T.css({backgroundColor:"transparent",border:`1px solid ${Nd.border.accentPrimary}`})},Ik=(e,t,n,r)=>{if(r)return T.css({cursor:"not-allowed",opacity:.7});const o={transition:Lk.general,borderRadius:Yt.lg,border:"none",color:e==="filled"?Nd.text.inverse:`var(--text-${t})`};switch(e){case"filled":return T.css({...o,backgroundColor:`var(--fill-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${t}-${n}-hover)`}});case"outline":return T.css({...o,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 T.css({...o,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});default:return T.css(o)}},{color:Aa}=V,Br=({disabled:e,loading:t,className:n,wrapperClassName:r,buttonClassName:o,buttonDisabledClassName:i,textClassName:s,children:a,variant:l="filled",backgroundColor:c,textColor:u,textFontWeight:f,borderColor:d,color:h="accent",opacity:g,borderRadius:p,width:m="auto",size:v="md",iconLeft:y,iconRight:x,intensity:b="primary",flex:w,type:_="button",...E})=>{const R=S.useMemo(()=>{switch(m){case"full":return"100%";case"auto":return"fit-content";default:return m}},[m]),k=S.useMemo(()=>c||(l==="filled"?h==="neutral"?Aa.fill.neutralSecondary:`var(--fill-${h}-${b})`:"transparent"),[l,c,h,b]),P=S.useMemo(()=>{if(b==="primary"){if(h==="neutral")return Aa.text.secondary;if(l==="filled")return Aa.text.inverse}else if(h==="neutral")return Aa.text.secondary;return`var(--text-${h})`},[b,h,l]),F=S.useMemo(()=>{if(b==="primary"){if(h==="neutral")return"secondary";if(l==="filled")return"inverse"}else if(h==="neutral")return"secondary";return h},[l,h,b]),$=S.useMemo(()=>d||(l==="outline"?`var(--border-${h}-${b})`:"transparent"),[l,d,h,b]),j=S.useMemo(()=>{switch(v){case"lg":return as.lg;case"md":case"sm":return as.md;case"xs":return as.sm;default:return as.md}},[v]),O=T.cx(Fk,Ik(l,h,b,e),Ok[l],e?i:void 0,T.css({borderRadius:p?as[p]:j,backgroundColor:k,borderColor:$,color:u??`var(--text-${F})`,width:R,height:$k[v],opacity:g||(e?.7:1)}),o),D=S.useMemo(()=>{switch(v){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[v]);return C.jsx(q,{className:T.cx(r,n),w:R,flex:w,relative:!0,overflow:"hidden",children:C.jsxs(ea.button,{...E,whileTap:!e&&!t?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},disabled:e||t,className:O,type:_,children:[t?C.jsx(z0,{color:P}):C.jsxs(C.Fragment,{children:[y,C.jsx(R1,{style:{color:u},colorName:F,variant:D,className:s,textOverflow:"ellipsis",overflow:"hidden",children:a}),x]}),C.jsx(zo,{})]})})},Dk=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),jk=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),{color:ao}=V,Sr={checkbox:T.css({display:"inline-flex",alignItems:"flex-start",gap:8,userSelect:"none"}),disabled:T.css({cursor:"not-allowed",opacity:.5}),checkbox__input:T.css({position:"absolute",opacity:0,width:"var(--checkbox-size)",height:"var(--checkbox-size)"}),checkbox__box:T.css({width:"var(--checkbox-size)",height:"var(--checkbox-size)",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${ao.border.neutralAlphaHigh}`,backgroundColor:ao.fill.bgSecondary,opacity:1,transition:"all 0.15s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative","& svg":{color:ao.border.accentPrimary}}),checked:T.css({borderColor:`${ao.border.accentPrimary} !important`,backgroundColor:`${ao.fill.accentSecondary} !important`}),error:T.css({borderColor:ao.border.negativePrimary,backgroundColor:ao.fill.negativeSecondary})},Vk={primary:T.css({}),secondary:T.css({backgroundColor:"transparent"})},Bk={sm:20,md:24},gh=S.forwardRef(({checked:e,onChange:t,disabled:n,error:r,indeterminate:o,size:i="md",title:s,titleColor:a,subtitle:l,subtitleColor:c="secondary",name:u,required:f,variant:d="primary",flex:h,readOnly:g,className:p,inputClassName:m,boxClassName:v,titleClassName:y,subtitleClassName:x},b)=>{const[w,_]=S.useState(!1),E=e!==void 0,R=E?e:w,k=O=>{E||_(O.target.checked),t?.(O)},P=Bk[i],F=R||o,$=!!g&&!n,j=n?"not-allowed":$?"auto":"pointer";return C.jsxs("label",{className:T.cx(Sr.checkbox,T.css({flex:h,cursor:j}),{[Sr.disabled]:n},p),children:[C.jsxs(q,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${P}px`,"--checkbox-size-double":`${P*2}px`},children:[C.jsx("input",{ref:b,type:"checkbox",checked:R,onChange:$?void 0:k,onClick:O=>O.stopPropagation(),disabled:n,readOnly:$,name:u,required:f,className:T.cx(Sr.checkbox__input,{[Sr.disabled]:n},T.css({cursor:j}),m)}),C.jsx("div",{className:T.cx(Sr.checkbox__box,Vk[d],{[Sr.disabled]:n,[Sr.error]:r,[Sr.checked]:F},v),children:F&&(o?C.jsx(jk,{width:P*.75,height:P*.75}):C.jsx(Dk,{width:P*.75,height:P*.75}))})]}),(s||l)&&C.jsxs(q,{gap:4,children:[s&&C.jsx(le,{colorName:a,variant:i==="sm"?"body-2":"body-1",className:y,children:s}),l&&C.jsx(le,{variant:"body-2",colorName:c,className:x,children:l})]})]})});gh.displayName="Checkbox";function Jl(){return typeof window<"u"}function Ki(e){return k1(e)?(e.nodeName||"").toLowerCase():"#document"}function Bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jn(e){var t;return(t=(k1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function k1(e){return Jl()?e instanceof Node||e instanceof Bt(e).Node:!1}function De(e){return Jl()?e instanceof Element||e instanceof Bt(e).Element:!1}function Ft(e){return Jl()?e instanceof HTMLElement||e instanceof Bt(e).HTMLElement:!1}function Md(e){return!Jl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bt(e).ShadowRoot}const zk=new Set(["inline","contents"]);function ta(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!zk.has(o)}const Hk=new Set(["table","td","th"]);function Wk(e){return Hk.has(Ki(e))}const Kk=[":popover-open",":modal"];function Ql(e){return Kk.some(t=>{try{return e.matches(t)}catch{return!1}})}const Uk=["transform","translate","scale","rotate","perspective"],Gk=["transform","translate","scale","rotate","perspective","filter"],qk=["paint","layout","strict","content"];function ph(e){const t=ec(),n=De(e)?dn(e):e;return Uk.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Gk.some(r=>(n.willChange||"").includes(r))||qk.some(r=>(n.contain||"").includes(r))}function Yk(e){let t=br(e);for(;Ft(t)&&!mr(t);){if(ph(t))return t;if(Ql(t))return null;t=br(t)}return null}function ec(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Xk=new Set(["html","body","#document"]);function mr(e){return Xk.has(Ki(e))}function dn(e){return Bt(e).getComputedStyle(e)}function tc(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function br(e){if(Ki(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Md(e)&&e.host||Jn(e);return Md(t)?t.host:t}function A1(e){const t=br(e);return mr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ft(t)&&ta(t)?t:A1(t)}function Ir(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=A1(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Bt(o);if(i){const a=Pd(s);return t.concat(s,s.visualViewport||[],ta(o)?o:[],a&&n?Ir(a):[])}return t.concat(o,Ir(o,[],n))}function Pd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const zr=Math.min,Xt=Math.max,bl=Math.round,Na=Math.floor,Wn=e=>({x:e,y:e}),Zk={left:"right",right:"left",bottom:"top",top:"bottom"},Jk={start:"end",end:"start"};function Ld(e,t,n){return Xt(e,zr(t,n))}function Ui(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function Gi(e){return e.split("-")[1]}function N1(e){return e==="x"?"y":"x"}function mh(e){return e==="y"?"height":"width"}const Qk=new Set(["top","bottom"]);function fr(e){return Qk.has(Hr(e))?"y":"x"}function yh(e){return N1(fr(e))}function e3(e,t,n){n===void 0&&(n=!1);const r=Gi(e),o=yh(e),i=mh(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=wl(s)),[s,wl(s)]}function t3(e){const t=wl(e);return[Fd(e),t,Fd(t)]}function Fd(e){return e.replace(/start|end/g,t=>Jk[t])}const sm=["left","right"],am=["right","left"],n3=["top","bottom"],r3=["bottom","top"];function o3(e,t,n){switch(e){case"top":case"bottom":return n?t?am:sm:t?sm:am;case"left":case"right":return t?n3:r3;default:return[]}}function i3(e,t,n,r){const o=Gi(e);let i=o3(Hr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Fd)))),i}function wl(e){return e.replace(/left|right|bottom|top/g,t=>Zk[t])}function s3(e){return{top:0,right:0,bottom:0,left:0,...e}}function M1(e){return typeof e!="number"?s3(e):{top:e,right:e,bottom:e,left:e}}function Cl(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function a3(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function l3(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function c3(){return/apple/i.test(navigator.vendor)}function u3(){return a3().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function d3(){return l3().includes("jsdom/")}const lm="data-floating-ui-focusable",f3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function cm(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Bs(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Md(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ci(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Qc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function h3(e){return e.matches("html,body")}function wo(e){return e?.ownerDocument||document}function P1(e){return Ft(e)&&e.matches(f3)}function g3(e){if(!e||d3())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function p3(e){return e?e.hasAttribute(lm)?e:e.querySelector("["+lm+"]")||e:null}function rl(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...rl(e,o.id,n)])}function m3(e){return"nativeEvent"in e}function zs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var y3=typeof document<"u",v3=function(){},Fi=y3?S.useLayoutEffect:v3;const x3={...N};function Ma(e){const t=N.useRef(e);return Fi(()=>{t.current=e}),t}const b3=x3.useInsertionEffect,w3=b3||(e=>e());function jn(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return w3(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function um(e,t,n){let{reference:r,floating:o}=e;const i=fr(t),s=yh(t),a=mh(s),l=Hr(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Gi(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const C3=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=um(c,r,l),d=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:v}=a[p],{x:y,y:x,data:b,reset:w}=await v({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=x??f,h={...h,[m]:{...h[m],...b}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(d=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:f}=um(c,d,l)),p=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}};async function vh(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Ui(t,e),g=M1(h),m=a[d?f==="floating"?"reference":"floating":f],v=Cl(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},w=Cl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(v.top-w.top+g.top)/b.y,bottom:(w.bottom-v.bottom+g.bottom)/b.y,left:(v.left-w.left+g.left)/b.x,right:(w.right-v.right+g.right)/b.x}}const S3=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Ui(e,t)||{};if(c==null)return{};const f=M1(u),d={x:n,y:r},h=yh(o),g=mh(h),p=await s.getDimensions(c),m=h==="y",v=m?"top":"left",y=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[h]-d[h]-i.floating[g],w=d[h]-i.reference[h],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=_?_[x]:0;(!E||!await(s.isElement==null?void 0:s.isElement(_)))&&(E=a.floating[x]||i.floating[g]);const R=b/2-w/2,k=E/2-p[g]/2-1,P=zr(f[v],k),F=zr(f[y],k),$=P,j=E-p[g]-F,O=E/2-p[g]/2+R,D=Ld($,O,j),K=!l.arrow&&Gi(o)!=null&&O!==D&&i.reference[g]/2-(O<$?P:F)-p[g]/2<0,I=K?O<$?O-$:O-j:0;return{[h]:d[h]+I,data:{[h]:D,centerOffset:O-D-I,...K&&{alignmentOffset:I}},reset:K}}}),_3=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=Ui(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Hr(o),y=fr(a),x=Hr(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=d||(x||!p?[wl(a)]:t3(a)),_=g!=="none";!d&&_&&w.push(...i3(a,p,g,b));const E=[a,...w],R=await vh(t,m),k=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(R[v]),f){const O=e3(o,s,b);k.push(R[O[0]],R[O[1]])}if(P=[...P,{placement:o,overflows:k}],!k.every(O=>O<=0)){var F,$;const O=(((F=i.flip)==null?void 0:F.index)||0)+1,D=E[O];if(D&&(!(f==="alignment"?y!==fr(D):!1)||P.every(M=>fr(M.placement)===y?M.overflows[0]>0:!0)))return{data:{index:O,overflows:P},reset:{placement:D}};let K=($=P.filter(I=>I.overflows[0]<=0).sort((I,M)=>I.overflows[1]-M.overflows[1])[0])==null?void 0:$.placement;if(!K)switch(h){case"bestFit":{var j;const I=(j=P.filter(M=>{if(_){const H=fr(M.placement);return H===y||H==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(H=>H>0).reduce((H,U)=>H+U,0)]).sort((M,H)=>M[1]-H[1])[0])==null?void 0:j[0];I&&(K=I);break}case"initialPlacement":K=a;break}if(o!==K)return{reset:{placement:K}}}return{}}}},T3=new Set(["left","top"]);async function E3(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Hr(n),a=Gi(n),l=fr(n)==="y",c=T3.has(s)?-1:1,u=i&&l?-1:1,f=Ui(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const R3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await E3(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},k3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:v,y}=m;return{x:v,y}}},...l}=Ui(e,t),c={x:n,y:r},u=await vh(t,l),f=fr(Hr(o)),d=N1(f);let h=c[d],g=c[f];if(i){const m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=h+u[m],x=h-u[v];h=Ld(y,h,x)}if(s){const m=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=g+u[m],x=g-u[v];g=Ld(y,g,x)}const p=a.fn({...t,[d]:h,[f]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[d]:i,[f]:s}}}}}},A3=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Ui(e,t),u=await vh(t,c),f=Hr(o),d=Gi(o),h=fr(o)==="y",{width:g,height:p}=i.floating;let m,v;f==="top"||f==="bottom"?(m=f,v=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,m=d==="end"?"top":"bottom");const y=p-u.top-u.bottom,x=g-u.left-u.right,b=zr(p-u[m],y),w=zr(g-u[v],x),_=!t.middlewareData.shift;let E=b,R=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=y),_&&!d){const P=Xt(u.left,0),F=Xt(u.right,0),$=Xt(u.top,0),j=Xt(u.bottom,0);h?R=g-2*(P!==0||F!==0?P+F:Xt(u.left,u.right)):E=p-2*($!==0||j!==0?$+j:Xt(u.top,u.bottom))}await l({...t,availableWidth:R,availableHeight:E});const k=await s.getDimensions(a.floating);return g!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function L1(e){const t=dn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ft(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=bl(n)!==i||bl(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function xh(e){return De(e)?e:e.contextElement}function Si(e){const t=xh(e);if(!Ft(t))return Wn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=L1(t);let s=(i?bl(n.width):n.width)/r,a=(i?bl(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const N3=Wn(0);function F1(e){const t=Bt(e);return!ec()||!t.visualViewport?N3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function M3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bt(e)?!1:t}function ko(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=xh(e);let s=Wn(1);t&&(r?De(r)&&(s=Si(r)):s=Si(e));const a=M3(i,n,r)?F1(i):Wn(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const d=Bt(i),h=r&&De(r)?Bt(r):r;let g=d,p=Pd(g);for(;p&&r&&h!==g;){const m=Si(p),v=p.getBoundingClientRect(),y=dn(p),x=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,b=v.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,f*=m.y,l+=x,c+=b,g=Bt(p),p=Pd(g)}}return Cl({width:u,height:f,x:l,y:c})}function nc(e,t){const n=tc(e).scrollLeft;return t?t.left+n:ko(Jn(e)).left+n}function $1(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-nc(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function P3(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Jn(r),a=t?Ql(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Wn(1);const u=Wn(0),f=Ft(r);if((f||!f&&!i)&&((Ki(r)!=="body"||ta(s))&&(l=tc(r)),Ft(r))){const h=ko(r);c=Si(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!i?$1(s,l):Wn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function L3(e){return Array.from(e.getClientRects())}function F3(e){const t=Jn(e),n=tc(e),r=e.ownerDocument.body,o=Xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+nc(e);const a=-n.scrollTop;return dn(r).direction==="rtl"&&(s+=Xt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const dm=25;function $3(e,t){const n=Bt(e),r=Jn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=ec();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=nc(r);if(c<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=dm&&(i-=g)}else c<=dm&&(i+=c);return{width:i,height:s,x:a,y:l}}const O3=new Set(["absolute","fixed"]);function I3(e,t){const n=ko(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ft(e)?Si(e):Wn(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function fm(e,t,n){let r;if(t==="viewport")r=$3(e,n);else if(t==="document")r=F3(Jn(e));else if(De(t))r=I3(t,n);else{const o=F1(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Cl(r)}function O1(e,t){const n=br(e);return n===t||!De(n)||mr(n)?!1:dn(n).position==="fixed"||O1(n,t)}function D3(e,t){const n=t.get(e);if(n)return n;let r=Ir(e,[],!1).filter(a=>De(a)&&Ki(a)!=="body"),o=null;const i=dn(e).position==="fixed";let s=i?br(e):e;for(;De(s)&&!mr(s);){const a=dn(s),l=ph(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&O3.has(o.position)||ta(s)&&!l&&O1(e,s))?r=r.filter(u=>u!==s):o=a,s=br(s)}return t.set(e,r),r}function j3(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Ql(t)?[]:D3(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=fm(t,u,o);return c.top=Xt(f.top,c.top),c.right=zr(f.right,c.right),c.bottom=zr(f.bottom,c.bottom),c.left=Xt(f.left,c.left),c},fm(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function V3(e){const{width:t,height:n}=L1(e);return{width:t,height:n}}function B3(e,t,n){const r=Ft(t),o=Jn(t),i=n==="fixed",s=ko(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Wn(0);function c(){l.x=nc(o)}if(r||!r&&!i)if((Ki(t)!=="body"||ta(o))&&(a=tc(t)),r){const h=ko(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?$1(o,a):Wn(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function eu(e){return dn(e).position==="static"}function hm(e,t){if(!Ft(e)||dn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Jn(e)===n&&(n=n.ownerDocument.body),n}function I1(e,t){const n=Bt(e);if(Ql(e))return n;if(!Ft(e)){let o=br(e);for(;o&&!mr(o);){if(De(o)&&!eu(o))return o;o=br(o)}return n}let r=hm(e,t);for(;r&&Wk(r)&&eu(r);)r=hm(r,t);return r&&mr(r)&&eu(r)&&!ph(r)?n:r||Yk(e)||n}const z3=async function(e){const t=this.getOffsetParent||I1,n=this.getDimensions,r=await n(e.floating);return{reference:B3(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function H3(e){return dn(e).direction==="rtl"}const W3={convertOffsetParentRelativeRectToViewportRelativeRect:P3,getDocumentElement:Jn,getClippingRect:j3,getOffsetParent:I1,getElementRects:z3,getClientRects:L3,getDimensions:V3,getScale:Si,isElement:De,isRTL:H3};function D1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function K3(e,t){let n=null,r;const o=Jn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=c;if(a||t(),!d||!h)return;const g=Na(f),p=Na(o.clientWidth-(u+d)),m=Na(o.clientHeight-(f+h)),v=Na(u),x={rootMargin:-g+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Xt(0,zr(1,l))||1};let b=!0;function w(_){const E=_[0].intersectionRatio;if(E!==l){if(!b)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!D1(c,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(w,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,x)}n.observe(e)}return s(!0),i}function bh(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=xh(e),u=o||i?[...c?Ir(c):[],...Ir(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const f=c&&a?K3(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(v=>{let[y]=v;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,p=l?ko(e):null;l&&m();function m(){const v=ko(e);p&&!D1(p,v)&&n(),p=v,g=requestAnimationFrame(m)}return n(),()=>{var v;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const U3=R3,G3=k3,q3=_3,Y3=A3,gm=S3,X3=(e,t,n)=>{const r=new Map,o={platform:W3,...n},i={...o.platform,_c:r};return C3(e,t,{...o,platform:i})};var Z3=typeof document<"u",J3=function(){},ol=Z3?S.useLayoutEffect:J3;function Sl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Sl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Sl(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function j1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pm(e,t){const n=j1(e);return Math.round(t*n)/n}function tu(e){const t=N.useRef(e);return ol(()=>{t.current=e}),t}function Q3(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=N.useState(r);Sl(d,r)||h(r);const[g,p]=N.useState(null),[m,v]=N.useState(null),y=N.useCallback(M=>{M!==_.current&&(_.current=M,p(M))},[]),x=N.useCallback(M=>{M!==E.current&&(E.current=M,v(M))},[]),b=i||g,w=s||m,_=N.useRef(null),E=N.useRef(null),R=N.useRef(u),k=l!=null,P=tu(l),F=tu(o),$=tu(c),j=N.useCallback(()=>{if(!_.current||!E.current)return;const M={placement:t,strategy:n,middleware:d};F.current&&(M.platform=F.current),X3(_.current,E.current,M).then(H=>{const U={...H,isPositioned:$.current!==!1};O.current&&!Sl(R.current,U)&&(R.current=U,A_.flushSync(()=>{f(U)}))})},[d,t,n,F,$]);ol(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[c]);const O=N.useRef(!1);ol(()=>(O.current=!0,()=>{O.current=!1}),[]),ol(()=>{if(b&&(_.current=b),w&&(E.current=w),b&&w){if(P.current)return P.current(b,w,j);j()}},[b,w,j,P,k]);const D=N.useMemo(()=>({reference:_,floating:E,setReference:y,setFloating:x}),[y,x]),K=N.useMemo(()=>({reference:b,floating:w}),[b,w]),I=N.useMemo(()=>{const M={position:n,left:0,top:0};if(!K.floating)return M;const H=pm(K.floating,u.x),U=pm(K.floating,u.y);return a?{...M,transform:"translate("+H+"px, "+U+"px)",...j1(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:U}},[n,a,K.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:j,refs:D,elements:K,floatingStyles:I}),[u,j,D,K,I])}const eA=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?gm({element:r.current,padding:o}).fn(n):{}:r?gm({element:r,padding:o}).fn(n):{}}}},wh=(e,t)=>({...U3(e),options:[e,t]}),Ch=(e,t)=>({...G3(e),options:[e,t]}),Sh=(e,t)=>({...q3(e),options:[e,t]}),tA=(e,t)=>({...Y3(e),options:[e,t]}),nA=(e,t)=>({...eA(e),options:[e,t]});function _l(e){const t=N.useRef(void 0),n=N.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i?.())}},e);return N.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const rA="data-floating-ui-focusable",mm="active",ym="selected",oA={...N};let vm=!1,iA=0;const xm=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+iA++;function sA(){const[e,t]=N.useState(()=>vm?xm():void 0);return Fi(()=>{e==null&&t(xm())},[]),N.useEffect(()=>{vm=!0},[]),e}const aA=oA.useId,V1=aA||sA;let $d;process.env.NODE_ENV!=="production"&&($d=new Set);function lA(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=$d)!=null&&e.has(o))){var i;(i=$d)==null||i.add(o),console.error(o)}}function cA(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const uA=N.createContext(null),dA=N.createContext(null),_h=()=>{var e;return((e=N.useContext(uA))==null?void 0:e.id)||null},Th=()=>N.useContext(dA);function Eh(e){return"data-floating-ui-"+e}function on(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const bm=Eh("safe-polygon");function nu(e,t,n){if(n&&!zs(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function ru(e){return typeof e=="function"?e():e}function B1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,h=Th(),g=_h(),p=Ma(c),m=Ma(l),v=Ma(n),y=Ma(f),x=N.useRef(),b=N.useRef(-1),w=N.useRef(),_=N.useRef(-1),E=N.useRef(!0),R=N.useRef(!1),k=N.useRef(()=>{}),P=N.useRef(!1),F=jn(()=>{var I;const M=(I=o.current.openEvent)==null?void 0:I.type;return M?.includes("mouse")&&M!=="mousedown"});N.useEffect(()=>{if(!a)return;function I(M){let{open:H}=M;H||(on(b),on(_),E.current=!0,P.current=!1)}return i.on("openchange",I),()=>{i.off("openchange",I)}},[a,i]),N.useEffect(()=>{if(!a||!p.current||!n)return;function I(H){F()&&r(!1,H,"hover")}const M=wo(s.floating).documentElement;return M.addEventListener("mouseleave",I),()=>{M.removeEventListener("mouseleave",I)}},[s.floating,n,r,a,p,F]);const $=N.useCallback(function(I,M,H){M===void 0&&(M=!0),H===void 0&&(H="hover");const U=nu(m.current,"close",x.current);U&&!w.current?(on(b),b.current=window.setTimeout(()=>r(!1,I,H),U)):M&&(on(b),r(!1,I,H))},[m,r]),j=jn(()=>{k.current(),w.current=void 0}),O=jn(()=>{if(R.current){const I=wo(s.floating).body;I.style.pointerEvents="",I.removeAttribute(bm),R.current=!1}}),D=jn(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);N.useEffect(()=>{if(!a)return;function I(G){if(on(b),E.current=!1,u&&!zs(x.current)||ru(y.current)>0&&!nu(m.current,"open"))return;const Y=nu(m.current,"open",x.current);Y?b.current=window.setTimeout(()=>{v.current||r(!0,G,"hover")},Y):n||r(!0,G,"hover")}function M(G){if(D()){O();return}k.current();const Y=wo(s.floating);if(on(_),P.current=!1,p.current&&o.current.floatingContext){n||on(b),w.current=p.current({...o.current.floatingContext,tree:h,x:G.clientX,y:G.clientY,onClose(){O(),j(),D()||$(G,!0,"safe-polygon")}});const ne=w.current;Y.addEventListener("mousemove",ne),k.current=()=>{Y.removeEventListener("mousemove",ne)};return}(x.current!=="touch"||!Bs(s.floating,G.relatedTarget))&&$(G)}function H(G){D()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:h,x:G.clientX,y:G.clientY,onClose(){O(),j(),D()||$(G)}})(G))}function U(){on(b)}function re(G){D()||$(G,!1)}if(De(s.domReference)){const G=s.domReference,Y=s.floating;return n&&G.addEventListener("mouseleave",H),d&&G.addEventListener("mousemove",I,{once:!0}),G.addEventListener("mouseenter",I),G.addEventListener("mouseleave",M),Y&&(Y.addEventListener("mouseleave",H),Y.addEventListener("mouseenter",U),Y.addEventListener("mouseleave",re)),()=>{n&&G.removeEventListener("mouseleave",H),d&&G.removeEventListener("mousemove",I),G.removeEventListener("mouseenter",I),G.removeEventListener("mouseleave",M),Y&&(Y.removeEventListener("mouseleave",H),Y.removeEventListener("mouseenter",U),Y.removeEventListener("mouseleave",re))}}},[s,a,e,u,d,$,j,O,r,n,v,h,m,p,o,D,y]),Fi(()=>{var I;if(a&&n&&(I=p.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&F()){R.current=!0;const H=s.floating;if(De(s.domReference)&&H){var M;const U=wo(s.floating).body;U.setAttribute(bm,"");const re=s.domReference,G=h==null||(M=h.nodesRef.current.find(Y=>Y.id===g))==null||(M=M.context)==null?void 0:M.elements.floating;return G&&(G.style.pointerEvents=""),U.style.pointerEvents="none",re.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{U.style.pointerEvents="",re.style.pointerEvents="",H.style.pointerEvents=""}}}},[a,n,g,s,h,p,F]),Fi(()=>{n||(x.current=void 0,P.current=!1,j(),O())},[n,j,O]),N.useEffect(()=>()=>{j(),on(b),on(_),O()},[a,s.domReference,j,O]);const K=N.useMemo(()=>{function I(M){x.current=M.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(M){const{nativeEvent:H}=M;function U(){!E.current&&!v.current&&r(!0,H,"hover")}u&&!zs(x.current)||n||ru(y.current)===0||P.current&&M.movementX**2+M.movementY**2<2||(on(_),x.current==="touch"?U():(P.current=!0,_.current=window.setTimeout(U,ru(y.current))))}}},[u,r,n,v,y]);return N.useMemo(()=>a?{reference:K}:{},[a,K])}function wm(e){return Ft(e.target)&&e.target.tagName==="BUTTON"}function fA(e){return Ft(e.target)&&e.target.tagName==="A"}function Cm(e){return P1(e)}function hA(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=N.useRef(),h=N.useRef(!1),g=N.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(zs(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}zs(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||wm(p))&&(p.key===" "&&!Cm(i)&&(p.preventDefault(),h.current=!0),!fA(p)&&p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||wm(p)||Cm(i)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,i,a,c,u,r,n,f,l]);return N.useMemo(()=>s?{reference:g}:{},[s,g])}const gA={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},pA={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Sm=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function z1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:h,capture:g}=t,p=Th(),m=jn(typeof l=="function"?l:()=>!1),v=typeof l=="function"?m:l,y=N.useRef(!1),{escapeKey:x,outsidePress:b}=Sm(h),{escapeKey:w,outsidePress:_}=Sm(g),E=N.useRef(!1),R=jn(O=>{var D;if(!n||!s||!a||O.key!=="Escape"||E.current)return;const K=(D=i.current.floatingContext)==null?void 0:D.nodeId,I=p?rl(p.nodesRef.current,K):[];if(!x&&(O.stopPropagation(),I.length>0)){let M=!0;if(I.forEach(H=>{var U;if((U=H.context)!=null&&U.open&&!H.context.dataRef.current.__escapeKeyBubbles){M=!1;return}}),!M)return}r(!1,m3(O)?O.nativeEvent:O,"escape-key")}),k=jn(O=>{var D;const K=()=>{var I;R(O),(I=ci(O))==null||I.removeEventListener("keydown",K)};(D=ci(O))==null||D.addEventListener("keydown",K)}),P=jn(O=>{var D;const K=i.current.insideReactTree;i.current.insideReactTree=!1;const I=y.current;if(y.current=!1,c==="click"&&I||K||typeof v=="function"&&!v(O))return;const M=ci(O),H="["+Eh("inert")+"]",U=wo(o.floating).querySelectorAll(H);let re=De(M)?M:null;for(;re&&!mr(re);){const ne=br(re);if(mr(ne)||!De(ne))break;re=ne}if(U.length&&De(M)&&!h3(M)&&!Bs(M,o.floating)&&Array.from(U).every(ne=>!Bs(re,ne)))return;if(Ft(M)&&j){const ne=mr(M),oe=dn(M),me=/auto|scroll/,ee=ne||me.test(oe.overflowX),ve=ne||me.test(oe.overflowY),Se=ee&&M.clientWidth>0&&M.scrollWidth>M.clientWidth,Ee=ve&&M.clientHeight>0&&M.scrollHeight>M.clientHeight,ze=oe.direction==="rtl",je=Ee&&(ze?O.offsetX<=M.offsetWidth-M.clientWidth:O.offsetX>M.clientWidth),Rt=Se&&O.offsetY>M.clientHeight;if(je||Rt)return}const G=(D=i.current.floatingContext)==null?void 0:D.nodeId,Y=p&&rl(p.nodesRef.current,G).some(ne=>{var oe;return Qc(O,(oe=ne.context)==null?void 0:oe.elements.floating)});if(Qc(O,o.floating)||Qc(O,o.domReference)||Y)return;const Q=p?rl(p.nodesRef.current,G):[];if(Q.length>0){let ne=!0;if(Q.forEach(oe=>{var me;if((me=oe.context)!=null&&me.open&&!oe.context.dataRef.current.__outsidePressBubbles){ne=!1;return}}),!ne)return}r(!1,O,"outside-press")}),F=jn(O=>{var D;const K=()=>{var I;P(O),(I=ci(O))==null||I.removeEventListener(c,K)};(D=ci(O))==null||D.addEventListener(c,K)});N.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=b;let O=-1;function D(U){r(!1,U,"ancestor-scroll")}function K(){window.clearTimeout(O),E.current=!0}function I(){O=window.setTimeout(()=>{E.current=!1},ec()?5:0)}const M=wo(o.floating);a&&(M.addEventListener("keydown",w?k:R,w),M.addEventListener("compositionstart",K),M.addEventListener("compositionend",I)),v&&M.addEventListener(c,_?F:P,_);let H=[];return d&&(De(o.domReference)&&(H=Ir(o.domReference)),De(o.floating)&&(H=H.concat(Ir(o.floating))),!De(o.reference)&&o.reference&&o.reference.contextElement&&(H=H.concat(Ir(o.reference.contextElement)))),H=H.filter(U=>{var re;return U!==((re=M.defaultView)==null?void 0:re.visualViewport)}),H.forEach(U=>{U.addEventListener("scroll",D,{passive:!0})}),()=>{a&&(M.removeEventListener("keydown",w?k:R,w),M.removeEventListener("compositionstart",K),M.removeEventListener("compositionend",I)),v&&M.removeEventListener(c,_?F:P,_),H.forEach(U=>{U.removeEventListener("scroll",D)}),window.clearTimeout(O)}},[i,o,a,v,c,n,r,d,s,x,b,R,w,k,P,_,F]),N.useEffect(()=>{i.current.insideReactTree=!1},[i,v,c]);const $=N.useMemo(()=>({onKeyDown:R,...u&&{[gA[f]]:O=>{r(!1,O.nativeEvent,"reference-press")},...f!=="click"&&{onClick(O){r(!1,O.nativeEvent,"reference-press")}}}}),[R,r,u,f]),j=N.useMemo(()=>({onKeyDown:R,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[pA[c]]:()=>{i.current.insideReactTree=!0}}),[R,c,i]);return N.useMemo(()=>s?{reference:$,floating:j}:{},[s,$,j])}function mA(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=V1(),i=N.useRef({}),[s]=N.useState(()=>cA()),a=_h()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!De(h)&&lA("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=N.useState(r.reference),u=jn((h,g,p)=>{i.current.openEvent=h?g:void 0,s.emit("openchange",{open:h,event:g,reason:p,nested:a}),n?.(h,g,p)}),f=N.useMemo(()=>({setPositionReference:c}),[]),d=N.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return N.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:o,refs:f}),[t,u,d,s,o,f])}function Rh(e){e===void 0&&(e={});const{nodeId:t}=e,n=mA({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=N.useState(null),[a,l]=N.useState(null),u=o?.domReference||i,f=N.useRef(null),d=Th();Fi(()=>{u&&(f.current=u)},[u]);const h=Q3({...e,elements:{...o,...a&&{reference:a}}}),g=N.useCallback(x=>{const b=De(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;l(b),h.refs.setReference(b)},[h.refs]),p=N.useCallback(x=>{(De(x)||x===null)&&(f.current=x,s(x)),(De(h.refs.reference.current)||h.refs.reference.current===null||x!==null&&!De(x))&&h.refs.setReference(x)},[h.refs]),m=N.useMemo(()=>({...h.refs,setReference:p,setPositionReference:g,domReference:f}),[h.refs,p,g]),v=N.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),y=N.useMemo(()=>({...h,...r,refs:m,elements:v,nodeId:t}),[h,m,v,t,r]);return Fi(()=>{r.dataRef.current.floatingContext=y;const x=d?.nodesRef.current.find(b=>b.id===t);x&&(x.context=y)}),N.useMemo(()=>({...h,context:y,refs:m,elements:v}),[h,m,v,y])}function ou(){return u3()&&c3()}function yA(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=N.useRef(!1),u=N.useRef(-1),f=N.useRef(!0);N.useEffect(()=>{if(!a)return;const h=Bt(s.domReference);function g(){!n&&Ft(s.domReference)&&s.domReference===cm(wo(s.domReference))&&(c.current=!0)}function p(){f.current=!0}function m(){f.current=!1}return h.addEventListener("blur",g),ou()&&(h.addEventListener("keydown",p,!0),h.addEventListener("pointerdown",m,!0)),()=>{h.removeEventListener("blur",g),ou()&&(h.removeEventListener("keydown",p,!0),h.removeEventListener("pointerdown",m,!0))}},[s.domReference,n,a]),N.useEffect(()=>{if(!a)return;function h(g){let{reason:p}=g;(p==="reference-press"||p==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),N.useEffect(()=>()=>{on(u)},[]);const d=N.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const g=ci(h.nativeEvent);if(l&&De(g)){if(ou()&&!h.relatedTarget){if(!f.current&&!P1(g))return}else if(!g3(g))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const g=h.relatedTarget,p=h.nativeEvent,m=De(g)&&g.hasAttribute(Eh("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var v;const y=cm(s.domReference?s.domReference.ownerDocument:document);!g&&y===s.domReference||Bs((v=i.current.floatingContext)==null?void 0:v.refs.floating.current,y)||Bs(s.domReference,y)||m||r(!1,p,"focus")})}}),[i,s.domReference,r,l]);return N.useMemo(()=>a?{reference:d}:{},[a,d])}function iu(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[mm]:s,[ym]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[rA]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[mm,ym].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var d,h=arguments.length,g=new Array(h),p=0;p<h;p++)g[p]=arguments[p];return(d=r.get(c))==null?void 0:d.map(m=>m(...g)).find(m=>m!==void 0)}}}else s[c]=u}),s),{})}}function H1(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=N.useCallback(a=>iu(a,e,"reference"),t),i=N.useCallback(a=>iu(a,e,"floating"),n),s=N.useCallback(a=>iu(a,e,"item"),r);return N.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const vA=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function W1(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=V1(),u=((n=i.domReference)==null?void 0:n.id)||c,f=N.useMemo(()=>{var y;return((y=p3(i.floating))==null?void 0:y.id)||s},[i.floating,s]),d=(r=vA.get(l))!=null?r:l,g=_h()!=null,p=N.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:u},...d==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,g,o,u,l]),m=N.useMemo(()=>{const y={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?y:{...y,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,l]),v=N.useCallback(y=>{let{active:x,selected:b}=y;const w={role:"option",...x&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...w,"aria-selected":b}}return{}},[f,l]);return N.useMemo(()=>a?{reference:p,floating:m,item:v}:{},[a,p,m,v])}const xA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{opacity:.5},N.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"}))),{color:en,spacing:ls}=V,su=T.css({opacity:.6,cursor:"not-allowed"}),xt={"input-container":T.css({backgroundColor:en.fill.accentSecondary,border:`1px solid ${en.border.neutralAlphaBasic}`,padding:`${ls.md} ${ls.lg}`,borderRadius:12,minHeight:40,width:"100%",transition:"border-color 0.2s ease, background-color 0.2s ease","& textarea":{resize:"none"},[`&:not(.${su}):hover`]:{backgroundColor:en.fill.neutralPrimaryHover},"&:focus-within":{borderColor:en.border.accentPrimary,[`&:not(.${su}):hover`]:{borderColor:en.border.accentPrimary}}}),input:T.css({...xe.common,...xe.body1,background:"transparent",width:"100%",color:en.text.primary,"&::placeholder":{color:en.text.tertiary,textOverflow:"ellipsis"}}),"input-text-size_sm":T.css({...xe.body2}),"input-text-size_md":T.css({...xe.body2}),"input-text-align_left":T.css({textAlign:"left"}),"input-text-align_center":T.css({textAlign:"center"}),"input-text-align_right":T.css({textAlign:"right"}),sm:T.css({height:40,padding:ls.md}),md:T.css({height:48,padding:`14px ${ls.lg} 14px ${ls.lg}`}),error:T.css({borderColor:en.border.negativePrimary}),disabled:su,multiline:T.css({height:"auto"}),primary:T.css({background:en.fill.bgPrimary}),secondary:T.css({background:en.fill.bgSecondary}),"clear-button":T.css({cursor:"pointer",color:en.text.tertiary,height:20,"&:hover":{color:en.text.primary}})},{spacing:_m}=V;function Tm(e){return{...new Event("input",{bubbles:!0}),target:e,currentTarget:e}}const $i=S.forwardRef((e,t)=>{const{label:n,prompt:r,error:o,errorText:i,size:s="md",prefix:a,suffix:l,background:c="primary",showClearButton:u,disabled:f,value:d,defaultValue:h,className:g,wrapperClassName:p,labelClassName:m,fieldContainerClassName:v,promptClassName:y,errorClassName:x,textAlign:b="left",...w}=e,_=e.multiline===!0,E=S.useRef(null),R=S.useRef(null),k=_l([E,t]),P=_l([R,t]),{current:F}=S.useRef(d!==void 0),[$,j]=Bo(typeof d=="string"||typeof d=="number"?String(d):void 0,typeof h=="string"||typeof h=="number"?String(h):""),O=M=>{if(j(M.target.value),_){const H=e.onChange;H?.(M)}else{const H=e.onChange;H?.(M)}};S.useEffect(()=>{_&&e.autoResize&&R.current&&(R.current.style.height="auto",R.current.style.height=`${R.current.scrollHeight}px`)},[$,_,e.autoResize]);const D=()=>{if(j(""),!_){const H=E.current;if(H){H.value="";const U=Tm(H),re=e.onChange;re?.(U)}return}const M=R.current;if(M){M.value="";const H=Tm(M),U=e.onChange;U?.(H)}},K=()=>{if(_){const{rows:re,autoResize:G,onChange:Y,multiline:Q,...ne}=w;return C.jsx("textarea",{ref:P,rows:e.rows??3,className:T.cx(xt.input,g,{[xt.disabled]:f,[xt[`input-text-align_${b}`]]:!!b}),disabled:f,maxLength:e.maxLength,...ne,...F?{value:$}:{defaultValue:String(h??"")},onChange:O})}const{onChange:M,multiline:H,...U}=w;return C.jsx("input",{...U,ref:k,className:T.cx(xt.input,xt[`input-text-size_${s}`],g,{[xt.disabled]:f,[xt[`input-text-align_${b}`]]:!!b}),disabled:f,type:e.type??"text",...F?{value:$}:{defaultValue:String(h??"")},onChange:O})},I=S.useMemo(()=>c==="white"?xt.primary:c==="gray"?xt.secondary:xt[c],[c]);return C.jsxs(q,{w:"full",gap:_m.sm,className:p,children:[typeof n=="string"?C.jsx(le,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",className:m,children:n}):n,C.jsxs(q,{row:!0,alignItems:_?"flex-start":"center",w:"full",gap:_m.md,className:T.cx(xt["input-container"],I,xt[s],{[xt.error]:o,[xt.disabled]:f,[xt.multiline]:_},v),children:[a&&C.jsx(q,{flex:"none",children:a}),C.jsx(q,{flex:"1",children:K()}),u&&$&&!f&&C.jsx(q,{flex:"none",children:C.jsx("span",{className:xt["clear-button"],onClick:D,children:C.jsx(xA,{})})}),l&&C.jsx(q,{flex:"none",children:l})]}),(r||_)&&C.jsxs(q,{row:!0,gap:10,w:"full",children:[typeof r=="string"?C.jsx(le,{variant:"caption-1",colorName:"tertiary",className:y,children:r}):r,_&&e.maxLength&&C.jsx(le,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${$.length}/${e.maxLength}`})]}),i&&o&&C.jsx(le,{variant:"body-2",colorName:"negative",fontWeight:"regular",className:x,children:i})]})});$i.displayName="Input";const bA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 8.33333H5M17.5 5H2.5M17.5 11.6667H2.5M15 15H5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),wA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.3333 8.33333H2.5M16.6667 5H2.5M16.6667 11.6667H2.5M13.3333 15H2.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),CA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 8.33333H6.66665M17.5 5H3.33331M17.5 11.6667H3.33331M17.5 15H6.66665",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),SA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 10H11.6667C13.5076 10 15 8.50766 15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H5V10ZM5 10H12.5C14.3409 10 15.8333 11.4924 15.8333 13.3334C15.8333 15.1743 14.3409 16.6667 12.5 16.6667H5V10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),_A=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.5 17.5H5.77614C5.2713 17.5 5.01887 17.5 4.90199 17.4002C4.80056 17.3135 4.74674 17.1836 4.75721 17.0506C4.76927 16.8974 4.94776 16.7189 5.30474 16.3619L12.3905 9.27614C12.7205 8.94613 12.8855 8.78112 13.0758 8.7193C13.2432 8.66492 13.4235 8.66492 13.5908 8.7193C13.7811 8.78112 13.9461 8.94613 14.2761 9.27614L17.5 12.5V13.5M13.5 17.5C14.9001 17.5 15.6002 17.5 16.135 17.2275C16.6054 16.9878 16.9878 16.6054 17.2275 16.135C17.5 15.6002 17.5 14.9001 17.5 13.5M13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5M8.75 7.08333C8.75 8.00381 8.00381 8.75 7.08333 8.75C6.16286 8.75 5.41667 8.00381 5.41667 7.08333C5.41667 6.16286 6.16286 5.41667 7.08333 5.41667C8.00381 5.41667 8.75 6.16286 8.75 7.08333Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),TA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15.8334 3.33337H8.33335M11.6667 16.6667H4.16669M12.5 3.33337L7.50002 16.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),EA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_1571_1710)"},N.createElement("path",{d:"M8.33332 10.8333C8.69119 11.3118 9.14778 11.7077 9.67211 11.9941C10.1964 12.2806 10.7762 12.4509 11.3722 12.4936C11.9681 12.5363 12.5663 12.4503 13.1261 12.2415C13.6859 12.0327 14.1942 11.7059 14.6167 11.2833L17.1167 8.78335C17.8756 7.9975 18.2956 6.94499 18.2861 5.85251C18.2766 4.76002 17.8384 3.71497 17.0659 2.94243C16.2934 2.1699 15.2483 1.7317 14.1558 1.7222C13.0633 1.71271 12.0108 2.13269 11.225 2.89168L9.79165 4.31668M11.6666 9.16668C11.3088 8.68824 10.8522 8.29236 10.3279 8.0059C9.80353 7.71943 9.22373 7.54908 8.62777 7.5064C8.03182 7.46372 7.43366 7.54971 6.87386 7.75853C6.31406 7.96735 5.80572 8.29412 5.38332 8.71668L2.88332 11.2167C2.12432 12.0025 1.70435 13.055 1.71384 14.1475C1.72334 15.24 2.16154 16.2851 2.93407 17.0576C3.70661 17.8301 4.75166 18.2683 5.84414 18.2778C6.93663 18.2873 7.98914 17.8673 8.77498 17.1083L10.2 15.6833",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_1571_1710"},N.createElement("rect",{width:20,height:20,fill:"white"})))),RA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 9.99996L7.5 9.99996M17.5 4.99996L7.5 4.99996M17.5 15L7.5 15M4.16667 9.99996C4.16667 10.4602 3.79357 10.8333 3.33333 10.8333C2.8731 10.8333 2.5 10.4602 2.5 9.99996C2.5 9.53972 2.8731 9.16663 3.33333 9.16663C3.79357 9.16663 4.16667 9.53972 4.16667 9.99996ZM4.16667 4.99996C4.16667 5.4602 3.79357 5.83329 3.33333 5.83329C2.8731 5.83329 2.5 5.4602 2.5 4.99996C2.5 4.53972 2.8731 4.16663 3.33333 4.16663C3.79357 4.16663 4.16667 4.53972 4.16667 4.99996ZM4.16667 15C4.16667 15.4602 3.79357 15.8333 3.33333 15.8333C2.8731 15.8333 2.5 15.4602 2.5 15C2.5 14.5397 2.8731 14.1666 3.33333 14.1666C3.79357 14.1666 4.16667 14.5397 4.16667 15Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),kA=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M14 8.74967C14.4142 8.74967 14.75 8.41389 14.75 7.99967C14.75 7.58546 14.4142 7.24967 14 7.24967V7.99967V8.74967ZM6 7.24967C5.58579 7.24967 5.25 7.58546 5.25 7.99967C5.25 8.41389 5.58579 8.74967 6 8.74967V7.99967V7.24967ZM14 4.74967C14.4142 4.74967 14.75 4.41389 14.75 3.99967C14.75 3.58546 14.4142 3.24967 14 3.24967V3.99967V4.74967ZM6 3.24967C5.58579 3.24967 5.25 3.58546 5.25 3.99967C5.25 4.41389 5.58579 4.74967 6 4.74967V3.99967V3.24967ZM14 12.7497C14.4142 12.7497 14.75 12.4139 14.75 11.9997C14.75 11.5855 14.4142 11.2497 14 11.2497V11.9997V12.7497ZM6 11.2497C5.58579 11.2497 5.25 11.5855 5.25 11.9997C5.25 12.4139 5.58579 12.7497 6 12.7497V11.9997V11.2497ZM1.58967 3.48952C1.24295 3.71614 1.14558 4.18092 1.3722 4.52765C1.59882 4.87437 2.0636 4.97174 2.41033 4.74512L2 4.11732L1.58967 3.48952ZM3.2 3.33301H3.95C3.95 3.05764 3.79909 2.80441 3.5569 2.67337C3.31471 2.54233 3.02018 2.55455 2.78967 2.70521L3.2 3.33301ZM2.4 5.91634C1.98579 5.91634 1.65 6.25213 1.65 6.66634C1.65 7.08055 1.98579 7.41634 2.4 7.41634V6.66634V5.91634ZM4 7.41634C4.41421 7.41634 4.75 7.08055 4.75 6.66634C4.75 6.25213 4.41421 5.91634 4 5.91634V6.66634V7.41634ZM3.73743 10.8967L4.2726 11.4222L4.2726 11.4222L3.73743 10.8967ZM2 12.6663L1.46483 12.1409C1.25318 12.3565 1.19153 12.678 1.30841 12.9565C1.4253 13.2351 1.69791 13.4163 2 13.4163V12.6663ZM4 13.4163C4.41421 13.4163 4.75 13.0806 4.75 12.6663C4.75 12.2521 4.41421 11.9163 4 11.9163V12.6663V13.4163ZM1.25 10.2589C1.25 10.6731 1.58579 11.0089 2 11.0089C2.41421 11.0089 2.75 10.6731 2.75 10.2589H2H1.25ZM14 7.99967V7.24967L6 7.24967V7.99967V8.74967L14 8.74967V7.99967ZM14 3.99967V3.24967H6V3.99967V4.74967H14V3.99967ZM14 11.9997V11.2497L6 11.2497V11.9997V12.7497L14 12.7497V11.9997ZM2 4.11732L2.41033 4.74512L3.61033 3.96081L3.2 3.33301L2.78967 2.70521L1.58967 3.48952L2 4.11732ZM3.2 3.33301H2.45V6.66634H3.2H3.95V3.33301H3.2ZM3.2 6.66634V5.91634H2.4V6.66634V7.41634H3.2V6.66634ZM3.2 6.66634V7.41634H4V6.66634V5.91634H3.2V6.66634ZM3.73743 10.8967L3.20226 10.3713L1.46483 12.1409L2 12.6663L2.53517 13.1918L4.2726 11.4222L3.73743 10.8967ZM2 12.6663V13.4163H4V12.6663V11.9163H2V12.6663ZM4 10.2654H3.25C3.25 10.2957 3.23759 10.3353 3.20225 10.3713L3.73743 10.8967L4.2726 11.4222C4.57518 11.114 4.75 10.7002 4.75 10.2654H4ZM3 9.33301V10.083C3.08406 10.083 3.1515 10.1147 3.19493 10.1553C3.23791 10.1955 3.25 10.2354 3.25 10.2654H4H4.75C4.75 9.29296 3.91808 8.58301 3 8.58301V9.33301ZM2 10.2589H2.75C2.75 10.2299 2.76126 10.1927 2.80245 10.1545C2.84462 10.1155 2.91258 10.083 3 10.083V9.33301V8.58301C2.0889 8.58301 1.25 9.28004 1.25 10.2589H2Z",fill:"currentColor"})),AA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 13.3334C5 15.1743 6.49238 16.6667 8.33333 16.6667H11.6667C13.5076 16.6667 15 15.1743 15 13.3334C15 11.4924 13.5076 10 11.6667 10M15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H8.33333C6.49238 3.33337 5 4.82576 5 6.66671M2.5 10H17.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),NA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M2.5 7.5L17.5 7.5M7.5 2.5L7.5 17.5M6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5C17.5 14.9001 17.5 15.6002 17.2275 16.135C16.9878 16.6054 16.6054 16.9878 16.135 17.2275C15.6002 17.5 14.9001 17.5 13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),MA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 3.33337V9.16671C15 11.9281 12.7614 14.1667 9.99998 14.1667C7.23856 14.1667 4.99998 11.9281 4.99998 9.16671V3.33337M3.33331 17.5H16.6666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),kh=S.createContext(null);function na(){const e=S.useContext(kh);if(!e)throw new Error("useEditorStates must be used within EditorState Provider");return e}const K1=S.createContext(null);function PA(){const e=S.useContext(K1);if(!e)throw new Error("useToolbarContext must be used within ToolbarContext provider");return e}var bs={exports:{}};bs.exports;var Em;function LA(){return Em||(Em=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",p="[object Map]",m="[object Number]",v="[object Null]",y="[object Object]",x="[object Proxy]",b="[object RegExp]",w="[object Set]",_="[object String]",E="[object Undefined]",R="[object WeakMap]",k="[object ArrayBuffer]",P="[object DataView]",F="[object Float32Array]",$="[object Float64Array]",j="[object Int8Array]",O="[object Int16Array]",D="[object Int32Array]",K="[object Uint8Array]",I="[object Uint8ClampedArray]",M="[object Uint16Array]",H="[object Uint32Array]",U=/[\\^$.*+?()[\]{}|]/g,re=/^\[object .+?Constructor\]$/,G=/^(?:0|[1-9]\d*)$/,Y={};Y[F]=Y[$]=Y[j]=Y[O]=Y[D]=Y[K]=Y[I]=Y[M]=Y[H]=!0,Y[a]=Y[l]=Y[k]=Y[u]=Y[P]=Y[f]=Y[d]=Y[h]=Y[p]=Y[m]=Y[y]=Y[b]=Y[w]=Y[_]=Y[R]=!1;var Q=typeof Bn=="object"&&Bn&&Bn.Object===Object&&Bn,ne=typeof self=="object"&&self&&self.Object===Object&&self,oe=Q||ne||Function("return this")(),me=t&&!t.nodeType&&t,ee=me&&!0&&e&&!e.nodeType&&e,ve=ee&&ee.exports===me,Se=ve&&Q.process,Ee=(function(){try{var A=ee&&ee.require&&ee.require("util").types;return A||Se&&Se.binding&&Se.binding("util")}catch{}})(),ze=Ee&&Ee.isTypedArray;function je(A,L,z){switch(z.length){case 0:return A.call(L);case 1:return A.call(L,z[0]);case 2:return A.call(L,z[0],z[1]);case 3:return A.call(L,z[0],z[1],z[2])}return A.apply(L,z)}function Rt(A,L){for(var z=-1,ie=Array(A);++z<A;)ie[z]=L(z);return ie}function gn(A){return function(L){return A(L)}}function ot(A,L){return A?.[L]}function Gt(A,L){return function(z){return A(L(z))}}var Qt=Array.prototype,pt=Function.prototype,se=Object.prototype,Re=oe["__core-js_shared__"],Ye=pt.toString,rt=se.hasOwnProperty,It=(function(){var A=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""})(),to=se.toString,no=Ye.call(Object),pa=RegExp("^"+Ye.call(rt).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qo=ve?oe.Buffer:void 0,Ce=oe.Symbol,Le=oe.Uint8Array;qo&&qo.allocUnsafe;var Yo=Gt(Object.getPrototypeOf,Object),Ag=Object.create,TS=se.propertyIsEnumerable,ES=Qt.splice,ro=Ce?Ce.toStringTag:void 0,ma=(function(){try{var A=kc(Object,"defineProperty");return A({},"",{}),A}catch{}})(),RS=qo?qo.isBuffer:void 0,Ng=Math.max,kS=Date.now,Mg=kc(oe,"Map"),rs=kc(Object,"create"),AS=(function(){function A(){}return function(L){if(!io(L))return{};if(Ag)return Ag(L);A.prototype=L;var z=new A;return A.prototype=void 0,z}})();function oo(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function NS(){this.__data__=rs?rs(null):{},this.size=0}function MS(A){var L=this.has(A)&&delete this.__data__[A];return this.size-=L?1:0,L}function PS(A){var L=this.__data__;if(rs){var z=L[A];return z===r?void 0:z}return rt.call(L,A)?L[A]:void 0}function LS(A){var L=this.__data__;return rs?L[A]!==void 0:rt.call(L,A)}function FS(A,L){var z=this.__data__;return this.size+=this.has(A)?0:1,z[A]=rs&&L===void 0?r:L,this}oo.prototype.clear=NS,oo.prototype.delete=MS,oo.prototype.get=PS,oo.prototype.has=LS,oo.prototype.set=FS;function Qn(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function $S(){this.__data__=[],this.size=0}function OS(A){var L=this.__data__,z=ya(L,A);if(z<0)return!1;var ie=L.length-1;return z==ie?L.pop():ES.call(L,z,1),--this.size,!0}function IS(A){var L=this.__data__,z=ya(L,A);return z<0?void 0:L[z][1]}function DS(A){return ya(this.__data__,A)>-1}function jS(A,L){var z=this.__data__,ie=ya(z,A);return ie<0?(++this.size,z.push([A,L])):z[ie][1]=L,this}Qn.prototype.clear=$S,Qn.prototype.delete=OS,Qn.prototype.get=IS,Qn.prototype.has=DS,Qn.prototype.set=jS;function Xo(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function VS(){this.size=0,this.__data__={hash:new oo,map:new(Mg||Qn),string:new oo}}function BS(A){var L=xa(this,A).delete(A);return this.size-=L?1:0,L}function zS(A){return xa(this,A).get(A)}function HS(A){return xa(this,A).has(A)}function WS(A,L){var z=xa(this,A),ie=z.size;return z.set(A,L),this.size+=z.size==ie?0:1,this}Xo.prototype.clear=VS,Xo.prototype.delete=BS,Xo.prototype.get=zS,Xo.prototype.has=HS,Xo.prototype.set=WS;function Zo(A){var L=this.__data__=new Qn(A);this.size=L.size}function KS(){this.__data__=new Qn,this.size=0}function US(A){var L=this.__data__,z=L.delete(A);return this.size=L.size,z}function GS(A){return this.__data__.get(A)}function qS(A){return this.__data__.has(A)}function YS(A,L){var z=this.__data__;if(z instanceof Qn){var ie=z.__data__;if(!Mg||ie.length<n-1)return ie.push([A,L]),this.size=++z.size,this;z=this.__data__=new Xo(ie)}return z.set(A,L),this.size=z.size,this}Zo.prototype.clear=KS,Zo.prototype.delete=US,Zo.prototype.get=GS,Zo.prototype.has=qS,Zo.prototype.set=YS;function XS(A,L){var z=Mc(A),ie=!z&&Nc(A),_e=!z&&!ie&&Og(A),Oe=!z&&!ie&&!_e&&Dg(A),He=z||ie||_e||Oe,Ae=He?Rt(A.length,String):[],We=Ae.length;for(var pn in A)He&&(pn=="length"||_e&&(pn=="offset"||pn=="parent")||Oe&&(pn=="buffer"||pn=="byteLength"||pn=="byteOffset")||Fg(pn,We))||Ae.push(pn);return Ae}function Ec(A,L,z){(z!==void 0&&!ba(A[L],z)||z===void 0&&!(L in A))&&Rc(A,L,z)}function ZS(A,L,z){var ie=A[L];(!(rt.call(A,L)&&ba(ie,z))||z===void 0&&!(L in A))&&Rc(A,L,z)}function ya(A,L){for(var z=A.length;z--;)if(ba(A[z][0],L))return z;return-1}function Rc(A,L,z){L=="__proto__"&&ma?ma(A,L,{configurable:!0,enumerable:!0,value:z,writable:!0}):A[L]=z}var JS=d_();function va(A){return A==null?A===void 0?E:v:ro&&ro in Object(A)?f_(A):v_(A)}function Pg(A){return os(A)&&va(A)==a}function QS(A){if(!io(A)||m_(A))return!1;var L=Lc(A)?pa:re;return L.test(C_(A))}function e_(A){return os(A)&&Ig(A.length)&&!!Y[va(A)]}function t_(A){if(!io(A))return y_(A);var L=$g(A),z=[];for(var ie in A)ie=="constructor"&&(L||!rt.call(A,ie))||z.push(ie);return z}function Lg(A,L,z,ie,_e){A!==L&&JS(L,function(Oe,He){if(_e||(_e=new Zo),io(Oe))n_(A,L,He,z,Lg,ie,_e);else{var Ae=ie?ie(Ac(A,He),Oe,He+"",A,L,_e):void 0;Ae===void 0&&(Ae=Oe),Ec(A,He,Ae)}},jg)}function n_(A,L,z,ie,_e,Oe,He){var Ae=Ac(A,z),We=Ac(L,z),pn=He.get(We);if(pn){Ec(A,z,pn);return}var qt=Oe?Oe(Ae,We,z+"",A,L,He):void 0,is=qt===void 0;if(is){var Fc=Mc(We),$c=!Fc&&Og(We),Bg=!Fc&&!$c&&Dg(We);qt=We,Fc||$c||Bg?Mc(Ae)?qt=Ae:S_(Ae)?qt=l_(Ae):$c?(is=!1,qt=i_(We)):Bg?(is=!1,qt=a_(We)):qt=[]:__(We)||Nc(We)?(qt=Ae,Nc(Ae)?qt=T_(Ae):(!io(Ae)||Lc(Ae))&&(qt=h_(We))):is=!1}is&&(He.set(We,qt),_e(qt,We,ie,Oe,He),He.delete(We)),Ec(A,z,qt)}function r_(A,L){return b_(x_(A,L,Vg),A+"")}var o_=ma?function(A,L){return ma(A,"toString",{configurable:!0,enumerable:!1,value:R_(L),writable:!0})}:Vg;function i_(A,L){return A.slice()}function s_(A){var L=new A.constructor(A.byteLength);return new Le(L).set(new Le(A)),L}function a_(A,L){var z=s_(A.buffer);return new A.constructor(z,A.byteOffset,A.length)}function l_(A,L){var z=-1,ie=A.length;for(L||(L=Array(ie));++z<ie;)L[z]=A[z];return L}function c_(A,L,z,ie){var _e=!z;z||(z={});for(var Oe=-1,He=L.length;++Oe<He;){var Ae=L[Oe],We=void 0;We===void 0&&(We=A[Ae]),_e?Rc(z,Ae,We):ZS(z,Ae,We)}return z}function u_(A){return r_(function(L,z){var ie=-1,_e=z.length,Oe=_e>1?z[_e-1]:void 0,He=_e>2?z[2]:void 0;for(Oe=A.length>3&&typeof Oe=="function"?(_e--,Oe):void 0,He&&g_(z[0],z[1],He)&&(Oe=_e<3?void 0:Oe,_e=1),L=Object(L);++ie<_e;){var Ae=z[ie];Ae&&A(L,Ae,ie,Oe)}return L})}function d_(A){return function(L,z,ie){for(var _e=-1,Oe=Object(L),He=ie(L),Ae=He.length;Ae--;){var We=He[++_e];if(z(Oe[We],We,Oe)===!1)break}return L}}function xa(A,L){var z=A.__data__;return p_(L)?z[typeof L=="string"?"string":"hash"]:z.map}function kc(A,L){var z=ot(A,L);return QS(z)?z:void 0}function f_(A){var L=rt.call(A,ro),z=A[ro];try{A[ro]=void 0;var ie=!0}catch{}var _e=to.call(A);return ie&&(L?A[ro]=z:delete A[ro]),_e}function h_(A){return typeof A.constructor=="function"&&!$g(A)?AS(Yo(A)):{}}function Fg(A,L){var z=typeof A;return L=L??s,!!L&&(z=="number"||z!="symbol"&&G.test(A))&&A>-1&&A%1==0&&A<L}function g_(A,L,z){if(!io(z))return!1;var ie=typeof L;return(ie=="number"?Pc(z)&&Fg(L,z.length):ie=="string"&&L in z)?ba(z[L],A):!1}function p_(A){var L=typeof A;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?A!=="__proto__":A===null}function m_(A){return!!It&&It in A}function $g(A){var L=A&&A.constructor,z=typeof L=="function"&&L.prototype||se;return A===z}function y_(A){var L=[];if(A!=null)for(var z in Object(A))L.push(z);return L}function v_(A){return to.call(A)}function x_(A,L,z){return L=Ng(L===void 0?A.length-1:L,0),function(){for(var ie=arguments,_e=-1,Oe=Ng(ie.length-L,0),He=Array(Oe);++_e<Oe;)He[_e]=ie[L+_e];_e=-1;for(var Ae=Array(L+1);++_e<L;)Ae[_e]=ie[_e];return Ae[L]=z(He),je(A,this,Ae)}}function Ac(A,L){if(!(L==="constructor"&&typeof A[L]=="function")&&L!="__proto__")return A[L]}var b_=w_(o_);function w_(A){var L=0,z=0;return function(){var ie=kS(),_e=i-(ie-z);if(z=ie,_e>0){if(++L>=o)return arguments[0]}else L=0;return A.apply(void 0,arguments)}}function C_(A){if(A!=null){try{return Ye.call(A)}catch{}try{return A+""}catch{}}return""}function ba(A,L){return A===L||A!==A&&L!==L}var Nc=Pg((function(){return arguments})())?Pg:function(A){return os(A)&&rt.call(A,"callee")&&!TS.call(A,"callee")},Mc=Array.isArray;function Pc(A){return A!=null&&Ig(A.length)&&!Lc(A)}function S_(A){return os(A)&&Pc(A)}var Og=RS||k_;function Lc(A){if(!io(A))return!1;var L=va(A);return L==h||L==g||L==c||L==x}function Ig(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function io(A){var L=typeof A;return A!=null&&(L=="object"||L=="function")}function os(A){return A!=null&&typeof A=="object"}function __(A){if(!os(A)||va(A)!=y)return!1;var L=Yo(A);if(L===null)return!0;var z=rt.call(L,"constructor")&&L.constructor;return typeof z=="function"&&z instanceof z&&Ye.call(z)==no}var Dg=ze?gn(ze):e_;function T_(A){return c_(A,jg(A))}function jg(A){return Pc(A)?XS(A):t_(A)}var E_=u_(function(A,L,z){Lg(A,L,z)});function R_(A){return function(){return A}}function Vg(A){return A}function k_(){return!1}e.exports=E_})(bs,bs.exports)),bs.exports}var FA=LA();const $A=Ff(FA),U1=S.createContext(null);function OA(){return S.useContext(U1)}function IA({children:e,locale:t}){return C.jsx(U1.Provider,{value:t||null,children:e})}function DA({localeKey:e,defaultLocale:t}){const n=S.createContext(t);function r(s){const{extraLocale:a}=s||{},l=OA();return{value:S.useMemo(()=>{const u=l?l[e]:null,f=[{},t];return u&&f.push(u),a&&f.push(a),$A(...f)},[t,a,e,l])}}function o(){return S.useContext(n)}function i({children:s,locale:a}){const{value:l}=r({extraLocale:a});return C.jsx(n.Provider,{value:l,children:s})}return{Context:n,useComposeLocaleProviderValue:r,useLocale:o,Provider:i}}const G1="MarkdownTextEditor",jA={toolbar:{link:{textPlaceholder:"Enter the text to display",linkPlaceholder:"Paste a link",linkErrorText:"Please enter a valid link",buttonText:"Save"},table:{maxRowsErrorText:e=>`Maximum number of rows is ${e.limit}`,maxColumnsErrorText:e=>`Maximum number of columns is ${e.limit}`,minRowsErrorText:e=>`Minimum number of rows is ${e.limit}`,minColumnsErrorText:e=>`Minimum number of columns is ${e.limit}`,rowsPlaceholder:"Rows count",columnsPlaceholder:"Columns count",buttonText:"Create table"},textSize:{paragraph:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3"},preview:{show:"Preview",hide:"Preview"},actions:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",link:"Link",image:"Image",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",table:"Table",bulletList:"Bullet list",numberedList:"Numbered list"}}},{Provider:VA,useLocale:ra}=DA({localeKey:G1,defaultLocale:jA}),q1=S.createContext(null);function BA(e,t){return{getTheme:function(){return t??null}}}function lt(){const e=S.useContext(q1);return e==null&&(function(t,...n){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(const i of n)o.append("v",i);throw r.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),e}function X(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Y1(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Ln=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,zA=Ln&&"documentMode"in document?document.documentMode:null,wn=Ln&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ao=Ln&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Tl=!(!Ln||!("InputEvent"in window)||zA)&&"getTargetRanges"in new window.InputEvent("input"),oa=Ln&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),qi=Ln&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,HA=Ln&&/Android/.test(navigator.userAgent),X1=Ln&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Rm=Ln&&HA&&X1,ia=Ln&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&wn&&!X1;function Z1(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}const WA=0,KA=1,UA=2,J1=128,GA=1,qA=2,YA=3,XA=4,ZA=5,JA=6,rc=oa||qi||ia?" ":"",Wr=`
|
|
35
35
|
|
|
36
36
|
`,QA=Ao?" ":rc,Kr={bold:1,capitalize:1024,code:16,highlight:J1,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},eN={directionless:1,unmergeable:2},km={center:2,end:6,justify:4,left:1,right:3,start:5},tN={[qA]:"center",[JA]:"end",[XA]:"justify",[GA]:"left",[YA]:"right",[ZA]:"start"},nN={normal:0,segmented:2,token:1},rN={[WA]:"normal",[UA]:"segmented",[KA]:"token"},Am="$config";function Q1(e,t,n,r,o,i){let s=e.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===t&&(B(s)&&Q1(s,a,n,r,o,i),n.has(a)||i.delete(a),o.push(a)),s=s.getNextSibling()}}let Od=!1,Ah=0;function oN(e){Ah=e.timeStamp}function au(e,t,n){const r=e.nodeName==="BR",o=t.__lexicalLineBreak;return o&&(e===o||r&&e.previousSibling===o)||r&&pc(e,n)!==void 0}function iN(e,t,n){const r=Ot(hn(n));let o=null,i=null;r!==null&&r.anchorNode===e&&(o=r.anchorOffset,i=r.focusOffset);const s=e.nodeValue;s!==null&&Zh(t,s,o,i,!1)}function sN(e,t,n){if(W(e)){const r=e.anchor.getNode();if(r.is(n)&&e.format!==r.getFormat())return!1}return Cr(t)&&n.isAttached()}function aN(e,t,n,r){for(let o=e;o&&!dM(o);o=ca(o)){const i=pc(o,t);if(i!==void 0){const s=Pe(i,n);if(s)return Te(s)||!Be(o)?void 0:[o,s]}else if(o===r)return[r,ew(n)]}}function eb(e,t,n){Od=!0;const r=performance.now()-Ah>100;try{Gn(e,()=>{const o=Z()||(function(d){return d.getEditorState().read(()=>{const h=Z();return h!==null?h.clone():null})})(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let d=0;d<t.length;d++){const h=t[d],g=h.type,p=h.target,m=aN(p,e,a,s);if(!m)continue;const[v,y]=m;if(g==="characterData")r&&J(y)&&Cr(p)&&sN(o,p,y)&&iN(p,y,e);else if(g==="childList"){c=!0;const x=h.addedNodes;for(let _=0;_<x.length;_++){const E=x[_],R=Jb(E),k=E.parentNode;if(k!=null&&E!==l&&R===null&&!au(E,k,e)){if(Ao){const P=(Be(E)?E.innerText:null)||E.nodeValue;P&&(u+=P)}k.removeChild(E)}}const b=h.removedNodes,w=b.length;if(w>0){let _=0;for(let E=0;E<w;E++){const R=b[E];(au(R,p,e)||l===R)&&(p.appendChild(R),_++)}w!==_&&i.set(v,y)}}}if(i.size>0)for(const[d,h]of i)h.reconcileObservedMutation(d,e);const f=n.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){const v=g[m],y=v.parentNode;y==null||v.nodeName!=="BR"||au(v,p,e)||y.removeChild(v)}}n.takeRecords()}o!==null&&(c&&Ge(o),Ao&&ow(e)&&o.insertRawText(u))})}finally{Od=!1}}function tb(e){const t=e._observer;t!==null&&eb(e,t.takeRecords(),t)}function nb(e){(function(t){Ah===0&&hn(t).addEventListener("textInput",oN,!0)})(e),e._observer=new MutationObserver((t,n)=>{eb(e,t,n)})}let lN=class{key;parse;unparse;isEqual;defaultValue;constructor(t,n){this.key=t,this.parse=n.parse.bind(n),this.unparse=(n.unparse||fN).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0)}};function cN(e,t){return new lN(e,t)}function rb(e,t,n="latest"){const r=(n==="latest"?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function lu(e,t,n){let r;if(ft(),typeof n=="function"){const i=e.getLatest(),s=rb(i,t);if(r=n(s),t.isEqual(s,r))return i}else r=n;const o=e.getWritable();return ib(o).updateFromKnown(t,r),o}function uN(e){const t=new Map,n=new Set;for(let r=typeof e=="function"?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:o}=yc(r);if(o&&o.stateConfigs)for(const i of o.stateConfigs){let s;"stateConfig"in i?(s=i.stateConfig,i.flat&&n.add(s.key)):s=i,t.set(s.key,s)}}return{flatKeys:n,sharedConfigMap:t}}let dN=class ob{node;knownState;unknownState;sharedNodeState;size;constructor(t,n,r=void 0,o=new Map,i=void 0){this.node=t,this.sharedNodeState=n,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,a=i!==void 0?i:(function(l,c,u){let f=u.size;if(c)for(const d in c){const h=l.get(d);h&&u.has(h)||f++}return f})(s,r,o);this.size=a}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const o=this.unknownState[t.key];o!==void 0&&(r=t.parse(o)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},n={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in t&&(n[r]=t[r],delete t[r]);return Nm(t)&&(n.$=t),n}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,o=new Map(this.knownState);return new ob(t,n,(function(i,s,a){let l;if(a)for(const[c,u]of Object.entries(a)){const f=i.get(c);f?s.has(f)||s.set(f,f.parse(u)):(l=l||{},l[c]=u)}return l})(n.sharedConfigMap,o,r),o,this.size)}updateFromKnown(t,n){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:o,unknownState:i}=this;o.has(t)||i&&r in i||(i&&(delete i[r],this.unknownState=Nm(i)),this.size++),o.set(t,n)}updateFromUnknown(t,n){const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(const[r,o]of Object.entries(t))this.updateFromUnknown(r,o)}};function ib(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new dN(t,sb(t));return t.__state=n,n}function sb(e){return e.__state?e.__state.sharedNodeState:Ub(es(),e.getType()).sharedNodeState}function Nm(e){if(e)for(const t in e)return e}function fN(e){return e}function Mm(e,t,n){for(const[r,o]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const i=n?n.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function Pm(e,t,n){const{unknownState:r}=t,o=n?n.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!e.has(i)&&(e.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function Lm(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function Fm(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style,l=e.__state,c=t.__state;return(n===null||n===i)&&(r===null||r===s)&&(o===null||o===a)&&(e.__state===null||l===c||(function(u,f){if(u===f)return!0;if(u&&f&&u.size!==f.size)return!1;const d=new Set;return!(u&&Mm(d,u,f)||f&&Mm(d,f,u)||u&&Pm(d,u,f)||f&&Pm(d,f,u))})(l,c))}function $m(e,t){const n=e.mergeWithSibling(t),r=$e()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Om(e){let t,n,r=e;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&J(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Fm(t,r)){r=$m(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&J(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(Fm(r,n)){r=$m(r,n);break}break}n.remove()}}else r.remove()}function Hs(e){return Im(e.anchor),Im(e.focus),e}function Im(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),J(r)){e.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!B(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}let No,_t,Ws,oc,Id,Dd,Mo,En,jd,Ks,ut="",Dn=null,fo=null,lr="",ui=!1,El=!1;function Rl(e,t){const n=Mo.get(e);if(t!==null){const r=Hd(e);r.parentNode===t&&t.removeChild(r)}if(En.has(e)||_t._keyToDOMMap.delete(e),B(n)){const r=Al(n,Mo);Vd(r,0,r.length-1,null)}n!==void 0&&Jh(Ks,Ws,oc,n,"destroyed")}function Vd(e,t,n,r){let o=t;for(;o<=n;++o){const i=e[o];i!==void 0&&Rl(i,r)}}function lo(e,t){e.setProperty("text-align",t)}const hN="40px";function ab(e,t){const n=No.theme.indent;if(typeof n=="string"){const o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||hN;e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${r})`)}function lb(e,t){const n=e.style;t===0?lo(n,""):t===1?lo(n,"left"):t===2?lo(n,"center"):t===3?lo(n,"right"):t===4?lo(n,"justify"):t===5?lo(n,"start"):t===6&&lo(n,"end")}function Bd(e,t){const n=(function(r){const o=r.__dir;if(o!==null)return o;if(at(r))return null;const i=r.getParentOrThrow();return at(i)&&i.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function kl(e,t){const n=En.get(e);n===void 0&&X(60);const r=n.createDOM(No,_t);if((function(o,i,s){const a=s._keyToDOMMap;(function(l,c,u){const f=`__lexicalKey_${c._key}`;l[f]=u})(i,s,o),a.set(o,i)})(e,r,_t),J(n)?r.setAttribute("data-lexical-text","true"):Te(n)&&r.setAttribute("data-lexical-decorator","true"),B(n)){const o=n.__indent,i=n.__size;if(Bd(r,n),o!==0&&ab(r,o),i!==0){const a=i-1;zd(Al(n,En),n,0,a,n.getDOMSlot(r))}const s=n.__format;s!==0&&lb(r,s),n.isInline()||cb(null,n,r),mc(n)&&(ut+=Wr,lr+=Wr)}else{const o=n.getTextContent();if(Te(n)){const i=n.decorate(_t,No);i!==null&&ub(e,i),r.contentEditable="false"}ut+=o,lr+=o}return t!==null&&t.insertChild(r),Jh(Ks,Ws,oc,n,"created"),r}function zd(e,t,n,r,o){const i=ut;ut="";let s=n;for(;s<=r;++s){kl(e[s],o);const a=En.get(e[s]);a!==null&&J(a)&&Dn===null&&(Dn=a.getFormat(),fo=a.getStyle())}mc(t)&&(ut+=Wr),o.element.__lexicalTextContent=ut,ut=i+ut}function Dm(e,t){if(e){const n=e.__last;if(n){const r=t.get(n);if(r)return Un(r)?"line-break":Te(r)&&r.isInline()?"decorator":null}return"empty"}return null}function cb(e,t,n){const r=Dm(e,Mo),o=Dm(t,En);r!==o&&t.getDOMSlot(n).setManagedLineBreak(o)}function gN(e,t,n){var r;Dn=null,fo=null,(function(o,i,s){const a=ut,l=o.__size,c=i.__size;ut="";const u=s.element;if(l===1&&c===1){const f=o.__first,d=i.__first;if(f===d)ws(f,u);else{const g=Hd(f),p=kl(d,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){const v=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(v)}throw m}Rl(f,null)}const h=En.get(d);J(h)&&Dn===null&&(Dn=h.getFormat(),fo=h.getStyle())}else{const f=Al(o,Mo),d=Al(i,En);if(f.length!==l&&X(227),d.length!==c&&X(228),l===0)c!==0&&zd(d,i,0,c-1,s);else if(c===0){if(l!==0){const h=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;Vd(f,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,v,y){const x=m-1,b=v-1;let w,_,E=y.getFirstChild(),R=0,k=0;for(;R<=x&&k<=b;){const $=g[R],j=p[k];if($===j)E=cu(ws(j,y.element)),R++,k++;else{w===void 0&&(w=new Set(g)),_===void 0&&(_=new Set(p));const D=_.has($),K=w.has(j);if(D)if(K){const I=Fo(_t,j);I===E?E=cu(ws(j,y.element)):(y.withBefore(E).insertChild(I),ws(j,y.element)),R++,k++}else kl(j,y.withBefore(E)),k++;else E=cu(Hd($)),Rl($,y.element),R++}const O=En.get(j);O!==null&&J(O)&&Dn===null&&(Dn=O.getFormat(),fo=O.getStyle())}const P=R>x,F=k>b;if(P&&!F){const $=p[b+1],j=$===void 0?null:_t.getElementByKey($);zd(p,h,k,b,y.withBefore(j))}else F&&!P&&Vd(g,R,x,y.element)})(i,f,d,l,c,s)}mc(i)&&(ut+=Wr),u.__lexicalTextContent=ut,ut=a+ut})(e,t,t.getDOMSlot(n)),r=t,Dn==null||Dn===r.__textFormat||El||r.setTextFormat(Dn),(function(o){fo==null||fo===o.__textStyle||El||o.setTextStyle(fo)})(t)}function Al(e,t){const n=[];let r=e.__first;for(;r!==null;){const o=t.get(r);o===void 0&&X(101),n.push(r),r=o.__next}return n}function ws(e,t){const n=Mo.get(e);let r=En.get(e);n!==void 0&&r!==void 0||X(61);const o=ui||Dd.has(e)||Id.has(e),i=Fo(_t,e);if(n===r&&!o){if(B(n)){const s=i.__lexicalTextContent;s!==void 0&&(ut+=s,lr+=s)}else{const s=n.getTextContent();lr+=s,ut+=s}return i}if(n!==r&&o&&Jh(Ks,Ws,oc,r,"updated"),r.updateDOM(n,i,No)){const s=kl(e,null);return t===null&&X(62),t.replaceChild(s,i),Rl(e,null),s}if(B(n)&&B(r)){const s=r.__indent;(ui||s!==n.__indent)&&ab(i,s);const a=r.__format;if((ui||a!==n.__format)&&lb(i,a),o&&(gN(n,r,i),at(r)||r.isInline()||cb(n,r,i)),mc(r)&&(ut+=Wr,lr+=Wr),(ui||r.__dir!==n.__dir)&&(Bd(i,r),at(r)&&!ui))for(const l of r.getChildren())B(l)&&Bd(Fo(_t,l.getKey()),l)}else{const s=r.getTextContent();if(Te(r)){const a=r.decorate(_t,No);a!==null&&ub(e,a)}ut+=s,lr+=s}if(!El&&at(r)&&r.__cachedText!==lr){const s=r.getWritable();s.__cachedText=lr,r=s}return i}function ub(e,t){let n=_t._pendingDecorators;const r=_t._decorators;if(n===null){if(r[e]===t)return;n=Qb(_t)}n[e]=t}function cu(e){let t=e.nextSibling;return t!==null&&t===_t._blockCursorElement&&(t=t.nextSibling),t}function pN(e,t,n,r,o,i){ut="",lr="",ui=r===2,_t=n,No=n._config,Ws=n._nodes,oc=_t._listeners.mutation,Id=o,Dd=i,Mo=e._nodeMap,En=t._nodeMap,El=t._readOnly,jd=new Map(n._keyToDOMMap);const s=new Map;return Ks=s,ws("root",null),_t=void 0,Ws=void 0,Id=void 0,Dd=void 0,Mo=void 0,En=void 0,No=void 0,jd=void 0,Ks=void 0,s}function Hd(e){const t=jd.get(e);return t===void 0&&X(75,e),t}function ce(e){return{type:e}}const hr=ce("SELECTION_CHANGE_COMMAND"),Nh=ce("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),ic=ce("CLICK_COMMAND"),db=ce("BEFORE_INPUT_COMMAND"),fb=ce("INPUT_COMMAND"),hb=ce("COMPOSITION_START_COMMAND"),gb=ce("COMPOSITION_END_COMMAND"),Dr=ce("DELETE_CHARACTER_COMMAND"),_i=ce("INSERT_LINE_BREAK_COMMAND"),Po=ce("INSERT_PARAGRAPH_COMMAND"),To=ce("CONTROLLED_TEXT_INSERTION_COMMAND"),Mh=ce("PASTE_COMMAND"),Wd=ce("REMOVE_TEXT_COMMAND"),Oi=ce("DELETE_WORD_COMMAND"),Lo=ce("DELETE_LINE_COMMAND"),Vt=ce("FORMAT_TEXT_COMMAND"),pb=ce("UNDO_COMMAND"),mb=ce("REDO_COMMAND"),yb=ce("KEYDOWN_COMMAND"),Ph=ce("KEY_ARROW_RIGHT_COMMAND"),mN=ce("MOVE_TO_END"),Lh=ce("KEY_ARROW_LEFT_COMMAND"),yN=ce("MOVE_TO_START"),Fh=ce("KEY_ARROW_UP_COMMAND"),$h=ce("KEY_ARROW_DOWN_COMMAND"),Nl=ce("KEY_ENTER_COMMAND"),vb=ce("KEY_SPACE_COMMAND"),sc=ce("KEY_BACKSPACE_COMMAND"),Oh=ce("KEY_ESCAPE_COMMAND"),Ih=ce("KEY_DELETE_COMMAND"),Dh=ce("KEY_TAB_COMMAND"),vN=ce("INSERT_TAB_COMMAND"),xN=ce("INDENT_CONTENT_COMMAND"),jm=ce("OUTDENT_CONTENT_COMMAND"),xb=ce("DROP_COMMAND"),Ti=ce("FORMAT_ELEMENT_COMMAND"),bb=ce("DRAGSTART_COMMAND"),wb=ce("DRAGOVER_COMMAND"),bN=ce("DRAGEND_COMMAND"),ac=ce("COPY_COMMAND"),lc=ce("CUT_COMMAND"),Kd=ce("SELECT_ALL_COMMAND"),Cb=ce("FOCUS_COMMAND"),wN=ce("BLUR_COMMAND"),CN=ce("KEY_MODIFIER_COMMAND"),tr=Object.freeze({}),Ud=[["keydown",function(e,t){Us=e.timeStamp,Sb=e.key,!t.isComposing()&&te(t,yb,e)}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;Cn(n)&&r!=="touch"&&r!=="pen"&&e.button===0&&Gn(t,()=>{Gb(n)||(Yd=!0)})}],["compositionstart",function(e,t){te(t,hb,e)}],["compositionend",function(e,t){Ao?Cs=!0:qi||!oa&&!ia?te(t,gb,e):(Xd=!0,Zd=e.data)}],["input",function(e,t){e.stopPropagation(),Gn(t,()=>{t.dispatchCommand(fb,e)},{event:e}),di=null}],["click",function(e,t){Gn(t,()=>{const n=Z(),r=Ot(hn(t)),o=Zn();if(r){if(W(n)){const i=n.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&n.isCollapsed()&&!at(s)&&qe().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&n.is(o))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&s!==n.focus.getNode()){const a=we(s,l=>B(l)&&!l.isInline());B(a)&&a.select(0)}}else if(e.pointerType==="touch"||e.pointerType==="pen"){const i=r.anchorNode;(Be(i)||Cr(i))&&Ge(fc(o,r,t,e))}}te(t,ic,e)})}],["cut",tr],["copy",tr],["dragstart",tr],["dragover",tr],["dragend",tr],["paste",tr],["focus",tr],["blur",tr],["drop",tr]];Tl&&Ud.push(["beforeinput",(e,t)=>(function(n,r){const o=n.inputType;o==="deleteCompositionText"||Ao&&ow(r)||o!=="insertCompositionText"&&te(r,db,n)})(e,t)]);let Us=0,Sb=null,_b=0,di=null;const Gd=new WeakMap,Ml=new WeakMap;let qd=!1,Yd=!1,ks=!1,Cs=!1,Xd=!1,Zd="",yo=null,Tb=[0,"",0,"root",0];function Eb(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=$e(),c=Ot(hn(l)),u=c!==null?c.anchorNode:null,f=i.key,d=l.getElementByKey(f),h=n.length;return f!==s.key||!J(a)||(!o&&(!Tl||_b<r+50)||a.isDirty()&&h<2||tw(n))&&i.offset!==s.offset&&!a.isComposing()||sr(a)||a.isDirty()&&h>1||(o||!Tl)&&d!==null&&!a.isComposing()&&u!==Di(d)||c!==null&&t!==null&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;const m=g.anchor.offset,v=p.getParentOrThrow(),y=Eo(p);return m===0?!p.canInsertTextBefore()||!v.canInsertTextBefore()&&!p.isComposing()||y||(function(x){const b=x.getPreviousSibling();return(J(b)||B(b)&&b.isInline())&&!b.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!v.canInsertTextAfter()&&!p.isComposing()||y)})(e,a)}function Vm(e,t){return Cr(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Bm(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;qd&&(qd=!1,Vm(r,o)&&Vm(i,s)&&!yo)||Gn(t,()=>{if(!n)return void Ge(null);if(!la(t,r,i))return;let a=Z();if(yo&&W(a)&&a.isCollapsed()){const l=a.anchor,c=yo.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=yo.clone(),Ge(a))}if(yo=null,W(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){e.type==="Range"&&e.anchorNode===e.focusNode&&(a.dirty=!0);const u=hn(t).event,f=u?u.timeStamp:performance.now(),[d,h,g,p,m]=Tb,v=qe(),y=t.isComposing()===!1&&v.getTextContent()==="";if(f<m+200&&l.offset===g&&l.key===p)il(a,d,h);else if(l.type==="text")J(c)||X(141),Rb(a,c);else if(l.type==="element"&&!y){B(c)||X(259);const x=l.getNode();x.isEmpty()?(function(b,w){const _=w.getTextFormat(),E=w.getTextStyle();il(b,_,E)})(a,x):il(a,0,"")}}else{const u=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),p=g?s:o,m=g?o:s,v=g?f:u,y=g?u:f;let x=2047,b=!1;for(let w=0;w<h;w++){const _=d[w],E=_.getTextContentSize();if(J(_)&&E!==0&&!(w===0&&_.__key===v&&p===E||w===h-1&&_.__key===y&&m===0)&&(b=!0,x&=_.getFormat(),x===0))break}a.format=b?x:0}}te(t,hr,void 0)})}function il(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Rb(e,t){il(e,t.getFormat(),t.getStyle())}function kb(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function SN(e){const t=e.inputType,n=kb(e),r=$e(),o=Z();if(t==="deleteContentBackward"){if(o===null){const f=Zn();if(!W(f))return!0;Ge(f.clone())}if(W(o)){const f=o.anchor.key===o.focus.key;if(i=e.timeStamp,Sb==="MediaLast"&&i<Us+30&&r.isComposing()&&f){if(yt(null),Us=0,setTimeout(()=>{Gn(r,()=>{yt(null)})},30),W(o)){const d=o.anchor.getNode();d.markDirty(),J(d)||X(142),Rb(o,d)}}else{yt(null),e.preventDefault();const d=o.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),p=o.anchor.offset===0&&o.focus.offset===h.length;let m=Rm&&f&&!p&&g;if(m&&o.isCollapsed()&&(m=!Te(nf(o.anchor,!0))),!m){te(r,Dr,!0);const v=Z();Rm&&W(v)&&v.isCollapsed()&&(yo=v,setTimeout(()=>yo=null))}}return!0}}var i;if(!W(o))return!0;const s=e.data;di!==null&&Xh(!1,r,di),o.dirty&&di===null||!o.isCollapsed()||at(o.anchor.getNode())||n===null||o.applyDOMRange(n),di=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(s===`
|
|
37
37
|
`)e.preventDefault(),te(r,_i,!1);else if(s===Wr)e.preventDefault(),te(r,Po,void 0);else if(s==null&&e.dataTransfer){const f=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(f)}else s!=null&&Eb(o,n,s,e.timeStamp,!0)?(e.preventDefault(),te(r,To,s)):di=s;return _b=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":te(r,To,e);break;case"insertFromComposition":yt(null),te(r,To,e);break;case"insertLineBreak":yt(null),te(r,_i,!1);break;case"insertParagraph":yt(null),ks&&!qi?(ks=!1,te(r,_i,!1)):te(r,Po,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":te(r,Mh,e);break;case"deleteByComposition":(function(f,d){return f!==d||B(f)||B(d)||!Eo(f)||!Eo(d)})(c,u)&&te(r,Wd,e);break;case"deleteByDrag":case"deleteByCut":te(r,Wd,e);break;case"deleteContent":te(r,Dr,!1);break;case"deleteWordBackward":te(r,Oi,!0);break;case"deleteWordForward":te(r,Oi,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":te(r,Lo,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":te(r,Lo,!1);break;case"formatStrikeThrough":te(r,Vt,"strikethrough");break;case"formatBold":te(r,Vt,"bold");break;case"formatItalic":te(r,Vt,"italic");break;case"formatUnderline":te(r,Vt,"underline");break;case"historyUndo":te(r,pb,void 0);break;case"historyRedo":te(r,mb,void 0)}return!0}function _N(e){if(Be(e.target)&&Gb(e.target))return!0;const t=$e(),n=Z(),r=e.data,o=kb(e);if(r!=null&&W(n)&&Eb(n,o,r,e.timeStamp,!1)){Cs&&(Pl(t,r),Cs=!1);const i=n.anchor.getNode(),s=Ot(hn(t));if(s===null)return!0;const a=n.isBackward(),l=a?n.anchor.offset:n.focus.offset,c=a?n.focus.offset:n.anchor.offset;Tl&&!n.isCollapsed()&&J(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,l)+r+i.getTextContent().slice(l+c)===rw(s.anchorNode)||te(t,To,r);const u=r.length;Ao&&u>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=u),oa||qi||ia||!t.isComposing()||(Us=0,yt(null))}else Xh(!1,t,r!==null?r:void 0),Cs&&(Pl(t,r||void 0),Cs=!1);return(function(){ft();const i=$e();tb(i)})(),!0}function TN(e){const t=$e(),n=Z();if(W(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();yt(r.key),(e.timeStamp<Us+30||r.type==="element"||!n.isCollapsed()||o.getFormat()!==n.format||J(o)&&o.getStyle()!==n.style)&&te(t,To,QA)}return!0}function EN(e){return Pl($e(),e.data),!0}function Pl(e,t){const n=e._compositionKey;if(yt(null),n!==null&&t!=null){if(t===""){const r=Pe(n),o=Di(e.getElementByKey(n));return void(o!==null&&o.nodeValue!==null&&J(r)&&Zh(r,o.nodeValue,null,null,!0))}if(t[t.length-1]===`
|