@useorgx/openclaw-plugin 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/dashboard/dist/assets/index-BrAP-X_H.css +1 -0
- package/dashboard/dist/assets/index-cOk6qwh-.js +56 -0
- package/dashboard/dist/assets/orgx-logo-QSE5QWy4.png +0 -0
- package/dashboard/dist/brand/anthropic-mark.svg +10 -0
- package/dashboard/dist/brand/control-tower.png +0 -0
- package/dashboard/dist/brand/design-codex.png +0 -0
- package/dashboard/dist/brand/engineering-autopilot.png +0 -0
- package/dashboard/dist/brand/launch-captain.png +0 -0
- package/dashboard/dist/brand/openai-mark.svg +10 -0
- package/dashboard/dist/brand/openclaw-mark.svg +11 -0
- package/dashboard/dist/brand/orgx-logo.png +0 -0
- package/dashboard/dist/brand/pipeline-intelligence.png +0 -0
- package/dashboard/dist/brand/product-orchestrator.png +0 -0
- package/dashboard/dist/index.html +2 -2
- package/dist/api.d.ts +9 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +76 -14
- package/dist/api.js.map +1 -1
- package/dist/auth-store.d.ts +20 -0
- package/dist/auth-store.d.ts.map +1 -0
- package/dist/auth-store.js +128 -0
- package/dist/auth-store.js.map +1 -0
- package/dist/dashboard-api.d.ts +2 -7
- package/dist/dashboard-api.d.ts.map +1 -1
- package/dist/dashboard-api.js +2 -4
- package/dist/dashboard-api.js.map +1 -1
- package/dist/http-handler.d.ts +28 -3
- package/dist/http-handler.d.ts.map +1 -1
- package/dist/http-handler.js +1686 -44
- package/dist/http-handler.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1294 -44
- package/dist/index.js.map +1 -1
- package/dist/local-openclaw.d.ts +87 -0
- package/dist/local-openclaw.d.ts.map +1 -0
- package/dist/local-openclaw.js +774 -0
- package/dist/local-openclaw.js.map +1 -0
- package/dist/openclaw.plugin.json +76 -0
- package/dist/outbox.d.ts +20 -0
- package/dist/outbox.d.ts.map +1 -0
- package/dist/outbox.js +86 -0
- package/dist/outbox.js.map +1 -0
- package/dist/types.d.ts +90 -0
- package/dist/types.d.ts.map +1 -1
- package/openclaw.plugin.json +1 -0
- package/package.json +4 -2
- package/skills/orgx/SKILL.md +180 -0
- package/dashboard/dist/assets/index-C_w24A8p.css +0 -1
- package/dashboard/dist/assets/index-DfkN5JSS.js +0 -48
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var Xp=t=>{throw TypeError(t)};var hc=(t,n,s)=>n.has(t)||Xp("Cannot "+s);var E=(t,n,s)=>(hc(t,n,"read from private field"),s?s.call(t):n.get(t)),we=(t,n,s)=>n.has(t)?Xp("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,s),ce=(t,n,s,o)=>(hc(t,n,"write to private field"),o?o.call(t,s):n.set(t,s),s),Pe=(t,n,s)=>(hc(t,n,"access private method"),s);var Ua=(t,n,s,o)=>({set _(u){ce(t,n,u,s)},get _(){return E(t,n,o)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const h of c.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function s(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(u){if(u.ep)return;u.ep=!0;const c=s(u);fetch(u.href,c)}})();var fc={exports:{}},eo={},pc={exports:{}},De={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Yp;function s1(){if(Yp)return De;Yp=1;var t=Symbol.for("react.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),h=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.iterator;function w(T){return T===null||typeof T!="object"?null:(T=y&&T[y]||T["@@iterator"],typeof T=="function"?T:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,A={};function N(T,L,ge){this.props=T,this.context=L,this.refs=A,this.updater=ge||j}N.prototype.isReactComponent={},N.prototype.setState=function(T,L){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,L,"setState")},N.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function _(){}_.prototype=N.prototype;function B(T,L,ge){this.props=T,this.context=L,this.refs=A,this.updater=ge||j}var W=B.prototype=new _;W.constructor=B,C(W,N.prototype),W.isPureReactComponent=!0;var $=Array.isArray,b=Object.prototype.hasOwnProperty,F={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function D(T,L,ge){var ye,Ce={},Te=null,Ae=null;if(L!=null)for(ye in L.ref!==void 0&&(Ae=L.ref),L.key!==void 0&&(Te=""+L.key),L)b.call(L,ye)&&!U.hasOwnProperty(ye)&&(Ce[ye]=L[ye]);var je=arguments.length-2;if(je===1)Ce.children=ge;else if(1<je){for(var Fe=Array(je),Qe=0;Qe<je;Qe++)Fe[Qe]=arguments[Qe+2];Ce.children=Fe}if(T&&T.defaultProps)for(ye in je=T.defaultProps,je)Ce[ye]===void 0&&(Ce[ye]=je[ye]);return{$$typeof:t,type:T,key:Te,ref:Ae,props:Ce,_owner:F.current}}function O(T,L){return{$$typeof:t,type:T.type,key:L,ref:T.ref,props:T.props,_owner:T._owner}}function G(T){return typeof T=="object"&&T!==null&&T.$$typeof===t}function oe(T){var L={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(ge){return L[ge]})}var K=/\/+/g;function I(T,L){return typeof T=="object"&&T!==null&&T.key!=null?oe(""+T.key):L.toString(36)}function J(T,L,ge,ye,Ce){var Te=typeof T;(Te==="undefined"||Te==="boolean")&&(T=null);var Ae=!1;if(T===null)Ae=!0;else switch(Te){case"string":case"number":Ae=!0;break;case"object":switch(T.$$typeof){case t:case n:Ae=!0}}if(Ae)return Ae=T,Ce=Ce(Ae),T=ye===""?"."+I(Ae,0):ye,$(Ce)?(ge="",T!=null&&(ge=T.replace(K,"$&/")+"/"),J(Ce,L,ge,"",function(Qe){return Qe})):Ce!=null&&(G(Ce)&&(Ce=O(Ce,ge+(!Ce.key||Ae&&Ae.key===Ce.key?"":(""+Ce.key).replace(K,"$&/")+"/")+T)),L.push(Ce)),1;if(Ae=0,ye=ye===""?".":ye+":",$(T))for(var je=0;je<T.length;je++){Te=T[je];var Fe=ye+I(Te,je);Ae+=J(Te,L,ge,Fe,Ce)}else if(Fe=w(T),typeof Fe=="function")for(T=Fe.call(T),je=0;!(Te=T.next()).done;)Te=Te.value,Fe=ye+I(Te,je++),Ae+=J(Te,L,ge,Fe,Ce);else if(Te==="object")throw L=String(T),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.");return Ae}function ne(T,L,ge){if(T==null)return T;var ye=[],Ce=0;return J(T,ye,"","",function(Te){return L.call(ge,Te,Ce++)}),ye}function le(T){if(T._status===-1){var L=T._result;L=L(),L.then(function(ge){(T._status===0||T._status===-1)&&(T._status=1,T._result=ge)},function(ge){(T._status===0||T._status===-1)&&(T._status=2,T._result=ge)}),T._status===-1&&(T._status=0,T._result=L)}if(T._status===1)return T._result.default;throw T._result}var q={current:null},R={transition:null},X={ReactCurrentDispatcher:q,ReactCurrentBatchConfig:R,ReactCurrentOwner:F};function Y(){throw Error("act(...) is not supported in production builds of React.")}return De.Children={map:ne,forEach:function(T,L,ge){ne(T,function(){L.apply(this,arguments)},ge)},count:function(T){var L=0;return ne(T,function(){L++}),L},toArray:function(T){return ne(T,function(L){return L})||[]},only:function(T){if(!G(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},De.Component=N,De.Fragment=s,De.Profiler=u,De.PureComponent=B,De.StrictMode=o,De.Suspense=m,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,De.act=Y,De.cloneElement=function(T,L,ge){if(T==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+T+".");var ye=C({},T.props),Ce=T.key,Te=T.ref,Ae=T._owner;if(L!=null){if(L.ref!==void 0&&(Te=L.ref,Ae=F.current),L.key!==void 0&&(Ce=""+L.key),T.type&&T.type.defaultProps)var je=T.type.defaultProps;for(Fe in L)b.call(L,Fe)&&!U.hasOwnProperty(Fe)&&(ye[Fe]=L[Fe]===void 0&&je!==void 0?je[Fe]:L[Fe])}var Fe=arguments.length-2;if(Fe===1)ye.children=ge;else if(1<Fe){je=Array(Fe);for(var Qe=0;Qe<Fe;Qe++)je[Qe]=arguments[Qe+2];ye.children=je}return{$$typeof:t,type:T.type,key:Ce,ref:Te,props:ye,_owner:Ae}},De.createContext=function(T){return T={$$typeof:h,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},T.Provider={$$typeof:c,_context:T},T.Consumer=T},De.createElement=D,De.createFactory=function(T){var L=D.bind(null,T);return L.type=T,L},De.createRef=function(){return{current:null}},De.forwardRef=function(T){return{$$typeof:f,render:T}},De.isValidElement=G,De.lazy=function(T){return{$$typeof:g,_payload:{_status:-1,_result:T},_init:le}},De.memo=function(T,L){return{$$typeof:x,type:T,compare:L===void 0?null:L}},De.startTransition=function(T){var L=R.transition;R.transition={};try{T()}finally{R.transition=L}},De.unstable_act=Y,De.useCallback=function(T,L){return q.current.useCallback(T,L)},De.useContext=function(T){return q.current.useContext(T)},De.useDebugValue=function(){},De.useDeferredValue=function(T){return q.current.useDeferredValue(T)},De.useEffect=function(T,L){return q.current.useEffect(T,L)},De.useId=function(){return q.current.useId()},De.useImperativeHandle=function(T,L,ge){return q.current.useImperativeHandle(T,L,ge)},De.useInsertionEffect=function(T,L){return q.current.useInsertionEffect(T,L)},De.useLayoutEffect=function(T,L){return q.current.useLayoutEffect(T,L)},De.useMemo=function(T,L){return q.current.useMemo(T,L)},De.useReducer=function(T,L,ge){return q.current.useReducer(T,L,ge)},De.useRef=function(T){return q.current.useRef(T)},De.useState=function(T){return q.current.useState(T)},De.useSyncExternalStore=function(T,L,ge){return q.current.useSyncExternalStore(T,L,ge)},De.useTransition=function(){return q.current.useTransition()},De.version="18.3.1",De}var Zp;function bd(){return Zp||(Zp=1,pc.exports=s1()),pc.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Jp;function i1(){if(Jp)return eo;Jp=1;var t=bd(),n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,u=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function h(f,m,x){var g,y={},w=null,j=null;x!==void 0&&(w=""+x),m.key!==void 0&&(w=""+m.key),m.ref!==void 0&&(j=m.ref);for(g in m)o.call(m,g)&&!c.hasOwnProperty(g)&&(y[g]=m[g]);if(f&&f.defaultProps)for(g in m=f.defaultProps,m)y[g]===void 0&&(y[g]=m[g]);return{$$typeof:n,type:f,key:w,ref:j,props:y,_owner:u.current}}return eo.Fragment=s,eo.jsx=h,eo.jsxs=h,eo}var em;function o1(){return em||(em=1,fc.exports=i1()),fc.exports}var a=o1(),k=bd(),Wa={},mc={exports:{}},Ot={},gc={exports:{}},xc={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var tm;function a1(){return tm||(tm=1,(function(t){function n(R,X){var Y=R.length;R.push(X);e:for(;0<Y;){var T=Y-1>>>1,L=R[T];if(0<u(L,X))R[T]=X,R[Y]=L,Y=T;else break e}}function s(R){return R.length===0?null:R[0]}function o(R){if(R.length===0)return null;var X=R[0],Y=R.pop();if(Y!==X){R[0]=Y;e:for(var T=0,L=R.length,ge=L>>>1;T<ge;){var ye=2*(T+1)-1,Ce=R[ye],Te=ye+1,Ae=R[Te];if(0>u(Ce,Y))Te<L&&0>u(Ae,Ce)?(R[T]=Ae,R[Te]=Y,T=Te):(R[T]=Ce,R[ye]=Y,T=ye);else if(Te<L&&0>u(Ae,Y))R[T]=Ae,R[Te]=Y,T=Te;else break e}}return X}function u(R,X){var Y=R.sortIndex-X.sortIndex;return Y!==0?Y:R.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var h=Date,f=h.now();t.unstable_now=function(){return h.now()-f}}var m=[],x=[],g=1,y=null,w=3,j=!1,C=!1,A=!1,N=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function W(R){for(var X=s(x);X!==null;){if(X.callback===null)o(x);else if(X.startTime<=R)o(x),X.sortIndex=X.expirationTime,n(m,X);else break;X=s(x)}}function $(R){if(A=!1,W(R),!C)if(s(m)!==null)C=!0,le(b);else{var X=s(x);X!==null&&q($,X.startTime-R)}}function b(R,X){C=!1,A&&(A=!1,_(D),D=-1),j=!0;var Y=w;try{for(W(X),y=s(m);y!==null&&(!(y.expirationTime>X)||R&&!oe());){var T=y.callback;if(typeof T=="function"){y.callback=null,w=y.priorityLevel;var L=T(y.expirationTime<=X);X=t.unstable_now(),typeof L=="function"?y.callback=L:y===s(m)&&o(m),W(X)}else o(m);y=s(m)}if(y!==null)var ge=!0;else{var ye=s(x);ye!==null&&q($,ye.startTime-X),ge=!1}return ge}finally{y=null,w=Y,j=!1}}var F=!1,U=null,D=-1,O=5,G=-1;function oe(){return!(t.unstable_now()-G<O)}function K(){if(U!==null){var R=t.unstable_now();G=R;var X=!0;try{X=U(!0,R)}finally{X?I():(F=!1,U=null)}}else F=!1}var I;if(typeof B=="function")I=function(){B(K)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,ne=J.port2;J.port1.onmessage=K,I=function(){ne.postMessage(null)}}else I=function(){N(K,0)};function le(R){U=R,F||(F=!0,I())}function q(R,X){D=N(function(){R(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(R){R.callback=null},t.unstable_continueExecution=function(){C||j||(C=!0,le(b))},t.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<R?Math.floor(1e3/R):5},t.unstable_getCurrentPriorityLevel=function(){return w},t.unstable_getFirstCallbackNode=function(){return s(m)},t.unstable_next=function(R){switch(w){case 1:case 2:case 3:var X=3;break;default:X=w}var Y=w;w=X;try{return R()}finally{w=Y}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(R,X){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var Y=w;w=R;try{return X()}finally{w=Y}},t.unstable_scheduleCallback=function(R,X,Y){var T=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?T+Y:T):Y=T,R){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=Y+L,R={id:g++,callback:X,priorityLevel:R,startTime:Y,expirationTime:L,sortIndex:-1},Y>T?(R.sortIndex=Y,n(x,R),s(m)===null&&R===s(x)&&(A?(_(D),D=-1):A=!0,q($,Y-T))):(R.sortIndex=L,n(m,R),C||j||(C=!0,le(b))),R},t.unstable_shouldYield=oe,t.unstable_wrapCallback=function(R){var X=w;return function(){var Y=w;w=X;try{return R.apply(this,arguments)}finally{w=Y}}}})(xc)),xc}var nm;function l1(){return nm||(nm=1,gc.exports=a1()),gc.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var rm;function u1(){if(rm)return Ot;rm=1;var t=bd(),n=l1();function s(e){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,u={};function c(e,r){h(e,r),h(e+"Capture",r)}function h(e,r){for(u[e]=r,e=0;e<r.length;e++)o.add(r[e])}var f=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,x=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},y={};function w(e){return m.call(y,e)?!0:m.call(g,e)?!1:x.test(e)?y[e]=!0:(g[e]=!0,!1)}function j(e,r,i,l){if(i!==null&&i.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,r,i,l){if(r===null||typeof r>"u"||j(e,r,i,l))return!0;if(l)return!1;if(i!==null)switch(i.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function A(e,r,i,l,d,p,v){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=l,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=e,this.type=r,this.sanitizeURL=p,this.removeEmptyString=v}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new A(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var r=e[0];N[r]=new A(r,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new A(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new A(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){N[e]=new A(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new A(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new A(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new A(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new A(e,5,!1,e.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function B(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var r=e.replace(_,B);N[r]=new A(r,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var r=e.replace(_,B);N[r]=new A(r,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var r=e.replace(_,B);N[r]=new A(r,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new A(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new A("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new A(e,1,!1,e.toLowerCase(),null,!0,!0)});function W(e,r,i,l){var d=N.hasOwnProperty(r)?N[r]:null;(d!==null?d.type!==0:l||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(C(r,i,d,l)&&(i=null),l||d===null?w(r)&&(i===null?e.removeAttribute(r):e.setAttribute(r,""+i)):d.mustUseProperty?e[d.propertyName]=i===null?d.type===3?!1:"":i:(r=d.attributeName,l=d.attributeNamespace,i===null?e.removeAttribute(r):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,l?e.setAttributeNS(l,r,i):e.setAttribute(r,i))))}var $=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,b=Symbol.for("react.element"),F=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),G=Symbol.for("react.provider"),oe=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),q=Symbol.for("react.offscreen"),R=Symbol.iterator;function X(e){return e===null||typeof e!="object"?null:(e=R&&e[R]||e["@@iterator"],typeof e=="function"?e:null)}var Y=Object.assign,T;function L(e){if(T===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);T=r&&r[1]||""}return`
|
|
34
|
+
`+T+e}var ge=!1;function ye(e,r){if(!e||ge)return"";ge=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(H){var l=H}Reflect.construct(e,[],r)}else{try{r.call()}catch(H){l=H}e.call(r.prototype)}else{try{throw Error()}catch(H){l=H}e()}}catch(H){if(H&&l&&typeof H.stack=="string"){for(var d=H.stack.split(`
|
|
35
|
+
`),p=l.stack.split(`
|
|
36
|
+
`),v=d.length-1,S=p.length-1;1<=v&&0<=S&&d[v]!==p[S];)S--;for(;1<=v&&0<=S;v--,S--)if(d[v]!==p[S]){if(v!==1||S!==1)do if(v--,S--,0>S||d[v]!==p[S]){var P=`
|
|
37
|
+
`+d[v].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),P}while(1<=v&&0<=S);break}}}finally{ge=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?L(e):""}function Ce(e){switch(e.tag){case 5:return L(e.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return e=ye(e.type,!1),e;case 11:return e=ye(e.type.render,!1),e;case 1:return e=ye(e.type,!0),e;default:return""}}function Te(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case U:return"Fragment";case F:return"Portal";case O:return"Profiler";case D:return"StrictMode";case I:return"Suspense";case J:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case oe:return(e.displayName||"Context")+".Consumer";case G:return(e._context.displayName||"Context")+".Provider";case K:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return r=e.displayName||null,r!==null?r:Te(e.type)||"Memo";case le:r=e._payload,e=e._init;try{return Te(e(r))}catch{}}return null}function Ae(e){var r=e.type;switch(e.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=r.render,e=e.displayName||e.name||"",r.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Te(r);case 8:return r===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function je(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fe(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Qe(e){var r=Fe(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),l=""+e[r];if(!e.hasOwnProperty(r)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,p=i.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return d.call(this)},set:function(v){l=""+v,p.call(this,v)}}),Object.defineProperty(e,r,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function Xt(e){e._valueTracker||(e._valueTracker=Qe(e))}function $t(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var i=r.getValue(),l="";return e&&(l=Fe(e)?e.checked?"true":"false":e.value),e=l,e!==i?(r.setValue(e),!0):!1}function At(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ae(e,r){var i=r.checked;return Y({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function Me(e,r){var i=r.defaultValue==null?"":r.defaultValue,l=r.checked!=null?r.checked:r.defaultChecked;i=je(r.value!=null?r.value:i),e._wrapperState={initialChecked:l,initialValue:i,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function Z(e,r){r=r.checked,r!=null&&W(e,"checked",r,!1)}function he(e,r){Z(e,r);var i=je(r.value),l=r.type;if(i!=null)l==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}r.hasOwnProperty("value")?ot(e,r.type,i):r.hasOwnProperty("defaultValue")&&ot(e,r.type,je(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}function $e(e,r,i){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var l=r.type;if(!(l!=="submit"&&l!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+e._wrapperState.initialValue,i||r===e.value||(e.value=r),e.defaultValue=r}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function ot(e,r,i){(r!=="number"||At(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var ht=Array.isArray;function zt(e,r,i,l){if(e=e.options,r){r={};for(var d=0;d<i.length;d++)r["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=r.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&l&&(e[i].defaultSelected=!0)}else{for(i=""+je(i),r=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}r!==null||e[d].disabled||(r=e[d])}r!==null&&(r.selected=!0)}}function kn(e,r){if(r.dangerouslySetInnerHTML!=null)throw Error(s(91));return Y({},r,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function tr(e,r){var i=r.value;if(i==null){if(i=r.children,r=r.defaultValue,i!=null){if(r!=null)throw Error(s(92));if(ht(i)){if(1<i.length)throw Error(s(93));i=i[0]}r=i}r==null&&(r=""),i=r}e._wrapperState={initialValue:je(i)}}function _n(e,r){var i=je(r.value),l=je(r.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),r.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),l!=null&&(e.defaultValue=""+l)}function Or(e){var r=e.textContent;r===e._wrapperState.initialValue&&r!==""&&r!==null&&(e.value=r)}function bs(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ee(e,r){return e==null||e==="http://www.w3.org/1999/xhtml"?bs(r):e==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ee,ve=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,i,l,d){MSApp.execUnsafeLocalFunction(function(){return e(r,i,l,d)})}:e})(function(e,r){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=r;else{for(Ee=Ee||document.createElement("div"),Ee.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=Ee.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;r.firstChild;)e.appendChild(r.firstChild)}});function ie(e,r){if(r){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=r;return}}e.textContent=r}var Oe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ze=["Webkit","ms","Moz","O"];Object.keys(Oe).forEach(function(e){ze.forEach(function(r){r=r+e.charAt(0).toUpperCase()+e.substring(1),Oe[r]=Oe[e]})});function Dt(e,r,i){return r==null||typeof r=="boolean"||r===""?"":i||typeof r!="number"||r===0||Oe.hasOwnProperty(e)&&Oe[e]?(""+r).trim():r+"px"}function st(e,r){e=e.style;for(var i in r)if(r.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=Dt(i,r[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var Ut=Y({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function dn(e,r){if(r){if(Ut[e]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(s(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(s(61))}if(r.style!=null&&typeof r.style!="object")throw Error(s(62))}}function Br(e,r){if(e.indexOf("-")===-1)return typeof r.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Vr=null;function nr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $r=null,ks=null,js=null;function hh(e){if(e=Bi(e)){if(typeof $r!="function")throw Error(s(280));var r=e.stateNode;r&&(r=sa(r),$r(e.stateNode,e.type,r))}}function fh(e){ks?js?js.push(e):js=[e]:ks=e}function ph(){if(ks){var e=ks,r=js;if(js=ks=null,hh(e),r)for(e=0;e<r.length;e++)hh(r[e])}}function mh(e,r){return e(r)}function gh(){}var Tl=!1;function xh(e,r,i){if(Tl)return e(r,i);Tl=!0;try{return mh(e,r,i)}finally{Tl=!1,(ks!==null||js!==null)&&(gh(),ph())}}function yi(e,r){var i=e.stateNode;if(i===null)return null;var l=sa(i);if(l===null)return null;i=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,r,typeof i));return i}var Pl=!1;if(f)try{var vi={};Object.defineProperty(vi,"passive",{get:function(){Pl=!0}}),window.addEventListener("test",vi,vi),window.removeEventListener("test",vi,vi)}catch{Pl=!1}function cy(e,r,i,l,d,p,v,S,P){var H=Array.prototype.slice.call(arguments,3);try{r.apply(i,H)}catch(re){this.onError(re)}}var wi=!1,Lo=null,Ro=!1,Ml=null,dy={onError:function(e){wi=!0,Lo=e}};function hy(e,r,i,l,d,p,v,S,P){wi=!1,Lo=null,cy.apply(dy,arguments)}function fy(e,r,i,l,d,p,v,S,P){if(hy.apply(this,arguments),wi){if(wi){var H=Lo;wi=!1,Lo=null}else throw Error(s(198));Ro||(Ro=!0,Ml=H)}}function zr(e){var r=e,i=e;if(e.alternate)for(;r.return;)r=r.return;else{e=r;do r=e,(r.flags&4098)!==0&&(i=r.return),e=r.return;while(e)}return r.tag===3?i:null}function yh(e){if(e.tag===13){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function vh(e){if(zr(e)!==e)throw Error(s(188))}function py(e){var r=e.alternate;if(!r){if(r=zr(e),r===null)throw Error(s(188));return r!==e?null:e}for(var i=e,l=r;;){var d=i.return;if(d===null)break;var p=d.alternate;if(p===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===i)return vh(d),e;if(p===l)return vh(d),r;p=p.sibling}throw Error(s(188))}if(i.return!==l.return)i=d,l=p;else{for(var v=!1,S=d.child;S;){if(S===i){v=!0,i=d,l=p;break}if(S===l){v=!0,l=d,i=p;break}S=S.sibling}if(!v){for(S=p.child;S;){if(S===i){v=!0,i=p,l=d;break}if(S===l){v=!0,l=p,i=d;break}S=S.sibling}if(!v)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:r}function wh(e){return e=py(e),e!==null?bh(e):null}function bh(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var r=bh(e);if(r!==null)return r;e=e.sibling}return null}var kh=n.unstable_scheduleCallback,jh=n.unstable_cancelCallback,my=n.unstable_shouldYield,gy=n.unstable_requestPaint,tt=n.unstable_now,xy=n.unstable_getCurrentPriorityLevel,Dl=n.unstable_ImmediatePriority,Nh=n.unstable_UserBlockingPriority,Oo=n.unstable_NormalPriority,yy=n.unstable_LowPriority,Sh=n.unstable_IdlePriority,Bo=null,jn=null;function vy(e){if(jn&&typeof jn.onCommitFiberRoot=="function")try{jn.onCommitFiberRoot(Bo,e,void 0,(e.current.flags&128)===128)}catch{}}var hn=Math.clz32?Math.clz32:ky,wy=Math.log,by=Math.LN2;function ky(e){return e>>>=0,e===0?32:31-(wy(e)/by|0)|0}var Vo=64,$o=4194304;function bi(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zo(e,r){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,p=e.pingedLanes,v=i&268435455;if(v!==0){var S=v&~d;S!==0?l=bi(S):(p&=v,p!==0&&(l=bi(p)))}else v=i&~d,v!==0?l=bi(v):p!==0&&(l=bi(p));if(l===0)return 0;if(r!==0&&r!==l&&(r&d)===0&&(d=l&-l,p=r&-r,d>=p||d===16&&(p&4194240)!==0))return r;if((l&4)!==0&&(l|=i&16),r=e.entangledLanes,r!==0)for(e=e.entanglements,r&=l;0<r;)i=31-hn(r),d=1<<i,l|=e[i],r&=~d;return l}function jy(e,r){switch(e){case 1:case 2:case 4:return r+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ny(e,r){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var v=31-hn(p),S=1<<v,P=d[v];P===-1?((S&i)===0||(S&l)!==0)&&(d[v]=jy(S,r)):P<=r&&(e.expiredLanes|=S),p&=~S}}function Fl(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ch(){var e=Vo;return Vo<<=1,(Vo&4194240)===0&&(Vo=64),e}function Il(e){for(var r=[],i=0;31>i;i++)r.push(e);return r}function ki(e,r,i){e.pendingLanes|=r,r!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,r=31-hn(r),e[r]=i}function Sy(e,r){var i=e.pendingLanes&~r;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=r,e.mutableReadLanes&=r,e.entangledLanes&=r,r=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<i;){var d=31-hn(i),p=1<<d;r[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function _l(e,r){var i=e.entangledLanes|=r;for(e=e.entanglements;i;){var l=31-hn(i),d=1<<l;d&r|e[l]&r&&(e[l]|=r),i&=~d}}var Ve=0;function Ah(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Eh,Ll,Th,Ph,Mh,Rl=!1,Uo=[],rr=null,sr=null,ir=null,ji=new Map,Ni=new Map,or=[],Cy="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Dh(e,r){switch(e){case"focusin":case"focusout":rr=null;break;case"dragenter":case"dragleave":sr=null;break;case"mouseover":case"mouseout":ir=null;break;case"pointerover":case"pointerout":ji.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ni.delete(r.pointerId)}}function Si(e,r,i,l,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:r,domEventName:i,eventSystemFlags:l,nativeEvent:p,targetContainers:[d]},r!==null&&(r=Bi(r),r!==null&&Ll(r)),e):(e.eventSystemFlags|=l,r=e.targetContainers,d!==null&&r.indexOf(d)===-1&&r.push(d),e)}function Ay(e,r,i,l,d){switch(r){case"focusin":return rr=Si(rr,e,r,i,l,d),!0;case"dragenter":return sr=Si(sr,e,r,i,l,d),!0;case"mouseover":return ir=Si(ir,e,r,i,l,d),!0;case"pointerover":var p=d.pointerId;return ji.set(p,Si(ji.get(p)||null,e,r,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,Ni.set(p,Si(Ni.get(p)||null,e,r,i,l,d)),!0}return!1}function Fh(e){var r=Ur(e.target);if(r!==null){var i=zr(r);if(i!==null){if(r=i.tag,r===13){if(r=yh(i),r!==null){e.blockedOn=r,Mh(e.priority,function(){Th(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wo(e){if(e.blockedOn!==null)return!1;for(var r=e.targetContainers;0<r.length;){var i=Bl(e.domEventName,e.eventSystemFlags,r[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Vr=l,i.target.dispatchEvent(l),Vr=null}else return r=Bi(i),r!==null&&Ll(r),e.blockedOn=i,!1;r.shift()}return!0}function Ih(e,r,i){Wo(e)&&i.delete(r)}function Ey(){Rl=!1,rr!==null&&Wo(rr)&&(rr=null),sr!==null&&Wo(sr)&&(sr=null),ir!==null&&Wo(ir)&&(ir=null),ji.forEach(Ih),Ni.forEach(Ih)}function Ci(e,r){e.blockedOn===r&&(e.blockedOn=null,Rl||(Rl=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Ey)))}function Ai(e){function r(d){return Ci(d,e)}if(0<Uo.length){Ci(Uo[0],e);for(var i=1;i<Uo.length;i++){var l=Uo[i];l.blockedOn===e&&(l.blockedOn=null)}}for(rr!==null&&Ci(rr,e),sr!==null&&Ci(sr,e),ir!==null&&Ci(ir,e),ji.forEach(r),Ni.forEach(r),i=0;i<or.length;i++)l=or[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<or.length&&(i=or[0],i.blockedOn===null);)Fh(i),i.blockedOn===null&&or.shift()}var Ns=$.ReactCurrentBatchConfig,Ho=!0;function Ty(e,r,i,l){var d=Ve,p=Ns.transition;Ns.transition=null;try{Ve=1,Ol(e,r,i,l)}finally{Ve=d,Ns.transition=p}}function Py(e,r,i,l){var d=Ve,p=Ns.transition;Ns.transition=null;try{Ve=4,Ol(e,r,i,l)}finally{Ve=d,Ns.transition=p}}function Ol(e,r,i,l){if(Ho){var d=Bl(e,r,i,l);if(d===null)nu(e,r,l,Ko,i),Dh(e,l);else if(Ay(d,e,r,i,l))l.stopPropagation();else if(Dh(e,l),r&4&&-1<Cy.indexOf(e)){for(;d!==null;){var p=Bi(d);if(p!==null&&Eh(p),p=Bl(e,r,i,l),p===null&&nu(e,r,l,Ko,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else nu(e,r,l,null,i)}}var Ko=null;function Bl(e,r,i,l){if(Ko=null,e=nr(l),e=Ur(e),e!==null)if(r=zr(e),r===null)e=null;else if(i=r.tag,i===13){if(e=yh(r),e!==null)return e;e=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;e=null}else r!==e&&(e=null);return Ko=e,null}function _h(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(xy()){case Dl:return 1;case Nh:return 4;case Oo:case yy:return 16;case Sh:return 536870912;default:return 16}default:return 16}}var ar=null,Vl=null,Qo=null;function Lh(){if(Qo)return Qo;var e,r=Vl,i=r.length,l,d="value"in ar?ar.value:ar.textContent,p=d.length;for(e=0;e<i&&r[e]===d[e];e++);var v=i-e;for(l=1;l<=v&&r[i-l]===d[p-l];l++);return Qo=d.slice(e,1<l?1-l:void 0)}function Go(e){var r=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&r===13&&(e=13)):e=r,e===10&&(e=13),32<=e||e===13?e:0}function qo(){return!0}function Rh(){return!1}function Wt(e){function r(i,l,d,p,v){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=v,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(i=e[S],this[S]=i?i(p):p[S]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?qo:Rh,this.isPropagationStopped=Rh,this}return Y(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=qo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=qo)},persist:function(){},isPersistent:qo}),r}var Ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$l=Wt(Ss),Ei=Y({},Ss,{view:0,detail:0}),My=Wt(Ei),zl,Ul,Ti,Xo=Y({},Ei,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hl,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ti&&(Ti&&e.type==="mousemove"?(zl=e.screenX-Ti.screenX,Ul=e.screenY-Ti.screenY):Ul=zl=0,Ti=e),zl)},movementY:function(e){return"movementY"in e?e.movementY:Ul}}),Oh=Wt(Xo),Dy=Y({},Xo,{dataTransfer:0}),Fy=Wt(Dy),Iy=Y({},Ei,{relatedTarget:0}),Wl=Wt(Iy),_y=Y({},Ss,{animationName:0,elapsedTime:0,pseudoElement:0}),Ly=Wt(_y),Ry=Y({},Ss,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Oy=Wt(Ry),By=Y({},Ss,{data:0}),Bh=Wt(By),Vy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$y={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},zy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uy(e){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(e):(e=zy[e])?!!r[e]:!1}function Hl(){return Uy}var Wy=Y({},Ei,{key:function(e){if(e.key){var r=Vy[e.key]||e.key;if(r!=="Unidentified")return r}return e.type==="keypress"?(e=Go(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$y[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hl,charCode:function(e){return e.type==="keypress"?Go(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Go(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Hy=Wt(Wy),Ky=Y({},Xo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vh=Wt(Ky),Qy=Y({},Ei,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hl}),Gy=Wt(Qy),qy=Y({},Ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xy=Wt(qy),Yy=Y({},Xo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Zy=Wt(Yy),Jy=[9,13,27,32],Kl=f&&"CompositionEvent"in window,Pi=null;f&&"documentMode"in document&&(Pi=document.documentMode);var ev=f&&"TextEvent"in window&&!Pi,$h=f&&(!Kl||Pi&&8<Pi&&11>=Pi),zh=" ",Uh=!1;function Wh(e,r){switch(e){case"keyup":return Jy.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cs=!1;function tv(e,r){switch(e){case"compositionend":return Hh(r);case"keypress":return r.which!==32?null:(Uh=!0,zh);case"textInput":return e=r.data,e===zh&&Uh?null:e;default:return null}}function nv(e,r){if(Cs)return e==="compositionend"||!Kl&&Wh(e,r)?(e=Lh(),Qo=Vl=ar=null,Cs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return $h&&r.locale!=="ko"?null:r.data;default:return null}}var rv={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Kh(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r==="input"?!!rv[e.type]:r==="textarea"}function Qh(e,r,i,l){fh(l),r=ta(r,"onChange"),0<r.length&&(i=new $l("onChange","change",null,i,l),e.push({event:i,listeners:r}))}var Mi=null,Di=null;function sv(e){hf(e,0)}function Yo(e){var r=Ms(e);if($t(r))return e}function iv(e,r){if(e==="change")return r}var Gh=!1;if(f){var Ql;if(f){var Gl="oninput"in document;if(!Gl){var qh=document.createElement("div");qh.setAttribute("oninput","return;"),Gl=typeof qh.oninput=="function"}Ql=Gl}else Ql=!1;Gh=Ql&&(!document.documentMode||9<document.documentMode)}function Xh(){Mi&&(Mi.detachEvent("onpropertychange",Yh),Di=Mi=null)}function Yh(e){if(e.propertyName==="value"&&Yo(Di)){var r=[];Qh(r,Di,e,nr(e)),xh(sv,r)}}function ov(e,r,i){e==="focusin"?(Xh(),Mi=r,Di=i,Mi.attachEvent("onpropertychange",Yh)):e==="focusout"&&Xh()}function av(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yo(Di)}function lv(e,r){if(e==="click")return Yo(r)}function uv(e,r){if(e==="input"||e==="change")return Yo(r)}function cv(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var fn=typeof Object.is=="function"?Object.is:cv;function Fi(e,r){if(fn(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;var i=Object.keys(e),l=Object.keys(r);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!m.call(r,d)||!fn(e[d],r[d]))return!1}return!0}function Zh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jh(e,r){var i=Zh(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=r&&l>=r)return{node:i,offset:r-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Zh(i)}}function ef(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?ef(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function tf(){for(var e=window,r=At();r instanceof e.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)e=r.contentWindow;else break;r=At(e.document)}return r}function ql(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}function dv(e){var r=tf(),i=e.focusedElem,l=e.selectionRange;if(r!==i&&i&&i.ownerDocument&&ef(i.ownerDocument.documentElement,i)){if(l!==null&&ql(i)){if(r=l.start,e=l.end,e===void 0&&(e=r),"selectionStart"in i)i.selectionStart=r,i.selectionEnd=Math.min(e,i.value.length);else if(e=(r=i.ownerDocument||document)&&r.defaultView||window,e.getSelection){e=e.getSelection();var d=i.textContent.length,p=Math.min(l.start,d);l=l.end===void 0?p:Math.min(l.end,d),!e.extend&&p>l&&(d=l,l=p,p=d),d=Jh(i,p);var v=Jh(i,l);d&&v&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==v.node||e.focusOffset!==v.offset)&&(r=r.createRange(),r.setStart(d.node,d.offset),e.removeAllRanges(),p>l?(e.addRange(r),e.extend(v.node,v.offset)):(r.setEnd(v.node,v.offset),e.addRange(r)))}}for(r=[],e=i;e=e.parentNode;)e.nodeType===1&&r.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<r.length;i++)e=r[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var hv=f&&"documentMode"in document&&11>=document.documentMode,As=null,Xl=null,Ii=null,Yl=!1;function nf(e,r,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Yl||As==null||As!==At(l)||(l=As,"selectionStart"in l&&ql(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ii&&Fi(Ii,l)||(Ii=l,l=ta(Xl,"onSelect"),0<l.length&&(r=new $l("onSelect","select",null,r,i),e.push({event:r,listeners:l}),r.target=As)))}function Zo(e,r){var i={};return i[e.toLowerCase()]=r.toLowerCase(),i["Webkit"+e]="webkit"+r,i["Moz"+e]="moz"+r,i}var Es={animationend:Zo("Animation","AnimationEnd"),animationiteration:Zo("Animation","AnimationIteration"),animationstart:Zo("Animation","AnimationStart"),transitionend:Zo("Transition","TransitionEnd")},Zl={},rf={};f&&(rf=document.createElement("div").style,"AnimationEvent"in window||(delete Es.animationend.animation,delete Es.animationiteration.animation,delete Es.animationstart.animation),"TransitionEvent"in window||delete Es.transitionend.transition);function Jo(e){if(Zl[e])return Zl[e];if(!Es[e])return e;var r=Es[e],i;for(i in r)if(r.hasOwnProperty(i)&&i in rf)return Zl[e]=r[i];return e}var sf=Jo("animationend"),of=Jo("animationiteration"),af=Jo("animationstart"),lf=Jo("transitionend"),uf=new Map,cf="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function lr(e,r){uf.set(e,r),c(r,[e])}for(var Jl=0;Jl<cf.length;Jl++){var eu=cf[Jl],fv=eu.toLowerCase(),pv=eu[0].toUpperCase()+eu.slice(1);lr(fv,"on"+pv)}lr(sf,"onAnimationEnd"),lr(of,"onAnimationIteration"),lr(af,"onAnimationStart"),lr("dblclick","onDoubleClick"),lr("focusin","onFocus"),lr("focusout","onBlur"),lr(lf,"onTransitionEnd"),h("onMouseEnter",["mouseout","mouseover"]),h("onMouseLeave",["mouseout","mouseover"]),h("onPointerEnter",["pointerout","pointerover"]),h("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _i="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mv=new Set("cancel close invalid load scroll toggle".split(" ").concat(_i));function df(e,r,i){var l=e.type||"unknown-event";e.currentTarget=i,fy(l,r,void 0,e),e.currentTarget=null}function hf(e,r){r=(r&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],d=l.event;l=l.listeners;e:{var p=void 0;if(r)for(var v=l.length-1;0<=v;v--){var S=l[v],P=S.instance,H=S.currentTarget;if(S=S.listener,P!==p&&d.isPropagationStopped())break e;df(d,S,H),p=P}else for(v=0;v<l.length;v++){if(S=l[v],P=S.instance,H=S.currentTarget,S=S.listener,P!==p&&d.isPropagationStopped())break e;df(d,S,H),p=P}}}if(Ro)throw e=Ml,Ro=!1,Ml=null,e}function We(e,r){var i=r[lu];i===void 0&&(i=r[lu]=new Set);var l=e+"__bubble";i.has(l)||(ff(r,e,2,!1),i.add(l))}function tu(e,r,i){var l=0;r&&(l|=4),ff(i,e,l,r)}var ea="_reactListening"+Math.random().toString(36).slice(2);function Li(e){if(!e[ea]){e[ea]=!0,o.forEach(function(i){i!=="selectionchange"&&(mv.has(i)||tu(i,!1,e),tu(i,!0,e))});var r=e.nodeType===9?e:e.ownerDocument;r===null||r[ea]||(r[ea]=!0,tu("selectionchange",!1,r))}}function ff(e,r,i,l){switch(_h(r)){case 1:var d=Ty;break;case 4:d=Py;break;default:d=Ol}i=d.bind(null,r,i,e),d=void 0,!Pl||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(d=!0),l?d!==void 0?e.addEventListener(r,i,{capture:!0,passive:d}):e.addEventListener(r,i,!0):d!==void 0?e.addEventListener(r,i,{passive:d}):e.addEventListener(r,i,!1)}function nu(e,r,i,l,d){var p=l;if((r&1)===0&&(r&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var S=l.stateNode.containerInfo;if(S===d||S.nodeType===8&&S.parentNode===d)break;if(v===4)for(v=l.return;v!==null;){var P=v.tag;if((P===3||P===4)&&(P=v.stateNode.containerInfo,P===d||P.nodeType===8&&P.parentNode===d))return;v=v.return}for(;S!==null;){if(v=Ur(S),v===null)return;if(P=v.tag,P===5||P===6){l=p=v;continue e}S=S.parentNode}}l=l.return}xh(function(){var H=p,re=nr(i),se=[];e:{var te=uf.get(e);if(te!==void 0){var de=$l,pe=e;switch(e){case"keypress":if(Go(i)===0)break e;case"keydown":case"keyup":de=Hy;break;case"focusin":pe="focus",de=Wl;break;case"focusout":pe="blur",de=Wl;break;case"beforeblur":case"afterblur":de=Wl;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=Oh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Fy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=Gy;break;case sf:case of:case af:de=Ly;break;case lf:de=Xy;break;case"scroll":de=My;break;case"wheel":de=Zy;break;case"copy":case"cut":case"paste":de=Oy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Vh}var me=(r&4)!==0,nt=!me&&e==="scroll",V=me?te!==null?te+"Capture":null:te;me=[];for(var M=H,z;M!==null;){z=M;var ue=z.stateNode;if(z.tag===5&&ue!==null&&(z=ue,V!==null&&(ue=yi(M,V),ue!=null&&me.push(Ri(M,ue,z)))),nt)break;M=M.return}0<me.length&&(te=new de(te,pe,null,i,re),se.push({event:te,listeners:me}))}}if((r&7)===0){e:{if(te=e==="mouseover"||e==="pointerover",de=e==="mouseout"||e==="pointerout",te&&i!==Vr&&(pe=i.relatedTarget||i.fromElement)&&(Ur(pe)||pe[Ln]))break e;if((de||te)&&(te=re.window===re?re:(te=re.ownerDocument)?te.defaultView||te.parentWindow:window,de?(pe=i.relatedTarget||i.toElement,de=H,pe=pe?Ur(pe):null,pe!==null&&(nt=zr(pe),pe!==nt||pe.tag!==5&&pe.tag!==6)&&(pe=null)):(de=null,pe=H),de!==pe)){if(me=Oh,ue="onMouseLeave",V="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(me=Vh,ue="onPointerLeave",V="onPointerEnter",M="pointer"),nt=de==null?te:Ms(de),z=pe==null?te:Ms(pe),te=new me(ue,M+"leave",de,i,re),te.target=nt,te.relatedTarget=z,ue=null,Ur(re)===H&&(me=new me(V,M+"enter",pe,i,re),me.target=z,me.relatedTarget=nt,ue=me),nt=ue,de&&pe)t:{for(me=de,V=pe,M=0,z=me;z;z=Ts(z))M++;for(z=0,ue=V;ue;ue=Ts(ue))z++;for(;0<M-z;)me=Ts(me),M--;for(;0<z-M;)V=Ts(V),z--;for(;M--;){if(me===V||V!==null&&me===V.alternate)break t;me=Ts(me),V=Ts(V)}me=null}else me=null;de!==null&&pf(se,te,de,me,!1),pe!==null&&nt!==null&&pf(se,nt,pe,me,!0)}}e:{if(te=H?Ms(H):window,de=te.nodeName&&te.nodeName.toLowerCase(),de==="select"||de==="input"&&te.type==="file")var xe=iv;else if(Kh(te))if(Gh)xe=uv;else{xe=av;var be=ov}else(de=te.nodeName)&&de.toLowerCase()==="input"&&(te.type==="checkbox"||te.type==="radio")&&(xe=lv);if(xe&&(xe=xe(e,H))){Qh(se,xe,i,re);break e}be&&be(e,te,H),e==="focusout"&&(be=te._wrapperState)&&be.controlled&&te.type==="number"&&ot(te,"number",te.value)}switch(be=H?Ms(H):window,e){case"focusin":(Kh(be)||be.contentEditable==="true")&&(As=be,Xl=H,Ii=null);break;case"focusout":Ii=Xl=As=null;break;case"mousedown":Yl=!0;break;case"contextmenu":case"mouseup":case"dragend":Yl=!1,nf(se,i,re);break;case"selectionchange":if(hv)break;case"keydown":case"keyup":nf(se,i,re)}var ke;if(Kl)e:{switch(e){case"compositionstart":var Se="onCompositionStart";break e;case"compositionend":Se="onCompositionEnd";break e;case"compositionupdate":Se="onCompositionUpdate";break e}Se=void 0}else Cs?Wh(e,i)&&(Se="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Se="onCompositionStart");Se&&($h&&i.locale!=="ko"&&(Cs||Se!=="onCompositionStart"?Se==="onCompositionEnd"&&Cs&&(ke=Lh()):(ar=re,Vl="value"in ar?ar.value:ar.textContent,Cs=!0)),be=ta(H,Se),0<be.length&&(Se=new Bh(Se,e,null,i,re),se.push({event:Se,listeners:be}),ke?Se.data=ke:(ke=Hh(i),ke!==null&&(Se.data=ke)))),(ke=ev?tv(e,i):nv(e,i))&&(H=ta(H,"onBeforeInput"),0<H.length&&(re=new Bh("onBeforeInput","beforeinput",null,i,re),se.push({event:re,listeners:H}),re.data=ke))}hf(se,r)})}function Ri(e,r,i){return{instance:e,listener:r,currentTarget:i}}function ta(e,r){for(var i=r+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=yi(e,i),p!=null&&l.unshift(Ri(e,p,d)),p=yi(e,r),p!=null&&l.push(Ri(e,p,d))),e=e.return}return l}function Ts(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function pf(e,r,i,l,d){for(var p=r._reactName,v=[];i!==null&&i!==l;){var S=i,P=S.alternate,H=S.stateNode;if(P!==null&&P===l)break;S.tag===5&&H!==null&&(S=H,d?(P=yi(i,p),P!=null&&v.unshift(Ri(i,P,S))):d||(P=yi(i,p),P!=null&&v.push(Ri(i,P,S)))),i=i.return}v.length!==0&&e.push({event:r,listeners:v})}var gv=/\r\n?/g,xv=/\u0000|\uFFFD/g;function mf(e){return(typeof e=="string"?e:""+e).replace(gv,`
|
|
38
|
+
`).replace(xv,"")}function na(e,r,i){if(r=mf(r),mf(e)!==r&&i)throw Error(s(425))}function ra(){}var ru=null,su=null;function iu(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var ou=typeof setTimeout=="function"?setTimeout:void 0,yv=typeof clearTimeout=="function"?clearTimeout:void 0,gf=typeof Promise=="function"?Promise:void 0,vv=typeof queueMicrotask=="function"?queueMicrotask:typeof gf<"u"?function(e){return gf.resolve(null).then(e).catch(wv)}:ou;function wv(e){setTimeout(function(){throw e})}function au(e,r){var i=r,l=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(l===0){e.removeChild(d),Ai(r);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);Ai(r)}function ur(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return e}function xf(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(r===0)return e;r--}else i==="/$"&&r++}e=e.previousSibling}return null}var Ps=Math.random().toString(36).slice(2),Nn="__reactFiber$"+Ps,Oi="__reactProps$"+Ps,Ln="__reactContainer$"+Ps,lu="__reactEvents$"+Ps,bv="__reactListeners$"+Ps,kv="__reactHandles$"+Ps;function Ur(e){var r=e[Nn];if(r)return r;for(var i=e.parentNode;i;){if(r=i[Ln]||i[Nn]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(e=xf(e);e!==null;){if(i=e[Nn])return i;e=xf(e)}return r}e=i,i=e.parentNode}return null}function Bi(e){return e=e[Nn]||e[Ln],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ms(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function sa(e){return e[Oi]||null}var uu=[],Ds=-1;function cr(e){return{current:e}}function He(e){0>Ds||(e.current=uu[Ds],uu[Ds]=null,Ds--)}function Ue(e,r){Ds++,uu[Ds]=e.current,e.current=r}var dr={},wt=cr(dr),Ft=cr(!1),Wr=dr;function Fs(e,r){var i=e.type.contextTypes;if(!i)return dr;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===r)return l.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in i)d[p]=r[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=d),d}function It(e){return e=e.childContextTypes,e!=null}function ia(){He(Ft),He(wt)}function yf(e,r,i){if(wt.current!==dr)throw Error(s(168));Ue(wt,r),Ue(Ft,i)}function vf(e,r,i){var l=e.stateNode;if(r=r.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var d in l)if(!(d in r))throw Error(s(108,Ae(e)||"Unknown",d));return Y({},i,l)}function oa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dr,Wr=wt.current,Ue(wt,e),Ue(Ft,Ft.current),!0}function wf(e,r,i){var l=e.stateNode;if(!l)throw Error(s(169));i?(e=vf(e,r,Wr),l.__reactInternalMemoizedMergedChildContext=e,He(Ft),He(wt),Ue(wt,e)):He(Ft),Ue(Ft,i)}var Rn=null,aa=!1,cu=!1;function bf(e){Rn===null?Rn=[e]:Rn.push(e)}function jv(e){aa=!0,bf(e)}function hr(){if(!cu&&Rn!==null){cu=!0;var e=0,r=Ve;try{var i=Rn;for(Ve=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}Rn=null,aa=!1}catch(d){throw Rn!==null&&(Rn=Rn.slice(e+1)),kh(Dl,hr),d}finally{Ve=r,cu=!1}}return null}var Is=[],_s=0,la=null,ua=0,Yt=[],Zt=0,Hr=null,On=1,Bn="";function Kr(e,r){Is[_s++]=ua,Is[_s++]=la,la=e,ua=r}function kf(e,r,i){Yt[Zt++]=On,Yt[Zt++]=Bn,Yt[Zt++]=Hr,Hr=e;var l=On;e=Bn;var d=32-hn(l)-1;l&=~(1<<d),i+=1;var p=32-hn(r)+d;if(30<p){var v=d-d%5;p=(l&(1<<v)-1).toString(32),l>>=v,d-=v,On=1<<32-hn(r)+d|i<<d|l,Bn=p+e}else On=1<<p|i<<d|l,Bn=e}function du(e){e.return!==null&&(Kr(e,1),kf(e,1,0))}function hu(e){for(;e===la;)la=Is[--_s],Is[_s]=null,ua=Is[--_s],Is[_s]=null;for(;e===Hr;)Hr=Yt[--Zt],Yt[Zt]=null,Bn=Yt[--Zt],Yt[Zt]=null,On=Yt[--Zt],Yt[Zt]=null}var Ht=null,Kt=null,Ge=!1,pn=null;function jf(e,r){var i=nn(5,null,null,0);i.elementType="DELETED",i.stateNode=r,i.return=e,r=e.deletions,r===null?(e.deletions=[i],e.flags|=16):r.push(i)}function Nf(e,r){switch(e.tag){case 5:var i=e.type;return r=r.nodeType!==1||i.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(e.stateNode=r,Ht=e,Kt=ur(r.firstChild),!0):!1;case 6:return r=e.pendingProps===""||r.nodeType!==3?null:r,r!==null?(e.stateNode=r,Ht=e,Kt=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(i=Hr!==null?{id:On,overflow:Bn}:null,e.memoizedState={dehydrated:r,treeContext:i,retryLane:1073741824},i=nn(18,null,null,0),i.stateNode=r,i.return=e,e.child=i,Ht=e,Kt=null,!0):!1;default:return!1}}function fu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function pu(e){if(Ge){var r=Kt;if(r){var i=r;if(!Nf(e,r)){if(fu(e))throw Error(s(418));r=ur(i.nextSibling);var l=Ht;r&&Nf(e,r)?jf(l,i):(e.flags=e.flags&-4097|2,Ge=!1,Ht=e)}}else{if(fu(e))throw Error(s(418));e.flags=e.flags&-4097|2,Ge=!1,Ht=e}}}function Sf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ht=e}function ca(e){if(e!==Ht)return!1;if(!Ge)return Sf(e),Ge=!0,!1;var r;if((r=e.tag!==3)&&!(r=e.tag!==5)&&(r=e.type,r=r!=="head"&&r!=="body"&&!iu(e.type,e.memoizedProps)),r&&(r=Kt)){if(fu(e))throw Cf(),Error(s(418));for(;r;)jf(e,r),r=ur(r.nextSibling)}if(Sf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,r=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(r===0){Kt=ur(e.nextSibling);break e}r--}else i!=="$"&&i!=="$!"&&i!=="$?"||r++}e=e.nextSibling}Kt=null}}else Kt=Ht?ur(e.stateNode.nextSibling):null;return!0}function Cf(){for(var e=Kt;e;)e=ur(e.nextSibling)}function Ls(){Kt=Ht=null,Ge=!1}function mu(e){pn===null?pn=[e]:pn.push(e)}var Nv=$.ReactCurrentBatchConfig;function Vi(e,r,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(s(309));var l=i.stateNode}if(!l)throw Error(s(147,e));var d=l,p=""+e;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===p?r.ref:(r=function(v){var S=d.refs;v===null?delete S[p]:S[p]=v},r._stringRef=p,r)}if(typeof e!="string")throw Error(s(284));if(!i._owner)throw Error(s(290,e))}return e}function da(e,r){throw e=Object.prototype.toString.call(r),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e))}function Af(e){var r=e._init;return r(e._payload)}function Ef(e){function r(V,M){if(e){var z=V.deletions;z===null?(V.deletions=[M],V.flags|=16):z.push(M)}}function i(V,M){if(!e)return null;for(;M!==null;)r(V,M),M=M.sibling;return null}function l(V,M){for(V=new Map;M!==null;)M.key!==null?V.set(M.key,M):V.set(M.index,M),M=M.sibling;return V}function d(V,M){return V=wr(V,M),V.index=0,V.sibling=null,V}function p(V,M,z){return V.index=z,e?(z=V.alternate,z!==null?(z=z.index,z<M?(V.flags|=2,M):z):(V.flags|=2,M)):(V.flags|=1048576,M)}function v(V){return e&&V.alternate===null&&(V.flags|=2),V}function S(V,M,z,ue){return M===null||M.tag!==6?(M=oc(z,V.mode,ue),M.return=V,M):(M=d(M,z),M.return=V,M)}function P(V,M,z,ue){var xe=z.type;return xe===U?re(V,M,z.props.children,ue,z.key):M!==null&&(M.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===le&&Af(xe)===M.type)?(ue=d(M,z.props),ue.ref=Vi(V,M,z),ue.return=V,ue):(ue=_a(z.type,z.key,z.props,null,V.mode,ue),ue.ref=Vi(V,M,z),ue.return=V,ue)}function H(V,M,z,ue){return M===null||M.tag!==4||M.stateNode.containerInfo!==z.containerInfo||M.stateNode.implementation!==z.implementation?(M=ac(z,V.mode,ue),M.return=V,M):(M=d(M,z.children||[]),M.return=V,M)}function re(V,M,z,ue,xe){return M===null||M.tag!==7?(M=es(z,V.mode,ue,xe),M.return=V,M):(M=d(M,z),M.return=V,M)}function se(V,M,z){if(typeof M=="string"&&M!==""||typeof M=="number")return M=oc(""+M,V.mode,z),M.return=V,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case b:return z=_a(M.type,M.key,M.props,null,V.mode,z),z.ref=Vi(V,null,M),z.return=V,z;case F:return M=ac(M,V.mode,z),M.return=V,M;case le:var ue=M._init;return se(V,ue(M._payload),z)}if(ht(M)||X(M))return M=es(M,V.mode,z,null),M.return=V,M;da(V,M)}return null}function te(V,M,z,ue){var xe=M!==null?M.key:null;if(typeof z=="string"&&z!==""||typeof z=="number")return xe!==null?null:S(V,M,""+z,ue);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case b:return z.key===xe?P(V,M,z,ue):null;case F:return z.key===xe?H(V,M,z,ue):null;case le:return xe=z._init,te(V,M,xe(z._payload),ue)}if(ht(z)||X(z))return xe!==null?null:re(V,M,z,ue,null);da(V,z)}return null}function de(V,M,z,ue,xe){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return V=V.get(z)||null,S(M,V,""+ue,xe);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case b:return V=V.get(ue.key===null?z:ue.key)||null,P(M,V,ue,xe);case F:return V=V.get(ue.key===null?z:ue.key)||null,H(M,V,ue,xe);case le:var be=ue._init;return de(V,M,z,be(ue._payload),xe)}if(ht(ue)||X(ue))return V=V.get(z)||null,re(M,V,ue,xe,null);da(M,ue)}return null}function pe(V,M,z,ue){for(var xe=null,be=null,ke=M,Se=M=0,mt=null;ke!==null&&Se<z.length;Se++){ke.index>Se?(mt=ke,ke=null):mt=ke.sibling;var Re=te(V,ke,z[Se],ue);if(Re===null){ke===null&&(ke=mt);break}e&&ke&&Re.alternate===null&&r(V,ke),M=p(Re,M,Se),be===null?xe=Re:be.sibling=Re,be=Re,ke=mt}if(Se===z.length)return i(V,ke),Ge&&Kr(V,Se),xe;if(ke===null){for(;Se<z.length;Se++)ke=se(V,z[Se],ue),ke!==null&&(M=p(ke,M,Se),be===null?xe=ke:be.sibling=ke,be=ke);return Ge&&Kr(V,Se),xe}for(ke=l(V,ke);Se<z.length;Se++)mt=de(ke,V,Se,z[Se],ue),mt!==null&&(e&&mt.alternate!==null&&ke.delete(mt.key===null?Se:mt.key),M=p(mt,M,Se),be===null?xe=mt:be.sibling=mt,be=mt);return e&&ke.forEach(function(br){return r(V,br)}),Ge&&Kr(V,Se),xe}function me(V,M,z,ue){var xe=X(z);if(typeof xe!="function")throw Error(s(150));if(z=xe.call(z),z==null)throw Error(s(151));for(var be=xe=null,ke=M,Se=M=0,mt=null,Re=z.next();ke!==null&&!Re.done;Se++,Re=z.next()){ke.index>Se?(mt=ke,ke=null):mt=ke.sibling;var br=te(V,ke,Re.value,ue);if(br===null){ke===null&&(ke=mt);break}e&&ke&&br.alternate===null&&r(V,ke),M=p(br,M,Se),be===null?xe=br:be.sibling=br,be=br,ke=mt}if(Re.done)return i(V,ke),Ge&&Kr(V,Se),xe;if(ke===null){for(;!Re.done;Se++,Re=z.next())Re=se(V,Re.value,ue),Re!==null&&(M=p(Re,M,Se),be===null?xe=Re:be.sibling=Re,be=Re);return Ge&&Kr(V,Se),xe}for(ke=l(V,ke);!Re.done;Se++,Re=z.next())Re=de(ke,V,Se,Re.value,ue),Re!==null&&(e&&Re.alternate!==null&&ke.delete(Re.key===null?Se:Re.key),M=p(Re,M,Se),be===null?xe=Re:be.sibling=Re,be=Re);return e&&ke.forEach(function(r1){return r(V,r1)}),Ge&&Kr(V,Se),xe}function nt(V,M,z,ue){if(typeof z=="object"&&z!==null&&z.type===U&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case b:e:{for(var xe=z.key,be=M;be!==null;){if(be.key===xe){if(xe=z.type,xe===U){if(be.tag===7){i(V,be.sibling),M=d(be,z.props.children),M.return=V,V=M;break e}}else if(be.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===le&&Af(xe)===be.type){i(V,be.sibling),M=d(be,z.props),M.ref=Vi(V,be,z),M.return=V,V=M;break e}i(V,be);break}else r(V,be);be=be.sibling}z.type===U?(M=es(z.props.children,V.mode,ue,z.key),M.return=V,V=M):(ue=_a(z.type,z.key,z.props,null,V.mode,ue),ue.ref=Vi(V,M,z),ue.return=V,V=ue)}return v(V);case F:e:{for(be=z.key;M!==null;){if(M.key===be)if(M.tag===4&&M.stateNode.containerInfo===z.containerInfo&&M.stateNode.implementation===z.implementation){i(V,M.sibling),M=d(M,z.children||[]),M.return=V,V=M;break e}else{i(V,M);break}else r(V,M);M=M.sibling}M=ac(z,V.mode,ue),M.return=V,V=M}return v(V);case le:return be=z._init,nt(V,M,be(z._payload),ue)}if(ht(z))return pe(V,M,z,ue);if(X(z))return me(V,M,z,ue);da(V,z)}return typeof z=="string"&&z!==""||typeof z=="number"?(z=""+z,M!==null&&M.tag===6?(i(V,M.sibling),M=d(M,z),M.return=V,V=M):(i(V,M),M=oc(z,V.mode,ue),M.return=V,V=M),v(V)):i(V,M)}return nt}var Rs=Ef(!0),Tf=Ef(!1),ha=cr(null),fa=null,Os=null,gu=null;function xu(){gu=Os=fa=null}function yu(e){var r=ha.current;He(ha),e._currentValue=r}function vu(e,r,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,l!==null&&(l.childLanes|=r)):l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r),e===i)break;e=e.return}}function Bs(e,r){fa=e,gu=Os=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&r)!==0&&(_t=!0),e.firstContext=null)}function Jt(e){var r=e._currentValue;if(gu!==e)if(e={context:e,memoizedValue:r,next:null},Os===null){if(fa===null)throw Error(s(308));Os=e,fa.dependencies={lanes:0,firstContext:e}}else Os=Os.next=e;return r}var Qr=null;function wu(e){Qr===null?Qr=[e]:Qr.push(e)}function Pf(e,r,i,l){var d=r.interleaved;return d===null?(i.next=i,wu(r)):(i.next=d.next,d.next=i),r.interleaved=i,Vn(e,l)}function Vn(e,r){e.lanes|=r;var i=e.alternate;for(i!==null&&(i.lanes|=r),i=e,e=e.return;e!==null;)e.childLanes|=r,i=e.alternate,i!==null&&(i.childLanes|=r),i=e,e=e.return;return i.tag===3?i.stateNode:null}var fr=!1;function bu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mf(e,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function $n(e,r){return{eventTime:e,lane:r,tag:0,payload:null,callback:null,next:null}}function pr(e,r,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Le&2)!==0){var d=l.pending;return d===null?r.next=r:(r.next=d.next,d.next=r),l.pending=r,Vn(e,i)}return d=l.interleaved,d===null?(r.next=r,wu(l)):(r.next=d.next,d.next=r),l.interleaved=r,Vn(e,i)}function pa(e,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194240)!==0)){var l=r.lanes;l&=e.pendingLanes,i|=l,r.lanes=i,_l(e,i)}}function Df(e,r){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var v={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?d=p=v:p=p.next=v,i=i.next}while(i!==null);p===null?d=p=r:p=p.next=r}else d=p=r;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:l.shared,effects:l.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=r:e.next=r,i.lastBaseUpdate=r}function ma(e,r,i,l){var d=e.updateQueue;fr=!1;var p=d.firstBaseUpdate,v=d.lastBaseUpdate,S=d.shared.pending;if(S!==null){d.shared.pending=null;var P=S,H=P.next;P.next=null,v===null?p=H:v.next=H,v=P;var re=e.alternate;re!==null&&(re=re.updateQueue,S=re.lastBaseUpdate,S!==v&&(S===null?re.firstBaseUpdate=H:S.next=H,re.lastBaseUpdate=P))}if(p!==null){var se=d.baseState;v=0,re=H=P=null,S=p;do{var te=S.lane,de=S.eventTime;if((l&te)===te){re!==null&&(re=re.next={eventTime:de,lane:0,tag:S.tag,payload:S.payload,callback:S.callback,next:null});e:{var pe=e,me=S;switch(te=r,de=i,me.tag){case 1:if(pe=me.payload,typeof pe=="function"){se=pe.call(de,se,te);break e}se=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=me.payload,te=typeof pe=="function"?pe.call(de,se,te):pe,te==null)break e;se=Y({},se,te);break e;case 2:fr=!0}}S.callback!==null&&S.lane!==0&&(e.flags|=64,te=d.effects,te===null?d.effects=[S]:te.push(S))}else de={eventTime:de,lane:te,tag:S.tag,payload:S.payload,callback:S.callback,next:null},re===null?(H=re=de,P=se):re=re.next=de,v|=te;if(S=S.next,S===null){if(S=d.shared.pending,S===null)break;te=S,S=te.next,te.next=null,d.lastBaseUpdate=te,d.shared.pending=null}}while(!0);if(re===null&&(P=se),d.baseState=P,d.firstBaseUpdate=H,d.lastBaseUpdate=re,r=d.shared.interleaved,r!==null){d=r;do v|=d.lane,d=d.next;while(d!==r)}else p===null&&(d.shared.lanes=0);Xr|=v,e.lanes=v,e.memoizedState=se}}function Ff(e,r,i){if(e=r.effects,r.effects=null,e!==null)for(r=0;r<e.length;r++){var l=e[r],d=l.callback;if(d!==null){if(l.callback=null,l=i,typeof d!="function")throw Error(s(191,d));d.call(l)}}}var $i={},Sn=cr($i),zi=cr($i),Ui=cr($i);function Gr(e){if(e===$i)throw Error(s(174));return e}function ku(e,r){switch(Ue(Ui,r),Ue(zi,e),Ue(Sn,$i),e=r.nodeType,e){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:ee(null,"");break;default:e=e===8?r.parentNode:r,r=e.namespaceURI||null,e=e.tagName,r=ee(r,e)}He(Sn),Ue(Sn,r)}function Vs(){He(Sn),He(zi),He(Ui)}function If(e){Gr(Ui.current);var r=Gr(Sn.current),i=ee(r,e.type);r!==i&&(Ue(zi,e),Ue(Sn,i))}function ju(e){zi.current===e&&(He(Sn),He(zi))}var qe=cr(0);function ga(e){for(var r=e;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Nu=[];function Su(){for(var e=0;e<Nu.length;e++)Nu[e]._workInProgressVersionPrimary=null;Nu.length=0}var xa=$.ReactCurrentDispatcher,Cu=$.ReactCurrentBatchConfig,qr=0,Xe=null,at=null,ft=null,ya=!1,Wi=!1,Hi=0,Sv=0;function bt(){throw Error(s(321))}function Au(e,r){if(r===null)return!1;for(var i=0;i<r.length&&i<e.length;i++)if(!fn(e[i],r[i]))return!1;return!0}function Eu(e,r,i,l,d,p){if(qr=p,Xe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,xa.current=e===null||e.memoizedState===null?Tv:Pv,e=i(l,d),Wi){p=0;do{if(Wi=!1,Hi=0,25<=p)throw Error(s(301));p+=1,ft=at=null,r.updateQueue=null,xa.current=Mv,e=i(l,d)}while(Wi)}if(xa.current=ba,r=at!==null&&at.next!==null,qr=0,ft=at=Xe=null,ya=!1,r)throw Error(s(300));return e}function Tu(){var e=Hi!==0;return Hi=0,e}function Cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ft===null?Xe.memoizedState=ft=e:ft=ft.next=e,ft}function en(){if(at===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var r=ft===null?Xe.memoizedState:ft.next;if(r!==null)ft=r,at=e;else{if(e===null)throw Error(s(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},ft===null?Xe.memoizedState=ft=e:ft=ft.next=e}return ft}function Ki(e,r){return typeof r=="function"?r(e):r}function Pu(e){var r=en(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=at,d=l.baseQueue,p=i.pending;if(p!==null){if(d!==null){var v=d.next;d.next=p.next,p.next=v}l.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,l=l.baseState;var S=v=null,P=null,H=p;do{var re=H.lane;if((qr&re)===re)P!==null&&(P=P.next={lane:0,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),l=H.hasEagerState?H.eagerState:e(l,H.action);else{var se={lane:re,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null};P===null?(S=P=se,v=l):P=P.next=se,Xe.lanes|=re,Xr|=re}H=H.next}while(H!==null&&H!==p);P===null?v=l:P.next=S,fn(l,r.memoizedState)||(_t=!0),r.memoizedState=l,r.baseState=v,r.baseQueue=P,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,Xe.lanes|=p,Xr|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[r.memoizedState,i.dispatch]}function Mu(e){var r=en(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=i.dispatch,d=i.pending,p=r.memoizedState;if(d!==null){i.pending=null;var v=d=d.next;do p=e(p,v.action),v=v.next;while(v!==d);fn(p,r.memoizedState)||(_t=!0),r.memoizedState=p,r.baseQueue===null&&(r.baseState=p),i.lastRenderedState=p}return[p,l]}function _f(){}function Lf(e,r){var i=Xe,l=en(),d=r(),p=!fn(l.memoizedState,d);if(p&&(l.memoizedState=d,_t=!0),l=l.queue,Du(Bf.bind(null,i,l,e),[e]),l.getSnapshot!==r||p||ft!==null&&ft.memoizedState.tag&1){if(i.flags|=2048,Qi(9,Of.bind(null,i,l,d,r),void 0,null),pt===null)throw Error(s(349));(qr&30)!==0||Rf(i,r,d)}return d}function Rf(e,r,i){e.flags|=16384,e={getSnapshot:r,value:i},r=Xe.updateQueue,r===null?(r={lastEffect:null,stores:null},Xe.updateQueue=r,r.stores=[e]):(i=r.stores,i===null?r.stores=[e]:i.push(e))}function Of(e,r,i,l){r.value=i,r.getSnapshot=l,Vf(r)&&$f(e)}function Bf(e,r,i){return i(function(){Vf(r)&&$f(e)})}function Vf(e){var r=e.getSnapshot;e=e.value;try{var i=r();return!fn(e,i)}catch{return!0}}function $f(e){var r=Vn(e,1);r!==null&&yn(r,e,1,-1)}function zf(e){var r=Cn();return typeof e=="function"&&(e=e()),r.memoizedState=r.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ki,lastRenderedState:e},r.queue=e,e=e.dispatch=Ev.bind(null,Xe,e),[r.memoizedState,e]}function Qi(e,r,i,l){return e={tag:e,create:r,destroy:i,deps:l,next:null},r=Xe.updateQueue,r===null?(r={lastEffect:null,stores:null},Xe.updateQueue=r,r.lastEffect=e.next=e):(i=r.lastEffect,i===null?r.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,r.lastEffect=e)),e}function Uf(){return en().memoizedState}function va(e,r,i,l){var d=Cn();Xe.flags|=e,d.memoizedState=Qi(1|r,i,void 0,l===void 0?null:l)}function wa(e,r,i,l){var d=en();l=l===void 0?null:l;var p=void 0;if(at!==null){var v=at.memoizedState;if(p=v.destroy,l!==null&&Au(l,v.deps)){d.memoizedState=Qi(r,i,p,l);return}}Xe.flags|=e,d.memoizedState=Qi(1|r,i,p,l)}function Wf(e,r){return va(8390656,8,e,r)}function Du(e,r){return wa(2048,8,e,r)}function Hf(e,r){return wa(4,2,e,r)}function Kf(e,r){return wa(4,4,e,r)}function Qf(e,r){if(typeof r=="function")return e=e(),r(e),function(){r(null)};if(r!=null)return e=e(),r.current=e,function(){r.current=null}}function Gf(e,r,i){return i=i!=null?i.concat([e]):null,wa(4,4,Qf.bind(null,r,e),i)}function Fu(){}function qf(e,r){var i=en();r=r===void 0?null:r;var l=i.memoizedState;return l!==null&&r!==null&&Au(r,l[1])?l[0]:(i.memoizedState=[e,r],e)}function Xf(e,r){var i=en();r=r===void 0?null:r;var l=i.memoizedState;return l!==null&&r!==null&&Au(r,l[1])?l[0]:(e=e(),i.memoizedState=[e,r],e)}function Yf(e,r,i){return(qr&21)===0?(e.baseState&&(e.baseState=!1,_t=!0),e.memoizedState=i):(fn(i,r)||(i=Ch(),Xe.lanes|=i,Xr|=i,e.baseState=!0),r)}function Cv(e,r){var i=Ve;Ve=i!==0&&4>i?i:4,e(!0);var l=Cu.transition;Cu.transition={};try{e(!1),r()}finally{Ve=i,Cu.transition=l}}function Zf(){return en().memoizedState}function Av(e,r,i){var l=yr(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},Jf(e))ep(r,i);else if(i=Pf(e,r,i,l),i!==null){var d=Tt();yn(i,e,l,d),tp(i,r,l)}}function Ev(e,r,i){var l=yr(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(Jf(e))ep(r,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=r.lastRenderedReducer,p!==null))try{var v=r.lastRenderedState,S=p(v,i);if(d.hasEagerState=!0,d.eagerState=S,fn(S,v)){var P=r.interleaved;P===null?(d.next=d,wu(r)):(d.next=P.next,P.next=d),r.interleaved=d;return}}catch{}finally{}i=Pf(e,r,d,l),i!==null&&(d=Tt(),yn(i,e,l,d),tp(i,r,l))}}function Jf(e){var r=e.alternate;return e===Xe||r!==null&&r===Xe}function ep(e,r){Wi=ya=!0;var i=e.pending;i===null?r.next=r:(r.next=i.next,i.next=r),e.pending=r}function tp(e,r,i){if((i&4194240)!==0){var l=r.lanes;l&=e.pendingLanes,i|=l,r.lanes=i,_l(e,i)}}var ba={readContext:Jt,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useInsertionEffect:bt,useLayoutEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useMutableSource:bt,useSyncExternalStore:bt,useId:bt,unstable_isNewReconciler:!1},Tv={readContext:Jt,useCallback:function(e,r){return Cn().memoizedState=[e,r===void 0?null:r],e},useContext:Jt,useEffect:Wf,useImperativeHandle:function(e,r,i){return i=i!=null?i.concat([e]):null,va(4194308,4,Qf.bind(null,r,e),i)},useLayoutEffect:function(e,r){return va(4194308,4,e,r)},useInsertionEffect:function(e,r){return va(4,2,e,r)},useMemo:function(e,r){var i=Cn();return r=r===void 0?null:r,e=e(),i.memoizedState=[e,r],e},useReducer:function(e,r,i){var l=Cn();return r=i!==void 0?i(r):r,l.memoizedState=l.baseState=r,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},l.queue=e,e=e.dispatch=Av.bind(null,Xe,e),[l.memoizedState,e]},useRef:function(e){var r=Cn();return e={current:e},r.memoizedState=e},useState:zf,useDebugValue:Fu,useDeferredValue:function(e){return Cn().memoizedState=e},useTransition:function(){var e=zf(!1),r=e[0];return e=Cv.bind(null,e[1]),Cn().memoizedState=e,[r,e]},useMutableSource:function(){},useSyncExternalStore:function(e,r,i){var l=Xe,d=Cn();if(Ge){if(i===void 0)throw Error(s(407));i=i()}else{if(i=r(),pt===null)throw Error(s(349));(qr&30)!==0||Rf(l,r,i)}d.memoizedState=i;var p={value:i,getSnapshot:r};return d.queue=p,Wf(Bf.bind(null,l,p,e),[e]),l.flags|=2048,Qi(9,Of.bind(null,l,p,i,r),void 0,null),i},useId:function(){var e=Cn(),r=pt.identifierPrefix;if(Ge){var i=Bn,l=On;i=(l&~(1<<32-hn(l)-1)).toString(32)+i,r=":"+r+"R"+i,i=Hi++,0<i&&(r+="H"+i.toString(32)),r+=":"}else i=Sv++,r=":"+r+"r"+i.toString(32)+":";return e.memoizedState=r},unstable_isNewReconciler:!1},Pv={readContext:Jt,useCallback:qf,useContext:Jt,useEffect:Du,useImperativeHandle:Gf,useInsertionEffect:Hf,useLayoutEffect:Kf,useMemo:Xf,useReducer:Pu,useRef:Uf,useState:function(){return Pu(Ki)},useDebugValue:Fu,useDeferredValue:function(e){var r=en();return Yf(r,at.memoizedState,e)},useTransition:function(){var e=Pu(Ki)[0],r=en().memoizedState;return[e,r]},useMutableSource:_f,useSyncExternalStore:Lf,useId:Zf,unstable_isNewReconciler:!1},Mv={readContext:Jt,useCallback:qf,useContext:Jt,useEffect:Du,useImperativeHandle:Gf,useInsertionEffect:Hf,useLayoutEffect:Kf,useMemo:Xf,useReducer:Mu,useRef:Uf,useState:function(){return Mu(Ki)},useDebugValue:Fu,useDeferredValue:function(e){var r=en();return at===null?r.memoizedState=e:Yf(r,at.memoizedState,e)},useTransition:function(){var e=Mu(Ki)[0],r=en().memoizedState;return[e,r]},useMutableSource:_f,useSyncExternalStore:Lf,useId:Zf,unstable_isNewReconciler:!1};function mn(e,r){if(e&&e.defaultProps){r=Y({},r),e=e.defaultProps;for(var i in e)r[i]===void 0&&(r[i]=e[i]);return r}return r}function Iu(e,r,i,l){r=e.memoizedState,i=i(l,r),i=i==null?r:Y({},r,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var ka={isMounted:function(e){return(e=e._reactInternals)?zr(e)===e:!1},enqueueSetState:function(e,r,i){e=e._reactInternals;var l=Tt(),d=yr(e),p=$n(l,d);p.payload=r,i!=null&&(p.callback=i),r=pr(e,p,d),r!==null&&(yn(r,e,d,l),pa(r,e,d))},enqueueReplaceState:function(e,r,i){e=e._reactInternals;var l=Tt(),d=yr(e),p=$n(l,d);p.tag=1,p.payload=r,i!=null&&(p.callback=i),r=pr(e,p,d),r!==null&&(yn(r,e,d,l),pa(r,e,d))},enqueueForceUpdate:function(e,r){e=e._reactInternals;var i=Tt(),l=yr(e),d=$n(i,l);d.tag=2,r!=null&&(d.callback=r),r=pr(e,d,l),r!==null&&(yn(r,e,l,i),pa(r,e,l))}};function np(e,r,i,l,d,p,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,v):r.prototype&&r.prototype.isPureReactComponent?!Fi(i,l)||!Fi(d,p):!0}function rp(e,r,i){var l=!1,d=dr,p=r.contextType;return typeof p=="object"&&p!==null?p=Jt(p):(d=It(r)?Wr:wt.current,l=r.contextTypes,p=(l=l!=null)?Fs(e,d):dr),r=new r(i,p),e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=ka,e.stateNode=r,r._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),r}function sp(e,r,i,l){e=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,l),r.state!==e&&ka.enqueueReplaceState(r,r.state,null)}function _u(e,r,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},bu(e);var p=r.contextType;typeof p=="object"&&p!==null?d.context=Jt(p):(p=It(r)?Wr:wt.current,d.context=Fs(e,p)),d.state=e.memoizedState,p=r.getDerivedStateFromProps,typeof p=="function"&&(Iu(e,r,p,i),d.state=e.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(r=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),r!==d.state&&ka.enqueueReplaceState(d,d.state,null),ma(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function $s(e,r){try{var i="",l=r;do i+=Ce(l),l=l.return;while(l);var d=i}catch(p){d=`
|
|
39
|
+
Error generating stack: `+p.message+`
|
|
40
|
+
`+p.stack}return{value:e,source:r,stack:d,digest:null}}function Lu(e,r,i){return{value:e,source:null,stack:i??null,digest:r??null}}function Ru(e,r){try{console.error(r.value)}catch(i){setTimeout(function(){throw i})}}var Dv=typeof WeakMap=="function"?WeakMap:Map;function ip(e,r,i){i=$n(-1,i),i.tag=3,i.payload={element:null};var l=r.value;return i.callback=function(){Ta||(Ta=!0,Zu=l),Ru(e,r)},i}function op(e,r,i){i=$n(-1,i),i.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var d=r.value;i.payload=function(){return l(d)},i.callback=function(){Ru(e,r)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){Ru(e,r),typeof l!="function"&&(gr===null?gr=new Set([this]):gr.add(this));var v=r.stack;this.componentDidCatch(r.value,{componentStack:v!==null?v:""})}),i}function ap(e,r,i){var l=e.pingCache;if(l===null){l=e.pingCache=new Dv;var d=new Set;l.set(r,d)}else d=l.get(r),d===void 0&&(d=new Set,l.set(r,d));d.has(i)||(d.add(i),e=Kv.bind(null,e,r,i),r.then(e,e))}function lp(e){do{var r;if((r=e.tag===13)&&(r=e.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return e;e=e.return}while(e!==null);return null}function up(e,r,i,l,d){return(e.mode&1)===0?(e===r?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(r=$n(-1,1),r.tag=2,pr(i,r,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Fv=$.ReactCurrentOwner,_t=!1;function Et(e,r,i,l){r.child=e===null?Tf(r,null,i,l):Rs(r,e.child,i,l)}function cp(e,r,i,l,d){i=i.render;var p=r.ref;return Bs(r,d),l=Eu(e,r,i,l,p,d),i=Tu(),e!==null&&!_t?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~d,zn(e,r,d)):(Ge&&i&&du(r),r.flags|=1,Et(e,r,l,d),r.child)}function dp(e,r,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!ic(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(r.tag=15,r.type=p,hp(e,r,p,l,d)):(e=_a(i.type,null,l,r,r.mode,d),e.ref=r.ref,e.return=r,r.child=e)}if(p=e.child,(e.lanes&d)===0){var v=p.memoizedProps;if(i=i.compare,i=i!==null?i:Fi,i(v,l)&&e.ref===r.ref)return zn(e,r,d)}return r.flags|=1,e=wr(p,l),e.ref=r.ref,e.return=r,r.child=e}function hp(e,r,i,l,d){if(e!==null){var p=e.memoizedProps;if(Fi(p,l)&&e.ref===r.ref)if(_t=!1,r.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(_t=!0);else return r.lanes=e.lanes,zn(e,r,d)}return Ou(e,r,i,l,d)}function fp(e,r,i){var l=r.pendingProps,d=l.children,p=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ue(Us,Qt),Qt|=i;else{if((i&1073741824)===0)return e=p!==null?p.baseLanes|i:i,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:e,cachePool:null,transitions:null},r.updateQueue=null,Ue(Us,Qt),Qt|=e,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,Ue(Us,Qt),Qt|=l}else p!==null?(l=p.baseLanes|i,r.memoizedState=null):l=i,Ue(Us,Qt),Qt|=l;return Et(e,r,d,i),r.child}function pp(e,r){var i=r.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(r.flags|=512,r.flags|=2097152)}function Ou(e,r,i,l,d){var p=It(i)?Wr:wt.current;return p=Fs(r,p),Bs(r,d),i=Eu(e,r,i,l,p,d),l=Tu(),e!==null&&!_t?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~d,zn(e,r,d)):(Ge&&l&&du(r),r.flags|=1,Et(e,r,i,d),r.child)}function mp(e,r,i,l,d){if(It(i)){var p=!0;oa(r)}else p=!1;if(Bs(r,d),r.stateNode===null)Na(e,r),rp(r,i,l),_u(r,i,l,d),l=!0;else if(e===null){var v=r.stateNode,S=r.memoizedProps;v.props=S;var P=v.context,H=i.contextType;typeof H=="object"&&H!==null?H=Jt(H):(H=It(i)?Wr:wt.current,H=Fs(r,H));var re=i.getDerivedStateFromProps,se=typeof re=="function"||typeof v.getSnapshotBeforeUpdate=="function";se||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(S!==l||P!==H)&&sp(r,v,l,H),fr=!1;var te=r.memoizedState;v.state=te,ma(r,l,v,d),P=r.memoizedState,S!==l||te!==P||Ft.current||fr?(typeof re=="function"&&(Iu(r,i,re,l),P=r.memoizedState),(S=fr||np(r,i,S,l,te,P,H))?(se||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(r.flags|=4194308)):(typeof v.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=P),v.props=l,v.state=P,v.context=H,l=S):(typeof v.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{v=r.stateNode,Mf(e,r),S=r.memoizedProps,H=r.type===r.elementType?S:mn(r.type,S),v.props=H,se=r.pendingProps,te=v.context,P=i.contextType,typeof P=="object"&&P!==null?P=Jt(P):(P=It(i)?Wr:wt.current,P=Fs(r,P));var de=i.getDerivedStateFromProps;(re=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(S!==se||te!==P)&&sp(r,v,l,P),fr=!1,te=r.memoizedState,v.state=te,ma(r,l,v,d);var pe=r.memoizedState;S!==se||te!==pe||Ft.current||fr?(typeof de=="function"&&(Iu(r,i,de,l),pe=r.memoizedState),(H=fr||np(r,i,H,l,te,pe,P)||!1)?(re||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(l,pe,P),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(l,pe,P)),typeof v.componentDidUpdate=="function"&&(r.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof v.componentDidUpdate!="function"||S===e.memoizedProps&&te===e.memoizedState||(r.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&te===e.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=pe),v.props=l,v.state=pe,v.context=P,l=H):(typeof v.componentDidUpdate!="function"||S===e.memoizedProps&&te===e.memoizedState||(r.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&te===e.memoizedState||(r.flags|=1024),l=!1)}return Bu(e,r,i,l,p,d)}function Bu(e,r,i,l,d,p){pp(e,r);var v=(r.flags&128)!==0;if(!l&&!v)return d&&wf(r,i,!1),zn(e,r,p);l=r.stateNode,Fv.current=r;var S=v&&typeof i.getDerivedStateFromError!="function"?null:l.render();return r.flags|=1,e!==null&&v?(r.child=Rs(r,e.child,null,p),r.child=Rs(r,null,S,p)):Et(e,r,S,p),r.memoizedState=l.state,d&&wf(r,i,!0),r.child}function gp(e){var r=e.stateNode;r.pendingContext?yf(e,r.pendingContext,r.pendingContext!==r.context):r.context&&yf(e,r.context,!1),ku(e,r.containerInfo)}function xp(e,r,i,l,d){return Ls(),mu(d),r.flags|=256,Et(e,r,i,l),r.child}var Vu={dehydrated:null,treeContext:null,retryLane:0};function $u(e){return{baseLanes:e,cachePool:null,transitions:null}}function yp(e,r,i){var l=r.pendingProps,d=qe.current,p=!1,v=(r.flags&128)!==0,S;if((S=v)||(S=e!==null&&e.memoizedState===null?!1:(d&2)!==0),S?(p=!0,r.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),Ue(qe,d&1),e===null)return pu(r),e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((r.mode&1)===0?r.lanes=1:e.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(v=l.children,e=l.fallback,p?(l=r.mode,p=r.child,v={mode:"hidden",children:v},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=v):p=La(v,l,0,null),e=es(e,l,i,null),p.return=r,e.return=r,p.sibling=e,r.child=p,r.child.memoizedState=$u(i),r.memoizedState=Vu,e):zu(r,v));if(d=e.memoizedState,d!==null&&(S=d.dehydrated,S!==null))return Iv(e,r,v,l,S,d,i);if(p){p=l.fallback,v=r.mode,d=e.child,S=d.sibling;var P={mode:"hidden",children:l.children};return(v&1)===0&&r.child!==d?(l=r.child,l.childLanes=0,l.pendingProps=P,r.deletions=null):(l=wr(d,P),l.subtreeFlags=d.subtreeFlags&14680064),S!==null?p=wr(S,p):(p=es(p,v,i,null),p.flags|=2),p.return=r,l.return=r,l.sibling=p,r.child=l,l=p,p=r.child,v=e.child.memoizedState,v=v===null?$u(i):{baseLanes:v.baseLanes|i,cachePool:null,transitions:v.transitions},p.memoizedState=v,p.childLanes=e.childLanes&~i,r.memoizedState=Vu,l}return p=e.child,e=p.sibling,l=wr(p,{mode:"visible",children:l.children}),(r.mode&1)===0&&(l.lanes=i),l.return=r,l.sibling=null,e!==null&&(i=r.deletions,i===null?(r.deletions=[e],r.flags|=16):i.push(e)),r.child=l,r.memoizedState=null,l}function zu(e,r){return r=La({mode:"visible",children:r},e.mode,0,null),r.return=e,e.child=r}function ja(e,r,i,l){return l!==null&&mu(l),Rs(r,e.child,null,i),e=zu(r,r.pendingProps.children),e.flags|=2,r.memoizedState=null,e}function Iv(e,r,i,l,d,p,v){if(i)return r.flags&256?(r.flags&=-257,l=Lu(Error(s(422))),ja(e,r,v,l)):r.memoizedState!==null?(r.child=e.child,r.flags|=128,null):(p=l.fallback,d=r.mode,l=La({mode:"visible",children:l.children},d,0,null),p=es(p,d,v,null),p.flags|=2,l.return=r,p.return=r,l.sibling=p,r.child=l,(r.mode&1)!==0&&Rs(r,e.child,null,v),r.child.memoizedState=$u(v),r.memoizedState=Vu,p);if((r.mode&1)===0)return ja(e,r,v,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var S=l.dgst;return l=S,p=Error(s(419)),l=Lu(p,l,void 0),ja(e,r,v,l)}if(S=(v&e.childLanes)!==0,_t||S){if(l=pt,l!==null){switch(v&-v){case 4:d=2;break;case 16:d=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(l.suspendedLanes|v))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,Vn(e,d),yn(l,e,d,-1))}return sc(),l=Lu(Error(s(421))),ja(e,r,v,l)}return d.data==="$?"?(r.flags|=128,r.child=e.child,r=Qv.bind(null,e),d._reactRetry=r,null):(e=p.treeContext,Kt=ur(d.nextSibling),Ht=r,Ge=!0,pn=null,e!==null&&(Yt[Zt++]=On,Yt[Zt++]=Bn,Yt[Zt++]=Hr,On=e.id,Bn=e.overflow,Hr=r),r=zu(r,l.children),r.flags|=4096,r)}function vp(e,r,i){e.lanes|=r;var l=e.alternate;l!==null&&(l.lanes|=r),vu(e.return,r,i)}function Uu(e,r,i,l,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d}:(p.isBackwards=r,p.rendering=null,p.renderingStartTime=0,p.last=l,p.tail=i,p.tailMode=d)}function wp(e,r,i){var l=r.pendingProps,d=l.revealOrder,p=l.tail;if(Et(e,r,l.children,i),l=qe.current,(l&2)!==0)l=l&1|2,r.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=r.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vp(e,i,r);else if(e.tag===19)vp(e,i,r);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break e;for(;e.sibling===null;){if(e.return===null||e.return===r)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(Ue(qe,l),(r.mode&1)===0)r.memoizedState=null;else switch(d){case"forwards":for(i=r.child,d=null;i!==null;)e=i.alternate,e!==null&&ga(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=r.child,r.child=null):(d=i.sibling,i.sibling=null),Uu(r,!1,d,i,p);break;case"backwards":for(i=null,d=r.child,r.child=null;d!==null;){if(e=d.alternate,e!==null&&ga(e)===null){r.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}Uu(r,!0,i,null,p);break;case"together":Uu(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Na(e,r){(r.mode&1)===0&&e!==null&&(e.alternate=null,r.alternate=null,r.flags|=2)}function zn(e,r,i){if(e!==null&&(r.dependencies=e.dependencies),Xr|=r.lanes,(i&r.childLanes)===0)return null;if(e!==null&&r.child!==e.child)throw Error(s(153));if(r.child!==null){for(e=r.child,i=wr(e,e.pendingProps),r.child=i,i.return=r;e.sibling!==null;)e=e.sibling,i=i.sibling=wr(e,e.pendingProps),i.return=r;i.sibling=null}return r.child}function _v(e,r,i){switch(r.tag){case 3:gp(r),Ls();break;case 5:If(r);break;case 1:It(r.type)&&oa(r);break;case 4:ku(r,r.stateNode.containerInfo);break;case 10:var l=r.type._context,d=r.memoizedProps.value;Ue(ha,l._currentValue),l._currentValue=d;break;case 13:if(l=r.memoizedState,l!==null)return l.dehydrated!==null?(Ue(qe,qe.current&1),r.flags|=128,null):(i&r.child.childLanes)!==0?yp(e,r,i):(Ue(qe,qe.current&1),e=zn(e,r,i),e!==null?e.sibling:null);Ue(qe,qe.current&1);break;case 19:if(l=(i&r.childLanes)!==0,(e.flags&128)!==0){if(l)return wp(e,r,i);r.flags|=128}if(d=r.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Ue(qe,qe.current),l)break;return null;case 22:case 23:return r.lanes=0,fp(e,r,i)}return zn(e,r,i)}var bp,Wu,kp,jp;bp=function(e,r){for(var i=r.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},Wu=function(){},kp=function(e,r,i,l){var d=e.memoizedProps;if(d!==l){e=r.stateNode,Gr(Sn.current);var p=null;switch(i){case"input":d=ae(e,d),l=ae(e,l),p=[];break;case"select":d=Y({},d,{value:void 0}),l=Y({},l,{value:void 0}),p=[];break;case"textarea":d=kn(e,d),l=kn(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=ra)}dn(i,l);var v;i=null;for(H in d)if(!l.hasOwnProperty(H)&&d.hasOwnProperty(H)&&d[H]!=null)if(H==="style"){var S=d[H];for(v in S)S.hasOwnProperty(v)&&(i||(i={}),i[v]="")}else H!=="dangerouslySetInnerHTML"&&H!=="children"&&H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&H!=="autoFocus"&&(u.hasOwnProperty(H)?p||(p=[]):(p=p||[]).push(H,null));for(H in l){var P=l[H];if(S=d!=null?d[H]:void 0,l.hasOwnProperty(H)&&P!==S&&(P!=null||S!=null))if(H==="style")if(S){for(v in S)!S.hasOwnProperty(v)||P&&P.hasOwnProperty(v)||(i||(i={}),i[v]="");for(v in P)P.hasOwnProperty(v)&&S[v]!==P[v]&&(i||(i={}),i[v]=P[v])}else i||(p||(p=[]),p.push(H,i)),i=P;else H==="dangerouslySetInnerHTML"?(P=P?P.__html:void 0,S=S?S.__html:void 0,P!=null&&S!==P&&(p=p||[]).push(H,P)):H==="children"?typeof P!="string"&&typeof P!="number"||(p=p||[]).push(H,""+P):H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&(u.hasOwnProperty(H)?(P!=null&&H==="onScroll"&&We("scroll",e),p||S===P||(p=[])):(p=p||[]).push(H,P))}i&&(p=p||[]).push("style",i);var H=p;(r.updateQueue=H)&&(r.flags|=4)}},jp=function(e,r,i,l){i!==l&&(r.flags|=4)};function Gi(e,r){if(!Ge)switch(e.tailMode){case"hidden":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function kt(e){var r=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(r)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&14680064,l|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=i,r}function Lv(e,r,i){var l=r.pendingProps;switch(hu(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(r),null;case 1:return It(r.type)&&ia(),kt(r),null;case 3:return l=r.stateNode,Vs(),He(Ft),He(wt),Su(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ca(r)?r.flags|=4:e===null||e.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,pn!==null&&(tc(pn),pn=null))),Wu(e,r),kt(r),null;case 5:ju(r);var d=Gr(Ui.current);if(i=r.type,e!==null&&r.stateNode!=null)kp(e,r,i,l,d),e.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!l){if(r.stateNode===null)throw Error(s(166));return kt(r),null}if(e=Gr(Sn.current),ca(r)){l=r.stateNode,i=r.type;var p=r.memoizedProps;switch(l[Nn]=r,l[Oi]=p,e=(r.mode&1)!==0,i){case"dialog":We("cancel",l),We("close",l);break;case"iframe":case"object":case"embed":We("load",l);break;case"video":case"audio":for(d=0;d<_i.length;d++)We(_i[d],l);break;case"source":We("error",l);break;case"img":case"image":case"link":We("error",l),We("load",l);break;case"details":We("toggle",l);break;case"input":Me(l,p),We("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},We("invalid",l);break;case"textarea":tr(l,p),We("invalid",l)}dn(i,p),d=null;for(var v in p)if(p.hasOwnProperty(v)){var S=p[v];v==="children"?typeof S=="string"?l.textContent!==S&&(p.suppressHydrationWarning!==!0&&na(l.textContent,S,e),d=["children",S]):typeof S=="number"&&l.textContent!==""+S&&(p.suppressHydrationWarning!==!0&&na(l.textContent,S,e),d=["children",""+S]):u.hasOwnProperty(v)&&S!=null&&v==="onScroll"&&We("scroll",l)}switch(i){case"input":Xt(l),$e(l,p,!0);break;case"textarea":Xt(l),Or(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=ra)}l=d,r.updateQueue=l,l!==null&&(r.flags|=4)}else{v=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=bs(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=v.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=v.createElement(i,{is:l.is}):(e=v.createElement(i),i==="select"&&(v=e,l.multiple?v.multiple=!0:l.size&&(v.size=l.size))):e=v.createElementNS(e,i),e[Nn]=r,e[Oi]=l,bp(e,r,!1,!1),r.stateNode=e;e:{switch(v=Br(i,l),i){case"dialog":We("cancel",e),We("close",e),d=l;break;case"iframe":case"object":case"embed":We("load",e),d=l;break;case"video":case"audio":for(d=0;d<_i.length;d++)We(_i[d],e);d=l;break;case"source":We("error",e),d=l;break;case"img":case"image":case"link":We("error",e),We("load",e),d=l;break;case"details":We("toggle",e),d=l;break;case"input":Me(e,l),d=ae(e,l),We("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=Y({},l,{value:void 0}),We("invalid",e);break;case"textarea":tr(e,l),d=kn(e,l),We("invalid",e);break;default:d=l}dn(i,d),S=d;for(p in S)if(S.hasOwnProperty(p)){var P=S[p];p==="style"?st(e,P):p==="dangerouslySetInnerHTML"?(P=P?P.__html:void 0,P!=null&&ve(e,P)):p==="children"?typeof P=="string"?(i!=="textarea"||P!=="")&&ie(e,P):typeof P=="number"&&ie(e,""+P):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(u.hasOwnProperty(p)?P!=null&&p==="onScroll"&&We("scroll",e):P!=null&&W(e,p,P,v))}switch(i){case"input":Xt(e),$e(e,l,!1);break;case"textarea":Xt(e),Or(e);break;case"option":l.value!=null&&e.setAttribute("value",""+je(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?zt(e,!!l.multiple,p,!1):l.defaultValue!=null&&zt(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=ra)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return kt(r),null;case 6:if(e&&r.stateNode!=null)jp(e,r,e.memoizedProps,l);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(i=Gr(Ui.current),Gr(Sn.current),ca(r)){if(l=r.stateNode,i=r.memoizedProps,l[Nn]=r,(p=l.nodeValue!==i)&&(e=Ht,e!==null))switch(e.tag){case 3:na(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&na(l.nodeValue,i,(e.mode&1)!==0)}p&&(r.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[Nn]=r,r.stateNode=l}return kt(r),null;case 13:if(He(qe),l=r.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ge&&Kt!==null&&(r.mode&1)!==0&&(r.flags&128)===0)Cf(),Ls(),r.flags|=98560,p=!1;else if(p=ca(r),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(s(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[Nn]=r}else Ls(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;kt(r),p=!1}else pn!==null&&(tc(pn),pn=null),p=!0;if(!p)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=i,r):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(r.child.flags|=8192,(r.mode&1)!==0&&(e===null||(qe.current&1)!==0?lt===0&&(lt=3):sc())),r.updateQueue!==null&&(r.flags|=4),kt(r),null);case 4:return Vs(),Wu(e,r),e===null&&Li(r.stateNode.containerInfo),kt(r),null;case 10:return yu(r.type._context),kt(r),null;case 17:return It(r.type)&&ia(),kt(r),null;case 19:if(He(qe),p=r.memoizedState,p===null)return kt(r),null;if(l=(r.flags&128)!==0,v=p.rendering,v===null)if(l)Gi(p,!1);else{if(lt!==0||e!==null&&(e.flags&128)!==0)for(e=r.child;e!==null;){if(v=ga(e),v!==null){for(r.flags|=128,Gi(p,!1),l=v.updateQueue,l!==null&&(r.updateQueue=l,r.flags|=4),r.subtreeFlags=0,l=i,i=r.child;i!==null;)p=i,e=l,p.flags&=14680066,v=p.alternate,v===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=v.childLanes,p.lanes=v.lanes,p.child=v.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=v.memoizedProps,p.memoizedState=v.memoizedState,p.updateQueue=v.updateQueue,p.type=v.type,e=v.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return Ue(qe,qe.current&1|2),r.child}e=e.sibling}p.tail!==null&&tt()>Ws&&(r.flags|=128,l=!0,Gi(p,!1),r.lanes=4194304)}else{if(!l)if(e=ga(v),e!==null){if(r.flags|=128,l=!0,i=e.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),Gi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!v.alternate&&!Ge)return kt(r),null}else 2*tt()-p.renderingStartTime>Ws&&i!==1073741824&&(r.flags|=128,l=!0,Gi(p,!1),r.lanes=4194304);p.isBackwards?(v.sibling=r.child,r.child=v):(i=p.last,i!==null?i.sibling=v:r.child=v,p.last=v)}return p.tail!==null?(r=p.tail,p.rendering=r,p.tail=r.sibling,p.renderingStartTime=tt(),r.sibling=null,i=qe.current,Ue(qe,l?i&1|2:i&1),r):(kt(r),null);case 22:case 23:return rc(),l=r.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(r.flags|=8192),l&&(r.mode&1)!==0?(Qt&1073741824)!==0&&(kt(r),r.subtreeFlags&6&&(r.flags|=8192)):kt(r),null;case 24:return null;case 25:return null}throw Error(s(156,r.tag))}function Rv(e,r){switch(hu(r),r.tag){case 1:return It(r.type)&&ia(),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 3:return Vs(),He(Ft),He(wt),Su(),e=r.flags,(e&65536)!==0&&(e&128)===0?(r.flags=e&-65537|128,r):null;case 5:return ju(r),null;case 13:if(He(qe),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Ls()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return He(qe),null;case 4:return Vs(),null;case 10:return yu(r.type._context),null;case 22:case 23:return rc(),null;case 24:return null;default:return null}}var Sa=!1,jt=!1,Ov=typeof WeakSet=="function"?WeakSet:Set,fe=null;function zs(e,r){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){Ze(e,r,l)}else i.current=null}function Hu(e,r,i){try{i()}catch(l){Ze(e,r,l)}}var Np=!1;function Bv(e,r){if(ru=Ho,e=tf(),ql(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var v=0,S=-1,P=-1,H=0,re=0,se=e,te=null;t:for(;;){for(var de;se!==i||d!==0&&se.nodeType!==3||(S=v+d),se!==p||l!==0&&se.nodeType!==3||(P=v+l),se.nodeType===3&&(v+=se.nodeValue.length),(de=se.firstChild)!==null;)te=se,se=de;for(;;){if(se===e)break t;if(te===i&&++H===d&&(S=v),te===p&&++re===l&&(P=v),(de=se.nextSibling)!==null)break;se=te,te=se.parentNode}se=de}i=S===-1||P===-1?null:{start:S,end:P}}else i=null}i=i||{start:0,end:0}}else i=null;for(su={focusedElem:e,selectionRange:i},Ho=!1,fe=r;fe!==null;)if(r=fe,e=r.child,(r.subtreeFlags&1028)!==0&&e!==null)e.return=r,fe=e;else for(;fe!==null;){r=fe;try{var pe=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var me=pe.memoizedProps,nt=pe.memoizedState,V=r.stateNode,M=V.getSnapshotBeforeUpdate(r.elementType===r.type?me:mn(r.type,me),nt);V.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var z=r.stateNode.containerInfo;z.nodeType===1?z.textContent="":z.nodeType===9&&z.documentElement&&z.removeChild(z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(ue){Ze(r,r.return,ue)}if(e=r.sibling,e!==null){e.return=r.return,fe=e;break}fe=r.return}return pe=Np,Np=!1,pe}function qi(e,r,i){var l=r.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&e)===e){var p=d.destroy;d.destroy=void 0,p!==void 0&&Hu(r,i,p)}d=d.next}while(d!==l)}}function Ca(e,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var l=i.create;i.destroy=l()}i=i.next}while(i!==r)}}function Ku(e){var r=e.ref;if(r!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof r=="function"?r(e):r.current=e}}function Sp(e){var r=e.alternate;r!==null&&(e.alternate=null,Sp(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&(delete r[Nn],delete r[Oi],delete r[lu],delete r[bv],delete r[kv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Cp(e){return e.tag===5||e.tag===3||e.tag===4}function Ap(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qu(e,r,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,r?i.nodeType===8?i.parentNode.insertBefore(e,r):i.insertBefore(e,r):(i.nodeType===8?(r=i.parentNode,r.insertBefore(e,i)):(r=i,r.appendChild(e)),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=ra));else if(l!==4&&(e=e.child,e!==null))for(Qu(e,r,i),e=e.sibling;e!==null;)Qu(e,r,i),e=e.sibling}function Gu(e,r,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,r?i.insertBefore(e,r):i.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Gu(e,r,i),e=e.sibling;e!==null;)Gu(e,r,i),e=e.sibling}var xt=null,gn=!1;function mr(e,r,i){for(i=i.child;i!==null;)Ep(e,r,i),i=i.sibling}function Ep(e,r,i){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(Bo,i)}catch{}switch(i.tag){case 5:jt||zs(i,r);case 6:var l=xt,d=gn;xt=null,mr(e,r,i),xt=l,gn=d,xt!==null&&(gn?(e=xt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):xt.removeChild(i.stateNode));break;case 18:xt!==null&&(gn?(e=xt,i=i.stateNode,e.nodeType===8?au(e.parentNode,i):e.nodeType===1&&au(e,i),Ai(e)):au(xt,i.stateNode));break;case 4:l=xt,d=gn,xt=i.stateNode.containerInfo,gn=!0,mr(e,r,i),xt=l,gn=d;break;case 0:case 11:case 14:case 15:if(!jt&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var p=d,v=p.destroy;p=p.tag,v!==void 0&&((p&2)!==0||(p&4)!==0)&&Hu(i,r,v),d=d.next}while(d!==l)}mr(e,r,i);break;case 1:if(!jt&&(zs(i,r),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(S){Ze(i,r,S)}mr(e,r,i);break;case 21:mr(e,r,i);break;case 22:i.mode&1?(jt=(l=jt)||i.memoizedState!==null,mr(e,r,i),jt=l):mr(e,r,i);break;default:mr(e,r,i)}}function Tp(e){var r=e.updateQueue;if(r!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Ov),r.forEach(function(l){var d=Gv.bind(null,e,l);i.has(l)||(i.add(l),l.then(d,d))})}}function xn(e,r){var i=r.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];try{var p=e,v=r,S=v;e:for(;S!==null;){switch(S.tag){case 5:xt=S.stateNode,gn=!1;break e;case 3:xt=S.stateNode.containerInfo,gn=!0;break e;case 4:xt=S.stateNode.containerInfo,gn=!0;break e}S=S.return}if(xt===null)throw Error(s(160));Ep(p,v,d),xt=null,gn=!1;var P=d.alternate;P!==null&&(P.return=null),d.return=null}catch(H){Ze(d,r,H)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)Pp(r,e),r=r.sibling}function Pp(e,r){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xn(r,e),An(e),l&4){try{qi(3,e,e.return),Ca(3,e)}catch(me){Ze(e,e.return,me)}try{qi(5,e,e.return)}catch(me){Ze(e,e.return,me)}}break;case 1:xn(r,e),An(e),l&512&&i!==null&&zs(i,i.return);break;case 5:if(xn(r,e),An(e),l&512&&i!==null&&zs(i,i.return),e.flags&32){var d=e.stateNode;try{ie(d,"")}catch(me){Ze(e,e.return,me)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,v=i!==null?i.memoizedProps:p,S=e.type,P=e.updateQueue;if(e.updateQueue=null,P!==null)try{S==="input"&&p.type==="radio"&&p.name!=null&&Z(d,p),Br(S,v);var H=Br(S,p);for(v=0;v<P.length;v+=2){var re=P[v],se=P[v+1];re==="style"?st(d,se):re==="dangerouslySetInnerHTML"?ve(d,se):re==="children"?ie(d,se):W(d,re,se,H)}switch(S){case"input":he(d,p);break;case"textarea":_n(d,p);break;case"select":var te=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var de=p.value;de!=null?zt(d,!!p.multiple,de,!1):te!==!!p.multiple&&(p.defaultValue!=null?zt(d,!!p.multiple,p.defaultValue,!0):zt(d,!!p.multiple,p.multiple?[]:"",!1))}d[Oi]=p}catch(me){Ze(e,e.return,me)}}break;case 6:if(xn(r,e),An(e),l&4){if(e.stateNode===null)throw Error(s(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(me){Ze(e,e.return,me)}}break;case 3:if(xn(r,e),An(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ai(r.containerInfo)}catch(me){Ze(e,e.return,me)}break;case 4:xn(r,e),An(e);break;case 13:xn(r,e),An(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Yu=tt())),l&4&&Tp(e);break;case 22:if(re=i!==null&&i.memoizedState!==null,e.mode&1?(jt=(H=jt)||re,xn(r,e),jt=H):xn(r,e),An(e),l&8192){if(H=e.memoizedState!==null,(e.stateNode.isHidden=H)&&!re&&(e.mode&1)!==0)for(fe=e,re=e.child;re!==null;){for(se=fe=re;fe!==null;){switch(te=fe,de=te.child,te.tag){case 0:case 11:case 14:case 15:qi(4,te,te.return);break;case 1:zs(te,te.return);var pe=te.stateNode;if(typeof pe.componentWillUnmount=="function"){l=te,i=te.return;try{r=l,pe.props=r.memoizedProps,pe.state=r.memoizedState,pe.componentWillUnmount()}catch(me){Ze(l,i,me)}}break;case 5:zs(te,te.return);break;case 22:if(te.memoizedState!==null){Fp(se);continue}}de!==null?(de.return=te,fe=de):Fp(se)}re=re.sibling}e:for(re=null,se=e;;){if(se.tag===5){if(re===null){re=se;try{d=se.stateNode,H?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(S=se.stateNode,P=se.memoizedProps.style,v=P!=null&&P.hasOwnProperty("display")?P.display:null,S.style.display=Dt("display",v))}catch(me){Ze(e,e.return,me)}}}else if(se.tag===6){if(re===null)try{se.stateNode.nodeValue=H?"":se.memoizedProps}catch(me){Ze(e,e.return,me)}}else if((se.tag!==22&&se.tag!==23||se.memoizedState===null||se===e)&&se.child!==null){se.child.return=se,se=se.child;continue}if(se===e)break e;for(;se.sibling===null;){if(se.return===null||se.return===e)break e;re===se&&(re=null),se=se.return}re===se&&(re=null),se.sibling.return=se.return,se=se.sibling}}break;case 19:xn(r,e),An(e),l&4&&Tp(e);break;case 21:break;default:xn(r,e),An(e)}}function An(e){var r=e.flags;if(r&2){try{e:{for(var i=e.return;i!==null;){if(Cp(i)){var l=i;break e}i=i.return}throw Error(s(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(ie(d,""),l.flags&=-33);var p=Ap(e);Gu(e,p,d);break;case 3:case 4:var v=l.stateNode.containerInfo,S=Ap(e);Qu(e,S,v);break;default:throw Error(s(161))}}catch(P){Ze(e,e.return,P)}e.flags&=-3}r&4096&&(e.flags&=-4097)}function Vv(e,r,i){fe=e,Mp(e)}function Mp(e,r,i){for(var l=(e.mode&1)!==0;fe!==null;){var d=fe,p=d.child;if(d.tag===22&&l){var v=d.memoizedState!==null||Sa;if(!v){var S=d.alternate,P=S!==null&&S.memoizedState!==null||jt;S=Sa;var H=jt;if(Sa=v,(jt=P)&&!H)for(fe=d;fe!==null;)v=fe,P=v.child,v.tag===22&&v.memoizedState!==null?Ip(d):P!==null?(P.return=v,fe=P):Ip(d);for(;p!==null;)fe=p,Mp(p),p=p.sibling;fe=d,Sa=S,jt=H}Dp(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,fe=p):Dp(e)}}function Dp(e){for(;fe!==null;){var r=fe;if((r.flags&8772)!==0){var i=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:jt||Ca(5,r);break;case 1:var l=r.stateNode;if(r.flags&4&&!jt)if(i===null)l.componentDidMount();else{var d=r.elementType===r.type?i.memoizedProps:mn(r.type,i.memoizedProps);l.componentDidUpdate(d,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var p=r.updateQueue;p!==null&&Ff(r,p,l);break;case 3:var v=r.updateQueue;if(v!==null){if(i=null,r.child!==null)switch(r.child.tag){case 5:i=r.child.stateNode;break;case 1:i=r.child.stateNode}Ff(r,v,i)}break;case 5:var S=r.stateNode;if(i===null&&r.flags&4){i=S;var P=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":P.autoFocus&&i.focus();break;case"img":P.src&&(i.src=P.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var H=r.alternate;if(H!==null){var re=H.memoizedState;if(re!==null){var se=re.dehydrated;se!==null&&Ai(se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}jt||r.flags&512&&Ku(r)}catch(te){Ze(r,r.return,te)}}if(r===e){fe=null;break}if(i=r.sibling,i!==null){i.return=r.return,fe=i;break}fe=r.return}}function Fp(e){for(;fe!==null;){var r=fe;if(r===e){fe=null;break}var i=r.sibling;if(i!==null){i.return=r.return,fe=i;break}fe=r.return}}function Ip(e){for(;fe!==null;){var r=fe;try{switch(r.tag){case 0:case 11:case 15:var i=r.return;try{Ca(4,r)}catch(P){Ze(r,i,P)}break;case 1:var l=r.stateNode;if(typeof l.componentDidMount=="function"){var d=r.return;try{l.componentDidMount()}catch(P){Ze(r,d,P)}}var p=r.return;try{Ku(r)}catch(P){Ze(r,p,P)}break;case 5:var v=r.return;try{Ku(r)}catch(P){Ze(r,v,P)}}}catch(P){Ze(r,r.return,P)}if(r===e){fe=null;break}var S=r.sibling;if(S!==null){S.return=r.return,fe=S;break}fe=r.return}}var $v=Math.ceil,Aa=$.ReactCurrentDispatcher,qu=$.ReactCurrentOwner,tn=$.ReactCurrentBatchConfig,Le=0,pt=null,it=null,yt=0,Qt=0,Us=cr(0),lt=0,Xi=null,Xr=0,Ea=0,Xu=0,Yi=null,Lt=null,Yu=0,Ws=1/0,Un=null,Ta=!1,Zu=null,gr=null,Pa=!1,xr=null,Ma=0,Zi=0,Ju=null,Da=-1,Fa=0;function Tt(){return(Le&6)!==0?tt():Da!==-1?Da:Da=tt()}function yr(e){return(e.mode&1)===0?1:(Le&2)!==0&&yt!==0?yt&-yt:Nv.transition!==null?(Fa===0&&(Fa=Ch()),Fa):(e=Ve,e!==0||(e=window.event,e=e===void 0?16:_h(e.type)),e)}function yn(e,r,i,l){if(50<Zi)throw Zi=0,Ju=null,Error(s(185));ki(e,i,l),((Le&2)===0||e!==pt)&&(e===pt&&((Le&2)===0&&(Ea|=i),lt===4&&vr(e,yt)),Rt(e,l),i===1&&Le===0&&(r.mode&1)===0&&(Ws=tt()+500,aa&&hr()))}function Rt(e,r){var i=e.callbackNode;Ny(e,r);var l=zo(e,e===pt?yt:0);if(l===0)i!==null&&jh(i),e.callbackNode=null,e.callbackPriority=0;else if(r=l&-l,e.callbackPriority!==r){if(i!=null&&jh(i),r===1)e.tag===0?jv(Lp.bind(null,e)):bf(Lp.bind(null,e)),vv(function(){(Le&6)===0&&hr()}),i=null;else{switch(Ah(l)){case 1:i=Dl;break;case 4:i=Nh;break;case 16:i=Oo;break;case 536870912:i=Sh;break;default:i=Oo}i=Wp(i,_p.bind(null,e))}e.callbackPriority=r,e.callbackNode=i}}function _p(e,r){if(Da=-1,Fa=0,(Le&6)!==0)throw Error(s(327));var i=e.callbackNode;if(Hs()&&e.callbackNode!==i)return null;var l=zo(e,e===pt?yt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||r)r=Ia(e,l);else{r=l;var d=Le;Le|=2;var p=Op();(pt!==e||yt!==r)&&(Un=null,Ws=tt()+500,Zr(e,r));do try{Wv();break}catch(S){Rp(e,S)}while(!0);xu(),Aa.current=p,Le=d,it!==null?r=0:(pt=null,yt=0,r=lt)}if(r!==0){if(r===2&&(d=Fl(e),d!==0&&(l=d,r=ec(e,d))),r===1)throw i=Xi,Zr(e,0),vr(e,l),Rt(e,tt()),i;if(r===6)vr(e,l);else{if(d=e.current.alternate,(l&30)===0&&!zv(d)&&(r=Ia(e,l),r===2&&(p=Fl(e),p!==0&&(l=p,r=ec(e,p))),r===1))throw i=Xi,Zr(e,0),vr(e,l),Rt(e,tt()),i;switch(e.finishedWork=d,e.finishedLanes=l,r){case 0:case 1:throw Error(s(345));case 2:Jr(e,Lt,Un);break;case 3:if(vr(e,l),(l&130023424)===l&&(r=Yu+500-tt(),10<r)){if(zo(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){Tt(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=ou(Jr.bind(null,e,Lt,Un),r);break}Jr(e,Lt,Un);break;case 4:if(vr(e,l),(l&4194240)===l)break;for(r=e.eventTimes,d=-1;0<l;){var v=31-hn(l);p=1<<v,v=r[v],v>d&&(d=v),l&=~p}if(l=d,l=tt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*$v(l/1960))-l,10<l){e.timeoutHandle=ou(Jr.bind(null,e,Lt,Un),l);break}Jr(e,Lt,Un);break;case 5:Jr(e,Lt,Un);break;default:throw Error(s(329))}}}return Rt(e,tt()),e.callbackNode===i?_p.bind(null,e):null}function ec(e,r){var i=Yi;return e.current.memoizedState.isDehydrated&&(Zr(e,r).flags|=256),e=Ia(e,r),e!==2&&(r=Lt,Lt=i,r!==null&&tc(r)),e}function tc(e){Lt===null?Lt=e:Lt.push.apply(Lt,e)}function zv(e){for(var r=e;;){if(r.flags&16384){var i=r.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var l=0;l<i.length;l++){var d=i[l],p=d.getSnapshot;d=d.value;try{if(!fn(p(),d))return!1}catch{return!1}}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function vr(e,r){for(r&=~Xu,r&=~Ea,e.suspendedLanes|=r,e.pingedLanes&=~r,e=e.expirationTimes;0<r;){var i=31-hn(r),l=1<<i;e[i]=-1,r&=~l}}function Lp(e){if((Le&6)!==0)throw Error(s(327));Hs();var r=zo(e,0);if((r&1)===0)return Rt(e,tt()),null;var i=Ia(e,r);if(e.tag!==0&&i===2){var l=Fl(e);l!==0&&(r=l,i=ec(e,l))}if(i===1)throw i=Xi,Zr(e,0),vr(e,r),Rt(e,tt()),i;if(i===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=r,Jr(e,Lt,Un),Rt(e,tt()),null}function nc(e,r){var i=Le;Le|=1;try{return e(r)}finally{Le=i,Le===0&&(Ws=tt()+500,aa&&hr())}}function Yr(e){xr!==null&&xr.tag===0&&(Le&6)===0&&Hs();var r=Le;Le|=1;var i=tn.transition,l=Ve;try{if(tn.transition=null,Ve=1,e)return e()}finally{Ve=l,tn.transition=i,Le=r,(Le&6)===0&&hr()}}function rc(){Qt=Us.current,He(Us)}function Zr(e,r){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,yv(i)),it!==null)for(i=it.return;i!==null;){var l=i;switch(hu(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&ia();break;case 3:Vs(),He(Ft),He(wt),Su();break;case 5:ju(l);break;case 4:Vs();break;case 13:He(qe);break;case 19:He(qe);break;case 10:yu(l.type._context);break;case 22:case 23:rc()}i=i.return}if(pt=e,it=e=wr(e.current,null),yt=Qt=r,lt=0,Xi=null,Xu=Ea=Xr=0,Lt=Yi=null,Qr!==null){for(r=0;r<Qr.length;r++)if(i=Qr[r],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,p=i.pending;if(p!==null){var v=p.next;p.next=d,l.next=v}i.pending=l}Qr=null}return e}function Rp(e,r){do{var i=it;try{if(xu(),xa.current=ba,ya){for(var l=Xe.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}ya=!1}if(qr=0,ft=at=Xe=null,Wi=!1,Hi=0,qu.current=null,i===null||i.return===null){lt=1,Xi=r,it=null;break}e:{var p=e,v=i.return,S=i,P=r;if(r=yt,S.flags|=32768,P!==null&&typeof P=="object"&&typeof P.then=="function"){var H=P,re=S,se=re.tag;if((re.mode&1)===0&&(se===0||se===11||se===15)){var te=re.alternate;te?(re.updateQueue=te.updateQueue,re.memoizedState=te.memoizedState,re.lanes=te.lanes):(re.updateQueue=null,re.memoizedState=null)}var de=lp(v);if(de!==null){de.flags&=-257,up(de,v,S,p,r),de.mode&1&&ap(p,H,r),r=de,P=H;var pe=r.updateQueue;if(pe===null){var me=new Set;me.add(P),r.updateQueue=me}else pe.add(P);break e}else{if((r&1)===0){ap(p,H,r),sc();break e}P=Error(s(426))}}else if(Ge&&S.mode&1){var nt=lp(v);if(nt!==null){(nt.flags&65536)===0&&(nt.flags|=256),up(nt,v,S,p,r),mu($s(P,S));break e}}p=P=$s(P,S),lt!==4&&(lt=2),Yi===null?Yi=[p]:Yi.push(p),p=v;do{switch(p.tag){case 3:p.flags|=65536,r&=-r,p.lanes|=r;var V=ip(p,P,r);Df(p,V);break e;case 1:S=P;var M=p.type,z=p.stateNode;if((p.flags&128)===0&&(typeof M.getDerivedStateFromError=="function"||z!==null&&typeof z.componentDidCatch=="function"&&(gr===null||!gr.has(z)))){p.flags|=65536,r&=-r,p.lanes|=r;var ue=op(p,S,r);Df(p,ue);break e}}p=p.return}while(p!==null)}Vp(i)}catch(xe){r=xe,it===i&&i!==null&&(it=i=i.return);continue}break}while(!0)}function Op(){var e=Aa.current;return Aa.current=ba,e===null?ba:e}function sc(){(lt===0||lt===3||lt===2)&&(lt=4),pt===null||(Xr&268435455)===0&&(Ea&268435455)===0||vr(pt,yt)}function Ia(e,r){var i=Le;Le|=2;var l=Op();(pt!==e||yt!==r)&&(Un=null,Zr(e,r));do try{Uv();break}catch(d){Rp(e,d)}while(!0);if(xu(),Le=i,Aa.current=l,it!==null)throw Error(s(261));return pt=null,yt=0,lt}function Uv(){for(;it!==null;)Bp(it)}function Wv(){for(;it!==null&&!my();)Bp(it)}function Bp(e){var r=Up(e.alternate,e,Qt);e.memoizedProps=e.pendingProps,r===null?Vp(e):it=r,qu.current=null}function Vp(e){var r=e;do{var i=r.alternate;if(e=r.return,(r.flags&32768)===0){if(i=Lv(i,r,Qt),i!==null){it=i;return}}else{if(i=Rv(i,r),i!==null){i.flags&=32767,it=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{lt=6,it=null;return}}if(r=r.sibling,r!==null){it=r;return}it=r=e}while(r!==null);lt===0&&(lt=5)}function Jr(e,r,i){var l=Ve,d=tn.transition;try{tn.transition=null,Ve=1,Hv(e,r,i,l)}finally{tn.transition=d,Ve=l}return null}function Hv(e,r,i,l){do Hs();while(xr!==null);if((Le&6)!==0)throw Error(s(327));i=e.finishedWork;var d=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(Sy(e,p),e===pt&&(it=pt=null,yt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Pa||(Pa=!0,Wp(Oo,function(){return Hs(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=tn.transition,tn.transition=null;var v=Ve;Ve=1;var S=Le;Le|=4,qu.current=null,Bv(e,i),Pp(i,e),dv(su),Ho=!!ru,su=ru=null,e.current=i,Vv(i),gy(),Le=S,Ve=v,tn.transition=p}else e.current=i;if(Pa&&(Pa=!1,xr=e,Ma=d),p=e.pendingLanes,p===0&&(gr=null),vy(i.stateNode),Rt(e,tt()),r!==null)for(l=e.onRecoverableError,i=0;i<r.length;i++)d=r[i],l(d.value,{componentStack:d.stack,digest:d.digest});if(Ta)throw Ta=!1,e=Zu,Zu=null,e;return(Ma&1)!==0&&e.tag!==0&&Hs(),p=e.pendingLanes,(p&1)!==0?e===Ju?Zi++:(Zi=0,Ju=e):Zi=0,hr(),null}function Hs(){if(xr!==null){var e=Ah(Ma),r=tn.transition,i=Ve;try{if(tn.transition=null,Ve=16>e?16:e,xr===null)var l=!1;else{if(e=xr,xr=null,Ma=0,(Le&6)!==0)throw Error(s(331));var d=Le;for(Le|=4,fe=e.current;fe!==null;){var p=fe,v=p.child;if((fe.flags&16)!==0){var S=p.deletions;if(S!==null){for(var P=0;P<S.length;P++){var H=S[P];for(fe=H;fe!==null;){var re=fe;switch(re.tag){case 0:case 11:case 15:qi(8,re,p)}var se=re.child;if(se!==null)se.return=re,fe=se;else for(;fe!==null;){re=fe;var te=re.sibling,de=re.return;if(Sp(re),re===H){fe=null;break}if(te!==null){te.return=de,fe=te;break}fe=de}}}var pe=p.alternate;if(pe!==null){var me=pe.child;if(me!==null){pe.child=null;do{var nt=me.sibling;me.sibling=null,me=nt}while(me!==null)}}fe=p}}if((p.subtreeFlags&2064)!==0&&v!==null)v.return=p,fe=v;else e:for(;fe!==null;){if(p=fe,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:qi(9,p,p.return)}var V=p.sibling;if(V!==null){V.return=p.return,fe=V;break e}fe=p.return}}var M=e.current;for(fe=M;fe!==null;){v=fe;var z=v.child;if((v.subtreeFlags&2064)!==0&&z!==null)z.return=v,fe=z;else e:for(v=M;fe!==null;){if(S=fe,(S.flags&2048)!==0)try{switch(S.tag){case 0:case 11:case 15:Ca(9,S)}}catch(xe){Ze(S,S.return,xe)}if(S===v){fe=null;break e}var ue=S.sibling;if(ue!==null){ue.return=S.return,fe=ue;break e}fe=S.return}}if(Le=d,hr(),jn&&typeof jn.onPostCommitFiberRoot=="function")try{jn.onPostCommitFiberRoot(Bo,e)}catch{}l=!0}return l}finally{Ve=i,tn.transition=r}}return!1}function $p(e,r,i){r=$s(i,r),r=ip(e,r,1),e=pr(e,r,1),r=Tt(),e!==null&&(ki(e,1,r),Rt(e,r))}function Ze(e,r,i){if(e.tag===3)$p(e,e,i);else for(;r!==null;){if(r.tag===3){$p(r,e,i);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(gr===null||!gr.has(l))){e=$s(i,e),e=op(r,e,1),r=pr(r,e,1),e=Tt(),r!==null&&(ki(r,1,e),Rt(r,e));break}}r=r.return}}function Kv(e,r,i){var l=e.pingCache;l!==null&&l.delete(r),r=Tt(),e.pingedLanes|=e.suspendedLanes&i,pt===e&&(yt&i)===i&&(lt===4||lt===3&&(yt&130023424)===yt&&500>tt()-Yu?Zr(e,0):Xu|=i),Rt(e,r)}function zp(e,r){r===0&&((e.mode&1)===0?r=1:(r=$o,$o<<=1,($o&130023424)===0&&($o=4194304)));var i=Tt();e=Vn(e,r),e!==null&&(ki(e,r,i),Rt(e,i))}function Qv(e){var r=e.memoizedState,i=0;r!==null&&(i=r.retryLane),zp(e,i)}function Gv(e,r){var i=0;switch(e.tag){case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(s(314))}l!==null&&l.delete(r),zp(e,i)}var Up;Up=function(e,r,i){if(e!==null)if(e.memoizedProps!==r.pendingProps||Ft.current)_t=!0;else{if((e.lanes&i)===0&&(r.flags&128)===0)return _t=!1,_v(e,r,i);_t=(e.flags&131072)!==0}else _t=!1,Ge&&(r.flags&1048576)!==0&&kf(r,ua,r.index);switch(r.lanes=0,r.tag){case 2:var l=r.type;Na(e,r),e=r.pendingProps;var d=Fs(r,wt.current);Bs(r,i),d=Eu(null,r,l,e,d,i);var p=Tu();return r.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,It(l)?(p=!0,oa(r)):p=!1,r.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,bu(r),d.updater=ka,r.stateNode=d,d._reactInternals=r,_u(r,l,e,i),r=Bu(null,r,l,!0,p,i)):(r.tag=0,Ge&&p&&du(r),Et(null,r,d,i),r=r.child),r;case 16:l=r.elementType;e:{switch(Na(e,r),e=r.pendingProps,d=l._init,l=d(l._payload),r.type=l,d=r.tag=Xv(l),e=mn(l,e),d){case 0:r=Ou(null,r,l,e,i);break e;case 1:r=mp(null,r,l,e,i);break e;case 11:r=cp(null,r,l,e,i);break e;case 14:r=dp(null,r,l,mn(l.type,e),i);break e}throw Error(s(306,l,""))}return r;case 0:return l=r.type,d=r.pendingProps,d=r.elementType===l?d:mn(l,d),Ou(e,r,l,d,i);case 1:return l=r.type,d=r.pendingProps,d=r.elementType===l?d:mn(l,d),mp(e,r,l,d,i);case 3:e:{if(gp(r),e===null)throw Error(s(387));l=r.pendingProps,p=r.memoizedState,d=p.element,Mf(e,r),ma(r,l,null,i);var v=r.memoizedState;if(l=v.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},r.updateQueue.baseState=p,r.memoizedState=p,r.flags&256){d=$s(Error(s(423)),r),r=xp(e,r,l,i,d);break e}else if(l!==d){d=$s(Error(s(424)),r),r=xp(e,r,l,i,d);break e}else for(Kt=ur(r.stateNode.containerInfo.firstChild),Ht=r,Ge=!0,pn=null,i=Tf(r,null,l,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ls(),l===d){r=zn(e,r,i);break e}Et(e,r,l,i)}r=r.child}return r;case 5:return If(r),e===null&&pu(r),l=r.type,d=r.pendingProps,p=e!==null?e.memoizedProps:null,v=d.children,iu(l,d)?v=null:p!==null&&iu(l,p)&&(r.flags|=32),pp(e,r),Et(e,r,v,i),r.child;case 6:return e===null&&pu(r),null;case 13:return yp(e,r,i);case 4:return ku(r,r.stateNode.containerInfo),l=r.pendingProps,e===null?r.child=Rs(r,null,l,i):Et(e,r,l,i),r.child;case 11:return l=r.type,d=r.pendingProps,d=r.elementType===l?d:mn(l,d),cp(e,r,l,d,i);case 7:return Et(e,r,r.pendingProps,i),r.child;case 8:return Et(e,r,r.pendingProps.children,i),r.child;case 12:return Et(e,r,r.pendingProps.children,i),r.child;case 10:e:{if(l=r.type._context,d=r.pendingProps,p=r.memoizedProps,v=d.value,Ue(ha,l._currentValue),l._currentValue=v,p!==null)if(fn(p.value,v)){if(p.children===d.children&&!Ft.current){r=zn(e,r,i);break e}}else for(p=r.child,p!==null&&(p.return=r);p!==null;){var S=p.dependencies;if(S!==null){v=p.child;for(var P=S.firstContext;P!==null;){if(P.context===l){if(p.tag===1){P=$n(-1,i&-i),P.tag=2;var H=p.updateQueue;if(H!==null){H=H.shared;var re=H.pending;re===null?P.next=P:(P.next=re.next,re.next=P),H.pending=P}}p.lanes|=i,P=p.alternate,P!==null&&(P.lanes|=i),vu(p.return,i,r),S.lanes|=i;break}P=P.next}}else if(p.tag===10)v=p.type===r.type?null:p.child;else if(p.tag===18){if(v=p.return,v===null)throw Error(s(341));v.lanes|=i,S=v.alternate,S!==null&&(S.lanes|=i),vu(v,i,r),v=p.sibling}else v=p.child;if(v!==null)v.return=p;else for(v=p;v!==null;){if(v===r){v=null;break}if(p=v.sibling,p!==null){p.return=v.return,v=p;break}v=v.return}p=v}Et(e,r,d.children,i),r=r.child}return r;case 9:return d=r.type,l=r.pendingProps.children,Bs(r,i),d=Jt(d),l=l(d),r.flags|=1,Et(e,r,l,i),r.child;case 14:return l=r.type,d=mn(l,r.pendingProps),d=mn(l.type,d),dp(e,r,l,d,i);case 15:return hp(e,r,r.type,r.pendingProps,i);case 17:return l=r.type,d=r.pendingProps,d=r.elementType===l?d:mn(l,d),Na(e,r),r.tag=1,It(l)?(e=!0,oa(r)):e=!1,Bs(r,i),rp(r,l,d),_u(r,l,d,i),Bu(null,r,l,!0,e,i);case 19:return wp(e,r,i);case 22:return fp(e,r,i)}throw Error(s(156,r.tag))};function Wp(e,r){return kh(e,r)}function qv(e,r,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(e,r,i,l){return new qv(e,r,i,l)}function ic(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xv(e){if(typeof e=="function")return ic(e)?1:0;if(e!=null){if(e=e.$$typeof,e===K)return 11;if(e===ne)return 14}return 2}function wr(e,r){var i=e.alternate;return i===null?(i=nn(e.tag,r,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=r,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,r=e.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function _a(e,r,i,l,d,p){var v=2;if(l=e,typeof e=="function")ic(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case U:return es(i.children,d,p,r);case D:v=8,d|=8;break;case O:return e=nn(12,i,r,d|2),e.elementType=O,e.lanes=p,e;case I:return e=nn(13,i,r,d),e.elementType=I,e.lanes=p,e;case J:return e=nn(19,i,r,d),e.elementType=J,e.lanes=p,e;case q:return La(i,d,p,r);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:v=10;break e;case oe:v=9;break e;case K:v=11;break e;case ne:v=14;break e;case le:v=16,l=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return r=nn(v,i,r,d),r.elementType=e,r.type=l,r.lanes=p,r}function es(e,r,i,l){return e=nn(7,e,l,r),e.lanes=i,e}function La(e,r,i,l){return e=nn(22,e,l,r),e.elementType=q,e.lanes=i,e.stateNode={isHidden:!1},e}function oc(e,r,i){return e=nn(6,e,null,r),e.lanes=i,e}function ac(e,r,i){return r=nn(4,e.children!==null?e.children:[],e.key,r),r.lanes=i,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}function Yv(e,r,i,l,d){this.tag=r,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Il(0),this.expirationTimes=Il(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Il(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function lc(e,r,i,l,d,p,v,S,P){return e=new Yv(e,r,i,S,P),r===1?(r=1,p===!0&&(r|=8)):r=0,p=nn(3,null,null,r),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},bu(p),e}function Zv(e,r,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:F,key:l==null?null:""+l,children:e,containerInfo:r,implementation:i}}function Hp(e){if(!e)return dr;e=e._reactInternals;e:{if(zr(e)!==e||e.tag!==1)throw Error(s(170));var r=e;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(It(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(s(171))}if(e.tag===1){var i=e.type;if(It(i))return vf(e,i,r)}return r}function Kp(e,r,i,l,d,p,v,S,P){return e=lc(i,l,!0,e,d,p,v,S,P),e.context=Hp(null),i=e.current,l=Tt(),d=yr(i),p=$n(l,d),p.callback=r??null,pr(i,p,d),e.current.lanes=d,ki(e,d,l),Rt(e,l),e}function Ra(e,r,i,l){var d=r.current,p=Tt(),v=yr(d);return i=Hp(i),r.context===null?r.context=i:r.pendingContext=i,r=$n(p,v),r.payload={element:e},l=l===void 0?null:l,l!==null&&(r.callback=l),e=pr(d,r,v),e!==null&&(yn(e,d,v,p),pa(e,d,v)),v}function Oa(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Qp(e,r){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<r?i:r}}function uc(e,r){Qp(e,r),(e=e.alternate)&&Qp(e,r)}function Jv(){return null}var Gp=typeof reportError=="function"?reportError:function(e){console.error(e)};function cc(e){this._internalRoot=e}Ba.prototype.render=cc.prototype.render=function(e){var r=this._internalRoot;if(r===null)throw Error(s(409));Ra(e,r,null,null)},Ba.prototype.unmount=cc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var r=e.containerInfo;Yr(function(){Ra(null,e,null,null)}),r[Ln]=null}};function Ba(e){this._internalRoot=e}Ba.prototype.unstable_scheduleHydration=function(e){if(e){var r=Ph();e={blockedOn:null,target:e,priority:r};for(var i=0;i<or.length&&r!==0&&r<or[i].priority;i++);or.splice(i,0,e),i===0&&Fh(e)}};function dc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Va(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function qp(){}function e1(e,r,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var H=Oa(v);p.call(H)}}var v=Kp(r,l,e,0,null,!1,!1,"",qp);return e._reactRootContainer=v,e[Ln]=v.current,Li(e.nodeType===8?e.parentNode:e),Yr(),v}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var S=l;l=function(){var H=Oa(P);S.call(H)}}var P=lc(e,0,!1,null,null,!1,!1,"",qp);return e._reactRootContainer=P,e[Ln]=P.current,Li(e.nodeType===8?e.parentNode:e),Yr(function(){Ra(r,P,i,l)}),P}function $a(e,r,i,l,d){var p=i._reactRootContainer;if(p){var v=p;if(typeof d=="function"){var S=d;d=function(){var P=Oa(v);S.call(P)}}Ra(r,v,e,d)}else v=e1(i,r,e,d,l);return Oa(v)}Eh=function(e){switch(e.tag){case 3:var r=e.stateNode;if(r.current.memoizedState.isDehydrated){var i=bi(r.pendingLanes);i!==0&&(_l(r,i|1),Rt(r,tt()),(Le&6)===0&&(Ws=tt()+500,hr()))}break;case 13:Yr(function(){var l=Vn(e,1);if(l!==null){var d=Tt();yn(l,e,1,d)}}),uc(e,1)}},Ll=function(e){if(e.tag===13){var r=Vn(e,134217728);if(r!==null){var i=Tt();yn(r,e,134217728,i)}uc(e,134217728)}},Th=function(e){if(e.tag===13){var r=yr(e),i=Vn(e,r);if(i!==null){var l=Tt();yn(i,e,r,l)}uc(e,r)}},Ph=function(){return Ve},Mh=function(e,r){var i=Ve;try{return Ve=e,r()}finally{Ve=i}},$r=function(e,r,i){switch(r){case"input":if(he(e,i),r=i.name,i.type==="radio"&&r!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<i.length;r++){var l=i[r];if(l!==e&&l.form===e.form){var d=sa(l);if(!d)throw Error(s(90));$t(l),he(l,d)}}}break;case"textarea":_n(e,i);break;case"select":r=i.value,r!=null&&zt(e,!!i.multiple,r,!1)}},mh=nc,gh=Yr;var t1={usingClientEntryPoint:!1,Events:[Bi,Ms,sa,fh,ph,nc]},Ji={findFiberByHostInstance:Ur,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},n1={bundleType:Ji.bundleType,version:Ji.version,rendererPackageName:Ji.rendererPackageName,rendererConfig:Ji.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=wh(e),e===null?null:e.stateNode},findFiberByHostInstance:Ji.findFiberByHostInstance||Jv,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var za=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!za.isDisabled&&za.supportsFiber)try{Bo=za.inject(n1),jn=za}catch{}}return Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t1,Ot.createPortal=function(e,r){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dc(r))throw Error(s(200));return Zv(e,r,null,i)},Ot.createRoot=function(e,r){if(!dc(e))throw Error(s(299));var i=!1,l="",d=Gp;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onRecoverableError!==void 0&&(d=r.onRecoverableError)),r=lc(e,1,!1,null,null,i,!1,l,d),e[Ln]=r.current,Li(e.nodeType===8?e.parentNode:e),new cc(r)},Ot.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var r=e._reactInternals;if(r===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=wh(r),e=e===null?null:e.stateNode,e},Ot.flushSync=function(e){return Yr(e)},Ot.hydrate=function(e,r,i){if(!Va(r))throw Error(s(200));return $a(null,e,r,!0,i)},Ot.hydrateRoot=function(e,r,i){if(!dc(e))throw Error(s(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",v=Gp;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),r=Kp(r,null,e,1,i??null,d,!1,p,v),e[Ln]=r.current,Li(e),l)for(e=0;e<l.length;e++)i=l[e],d=i._getVersion,d=d(i._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[i,d]:r.mutableSourceEagerHydrationData.push(i,d);return new Ba(r)},Ot.render=function(e,r,i){if(!Va(r))throw Error(s(200));return $a(null,e,r,!1,i)},Ot.unmountComponentAtNode=function(e){if(!Va(e))throw Error(s(40));return e._reactRootContainer?(Yr(function(){$a(null,null,e,!1,function(){e._reactRootContainer=null,e[Ln]=null})}),!0):!1},Ot.unstable_batchedUpdates=nc,Ot.unstable_renderSubtreeIntoContainer=function(e,r,i,l){if(!Va(i))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return $a(e,r,i,!1,l)},Ot.version="18.3.1-next-f1338f8080-20240426",Ot}var sm;function pg(){if(sm)return mc.exports;sm=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),mc.exports=u1(),mc.exports}var im;function c1(){if(im)return Wa;im=1;var t=pg();return Wa.createRoot=t.createRoot,Wa.hydrateRoot=t.hydrateRoot,Wa}var d1=c1(),mi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},h1={setTimeout:(t,n)=>setTimeout(t,n),clearTimeout:t=>clearTimeout(t),setInterval:(t,n)=>setInterval(t,n),clearInterval:t=>clearInterval(t)},Nr,wd,rg,f1=(rg=class{constructor(){we(this,Nr,h1);we(this,wd,!1)}setTimeoutProvider(t){ce(this,Nr,t)}setTimeout(t,n){return E(this,Nr).setTimeout(t,n)}clearTimeout(t){E(this,Nr).clearTimeout(t)}setInterval(t,n){return E(this,Nr).setInterval(t,n)}clearInterval(t){E(this,Nr).clearInterval(t)}},Nr=new WeakMap,wd=new WeakMap,rg),is=new f1;function p1(t){setTimeout(t,0)}var xs=typeof window>"u"||"Deno"in globalThis;function Mt(){}function m1(t,n){return typeof t=="function"?t(n):t}function Uc(t){return typeof t=="number"&&t>=0&&t!==1/0}function mg(t,n){return Math.max(t+(n||0)-Date.now(),0)}function Fr(t,n){return typeof t=="function"?t(n):t}function ln(t,n){return typeof t=="function"?t(n):t}function om(t,n){const{type:s="all",exact:o,fetchStatus:u,predicate:c,queryKey:h,stale:f}=t;if(h){if(o){if(n.queryHash!==kd(h,n.options))return!1}else if(!vo(n.queryKey,h))return!1}if(s!=="all"){const m=n.isActive();if(s==="active"&&!m||s==="inactive"&&m)return!1}return!(typeof f=="boolean"&&n.isStale()!==f||u&&u!==n.state.fetchStatus||c&&!c(n))}function am(t,n){const{exact:s,status:o,predicate:u,mutationKey:c}=t;if(c){if(!n.options.mutationKey)return!1;if(s){if(ys(n.options.mutationKey)!==ys(c))return!1}else if(!vo(n.options.mutationKey,c))return!1}return!(o&&n.state.status!==o||u&&!u(n))}function kd(t,n){return((n==null?void 0:n.queryKeyHashFn)||ys)(t)}function ys(t){return JSON.stringify(t,(n,s)=>Wc(s)?Object.keys(s).sort().reduce((o,u)=>(o[u]=s[u],o),{}):s)}function vo(t,n){return t===n?!0:typeof t!=typeof n?!1:t&&n&&typeof t=="object"&&typeof n=="object"?Object.keys(n).every(s=>vo(t[s],n[s])):!1}var g1=Object.prototype.hasOwnProperty;function gg(t,n,s=0){if(t===n)return t;if(s>500)return n;const o=lm(t)&&lm(n);if(!o&&!(Wc(t)&&Wc(n)))return n;const c=(o?t:Object.keys(t)).length,h=o?n:Object.keys(n),f=h.length,m=o?new Array(f):{};let x=0;for(let g=0;g<f;g++){const y=o?g:h[g],w=t[y],j=n[y];if(w===j){m[y]=w,(o?g<c:g1.call(t,y))&&x++;continue}if(w===null||j===null||typeof w!="object"||typeof j!="object"){m[y]=j;continue}const C=gg(w,j,s+1);m[y]=C,C===w&&x++}return c===f&&x===c?t:m}function ll(t,n){if(!n||Object.keys(t).length!==Object.keys(n).length)return!1;for(const s in t)if(t[s]!==n[s])return!1;return!0}function lm(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Wc(t){if(!um(t))return!1;const n=t.constructor;if(n===void 0)return!0;const s=n.prototype;return!(!um(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function um(t){return Object.prototype.toString.call(t)==="[object Object]"}function x1(t){return new Promise(n=>{is.setTimeout(n,t)})}function Hc(t,n,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,n):s.structuralSharing!==!1?gg(t,n):n}function y1(t,n,s=0){const o=[...t,n];return s&&o.length>s?o.slice(1):o}function v1(t,n,s=0){const o=[n,...t];return s&&o.length>s?o.slice(0,-1):o}var jd=Symbol();function xg(t,n){return!t.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!t.queryFn||t.queryFn===jd?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Nd(t,n){return typeof t=="function"?t(...n):!!t}function w1(t,n,s){let o=!1,u;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(u??(u=n()),o||(o=!0,u.aborted?s():u.addEventListener("abort",s,{once:!0})),u)}),t}var as,Sr,ei,sg,b1=(sg=class extends mi{constructor(){super();we(this,as);we(this,Sr);we(this,ei);ce(this,ei,n=>{if(!xs&&window.addEventListener){const s=()=>n();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){E(this,Sr)||this.setEventListener(E(this,ei))}onUnsubscribe(){var n;this.hasListeners()||((n=E(this,Sr))==null||n.call(this),ce(this,Sr,void 0))}setEventListener(n){var s;ce(this,ei,n),(s=E(this,Sr))==null||s.call(this),ce(this,Sr,n(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(n){E(this,as)!==n&&(ce(this,as,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(s=>{s(n)})}isFocused(){var n;return typeof E(this,as)=="boolean"?E(this,as):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},as=new WeakMap,Sr=new WeakMap,ei=new WeakMap,sg),Sd=new b1;function Kc(){let t,n;const s=new Promise((u,c)=>{t=u,n=c});s.status="pending",s.catch(()=>{});function o(u){Object.assign(s,u),delete s.resolve,delete s.reject}return s.resolve=u=>{o({status:"fulfilled",value:u}),t(u)},s.reject=u=>{o({status:"rejected",reason:u}),n(u)},s}var k1=p1;function j1(){let t=[],n=0,s=f=>{f()},o=f=>{f()},u=k1;const c=f=>{n?t.push(f):u(()=>{s(f)})},h=()=>{const f=t;t=[],f.length&&u(()=>{o(()=>{f.forEach(m=>{s(m)})})})};return{batch:f=>{let m;n++;try{m=f()}finally{n--,n||h()}return m},batchCalls:f=>(...m)=>{c(()=>{f(...m)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{o=f},setScheduler:f=>{u=f}}}var ut=j1(),ti,Cr,ni,ig,N1=(ig=class extends mi{constructor(){super();we(this,ti,!0);we(this,Cr);we(this,ni);ce(this,ni,n=>{if(!xs&&window.addEventListener){const s=()=>n(!0),o=()=>n(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",o)}}})}onSubscribe(){E(this,Cr)||this.setEventListener(E(this,ni))}onUnsubscribe(){var n;this.hasListeners()||((n=E(this,Cr))==null||n.call(this),ce(this,Cr,void 0))}setEventListener(n){var s;ce(this,ni,n),(s=E(this,Cr))==null||s.call(this),ce(this,Cr,n(this.setOnline.bind(this)))}setOnline(n){E(this,ti)!==n&&(ce(this,ti,n),this.listeners.forEach(o=>{o(n)}))}isOnline(){return E(this,ti)}},ti=new WeakMap,Cr=new WeakMap,ni=new WeakMap,ig),ul=new N1;function S1(t){return Math.min(1e3*2**t,3e4)}function yg(t){return(t??"online")==="online"?ul.isOnline():!0}var Qc=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function vg(t){let n=!1,s=0,o;const u=Kc(),c=()=>u.status!=="pending",h=A=>{var N;if(!c()){const _=new Qc(A);w(_),(N=t.onCancel)==null||N.call(t,_)}},f=()=>{n=!0},m=()=>{n=!1},x=()=>Sd.isFocused()&&(t.networkMode==="always"||ul.isOnline())&&t.canRun(),g=()=>yg(t.networkMode)&&t.canRun(),y=A=>{c()||(o==null||o(),u.resolve(A))},w=A=>{c()||(o==null||o(),u.reject(A))},j=()=>new Promise(A=>{var N;o=_=>{(c()||x())&&A(_)},(N=t.onPause)==null||N.call(t)}).then(()=>{var A;o=void 0,c()||(A=t.onContinue)==null||A.call(t)}),C=()=>{if(c())return;let A;const N=s===0?t.initialPromise:void 0;try{A=N??t.fn()}catch(_){A=Promise.reject(_)}Promise.resolve(A).then(y).catch(_=>{var F;if(c())return;const B=t.retry??(xs?0:3),W=t.retryDelay??S1,$=typeof W=="function"?W(s,_):W,b=B===!0||typeof B=="number"&&s<B||typeof B=="function"&&B(s,_);if(n||!b){w(_);return}s++,(F=t.onFail)==null||F.call(t,s,_),x1($).then(()=>x()?void 0:j()).then(()=>{n?w(_):C()})})};return{promise:u,status:()=>u.status,cancel:h,continue:()=>(o==null||o(),u),cancelRetry:f,continueRetry:m,canStart:g,start:()=>(g()?C():j().then(C),u)}}var ls,og,wg=(og=class{constructor(){we(this,ls)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Uc(this.gcTime)&&ce(this,ls,is.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(xs?1/0:300*1e3))}clearGcTimeout(){E(this,ls)&&(is.clearTimeout(E(this,ls)),ce(this,ls,void 0))}},ls=new WeakMap,og),us,ri,an,cs,gt,Ao,ds,wn,Hn,ag,C1=(ag=class extends wg{constructor(n){super();we(this,wn);we(this,us);we(this,ri);we(this,an);we(this,cs);we(this,gt);we(this,Ao);we(this,ds);ce(this,ds,!1),ce(this,Ao,n.defaultOptions),this.setOptions(n.options),this.observers=[],ce(this,cs,n.client),ce(this,an,E(this,cs).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,ce(this,us,dm(this.options)),this.state=n.state??E(this,us),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var n;return(n=E(this,gt))==null?void 0:n.promise}setOptions(n){if(this.options={...E(this,Ao),...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=dm(this.options);s.data!==void 0&&(this.setState(cm(s.data,s.dataUpdatedAt)),ce(this,us,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,an).remove(this)}setData(n,s){const o=Hc(this.state.data,n,this.options);return Pe(this,wn,Hn).call(this,{data:o,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),o}setState(n,s){Pe(this,wn,Hn).call(this,{type:"setState",state:n,setStateOptions:s})}cancel(n){var o,u;const s=(o=E(this,gt))==null?void 0:o.promise;return(u=E(this,gt))==null||u.cancel(n),s?s.then(Mt).catch(Mt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(E(this,us))}isActive(){return this.observers.some(n=>ln(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Fr(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!mg(this.state.dataUpdatedAt,n)}onFocus(){var s;const n=this.observers.find(o=>o.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(s=E(this,gt))==null||s.continue()}onOnline(){var s;const n=this.observers.find(o=>o.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(s=E(this,gt))==null||s.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),E(this,an).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(s=>s!==n),this.observers.length||(E(this,gt)&&(E(this,ds)?E(this,gt).cancel({revert:!0}):E(this,gt).cancelRetry()),this.scheduleGc()),E(this,an).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Pe(this,wn,Hn).call(this,{type:"invalidate"})}async fetch(n,s){var m,x,g,y,w,j,C,A,N,_,B,W;if(this.state.fetchStatus!=="idle"&&((m=E(this,gt))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(E(this,gt))return E(this,gt).continueRetry(),E(this,gt).promise}if(n&&this.setOptions(n),!this.options.queryFn){const $=this.observers.find(b=>b.options.queryFn);$&&this.setOptions($.options)}const o=new AbortController,u=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>(ce(this,ds,!0),o.signal)})},c=()=>{const $=xg(this.options,s),F=(()=>{const U={client:E(this,cs),queryKey:this.queryKey,meta:this.meta};return u(U),U})();return ce(this,ds,!1),this.options.persister?this.options.persister($,F,this):$(F)},f=(()=>{const $={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:E(this,cs),state:this.state,fetchFn:c};return u($),$})();(x=this.options.behavior)==null||x.onFetch(f,this),ce(this,ri,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=f.fetchOptions)==null?void 0:g.meta))&&Pe(this,wn,Hn).call(this,{type:"fetch",meta:(y=f.fetchOptions)==null?void 0:y.meta}),ce(this,gt,vg({initialPromise:s==null?void 0:s.initialPromise,fn:f.fetchFn,onCancel:$=>{$ instanceof Qc&&$.revert&&this.setState({...E(this,ri),fetchStatus:"idle"}),o.abort()},onFail:($,b)=>{Pe(this,wn,Hn).call(this,{type:"failed",failureCount:$,error:b})},onPause:()=>{Pe(this,wn,Hn).call(this,{type:"pause"})},onContinue:()=>{Pe(this,wn,Hn).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const $=await E(this,gt).start();if($===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData($),(j=(w=E(this,an).config).onSuccess)==null||j.call(w,$,this),(A=(C=E(this,an).config).onSettled)==null||A.call(C,$,this.state.error,this),$}catch($){if($ instanceof Qc){if($.silent)return E(this,gt).promise;if($.revert){if(this.state.data===void 0)throw $;return this.state.data}}throw Pe(this,wn,Hn).call(this,{type:"error",error:$}),(_=(N=E(this,an).config).onError)==null||_.call(N,$,this),(W=(B=E(this,an).config).onSettled)==null||W.call(B,this.state.data,$,this),$}finally{this.scheduleGc()}}},us=new WeakMap,ri=new WeakMap,an=new WeakMap,cs=new WeakMap,gt=new WeakMap,Ao=new WeakMap,ds=new WeakMap,wn=new WeakSet,Hn=function(n){const s=o=>{switch(n.type){case"failed":return{...o,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...bg(o.data,this.options),fetchMeta:n.meta??null};case"success":const u={...o,...cm(n.data,n.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ce(this,ri,n.manual?u:void 0),u;case"error":const c=n.error;return{...o,error:c,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...n.state}}};this.state=s(this.state),ut.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),E(this,an).notify({query:this,type:"updated",action:n})})},ag);function bg(t,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yg(n.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function cm(t,n){return{data:t,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dm(t){const n=typeof t.initialData=="function"?t.initialData():t.initialData,s=n!==void 0,o=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:s?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Bt,Ie,Eo,Pt,hs,si,Qn,Ar,To,ii,oi,fs,ps,Er,ai,Be,oo,Gc,qc,Xc,Yc,Zc,Jc,ed,kg,lg,A1=(lg=class extends mi{constructor(n,s){super();we(this,Be);we(this,Bt);we(this,Ie);we(this,Eo);we(this,Pt);we(this,hs);we(this,si);we(this,Qn);we(this,Ar);we(this,To);we(this,ii);we(this,oi);we(this,fs);we(this,ps);we(this,Er);we(this,ai,new Set);this.options=s,ce(this,Bt,n),ce(this,Ar,null),ce(this,Qn,Kc()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,Ie).addObserver(this),hm(E(this,Ie),this.options)?Pe(this,Be,oo).call(this):this.updateResult(),Pe(this,Be,Yc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return td(E(this,Ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return td(E(this,Ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Pe(this,Be,Zc).call(this),Pe(this,Be,Jc).call(this),E(this,Ie).removeObserver(this)}setOptions(n){const s=this.options,o=E(this,Ie);if(this.options=E(this,Bt).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ln(this.options.enabled,E(this,Ie))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Pe(this,Be,ed).call(this),E(this,Ie).setOptions(this.options),s._defaulted&&!ll(this.options,s)&&E(this,Bt).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,Ie),observer:this});const u=this.hasListeners();u&&fm(E(this,Ie),o,this.options,s)&&Pe(this,Be,oo).call(this),this.updateResult(),u&&(E(this,Ie)!==o||ln(this.options.enabled,E(this,Ie))!==ln(s.enabled,E(this,Ie))||Fr(this.options.staleTime,E(this,Ie))!==Fr(s.staleTime,E(this,Ie)))&&Pe(this,Be,Gc).call(this);const c=Pe(this,Be,qc).call(this);u&&(E(this,Ie)!==o||ln(this.options.enabled,E(this,Ie))!==ln(s.enabled,E(this,Ie))||c!==E(this,Er))&&Pe(this,Be,Xc).call(this,c)}getOptimisticResult(n){const s=E(this,Bt).getQueryCache().build(E(this,Bt),n),o=this.createResult(s,n);return T1(this,o)&&(ce(this,Pt,o),ce(this,si,this.options),ce(this,hs,E(this,Ie).state)),o}getCurrentResult(){return E(this,Pt)}trackResult(n,s){return new Proxy(n,{get:(o,u)=>(this.trackProp(u),s==null||s(u),u==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&E(this,Qn).status==="pending"&&E(this,Qn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,u))})}trackProp(n){E(this,ai).add(n)}getCurrentQuery(){return E(this,Ie)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const s=E(this,Bt).defaultQueryOptions(n),o=E(this,Bt).getQueryCache().build(E(this,Bt),s);return o.fetch().then(()=>this.createResult(o,s))}fetch(n){return Pe(this,Be,oo).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,Pt)))}createResult(n,s){var O;const o=E(this,Ie),u=this.options,c=E(this,Pt),h=E(this,hs),f=E(this,si),x=n!==o?n.state:E(this,Eo),{state:g}=n;let y={...g},w=!1,j;if(s._optimisticResults){const G=this.hasListeners(),oe=!G&&hm(n,s),K=G&&fm(n,o,s,u);(oe||K)&&(y={...y,...bg(g.data,n.options)}),s._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:C,errorUpdatedAt:A,status:N}=y;j=y.data;let _=!1;if(s.placeholderData!==void 0&&j===void 0&&N==="pending"){let G;c!=null&&c.isPlaceholderData&&s.placeholderData===(f==null?void 0:f.placeholderData)?(G=c.data,_=!0):G=typeof s.placeholderData=="function"?s.placeholderData((O=E(this,oi))==null?void 0:O.state.data,E(this,oi)):s.placeholderData,G!==void 0&&(N="success",j=Hc(c==null?void 0:c.data,G,s),w=!0)}if(s.select&&j!==void 0&&!_)if(c&&j===(h==null?void 0:h.data)&&s.select===E(this,To))j=E(this,ii);else try{ce(this,To,s.select),j=s.select(j),j=Hc(c==null?void 0:c.data,j,s),ce(this,ii,j),ce(this,Ar,null)}catch(G){ce(this,Ar,G)}E(this,Ar)&&(C=E(this,Ar),j=E(this,ii),A=Date.now(),N="error");const B=y.fetchStatus==="fetching",W=N==="pending",$=N==="error",b=W&&B,F=j!==void 0,D={status:N,fetchStatus:y.fetchStatus,isPending:W,isSuccess:N==="success",isError:$,isInitialLoading:b,isLoading:b,data:j,dataUpdatedAt:y.dataUpdatedAt,error:C,errorUpdatedAt:A,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>x.dataUpdateCount||y.errorUpdateCount>x.errorUpdateCount,isFetching:B,isRefetching:B&&!W,isLoadingError:$&&!F,isPaused:y.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:$&&F,isStale:Cd(n,s),refetch:this.refetch,promise:E(this,Qn),isEnabled:ln(s.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const G=D.data!==void 0,oe=D.status==="error"&&!G,K=ne=>{oe?ne.reject(D.error):G&&ne.resolve(D.data)},I=()=>{const ne=ce(this,Qn,D.promise=Kc());K(ne)},J=E(this,Qn);switch(J.status){case"pending":n.queryHash===o.queryHash&&K(J);break;case"fulfilled":(oe||D.data!==J.value)&&I();break;case"rejected":(!oe||D.error!==J.reason)&&I();break}}return D}updateResult(){const n=E(this,Pt),s=this.createResult(E(this,Ie),this.options);if(ce(this,hs,E(this,Ie).state),ce(this,si,this.options),E(this,hs).data!==void 0&&ce(this,oi,E(this,Ie)),ll(s,n))return;ce(this,Pt,s);const o=()=>{if(!n)return!0;const{notifyOnChangeProps:u}=this.options,c=typeof u=="function"?u():u;if(c==="all"||!c&&!E(this,ai).size)return!0;const h=new Set(c??E(this,ai));return this.options.throwOnError&&h.add("error"),Object.keys(E(this,Pt)).some(f=>{const m=f;return E(this,Pt)[m]!==n[m]&&h.has(m)})};Pe(this,Be,kg).call(this,{listeners:o()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Pe(this,Be,Yc).call(this)}},Bt=new WeakMap,Ie=new WeakMap,Eo=new WeakMap,Pt=new WeakMap,hs=new WeakMap,si=new WeakMap,Qn=new WeakMap,Ar=new WeakMap,To=new WeakMap,ii=new WeakMap,oi=new WeakMap,fs=new WeakMap,ps=new WeakMap,Er=new WeakMap,ai=new WeakMap,Be=new WeakSet,oo=function(n){Pe(this,Be,ed).call(this);let s=E(this,Ie).fetch(this.options,n);return n!=null&&n.throwOnError||(s=s.catch(Mt)),s},Gc=function(){Pe(this,Be,Zc).call(this);const n=Fr(this.options.staleTime,E(this,Ie));if(xs||E(this,Pt).isStale||!Uc(n))return;const o=mg(E(this,Pt).dataUpdatedAt,n)+1;ce(this,fs,is.setTimeout(()=>{E(this,Pt).isStale||this.updateResult()},o))},qc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,Ie)):this.options.refetchInterval)??!1},Xc=function(n){Pe(this,Be,Jc).call(this),ce(this,Er,n),!(xs||ln(this.options.enabled,E(this,Ie))===!1||!Uc(E(this,Er))||E(this,Er)===0)&&ce(this,ps,is.setInterval(()=>{(this.options.refetchIntervalInBackground||Sd.isFocused())&&Pe(this,Be,oo).call(this)},E(this,Er)))},Yc=function(){Pe(this,Be,Gc).call(this),Pe(this,Be,Xc).call(this,Pe(this,Be,qc).call(this))},Zc=function(){E(this,fs)&&(is.clearTimeout(E(this,fs)),ce(this,fs,void 0))},Jc=function(){E(this,ps)&&(is.clearInterval(E(this,ps)),ce(this,ps,void 0))},ed=function(){const n=E(this,Bt).getQueryCache().build(E(this,Bt),this.options);if(n===E(this,Ie))return;const s=E(this,Ie);ce(this,Ie,n),ce(this,Eo,n.state),this.hasListeners()&&(s==null||s.removeObserver(this),n.addObserver(this))},kg=function(n){ut.batch(()=>{n.listeners&&this.listeners.forEach(s=>{s(E(this,Pt))}),E(this,Bt).getQueryCache().notify({query:E(this,Ie),type:"observerResultsUpdated"})})},lg);function E1(t,n){return ln(n.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&n.retryOnMount===!1)}function hm(t,n){return E1(t,n)||t.state.data!==void 0&&td(t,n,n.refetchOnMount)}function td(t,n,s){if(ln(n.enabled,t)!==!1&&Fr(n.staleTime,t)!=="static"){const o=typeof s=="function"?s(t):s;return o==="always"||o!==!1&&Cd(t,n)}return!1}function fm(t,n,s,o){return(t!==n||ln(o.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&Cd(t,s)}function Cd(t,n){return ln(n.enabled,t)!==!1&&t.isStaleByTime(Fr(n.staleTime,t))}function T1(t,n){return!ll(t.getCurrentResult(),n)}function pm(t){return{onFetch:(n,s)=>{var g,y,w,j,C;const o=n.options,u=(w=(y=(g=n.fetchOptions)==null?void 0:g.meta)==null?void 0:y.fetchMore)==null?void 0:w.direction,c=((j=n.state.data)==null?void 0:j.pages)||[],h=((C=n.state.data)==null?void 0:C.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const x=async()=>{let A=!1;const N=W=>{w1(W,()=>n.signal,()=>A=!0)},_=xg(n.options,n.fetchOptions),B=async(W,$,b)=>{if(A)return Promise.reject();if($==null&&W.pages.length)return Promise.resolve(W);const U=(()=>{const oe={client:n.client,queryKey:n.queryKey,pageParam:$,direction:b?"backward":"forward",meta:n.options.meta};return N(oe),oe})(),D=await _(U),{maxPages:O}=n.options,G=b?v1:y1;return{pages:G(W.pages,D,O),pageParams:G(W.pageParams,$,O)}};if(u&&c.length){const W=u==="backward",$=W?P1:mm,b={pages:c,pageParams:h},F=$(o,b);f=await B(b,F,W)}else{const W=t??c.length;do{const $=m===0?h[0]??o.initialPageParam:mm(o,f);if(m>0&&$==null)break;f=await B(f,$),m++}while(m<W)}return f};n.options.persister?n.fetchFn=()=>{var A,N;return(N=(A=n.options).persister)==null?void 0:N.call(A,x,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},s)}:n.fetchFn=x}}}function mm(t,{pages:n,pageParams:s}){const o=n.length-1;return n.length>0?t.getNextPageParam(n[o],n,s[o],s):void 0}function P1(t,{pages:n,pageParams:s}){var o;return n.length>0?(o=t.getPreviousPageParam)==null?void 0:o.call(t,n[0],n,s[0],s):void 0}var Po,En,Nt,ms,Tn,kr,ug,M1=(ug=class extends wg{constructor(n){super();we(this,Tn);we(this,Po);we(this,En);we(this,Nt);we(this,ms);ce(this,Po,n.client),this.mutationId=n.mutationId,ce(this,Nt,n.mutationCache),ce(this,En,[]),this.state=n.state||jg(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){E(this,En).includes(n)||(E(this,En).push(n),this.clearGcTimeout(),E(this,Nt).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){ce(this,En,E(this,En).filter(s=>s!==n)),this.scheduleGc(),E(this,Nt).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){E(this,En).length||(this.state.status==="pending"?this.scheduleGc():E(this,Nt).remove(this))}continue(){var n;return((n=E(this,ms))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var h,f,m,x,g,y,w,j,C,A,N,_,B,W,$,b,F,U;const s=()=>{Pe(this,Tn,kr).call(this,{type:"continue"})},o={client:E(this,Po),meta:this.options.meta,mutationKey:this.options.mutationKey};ce(this,ms,vg({fn:()=>this.options.mutationFn?this.options.mutationFn(n,o):Promise.reject(new Error("No mutationFn found")),onFail:(D,O)=>{Pe(this,Tn,kr).call(this,{type:"failed",failureCount:D,error:O})},onPause:()=>{Pe(this,Tn,kr).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,Nt).canRun(this)}));const u=this.state.status==="pending",c=!E(this,ms).canStart();try{if(u)s();else{Pe(this,Tn,kr).call(this,{type:"pending",variables:n,isPaused:c}),E(this,Nt).config.onMutate&&await E(this,Nt).config.onMutate(n,this,o);const O=await((f=(h=this.options).onMutate)==null?void 0:f.call(h,n,o));O!==this.state.context&&Pe(this,Tn,kr).call(this,{type:"pending",context:O,variables:n,isPaused:c})}const D=await E(this,ms).start();return await((x=(m=E(this,Nt).config).onSuccess)==null?void 0:x.call(m,D,n,this.state.context,this,o)),await((y=(g=this.options).onSuccess)==null?void 0:y.call(g,D,n,this.state.context,o)),await((j=(w=E(this,Nt).config).onSettled)==null?void 0:j.call(w,D,null,this.state.variables,this.state.context,this,o)),await((A=(C=this.options).onSettled)==null?void 0:A.call(C,D,null,n,this.state.context,o)),Pe(this,Tn,kr).call(this,{type:"success",data:D}),D}catch(D){try{await((_=(N=E(this,Nt).config).onError)==null?void 0:_.call(N,D,n,this.state.context,this,o))}catch(O){Promise.reject(O)}try{await((W=(B=this.options).onError)==null?void 0:W.call(B,D,n,this.state.context,o))}catch(O){Promise.reject(O)}try{await((b=($=E(this,Nt).config).onSettled)==null?void 0:b.call($,void 0,D,this.state.variables,this.state.context,this,o))}catch(O){Promise.reject(O)}try{await((U=(F=this.options).onSettled)==null?void 0:U.call(F,void 0,D,n,this.state.context,o))}catch(O){Promise.reject(O)}throw Pe(this,Tn,kr).call(this,{type:"error",error:D}),D}finally{E(this,Nt).runNext(this)}}},Po=new WeakMap,En=new WeakMap,Nt=new WeakMap,ms=new WeakMap,Tn=new WeakSet,kr=function(n){const s=o=>{switch(n.type){case"failed":return{...o,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...o,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:n.error,failureCount:o.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=s(this.state),ut.batch(()=>{E(this,En).forEach(o=>{o.onMutationUpdate(n)}),E(this,Nt).notify({mutation:this,type:"updated",action:n})})},ug);function jg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Gn,bn,Mo,cg,D1=(cg=class extends mi{constructor(n={}){super();we(this,Gn);we(this,bn);we(this,Mo);this.config=n,ce(this,Gn,new Set),ce(this,bn,new Map),ce(this,Mo,0)}build(n,s,o){const u=new M1({client:n,mutationCache:this,mutationId:++Ua(this,Mo)._,options:n.defaultMutationOptions(s),state:o});return this.add(u),u}add(n){E(this,Gn).add(n);const s=Ha(n);if(typeof s=="string"){const o=E(this,bn).get(s);o?o.push(n):E(this,bn).set(s,[n])}this.notify({type:"added",mutation:n})}remove(n){if(E(this,Gn).delete(n)){const s=Ha(n);if(typeof s=="string"){const o=E(this,bn).get(s);if(o)if(o.length>1){const u=o.indexOf(n);u!==-1&&o.splice(u,1)}else o[0]===n&&E(this,bn).delete(s)}}this.notify({type:"removed",mutation:n})}canRun(n){const s=Ha(n);if(typeof s=="string"){const o=E(this,bn).get(s),u=o==null?void 0:o.find(c=>c.state.status==="pending");return!u||u===n}else return!0}runNext(n){var o;const s=Ha(n);if(typeof s=="string"){const u=(o=E(this,bn).get(s))==null?void 0:o.find(c=>c!==n&&c.state.isPaused);return(u==null?void 0:u.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ut.batch(()=>{E(this,Gn).forEach(n=>{this.notify({type:"removed",mutation:n})}),E(this,Gn).clear(),E(this,bn).clear()})}getAll(){return Array.from(E(this,Gn))}find(n){const s={exact:!0,...n};return this.getAll().find(o=>am(s,o))}findAll(n={}){return this.getAll().filter(s=>am(n,s))}notify(n){ut.batch(()=>{this.listeners.forEach(s=>{s(n)})})}resumePausedMutations(){const n=this.getAll().filter(s=>s.state.isPaused);return ut.batch(()=>Promise.all(n.map(s=>s.continue().catch(Mt))))}},Gn=new WeakMap,bn=new WeakMap,Mo=new WeakMap,cg);function Ha(t){var n;return(n=t.options.scope)==null?void 0:n.id}var qn,Tr,Vt,Xn,Jn,tl,nd,dg,F1=(dg=class extends mi{constructor(s,o){super();we(this,Jn);we(this,qn);we(this,Tr);we(this,Vt);we(this,Xn);ce(this,qn,s),this.setOptions(o),this.bindMethods(),Pe(this,Jn,tl).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){var u;const o=this.options;this.options=E(this,qn).defaultMutationOptions(s),ll(this.options,o)||E(this,qn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:E(this,Vt),observer:this}),o!=null&&o.mutationKey&&this.options.mutationKey&&ys(o.mutationKey)!==ys(this.options.mutationKey)?this.reset():((u=E(this,Vt))==null?void 0:u.state.status)==="pending"&&E(this,Vt).setOptions(this.options)}onUnsubscribe(){var s;this.hasListeners()||(s=E(this,Vt))==null||s.removeObserver(this)}onMutationUpdate(s){Pe(this,Jn,tl).call(this),Pe(this,Jn,nd).call(this,s)}getCurrentResult(){return E(this,Tr)}reset(){var s;(s=E(this,Vt))==null||s.removeObserver(this),ce(this,Vt,void 0),Pe(this,Jn,tl).call(this),Pe(this,Jn,nd).call(this)}mutate(s,o){var u;return ce(this,Xn,o),(u=E(this,Vt))==null||u.removeObserver(this),ce(this,Vt,E(this,qn).getMutationCache().build(E(this,qn),this.options)),E(this,Vt).addObserver(this),E(this,Vt).execute(s)}},qn=new WeakMap,Tr=new WeakMap,Vt=new WeakMap,Xn=new WeakMap,Jn=new WeakSet,tl=function(){var o;const s=((o=E(this,Vt))==null?void 0:o.state)??jg();ce(this,Tr,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},nd=function(s){ut.batch(()=>{var o,u,c,h,f,m,x,g;if(E(this,Xn)&&this.hasListeners()){const y=E(this,Tr).variables,w=E(this,Tr).context,j={client:E(this,qn),meta:this.options.meta,mutationKey:this.options.mutationKey};if((s==null?void 0:s.type)==="success"){try{(u=(o=E(this,Xn)).onSuccess)==null||u.call(o,s.data,y,w,j)}catch(C){Promise.reject(C)}try{(h=(c=E(this,Xn)).onSettled)==null||h.call(c,s.data,null,y,w,j)}catch(C){Promise.reject(C)}}else if((s==null?void 0:s.type)==="error"){try{(m=(f=E(this,Xn)).onError)==null||m.call(f,s.error,y,w,j)}catch(C){Promise.reject(C)}try{(g=(x=E(this,Xn)).onSettled)==null||g.call(x,void 0,s.error,y,w,j)}catch(C){Promise.reject(C)}}}this.listeners.forEach(y=>{y(E(this,Tr))})})},dg),Pn,hg,I1=(hg=class extends mi{constructor(n={}){super();we(this,Pn);this.config=n,ce(this,Pn,new Map)}build(n,s,o){const u=s.queryKey,c=s.queryHash??kd(u,s);let h=this.get(c);return h||(h=new C1({client:n,queryKey:u,queryHash:c,options:n.defaultQueryOptions(s),state:o,defaultOptions:n.getQueryDefaults(u)}),this.add(h)),h}add(n){E(this,Pn).has(n.queryHash)||(E(this,Pn).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const s=E(this,Pn).get(n.queryHash);s&&(n.destroy(),s===n&&E(this,Pn).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){ut.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return E(this,Pn).get(n)}getAll(){return[...E(this,Pn).values()]}find(n){const s={exact:!0,...n};return this.getAll().find(o=>om(s,o))}findAll(n={}){const s=this.getAll();return Object.keys(n).length>0?s.filter(o=>om(n,o)):s}notify(n){ut.batch(()=>{this.listeners.forEach(s=>{s(n)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Pn=new WeakMap,hg),Je,Pr,Mr,li,ui,Dr,ci,di,fg,_1=(fg=class{constructor(t={}){we(this,Je);we(this,Pr);we(this,Mr);we(this,li);we(this,ui);we(this,Dr);we(this,ci);we(this,di);ce(this,Je,t.queryCache||new I1),ce(this,Pr,t.mutationCache||new D1),ce(this,Mr,t.defaultOptions||{}),ce(this,li,new Map),ce(this,ui,new Map),ce(this,Dr,0)}mount(){Ua(this,Dr)._++,E(this,Dr)===1&&(ce(this,ci,Sd.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,Je).onFocus())})),ce(this,di,ul.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,Je).onOnline())})))}unmount(){var t,n;Ua(this,Dr)._--,E(this,Dr)===0&&((t=E(this,ci))==null||t.call(this),ce(this,ci,void 0),(n=E(this,di))==null||n.call(this),ce(this,di,void 0))}isFetching(t){return E(this,Je).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return E(this,Pr).findAll({...t,status:"pending"}).length}getQueryData(t){var s;const n=this.defaultQueryOptions({queryKey:t});return(s=E(this,Je).get(n.queryHash))==null?void 0:s.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),s=E(this,Je).build(this,n),o=s.state.data;return o===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(Fr(n.staleTime,s))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(t){return E(this,Je).findAll(t).map(({queryKey:n,state:s})=>{const o=s.data;return[n,o]})}setQueryData(t,n,s){const o=this.defaultQueryOptions({queryKey:t}),u=E(this,Je).get(o.queryHash),c=u==null?void 0:u.state.data,h=m1(n,c);if(h!==void 0)return E(this,Je).build(this,o).setData(h,{...s,manual:!0})}setQueriesData(t,n,s){return ut.batch(()=>E(this,Je).findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,s)]))}getQueryState(t){var s;const n=this.defaultQueryOptions({queryKey:t});return(s=E(this,Je).get(n.queryHash))==null?void 0:s.state}removeQueries(t){const n=E(this,Je);ut.batch(()=>{n.findAll(t).forEach(s=>{n.remove(s)})})}resetQueries(t,n){const s=E(this,Je);return ut.batch(()=>(s.findAll(t).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...t},n)))}cancelQueries(t,n={}){const s={revert:!0,...n},o=ut.batch(()=>E(this,Je).findAll(t).map(u=>u.cancel(s)));return Promise.all(o).then(Mt).catch(Mt)}invalidateQueries(t,n={}){return ut.batch(()=>(E(this,Je).findAll(t).forEach(s=>{s.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},n)))}refetchQueries(t,n={}){const s={...n,cancelRefetch:n.cancelRefetch??!0},o=ut.batch(()=>E(this,Je).findAll(t).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let c=u.fetch(void 0,s);return s.throwOnError||(c=c.catch(Mt)),u.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(o).then(Mt)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const s=E(this,Je).build(this,n);return s.isStaleByTime(Fr(n.staleTime,s))?s.fetch(n):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Mt).catch(Mt)}fetchInfiniteQuery(t){return t.behavior=pm(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Mt).catch(Mt)}ensureInfiniteQueryData(t){return t.behavior=pm(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return ul.isOnline()?E(this,Pr).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,Je)}getMutationCache(){return E(this,Pr)}getDefaultOptions(){return E(this,Mr)}setDefaultOptions(t){ce(this,Mr,t)}setQueryDefaults(t,n){E(this,li).set(ys(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...E(this,li).values()],s={};return n.forEach(o=>{vo(t,o.queryKey)&&Object.assign(s,o.defaultOptions)}),s}setMutationDefaults(t,n){E(this,ui).set(ys(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...E(this,ui).values()],s={};return n.forEach(o=>{vo(t,o.mutationKey)&&Object.assign(s,o.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const n={...E(this,Mr).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=kd(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===jd&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...E(this,Mr).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){E(this,Je).clear(),E(this,Pr).clear()}},Je=new WeakMap,Pr=new WeakMap,Mr=new WeakMap,li=new WeakMap,ui=new WeakMap,Dr=new WeakMap,ci=new WeakMap,di=new WeakMap,fg),Ng=k.createContext(void 0),Ad=t=>{const n=k.useContext(Ng);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},L1=({client:t,children:n})=>(k.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),a.jsx(Ng.Provider,{value:t,children:n})),Sg=k.createContext(!1),R1=()=>k.useContext(Sg);Sg.Provider;function O1(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var B1=k.createContext(O1()),V1=()=>k.useContext(B1),$1=(t,n,s)=>{const o=s!=null&&s.state.error&&typeof t.throwOnError=="function"?Nd(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||o)&&(n.isReset()||(t.retryOnMount=!1))},z1=t=>{k.useEffect(()=>{t.clearReset()},[t])},U1=({result:t,errorResetBoundary:n,throwOnError:s,query:o,suspense:u})=>t.isError&&!n.isReset()&&!t.isFetching&&o&&(u&&t.data===void 0||Nd(s,[t.error,o])),W1=t=>{if(t.suspense){const s=u=>u==="static"?u:Math.max(u??1e3,1e3),o=t.staleTime;t.staleTime=typeof o=="function"?(...u)=>s(o(...u)):s(o),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},H1=(t,n)=>t.isLoading&&t.isFetching&&!n,K1=(t,n)=>(t==null?void 0:t.suspense)&&n.isPending,gm=(t,n,s)=>n.fetchOptimistic(t).catch(()=>{s.clearReset()});function Q1(t,n,s){var w,j,C,A;const o=R1(),u=V1(),c=Ad(),h=c.defaultQueryOptions(t);(j=(w=c.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||j.call(w,h);const f=c.getQueryCache().get(h.queryHash);h._optimisticResults=o?"isRestoring":"optimistic",W1(h),$1(h,u,f),z1(u);const m=!c.getQueryCache().get(h.queryHash),[x]=k.useState(()=>new n(c,h)),g=x.getOptimisticResult(h),y=!o&&t.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(N=>{const _=y?x.subscribe(ut.batchCalls(N)):Mt;return x.updateResult(),_},[x,y]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),k.useEffect(()=>{x.setOptions(h)},[h,x]),K1(h,g))throw gm(h,x,u);if(U1({result:g,errorResetBoundary:u,throwOnError:h.throwOnError,query:f,suspense:h.suspense}))throw g.error;if((A=(C=c.getDefaultOptions().queries)==null?void 0:C._experimental_afterQuery)==null||A.call(C,h,g),h.experimental_prefetchInRender&&!xs&&H1(g,o)){const N=m?gm(h,x,u):f==null?void 0:f.promise;N==null||N.catch(Mt).finally(()=>{x.updateResult()})}return h.notifyOnChangeProps?g:x.trackResult(g)}function yl(t,n){return Q1(t,A1)}function Ka(t,n){const s=Ad(),[o]=k.useState(()=>new F1(s,t));k.useEffect(()=>{o.setOptions(t)},[o,t]);const u=k.useSyncExternalStore(k.useCallback(h=>o.subscribe(ut.batchCalls(h)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),c=k.useCallback((h,f)=>{o.mutate(h,f).catch(Mt)},[o]);if(u.error&&Nd(o.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:c,mutateAsync:u.mutate}}const xm=()=>{const t=new Date,n=s=>new Date(t.getTime()-s*60*1e3).toISOString();return{connection:"connected",lastActivity:"2m ago",sessions:{groups:[{id:"init-1",label:"Q4 Feature Ship",status:"active"},{id:"init-2",label:"Black Friday Email",status:"active"}],edges:[{parentId:"run-1",childId:"run-2"},{parentId:"run-1",childId:"run-3"}],nodes:[{id:"run-1",parentId:null,runId:"run-1",title:"Q4 Feature Ship – Planning",agentId:"eli",agentName:"Eli",status:"running",progress:45,initiativeId:"init-1",workstreamId:null,groupId:"init-1",groupLabel:"Q4 Feature Ship",startedAt:n(120),updatedAt:n(2),lastEventAt:n(2),lastEventSummary:"Delegated work to design and data agents.",blockers:[]},{id:"run-2",parentId:"run-1",runId:"run-2",title:"Dashboard UI pass",agentId:"dana",agentName:"Dana",status:"running",progress:70,initiativeId:"init-1",workstreamId:"ws-4",groupId:"init-1",groupLabel:"Q4 Feature Ship",startedAt:n(80),updatedAt:n(5),lastEventAt:n(5),lastEventSummary:"Drafted handoff for approval.",blockers:["Approval pending"]},{id:"run-3",parentId:"run-1",runId:"run-3",title:"Usage tracking instrumentation",agentId:"pace",agentName:"Pace",status:"queued",progress:0,initiativeId:"init-1",workstreamId:"ws-5",groupId:"init-1",groupLabel:"Q4 Feature Ship",startedAt:n(30),updatedAt:n(12),lastEventAt:n(12),lastEventSummary:"Waiting for data pipeline access.",blockers:["Access to events table"]},{id:"run-4",parentId:null,runId:"run-4",title:"Black Friday Email Campaign",agentId:"mark",agentName:"Mark",status:"running",progress:55,initiativeId:"init-2",workstreamId:null,groupId:"init-2",groupLabel:"Black Friday Email",startedAt:n(90),updatedAt:n(8),lastEventAt:n(8),lastEventSummary:"Drafted subject line variants.",blockers:[]}]},activity:[{id:"activity-1",type:"decision_requested",title:"Decision requested",description:"Approve dashboard UI layout for Q4 Feature Ship.",agentId:"dana",agentName:"Dana",runId:"run-2",initiativeId:"init-1",timestamp:n(2)},{id:"activity-2",type:"artifact_created",title:"Artifact created: Subject line variants",description:"Drafted 3 subject line variants for approval.",agentId:"mark",agentName:"Mark",runId:"run-4",initiativeId:"init-2",timestamp:n(8)},{id:"activity-3",type:"delegation",title:"Task delegated",description:"Spin up data agent for instrumentation plan.",agentId:"eli",agentName:"Eli",runId:"run-1",initiativeId:"init-1",timestamp:n(18)}],handoffs:[{id:"handoff-1",title:"Dashboard UI approval",status:"created",priority:"high",summary:"Need approval on dashboard UI layout and component hierarchy.",currentActorType:"user",currentActorId:"me",createdAt:n(12),updatedAt:n(2),events:[{id:"handoff-event-1",handoffId:"handoff-1",eventType:"created",actorType:"agent",actorId:"dana",payload:{summary:"Draft layout ready for review."},createdAt:n(12)}]}],decisions:[{id:"decision-1",title:"Approve dashboard copy update",context:"Marketing requested a copy refresh before final launch. Confirm wording changes.",status:"pending",agentName:"Mark",requestedAt:n(22),updatedAt:n(2),waitingMinutes:22}]}};function un(t){const n=t instanceof Date?t:new Date(t),s=Date.now()-n.getTime();if(Number.isNaN(s))return"unknown";const o=Math.floor(s/1e3);if(o<60)return`${o}s ago`;const u=Math.floor(o/60);if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}const G1=8e3,q1=320,X1=600,Y1=120,Z1=120,J1=90,ym={running:0,queued:1,pending:2,blocked:3,failed:4,cancelled:5,completed:6,archived:7};function ct(t){if(!t)return 0;const n=Date.parse(t);return Number.isFinite(n)?n:0}function Cg(t,n){const s=ym[t.status]??99,o=ym[n.status]??99;if(s!==o)return s-o;const u=ct(t.updatedAt??t.lastEventAt??t.startedAt),c=ct(n.updatedAt??n.lastEventAt??n.startedAt);return u!==c?c-u:t.id.localeCompare(n.id)}function vm(t,n){if(t.nodes.length<=n)return t;const s=[...t.nodes].sort(Cg).slice(0,n),o=new Set(s.map(c=>c.id)),u=new Set(s.map(c=>c.groupId));return{nodes:s,edges:t.edges.filter(c=>o.has(c.parentId)&&o.has(c.childId)),groups:t.groups.filter(c=>u.has(c.id))}}function wm(t,n){return t.length<=n?t:[...t].sort((s,o)=>ct(o.updatedAt)-ct(s.updatedAt)).slice(0,n)}function ew(t){const n=t.requestedAt??t.updatedAt??null,s=t.updatedAt??n,o=Number.isFinite(t.waitingMinutes)?Math.max(0,Math.floor(t.waitingMinutes)):n?Math.max(0,Math.floor((Date.now()-ct(n))/6e4)):0;return{id:t.id,title:t.title,context:t.context??null,status:t.status??"pending",agentName:t.agentName??null,requestedAt:n,updatedAt:s,waitingMinutes:o,metadata:t.metadata}}function Ag(t,n){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s+=1)if(t[s].id!==n[s].id||t[s].timestamp!==n[s].timestamp||t[s].type!==n[s].type||t[s].title!==n[s].title)return!1;return!0}function bm(t,n){if(t.nodes.length!==n.nodes.length||t.edges.length!==n.edges.length||t.groups.length!==n.groups.length)return!1;for(let s=0;s<t.nodes.length;s+=1){const o=t.nodes[s],u=n.nodes[s];if(o.id!==u.id||o.status!==u.status||o.title!==u.title||o.progress!==u.progress||o.updatedAt!==u.updatedAt||o.lastEventAt!==u.lastEventAt)return!1}for(let s=0;s<t.edges.length;s+=1){const o=t.edges[s],u=n.edges[s];if(o.parentId!==u.parentId||o.childId!==u.childId)return!1}for(let s=0;s<t.groups.length;s+=1){const o=t.groups[s],u=n.groups[s];if(o.id!==u.id||o.label!==u.label||o.status!==u.status)return!1}return!0}function km(t,n){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s+=1)if(t[s].id!==n[s].id||t[s].updatedAt!==n[s].updatedAt||t[s].status!==n[s].status||t[s].title!==n[s].title)return!1;return!0}function jm(t,n){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s+=1)if(t[s].id!==n[s].id||t[s].status!==n[s].status||t[s].updatedAt!==n[s].updatedAt||t[s].waitingMinutes!==n[s].waitingMinutes)return!1;return!0}function tw(t,n,s){if(n.length===0)return t;const o=new Map;for(const h of t)o.set(h.id,h);let u=!1;for(const h of n){const f=o.get(h.id);if(!f){o.set(h.id,h),u=!0;continue}(f.timestamp!==h.timestamp||f.type!==h.type||f.title!==h.title||f.description!==h.description)&&(o.set(h.id,h),u=!0)}if(!u)return t;const c=Array.from(o.values()).sort((h,f)=>ct(f.timestamp)-ct(h.timestamp)).slice(0,s);return Ag(t,c)?t:c}function Nm(t,n){const s=[...t].sort((c,h)=>ct(h.timestamp)-ct(c.timestamp)).slice(0,n),o=new Set,u=[];for(const c of s)o.has(c.id)||(o.add(c.id),u.push(c));return u}function Sm(t,n){const s=t.filter(c=>!!c&&typeof c.id=="string"&&c.id.length>0).map(ew).sort((c,h)=>c.waitingMinutes!==h.waitingMinutes?h.waitingMinutes-c.waitingMinutes:ct(h.requestedAt??h.updatedAt)-ct(c.requestedAt??c.updatedAt)).slice(0,n),o=new Set,u=[];for(const c of s)o.has(c.id)||(o.add(c.id),u.push(c));return u}function Cm(t){return t==="run_failed"||t==="blocker_created"?"blocked":t==="run_completed"||t==="milestone_completed"?"completed":t==="decision_requested"||t==="handoff_requested"?"pending":t==="decision_resolved"||t==="handoff_fulfilled"?"completed":"running"}function nw(t){const n=t.toLowerCase();return n==="running"||n==="active"?"running":n==="queued"||n==="pending"?"queued":n==="blocked"?"blocked":n==="failed"?"failed":n==="completed"||n==="done"?"completed":"archived"}function Qa(t){return t?`Initiative ${t.length>16?`${t.slice(0,8)}…`:t}`:"Unscoped"}function yc(t){if(!Array.isArray(t))return[];const n=[];for(const s of t)typeof s=="string"&&s.trim().length>0&&n.push(s.trim());return n}function rw(t,n,s){const o=new Map,u=[...t].sort((f,m)=>ct(m.timestamp)-ct(f.timestamp));for(const f of u){if(!f.runId)continue;const m=f.runId,x=o.get(m),g=f.timestamp;if(!x){const y=f.initiativeId??null;o.set(m,{id:m,parentId:null,runId:m,title:f.title,agentId:f.agentId??null,agentName:f.agentName??null,status:Cm(f.type),progress:null,initiativeId:y,workstreamId:null,groupId:y??"unscoped",groupLabel:Qa(y),startedAt:g,updatedAt:g,lastEventAt:g,lastEventSummary:f.title,blockers:f.type==="blocker_created"&&f.description?[f.description]:[]});continue}(!x.startedAt||ct(g)<ct(x.startedAt))&&(x.startedAt=g),ct(g)>=ct(x.updatedAt??x.lastEventAt)&&(x.updatedAt=g,x.lastEventAt=g,x.lastEventSummary=f.title,x.status=Cm(f.type),f.agentName&&(x.agentName=f.agentName),f.agentId&&(x.agentId=f.agentId),f.initiativeId&&(x.initiativeId=f.initiativeId,x.groupId=f.initiativeId,x.groupLabel=Qa(f.initiativeId)),(!x.title||x.title.length<4)&&(x.title=f.title)),f.type==="blocker_created"&&f.description&&(x.blockers.includes(f.description)||x.blockers.push(f.description))}for(const f of n??[]){const m=f.runId??`agent:${f.id}`,x=o.get(m),g=nw(f.status),y=f.initiativeId??null,w=f.currentTask&&f.currentTask.trim().length>0?f.currentTask.trim():`${f.name??f.id} ${g==="archived"?"idle":g}`;if(!x){o.set(m,{id:m,parentId:null,runId:m,title:w,agentId:f.id,agentName:f.name??f.id,status:g,progress:null,initiativeId:y,workstreamId:null,groupId:y??"unscoped",groupLabel:Qa(y),startedAt:f.startedAt??null,updatedAt:f.startedAt??null,lastEventAt:f.startedAt??null,lastEventSummary:f.currentTask,blockers:yc(f.blockers)});continue}!x.agentName&&f.name&&(x.agentName=f.name),x.agentId||(x.agentId=f.id),(!x.title||x.title===x.runId)&&(x.title=w),x.status==="archived"&&g!=="archived"&&(x.status=g),yc(f.blockers).length>0&&(x.blockers=yc(f.blockers)),y&&!x.initiativeId&&(x.initiativeId=y,x.groupId=y,x.groupLabel=Qa(y))}const c=Array.from(o.values()).sort(Cg).slice(0,s),h=new Map;for(const f of c)h.has(f.groupId)||h.set(f.groupId,{id:f.groupId,label:f.groupLabel,status:f.status});return{nodes:c,edges:[],groups:Array.from(h.values())}}async function sw(t,n){var s;try{const o=await fetch(t,n),c=(((s=o.headers.get("content-type"))==null?void 0:s.toLowerCase())??"").includes("application/json");if(!o.ok){let h=`${o.status} ${o.statusText}`;if(c){const f=await o.json().catch(()=>null);f!=null&&f.error&&(h=`${o.status} ${f.error}`)}else{const f=(await o.text().catch(()=>"")).replace(/\s+/g," ").slice(0,80);f.length>0&&(h=`${o.status} ${f}`)}return{ok:!1,status:o.status,data:null,error:h}}if(!c){const h=(await o.text().catch(()=>"")).replace(/\s+/g," ").slice(0,80);return{ok:!1,status:o.status,data:null,error:`Unexpected content type for ${t}${h?`: ${h}`:""}`}}return{ok:!0,status:o.status,data:await o.json(),error:null}}catch(o){return{ok:!1,status:0,data:null,error:o instanceof Error?o.message:"Network error"}}}function iw(t,n,s,o){var f,m,x;const u=((f=n[0])==null?void 0:f.timestamp)??null,c=((m=o[0])==null?void 0:m.requestedAt)??((x=o[0])==null?void 0:x.updatedAt)??null,h=ct(u)>=ct(c)?u:c;return{connection:"connected",lastActivity:h?un(h):null,sessions:t,activity:n,handoffs:s,decisions:o}}function ow(t={}){const{enabled:n=!0,pollInterval:s=G1,useMock:o=!1,enableDecisions:u=!0,maxSessions:c=q1,maxActivityItems:h=X1,maxHandoffs:f=Y1,maxDecisions:m=Z1,batchWindowMs:x=J1}=t,[g,y]=k.useState(xm()),[w,j]=k.useState(!o),[C,A]=k.useState(null),N=k.useRef(),_=k.useRef(null),[B,W]=k.useState(!1),$=k.useCallback((O,G,oe,K=null)=>{const I=vm(O,c),J=Nm(G,h),ne=wm(oe,f);y(le=>{const q=K===null?le.decisions:Sm(K,m);return bm(le.sessions,I)&&Ag(le.activity,J)&&km(le.handoffs,ne)&&jm(le.decisions,q)&&le.connection==="connected"?le:iw(I,J,ne,q)}),j(!1)},[h,m,f,c]),b=k.useCallback(async()=>{if(!n){y(G=>G.connection==="disconnected"?G:{...G,connection:"disconnected"}),j(!1),A(null);return}if(_.current)return _.current;if(o){y(xm()),j(!1);return}const O=(async()=>{try{const G=new URLSearchParams({sessionsLimit:String(c),activityLimit:String(h),decisionsLimit:String(m),include_idle:"true"}),oe=await sw(`/orgx/api/live/snapshot?${G.toString()}`);if(!oe.ok||!oe.data)throw new Error(oe.error??"Snapshot endpoint unavailable");const K=oe.data,I=Array.isArray(K.activity)?K.activity:[],J=Array.isArray(K.handoffs)?K.handoffs:[],ne=u&&Array.isArray(K.decisions)?K.decisions:[],le=K.sessions&&Array.isArray(K.sessions.nodes)&&Array.isArray(K.sessions.edges)&&Array.isArray(K.sessions.groups)?K.sessions:rw(I,K.agents,c);$(le,I,J,ne);const q=Array.isArray(K.degraded)?K.degraded:[];q.length>0?(A(`Partial live data: ${q.join("; ")}`),y(R=>R.connection==="reconnecting"?R:{...R,connection:"reconnecting"}),W(!0)):(A(null),y(R=>R.connection==="connected"?R:{...R,connection:"connected"}))}catch(G){A(G instanceof Error?G.message:"Unknown error"),y(oe=>oe.connection==="reconnecting"?oe:{...oe,connection:"reconnecting"}),j(!1)}finally{_.current=null}})();return _.current=O,O},[$,n,u,h,m,f,c,o]),F=k.useCallback(async(O,G)=>{if(!u)throw new Error("OrgX decisions are unavailable while disconnected.");const oe=Array.from(new Set(O.filter(Boolean)));if(oe.length===0)return{updated:0,failed:0};const K=await fetch("/orgx/api/live/decisions/approve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:oe,action:G})}),I=await K.json().catch(()=>null),J=Array.isArray(I==null?void 0:I.results)?I.results:[],ne=new Set(J.filter(R=>R.ok).map(R=>R.id));if(!K.ok&&K.status!==207){const R=typeof(I==null?void 0:I.error)=="string"?I.error:`Decision action failed (${K.status})`;throw new Error(R)}if(ne.size===0&&K.ok&&((I==null?void 0:I.failed)??0)===0)for(const R of oe)ne.add(R);ne.size>0&&y(R=>{const X=R.decisions.filter(ye=>ne.has(ye.id));if(X.length===0)return R;const Y=new Date().toISOString(),T=X.map(ye=>({id:`decision:${G}:${ye.id}:${Date.now()}`,type:"decision_resolved",title:G==="approve"?`Approved: ${ye.title}`:`Rejected: ${ye.title}`,description:ye.context,agentId:null,agentName:ye.agentName,runId:null,initiativeId:null,timestamp:Y,metadata:{decisionId:ye.id,action:G}})),L=Nm(T.concat(R.activity),h);return{...R,decisions:R.decisions.filter(ye=>!ne.has(ye.id)),activity:L,lastActivity:un(Y)}});const le=(I==null?void 0:I.updated)??ne.size,q=(I==null?void 0:I.failed)??Math.max(0,oe.length-ne.size);return{updated:le,failed:q}},[u,h]),U=k.useCallback(async O=>F([O],"approve"),[F]),D=k.useCallback(async()=>{const O=g.decisions.map(G=>G.id);return F(O,"approve")},[F,g.decisions]);return k.useEffect(()=>{u||y(O=>O.decisions.length===0?O:{...O,decisions:[]})},[u]),k.useEffect(()=>{if(!n){W(!1),j(!1),A(null);return}if(o){b();return}b();const O=new EventSource("/orgx/api/live/stream");let G=null,oe=null,K=null,I=[],J=null,ne;const le=()=>{if(ne=void 0,G){const R=G;G=null,oe=null,K=null,I=[],J=null,$(R.sessions,R.activity,R.handoffs,R.decisions);return}!oe&&!K&&!J&&I.length===0||(y(R=>{var Y;let X=R;if(oe){const T=vm(oe,c);oe=null,bm(X.sessions,T)||(X={...X,sessions:T})}if(K){const T=wm(K,f);K=null,km(X.handoffs,T)||(X={...X,handoffs:T})}if(J){const T=Sm(J,m);J=null,jm(X.decisions,T)||(X={...X,decisions:T})}if(I.length>0){const T=tw(X.activity,I,h);I=[],T!==X.activity&&(X={...X,activity:T,lastActivity:(Y=T[0])!=null&&Y.timestamp?un(T[0].timestamp):X.lastActivity})}return X===R?R:X.connection==="connected"?X:{...X,connection:"connected"}}),A(null),j(!1))},q=()=>{ne||(ne=setTimeout(le,x))};return O.onopen=()=>{W(!1),y(R=>R.connection==="connected"?R:{...R,connection:"connected"}),A(null)},O.onerror=()=>{y(R=>R.connection==="reconnecting"?R:{...R,connection:"reconnecting"}),W(!0)},O.addEventListener("snapshot",R=>{try{const X=JSON.parse(R.data);G={sessions:X.sessions,activity:X.activity??[],handoffs:X.handoffs??[],decisions:u?X.decisions??null:[]},q()}catch(X){A(X instanceof Error?X.message:"Invalid snapshot")}}),O.addEventListener("activity.appended",R=>{try{const X=JSON.parse(R.data);if(X.length===0)return;I=I.concat(X),q()}catch{}}),O.addEventListener("session.updated",R=>{try{oe=JSON.parse(R.data),q()}catch{}}),O.addEventListener("handoff.updated",R=>{try{K=JSON.parse(R.data),q()}catch{}}),O.addEventListener("decision.updated",R=>{if(u)try{J=JSON.parse(R.data),q()}catch{}}),()=>{ne&&clearTimeout(ne),O.close()}},[$,x,n,u,b,h,m,f,c,o]),k.useEffect(()=>{if(n&&!o&&(N.current&&clearInterval(N.current),!!B))return N.current=setInterval(b,s),()=>{N.current&&clearInterval(N.current)}},[n,b,s,B,o]),{data:g,isLoading:w,error:C,refetch:b,approveDecision:U,approveAllDecisions:D}}const aw="https://orgx.mintlify.site/guides/openclaw-plugin-setup",lw=1500,vc="orgx.onboarding.skip",wc={status:"idle",hasApiKey:!1,connectionVerified:!1,workspaceName:null,lastError:null,nextAction:"connect",docsUrl:aw,keySource:"none",installationId:null,connectUrl:null,pairingId:null,expiresAt:null,pollIntervalMs:null};function uw(t){if(typeof t=="string")return t;if(t&&typeof t=="object")return JSON.stringify(t)}async function to(t){const n=await t,s=await n.json().catch(()=>null);return n.ok?s??{}:{ok:!1,error:uw(s==null?void 0:s.error)??`Request failed (${n.status})`}}function cw(){const[t,n]=k.useState(wc),[s,o]=k.useState(!0),[u,c]=k.useState(!1),[h,f]=k.useState(!1),m=k.useRef(null),[x,g]=k.useState(()=>typeof window>"u"?!1:window.localStorage.getItem(vc)==="1"),y=k.useCallback(async()=>{const B=await to(fetch("/orgx/api/onboarding/status",{method:"GET"}));if(!B.ok||!B.data){const W=B.error??"Failed to load onboarding state",$={...wc,status:"error",lastError:W,nextAction:"retry"};return n($),$}return n(B.data),B.data},[]);k.useEffect(()=>{let B=!1;return(async()=>{o(!0);const W=await y();B||(n(W),o(!1))})(),()=>{B=!0}},[y]),k.useEffect(()=>{if(!(t.status==="awaiting_browser_auth"||t.status==="pairing"))return;const W=Math.max(900,t.pollIntervalMs??lw),$=window.setInterval(async()=>{const b=await to(fetch("/orgx/api/onboarding/status",{method:"GET"}));b.ok&&b.data&&n(b.data)},W);return()=>{window.clearInterval($)}},[t.pollIntervalMs,t.status]),k.useEffect(()=>{if(!(typeof window>"u")){if(x){window.localStorage.setItem(vc,"1");return}window.localStorage.removeItem(vc)}},[x]);const w=k.useCallback(()=>{if(typeof window>"u")return null;try{const B=window.open("","_blank");return B?(B.opener=null,B.document.title="Connecting to OrgX…",B.document.body.innerHTML='<div style="font-family:system-ui,-apple-system,sans-serif;padding:20px;color:#111">Connecting to OrgX...</div>',B):null}catch{return null}},[]),j=k.useCallback(async()=>{var W;const B=w();m.current=B,c(!0);try{const $=await to(fetch("/orgx/api/onboarding/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceName:navigator.platform||"OpenClaw Device",platform:navigator.platform})}));if(!$.ok||!((W=$.data)!=null&&W.state)){B&&!B.closed&&B.close();const b=$.error??"Could not start pairing";n(F=>({...F,status:"error",lastError:b,nextAction:"enter_manual_key"}));return}if(n($.data.state),$.data.connectUrl){const b=m.current;let F=!1;if(b&&!b.closed)try{b.location.href=$.data.connectUrl,F=!0}catch{F=!1}F||(F=!!window.open($.data.connectUrl,"_blank","noopener,noreferrer")),F||n(U=>({...U,lastError:'Popup was blocked. Use "Approve in browser" below.',nextAction:"open_browser"}))}}finally{m.current=null,c(!1)}},[w]),C=k.useCallback(async(B,W)=>{f(!0);try{const $=B.trim(),b=$.replace(/^[a-z]+_/i,""),F=Array.from(new Set([$,b?`oxk_${b}`:"",b?`orgx_${b}`:""].map(D=>D.trim()).filter(D=>D.length>0)));let U="Manual key validation failed";for(const D of F){const O={"Content-Type":"application/json","X-OrgX-Api-Key":D,Authorization:`Bearer ${D}`};W&&W.trim().length>0&&(O["X-OrgX-User-Id"]=W.trim());const G=await to(fetch("/orgx/api/onboarding/manual-key",{method:"POST",headers:O,body:JSON.stringify({apiKey:D,userId:W})}));if(G.ok&&G.data)return n(G.data),G.data;U=G.error??U}throw n(D=>({...D,status:"manual_key",lastError:U,nextAction:"enter_manual_key"})),new Error(U)}finally{f(!1)}},[]),A=k.useCallback(async()=>{const B=await to(fetch("/orgx/api/onboarding/disconnect",{method:"POST"}));if(B.ok&&B.data)return n(B.data),B.data;const W={...wc,status:"idle"};return n(W),W},[]),N=k.useCallback(()=>{n(B=>({...B,status:"idle",lastError:null,nextAction:"connect",connectUrl:null,pairingId:null,expiresAt:null,pollIntervalMs:null}))},[]),_=k.useMemo(()=>x?!1:!(t.hasApiKey&&t.connectionVerified&&t.status==="connected"),[x,t.connectionVerified,t.hasApiKey,t.status]);return{state:t,showGate:_,isLoading:s,isStarting:u,isSubmittingManual:h,refreshStatus:y,startPairing:j,submitManualKey:C,disconnect:A,skipGate:()=>g(!0),resumeGate:()=>g(!1),backToPairing:N,setManualMode:()=>n(B=>({...B,status:"manual_key",nextAction:"enter_manual_key"}))}}const Q={lime:"#BFFF00",teal:"#14B8A6",cyan:"#0AD4C4",iris:"#7C7CFF",amber:"#F5B700",red:"#FF6B88",background:"#02040A",cardBg:"#08090D",cardBgElevated:"#0C0E14",cardBorder:"rgba(255, 255, 255, 0.08)",cardBorderStrong:"rgba(255, 255, 255, 0.12)",textMuted:"#8F9AB7"},dw={Pace:"#7C7CFF",Eli:"#BFFF00",Dana:"#FF00D4",Mark:"#F5B700",System:"#14B8A6"};function hw(t){return dw[t]??Q.teal}function fw(t){return t.split(" ").map(n=>n[0]).join("").toUpperCase().slice(0,2)}const Ed=k.createContext({});function Td(t){const n=k.useRef(null);return n.current===null&&(n.current=t()),n.current}const vl=k.createContext(null),Pd=k.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class pw extends k.Component{getSnapshotBeforeUpdate(n){const s=this.props.childRef.current;if(s&&n.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=s.offsetHeight||0,o.width=s.offsetWidth||0,o.top=s.offsetTop,o.left=s.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function mw({children:t,isPresent:n}){const s=k.useId(),o=k.useRef(null),u=k.useRef({width:0,height:0,top:0,left:0}),{nonce:c}=k.useContext(Pd);return k.useInsertionEffect(()=>{const{width:h,height:f,top:m,left:x}=u.current;if(n||!o.current||!h||!f)return;o.current.dataset.motionPopId=s;const g=document.createElement("style");return c&&(g.nonce=c),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(`
|
|
41
|
+
[data-motion-pop-id="${s}"] {
|
|
42
|
+
position: absolute !important;
|
|
43
|
+
width: ${h}px !important;
|
|
44
|
+
height: ${f}px !important;
|
|
45
|
+
top: ${m}px !important;
|
|
46
|
+
left: ${x}px !important;
|
|
47
|
+
}
|
|
48
|
+
`),()=>{document.head.removeChild(g)}},[n]),a.jsx(pw,{isPresent:n,childRef:o,sizeRef:u,children:k.cloneElement(t,{ref:o})})}const gw=({children:t,initial:n,isPresent:s,onExitComplete:o,custom:u,presenceAffectsLayout:c,mode:h})=>{const f=Td(xw),m=k.useId(),x=k.useCallback(y=>{f.set(y,!0);for(const w of f.values())if(!w)return;o&&o()},[f,o]),g=k.useMemo(()=>({id:m,initial:n,isPresent:s,custom:u,onExitComplete:x,register:y=>(f.set(y,!1),()=>f.delete(y))}),c?[Math.random(),x]:[s,x]);return k.useMemo(()=>{f.forEach((y,w)=>f.set(w,!1))},[s]),k.useEffect(()=>{!s&&!f.size&&o&&o()},[s]),h==="popLayout"&&(t=a.jsx(mw,{isPresent:s,children:t})),a.jsx(vl.Provider,{value:g,children:t})};function xw(){return new Map}function Eg(t=!0){const n=k.useContext(vl);if(n===null)return[!0,null];const{isPresent:s,onExitComplete:o,register:u}=n,c=k.useId();k.useEffect(()=>{t&&u(c)},[t]);const h=k.useCallback(()=>t&&o&&o(c),[c,o,t]);return!s&&o?[!1,h]:[!0]}const Ga=t=>t.key||"";function Am(t){const n=[];return k.Children.forEach(t,s=>{k.isValidElement(s)&&n.push(s)}),n}const Md=typeof window<"u",Tg=Md?k.useLayoutEffect:k.useEffect,Ir=({children:t,custom:n,initial:s=!0,onExitComplete:o,presenceAffectsLayout:u=!0,mode:c="sync",propagate:h=!1})=>{const[f,m]=Eg(h),x=k.useMemo(()=>Am(t),[t]),g=h&&!f?[]:x.map(Ga),y=k.useRef(!0),w=k.useRef(x),j=Td(()=>new Map),[C,A]=k.useState(x),[N,_]=k.useState(x);Tg(()=>{y.current=!1,w.current=x;for(let $=0;$<N.length;$++){const b=Ga(N[$]);g.includes(b)?j.delete(b):j.get(b)!==!0&&j.set(b,!1)}},[N,g.length,g.join("-")]);const B=[];if(x!==C){let $=[...x];for(let b=0;b<N.length;b++){const F=N[b],U=Ga(F);g.includes(U)||($.splice(b,0,F),B.push(F))}c==="wait"&&B.length&&($=B),_(Am($)),A(x);return}const{forceRender:W}=k.useContext(Ed);return a.jsx(a.Fragment,{children:N.map($=>{const b=Ga($),F=h&&!f?!1:x===N||g.includes(b),U=()=>{if(j.has(b))j.set(b,!0);else return;let D=!0;j.forEach(O=>{O||(D=!1)}),D&&(W==null||W(),_(w.current),h&&(m==null||m()),o&&o())};return a.jsx(gw,{isPresent:F,initial:!y.current||s?void 0:!1,custom:F?void 0:n,presenceAffectsLayout:u,mode:c,onExitComplete:F?void 0:U,children:$},b)})})},Gt=t=>t;let Pg=Gt;function Dd(t){let n;return()=>(n===void 0&&(n=t()),n)}const hi=(t,n,s)=>{const o=n-t;return o===0?1:(s-t)/o},Yn=t=>t*1e3,Zn=t=>t/1e3,yw={useManualTiming:!1};function vw(t){let n=new Set,s=new Set,o=!1,u=!1;const c=new WeakSet;let h={delta:0,timestamp:0,isProcessing:!1};function f(x){c.has(x)&&(m.schedule(x),t()),x(h)}const m={schedule:(x,g=!1,y=!1)=>{const j=y&&o?n:s;return g&&c.add(x),j.has(x)||j.add(x),x},cancel:x=>{s.delete(x),c.delete(x)},process:x=>{if(h=x,o){u=!0;return}o=!0,[n,s]=[s,n],n.forEach(f),n.clear(),o=!1,u&&(u=!1,m.process(x))}};return m}const qa=["read","resolveKeyframes","update","preRender","render","postRender"],ww=40;function Mg(t,n){let s=!1,o=!0;const u={delta:0,timestamp:0,isProcessing:!1},c=()=>s=!0,h=qa.reduce((_,B)=>(_[B]=vw(c),_),{}),{read:f,resolveKeyframes:m,update:x,preRender:g,render:y,postRender:w}=h,j=()=>{const _=performance.now();s=!1,u.delta=o?1e3/60:Math.max(Math.min(_-u.timestamp,ww),1),u.timestamp=_,u.isProcessing=!0,f.process(u),m.process(u),x.process(u),g.process(u),y.process(u),w.process(u),u.isProcessing=!1,s&&n&&(o=!1,t(j))},C=()=>{s=!0,o=!0,u.isProcessing||t(j)};return{schedule:qa.reduce((_,B)=>{const W=h[B];return _[B]=($,b=!1,F=!1)=>(s||C(),W.schedule($,b,F)),_},{}),cancel:_=>{for(let B=0;B<qa.length;B++)h[qa[B]].cancel(_)},state:u,steps:h}}const{schedule:Ke,cancel:_r,state:vt,steps:bc}=Mg(typeof requestAnimationFrame<"u"?requestAnimationFrame:Gt,!0),Dg=k.createContext({strict:!1}),Em={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"]},fi={};for(const t in Em)fi[t]={isEnabled:n=>Em[t].some(s=>!!n[s])};function bw(t){for(const n in t)fi[n]={...fi[n],...t[n]}}const kw=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 cl(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||kw.has(t)}let Fg=t=>!cl(t);function jw(t){t&&(Fg=n=>n.startsWith("on")?!cl(n):t(n))}try{jw(require("@emotion/is-prop-valid").default)}catch{}function Nw(t,n,s){const o={};for(const u in t)u==="values"&&typeof t.values=="object"||(Fg(u)||s===!0&&cl(u)||!n&&!cl(u)||t.draggable&&u.startsWith("onDrag"))&&(o[u]=t[u]);return o}function Sw(t){if(typeof Proxy>"u")return t;const n=new Map,s=(...o)=>t(...o);return new Proxy(s,{get:(o,u)=>u==="create"?t:(n.has(u)||n.set(u,t(u)),n.get(u))})}const wl=k.createContext({});function wo(t){return typeof t=="string"||Array.isArray(t)}function bl(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Fd=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Id=["initial",...Fd];function kl(t){return bl(t.animate)||Id.some(n=>wo(t[n]))}function Ig(t){return!!(kl(t)||t.variants)}function Cw(t,n){if(kl(t)){const{initial:s,animate:o}=t;return{initial:s===!1||wo(s)?s:void 0,animate:wo(o)?o:void 0}}return t.inherit!==!1?n:{}}function Aw(t){const{initial:n,animate:s}=Cw(t,k.useContext(wl));return k.useMemo(()=>({initial:n,animate:s}),[Tm(n),Tm(s)])}function Tm(t){return Array.isArray(t)?t.join(" "):t}const Ew=Symbol.for("motionComponentSymbol");function Gs(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Tw(t,n,s){return k.useCallback(o=>{o&&t.onMount&&t.onMount(o),n&&(o?n.mount(o):n.unmount()),s&&(typeof s=="function"?s(o):Gs(s)&&(s.current=o))},[n])}const _d=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Pw="framerAppearId",_g="data-"+_d(Pw),{schedule:Ld}=Mg(queueMicrotask,!1),Lg=k.createContext({});function Mw(t,n,s,o,u){var c,h;const{visualElement:f}=k.useContext(wl),m=k.useContext(Dg),x=k.useContext(vl),g=k.useContext(Pd).reducedMotion,y=k.useRef(null);o=o||m.renderer,!y.current&&o&&(y.current=o(t,{visualState:n,parent:f,props:s,presenceContext:x,blockInitialAnimation:x?x.initial===!1:!1,reducedMotionConfig:g}));const w=y.current,j=k.useContext(Lg);w&&!w.projection&&u&&(w.type==="html"||w.type==="svg")&&Dw(y.current,s,u,j);const C=k.useRef(!1);k.useInsertionEffect(()=>{w&&C.current&&w.update(s,x)});const A=s[_g],N=k.useRef(!!A&&!(!((c=window.MotionHandoffIsComplete)===null||c===void 0)&&c.call(window,A))&&((h=window.MotionHasOptimisedAnimation)===null||h===void 0?void 0:h.call(window,A)));return Tg(()=>{w&&(C.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),Ld.render(w.render),N.current&&w.animationState&&w.animationState.animateChanges())}),k.useEffect(()=>{w&&(!N.current&&w.animationState&&w.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var _;(_=window.MotionHandoffMarkAsComplete)===null||_===void 0||_.call(window,A)}),N.current=!1))}),w}function Dw(t,n,s,o){const{layoutId:u,layout:c,drag:h,dragConstraints:f,layoutScroll:m,layoutRoot:x}=n;t.projection=new s(t.latestValues,n["data-framer-portal-id"]?void 0:Rg(t.parent)),t.projection.setOptions({layoutId:u,layout:c,alwaysMeasureLayout:!!h||f&&Gs(f),visualElement:t,animationType:typeof c=="string"?c:"both",initialPromotionConfig:o,layoutScroll:m,layoutRoot:x})}function Rg(t){if(t)return t.options.allowProjection!==!1?t.projection:Rg(t.parent)}function Fw({preloadedFeatures:t,createVisualElement:n,useRender:s,useVisualState:o,Component:u}){var c,h;t&&bw(t);function f(x,g){let y;const w={...k.useContext(Pd),...x,layoutId:Iw(x)},{isStatic:j}=w,C=Aw(x),A=o(x,j);if(!j&&Md){_w();const N=Lw(w);y=N.MeasureLayout,C.visualElement=Mw(u,A,w,n,N.ProjectionNode)}return a.jsxs(wl.Provider,{value:C,children:[y&&C.visualElement?a.jsx(y,{visualElement:C.visualElement,...w}):null,s(u,x,Tw(A,C.visualElement,g),A,j,C.visualElement)]})}f.displayName=`motion.${typeof u=="string"?u:`create(${(h=(c=u.displayName)!==null&&c!==void 0?c:u.name)!==null&&h!==void 0?h:""})`}`;const m=k.forwardRef(f);return m[Ew]=u,m}function Iw({layoutId:t}){const n=k.useContext(Ed).id;return n&&t!==void 0?n+"-"+t:t}function _w(t,n){k.useContext(Dg).strict}function Lw(t){const{drag:n,layout:s}=fi;if(!n&&!s)return{};const o={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(t)||s!=null&&s.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const Rw=["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 Rd(t){return typeof t!="string"||t.includes("-")?!1:!!(Rw.indexOf(t)>-1||/[A-Z]/u.test(t))}function Pm(t){const n=[{},{}];return t==null||t.values.forEach((s,o)=>{n[0][o]=s.get(),n[1][o]=s.getVelocity()}),n}function Od(t,n,s,o){if(typeof n=="function"){const[u,c]=Pm(o);n=n(s!==void 0?s:t.custom,u,c)}if(typeof n=="string"&&(n=t.variants&&t.variants[n]),typeof n=="function"){const[u,c]=Pm(o);n=n(s!==void 0?s:t.custom,u,c)}return n}const rd=t=>Array.isArray(t),Ow=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Bw=t=>rd(t)?t[t.length-1]||0:t,Ct=t=>!!(t&&t.getVelocity);function nl(t){const n=Ct(t)?t.get():t;return Ow(n)?n.toValue():n}function Vw({scrapeMotionValuesFromProps:t,createRenderState:n,onUpdate:s},o,u,c){const h={latestValues:$w(o,u,c,t),renderState:n()};return s&&(h.onMount=f=>s({props:o,current:f,...h}),h.onUpdate=f=>s(f)),h}const Og=t=>(n,s)=>{const o=k.useContext(wl),u=k.useContext(vl),c=()=>Vw(t,n,o,u);return s?c():Td(c)};function $w(t,n,s,o){const u={},c=o(t,{});for(const w in c)u[w]=nl(c[w]);let{initial:h,animate:f}=t;const m=kl(t),x=Ig(t);n&&x&&!m&&t.inherit!==!1&&(h===void 0&&(h=n.initial),f===void 0&&(f=n.animate));let g=s?s.initial===!1:!1;g=g||h===!1;const y=g?f:h;if(y&&typeof y!="boolean"&&!bl(y)){const w=Array.isArray(y)?y:[y];for(let j=0;j<w.length;j++){const C=Od(t,w[j]);if(C){const{transitionEnd:A,transition:N,..._}=C;for(const B in _){let W=_[B];if(Array.isArray(W)){const $=g?W.length-1:0;W=W[$]}W!==null&&(u[B]=W)}for(const B in A)u[B]=A[B]}}}return u}const gi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vs=new Set(gi),Bg=t=>n=>typeof n=="string"&&n.startsWith(t),Vg=Bg("--"),zw=Bg("var(--"),Bd=t=>zw(t)?Uw.test(t.split("/*")[0].trim()):!1,Uw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,$g=(t,n)=>n&&typeof t=="number"?n.transform(t):t,er=(t,n,s)=>s>n?n:s<t?t:s,xi={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},bo={...xi,transform:t=>er(0,1,t)},Xa={...xi,default:1},Do=t=>({test:n=>typeof n=="string"&&n.endsWith(t)&&n.split(" ").length===1,parse:parseFloat,transform:n=>`${n}${t}`}),jr=Do("deg"),Dn=Do("%"),Ne=Do("px"),Ww=Do("vh"),Hw=Do("vw"),Mm={...Dn,parse:t=>Dn.parse(t)/100,transform:t=>Dn.transform(t*100)},Kw={borderWidth:Ne,borderTopWidth:Ne,borderRightWidth:Ne,borderBottomWidth:Ne,borderLeftWidth:Ne,borderRadius:Ne,radius:Ne,borderTopLeftRadius:Ne,borderTopRightRadius:Ne,borderBottomRightRadius:Ne,borderBottomLeftRadius:Ne,width:Ne,maxWidth:Ne,height:Ne,maxHeight:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,backgroundPositionX:Ne,backgroundPositionY:Ne},Qw={rotate:jr,rotateX:jr,rotateY:jr,rotateZ:jr,scale:Xa,scaleX:Xa,scaleY:Xa,scaleZ:Xa,skew:jr,skewX:jr,skewY:jr,distance:Ne,translateX:Ne,translateY:Ne,translateZ:Ne,x:Ne,y:Ne,z:Ne,perspective:Ne,transformPerspective:Ne,opacity:bo,originX:Mm,originY:Mm,originZ:Ne},Dm={...xi,transform:Math.round},Vd={...Kw,...Qw,zIndex:Dm,size:Ne,fillOpacity:bo,strokeOpacity:bo,numOctaves:Dm},Gw={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qw=gi.length;function Xw(t,n,s){let o="",u=!0;for(let c=0;c<qw;c++){const h=gi[c],f=t[h];if(f===void 0)continue;let m=!0;if(typeof f=="number"?m=f===(h.startsWith("scale")?1:0):m=parseFloat(f)===0,!m||s){const x=$g(f,Vd[h]);if(!m){u=!1;const g=Gw[h]||h;o+=`${g}(${x}) `}s&&(n[h]=x)}}return o=o.trim(),s?o=s(n,u?"":o):u&&(o="none"),o}function $d(t,n,s){const{style:o,vars:u,transformOrigin:c}=t;let h=!1,f=!1;for(const m in n){const x=n[m];if(vs.has(m)){h=!0;continue}else if(Vg(m)){u[m]=x;continue}else{const g=$g(x,Vd[m]);m.startsWith("origin")?(f=!0,c[m]=g):o[m]=g}}if(n.transform||(h||s?o.transform=Xw(n,t.transform,s):o.transform&&(o.transform="none")),f){const{originX:m="50%",originY:x="50%",originZ:g=0}=c;o.transformOrigin=`${m} ${x} ${g}`}}const Yw={offset:"stroke-dashoffset",array:"stroke-dasharray"},Zw={offset:"strokeDashoffset",array:"strokeDasharray"};function Jw(t,n,s=1,o=0,u=!0){t.pathLength=1;const c=u?Yw:Zw;t[c.offset]=Ne.transform(-o);const h=Ne.transform(n),f=Ne.transform(s);t[c.array]=`${h} ${f}`}function Fm(t,n,s){return typeof t=="string"?t:Ne.transform(n+s*t)}function eb(t,n,s){const o=Fm(n,t.x,t.width),u=Fm(s,t.y,t.height);return`${o} ${u}`}function zd(t,{attrX:n,attrY:s,attrScale:o,originX:u,originY:c,pathLength:h,pathSpacing:f=1,pathOffset:m=0,...x},g,y){if($d(t,x,y),g){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:w,style:j,dimensions:C}=t;w.transform&&(C&&(j.transform=w.transform),delete w.transform),C&&(u!==void 0||c!==void 0||j.transform)&&(j.transformOrigin=eb(C,u!==void 0?u:.5,c!==void 0?c:.5)),n!==void 0&&(w.x=n),s!==void 0&&(w.y=s),o!==void 0&&(w.scale=o),h!==void 0&&Jw(w,h,f,m,!1)}const Ud=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),zg=()=>({...Ud(),attrs:{}}),Wd=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Ug(t,{style:n,vars:s},o,u){Object.assign(t.style,n,u&&u.getProjectionStyles(o));for(const c in s)t.style.setProperty(c,s[c])}const Wg=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 Hg(t,n,s,o){Ug(t,n,void 0,o);for(const u in n.attrs)t.setAttribute(Wg.has(u)?u:_d(u),n.attrs[u])}const dl={};function tb(t){Object.assign(dl,t)}function Kg(t,{layout:n,layoutId:s}){return vs.has(t)||t.startsWith("origin")||(n||s!==void 0)&&(!!dl[t]||t==="opacity")}function Hd(t,n,s){var o;const{style:u}=t,c={};for(const h in u)(Ct(u[h])||n.style&&Ct(n.style[h])||Kg(h,t)||((o=s==null?void 0:s.getValue(h))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(c[h]=u[h]);return c}function Qg(t,n,s){const o=Hd(t,n,s);for(const u in t)if(Ct(t[u])||Ct(n[u])){const c=gi.indexOf(u)!==-1?"attr"+u.charAt(0).toUpperCase()+u.substring(1):u;o[c]=t[u]}return o}function nb(t,n){try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}const Im=["x","y","width","height","cx","cy","r"],rb={useVisualState:Og({scrapeMotionValuesFromProps:Qg,createRenderState:zg,onUpdate:({props:t,prevProps:n,current:s,renderState:o,latestValues:u})=>{if(!s)return;let c=!!t.drag;if(!c){for(const f in u)if(vs.has(f)){c=!0;break}}if(!c)return;let h=!n;if(n)for(let f=0;f<Im.length;f++){const m=Im[f];t[m]!==n[m]&&(h=!0)}h&&Ke.read(()=>{nb(s,o),Ke.render(()=>{zd(o,u,Wd(s.tagName),t.transformTemplate),Hg(s,o)})})}})},sb={useVisualState:Og({scrapeMotionValuesFromProps:Hd,createRenderState:Ud})};function Gg(t,n,s){for(const o in n)!Ct(n[o])&&!Kg(o,s)&&(t[o]=n[o])}function ib({transformTemplate:t},n){return k.useMemo(()=>{const s=Ud();return $d(s,n,t),Object.assign({},s.vars,s.style)},[n])}function ob(t,n){const s=t.style||{},o={};return Gg(o,s,t),Object.assign(o,ib(t,n)),o}function ab(t,n){const s={},o=ob(t,n);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=o,s}function lb(t,n,s,o){const u=k.useMemo(()=>{const c=zg();return zd(c,n,Wd(o),t.transformTemplate),{...c.attrs,style:{...c.style}}},[n]);if(t.style){const c={};Gg(c,t.style,t),u.style={...c,...u.style}}return u}function ub(t=!1){return(s,o,u,{latestValues:c},h)=>{const m=(Rd(s)?lb:ab)(o,c,h,s),x=Nw(o,typeof s=="string",t),g=s!==k.Fragment?{...x,...m,ref:u}:{},{children:y}=o,w=k.useMemo(()=>Ct(y)?y.get():y,[y]);return k.createElement(s,{...g,children:w})}}function cb(t,n){return function(o,{forwardMotionProps:u}={forwardMotionProps:!1}){const h={...Rd(o)?rb:sb,preloadedFeatures:t,useRender:ub(u),createVisualElement:n,Component:o};return Fw(h)}}function qg(t,n){if(!Array.isArray(n))return!1;const s=n.length;if(s!==t.length)return!1;for(let o=0;o<s;o++)if(n[o]!==t[o])return!1;return!0}function jl(t,n,s){const o=t.getProps();return Od(o,n,s!==void 0?s:o.custom,t)}const db=Dd(()=>window.ScrollTimeline!==void 0);class hb{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,s){for(let o=0;o<this.animations.length;o++)this.animations[o][n]=s}attachTimeline(n,s){const o=this.animations.map(u=>{if(db()&&u.attachTimeline)return u.attachTimeline(n);if(typeof s=="function")return s(u)});return()=>{o.forEach((u,c)=>{u&&u(),this.animations[c].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 s=0;s<this.animations.length;s++)n=Math.max(n,this.animations[s].duration);return n}runAll(n){this.animations.forEach(s=>s[n]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class fb extends hb{then(n,s){return Promise.all(this.animations).then(n).catch(s)}}function Kd(t,n){return t?t[n]||t.default||t:void 0}const sd=2e4;function Xg(t){let n=0;const s=50;let o=t.next(n);for(;!o.done&&n<sd;)n+=s,o=t.next(n);return n>=sd?1/0:n}function Qd(t){return typeof t=="function"}function _m(t,n){t.timeline=n,t.onfinish=null}const Gd=t=>Array.isArray(t)&&typeof t[0]=="number",pb={linearEasing:void 0};function mb(t,n){const s=Dd(t);return()=>{var o;return(o=pb[n])!==null&&o!==void 0?o:s()}}const hl=mb(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Yg=(t,n,s=10)=>{let o="";const u=Math.max(Math.round(n/s),2);for(let c=0;c<u;c++)o+=t(hi(0,u-1,c))+", ";return`linear(${o.substring(0,o.length-2)})`};function Zg(t){return!!(typeof t=="function"&&hl()||!t||typeof t=="string"&&(t in id||hl())||Gd(t)||Array.isArray(t)&&t.every(Zg))}const ao=([t,n,s,o])=>`cubic-bezier(${t}, ${n}, ${s}, ${o})`,id={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ao([0,.65,.55,1]),circOut:ao([.55,0,1,.45]),backIn:ao([.31,.01,.66,-.59]),backOut:ao([.33,1.53,.69,.99])};function Jg(t,n){if(t)return typeof t=="function"&&hl()?Yg(t,n):Gd(t)?ao(t):Array.isArray(t)?t.map(s=>Jg(s,n)||id.easeOut):id[t]}const vn={x:!1,y:!1};function ex(){return vn.x||vn.y}function gb(t,n,s){var o;if(t instanceof Element)return[t];if(typeof t=="string"){let u=document;const c=(o=void 0)!==null&&o!==void 0?o:u.querySelectorAll(t);return c?Array.from(c):[]}return Array.from(t)}function tx(t,n){const s=gb(t),o=new AbortController,u={passive:!0,...n,signal:o.signal};return[s,u,()=>o.abort()]}function Lm(t){return n=>{n.pointerType==="touch"||ex()||t(n)}}function xb(t,n,s={}){const[o,u,c]=tx(t,s),h=Lm(f=>{const{target:m}=f,x=n(f);if(typeof x!="function"||!m)return;const g=Lm(y=>{x(y),m.removeEventListener("pointerleave",g)});m.addEventListener("pointerleave",g,u)});return o.forEach(f=>{f.addEventListener("pointerenter",h,u)}),c}const nx=(t,n)=>n?t===n?!0:nx(t,n.parentElement):!1,qd=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,yb=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function vb(t){return yb.has(t.tagName)||t.tabIndex!==-1}const lo=new WeakSet;function Rm(t){return n=>{n.key==="Enter"&&t(n)}}function kc(t,n){t.dispatchEvent(new PointerEvent("pointer"+n,{isPrimary:!0,bubbles:!0}))}const wb=(t,n)=>{const s=t.currentTarget;if(!s)return;const o=Rm(()=>{if(lo.has(s))return;kc(s,"down");const u=Rm(()=>{kc(s,"up")}),c=()=>kc(s,"cancel");s.addEventListener("keyup",u,n),s.addEventListener("blur",c,n)});s.addEventListener("keydown",o,n),s.addEventListener("blur",()=>s.removeEventListener("keydown",o),n)};function Om(t){return qd(t)&&!ex()}function bb(t,n,s={}){const[o,u,c]=tx(t,s),h=f=>{const m=f.currentTarget;if(!Om(f)||lo.has(m))return;lo.add(m);const x=n(f),g=(j,C)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",w),!(!Om(j)||!lo.has(m))&&(lo.delete(m),typeof x=="function"&&x(j,{success:C}))},y=j=>{g(j,s.useGlobalTarget||nx(m,j.target))},w=j=>{g(j,!1)};window.addEventListener("pointerup",y,u),window.addEventListener("pointercancel",w,u)};return o.forEach(f=>{!vb(f)&&f.getAttribute("tabindex")===null&&(f.tabIndex=0),(s.useGlobalTarget?window:f).addEventListener("pointerdown",h,u),f.addEventListener("focus",x=>wb(x,u),u)}),c}function kb(t){return t==="x"||t==="y"?vn[t]?null:(vn[t]=!0,()=>{vn[t]=!1}):vn.x||vn.y?null:(vn.x=vn.y=!0,()=>{vn.x=vn.y=!1})}const rx=new Set(["width","height","top","left","right","bottom",...gi]);let rl;function jb(){rl=void 0}const Fn={now:()=>(rl===void 0&&Fn.set(vt.isProcessing||yw.useManualTiming?vt.timestamp:performance.now()),rl),set:t=>{rl=t,queueMicrotask(jb)}};function Xd(t,n){t.indexOf(n)===-1&&t.push(n)}function Yd(t,n){const s=t.indexOf(n);s>-1&&t.splice(s,1)}class Zd{constructor(){this.subscriptions=[]}add(n){return Xd(this.subscriptions,n),()=>Yd(this.subscriptions,n)}notify(n,s,o){const u=this.subscriptions.length;if(u)if(u===1)this.subscriptions[0](n,s,o);else for(let c=0;c<u;c++){const h=this.subscriptions[c];h&&h(n,s,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function sx(t,n){return n?t*(1e3/n):0}const Bm=30,Nb=t=>!isNaN(parseFloat(t));class Sb{constructor(n,s={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,u=!0)=>{const c=Fn.now();this.updatedAt!==c&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),u&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(n),this.owner=s.owner}setCurrent(n){this.current=n,this.updatedAt=Fn.now(),this.canTrackVelocity===null&&n!==void 0&&(this.canTrackVelocity=Nb(this.current))}setPrevFrameValue(n=this.current){this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt}onChange(n){return this.on("change",n)}on(n,s){this.events[n]||(this.events[n]=new Zd);const o=this.events[n].add(s);return n==="change"?()=>{o(),Ke.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const n in this.events)this.events[n].clear()}attach(n,s){this.passiveEffect=n,this.stopPassiveEffect=s}set(n,s=!0){!s||!this.passiveEffect?this.updateAndNotify(n,s):this.passiveEffect(n,this.updateAndNotify)}setWithVelocity(n,s,o){this.set(s),this.prev=void 0,this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt-o}jump(n,s=!0){this.updateAndNotify(n),this.prev=n,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const n=Fn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||n-this.updatedAt>Bm)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,Bm);return sx(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(n){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=n(s),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 ko(t,n){return new Sb(t,n)}function Cb(t,n,s){t.hasValue(n)?t.getValue(n).set(s):t.addValue(n,ko(s))}function Ab(t,n){const s=jl(t,n);let{transitionEnd:o={},transition:u={},...c}=s||{};c={...c,...o};for(const h in c){const f=Bw(c[h]);Cb(t,h,f)}}function Eb(t){return!!(Ct(t)&&t.add)}function od(t,n){const s=t.getValue("willChange");if(Eb(s))return s.add(n)}function ix(t){return t.props[_g]}const ox=(t,n,s)=>(((1-3*s+3*n)*t+(3*s-6*n))*t+3*n)*t,Tb=1e-7,Pb=12;function Mb(t,n,s,o,u){let c,h,f=0;do h=n+(s-n)/2,c=ox(h,o,u)-t,c>0?s=h:n=h;while(Math.abs(c)>Tb&&++f<Pb);return h}function Fo(t,n,s,o){if(t===n&&s===o)return Gt;const u=c=>Mb(c,0,1,t,s);return c=>c===0||c===1?c:ox(u(c),n,o)}const ax=t=>n=>n<=.5?t(2*n)/2:(2-t(2*(1-n)))/2,lx=t=>n=>1-t(1-n),ux=Fo(.33,1.53,.69,.99),Jd=lx(ux),cx=ax(Jd),dx=t=>(t*=2)<1?.5*Jd(t):.5*(2-Math.pow(2,-10*(t-1))),eh=t=>1-Math.sin(Math.acos(t)),hx=lx(eh),fx=ax(eh),px=t=>/^0[^.\s]+$/u.test(t);function Db(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||px(t):!0}const ho=t=>Math.round(t*1e5)/1e5,th=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Fb(t){return t==null}const Ib=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,nh=(t,n)=>s=>!!(typeof s=="string"&&Ib.test(s)&&s.startsWith(t)||n&&!Fb(s)&&Object.prototype.hasOwnProperty.call(s,n)),mx=(t,n,s)=>o=>{if(typeof o!="string")return o;const[u,c,h,f]=o.match(th);return{[t]:parseFloat(u),[n]:parseFloat(c),[s]:parseFloat(h),alpha:f!==void 0?parseFloat(f):1}},_b=t=>er(0,255,t),jc={...xi,transform:t=>Math.round(_b(t))},os={test:nh("rgb","red"),parse:mx("red","green","blue"),transform:({red:t,green:n,blue:s,alpha:o=1})=>"rgba("+jc.transform(t)+", "+jc.transform(n)+", "+jc.transform(s)+", "+ho(bo.transform(o))+")"};function Lb(t){let n="",s="",o="",u="";return t.length>5?(n=t.substring(1,3),s=t.substring(3,5),o=t.substring(5,7),u=t.substring(7,9)):(n=t.substring(1,2),s=t.substring(2,3),o=t.substring(3,4),u=t.substring(4,5),n+=n,s+=s,o+=o,u+=u),{red:parseInt(n,16),green:parseInt(s,16),blue:parseInt(o,16),alpha:u?parseInt(u,16)/255:1}}const ad={test:nh("#"),parse:Lb,transform:os.transform},qs={test:nh("hsl","hue"),parse:mx("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:s,alpha:o=1})=>"hsla("+Math.round(t)+", "+Dn.transform(ho(n))+", "+Dn.transform(ho(s))+", "+ho(bo.transform(o))+")"},St={test:t=>os.test(t)||ad.test(t)||qs.test(t),parse:t=>os.test(t)?os.parse(t):qs.test(t)?qs.parse(t):ad.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?os.transform(t):qs.transform(t)},Rb=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ob(t){var n,s;return isNaN(t)&&typeof t=="string"&&(((n=t.match(th))===null||n===void 0?void 0:n.length)||0)+(((s=t.match(Rb))===null||s===void 0?void 0:s.length)||0)>0}const gx="number",xx="color",Bb="var",Vb="var(",Vm="${}",$b=/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 jo(t){const n=t.toString(),s=[],o={color:[],number:[],var:[]},u=[];let c=0;const f=n.replace($b,m=>(St.test(m)?(o.color.push(c),u.push(xx),s.push(St.parse(m))):m.startsWith(Vb)?(o.var.push(c),u.push(Bb),s.push(m)):(o.number.push(c),u.push(gx),s.push(parseFloat(m))),++c,Vm)).split(Vm);return{values:s,split:f,indexes:o,types:u}}function yx(t){return jo(t).values}function vx(t){const{split:n,types:s}=jo(t),o=n.length;return u=>{let c="";for(let h=0;h<o;h++)if(c+=n[h],u[h]!==void 0){const f=s[h];f===gx?c+=ho(u[h]):f===xx?c+=St.transform(u[h]):c+=u[h]}return c}}const zb=t=>typeof t=="number"?0:t;function Ub(t){const n=yx(t);return vx(t)(n.map(zb))}const Lr={test:Ob,parse:yx,createTransformer:vx,getAnimatableNone:Ub},Wb=new Set(["brightness","contrast","saturate","opacity"]);function Hb(t){const[n,s]=t.slice(0,-1).split("(");if(n==="drop-shadow")return t;const[o]=s.match(th)||[];if(!o)return t;const u=s.replace(o,"");let c=Wb.has(n)?1:0;return o!==s&&(c*=100),n+"("+c+u+")"}const Kb=/\b([a-z-]*)\(.*?\)/gu,ld={...Lr,getAnimatableNone:t=>{const n=t.match(Kb);return n?n.map(Hb).join(" "):t}},Qb={...Vd,color:St,backgroundColor:St,outlineColor:St,fill:St,stroke:St,borderColor:St,borderTopColor:St,borderRightColor:St,borderBottomColor:St,borderLeftColor:St,filter:ld,WebkitFilter:ld},rh=t=>Qb[t];function wx(t,n){let s=rh(t);return s!==ld&&(s=Lr),s.getAnimatableNone?s.getAnimatableNone(n):void 0}const Gb=new Set(["auto","none","0"]);function qb(t,n,s){let o=0,u;for(;o<t.length&&!u;){const c=t[o];typeof c=="string"&&!Gb.has(c)&&jo(c).values.length&&(u=t[o]),o++}if(u&&s)for(const c of n)t[c]=wx(s,u)}const $m=t=>t===xi||t===Ne,zm=(t,n)=>parseFloat(t.split(", ")[n]),Um=(t,n)=>(s,{transform:o})=>{if(o==="none"||!o)return 0;const u=o.match(/^matrix3d\((.+)\)$/u);if(u)return zm(u[1],n);{const c=o.match(/^matrix\((.+)\)$/u);return c?zm(c[1],t):0}},Xb=new Set(["x","y","z"]),Yb=gi.filter(t=>!Xb.has(t));function Zb(t){const n=[];return Yb.forEach(s=>{const o=t.getValue(s);o!==void 0&&(n.push([s,o.get()]),o.set(s.startsWith("scale")?1:0))}),n}const pi={width:({x:t},{paddingLeft:n="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(n)-parseFloat(s),height:({y:t},{paddingTop:n="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(n)-parseFloat(s),top:(t,{top:n})=>parseFloat(n),left:(t,{left:n})=>parseFloat(n),bottom:({y:t},{top:n})=>parseFloat(n)+(t.max-t.min),right:({x:t},{left:n})=>parseFloat(n)+(t.max-t.min),x:Um(4,13),y:Um(5,14)};pi.translateX=pi.x;pi.translateY=pi.y;const gs=new Set;let ud=!1,cd=!1;function bx(){if(cd){const t=Array.from(gs).filter(o=>o.needsMeasurement),n=new Set(t.map(o=>o.element)),s=new Map;n.forEach(o=>{const u=Zb(o);u.length&&(s.set(o,u),o.render())}),t.forEach(o=>o.measureInitialState()),n.forEach(o=>{o.render();const u=s.get(o);u&&u.forEach(([c,h])=>{var f;(f=o.getValue(c))===null||f===void 0||f.set(h)})}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}cd=!1,ud=!1,gs.forEach(t=>t.complete()),gs.clear()}function kx(){gs.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(cd=!0)})}function Jb(){kx(),bx()}class sh{constructor(n,s,o,u,c,h=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...n],this.onComplete=s,this.name=o,this.motionValue=u,this.element=c,this.isAsync=h}scheduleResolve(){this.isScheduled=!0,this.isAsync?(gs.add(this),ud||(ud=!0,Ke.read(kx),Ke.resolveKeyframes(bx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:n,name:s,element:o,motionValue:u}=this;for(let c=0;c<n.length;c++)if(n[c]===null)if(c===0){const h=u==null?void 0:u.get(),f=n[n.length-1];if(h!==void 0)n[0]=h;else if(o&&s){const m=o.readValue(s,f);m!=null&&(n[0]=m)}n[0]===void 0&&(n[0]=f),u&&h===void 0&&u.set(n[0])}else n[c]=n[c-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),gs.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,gs.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const jx=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),e2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function t2(t){const n=e2.exec(t);if(!n)return[,];const[,s,o,u]=n;return[`--${s??o}`,u]}function Nx(t,n,s=1){const[o,u]=t2(t);if(!o)return;const c=window.getComputedStyle(n).getPropertyValue(o);if(c){const h=c.trim();return jx(h)?parseFloat(h):h}return Bd(u)?Nx(u,n,s+1):u}const Sx=t=>n=>n.test(t),n2={test:t=>t==="auto",parse:t=>t},Cx=[xi,Ne,Dn,jr,Hw,Ww,n2],Wm=t=>Cx.find(Sx(t));class Ax extends sh{constructor(n,s,o,u,c){super(n,s,o,u,c,!0)}readKeyframes(){const{unresolvedKeyframes:n,element:s,name:o}=this;if(!s||!s.current)return;super.readKeyframes();for(let m=0;m<n.length;m++){let x=n[m];if(typeof x=="string"&&(x=x.trim(),Bd(x))){const g=Nx(x,s.current);g!==void 0&&(n[m]=g),m===n.length-1&&(this.finalKeyframe=x)}}if(this.resolveNoneKeyframes(),!rx.has(o)||n.length!==2)return;const[u,c]=n,h=Wm(u),f=Wm(c);if(h!==f)if($m(h)&&$m(f))for(let m=0;m<n.length;m++){const x=n[m];typeof x=="string"&&(n[m]=parseFloat(x))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:n,name:s}=this,o=[];for(let u=0;u<n.length;u++)Db(n[u])&&o.push(u);o.length&&qb(n,o,s)}measureInitialState(){const{element:n,unresolvedKeyframes:s,name:o}=this;if(!n||!n.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=pi[o](n.measureViewportBox(),window.getComputedStyle(n.current)),s[0]=this.measuredOrigin;const u=s[s.length-1];u!==void 0&&n.getValue(o,u).jump(u,!1)}measureEndState(){var n;const{element:s,name:o,unresolvedKeyframes:u}=this;if(!s||!s.current)return;const c=s.getValue(o);c&&c.jump(this.measuredOrigin,!1);const h=u.length-1,f=u[h];u[h]=pi[o](s.measureViewportBox(),window.getComputedStyle(s.current)),f!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=f),!((n=this.removedTransforms)===null||n===void 0)&&n.length&&this.removedTransforms.forEach(([m,x])=>{s.getValue(m).set(x)}),this.resolveNoneKeyframes()}}const Hm=(t,n)=>n==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Lr.test(t)||t==="0")&&!t.startsWith("url("));function r2(t){const n=t[0];if(t.length===1)return!0;for(let s=0;s<t.length;s++)if(t[s]!==n)return!0}function s2(t,n,s,o){const u=t[0];if(u===null)return!1;if(n==="display"||n==="visibility")return!0;const c=t[t.length-1],h=Hm(u,n),f=Hm(c,n);return!h||!f?!1:r2(t)||(s==="spring"||Qd(s))&&o}const i2=t=>t!==null;function Nl(t,{repeat:n,repeatType:s="loop"},o){const u=t.filter(i2),c=n&&s!=="loop"&&n%2===1?0:u.length-1;return!c||o===void 0?u[c]:o}const o2=40;class Ex{constructor({autoplay:n=!0,delay:s=0,type:o="keyframes",repeat:u=0,repeatDelay:c=0,repeatType:h="loop",...f}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Fn.now(),this.options={autoplay:n,delay:s,type:o,repeat:u,repeatDelay:c,repeatType:h,...f},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>o2?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Jb(),this._resolved}onKeyframesResolved(n,s){this.resolvedAt=Fn.now(),this.hasAttemptedResolve=!0;const{name:o,type:u,velocity:c,delay:h,onComplete:f,onUpdate:m,isGenerator:x}=this.options;if(!x&&!s2(n,o,u,c))if(h)this.options.duration=0;else{m&&m(Nl(n,this.options,s)),f&&f(),this.resolveFinishedPromise();return}const g=this.initPlayback(n,s);g!==!1&&(this._resolved={keyframes:n,finalKeyframe:s,...g},this.onPostResolved())}onPostResolved(){}then(n,s){return this.currentFinishedPromise.then(n,s)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(n=>{this.resolveFinishedPromise=n})}}const Ye=(t,n,s)=>t+(n-t)*s;function Nc(t,n,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+(n-t)*6*s:s<1/2?n:s<2/3?t+(n-t)*(2/3-s)*6:t}function a2({hue:t,saturation:n,lightness:s,alpha:o}){t/=360,n/=100,s/=100;let u=0,c=0,h=0;if(!n)u=c=h=s;else{const f=s<.5?s*(1+n):s+n-s*n,m=2*s-f;u=Nc(m,f,t+1/3),c=Nc(m,f,t),h=Nc(m,f,t-1/3)}return{red:Math.round(u*255),green:Math.round(c*255),blue:Math.round(h*255),alpha:o}}function fl(t,n){return s=>s>0?n:t}const Sc=(t,n,s)=>{const o=t*t,u=s*(n*n-o)+o;return u<0?0:Math.sqrt(u)},l2=[ad,os,qs],u2=t=>l2.find(n=>n.test(t));function Km(t){const n=u2(t);if(!n)return!1;let s=n.parse(t);return n===qs&&(s=a2(s)),s}const Qm=(t,n)=>{const s=Km(t),o=Km(n);if(!s||!o)return fl(t,n);const u={...s};return c=>(u.red=Sc(s.red,o.red,c),u.green=Sc(s.green,o.green,c),u.blue=Sc(s.blue,o.blue,c),u.alpha=Ye(s.alpha,o.alpha,c),os.transform(u))},c2=(t,n)=>s=>n(t(s)),Io=(...t)=>t.reduce(c2),dd=new Set(["none","hidden"]);function d2(t,n){return dd.has(t)?s=>s<=0?t:n:s=>s>=1?n:t}function h2(t,n){return s=>Ye(t,n,s)}function ih(t){return typeof t=="number"?h2:typeof t=="string"?Bd(t)?fl:St.test(t)?Qm:m2:Array.isArray(t)?Tx:typeof t=="object"?St.test(t)?Qm:f2:fl}function Tx(t,n){const s=[...t],o=s.length,u=t.map((c,h)=>ih(c)(c,n[h]));return c=>{for(let h=0;h<o;h++)s[h]=u[h](c);return s}}function f2(t,n){const s={...t,...n},o={};for(const u in s)t[u]!==void 0&&n[u]!==void 0&&(o[u]=ih(t[u])(t[u],n[u]));return u=>{for(const c in o)s[c]=o[c](u);return s}}function p2(t,n){var s;const o=[],u={color:0,var:0,number:0};for(let c=0;c<n.values.length;c++){const h=n.types[c],f=t.indexes[h][u[h]],m=(s=t.values[f])!==null&&s!==void 0?s:0;o[c]=m,u[h]++}return o}const m2=(t,n)=>{const s=Lr.createTransformer(n),o=jo(t),u=jo(n);return o.indexes.var.length===u.indexes.var.length&&o.indexes.color.length===u.indexes.color.length&&o.indexes.number.length>=u.indexes.number.length?dd.has(t)&&!u.values.length||dd.has(n)&&!o.values.length?d2(t,n):Io(Tx(p2(o,u),u.values),s):fl(t,n)};function Px(t,n,s){return typeof t=="number"&&typeof n=="number"&&typeof s=="number"?Ye(t,n,s):ih(t)(t,n)}const g2=5;function Mx(t,n,s){const o=Math.max(n-g2,0);return sx(s-t(o),n-o)}const et={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},Cc=.001;function x2({duration:t=et.duration,bounce:n=et.bounce,velocity:s=et.velocity,mass:o=et.mass}){let u,c,h=1-n;h=er(et.minDamping,et.maxDamping,h),t=er(et.minDuration,et.maxDuration,Zn(t)),h<1?(u=x=>{const g=x*h,y=g*t,w=g-s,j=hd(x,h),C=Math.exp(-y);return Cc-w/j*C},c=x=>{const y=x*h*t,w=y*s+s,j=Math.pow(h,2)*Math.pow(x,2)*t,C=Math.exp(-y),A=hd(Math.pow(x,2),h);return(-u(x)+Cc>0?-1:1)*((w-j)*C)/A}):(u=x=>{const g=Math.exp(-x*t),y=(x-s)*t+1;return-Cc+g*y},c=x=>{const g=Math.exp(-x*t),y=(s-x)*(t*t);return g*y});const f=5/t,m=v2(u,c,f);if(t=Yn(t),isNaN(m))return{stiffness:et.stiffness,damping:et.damping,duration:t};{const x=Math.pow(m,2)*o;return{stiffness:x,damping:h*2*Math.sqrt(o*x),duration:t}}}const y2=12;function v2(t,n,s){let o=s;for(let u=1;u<y2;u++)o=o-t(o)/n(o);return o}function hd(t,n){return t*Math.sqrt(1-n*n)}const w2=["duration","bounce"],b2=["stiffness","damping","mass"];function Gm(t,n){return n.some(s=>t[s]!==void 0)}function k2(t){let n={velocity:et.velocity,stiffness:et.stiffness,damping:et.damping,mass:et.mass,isResolvedFromDuration:!1,...t};if(!Gm(t,b2)&&Gm(t,w2))if(t.visualDuration){const s=t.visualDuration,o=2*Math.PI/(s*1.2),u=o*o,c=2*er(.05,1,1-(t.bounce||0))*Math.sqrt(u);n={...n,mass:et.mass,stiffness:u,damping:c}}else{const s=x2(t);n={...n,...s,mass:et.mass},n.isResolvedFromDuration=!0}return n}function Dx(t=et.visualDuration,n=et.bounce){const s=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:n}:t;let{restSpeed:o,restDelta:u}=s;const c=s.keyframes[0],h=s.keyframes[s.keyframes.length-1],f={done:!1,value:c},{stiffness:m,damping:x,mass:g,duration:y,velocity:w,isResolvedFromDuration:j}=k2({...s,velocity:-Zn(s.velocity||0)}),C=w||0,A=x/(2*Math.sqrt(m*g)),N=h-c,_=Zn(Math.sqrt(m/g)),B=Math.abs(N)<5;o||(o=B?et.restSpeed.granular:et.restSpeed.default),u||(u=B?et.restDelta.granular:et.restDelta.default);let W;if(A<1){const b=hd(_,A);W=F=>{const U=Math.exp(-A*_*F);return h-U*((C+A*_*N)/b*Math.sin(b*F)+N*Math.cos(b*F))}}else if(A===1)W=b=>h-Math.exp(-_*b)*(N+(C+_*N)*b);else{const b=_*Math.sqrt(A*A-1);W=F=>{const U=Math.exp(-A*_*F),D=Math.min(b*F,300);return h-U*((C+A*_*N)*Math.sinh(D)+b*N*Math.cosh(D))/b}}const $={calculatedDuration:j&&y||null,next:b=>{const F=W(b);if(j)f.done=b>=y;else{let U=0;A<1&&(U=b===0?Yn(C):Mx(W,b,F));const D=Math.abs(U)<=o,O=Math.abs(h-F)<=u;f.done=D&&O}return f.value=f.done?h:F,f},toString:()=>{const b=Math.min(Xg($),sd),F=Yg(U=>$.next(b*U).value,b,30);return b+"ms "+F}};return $}function qm({keyframes:t,velocity:n=0,power:s=.8,timeConstant:o=325,bounceDamping:u=10,bounceStiffness:c=500,modifyTarget:h,min:f,max:m,restDelta:x=.5,restSpeed:g}){const y=t[0],w={done:!1,value:y},j=D=>f!==void 0&&D<f||m!==void 0&&D>m,C=D=>f===void 0?m:m===void 0||Math.abs(f-D)<Math.abs(m-D)?f:m;let A=s*n;const N=y+A,_=h===void 0?N:h(N);_!==N&&(A=_-y);const B=D=>-A*Math.exp(-D/o),W=D=>_+B(D),$=D=>{const O=B(D),G=W(D);w.done=Math.abs(O)<=x,w.value=w.done?_:G};let b,F;const U=D=>{j(w.value)&&(b=D,F=Dx({keyframes:[w.value,C(w.value)],velocity:Mx(W,D,w.value),damping:u,stiffness:c,restDelta:x,restSpeed:g}))};return U(0),{calculatedDuration:null,next:D=>{let O=!1;return!F&&b===void 0&&(O=!0,$(D),U(D)),b!==void 0&&D>=b?F.next(D-b):(!O&&$(D),w)}}}const j2=Fo(.42,0,1,1),N2=Fo(0,0,.58,1),Fx=Fo(.42,0,.58,1),S2=t=>Array.isArray(t)&&typeof t[0]!="number",C2={linear:Gt,easeIn:j2,easeInOut:Fx,easeOut:N2,circIn:eh,circInOut:fx,circOut:hx,backIn:Jd,backInOut:cx,backOut:ux,anticipate:dx},Xm=t=>{if(Gd(t)){Pg(t.length===4);const[n,s,o,u]=t;return Fo(n,s,o,u)}else if(typeof t=="string")return C2[t];return t};function A2(t,n,s){const o=[],u=s||Px,c=t.length-1;for(let h=0;h<c;h++){let f=u(t[h],t[h+1]);if(n){const m=Array.isArray(n)?n[h]||Gt:n;f=Io(m,f)}o.push(f)}return o}function E2(t,n,{clamp:s=!0,ease:o,mixer:u}={}){const c=t.length;if(Pg(c===n.length),c===1)return()=>n[0];if(c===2&&n[0]===n[1])return()=>n[1];const h=t[0]===t[1];t[0]>t[c-1]&&(t=[...t].reverse(),n=[...n].reverse());const f=A2(n,o,u),m=f.length,x=g=>{if(h&&g<t[0])return n[0];let y=0;if(m>1)for(;y<t.length-2&&!(g<t[y+1]);y++);const w=hi(t[y],t[y+1],g);return f[y](w)};return s?g=>x(er(t[0],t[c-1],g)):x}function T2(t,n){const s=t[t.length-1];for(let o=1;o<=n;o++){const u=hi(0,n,o);t.push(Ye(s,1,u))}}function P2(t){const n=[0];return T2(n,t.length-1),n}function M2(t,n){return t.map(s=>s*n)}function D2(t,n){return t.map(()=>n||Fx).splice(0,t.length-1)}function pl({duration:t=300,keyframes:n,times:s,ease:o="easeInOut"}){const u=S2(o)?o.map(Xm):Xm(o),c={done:!1,value:n[0]},h=M2(s&&s.length===n.length?s:P2(n),t),f=E2(h,n,{ease:Array.isArray(u)?u:D2(n,u)});return{calculatedDuration:t,next:m=>(c.value=f(m),c.done=m>=t,c)}}const F2=t=>{const n=({timestamp:s})=>t(s);return{start:()=>Ke.update(n,!0),stop:()=>_r(n),now:()=>vt.isProcessing?vt.timestamp:Fn.now()}},I2={decay:qm,inertia:qm,tween:pl,keyframes:pl,spring:Dx},_2=t=>t/100;class oh extends Ex{constructor(n){super(n),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:m}=this.options;m&&m()};const{name:s,motionValue:o,element:u,keyframes:c}=this.options,h=(u==null?void 0:u.KeyframeResolver)||sh,f=(m,x)=>this.onKeyframesResolved(m,x);this.resolver=new h(c,f,s,o,u),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(n){const{type:s="keyframes",repeat:o=0,repeatDelay:u=0,repeatType:c,velocity:h=0}=this.options,f=Qd(s)?s:I2[s]||pl;let m,x;f!==pl&&typeof n[0]!="number"&&(m=Io(_2,Px(n[0],n[1])),n=[0,100]);const g=f({...this.options,keyframes:n});c==="mirror"&&(x=f({...this.options,keyframes:[...n].reverse(),velocity:-h})),g.calculatedDuration===null&&(g.calculatedDuration=Xg(g));const{calculatedDuration:y}=g,w=y+u,j=w*(o+1)-u;return{generator:g,mirroredGenerator:x,mapPercentToKeyframes:m,calculatedDuration:y,resolvedDuration:w,totalDuration:j}}onPostResolved(){const{autoplay:n=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!n?this.pause():this.state=this.pendingPlayState}tick(n,s=!1){const{resolved:o}=this;if(!o){const{keyframes:D}=this.options;return{done:!0,value:D[D.length-1]}}const{finalKeyframe:u,generator:c,mirroredGenerator:h,mapPercentToKeyframes:f,keyframes:m,calculatedDuration:x,totalDuration:g,resolvedDuration:y}=o;if(this.startTime===null)return c.next(0);const{delay:w,repeat:j,repeatType:C,repeatDelay:A,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-g/this.speed,this.startTime)),s?this.currentTime=n:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(n-this.startTime)*this.speed;const _=this.currentTime-w*(this.speed>=0?1:-1),B=this.speed>=0?_<0:_>g;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=g);let W=this.currentTime,$=c;if(j){const D=Math.min(this.currentTime,g)/y;let O=Math.floor(D),G=D%1;!G&&D>=1&&(G=1),G===1&&O--,O=Math.min(O,j+1),!!(O%2)&&(C==="reverse"?(G=1-G,A&&(G-=A/y)):C==="mirror"&&($=h)),W=er(0,1,G)*y}const b=B?{done:!1,value:m[0]}:$.next(W);f&&(b.value=f(b.value));let{done:F}=b;!B&&x!==null&&(F=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const U=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&F);return U&&u!==void 0&&(b.value=Nl(m,this.options,u)),N&&N(b.value),U&&this.finish(),b}get duration(){const{resolved:n}=this;return n?Zn(n.calculatedDuration):0}get time(){return Zn(this.currentTime)}set time(n){n=Yn(n),this.currentTime=n,this.holdTime!==null||this.speed===0?this.holdTime=n:this.driver&&(this.startTime=this.driver.now()-n/this.speed)}get speed(){return this.playbackSpeed}set speed(n){const s=this.playbackSpeed!==n;this.playbackSpeed=n,s&&(this.time=Zn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:n=F2,onPlay:s,startTime:o}=this.options;this.driver||(this.driver=n(c=>this.tick(c))),s&&s();const u=this.driver.now();this.holdTime!==null?this.startTime=u-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=u):this.startTime=o??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var n;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(n=this.currentTime)!==null&&n!==void 0?n:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:n}=this.options;n&&n()}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(n){return this.startTime=0,this.tick(n,!0)}}const L2=new Set(["opacity","clipPath","filter","transform"]);function R2(t,n,s,{delay:o=0,duration:u=300,repeat:c=0,repeatType:h="loop",ease:f="easeInOut",times:m}={}){const x={[n]:s};m&&(x.offset=m);const g=Jg(f,u);return Array.isArray(g)&&(x.easing=g),t.animate(x,{delay:o,duration:u,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:c+1,direction:h==="reverse"?"alternate":"normal"})}const O2=Dd(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ml=10,B2=2e4;function V2(t){return Qd(t.type)||t.type==="spring"||!Zg(t.ease)}function $2(t,n){const s=new oh({...n,keyframes:t,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:t[0]};const u=[];let c=0;for(;!o.done&&c<B2;)o=s.sample(c),u.push(o.value),c+=ml;return{times:void 0,keyframes:u,duration:c-ml,ease:"linear"}}const Ix={anticipate:dx,backInOut:cx,circInOut:fx};function z2(t){return t in Ix}class Ym extends Ex{constructor(n){super(n);const{name:s,motionValue:o,element:u,keyframes:c}=this.options;this.resolver=new Ax(c,(h,f)=>this.onKeyframesResolved(h,f),s,o,u),this.resolver.scheduleResolve()}initPlayback(n,s){let{duration:o=300,times:u,ease:c,type:h,motionValue:f,name:m,startTime:x}=this.options;if(!f.owner||!f.owner.current)return!1;if(typeof c=="string"&&hl()&&z2(c)&&(c=Ix[c]),V2(this.options)){const{onComplete:y,onUpdate:w,motionValue:j,element:C,...A}=this.options,N=$2(n,A);n=N.keyframes,n.length===1&&(n[1]=n[0]),o=N.duration,u=N.times,c=N.ease,h="keyframes"}const g=R2(f.owner.current,m,n,{...this.options,duration:o,times:u,ease:c});return g.startTime=x??this.calcStartTime(),this.pendingTimeline?(_m(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:y}=this.options;f.set(Nl(n,this.options,s)),y&&y(),this.cancel(),this.resolveFinishedPromise()},{animation:g,duration:o,times:u,type:h,ease:c,keyframes:n}}get duration(){const{resolved:n}=this;if(!n)return 0;const{duration:s}=n;return Zn(s)}get time(){const{resolved:n}=this;if(!n)return 0;const{animation:s}=n;return Zn(s.currentTime||0)}set time(n){const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.currentTime=Yn(n)}get speed(){const{resolved:n}=this;if(!n)return 1;const{animation:s}=n;return s.playbackRate}set speed(n){const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.playbackRate=n}get state(){const{resolved:n}=this;if(!n)return"idle";const{animation:s}=n;return s.playState}get startTime(){const{resolved:n}=this;if(!n)return null;const{animation:s}=n;return s.startTime}attachTimeline(n){if(!this._resolved)this.pendingTimeline=n;else{const{resolved:s}=this;if(!s)return Gt;const{animation:o}=s;_m(o,n)}return Gt}play(){if(this.isStopped)return;const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playState==="finished"&&this.updateFinishedPromise(),s.play()}pause(){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:n}=this;if(!n)return;const{animation:s,keyframes:o,duration:u,type:c,ease:h,times:f}=n;if(s.playState==="idle"||s.playState==="finished")return;if(this.time){const{motionValue:x,onUpdate:g,onComplete:y,element:w,...j}=this.options,C=new oh({...j,keyframes:o,duration:u,type:c,ease:h,times:f,isGenerator:!0}),A=Yn(this.time);x.setWithVelocity(C.sample(A-ml).value,C.sample(A).value,ml)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:n}=this;n&&n.animation.finish()}cancel(){const{resolved:n}=this;n&&n.animation.cancel()}static supports(n){const{motionValue:s,name:o,repeatDelay:u,repeatType:c,damping:h,type:f}=n;if(!s||!s.owner||!(s.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:x}=s.owner.getProps();return O2()&&o&&L2.has(o)&&!m&&!x&&!u&&c!=="mirror"&&h!==0&&f!=="inertia"}}const U2={type:"spring",stiffness:500,damping:25,restSpeed:10},W2=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),H2={type:"keyframes",duration:.8},K2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Q2=(t,{keyframes:n})=>n.length>2?H2:vs.has(t)?t.startsWith("scale")?W2(n[1]):U2:K2;function G2({when:t,delay:n,delayChildren:s,staggerChildren:o,staggerDirection:u,repeat:c,repeatType:h,repeatDelay:f,from:m,elapsed:x,...g}){return!!Object.keys(g).length}const ah=(t,n,s,o={},u,c)=>h=>{const f=Kd(o,t)||{},m=f.delay||o.delay||0;let{elapsed:x=0}=o;x=x-Yn(m);let g={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:n.getVelocity(),...f,delay:-x,onUpdate:w=>{n.set(w),f.onUpdate&&f.onUpdate(w)},onComplete:()=>{h(),f.onComplete&&f.onComplete()},name:t,motionValue:n,element:c?void 0:u};G2(f)||(g={...g,...Q2(t,g)}),g.duration&&(g.duration=Yn(g.duration)),g.repeatDelay&&(g.repeatDelay=Yn(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let y=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(g.duration=0,g.delay===0&&(y=!0)),y&&!c&&n.get()!==void 0){const w=Nl(g.keyframes,f);if(w!==void 0)return Ke.update(()=>{g.onUpdate(w),g.onComplete()}),new fb([])}return!c&&Ym.supports(g)?new Ym(g):new oh(g)};function q2({protectedKeys:t,needsAnimating:n},s){const o=t.hasOwnProperty(s)&&n[s]!==!0;return n[s]=!1,o}function _x(t,n,{delay:s=0,transitionOverride:o,type:u}={}){var c;let{transition:h=t.getDefaultTransition(),transitionEnd:f,...m}=n;o&&(h=o);const x=[],g=u&&t.animationState&&t.animationState.getState()[u];for(const y in m){const w=t.getValue(y,(c=t.latestValues[y])!==null&&c!==void 0?c:null),j=m[y];if(j===void 0||g&&q2(g,y))continue;const C={delay:s,...Kd(h||{},y)};let A=!1;if(window.MotionHandoffAnimation){const _=ix(t);if(_){const B=window.MotionHandoffAnimation(_,y,Ke);B!==null&&(C.startTime=B,A=!0)}}od(t,y),w.start(ah(y,w,j,t.shouldReduceMotion&&rx.has(y)?{type:!1}:C,t,A));const N=w.animation;N&&x.push(N)}return f&&Promise.all(x).then(()=>{Ke.update(()=>{f&&Ab(t,f)})}),x}function fd(t,n,s={}){var o;const u=jl(t,n,s.type==="exit"?(o=t.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:c=t.getDefaultTransition()||{}}=u||{};s.transitionOverride&&(c=s.transitionOverride);const h=u?()=>Promise.all(_x(t,u,s)):()=>Promise.resolve(),f=t.variantChildren&&t.variantChildren.size?(x=0)=>{const{delayChildren:g=0,staggerChildren:y,staggerDirection:w}=c;return X2(t,n,g+x,y,w,s)}:()=>Promise.resolve(),{when:m}=c;if(m){const[x,g]=m==="beforeChildren"?[h,f]:[f,h];return x().then(()=>g())}else return Promise.all([h(),f(s.delay)])}function X2(t,n,s=0,o=0,u=1,c){const h=[],f=(t.variantChildren.size-1)*o,m=u===1?(x=0)=>x*o:(x=0)=>f-x*o;return Array.from(t.variantChildren).sort(Y2).forEach((x,g)=>{x.notify("AnimationStart",n),h.push(fd(x,n,{...c,delay:s+m(g)}).then(()=>x.notify("AnimationComplete",n)))}),Promise.all(h)}function Y2(t,n){return t.sortNodePosition(n)}function Z2(t,n,s={}){t.notify("AnimationStart",n);let o;if(Array.isArray(n)){const u=n.map(c=>fd(t,c,s));o=Promise.all(u)}else if(typeof n=="string")o=fd(t,n,s);else{const u=typeof n=="function"?jl(t,n,s.custom):n;o=Promise.all(_x(t,u,s))}return o.then(()=>{t.notify("AnimationComplete",n)})}const J2=Id.length;function Lx(t){if(!t)return;if(!t.isControllingVariants){const s=t.parent?Lx(t.parent)||{}:{};return t.props.initial!==void 0&&(s.initial=t.props.initial),s}const n={};for(let s=0;s<J2;s++){const o=Id[s],u=t.props[o];(wo(u)||u===!1)&&(n[o]=u)}return n}const ek=[...Fd].reverse(),tk=Fd.length;function nk(t){return n=>Promise.all(n.map(({animation:s,options:o})=>Z2(t,s,o)))}function rk(t){let n=nk(t),s=Zm(),o=!0;const u=m=>(x,g)=>{var y;const w=jl(t,g,m==="exit"?(y=t.presenceContext)===null||y===void 0?void 0:y.custom:void 0);if(w){const{transition:j,transitionEnd:C,...A}=w;x={...x,...A,...C}}return x};function c(m){n=m(t)}function h(m){const{props:x}=t,g=Lx(t.parent)||{},y=[],w=new Set;let j={},C=1/0;for(let N=0;N<tk;N++){const _=ek[N],B=s[_],W=x[_]!==void 0?x[_]:g[_],$=wo(W),b=_===m?B.isActive:null;b===!1&&(C=N);let F=W===g[_]&&W!==x[_]&&$;if(F&&o&&t.manuallyAnimateOnMount&&(F=!1),B.protectedKeys={...j},!B.isActive&&b===null||!W&&!B.prevProp||bl(W)||typeof W=="boolean")continue;const U=sk(B.prevProp,W);let D=U||_===m&&B.isActive&&!F&&$||N>C&&$,O=!1;const G=Array.isArray(W)?W:[W];let oe=G.reduce(u(_),{});b===!1&&(oe={});const{prevResolvedValues:K={}}=B,I={...K,...oe},J=q=>{D=!0,w.has(q)&&(O=!0,w.delete(q)),B.needsAnimating[q]=!0;const R=t.getValue(q);R&&(R.liveStyle=!1)};for(const q in I){const R=oe[q],X=K[q];if(j.hasOwnProperty(q))continue;let Y=!1;rd(R)&&rd(X)?Y=!qg(R,X):Y=R!==X,Y?R!=null?J(q):w.add(q):R!==void 0&&w.has(q)?J(q):B.protectedKeys[q]=!0}B.prevProp=W,B.prevResolvedValues=oe,B.isActive&&(j={...j,...oe}),o&&t.blockInitialAnimation&&(D=!1),D&&(!(F&&U)||O)&&y.push(...G.map(q=>({animation:q,options:{type:_}})))}if(w.size){const N={};w.forEach(_=>{const B=t.getBaseTarget(_),W=t.getValue(_);W&&(W.liveStyle=!0),N[_]=B??null}),y.push({animation:N})}let A=!!y.length;return o&&(x.initial===!1||x.initial===x.animate)&&!t.manuallyAnimateOnMount&&(A=!1),o=!1,A?n(y):Promise.resolve()}function f(m,x){var g;if(s[m].isActive===x)return Promise.resolve();(g=t.variantChildren)===null||g===void 0||g.forEach(w=>{var j;return(j=w.animationState)===null||j===void 0?void 0:j.setActive(m,x)}),s[m].isActive=x;const y=h(m);for(const w in s)s[w].protectedKeys={};return y}return{animateChanges:h,setActive:f,setAnimateFunction:c,getState:()=>s,reset:()=>{s=Zm(),o=!0}}}function sk(t,n){return typeof n=="string"?n!==t:Array.isArray(n)?!qg(n,t):!1}function ts(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Zm(){return{animate:ts(!0),whileInView:ts(),whileHover:ts(),whileTap:ts(),whileDrag:ts(),whileFocus:ts(),exit:ts()}}class Rr{constructor(n){this.isMounted=!1,this.node=n}update(){}}class ik extends Rr{constructor(n){super(n),n.animationState||(n.animationState=rk(n))}updateAnimationControlsSubscription(){const{animate:n}=this.node.getProps();bl(n)&&(this.unmountControls=n.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:n}=this.node.getProps(),{animate:s}=this.node.prevProps||{};n!==s&&this.updateAnimationControlsSubscription()}unmount(){var n;this.node.animationState.reset(),(n=this.unmountControls)===null||n===void 0||n.call(this)}}let ok=0;class ak extends Rr{constructor(){super(...arguments),this.id=ok++}update(){if(!this.node.presenceContext)return;const{isPresent:n,onExitComplete:s}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||n===o)return;const u=this.node.animationState.setActive("exit",!n);s&&!n&&u.then(()=>s(this.id))}mount(){const{register:n}=this.node.presenceContext||{};n&&(this.unmount=n(this.id))}unmount(){}}const lk={animation:{Feature:ik},exit:{Feature:ak}};function No(t,n,s,o={passive:!0}){return t.addEventListener(n,s,o),()=>t.removeEventListener(n,s)}function _o(t){return{point:{x:t.pageX,y:t.pageY}}}const uk=t=>n=>qd(n)&&t(n,_o(n));function fo(t,n,s,o){return No(t,n,uk(s),o)}const Jm=(t,n)=>Math.abs(t-n);function ck(t,n){const s=Jm(t.x,n.x),o=Jm(t.y,n.y);return Math.sqrt(s**2+o**2)}class Rx{constructor(n,s,{transformPagePoint:o,contextWindow:u,dragSnapToOrigin:c=!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 y=Ec(this.lastMoveEventInfo,this.history),w=this.startEvent!==null,j=ck(y.offset,{x:0,y:0})>=3;if(!w&&!j)return;const{point:C}=y,{timestamp:A}=vt;this.history.push({...C,timestamp:A});const{onStart:N,onMove:_}=this.handlers;w||(N&&N(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),_&&_(this.lastMoveEvent,y)},this.handlePointerMove=(y,w)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=Ac(w,this.transformPagePoint),Ke.update(this.updatePoint,!0)},this.handlePointerUp=(y,w)=>{this.end();const{onEnd:j,onSessionEnd:C,resumeAnimation:A}=this.handlers;if(this.dragSnapToOrigin&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=Ec(y.type==="pointercancel"?this.lastMoveEventInfo:Ac(w,this.transformPagePoint),this.history);this.startEvent&&j&&j(y,N),C&&C(y,N)},!qd(n))return;this.dragSnapToOrigin=c,this.handlers=s,this.transformPagePoint=o,this.contextWindow=u||window;const h=_o(n),f=Ac(h,this.transformPagePoint),{point:m}=f,{timestamp:x}=vt;this.history=[{...m,timestamp:x}];const{onSessionStart:g}=s;g&&g(n,Ec(f,this.history)),this.removeListeners=Io(fo(this.contextWindow,"pointermove",this.handlePointerMove),fo(this.contextWindow,"pointerup",this.handlePointerUp),fo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(n){this.handlers=n}end(){this.removeListeners&&this.removeListeners(),_r(this.updatePoint)}}function Ac(t,n){return n?{point:n(t.point)}:t}function e0(t,n){return{x:t.x-n.x,y:t.y-n.y}}function Ec({point:t},n){return{point:t,delta:e0(t,Ox(n)),offset:e0(t,dk(n)),velocity:hk(n,.1)}}function dk(t){return t[0]}function Ox(t){return t[t.length-1]}function hk(t,n){if(t.length<2)return{x:0,y:0};let s=t.length-1,o=null;const u=Ox(t);for(;s>=0&&(o=t[s],!(u.timestamp-o.timestamp>Yn(n)));)s--;if(!o)return{x:0,y:0};const c=Zn(u.timestamp-o.timestamp);if(c===0)return{x:0,y:0};const h={x:(u.x-o.x)/c,y:(u.y-o.y)/c};return h.x===1/0&&(h.x=0),h.y===1/0&&(h.y=0),h}const Bx=1e-4,fk=1-Bx,pk=1+Bx,Vx=.01,mk=0-Vx,gk=0+Vx;function qt(t){return t.max-t.min}function xk(t,n,s){return Math.abs(t-n)<=s}function t0(t,n,s,o=.5){t.origin=o,t.originPoint=Ye(n.min,n.max,t.origin),t.scale=qt(s)/qt(n),t.translate=Ye(s.min,s.max,t.origin)-t.originPoint,(t.scale>=fk&&t.scale<=pk||isNaN(t.scale))&&(t.scale=1),(t.translate>=mk&&t.translate<=gk||isNaN(t.translate))&&(t.translate=0)}function po(t,n,s,o){t0(t.x,n.x,s.x,o?o.originX:void 0),t0(t.y,n.y,s.y,o?o.originY:void 0)}function n0(t,n,s){t.min=s.min+n.min,t.max=t.min+qt(n)}function yk(t,n,s){n0(t.x,n.x,s.x),n0(t.y,n.y,s.y)}function r0(t,n,s){t.min=n.min-s.min,t.max=t.min+qt(n)}function mo(t,n,s){r0(t.x,n.x,s.x),r0(t.y,n.y,s.y)}function vk(t,{min:n,max:s},o){return n!==void 0&&t<n?t=o?Ye(n,t,o.min):Math.max(t,n):s!==void 0&&t>s&&(t=o?Ye(s,t,o.max):Math.min(t,s)),t}function s0(t,n,s){return{min:n!==void 0?t.min+n:void 0,max:s!==void 0?t.max+s-(t.max-t.min):void 0}}function wk(t,{top:n,left:s,bottom:o,right:u}){return{x:s0(t.x,s,u),y:s0(t.y,n,o)}}function i0(t,n){let s=n.min-t.min,o=n.max-t.max;return n.max-n.min<t.max-t.min&&([s,o]=[o,s]),{min:s,max:o}}function bk(t,n){return{x:i0(t.x,n.x),y:i0(t.y,n.y)}}function kk(t,n){let s=.5;const o=qt(t),u=qt(n);return u>o?s=hi(n.min,n.max-o,t.min):o>u&&(s=hi(t.min,t.max-u,n.min)),er(0,1,s)}function jk(t,n){const s={};return n.min!==void 0&&(s.min=n.min-t.min),n.max!==void 0&&(s.max=n.max-t.min),s}const pd=.35;function Nk(t=pd){return t===!1?t=0:t===!0&&(t=pd),{x:o0(t,"left","right"),y:o0(t,"top","bottom")}}function o0(t,n,s){return{min:a0(t,n),max:a0(t,s)}}function a0(t,n){return typeof t=="number"?t:t[n]||0}const l0=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xs=()=>({x:l0(),y:l0()}),u0=()=>({min:0,max:0}),rt=()=>({x:u0(),y:u0()});function on(t){return[t("x"),t("y")]}function $x({top:t,left:n,right:s,bottom:o}){return{x:{min:n,max:s},y:{min:t,max:o}}}function Sk({x:t,y:n}){return{top:n.min,right:t.max,bottom:n.max,left:t.min}}function Ck(t,n){if(!n)return t;const s=n({x:t.left,y:t.top}),o=n({x:t.right,y:t.bottom});return{top:s.y,left:s.x,bottom:o.y,right:o.x}}function Tc(t){return t===void 0||t===1}function md({scale:t,scaleX:n,scaleY:s}){return!Tc(t)||!Tc(n)||!Tc(s)}function ns(t){return md(t)||zx(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function zx(t){return c0(t.x)||c0(t.y)}function c0(t){return t&&t!=="0%"}function gl(t,n,s){const o=t-s,u=n*o;return s+u}function d0(t,n,s,o,u){return u!==void 0&&(t=gl(t,u,o)),gl(t,s,o)+n}function gd(t,n=0,s=1,o,u){t.min=d0(t.min,n,s,o,u),t.max=d0(t.max,n,s,o,u)}function Ux(t,{x:n,y:s}){gd(t.x,n.translate,n.scale,n.originPoint),gd(t.y,s.translate,s.scale,s.originPoint)}const h0=.999999999999,f0=1.0000000000001;function Ak(t,n,s,o=!1){const u=s.length;if(!u)return;n.x=n.y=1;let c,h;for(let f=0;f<u;f++){c=s[f],h=c.projectionDelta;const{visualElement:m}=c.options;m&&m.props.style&&m.props.style.display==="contents"||(o&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Zs(t,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),h&&(n.x*=h.x.scale,n.y*=h.y.scale,Ux(t,h)),o&&ns(c.latestValues)&&Zs(t,c.latestValues))}n.x<f0&&n.x>h0&&(n.x=1),n.y<f0&&n.y>h0&&(n.y=1)}function Ys(t,n){t.min=t.min+n,t.max=t.max+n}function p0(t,n,s,o,u=.5){const c=Ye(t.min,t.max,u);gd(t,n,s,c,o)}function Zs(t,n){p0(t.x,n.x,n.scaleX,n.scale,n.originX),p0(t.y,n.y,n.scaleY,n.scale,n.originY)}function Wx(t,n){return $x(Ck(t.getBoundingClientRect(),n))}function Ek(t,n,s){const o=Wx(t,s),{scroll:u}=n;return u&&(Ys(o.x,u.offset.x),Ys(o.y,u.offset.y)),o}const Hx=({current:t})=>t?t.ownerDocument.defaultView:null,Tk=new WeakMap;class Pk{constructor(n){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=rt(),this.visualElement=n}start(n,{snapToCursor:s=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const u=g=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor(_o(g).point)},c=(g,y)=>{const{drag:w,dragPropagation:j,onDragStart:C}=this.getProps();if(w&&!j&&(this.openDragLock&&this.openDragLock(),this.openDragLock=kb(w),!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),on(N=>{let _=this.getAxisMotionValue(N).get()||0;if(Dn.test(_)){const{projection:B}=this.visualElement;if(B&&B.layout){const W=B.layout.layoutBox[N];W&&(_=qt(W)*(parseFloat(_)/100))}}this.originPoint[N]=_}),C&&Ke.postRender(()=>C(g,y)),od(this.visualElement,"transform");const{animationState:A}=this.visualElement;A&&A.setActive("whileDrag",!0)},h=(g,y)=>{const{dragPropagation:w,dragDirectionLock:j,onDirectionLock:C,onDrag:A}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:N}=y;if(j&&this.currentDirection===null){this.currentDirection=Mk(N),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",y.point,N),this.updateAxis("y",y.point,N),this.visualElement.render(),A&&A(g,y)},f=(g,y)=>this.stop(g,y),m=()=>on(g=>{var y;return this.getAnimationState(g)==="paused"&&((y=this.getAxisMotionValue(g).animation)===null||y===void 0?void 0:y.play())}),{dragSnapToOrigin:x}=this.getProps();this.panSession=new Rx(n,{onSessionStart:u,onStart:c,onMove:h,onSessionEnd:f,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:x,contextWindow:Hx(this.visualElement)})}stop(n,s){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:u}=s;this.startAnimation(u);const{onDragEnd:c}=this.getProps();c&&Ke.postRender(()=>c(n,s))}cancel(){this.isDragging=!1;const{projection:n,animationState:s}=this.visualElement;n&&(n.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(n,s,o){const{drag:u}=this.getProps();if(!o||!Ya(n,u,this.currentDirection))return;const c=this.getAxisMotionValue(n);let h=this.originPoint[n]+o[n];this.constraints&&this.constraints[n]&&(h=vk(h,this.constraints[n],this.elastic[n])),c.set(h)}resolveConstraints(){var n;const{dragConstraints:s,dragElastic:o}=this.getProps(),u=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(n=this.visualElement.projection)===null||n===void 0?void 0:n.layout,c=this.constraints;s&&Gs(s)?this.constraints||(this.constraints=this.resolveRefConstraints()):s&&u?this.constraints=wk(u.layoutBox,s):this.constraints=!1,this.elastic=Nk(o),c!==this.constraints&&u&&this.constraints&&!this.hasMutatedConstraints&&on(h=>{this.constraints!==!1&&this.getAxisMotionValue(h)&&(this.constraints[h]=jk(u.layoutBox[h],this.constraints[h]))})}resolveRefConstraints(){const{dragConstraints:n,onMeasureDragConstraints:s}=this.getProps();if(!n||!Gs(n))return!1;const o=n.current,{projection:u}=this.visualElement;if(!u||!u.layout)return!1;const c=Ek(o,u.root,this.visualElement.getTransformPagePoint());let h=bk(u.layout.layoutBox,c);if(s){const f=s(Sk(h));this.hasMutatedConstraints=!!f,f&&(h=$x(f))}return h}startAnimation(n){const{drag:s,dragMomentum:o,dragElastic:u,dragTransition:c,dragSnapToOrigin:h,onDragTransitionEnd:f}=this.getProps(),m=this.constraints||{},x=on(g=>{if(!Ya(g,s,this.currentDirection))return;let y=m&&m[g]||{};h&&(y={min:0,max:0});const w=u?200:1e6,j=u?40:1e7,C={type:"inertia",velocity:o?n[g]:0,bounceStiffness:w,bounceDamping:j,timeConstant:750,restDelta:1,restSpeed:10,...c,...y};return this.startAxisValueAnimation(g,C)});return Promise.all(x).then(f)}startAxisValueAnimation(n,s){const o=this.getAxisMotionValue(n);return od(this.visualElement,n),o.start(ah(n,o,0,s,this.visualElement,!1))}stopAnimation(){on(n=>this.getAxisMotionValue(n).stop())}pauseAnimation(){on(n=>{var s;return(s=this.getAxisMotionValue(n).animation)===null||s===void 0?void 0:s.pause()})}getAnimationState(n){var s;return(s=this.getAxisMotionValue(n).animation)===null||s===void 0?void 0:s.state}getAxisMotionValue(n){const s=`_drag${n.toUpperCase()}`,o=this.visualElement.getProps(),u=o[s];return u||this.visualElement.getValue(n,(o.initial?o.initial[n]:void 0)||0)}snapToCursor(n){on(s=>{const{drag:o}=this.getProps();if(!Ya(s,o,this.currentDirection))return;const{projection:u}=this.visualElement,c=this.getAxisMotionValue(s);if(u&&u.layout){const{min:h,max:f}=u.layout.layoutBox[s];c.set(n[s]-Ye(h,f,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:n,dragConstraints:s}=this.getProps(),{projection:o}=this.visualElement;if(!Gs(s)||!o||!this.constraints)return;this.stopAnimation();const u={x:0,y:0};on(h=>{const f=this.getAxisMotionValue(h);if(f&&this.constraints!==!1){const m=f.get();u[h]=kk({min:m,max:m},this.constraints[h])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),on(h=>{if(!Ya(h,n,null))return;const f=this.getAxisMotionValue(h),{min:m,max:x}=this.constraints[h];f.set(Ye(m,x,u[h]))})}addListeners(){if(!this.visualElement.current)return;Tk.set(this.visualElement,this);const n=this.visualElement.current,s=fo(n,"pointerdown",m=>{const{drag:x,dragListener:g=!0}=this.getProps();x&&g&&this.start(m)}),o=()=>{const{dragConstraints:m}=this.getProps();Gs(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:u}=this.visualElement,c=u.addEventListener("measure",o);u&&!u.layout&&(u.root&&u.root.updateScroll(),u.updateLayout()),Ke.read(o);const h=No(window,"resize",()=>this.scalePositionWithinConstraints()),f=u.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:x})=>{this.isDragging&&x&&(on(g=>{const y=this.getAxisMotionValue(g);y&&(this.originPoint[g]+=m[g].translate,y.set(y.get()+m[g].translate))}),this.visualElement.render())}));return()=>{h(),s(),c(),f&&f()}}getProps(){const n=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:o=!1,dragPropagation:u=!1,dragConstraints:c=!1,dragElastic:h=pd,dragMomentum:f=!0}=n;return{...n,drag:s,dragDirectionLock:o,dragPropagation:u,dragConstraints:c,dragElastic:h,dragMomentum:f}}}function Ya(t,n,s){return(n===!0||n===t)&&(s===null||s===t)}function Mk(t,n=10){let s=null;return Math.abs(t.y)>n?s="y":Math.abs(t.x)>n&&(s="x"),s}class Dk extends Rr{constructor(n){super(n),this.removeGroupControls=Gt,this.removeListeners=Gt,this.controls=new Pk(n)}mount(){const{dragControls:n}=this.node.getProps();n&&(this.removeGroupControls=n.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Gt}unmount(){this.removeGroupControls(),this.removeListeners()}}const m0=t=>(n,s)=>{t&&Ke.postRender(()=>t(n,s))};class Fk extends Rr{constructor(){super(...arguments),this.removePointerDownListener=Gt}onPointerDown(n){this.session=new Rx(n,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Hx(this.node)})}createPanHandlers(){const{onPanSessionStart:n,onPanStart:s,onPan:o,onPanEnd:u}=this.node.getProps();return{onSessionStart:m0(n),onStart:m0(s),onMove:o,onEnd:(c,h)=>{delete this.session,u&&Ke.postRender(()=>u(c,h))}}}mount(){this.removePointerDownListener=fo(this.node.current,"pointerdown",n=>this.onPointerDown(n))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const sl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function g0(t,n){return n.max===n.min?0:t/(n.max-n.min)*100}const no={correct:(t,n)=>{if(!n.target)return t;if(typeof t=="string")if(Ne.test(t))t=parseFloat(t);else return t;const s=g0(t,n.target.x),o=g0(t,n.target.y);return`${s}% ${o}%`}},Ik={correct:(t,{treeScale:n,projectionDelta:s})=>{const o=t,u=Lr.parse(t);if(u.length>5)return o;const c=Lr.createTransformer(t),h=typeof u[0]!="number"?1:0,f=s.x.scale*n.x,m=s.y.scale*n.y;u[0+h]/=f,u[1+h]/=m;const x=Ye(f,m,.5);return typeof u[2+h]=="number"&&(u[2+h]/=x),typeof u[3+h]=="number"&&(u[3+h]/=x),c(u)}};class _k extends k.Component{componentDidMount(){const{visualElement:n,layoutGroup:s,switchLayoutGroup:o,layoutId:u}=this.props,{projection:c}=n;tb(Lk),c&&(s.group&&s.group.add(c),o&&o.register&&u&&o.register(c),c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,onExitComplete:()=>this.safeToRemove()})),sl.hasEverUpdated=!0}getSnapshotBeforeUpdate(n){const{layoutDependency:s,visualElement:o,drag:u,isPresent:c}=this.props,h=o.projection;return h&&(h.isPresent=c,u||n.layoutDependency!==s||s===void 0?h.willUpdate():this.safeToRemove(),n.isPresent!==c&&(c?h.promote():h.relegate()||Ke.postRender(()=>{const f=h.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:n}=this.props.visualElement;n&&(n.root.didUpdate(),Ld.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:n,layoutGroup:s,switchLayoutGroup:o}=this.props,{projection:u}=n;u&&(u.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(u),o&&o.deregister&&o.deregister(u))}safeToRemove(){const{safeToRemove:n}=this.props;n&&n()}render(){return null}}function Kx(t){const[n,s]=Eg(),o=k.useContext(Ed);return a.jsx(_k,{...t,layoutGroup:o,switchLayoutGroup:k.useContext(Lg),isPresent:n,safeToRemove:s})}const Lk={borderRadius:{...no,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:no,borderTopRightRadius:no,borderBottomLeftRadius:no,borderBottomRightRadius:no,boxShadow:Ik};function Rk(t,n,s){const o=Ct(t)?t:ko(t);return o.start(ah("",o,n,s)),o.animation}function Ok(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Bk=(t,n)=>t.depth-n.depth;class Vk{constructor(){this.children=[],this.isDirty=!1}add(n){Xd(this.children,n),this.isDirty=!0}remove(n){Yd(this.children,n),this.isDirty=!0}forEach(n){this.isDirty&&this.children.sort(Bk),this.isDirty=!1,this.children.forEach(n)}}function $k(t,n){const s=Fn.now(),o=({timestamp:u})=>{const c=u-s;c>=n&&(_r(o),t(c-n))};return Ke.read(o,!0),()=>_r(o)}const Qx=["TopLeft","TopRight","BottomLeft","BottomRight"],zk=Qx.length,x0=t=>typeof t=="string"?parseFloat(t):t,y0=t=>typeof t=="number"||Ne.test(t);function Uk(t,n,s,o,u,c){u?(t.opacity=Ye(0,s.opacity!==void 0?s.opacity:1,Wk(o)),t.opacityExit=Ye(n.opacity!==void 0?n.opacity:1,0,Hk(o))):c&&(t.opacity=Ye(n.opacity!==void 0?n.opacity:1,s.opacity!==void 0?s.opacity:1,o));for(let h=0;h<zk;h++){const f=`border${Qx[h]}Radius`;let m=v0(n,f),x=v0(s,f);if(m===void 0&&x===void 0)continue;m||(m=0),x||(x=0),m===0||x===0||y0(m)===y0(x)?(t[f]=Math.max(Ye(x0(m),x0(x),o),0),(Dn.test(x)||Dn.test(m))&&(t[f]+="%")):t[f]=x}(n.rotate||s.rotate)&&(t.rotate=Ye(n.rotate||0,s.rotate||0,o))}function v0(t,n){return t[n]!==void 0?t[n]:t.borderRadius}const Wk=Gx(0,.5,hx),Hk=Gx(.5,.95,Gt);function Gx(t,n,s){return o=>o<t?0:o>n?1:s(hi(t,n,o))}function w0(t,n){t.min=n.min,t.max=n.max}function rn(t,n){w0(t.x,n.x),w0(t.y,n.y)}function b0(t,n){t.translate=n.translate,t.scale=n.scale,t.originPoint=n.originPoint,t.origin=n.origin}function k0(t,n,s,o,u){return t-=n,t=gl(t,1/s,o),u!==void 0&&(t=gl(t,1/u,o)),t}function Kk(t,n=0,s=1,o=.5,u,c=t,h=t){if(Dn.test(n)&&(n=parseFloat(n),n=Ye(h.min,h.max,n/100)-h.min),typeof n!="number")return;let f=Ye(c.min,c.max,o);t===c&&(f-=n),t.min=k0(t.min,n,s,f,u),t.max=k0(t.max,n,s,f,u)}function j0(t,n,[s,o,u],c,h){Kk(t,n[s],n[o],n[u],n.scale,c,h)}const Qk=["x","scaleX","originX"],Gk=["y","scaleY","originY"];function N0(t,n,s,o){j0(t.x,n,Qk,s?s.x:void 0,o?o.x:void 0),j0(t.y,n,Gk,s?s.y:void 0,o?o.y:void 0)}function S0(t){return t.translate===0&&t.scale===1}function qx(t){return S0(t.x)&&S0(t.y)}function C0(t,n){return t.min===n.min&&t.max===n.max}function qk(t,n){return C0(t.x,n.x)&&C0(t.y,n.y)}function A0(t,n){return Math.round(t.min)===Math.round(n.min)&&Math.round(t.max)===Math.round(n.max)}function Xx(t,n){return A0(t.x,n.x)&&A0(t.y,n.y)}function E0(t){return qt(t.x)/qt(t.y)}function T0(t,n){return t.translate===n.translate&&t.scale===n.scale&&t.originPoint===n.originPoint}class Xk{constructor(){this.members=[]}add(n){Xd(this.members,n),n.scheduleRender()}remove(n){if(Yd(this.members,n),n===this.prevLead&&(this.prevLead=void 0),n===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(n){const s=this.members.findIndex(u=>n===u);if(s===0)return!1;let o;for(let u=s;u>=0;u--){const c=this.members[u];if(c.isPresent!==!1){o=c;break}}return o?(this.promote(o),!0):!1}promote(n,s){const o=this.lead;if(n!==o&&(this.prevLead=o,this.lead=n,n.show(),o)){o.instance&&o.scheduleRender(),n.scheduleRender(),n.resumeFrom=o,s&&(n.resumeFrom.preserveOpacity=!0),o.snapshot&&(n.snapshot=o.snapshot,n.snapshot.latestValues=o.animationValues||o.latestValues),n.root&&n.root.isUpdating&&(n.isLayoutDirty=!0);const{crossfade:u}=n.options;u===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(n=>{const{options:s,resumingFrom:o}=n;s.onExitComplete&&s.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(n=>{n.instance&&n.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Yk(t,n,s){let o="";const u=t.x.translate/n.x,c=t.y.translate/n.y,h=(s==null?void 0:s.z)||0;if((u||c||h)&&(o=`translate3d(${u}px, ${c}px, ${h}px) `),(n.x!==1||n.y!==1)&&(o+=`scale(${1/n.x}, ${1/n.y}) `),s){const{transformPerspective:x,rotate:g,rotateX:y,rotateY:w,skewX:j,skewY:C}=s;x&&(o=`perspective(${x}px) ${o}`),g&&(o+=`rotate(${g}deg) `),y&&(o+=`rotateX(${y}deg) `),w&&(o+=`rotateY(${w}deg) `),j&&(o+=`skewX(${j}deg) `),C&&(o+=`skewY(${C}deg) `)}const f=t.x.scale*n.x,m=t.y.scale*n.y;return(f!==1||m!==1)&&(o+=`scale(${f}, ${m})`),o||"none"}const rs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},uo=typeof window<"u"&&window.MotionDebug!==void 0,Pc=["","X","Y","Z"],Zk={visibility:"hidden"},P0=1e3;let Jk=0;function Mc(t,n,s,o){const{latestValues:u}=n;u[t]&&(s[t]=u[t],n.setStaticValue(t,0),o&&(o[t]=0))}function Yx(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:n}=t.options;if(!n)return;const s=ix(n);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:u,layoutId:c}=t.options;window.MotionCancelOptimisedAnimation(s,"transform",Ke,!(u||c))}const{parent:o}=t;o&&!o.hasCheckedOptimisedAppear&&Yx(o)}function Zx({attachResizeListener:t,defaultParent:n,measureScroll:s,checkIsScrollRoot:o,resetTransform:u}){return class{constructor(h={},f=n==null?void 0:n()){this.id=Jk++,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,uo&&(rs.totalNodes=rs.resolvedTargetDeltas=rs.recalculatedProjection=0),this.nodes.forEach(nj),this.nodes.forEach(aj),this.nodes.forEach(lj),this.nodes.forEach(rj),uo&&window.MotionDebug.record(rs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=h,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new Vk)}addEventListener(h,f){return this.eventHandlers.has(h)||this.eventHandlers.set(h,new Zd),this.eventHandlers.get(h).add(f)}notifyListeners(h,...f){const m=this.eventHandlers.get(h);m&&m.notify(...f)}hasListeners(h){return this.eventHandlers.has(h)}mount(h,f=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ok(h),this.instance=h;const{layoutId:m,layout:x,visualElement:g}=this.options;if(g&&!g.current&&g.mount(h),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),f&&(x||m)&&(this.isLayoutDirty=!0),t){let y;const w=()=>this.root.updateBlockedByResize=!1;t(h,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=$k(w,250),sl.hasAnimatedSinceResize&&(sl.hasAnimatedSinceResize=!1,this.nodes.forEach(D0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&g&&(m||x)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:w,hasRelativeTargetChanged:j,layout:C})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const A=this.options.transition||g.getDefaultTransition()||fj,{onLayoutAnimationStart:N,onLayoutAnimationComplete:_}=g.getProps(),B=!this.targetLayout||!Xx(this.targetLayout,C)||j,W=!w&&j;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||W||w&&(B||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(y,W);const $={...Kd(A,"layout"),onPlay:N,onComplete:_};(g.shouldReduceMotion||this.options.layoutRoot)&&($.delay=0,$.type=!1),this.startAnimation($)}else w||D0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=C})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const h=this.getStack();h&&h.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,_r(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(uj),this.animationId++)}getTransformTemplate(){const{visualElement:h}=this.options;return h&&h.getProps().transformTemplate}willUpdate(h=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Yx(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const y=this.path[g];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:f,layout:m}=this.options;if(f===void 0&&!m)return;const x=this.getTransformTemplate();this.prevTransformTemplateValue=x?x(this.latestValues,""):void 0,this.updateSnapshot(),h&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(M0);return}this.isUpdating||this.nodes.forEach(ij),this.isUpdating=!1,this.nodes.forEach(oj),this.nodes.forEach(ej),this.nodes.forEach(tj),this.clearAllSnapshots();const f=Fn.now();vt.delta=er(0,1e3/60,f-vt.timestamp),vt.timestamp=f,vt.isProcessing=!0,bc.update.process(vt),bc.preRender.process(vt),bc.render.process(vt),vt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ld.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(sj),this.sharedNodes.forEach(cj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ke.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ke.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 m=0;m<this.path.length;m++)this.path[m].updateScroll();const h=this.layout;this.layout=this.measure(!1),this.layoutCorrected=rt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:f}=this.options;f&&f.notify("LayoutMeasure",this.layout.layoutBox,h?h.layoutBox:void 0)}updateScroll(h="measure"){let f=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===h&&(f=!1),f){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:h,isRoot:m,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!u)return;const h=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,f=this.projectionDelta&&!qx(this.projectionDelta),m=this.getTransformTemplate(),x=m?m(this.latestValues,""):void 0,g=x!==this.prevTransformTemplateValue;h&&(f||ns(this.latestValues)||g)&&(u(this.instance,x),this.shouldResetTransform=!1,this.scheduleRender())}measure(h=!0){const f=this.measurePageBox();let m=this.removeElementScroll(f);return h&&(m=this.removeTransform(m)),pj(m),{animationId:this.root.animationId,measuredBox:f,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var h;const{visualElement:f}=this.options;if(!f)return rt();const m=f.measureViewportBox();if(!(((h=this.scroll)===null||h===void 0?void 0:h.wasRoot)||this.path.some(mj))){const{scroll:g}=this.root;g&&(Ys(m.x,g.offset.x),Ys(m.y,g.offset.y))}return m}removeElementScroll(h){var f;const m=rt();if(rn(m,h),!((f=this.scroll)===null||f===void 0)&&f.wasRoot)return m;for(let x=0;x<this.path.length;x++){const g=this.path[x],{scroll:y,options:w}=g;g!==this.root&&y&&w.layoutScroll&&(y.wasRoot&&rn(m,h),Ys(m.x,y.offset.x),Ys(m.y,y.offset.y))}return m}applyTransform(h,f=!1){const m=rt();rn(m,h);for(let x=0;x<this.path.length;x++){const g=this.path[x];!f&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Zs(m,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),ns(g.latestValues)&&Zs(m,g.latestValues)}return ns(this.latestValues)&&Zs(m,this.latestValues),m}removeTransform(h){const f=rt();rn(f,h);for(let m=0;m<this.path.length;m++){const x=this.path[m];if(!x.instance||!ns(x.latestValues))continue;md(x.latestValues)&&x.updateSnapshot();const g=rt(),y=x.measurePageBox();rn(g,y),N0(f,x.latestValues,x.snapshot?x.snapshot.layoutBox:void 0,g)}return ns(this.latestValues)&&N0(f,this.latestValues),f}setTargetDelta(h){this.targetDelta=h,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(h){this.options={...this.options,...h,crossfade:h.crossfade!==void 0?h.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!==vt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(h=!1){var f;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const x=!!this.resumingFrom||this!==m;if(!(h||x&&this.isSharedProjectionDirty||this.isProjectionDirty||!((f=this.parent)===null||f===void 0)&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:w}=this.options;if(!(!this.layout||!(y||w))){if(this.resolvedRelativeTargetAt=vt.timestamp,!this.targetDelta&&!this.relativeTarget){const j=this.getClosestProjectingParent();j&&j.layout&&this.animationProgress!==1?(this.relativeParent=j,this.forceRelativeParentToResolveTarget(),this.relativeTarget=rt(),this.relativeTargetOrigin=rt(),mo(this.relativeTargetOrigin,this.layout.layoutBox,j.layout.layoutBox),rn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=rt(),this.targetWithTransforms=rt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),yk(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):rn(this.target,this.layout.layoutBox),Ux(this.target,this.targetDelta)):rn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const j=this.getClosestProjectingParent();j&&!!j.resumingFrom==!!this.resumingFrom&&!j.options.layoutScroll&&j.target&&this.animationProgress!==1?(this.relativeParent=j,this.forceRelativeParentToResolveTarget(),this.relativeTarget=rt(),this.relativeTargetOrigin=rt(),mo(this.relativeTargetOrigin,this.target,j.target),rn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}uo&&rs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||md(this.parent.latestValues)||zx(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 h;const f=this.getLead(),m=!!this.resumingFrom||this!==f;let x=!0;if((this.isProjectionDirty||!((h=this.parent)===null||h===void 0)&&h.isProjectionDirty)&&(x=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(x=!1),this.resolvedRelativeTargetAt===vt.timestamp&&(x=!1),x)return;const{layout:g,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(g||y))return;rn(this.layoutCorrected,this.layout.layoutBox);const w=this.treeScale.x,j=this.treeScale.y;Ak(this.layoutCorrected,this.treeScale,this.path,m),f.layout&&!f.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(f.target=f.layout.layoutBox,f.targetWithTransforms=rt());const{target:C}=f;if(!C){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(b0(this.prevProjectionDelta.x,this.projectionDelta.x),b0(this.prevProjectionDelta.y,this.projectionDelta.y)),po(this.projectionDelta,this.layoutCorrected,C,this.latestValues),(this.treeScale.x!==w||this.treeScale.y!==j||!T0(this.projectionDelta.x,this.prevProjectionDelta.x)||!T0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",C)),uo&&rs.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(h=!0){var f;if((f=this.options.visualElement)===null||f===void 0||f.scheduleRender(),h){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Xs(),this.projectionDelta=Xs(),this.projectionDeltaWithTransform=Xs()}setAnimationOrigin(h,f=!1){const m=this.snapshot,x=m?m.latestValues:{},g={...this.latestValues},y=Xs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const w=rt(),j=m?m.source:void 0,C=this.layout?this.layout.source:void 0,A=j!==C,N=this.getStack(),_=!N||N.members.length<=1,B=!!(A&&!_&&this.options.crossfade===!0&&!this.path.some(hj));this.animationProgress=0;let W;this.mixTargetDelta=$=>{const b=$/1e3;F0(y.x,h.x,b),F0(y.y,h.y,b),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mo(w,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dj(this.relativeTarget,this.relativeTargetOrigin,w,b),W&&qk(this.relativeTarget,W)&&(this.isProjectionDirty=!1),W||(W=rt()),rn(W,this.relativeTarget)),A&&(this.animationValues=g,Uk(g,x,this.latestValues,b,B,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(h){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(_r(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ke.update(()=>{sl.hasAnimatedSinceResize=!0,this.currentAnimation=Rk(0,P0,{...h,onUpdate:f=>{this.mixTargetDelta(f),h.onUpdate&&h.onUpdate(f)},onComplete:()=>{h.onComplete&&h.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 h=this.getStack();h&&h.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(P0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const h=this.getLead();let{targetWithTransforms:f,target:m,layout:x,latestValues:g}=h;if(!(!f||!m||!x)){if(this!==h&&this.layout&&x&&Jx(this.options.animationType,this.layout.layoutBox,x.layoutBox)){m=this.target||rt();const y=qt(this.layout.layoutBox.x);m.x.min=h.target.x.min,m.x.max=m.x.min+y;const w=qt(this.layout.layoutBox.y);m.y.min=h.target.y.min,m.y.max=m.y.min+w}rn(f,m),Zs(f,g),po(this.projectionDeltaWithTransform,this.layoutCorrected,f,g)}}registerSharedNode(h,f){this.sharedNodes.has(h)||this.sharedNodes.set(h,new Xk),this.sharedNodes.get(h).add(f);const x=f.options.initialPromotionConfig;f.promote({transition:x?x.transition:void 0,preserveFollowOpacity:x&&x.shouldPreserveFollowOpacity?x.shouldPreserveFollowOpacity(f):void 0})}isLead(){const h=this.getStack();return h?h.lead===this:!0}getLead(){var h;const{layoutId:f}=this.options;return f?((h=this.getStack())===null||h===void 0?void 0:h.lead)||this:this}getPrevLead(){var h;const{layoutId:f}=this.options;return f?(h=this.getStack())===null||h===void 0?void 0:h.prevLead:void 0}getStack(){const{layoutId:h}=this.options;if(h)return this.root.sharedNodes.get(h)}promote({needsReset:h,transition:f,preserveFollowOpacity:m}={}){const x=this.getStack();x&&x.promote(this,m),h&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const h=this.getStack();return h?h.relegate(this):!1}resetSkewAndRotation(){const{visualElement:h}=this.options;if(!h)return;let f=!1;const{latestValues:m}=h;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(f=!0),!f)return;const x={};m.z&&Mc("z",h,x,this.animationValues);for(let g=0;g<Pc.length;g++)Mc(`rotate${Pc[g]}`,h,x,this.animationValues),Mc(`skew${Pc[g]}`,h,x,this.animationValues);h.render();for(const g in x)h.setStaticValue(g,x[g]),this.animationValues&&(this.animationValues[g]=x[g]);h.scheduleRender()}getProjectionStyles(h){var f,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Zk;const x={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,x.opacity="",x.pointerEvents=nl(h==null?void 0:h.pointerEvents)||"",x.transform=g?g(this.latestValues,""):"none",x;const y=this.getLead();if(!this.projectionDelta||!this.layout||!y.target){const A={};return this.options.layoutId&&(A.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,A.pointerEvents=nl(h==null?void 0:h.pointerEvents)||""),this.hasProjected&&!ns(this.latestValues)&&(A.transform=g?g({},""):"none",this.hasProjected=!1),A}const w=y.animationValues||y.latestValues;this.applyTransformsToTarget(),x.transform=Yk(this.projectionDeltaWithTransform,this.treeScale,w),g&&(x.transform=g(w,x.transform));const{x:j,y:C}=this.projectionDelta;x.transformOrigin=`${j.origin*100}% ${C.origin*100}% 0`,y.animationValues?x.opacity=y===this?(m=(f=w.opacity)!==null&&f!==void 0?f:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:w.opacityExit:x.opacity=y===this?w.opacity!==void 0?w.opacity:"":w.opacityExit!==void 0?w.opacityExit:0;for(const A in dl){if(w[A]===void 0)continue;const{correct:N,applyTo:_}=dl[A],B=x.transform==="none"?w[A]:N(w[A],y);if(_){const W=_.length;for(let $=0;$<W;$++)x[_[$]]=B}else x[A]=B}return this.options.layoutId&&(x.pointerEvents=y===this?nl(h==null?void 0:h.pointerEvents)||"":"none"),x}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(h=>{var f;return(f=h.currentAnimation)===null||f===void 0?void 0:f.stop()}),this.root.nodes.forEach(M0),this.root.sharedNodes.clear()}}}function ej(t){t.updateLayout()}function tj(t){var n;const s=((n=t.resumeFrom)===null||n===void 0?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&s&&t.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:u}=t.layout,{animationType:c}=t.options,h=s.source!==t.layout.source;c==="size"?on(y=>{const w=h?s.measuredBox[y]:s.layoutBox[y],j=qt(w);w.min=o[y].min,w.max=w.min+j}):Jx(c,s.layoutBox,o)&&on(y=>{const w=h?s.measuredBox[y]:s.layoutBox[y],j=qt(o[y]);w.max=w.min+j,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[y].max=t.relativeTarget[y].min+j)});const f=Xs();po(f,o,s.layoutBox);const m=Xs();h?po(m,t.applyTransform(u,!0),s.measuredBox):po(m,o,s.layoutBox);const x=!qx(f);let g=!1;if(!t.resumeFrom){const y=t.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:w,layout:j}=y;if(w&&j){const C=rt();mo(C,s.layoutBox,w.layoutBox);const A=rt();mo(A,o,j.layoutBox),Xx(C,A)||(g=!0),y.options.layoutRoot&&(t.relativeTarget=A,t.relativeTargetOrigin=C,t.relativeParent=y)}}}t.notifyListeners("didUpdate",{layout:o,snapshot:s,delta:m,layoutDelta:f,hasLayoutChanged:x,hasRelativeTargetChanged:g})}else if(t.isLead()){const{onExitComplete:o}=t.options;o&&o()}t.options.transition=void 0}function nj(t){uo&&rs.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 rj(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function sj(t){t.clearSnapshot()}function M0(t){t.clearMeasurements()}function ij(t){t.isLayoutDirty=!1}function oj(t){const{visualElement:n}=t.options;n&&n.getProps().onBeforeLayoutMeasure&&n.notify("BeforeLayoutMeasure"),t.resetTransform()}function D0(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function aj(t){t.resolveTargetDelta()}function lj(t){t.calcProjection()}function uj(t){t.resetSkewAndRotation()}function cj(t){t.removeLeadSnapshot()}function F0(t,n,s){t.translate=Ye(n.translate,0,s),t.scale=Ye(n.scale,1,s),t.origin=n.origin,t.originPoint=n.originPoint}function I0(t,n,s,o){t.min=Ye(n.min,s.min,o),t.max=Ye(n.max,s.max,o)}function dj(t,n,s,o){I0(t.x,n.x,s.x,o),I0(t.y,n.y,s.y,o)}function hj(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const fj={duration:.45,ease:[.4,0,.1,1]},_0=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),L0=_0("applewebkit/")&&!_0("chrome/")?Math.round:Gt;function R0(t){t.min=L0(t.min),t.max=L0(t.max)}function pj(t){R0(t.x),R0(t.y)}function Jx(t,n,s){return t==="position"||t==="preserve-aspect"&&!xk(E0(n),E0(s),.2)}function mj(t){var n;return t!==t.root&&((n=t.scroll)===null||n===void 0?void 0:n.wasRoot)}const gj=Zx({attachResizeListener:(t,n)=>No(t,"resize",n),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Dc={current:void 0},ey=Zx({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Dc.current){const t=new gj({});t.mount(window),t.setOptions({layoutScroll:!0}),Dc.current=t}return Dc.current},resetTransform:(t,n)=>{t.style.transform=n!==void 0?n:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),xj={pan:{Feature:Fk},drag:{Feature:Dk,ProjectionNode:ey,MeasureLayout:Kx}};function O0(t,n,s){const{props:o}=t;t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",s==="Start");const u="onHover"+s,c=o[u];c&&Ke.postRender(()=>c(n,_o(n)))}class yj extends Rr{mount(){const{current:n}=this.node;n&&(this.unmount=xb(n,s=>(O0(this.node,s,"Start"),o=>O0(this.node,o,"End"))))}unmount(){}}class vj extends Rr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let n=!1;try{n=this.node.current.matches(":focus-visible")}catch{n=!0}!n||!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=Io(No(this.node.current,"focus",()=>this.onFocus()),No(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function B0(t,n,s){const{props:o}=t;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap",s==="Start");const u="onTap"+(s==="End"?"":s),c=o[u];c&&Ke.postRender(()=>c(n,_o(n)))}class wj extends Rr{mount(){const{current:n}=this.node;n&&(this.unmount=bb(n,s=>(B0(this.node,s,"Start"),(o,{success:u})=>B0(this.node,o,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const xd=new WeakMap,Fc=new WeakMap,bj=t=>{const n=xd.get(t.target);n&&n(t)},kj=t=>{t.forEach(bj)};function jj({root:t,...n}){const s=t||document;Fc.has(s)||Fc.set(s,{});const o=Fc.get(s),u=JSON.stringify(n);return o[u]||(o[u]=new IntersectionObserver(kj,{root:t,...n})),o[u]}function Nj(t,n,s){const o=jj(n);return xd.set(t,s),o.observe(t),()=>{xd.delete(t),o.unobserve(t)}}const Sj={some:0,all:1};class Cj extends Rr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:n={}}=this.node.getProps(),{root:s,margin:o,amount:u="some",once:c}=n,h={root:s?s.current:void 0,rootMargin:o,threshold:typeof u=="number"?u:Sj[u]},f=m=>{const{isIntersecting:x}=m;if(this.isInView===x||(this.isInView=x,c&&!x&&this.hasEnteredView))return;x&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",x);const{onViewportEnter:g,onViewportLeave:y}=this.node.getProps(),w=x?g:y;w&&w(m)};return Nj(this.node.current,h,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:n,prevProps:s}=this.node;["amount","margin","root"].some(Aj(n,s))&&this.startObserver()}unmount(){}}function Aj({viewport:t={}},{viewport:n={}}={}){return s=>t[s]!==n[s]}const Ej={inView:{Feature:Cj},tap:{Feature:wj},focus:{Feature:vj},hover:{Feature:yj}},Tj={layout:{ProjectionNode:ey,MeasureLayout:Kx}},yd={current:null},ty={current:!1};function Pj(){if(ty.current=!0,!!Md)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),n=()=>yd.current=t.matches;t.addListener(n),n()}else yd.current=!1}const Mj=[...Cx,St,Lr],Dj=t=>Mj.find(Sx(t)),V0=new WeakMap;function Fj(t,n,s){for(const o in n){const u=n[o],c=s[o];if(Ct(u))t.addValue(o,u);else if(Ct(c))t.addValue(o,ko(u,{owner:t}));else if(c!==u)if(t.hasValue(o)){const h=t.getValue(o);h.liveStyle===!0?h.jump(u):h.hasAnimated||h.set(u)}else{const h=t.getStaticValue(o);t.addValue(o,ko(h!==void 0?h:u,{owner:t}))}}for(const o in s)n[o]===void 0&&t.removeValue(o);return n}const $0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ij{scrapeMotionValuesFromProps(n,s,o){return{}}constructor({parent:n,props:s,presenceContext:o,reducedMotionConfig:u,blockInitialAnimation:c,visualState:h},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=sh,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 j=Fn.now();this.renderScheduledAt<j&&(this.renderScheduledAt=j,Ke.render(this.render,!1,!0))};const{latestValues:m,renderState:x,onUpdate:g}=h;this.onUpdate=g,this.latestValues=m,this.baseTarget={...m},this.initialValues=s.initial?{...m}:{},this.renderState=x,this.parent=n,this.props=s,this.presenceContext=o,this.depth=n?n.depth+1:0,this.reducedMotionConfig=u,this.options=f,this.blockInitialAnimation=!!c,this.isControllingVariants=kl(s),this.isVariantNode=Ig(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(n&&n.current);const{willChange:y,...w}=this.scrapeMotionValuesFromProps(s,{},this);for(const j in w){const C=w[j];m[j]!==void 0&&Ct(C)&&C.set(m[j],!1)}}mount(n){this.current=n,V0.set(n,this),this.projection&&!this.projection.instance&&this.projection.mount(n),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,o)=>this.bindToMotionValue(o,s)),ty.current||Pj(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:yd.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){V0.delete(this.current),this.projection&&this.projection.unmount(),_r(this.notifyUpdate),_r(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}bindToMotionValue(n,s){this.valueSubscriptions.has(n)&&this.valueSubscriptions.get(n)();const o=vs.has(n),u=s.on("change",f=>{this.latestValues[n]=f,this.props.onUpdate&&Ke.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),c=s.on("renderRequest",this.scheduleRender);let h;window.MotionCheckAppearSync&&(h=window.MotionCheckAppearSync(this,n,s)),this.valueSubscriptions.set(n,()=>{u(),c(),h&&h(),s.owner&&s.stop()})}sortNodePosition(n){return!this.current||!this.sortInstanceNodePosition||this.type!==n.type?0:this.sortInstanceNodePosition(this.current,n.current)}updateFeatures(){let n="animation";for(n in fi){const s=fi[n];if(!s)continue;const{isEnabled:o,Feature:u}=s;if(!this.features[n]&&u&&o(this.props)&&(this.features[n]=new u(this)),this.features[n]){const c=this.features[n];c.isMounted?c.update():(c.mount(),c.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):rt()}getStaticValue(n){return this.latestValues[n]}setStaticValue(n,s){this.latestValues[n]=s}update(n,s){(n.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=n,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let o=0;o<$0.length;o++){const u=$0[o];this.propEventSubscriptions[u]&&(this.propEventSubscriptions[u](),delete this.propEventSubscriptions[u]);const c="on"+u,h=n[c];h&&(this.propEventSubscriptions[u]=this.on(u,h))}this.prevMotionValues=Fj(this,this.scrapeMotionValuesFromProps(n,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(n){return this.props.variants?this.props.variants[n]: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(n){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(n),()=>s.variantChildren.delete(n)}addValue(n,s){const o=this.values.get(n);s!==o&&(o&&this.removeValue(n),this.bindToMotionValue(n,s),this.values.set(n,s),this.latestValues[n]=s.get())}removeValue(n){this.values.delete(n);const s=this.valueSubscriptions.get(n);s&&(s(),this.valueSubscriptions.delete(n)),delete this.latestValues[n],this.removeValueFromRenderState(n,this.renderState)}hasValue(n){return this.values.has(n)}getValue(n,s){if(this.props.values&&this.props.values[n])return this.props.values[n];let o=this.values.get(n);return o===void 0&&s!==void 0&&(o=ko(s===null?void 0:s,{owner:this}),this.addValue(n,o)),o}readValue(n,s){var o;let u=this.latestValues[n]!==void 0||!this.current?this.latestValues[n]:(o=this.getBaseTargetFromProps(this.props,n))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,n,this.options);return u!=null&&(typeof u=="string"&&(jx(u)||px(u))?u=parseFloat(u):!Dj(u)&&Lr.test(s)&&(u=wx(n,s)),this.setBaseTarget(n,Ct(u)?u.get():u)),Ct(u)?u.get():u}setBaseTarget(n,s){this.baseTarget[n]=s}getBaseTarget(n){var s;const{initial:o}=this.props;let u;if(typeof o=="string"||typeof o=="object"){const h=Od(this.props,o,(s=this.presenceContext)===null||s===void 0?void 0:s.custom);h&&(u=h[n])}if(o&&u!==void 0)return u;const c=this.getBaseTargetFromProps(this.props,n);return c!==void 0&&!Ct(c)?c:this.initialValues[n]!==void 0&&u===void 0?void 0:this.baseTarget[n]}on(n,s){return this.events[n]||(this.events[n]=new Zd),this.events[n].add(s)}notify(n,...s){this.events[n]&&this.events[n].notify(...s)}}class ny extends Ij{constructor(){super(...arguments),this.KeyframeResolver=Ax}sortInstanceNodePosition(n,s){return n.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(n,s){return n.style?n.style[s]:void 0}removeValueFromRenderState(n,{vars:s,style:o}){delete s[n],delete o[n]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:n}=this.props;Ct(n)&&(this.childSubscription=n.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function _j(t){return window.getComputedStyle(t)}class Lj extends ny{constructor(){super(...arguments),this.type="html",this.renderInstance=Ug}readValueFromInstance(n,s){if(vs.has(s)){const o=rh(s);return o&&o.default||0}else{const o=_j(n),u=(Vg(s)?o.getPropertyValue(s):o[s])||0;return typeof u=="string"?u.trim():u}}measureInstanceViewportBox(n,{transformPagePoint:s}){return Wx(n,s)}build(n,s,o){$d(n,s,o.transformTemplate)}scrapeMotionValuesFromProps(n,s,o){return Hd(n,s,o)}}class Rj extends ny{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=rt}getBaseTargetFromProps(n,s){return n[s]}readValueFromInstance(n,s){if(vs.has(s)){const o=rh(s);return o&&o.default||0}return s=Wg.has(s)?s:_d(s),n.getAttribute(s)}scrapeMotionValuesFromProps(n,s,o){return Qg(n,s,o)}build(n,s,o){zd(n,s,this.isSVGTag,o.transformTemplate)}renderInstance(n,s,o,u){Hg(n,s,o,u)}mount(n){this.isSVGTag=Wd(n.tagName),super.mount(n)}}const Oj=(t,n)=>Rd(t)?new Rj(n):new Lj(n,{allowProjection:t!==k.Fragment}),Bj=cb({...lk,...Ej,...xj,...Tj},Oj),_e=Sw(Bj),Sl="/orgx/live/assets/orgx-logo-QSE5QWy4.png",Vj=[{label:"Model Routing",desc:"Right model, right cost, every prompt",accent:"#BFFF00",icon:a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("circle",{cx:"12",cy:"5",r:"2.5",stroke:"currentColor",strokeWidth:"1.4"}),a.jsx("circle",{cx:"5",cy:"19",r:"2.5",stroke:"currentColor",strokeWidth:"1.4"}),a.jsx("circle",{cx:"19",cy:"19",r:"2.5",stroke:"currentColor",strokeWidth:"1.4"}),a.jsx("path",{d:"M12 7.5v3m0 0l-5.5 6m5.5-6l5.5 6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})},{label:"Live Operations",desc:"Decisions, handoffs, sessions — real-time",accent:"#14B8A6",icon:a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M3 12h3l2.5-5 3.5 10 2.5-5H21",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})},{label:"Quality Gates",desc:"Automated checkpoints before shipping",accent:"#7C7CFF",icon:a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("path",{d:"M12 2l8 4.5v5.5c0 4.7-3.4 9-8 10.3C7.4 21 4 16.7 4 12V6.5L12 2z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),a.jsx("path",{d:"M9 12l2.5 2.5L15 10",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}],$j=[{label:"Initiative",detail:"Top-level outcome and owner context"},{label:"Workstream",detail:"Major track that sequences execution"},{label:"Milestone",detail:"Checkpoint that gates readiness"},{label:"Task",detail:"Atomic action with dependencies and priority"}],zj={hidden:{},visible:{transition:{staggerChildren:.07}}},Wn={hidden:{opacity:0,y:14},visible:{opacity:1,y:0,transition:{duration:.45,ease:[.16,1,.3,1]}}};function Uj({state:t,isStarting:n,onConnect:s,onUseManualKey:o,onContinueWithoutOrgX:u}){const c=!!t.lastError;return a.jsxs(_e.section,{variants:zj,initial:"hidden",animate:"visible",className:"glass-panel soft-shadow rounded-2xl",children:[a.jsxs("div",{className:"px-6 pt-6 sm:px-8 sm:pt-8",children:[a.jsxs(_e.div,{variants:Wn,className:"flex items-center gap-2.5",children:[a.jsx("img",{src:Sl,alt:"OrgX",className:"h-7 w-7 rounded-lg object-contain"}),a.jsx("span",{className:"text-[13px] font-semibold text-white/70",children:"OrgX"})]}),a.jsx(_e.h2,{variants:Wn,className:"mt-5 text-[26px] font-semibold leading-[1.2] tracking-[-0.02em] text-white sm:text-[30px]",children:"Connect your workspace"}),a.jsx(_e.p,{variants:Wn,className:"mt-2 max-w-md text-[15px] leading-relaxed text-white/50",children:"Orchestrate agents, approve decisions, and track progress from a single live dashboard."})]}),a.jsx(_e.div,{variants:Wn,className:"mt-6 grid grid-cols-1 gap-2.5 px-6 sm:grid-cols-3 sm:px-8",children:Vj.map((h,f)=>a.jsxs(_e.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.18+f*.08,duration:.4,ease:[.16,1,.3,1]},className:"hover-lift rounded-xl border border-white/[0.06] bg-white/[0.025] px-4 py-3.5",children:[a.jsx("div",{style:{color:h.accent},className:"mb-2.5 opacity-80",children:h.icon}),a.jsx("p",{className:"text-[13px] font-semibold text-white",children:h.label}),a.jsx("p",{className:"mt-0.5 text-[12px] leading-snug text-white/40",children:h.desc})]},h.label))}),a.jsxs(_e.div,{variants:Wn,className:"mt-4 mx-6 sm:mx-8 rounded-xl border border-white/[0.08] bg-white/[0.02] p-4",children:[a.jsx("p",{className:"text-[11px] uppercase tracking-[0.08em] text-white/38",children:"How Work Ladders Up"}),a.jsx("div",{className:"mt-2 grid gap-1.5 sm:grid-cols-2",children:$j.map(h=>a.jsxs("div",{className:"rounded-lg border border-white/[0.08] bg-white/[0.02] px-2.5 py-2",children:[a.jsx("p",{className:"text-[12px] font-semibold text-white/85",children:h.label}),a.jsx("p",{className:"text-[11px] leading-relaxed text-white/45",children:h.detail})]},h.label))}),a.jsx("p",{className:"mt-2 text-[11px] leading-relaxed text-white/45",children:"Mission Control maps dependencies between all four levels so you can stay high-level, then drill down instantly."})]}),a.jsxs(_e.div,{variants:Wn,className:"mt-3 mx-6 sm:mx-8 rounded-xl border border-[#14B8A6]/20 bg-[#14B8A6]/[0.06] px-4 py-3",children:[a.jsx("p",{className:"text-[11px] uppercase tracking-[0.08em] text-[#7EEDE1]",children:"OpenClaw Integration"}),a.jsx("p",{className:"mt-1 text-[12px] leading-relaxed text-[#CFF8F3]",children:"OrgX syncs with your OpenClaw sessions so initiatives, workstreams, milestones, tasks, and assignment context stay aligned with live agent execution."})]}),a.jsxs(_e.div,{variants:Wn,className:"mt-6 flex flex-wrap items-center gap-3 px-6 sm:px-8",children:[a.jsx("button",{type:"button",onClick:s,disabled:n,className:"inline-flex items-center gap-2 rounded-full bg-[#BFFF00] px-5 py-2.5 text-[13px] font-semibold text-black shadow-[0_0_24px_rgba(191,255,0,0.12)] transition-all hover:bg-[#d3ff42] hover:shadow-[0_0_32px_rgba(191,255,0,0.22)] disabled:cursor-not-allowed disabled:opacity-50",children:n?a.jsxs(a.Fragment,{children:[a.jsxs("svg",{className:"h-3.5 w-3.5 animate-spin",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.2"}),a.jsx("path",{d:"M14 8a6 6 0 00-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),"Connecting..."]}):"Connect OrgX"}),a.jsx("button",{type:"button",onClick:o,className:"rounded-full border border-white/[0.1] px-4 py-2 text-[13px] text-white/60 transition hover:border-white/[0.18] hover:text-white/85",children:"Use API key"})]}),a.jsx(_e.div,{variants:Wn,className:"mx-6 mt-6 sm:mx-8",children:c?a.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-red-500/15 bg-red-500/[0.04] px-4 py-3",children:[a.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-red-500/15",children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:a.jsx("path",{d:"M5 2.5v3M5 7.5h.004",stroke:"#FF6B88",strokeWidth:"1.4",strokeLinecap:"round"})})}),a.jsx("div",{className:"min-w-0 flex-1",children:a.jsx("p",{className:"text-[13px] text-red-300/80",children:t.lastError})}),a.jsx("button",{type:"button",onClick:s,disabled:n,className:"shrink-0 text-[12px] font-medium text-red-300/70 transition hover:text-red-200",children:"Retry"})]}):a.jsxs("div",{className:"flex items-center gap-2.5 rounded-xl border border-white/[0.06] bg-white/[0.02] px-4 py-2.5",children:[a.jsx("span",{className:"relative flex h-1.5 w-1.5",children:a.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-white/40"})}),a.jsx("span",{className:"text-[13px] text-white/40",children:"Ready to connect"})]})}),a.jsxs(_e.div,{variants:Wn,className:"mt-4 flex items-center justify-between border-t border-white/[0.05] px-6 py-4 sm:px-8",children:[a.jsx("button",{type:"button",onClick:u,className:"text-[12px] text-white/35 transition hover:text-white/60",children:"Continue without OrgX"}),a.jsxs("a",{href:t.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"group inline-flex items-center gap-1 text-[12px] text-white/35 transition hover:text-white/60",children:["Setup guide",a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",className:"transition-transform group-hover:translate-x-0.5",children:a.jsx("path",{d:"M3.5 2.5l3 2.5-3 2.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})}const Wj={hidden:{},visible:{transition:{staggerChildren:.06}}},Ks={hidden:{opacity:0,y:10},visible:{opacity:1,y:0,transition:{duration:.35,ease:[.16,1,.3,1]}}};function Hj({isSubmitting:t,onSubmit:n,onBack:s}){const[o,u]=k.useState(""),[c,h]=k.useState(""),[f,m]=k.useState(null),x=async()=>{m(null);const y=o.trim();if(!y){m("API key is required.");return}const w=/^[a-z]+_/i.test(y)?y:`oxk_${y}`;try{await n(w,c.trim()||void 0),u("")}catch(j){m(j instanceof Error?j.message:"Failed to validate API key.")}},g=f!==null;return a.jsxs(_e.section,{variants:Wj,initial:"hidden",animate:"visible",className:"glass-panel soft-shadow rounded-2xl",children:[a.jsxs("div",{className:"px-6 pt-6 sm:px-8 sm:pt-8",children:[a.jsxs(_e.div,{variants:Ks,className:"flex items-center gap-2.5",children:[a.jsx("img",{src:Sl,alt:"OrgX",className:"h-7 w-7 rounded-lg object-contain"}),a.jsx("span",{className:"text-[13px] font-semibold text-white/70",children:"OrgX"})]}),a.jsx(_e.h3,{variants:Ks,className:"mt-5 text-[22px] font-semibold tracking-[-0.02em] text-white",children:"Manual API key"}),a.jsxs(_e.p,{variants:Ks,className:"mt-1.5 text-[14px] leading-relaxed text-white/45",children:["Paste a key from your ",a.jsx("span",{className:"text-white/60",children:"useorgx.com"})," dashboard. Browser pairing is recommended."]}),a.jsxs(_e.p,{variants:Ks,className:"mt-1 text-[12px] text-white/35",children:["Paste full key or only the part after ",a.jsx("span",{className:"font-mono text-white/50",children:"oxk_"}),"."]})]}),a.jsxs(_e.div,{variants:Ks,className:"mt-6 space-y-4 px-6 sm:px-8",children:[a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"mb-1.5 block text-[11px] font-medium uppercase tracking-[0.14em] text-white/40",children:"API key"}),a.jsxs("div",{className:`flex items-stretch overflow-hidden rounded-xl border transition-colors focus-within:border-[#BFFF00]/40 ${g?"border-red-500/30":"border-white/[0.08]"}`,children:[a.jsx("span",{className:"flex items-center border-r border-white/[0.06] bg-white/[0.03] px-3 font-mono text-[13px] text-white/25 select-none",children:"oxk_"}),a.jsx("input",{value:o,onChange:y=>{u(y.target.value),f&&m(null)},placeholder:"paste your key",className:"w-full bg-transparent px-3 py-2.5 font-mono text-[13px] text-white outline-none placeholder:text-white/15"})]}),g&&a.jsx(_e.p,{initial:{opacity:0,y:-3},animate:{opacity:1,y:0},className:"mt-1.5 text-[12px] text-red-400/70",children:f})]}),a.jsxs("label",{className:"block",children:[a.jsxs("span",{className:"mb-1.5 block text-[11px] font-medium uppercase tracking-[0.14em] text-white/40",children:["User ID ",a.jsx("span",{className:"normal-case tracking-normal text-white/25",children:"(optional)"})]}),a.jsx("input",{value:c,onChange:y=>h(y.target.value),placeholder:"user_...",className:"w-full rounded-xl border border-white/[0.08] bg-transparent px-3 py-2.5 font-mono text-[13px] text-white outline-none transition placeholder:text-white/15 focus:border-[#BFFF00]/40"})]})]}),a.jsxs(_e.div,{variants:Ks,className:"mt-6 flex flex-wrap items-center gap-3 px-6 sm:px-8",children:[a.jsx("button",{type:"button",onClick:()=>{x()},disabled:t,className:"inline-flex items-center gap-2 rounded-full bg-[#BFFF00] px-5 py-2.5 text-[13px] font-semibold text-black shadow-[0_0_24px_rgba(191,255,0,0.12)] transition-all hover:bg-[#d3ff42] hover:shadow-[0_0_32px_rgba(191,255,0,0.22)] disabled:cursor-not-allowed disabled:opacity-50",children:t?a.jsxs(a.Fragment,{children:[a.jsxs("svg",{className:"h-3.5 w-3.5 animate-spin",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.2"}),a.jsx("path",{d:"M14 8a6 6 0 00-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),"Validating..."]}):"Validate & Connect"}),a.jsx("button",{type:"button",onClick:s,className:"rounded-full border border-white/[0.1] px-4 py-2 text-[13px] text-white/60 transition hover:border-white/[0.18] hover:text-white/85",children:"Back to pairing"})]}),a.jsx("div",{className:"mt-6 border-t border-white/[0.05] px-6 py-4 sm:px-8",children:a.jsx("p",{className:"text-[12px] text-white/25",children:"Keys are stored locally and never leave your device."})})]})}function Kj(t){switch(t){case"starting":return"Starting secure session...";case"awaiting_browser_auth":return"Waiting for browser approval...";case"pairing":return"Confirming connection...";case"manual_key":return"Manual key entry";case"connected":return"Connected";case"error":return"Connection issue";default:return"Ready to connect"}}function Qj(t){return t==="awaiting_browser_auth"||t==="pairing"||t==="starting"?"active":t==="error"?"error":t==="connected"?"active":"idle"}const z0={idle:"bg-white/40",active:"bg-[#BFFF00]",error:"bg-red-400"},Ic="orgx.onboarding.mc_hint.dismissed",U0={initial:{opacity:0,y:14,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.985},transition:{duration:.32,ease:[.16,1,.3,1]}};function Gj({state:t,isLoading:n,isStarting:s,isSubmittingManual:o,onRefresh:u,onStartPairing:c,onSubmitManualKey:h,onBackToPairing:f,onUseManualKey:m,onSkip:x}){const[g,y]=k.useState(()=>typeof window>"u"?!1:window.localStorage.getItem(Ic)==="1");k.useEffect(()=>{typeof window>"u"||(g?window.localStorage.setItem(Ic,"1"):window.localStorage.removeItem(Ic))},[g]);const w=t.status==="manual_key",j=t.status==="awaiting_browser_auth"||t.status==="pairing",C=Qj(t.status),A=C==="active"&&t.status!=="connected",N=t.status==="connected"&&!g;return a.jsxs("div",{className:"relative flex min-h-screen items-center justify-center px-4 py-10 sm:py-16",style:{backgroundColor:"#02040A"},children:[a.jsxs("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:[a.jsx("div",{className:"ambient-orb orb-lime",style:{width:500,height:500,top:-200,left:-160}}),a.jsx("div",{className:"ambient-orb orb-teal",style:{width:560,height:560,bottom:-240,right:-170}}),a.jsx("div",{className:"ambient-orb orb-iris",style:{width:340,height:340,bottom:"20%",left:"50%",animationDelay:"3s"}}),a.jsx("div",{className:"grain-overlay absolute inset-0"})]}),a.jsxs(_e.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.45},className:"relative z-10 w-full max-w-lg",children:[n?a.jsxs("div",{className:"glass-panel rounded-2xl p-6 sm:p-8",children:[a.jsx("div",{className:"shimmer-skeleton h-7 w-28 rounded-lg"}),a.jsx("div",{className:"shimmer-skeleton mt-5 h-8 w-3/4 rounded-lg"}),a.jsx("div",{className:"shimmer-skeleton mt-3 h-4 w-2/3 rounded-lg"}),a.jsxs("div",{className:"mt-7 grid grid-cols-3 gap-2.5",children:[a.jsx("div",{className:"shimmer-skeleton h-24 rounded-xl"}),a.jsx("div",{className:"shimmer-skeleton h-24 rounded-xl"}),a.jsx("div",{className:"shimmer-skeleton h-24 rounded-xl"})]}),a.jsx("div",{className:"shimmer-skeleton mt-7 h-10 w-36 rounded-full"})]}):a.jsx(Ir,{mode:"wait",children:w?a.jsx(_e.div,{...U0,children:a.jsx(Hj,{isSubmitting:o,onSubmit:h,onBack:f})},"manual"):a.jsx(_e.div,{...U0,children:a.jsx(Uj,{state:t,isStarting:s,onConnect:()=>{c()},onUseManualKey:m,onContinueWithoutOrgX:x})},"explainer")}),!n&&(j||t.status==="connected")&&a.jsxs(_e.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:6},transition:{delay:.15,duration:.35,ease:[.16,1,.3,1]},className:"mt-4 flex items-center justify-between rounded-xl border border-white/[0.06] bg-white/[0.025] px-4 py-3",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsxs("span",{className:"relative flex h-2 w-2",children:[A&&a.jsx("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${z0[C]} opacity-40`}),a.jsx("span",{className:`relative inline-flex h-2 w-2 rounded-full ${z0[C]}`})]}),a.jsx("span",{className:"text-[13px] text-white/60",children:Kj(t.status)}),t.workspaceName&&a.jsx("span",{className:"chip",children:t.workspaceName})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[t.expiresAt&&a.jsx("span",{className:"text-[11px] text-white/30",children:new Date(t.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),t.connectUrl&&j&&a.jsx("a",{href:t.connectUrl,target:"_blank",rel:"noopener noreferrer",className:"rounded-full border border-[#BFFF00]/25 bg-[#BFFF00]/[0.05] px-3 py-1 text-[11px] font-medium text-[#D8FFA1] transition hover:bg-[#BFFF00]/[0.1]",children:"Approve in browser"}),a.jsx("button",{type:"button",onClick:()=>{u()},className:"rounded-full border border-white/[0.08] px-2.5 py-1 text-[11px] text-white/40 transition hover:bg-white/[0.04] hover:text-white/60",children:"Refresh"})]})]}),N&&a.jsxs(_e.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.2,duration:.3},className:"mt-3 rounded-xl border border-[#7C7CFF]/25 bg-[#7C7CFF]/10 px-4 py-3",children:[a.jsx("p",{className:"text-[11px] uppercase tracking-[0.08em] text-[#CFCBFF]",children:"Mission Control Tip"}),a.jsx("p",{className:"mt-1 text-[12px] leading-relaxed text-[#E6E4FF]",children:"Open Mission Control to see initiative → workstream → milestone → task flow with dependencies and recent todos in one expandable view."}),a.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[a.jsx("a",{href:"/orgx/live?view=mission-control",className:"rounded-full border border-[#BFFF00]/30 bg-[#BFFF00]/15 px-3 py-1 text-[11px] font-medium text-[#D8FFA1]",children:"Open Mission Control"}),a.jsx("button",{type:"button",onClick:()=>y(!0),className:"text-[11px] text-white/60 underline underline-offset-2",children:"Dismiss"})]})]})]})]})}function qj({children:t,color:n,pulse:s}){const o=n??Q.lime;return a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.14em]",style:{backgroundColor:`${o}22`,border:`1px solid ${o}5a`,color:o,boxShadow:`0 8px 20px ${o}24`},children:[a.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[s&&a.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full opacity-75",style:{backgroundColor:o}}),a.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full",style:{backgroundColor:o}})]}),t]})}var Xj=pg();function lh({open:t,onClose:n,children:s,maxWidth:o="max-w-2xl"}){const u=k.useRef(null),c=k.useRef(null);k.useEffect(()=>{if(!t)return;c.current=document.activeElement instanceof HTMLElement?document.activeElement:null,(()=>{const g=u.current;if(!g)return;const y=g.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');y.length>0?y[0].focus():g.focus()})();const m=g=>{if(g.key==="Escape"){g.preventDefault(),n();return}if(g.key!=="Tab")return;const y=u.current;if(!y)return;const w=y.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');if(w.length===0){g.preventDefault(),y.focus();return}const j=w[0],C=w[w.length-1],A=document.activeElement;!g.shiftKey&&A===C?(g.preventDefault(),j.focus()):g.shiftKey&&A===j&&(g.preventDefault(),C.focus())},x=document.body.style.overflow;return document.body.style.overflow="hidden",document.addEventListener("keydown",m),()=>{var g;document.body.style.overflow=x,document.removeEventListener("keydown",m),(g=c.current)==null||g.focus()}},[t,n]);const h=a.jsx(Ir,{children:t&&a.jsxs(_e.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[120] flex items-stretch justify-center p-0 sm:items-center sm:p-6",onClick:n,"aria-hidden":!t,children:[a.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-md"}),a.jsxs(_e.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.24,ease:[.16,1,.3,1]},className:`glass-panel soft-shadow relative flex h-[100dvh] max-h-[100dvh] w-full ${o} overflow-hidden rounded-none sm:h-[88vh] sm:max-h-[88vh] sm:rounded-2xl`,style:{backgroundColor:Q.cardBgElevated,borderColor:Q.cardBorderStrong},onClick:f=>f.stopPropagation(),role:"dialog","aria-modal":"true",tabIndex:-1,ref:u,children:[a.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-white/50 to-transparent"}),s]})]})});return typeof document>"u"?h:Xj.createPortal(h,document.body)}function dt(...t){return t.filter(Boolean).join(" ")}const Yj=[{id:"agents",label:"Agents",icon:a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.jsx("circle",{cx:"12",cy:"7",r:"4"})]})},{id:"activity",label:"Activity",icon:a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})},{id:"decisions",label:"Decisions",icon:a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]})},{id:"initiatives",label:"Initiatives",icon:a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"}),a.jsx("line",{x1:"4",x2:"4",y1:"22",y2:"15"})]})}];function Zj({activeTab:t,onTabChange:n,pendingDecisionCount:s=0}){return a.jsxs("nav",{className:"fixed inset-x-0 bottom-0 z-40 border-t border-white/[0.08] bg-[#0a0a0f]/95 backdrop-blur-lg lg:hidden","aria-label":"Mobile sections",children:[a.jsx("div",{className:"flex items-stretch",children:Yj.map(o=>{const u=t===o.id;return a.jsxs("button",{type:"button",onClick:()=>n(o.id),"aria-current":u?"page":void 0,className:dt("relative flex flex-1 flex-col items-center gap-0.5 pb-1 pt-2 transition-colors",u?"text-lime":"text-white/40 hover:text-white/60"),children:[u&&a.jsx("span",{className:"absolute inset-x-3 top-0 h-[2px] rounded-full",style:{backgroundColor:Q.lime}}),a.jsxs("span",{className:"relative",children:[o.icon,o.id==="decisions"&&s>0&&a.jsx("span",{className:"absolute -right-2 -top-1 flex h-3.5 min-w-[14px] items-center justify-center rounded-full px-1 text-[8px] font-bold text-black",style:{backgroundColor:Q.amber},children:s>99?"99+":s})]}),a.jsx("span",{className:"text-[10px]",children:o.label})]},o.id)})}),a.jsx("div",{className:"h-[env(safe-area-inset-bottom)]"})]})}const xl={codex:{id:"codex",label:"Codex",accent:"#10B981",tint:"rgba(16, 185, 129, 0.18)"},openai:{id:"openai",label:"OpenAI",accent:"#9F7AEA",tint:"rgba(159, 122, 234, 0.2)"},anthropic:{id:"anthropic",label:"Anthropic",accent:"#F5B700",tint:"rgba(245, 183, 0, 0.18)"},openclaw:{id:"openclaw",label:"OpenClaw",accent:"#FF4D4D",tint:"rgba(255, 77, 77, 0.18)"},orgx:{id:"orgx",label:"OrgX",accent:Q.lime,tint:"rgba(191, 255, 0, 0.18)"},unknown:{id:"unknown",label:"Agent",accent:Q.teal,tint:"rgba(20, 184, 166, 0.18)"}},Jj=["provider","vendor","model","runtime","engine","agent","name","title","label","summary","description","source"];function il(t,n,s,o){if(!(t==null||s>2)){if(typeof t=="string"){const u=t.trim();u.length>0&&n.push(u);return}if(Array.isArray(t)){for(const u of t)il(u,n,s+1,o);return}if(typeof t=="object"){if(o.has(t))return;o.add(t);for(const[u,c]of Object.entries(t)){const h=u.toLowerCase();typeof c=="string"?(Jj.some(f=>h.includes(f))||h.startsWith("meta")||h.endsWith("id"))&&il(c,n,s+1,o):typeof c=="object"&&c!==null&&il(c,n,s+1,o)}}}}function eN(t){const n=t.toLowerCase();return/\bcodex\b/.test(n)||/\bcursor\b/.test(n)||n.includes("openai/codex")?"codex":n.includes("openclaw")||n.includes("clawdbot")||n.includes("moltbot")?"openclaw":n.includes("anthropic")||n.includes("claude")||n.includes("sonnet")||n.includes("opus")?"anthropic":n.includes("openai")||n.includes("chatgpt")||/\bgpt[-\s]?\d/.test(n)||/\bo[134]/.test(n)?"openai":n.includes("orgx")?"orgx":null}function go(...t){const n=[],s=new Set;for(const o of t)il(o,n,0,s);for(const o of n){const u=eN(o);if(u)return xl[u]}return xl.unknown}function tN(t){return xl[t]??xl.unknown}function In({children:t,className:n=""}){return a.jsxs("section",{className:dt("group relative overflow-hidden rounded-2xl","glass-panel soft-shadow hover-lift",n),style:{backgroundColor:Q.cardBg,borderColor:Q.cardBorder},children:[a.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-white/50 to-transparent"}),a.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-500 group-hover:opacity-100",style:{background:"radial-gradient(circle at 18% 0%, rgba(191,255,0,0.06), transparent 46%)"}}),t]})}const nN={xs:18,sm:24,md:30};function rN({provider:t}){switch(t){case"openai":return a.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:a.jsx("path",{fill:"currentColor",d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})});case"anthropic":return a.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:a.jsx("path",{fill:"currentColor",d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"})});case"codex":return a.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:a.jsx("path",{fill:"currentColor",d:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"})});case"openclaw":return a.jsxs("svg",{viewBox:"0 0 120 120","aria-hidden":"true",children:[a.jsx("path",{d:"M60 10C30 10 15 35 15 55C15 75 30 95 45 100V110H55V100C55 100 60 102 65 100V110H75V100C90 95 105 75 105 55C105 35 90 10 60 10Z",fill:"currentColor"}),a.jsx("path",{d:"M20 45C5 40 0 50 5 60C10 70 20 65 25 55C28 48 25 45 20 45Z",fill:"currentColor"}),a.jsx("path",{d:"M100 45C115 40 120 50 115 60C110 70 100 65 95 55C92 48 95 45 100 45Z",fill:"currentColor"}),a.jsx("circle",{cx:"45",cy:"35",r:"6",fill:"rgba(2,4,10,0.92)"}),a.jsx("circle",{cx:"75",cy:"35",r:"6",fill:"rgba(2,4,10,0.92)"})]});case"orgx":return a.jsx("img",{src:Sl,alt:"","aria-hidden":"true",className:"h-full w-full rounded-[4px] object-contain"});default:return a.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"8",stroke:"currentColor",strokeWidth:"1.8",fill:"none"}),a.jsx("path",{d:"m12 6-2 7h3l-1 5 4-8h-3l1-4Z",fill:"currentColor"})]})}}function ol({provider:t,size:n="sm",className:s,showRing:o=!0}){const u=tN(t),c=nN[n];return a.jsx("span",{className:dt("inline-flex items-center justify-center rounded-md",s),style:{width:c,height:c,color:u.accent,backgroundColor:u.tint,border:o?`1px solid ${u.accent}55`:"none"},title:u.label,"aria-label":u.label,children:a.jsx("span",{style:{width:Math.round(c*.66),height:Math.round(c*.66),display:"inline-flex",alignItems:"center",justifyContent:"center"},children:a.jsx(rN,{provider:t})})})}const Za=120,sN=10,W0=new Set(["running","queued","pending","blocked"]),_c=[{id:"all",label:"All offline",minutes:null},{id:"24h",label:"24h",minutes:1440},{id:"3d",label:"3d",minutes:4320},{id:"7d",label:"7d",minutes:10080},{id:"30d",label:"30d",minutes:720*60}],iN=10,oN=[{id:"orchestrator",name:"Orchestrator",role:"Coordinates cross-team execution"},{id:"engineering",name:"Engineering",role:"Builds and ships technical work"},{id:"product",name:"Product",role:"Defines features and requirements"},{id:"marketing",name:"Marketing",role:"Drives campaigns and content"},{id:"design",name:"Design",role:"Creates interfaces and experiences"},{id:"operations",name:"Operations",role:"Manages reliability and processes"}],aN={running:Q.lime,queued:Q.amber,pending:Q.amber,blocked:Q.red,failed:Q.red,cancelled:Q.red,completed:Q.teal,archived:"rgba(255,255,255,0.5)"};function lN(t){return aN[t]??Q.iris}function Js(t){if(!t)return 0;const n=Date.parse(t);return Number.isFinite(n)?n:0}function Lc(t,n){return Js(n.updatedAt??n.lastEventAt??n.startedAt)-Js(t.updatedAt??t.lastEventAt??t.startedAt)}function uN(t,n){const o=(t.lastEventSummary??n.get(t.runId)??n.get(t.id)??"").trim();return o.length>0?o:"No run summary yet. Open session to inspect messages and outputs."}const cN=k.memo(function({sessions:n,activity:s,selectedSessionId:o,onSelectSession:u,onReconnect:c}){const[h,f]=k.useState(new Set),[m,x]=k.useState("all"),[g,y]=k.useState(!1),[w,j]=k.useState(0),C=k.useMemo(()=>{var oe,K,I;const O=new Map,G=[...s].sort((J,ne)=>Js(ne.timestamp)-Js(J.timestamp));for(const J of G){const ne=J.runId;if(!ne||O.has(ne))continue;const le=((oe=J.summary)==null?void 0:oe.trim())??((K=J.description)==null?void 0:K.trim())??((I=J.title)==null?void 0:I.trim())??"";le.length>0&&O.set(ne,le)}return O},[s]),{agents:A,hiddenGroupCount:N,filteredOutGroupsByDate:_,filteredOutSessionsByDate:B,visibleSessionCount:W,archivedGroups:$}=k.useMemo(()=>{const O=new Map;for(const q of n.nodes){const R=q.agentId??q.agentName??q.id,X=O.get(R);X?X.nodes.push(q):O.set(R,{agentId:q.agentId,agentName:q.agentName??"Unassigned",nodes:[q],latest:q})}for(const q of O.values())q.nodes.sort(Lc),q.latest=q.nodes[0];const G=Array.from(O.values()).sort((q,R)=>Lc(q.latest,R.latest)),oe=_c.find(q=>q.id===m)??_c[0],K=oe.minutes===null?null:Date.now()-oe.minutes*6e4,I=[],J=[];let ne=0,le=0;for(const q of G){if(K===null){I.push(q);continue}const R=q.nodes.filter(Y=>W0.has(Y.status)?!0:Js(Y.updatedAt??Y.lastEventAt??Y.startedAt)>=K);if(R.length===0){ne+=1,le+=q.nodes.length,J.push(q);continue}const X=q.nodes.filter(Y=>W0.has(Y.status)?!1:Js(Y.updatedAt??Y.lastEventAt??Y.startedAt)<K);le+=X.length,X.length>0&&J.push({...q,nodes:X,latest:X[0]}),I.push({...q,nodes:R,latest:R[0]})}return{agents:I.slice(0,Za),hiddenGroupCount:Math.max(0,I.length-Za),filteredOutGroupsByDate:ne,filteredOutSessionsByDate:le,visibleSessionCount:I.slice(0,Za).reduce((q,R)=>q+R.nodes.length,0),archivedGroups:J}},[m,n.nodes]);k.useEffect(()=>{y(!1),j(0)},[m]);const b=k.useMemo(()=>$.reduce((O,G)=>O+G.nodes.length,0),[$]),F=k.useMemo(()=>{const O=[];for(const G of $)for(const oe of G.nodes)O.push({node:oe,agentName:G.agentName});return O.sort((G,oe)=>Lc(G.node,oe.node)),O.slice(0,(w+1)*iN)},[$,w]),U=O=>{f(G=>{const oe=new Set(G);return oe.has(O)?oe.delete(O):oe.add(O),oe})},D=n.nodes.length===0;return a.jsxs(In,{className:"flex h-full min-h-0 flex-col card-enter",children:[a.jsxs("div",{className:"border-b border-white/[0.06] px-4 py-3.5",children:[a.jsx("div",{className:"flex items-center justify-between gap-2",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h2",{className:"text-[14px] font-semibold text-white",children:"Agents / Chats"}),a.jsxs("span",{className:"chip text-[11px]",children:[W,"/",n.nodes.length]})]})}),a.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[a.jsx("label",{htmlFor:"offline-date-filter",className:"text-[11px] text-white/45",children:"Offline"}),a.jsx("select",{id:"offline-date-filter",value:m,onChange:O=>x(O.target.value),className:"rounded-lg border border-white/[0.1] bg-black/30 px-2 py-1 text-[11px] text-white/75 focus:outline-none focus:ring-1 focus:ring-[#BFFF00]/30",children:_c.map(O=>a.jsx("option",{value:O.id,children:O.label},O.id))})]})]}),a.jsxs("div",{className:"flex-1 space-y-2 overflow-y-auto p-3",children:[A.length===0&&!D&&a.jsxs("div",{className:"flex flex-col items-center gap-2.5 rounded-xl border border-white/[0.06] bg-white/[0.02] px-3 py-6 text-center",children:[a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/25",children:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),a.jsx("p",{className:"text-[12px] text-white/45",children:"No sessions match the selected offline date filter."})]}),A.length===0&&D&&!c&&a.jsxs("div",{className:"flex flex-col items-center gap-2.5 rounded-xl border border-white/[0.06] bg-white/[0.02] px-3 py-6 text-center",children:[a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/25",children:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),a.jsx("p",{className:"text-[12px] text-white/45",children:"No active chats yet. Start a session to see agents here."})]}),A.map(O=>{const G=O.agentId??O.agentName,oe=h.has(G),K=O.nodes.length>1,I=O.latest,J=o===I.id,ne=oe?[]:O.nodes.slice(1,1+sN),le=Math.max(0,O.nodes.length-1-ne.length),q=uN(I,C),R=go(O.agentName,I.title,I.lastEventSummary,q,I);return a.jsxs("div",{className:dt("overflow-hidden rounded-xl border border-white/[0.06] bg-white/[0.02] transition-all",J&&"border-white/20 bg-white/[0.05]"),children:[a.jsxs("div",{className:"flex items-stretch",children:[a.jsx("button",{onClick:()=>u(I.id),className:"flex-1 px-3 py-2.5 text-left transition-colors hover:bg-white/[0.03]",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsxs("div",{className:"relative mt-0.5 flex-shrink-0",children:[a.jsx(ol,{provider:R.id,size:"sm"}),a.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 h-2.5 w-2.5 rounded-full border-2",style:{backgroundColor:lN(I.status),borderColor:Q.cardBg}})]}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"truncate text-[13px] font-semibold text-white",children:O.agentName}),I.progress!==null&&a.jsxs("span",{className:"text-[11px] font-medium text-white/60",children:[Math.round(I.progress),"%"]})]}),I.progress!==null&&a.jsx("div",{className:"mt-1 h-0.5 rounded-full bg-white/[0.08]",children:a.jsx("div",{className:"h-0.5 rounded-full",style:{width:`${Math.round(I.progress)}%`,background:`linear-gradient(90deg, ${Q.lime}, ${Q.teal})`}})}),a.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-[10px] text-white/45",children:[a.jsx("span",{className:"rounded-full border px-1.5 py-0.5 uppercase tracking-[0.08em]",style:{borderColor:`${R.accent}66`,color:R.accent,backgroundColor:R.tint},children:R.label}),a.jsx("span",{className:"text-[11px]",children:un(I.updatedAt??I.lastEventAt??I.startedAt??Date.now())})]}),a.jsx("p",{className:"mt-1 truncate text-[12px] text-white/78",children:I.title}),a.jsx("p",{className:"mt-0.5 line-clamp-2 text-[11px] leading-relaxed text-white/48",children:q})]})]})}),K&&a.jsx("button",{type:"button",onClick:()=>U(G),"aria-label":oe?"Expand sessions":"Collapse sessions",className:"flex w-10 items-center justify-center border-l border-white/[0.06] text-white/50 transition-colors hover:bg-white/[0.05] hover:text-white/80",children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:dt("transition-transform",oe?"-rotate-90":"rotate-0"),children:a.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),K&&a.jsx("div",{className:dt("overflow-hidden border-t border-white/[0.06] transition-all",oe?"max-h-0 opacity-0":"max-h-[360px] opacity-100"),children:a.jsxs("div",{className:"space-y-1.5 p-2",children:[ne.map(X=>{const Y=o===X.id,T=go(X.agentName,X.title,X.lastEventSummary,X);return a.jsx("button",{onClick:()=>u(X.id),className:dt("w-full rounded-lg px-2.5 py-2 text-left transition-colors",Y?"bg-white/[0.09]":"bg-white/[0.02] hover:bg-white/[0.05]"),children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ol,{provider:T.id,size:"xs"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate text-[12px] text-white/90",children:X.title}),a.jsxs("p",{className:"text-[10px] uppercase tracking-[0.08em] text-white/45",children:[T.label," · ",X.status]})]})]})},X.id)}),le>0&&!oe&&a.jsxs("p",{className:"px-1 text-[10px] text-white/40",children:["+",le," older sessions hidden for smooth rendering"]})]})})]},G)}),N>0&&a.jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] px-3 py-2 text-[11px] text-white/45",children:["Showing ",Za," most recent agent groups (",N," older groups omitted)."]}),c&&a.jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] text-[11px] text-white/45",children:[a.jsx("p",{className:"px-3 pt-2 pb-1.5 text-[10px] uppercase tracking-[0.1em] text-white/30",children:"OrgX Agent Roster"}),a.jsx("div",{className:"space-y-1 px-2 pb-2",children:oN.map(O=>a.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg px-2 py-1.5 opacity-55",children:[a.jsx("div",{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-md border border-white/[0.08] bg-white/[0.03]",children:a.jsx("span",{className:"text-[9px] font-semibold text-white/50",children:O.name.charAt(0)})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-[11px] font-medium text-white/60",children:O.name}),a.jsx("p",{className:"text-[9px] text-white/35",children:O.role})]}),a.jsx("button",{onClick:c,className:"rounded-md border border-lime/25 bg-lime/10 px-2 py-0.5 text-[9px] font-semibold text-lime transition-colors hover:bg-lime/20",children:"Connect"})]},O.id))})]}),B>0&&a.jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] text-[11px] text-white/45",children:[a.jsxs("button",{onClick:()=>{y(O=>!O),g&&j(0)},className:"flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03]",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:dt("transition-transform",g?"rotate-0":"-rotate-90"),children:a.jsx("path",{d:"m6 9 6 6 6-6"})}),a.jsxs("span",{children:[b," archived session",b===1?"":"s",_>0?` across ${_} agent${_===1?"":"s"}`:""]})]}),g&&a.jsxs("div",{className:"space-y-1.5 border-t border-white/[0.06] p-2",children:[F.map(({node:O,agentName:G})=>{const oe=go(O.agentName,O.title,O.lastEventSummary,O);return a.jsxs("button",{onClick:()=>u(O.id),className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left opacity-60 transition-colors hover:bg-white/[0.05] hover:opacity-80",children:[a.jsx(ol,{provider:oe.id,size:"xs"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("p",{className:"truncate text-[11px] font-medium text-white/70",children:G}),a.jsx("span",{className:"text-[10px] text-white/35",children:un(O.updatedAt??O.lastEventAt??O.startedAt??Date.now())})]}),a.jsx("p",{className:"truncate text-[10px] text-white/50",children:O.title}),a.jsx("span",{className:"text-[9px] uppercase tracking-[0.08em] text-white/35",children:O.status})]})]},O.id)}),F.length<b&&a.jsxs("button",{onClick:()=>j(O=>O+1),className:"w-full rounded-lg border border-white/[0.08] bg-white/[0.02] px-3 py-1.5 text-[10px] text-white/50 transition-colors hover:bg-white/[0.05]",children:["Load more (",b-F.length," remaining)"]})]})]})]})]})}),dN=/^[0-9a-f-]{20,}$/i;function hN(t){if(t.runId)return t.runId;const n=t.metadata;if(!n)return null;const s=["runId","run_id","sessionId","session_id","agentRunId"];for(const o of s){const u=n[o];if(typeof u=="string"&&u.trim().length>0)return u.trim()}return null}const fN=k.memo(function({session:n,activity:s,initiatives:o=[],onContinueHighestPriority:u,onDispatchSession:c,onStartInitiative:h,onStartWorkstream:f}){const[m,x]=k.useState(null),[g,y]=k.useState(null),[w,j]=k.useState(!1),C=k.useMemo(()=>n?s.filter(b=>hN(b)===n.runId).sort((b,F)=>Date.parse(F.timestamp)-Date.parse(b.timestamp)).slice(0,8):[],[s,n]),A=k.useMemo(()=>{var D;if(!n)return[];const b=[],F=n.initiativeId??n.groupId;if(F){const O=o.find(G=>G.id===F);O?b.push({label:"Initiative",value:O.name}):n.groupLabel&&n.groupLabel.trim().length>0&&b.push({label:"Initiative",value:n.groupLabel})}if(n.workstreamId){let O=null;for(const G of o){const oe=(D=G.workstreams)==null?void 0:D.find(K=>K.id===n.workstreamId);if(oe){O=oe.name;break}}!O&&!dN.test(n.workstreamId)&&(O=n.workstreamId),O&&b.push({label:"Workstream",value:O})}const U=n.phase??null;return U&&b.push({label:"Milestone",value:String(U)}),n.title&&b.push({label:"Task",value:n.title}),b},[o,n]),N=k.useMemo(()=>{var D,O;if(!n)return null;const b=((D=C[0])==null?void 0:D.summary)??((O=C[0])==null?void 0:O.description)??null,U=n.lastEventSummary??b??null;return U&&U.trim().length>0?U.trim():null},[C,n]),_=k.useMemo(()=>{var b;return n?go(n.agentName,n.title,n.lastEventSummary,N,(b=C[0])==null?void 0:b.metadata):go()},[C,n,N]),B=async(b,F,U)=>{if(!(!U||m)){x(b),y(null);try{await U(),y(`${F} requested.`)}catch(D){y(D instanceof Error?D.message:`${F} failed.`)}finally{x(null)}}};if(!n)return a.jsxs(In,{className:"flex h-full min-h-0 flex-col card-enter",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-white/[0.06] px-4 py-3.5",children:[a.jsx("h2",{className:"text-[14px] font-semibold text-white",children:"Session Detail"}),a.jsx("button",{onClick:()=>j(b=>!b),className:"text-white/40 transition-colors hover:text-white/70","aria-label":w?"Expand session detail":"Collapse session detail",children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:dt("transition-transform",w?"-rotate-90":"rotate-0"),children:a.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),a.jsx("div",{className:dt("transition-all",w?"max-h-0 overflow-hidden":"min-h-0 flex-1"),children:a.jsxs("div",{className:"space-y-2 overflow-y-auto p-4 text-[12px] text-white/45",children:[a.jsx("p",{children:"Select a session to inspect summary, breadcrumbs, blockers, and recent messages."}),a.jsx("button",{onClick:()=>B("continue-priority","Continue highest priority",u),disabled:!u||!!m,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:m==="continue-priority"?"Dispatching…":"Continue highest priority"}),g&&a.jsx("p",{className:"text-[11px] text-white/55",children:g})]})})]});const W=n.progress===null?null:Math.round(n.progress),$=[{label:"Started",value:n.startedAt?un(n.startedAt):"—"},{label:"Updated",value:n.updatedAt?un(n.updatedAt):"—"},{label:"ETA",value:n.eta??"—"},{label:"Checkpoints",value:n.checkpointCount!==null&&n.checkpointCount!==void 0?String(n.checkpointCount):"—"}];return a.jsxs(In,{className:"flex h-full min-h-0 flex-col card-enter",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-white/[0.06] px-4 py-3.5",children:[a.jsx("h2",{className:"text-[14px] font-semibold text-white",children:"Session Detail"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"chip text-[11px] uppercase",children:n.status}),a.jsx("button",{onClick:()=>j(b=>!b),className:"text-white/40 transition-colors hover:text-white/70","aria-label":w?"Expand session detail":"Collapse session detail",children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:dt("transition-transform",w?"-rotate-90":"rotate-0"),children:a.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]}),a.jsx("div",{className:dt("transition-all",w?"max-h-0 overflow-hidden":"min-h-0 flex-1"),children:a.jsxs("div",{className:"space-y-3 overflow-y-auto p-4",children:[a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(ol,{provider:_.id,size:"sm"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate text-[13px] font-medium text-white",children:n.title}),a.jsxs("p",{className:"mt-0.5 text-[11px] text-white/45",children:[n.agentName??"Unassigned"," · ",_.label]})]})]}),A.length>0&&a.jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] p-2.5",children:[a.jsx("p",{className:"mb-1.5 text-[10px] uppercase tracking-[0.1em] text-white/35",children:"Breadcrumb"}),a.jsx("div",{className:"flex flex-wrap items-center gap-1.5 text-[11px]",children:A.map((b,F)=>a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"rounded-full border border-white/[0.12] bg-white/[0.02] px-1.5 py-0.5 text-white/65",children:b.value}),F<A.length-1&&a.jsx("span",{className:"text-[11px] text-white/40",children:"›"})]},`${b.label}-${b.value}`))})]}),N&&a.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:N}),W!==null&&a.jsxs("div",{children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between text-[11px] text-white/55",children:[a.jsx("span",{children:"Progress"}),a.jsxs("span",{children:[W,"%"]})]}),a.jsx("div",{className:"h-2 rounded-full bg-white/[0.08]",children:a.jsx("div",{className:"h-2 rounded-full",style:{width:`${W}%`,background:`linear-gradient(90deg, ${Q.lime}, ${Q.teal})`}})})]}),a.jsx("dl",{className:"grid grid-cols-1 gap-1 text-[11px] text-white/55 sm:grid-cols-2",children:$.map(b=>a.jsxs("div",{children:[a.jsx("dt",{className:"text-white/35",children:b.label}),a.jsx("dd",{className:"font-medium",children:b.value})]},b.label))}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx("button",{onClick:()=>B("continue-priority","Continue highest priority",u),disabled:!u||!!m,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:m==="continue-priority"?"Dispatching…":"Continue Priority"}),a.jsx("button",{onClick:()=>B("dispatch-session","Dispatch session",()=>c==null?void 0:c(n)),disabled:!c||!!m,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:m==="dispatch-session"?"Dispatching…":"Dispatch Session"}),a.jsx("button",{onClick:()=>B("start-initiative","Start initiative",h),disabled:!h||!!m,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:m==="start-initiative"?"Creating…":"Start Initiative"}),a.jsx("button",{onClick:()=>B("start-workstream","Start workstream",()=>f==null?void 0:f(n.initiativeId)),disabled:!f||!!m,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:m==="start-workstream"?"Creating…":"Start Workstream"})]}),g&&a.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:g}),n.blockers.length>0&&a.jsxs("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3",children:[a.jsx("h3",{className:"mb-1 text-[11px] uppercase tracking-[0.12em] text-red-200/70",children:"Blockers"}),a.jsx("ul",{className:"space-y-1 text-[12px] text-red-100/90",children:n.blockers.map(b=>a.jsxs("li",{children:["• ",b]},b))})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"mb-2 text-[11px] uppercase tracking-[0.12em] text-white/45",children:"Recent Messages"}),C.length===0&&a.jsx("p",{className:"text-[12px] text-white/45",children:"No recent messages for this run."}),a.jsx("div",{className:"space-y-2",children:C.map(b=>a.jsxs("article",{className:"rounded-lg border border-white/[0.06] bg-white/[0.02] px-2.5 py-2",children:[a.jsx("p",{className:"text-[11px] text-white/85",children:b.title}),(b.summary||b.description)&&a.jsx("p",{className:"mt-0.5 line-clamp-2 text-[11px] text-white/55",children:b.summary??b.description}),a.jsxs("p",{className:"mt-1 text-[10px] text-white/35",children:[new Date(b.timestamp).toLocaleString()," · ",un(b.timestamp)]})]},b.id))})]})]})})]})}),pN=[[/opus/i,"Opus"],[/sonnet/i,"Sonnet"],[/haiku/i,"Haiku"],[/kimi/i,"Kimi"],[/gemini/i,"Gemini"],[/gpt-4o/i,"GPT-4o"],[/gpt-4/i,"GPT-4"],[/qwen/i,"Qwen"],[/deepseek/i,"DeepSeek"],[/llama/i,"Llama"]];function uh(t){if(!t)return"";for(const[s,o]of pN)if(s.test(t))return o;const n=t.split("/");return n[n.length-1]??t}function mN(t,n=4){let s=t.replace(/^\/Users\/[^/]+\//,"~/").replace(/^~\/Code\//,"").replace(/^~\//,"");const o=s.split("/");return o.length>n&&(s=o.slice(-n).join("/")),s}function Mn(t){let n=t;return n=n.replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,s=>`#${s.slice(0,4)}`),n=n.replace(/(?:anthropic|openrouter|openai)\/[a-z0-9._/-]+/gi,s=>uh(s)),n=n.replace(/\/Users\/[a-zA-Z0-9_-]+\/[^\s"']+/g,s=>mN(s)),n}const Rc=/\[([^\]]+)\]\(([^)\s]+)\)|`([^`]+)`|\*\*([^*]+)\*\*|__([^_]+)__|\*([^*\n]+)\*|_([^_\n]+)_/g;function gN(t){try{const n=new URL(t);return n.protocol==="http:"||n.protocol==="https:"}catch{return!1}}function ss(t,n){const s=[];let o=0,u=0;Rc.lastIndex=0;for(let c=Rc.exec(t);c;c=Rc.exec(t)){const[h]=c,f=c.index;f>o&&s.push(t.slice(o,f));const m=`${n}-${u++}`,x=c[1],g=c[2],y=c[3],w=c[4],j=c[5],C=c[6],A=c[7];x&&g&&gN(g)?s.push(a.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",className:"text-[#D8FFA1] underline decoration-white/35 underline-offset-2 transition hover:text-[#ECFFC6]",children:x},m)):y?s.push(a.jsx("code",{className:"rounded bg-white/[0.08] px-1 py-0.5 font-mono text-[0.93em] text-white/95",children:y},m)):w||j?s.push(a.jsx("strong",{className:"font-semibold text-white",children:w??j},m)):C||A?s.push(a.jsx("em",{className:"italic text-white/90",children:C??A},m)):s.push(h),o=f+h.length}return o<t.length&&s.push(t.slice(o)),s}function xN(t,n){const s=t.split(`
|
|
49
|
+
`),o=[];return s.forEach((u,c)=>{o.push(...ss(u,`${n}-line-${c}`)),c<s.length-1&&o.push(a.jsx("br",{},`${n}-br-${c}`))}),o}function al(t){return t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(s=>s.trim())}function yN(t){const n=al(t);return n.length===0?!1:n.every(s=>/^:?-{3,}:?$/.test(s))}function vN(t){const n=t.trim(),s=n.startsWith(":"),o=n.endsWith(":");return s&&o?"center":o?"right":"left"}function wN(t){const n=t.replace(/\r\n/g,`
|
|
50
|
+
`).split(`
|
|
51
|
+
`),s=[];let o=0;for(;o<n.length;){const u=n[o]??"",c=u.trim();if(!c){o+=1;continue}const h=u.includes("|"),f=n[o+1]??"";if(h&&f.includes("|")&&yN(f)){const w=al(u),C=al(f).map(N=>vN(N));o+=2;const A=[];for(;o<n.length;){const N=n[o]??"";if(!N.trim()||!N.includes("|"))break;A.push(al(N)),o+=1}s.push(a.jsx("div",{className:"overflow-x-auto rounded-xl border border-white/[0.1] bg-black/25",children:a.jsxs("table",{className:"min-w-full border-collapse text-left",children:[a.jsx("thead",{children:a.jsx("tr",{className:"border-b border-white/[0.08] bg-white/[0.03]",children:w.map((N,_)=>a.jsx("th",{className:"px-3 py-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-white/70",style:{textAlign:C[_]??"left"},children:ss(N,`tbl-h-${o}-${_}`)},`tbl-h-${_}`))})}),a.jsx("tbody",{children:A.map((N,_)=>a.jsx("tr",{className:_<A.length-1?"border-b border-white/[0.06]":void 0,children:w.map((B,W)=>a.jsx("td",{className:"px-3 py-2 text-[13px] leading-relaxed text-white/80 align-top",style:{textAlign:C[W]??"left"},children:ss(N[W]??"",`tbl-r-${o}-${_}-${W}`)},`tbl-r-${_}-c-${W}`))},`tbl-r-${_}`))})]})},`tbl-${o}`));continue}if(c.startsWith("```")){const w=c.slice(3).trim(),j=[];for(o+=1;o<n.length&&!(n[o]??"").trim().startsWith("```");)j.push(n[o]??""),o+=1;o<n.length&&(o+=1),s.push(a.jsxs("div",{className:"rounded-xl border border-white/[0.1] bg-black/40 p-3",children:[w&&a.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-[0.12em] text-white/35",children:w}),a.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap font-mono text-[11px] leading-relaxed text-white/78",children:a.jsx("code",{children:j.join(`
|
|
52
|
+
`)})})]},`code-${o}`));continue}const m=c.match(/^(#{1,3})\s+(.+)$/);if(m){const w=m[1].length,j=m[2],C=w===1?"text-[16px] font-semibold":w===2?"text-[14px] font-semibold":"text-[13px] font-medium";s.push(a.jsx("p",{className:dt("tracking-[-0.01em] text-white",C),children:ss(j,`h-${o}`)},`h-${o}`)),o+=1;continue}if(u.match(/^\s*[-*]\s+(.+)$/)){const w=[];for(;o<n.length;){const C=(n[o]??"").match(/^\s*[-*]\s+(.+)$/);if(!C)break;w.push(C[1]),o+=1}s.push(a.jsx("ul",{className:"space-y-1.5 pl-4",children:w.map((j,C)=>a.jsx("li",{className:"list-disc text-[13px] leading-relaxed text-white/78",children:ss(j,`ul-${o}-${C}`)},`ul-${o}-${C}`))},`ul-${o}`));continue}if(u.match(/^\s*\d+\.\s+(.+)$/)){const w=[];for(;o<n.length;){const C=(n[o]??"").match(/^\s*\d+\.\s+(.+)$/);if(!C)break;w.push(C[1]),o+=1}s.push(a.jsx("ol",{className:"space-y-1.5 pl-4",children:w.map((j,C)=>a.jsx("li",{className:"list-decimal text-[13px] leading-relaxed text-white/78",children:ss(j,`ol-${o}-${C}`)},`ol-${o}-${C}`))},`ol-${o}`));continue}const y=[];for(;o<n.length;){const w=n[o]??"",j=w.trim();if(!j||/^(#{1,3})\s+/.test(j)||/^\s*[-*]\s+/.test(w)||/^\s*\d+\.\s+/.test(w)||j.startsWith("```"))break;y.push(w),o+=1}s.push(a.jsx("p",{className:"text-[13px] leading-relaxed text-white/78",children:xN(y.join(`
|
|
53
|
+
`),`p-${o}`)},`p-${o}`))}return s}function xo({text:t,mode:n="inline",className:s}){const o=t.replace(/\r\n/g,`
|
|
54
|
+
`);return o.trim()?n==="inline"?a.jsx("span",{className:s,children:ss(o,"inline")}):a.jsx("div",{className:dt("space-y-2",s),children:wN(o)}):null}const bN={xs:"w-6 h-6 text-[9px]",sm:"w-8 h-8 text-[10px]",md:"w-10 h-10 text-[12px]"},kN="/orgx/live/",sn=t=>`${kN.replace(/\/+$/,"/")}${t}`,jN={pace:sn("brand/product-orchestrator.png"),eli:sn("brand/engineering-autopilot.png"),mark:sn("brand/launch-captain.png"),sage:sn("brand/pipeline-intelligence.png"),orion:sn("brand/control-tower.png"),dana:sn("brand/design-codex.png"),xandy:sn("brand/product-orchestrator.png"),nova:sn("brand/product-orchestrator.png"),openclaw:sn("brand/openclaw-mark.svg"),openai:sn("brand/openai-mark.svg"),anthropic:sn("brand/anthropic-mark.svg"),orgx:sn("brand/orgx-logo.png")},NN=[{test:/\bpace\b|product|nova|strategist/i,key:"pace"},{test:/\beli\b|engineering|dev-delivery|executor/i,key:"eli"},{test:/\bmark\b|marketing|launch-captain/i,key:"mark"},{test:/\bsage\b|sales|pipeline-intelligence|sales-sage/i,key:"sage"},{test:/\borion\b|operations|ops-orbit|control-tower/i,key:"orion"},{test:/\bdana\b|design|codex/i,key:"dana"},{test:/\bxandy\b|orchestrator|router-all-agents/i,key:"xandy"},{test:/\bholt\b|openclaw/i,key:"openclaw"},{test:/openai|gpt|o[1345]-|codex/i,key:"openai"},{test:/anthropic|claude/i,key:"anthropic"},{test:/\borgx\b/i,key:"orgx"}];function SN(...t){const n=t.map(s=>typeof s=="string"?s.trim():"").filter(Boolean).join(" ").toLowerCase();if(!n)return null;for(const s of NN)if(s.test.test(n))return jN[s.key];return null}function So({name:t,size:n="xs",hint:s,src:o}){const u=hw(t),[c,h]=k.useState(!1),f=k.useMemo(()=>o&&o.trim()?o:SN(t,s),[s,t,o]),m=!!(f&&!c);return a.jsx("div",{className:`${bN[n]} overflow-hidden rounded-full flex items-center justify-center font-semibold flex-shrink-0`,style:{backgroundColor:`${u}20`,color:u,border:`1px solid ${u}30`},children:m?a.jsx("img",{src:f??void 0,alt:t,className:"h-full w-full rounded-full object-cover",onError:()=>h(!0),loading:"lazy"}):fw(t)})}const CN={artifact_created:"⬦",run_failed:"✗",run_started:"▶",run_completed:"✓",decision_requested:"❓",decision_resolved:"✓",delegation:"→",blocker_created:"⚠",milestone_completed:"★"},AN={run_started:Q.teal,run_completed:Q.lime,run_failed:Q.red,artifact_created:Q.cyan,decision_requested:Q.amber,decision_resolved:Q.lime,handoff_requested:Q.iris,handoff_claimed:Q.teal,handoff_fulfilled:Q.lime,blocker_created:Q.red,milestone_completed:Q.cyan,delegation:Q.iris};function EN(t){try{return new Date(t).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}catch{return""}}function TN(t){var s;let n=0;for(const o of t){const u=(s=o.metadata)==null?void 0:s.costTotal;typeof u=="number"&&(n+=u)}return n<=0?null:n<.01?`$${n.toFixed(4)}`:`$${n.toFixed(2)}`}const PN=k.memo(function({items:n,session:s,agentName:o,onBack:u}){const c=k.useMemo(()=>[...n].sort((x,g)=>Date.parse(x.timestamp)-Date.parse(g.timestamp)),[n]),h=k.useMemo(()=>TN(c),[c]),f=k.useMemo(()=>{if(c.length<2)return null;const x=Date.parse(c[0].timestamp),y=Date.parse(c[c.length-1].timestamp)-x;return y<6e4?`${Math.round(y/1e3)}s`:y<36e5?`${Math.round(y/6e4)}m`:`${(y/36e5).toFixed(1)}h`},[c]),m=(s==null?void 0:s.title)??o??"Session";return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"border-b border-white/[0.06] px-4 py-3",children:[a.jsxs("button",{onClick:u,className:"mb-2 flex items-center gap-1.5 text-[11px] text-white/50 transition-colors hover:text-white/80",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"m15 18-6-6 6-6"})}),"Back to timeline"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:Q.lime,boxShadow:`0 0 12px ${Q.lime}55`}}),a.jsx("h3",{className:"text-[14px] font-semibold text-white",children:Mn(m)})]}),a.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[10px] text-white/45",children:[o&&a.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-white/[0.1] px-1 py-0.5",children:[a.jsx(So,{name:o,hint:(s==null?void 0:s.id)??(s==null?void 0:s.runId)??null,size:"xs"}),a.jsx("span",{children:o})]}),a.jsxs("span",{children:[c.length," turn",c.length!==1?"s":""]}),f&&a.jsx("span",{children:f}),h&&a.jsx("span",{className:"text-white/35",children:h}),(s==null?void 0:s.status)&&a.jsx("span",{className:"rounded-full px-1.5 py-0.5 text-[9px] uppercase tracking-wider",style:{backgroundColor:s.status==="running"?`${Q.lime}20`:s.status==="failed"?`${Q.red}20`:`${Q.teal}20`,color:s.status==="running"?Q.lime:s.status==="failed"?Q.red:Q.teal},children:s.status})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3",children:[a.jsx(Ir,{mode:"popLayout",children:a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute left-[7px] top-3 bottom-3 w-px",style:{backgroundColor:`${Q.iris}25`}}),a.jsx("div",{className:"space-y-1",children:c.map((x,g)=>{const y=AN[x.type]??Q.iris,w=CN[x.type]??"→",j=uh(x.description),C=Mn(x.title??""),A=x.type==="run_failed",N=x.type==="artifact_created",_=x.type==="decision_requested"||x.type==="decision_resolved";return a.jsxs(_e.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{duration:.2,delay:g*.02},className:"group relative flex items-start gap-2.5 rounded-lg py-1.5 pl-0 pr-2 transition-colors hover:bg-white/[0.02]",children:[a.jsx("span",{className:"relative z-10 mt-1.5 flex h-[15px] w-[15px] flex-shrink-0 items-center justify-center rounded-full text-[8px]",style:{backgroundColor:`${y}20`,color:y,border:`1px solid ${y}40`},children:w}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:`text-[12px] leading-snug ${A?"text-red-400":_?"text-amber-300":N?"text-cyan-300":"text-white/85"}`,children:C}),x.summary&&x.summary!==C&&a.jsx("p",{className:"mt-0.5 text-[11px] leading-relaxed text-white/40",children:Mn(x.summary)})]}),a.jsxs("div",{className:"flex flex-shrink-0 flex-col items-end gap-0.5 pt-0.5",children:[a.jsx("span",{className:"text-[10px] text-white/35",children:EN(x.timestamp)}),j&&a.jsx("span",{className:"text-[9px] text-white/25",children:j})]})]},x.id)})})]})}),c.length===0&&a.jsx("div",{className:"flex flex-col items-center gap-2 py-8 text-center",children:a.jsx("p",{className:"text-[12px] text-white/40",children:"No activity in this session yet."})}),c.length>0&&a.jsxs("div",{className:"mt-4 rounded-lg border border-white/[0.06] bg-white/[0.02] px-3 py-2 text-[10px] text-white/35",children:[c.length," turn",c.length!==1?"s":"",f?` over ${f}`:"",h?` · ${h}`:""," · ",un(c[c.length-1].timestamp)]})]})]})}),MN={initial:{opacity:0,y:8,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98}},DN=480,Oc={all:"All",messages:"Messages",artifacts:"Artifacts",decisions:"Decisions"},FN={run_started:Q.teal,run_completed:Q.lime,run_failed:Q.red,artifact_created:Q.cyan,decision_requested:Q.amber,decision_resolved:Q.lime,handoff_requested:Q.iris,handoff_claimed:Q.teal,handoff_fulfilled:Q.lime,blocker_created:Q.red,milestone_completed:Q.cyan,delegation:Q.iris};function IN(t){if(!t)return 0;const n=Date.parse(t);return Number.isFinite(n)?n:0}function ry(t){if(!t)return"";const n=[];for(const[s,o]of Object.entries(t))typeof o=="string"&&(s.toLowerCase().includes("type")||s.toLowerCase().includes("kind")||s.toLowerCase().includes("summary")||s.toLowerCase().includes("message")||s.toLowerCase().includes("artifact")||s.toLowerCase().includes("decision")||s.toLowerCase().includes("run")||s.toLowerCase().includes("title")||s.toLowerCase().includes("task")||s.toLowerCase().includes("workstream")||s.toLowerCase().includes("milestone"))&&n.push(o);return n.join(" ")}function _N(t){if(t.runId)return t.runId;const n=t.metadata;if(!n)return null;const s=["runId","run_id","sessionId","session_id","agentRunId"];for(const o of s){const u=n[o];if(typeof u=="string"&&u.trim().length>0)return u.trim()}return null}function LN(t){return t?["artifact","artifacts","artifact_type","artifactType","output","outputs","result","results","payload","toolOutput","toolOutputs","toolResult","toolResults"].some(s=>s in t):!1}function RN(t){const n=t.metadata,s=ry(t.metadata),o=[t.type,t.kind,t.summary,t.title,t.description,s].filter(h=>typeof h=="string"&&h.trim().length>0).join(" ").toLowerCase();return t.type==="artifact_created"||LN(n)||/artifact|deliverable|output payload/.test(o)?"artifact":t.type==="decision_requested"||t.type==="decision_resolved"||t.decisionRequired===!0||/decision|approve|approval|reject|review request|request changes/.test(o)?"decision":"message"}function co(t){return t.split("_").join(" ")}function ON(t){const n=new Date(t);if(Number.isNaN(n.getTime()))return"unknown";const s=new Date(n.getFullYear(),n.getMonth(),n.getDate());return String(s.getTime())}function BN(t){const n=Number(t);if(!Number.isFinite(n))return"Unknown day";const s=new Date(n),o=new Date,u=new Date(o.getFullYear(),o.getMonth(),o.getDate()),c=new Date(u);return c.setDate(u.getDate()-1),s.getTime()===u.getTime()?"Today":s.getTime()===c.getTime()?"Yesterday":s.toLocaleDateString(void 0,{month:"short",day:"numeric",year:s.getFullYear()===o.getFullYear()?void 0:"numeric"})}function Bc(t){return t==="artifact"?"artifact":t==="decision"?"decision":"message"}function ro(t){return t==="artifact"?Q.cyan:t==="decision"?Q.amber:Q.teal}function H0(t){if(!t||Object.keys(t).length===0)return null;try{return JSON.stringify(t,null,2)}catch{return null}}function VN(t){if(!t)return null;const n=t.metadata;if(!n||typeof n!="object")return null;const s=["artifact","artifacts","output","outputs","result","results","payload","toolOutput","toolOutputs","toolResult","toolResults"];for(const o of s){const u=n[o];if(u!=null)return{source:o,value:u}}return t.type==="artifact_created"?{source:"metadata",value:n}:null}function sy(t){if(typeof t=="string")return a.jsx(xo,{mode:"block",text:t,className:"text-[13px] leading-relaxed text-white/82"});if(typeof t=="number"||typeof t=="boolean")return a.jsx("p",{className:"text-[13px] text-white/82",children:String(t)});if(Array.isArray(t))return a.jsx("div",{className:"space-y-1.5",children:t.map((n,s)=>a.jsx("div",{className:"rounded-lg border border-white/[0.08] bg-white/[0.02] px-2.5 py-2",children:sy(n)},`artifact-list-${s}`))});if(t&&typeof t=="object"){const n=Object.entries(t);return a.jsx("dl",{className:"space-y-1.5",children:n.map(([s,o])=>a.jsxs("div",{className:"rounded-lg border border-white/[0.08] bg-white/[0.02] px-2.5 py-2",children:[a.jsx("dt",{className:"text-[10px] uppercase tracking-[0.1em] text-white/45",children:Mn(s)}),a.jsx("dd",{className:"mt-1 text-[13px] text-white/82",children:typeof o=="string"||typeof o=="number"||typeof o=="boolean"?String(o):Array.isArray(o)?`${o.length} item${o.length===1?"":"s"}`:o&&typeof o=="object"?`${Object.keys(o).length} field${Object.keys(o).length===1?"":"s"}`:"—"})]},s))})}return a.jsx("p",{className:"text-[13px] text-white/55",children:"No artifact payload."})}function Kn(t){if(!t)return null;const n=t.trim();if(!n)return null;const s=uh(n);return s&&s!==n&&/^[a-z0-9._/-]+$/i.test(n)?s:Mn(n)}function $N(t){if(!t)return null;const n=t.metadata;if(!n||typeof n!="object")return null;const s=typeof n.source=="string"?n.source.trim():"",o=typeof n.turnId=="string"?n.turnId.trim():"";if(s!=="local_openclaw"||!o)return null;const u=typeof n.sessionKey=="string"&&n.sessionKey.trim().length>0?n.sessionKey.trim():null;return{turnId:o,sessionKey:u,runId:t.runId??null}}function K0(t){return t.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/\*([^*\n]+)\*/g,"$1").replace(/_([^_\n]+)_/g,"$1")}function zN(t,n){const o=(Kn(n??t.summary)??Kn(t.description)??Mn(t.title||co(t.type))).replace(/\r\n/g,`
|
|
55
|
+
`).replace(/```[\s\S]*?```/g," ").replace(/^\s{0,3}#{1,6}\s+/gm,"").replace(/^\s*[-*]\s+/gm,"").replace(/\s+/g," ").trim(),u=o.split(`
|
|
56
|
+
`).map(h=>K0(h).trim()).filter(h=>h.length>0&&!/^\|?[:\-| ]+\|?$/.test(h));let c=u[0]??K0(o);return c.length<24&&u.length>1&&(c=`${c} ${u[1]}`.trim()),c.length>108?`${c.slice(0,107).trimEnd()}…`:c}const UN=k.memo(function({activity:n,sessions:s,selectedRunIds:o,selectedSessionLabel:u=null,onClearSelection:c}){var At;const[h,f]=k.useState("all"),[m,x]=k.useState(!1),[g,y]=k.useState(""),[w,j]=k.useState("newest"),[C,A]=k.useState(null),[N,_]=k.useState(1),[B,W]=k.useState("structured"),[$,b]=k.useState(null),[F,U]=k.useState("feed"),[D,O]=k.useState(null),[G,oe]=k.useState(null),[K,I]=k.useState(!1),J=k.useMemo(()=>{const ae=new Map;for(const Me of s)ae.set(Me.runId,Me.title),ae.set(Me.id,Me.title);return ae},[s]),ne=k.useMemo(()=>n.map(ae=>{const Me=_N(ae),Z=RN(ae),he=[ae.title,ae.description,ae.summary,ae.agentName,ry(ae.metadata)].filter($e=>typeof $e=="string"&&$e.length>0).join(" ").toLowerCase();return{item:ae,bucket:Z,runId:Me,timestampEpoch:IN(ae.timestamp),searchText:he}}),[n]),le=k.useMemo(()=>new Set(o.filter(ae=>ae&&ae.trim().length>0)),[o]),q=le.size>0,{filtered:R,truncatedCount:X}=k.useMemo(()=>{const ae=[];let Me=0;const Z=g.trim().toLowerCase();for(const $e of ne){const ot=$e.runId;if(q&&(!ot||!le.has(ot)))continue;const ht=$e.bucket;if(!(h==="messages"&&ht!=="message")&&!(h==="artifacts"&&ht!=="artifact")&&!(h==="decisions"&&ht!=="decision")){if(Z.length>0){const zt=ot?J.get(ot)??ot:"";if(!`${$e.searchText} ${zt.toLowerCase()}`.includes(Z))continue}ae.length<DN?ae.push($e):Me+=1}}return{filtered:[...ae].sort(($e,ot)=>{const ht=ot.timestampEpoch-$e.timestampEpoch;return w==="newest"?ht:-ht}),truncatedCount:Me}},[h,ne,q,g,J,le,w]),Y=k.useMemo(()=>{const ae=new Map;for(const Z of R){const he=ON(Z.item.timestamp),$e=ae.get(he);$e?$e.push(Z):ae.set(he,[Z])}return Array.from(ae.keys()).sort((Z,he)=>{const $e=Number(he)-Number(Z);return w==="newest"?$e:-$e}).map(Z=>({key:Z,label:BN(Z),items:ae.get(Z)??[]}))},[R,w]),T=k.useMemo(()=>C?R.findIndex(ae=>ae.item.id===C):-1,[C,R]),L=T>=0?R[T]:null,ge=k.useMemo(()=>VN((L==null?void 0:L.item)??null),[L]),ye=k.useMemo(()=>H0((L==null?void 0:L.item.metadata)??void 0),[L]),Ce=k.useMemo(()=>{const ae=Kn($);return ae||(Kn(L==null?void 0:L.item.summary)??Kn(L==null?void 0:L.item.description))},[$,L]),Te=k.useCallback(()=>{A(null)},[]);k.useEffect(()=>{W("structured")},[C]),k.useEffect(()=>{b(null),U("feed");const ae=$N((L==null?void 0:L.item)??null);if(!ae)return;const Me=new URLSearchParams({turnId:ae.turnId});ae.sessionKey&&Me.set("sessionKey",ae.sessionKey),ae.runId&&Me.set("run",ae.runId);const Z=new AbortController;return fetch(`/orgx/api/live/activity/detail?${Me.toString()}`,{method:"GET",signal:Z.signal}).then(async he=>{var ot;return he.ok?((ot=(await he.json()).detail)==null?void 0:ot.summary)??null:(he.status===404&&U("missing"),null)}).then(he=>{typeof he=="string"&&he.trim().length>0?(b(he),U("local")):U("missing")}).catch(he=>{he instanceof DOMException&&he.name==="AbortError"||U("missing")}),()=>Z.abort()},[L]),k.useEffect(()=>{O(null),oe(null);const ae=L==null?void 0:L.item;if(!ae||K)return;const Me=($??ae.summary??ae.description??ae.title??"").trim();if(!Me)return;const Z=new AbortController;return fetch("/orgx/api/live/activity/headline",{method:"POST",headers:{"Content-Type":"application/json"},signal:Z.signal,body:JSON.stringify({text:Me,title:ae.title??null,type:ae.type})}).then(async he=>he.ok?await he.json():((he.status===404||he.status===405)&&I(!0),null)).then(he=>{const $e=he==null?void 0:he.headline;typeof $e=="string"&&$e.trim().length>0&&(I(!1),O($e.trim()),oe((he==null?void 0:he.source)??null))}).catch(he=>{he instanceof DOMException&&he.name}),()=>Z.abort()},[L,$,K]);const Ae=k.useCallback(ae=>{var he;if(R.length===0)return;const Z=((T>=0?T:0)+ae+R.length)%R.length;_(ae),A(((he=R[Z])==null?void 0:he.item.id)??null)},[T,R]);k.useEffect(()=>{C&&(T>=0||A(null))},[T,C]),k.useEffect(()=>{if(!C)return;const ae=Me=>{Me.key==="ArrowRight"||Me.key.toLowerCase()==="l"?(Me.preventDefault(),Ae(1)):(Me.key==="ArrowLeft"||Me.key.toLowerCase()==="h")&&(Me.preventDefault(),Ae(-1))};return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[C,Ae]);const je=le.size===1,Fe=je?[...le][0]:null,Qe=Fe?s.find(ae=>ae.runId===Fe||ae.id===Fe)??null:null,Xt=k.useMemo(()=>je?ne.filter(ae=>ae.runId&&le.has(ae.runId)).map(ae=>ae.item):[],[je,ne,le]),$t=(ae,Me)=>{const Z=ae.item,he=FN[Z.type]??Q.iris,$e=w==="newest"&&Me<2,ot=ae.bucket,ht=ae.runId,zt=ht?J.get(ht)??Mn(ht):"Workspace",kn=Mn(Z.title??""),tr=Kn(Z.summary),_n=Kn(Z.description),Or=ro(ot),bs=Bc(ot),ee=H0(Z.metadata);return a.jsx(_e.button,{type:"button",variants:MN,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.4,0,.2,1]},layout:!0,whileHover:{y:-1.5,scale:1.005},whileTap:{scale:.995},onClick:()=>{_(1),A(Z.id)},className:"group w-full rounded-xl border border-white/[0.06] bg-white/[0.02] px-3 py-2.5 text-left transition-colors hover:border-white/[0.14] hover:bg-white/[0.04] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#BFFF00]/45","aria-label":`Open activity details for ${kn||co(Z.type)}`,children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsxs("div",{className:"mt-0.5 flex flex-col items-center gap-1.5",children:[a.jsx(So,{name:Z.agentName??"OrgX",hint:`${Z.agentId??""} ${zt} ${Z.title??""}`,size:"xs"}),a.jsx("span",{className:dt("h-2.5 w-2.5 rounded-full",$e&&"pulse-soft"),style:{backgroundColor:he,boxShadow:`0 0 16px ${he}77`}})]}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsx("p",{className:"line-clamp-2 text-[13px] text-white/90",children:kn}),a.jsx("span",{className:"text-[10px] uppercase tracking-[0.1em] text-white/35",children:co(Z.type)})]}),(tr||_n)&&a.jsx("div",{className:"mt-1 line-clamp-3 text-[11px] leading-relaxed text-white/55",children:a.jsx(xo,{mode:"inline",text:tr??_n??""})}),a.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5 text-[10px]",children:[a.jsx("span",{className:"rounded-full border px-1.5 py-0.5 uppercase tracking-[0.08em]",style:{borderColor:`${Or}66`,color:Or},children:bs}),a.jsx("span",{className:"rounded-full border border-white/[0.12] px-1.5 py-0.5 text-white/55",children:zt}),a.jsx("span",{className:"text-white/50",children:new Date(Z.timestamp).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}),a.jsx("span",{className:"text-white/50",children:un(Z.timestamp)}),ee&&a.jsx("span",{className:"text-white/35",children:"meta"})]}),a.jsxs("div",{className:"mt-1.5 inline-flex items-center gap-1 text-[10px] text-white/0 transition-colors group-hover:text-white/45",children:[a.jsx("span",{children:"Open details"}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"m9 18 6-6-6-6"})})]})]})]})},Z.id)};return a.jsxs(In,{className:"flex h-full min-h-0 flex-col card-enter",children:[je&&Xt.length>0?a.jsx(PN,{items:Xt,session:Qe,agentName:((At=Xt[0])==null?void 0:At.agentName)??null,onBack:c}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"border-b border-white/[0.06] px-4 py-3.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx("h2",{className:"text-[14px] font-semibold text-white",children:"Activity"}),a.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[a.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full opacity-75",style:{backgroundColor:Q.lime}}),a.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full",style:{backgroundColor:Q.lime}})]}),q&&a.jsxs("button",{onClick:c,className:"chip text-[11px]",children:["Session filtered",u?`: ${u}`:""]})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{type:"button",onClick:()=>j(ae=>ae==="newest"?"oldest":"newest"),className:"rounded-md border border-white/[0.1] bg-white/[0.03] px-2 py-1 text-[10px] text-white/60 transition-colors hover:text-white","aria-label":w==="newest"?"Sort oldest first":"Sort newest first",children:w==="newest"?"New→Old":"Old→New"}),a.jsx("button",{type:"button",onClick:()=>x(ae=>!ae),className:"rounded-md border border-white/[0.1] bg-white/[0.03] px-2 py-1 text-[10px] text-white/55 transition-colors hover:text-white","aria-pressed":m,children:m?"Expand":"Collapse"})]})]}),a.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[a.jsxs("div",{className:"relative min-w-0 flex-1",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-white/35",children:[a.jsx("circle",{cx:"11",cy:"11",r:"7"}),a.jsx("path",{d:"m20 20-3.5-3.5"})]}),a.jsx("input",{value:g,onChange:ae=>y(ae.target.value),placeholder:"Search activity...",className:"w-full rounded-lg border border-white/[0.1] bg-black/30 py-1.5 pl-9 pr-2 text-[12px] text-white/80 placeholder:text-white/35 focus:outline-none focus:ring-1 focus:ring-[#BFFF00]/30","aria-label":"Search activity"})]}),a.jsx("div",{className:"flex flex-shrink-0 items-center gap-1",role:"group","aria-label":"Activity filters",children:Object.keys(Oc).map(ae=>a.jsx("button",{type:"button",onClick:()=>f(ae),"aria-pressed":h===ae,className:dt("rounded-full px-2 py-1 text-[10px] font-medium transition-all duration-200",h===ae?"border border-lime/25 bg-lime/[0.12] text-lime shadow-[0_0_10px_rgba(191,255,0,0.08)]":"border border-transparent bg-white/[0.03] text-white/60 hover:bg-white/[0.06] hover:text-white/80"),children:Oc[ae]},ae))})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3",children:[R.length===0&&a.jsxs("div",{className:"flex flex-col items-center gap-2.5 rounded-xl border border-white/[0.06] bg-white/[0.02] px-3 py-6 text-center",children:[a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/25",children:a.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),a.jsx("p",{className:"text-[12px] text-white/45",children:q?`No ${Oc[h].toLowerCase()} for the selected session.`:"No matching activity right now."}),q&&a.jsx("button",{onClick:c,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]",children:"Show all sessions"})]}),R.length>0&&a.jsxs("div",{className:"space-y-4",children:[Y.map(ae=>{const Me=m?ae.items.slice(0,4):ae.items;return a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2.5 border-b border-white/[0.06] pb-1.5 text-[11px] uppercase tracking-[0.12em] text-white/35",children:ae.label}),a.jsx(Ir,{mode:"popLayout",children:a.jsx("div",{className:"space-y-2",children:Me.map((Z,he)=>$t(Z,he))})}),m&&ae.items.length>Me.length&&a.jsxs("p",{className:"mt-1.5 text-[11px] text-white/35",children:["+",ae.items.length-Me.length," more"]})]},ae.key)}),X>0&&a.jsxs("p",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] px-3 py-2 text-[11px] text-white/45",children:["Showing latest ",R.length," events (",X," older events omitted for smooth rendering)."]})]})]})]}),a.jsx(lh,{open:L!==null,onClose:Te,maxWidth:"max-w-3xl",children:L&&a.jsxs("div",{className:"relative flex h-[100dvh] w-full min-h-0 flex-col sm:h-[86vh] sm:max-h-[86vh]",children:[a.jsx("div",{className:"absolute inset-x-0 top-0 h-20 bg-gradient-to-b from-lime/10 via-cyan/5 to-transparent"}),a.jsxs("div",{className:"relative z-10 flex items-center justify-between border-b border-white/[0.06] px-5 py-4 sm:px-6",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-[11px] uppercase tracking-[0.12em] text-white/40",children:"Activity Detail"}),a.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[a.jsx("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:ro(L.bucket),boxShadow:`0 0 16px ${ro(L.bucket)}77`}}),a.jsxs("span",{className:"text-[12px] text-white/70",children:[Bc(L.bucket)," · ",T+1,"/",R.length]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{type:"button",onClick:()=>Ae(-1),className:"rounded-full border border-white/[0.12] bg-white/[0.04] px-2.5 py-1 text-[11px] text-white/70 transition hover:bg-white/[0.1]","aria-label":"Previous activity item",children:"← Prev"}),a.jsx("button",{type:"button",onClick:()=>Ae(1),className:"rounded-full border border-white/[0.12] bg-white/[0.04] px-2.5 py-1 text-[11px] text-white/70 transition hover:bg-white/[0.1]","aria-label":"Next activity item",children:"Next →"}),a.jsx("button",{type:"button",onClick:Te,className:"rounded-full border border-white/[0.12] bg-white/[0.04] px-2 py-1 text-[11px] text-white/60 transition hover:bg-white/[0.1] hover:text-white/90","aria-label":"Close activity detail",children:"Esc"})]})]}),a.jsx("div",{className:"relative min-h-0 flex-1 overflow-x-hidden overflow-y-auto px-5 pb-5 pt-4 sm:px-6",children:a.jsx(Ir,{mode:"wait",custom:N,children:a.jsx(_e.section,{custom:N,initial:{opacity:0,x:N*44,scale:.985},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:N*-32,scale:.985},transition:{duration:.28,ease:[.16,1,.3,1]},className:"min-h-full w-full overscroll-contain",children:a.jsxs("div",{className:"space-y-4 pb-1",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-[20px] font-semibold tracking-[-0.02em] text-white whitespace-pre-wrap break-words",children:D||zN(L.item,$)||Mn(L.item.title||co(L.item.type))}),a.jsxs("p",{className:"mt-1 flex flex-wrap items-center gap-x-2 text-[12px] text-white/45",children:[new Date(L.item.timestamp).toLocaleString()," · ",un(L.item.timestamp),G==="llm"&&a.jsx("span",{className:"text-white/35",children:"· AI title"})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1.5 text-[11px]",children:[a.jsx("span",{className:"rounded-full border px-2 py-0.5 uppercase tracking-[0.1em]",style:{borderColor:`${ro(L.bucket)}55`,color:ro(L.bucket)},children:Bc(L.bucket)}),a.jsx("span",{className:"rounded-full border border-white/[0.12] px-2 py-0.5 text-white/65",children:co(L.item.type)}),L.item.agentName&&a.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-white/[0.12] px-1.5 py-0.5 text-white/65",children:[a.jsx(So,{name:L.item.agentName,hint:`${L.item.agentId??""} ${L.item.title??""}`,size:"xs"}),a.jsx("span",{children:L.item.agentName})]}),L.runId&&a.jsx("span",{className:"rounded-full border border-white/[0.12] px-2 py-0.5 text-white/65",children:J.get(L.runId)??Mn(L.runId)})]}),Ce&&a.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.03] p-3",children:[a.jsx("p",{className:"text-[11px] uppercase tracking-[0.11em] text-white/45",children:"Summary"}),F==="missing"&&a.jsx("p",{className:"mt-1 text-[11px] text-amber-200/75",children:"Full local turn transcript was unavailable; showing the event summary payload."}),a.jsx(xo,{mode:"block",text:Ce,className:"mt-1.5 text-[14px] leading-relaxed text-white/82"})]}),Kn(L.item.description)&&a.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-black/25 p-3",children:[a.jsx("p",{className:"text-[11px] uppercase tracking-[0.11em] text-white/45",children:"Details"}),a.jsx(xo,{mode:"block",text:Kn(L.item.description)??"",className:"mt-1.5 text-[13px] leading-relaxed text-white/75"})]}),ge&&a.jsxs("div",{className:"rounded-xl border border-cyan-400/20 bg-cyan-500/[0.06] p-3",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("p",{className:"text-[11px] uppercase tracking-[0.11em] text-cyan-100/85",children:"Artifact Output"}),a.jsxs("div",{className:"inline-flex rounded-full border border-white/[0.12] bg-black/30 p-0.5 text-[11px]",children:[a.jsx("button",{type:"button",onClick:()=>W("structured"),"aria-pressed":B==="structured",className:`rounded-full px-2.5 py-0.5 transition-colors ${B==="structured"?"bg-white/[0.12] text-white":"text-white/55 hover:text-white/80"}`,children:"Structured"}),a.jsx("button",{type:"button",onClick:()=>W("json"),"aria-pressed":B==="json",className:`rounded-full px-2.5 py-0.5 transition-colors ${B==="json"?"bg-white/[0.12] text-white":"text-white/55 hover:text-white/80"}`,children:"JSON"})]})]}),a.jsxs("p",{className:"mt-1 text-[10px] text-cyan-100/55",children:["Source: ",ge.source]}),a.jsx("div",{className:"mt-2",children:B==="structured"?sy(ge.value):a.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap font-mono text-[11px] leading-relaxed text-white/70",children:JSON.stringify(ge.value,null,2)})})]}),ye&&a.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-black/35 p-3",children:[a.jsx("p",{className:"text-[11px] uppercase tracking-[0.11em] text-white/45",children:"Metadata"}),a.jsx("pre",{className:"mt-1.5 overflow-x-auto whitespace-pre-wrap font-mono text-[11px] leading-relaxed text-white/65",children:ye})]})]})},L.item.id)})}),a.jsx("div",{className:"border-t border-white/[0.06] px-5 py-2.5 text-[11px] text-white/40 sm:px-6",children:"Keyboard: ← previous · → next · Esc close"})]})})]})});function WN(t){return t>=15?{border:Q.red,glow:`0 0 16px ${Q.red}20`}:t>=5?{border:Q.amber,glow:`0 0 12px ${Q.amber}18`}:{border:Q.teal,glow:"none"}}const HN=k.memo(function({decisions:n,onApproveDecision:s,onApproveAll:o}){const[u,c]=k.useState(!1),[h,f]=k.useState(new Set),[m,x]=k.useState(new Set),[g,y]=k.useState(null),w=k.useMemo(()=>[...n].sort((b,F)=>{if(b.waitingMinutes!==F.waitingMinutes)return F.waitingMinutes-b.waitingMinutes;const U=Date.parse(b.requestedAt??b.updatedAt??""),D=Date.parse(F.requestedAt??F.updatedAt??""),O=Number.isFinite(U)?U:0;return(Number.isFinite(D)?D:0)-O}),[n]);k.useEffect(()=>{x(b=>{const F=new Set(w.map(D=>D.id)),U=new Set;for(const D of b)F.has(D)&&U.add(D);return U})},[w]);const j=m.size,C=w.length>0&&j===w.length,A=b=>{x(F=>{const U=new Set(F);return U.has(b)?U.delete(b):U.add(b),U})},N=()=>{x(b=>w.length===0?b:b.size===w.length?new Set:new Set(w.map(F=>F.id)))},_=async()=>{if(!(w.length===0||u)){y(null),c(!0);try{const b=await o();b.failed>0?y(`Approved ${b.updated}; ${b.failed} failed.`):b.updated>0?y(`Approved ${b.updated} decision${b.updated===1?"":"s"}.`):y("No decisions were updated."),x(new Set)}catch(b){y(b instanceof Error?b.message:"Bulk approval failed.")}finally{c(!1)}}},B=async()=>{if(j===0||u)return;y(null),c(!0);let b=0,F=0;try{const U=w.map(D=>D.id).filter(D=>m.has(D));for(const D of U){f(O=>new Set(O).add(D));try{const O=await s(D);b+=O.updated,F+=O.failed}catch{F+=1}finally{f(O=>{const G=new Set(O);return G.delete(D),G})}}F>0?y(`Approved ${b}; ${F} failed.`):y(`Approved ${b} selected decision${b===1?"":"s"}.`),x(new Set)}finally{c(!1)}},W=async b=>{if(!(h.has(b)||u)){y(null),f(F=>{const U=new Set(F);return U.add(b),U});try{const F=await s(b);F.failed>0?y(`Approval failed for ${F.failed} decision.`):F.updated>0&&y("Decision approved.")}catch(F){y(F instanceof Error?F.message:"Decision approval failed.")}finally{f(F=>{const U=new Set(F);return U.delete(b),U}),x(F=>{if(!F.has(b))return F;const U=new Set(F);return U.delete(b),U})}}},$=g!==null&&!g.toLowerCase().includes("fail");return a.jsxs(In,{className:"flex h-full min-h-0 flex-col card-enter",children:[a.jsxs("div",{className:"space-y-2 border-b border-white/[0.06] px-4 py-3.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-[14px] font-semibold text-white",children:"Decisions"}),a.jsx("p",{className:"text-[12px] text-white/45",children:"Select multiple items to bulk review and approve"})]}),a.jsx("button",{onClick:_,disabled:w.length===0||u,className:"rounded-lg px-3 py-1.5 text-[11px] font-semibold transition-colors",style:{backgroundColor:w.length===0||u?"rgba(255,255,255,0.08)":Q.lime,color:w.length===0||u?"rgba(255,255,255,0.45)":"#000"},children:u?"Approving…":`Approve all (${w.length})`})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("button",{onClick:N,disabled:w.length===0||u,className:"rounded-md border border-white/[0.12] bg-white/[0.03] px-2.5 py-1.5 text-[11px] text-white/70 transition-colors hover:bg-white/[0.07] disabled:opacity-45",children:C?"Clear all":"Select all"}),a.jsx("button",{onClick:B,disabled:j===0||u,className:"rounded-md border border-lime/25 bg-lime/10 px-2.5 py-1.5 text-[11px] font-semibold text-lime transition-colors hover:bg-lime/20 disabled:opacity-45",children:u?"Approving…":`Approve selected (${j})`}),a.jsx("span",{className:"text-[11px] text-white/45",children:j>0?`${j} selected`:"No selection"})]})]}),a.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-3",children:[w.length===0&&a.jsxs("div",{className:"flex flex-col items-center gap-2.5 rounded-xl border border-white/[0.06] bg-white/[0.02] p-4 text-center",children:[a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/25",children:[a.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),a.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),a.jsx("p",{className:"text-[12px] text-white/45",children:"No pending decisions. All clear."})]}),a.jsx(Ir,{mode:"popLayout",children:w.map(b=>{const F=h.has(b.id),U=WN(b.waitingMinutes),D=m.has(b.id);return a.jsx(_e.article,{initial:{opacity:0,y:8,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.25,ease:[.4,0,.2,1]},layout:!0,className:"rounded-xl border bg-white/[0.03] px-3 py-2.5 transition-[border-color,box-shadow]",style:{borderColor:D?`${Q.lime}50`:`${U.border}35`,borderLeftWidth:3,borderLeftColor:`${U.border}80`,boxShadow:U.glow},children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx("input",{type:"checkbox",checked:D,onChange:()=>A(b.id),disabled:F||u,className:"mt-0.5 h-4 w-4 rounded border-white/20 bg-black/40 text-lime focus:ring-lime/40"}),a.jsx("div",{className:"min-w-0 flex-1",children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-[13px] font-medium text-white",children:b.title}),b.context&&a.jsx("p",{className:"mt-1 line-clamp-2 text-[11px] text-white/55",children:b.context}),a.jsxs("p",{className:"mt-1.5 text-[10px] text-white/40",children:[b.agentName??"System"," · Waiting ",b.waitingMinutes,"m",b.requestedAt?` · ${un(b.requestedAt)}`:""]})]}),a.jsx("button",{onClick:()=>W(b.id),disabled:F||u,className:"rounded-md border border-lime/25 bg-lime/10 px-3 py-1.5 text-[11px] font-semibold text-lime transition-colors hover:bg-lime/20 disabled:cursor-not-allowed disabled:border-white/10 disabled:bg-white/[0.08] disabled:text-white/45",children:F?"Approving…":"Approve"})]})})]})},b.id)})})]}),g&&a.jsxs("div",{className:"flex items-center gap-2 border-t border-white/[0.06] px-4 py-2.5 text-[12px] text-white/55",children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:$?"text-lime":"text-amber-400",children:$?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),a.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),a.jsx("line",{x1:"12",x2:"12",y1:"9",y2:"13"}),a.jsx("line",{x1:"12",x2:"12.01",y1:"17",y2:"17"})]})}),g]})]})});function iy({value:t,onChange:n,placeholder:s}){return a.jsxs("label",{className:"relative block",children:[a.jsx("span",{className:"sr-only",children:s}),a.jsxs("svg",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-white/35",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"11",cy:"11",r:"8"}),a.jsx("path",{d:"m21 21-4.3-4.3"})]}),a.jsx("input",{type:"text",value:t,onChange:o=>n(o.target.value),placeholder:s,className:"w-full rounded-xl border border-white/[0.08] bg-white/[0.03] py-2.5 pl-10 pr-8 text-[13px] text-white placeholder:text-white/35 transition-all focus:border-[#BFFF00]/30 focus:bg-white/[0.05] focus:outline-none"}),t.length>0&&a.jsx("button",{type:"button",onClick:()=>n(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 rounded-full p-0.5 text-white/40 transition-colors hover:text-white/70","aria-label":"Clear search",children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:a.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]})}function KN(t,n){if(t.length===0)return 0;if(n>=t.length-1&&t.every(u=>u.status==="completed"))return 100;const s=n/Math.max(1,t.length-1)*100,o=t[n];return o?o.status==="completed"?Math.min(100,s+100/t.length):o.status==="current"||o.status==="warning"?Math.min(100,s+50/t.length):s:s}function QN({phases:t,currentPhase:n,health:s}){const o=KN(t,n);return a.jsxs("div",{className:"space-y-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between text-[9px] uppercase tracking-[0.1em] text-white/38",children:[a.jsx("span",{children:"Momentum"}),a.jsxs("span",{children:[Math.round(s??o),"%"]})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"h-2 rounded-full bg-white/[0.08]"}),a.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:`${Math.max(0,Math.min(100,o))}%`,background:`linear-gradient(90deg, ${Q.lime}, ${Q.teal})`,boxShadow:`0 0 18px ${Q.teal}45`}}),t.map((u,c)=>{const h=c/Math.max(1,t.length-1)*100,f=u.status==="completed",m=u.status==="current",x=u.status==="warning";return a.jsx("div",{className:"absolute top-1/2 z-10 -translate-y-1/2",style:{left:`${h}%`,transform:"translate(-50%, -50%)"},children:a.jsx("div",{className:dt("flex h-4 w-4 items-center justify-center rounded-full border text-[9px] font-semibold",f&&"border-lime/80 bg-lime text-black",m&&"border-lime/60 bg-lime/30 text-lime",x&&"border-amber-300/70 bg-amber-300 text-black",!f&&!m&&!x&&"border-white/20 bg-black/60 text-white/45"),children:f?"✓":x?"!":""})},u.name)})]}),a.jsx("div",{className:"grid gap-1",style:{gridTemplateColumns:`repeat(${Math.max(t.length,1)}, minmax(0, 1fr))`},children:t.map(u=>a.jsx("span",{className:dt("truncate text-[8px] uppercase tracking-[0.12em]",u.status==="completed"||u.status==="current"?"text-white/60":"text-white/30"),children:u.name},u.name))})]})}function GN({names:t}){return a.jsx("div",{className:"flex -space-x-1.5",children:t.slice(0,3).map((n,s)=>a.jsx("div",{className:"relative",style:{zIndex:t.length-s},children:a.jsx(So,{name:n,size:"xs"})},`${n}-${s}`))})}function qN(t){return t==="blocked"?{text:"Watch",className:"border-amber-300/45 bg-amber-300/10 text-amber-200"}:t==="completed"?{text:"Done",className:"border-lime/45 bg-lime/15 text-lime"}:t==="paused"?{text:"Paused",className:"border-white/20 bg-white/[0.04] text-white/60"}:{text:"In Motion",className:"border-teal/45 bg-teal/10 text-teal"}}function XN({initiative:t,onClick:n}){var f;const s=t.phases??[],o=t.currentPhase??0,u=t.avatars??[],c=qN(t.status),h=((f=t.workstreams)==null?void 0:f.length)??0;return a.jsxs("button",{onClick:n,className:"w-full rounded-xl border border-white/[0.08] bg-[linear-gradient(150deg,rgba(20,184,166,0.15),rgba(2,4,10,0.7)_42%,rgba(2,4,10,0.95))] p-3 text-left transition-all duration-200 hover:border-white/[0.16] hover:bg-[linear-gradient(150deg,rgba(20,184,166,0.22),rgba(2,4,10,0.72)_42%,rgba(2,4,10,0.95))]",children:[a.jsxs("div",{className:"mb-2 flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[u.length>0&&a.jsx(GN,{names:u}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsx("span",{className:`rounded-full border px-1.5 py-0.5 text-[10px] uppercase tracking-[0.1em] ${c.className}`,children:c.text}),a.jsx("span",{className:"rounded-full border border-white/[0.16] bg-white/[0.03] px-1.5 py-0.5 text-[10px] uppercase tracking-[0.1em] text-white/60",children:t.category??"Program"})]}),a.jsx("h4",{className:"mt-1 text-[13px] font-semibold text-white",children:t.name})]})]}),a.jsxs("span",{className:"text-[12px] text-white/45",style:{fontVariantNumeric:"tabular-nums"},children:[t.health,"%"]})]}),t.description&&a.jsx("p",{className:"mb-2 line-clamp-2 text-[11px] text-white/65",children:t.description}),s.length>0&&a.jsx(QN,{phases:s,currentPhase:o,health:t.health}),a.jsxs("div",{className:"mt-2.5 grid grid-cols-3 gap-1.5 text-[10px] uppercase tracking-[0.08em]",children:[a.jsxs("div",{className:"rounded-md border border-white/[0.1] bg-black/25 px-2 py-1.5",children:[a.jsx("p",{className:"text-white/35",children:"Live Streams"}),a.jsx("p",{className:"text-[12px] font-semibold text-white",children:t.activeAgents})]}),a.jsxs("div",{className:"rounded-md border border-white/[0.1] bg-black/25 px-2 py-1.5",children:[a.jsx("p",{className:"text-white/35",children:"Total Streams"}),a.jsx("p",{className:"text-[12px] font-semibold text-white",children:t.totalAgents})]}),a.jsxs("div",{className:"rounded-md border border-white/[0.1] bg-black/25 px-2 py-1.5",children:[a.jsx("p",{className:"text-white/35",children:"Workstreams"}),a.jsx("p",{className:"text-[12px] font-semibold text-white",children:h})]})]})]})}function YN({initiatives:t,onInitiativeClick:n,onCreateInitiative:s,onCreateWorkstream:o}){const[u,c]=k.useState(""),[h,f]=k.useState(0),[m,x]=k.useState(null),g=3,y=k.useMemo(()=>t.filter(N=>N.name.toLowerCase().includes(u.toLowerCase())),[t,u]),w=Math.max(1,Math.ceil(y.length/g)),j=Math.min(h,Math.max(0,w-1)),C=y.slice(j*g,(j+1)*g),A=async(N,_)=>{if(!(!_||m)){x(N);try{await _()}finally{x(null)}}};return a.jsxs(In,{className:"flex h-full min-h-0 flex-1 flex-col card-enter",children:[a.jsxs("div",{className:"flex-shrink-0 space-y-2 border-b border-white/[0.06] px-4 py-3.5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[14px] font-semibold text-white",children:"Initiatives"}),a.jsx("span",{className:"text-[12px] text-white/35",children:t.length})]}),a.jsx(iy,{value:u,onChange:N=>{c(N),f(0)},placeholder:"Search initiatives..."}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsx("button",{onClick:()=>A("initiative",s),disabled:!s||m!==null,className:"rounded-md border border-lime/25 bg-lime/10 px-2.5 py-1.5 text-[11px] font-semibold text-lime transition-colors hover:bg-lime/20 disabled:opacity-45",children:m==="initiative"?"Creating…":"Start initiative"}),a.jsx("button",{onClick:()=>A("workstream",o),disabled:!o||m!==null,className:"rounded-md border border-white/[0.12] bg-white/[0.03] px-2.5 py-1.5 text-[11px] text-white/75 transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:m==="workstream"?"Creating…":"Start workstream"})]})]}),a.jsxs("div",{className:"flex-1 space-y-2 overflow-y-auto p-3",children:[C.length===0&&a.jsxs("div",{className:"flex flex-col items-center gap-2.5 rounded-xl border border-white/[0.06] bg-white/[0.02] p-4 text-center",children:[a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/25",children:[a.jsx("path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"}),a.jsx("path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"})]}),a.jsx("p",{className:"text-[12px] text-white/45",children:t.length===0?"No active initiatives yet. Start one above.":"No initiatives match this search."})]}),C.map(N=>a.jsx(XN,{initiative:N,onClick:()=>n(N)},N.id))]}),w>1&&a.jsx("div",{className:"flex-shrink-0 border-t border-white/[0.06] px-4 py-2.5",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("button",{onClick:()=>f(Math.max(0,j-1)),disabled:j===0,className:"rounded p-1.5 text-white/45 transition-colors hover:text-white disabled:opacity-30",children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"m15 18-6-6 6-6"})})}),a.jsx("div",{className:"flex items-center gap-1.5",children:Array.from({length:w}).map((N,_)=>a.jsx("button",{type:"button",onClick:()=>f(_),"aria-label":`Page ${_+1}`,className:"rounded-full p-1 transition-colors",children:a.jsx("span",{className:"block h-2.5 w-2.5 rounded-full transition-colors",style:{backgroundColor:_===j?Q.lime:"rgba(255,255,255,0.25)"}})},_))}),a.jsx("button",{onClick:()=>f(Math.min(w-1,j+1)),disabled:j>=w-1,className:"rounded p-1.5 text-white/45 transition-colors hover:text-white disabled:opacity-30",children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"m9 18 6-6-6-6"})})})]})})]})}function ZN({activities:t,agents:n,initiatives:s}){return k.useMemo(()=>{const o=new Map,u=(c,h,f,m)=>{const x=o.get(c)??[];x.some(g=>g.id===h)||(x.push({id:h,name:f,confidence:m}),o.set(c,x))};return t.forEach(c=>{const h="metadata"in c&&c.metadata&&typeof c.metadata=="object"?c.metadata:null,f=h&&typeof h=="object"?h:{},m=("initiativeId"in c&&typeof c.initiativeId=="string"?c.initiativeId:void 0)??f.initiativeId??void 0,x=c.agentId??void 0,g=("agentName"in c&&typeof c.agentName=="string"?c.agentName:"agent"in c&&typeof c.agent=="string"?c.agent:void 0)??x??"Unknown";m&&x&&u(m,x,g,"high")}),s.forEach(c=>{var h;(h=c.avatars)!=null&&h.length&&c.avatars.forEach(f=>{const m=n.find(x=>x.name.toLowerCase()===f.toLowerCase());m?u(c.id,m.id,m.name,"medium"):u(c.id,`avatar:${f}`,f,"medium")})}),n.forEach(c=>{if(!c.task)return;const h=c.task.toLowerCase();s.forEach(f=>{f.name.toLowerCase().split(/\s+/).filter(y=>y.length>3).some(y=>h.includes(y))&&u(f.id,c.id,c.name,"low")})}),o},[t,n,s])}function Co({className:t=""}){return a.jsx("div",{className:dt("shimmer-skeleton",t),"aria-hidden":"true"})}function JN(t){const n={"Content-Type":"application/json"};return t.embedMode&&(n["X-Orgx-Embed"]="true"),t.authToken&&(n.Authorization=`Bearer ${t.authToken}`),n}async function Ja(t){if(!t.ok){const n=await t.json().catch(()=>null),s=typeof(n==null?void 0:n.error)=="string"&&n.error||typeof(n==null?void 0:n.message)=="string"&&n.message||`Request failed (${t.status})`;throw new Error(s)}return t}function eS(t){const n=Ad(),s=JN(t),o=()=>{n.invalidateQueries({queryKey:["live-data"]}),n.invalidateQueries({queryKey:["initiative-details"]}),n.invalidateQueries({queryKey:["entities"]}),n.invalidateQueries({queryKey:["mission-control-graph"]})},u=Ka({mutationFn:async m=>{const{type:x,...g}=m,y=await fetch("/orgx/api/entities",{method:"POST",headers:s,body:JSON.stringify({type:x,...g})});return await Ja(y),y.json()},onSuccess:o}),c=Ka({mutationFn:async m=>{const{type:x,id:g,...y}=m,w=await fetch("/orgx/api/entities",{method:"PATCH",headers:s,body:JSON.stringify({type:x,id:g,...y})});return await Ja(w),w.json()},onSuccess:o}),h=Ka({mutationFn:async m=>{const x=await fetch(`/orgx/api/entities/${encodeURIComponent(m.type)}/${encodeURIComponent(m.id)}/delete`,{method:"POST",headers:s,body:"{}"});return await Ja(x),x.json()},onSuccess:o}),f=Ka({mutationFn:async m=>{const x=await fetch(`/orgx/api/entities/${encodeURIComponent(m.type)}/${encodeURIComponent(m.id)}/${encodeURIComponent(m.action)}`,{method:"POST",headers:s,body:JSON.stringify({force:m.force??!1})});return await Ja(x),x.json()},onSuccess:o});return{createEntity:u,updateEntity:c,deleteEntity:h,entityAction:f}}const oy=k.createContext(null);function ws(){const t=k.useContext(oy);if(!t)throw new Error("useMissionControl must be used within MissionControlProvider");return t}function tS({children:t,agentEntityMap:n,authToken:s,embedMode:o}){const[u,c]=k.useState(new Set),[h,f]=k.useState(null),[m,x]=k.useState(""),[g,y]=k.useState([]),[w,j]=k.useState("target"),[C,A]=k.useState("any"),[N,_]=k.useState(""),[B,W]=k.useState(""),[$,b]=k.useState("status"),[F,U]=k.useState("default"),D=eS({authToken:s,embedMode:o}),O=k.useCallback(Y=>{c(T=>{const L=new Set(T);return L.has(Y)?L.delete(Y):L.add(Y),L})},[]),G=k.useCallback(Y=>{c(T=>{if(T.has(Y))return T;const L=new Set(T);return L.add(Y),L})},[]),oe=k.useCallback(Y=>{c(new Set(Y))},[]),K=k.useCallback(()=>{c(new Set)},[]),I=k.useCallback(Y=>{f(Y)},[]),J=k.useCallback(()=>{f(null)},[]),ne=k.useCallback(Y=>{y(T=>{const L=Y.trim().toLowerCase();return L?T.includes(L)?T.filter(ge=>ge!==L):[...T,L]:T})},[]),le=k.useCallback(()=>{x(""),y([]),j("target"),A("any"),_(""),W("")},[]),q=g.length+(w!=="target"?1:0)+(C!=="any"?1:0),R=m.trim().length>0||q>0,X=k.useMemo(()=>({agentEntityMap:n,expandedInitiatives:u,modalTarget:h,searchQuery:m,statusFilters:g,dateField:w,datePreset:C,dateStart:N,dateEnd:B,activeFilterCount:q,hasActiveFilters:R,groupBy:$,sortBy:F,authToken:s,embedMode:o,mutations:D,toggleExpanded:O,expandInitiative:G,expandAll:oe,collapseAll:K,openModal:I,closeModal:J,setSearchQuery:x,setStatusFilters:y,toggleStatusFilter:ne,setDateField:j,setDatePreset:A,setDateStart:_,setDateEnd:W,setGroupBy:b,setSortBy:U,clearFilters:le}),[n,u,h,m,g,w,C,N,B,q,R,$,F,s,o,D,O,G,oe,K,I,J,y,ne,j,A,_,W,b,U,le]);return a.jsx(oy.Provider,{value:X,children:t})}const ay={active:"text-[#BFFF00] bg-[#BFFF00]/10 border-[#BFFF00]/20",paused:"text-[#F5B700] bg-[#F5B700]/10 border-[#F5B700]/20",blocked:"text-[#FF6B88] bg-[#FF6B88]/10 border-[#FF6B88]/20",completed:"text-[#14B8A6] bg-[#14B8A6]/10 border-[#14B8A6]/20"},nS={done:"text-[#14B8A6] bg-[#14B8A6]/10 border-[#14B8A6]/20",completed:"text-[#14B8A6] bg-[#14B8A6]/10 border-[#14B8A6]/20",in_progress:"text-[#BFFF00] bg-[#BFFF00]/10 border-[#BFFF00]/20",active:"text-[#BFFF00] bg-[#BFFF00]/10 border-[#BFFF00]/20",blocked:"text-[#FF6B88] bg-[#FF6B88]/10 border-[#FF6B88]/20",todo:"text-white/60 bg-white/5 border-white/10"},ch=t=>nS[t.toLowerCase()]??"text-white/60 bg-white/5 border-white/10",ly=t=>{const n=t.toLowerCase();return n==="active"||n==="in_progress"?"text-[#BFFF00] bg-[#BFFF00]/10 border-[#BFFF00]/20":n==="blocked"?"text-[#FF6B88] bg-[#FF6B88]/10 border-[#FF6B88]/20":n==="completed"||n==="done"?"text-[#14B8A6] bg-[#14B8A6]/10 border-[#14B8A6]/20":"text-white/60 bg-white/5 border-white/10"},uy=t=>{const n=t.toLowerCase();return n==="done"||n==="completed"?"text-[#14B8A6] bg-[#14B8A6]/10 border-[#14B8A6]/20":n==="active"||n==="in_progress"?"text-[#BFFF00] bg-[#BFFF00]/10 border-[#BFFF00]/20":"text-white/60 bg-white/5 border-white/10"},cn=t=>t.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase()),Q0=t=>{const n=t.toLowerCase();return n==="blocked"?0:n==="in_progress"||n==="active"?1:n==="todo"||n==="planned"?2:n==="done"||n==="completed"?3:4},G0=t=>{const n=t.toLowerCase();return n==="blocked"?Q.red:n==="active"||n==="in_progress"?Q.lime:n==="done"||n==="completed"?Q.teal:n==="paused"?Q.amber:"rgba(255,255,255,0.35)"};function rS(t){if(!t)return null;const n=Date.parse(t);if(!Number.isFinite(n))return null;const s=new Date,o=new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime(),u=new Date(n),c=new Date(u.getFullYear(),u.getMonth(),u.getDate()).getTime();return Math.round((c-o)/864e5)}function sS(t){const n=rS(t);return n===null?{label:"No target date",tone:"neutral"}:n<0?{label:`Overdue ${Math.abs(n)}d`,tone:"danger"}:n===0?{label:"Due today",tone:"warning"}:n<=7?{label:`Due in ${n}d`,tone:"warning"}:{label:`Due in ${n}d`,tone:"success"}}function Cl({agents:t,max:n=4}){if(!t.length)return null;const s=t.slice(0,n),o=t.length-n;return a.jsxs("div",{className:"flex items-center -space-x-1.5",children:[s.map(u=>a.jsx("div",{className:"relative",title:`${u.name} (${u.confidence} confidence)`,style:{borderRadius:"9999px",border:u.confidence==="high"?"1.5px solid rgba(255,255,255,0.25)":u.confidence==="medium"?"1.5px dashed rgba(255,255,255,0.15)":"1.5px dotted rgba(255,255,255,0.10)"},children:a.jsx(So,{name:u.name,size:"xs"})},u.id)),o>0&&a.jsxs("span",{className:"ml-1 text-[9px] text-white/40",children:["+",o]})]})}const Al={liveData:t=>["live-data",{authToken:t.authToken??null,embedMode:t.embedMode??!1,useMock:t.useMock??!1}],sessions:t=>["sessions",{activeMinutes:t.activeMinutes??null,limit:t.limit??null,authToken:t.authToken??null,embedMode:t.embedMode??!1}],initiativeDetails:t=>["initiative-details",{initiativeId:t.initiativeId,authToken:t.authToken??null,embedMode:t.embedMode??!1}],entities:t=>["entities",{type:t.type,authToken:t.authToken??null,embedMode:t.embedMode??!1}],missionControlGraph:t=>["mission-control-graph",{initiativeId:t.initiativeId,authToken:t.authToken??null,embedMode:t.embedMode??!1}],liveInitiatives:t=>["live-initiatives",{limit:(t==null?void 0:t.limit)??300}]};function q0(t){return{initiative:{id:t,title:"Initiative",status:"active",summary:null,assignedAgents:[]},nodes:[],edges:[],recentTodos:[]}}function iS({initiativeId:t,authToken:n=null,embedMode:s=!1,enabled:o=!0}){var f,m;const u=k.useMemo(()=>Al.missionControlGraph({initiativeId:t,authToken:n,embedMode:s}),[t,n,s]),c=yl({queryKey:u,enabled:o&&!!t,queryFn:async()=>{if(!t)throw new Error("initiativeId is required");const x=new URLSearchParams({initiative_id:t}),g={};s&&(g["X-Orgx-Embed"]="true"),n&&(g.Authorization=`Bearer ${n}`);const y=Object.keys(g).length>0?g:void 0,w=await fetch(`/orgx/api/mission-control/graph?${x.toString()}`,{headers:y});if(!w.ok){const j=await w.json().catch(()=>null),C=typeof(j==null?void 0:j.error)=="string"&&j.error||typeof(j==null?void 0:j.message)=="string"&&j.message||`Failed to fetch Mission Control graph (${w.status})`;return console.warn(`[useMissionControlGraph] ${C}`),{...q0(t),degraded:[C]}}return await w.json()}});return{graph:c.data??(t?q0(t):null),isLoading:c.isLoading,error:((f=c.error)==null?void 0:f.message)??null,degraded:((m=c.data)==null?void 0:m.degraded)??[],refetch:c.refetch}}const Vc={initiativeId:"",workstreams:[],milestones:[],tasks:[]},oS=(t,n)=>({id:t.id,name:t.name??"Untitled workstream",summary:t.summary??null,status:t.status??"planned",progress:typeof t.progress=="number"&&!Number.isNaN(t.progress)?Math.max(0,Math.min(100,t.progress<=1?t.progress*100:t.progress)):null,initiativeId:t.initiative_id??n,createdAt:t.created_at??null}),aS=(t,n)=>({id:t.id,title:t.title??"Untitled milestone",description:t.description??null,status:t.status??"planned",dueDate:t.due_date??null,initiativeId:t.initiative_id??n,workstreamId:t.workstream_id??null,createdAt:t.created_at??null}),lS=(t,n)=>({id:t.id,title:t.title??"Untitled task",description:t.description??null,status:t.status??"todo",priority:t.priority??null,dueDate:t.due_date??null,initiativeId:t.initiative_id??n,milestoneId:t.milestone_id??null,workstreamId:t.workstream_id??null,createdAt:t.created_at??null});function El({initiativeId:t,authToken:n=null,embedMode:s=!1,enabled:o=!0}){var h;const u=k.useMemo(()=>Al.initiativeDetails({initiativeId:t,authToken:n,embedMode:s}),[t,n,s]),c=yl({queryKey:u,enabled:o&&!!t,queryFn:async()=>{if(!t)return Vc;const f={};s&&(f["X-Orgx-Embed"]="true"),n&&(f.Authorization=`Bearer ${n}`);const m=Object.keys(f).length?f:void 0,x=async N=>{try{const _=new URLSearchParams({type:N,initiative_id:t,limit:"100"}),B=await fetch(`/orgx/api/entities?${_.toString()}`,{headers:m});return B.ok?await B.json():(console.warn(`[useInitiativeDetails] ${N} fetch returned ${B.status}, using empty list`),{data:[]})}catch(_){return console.warn(`[useInitiativeDetails] ${N} fetch failed:`,_),{data:[]}}},[g,y,w]=await Promise.all([x("workstream"),x("milestone"),x("task")]),j=Array.isArray(g.data)?g.data.map(N=>oS(N,t)):[],C=Array.isArray(y.data)?y.data.map(N=>aS(N,t)):[],A=Array.isArray(w.data)?w.data.map(N=>lS(N,t)):[];return{initiativeId:t,workstreams:j,milestones:C,tasks:A}}});return{details:c.data??(t?{...Vc,initiativeId:t}:Vc),isLoading:c.isLoading,error:((h=c.error)==null?void 0:h.message)??null,refetch:c.refetch}}function uS({editMode:t,onToggleEditMode:n}){return a.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-white/[0.08] bg-white/[0.03] px-3.5 py-2.5",children:[a.jsx("div",{className:"text-[11px] text-white/45",children:t?"Edit mode enabled: status, priority, ETA, duration, dependencies, assignments":"Read mode: click rows to drill in and inspect dependency paths"}),a.jsx("button",{type:"button",onClick:n,className:`rounded-md border px-3 py-1.5 text-[11px] transition-colors ${t?"border-[#BFFF00]/30 bg-[#BFFF00]/15 text-[#D8FFA1]":"border-white/[0.12] bg-white/[0.05] text-white/65 hover:bg-white/[0.1]"}`,children:t?"Exit edit mode":"Edit mode"})]})}function dh({type:t,className:n=""}){return t==="initiative"?a.jsx("svg",{className:n,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:Q.iris,strokeWidth:"1.8",children:a.jsx("circle",{cx:"12",cy:"12",r:"8"})}):t==="workstream"?a.jsx("svg",{className:n,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:Q.lime,strokeWidth:"1.8",children:a.jsx("rect",{x:"5",y:"5",width:"14",height:"14",rx:"2"})}):t==="milestone"?a.jsx("svg",{className:n,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:Q.teal,strokeWidth:"1.8",children:a.jsx("path",{d:"M12 4l7 7-7 9-7-9 7-7z"})}):a.jsx("svg",{className:n,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(255,255,255,0.72)",strokeWidth:"1.8",children:a.jsx("path",{d:"M4 7h16M4 12h16M4 17h16"})})}function cS(t){return t==="initiative"?"Initiatives":t==="workstream"?"Workstreams":t==="milestone"?"Milestones":"Tasks"}function dS({nodes:t,edges:n,selectedNodeId:s,focusedWorkstreamId:o,onSelectNode:u}){const c=k.useMemo(()=>new Map(t.map(g=>[g.id,g])),[t]),h=k.useMemo(()=>{if(!o)return new Set(t.map(w=>w.id));const g=new Set;for(const w of t)(w.type==="initiative"||w.id===o||w.workstreamId===o)&&g.add(w.id);let y=!0;for(;y;){y=!1;for(const w of n)(g.has(w.from)||g.has(w.to))&&(!g.has(w.from)||!g.has(w.to))&&(g.add(w.from),g.add(w.to),y=!0)}return g},[o,t,n]),f=t.filter(g=>h.has(g.id)),m={initiative:f.filter(g=>g.type==="initiative"),workstream:f.filter(g=>g.type==="workstream"),milestone:f.filter(g=>g.type==="milestone"),task:f.filter(g=>g.type==="task")},x=n.filter(g=>h.has(g.from)&&h.has(g.to));return f.length===0?null:a.jsxs("section",{className:"space-y-2 rounded-xl border border-white/[0.08] bg-white/[0.03] p-3.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("h4",{className:"text-[11px] uppercase tracking-[0.08em] text-white/45",children:"Dependency map"}),o&&a.jsx("span",{className:"text-[10px] rounded-full border border-[#BFFF00]/25 bg-[#BFFF00]/10 px-2 py-0.5 text-[#D8FFA1]",children:"Focused workstream"})]}),a.jsx("div",{className:"grid gap-2 md:grid-cols-2 xl:grid-cols-4",children:Object.keys(m).map(g=>a.jsxs("div",{className:"rounded-lg border border-white/[0.08] bg-white/[0.02] p-2",children:[a.jsx("div",{className:"mb-1.5 text-[10px] uppercase tracking-[0.08em] text-white/35",children:cS(g)}),a.jsxs("div",{className:"space-y-1",children:[m[g].slice(0,8).map(y=>a.jsxs("button",{type:"button",onClick:()=>u(y.id),className:`flex w-full items-center gap-1.5 rounded-md border px-2 py-1 text-left transition-colors ${s===y.id?"border-[#BFFF00]/35 bg-[#BFFF00]/10":"border-white/[0.08] bg-white/[0.03] hover:bg-white/[0.08]"}`,children:[a.jsx(dh,{type:y.type}),a.jsx("span",{className:"truncate text-[11px] text-white/80",children:y.title})]},y.id)),m[g].length>8&&a.jsxs("div",{className:"px-1 text-[10px] text-white/35",children:["+",m[g].length-8," more"]})]})]},g))}),x.length>0&&a.jsxs("div",{className:"rounded-lg border border-white/[0.08] bg-white/[0.02] px-2.5 py-2",children:[a.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-[0.08em] text-white/35",children:"Dependency links"}),a.jsx("div",{className:"max-h-[110px] space-y-1 overflow-auto pr-1",children:x.slice(0,36).map(g=>{const y=c.get(g.from),w=c.get(g.to);if(!y||!w)return null;const j=s===y.id||s===w.id;return a.jsxs("button",{type:"button",onClick:()=>u(w.id),className:"flex w-full items-center gap-1 rounded-md px-1.5 py-1 text-left hover:bg-white/[0.06]",children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:j?Q.lime:"rgba(255,255,255,0.35)"}}),a.jsx("span",{className:"truncate text-[10px] text-white/70",children:y.title}),a.jsx("span",{className:"text-[10px] text-white/30",children:"→"}),a.jsx("span",{className:"truncate text-[10px] text-white/70",children:w.title})]},`${g.from}-${g.to}`)})})]})]})}function hS({dependencies:t,allNodes:n,disabled:s=!1,onSave:o}){const[u,c]=k.useState(!1),[h,f]=k.useState(t.join(", ")),m=k.useMemo(()=>n.slice(0,12).map(g=>`${g.id.slice(0,8)}… ${g.title}`),[n]),x=()=>{const g=h.split(",").map(y=>y.trim()).filter(Boolean);o(Array.from(new Set(g))),c(!1)};return a.jsxs("div",{className:"relative",children:[a.jsx("button",{type:"button",disabled:s,onClick:()=>{f(t.join(", ")),c(g=>!g)},className:"rounded-md border border-white/[0.12] bg-white/[0.04] px-2 py-1 text-[10px] text-white/70 hover:bg-white/[0.08] disabled:opacity-40",children:t.length>0?`${t.length} linked`:"Set links"}),u&&a.jsxs("div",{className:"absolute right-0 z-20 mt-1.5 w-[300px] rounded-xl border border-white/[0.14] bg-[#0A0D14] p-2.5 shadow-[0_20px_40px_rgba(0,0,0,0.45)]",children:[a.jsx("label",{className:"text-[10px] uppercase tracking-[0.08em] text-white/40",children:"Dependency IDs (comma separated)"}),a.jsx("textarea",{value:h,onChange:g=>f(g.target.value),className:"mt-1.5 h-[72px] w-full resize-none rounded-md border border-white/[0.12] bg-white/[0.04] px-2 py-1.5 text-[11px] text-white/80 outline-none focus:border-[#BFFF00]/40"}),a.jsxs("div",{className:"mt-2 rounded-md border border-white/[0.08] bg-white/[0.02] p-1.5 text-[10px] text-white/45",children:["IDs: ",m.join(" • ")]}),a.jsxs("div",{className:"mt-2 flex items-center justify-end gap-1.5",children:[a.jsx("button",{type:"button",onClick:()=>c(!1),className:"rounded-md border border-white/[0.12] px-2 py-1 text-[10px] text-white/60",children:"Cancel"}),a.jsx("button",{type:"button",onClick:x,className:"rounded-md border border-[#BFFF00]/30 bg-[#BFFF00]/15 px-2 py-1 text-[10px] text-[#D8FFA1]",children:"Save links"})]})]})]})}function fS(t){if(!t)return"";const n=new Date(t);if(Number.isNaN(n.getTime()))return"";const s=n.getFullYear(),o=String(n.getMonth()+1).padStart(2,"0"),u=String(n.getDate()).padStart(2,"0"),c=String(n.getHours()).padStart(2,"0"),h=String(n.getMinutes()).padStart(2,"0");return`${s}-${o}-${u}T${c}:${h}`}const pS=["not_started","planned","todo","in_progress","active","blocked","done"];function mS({nodes:t,edges:n,selectedNodeId:s,highlightedNodeIds:o,editMode:u,onSelectNode:c,onFocusWorkstream:h,onOpenNode:f,onUpdateNode:m,mutations:x}){const g=k.useMemo(()=>new Map(t.map(b=>[b.id,b])),[t]),y=k.useMemo(()=>t.map(b=>({id:b.id,title:b.title})),[t]),w=k.useMemo(()=>t.filter(b=>b.type==="workstream").sort((b,F)=>b.priorityNum-F.priorityNum||b.title.localeCompare(F.title)),[t]),j=k.useMemo(()=>{const b=new Map;for(const F of t.filter(U=>U.type==="milestone")){const U=F.workstreamId??"unscoped",D=b.get(U)??[];D.push(F),b.set(U,D)}for(const F of b.values())F.sort((U,D)=>U.priorityNum-D.priorityNum||U.title.localeCompare(D.title));return b},[t]),C=k.useMemo(()=>{const b=new Map;for(const F of t.filter(U=>U.type==="task"&&U.milestoneId)){const U=F.milestoneId??"unscoped",D=b.get(U)??[];D.push(F),b.set(U,D)}for(const F of b.values())F.sort((U,D)=>U.priorityNum-D.priorityNum||U.title.localeCompare(D.title));return b},[t]),A=k.useMemo(()=>{const b=new Map;for(const F of t.filter(U=>U.type==="task"&&!U.milestoneId)){const U=F.workstreamId??"unscoped",D=b.get(U)??[];D.push(F),b.set(U,D)}for(const F of b.values())F.sort((U,D)=>U.priorityNum-D.priorityNum||U.title.localeCompare(D.title));return b},[t]),N=k.useMemo(()=>{const b=new Set;for(const F of w)b.add(F.id);for(const F of t.filter(U=>U.type==="milestone"))b.add(F.id);return b},[t,w]),[_,B]=k.useState(N);k.useEffect(()=>{B(N)},[N]);const W=k.useMemo(()=>{const b=[];for(const D of w){const O=j.get(D.id)??[],G=A.get(D.id)??[],oe=O.length>0||G.length>0;if(b.push({node:D,depth:0,canCollapse:oe}),!!_.has(D.id)){for(const K of O){const I=C.get(K.id)??[];if(b.push({node:K,depth:1,canCollapse:I.length>0}),_.has(K.id))for(const J of I)b.push({node:J,depth:2,canCollapse:!1})}for(const K of G)b.push({node:K,depth:1,canCollapse:!1})}}const F=j.get("unscoped")??[],U=A.get("unscoped")??[];for(const D of F)if(b.push({node:D,depth:0,canCollapse:(C.get(D.id)??[]).length>0}),_.has(D.id))for(const O of C.get(D.id)??[])b.push({node:O,depth:1,canCollapse:!1});for(const D of U)b.push({node:D,depth:0,canCollapse:!1});return b},[A,_,j,C,w]),$=b=>b.dependencyIds.length;return a.jsxs("section",{className:"rounded-xl border border-white/[0.08] bg-white/[0.03] p-3",children:[a.jsx("div",{className:"mb-2 text-[11px] uppercase tracking-[0.08em] text-white/45",children:"Hierarchy table"}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full min-w-[1180px] border-separate border-spacing-y-1.5",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"text-left text-[10px] uppercase tracking-[0.08em] text-white/35",children:[a.jsx("th",{className:"px-2 py-1.5",children:"Item"}),a.jsx("th",{className:"px-2 py-1.5",children:"Status"}),a.jsx("th",{className:"px-2 py-1.5",children:"Priority"}),a.jsx("th",{className:"px-2 py-1.5",children:"ETA"}),a.jsx("th",{className:"px-2 py-1.5",children:"Duration (h)"}),a.jsx("th",{className:"px-2 py-1.5",children:"Budget ($)"}),a.jsx("th",{className:"px-2 py-1.5",children:"Dependencies"}),a.jsx("th",{className:"px-2 py-1.5",children:"Assigned"})]})}),a.jsx("tbody",{children:W.map(({node:b,depth:F,canCollapse:U})=>{const D=s===b.id,O=o.has(b.id),G=b.assignedAgents.map(K=>K.name).join(", "),oe=b.dependencyIds.map(K=>{var I;return((I=g.get(K))==null?void 0:I.title)??K}).slice(0,3).join(", ");return a.jsxs("tr",{onClick:()=>{c(b.id),b.type==="workstream"&&h(b.id)},className:`group/row cursor-pointer rounded-lg border transition-colors ${D?"bg-[#BFFF00]/10":O?"bg-[#14B8A6]/10":"bg-white/[0.02] hover:bg-white/[0.07]"}`,children:[a.jsx("td",{className:"rounded-l-lg border border-white/[0.08] border-r-0 px-2 py-2",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{style:{width:F*14}}),U?a.jsx("button",{type:"button",onClick:K=>{K.stopPropagation(),B(I=>{const J=new Set(I);return J.has(b.id)?J.delete(b.id):J.add(b.id),J})},className:"text-white/50",children:_.has(b.id)?"▾":"▸"}):a.jsx("span",{className:"w-2.5"}),a.jsx(dh,{type:b.type}),a.jsx("button",{type:"button",onClick:K=>{K.stopPropagation(),f(b)},className:"max-w-[320px] truncate text-[12px] text-white/85 hover:text-white",children:b.title}),b.type==="task"&&x&&!u&&a.jsx("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity ml-1",children:["not_started","todo","planned","pending","backlog"].includes(b.status.toLowerCase())?a.jsx("button",{type:"button",title:"Start",onClick:K=>{K.stopPropagation(),m(b,{status:"in_progress"})},className:"flex items-center justify-center w-5 h-5 rounded text-white/40 hover:text-[#BFFF00] hover:bg-white/[0.06] transition-colors",children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M8 5v14l11-7z"})})}):["in_progress","active"].includes(b.status.toLowerCase())?a.jsx("button",{type:"button",title:"Mark done",onClick:K=>{K.stopPropagation(),m(b,{status:"done"})},className:"flex items-center justify-center w-5 h-5 rounded text-white/40 hover:text-emerald-400 hover:bg-white/[0.06] transition-colors",children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:a.jsx("path",{d:"M20 6 9 17l-5-5"})})}):null})]})}),a.jsx("td",{className:"border border-white/[0.08] border-l-0 border-r-0 px-2 py-2 text-[11px] text-white/75",children:u?a.jsx("select",{defaultValue:b.status,onClick:K=>K.stopPropagation(),onChange:K=>{m(b,{status:K.target.value})},className:"rounded border border-white/[0.14] bg-white/[0.05] px-1.5 py-1 text-[10px] text-white/80",children:pS.map(K=>a.jsx("option",{value:K,children:K},K))}):a.jsx("span",{children:cn(b.status)})}),a.jsx("td",{className:"border border-white/[0.08] border-l-0 border-r-0 px-2 py-2 text-[11px] text-white/75",children:u?a.jsx("input",{type:"number",min:1,max:100,defaultValue:b.priorityNum,onClick:K=>K.stopPropagation(),onBlur:K=>{const I=Number(K.currentTarget.value);Number.isFinite(I)&&m(b,{priority_num:I})},className:"w-[66px] rounded border border-white/[0.14] bg-white/[0.05] px-1.5 py-1 text-[10px] text-white/80"}):a.jsxs("span",{children:["P",b.priorityNum]})}),a.jsx("td",{className:"border border-white/[0.08] border-l-0 border-r-0 px-2 py-2 text-[11px] text-white/75",children:u?a.jsx("input",{type:"datetime-local",defaultValue:fS(b.etaEndAt),onClick:K=>K.stopPropagation(),onBlur:K=>{const I=K.currentTarget.value;m(b,{eta_end_at:I?new Date(I).toISOString():null})},className:"w-[170px] rounded border border-white/[0.14] bg-white/[0.05] px-1.5 py-1 text-[10px] text-white/80"}):a.jsx("span",{children:b.etaEndAt?new Date(b.etaEndAt).toLocaleString():"—"})}),a.jsx("td",{className:"border border-white/[0.08] border-l-0 border-r-0 px-2 py-2 text-[11px] text-white/75",children:u&&b.type!=="task"?a.jsx("input",{type:"number",min:0,step:.5,defaultValue:b.expectedDurationHours,onClick:K=>K.stopPropagation(),onBlur:K=>{const I=Number(K.currentTarget.value);Number.isFinite(I)&&m(b,{expected_duration_hours:I})},className:"w-[82px] rounded border border-white/[0.14] bg-white/[0.05] px-1.5 py-1 text-[10px] text-white/80"}):a.jsx("span",{children:b.expectedDurationHours})}),a.jsx("td",{className:"border border-white/[0.08] border-l-0 border-r-0 px-2 py-2 text-[11px] text-white/75",children:u&&b.type!=="task"?a.jsx("input",{type:"number",min:0,step:1,defaultValue:b.expectedBudgetUsd,onClick:K=>K.stopPropagation(),onBlur:K=>{const I=Number(K.currentTarget.value);Number.isFinite(I)&&m(b,{expected_budget_usd:I})},className:"w-[88px] rounded border border-white/[0.14] bg-white/[0.05] px-1.5 py-1 text-[10px] text-white/80"}):a.jsxs("span",{children:["$",b.expectedBudgetUsd.toLocaleString(),u&&b.type==="task"?" (from task spec)":""]})}),a.jsx("td",{className:"border border-white/[0.08] border-l-0 border-r-0 px-2 py-2 text-[11px] text-white/75",children:u?a.jsx("div",{onClick:K=>K.stopPropagation(),children:a.jsx(hS,{dependencies:b.dependencyIds,allNodes:y,onSave:K=>void m(b,{depends_on:K})})}):a.jsx("div",{className:"max-w-[250px] truncate",children:$(b)>0?`${$(b)} · ${oe}`:"—"})}),a.jsx("td",{className:"rounded-r-lg border border-white/[0.08] border-l-0 px-2 py-2 text-[11px] text-white/75",children:u?a.jsx("input",{type:"text",defaultValue:G,placeholder:"Agent A, Agent B",onClick:K=>K.stopPropagation(),onBlur:K=>{const I=K.currentTarget.value.split(",").map(J=>J.trim()).filter(Boolean);m(b,{assigned_agent_names:I,assigned_agent_ids:I.map(J=>`name:${J}`),assignment_source:"manual"})},className:"w-[220px] rounded border border-white/[0.14] bg-white/[0.05] px-1.5 py-1 text-[10px] text-white/80"}):a.jsxs("div",{className:"flex items-center gap-1.5",children:[b.assignedAgents.length>0?b.assignedAgents.slice(0,3).map(K=>a.jsx("span",{className:"rounded-full border border-white/[0.12] bg-white/[0.04] px-2 py-0.5 text-[10px] text-white/70",children:K.name},`${b.id}:${K.id}`)):a.jsx("span",{className:"text-white/35",children:"Unassigned"}),b.assignedAgents.length>3&&a.jsxs("span",{className:"text-[10px] text-white/45",children:["+",b.assignedAgents.length-3]})]})})]},b.id)})})]})}),W.length===0&&a.jsxs("div",{className:"rounded-lg border border-white/[0.06] bg-white/[0.02] px-4 py-6 text-center",children:[a.jsx("div",{className:"text-[12px] text-white/60",children:"No workstreams, milestones, or tasks yet"}),a.jsx("div",{className:"mt-1 text-[11px] text-white/35",children:"Create workstreams and tasks to see them here, or reconnect the OrgX API key."})]}),n.length>0&&a.jsxs("div",{className:"mt-2 text-[10px] text-white/35",children:["Showing ",W.length," rows and ",n.length," dependency links."]}),a.jsx("div",{className:"mt-1 text-[10px] text-white/30",children:"Workstream rows set dependency-map focus. Milestone/task rows highlight dependency path."})]})}function gS({recentTodoIds:t,nodesById:n,selectedNodeId:s,onSelectNode:o}){const u=t.map(c=>n.get(c)).filter(c=>!!c).slice(0,14);return u.length===0?null:a.jsxs("section",{className:"space-y-1.5 rounded-xl border border-white/[0.08] bg-white/[0.03] p-3",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("h4",{className:"text-[11px] uppercase tracking-[0.08em] text-white/45",children:"Next-up tasks"}),a.jsx("span",{className:"text-[10px] text-white/35",children:u.length})]}),a.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-1",children:u.map(c=>a.jsxs("button",{type:"button",onClick:()=>o(c.id),className:`flex flex-shrink-0 items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-left transition-colors ${s===c.id?"border-[#BFFF00]/30 bg-[#BFFF00]/12":"border-white/[0.1] bg-white/[0.02] hover:bg-white/[0.08]"}`,children:[a.jsx(dh,{type:c.type}),a.jsx("span",{className:"max-w-[220px] truncate text-[11px] text-white/80",children:c.title}),a.jsxs("span",{className:"rounded-full px-1.5 py-0.5 text-[9px]",style:{backgroundColor:`${Q.amber}22`,color:`${Q.amber}`},children:["P",c.priorityNum]})]},c.id))})]})}function xS(t){if(!t)return{priorityNum:60,priorityLabel:null};const n=t.trim().toLowerCase();if(n==="urgent"||n==="p0")return{priorityNum:10,priorityLabel:"urgent"};if(n==="high"||n==="p1")return{priorityNum:25,priorityLabel:"high"};if(n==="medium"||n==="p2")return{priorityNum:50,priorityLabel:"medium"};if(n==="low"||n==="p3"||n==="p4")return{priorityNum:75,priorityLabel:"low"};const s=Number(n.replace(/^p/,""));return Number.isFinite(s)?{priorityNum:Math.max(1,Math.min(100,Math.round(s))),priorityLabel:null}:{priorityNum:60,priorityLabel:null}}function yS(t){const n=t.toLowerCase();return["todo","not_started","planned","pending","backlog"].includes(n)}function vS(t){const n=t.toLowerCase();return["in_progress","active","running","queued"].includes(n)}function wS(t,n){const s={id:t.id,type:"initiative",title:t.name,status:t.rawStatus??t.status,parentId:null,initiativeId:t.id,workstreamId:null,milestoneId:null,priorityNum:60,priorityLabel:null,dependencyIds:[],dueDate:t.targetDate??null,etaEndAt:t.targetDate??null,expectedDurationHours:40,expectedBudgetUsd:1500,assignedAgents:[],updatedAt:t.updatedAt??t.createdAt??null},u=(n.workstreams.length>0?n.workstreams:(t.workstreams??[]).map(g=>({id:g.id,name:g.name,summary:null,status:g.status,progress:null,initiativeId:t.id,createdAt:null}))).map(g=>({id:g.id,type:"workstream",title:g.name,status:g.status,parentId:t.id,initiativeId:t.id,workstreamId:g.id,milestoneId:null,priorityNum:50,priorityLabel:"medium",dependencyIds:[],dueDate:null,etaEndAt:null,expectedDurationHours:16,expectedBudgetUsd:300,assignedAgents:[],updatedAt:g.createdAt})),c=new Set(u.map(g=>g.id)),h=n.milestones.map(g=>({id:g.id,type:"milestone",title:g.title,status:g.status,parentId:g.workstreamId&&c.has(g.workstreamId)?g.workstreamId:t.id,initiativeId:t.id,workstreamId:g.workstreamId&&c.has(g.workstreamId)?g.workstreamId:null,milestoneId:g.id,priorityNum:50,priorityLabel:"medium",dependencyIds:[],dueDate:g.dueDate,etaEndAt:g.dueDate,expectedDurationHours:6,expectedBudgetUsd:120,assignedAgents:[],updatedAt:g.createdAt})),f=new Set(h.map(g=>g.id)),m=n.tasks.map(g=>{const y=xS(g.priority),w=g.milestoneId&&f.has(g.milestoneId),j=g.workstreamId&&c.has(g.workstreamId);return{id:g.id,type:"task",title:g.title,status:g.status,parentId:w?g.milestoneId:j?g.workstreamId:t.id,initiativeId:t.id,workstreamId:j?g.workstreamId:null,milestoneId:w?g.milestoneId:null,priorityNum:y.priorityNum,priorityLabel:y.priorityLabel,dependencyIds:[],dueDate:g.dueDate,etaEndAt:g.dueDate,expectedDurationHours:2,expectedBudgetUsd:40,assignedAgents:[],updatedAt:g.createdAt}}),x=m.filter(g=>["todo","not_started","planned","pending","backlog"].includes(g.status.toLowerCase())).sort((g,y)=>{const w=g.priorityNum-y.priorityNum;if(w!==0)return w;const j=g.etaEndAt?Date.parse(g.etaEndAt):1/0,C=y.etaEndAt?Date.parse(y.etaEndAt):1/0;if(j!==C)return j-C;const A=g.updatedAt?Date.parse(g.updatedAt):0;return(y.updatedAt?Date.parse(y.updatedAt):0)-A}).map(g=>g.id);return{nodes:[s,...u,...h,...m],edges:[],recentTodos:x}}function bS(t,n){if(!t)return new Set;const s=new Map(n.map(h=>[h.id,h])),o=new Map;for(const h of n)for(const f of h.dependencyIds){const m=o.get(f)??[];m.push(h.id),o.set(f,m)}const u=new Set,c=[t];for(;c.length>0;){const h=c.shift();if(u.has(h))continue;u.add(h);const f=s.get(h);if(f){for(const m of f.dependencyIds)u.has(m)||c.push(m);for(const m of o.get(h)??[])u.has(m)||c.push(m)}}return u}function kS(t,n){return{id:t.id,name:t.title,summary:null,status:t.status,progress:null,initiativeId:n.id,createdAt:t.updatedAt}}function jS(t,n){return{id:t.id,title:t.title,description:null,status:t.status,dueDate:t.dueDate,initiativeId:n.id,workstreamId:t.workstreamId,createdAt:t.updatedAt}}function NS(t,n){return{id:t.id,title:t.title,description:null,status:t.status,priority:t.priorityLabel??`p${t.priorityNum}`,dueDate:t.dueDate,initiativeId:n.id,milestoneId:t.milestoneId,workstreamId:t.workstreamId,createdAt:t.updatedAt}}function SS({initiative:t}){var Me;const{expandedInitiatives:n,toggleExpanded:s,openModal:o,agentEntityMap:u,authToken:c,embedMode:h,mutations:f}=ws(),[m,x]=k.useState(!1),[g,y]=k.useState(null),[w,j]=k.useState(null),C=n.has(t.id),{graph:A,isLoading:N,degraded:_,error:B}=iS({initiativeId:t.id,authToken:c,embedMode:h,enabled:C}),{details:W,isLoading:$,error:b}=El({initiativeId:t.id,authToken:c,embedMode:h,enabled:C}),F=k.useMemo(()=>wS(t,W),[t,W]),U=!!(A&&A.nodes.length>0),D=F.nodes.length>0,O=!U&&D,G=O?F.nodes:U?(A==null?void 0:A.nodes)??[]:F.nodes,oe=O?F.edges:U?(A==null?void 0:A.edges)??[]:F.edges,K=O?F.recentTodos:U?(A==null?void 0:A.recentTodos)??[]:F.recentTodos,I=_.some(Z=>/401|unauthorized/i.test(Z))||!!(B&&/401|unauthorized/i.test(B))||!!(b&&/401|unauthorized/i.test(b)),J=B&&/unknown api endpoint/i.test(B)?"Graph API unavailable. Showing session-derived data.":B,ne=b,le=[..._,...J?[J]:[],...ne?[`Entity data partially unavailable: ${ne}`]:[],...I?["OrgX auth is missing or expired in this local plugin instance. Reconnect in onboarding to load full workstreams/milestones/tasks."]:[]],q=k.useMemo(()=>new Map(G.map(Z=>[Z.id,Z])),[G]),R=k.useMemo(()=>bS(g,G),[g,G]);k.useEffect(()=>{var Z;C&&!g&&G.length>0&&y(((Z=G[0])==null?void 0:Z.id)??null)},[C,G,g]);const X=((A==null?void 0:A.initiative.assignedAgents)??[]).map(Z=>({id:Z.id,name:Z.name,confidence:"high"})),Y=u.get(t.id)??[],T=X.length>0?X:Y,L=G.filter(Z=>Z.type==="task"),ge=L.filter(Z=>vS(Z.status)).length,ye=L.filter(Z=>yS(Z.status)).length,Ce=t.status==="active"&&ge===0&&ye>0?"paused":t.status,Te=L.length>0?L:G.some(Z=>Z.type==="milestone")?G.filter(Z=>Z.type==="milestone"):G.filter(Z=>Z.type==="workstream"),Ae=Math.round(Te.reduce((Z,he)=>Z+(he.expectedDurationHours||0),0)*10)/10,je=Math.round(Te.reduce((Z,he)=>Z+(he.expectedBudgetUsd||0),0)*100)/100,Fe=t.health,Qe=sS(t.targetDate),Xt=Qe.tone==="danger"?"border-rose-400/35 bg-rose-500/10 text-rose-200":Qe.tone==="warning"?"border-amber-400/35 bg-amber-500/10 text-amber-200":Qe.tone==="success"?"border-emerald-400/35 bg-emerald-500/10 text-emerald-200":"border-white/[0.12] bg-white/[0.03] text-white/50",$t=Z=>{if(Z.type==="initiative"){o({type:"initiative",entity:t});return}if(Z.type==="workstream"){o({type:"workstream",entity:kS(Z,t),initiative:t});return}if(Z.type==="milestone"){o({type:"milestone",entity:jS(Z,t),initiative:t});return}o({type:"task",entity:NS(Z,t),initiative:t})},At=async(Z,he)=>{await f.updateEntity.mutateAsync({type:Z.type,id:Z.id,...he})},ae=Z=>he=>{he.stopPropagation(),f.entityAction.mutate({type:"initiative",id:t.id,action:Z})};return a.jsxs("div",{id:`initiative-${t.id}`,className:`glass-panel soft-shadow rounded-2xl overflow-hidden border-l-2 transition-colors ${C?"border-l-[#BFFF00]/60":"border-l-transparent"}`,children:[a.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":C,onClick:()=>s(t.id),onKeyDown:Z=>{(Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),s(t.id))},className:"group flex w-full cursor-pointer items-center gap-3 px-4 py-3.5 text-left transition-colors hover:bg-white/[0.04]",children:[a.jsx(_e.div,{animate:{rotate:C?90:0},transition:{type:"spring",stiffness:400,damping:25},className:"flex-shrink-0 flex items-center justify-center w-6 h-6 rounded-md transition-colors group-hover:bg-white/[0.06]",children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"text-white/40",children:a.jsx("path",{d:"m9 18 6-6-6-6"})})}),a.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${Ce==="active"?"status-breathe":""}`,style:{backgroundColor:G0(Ce)}}),a.jsx("button",{type:"button",onClick:Z=>{Z.stopPropagation(),o({type:"initiative",entity:t})},className:"text-[14px] font-semibold text-white hover:text-white/80 truncate transition-colors",children:t.name}),a.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-full border uppercase tracking-[0.08em] flex-shrink-0 ${ay[Ce]}`,children:cn(Ce)}),a.jsx("span",{className:`hidden md:inline-flex text-[10px] px-2 py-0.5 rounded-full border tracking-[0.06em] flex-shrink-0 ${Xt}`,title:t.targetDate?new Date(t.targetDate).toLocaleDateString():"No target date",children:Qe.label}),a.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:[Ce==="active"&&a.jsx("button",{type:"button",onClick:ae("pause"),title:"Pause",className:"flex items-center justify-center w-6 h-6 rounded-lg text-white/50 hover:text-white hover:bg-white/[0.08] transition-colors",children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:[a.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),a.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]})}),Ce==="paused"&&a.jsx("button",{type:"button",onClick:ae("resume"),title:"Resume",className:"flex items-center justify-center w-6 h-6 rounded-lg text-white/50 hover:text-white hover:bg-white/[0.08] transition-colors",children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M8 5v14l11-7z"})})}),a.jsx("button",{type:"button",onClick:Z=>{Z.stopPropagation(),o({type:"initiative",entity:t})},title:"Details",className:"flex items-center justify-center w-6 h-6 rounded-lg text-white/50 hover:text-white hover:bg-white/[0.08] transition-colors",children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("path",{d:"M12 16v-4M12 8h.01"})]})})]}),a.jsx("div",{className:"flex-1 max-w-[200px] hidden sm:block",children:a.jsx("div",{className:"h-[2px] w-full rounded-full bg-white/[0.06] overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Fe}%`,backgroundColor:G0(Ce)}})})}),a.jsxs("span",{className:"text-[11px] text-white/40 flex-shrink-0 hidden sm:block",children:[Fe,"%"]}),a.jsx("div",{className:"flex-shrink-0 ml-auto",children:a.jsx(Cl,{agents:T,max:5})})]}),a.jsx(Ir,{children:C&&a.jsx(_e.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",stiffness:400,damping:35},className:"overflow-hidden",children:a.jsxs("div",{className:"px-4 pb-4 space-y-3 pt-3",children:[a.jsx("div",{className:"section-divider"}),N||!U&&$?a.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((Z,he)=>a.jsx(Co,{className:"h-24 w-full rounded-xl"},`mc-loading-${he}`))}):a.jsxs(a.Fragment,{children:[a.jsx(uS,{editMode:m,onToggleEditMode:()=>x(Z=>!Z)}),le.length>0&&a.jsxs("div",{className:"rounded-lg border border-amber-400/30 bg-amber-400/10 px-3 py-2 text-[11px] text-amber-200/90",children:["Partial data: ",le.join(" | ")]}),a.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[a.jsxs("div",{className:"rounded-lg border border-white/[0.1] bg-white/[0.03] px-3 py-2",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/45",children:"Next-Up Queue"}),a.jsxs("div",{className:"mt-1 text-[12px] text-white/85",children:[ye," todo • ",ge," active"]})]}),a.jsxs("div",{className:"rounded-lg border border-white/[0.1] bg-white/[0.03] px-3 py-2",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/45",children:"Expected Duration"}),a.jsxs("div",{className:"mt-1 text-[12px] text-white/85",children:[Ae,"h"]})]}),a.jsxs("div",{className:"rounded-lg border border-white/[0.1] bg-white/[0.03] px-3 py-2",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/45",children:"Expected Budget"}),a.jsxs("div",{className:"mt-1 text-[12px] text-white/85",children:["$",je.toLocaleString()]})]})]}),w&&a.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[#BFFF00]/25 bg-[#BFFF00]/10 px-3 py-1.5 text-[11px] text-[#D8FFA1]",children:[a.jsxs("span",{children:["Focused on workstream ",((Me=q.get(w))==null?void 0:Me.title)??w]}),a.jsx("button",{type:"button",onClick:()=>j(null),className:"text-[10px] underline underline-offset-2",children:"Clear focus"})]}),a.jsx(dS,{nodes:G,edges:oe,selectedNodeId:g,focusedWorkstreamId:w,onSelectNode:Z=>{y(Z);const he=q.get(Z);(he==null?void 0:he.type)==="workstream"&&j(he.id)}}),a.jsx(gS,{recentTodoIds:K,nodesById:q,selectedNodeId:g,onSelectNode:Z=>{y(Z);const he=q.get(Z);(he==null?void 0:he.type)==="workstream"&&j(he.id)}}),a.jsx(mS,{nodes:G,edges:oe,selectedNodeId:g,highlightedNodeIds:R,editMode:m,onSelectNode:y,onFocusWorkstream:j,onOpenNode:$t,onUpdateNode:At,mutations:f})]}),a.jsxs("button",{type:"button",onClick:()=>s(t.id),className:"flex w-full items-center justify-center gap-1.5 py-1.5 text-[10px] text-white/30 hover:text-white/60 transition-colors",children:[a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:a.jsx("path",{d:"m18 15-6-6-6 6"})}),"Collapse"]})]})})})]})}const CS={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.04}}},AS={hidden:{opacity:0,y:12},show:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:30}}};function X0({initiatives:t}){return a.jsx(_e.div,{variants:CS,initial:"hidden",animate:"show",className:"space-y-2",children:t.map(n=>a.jsx(_e.div,{variants:AS,children:a.jsx(SS,{initiative:n})},n.id))})}function ES(){return a.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:a.jsx(In,{className:"max-w-sm p-8",children:a.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[a.jsx("div",{className:"relative flex items-center justify-center h-16 w-16 rounded-2xl",style:{backgroundColor:`${Q.iris}1a`,border:`1px solid ${Q.iris}33`},children:a.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:Q.iris,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("path",{d:"M12 6v6l4 2"})]})}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("h3",{className:"text-[14px] font-semibold text-white",children:"No initiatives yet"}),a.jsx("p",{className:"text-[12px] text-white/50 leading-relaxed",children:"Create initiatives in OrgX to see them here. Mission Control shows your full initiative hierarchy with workstreams, milestones, and tasks."})]})]})})})}function TS({initiative:t}){const{agentEntityMap:n,openModal:s,authToken:o,embedMode:u,mutations:c}=ws(),h=n.get(t.id)??[],[f,m]=k.useState(!1),[x,g]=k.useState(""),{details:y,isLoading:w}=El({initiativeId:t.id,authToken:o,embedMode:u}),j=y.tasks.filter(N=>["active","in_progress"].includes(N.status.toLowerCase())).length,C=y.tasks.filter(N=>N.status.toLowerCase()==="blocked").length,A=y.tasks.filter(N=>["done","completed"].includes(N.status.toLowerCase())).length;return a.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[a.jsxs("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto p-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h2",{className:"text-[16px] font-semibold text-white",children:t.name}),a.jsx("span",{className:`text-[10px] px-2.5 py-0.5 rounded-full border uppercase tracking-[0.08em] ${ay[t.status]}`,children:cn(t.status)})]}),t.description&&a.jsx("p",{className:"text-[13px] text-white/50 leading-relaxed",children:t.description}),h.length>0&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] text-white/30 uppercase tracking-wider",children:"Agents"}),a.jsx(Cl,{agents:h,max:6})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[a.jsx(el,{label:"Workstreams",value:`${y.workstreams.length}`}),a.jsx(el,{label:"Milestones",value:`${y.milestones.length}`}),a.jsx(el,{label:"Active Tasks",value:`${j}`,accent:j>0?Q.lime:void 0}),a.jsx(el,{label:"Blocked",value:`${C}`,accent:C>0?Q.red:void 0})]}),w?a.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((N,_)=>a.jsx(Co,{className:"h-14 w-full rounded-lg"},`init-detail-${_}`))}):a.jsxs(a.Fragment,{children:[y.workstreams.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Y0,{title:"Workstreams",count:y.workstreams.length}),y.workstreams.map(N=>{const _=y.tasks.filter(B=>B.workstreamId===N.id).length;return a.jsxs("button",{onClick:()=>s({type:"workstream",entity:N,initiative:t}),className:"w-full text-left rounded-xl border border-white/[0.08] bg-white/[0.03] p-3.5 transition-all hover:bg-white/[0.06] hover-lift",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-[12px] text-white/90 break-words",children:N.name}),a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full border uppercase tracking-[0.08em] ${ly(N.status)}`,children:cn(N.status)})]}),a.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-[10px] text-white/35 uppercase tracking-[0.08em]",children:[a.jsxs("span",{children:[_," tasks"]}),N.progress!==null&&a.jsxs("span",{children:[Math.round(N.progress),"%"]})]})]},N.id)})]}),y.milestones.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Y0,{title:"Milestones",count:y.milestones.length}),y.milestones.map(N=>a.jsxs("button",{onClick:()=>s({type:"milestone",entity:N,initiative:t}),className:"w-full text-left rounded-xl border border-white/[0.08] bg-white/[0.03] p-3 transition-all hover:bg-white/[0.06] hover-lift",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[12px] text-white/90 break-words",children:N.title}),a.jsx("span",{className:"text-[10px] text-white/40 uppercase tracking-[0.08em]",children:cn(N.status)})]}),N.dueDate&&a.jsxs("span",{className:"text-[10px] text-white/30 mt-0.5 block",children:["Due: ",new Date(N.dueDate).toLocaleDateString()]})]},N.id))]}),a.jsxs("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/30 pt-2 border-t border-white/[0.06]",children:[y.tasks.length," total tasks · ",A," done"]})]})]}),a.jsx("div",{className:"border-t border-white/[0.06] bg-[#070b12]/85 px-6 py-3 backdrop-blur",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.status==="active"&&a.jsx("button",{onClick:()=>c.entityAction.mutate({type:"initiative",id:t.id,action:"pause"}),disabled:c.entityAction.isPending,className:"text-[11px] px-3 py-1.5 rounded-lg border transition-colors disabled:opacity-50",style:{backgroundColor:`${Q.amber}20`,color:Q.amber,borderColor:`${Q.amber}30`},children:"Pause"}),t.status==="paused"&&a.jsx("button",{onClick:()=>c.entityAction.mutate({type:"initiative",id:t.id,action:"resume"}),disabled:c.entityAction.isPending,className:"text-[11px] px-3 py-1.5 rounded-lg border transition-colors disabled:opacity-50",style:{backgroundColor:Q.lime,color:"#05060A",borderColor:`${Q.lime}CC`},children:"Resume"}),a.jsx("div",{className:"flex-1"}),f?a.jsxs("form",{className:"flex flex-wrap items-center gap-2",onSubmit:N=>{N.preventDefault(),x.trim()&&c.createEntity.mutate({type:"workstream",title:x.trim(),initiative_id:t.id,status:"not_started"},{onSuccess:()=>{g(""),m(!1)}})},children:[a.jsx("input",{type:"text",value:x,onChange:N=>g(N.target.value),placeholder:"Workstream name...",autoFocus:!0,className:"text-[12px] bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-white/80 placeholder-white/30 w-[180px] outline-none focus:border-white/25"}),a.jsx("button",{type:"submit",disabled:!x.trim()||c.createEntity.isPending,className:"text-[11px] px-2.5 py-1 rounded-lg border disabled:opacity-50",style:{backgroundColor:`${Q.lime}20`,color:Q.lime,borderColor:`${Q.lime}30`},children:"Add"}),a.jsx("button",{type:"button",onClick:()=>{m(!1),g("")},className:"text-[11px] px-2.5 py-1 rounded-lg bg-white/5 text-white/40 border border-white/10",children:"Cancel"})]}):a.jsx("button",{onClick:()=>m(!0),className:"text-[11px] px-3 py-1.5 rounded-lg border bg-white/5 text-white/50 border-white/10 hover:bg-white/10 transition-colors",children:"+ Workstream"})]})})]})}function el({label:t,value:n,accent:s}){return a.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.03] px-3 py-2.5",style:s?{borderTopColor:`${s}50`,borderTopWidth:2}:void 0,children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/35",children:t}),a.jsx("div",{className:"text-[15px] font-medium mt-0.5",style:{color:s??"rgba(255,255,255,0.8)"},children:n})]})}function Y0({title:t,count:n}){return a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] uppercase tracking-[0.08em] text-white/35",children:t}),a.jsx("span",{className:"text-[10px] text-white/30",children:n})]})}function PS({workstream:t,initiative:n}){const{agentEntityMap:s,openModal:o,authToken:u,embedMode:c,mutations:h}=ws(),f=s.get(t.id)??s.get(n.id)??[],[m,x]=k.useState(!1),[g,y]=k.useState(""),{details:w,isLoading:j}=El({initiativeId:n.id,authToken:u,embedMode:c}),C=w.tasks.filter(N=>N.workstreamId===t.id).sort((N,_)=>{const B=Q0(N.status)-Q0(_.status);if(B!==0)return B;const W=N.createdAt?Date.parse(N.createdAt):0;return(_.createdAt?Date.parse(_.createdAt):0)-W}),A=w.milestones.filter(N=>N.workstreamId===t.id);return a.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[a.jsxs("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto p-6",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-[11px]",children:[a.jsx("button",{onClick:()=>o({type:"initiative",entity:n}),className:"break-words text-white/45 transition-colors hover:text-white",children:n.name}),a.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-white/20",children:a.jsx("path",{d:"m9 18 6-6-6-6"})}),a.jsx("span",{className:"break-words font-medium text-white/70",children:t.name})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h2",{className:"text-[16px] font-semibold text-white",children:t.name}),a.jsx("span",{className:`text-[10px] px-2.5 py-0.5 rounded-full border uppercase tracking-[0.08em] ${ly(t.status)}`,children:cn(t.status)})]}),t.summary&&a.jsx("p",{className:"text-[13px] text-white/50 leading-relaxed",children:t.summary}),f.length>0&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] text-white/30 uppercase tracking-wider",children:"Agents"}),a.jsx(Cl,{agents:f,max:6})]})]}),t.progress!==null&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"text-[10px] text-white/30 uppercase tracking-wider",children:"Progress"}),a.jsxs("span",{className:"text-[12px] text-white/60",children:[Math.round(t.progress),"%"]})]}),a.jsx("div",{className:"h-1.5 w-full rounded-full bg-white/[0.06] overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.round(t.progress)}%`,backgroundColor:Q.lime}})})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[a.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.03] px-3 py-2.5",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/35",children:"Tasks"}),a.jsx("div",{className:"text-[15px] font-medium text-white/80 mt-0.5",children:C.length})]}),a.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.03] px-3 py-2.5",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/35",children:"Milestones"}),a.jsx("div",{className:"text-[15px] font-medium text-white/80 mt-0.5",children:A.length})]}),a.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.03] px-3 py-2.5",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/35",children:"Progress"}),a.jsx("div",{className:"text-[15px] font-medium text-white/80 mt-0.5",children:t.progress!==null?`${Math.round(t.progress)}%`:"—"})]})]}),j?a.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((N,_)=>a.jsx(Co,{className:"h-12 w-full rounded-lg"},`ws-detail-${_}`))}):a.jsxs(a.Fragment,{children:[A.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("span",{className:"text-[11px] uppercase tracking-[0.08em] text-white/35",children:"Milestones"}),A.map(N=>a.jsx("button",{onClick:()=>o({type:"milestone",entity:N,initiative:n}),className:"w-full text-left rounded-xl border border-white/[0.08] bg-white/[0.03] p-3 transition-all hover:bg-white/[0.06] hover-lift",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[12px] text-white/90",children:N.title}),a.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full border uppercase tracking-[0.08em] ${uy(N.status)}`,children:cn(N.status)})]})},N.id))]}),C.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("span",{className:"text-[11px] uppercase tracking-[0.08em] text-white/35",children:["Tasks (",C.length,")"]}),C.map(N=>a.jsxs("button",{onClick:()=>o({type:"task",entity:N,initiative:n}),className:"w-full text-left rounded-xl border border-white/[0.08] bg-white/[0.03] p-3 transition-all hover:bg-white/[0.06] hover-lift",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-[12px] text-white/90",children:N.title}),a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full border uppercase tracking-[0.08em] flex-shrink-0 ${ch(N.status)}`,children:cn(N.status)})]}),N.priority&&a.jsxs("span",{className:"text-[10px] text-white/30 mt-0.5 block uppercase tracking-wider",children:["Priority: ",N.priority]})]},N.id))]})]})]}),a.jsx("div",{className:"border-t border-white/[0.06] bg-[#070b12]/85 px-6 py-3 backdrop-blur",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.status==="not_started"&&a.jsx(Qs,{label:"Start",color:Q.lime,variant:"primary",onClick:()=>h.entityAction.mutate({type:"workstream",id:t.id,action:"start"}),disabled:h.entityAction.isPending}),t.status==="active"&&a.jsxs(a.Fragment,{children:[a.jsx(Qs,{label:"Complete",color:Q.teal,variant:"primary",onClick:()=>h.entityAction.mutate({type:"workstream",id:t.id,action:"complete"}),disabled:h.entityAction.isPending}),a.jsx(Qs,{label:"Pause",color:Q.amber,onClick:()=>h.entityAction.mutate({type:"workstream",id:t.id,action:"pause"}),disabled:h.entityAction.isPending}),a.jsx(Qs,{label:"Block",color:Q.red,variant:"destructive",onClick:()=>h.entityAction.mutate({type:"workstream",id:t.id,action:"block"}),disabled:h.entityAction.isPending})]}),(t.status==="paused"||t.status==="blocked")&&a.jsx(Qs,{label:"Resume",color:Q.lime,variant:"primary",onClick:()=>h.entityAction.mutate({type:"workstream",id:t.id,action:"resume"}),disabled:h.entityAction.isPending}),a.jsx("div",{className:"flex-1"}),m?a.jsxs("form",{className:"flex flex-wrap items-center gap-2",onSubmit:N=>{N.preventDefault(),g.trim()&&h.createEntity.mutate({type:"task",title:g.trim(),workstream_id:t.id,initiative_id:n.id,status:"todo"},{onSuccess:()=>{y(""),x(!1)}})},children:[a.jsx("input",{type:"text",value:g,onChange:N=>y(N.target.value),placeholder:"Task title...",autoFocus:!0,className:"text-[12px] bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-white/80 placeholder-white/30 w-[160px] outline-none focus:border-white/25"}),a.jsx(Qs,{label:"Add",color:Q.lime,onClick:()=>{},disabled:!g.trim()||h.createEntity.isPending}),a.jsx("button",{type:"button",onClick:()=>{x(!1),y("")},className:"text-[11px] px-2.5 py-1 rounded-lg bg-white/5 text-white/40 border border-white/10",children:"Cancel"})]}):a.jsx("button",{onClick:()=>x(!0),className:"text-[11px] px-3 py-1.5 rounded-lg border bg-white/5 text-white/50 border-white/10 hover:bg-white/10 transition-colors",children:"+ Task"})]})})]})}function Qs({label:t,color:n,onClick:s,disabled:o,variant:u="secondary"}){const c=u==="primary"?{backgroundColor:n,color:"#05060A",borderColor:`${n}CC`}:u==="destructive"?{backgroundColor:`${n}14`,color:n,borderColor:`${n}40`}:{backgroundColor:`${n}20`,color:n,borderColor:`${n}30`};return a.jsx("button",{onClick:s,disabled:o,className:"rounded-lg border px-3 py-1.5 text-[11px] transition-colors disabled:opacity-50",style:c,children:t})}function MS({milestone:t,initiative:n}){var x;const{openModal:s,authToken:o,embedMode:u,mutations:c}=ws(),{details:h}=El({initiativeId:n.id,authToken:o,embedMode:u}),f=h.tasks.filter(g=>g.milestoneId===t.id),m=t.status.toLowerCase()==="done"||t.status.toLowerCase()==="completed";return a.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[a.jsxs("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto p-6",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-[11px]",children:[a.jsx("button",{onClick:()=>s({type:"initiative",entity:n}),className:"break-words text-white/45 transition-colors hover:text-white",children:n.name}),a.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-white/20",children:a.jsx("path",{d:"m9 18 6-6-6-6"})}),a.jsx("span",{className:"break-words font-medium text-white/70",children:t.title})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-3 h-3 rounded-full border flex-shrink-0",style:{backgroundColor:m?`${Q.teal}99`:"rgba(255,255,255,0.1)",borderColor:m?`${Q.teal}66`:"rgba(255,255,255,0.2)"}}),a.jsx("h2",{className:"text-[16px] font-semibold text-white",children:t.title}),a.jsx("span",{className:`text-[10px] px-2.5 py-0.5 rounded-full border uppercase tracking-[0.08em] ${uy(t.status)}`,children:cn(t.status)})]}),t.description&&a.jsx("p",{className:"text-[13px] text-white/50 leading-relaxed",children:t.description})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[t.dueDate&&a.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.03] px-3 py-2.5",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/35",children:"Due Date"}),a.jsx("div",{className:"text-[13px] text-white/80 mt-0.5",children:new Date(t.dueDate).toLocaleDateString()})]}),a.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.03] px-3 py-2.5",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/35",children:"Associated Tasks"}),a.jsx("div",{className:"text-[15px] font-medium text-white/80 mt-0.5",children:f.length})]})]}),f.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("span",{className:"text-[11px] uppercase tracking-[0.08em] text-white/35",children:"Tasks"}),f.map(g=>a.jsx("button",{onClick:()=>s({type:"task",entity:g,initiative:n}),className:"w-full text-left rounded-xl border border-white/[0.08] bg-white/[0.03] p-3 transition-all hover:bg-white/[0.06] hover-lift",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-[12px] text-white/90",children:g.title}),a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full border uppercase tracking-[0.08em] flex-shrink-0 ${ch(g.status)}`,children:cn(g.status)})]})},g.id))]})]}),a.jsx("div",{className:"border-t border-white/[0.06] bg-[#070b12]/85 px-6 py-3 backdrop-blur",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[!m&&t.status.toLowerCase()==="planned"&&a.jsx("button",{onClick:()=>c.entityAction.mutate({type:"milestone",id:t.id,action:"start"}),disabled:c.entityAction.isPending,className:"text-[11px] px-3 py-1.5 rounded-lg border transition-colors disabled:opacity-50",style:{backgroundColor:Q.lime,color:"#05060A",borderColor:`${Q.lime}CC`},children:"Start"}),!m&&(t.status.toLowerCase()==="in_progress"||t.status.toLowerCase()==="at_risk")&&a.jsx("button",{onClick:()=>{const g=f.length===0||f.every(y=>["done","completed"].includes(y.status.toLowerCase()));c.entityAction.mutate({type:"milestone",id:t.id,action:"complete",force:!g})},disabled:c.entityAction.isPending,className:"text-[11px] px-3 py-1.5 rounded-lg border transition-colors disabled:opacity-50",style:{backgroundColor:Q.teal,color:"#05060A",borderColor:`${Q.teal}CC`},children:f.length>0&&!f.every(g=>["done","completed"].includes(g.status.toLowerCase()))?"Complete (force)":"Complete"}),m&&a.jsx("span",{className:"text-[11px] text-white/50",children:"Milestone is complete."}),c.entityAction.error&&a.jsx("span",{className:"text-[11px] ml-2",style:{color:`${Q.red}b3`},children:(x=c.entityAction.error)==null?void 0:x.message})]})})]})}function DS({task:t,initiative:n}){var j,C;const{agentEntityMap:s,openModal:o,mutations:u,closeModal:c}=ws(),h=s.get(t.id)??s.get(n.id)??[],[f,m]=k.useState(!1),x=t.status.toLowerCase(),g=A=>{u.entityAction.mutate({type:"task",id:t.id,action:A},{onSuccess:()=>c()})},y=()=>{u.deleteEntity.mutate({type:"task",id:t.id},{onSuccess:()=>c()})},w=u.entityAction.isPending||u.deleteEntity.isPending;return a.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[a.jsxs("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto p-6",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-[11px]",children:[a.jsx("button",{onClick:()=>o({type:"initiative",entity:n}),className:"break-words text-white/45 transition-colors hover:text-white",children:n.name}),a.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-white/20",children:a.jsx("path",{d:"m9 18 6-6-6-6"})}),a.jsx("span",{className:"break-words font-medium text-white/70",children:t.title})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx("h2",{className:"break-words text-[16px] font-semibold text-white",children:t.title}),a.jsx("span",{className:`text-[10px] px-2.5 py-0.5 rounded-full border uppercase tracking-[0.08em] ${ch(t.status)}`,children:cn(t.status)})]}),t.description&&a.jsx(xo,{text:t.description,mode:"block",className:"text-[13px] text-white/50 leading-relaxed"}),h.length>0&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] text-white/30 uppercase tracking-wider",children:"Agents"}),a.jsx(Cl,{agents:h,max:4})]})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[a.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.03] px-3 py-2.5",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/35",children:"Status"}),a.jsx("div",{className:"text-[13px] text-white/80 mt-0.5",children:cn(t.status)})]}),a.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.03] px-3 py-2.5",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/35",children:"Priority"}),a.jsx("div",{className:"text-[13px] text-white/80 mt-0.5",children:t.priority??"—"})]}),t.dueDate&&a.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.03] px-3 py-2.5",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-white/35",children:"Due Date"}),a.jsx("div",{className:"text-[13px] text-white/80 mt-0.5",children:new Date(t.dueDate).toLocaleDateString()})]})]}),(u.entityAction.error||u.deleteEntity.error)&&a.jsx("div",{className:"text-[11px] px-1",style:{color:`${Q.red}b3`},children:((j=u.entityAction.error)==null?void 0:j.message)??((C=u.deleteEntity.error)==null?void 0:C.message)})]}),a.jsx("div",{className:"border-t border-white/[0.06] bg-[#070b12]/85 px-6 py-3 backdrop-blur",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x==="todo"&&a.jsx(so,{label:"Start",color:Q.lime,variant:"primary",onClick:()=>g("start"),disabled:w}),(x==="in_progress"||x==="active")&&a.jsx(so,{label:"Complete",color:Q.teal,variant:"primary",onClick:()=>g("complete"),disabled:w}),(x==="todo"||x==="in_progress"||x==="active")&&a.jsx(so,{label:"Block",color:Q.red,variant:"destructive",onClick:()=>g("block"),disabled:w}),x==="blocked"&&a.jsx(so,{label:"Unblock",color:Q.amber,onClick:()=>g("unblock"),disabled:w}),a.jsx("div",{className:"flex-1"}),f?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[11px]",style:{color:`${Q.red}b3`},children:"Delete?"}),a.jsx(so,{label:"Yes",color:Q.red,onClick:y,disabled:w}),a.jsx("button",{onClick:()=>m(!1),disabled:w,className:"text-[11px] px-3 py-1.5 rounded-lg border bg-white/5 text-white/50 border-white/10 hover:bg-white/10 transition-colors disabled:opacity-50",children:"No"})]}):a.jsx("button",{onClick:()=>m(!0),disabled:w,className:"text-[11px] px-3 py-1.5 rounded-lg border bg-white/5 text-white/40 border-white/10 transition-colors disabled:opacity-50",style:{"--hover-bg":`${Q.red}20`},children:"Delete"})]})})]})}function so({label:t,color:n,onClick:s,disabled:o,variant:u="secondary"}){const c=u==="primary"?{backgroundColor:n,color:"#05060A",borderColor:`${n}CC`}:u==="destructive"?{backgroundColor:`${n}14`,color:n,borderColor:`${n}40`}:{backgroundColor:`${n}20`,color:n,borderColor:`${n}30`};return a.jsx("button",{onClick:s,disabled:o,className:"text-[11px] px-3 py-1.5 rounded-lg border transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:c,children:t})}function FS({target:t,onClose:n}){return a.jsx(lh,{open:t!==null,onClose:n,maxWidth:"max-w-3xl",children:t&&a.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[t.type==="initiative"&&a.jsx(TS,{initiative:t.entity}),t.type==="workstream"&&a.jsx(PS,{workstream:t.entity,initiative:t.initiative}),t.type==="milestone"&&a.jsx(MS,{milestone:t.entity,initiative:t.initiative}),t.type==="task"&&a.jsx(DS,{task:t.entity,initiative:t.initiative})]})})}function Z0(t){return(t??"").trim().toLowerCase().replace(/[\s-]+/g,"_")}function IS(t){return t.split("_").map(n=>n.slice(0,1).toUpperCase()+n.slice(1)).join(" ")}const $c=["active","in_progress","not_started","planned","blocked","at_risk","paused","completed","done","backlog","todo","pending","draft"],_S=[{value:"target",label:"Target date"},{value:"created",label:"Created at"},{value:"updated",label:"Updated at"}],LS=[{value:"any",label:"Any time"},{value:"missing",label:"No target date"},{value:"overdue",label:"Overdue"},{value:"today",label:"Today"},{value:"next_7_days",label:"Next 7 days"},{value:"next_30_days",label:"Next 30 days"},{value:"custom_range",label:"Custom range"}],RS=[{value:"any",label:"Any time"},{value:"missing",label:"No timestamp"},{value:"today",label:"Today"},{value:"past_7_days",label:"Past 7 days"},{value:"past_30_days",label:"Past 30 days"},{value:"custom_range",label:"Custom range"}];function OS({initiatives:t,visibleCount:n}){const{statusFilters:s,dateField:o,datePreset:u,dateStart:c,dateEnd:h,activeFilterCount:f,hasActiveFilters:m,groupBy:x,setGroupBy:g,sortBy:y,setSortBy:w,setStatusFilters:j,toggleStatusFilter:C,setDateField:A,setDatePreset:N,setDateStart:_,setDateEnd:B,clearFilters:W}=ws(),[$,b]=k.useState(!1),F=k.useRef(null);k.useEffect(()=>{if(!$)return;const I=J=>{var le;const ne=J.target;ne&&((le=F.current)!=null&&le.contains(ne)||b(!1))};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[$]);const U=k.useMemo(()=>{const I=new Map;for(const ne of t){const le=new Set([Z0(ne.status),Z0(ne.rawStatus)]);for(const q of le)q&&I.set(q,(I.get(q)??0)+1)}for(const ne of $c)I.has(ne)||I.set(ne,0);return Array.from(I.entries()).sort((ne,le)=>{const q=$c.indexOf(ne[0]),R=$c.indexOf(le[0]);return q>=0&&R>=0?q-R:q>=0?-1:R>=0?1:ne[0].localeCompare(le[0])}).map(([ne,le])=>({key:ne,count:le}))},[t]),D=s.length,O=k.useMemo(()=>o==="target"?LS:RS,[o]);k.useEffect(()=>{O.some(I=>I.value===u)||N("any")},[u,O,N]);const G=f>0?`Filters (${f})`:"Filters",oe=[{value:"none",label:"None"},{value:"status",label:"Status"},{value:"date",label:"Date"},{value:"category",label:"Category"}],K=[{value:"default",label:"Default"},{value:"date_asc",label:"Date (earliest)"},{value:"date_desc",label:"Date (latest)"}];return a.jsxs("div",{ref:F,className:"relative flex items-center gap-2",children:[a.jsxs("div",{className:"hidden sm:flex items-center gap-1",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-white/40",children:"Group"}),a.jsx("select",{value:x,onChange:I=>g(I.target.value),className:"h-8 rounded-lg border border-white/[0.12] bg-white/[0.03] px-2 text-[11px] text-white/75 focus:border-[#BFFF00]/40 focus:outline-none",children:oe.map(I=>a.jsx("option",{value:I.value,children:I.label},I.value))})]}),a.jsxs("div",{className:"hidden sm:flex items-center gap-1",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-white/40",children:"Sort"}),a.jsx("select",{value:y,onChange:I=>w(I.target.value),className:"h-8 rounded-lg border border-white/[0.12] bg-white/[0.03] px-2 text-[11px] text-white/75 focus:border-[#BFFF00]/40 focus:outline-none",children:K.map(I=>a.jsx("option",{value:I.value,children:I.label},I.value))})]}),a.jsx("button",{type:"button",onClick:()=>b(I=>!I),className:`h-10 rounded-lg border px-3 text-[11px] uppercase tracking-[0.08em] transition-colors ${$||f>0?"border-[#BFFF00]/40 bg-[#BFFF00]/12 text-[#D8FFA1]":"border-white/[0.12] text-white/75 hover:border-white/[0.2] hover:text-white"}`,children:G}),a.jsxs("div",{className:"hidden lg:block text-[11px] text-white/55 whitespace-nowrap",children:[n,"/",t.length]}),m&&a.jsx("button",{type:"button",onClick:W,className:"h-10 rounded-lg border border-white/[0.12] px-2.5 text-[10px] uppercase tracking-[0.08em] text-white/70 transition-colors hover:border-white/[0.2] hover:text-white whitespace-nowrap",children:"Clear"}),a.jsx(Ir,{children:$&&a.jsxs(_e.div,{initial:{opacity:0,y:-4,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.97},transition:{duration:.15},className:"absolute right-0 top-12 z-30 w-[340px] max-w-[92vw] rounded-xl border border-white/[0.12] bg-[#090d14]/95 p-3 shadow-[0_16px_40px_rgba(0,0,0,0.45)] backdrop-blur-xl",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.1em] text-white/45",children:"Status"}),a.jsx("div",{className:"mt-2 max-h-44 space-y-1 overflow-auto pr-1",children:U.map(I=>{const J=s.includes(I.key);return a.jsxs("label",{className:"flex cursor-pointer items-center justify-between rounded-md border border-white/[0.08] bg-white/[0.02] px-2.5 py-1.5 text-[11px] text-white/80 hover:border-white/[0.14]",children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"checkbox",checked:J,onChange:()=>C(I.key),className:"h-3.5 w-3.5 accent-[#BFFF00]"}),a.jsx("span",{children:IS(I.key)})]}),a.jsx("span",{className:"text-[10px] text-white/50",children:I.count})]},I.key)})}),a.jsxs("div",{className:"mt-2 flex justify-between",children:[a.jsx("button",{type:"button",onClick:()=>j([]),className:`text-[10px] uppercase tracking-[0.08em] ${D>0?"text-white/70 hover:text-white":"text-white/35"}`,disabled:D===0,children:"Clear status"}),a.jsxs("div",{className:"text-[10px] text-white/45",children:[D," selected"]})]}),a.jsxs("div",{className:"mt-3 border-t border-white/[0.08] pt-3",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-[0.1em] text-white/45",children:"Date"}),a.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[a.jsxs("label",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-white/45",children:"Field"}),a.jsx("select",{value:o,onChange:I=>A(I.target.value),className:"h-9 rounded-lg border border-white/[0.12] bg-black/30 px-2 text-[11px] text-white focus:border-[#BFFF00]/40 focus:outline-none",children:_S.map(I=>a.jsx("option",{value:I.value,children:I.label},I.value))})]}),a.jsxs("label",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-white/45",children:"Condition"}),a.jsx("select",{value:u,onChange:I=>N(I.target.value),className:"h-9 rounded-lg border border-white/[0.12] bg-black/30 px-2 text-[11px] text-white focus:border-[#BFFF00]/40 focus:outline-none",children:O.map(I=>a.jsx("option",{value:I.value,children:I.label},I.value))})]})]}),u==="custom_range"&&a.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[a.jsxs("label",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-white/45",children:"Start"}),a.jsx("input",{type:"date",value:c,onChange:I=>_(I.target.value),className:"h-9 rounded-lg border border-white/[0.12] bg-black/30 px-2 text-[11px] text-white focus:border-[#BFFF00]/40 focus:outline-none"})]}),a.jsxs("label",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-white/45",children:"End"}),a.jsx("input",{type:"date",value:h,onChange:I=>B(I.target.value),className:"h-9 rounded-lg border border-white/[0.12] bg-black/30 px-2 text-[11px] text-white focus:border-[#BFFF00]/40 focus:outline-none"})]})]})]})]})})]})}function J0(t){return(t??"").trim().toLowerCase().replace(/[\s-]+/g,"_")}function vd(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function eg(t){if(!t)return null;const n=Date.parse(`${t}T00:00:00`);return Number.isFinite(n)?n:null}function BS(t,n){return n==="target"?t.targetDate??null:n==="created"?t.createdAt??null:t.updatedAt??t.createdAt??null}function VS(t,n){if(n==="status"){const s=new Map,o=["active","blocked","paused","completed"];for(const u of t){const c=u.status??"active",h=s.get(c)??[];h.push(u),s.set(c,h)}return o.filter(u=>s.has(u)).concat(Array.from(s.keys()).filter(u=>!o.includes(u))).map(u=>{var c;return{key:u,label:u.charAt(0).toUpperCase()+u.slice(1),count:((c=s.get(u))==null?void 0:c.length)??0,initiatives:s.get(u)??[]}})}if(n==="category"){const s=new Map;for(const o of t){const u=o.category??"Uncategorized",c=s.get(u)??[];c.push(o),s.set(u,c)}return Array.from(s.entries()).sort((o,u)=>o[0].localeCompare(u[0])).map(([o,u])=>({key:o,label:o,count:u.length,initiatives:u}))}if(n==="date"){const o=vd(new Date),u=o+7*864e5,c=o+30*864e5,h={overdue:[],this_week:[],this_month:[],later:[],no_date:[]};for(const m of t){const x=m.targetDate?Date.parse(m.targetDate):null;x===null||!Number.isFinite(x)?h.no_date.push(m):x<o?h.overdue.push(m):x<u?h.this_week.push(m):x<c?h.this_month.push(m):h.later.push(m)}const f={overdue:"Overdue",this_week:"This Week",this_month:"This Month",later:"Later",no_date:"No Date"};return["overdue","this_week","this_month","later","no_date"].filter(m=>h[m].length>0).map(m=>({key:m,label:f[m],count:h[m].length,initiatives:h[m]}))}return[]}function io(t,n){return`${t}:${n}`}function $S(t){return`mc-group-${t}`.toLowerCase().replace(/[^a-z0-9_-]+/g,"-")}function zS(t,n){if(t.size!==n.size)return!1;for(const s of t)if(!n.has(s))return!1;return!0}function US({initiatives:t,activities:n,agents:s,isLoading:o,authToken:u,embedMode:c,initialInitiativeId:h}){const f=ZN({activities:n,agents:s,initiatives:t});return a.jsx(tS,{agentEntityMap:f,authToken:u,embedMode:c,children:a.jsx(WS,{initiatives:t,isLoading:o,initialInitiativeId:h})})}function WS({initiatives:t,isLoading:n,initialInitiativeId:s}){const{searchQuery:o,setSearchQuery:u,statusFilters:c,dateField:h,datePreset:f,dateStart:m,dateEnd:x,hasActiveFilters:g,groupBy:y,sortBy:w,expandedInitiatives:j,expandAll:C,collapseAll:A,modalTarget:N,closeModal:_,expandInitiative:B}=ws(),W=k.useRef(!1),[$,b]=k.useState(new Set),F=k.useMemo(()=>{const J=vd(new Date),ne=o.toLowerCase().trim().split(/\s+/).filter(Boolean);return t.filter(le=>{if(c.length>0&&![J0(le.status),J0(le.rawStatus)].filter(Boolean).some(ge=>c.includes(ge)))return!1;const q=BS(le,h),R=q?Date.parse(q):Number.NaN,X=Number.isFinite(R)?vd(new Date(R)):null,Y=X===null?null:Math.round((X-J)/864e5);if(f==="missing"&&X!==null||f==="overdue"&&!(Y!==null&&Y<0)||f==="today"&&Y!==0||f==="next_7_days"&&!(Y!==null&&Y>=0&&Y<=7)||f==="next_30_days"&&!(Y!==null&&Y>=0&&Y<=30)||f==="past_7_days"&&!(Y!==null&&Y<=0&&Y>=-7)||f==="past_30_days"&&!(Y!==null&&Y<=0&&Y>=-30))return!1;if(f==="custom_range"){const L=eg(m),ge=eg(x);if(X===null||L!==null&&X<L||ge!==null&&X>ge)return!1}if(ne.length===0)return!0;const T=[le.name,le.description??"",le.status,le.rawStatus??"",le.category??""].join(" ").toLowerCase();return ne.every(L=>T.includes(L))})},[t,o,c,h,f,m,x]),U=k.useMemo(()=>w==="default"?F:[...F].sort((I,J)=>{const ne=I.targetDate?Date.parse(I.targetDate):Number.NaN,le=J.targetDate?Date.parse(J.targetDate):Number.NaN,q=Number.isFinite(ne),R=Number.isFinite(le);return!q&&!R?0:q?R?w==="date_asc"?ne-le:le-ne:-1:1}),[F,w]),D=k.useMemo(()=>y!=="none"?VS(U,y):null,[U,y]),O=k.useMemo(()=>(D==null?void 0:D.map(I=>io(y,I.key)))??[],[y,D]),G=O.length>0&&O.every(I=>$.has(I)),oe=k.useCallback(I=>{b(J=>{const ne=new Set(J);return ne.has(I)?ne.delete(I):ne.add(I),ne})},[]);k.useEffect(()=>{if(!D||D.length===0){b(J=>J.size===0?J:new Set);return}const I=new Set(D.map(J=>io(y,J.key)));b(J=>{const ne=new Set(Array.from(J).filter(le=>I.has(le)));return ne.size===0&&ne.add(io(y,D[0].key)),zS(ne,J)?J:ne})},[y,D]),k.useEffect(()=>{if(s&&!W.current&&!n&&t.length>0){if(B(s),D){const I=D.find(J=>J.initiatives.some(ne=>ne.id===s));if(I){const J=io(y,I.key);b(ne=>{if(ne.has(J))return ne;const le=new Set(ne);return le.add(J),le})}}W.current=!0,requestAnimationFrame(()=>{const I=document.getElementById(`initiative-${s}`);I==null||I.scrollIntoView({behavior:"smooth",block:"start"})})}},[s,n,t.length,B,y,D]);const K=U.length>0&&j.size>=U.length;return a.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[a.jsxs("div",{className:"relative flex-1 min-h-0",children:[a.jsx("div",{className:"pointer-events-none absolute top-0 left-0 right-0 h-6 bg-gradient-to-b from-[#02040A] to-transparent z-10"}),a.jsx("div",{className:"pointer-events-none absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-[#02040A] to-transparent z-10"}),a.jsx("div",{className:"h-full overflow-y-auto overflow-x-hidden",children:a.jsxs("div",{className:"mx-auto max-w-6xl space-y-4 px-4 py-4 pb-8 sm:px-6 lg:pb-6",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("div",{className:"min-w-[220px] flex-1",children:a.jsx(iy,{value:o,onChange:u,placeholder:"Search initiatives, status, or category..."})}),a.jsx(OS,{initiatives:t,visibleCount:F.length}),U.length>0&&a.jsx("button",{type:"button",onClick:()=>{K?A():C(U.map(I=>I.id))},className:"h-10 rounded-lg border border-white/[0.12] px-3 text-[11px] uppercase tracking-[0.08em] text-white/70 transition-colors hover:border-white/[0.2] hover:text-white whitespace-nowrap",children:K?"Collapse All":"Expand All"}),D&&O.length>0&&a.jsx("button",{type:"button",onClick:()=>{b(G?new Set:new Set(O))},className:"h-10 rounded-lg border border-white/[0.12] px-3 text-[11px] uppercase tracking-[0.08em] text-white/70 transition-colors hover:border-white/[0.2] hover:text-white whitespace-nowrap",children:G?"Collapse Groups":"Expand Groups"})]}),n?a.jsx("div",{className:"space-y-3",children:Array.from({length:4}).map((I,J)=>a.jsxs("div",{className:"glass-panel soft-shadow rounded-2xl p-4",children:[a.jsx(Co,{className:"h-4 w-2/5 rounded"}),a.jsx(Co,{className:"h-1 w-full rounded mt-3"})]},`mc-skeleton-${J}`))}):t.length===0?a.jsx(ES,{}):U.length===0?a.jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-white/[0.02] px-4 py-8 text-center",children:[a.jsx("div",{className:"text-[13px] font-medium text-white/85",children:"No initiatives match the current filters"}),a.jsx("div",{className:"mt-1 text-[12px] text-white/50",children:g?"Try adjusting status/date filters or clear them.":"Try a broader search phrase."})]}):D?a.jsx("div",{className:"space-y-4",children:D.map(I=>{const J=io(y,I.key),ne=$S(J),le=$.has(J);return a.jsxs("div",{children:[a.jsxs("button",{type:"button","aria-expanded":le,"aria-controls":ne,onClick:()=>oe(J),className:"mb-2 flex w-full items-center gap-2 rounded-lg border border-white/[0.06] bg-white/[0.02] px-3 py-2 text-left transition-colors hover:border-white/[0.14] hover:bg-white/[0.04]",children:[a.jsx("span",{"aria-hidden":!0,className:`inline-flex h-5 w-5 items-center justify-center rounded-md border border-white/[0.1] bg-white/[0.03] text-[11px] text-white/55 transition-transform ${le?"rotate-90":""}`,children:"▶"}),a.jsx("span",{className:"text-[12px] font-medium text-white/75",children:I.label}),a.jsx("span",{className:"rounded-full border border-white/[0.1] bg-white/[0.04] px-2 py-0.5 text-[10px] text-white/50",children:I.count}),a.jsx("span",{className:"ml-auto text-[10px] uppercase tracking-[0.08em] text-white/45",children:le?"Hide":"Show"})]}),le&&a.jsx("div",{id:ne,children:a.jsx(X0,{initiatives:I.initiatives})})]},I.key)})}):a.jsx(X0,{initiatives:U})]})})]}),a.jsx(FS,{target:N,onClose:_})]})}function HS(t){const n=t.toLowerCase();return n==="completed"||n==="done"?"completed":n==="blocked"||n==="at_risk"?"blocked":n==="paused"||n==="hold"?"paused":"active"}function KS(t){if(!t)return 0;const n=new Date(t),s=new Date;return Math.max(0,Math.ceil((n.getTime()-s.getTime())/864e5))}function QS(t){return{id:t.id,name:t.title,status:HS(t.status),rawStatus:t.status??null,health:t.progress_pct??0,daysRemaining:KS(t.target_date),targetDate:t.target_date??null,createdAt:t.created_at??null,updatedAt:t.updated_at??t.created_at??null,activeAgents:0,totalAgents:0,description:t.summary??void 0}}function GS(t){const n=t.toLowerCase();return!["deleted","archived","cancelled"].includes(n)}function qS(t){return yl({queryKey:Al.entities({type:"initiative"}),queryFn:async()=>{const n=await fetch("/orgx/api/entities?type=initiative&limit=300");return n.ok?((await n.json()).data??[]).filter(o=>GS(o.status??"")).sort((o,u)=>{const c=Date.parse(o.updated_at??o.created_at??"")||0;return(Date.parse(u.updated_at??u.created_at??"")||0)-c}).map(QS):[]},enabled:t,staleTime:6e4})}function XS(t){const n=(t??"").toLowerCase();return n==="completed"||n==="done"?"completed":n==="blocked"||n==="at_risk"?"blocked":n==="paused"||n==="hold"?"paused":"active"}function YS(t){const n=(t??"").toLowerCase();return!["deleted","archived","cancelled"].includes(n)}function ZS(t){return{id:t.id,name:t.title,status:XS(t.status),rawStatus:t.status??null,category:void 0,health:Math.max(0,Math.min(100,Math.round(t.progress??0))),daysRemaining:0,targetDate:t.targetDate??t.dueDate??t.etaEndAt??null,createdAt:t.createdAt??null,updatedAt:t.updatedAt??null,activeAgents:0,totalAgents:0,description:void 0}}function JS(t){return yl({queryKey:Al.liveInitiatives({limit:300}),queryFn:async()=>{const n=await fetch("/orgx/api/live/initiatives?limit=300");return n.ok?((await n.json()).initiatives??[]).filter(o=>YS(o.status)).map(ZS):[]},enabled:t,staleTime:3e4})}const e5={connected:"Live",reconnecting:"Reconnecting",disconnected:"Offline"},t5={connected:Q.lime,reconnecting:Q.amber,disconnected:Q.red},zc="orgx.mission_control.welcome.dismissed",tg={blocked:0,pending:1,queued:2,running:3,failed:4,cancelled:5,completed:6,archived:7};function yo(t){if(!t)return 0;const n=Date.parse(t);return Number.isFinite(n)?n:0}function ng(t,n){const s=tg[t.status]??99,o=tg[n.status]??99;return s!==o?s-o:yo(t.updatedAt??t.lastEventAt??t.startedAt)-yo(n.updatedAt??n.lastEventAt??n.startedAt)}function n5(){const t=cw();return t.showGate?a.jsx(Gj,{state:t.state,isLoading:t.isLoading,isStarting:t.isStarting,isSubmittingManual:t.isSubmittingManual,onRefresh:t.refreshStatus,onStartPairing:t.startPairing,onSubmitManualKey:t.submitManualKey,onBackToPairing:t.backToPairing,onUseManualKey:t.setManualMode,onSkip:t.skipGate}):a.jsx(o5,{onboardingState:t.state,onReconnect:t.resumeGate})}function r5(t){const n=t.toLowerCase();return/market|email|campaign|content|brand/.test(n)?"Marketing":/product|feature|ux|discovery/.test(n)?"Product":/engineer|infra|platform|api|backend|frontend|dev/.test(n)?"Engineering":"Program"}function s5(t){return t==="Marketing"?["Brief","Draft","Review","Ship"]:t==="Engineering"?["Spec","Dev","QA","Deploy"]:t==="Product"?["Brief","Define","Build","Ship"]:["Plan","Build","Review","Ship"]}function i5(){return a.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-lg border border-white/[0.12] bg-white/[0.04] p-0.5",children:a.jsx("img",{src:Sl,alt:"OrgX",className:"h-full w-full rounded-md object-contain"})})}function o5({onboardingState:t,onReconnect:n}){const s=t.hasApiKey&&t.connectionVerified,{data:o,isLoading:u,error:c,refetch:h,approveDecision:f,approveAllDecisions:m}=ow({useMock:!1,enabled:!0,enableDecisions:s}),x=s&&o.connection==="connected",[g,y]=k.useState(null),[w,j]=k.useState(null),[C,A]=k.useState(null),[N,_]=k.useState(!1),[B,W]=k.useState([]),$=k.useRef(null),b=k.useRef(null),[F,U]=k.useState("agents"),[D,O]=k.useState("initiatives"),[G,oe]=k.useState(()=>typeof window>"u"?!1:window.localStorage.getItem(zc)==="1");k.useEffect(()=>{typeof window>"u"||(G?window.localStorage.setItem(zc,"1"):window.localStorage.removeItem(zc))},[G]);const[K,I]=k.useState(()=>{if(new URLSearchParams(window.location.search).get("view")==="mission-control")return"mission-control";try{if(localStorage.getItem("orgx-dashboard-view")==="mission-control")return"mission-control"}catch{}return"activity"}),J=k.useCallback(ee=>{I(ee);try{localStorage.setItem("orgx-dashboard-view",ee)}catch{}},[]),{data:ne}=qS(K==="mission-control"),{data:le}=JS(K==="mission-control"),[q,R]=k.useState(null),[X,Y]=k.useState(""),[T,L]=k.useState(!1),ge=k.useCallback((ee,Ee)=>{R({type:ee,initiativeId:Ee}),Y(""),L(!1)},[]),ye=k.useCallback(()=>{R(null),Y(""),L(!1)},[]),Ce=k.useCallback(()=>{j(null)},[]);k.useEffect(()=>{var ve;const ee=((ve=o.sessions.nodes[0])==null?void 0:ve.id)??null;if(!ee){g!==null&&y(null);return}if(g===null){y(ee);return}o.sessions.nodes.some(ie=>ie.id===g)||y(ee)},[o.sessions.nodes,g]),k.useEffect(()=>{if(!w)return;o.sessions.nodes.some(Ee=>Ee.id===w)||j(null)},[w,o.sessions.nodes]);const Te=k.useCallback(ee=>{y(ee),j(ee)},[]),Ae=k.useMemo(()=>o.sessions.nodes.find(ee=>ee.id===w)??null,[w,o.sessions.nodes]),je=k.useMemo(()=>o.sessions.nodes.find(ee=>ee.id===g)??null,[o.sessions.nodes,g]),Fe=k.useMemo(()=>o.sessions.nodes.filter(ee=>["running","queued","pending"].includes(ee.status)).length,[o.sessions.nodes]),Qe=k.useMemo(()=>o.sessions.nodes.filter(ee=>ee.status==="blocked"||ee.blockers.length>0).length,[o.sessions.nodes]),Xt=k.useMemo(()=>{const ee=[{id:"sessions",label:"Sessions",value:o.sessions.nodes.length,color:Q.teal},{id:"active",label:"Active",value:Fe,color:Fe>0?Q.lime:Q.textMuted},{id:"blocked",label:"Blocked",value:Qe,color:Qe>0?Q.red:Q.textMuted},{id:"decisions",label:"Decisions",value:x?o.decisions.length:0,color:x&&o.decisions.length>0?Q.amber:Q.textMuted}];return o.handoffs.length>0&&ee.push({id:"handoffs",label:"Handoffs",value:o.handoffs.length,color:Q.iris}),ee},[Fe,Qe,o.decisions.length,o.handoffs.length,o.sessions.nodes.length,x]),$t=k.useMemo(()=>{const ee=[];return c&&ee.push({id:`stream-error:${c}`,kind:"error",title:"Live stream degraded",message:c}),o.connection!=="connected"&&ee.push({id:`connection:${o.connection}`,kind:o.connection==="disconnected"?"error":"info",title:o.connection==="disconnected"?"Connection lost":"Reconnecting",message:o.connection==="disconnected"?"Dashboard is offline. Some data may be stale.":"Live data is recovering. Some sections may be delayed."}),C&&ee.push({id:`ops:${C}`,kind:"info",title:"Update",message:C}),ee},[o.connection,c,C]);k.useEffect(()=>{const ee=new Set($t.map(Ee=>Ee.id));W(Ee=>Ee.filter(ve=>ee.has(ve)))},[$t]);const At=k.useMemo(()=>$t.filter(ee=>!B.includes(ee.id)),[B,$t]),ae=k.useCallback(ee=>{W(Ee=>Ee.includes(ee)?Ee:Ee.concat(ee))},[]),Me=k.useCallback(()=>{W($t.map(ee=>ee.id))},[$t]);k.useEffect(()=>{if(!N)return;const ee=ve=>{var Oe,ze;const ie=ve.target;ie&&((Oe=b.current)!=null&&Oe.contains(ie)||(ze=$.current)!=null&&ze.contains(ie)||_(!1))},Ee=ve=>{ve.key==="Escape"&&_(!1)};return document.addEventListener("mousedown",ee),document.addEventListener("touchstart",ee),document.addEventListener("keydown",Ee),()=>{document.removeEventListener("mousedown",ee),document.removeEventListener("touchstart",ee),document.removeEventListener("keydown",Ee)}},[N]);const Z=k.useMemo(()=>{var ve;const ee=new Map;for(const ie of o.sessions.nodes){const Oe=ie.initiativeId??ie.groupId??"unscoped",ze=ie.groupLabel&&ie.groupLabel.trim().length>0?ie.groupLabel:ie.initiativeId??"Unscoped Initiative",Dt=r5(ze),st=ee.get(Oe)??{id:Oe,name:ze,category:Dt,progressTotal:0,progressCount:0,statusCounts:{},activeAgents:new Set,allAgents:new Set,workstreams:new Map,latestEpoch:0};if(ie.progress!==null&&(st.progressTotal+=ie.progress,st.progressCount+=1),st.statusCounts[ie.status]=(st.statusCounts[ie.status]??0)+1,ie.agentName&&(st.allAgents.add(ie.agentName),["running","queued","pending","blocked"].includes(ie.status)&&st.activeAgents.add(ie.agentName)),ie.workstreamId){const Ut=o.sessions.groups.find(Br=>Br.id===ie.workstreamId),dn=((ve=Ut==null?void 0:Ut.label)==null?void 0:ve.trim())||ie.workstreamId;st.workstreams.set(ie.workstreamId,dn)}st.latestEpoch=Math.max(st.latestEpoch,yo(ie.updatedAt??ie.lastEventAt??ie.startedAt)),ee.set(Oe,st)}const Ee=[];for(const ie of ee.values()){const Oe=ie.progressCount>0?Math.round(ie.progressTotal/ie.progressCount):ie.statusCounts.completed?100:ie.statusCounts.running?55:0,ze=ie.category,Dt=s5(ze),st=Math.round(Math.max(0,Math.min(100,Oe))/100*(Dt.length-1)),Ut=(ie.statusCounts.blocked??0)>0,dn=(ie.statusCounts.completed??0)>0&&(ie.statusCounts.running??0)===0&&(ie.statusCounts.queued??0)===0&&(ie.statusCounts.pending??0)===0&&(ie.statusCounts.blocked??0)===0,Br=Dt.map((Vr,nr)=>{let $r="upcoming";return(dn||nr<st)&&($r="completed"),nr===st&&!dn&&($r=Ut?"warning":"current"),{name:Vr,status:$r}});Ee.push({id:ie.id,name:ie.name,status:dn?"completed":Ut?"blocked":"active",rawStatus:dn?"completed":Ut?"blocked":"active",category:ze,health:Math.max(0,Math.min(100,Oe)),phases:Br,currentPhase:dn?Dt.length-1:st,daysRemaining:0,targetDate:null,createdAt:ie.latestEpoch>0?new Date(ie.latestEpoch).toISOString():null,updatedAt:ie.latestEpoch>0?new Date(ie.latestEpoch).toISOString():null,activeAgents:ie.activeAgents.size,totalAgents:ie.allAgents.size,avatars:Array.from(ie.activeAgents).slice(0,3),description:`${ie.workstreams.size} workstreams are active right now.`,workstreams:Array.from(ie.workstreams.entries()).map(([Vr,nr])=>({id:Vr,name:nr,status:"active"}))})}return Ee.sort((ie,Oe)=>{const ze=ie.status==="blocked"?0:ie.status==="active"?1:2,Dt=Oe.status==="blocked"?0:Oe.status==="active"?1:2;return ze!==Dt?ze-Dt:Oe.health-ie.health})},[o.sessions.nodes,o.sessions.groups]),he=k.useMemo(()=>{const ee=(ve,ie)=>{var Oe,ze;return{...ve,...ie,health:ie.health>0?ie.health:ve.health,activeAgents:Math.max(ve.activeAgents,ie.activeAgents),totalAgents:Math.max(ve.totalAgents,ie.totalAgents),avatars:(Oe=ve.avatars)!=null&&Oe.length?ve.avatars:ie.avatars,workstreams:(ze=ve.workstreams)!=null&&ze.length?ve.workstreams:ie.workstreams,description:ve.description??ie.description,rawStatus:ie.rawStatus??ve.rawStatus??null,targetDate:ie.targetDate??ve.targetDate??null,createdAt:ie.createdAt??ve.createdAt??null,updatedAt:ie.updatedAt??ve.updatedAt??null}},Ee=new Map;for(const ve of Z)Ee.set(ve.id,ve);for(const ve of[...ne??[],...le??[]]){const ie=Ee.get(ve.id);Ee.set(ve.id,ie?ee(ie,ve):ve)}return Array.from(Ee.values()).sort((ve,ie)=>{const Oe=Ut=>Ut==="blocked"?0:Ut==="active"?1:Ut==="paused"?2:3,ze=Oe(ve.status)-Oe(ie.status);if(ze!==0)return ze;const Dt=yo(ie.updatedAt)-yo(ve.updatedAt);if(Dt!==0)return Dt;const st=ie.health-ve.health;return st!==0?st:ve.name.localeCompare(ie.name)})},[Z,ne,le]),$e=k.useMemo(()=>{if(!Ae)return null;const ee=Ae.agentName,Ee=Ae.title;if(ee){const ve=o.activity.find(ie=>{var Oe;return ie.runId===Ae.runId&&((Oe=ie.summary)==null?void 0:Oe.trim())});if(ve!=null&&ve.summary){const ie=ve.summary.trim().length>40?ve.summary.trim().slice(0,40)+"…":ve.summary.trim();return`${ee}: ${ie}`}return ee}if(Ee){const ve=Ee.replace(/^(telegram|slack|discord|whatsapp|email|sms):/,"").trim();if(ve.length>0)return ve}return Ee??null},[o.activity,Ae]),ot=t.connectionVerified&&!G,ht=k.useCallback(async()=>{if(o.sessions.nodes.length===0){A("No sessions available to continue.");return}const ee=[...o.sessions.nodes].sort(ng)[0];if(y(ee.id),j(ee.id),["blocked","pending","queued"].includes(ee.status))try{await fetch(`/orgx/api/runs/${encodeURIComponent(ee.runId)}/actions/resume`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:"continue_from_dashboard"})})}catch{}A(`Focused highest priority session: ${ee.title}`),await h()},[o.sessions.nodes,h]),zt=k.useCallback(async ee=>{if(y(ee.id),j(ee.id),!["running","completed","archived"].includes(ee.status))try{await fetch(`/orgx/api/runs/${encodeURIComponent(ee.runId)}/actions/resume`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:"dispatch_from_dashboard"})})}catch{}A(`Dispatch requested: ${ee.title}`),await h()},[h]),kn=k.useCallback(async()=>{var ve;if(!q||X.trim().length===0||T)return;L(!0);const ee=q.type,Ee=X.trim();try{const ie={type:ee,title:Ee,status:"active"};if(ee==="workstream"){const ze=q.initiativeId??(je==null?void 0:je.initiativeId)??((ve=Z[0])==null?void 0:ve.id)??null;if(!ze){A("Select an initiative first to start a workstream."),L(!1);return}ie.initiative_id=ze,ie.parentId=ze}const Oe=await fetch("/orgx/api/entities",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ie)});if(!Oe.ok){const ze=await Oe.json().catch(()=>null);throw new Error((ze==null?void 0:ze.error)??`Failed to create ${ee}.`)}A(`Created ${ee}: ${Ee}`),ye(),await h()}catch(ie){A(ie instanceof Error?ie.message:`Failed to create ${ee}.`),L(!1)}},[ye,T,q,X,Z,h,je==null?void 0:je.initiativeId]),tr=k.useCallback(()=>{ge("initiative")},[ge]),_n=k.useCallback(ee=>{ge("workstream",ee)},[ge]),Or=k.useCallback(()=>{var ee;return _n((je==null?void 0:je.initiativeId)??((ee=Z[0])==null?void 0:ee.id)??null)},[Z,je==null?void 0:je.initiativeId,_n]),bs=k.useCallback(ee=>{const Ee=[...o.sessions.nodes].filter(ve=>(ve.initiativeId??ve.groupId)===ee.id).sort(ng)[0];Ee&&(y(Ee.id),j(Ee.id),A(`Focused initiative: ${ee.name}`))},[o.sessions.nodes]);return u?a.jsxs("div",{className:"flex min-h-screen flex-col lg:h-screen",style:{backgroundColor:Q.background},children:[a.jsxs("div",{className:"border-b border-white/[0.06] px-4 py-2.5 sm:px-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"shimmer-skeleton h-6 w-6 rounded-lg"}),a.jsx("div",{className:"shimmer-skeleton h-5 w-28 rounded-md"}),a.jsx("div",{className:"shimmer-skeleton h-5 w-14 rounded-full"})]}),a.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:Array.from({length:4}).map((ee,Ee)=>a.jsx("div",{className:"shimmer-skeleton h-7 w-24 rounded-full"},Ee))})]}),a.jsxs("div",{className:"grid flex-1 grid-cols-1 gap-4 p-4 sm:p-5 lg:grid-cols-12",children:[a.jsx("div",{className:"shimmer-skeleton min-h-[240px] rounded-2xl lg:col-span-3"}),a.jsx("div",{className:"shimmer-skeleton min-h-[240px] rounded-2xl lg:col-span-6"}),a.jsxs("div",{className:"flex flex-col gap-4 lg:col-span-3",children:[a.jsx("div",{className:"shimmer-skeleton h-40 rounded-2xl"}),a.jsx("div",{className:"shimmer-skeleton h-48 rounded-2xl"}),a.jsx("div",{className:"shimmer-skeleton flex-1 rounded-2xl",style:{minHeight:160}})]})]})]}):a.jsxs("div",{className:"relative flex min-h-screen flex-col lg:h-screen lg:min-h-0 lg:overflow-hidden",style:{backgroundColor:Q.background},children:[typeof window<"u"&&window.location.port==="5173"&&a.jsx("div",{className:"absolute left-1/2 top-4 z-30 -translate-x-1/2",children:a.jsxs("div",{className:"rounded-full border border-white/[0.12] bg-white/[0.06] px-4 py-2 text-[11px] text-white/80 shadow-[0_10px_30px_rgba(0,0,0,0.35)] backdrop-blur",children:["Dev preview on 5173. Installed plugin runs on OpenClaw port"," ",a.jsx("a",{href:"http://127.0.0.1:18789/orgx/live/",className:"text-white underline underline-offset-4 hover:text-white/60",children:"18789"}),"."]})}),a.jsxs("div",{className:"pointer-events-none absolute inset-0",children:[a.jsx("div",{className:"ambient-orb orb-lime",style:{width:460,height:460,top:-180,left:-120}}),a.jsx("div",{className:"ambient-orb orb-teal",style:{width:520,height:520,top:-220,right:-180,animationDelay:"2s"}}),a.jsx("div",{className:"ambient-orb orb-iris",style:{width:420,height:420,bottom:-180,left:"30%",animationDelay:"4s"}}),a.jsx("div",{className:"grain-overlay absolute inset-0"})]}),a.jsxs("header",{className:"relative z-[180] border-b border-white/[0.06] px-4 py-1.5 sm:px-6",children:[a.jsxs("div",{className:"grid items-center gap-2.5 lg:grid-cols-[1fr_auto_1fr]",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[a.jsx(i5,{}),a.jsxs("h1",{className:"text-[17px] font-semibold tracking-tight text-white",children:["OrgX",a.jsx("span",{className:"ml-1.5 text-white/50",children:"Live"})]}),a.jsx(qj,{color:t5[o.connection],pulse:o.connection==="connected",children:e5[o.connection]??"Unknown"})]}),a.jsx("div",{className:"hidden items-center justify-center lg:flex",children:a.jsxs("div",{className:"flex rounded-full border border-white/[0.1] bg-white/[0.03] p-0.5",role:"group","aria-label":"Dashboard view",children:[a.jsx("button",{type:"button",onClick:()=>J("activity"),"aria-pressed":K==="activity",className:`rounded-full px-3 py-1 text-[12px] font-medium transition-all ${K==="activity"?"bg-white/[0.1] text-white":"text-white/55 hover:text-white/85"}`,children:"Activity"}),a.jsx("button",{type:"button",onClick:()=>J("mission-control"),"aria-pressed":K==="mission-control",className:`rounded-full px-3 py-1 text-[12px] font-medium transition-all ${K==="mission-control"?"bg-white/[0.1] text-white":"text-white/55 hover:text-white/85"}`,children:"Mission Control"})]})}),a.jsxs("div",{className:"relative isolate flex items-center justify-end gap-2",children:[o.lastActivity&&a.jsxs("span",{className:"hidden text-[12px] text-white/45 xl:inline",children:["Last activity: ",o.lastActivity]}),a.jsxs("button",{type:"button",ref:$,onClick:()=>_(ee=>!ee),title:"Notifications","aria-haspopup":"dialog","aria-expanded":N,"aria-controls":"header-notifications-panel",className:"relative inline-flex h-8 w-8 items-center justify-center rounded-full border border-white/[0.1] bg-white/[0.03] text-white/80 transition-colors hover:bg-white/[0.08]",children:[a.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M15 17h5l-1.4-1.4a2 2 0 0 1-.6-1.4V11a6 6 0 1 0-12 0v3.2c0 .53-.21 1.04-.59 1.42L4 17h5"}),a.jsx("path",{d:"M9 17a3 3 0 0 0 6 0"})]}),At.length>0&&a.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-h-[16px] min-w-[16px] items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-semibold text-white",children:At.length})]}),a.jsxs("button",{type:"button",onClick:h,className:"group inline-flex h-8 items-center gap-1.5 rounded-full border border-white/[0.1] bg-white/[0.03] px-3 text-[12px] text-white/80 transition-colors hover:bg-white/[0.08]",title:"Refresh data",children:[a.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform group-hover:rotate-45",children:[a.jsx("path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}),a.jsx("path",{d:"M21 3v5h-5"})]}),a.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]}),N&&a.jsxs("div",{id:"header-notifications-panel",ref:b,role:"dialog","aria-label":"Notifications",className:"absolute right-0 top-[calc(100%+8px)] z-[320] w-[min(92vw,380px)] rounded-2xl border border-white/[0.12] bg-[#070a11]/95 p-2 shadow-[0_20px_50px_rgba(0,0,0,0.45)] backdrop-blur",children:[a.jsxs("div",{className:"mb-1.5 flex items-center justify-between px-2 py-1",children:[a.jsx("p",{className:"text-[12px] font-semibold uppercase tracking-[0.12em] text-white/55",children:"Notifications"}),a.jsxs("div",{className:"flex items-center gap-2",children:[At.length>0&&a.jsx("button",{type:"button",onClick:Me,className:"text-[11px] text-white/45 transition-colors hover:text-white/80",children:"Dismiss all"}),a.jsx("button",{type:"button",onClick:()=>_(!1),className:"rounded-md px-1.5 py-0.5 text-[11px] text-white/45 transition-colors hover:bg-white/[0.08] hover:text-white/80","aria-label":"Close notifications",children:"Close"})]})]}),a.jsx("div",{className:"mb-1.5 flex flex-wrap items-center gap-1.5 px-1.5",children:Xt.map(ee=>a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-white/[0.1] bg-white/[0.03] px-2 py-0.5 text-[10px]",children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:ee.color}}),a.jsx("span",{className:"uppercase tracking-[0.08em] text-white/45",children:ee.label}),a.jsx("span",{className:"font-semibold text-white",style:{fontVariantNumeric:"tabular-nums"},children:ee.value})]},ee.id))}),At.length===0?a.jsx("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.02] px-3 py-3 text-[12px] text-white/45",children:"Everything looks clear."}):a.jsx("div",{className:"space-y-1.5",children:At.map(ee=>a.jsx("div",{className:"rounded-xl border px-3 py-2",style:{borderColor:ee.kind==="error"?"rgba(239,68,68,0.35)":"rgba(255,255,255,0.1)",backgroundColor:ee.kind==="error"?"rgba(239,68,68,0.08)":"rgba(255,255,255,0.02)"},children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-[12px] font-semibold",style:{color:ee.kind==="error"?"#fecaca":"#e2e8f0"},children:ee.title}),a.jsx("p",{className:"mt-0.5 text-[12px] leading-snug text-white/65",children:ee.message})]}),a.jsx("button",{type:"button",onClick:()=>ae(ee.id),className:"shrink-0 rounded-md px-1.5 py-0.5 text-[11px] text-white/45 transition-colors hover:bg-white/[0.08] hover:text-white/80",title:"Dismiss",children:"Dismiss"})]})},ee.id))})]})]})]}),a.jsx("div",{className:"mt-1.5 flex items-center justify-center lg:hidden",children:a.jsxs("div",{className:"flex rounded-full border border-white/[0.1] bg-white/[0.03] p-0.5",role:"group","aria-label":"Dashboard view",children:[a.jsx("button",{type:"button",onClick:()=>J("activity"),"aria-pressed":K==="activity",className:`rounded-full px-3 py-1 text-[12px] font-medium transition-all ${K==="activity"?"bg-white/[0.1] text-white":"text-white/55 hover:text-white/85"}`,children:"Activity"}),a.jsx("button",{type:"button",onClick:()=>J("mission-control"),"aria-pressed":K==="mission-control",className:`rounded-full px-3 py-1 text-[12px] font-medium transition-all ${K==="mission-control"?"bg-white/[0.1] text-white":"text-white/55 hover:text-white/85"}`,children:"Mission Control"})]})}),ot&&a.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-between gap-2 rounded-lg border border-[#7C7CFF]/30 bg-[#7C7CFF]/10 px-3 py-2 text-[12px] text-[#E6E4FF]",children:[a.jsx("span",{children:"Mission Control now includes a dependency map plus expandable hierarchy rows for initiatives, workstreams, milestones, and tasks."}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{type:"button",onClick:()=>J("mission-control"),className:"rounded-full border border-[#BFFF00]/30 bg-[#BFFF00]/15 px-2.5 py-1 text-[11px] text-[#D8FFA1]",children:"Open"}),a.jsx("button",{type:"button",onClick:()=>oe(!0),className:"text-[11px] text-white/65 underline underline-offset-2",children:"Dismiss"})]})]})]}),K==="mission-control"?a.jsx("div",{className:"relative z-0 flex-1 min-h-0 flex flex-col overflow-hidden",children:a.jsx(US,{initiatives:he,activities:[],agents:[],isLoading:u,authToken:null,embedMode:!1})}):a.jsxs("main",{className:"relative z-0 grid min-h-0 flex-1 grid-cols-1 gap-4 overflow-y-auto p-4 pb-20 sm:p-5 sm:pb-20 lg:grid-cols-12 lg:overflow-hidden lg:pb-5",children:[a.jsx("section",{className:`min-h-0 lg:col-span-3 lg:flex lg:flex-col lg:[&>section]:h-full ${F!=="agents"?"hidden lg:flex":""}`,children:a.jsx(cN,{sessions:o.sessions,activity:o.activity,selectedSessionId:g,onSelectSession:Te,onReconnect:n})}),a.jsx("section",{className:`min-h-0 lg:col-span-6 lg:flex lg:flex-col lg:[&>section]:h-full ${F!=="activity"?"hidden lg:flex":""}`,children:a.jsx(UN,{activity:o.activity,sessions:o.sessions.nodes,selectedRunIds:Ae?[Ae.runId,Ae.id]:[],selectedSessionLabel:$e,onClearSelection:Ce})}),a.jsxs("section",{className:`flex min-h-0 flex-col gap-2 lg:col-span-3 lg:gap-2 ${F!=="decisions"&&F!=="initiatives"?"hidden lg:flex":""}`,children:[a.jsx("div",{className:`min-h-0 ${D==="initiatives"?"flex-1":"flex-shrink-0"} `,children:D==="initiatives"?a.jsx(YN,{initiatives:Z,onInitiativeClick:bs,onCreateInitiative:tr,onCreateWorkstream:Or}):a.jsx(In,{className:"card-enter",children:a.jsxs("button",{onClick:()=>O("initiatives"),className:"flex w-full items-center justify-between px-4 py-3 text-left transition-colors hover:bg-white/[0.03]",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h2",{className:"text-[14px] font-semibold text-white",children:"Initiatives"}),Z.length>0&&a.jsx("span",{className:"chip text-[10px]",children:Z.length})]}),a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"-rotate-90 text-white/40",children:a.jsx("path",{d:"m6 9 6 6 6-6"})})]})})}),a.jsx("div",{className:`min-h-0 ${D==="decisions"?"flex-1":"flex-shrink-0"} ${F==="initiatives"?"hidden lg:block":""}`,children:D==="decisions"?x?a.jsx(HN,{decisions:o.decisions,onApproveDecision:f,onApproveAll:m}):a.jsxs(In,{className:"flex h-full min-h-[220px] flex-col card-enter",children:[a.jsxs("div",{className:"space-y-2 border-b border-white/[0.06] px-4 py-3.5",children:[a.jsx("h2",{className:"text-[14px] font-semibold text-white",children:"Decisions"}),a.jsx("p",{className:"text-[12px] text-white/45",children:"OrgX is not connected. Pending decision data is hidden in local-only mode."})]}),a.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-4 text-center",children:[a.jsx("p",{className:"text-[12px] text-white/45",children:"Connect OrgX to review and approve live decisions."}),n&&a.jsx("button",{onClick:n,className:"rounded-md border border-lime/25 bg-lime/10 px-3 py-1.5 text-[11px] font-semibold text-lime transition-colors hover:bg-lime/20",children:"Connect OrgX"})]})]}):a.jsx(In,{className:"card-enter",children:a.jsxs("button",{onClick:()=>O("decisions"),className:"flex w-full items-center justify-between px-4 py-3 text-left transition-colors hover:bg-white/[0.03]",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h2",{className:"text-[14px] font-semibold text-white",children:"Decisions"}),x&&o.decisions.length>0&&a.jsx("span",{className:"chip text-[10px]",style:{borderColor:`${Q.amber}44`,color:Q.amber},children:o.decisions.length}),!x&&a.jsx("span",{className:"text-[10px] text-white/30",children:"disconnected"})]}),a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"-rotate-90 text-white/40",children:a.jsx("path",{d:"m6 9 6 6 6-6"})})]})})}),a.jsx("div",{className:"hidden min-h-0 lg:flex lg:flex-1",children:a.jsx(fN,{session:je,activity:o.activity,initiatives:Z,onContinueHighestPriority:ht,onDispatchSession:zt,onStartInitiative:tr,onStartWorkstream:_n})})]})]}),a.jsx(Zj,{activeTab:F,onTabChange:U,pendingDecisionCount:x?o.decisions.length:0}),a.jsxs(lh,{open:q!==null,onClose:ye,maxWidth:"max-w-sm",children:[a.jsxs("div",{className:"px-5 pt-5 pb-1",children:[a.jsx("h3",{className:"text-[15px] font-semibold text-white",children:(q==null?void 0:q.type)==="workstream"?"New Workstream":"New Initiative"}),a.jsx("p",{className:"mt-1 text-[12px] text-white/45",children:(q==null?void 0:q.type)==="workstream"?"Create a new workstream under the selected initiative.":"Create a new initiative to organize your work."})]}),a.jsxs("div",{className:"px-5 py-3",children:[a.jsx("label",{className:"mb-1.5 block text-[11px] uppercase tracking-[0.1em] text-white/45",children:"Name"}),a.jsx("input",{value:X,onChange:ee=>Y(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"&&kn()},autoFocus:!0,placeholder:(q==null?void 0:q.type)==="workstream"?"e.g. User Onboarding Flow":"e.g. Q1 Product Launch",className:"w-full rounded-lg border border-white/[0.12] bg-black/30 px-3 py-2 text-[13px] text-white placeholder:text-white/30 focus:outline-none focus:ring-1 focus:ring-[#BFFF00]/40"})]}),a.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-white/[0.06] px-5 py-3",children:[a.jsx("button",{onClick:ye,className:"rounded-md px-3 py-1.5 text-[12px] text-white/60 transition-colors hover:text-white",children:"Cancel"}),a.jsx("button",{onClick:kn,disabled:X.trim().length===0||T,className:"rounded-md border border-lime/25 bg-lime/10 px-4 py-1.5 text-[12px] font-semibold text-lime transition-colors hover:bg-lime/20 disabled:opacity-45",children:T?"Creating…":"Create"})]})]})]})}const a5=new _1({defaultOptions:{queries:{staleTime:3e4,retry:1}}});d1.createRoot(document.getElementById("root")).render(a.jsx(k.StrictMode,{children:a.jsx(L1,{client:a5,children:a.jsx(n5,{})})}));
|