@useorgx/openclaw-plugin 0.3.2 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dashboard/dist/assets/BqukHQH-.js +8 -0
  2. package/dashboard/dist/assets/CE5pVdev.js +9 -0
  3. package/dashboard/dist/assets/Cpr7n8fE.js +1 -0
  4. package/dashboard/dist/assets/Nip3CrNC.js +1 -0
  5. package/dashboard/dist/assets/TN5wE36J.js +1 -0
  6. package/dashboard/dist/assets/X6IcjS74.js +212 -0
  7. package/dashboard/dist/assets/jyFhCND-.css +1 -0
  8. package/dashboard/dist/index.html +9 -6
  9. package/dist/adapters/outbox.d.ts +0 -1
  10. package/dist/adapters/outbox.js +0 -1
  11. package/dist/agent-context-store.d.ts +0 -1
  12. package/dist/agent-context-store.js +0 -1
  13. package/dist/agent-run-store.d.ts +0 -1
  14. package/dist/agent-run-store.js +0 -1
  15. package/dist/api.d.ts +0 -1
  16. package/dist/api.js +0 -1
  17. package/dist/auth-store.d.ts +0 -1
  18. package/dist/auth-store.js +0 -1
  19. package/dist/byok-store.d.ts +0 -1
  20. package/dist/byok-store.js +0 -1
  21. package/dist/contracts/client.d.ts +0 -1
  22. package/dist/contracts/client.js +0 -1
  23. package/dist/contracts/types.d.ts +33 -1
  24. package/dist/contracts/types.js +0 -1
  25. package/dist/dashboard-api.d.ts +0 -1
  26. package/dist/dashboard-api.js +0 -1
  27. package/dist/fs-utils.d.ts +0 -1
  28. package/dist/fs-utils.js +0 -1
  29. package/dist/http-handler.d.ts +0 -1
  30. package/dist/http-handler.js +1331 -111
  31. package/dist/index.d.ts +0 -1
  32. package/dist/index.js +0 -1
  33. package/dist/local-openclaw.d.ts +0 -1
  34. package/dist/local-openclaw.js +0 -1
  35. package/dist/outbox.d.ts +0 -1
  36. package/dist/outbox.js +0 -1
  37. package/dist/paths.d.ts +0 -1
  38. package/dist/paths.js +0 -1
  39. package/dist/reporting/outbox-replay.d.ts +0 -1
  40. package/dist/reporting/outbox-replay.js +0 -1
  41. package/dist/reporting/rollups.d.ts +0 -1
  42. package/dist/reporting/rollups.js +0 -1
  43. package/dist/runtime-instance-store.d.ts +62 -0
  44. package/dist/runtime-instance-store.js +362 -0
  45. package/dist/snapshot-store.d.ts +0 -1
  46. package/dist/snapshot-store.js +0 -1
  47. package/dist/types.d.ts +0 -1
  48. package/dist/types.js +0 -1
  49. package/package.json +2 -2
  50. package/dashboard/dist/assets/MissionControlView-CthHdl6R.js +0 -1
  51. package/dashboard/dist/assets/SessionInspector-Dq0Z5WMo.js +0 -1
  52. package/dashboard/dist/assets/index-CoLgC4zE.js +0 -11
  53. package/dashboard/dist/assets/index-jfEYE0kO.css +0 -1
  54. package/dashboard/dist/assets/motion-CVDprFZg.js +0 -9
  55. package/dashboard/dist/assets/react-vendor-C2t2w4r2.js +0 -32
  56. package/dashboard/dist/assets/vendor-C-AHK0Ly.js +0 -9
  57. package/dist/adapters/outbox.d.ts.map +0 -1
  58. package/dist/adapters/outbox.js.map +0 -1
  59. package/dist/agent-context-store.d.ts.map +0 -1
  60. package/dist/agent-context-store.js.map +0 -1
  61. package/dist/agent-run-store.d.ts.map +0 -1
  62. package/dist/agent-run-store.js.map +0 -1
  63. package/dist/api.d.ts.map +0 -1
  64. package/dist/api.js.map +0 -1
  65. package/dist/auth-store.d.ts.map +0 -1
  66. package/dist/auth-store.js.map +0 -1
  67. package/dist/byok-store.d.ts.map +0 -1
  68. package/dist/byok-store.js.map +0 -1
  69. package/dist/contracts/client.d.ts.map +0 -1
  70. package/dist/contracts/client.js.map +0 -1
  71. package/dist/contracts/types.d.ts.map +0 -1
  72. package/dist/contracts/types.js.map +0 -1
  73. package/dist/dashboard-api.d.ts.map +0 -1
  74. package/dist/dashboard-api.js.map +0 -1
  75. package/dist/fs-utils.d.ts.map +0 -1
  76. package/dist/fs-utils.js.map +0 -1
  77. package/dist/http-handler.d.ts.map +0 -1
  78. package/dist/http-handler.js.map +0 -1
  79. package/dist/index.d.ts.map +0 -1
  80. package/dist/index.js.map +0 -1
  81. package/dist/local-openclaw.d.ts.map +0 -1
  82. package/dist/local-openclaw.js.map +0 -1
  83. package/dist/mcp-apps/orgx-live.html +0 -690
  84. package/dist/outbox.d.ts.map +0 -1
  85. package/dist/outbox.js.map +0 -1
  86. package/dist/paths.d.ts.map +0 -1
  87. package/dist/paths.js.map +0 -1
  88. package/dist/reporting/outbox-replay.d.ts.map +0 -1
  89. package/dist/reporting/outbox-replay.js.map +0 -1
  90. package/dist/reporting/rollups.d.ts.map +0 -1
  91. package/dist/reporting/rollups.js.map +0 -1
  92. package/dist/snapshot-store.d.ts.map +0 -1
  93. package/dist/snapshot-store.js.map +0 -1
  94. package/dist/types.d.ts.map +0 -1
  95. package/dist/types.js.map +0 -1
  96. /package/dashboard/dist/assets/{tanstack-C-KIc3Wc.js → C-KIc3Wc.js} +0 -0
  97. /package/dashboard/dist/assets/{orgx-logo-Fm0FhtnV.png → Fm0FhtnV.png} +0 -0
@@ -0,0 +1,9 @@
1
+ import{r as v,j as _}from"./BqukHQH-.js";import{n as U,i as we,m as $,s as z,c as vs,a as Wi,g as Gi,b as $i,d as xs,p as Tt,e as zi,f as Hi,h as Xi,j as on,k as Yi,l as Ve,G as qi,o as Ts,q as Zi,t as Ji,u as Qi}from"./Cpr7n8fE.js";const Pt=v.createContext({});function be(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const $t=v.createContext(null),Ce=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class to extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function eo({children:t,isPresent:e}){const n=v.useId(),s=v.useRef(null),i=v.useRef({width:0,height:0,top:0,left:0}),{nonce:r}=v.useContext(Ce);return v.useInsertionEffect(()=>{const{width:o,height:a,top:l,left:u}=i.current;if(e||!s.current||!o||!a)return;s.current.dataset.motionPopId=n;const c=document.createElement("style");return r&&(c.nonce=r),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
2
+ [data-motion-pop-id="${n}"] {
3
+ position: absolute !important;
4
+ width: ${o}px !important;
5
+ height: ${a}px !important;
6
+ top: ${l}px !important;
7
+ left: ${u}px !important;
8
+ }
9
+ `),()=>{document.head.removeChild(c)}},[e]),_.jsx(to,{isPresent:e,childRef:s,sizeRef:i,children:v.cloneElement(t,{ref:s})})}const no=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o})=>{const a=be(so),l=v.useId(),u=v.useCallback(h=>{a.set(h,!0);for(const f of a.values())if(!f)return;s&&s()},[a,s]),c=v.useMemo(()=>({id:l,initial:e,isPresent:n,custom:i,onExitComplete:u,register:h=>(a.set(h,!1),()=>a.delete(h))}),r?[Math.random(),u]:[n,u]);return v.useMemo(()=>{a.forEach((h,f)=>a.set(f,!1))},[n]),v.useEffect(()=>{!n&&!a.size&&s&&s()},[n]),o==="popLayout"&&(t=_.jsx(eo,{isPresent:n,children:t})),_.jsx($t.Provider,{value:c,children:t})};function so(){return new Map}function Ps(t=!0){const e=v.useContext($t);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=v.useId();v.useEffect(()=>{t&&i(r)},[t]);const o=v.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const Et=t=>t.key||"";function rn(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const De=typeof window<"u",Me=De?v.useLayoutEffect:v.useEffect,Au=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1})=>{const[a,l]=Ps(o),u=v.useMemo(()=>rn(t),[t]),c=o&&!a?[]:u.map(Et),h=v.useRef(!0),f=v.useRef(u),d=be(()=>new Map),[p,m]=v.useState(u),[y,g]=v.useState(u);Me(()=>{h.current=!1,f.current=u;for(let w=0;w<y.length;w++){const x=Et(y[w]);c.includes(x)?d.delete(x):d.get(x)!==!0&&d.set(x,!1)}},[y,c.length,c.join("-")]);const T=[];if(u!==p){let w=[...u];for(let x=0;x<y.length;x++){const V=y[x],M=Et(V);c.includes(M)||(w.splice(x,0,V),T.push(V))}r==="wait"&&T.length&&(w=T),g(rn(w)),m(u);return}const{forceRender:P}=v.useContext(Pt);return _.jsx(_.Fragment,{children:y.map(w=>{const x=Et(w),V=o&&!a?!1:u===y||c.includes(x),M=()=>{if(d.has(x))d.set(x,!0);else return;let A=!0;d.forEach(L=>{L||(A=!1)}),A&&(P==null||P(),g(f.current),o&&(l==null||l()),s&&s())};return _.jsx(no,{isPresent:V,initial:!h.current||n?void 0:!1,custom:V?void 0:e,presenceAffectsLayout:i,mode:r,onExitComplete:V?void 0:M,children:w},x)})})},io=v.createContext(null);function oo(){const t=v.useRef(!1);return Me(()=>(t.current=!0,()=>{t.current=!1}),[]),t}const ro={useManualTiming:!1};function ao(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){r.has(u)&&(l.schedule(u),t()),u(o)}const l={schedule:(u,c=!1,h=!1)=>{const d=h&&s?e:n;return c&&r.add(u),d.has(u)||d.add(u),u},cancel:u=>{n.delete(u),r.delete(u)},process:u=>{if(o=u,s){i=!0;return}s=!0,[e,n]=[n,e],e.forEach(a),e.clear(),s=!1,i&&(i=!1,l.process(u))}};return l}const Lt=["read","resolveKeyframes","update","preRender","render","postRender"],lo=40;function Ss(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Lt.reduce((g,T)=>(g[T]=ao(r),g),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:f}=o,d=()=>{const g=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,lo),1),i.timestamp=g,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(d))},p=()=>{n=!0,s=!0,i.isProcessing||t(d)};return{schedule:Lt.reduce((g,T)=>{const P=o[T];return g[T]=(w,x=!1,V=!1)=>(n||p(),P.schedule(w,x,V)),g},{}),cancel:g=>{for(let T=0;T<Lt.length;T++)o[Lt[T]].cancel(g)},state:i,steps:o}}const{schedule:b,cancel:Y,state:E,steps:Qt}=Ss(typeof requestAnimationFrame<"u"?requestAnimationFrame:U,!0);function uo(){const t=oo(),[e,n]=v.useState(0),s=v.useCallback(()=>{t.current&&n(e+1)},[e]);return[v.useCallback(()=>b.postRender(s),[s]),e]}const co=t=>!t.isLayoutDirty&&t.willUpdate(!1);function an(){const t=new Set,e=new WeakMap,n=()=>t.forEach(co);return{add:s=>{t.add(s),e.set(s,s.addEventListener("willUpdate",n))},remove:s=>{t.delete(s);const i=e.get(s);i&&(i(),e.delete(s)),n()},dirty:n}}const As=t=>t===!0,ho=t=>As(t===!0)||t==="id",wu=({children:t,id:e,inherit:n=!0})=>{const s=v.useContext(Pt),i=v.useContext(io),[r,o]=uo(),a=v.useRef(null),l=s.id||i;a.current===null&&(ho(n)&&l&&(e=e?l+"-"+e:l),a.current={id:e,group:As(n)&&s.group||an()});const u=v.useMemo(()=>({...a.current,forceRender:r}),[o]);return _.jsx(Pt.Provider,{value:u,children:t})},ws=v.createContext({strict:!1}),ln={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"]},ct={};for(const t in ln)ct[t]={isEnabled:e=>ln[t].some(n=>!!e[n])};function fo(t){for(const e in t)ct[e]={...ct[e],...t[e]}}const po=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 Ot(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||po.has(t)}let Vs=t=>!Ot(t);function mo(t){t&&(Vs=e=>e.startsWith("on")?!Ot(e):t(e))}try{mo(require("@emotion/is-prop-valid").default)}catch{}function go(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Vs(i)||n===!0&&Ot(i)||!e&&!Ot(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function yo(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...s)=>t(...s);return new Proxy(n,{get:(s,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const zt=v.createContext({});function St(t){return typeof t=="string"||Array.isArray(t)}function Ht(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Re=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ee=["initial",...Re];function Xt(t){return Ht(t.animate)||Ee.some(e=>St(t[e]))}function bs(t){return!!(Xt(t)||t.variants)}function vo(t,e){if(Xt(t)){const{initial:n,animate:s}=t;return{initial:n===!1||St(n)?n:void 0,animate:St(s)?s:void 0}}return t.inherit!==!1?e:{}}function xo(t){const{initial:e,animate:n}=vo(t,v.useContext(zt));return v.useMemo(()=>({initial:e,animate:n}),[un(e),un(n)])}function un(t){return Array.isArray(t)?t.join(" "):t}const To=Symbol.for("motionComponentSymbol");function ot(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Po(t,e,n){return v.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):ot(n)&&(n.current=s))},[e])}const Le=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),So="framerAppearId",Cs="data-"+Le(So),{schedule:Fe}=Ss(queueMicrotask,!1),Ds=v.createContext({});function Ao(t,e,n,s,i){var r,o;const{visualElement:a}=v.useContext(zt),l=v.useContext(ws),u=v.useContext($t),c=v.useContext(Ce).reducedMotion,h=v.useRef(null);s=s||l.renderer,!h.current&&s&&(h.current=s(t,{visualState:e,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const f=h.current,d=v.useContext(Ds);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&wo(h.current,n,i,d);const p=v.useRef(!1);v.useInsertionEffect(()=>{f&&p.current&&f.update(n,u)});const m=n[Cs],y=v.useRef(!!m&&!(!((r=window.MotionHandoffIsComplete)===null||r===void 0)&&r.call(window,m))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,m)));return Me(()=>{f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Fe.render(f.render),y.current&&f.animationState&&f.animationState.animateChanges())}),v.useEffect(()=>{f&&(!y.current&&f.animationState&&f.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,m)}),y.current=!1))}),f}function wo(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ms(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&ot(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:u})}function Ms(t){if(t)return t.options.allowProjection!==!1?t.projection:Ms(t.parent)}function Vo({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){var r,o;t&&fo(t);function a(u,c){let h;const f={...v.useContext(Ce),...u,layoutId:bo(u)},{isStatic:d}=f,p=xo(u),m=s(u,d);if(!d&&De){Co();const y=Do(f);h=y.MeasureLayout,p.visualElement=Ao(i,m,f,e,y.ProjectionNode)}return _.jsxs(zt.Provider,{value:p,children:[h&&p.visualElement?_.jsx(h,{visualElement:p.visualElement,...f}):null,n(i,u,Po(m,p.visualElement,c),m,d,p.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(r=i.displayName)!==null&&r!==void 0?r:i.name)!==null&&o!==void 0?o:""})`}`;const l=v.forwardRef(a);return l[To]=i,l}function bo({layoutId:t}){const e=v.useContext(Pt).id;return e&&t!==void 0?e+"-"+t:t}function Co(t,e){v.useContext(ws).strict}function Do(t){const{drag:e,layout:n}=ct;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const Mo=["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 Be(t){return typeof t!="string"||t.includes("-")?!1:!!(Mo.indexOf(t)>-1||/[A-Z]/u.test(t))}function cn(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function ke(t,e,n,s){if(typeof e=="function"){const[i,r]=cn(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=cn(s);e=e(n!==void 0?n:t.custom,i,r)}return e}const he=t=>Array.isArray(t),Ro=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Eo=t=>he(t)?t[t.length-1]||0:t,B=t=>!!(t&&t.getVelocity);function kt(t){const e=B(t)?t.get():t;return Ro(e)?e.toValue():e}function Lo({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},s,i,r){const o={latestValues:Fo(s,i,r,t),renderState:e()};return n&&(o.onMount=a=>n({props:s,current:a,...o}),o.onUpdate=a=>n(a)),o}const Rs=t=>(e,n)=>{const s=v.useContext(zt),i=v.useContext($t),r=()=>Lo(t,e,s,i);return n?r():be(r)};function Fo(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=kt(r[f]);let{initial:o,animate:a}=t;const l=Xt(t),u=bs(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const h=c?a:o;if(h&&typeof h!="boolean"&&!Ht(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=ke(t,f[d]);if(p){const{transitionEnd:m,transition:y,...g}=p;for(const T in g){let P=g[T];if(Array.isArray(P)){const w=c?P.length-1:0;P=P[w]}P!==null&&(i[T]=P)}for(const T in m)i[T]=m[T]}}}return i}const ft=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],st=new Set(ft),Es=t=>e=>typeof e=="string"&&e.startsWith(t),Ls=Es("--"),Bo=Es("var(--"),je=t=>Bo(t)?ko.test(t.split("/*")[0].trim()):!1,ko=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Fs=(t,e)=>e&&typeof t=="number"?e.transform(t):t,H=(t,e,n)=>n>e?e:n<t?t:n,dt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},At={...dt,transform:t=>H(0,1,t)},Ft={...dt,default:1},Ct=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),X=Ct("deg"),K=Ct("%"),S=Ct("px"),jo=Ct("vh"),Io=Ct("vw"),hn={...K,parse:t=>K.parse(t)/100,transform:t=>K.transform(t*100)},Oo={borderWidth:S,borderTopWidth:S,borderRightWidth:S,borderBottomWidth:S,borderLeftWidth:S,borderRadius:S,radius:S,borderTopLeftRadius:S,borderTopRightRadius:S,borderBottomRightRadius:S,borderBottomLeftRadius:S,width:S,maxWidth:S,height:S,maxHeight:S,top:S,right:S,bottom:S,left:S,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,backgroundPositionX:S,backgroundPositionY:S},No={rotate:X,rotateX:X,rotateY:X,rotateZ:X,scale:Ft,scaleX:Ft,scaleY:Ft,scaleZ:Ft,skew:X,skewX:X,skewY:X,distance:S,translateX:S,translateY:S,translateZ:S,x:S,y:S,z:S,perspective:S,transformPerspective:S,opacity:At,originX:hn,originY:hn,originZ:S},fn={...dt,transform:Math.round},Ie={...Oo,...No,zIndex:fn,size:S,fillOpacity:At,strokeOpacity:At,numOctaves:fn},Uo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_o=ft.length;function Ko(t,e,n){let s="",i=!0;for(let r=0;r<_o;r++){const o=ft[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Fs(a,Ie[o]);if(!l){i=!1;const c=Uo[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Oe(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if(st.has(l)){o=!0;continue}else if(Ls(l)){i[l]=u;continue}else{const c=Fs(u,Ie[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=Ko(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}const Wo={offset:"stroke-dashoffset",array:"stroke-dasharray"},Go={offset:"strokeDashoffset",array:"strokeDasharray"};function $o(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Wo:Go;t[r.offset]=S.transform(-s);const o=S.transform(e),a=S.transform(n);t[r.array]=`${o} ${a}`}function dn(t,e,n){return typeof t=="string"?t:S.transform(e+n*t)}function zo(t,e,n){const s=dn(e,t.x,t.width),i=dn(n,t.y,t.height);return`${s} ${i}`}function Ne(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(Oe(t,u,h),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:d,dimensions:p}=t;f.transform&&(p&&(d.transform=f.transform),delete f.transform),p&&(i!==void 0||r!==void 0||d.transform)&&(d.transformOrigin=zo(p,i!==void 0?i:.5,r!==void 0?r:.5)),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),o!==void 0&&$o(f,o,a,l,!1)}const Ue=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Bs=()=>({...Ue(),attrs:{}}),_e=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ks(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const r in n)t.style.setProperty(r,n[r])}const js=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 Is(t,e,n,s){ks(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(js.has(i)?i:Le(i),e.attrs[i])}const Nt={};function Ho(t){Object.assign(Nt,t)}function Os(t,{layout:e,layoutId:n}){return st.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Nt[t]||t==="opacity")}function Ke(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(B(i[o])||e.style&&B(e.style[o])||Os(o,t)||((s=n==null?void 0:n.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(r[o]=i[o]);return r}function Ns(t,e,n){const s=Ke(t,e,n);for(const i in t)if(B(t[i])||B(e[i])){const r=ft.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}function Xo(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const pn=["x","y","width","height","cx","cy","r"],Yo={useVisualState:Rs({scrapeMotionValuesFromProps:Ns,createRenderState:Bs,onUpdate:({props:t,prevProps:e,current:n,renderState:s,latestValues:i})=>{if(!n)return;let r=!!t.drag;if(!r){for(const a in i)if(st.has(a)){r=!0;break}}if(!r)return;let o=!e;if(e)for(let a=0;a<pn.length;a++){const l=pn[a];t[l]!==e[l]&&(o=!0)}o&&b.read(()=>{Xo(n,s),b.render(()=>{Ne(s,i,_e(n.tagName),t.transformTemplate),Is(n,s)})})}})},qo={useVisualState:Rs({scrapeMotionValuesFromProps:Ke,createRenderState:Ue})};function Us(t,e,n){for(const s in e)!B(e[s])&&!Os(s,n)&&(t[s]=e[s])}function Zo({transformTemplate:t},e){return v.useMemo(()=>{const n=Ue();return Oe(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Jo(t,e){const n=t.style||{},s={};return Us(s,n,t),Object.assign(s,Zo(t,e)),s}function Qo(t,e){const n={},s=Jo(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}function tr(t,e,n,s){const i=v.useMemo(()=>{const r=Bs();return Ne(r,e,_e(s),t.transformTemplate),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Us(r,t.style,t),i.style={...r,...i.style}}return i}function er(t=!1){return(n,s,i,{latestValues:r},o)=>{const l=(Be(n)?tr:Qo)(s,r,o,n),u=go(s,typeof n=="string",t),c=n!==v.Fragment?{...u,...l,ref:i}:{},{children:h}=s,f=v.useMemo(()=>B(h)?h.get():h,[h]);return v.createElement(n,{...c,children:f})}}function nr(t,e){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Be(s)?Yo:qo,preloadedFeatures:t,useRender:er(i),createVisualElement:e,Component:s};return Vo(o)}}function _s(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function Yt(t,e,n){const s=t.getProps();return ke(s,e,n!==void 0?n:s.custom,t)}const Ks=new Set(["width","height","top","left","right","bottom",...ft]);let jt;function sr(){jt=void 0}const W={now:()=>(jt===void 0&&W.set(E.isProcessing||ro.useManualTiming?E.timestamp:performance.now()),jt),set:t=>{jt=t,queueMicrotask(sr)}};function We(t,e){t.indexOf(e)===-1&&t.push(e)}function Ge(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class $e{constructor(){this.subscriptions=[]}add(e){return We(this.subscriptions,e),()=>Ge(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ws(t,e){return e?t*(1e3/e):0}const mn=30,ir=t=>!isNaN(parseFloat(t));class or{constructor(e,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=W.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=W.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ir(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new $e);const s=this.events[e].add(n);return e==="change"?()=>{s(),b.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=W.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>mn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,mn);return Ws(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function wt(t,e){return new or(t,e)}function rr(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,wt(n))}function ar(t,e){const n=Yt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Eo(r[o]);rr(t,o,a)}}function lr(t){return!!(B(t)&&t.add)}function fe(t,e){const n=t.getValue("willChange");if(lr(n))return n.add(e)}function Gs(t){return t.props[Cs]}const $s=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,ur=1e-7,cr=12;function hr(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=$s(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>ur&&++a<cr);return o}function Dt(t,e,n,s){if(t===e&&n===s)return U;const i=r=>hr(r,0,1,t,n);return r=>r===0||r===1?r:$s(i(r),e,s)}const zs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Hs=t=>e=>1-t(1-e),Xs=Dt(.33,1.53,.69,.99),ze=Hs(Xs),Ys=zs(ze),qs=t=>(t*=2)<1?.5*ze(t):.5*(2-Math.pow(2,-10*(t-1))),He=t=>1-Math.sin(Math.acos(t)),Zs=Hs(He),Js=zs(He),Qs=t=>/^0[^.\s]+$/u.test(t);function fr(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Qs(t):!0}const gt=t=>Math.round(t*1e5)/1e5,Xe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function dr(t){return t==null}const pr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ye=(t,e)=>n=>!!(typeof n=="string"&&pr.test(n)&&n.startsWith(t)||e&&!dr(n)&&Object.prototype.hasOwnProperty.call(n,e)),ti=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(Xe);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},mr=t=>H(0,255,t),te={...dt,transform:t=>Math.round(mr(t))},et={test:Ye("rgb","red"),parse:ti("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+te.transform(t)+", "+te.transform(e)+", "+te.transform(n)+", "+gt(At.transform(s))+")"};function gr(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const de={test:Ye("#"),parse:gr,transform:et.transform},rt={test:Ye("hsl","hue"),parse:ti("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+K.transform(gt(e))+", "+K.transform(gt(n))+", "+gt(At.transform(s))+")"},F={test:t=>et.test(t)||de.test(t)||rt.test(t),parse:t=>et.test(t)?et.parse(t):rt.test(t)?rt.parse(t):de.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?et.transform(t):rt.transform(t)},yr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function vr(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Xe))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(yr))===null||n===void 0?void 0:n.length)||0)>0}const ei="number",ni="color",xr="var",Tr="var(",gn="${}",Pr=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Vt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Pr,l=>(F.test(l)?(s.color.push(r),i.push(ni),n.push(F.parse(l))):l.startsWith(Tr)?(s.var.push(r),i.push(xr),n.push(l)):(s.number.push(r),i.push(ei),n.push(parseFloat(l))),++r,gn)).split(gn);return{values:n,split:a,indexes:s,types:i}}function si(t){return Vt(t).values}function ii(t){const{split:e,types:n}=Vt(t),s=e.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=e[o],i[o]!==void 0){const a=n[o];a===ei?r+=gt(i[o]):a===ni?r+=F.transform(i[o]):r+=i[o]}return r}}const Sr=t=>typeof t=="number"?0:t;function Ar(t){const e=si(t);return ii(t)(e.map(Sr))}const q={test:vr,parse:si,createTransformer:ii,getAnimatableNone:Ar},wr=new Set(["brightness","contrast","saturate","opacity"]);function Vr(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Xe)||[];if(!s)return t;const i=n.replace(s,"");let r=wr.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const br=/\b([a-z-]*)\(.*?\)/gu,pe={...q,getAnimatableNone:t=>{const e=t.match(br);return e?e.map(Vr).join(" "):t}},Cr={...Ie,color:F,backgroundColor:F,outlineColor:F,fill:F,stroke:F,borderColor:F,borderTopColor:F,borderRightColor:F,borderBottomColor:F,borderLeftColor:F,filter:pe,WebkitFilter:pe},qe=t=>Cr[t];function oi(t,e){let n=qe(t);return n!==pe&&(n=q),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Dr=new Set(["auto","none","0"]);function Mr(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Dr.has(r)&&Vt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=oi(n,i)}const yn=t=>t===dt||t===S,vn=(t,e)=>parseFloat(t.split(", ")[e]),xn=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return vn(i[1],e);{const r=s.match(/^matrix\((.+)\)$/u);return r?vn(r[1],t):0}},Rr=new Set(["x","y","z"]),Er=ft.filter(t=>!Rr.has(t));function Lr(t){const e=[];return Er.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const ht={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:xn(4,13),y:xn(5,14)};ht.translateX=ht.x;ht.translateY=ht.y;const nt=new Set;let me=!1,ge=!1;function ri(){if(ge){const t=Array.from(nt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Lr(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))===null||a===void 0||a.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ge=!1,me=!1,nt.forEach(t=>t.complete()),nt.clear()}function ai(){nt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ge=!0)})}function Fr(){ai(),ri()}class Ze{constructor(e,n,s,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(nt.add(this),me||(me=!0,b.read(ai),b.resolveKeyframes(ri))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let r=0;r<e.length;r++)if(e[r]===null)if(r===0){const o=i==null?void 0:i.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&o===void 0&&i.set(e[0])}else e[r]=e[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),nt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,nt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const li=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Br=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function kr(t){const e=Br.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function ui(t,e,n=1){const[s,i]=kr(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return li(o)?parseFloat(o):o}return je(i)?ui(i,e,n+1):i}const ci=t=>e=>e.test(t),jr={test:t=>t==="auto",parse:t=>t},hi=[dt,S,K,X,Io,jo,jr],Tn=t=>hi.find(ci(t));class fi extends Ze{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),je(u))){const c=ui(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Ks.has(s)||e.length!==2)return;const[i,r]=e,o=Tn(i),a=Tn(r);if(o!==a)if(yn(o)&&yn(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)fr(e[i])&&s.push(i);s.length&&Mr(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ht[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const r=n.getValue(s);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=ht[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Pn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(q.test(t)||t==="0")&&!t.startsWith("url("));function Ir(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Or(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=Pn(i,e),a=Pn(r,e);return!o||!a?!1:Ir(t)||(n==="spring"||we(n))&&s}const Nr=t=>t!==null;function qt(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Nr),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}const Ur=40;class di{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=W.now(),this.options={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Ur?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Fr(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=W.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:r,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Or(e,s,i,r))if(o)this.options.duration=0;else{l&&l(qt(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const C=(t,e,n)=>t+(e-t)*n;function ee(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function _r({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=ee(l,a,t+1/3),r=ee(l,a,t),o=ee(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Ut(t,e){return n=>n>0?e:t}const ne=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Kr=[de,et,rt],Wr=t=>Kr.find(e=>e.test(t));function Sn(t){const e=Wr(t);if(!e)return!1;let n=e.parse(t);return e===rt&&(n=_r(n)),n}const An=(t,e)=>{const n=Sn(t),s=Sn(e);if(!n||!s)return Ut(t,e);const i={...n};return r=>(i.red=ne(n.red,s.red,r),i.green=ne(n.green,s.green,r),i.blue=ne(n.blue,s.blue,r),i.alpha=C(n.alpha,s.alpha,r),et.transform(i))},Gr=(t,e)=>n=>e(t(n)),Mt=(...t)=>t.reduce(Gr),ye=new Set(["none","hidden"]);function $r(t,e){return ye.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function zr(t,e){return n=>C(t,e,n)}function Je(t){return typeof t=="number"?zr:typeof t=="string"?je(t)?Ut:F.test(t)?An:Yr:Array.isArray(t)?pi:typeof t=="object"?F.test(t)?An:Hr:Ut}function pi(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>Je(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function Hr(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Je(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Xr(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=(n=t.values[a])!==null&&n!==void 0?n:0;s[r]=l,i[o]++}return s}const Yr=(t,e)=>{const n=q.createTransformer(e),s=Vt(t),i=Vt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ye.has(t)&&!i.values.length||ye.has(e)&&!s.values.length?$r(t,e):Mt(pi(Xr(s,i),i.values),n):Ut(t,e)};function mi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?C(t,e,n):Je(t)(t,e)}const qr=5;function gi(t,e,n){const s=Math.max(e-qr,0);return Ws(n-t(s),e-s)}const D={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},se=.001;function Zr({duration:t=D.duration,bounce:e=D.bounce,velocity:n=D.velocity,mass:s=D.mass}){let i,r,o=1-e;o=H(D.minDamping,D.maxDamping,o),t=H(D.minDuration,D.maxDuration,$(t)),o<1?(i=u=>{const c=u*o,h=c*t,f=c-n,d=ve(u,o),p=Math.exp(-h);return se-f/d*p},r=u=>{const h=u*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),m=ve(Math.pow(u,2),o);return(-i(u)+se>0?-1:1)*((f-d)*p)/m}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-se+c*h},r=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=Qr(i,r,a);if(t=z(t),isNaN(l))return{stiffness:D.stiffness,damping:D.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const Jr=12;function Qr(t,e,n){let s=n;for(let i=1;i<Jr;i++)s=s-t(s)/e(s);return s}function ve(t,e){return t*Math.sqrt(1-e*e)}const ta=["duration","bounce"],ea=["stiffness","damping","mass"];function wn(t,e){return e.some(n=>t[n]!==void 0)}function na(t){let e={velocity:D.velocity,stiffness:D.stiffness,damping:D.damping,mass:D.mass,isResolvedFromDuration:!1,...t};if(!wn(t,ea)&&wn(t,ta))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*H(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:D.mass,stiffness:i,damping:r}}else{const n=Zr(t);e={...e,...n,mass:D.mass},e.isResolvedFromDuration=!0}return e}function yi(t=D.visualDuration,e=D.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:u,mass:c,duration:h,velocity:f,isResolvedFromDuration:d}=na({...n,velocity:-$(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(l*c)),y=o-r,g=$(Math.sqrt(l/c)),T=Math.abs(y)<5;s||(s=T?D.restSpeed.granular:D.restSpeed.default),i||(i=T?D.restDelta.granular:D.restDelta.default);let P;if(m<1){const x=ve(g,m);P=V=>{const M=Math.exp(-m*g*V);return o-M*((p+m*g*y)/x*Math.sin(x*V)+y*Math.cos(x*V))}}else if(m===1)P=x=>o-Math.exp(-g*x)*(y+(p+g*y)*x);else{const x=g*Math.sqrt(m*m-1);P=V=>{const M=Math.exp(-m*g*V),A=Math.min(x*V,300);return o-M*((p+m*g*y)*Math.sinh(A)+x*y*Math.cosh(A))/x}}const w={calculatedDuration:d&&h||null,next:x=>{const V=P(x);if(d)a.done=x>=h;else{let M=0;m<1&&(M=x===0?z(p):gi(P,x,V));const A=Math.abs(M)<=s,L=Math.abs(o-V)<=i;a.done=A&&L}return a.value=a.done?o:V,a},toString:()=>{const x=Math.min(vs(w),Wi),V=Gi(M=>w.next(x*M).value,x,30);return x+"ms "+V}};return w}function Vn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=A=>a!==void 0&&A<a||l!==void 0&&A>l,p=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let m=n*e;const y=h+m,g=o===void 0?y:o(y);g!==y&&(m=g-h);const T=A=>-m*Math.exp(-A/s),P=A=>g+T(A),w=A=>{const L=T(A),I=P(A);f.done=Math.abs(L)<=u,f.value=f.done?g:I};let x,V;const M=A=>{d(f.value)&&(x=A,V=yi({keyframes:[f.value,p(f.value)],velocity:gi(P,A,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return M(0),{calculatedDuration:null,next:A=>{let L=!1;return!V&&x===void 0&&(L=!0,w(A),M(A)),x!==void 0&&A>=x?V.next(A-x):(!L&&w(A),f)}}}const sa=Dt(.42,0,1,1),ia=Dt(0,0,.58,1),vi=Dt(.42,0,.58,1),oa=t=>Array.isArray(t)&&typeof t[0]!="number",ra={linear:U,easeIn:sa,easeInOut:vi,easeOut:ia,circIn:He,circInOut:Js,circOut:Zs,backIn:ze,backInOut:Ys,backOut:Xs,anticipate:qs},bn=t=>{if($i(t)){xs(t.length===4);const[e,n,s,i]=t;return Dt(e,n,s,i)}else if(typeof t=="string")return ra[t];return t};function aa(t,e,n){const s=[],i=n||mi,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||U:e;a=Mt(l,a)}s.push(a)}return s}function la(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(xs(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=aa(e,s,i),l=a.length,u=c=>{if(o&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const f=Tt(t[h],t[h+1],c);return a[h](f)};return n?c=>u(H(t[0],t[r-1],c)):u}function ua(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Tt(0,e,s);t.push(C(n,1,i))}}function ca(t){const e=[0];return ua(e,t.length-1),e}function ha(t,e){return t.map(n=>n*e)}function fa(t,e){return t.map(()=>e||vi).splice(0,t.length-1)}function _t({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=oa(s)?s.map(bn):bn(s),r={done:!1,value:e[0]},o=ha(n&&n.length===e.length?n:ca(e),t),a=la(o,e,{ease:Array.isArray(i)?i:fa(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const da=t=>{const e=({timestamp:n})=>t(n);return{start:()=>b.update(e,!0),stop:()=>Y(e),now:()=>E.isProcessing?E.timestamp:W.now()}},pa={decay:Vn,inertia:Vn,tween:_t,keyframes:_t,spring:yi},ma=t=>t/100;class Qe extends di{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:s,element:i,keyframes:r}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Ze,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(r,a,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=this.options,a=we(n)?n:pa[n]||_t;let l,u;a!==_t&&typeof e[0]!="number"&&(l=Mt(ma,mi(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});r==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=vs(c));const{calculatedDuration:h}=c,f=h+i,d=f*(s+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:f,totalDuration:d}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:h}=s;if(this.startTime===null)return r.next(0);const{delay:f,repeat:d,repeatType:p,repeatDelay:m,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-f*(this.speed>=0?1:-1),T=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let P=this.currentTime,w=r;if(d){const A=Math.min(this.currentTime,c)/h;let L=Math.floor(A),I=A%1;!I&&A>=1&&(I=1),I===1&&L--,L=Math.min(L,d+1),!!(L%2)&&(p==="reverse"?(I=1-I,m&&(I-=m/h)):p==="mirror"&&(w=o)),P=H(0,1,I)*h}const x=T?{done:!1,value:l[0]}:w.next(P);a&&(x.value=a(x.value));let{done:V}=x;!T&&u!==null&&(V=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return M&&i!==void 0&&(x.value=qt(l,this.options,i)),y&&y(x.value),M&&this.finish(),x}get duration(){const{resolved:e}=this;return e?$(e.calculatedDuration):0}get time(){return $(this.currentTime)}set time(e){e=z(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=$(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=da,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const ga=new Set(["opacity","clipPath","filter","transform"]);function ya(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=zi(a,i);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}const va=Hi(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Kt=10,xa=2e4;function Ta(t){return we(t.type)||t.type==="spring"||!Yi(t.ease)}function Pa(t,e){const n=new Qe({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<xa;)s=n.sample(r),i.push(s.value),r+=Kt;return{times:void 0,keyframes:i,duration:r-Kt,ease:"linear"}}const xi={anticipate:qs,backInOut:Ys,circInOut:Js};function Sa(t){return t in xi}class Cn extends di{constructor(e){super(e);const{name:n,motionValue:s,element:i,keyframes:r}=this.options;this.resolver=new fi(r,(o,a)=>this.onKeyframesResolved(o,a),n,s,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:s=300,times:i,ease:r,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof r=="string"&&Xi()&&Sa(r)&&(r=xi[r]),Ta(this.options)){const{onComplete:h,onUpdate:f,motionValue:d,element:p,...m}=this.options,y=Pa(e,m);e=y.keyframes,e.length===1&&(e[1]=e[0]),s=y.duration,i=y.times,r=y.ease,o="keyframes"}const c=ya(a.owner.current,l,e,{...this.options,duration:s,times:i,ease:r});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(on(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:h}=this.options;a.set(qt(e,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:s,times:i,type:o,ease:r,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return $(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return $(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=z(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return U;const{animation:s}=n;on(s,e)}return U}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:i,type:r,ease:o,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:h,element:f,...d}=this.options,p=new Qe({...d,keyframes:s,duration:i,type:r,ease:o,times:a,isGenerator:!0}),m=z(this.time);u.setWithVelocity(p.sample(m-Kt).value,p.sample(m).value,Kt)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:i,repeatType:r,damping:o,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return va()&&s&&ga.has(s)&&!l&&!u&&!i&&r!=="mirror"&&o!==0&&a!=="inertia"}}const Aa={type:"spring",stiffness:500,damping:25,restSpeed:10},wa=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Va={type:"keyframes",duration:.8},ba={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ca=(t,{keyframes:e})=>e.length>2?Va:st.has(t)?t.startsWith("scale")?wa(e[1]):Aa:ba;function Da({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const tn=(t,e,n,s={},i,r)=>o=>{const a=Ve(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-z(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};Da(a)||(c={...c,...Ca(t,c)}),c.duration&&(c.duration=z(c.duration)),c.repeatDelay&&(c.repeatDelay=z(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(h=!0)),h&&!r&&e.get()!==void 0){const f=qt(c.keyframes,a);if(f!==void 0)return b.update(()=>{c.onUpdate(f),c.onComplete()}),new qi([])}return!r&&Cn.supports(c)?new Cn(c):new Qe(c)};function Ma({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Ti(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const h in l){const f=t.getValue(h,(r=t.latestValues[h])!==null&&r!==void 0?r:null),d=l[h];if(d===void 0||c&&Ma(c,h))continue;const p={delay:n,...Ve(o||{},h)};let m=!1;if(window.MotionHandoffAnimation){const g=Gs(t);if(g){const T=window.MotionHandoffAnimation(g,h,b);T!==null&&(p.startTime=T,m=!0)}}fe(t,h),f.start(tn(h,f,d,t.shouldReduceMotion&&Ks.has(h)?{type:!1}:p,t,m));const y=f.animation;y&&u.push(y)}return a&&Promise.all(u).then(()=>{b.update(()=>{a&&ar(t,a)})}),u}function xe(t,e,n={}){var s;const i=Yt(t,e,n.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(Ti(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=r;return Ra(t,e,c+u,h,f,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function Ra(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,l=i===1?(u=0)=>u*s:(u=0)=>a-u*s;return Array.from(t.variantChildren).sort(Ea).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(xe(u,e,{...r,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function Ea(t,e){return t.sortNodePosition(e)}function La(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>xe(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=xe(t,e,n);else{const i=typeof e=="function"?Yt(t,e,n.custom):e;s=Promise.all(Ti(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Fa=Ee.length;function Pi(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Pi(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Fa;n++){const s=Ee[n],i=t.props[s];(St(i)||i===!1)&&(e[s]=i)}return e}const Ba=[...Re].reverse(),ka=Re.length;function ja(t){return e=>Promise.all(e.map(({animation:n,options:s})=>La(t,n,s)))}function Ia(t){let e=ja(t),n=Dn(),s=!0;const i=l=>(u,c)=>{var h;const f=Yt(t,c,l==="exit"?(h=t.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(f){const{transition:d,transitionEnd:p,...m}=f;u={...u,...m,...p}}return u};function r(l){e=l(t)}function o(l){const{props:u}=t,c=Pi(t.parent)||{},h=[],f=new Set;let d={},p=1/0;for(let y=0;y<ka;y++){const g=Ba[y],T=n[g],P=u[g]!==void 0?u[g]:c[g],w=St(P),x=g===l?T.isActive:null;x===!1&&(p=y);let V=P===c[g]&&P!==u[g]&&w;if(V&&s&&t.manuallyAnimateOnMount&&(V=!1),T.protectedKeys={...d},!T.isActive&&x===null||!P&&!T.prevProp||Ht(P)||typeof P=="boolean")continue;const M=Oa(T.prevProp,P);let A=M||g===l&&T.isActive&&!V&&w||y>p&&w,L=!1;const I=Array.isArray(P)?P:[P];let it=I.reduce(i(g),{});x===!1&&(it={});const{prevResolvedValues:nn={}}=T,Ki={...nn,...it},sn=k=>{A=!0,f.has(k)&&(L=!0,f.delete(k)),T.needsAnimating[k]=!0;const G=t.getValue(k);G&&(G.liveStyle=!1)};for(const k in Ki){const G=it[k],Zt=nn[k];if(d.hasOwnProperty(k))continue;let Jt=!1;he(G)&&he(Zt)?Jt=!_s(G,Zt):Jt=G!==Zt,Jt?G!=null?sn(k):f.add(k):G!==void 0&&f.has(k)?sn(k):T.protectedKeys[k]=!0}T.prevProp=P,T.prevResolvedValues=it,T.isActive&&(d={...d,...it}),s&&t.blockInitialAnimation&&(A=!1),A&&(!(V&&M)||L)&&h.push(...I.map(k=>({animation:k,options:{type:g}})))}if(f.size){const y={};f.forEach(g=>{const T=t.getBaseTarget(g),P=t.getValue(g);P&&(P.liveStyle=!0),y[g]=T??null}),h.push({animation:y})}let m=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),s=!1,m?e(h):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(f=>{var d;return(d=f.animationState)===null||d===void 0?void 0:d.setActive(l,u)}),n[l].isActive=u;const h=o(l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=Dn(),s=!0}}}function Oa(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!_s(e,t):!1}function J(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Dn(){return{animate:J(!0),whileInView:J(),whileHover:J(),whileTap:J(),whileDrag:J(),whileFocus:J(),exit:J()}}class Z{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Na extends Z{constructor(e){super(e),e.animationState||(e.animationState=Ia(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Ht(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let Ua=0;class _a extends Z{constructor(){super(...arguments),this.id=Ua++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Ka={animation:{Feature:Na},exit:{Feature:_a}};function bt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Rt(t){return{point:{x:t.pageX,y:t.pageY}}}const Wa=t=>e=>Ts(e)&&t(e,Rt(e));function yt(t,e,n,s){return bt(t,e,Wa(n),s)}const Mn=(t,e)=>Math.abs(t-e);function Ga(t,e){const n=Mn(t.x,e.x),s=Mn(t.y,e.y);return Math.sqrt(n**2+s**2)}class Si{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=oe(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,d=Ga(h.offset,{x:0,y:0})>=3;if(!f&&!d)return;const{point:p}=h,{timestamp:m}=E;this.history.push({...p,timestamp:m});const{onStart:y,onMove:g}=this.handlers;f||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,h)},this.handlePointerMove=(h,f)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=ie(f,this.transformPagePoint),b.update(this.updatePoint,!0)},this.handlePointerUp=(h,f)=>{this.end();const{onEnd:d,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=oe(h.type==="pointercancel"?this.lastMoveEventInfo:ie(f,this.transformPagePoint),this.history);this.startEvent&&d&&d(h,y),p&&p(h,y)},!Ts(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const o=Rt(e),a=ie(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=E;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,oe(a,this.history)),this.removeListeners=Mt(yt(this.contextWindow,"pointermove",this.handlePointerMove),yt(this.contextWindow,"pointerup",this.handlePointerUp),yt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Y(this.updatePoint)}}function ie(t,e){return e?{point:e(t.point)}:t}function Rn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function oe({point:t},e){return{point:t,delta:Rn(t,Ai(e)),offset:Rn(t,$a(e)),velocity:za(e,.1)}}function $a(t){return t[0]}function Ai(t){return t[t.length-1]}function za(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Ai(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>z(e)));)n--;if(!s)return{x:0,y:0};const r=$(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const wi=1e-4,Ha=1-wi,Xa=1+wi,Vi=.01,Ya=0-Vi,qa=0+Vi;function j(t){return t.max-t.min}function Za(t,e,n){return Math.abs(t-e)<=n}function En(t,e,n,s=.5){t.origin=s,t.originPoint=C(e.min,e.max,t.origin),t.scale=j(n)/j(e),t.translate=C(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Ha&&t.scale<=Xa||isNaN(t.scale))&&(t.scale=1),(t.translate>=Ya&&t.translate<=qa||isNaN(t.translate))&&(t.translate=0)}function vt(t,e,n,s){En(t.x,e.x,n.x,s?s.originX:void 0),En(t.y,e.y,n.y,s?s.originY:void 0)}function Ln(t,e,n){t.min=n.min+e.min,t.max=t.min+j(e)}function Ja(t,e,n){Ln(t.x,e.x,n.x),Ln(t.y,e.y,n.y)}function Fn(t,e,n){t.min=e.min-n.min,t.max=t.min+j(e)}function xt(t,e,n){Fn(t.x,e.x,n.x),Fn(t.y,e.y,n.y)}function Qa(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?C(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?C(n,t,s.max):Math.min(t,n)),t}function Bn(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function tl(t,{top:e,left:n,bottom:s,right:i}){return{x:Bn(t.x,n,i),y:Bn(t.y,e,s)}}function kn(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function el(t,e){return{x:kn(t.x,e.x),y:kn(t.y,e.y)}}function nl(t,e){let n=.5;const s=j(t),i=j(e);return i>s?n=Tt(e.min,e.max-s,t.min):s>i&&(n=Tt(t.min,t.max-i,e.min)),H(0,1,n)}function sl(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Te=.35;function il(t=Te){return t===!1?t=0:t===!0&&(t=Te),{x:jn(t,"left","right"),y:jn(t,"top","bottom")}}function jn(t,e,n){return{min:In(t,e),max:In(t,n)}}function In(t,e){return typeof t=="number"?t:t[e]||0}const On=()=>({translate:0,scale:1,origin:0,originPoint:0}),at=()=>({x:On(),y:On()}),Nn=()=>({min:0,max:0}),R=()=>({x:Nn(),y:Nn()});function N(t){return[t("x"),t("y")]}function bi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function ol({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function rl(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function re(t){return t===void 0||t===1}function Pe({scale:t,scaleX:e,scaleY:n}){return!re(t)||!re(e)||!re(n)}function Q(t){return Pe(t)||Ci(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ci(t){return Un(t.x)||Un(t.y)}function Un(t){return t&&t!=="0%"}function Wt(t,e,n){const s=t-n,i=e*s;return n+i}function _n(t,e,n,s,i){return i!==void 0&&(t=Wt(t,i,s)),Wt(t,n,s)+e}function Se(t,e=0,n=1,s,i){t.min=_n(t.min,e,n,s,i),t.max=_n(t.max,e,n,s,i)}function Di(t,{x:e,y:n}){Se(t.x,e.translate,e.scale,e.originPoint),Se(t.y,n.translate,n.scale,n.originPoint)}const Kn=.999999999999,Wn=1.0000000000001;function al(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&ut(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Di(t,o)),s&&Q(r.latestValues)&&ut(t,r.latestValues))}e.x<Wn&&e.x>Kn&&(e.x=1),e.y<Wn&&e.y>Kn&&(e.y=1)}function lt(t,e){t.min=t.min+e,t.max=t.max+e}function Gn(t,e,n,s,i=.5){const r=C(t.min,t.max,i);Se(t,e,n,r,s)}function ut(t,e){Gn(t.x,e.x,e.scaleX,e.scale,e.originX),Gn(t.y,e.y,e.scaleY,e.scale,e.originY)}function Mi(t,e){return bi(rl(t.getBoundingClientRect(),e))}function ll(t,e,n){const s=Mi(t,n),{scroll:i}=e;return i&&(lt(s.x,i.offset.x),lt(s.y,i.offset.y)),s}const Ri=({current:t})=>t?t.ownerDocument.defaultView:null,ul=new WeakMap;class cl{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=R(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Rt(c).point)},r=(c,h)=>{const{drag:f,dragPropagation:d,onDragStart:p}=this.getProps();if(f&&!d&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Zi(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),N(y=>{let g=this.getAxisMotionValue(y).get()||0;if(K.test(g)){const{projection:T}=this.visualElement;if(T&&T.layout){const P=T.layout.layoutBox[y];P&&(g=j(P)*(parseFloat(g)/100))}}this.originPoint[y]=g}),p&&b.postRender(()=>p(c,h)),fe(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(c,h)=>{const{dragPropagation:f,dragDirectionLock:d,onDirectionLock:p,onDrag:m}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:y}=h;if(d&&this.currentDirection===null){this.currentDirection=hl(y),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),m&&m(c,h)},a=(c,h)=>this.stop(c,h),l=()=>N(c=>{var h;return this.getAnimationState(c)==="paused"&&((h=this.getAxisMotionValue(c).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Si(e,{onSessionStart:i,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Ri(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:r}=this.getProps();r&&b.postRender(()=>r(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Bt(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=Qa(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,r=this.constraints;n&&ot(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=tl(i.layoutBox,n):this.constraints=!1,this.elastic=il(s),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&N(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=sl(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ot(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=ll(s,i.root,this.visualElement.getTransformPagePoint());let o=el(i.layout.layoutBox,r);if(n){const a=n(ol(o));this.hasMutatedConstraints=!!a,a&&(o=bi(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=N(c=>{if(!Bt(c,n,this.currentDirection))return;let h=l&&l[c]||{};o&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return fe(this.visualElement,e),s.start(tn(e,s,0,n,this.visualElement,!1))}stopAnimation(){N(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){N(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){N(n=>{const{drag:s}=this.getProps();if(!Bt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];r.set(e[n]-C(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!ot(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};N(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=nl({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),N(o=>{if(!Bt(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(C(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;ul.set(this.visualElement,this);const e=this.visualElement.current,n=yt(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();ot(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),b.read(s);const o=bt(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(N(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())}));return()=>{o(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Te,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Bt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function hl(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class fl extends Z{constructor(e){super(e),this.removeGroupControls=U,this.removeListeners=U,this.controls=new cl(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||U}unmount(){this.removeGroupControls(),this.removeListeners()}}const $n=t=>(e,n)=>{t&&b.postRender(()=>t(e,n))};class dl extends Z{constructor(){super(...arguments),this.removePointerDownListener=U}onPointerDown(e){this.session=new Si(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ri(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:$n(e),onStart:$n(n),onMove:s,onEnd:(r,o)=>{delete this.session,i&&b.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=yt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const It={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function zn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const pt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(S.test(t))t=parseFloat(t);else return t;const n=zn(t,e.target.x),s=zn(t,e.target.y);return`${n}% ${s}%`}},pl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=q.parse(t);if(i.length>5)return s;const r=q.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=C(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}};class ml extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;Ho(gl),r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),It.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,o=s.projection;return o&&(o.isPresent=r,i||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||b.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Fe.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ei(t){const[e,n]=Ps(),s=v.useContext(Pt);return _.jsx(ml,{...t,layoutGroup:s,switchLayoutGroup:v.useContext(Ds),isPresent:e,safeToRemove:n})}const gl={borderRadius:{...pt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:pt,borderTopRightRadius:pt,borderBottomLeftRadius:pt,borderBottomRightRadius:pt,boxShadow:pl};function yl(t,e,n){const s=B(t)?t:wt(t);return s.start(tn("",s,e,n)),s.animation}function vl(t){return t instanceof SVGElement&&t.tagName!=="svg"}const xl=(t,e)=>t.depth-e.depth;class Tl{constructor(){this.children=[],this.isDirty=!1}add(e){We(this.children,e),this.isDirty=!0}remove(e){Ge(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(xl),this.isDirty=!1,this.children.forEach(e)}}function Pl(t,e){const n=W.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(Y(s),t(r-e))};return b.read(s,!0),()=>Y(s)}const Li=["TopLeft","TopRight","BottomLeft","BottomRight"],Sl=Li.length,Hn=t=>typeof t=="string"?parseFloat(t):t,Xn=t=>typeof t=="number"||S.test(t);function Al(t,e,n,s,i,r){i?(t.opacity=C(0,n.opacity!==void 0?n.opacity:1,wl(s)),t.opacityExit=C(e.opacity!==void 0?e.opacity:1,0,Vl(s))):r&&(t.opacity=C(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let o=0;o<Sl;o++){const a=`border${Li[o]}Radius`;let l=Yn(e,a),u=Yn(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Xn(l)===Xn(u)?(t[a]=Math.max(C(Hn(l),Hn(u),s),0),(K.test(u)||K.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=C(e.rotate||0,n.rotate||0,s))}function Yn(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const wl=Fi(0,.5,Zs),Vl=Fi(.5,.95,U);function Fi(t,e,n){return s=>s<t?0:s>e?1:n(Tt(t,e,s))}function qn(t,e){t.min=e.min,t.max=e.max}function O(t,e){qn(t.x,e.x),qn(t.y,e.y)}function Zn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Jn(t,e,n,s,i){return t-=e,t=Wt(t,1/n,s),i!==void 0&&(t=Wt(t,1/i,s)),t}function bl(t,e=0,n=1,s=.5,i,r=t,o=t){if(K.test(e)&&(e=parseFloat(e),e=C(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=C(r.min,r.max,s);t===r&&(a-=e),t.min=Jn(t.min,e,n,a,i),t.max=Jn(t.max,e,n,a,i)}function Qn(t,e,[n,s,i],r,o){bl(t,e[n],e[s],e[i],e.scale,r,o)}const Cl=["x","scaleX","originX"],Dl=["y","scaleY","originY"];function ts(t,e,n,s){Qn(t.x,e,Cl,n?n.x:void 0,s?s.x:void 0),Qn(t.y,e,Dl,n?n.y:void 0,s?s.y:void 0)}function es(t){return t.translate===0&&t.scale===1}function Bi(t){return es(t.x)&&es(t.y)}function ns(t,e){return t.min===e.min&&t.max===e.max}function Ml(t,e){return ns(t.x,e.x)&&ns(t.y,e.y)}function ss(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function ki(t,e){return ss(t.x,e.x)&&ss(t.y,e.y)}function is(t){return j(t.x)/j(t.y)}function os(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Rl{constructor(){this.members=[]}add(e){We(this.members,e),e.scheduleRender()}remove(e){if(Ge(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function El(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const tt={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},mt=typeof window<"u"&&window.MotionDebug!==void 0,ae=["","X","Y","Z"],Ll={visibility:"hidden"},rs=1e3;let Fl=0;function le(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function ji(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Gs(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",b,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&ji(s)}function Ii({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Fl++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,mt&&(tt.totalNodes=tt.resolvedTargetDeltas=tt.recalculatedProjection=0),this.nodes.forEach(jl),this.nodes.forEach(_l),this.nodes.forEach(Kl),this.nodes.forEach(Il),mt&&window.MotionDebug.record(tt)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Tl)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new $e),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=vl(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let h;const f=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=Pl(f,250),It.hasAnimatedSinceResize&&(It.hasAnimatedSinceResize=!1,this.nodes.forEach(ls))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:f,hasRelativeTargetChanged:d,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||Hl,{onLayoutAnimationStart:y,onLayoutAnimationComplete:g}=c.getProps(),T=!this.targetLayout||!ki(this.targetLayout,p)||d,P=!f&&d;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||P||f&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,P);const w={...Ve(m,"layout"),onPlay:y,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else f||ls(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Y(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(Wl),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ji(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(as);return}this.isUpdating||this.nodes.forEach(Nl),this.isUpdating=!1,this.nodes.forEach(Ul),this.nodes.forEach(Bl),this.nodes.forEach(kl),this.clearAllSnapshots();const a=W.now();E.delta=H(0,1e3/60,a-E.timestamp),E.timestamp=a,E.isProcessing=!0,Qt.update.process(E),Qt.preRender.process(E),Qt.render.process(E),E.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fe.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ol),this.sharedNodes.forEach(Gl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,b.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){b.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=R(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Bi(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||Q(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Xl(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return R();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(Yl))){const{scroll:c}=this.root;c&&(lt(l.x,c.offset.x),lt(l.y,c.offset.y))}return l}removeElementScroll(o){var a;const l=R();if(O(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:f}=c;c!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&O(l,o),lt(l.x,h.offset.x),lt(l.y,h.offset.y))}return l}applyTransform(o,a=!1){const l=R();O(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&ut(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Q(c.latestValues)&&ut(l,c.latestValues)}return Q(this.latestValues)&&ut(l,this.latestValues),l}removeTransform(o){const a=R();O(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Q(u.latestValues))continue;Pe(u.latestValues)&&u.updateSnapshot();const c=R(),h=u.measurePageBox();O(c,h),ts(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Q(this.latestValues)&&ts(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==E.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:f}=this.options;if(!(!this.layout||!(h||f))){if(this.resolvedRelativeTargetAt=E.timestamp,!this.targetDelta&&!this.relativeTarget){const d=this.getClosestProjectingParent();d&&d.layout&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=R(),this.relativeTargetOrigin=R(),xt(this.relativeTargetOrigin,this.layout.layoutBox,d.layout.layoutBox),O(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=R(),this.targetWithTransforms=R()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ja(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):O(this.target,this.layout.layoutBox),Di(this.target,this.targetDelta)):O(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const d=this.getClosestProjectingParent();d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=R(),this.relativeTargetOrigin=R(),xt(this.relativeTargetOrigin,this.target,d.target),O(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}mt&&tt.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Pe(this.parent.latestValues)||Ci(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===E.timestamp&&(u=!1),u)return;const{layout:c,layoutId:h}=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||h))return;O(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;al(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=R());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Zn(this.prevProjectionDelta.x,this.projectionDelta.x),Zn(this.prevProjectionDelta.y,this.projectionDelta.y)),vt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!os(this.projectionDelta.x,this.prevProjectionDelta.x)||!os(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),mt&&tt.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=at(),this.projectionDelta=at(),this.projectionDeltaWithTransform=at()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=at();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=R(),d=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=d!==p,y=this.getStack(),g=!y||y.members.length<=1,T=!!(m&&!g&&this.options.crossfade===!0&&!this.path.some(zl));this.animationProgress=0;let P;this.mixTargetDelta=w=>{const x=w/1e3;us(h.x,o.x,x),us(h.y,o.y,x),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),$l(this.relativeTarget,this.relativeTargetOrigin,f,x),P&&Ml(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=R()),O(P,this.relativeTarget)),m&&(this.animationValues=c,Al(c,u,this.latestValues,x,T,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=x},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Y(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=b.update(()=>{It.hasAnimatedSinceResize=!0,this.currentAnimation=yl(0,rs,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(rs),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Oi(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||R();const h=j(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=j(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}O(a,l),ut(a,c),vt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Rl),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&le("z",o,u,this.animationValues);for(let c=0;c<ae.length;c++)le(`rotate${ae[c]}`,o,u,this.animationValues),le(`skew${ae[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Ll;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=kt(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=kt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Q(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const f=h.animationValues||h.latestValues;this.applyTransformsToTarget(),u.transform=El(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:d,y:p}=this.projectionDelta;u.transformOrigin=`${d.origin*100}% ${p.origin*100}% 0`,h.animationValues?u.opacity=h===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=h===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const m in Nt){if(f[m]===void 0)continue;const{correct:y,applyTo:g}=Nt[m],T=u.transform==="none"?f[m]:y(f[m],h);if(g){const P=g.length;for(let w=0;w<P;w++)u[g[w]]=T}else u[m]=T}return this.options.layoutId&&(u.pointerEvents=h===this?kt(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(as),this.root.sharedNodes.clear()}}}function Bl(t){t.updateLayout()}function kl(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:r}=t.options,o=n.source!==t.layout.source;r==="size"?N(h=>{const f=o?n.measuredBox[h]:n.layoutBox[h],d=j(f);f.min=s[h].min,f.max=f.min+d}):Oi(r,n.layoutBox,s)&&N(h=>{const f=o?n.measuredBox[h]:n.layoutBox[h],d=j(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=at();vt(a,s,n.layoutBox);const l=at();o?vt(l,t.applyTransform(i,!0),n.measuredBox):vt(l,s,n.layoutBox);const u=!Bi(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const p=R();xt(p,n.layoutBox,f.layoutBox);const m=R();xt(m,s,d.layoutBox),ki(p,m)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function jl(t){mt&&tt.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Il(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ol(t){t.clearSnapshot()}function as(t){t.clearMeasurements()}function Nl(t){t.isLayoutDirty=!1}function Ul(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ls(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function _l(t){t.resolveTargetDelta()}function Kl(t){t.calcProjection()}function Wl(t){t.resetSkewAndRotation()}function Gl(t){t.removeLeadSnapshot()}function us(t,e,n){t.translate=C(e.translate,0,n),t.scale=C(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function cs(t,e,n,s){t.min=C(e.min,n.min,s),t.max=C(e.max,n.max,s)}function $l(t,e,n,s){cs(t.x,e.x,n.x,s),cs(t.y,e.y,n.y,s)}function zl(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Hl={duration:.45,ease:[.4,0,.1,1]},hs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),fs=hs("applewebkit/")&&!hs("chrome/")?Math.round:U;function ds(t){t.min=fs(t.min),t.max=fs(t.max)}function Xl(t){ds(t.x),ds(t.y)}function Oi(t,e,n){return t==="position"||t==="preserve-aspect"&&!Za(is(e),is(n),.2)}function Yl(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const ql=Ii({attachResizeListener:(t,e)=>bt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ue={current:void 0},Ni=Ii({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ue.current){const t=new ql({});t.mount(window),t.setOptions({layoutScroll:!0}),ue.current=t}return ue.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Zl={pan:{Feature:dl},drag:{Feature:fl,ProjectionNode:Ni,MeasureLayout:Ei}};function ps(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&b.postRender(()=>r(e,Rt(e)))}class Jl extends Z{mount(){const{current:e}=this.node;e&&(this.unmount=Ji(e,n=>(ps(this.node,n,"Start"),s=>ps(this.node,s,"End"))))}unmount(){}}class Ql extends Z{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=Mt(bt(this.node.current,"focus",()=>this.onFocus()),bt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ms(t,e,n){const{props:s}=t;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&b.postRender(()=>r(e,Rt(e)))}class tu extends Z{mount(){const{current:e}=this.node;e&&(this.unmount=Qi(e,n=>(ms(this.node,n,"Start"),(s,{success:i})=>ms(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ae=new WeakMap,ce=new WeakMap,eu=t=>{const e=Ae.get(t.target);e&&e(t)},nu=t=>{t.forEach(eu)};function su({root:t,...e}){const n=t||document;ce.has(n)||ce.set(n,{});const s=ce.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(nu,{root:t,...e})),s[i]}function iu(t,e,n){const s=su(e);return Ae.set(t,n),s.observe(t),()=>{Ae.delete(t),s.unobserve(t)}}const ou={some:0,all:1};class ru extends Z{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:ou[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return iu(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(au(e,n))&&this.startObserver()}unmount(){}}function au({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const lu={inView:{Feature:ru},tap:{Feature:tu},focus:{Feature:Ql},hover:{Feature:Jl}},uu={layout:{ProjectionNode:Ni,MeasureLayout:Ei}},Gt={current:null},en={current:!1};function Ui(){if(en.current=!0,!!De)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Gt.current=t.matches;t.addListener(e),e()}else Gt.current=!1}const cu=[...hi,F,q],hu=t=>cu.find(ci(t)),gs=new WeakMap;function fu(t,e,n){for(const s in e){const i=e[s],r=n[s];if(B(i))t.addValue(s,i);else if(B(r))t.addValue(s,wt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,wt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const ys=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class du{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ze,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=W.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,b.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:c}=o;this.onUpdate=c,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=Xt(n),this.isVariantNode=bs(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const p=f[d];l[d]!==void 0&&B(p)&&p.set(l[d],!1)}}mount(e){this.current=e,gs.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),en.current||Ui(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Gt.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){gs.delete(this.current),this.projection&&this.projection.unmount(),Y(this.notifyUpdate),Y(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=st.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&b.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ct){const n=ct[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):R()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<ys.length;s++){const i=ys[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=fu(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=wt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){var s;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(s=this.getBaseTargetFromProps(this.props,e))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(li(i)||Qs(i))?i=parseFloat(i):!hu(i)&&q.test(n)&&(i=oi(e,n)),this.setBaseTarget(e,B(i)?i.get():i)),B(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=ke(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[e])}if(s&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!B(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new $e),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class _i extends du{constructor(){super(...arguments),this.KeyframeResolver=fi}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;B(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function pu(t){return window.getComputedStyle(t)}class mu extends _i{constructor(){super(...arguments),this.type="html",this.renderInstance=ks}readValueFromInstance(e,n){if(st.has(n)){const s=qe(n);return s&&s.default||0}else{const s=pu(e),i=(Ls(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Mi(e,n)}build(e,n,s){Oe(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Ke(e,n,s)}}class gu extends _i{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=R}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(st.has(n)){const s=qe(n);return s&&s.default||0}return n=js.has(n)?n:Le(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Ns(e,n,s)}build(e,n,s){Ne(e,n,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,s,i){Is(e,n,s,i)}mount(e){this.isSVGTag=_e(e.tagName),super.mount(e)}}const yu=(t,e)=>Be(t)?new gu(e):new mu(e,{allowProjection:t!==v.Fragment}),vu=nr({...Ka,...lu,...Zl,...uu},yu),bu=yo(vu);function Cu(){!en.current&&Ui();const[t]=v.useState(Gt.current);return t}export{Au as A,wu as L,bu as m,Cu as u};
@@ -0,0 +1 @@
1
+ var z={exports:{}},K={};var Y;function le(){return Y||(Y=1,(function(e){function n(t,i){var a=t.length;t.push(i);e:for(;0<a;){var l=a-1>>>1,f=t[l];if(0<o(f,i))t[l]=i,t[a]=f,a=l;else break e}}function r(t){return t.length===0?null:t[0]}function s(t){if(t.length===0)return null;var i=t[0],a=t.pop();if(a!==i){t[0]=a;e:for(var l=0,f=t.length,S=f>>>1;l<S;){var E=2*(l+1)-1,R=t[E],w=E+1,G=t[w];if(0>o(R,a))w<f&&0>o(G,R)?(t[l]=G,t[w]=a,l=w):(t[l]=R,t[E]=a,l=E);else if(w<f&&0>o(G,a))t[l]=G,t[w]=a,l=w;else break e}}return i}function o(t,i){var a=t.sortIndex-i.sortIndex;return a!==0?a:t.id-i.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;e.unstable_now=function(){return d.now()}}else{var T=Date,h=T.now();e.unstable_now=function(){return T.now()-h}}var u=[],m=[],g=1,p=null,c=3,y=!1,b=!1,P=!1,j=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function B(t){for(var i=r(m);i!==null;){if(i.callback===null)s(m);else if(i.startTime<=t)s(m),i.sortIndex=i.expirationTime,n(u,i);else break;i=r(m)}}function D(t){if(P=!1,B(t),!b)if(r(u)!==null)b=!0,q(M);else{var i=r(m);i!==null&&F(D,i.startTime-t)}}function M(t,i){b=!1,P&&(P=!1,x(A),A=-1),y=!0;var a=c;try{for(B(i),p=r(u);p!==null&&(!(p.expirationTime>i)||t&&!Q());){var l=p.callback;if(typeof l=="function"){p.callback=null,c=p.priorityLevel;var f=l(p.expirationTime<=i);i=e.unstable_now(),typeof f=="function"?p.callback=f:p===r(u)&&s(u),B(i)}else s(u);p=r(u)}if(p!==null)var S=!0;else{var E=r(m);E!==null&&F(D,E.startTime-i),S=!1}return S}finally{p=null,c=a,y=!1}}var I=!1,C=null,A=-1,V=5,J=-1;function Q(){return!(e.unstable_now()-J<V)}function N(){if(C!==null){var t=e.unstable_now();J=t;var i=!0;try{i=C(!0,t)}finally{i?_():(I=!1,C=null)}}else I=!1}var _;if(typeof H=="function")_=function(){H(N)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,ue=X.port2;X.port1.onmessage=N,_=function(){ue.postMessage(null)}}else _=function(){j(N,0)};function q(t){C=t,I||(I=!0,_())}function F(t,i){A=j(function(){t(e.unstable_now())},i)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(t){t.callback=null},e.unstable_continueExecution=function(){b||y||(b=!0,q(M))},e.unstable_forceFrameRate=function(t){0>t||125<t||(V=0<t?Math.floor(1e3/t):5)},e.unstable_getCurrentPriorityLevel=function(){return c},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(t){switch(c){case 1:case 2:case 3:var i=3;break;default:i=c}var a=c;c=i;try{return t()}finally{c=a}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(t,i){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var a=c;c=t;try{return i()}finally{c=a}},e.unstable_scheduleCallback=function(t,i,a){var l=e.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?l+a:l):a=l,t){case 1:var f=-1;break;case 2:f=250;break;case 5:f=1073741823;break;case 4:f=1e4;break;default:f=5e3}return f=a+f,t={id:g++,callback:i,priorityLevel:t,startTime:a,expirationTime:f,sortIndex:-1},a>l?(t.sortIndex=a,n(m,t),r(u)===null&&t===r(m)&&(P?(x(A),A=-1):P=!0,F(D,a-l))):(t.sortIndex=f,n(u,t),b||y||(b=!0,q(M))),t},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(t){var i=c;return function(){var a=c;c=i;try{return t.apply(this,arguments)}finally{c=a}}}})(K)),K}var Z;function Ae(){return Z||(Z=1,z.exports=le()),z.exports}const ce=e=>e;let _e=ce;function re(e){let n;return()=>(n===void 0&&(n=e()),n)}const fe=(e,n,r)=>{const s=n-e;return s===0?1:(r-e)/s},ke=e=>e*1e3,Le=e=>e/1e3,de=re(()=>window.ScrollTimeline!==void 0);class pe{constructor(n){this.stop=()=>this.runAll("stop"),this.animations=n.filter(Boolean)}get finished(){return Promise.all(this.animations.map(n=>"finished"in n?n.finished:n))}getAll(n){return this.animations[0][n]}setAll(n,r){for(let s=0;s<this.animations.length;s++)this.animations[s][n]=r}attachTimeline(n,r){const s=this.animations.map(o=>{if(de()&&o.attachTimeline)return o.attachTimeline(n);if(typeof r=="function")return r(o)});return()=>{s.forEach((o,d)=>{o&&o(),this.animations[d].stop()})}}get time(){return this.getAll("time")}set time(n){this.setAll("time",n)}get speed(){return this.getAll("speed")}set speed(n){this.setAll("speed",n)}get startTime(){return this.getAll("startTime")}get duration(){let n=0;for(let r=0;r<this.animations.length;r++)n=Math.max(n,this.animations[r].duration);return n}runAll(n){this.animations.forEach(r=>r[n]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Ie extends pe{then(n,r){return Promise.all(this.animations).then(n).catch(r)}}function Ce(e,n){return e?e[n]||e.default||e:void 0}const $=2e4;function Se(e){let n=0;const r=50;let s=e.next(n);for(;!s.done&&n<$;)n+=r,s=e.next(n);return n>=$?1/0:n}function Ge(e){return typeof e=="function"}function Be(e,n){e.timeline=n,e.onfinish=null}const ie=e=>Array.isArray(e)&&typeof e[0]=="number",he={linearEasing:void 0};function me(e,n){const r=re(e);return()=>{var s;return(s=he[n])!==null&&s!==void 0?s:r()}}const U=me(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ye=(e,n,r=10)=>{let s="";const o=Math.max(Math.round(n/r),2);for(let d=0;d<o;d++)s+=e(fe(0,o-1,d))+", ";return`linear(${s.substring(0,s.length-2)})`};function ve(e){return!!(typeof e=="function"&&U()||!e||typeof e=="string"&&(e in W||U())||ie(e)||Array.isArray(e)&&e.every(ve))}const k=([e,n,r,s])=>`cubic-bezier(${e}, ${n}, ${r}, ${s})`,W={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:k([0,.65,.55,1]),circOut:k([.55,0,1,.45]),backIn:k([.31,.01,.66,-.59]),backOut:k([.33,1.53,.69,.99])};function be(e,n){if(e)return typeof e=="function"&&U()?ye(e,n):ie(e)?k(e):Array.isArray(e)?e.map(r=>be(r,n)||W.easeOut):W[e]}const v={x:!1,y:!1};function se(){return v.x||v.y}function ge(e,n,r){var s;if(e instanceof Element)return[e];if(typeof e=="string"){let o=document;const d=(s=void 0)!==null&&s!==void 0?s:o.querySelectorAll(e);return d?Array.from(d):[]}return Array.from(e)}function ae(e,n){const r=ge(e),s=new AbortController,o={passive:!0,...n,signal:s.signal};return[r,o,()=>s.abort()]}function ee(e){return n=>{n.pointerType==="touch"||se()||e(n)}}function De(e,n,r={}){const[s,o,d]=ae(e,r),T=ee(h=>{const{target:u}=h,m=n(h);if(typeof m!="function"||!u)return;const g=ee(p=>{m(p),u.removeEventListener("pointerleave",g)});u.addEventListener("pointerleave",g,o)});return s.forEach(h=>{h.addEventListener("pointerenter",T,o)}),d}const oe=(e,n)=>n?e===n?!0:oe(e,n.parentElement):!1,Ee=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,we=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Te(e){return we.has(e.tagName)||e.tabIndex!==-1}const L=new WeakSet;function ne(e){return n=>{n.key==="Enter"&&e(n)}}function O(e,n){e.dispatchEvent(new PointerEvent("pointer"+n,{isPrimary:!0,bubbles:!0}))}const Pe=(e,n)=>{const r=e.currentTarget;if(!r)return;const s=ne(()=>{if(L.has(r))return;O(r,"down");const o=ne(()=>{O(r,"up")}),d=()=>O(r,"cancel");r.addEventListener("keyup",o,n),r.addEventListener("blur",d,n)});r.addEventListener("keydown",s,n),r.addEventListener("blur",()=>r.removeEventListener("keydown",s),n)};function te(e){return Ee(e)&&!se()}function Me(e,n,r={}){const[s,o,d]=ae(e,r),T=h=>{const u=h.currentTarget;if(!te(h)||L.has(u))return;L.add(u);const m=n(h),g=(y,b)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",c),!(!te(y)||!L.has(u))&&(L.delete(u),typeof m=="function"&&m(y,{success:b}))},p=y=>{g(y,r.useGlobalTarget||oe(u,y.target))},c=y=>{g(y,!1)};window.addEventListener("pointerup",p,o),window.addEventListener("pointercancel",c,o)};return s.forEach(h=>{!Te(h)&&h.getAttribute("tabindex")===null&&(h.tabIndex=0),(r.useGlobalTarget?window:h).addEventListener("pointerdown",T,o),h.addEventListener("focus",m=>Pe(m,o),o)}),d}function Ne(e){return e==="x"||e==="y"?v[e]?null:(v[e]=!0,()=>{v[e]=!1}):v.x||v.y?null:(v.x=v.y=!0,()=>{v.x=v.y=!1})}export{Ie as G,$ as a,ie as b,Se as c,_e as d,be as e,re as f,ye as g,U as h,Ge as i,Be as j,ve as k,Ce as l,Le as m,ce as n,Ee as o,fe as p,Ne as q,Ae as r,ke as s,De as t,Me as u};
@@ -0,0 +1 @@
1
+ import{r as o,j as e}from"./BqukHQH-.js";import{r as P,P as T,c as C,g as D,h as K,a as _}from"./X6IcjS74.js";import"./C-KIc3Wc.js";import"./Cpr7n8fE.js";import"./CE5pVdev.js";const O=/^[0-9a-f-]{20,}$/i;function X(h){if(h.runId)return h.runId;const t=h.metadata;if(!t)return null;const u=["runId","run_id","sessionId","session_id","agentRunId"];for(const p of u){const c=t[p];if(typeof c=="string"&&c.trim().length>0)return c.trim()}return null}const ee=o.memo(function({session:t,activity:u,initiatives:p=[],onContinueHighestPriority:c,onDispatchSession:b,onPauseSession:g,onResumeSession:f,onCancelSession:w,onCreateCheckpoint:j,onRollbackSession:v,onStartInitiative:B,onStartWorkstream:N}){const[i,L]=o.useState(null),[y,E]=o.useState(null),[m,q]=o.useState(!1),x=o.useMemo(()=>t?u.filter(r=>X(r)===t.runId).sort((r,l)=>Date.parse(l.timestamp)-Date.parse(r.timestamp)).slice(0,8):[],[u,t]),A=o.useMemo(()=>{var n;if(!t)return[];const r=[],l=t.initiativeId??t.groupId;if(l){const a=p.find(M=>M.id===l);a?r.push({label:"Initiative",value:a.name}):t.groupLabel&&t.groupLabel.trim().length>0&&r.push({label:"Initiative",value:t.groupLabel})}if(t.workstreamId){let a=null;for(const M of p){const U=(n=M.workstreams)==null?void 0:n.find(J=>J.id===t.workstreamId);if(U){a=U.name;break}}!a&&!O.test(t.workstreamId)&&(a=t.workstreamId),a&&r.push({label:"Workstream",value:a})}const d=t.phase??null;return d&&r.push({label:"Milestone",value:String(d)}),t.title&&r.push({label:"Task",value:t.title}),r},[p,t]),k=o.useMemo(()=>{var n,a;if(!t)return null;const r=((n=x[0])==null?void 0:n.summary)??((a=x[0])==null?void 0:a.description)??null,d=t.lastEventSummary??r??null;return d&&d.trim().length>0?d.trim():null},[x,t]),R=o.useMemo(()=>{var r;return t?P(t.agentName,t.title,t.lastEventSummary,k,(r=x[0])==null?void 0:r.metadata):P()},[x,t,k]),s=async(r,l,d)=>{if(!(!d||i)){L(r),E(null);try{await d(),E(`${l} requested.`)}catch(n){E(n instanceof Error?n.message:`${l} failed.`)}finally{L(null)}}};if(!t)return e.jsxs(T,{className:"flex h-full min-h-0 flex-col card-enter",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-white/[0.06] px-4 py-3.5",children:[e.jsx("h2",{className:"text-[14px] font-semibold text-white",children:"Session Detail"}),e.jsx("button",{onClick:()=>q(r=>!r),className:"text-white/40 transition-colors hover:text-white/70","aria-label":m?"Expand session detail":"Collapse session detail",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:C("transition-transform",m?"-rotate-90":"rotate-0"),children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),e.jsx("div",{className:C("transition-all",m?"max-h-0 overflow-hidden":"min-h-0 flex-1"),children:e.jsxs("div",{className:"space-y-2 overflow-y-auto p-4 text-[12px] text-white/45",children:[e.jsx("p",{children:"Select a session to inspect summary, breadcrumbs, blockers, and recent messages."}),e.jsx("button",{onClick:()=>s("continue-priority","Continue highest priority",c),disabled:!c||!!i,className:"rounded-md border border-white/[0.12] bg-white/[0.04] px-3 py-1.5 text-[11px] text-white/70 transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:i==="continue-priority"?"Dispatching…":"Continue highest priority"}),y&&e.jsx("p",{className:"text-[11px] text-white/55",children:y})]})})]});const $=t.progress===null?null:Math.round(t.progress),I=t.status.toLowerCase(),z=["running","active","queued","pending"].includes(I),Q=["paused","blocked","queued","pending"].includes(I),V=!["completed","archived","cancelled"].includes(I),F=!["archived","cancelled"].includes(I),G=[{label:"Started",value:t.startedAt?D(t.startedAt):"—"},{label:"Updated",value:t.updatedAt?D(t.updatedAt):"—"},{label:"ETA",value:t.eta??"—"},{label:"Checkpoints",value:t.checkpointCount!==null&&t.checkpointCount!==void 0?String(t.checkpointCount):"—"}];return e.jsxs(T,{className:"flex h-full min-h-0 flex-col card-enter",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-white/[0.06] px-4 py-3.5",children:[e.jsx("h2",{className:"text-[14px] font-semibold text-white",children:"Session Detail"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"chip text-[11px] uppercase",children:t.status}),e.jsx("button",{onClick:()=>q(r=>!r),className:"text-white/40 transition-colors hover:text-white/70","aria-label":m?"Expand session detail":"Collapse session detail",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:C("transition-transform",m?"-rotate-90":"rotate-0"),children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]}),e.jsx("div",{className:C("transition-all",m?"max-h-0 overflow-hidden":"min-h-0 flex-1"),children:e.jsxs("div",{className:"space-y-3 overflow-y-auto p-4",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(K,{provider:R.id,size:"sm"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-[13px] font-medium text-white",children:t.title}),e.jsxs("p",{className:"mt-0.5 text-[11px] text-white/45",children:[t.agentName??"Unassigned"," · ",R.label]})]})]}),A.length>0&&e.jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] p-2.5",children:[e.jsx("p",{className:"mb-1.5 text-[10px] uppercase tracking-[0.1em] text-white/35",children:"Breadcrumb"}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5 text-[11px]",children:A.map((r,l)=>e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{className:"rounded-full border border-white/[0.12] bg-white/[0.02] px-1.5 py-0.5 text-white/65",children:r.value}),l<A.length-1&&e.jsx("span",{className:"text-[11px] text-white/40",children:"›"})]},`${r.label}-${r.value}`))})]}),k&&e.jsx("p",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] px-3 py-2 text-[12px] leading-relaxed text-white/65",children:k}),$!==null&&e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between text-[11px] text-white/55",children:[e.jsx("span",{children:"Progress"}),e.jsxs("span",{children:[$,"%"]})]}),e.jsx("div",{className:"h-2 rounded-full bg-white/[0.08]",children:e.jsx("div",{className:"h-2 rounded-full",style:{width:`${$}%`,background:`linear-gradient(90deg, ${_.lime}, ${_.teal})`}})})]}),e.jsx("dl",{className:"grid grid-cols-1 gap-1 text-[11px] text-white/55 sm:grid-cols-2",children:G.map(r=>e.jsxs("div",{children:[e.jsx("dt",{className:"text-white/35",children:r.label}),e.jsx("dd",{className:"font-medium",children:r.value})]},r.label))}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-[0.12em] text-white/40",children:"Quick actions"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("button",{onClick:()=>s("continue-priority","Continue highest priority",c),disabled:!c||!!i,className:"rounded-md border border-white/[0.12] bg-white/[0.03] px-3 py-2 text-[11px] text-white/75 transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:i==="continue-priority"?"Dispatching…":"Continue Priority"}),e.jsx("button",{onClick:()=>s("dispatch-session","Dispatch session",()=>b==null?void 0:b(t)),disabled:!b||!!i,className:"rounded-md border border-lime/25 bg-lime/10 px-3 py-2 text-[11px] font-semibold text-lime transition-colors hover:bg-lime/20 disabled:opacity-45",children:i==="dispatch-session"?"Dispatching…":"Dispatch Session"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-[0.12em] text-white/40",children:"Session controls"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("button",{onClick:()=>s("pause-session","Pause session",()=>g==null?void 0:g(t)),disabled:!g||!z||!!i,className:"rounded-md border border-amber-400/30 bg-amber-400/10 px-3 py-2 text-[11px] font-semibold text-amber-300 transition-colors hover:bg-amber-400/20 disabled:opacity-45",children:i==="pause-session"?"Pausing…":"Pause"}),e.jsx("button",{onClick:()=>s("resume-session","Resume session",()=>f==null?void 0:f(t)),disabled:!f||!Q||!!i,className:"rounded-md border border-lime/25 bg-lime/10 px-3 py-2 text-[11px] font-semibold text-lime transition-colors hover:bg-lime/20 disabled:opacity-45",children:i==="resume-session"?"Resuming…":"Resume"}),e.jsx("button",{onClick:()=>s("checkpoint-session","Checkpoint created",()=>j==null?void 0:j(t)),disabled:!j||!!i,className:"rounded-md border border-sky-400/30 bg-sky-400/10 px-3 py-2 text-[11px] font-semibold text-sky-300 transition-colors hover:bg-sky-400/20 disabled:opacity-45",children:i==="checkpoint-session"?"Creating…":"Checkpoint"}),e.jsx("button",{onClick:()=>s("rollback-session","Rollback requested",()=>v==null?void 0:v(t)),disabled:!v||!F||!!i,className:"rounded-md border border-fuchsia-400/30 bg-fuchsia-400/10 px-3 py-2 text-[11px] font-semibold text-fuchsia-300 transition-colors hover:bg-fuchsia-400/20 disabled:opacity-45",children:i==="rollback-session"?"Rolling back…":"Rollback"}),e.jsx("button",{onClick:()=>s("cancel-session","Cancel session",()=>w==null?void 0:w(t)),disabled:!w||!V||!!i,className:"col-span-2 rounded-md border border-red-400/30 bg-red-400/10 px-3 py-2 text-[11px] font-semibold text-red-300 transition-colors hover:bg-red-400/20 disabled:opacity-45",children:i==="cancel-session"?"Cancelling…":"Cancel session"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-[0.12em] text-white/40",children:"Planning"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("button",{onClick:()=>s("start-initiative","Start initiative",B),disabled:!B||!!i,className:"rounded-md border border-white/[0.12] bg-white/[0.03] px-3 py-2 text-[11px] text-white/75 transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:i==="start-initiative"?"Creating…":"New initiative"}),e.jsx("button",{onClick:()=>s("start-workstream","Start workstream",()=>N==null?void 0:N(t.initiativeId)),disabled:!N||!!i,className:"rounded-md border border-white/[0.12] bg-white/[0.03] px-3 py-2 text-[11px] text-white/75 transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:i==="start-workstream"?"Creating…":"New workstream"})]})]})]}),y&&e.jsx("p",{className:"rounded-md border border-white/[0.08] bg-white/[0.02] px-2.5 py-1.5 text-[11px] text-white/55",children:y}),t.blockers.length>0&&e.jsxs("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3",children:[e.jsx("h3",{className:"mb-1 text-[11px] uppercase tracking-[0.12em] text-red-200/70",children:"Blockers"}),e.jsx("ul",{className:"space-y-1 text-[12px] text-red-100/90",children:t.blockers.map(r=>e.jsxs("li",{children:["• ",r]},r))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"mb-2 text-[11px] uppercase tracking-[0.12em] text-white/45",children:"Recent Messages"}),x.length===0&&e.jsx("p",{className:"text-[12px] text-white/45",children:"No recent messages for this run."}),e.jsx("div",{className:"space-y-2",children:x.map(r=>e.jsxs("article",{className:"rounded-lg border border-white/[0.06] bg-white/[0.02] px-2.5 py-2",children:[e.jsx("p",{className:"text-[11px] text-white/85",children:r.title}),(r.summary||r.description)&&e.jsx("p",{className:"mt-0.5 line-clamp-2 text-[11px] text-white/55",children:r.summary??r.description}),e.jsxs("p",{className:"mt-1 text-[10px] text-white/35",children:[new Date(r.timestamp).toLocaleString()," · ",D(r.timestamp)]})]},r.id))})]})]})})]})});export{ee as SessionInspector};