@grackle-ai/web 0.74.1 → 0.75.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-BUipATbG.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as ZS,a as b,j as c,v as XS,b as QS,t as Gr,i as WS,f as JS,M as th,c as nh}from"./markdown-gcy1Jmzi.js";import{r as eT,d as Zv,H as Xv,P as Qv,i as tT,B as nT,a as aT,C as sT,M as iT}from"./dagview-BA5TtMAQ.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function i(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(r){if(r.ep)return;r.ep=!0;const u=i(r);fetch(r.href,u)}})();var Yd={exports:{}},Yo={},Zd={exports:{}},Xd={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* scheduler.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Wv;function oT(){return Wv||(Wv=1,(function(t){function a(B,q){var oe=B.length;B.push(q);e:for(;0<oe;){var le=oe-1>>>1,F=B[le];if(0<r(F,q))B[le]=q,B[oe]=F,oe=le;else break e}}function i(B){return B.length===0?null:B[0]}function o(B){if(B.length===0)return null;var q=B[0],oe=B.pop();if(oe!==q){B[0]=oe;e:for(var le=0,F=B.length,ye=F>>>1;le<ye;){var Te=2*(le+1)-1,be=B[Te],ne=Te+1,ce=B[ne];if(0>r(be,oe))ne<F&&0>r(ce,be)?(B[le]=ce,B[ne]=oe,le=ne):(B[le]=be,B[Te]=oe,le=Te);else if(ne<F&&0>r(ce,oe))B[le]=ce,B[ne]=oe,le=ne;else break e}}return q}function r(B,q){var oe=B.sortIndex-q.sortIndex;return oe!==0?oe:B.id-q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var d=Date,p=d.now();t.unstable_now=function(){return d.now()-p}}var m=[],g=[],v=1,y=null,x=3,S=!1,T=!1,E=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(B){for(var q=i(g);q!==null;){if(q.callback===null)o(g);else if(q.startTime<=B)o(g),q.sortIndex=q.expirationTime,a(m,q);else break;q=i(g)}}function w(B){if(E=!1,R(B),!T)if(i(m)!==null)T=!0,G||(G=!0,se());else{var q=i(g);q!==null&&Q(w,q.startTime-B)}}var G=!1,z=-1,O=5,$=-1;function J(){return N?!0:!(t.unstable_now()-$<O)}function ae(){if(N=!1,G){var B=t.unstable_now();$=B;var q=!0;try{e:{T=!1,E&&(E=!1,j(z),z=-1),S=!0;var oe=x;try{t:{for(R(B),y=i(m);y!==null&&!(y.expirationTime>B&&J());){var le=y.callback;if(typeof le=="function"){y.callback=null,x=y.priorityLevel;var F=le(y.expirationTime<=B);if(B=t.unstable_now(),typeof F=="function"){y.callback=F,R(B),q=!0;break t}y===i(m)&&o(m),R(B)}else o(m);y=i(m)}if(y!==null)q=!0;else{var ye=i(g);ye!==null&&Q(w,ye.startTime-B),q=!1}}break e}finally{y=null,x=oe,S=!1}q=void 0}}finally{q?se():G=!1}}}var se;if(typeof A=="function")se=function(){A(ae)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,U=te.port2;te.port1.onmessage=ae,se=function(){U.postMessage(null)}}else se=function(){C(ae,0)};function Q(B,q){z=C(function(){B(t.unstable_now())},q)}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(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(B){switch(x){case 1:case 2:case 3:var q=3;break;default:q=x}var oe=x;x=q;try{return B()}finally{x=oe}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(B,q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var oe=x;x=B;try{return q()}finally{x=oe}},t.unstable_scheduleCallback=function(B,q,oe){var le=t.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?le+oe:le):oe=le,B){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=oe+F,B={id:v++,callback:q,priorityLevel:B,startTime:oe,expirationTime:F,sortIndex:-1},oe>le?(B.sortIndex=oe,a(g,B),i(m)===null&&B===i(g)&&(E?(j(z),z=-1):E=!0,Q(w,oe-le))):(B.sortIndex=F,a(m,B),T||S||(T=!0,G||(G=!0,se()))),B},t.unstable_shouldYield=J,t.unstable_wrapCallback=function(B){var q=x;return function(){var oe=x;x=q;try{return B.apply(this,arguments)}finally{x=oe}}}})(Xd)),Xd}var Jv;function lT(){return Jv||(Jv=1,Zd.exports=oT()),Zd.exports}/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react-dom-client.production.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var ey;function rT(){if(ey)return Yo;ey=1;var t=lT(),a=ZS(),i=eT();function o(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,s=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(s=n.return),e=n.return;while(e)}return n.tag===3?s:null}function d(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(u(e)!==e)throw Error(o(188))}function g(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(o(188));return n!==e?null:e}for(var s=e,l=n;;){var f=s.return;if(f===null)break;var h=f.alternate;if(h===null){if(l=f.return,l!==null){s=l;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===s)return m(f),e;if(h===l)return m(f),n;h=h.sibling}throw Error(o(188))}if(s.return!==l.return)s=f,l=h;else{for(var _=!1,k=f.child;k;){if(k===s){_=!0,s=f,l=h;break}if(k===l){_=!0,l=f,s=h;break}k=k.sibling}if(!_){for(k=h.child;k;){if(k===s){_=!0,s=h,l=f;break}if(k===l){_=!0,l=h,s=f;break}k=k.sibling}if(!_)throw Error(o(189))}}if(s.alternate!==l)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var te=Symbol.for("react.client.reference");function U(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case w:return"Suspense";case G:return"SuspenseList";case $:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case A:return e.displayName||"Context";case j:return(e._context.displayName||"Context")+".Consumer";case R:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return n=e.displayName||null,n!==null?n:U(e.type)||"Memo";case O:n=e._payload,e=e._init;try{return U(e(n))}catch{}}return null}var Q=Array.isArray,B=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},le=[],F=-1;function ye(e){return{current:e}}function Te(e){0>F||(e.current=le[F],le[F]=null,F--)}function be(e,n){F++,le[F]=e.current,e.current=n}var ne=ye(null),ce=ye(null),ee=ye(null),et=ye(null);function Me(e,n){switch(be(ee,n),be(ce,e),be(ne,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?yv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=yv(n),e=bv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Te(ne),be(ne,e)}function On(){Te(ne),Te(ce),Te(ee)}function Na(e){e.memoizedState!==null&&be(et,e);var n=ne.current,s=bv(n,e.type);n!==s&&(be(ce,e),be(ne,s))}function gn(e){ce.current===e&&(Te(ne),Te(ce)),et.current===e&&(Te(et),$o._currentValue=oe)}var Jn,ea;function vn(e){if(Jn===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);Jn=n&&n[1]||"",ea=-1<s.stack.indexOf(`
|
|
19
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
20
|
-
`+Jn+e+ea}var zn=!1;function ke(e,n){if(!e||zn)return"";zn=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(K){var P=K}Reflect.construct(e,[],W)}else{try{W.call()}catch(K){P=K}e.call(W.prototype)}}else{try{throw Error()}catch(K){P=K}(W=e())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(K){if(K&&P&&typeof K.stack=="string")return[K.stack,P.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),_=h[0],k=h[1];if(_&&k){var D=_.split(`
|
|
21
|
-
`),H=k.split(`
|
|
22
|
-
`);for(f=l=0;l<D.length&&!D[l].includes("DetermineComponentFrameRoot");)l++;for(;f<H.length&&!H[f].includes("DetermineComponentFrameRoot");)f++;if(l===D.length||f===H.length)for(l=D.length-1,f=H.length-1;1<=l&&0<=f&&D[l]!==H[f];)f--;for(;1<=l&&0<=f;l--,f--)if(D[l]!==H[f]){if(l!==1||f!==1)do if(l--,f--,0>f||D[l]!==H[f]){var Y=`
|
|
23
|
-
`+D[l].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=l&&0<=f);break}}}finally{zn=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?vn(s):""}function Nt(e,n){switch(e.tag){case 26:case 27:case 5:return vn(e.type);case 16:return vn("Lazy");case 13:return e.child!==n&&n!==null?vn("Suspense Fallback"):vn("Suspense");case 19:return vn("SuspenseList");case 0:case 15:return ke(e.type,!1);case 11:return ke(e.type.render,!1);case 1:return ke(e.type,!0);case 31:return vn("Activity");default:return""}}function to(e){try{var n="",s=null;do n+=Nt(e,s),s=e,e=e.return;while(e);return n}catch(l){return`
|
|
24
|
-
Error generating stack: `+l.message+`
|
|
25
|
-
`+l.stack}}var Fs=Object.prototype.hasOwnProperty,qs=t.unstable_scheduleCallback,Ks=t.unstable_cancelCallback,jl=t.unstable_shouldYield,wl=t.unstable_requestPaint,Vt=t.unstable_now,Bc=t.unstable_getCurrentPriorityLevel,X=t.unstable_ImmediatePriority,re=t.unstable_UserBlockingPriority,ue=t.unstable_NormalPriority,Se=t.unstable_LowPriority,ge=t.unstable_IdlePriority,We=t.log,je=t.unstable_setDisableYieldValue,tt=null,Ae=null;function st(e){if(typeof We=="function"&&je(e),Ae&&typeof Ae.setStrictMode=="function")try{Ae.setStrictMode(tt,e)}catch{}}var Fe=Math.clz32?Math.clz32:Ht,$t=Math.log,nn=Math.LN2;function Ht(e){return e>>>=0,e===0?32:31-($t(e)/nn|0)|0}var ja=256,yn=262144,wa=4194304;function ds(e){var n=e&42;if(n!==0)return n;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Al(e,n,s){var l=e.pendingLanes;if(l===0)return 0;var f=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var k=l&134217727;return k!==0?(l=k&~h,l!==0?f=ds(l):(_&=k,_!==0?f=ds(_):s||(s=k&~e,s!==0&&(f=ds(s))))):(k=l&~h,k!==0?f=ds(k):_!==0?f=ds(_):s||(s=l&~e,s!==0&&(f=ds(s)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,s=n&-n,h>=s||h===32&&(s&4194048)!==0)?n:f}function no(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function I_(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32: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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jh(){var e=wa;return wa<<=1,(wa&62914560)===0&&(wa=4194304),e}function Ic(e){for(var n=[],s=0;31>s;s++)n.push(e);return n}function ao(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function L_(e,n,s,l,f,h){var _=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var k=e.entanglements,D=e.expirationTimes,H=e.hiddenUpdates;for(s=_&~s;0<s;){var Y=31-Fe(s),W=1<<Y;k[Y]=0,D[Y]=-1;var P=H[Y];if(P!==null)for(H[Y]=null,Y=0;Y<P.length;Y++){var K=P[Y];K!==null&&(K.lane&=-536870913)}s&=~W}l!==0&&ep(e,l,0),h!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~n))}function ep(e,n,s){e.pendingLanes|=n,e.suspendedLanes&=~n;var l=31-Fe(n);e.entangledLanes|=n,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function tp(e,n){var s=e.entangledLanes|=n;for(e=e.entanglements;s;){var l=31-Fe(s),f=1<<l;f&n|e[l]&n&&(e[l]|=n),s&=~f}}function np(e,n){var s=n&-n;return s=(s&42)!==0?1:Lc(s),(s&(e.suspendedLanes|n))!==0?0:s}function Lc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Uc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ap(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:Pv(e.type))}function sp(e,n){var s=q.p;try{return q.p=e,n()}finally{q.p=s}}var Aa=Math.random().toString(36).slice(2),Ot="__reactFiber$"+Aa,Yt="__reactProps$"+Aa,Ys="__reactContainer$"+Aa,zc="__reactEvents$"+Aa,U_="__reactListeners$"+Aa,z_="__reactHandles$"+Aa,ip="__reactResources$"+Aa,so="__reactMarker$"+Aa;function Vc(e){delete e[Ot],delete e[Yt],delete e[zc],delete e[U_],delete e[z_]}function Zs(e){var n=e[Ot];if(n)return n;for(var s=e.parentNode;s;){if(n=s[Ys]||s[Ot]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=Ev(e);e!==null;){if(s=e[Ot])return s;e=Ev(e)}return n}e=s,s=e.parentNode}return null}function Xs(e){if(e=e[Ot]||e[Ys]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function io(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(o(33))}function Qs(e){var n=e[ip];return n||(n=e[ip]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Dt(e){e[so]=!0}var op=new Set,lp={};function fs(e,n){Ws(e,n),Ws(e+"Capture",n)}function Ws(e,n){for(lp[e]=n,e=0;e<n.length;e++)op.add(n[e])}var V_=RegExp("^[: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]*$"),rp={},cp={};function H_(e){return Fs.call(cp,e)?!0:Fs.call(rp,e)?!1:V_.test(e)?cp[e]=!0:(rp[e]=!0,!1)}function Dl(e,n,s){if(H_(n))if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var l=n.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+s)}}function Rl(e,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+s)}}function ta(e,n,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(n,s,""+l)}}function bn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function up(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function P_(e,n,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,h=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(_){s=""+_,h.call(this,_)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Hc(e){if(!e._valueTracker){var n=up(e)?"checked":"value";e._valueTracker=P_(e,n,""+e[n])}}function dp(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),l="";return e&&(l=up(e)?e.checked?"true":"false":e.value),e=l,e!==s?(n.setValue(e),!0):!1}function Ml(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}}var G_=/[\n"\\]/g;function xn(e){return e.replace(G_,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Pc(e,n,s,l,f,h,_,k){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),n!=null?_==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+bn(n)):e.value!==""+bn(n)&&(e.value=""+bn(n)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),n!=null?Gc(e,_,bn(n)):s!=null?Gc(e,_,bn(s)):l!=null&&e.removeAttribute("value"),f==null&&h!=null&&(e.defaultChecked=!!h),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+bn(k):e.removeAttribute("name")}function fp(e,n,s,l,f,h,_,k){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Hc(e);return}s=s!=null?""+bn(s):"",n=n!=null?""+bn(n):s,k||n===e.value||(e.value=n),e.defaultValue=n}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=k?e.checked:!!l,e.defaultChecked=!!l,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Hc(e)}function Gc(e,n,s){n==="number"&&Ml(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Js(e,n,s,l){if(e=e.options,n){n={};for(var f=0;f<s.length;f++)n["$"+s[f]]=!0;for(s=0;s<e.length;s++)f=n.hasOwnProperty("$"+e[s].value),e[s].selected!==f&&(e[s].selected=f),f&&l&&(e[s].defaultSelected=!0)}else{for(s=""+bn(s),n=null,f=0;f<e.length;f++){if(e[f].value===s){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function hp(e,n,s){if(n!=null&&(n=""+bn(n),n!==e.value&&(e.value=n),s==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=s!=null?""+bn(s):""}function pp(e,n,s,l){if(n==null){if(l!=null){if(s!=null)throw Error(o(92));if(Q(l)){if(1<l.length)throw Error(o(93));l=l[0]}s=l}s==null&&(s=""),n=s}s=bn(n),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),Hc(e)}function ei(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}var $_=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function mp(e,n,s){var l=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":l?e.setProperty(n,s):typeof s!="number"||s===0||$_.has(n)?n==="float"?e.cssFloat=s:e[n]=(""+s).trim():e[n]=s+"px"}function gp(e,n,s){if(n!=null&&typeof n!="object")throw Error(o(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||n!=null&&n.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var f in n)l=n[f],n.hasOwnProperty(f)&&s[f]!==l&&mp(e,f,l)}else for(var h in n)n.hasOwnProperty(h)&&mp(e,h,n[h])}function $c(e){if(e.indexOf("-")===-1)return!1;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 F_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),q_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ol(e){return q_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function na(){}var Fc=null;function qc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ti=null,ni=null;function vp(e){var n=Xs(e);if(n&&(e=n.stateNode)){var s=e[Yt]||null;e:switch(e=n.stateNode,n.type){case"input":if(Pc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+xn(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var l=s[n];if(l!==e&&l.form===e.form){var f=l[Yt]||null;if(!f)throw Error(o(90));Pc(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<s.length;n++)l=s[n],l.form===e.form&&dp(l)}break e;case"textarea":hp(e,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&Js(e,!!s.multiple,n,!1)}}}var Kc=!1;function yp(e,n,s){if(Kc)return e(n,s);Kc=!0;try{var l=e(n);return l}finally{if(Kc=!1,(ti!==null||ni!==null)&&(_r(),ti&&(n=ti,e=ni,ni=ti=null,vp(n),e)))for(n=0;n<e.length;n++)vp(e[n])}}function oo(e,n){var s=e.stateNode;if(s===null)return null;var l=s[Yt]||null;if(l===null)return null;s=l[n];e:switch(n){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(s&&typeof s!="function")throw Error(o(231,n,typeof s));return s}var aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yc=!1;if(aa)try{var lo={};Object.defineProperty(lo,"passive",{get:function(){Yc=!0}}),window.addEventListener("test",lo,lo),window.removeEventListener("test",lo,lo)}catch{Yc=!1}var Da=null,Zc=null,Bl=null;function bp(){if(Bl)return Bl;var e,n=Zc,s=n.length,l,f="value"in Da?Da.value:Da.textContent,h=f.length;for(e=0;e<s&&n[e]===f[e];e++);var _=s-e;for(l=1;l<=_&&n[s-l]===f[h-l];l++);return Bl=f.slice(e,1<l?1-l:void 0)}function Il(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ll(){return!0}function xp(){return!1}function Zt(e){function n(s,l,f,h,_){this._reactName=s,this._targetInst=f,this.type=l,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(s=e[k],this[k]=s?s(h):h[k]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ll:xp,this.isPropagationStopped=xp,this}return y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ll)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ll)},persist:function(){},isPersistent:Ll}),n}var hs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ul=Zt(hs),ro=y({},hs,{view:0,detail:0}),K_=Zt(ro),Xc,Qc,co,zl=y({},ro,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jc,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!==co&&(co&&e.type==="mousemove"?(Xc=e.screenX-co.screenX,Qc=e.screenY-co.screenY):Qc=Xc=0,co=e),Xc)},movementY:function(e){return"movementY"in e?e.movementY:Qc}}),_p=Zt(zl),Y_=y({},zl,{dataTransfer:0}),Z_=Zt(Y_),X_=y({},ro,{relatedTarget:0}),Wc=Zt(X_),Q_=y({},hs,{animationName:0,elapsedTime:0,pseudoElement:0}),W_=Zt(Q_),J_=y({},hs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),e1=Zt(J_),t1=y({},hs,{data:0}),Sp=Zt(t1),n1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a1={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"},s1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function i1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=s1[e])?!!n[e]:!1}function Jc(){return i1}var o1=y({},ro,{key:function(e){if(e.key){var n=n1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Il(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?a1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jc,charCode:function(e){return e.type==="keypress"?Il(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Il(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),l1=Zt(o1),r1=y({},zl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tp=Zt(r1),c1=y({},ro,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jc}),u1=Zt(c1),d1=y({},hs,{propertyName:0,elapsedTime:0,pseudoElement:0}),f1=Zt(d1),h1=y({},zl,{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}),p1=Zt(h1),m1=y({},hs,{newState:0,oldState:0}),g1=Zt(m1),v1=[9,13,27,32],eu=aa&&"CompositionEvent"in window,uo=null;aa&&"documentMode"in document&&(uo=document.documentMode);var y1=aa&&"TextEvent"in window&&!uo,kp=aa&&(!eu||uo&&8<uo&&11>=uo),Cp=" ",Ep=!1;function Np(e,n){switch(e){case"keyup":return v1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ai=!1;function b1(e,n){switch(e){case"compositionend":return jp(n);case"keypress":return n.which!==32?null:(Ep=!0,Cp);case"textInput":return e=n.data,e===Cp&&Ep?null:e;default:return null}}function x1(e,n){if(ai)return e==="compositionend"||!eu&&Np(e,n)?(e=bp(),Bl=Zc=Da=null,ai=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return kp&&n.locale!=="ko"?null:n.data;default:return null}}var _1={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 wp(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!_1[e.type]:n==="textarea"}function Ap(e,n,s,l){ti?ni?ni.push(l):ni=[l]:ti=l,n=jr(n,"onChange"),0<n.length&&(s=new Ul("onChange","change",null,s,l),e.push({event:s,listeners:n}))}var fo=null,ho=null;function S1(e){fv(e,0)}function Vl(e){var n=io(e);if(dp(n))return e}function Dp(e,n){if(e==="change")return n}var Rp=!1;if(aa){var tu;if(aa){var nu="oninput"in document;if(!nu){var Mp=document.createElement("div");Mp.setAttribute("oninput","return;"),nu=typeof Mp.oninput=="function"}tu=nu}else tu=!1;Rp=tu&&(!document.documentMode||9<document.documentMode)}function Op(){fo&&(fo.detachEvent("onpropertychange",Bp),ho=fo=null)}function Bp(e){if(e.propertyName==="value"&&Vl(ho)){var n=[];Ap(n,ho,e,qc(e)),yp(S1,n)}}function T1(e,n,s){e==="focusin"?(Op(),fo=n,ho=s,fo.attachEvent("onpropertychange",Bp)):e==="focusout"&&Op()}function k1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vl(ho)}function C1(e,n){if(e==="click")return Vl(n)}function E1(e,n){if(e==="input"||e==="change")return Vl(n)}function N1(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var an=typeof Object.is=="function"?Object.is:N1;function po(e,n){if(an(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var s=Object.keys(e),l=Object.keys(n);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var f=s[l];if(!Fs.call(n,f)||!an(e[f],n[f]))return!1}return!0}function Ip(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lp(e,n){var s=Ip(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=n&&l>=n)return{node:s,offset:n-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Ip(s)}}function Up(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Up(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function zp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Ml(e.document);n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=Ml(e.document)}return n}function au(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var j1=aa&&"documentMode"in document&&11>=document.documentMode,si=null,su=null,mo=null,iu=!1;function Vp(e,n,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;iu||si==null||si!==Ml(l)||(l=si,"selectionStart"in l&&au(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}),mo&&po(mo,l)||(mo=l,l=jr(su,"onSelect"),0<l.length&&(n=new Ul("onSelect","select",null,n,s),e.push({event:n,listeners:l}),n.target=si)))}function ps(e,n){var s={};return s[e.toLowerCase()]=n.toLowerCase(),s["Webkit"+e]="webkit"+n,s["Moz"+e]="moz"+n,s}var ii={animationend:ps("Animation","AnimationEnd"),animationiteration:ps("Animation","AnimationIteration"),animationstart:ps("Animation","AnimationStart"),transitionrun:ps("Transition","TransitionRun"),transitionstart:ps("Transition","TransitionStart"),transitioncancel:ps("Transition","TransitionCancel"),transitionend:ps("Transition","TransitionEnd")},ou={},Hp={};aa&&(Hp=document.createElement("div").style,"AnimationEvent"in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),"TransitionEvent"in window||delete ii.transitionend.transition);function ms(e){if(ou[e])return ou[e];if(!ii[e])return e;var n=ii[e],s;for(s in n)if(n.hasOwnProperty(s)&&s in Hp)return ou[e]=n[s];return e}var Pp=ms("animationend"),Gp=ms("animationiteration"),$p=ms("animationstart"),w1=ms("transitionrun"),A1=ms("transitionstart"),D1=ms("transitioncancel"),Fp=ms("transitionend"),qp=new Map,lu="abort auxClick beforeToggle 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(" ");lu.push("scrollEnd");function Bn(e,n){qp.set(e,n),fs(n,[e])}var Hl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},_n=[],oi=0,ru=0;function Pl(){for(var e=oi,n=ru=oi=0;n<e;){var s=_n[n];_n[n++]=null;var l=_n[n];_n[n++]=null;var f=_n[n];_n[n++]=null;var h=_n[n];if(_n[n++]=null,l!==null&&f!==null){var _=l.pending;_===null?f.next=f:(f.next=_.next,_.next=f),l.pending=f}h!==0&&Kp(s,f,h)}}function Gl(e,n,s,l){_n[oi++]=e,_n[oi++]=n,_n[oi++]=s,_n[oi++]=l,ru|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function cu(e,n,s,l){return Gl(e,n,s,l),$l(e)}function gs(e,n){return Gl(e,null,null,n),$l(e)}function Kp(e,n,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var f=!1,h=e.return;h!==null;)h.childLanes|=s,l=h.alternate,l!==null&&(l.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(f=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,f&&n!==null&&(f=31-Fe(s),e=h.hiddenUpdates,l=e[f],l===null?e[f]=[n]:l.push(n),n.lane=s|536870912),h):null}function $l(e){if(50<Lo)throw Lo=0,yd=null,Error(o(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var li={};function R1(e,n,s,l){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,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 sn(e,n,s,l){return new R1(e,n,s,l)}function uu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sa(e,n){var s=e.alternate;return s===null?(s=sn(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=n,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Yp(e,n){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,n=s.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Fl(e,n,s,l,f,h){var _=0;if(l=e,typeof e=="function")uu(e)&&(_=1);else if(typeof e=="string")_=LS(e,s,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=sn(31,s,n,f),e.elementType=$,e.lanes=h,e;case E:return vs(s.children,f,h,n);case N:_=8,f|=24;break;case C:return e=sn(12,s,n,f|2),e.elementType=C,e.lanes=h,e;case w:return e=sn(13,s,n,f),e.elementType=w,e.lanes=h,e;case G:return e=sn(19,s,n,f),e.elementType=G,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:_=10;break e;case j:_=9;break e;case R:_=11;break e;case z:_=14;break e;case O:_=16,l=null;break e}_=29,s=Error(o(130,e===null?"null":typeof e,"")),l=null}return n=sn(_,s,n,f),n.elementType=e,n.type=l,n.lanes=h,n}function vs(e,n,s,l){return e=sn(7,e,l,n),e.lanes=s,e}function du(e,n,s){return e=sn(6,e,null,n),e.lanes=s,e}function Zp(e){var n=sn(18,null,null,0);return n.stateNode=e,n}function fu(e,n,s){return n=sn(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Xp=new WeakMap;function Sn(e,n){if(typeof e=="object"&&e!==null){var s=Xp.get(e);return s!==void 0?s:(n={value:e,source:n,stack:to(n)},Xp.set(e,n),n)}return{value:e,source:n,stack:to(n)}}var ri=[],ci=0,ql=null,go=0,Tn=[],kn=0,Ra=null,Vn=1,Hn="";function ia(e,n){ri[ci++]=go,ri[ci++]=ql,ql=e,go=n}function Qp(e,n,s){Tn[kn++]=Vn,Tn[kn++]=Hn,Tn[kn++]=Ra,Ra=e;var l=Vn;e=Hn;var f=32-Fe(l)-1;l&=~(1<<f),s+=1;var h=32-Fe(n)+f;if(30<h){var _=f-f%5;h=(l&(1<<_)-1).toString(32),l>>=_,f-=_,Vn=1<<32-Fe(n)+f|s<<f|l,Hn=h+e}else Vn=1<<h|s<<f|l,Hn=e}function hu(e){e.return!==null&&(ia(e,1),Qp(e,1,0))}function pu(e){for(;e===ql;)ql=ri[--ci],ri[ci]=null,go=ri[--ci],ri[ci]=null;for(;e===Ra;)Ra=Tn[--kn],Tn[kn]=null,Hn=Tn[--kn],Tn[kn]=null,Vn=Tn[--kn],Tn[kn]=null}function Wp(e,n){Tn[kn++]=Vn,Tn[kn++]=Hn,Tn[kn++]=Ra,Vn=n.id,Hn=n.overflow,Ra=e}var Bt=null,it=null,Ie=!1,Ma=null,Cn=!1,mu=Error(o(519));function Oa(e){var n=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vo(Sn(n,e)),mu}function Jp(e){var n=e.stateNode,s=e.type,l=e.memoizedProps;switch(n[Ot]=e,n[Yt]=l,s){case"dialog":Re("cancel",n),Re("close",n);break;case"iframe":case"object":case"embed":Re("load",n);break;case"video":case"audio":for(s=0;s<zo.length;s++)Re(zo[s],n);break;case"source":Re("error",n);break;case"img":case"image":case"link":Re("error",n),Re("load",n);break;case"details":Re("toggle",n);break;case"input":Re("invalid",n),fp(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Re("invalid",n);break;case"textarea":Re("invalid",n),pp(n,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||l.suppressHydrationWarning===!0||gv(n.textContent,s)?(l.popover!=null&&(Re("beforetoggle",n),Re("toggle",n)),l.onScroll!=null&&Re("scroll",n),l.onScrollEnd!=null&&Re("scrollend",n),l.onClick!=null&&(n.onclick=na),n=!0):n=!1,n||Oa(e,!0)}function em(e){for(Bt=e.return;Bt;)switch(Bt.tag){case 5:case 31:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:Bt=Bt.return}}function ui(e){if(e!==Bt)return!1;if(!Ie)return em(e),Ie=!0,!1;var n=e.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Md(e.type,e.memoizedProps)),s=!s),s&&it&&Oa(e),em(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));it=Cv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));it=Cv(e)}else n===27?(n=it,Ya(e.type)?(e=Ud,Ud=null,it=e):it=n):it=Bt?Nn(e.stateNode.nextSibling):null;return!0}function ys(){it=Bt=null,Ie=!1}function gu(){var e=Ma;return e!==null&&(Jt===null?Jt=e:Jt.push.apply(Jt,e),Ma=null),e}function vo(e){Ma===null?Ma=[e]:Ma.push(e)}var vu=ye(null),bs=null,oa=null;function Ba(e,n,s){be(vu,n._currentValue),n._currentValue=s}function la(e){e._currentValue=vu.current,Te(vu)}function yu(e,n,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===s)break;e=e.return}}function bu(e,n,s,l){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var h=f.dependencies;if(h!==null){var _=f.child;h=h.firstContext;e:for(;h!==null;){var k=h;h=f;for(var D=0;D<n.length;D++)if(k.context===n[D]){h.lanes|=s,k=h.alternate,k!==null&&(k.lanes|=s),yu(h.return,s,e),l||(_=null);break e}h=k.next}}else if(f.tag===18){if(_=f.return,_===null)throw Error(o(341));_.lanes|=s,h=_.alternate,h!==null&&(h.lanes|=s),yu(_,s,e),_=null}else _=f.child;if(_!==null)_.return=f;else for(_=f;_!==null;){if(_===e){_=null;break}if(f=_.sibling,f!==null){f.return=_.return,_=f;break}_=_.return}f=_}}function di(e,n,s,l){e=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var _=f.alternate;if(_===null)throw Error(o(387));if(_=_.memoizedProps,_!==null){var k=f.type;an(f.pendingProps.value,_.value)||(e!==null?e.push(k):e=[k])}}else if(f===et.current){if(_=f.alternate,_===null)throw Error(o(387));_.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push($o):e=[$o])}f=f.return}e!==null&&bu(n,e,s,l),n.flags|=262144}function Kl(e){for(e=e.firstContext;e!==null;){if(!an(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xs(e){bs=e,oa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function It(e){return tm(bs,e)}function Yl(e,n){return bs===null&&xs(e),tm(e,n)}function tm(e,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},oa===null){if(e===null)throw Error(o(308));oa=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else oa=oa.next=n;return s}var M1=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){n.aborted=!0,e.forEach(function(s){return s()})}},O1=t.unstable_scheduleCallback,B1=t.unstable_NormalPriority,xt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xu(){return{controller:new M1,data:new Map,refCount:0}}function yo(e){e.refCount--,e.refCount===0&&O1(B1,function(){e.controller.abort()})}var bo=null,_u=0,fi=0,hi=null;function I1(e,n){if(bo===null){var s=bo=[];_u=0,fi=kd(),hi={status:"pending",value:void 0,then:function(l){s.push(l)}}}return _u++,n.then(nm,nm),n}function nm(){if(--_u===0&&bo!==null){hi!==null&&(hi.status="fulfilled");var e=bo;bo=null,fi=0,hi=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function L1(e,n){var s=[],l={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return e.then(function(){l.status="fulfilled",l.value=n;for(var f=0;f<s.length;f++)(0,s[f])(n)},function(f){for(l.status="rejected",l.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),l}var am=B.S;B.S=function(e,n){Vg=Vt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&I1(e,n),am!==null&&am(e,n)};var _s=ye(null);function Su(){var e=_s.current;return e!==null?e:Je.pooledCache}function Zl(e,n){n===null?be(_s,_s.current):be(_s,n.pool)}function sm(){var e=Su();return e===null?null:{parent:xt._currentValue,pool:e}}var pi=Error(o(460)),Tu=Error(o(474)),Xl=Error(o(542)),Ql={then:function(){}};function im(e){return e=e.status,e==="fulfilled"||e==="rejected"}function om(e,n,s){switch(s=e[s],s===void 0?e.push(n):s!==n&&(n.then(na,na),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,rm(e),e;default:if(typeof n.status=="string")n.then(na,na);else{if(e=Je,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=n,e.status="pending",e.then(function(l){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=l}},function(l){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=l}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,rm(e),e}throw Ts=n,pi}}function Ss(e){try{var n=e._init;return n(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ts=s,pi):s}}var Ts=null;function lm(){if(Ts===null)throw Error(o(459));var e=Ts;return Ts=null,e}function rm(e){if(e===pi||e===Xl)throw Error(o(483))}var mi=null,xo=0;function Wl(e){var n=xo;return xo+=1,mi===null&&(mi=[]),om(mi,e,n)}function _o(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Jl(e,n){throw n.$$typeof===x?Error(o(525)):(e=Object.prototype.toString.call(n),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function cm(e){function n(I,M){if(e){var V=I.deletions;V===null?(I.deletions=[M],I.flags|=16):V.push(M)}}function s(I,M){if(!e)return null;for(;M!==null;)n(I,M),M=M.sibling;return null}function l(I){for(var M=new Map;I!==null;)I.key!==null?M.set(I.key,I):M.set(I.index,I),I=I.sibling;return M}function f(I,M){return I=sa(I,M),I.index=0,I.sibling=null,I}function h(I,M,V){return I.index=V,e?(V=I.alternate,V!==null?(V=V.index,V<M?(I.flags|=67108866,M):V):(I.flags|=67108866,M)):(I.flags|=1048576,M)}function _(I){return e&&I.alternate===null&&(I.flags|=67108866),I}function k(I,M,V,Z){return M===null||M.tag!==6?(M=du(V,I.mode,Z),M.return=I,M):(M=f(M,V),M.return=I,M)}function D(I,M,V,Z){var pe=V.type;return pe===E?Y(I,M,V.props.children,Z,V.key):M!==null&&(M.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===O&&Ss(pe)===M.type)?(M=f(M,V.props),_o(M,V),M.return=I,M):(M=Fl(V.type,V.key,V.props,null,I.mode,Z),_o(M,V),M.return=I,M)}function H(I,M,V,Z){return M===null||M.tag!==4||M.stateNode.containerInfo!==V.containerInfo||M.stateNode.implementation!==V.implementation?(M=fu(V,I.mode,Z),M.return=I,M):(M=f(M,V.children||[]),M.return=I,M)}function Y(I,M,V,Z,pe){return M===null||M.tag!==7?(M=vs(V,I.mode,Z,pe),M.return=I,M):(M=f(M,V),M.return=I,M)}function W(I,M,V){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=du(""+M,I.mode,V),M.return=I,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case S:return V=Fl(M.type,M.key,M.props,null,I.mode,V),_o(V,M),V.return=I,V;case T:return M=fu(M,I.mode,V),M.return=I,M;case O:return M=Ss(M),W(I,M,V)}if(Q(M)||se(M))return M=vs(M,I.mode,V,null),M.return=I,M;if(typeof M.then=="function")return W(I,Wl(M),V);if(M.$$typeof===A)return W(I,Yl(I,M),V);Jl(I,M)}return null}function P(I,M,V,Z){var pe=M!==null?M.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return pe!==null?null:k(I,M,""+V,Z);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case S:return V.key===pe?D(I,M,V,Z):null;case T:return V.key===pe?H(I,M,V,Z):null;case O:return V=Ss(V),P(I,M,V,Z)}if(Q(V)||se(V))return pe!==null?null:Y(I,M,V,Z,null);if(typeof V.then=="function")return P(I,M,Wl(V),Z);if(V.$$typeof===A)return P(I,M,Yl(I,V),Z);Jl(I,V)}return null}function K(I,M,V,Z,pe){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return I=I.get(V)||null,k(M,I,""+Z,pe);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:return I=I.get(Z.key===null?V:Z.key)||null,D(M,I,Z,pe);case T:return I=I.get(Z.key===null?V:Z.key)||null,H(M,I,Z,pe);case O:return Z=Ss(Z),K(I,M,V,Z,pe)}if(Q(Z)||se(Z))return I=I.get(V)||null,Y(M,I,Z,pe,null);if(typeof Z.then=="function")return K(I,M,V,Wl(Z),pe);if(Z.$$typeof===A)return K(I,M,V,Yl(M,Z),pe);Jl(M,Z)}return null}function de(I,M,V,Z){for(var pe=null,Ve=null,he=M,Ne=M=0,Be=null;he!==null&&Ne<V.length;Ne++){he.index>Ne?(Be=he,he=null):Be=he.sibling;var He=P(I,he,V[Ne],Z);if(He===null){he===null&&(he=Be);break}e&&he&&He.alternate===null&&n(I,he),M=h(He,M,Ne),Ve===null?pe=He:Ve.sibling=He,Ve=He,he=Be}if(Ne===V.length)return s(I,he),Ie&&ia(I,Ne),pe;if(he===null){for(;Ne<V.length;Ne++)he=W(I,V[Ne],Z),he!==null&&(M=h(he,M,Ne),Ve===null?pe=he:Ve.sibling=he,Ve=he);return Ie&&ia(I,Ne),pe}for(he=l(he);Ne<V.length;Ne++)Be=K(he,I,Ne,V[Ne],Z),Be!==null&&(e&&Be.alternate!==null&&he.delete(Be.key===null?Ne:Be.key),M=h(Be,M,Ne),Ve===null?pe=Be:Ve.sibling=Be,Ve=Be);return e&&he.forEach(function(Ja){return n(I,Ja)}),Ie&&ia(I,Ne),pe}function ve(I,M,V,Z){if(V==null)throw Error(o(151));for(var pe=null,Ve=null,he=M,Ne=M=0,Be=null,He=V.next();he!==null&&!He.done;Ne++,He=V.next()){he.index>Ne?(Be=he,he=null):Be=he.sibling;var Ja=P(I,he,He.value,Z);if(Ja===null){he===null&&(he=Be);break}e&&he&&Ja.alternate===null&&n(I,he),M=h(Ja,M,Ne),Ve===null?pe=Ja:Ve.sibling=Ja,Ve=Ja,he=Be}if(He.done)return s(I,he),Ie&&ia(I,Ne),pe;if(he===null){for(;!He.done;Ne++,He=V.next())He=W(I,He.value,Z),He!==null&&(M=h(He,M,Ne),Ve===null?pe=He:Ve.sibling=He,Ve=He);return Ie&&ia(I,Ne),pe}for(he=l(he);!He.done;Ne++,He=V.next())He=K(he,I,Ne,He.value,Z),He!==null&&(e&&He.alternate!==null&&he.delete(He.key===null?Ne:He.key),M=h(He,M,Ne),Ve===null?pe=He:Ve.sibling=He,Ve=He);return e&&he.forEach(function(YS){return n(I,YS)}),Ie&&ia(I,Ne),pe}function Qe(I,M,V,Z){if(typeof V=="object"&&V!==null&&V.type===E&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case S:e:{for(var pe=V.key;M!==null;){if(M.key===pe){if(pe=V.type,pe===E){if(M.tag===7){s(I,M.sibling),Z=f(M,V.props.children),Z.return=I,I=Z;break e}}else if(M.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===O&&Ss(pe)===M.type){s(I,M.sibling),Z=f(M,V.props),_o(Z,V),Z.return=I,I=Z;break e}s(I,M);break}else n(I,M);M=M.sibling}V.type===E?(Z=vs(V.props.children,I.mode,Z,V.key),Z.return=I,I=Z):(Z=Fl(V.type,V.key,V.props,null,I.mode,Z),_o(Z,V),Z.return=I,I=Z)}return _(I);case T:e:{for(pe=V.key;M!==null;){if(M.key===pe)if(M.tag===4&&M.stateNode.containerInfo===V.containerInfo&&M.stateNode.implementation===V.implementation){s(I,M.sibling),Z=f(M,V.children||[]),Z.return=I,I=Z;break e}else{s(I,M);break}else n(I,M);M=M.sibling}Z=fu(V,I.mode,Z),Z.return=I,I=Z}return _(I);case O:return V=Ss(V),Qe(I,M,V,Z)}if(Q(V))return de(I,M,V,Z);if(se(V)){if(pe=se(V),typeof pe!="function")throw Error(o(150));return V=pe.call(V),ve(I,M,V,Z)}if(typeof V.then=="function")return Qe(I,M,Wl(V),Z);if(V.$$typeof===A)return Qe(I,M,Yl(I,V),Z);Jl(I,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,M!==null&&M.tag===6?(s(I,M.sibling),Z=f(M,V),Z.return=I,I=Z):(s(I,M),Z=du(V,I.mode,Z),Z.return=I,I=Z),_(I)):s(I,M)}return function(I,M,V,Z){try{xo=0;var pe=Qe(I,M,V,Z);return mi=null,pe}catch(he){if(he===pi||he===Xl)throw he;var Ve=sn(29,he,null,I.mode);return Ve.lanes=Z,Ve.return=I,Ve}finally{}}}var ks=cm(!0),um=cm(!1),Ia=!1;function ku(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cu(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,n,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ge&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,n=$l(e),Kp(e,null,s),n}return Gl(e,l,n,s),$l(e)}function So(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,s|=l,n.lanes=s,tp(e,s)}}function Eu(e,n){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var f=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?f=h=_:h=h.next=_,s=s.next}while(s!==null);h===null?f=h=n:h=h.next=n}else f=h=n;s={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}var Nu=!1;function To(){if(Nu){var e=hi;if(e!==null)throw e}}function ko(e,n,s,l){Nu=!1;var f=e.updateQueue;Ia=!1;var h=f.firstBaseUpdate,_=f.lastBaseUpdate,k=f.shared.pending;if(k!==null){f.shared.pending=null;var D=k,H=D.next;D.next=null,_===null?h=H:_.next=H,_=D;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,k=Y.lastBaseUpdate,k!==_&&(k===null?Y.firstBaseUpdate=H:k.next=H,Y.lastBaseUpdate=D))}if(h!==null){var W=f.baseState;_=0,Y=H=D=null,k=h;do{var P=k.lane&-536870913,K=P!==k.lane;if(K?(Oe&P)===P:(l&P)===P){P!==0&&P===fi&&(Nu=!0),Y!==null&&(Y=Y.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var de=e,ve=k;P=n;var Qe=s;switch(ve.tag){case 1:if(de=ve.payload,typeof de=="function"){W=de.call(Qe,W,P);break e}W=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=ve.payload,P=typeof de=="function"?de.call(Qe,W,P):de,P==null)break e;W=y({},W,P);break e;case 2:Ia=!0}}P=k.callback,P!==null&&(e.flags|=64,K&&(e.flags|=8192),K=f.callbacks,K===null?f.callbacks=[P]:K.push(P))}else K={lane:P,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Y===null?(H=Y=K,D=W):Y=Y.next=K,_|=P;if(k=k.next,k===null){if(k=f.shared.pending,k===null)break;K=k,k=K.next,K.next=null,f.lastBaseUpdate=K,f.shared.pending=null}}while(!0);Y===null&&(D=W),f.baseState=D,f.firstBaseUpdate=H,f.lastBaseUpdate=Y,h===null&&(f.shared.lanes=0),Ga|=_,e.lanes=_,e.memoizedState=W}}function dm(e,n){if(typeof e!="function")throw Error(o(191,e));e.call(n)}function fm(e,n){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)dm(s[e],n)}var gi=ye(null),er=ye(0);function hm(e,n){e=ga,be(er,e),be(gi,n),ga=e|n.baseLanes}function ju(){be(er,ga),be(gi,gi.current)}function wu(){ga=er.current,Te(gi),Te(er)}var on=ye(null),En=null;function za(e){var n=e.alternate;be(vt,vt.current&1),be(on,e),En===null&&(n===null||gi.current!==null||n.memoizedState!==null)&&(En=e)}function Au(e){be(vt,vt.current),be(on,e),En===null&&(En=e)}function pm(e){e.tag===22?(be(vt,vt.current),be(on,e),En===null&&(En=e)):Va()}function Va(){be(vt,vt.current),be(on,on.current)}function ln(e){Te(on),En===e&&(En=null),Te(vt)}var vt=ye(0);function tr(e){for(var n=e;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Id(s)||Ld(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ra=0,Ee=null,Ze=null,_t=null,nr=!1,vi=!1,Cs=!1,ar=0,Co=0,yi=null,U1=0;function pt(){throw Error(o(321))}function Du(e,n){if(n===null)return!1;for(var s=0;s<n.length&&s<e.length;s++)if(!an(e[s],n[s]))return!1;return!0}function Ru(e,n,s,l,f,h){return ra=h,Ee=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,B.H=e===null||e.memoizedState===null?Qm:Ku,Cs=!1,h=s(l,f),Cs=!1,vi&&(h=gm(n,s,l,f)),mm(e),h}function mm(e){B.H=jo;var n=Ze!==null&&Ze.next!==null;if(ra=0,_t=Ze=Ee=null,nr=!1,Co=0,yi=null,n)throw Error(o(300));e===null||St||(e=e.dependencies,e!==null&&Kl(e)&&(St=!0))}function gm(e,n,s,l){Ee=e;var f=0;do{if(vi&&(yi=null),Co=0,vi=!1,25<=f)throw Error(o(301));if(f+=1,_t=Ze=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}B.H=Wm,h=n(s,l)}while(vi);return h}function z1(){var e=B.H,n=e.useState()[0];return n=typeof n.then=="function"?Eo(n):n,e=e.useState()[0],(Ze!==null?Ze.memoizedState:null)!==e&&(Ee.flags|=1024),n}function Mu(){var e=ar!==0;return ar=0,e}function Ou(e,n,s){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~s}function Bu(e){if(nr){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}nr=!1}ra=0,_t=Ze=Ee=null,vi=!1,Co=ar=0,yi=null}function Ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?Ee.memoizedState=_t=e:_t=_t.next=e,_t}function yt(){if(Ze===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var n=_t===null?Ee.memoizedState:_t.next;if(n!==null)_t=n,Ze=e;else{if(e===null)throw Ee.alternate===null?Error(o(467)):Error(o(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},_t===null?Ee.memoizedState=_t=e:_t=_t.next=e}return _t}function sr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(e){var n=Co;return Co+=1,yi===null&&(yi=[]),e=om(yi,e,n),n=Ee,(_t===null?n.memoizedState:_t.next)===null&&(n=n.alternate,B.H=n===null||n.memoizedState===null?Qm:Ku),e}function ir(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Eo(e);if(e.$$typeof===A)return It(e)}throw Error(o(438,String(e)))}function Iu(e){var n=null,s=Ee.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var l=Ee.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(n={data:l.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=sr(),Ee.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(e),l=0;l<e;l++)s[l]=J;return n.index++,s}function ca(e,n){return typeof n=="function"?n(e):n}function or(e){var n=yt();return Lu(n,Ze,e)}function Lu(e,n,s){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=s;var f=e.baseQueue,h=l.pending;if(h!==null){if(f!==null){var _=f.next;f.next=h.next,h.next=_}n.baseQueue=f=h,l.pending=null}if(h=e.baseState,f===null)e.memoizedState=h;else{n=f.next;var k=_=null,D=null,H=n,Y=!1;do{var W=H.lane&-536870913;if(W!==H.lane?(Oe&W)===W:(ra&W)===W){var P=H.revertLane;if(P===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),W===fi&&(Y=!0);else if((ra&P)===P){H=H.next,P===fi&&(Y=!0);continue}else W={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},D===null?(k=D=W,_=h):D=D.next=W,Ee.lanes|=P,Ga|=P;W=H.action,Cs&&s(h,W),h=H.hasEagerState?H.eagerState:s(h,W)}else P={lane:W,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},D===null?(k=D=P,_=h):D=D.next=P,Ee.lanes|=W,Ga|=W;H=H.next}while(H!==null&&H!==n);if(D===null?_=h:D.next=k,!an(h,e.memoizedState)&&(St=!0,Y&&(s=hi,s!==null)))throw s;e.memoizedState=h,e.baseState=_,e.baseQueue=D,l.lastRenderedState=h}return f===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Uu(e){var n=yt(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var l=s.dispatch,f=s.pending,h=n.memoizedState;if(f!==null){s.pending=null;var _=f=f.next;do h=e(h,_.action),_=_.next;while(_!==f);an(h,n.memoizedState)||(St=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),s.lastRenderedState=h}return[h,l]}function vm(e,n,s){var l=Ee,f=yt(),h=Ie;if(h){if(s===void 0)throw Error(o(407));s=s()}else s=n();var _=!an((Ze||f).memoizedState,s);if(_&&(f.memoizedState=s,St=!0),f=f.queue,Hu(xm.bind(null,l,f,e),[e]),f.getSnapshot!==n||_||_t!==null&&_t.memoizedState.tag&1){if(l.flags|=2048,bi(9,{destroy:void 0},bm.bind(null,l,f,s,n),null),Je===null)throw Error(o(349));h||(ra&127)!==0||ym(l,n,s)}return s}function ym(e,n,s){e.flags|=16384,e={getSnapshot:n,value:s},n=Ee.updateQueue,n===null?(n=sr(),Ee.updateQueue=n,n.stores=[e]):(s=n.stores,s===null?n.stores=[e]:s.push(e))}function bm(e,n,s,l){n.value=s,n.getSnapshot=l,_m(n)&&Sm(e)}function xm(e,n,s){return s(function(){_m(n)&&Sm(e)})}function _m(e){var n=e.getSnapshot;e=e.value;try{var s=n();return!an(e,s)}catch{return!0}}function Sm(e){var n=gs(e,2);n!==null&&en(n,e,2)}function zu(e){var n=Ft();if(typeof e=="function"){var s=e;if(e=s(),Cs){st(!0);try{s()}finally{st(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:e},n}function Tm(e,n,s,l){return e.baseState=s,Lu(e,Ze,typeof l=="function"?l:ca)}function V1(e,n,s,l,f){if(cr(e))throw Error(o(485));if(e=n.action,e!==null){var h={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){h.listeners.push(_)}};B.T!==null?s(!0):h.isTransition=!1,l(h),s=n.pending,s===null?(h.next=n.pending=h,km(n,h)):(h.next=s.next,n.pending=s.next=h)}}function km(e,n){var s=n.action,l=n.payload,f=e.state;if(n.isTransition){var h=B.T,_={};B.T=_;try{var k=s(f,l),D=B.S;D!==null&&D(_,k),Cm(e,n,k)}catch(H){Vu(e,n,H)}finally{h!==null&&_.types!==null&&(h.types=_.types),B.T=h}}else try{h=s(f,l),Cm(e,n,h)}catch(H){Vu(e,n,H)}}function Cm(e,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Em(e,n,l)},function(l){return Vu(e,n,l)}):Em(e,n,s)}function Em(e,n,s){n.status="fulfilled",n.value=s,Nm(n),e.state=s,n=e.pending,n!==null&&(s=n.next,s===n?e.pending=null:(s=s.next,n.next=s,km(e,s)))}function Vu(e,n,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=s,Nm(n),n=n.next;while(n!==l)}e.action=null}function Nm(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function jm(e,n){return n}function wm(e,n){if(Ie){var s=Je.formState;if(s!==null){e:{var l=Ee;if(Ie){if(it){t:{for(var f=it,h=Cn;f.nodeType!==8;){if(!h){f=null;break t}if(f=Nn(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){it=Nn(f.nextSibling),l=f.data==="F!";break e}}Oa(l)}l=!1}l&&(n=s[0])}}return s=Ft(),s.memoizedState=s.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jm,lastRenderedState:n},s.queue=l,s=Ym.bind(null,Ee,l),l.dispatch=s,l=zu(!1),h=qu.bind(null,Ee,!1,l.queue),l=Ft(),f={state:n,dispatch:null,action:e,pending:null},l.queue=f,s=V1.bind(null,Ee,f,h,s),f.dispatch=s,l.memoizedState=e,[n,s,!1]}function Am(e){var n=yt();return Dm(n,Ze,e)}function Dm(e,n,s){if(n=Lu(e,n,jm)[0],e=or(ca)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=Eo(n)}catch(_){throw _===pi?Xl:_}else l=n;n=yt();var f=n.queue,h=f.dispatch;return s!==n.memoizedState&&(Ee.flags|=2048,bi(9,{destroy:void 0},H1.bind(null,f,s),null)),[l,h,e]}function H1(e,n){e.action=n}function Rm(e){var n=yt(),s=Ze;if(s!==null)return Dm(n,s,e);yt(),n=n.memoizedState,s=yt();var l=s.queue.dispatch;return s.memoizedState=e,[n,l,!1]}function bi(e,n,s,l){return e={tag:e,create:s,deps:l,inst:n,next:null},n=Ee.updateQueue,n===null&&(n=sr(),Ee.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,n.lastEffect=e),e}function Mm(){return yt().memoizedState}function lr(e,n,s,l){var f=Ft();Ee.flags|=e,f.memoizedState=bi(1|n,{destroy:void 0},s,l===void 0?null:l)}function rr(e,n,s,l){var f=yt();l=l===void 0?null:l;var h=f.memoizedState.inst;Ze!==null&&l!==null&&Du(l,Ze.memoizedState.deps)?f.memoizedState=bi(n,h,s,l):(Ee.flags|=e,f.memoizedState=bi(1|n,h,s,l))}function Om(e,n){lr(8390656,8,e,n)}function Hu(e,n){rr(2048,8,e,n)}function P1(e){Ee.flags|=4;var n=Ee.updateQueue;if(n===null)n=sr(),Ee.updateQueue=n,n.events=[e];else{var s=n.events;s===null?n.events=[e]:s.push(e)}}function Bm(e){var n=yt().memoizedState;return P1({ref:n,nextImpl:e}),function(){if((Ge&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}function Im(e,n){return rr(4,2,e,n)}function Lm(e,n){return rr(4,4,e,n)}function Um(e,n){if(typeof n=="function"){e=e();var s=n(e);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function zm(e,n,s){s=s!=null?s.concat([e]):null,rr(4,4,Um.bind(null,n,e),s)}function Pu(){}function Vm(e,n){var s=yt();n=n===void 0?null:n;var l=s.memoizedState;return n!==null&&Du(n,l[1])?l[0]:(s.memoizedState=[e,n],e)}function Hm(e,n){var s=yt();n=n===void 0?null:n;var l=s.memoizedState;if(n!==null&&Du(n,l[1]))return l[0];if(l=e(),Cs){st(!0);try{e()}finally{st(!1)}}return s.memoizedState=[l,n],l}function Gu(e,n,s){return s===void 0||(ra&1073741824)!==0&&(Oe&261930)===0?e.memoizedState=n:(e.memoizedState=s,e=Pg(),Ee.lanes|=e,Ga|=e,s)}function Pm(e,n,s,l){return an(s,n)?s:gi.current!==null?(e=Gu(e,s,l),an(e,n)||(St=!0),e):(ra&42)===0||(ra&1073741824)!==0&&(Oe&261930)===0?(St=!0,e.memoizedState=s):(e=Pg(),Ee.lanes|=e,Ga|=e,n)}function Gm(e,n,s,l,f){var h=q.p;q.p=h!==0&&8>h?h:8;var _=B.T,k={};B.T=k,qu(e,!1,n,s);try{var D=f(),H=B.S;if(H!==null&&H(k,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var Y=L1(D,l);No(e,n,Y,un(e))}else No(e,n,l,un(e))}catch(W){No(e,n,{then:function(){},status:"rejected",reason:W},un())}finally{q.p=h,_!==null&&k.types!==null&&(_.types=k.types),B.T=_}}function G1(){}function $u(e,n,s,l){if(e.tag!==5)throw Error(o(476));var f=$m(e).queue;Gm(e,f,n,oe,s===null?G1:function(){return Fm(e),s(l)})}function $m(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:oe},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:s},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Fm(e){var n=$m(e);n.next===null&&(n=e.alternate.memoizedState),No(e,n.next.queue,{},un())}function Fu(){return It($o)}function qm(){return yt().memoizedState}function Km(){return yt().memoizedState}function $1(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var s=un();e=La(s);var l=Ua(n,e,s);l!==null&&(en(l,n,s),So(l,n,s)),n={cache:xu()},e.payload=n;return}n=n.return}}function F1(e,n,s){var l=un();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},cr(e)?Zm(n,s):(s=cu(e,n,s,l),s!==null&&(en(s,e,l),Xm(s,n,l)))}function Ym(e,n,s){var l=un();No(e,n,s,l)}function No(e,n,s,l){var f={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(cr(e))Zm(n,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var _=n.lastRenderedState,k=h(_,s);if(f.hasEagerState=!0,f.eagerState=k,an(k,_))return Gl(e,n,f,0),Je===null&&Pl(),!1}catch{}finally{}if(s=cu(e,n,f,l),s!==null)return en(s,e,l),Xm(s,n,l),!0}return!1}function qu(e,n,s,l){if(l={lane:2,revertLane:kd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},cr(e)){if(n)throw Error(o(479))}else n=cu(e,s,l,2),n!==null&&en(n,e,2)}function cr(e){var n=e.alternate;return e===Ee||n!==null&&n===Ee}function Zm(e,n){vi=nr=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function Xm(e,n,s){if((s&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,s|=l,n.lanes=s,tp(e,s)}}var jo={readContext:It,use:ir,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt};jo.useEffectEvent=pt;var Qm={readContext:It,use:ir,useCallback:function(e,n){return Ft().memoizedState=[e,n===void 0?null:n],e},useContext:It,useEffect:Om,useImperativeHandle:function(e,n,s){s=s!=null?s.concat([e]):null,lr(4194308,4,Um.bind(null,n,e),s)},useLayoutEffect:function(e,n){return lr(4194308,4,e,n)},useInsertionEffect:function(e,n){lr(4,2,e,n)},useMemo:function(e,n){var s=Ft();n=n===void 0?null:n;var l=e();if(Cs){st(!0);try{e()}finally{st(!1)}}return s.memoizedState=[l,n],l},useReducer:function(e,n,s){var l=Ft();if(s!==void 0){var f=s(n);if(Cs){st(!0);try{s(n)}finally{st(!1)}}}else f=n;return l.memoizedState=l.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},l.queue=e,e=e.dispatch=F1.bind(null,Ee,e),[l.memoizedState,e]},useRef:function(e){var n=Ft();return e={current:e},n.memoizedState=e},useState:function(e){e=zu(e);var n=e.queue,s=Ym.bind(null,Ee,n);return n.dispatch=s,[e.memoizedState,s]},useDebugValue:Pu,useDeferredValue:function(e,n){var s=Ft();return Gu(s,e,n)},useTransition:function(){var e=zu(!1);return e=Gm.bind(null,Ee,e.queue,!0,!1),Ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,s){var l=Ee,f=Ft();if(Ie){if(s===void 0)throw Error(o(407));s=s()}else{if(s=n(),Je===null)throw Error(o(349));(Oe&127)!==0||ym(l,n,s)}f.memoizedState=s;var h={value:s,getSnapshot:n};return f.queue=h,Om(xm.bind(null,l,h,e),[e]),l.flags|=2048,bi(9,{destroy:void 0},bm.bind(null,l,h,s,n),null),s},useId:function(){var e=Ft(),n=Je.identifierPrefix;if(Ie){var s=Hn,l=Vn;s=(l&~(1<<32-Fe(l)-1)).toString(32)+s,n="_"+n+"R_"+s,s=ar++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=U1++,n="_"+n+"r_"+s.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Fu,useFormState:wm,useActionState:wm,useOptimistic:function(e){var n=Ft();n.memoizedState=n.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=qu.bind(null,Ee,!0,s),s.dispatch=n,[e,n]},useMemoCache:Iu,useCacheRefresh:function(){return Ft().memoizedState=$1.bind(null,Ee)},useEffectEvent:function(e){var n=Ft(),s={impl:e};return n.memoizedState=s,function(){if((Ge&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Ku={readContext:It,use:ir,useCallback:Vm,useContext:It,useEffect:Hu,useImperativeHandle:zm,useInsertionEffect:Im,useLayoutEffect:Lm,useMemo:Hm,useReducer:or,useRef:Mm,useState:function(){return or(ca)},useDebugValue:Pu,useDeferredValue:function(e,n){var s=yt();return Pm(s,Ze.memoizedState,e,n)},useTransition:function(){var e=or(ca)[0],n=yt().memoizedState;return[typeof e=="boolean"?e:Eo(e),n]},useSyncExternalStore:vm,useId:qm,useHostTransitionStatus:Fu,useFormState:Am,useActionState:Am,useOptimistic:function(e,n){var s=yt();return Tm(s,Ze,e,n)},useMemoCache:Iu,useCacheRefresh:Km};Ku.useEffectEvent=Bm;var Wm={readContext:It,use:ir,useCallback:Vm,useContext:It,useEffect:Hu,useImperativeHandle:zm,useInsertionEffect:Im,useLayoutEffect:Lm,useMemo:Hm,useReducer:Uu,useRef:Mm,useState:function(){return Uu(ca)},useDebugValue:Pu,useDeferredValue:function(e,n){var s=yt();return Ze===null?Gu(s,e,n):Pm(s,Ze.memoizedState,e,n)},useTransition:function(){var e=Uu(ca)[0],n=yt().memoizedState;return[typeof e=="boolean"?e:Eo(e),n]},useSyncExternalStore:vm,useId:qm,useHostTransitionStatus:Fu,useFormState:Rm,useActionState:Rm,useOptimistic:function(e,n){var s=yt();return Ze!==null?Tm(s,Ze,e,n):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Iu,useCacheRefresh:Km};Wm.useEffectEvent=Bm;function Yu(e,n,s,l){n=e.memoizedState,s=s(l,n),s=s==null?n:y({},n,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Zu={enqueueSetState:function(e,n,s){e=e._reactInternals;var l=un(),f=La(l);f.payload=n,s!=null&&(f.callback=s),n=Ua(e,f,l),n!==null&&(en(n,e,l),So(n,e,l))},enqueueReplaceState:function(e,n,s){e=e._reactInternals;var l=un(),f=La(l);f.tag=1,f.payload=n,s!=null&&(f.callback=s),n=Ua(e,f,l),n!==null&&(en(n,e,l),So(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var s=un(),l=La(s);l.tag=2,n!=null&&(l.callback=n),n=Ua(e,l,s),n!==null&&(en(n,e,s),So(n,e,s))}};function Jm(e,n,s,l,f,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,_):n.prototype&&n.prototype.isPureReactComponent?!po(s,l)||!po(f,h):!0}function eg(e,n,s,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,l),n.state!==e&&Zu.enqueueReplaceState(n,n.state,null)}function Es(e,n){var s=n;if("ref"in n){s={};for(var l in n)l!=="ref"&&(s[l]=n[l])}if(e=e.defaultProps){s===n&&(s=y({},s));for(var f in e)s[f]===void 0&&(s[f]=e[f])}return s}function tg(e){Hl(e)}function ng(e){console.error(e)}function ag(e){Hl(e)}function ur(e,n){try{var s=e.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function sg(e,n,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Xu(e,n,s){return s=La(s),s.tag=3,s.payload={element:null},s.callback=function(){ur(e,n)},s}function ig(e){return e=La(e),e.tag=3,e}function og(e,n,s,l){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var h=l.value;e.payload=function(){return f(h)},e.callback=function(){sg(n,s,l)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){sg(n,s,l),typeof f!="function"&&($a===null?$a=new Set([this]):$a.add(this));var k=l.stack;this.componentDidCatch(l.value,{componentStack:k!==null?k:""})})}function q1(e,n,s,l,f){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=s.alternate,n!==null&&di(n,s,f,!0),s=on.current,s!==null){switch(s.tag){case 31:case 13:return En===null?Sr():s.alternate===null&&mt===0&&(mt=3),s.flags&=-257,s.flags|=65536,s.lanes=f,l===Ql?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([l]):n.add(l),_d(e,l,f)),!1;case 22:return s.flags|=65536,l===Ql?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([l]):s.add(l)),_d(e,l,f)),!1}throw Error(o(435,s.tag))}return _d(e,l,f),Sr(),!1}if(Ie)return n=on.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,l!==mu&&(e=Error(o(422),{cause:l}),vo(Sn(e,s)))):(l!==mu&&(n=Error(o(423),{cause:l}),vo(Sn(n,s))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,l=Sn(l,s),f=Xu(e.stateNode,l,f),Eu(e,f),mt!==4&&(mt=2)),!1;var h=Error(o(520),{cause:l});if(h=Sn(h,s),Io===null?Io=[h]:Io.push(h),mt!==4&&(mt=2),n===null)return!0;l=Sn(l,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,e=f&-f,s.lanes|=e,e=Xu(s.stateNode,l,e),Eu(s,e),!1;case 1:if(n=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&($a===null||!$a.has(h))))return s.flags|=65536,f&=-f,s.lanes|=f,f=ig(f),og(f,e,s,l),Eu(s,f),!1}s=s.return}while(s!==null);return!1}var Qu=Error(o(461)),St=!1;function Lt(e,n,s,l){n.child=e===null?um(n,null,s,l):ks(n,e.child,s,l)}function lg(e,n,s,l,f){s=s.render;var h=n.ref;if("ref"in l){var _={};for(var k in l)k!=="ref"&&(_[k]=l[k])}else _=l;return xs(n),l=Ru(e,n,s,_,h,f),k=Mu(),e!==null&&!St?(Ou(e,n,f),ua(e,n,f)):(Ie&&k&&hu(n),n.flags|=1,Lt(e,n,l,f),n.child)}function rg(e,n,s,l,f){if(e===null){var h=s.type;return typeof h=="function"&&!uu(h)&&h.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=h,cg(e,n,h,l,f)):(e=Fl(s.type,null,l,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!id(e,f)){var _=h.memoizedProps;if(s=s.compare,s=s!==null?s:po,s(_,l)&&e.ref===n.ref)return ua(e,n,f)}return n.flags|=1,e=sa(h,l),e.ref=n.ref,e.return=n,n.child=e}function cg(e,n,s,l,f){if(e!==null){var h=e.memoizedProps;if(po(h,l)&&e.ref===n.ref)if(St=!1,n.pendingProps=l=h,id(e,f))(e.flags&131072)!==0&&(St=!0);else return n.lanes=e.lanes,ua(e,n,f)}return Wu(e,n,s,l,f)}function ug(e,n,s,l){var f=l.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(l=n.child=e.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~h}else l=0,n.child=null;return dg(e,n,h,s,l)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Zl(n,h!==null?h.cachePool:null),h!==null?hm(n,h):ju(),pm(n);else return l=n.lanes=536870912,dg(e,n,h!==null?h.baseLanes|s:s,s,l)}else h!==null?(Zl(n,h.cachePool),hm(n,h),Va(),n.memoizedState=null):(e!==null&&Zl(n,null),ju(),Va());return Lt(e,n,f,s),n.child}function wo(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function dg(e,n,s,l,f){var h=Su();return h=h===null?null:{parent:xt._currentValue,pool:h},n.memoizedState={baseLanes:s,cachePool:h},e!==null&&Zl(n,null),ju(),pm(n),e!==null&&di(e,n,l,!0),n.childLanes=f,null}function dr(e,n){return n=hr({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function fg(e,n,s){return ks(n,e.child,null,s),e=dr(n,n.pendingProps),e.flags|=2,ln(n),n.memoizedState=null,e}function K1(e,n,s){var l=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Ie){if(l.mode==="hidden")return e=dr(n,l),n.lanes=536870912,wo(null,e);if(Au(n),(e=it)?(e=kv(e,Cn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ra!==null?{id:Vn,overflow:Hn}:null,retryLane:536870912,hydrationErrors:null},s=Zp(e),s.return=n,n.child=s,Bt=n,it=null)):e=null,e===null)throw Oa(n);return n.lanes=536870912,null}return dr(n,l)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(Au(n),f)if(n.flags&256)n.flags&=-257,n=fg(e,n,s);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(o(558));else if(St||di(e,n,s,!1),f=(s&e.childLanes)!==0,St||f){if(l=Je,l!==null&&(_=np(l,s),_!==0&&_!==h.retryLane))throw h.retryLane=_,gs(e,_),en(l,e,_),Qu;Sr(),n=fg(e,n,s)}else e=h.treeContext,it=Nn(_.nextSibling),Bt=n,Ie=!0,Ma=null,Cn=!1,e!==null&&Wp(n,e),n=dr(n,l),n.flags|=4096;return n}return e=sa(e.child,{mode:l.mode,children:l.children}),e.ref=n.ref,n.child=e,e.return=n,e}function fr(e,n){var s=n.ref;if(s===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(n.flags|=4194816)}}function Wu(e,n,s,l,f){return xs(n),s=Ru(e,n,s,l,void 0,f),l=Mu(),e!==null&&!St?(Ou(e,n,f),ua(e,n,f)):(Ie&&l&&hu(n),n.flags|=1,Lt(e,n,s,f),n.child)}function hg(e,n,s,l,f,h){return xs(n),n.updateQueue=null,s=gm(n,l,s,f),mm(e),l=Mu(),e!==null&&!St?(Ou(e,n,h),ua(e,n,h)):(Ie&&l&&hu(n),n.flags|=1,Lt(e,n,s,h),n.child)}function pg(e,n,s,l,f){if(xs(n),n.stateNode===null){var h=li,_=s.contextType;typeof _=="object"&&_!==null&&(h=It(_)),h=new s(l,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Zu,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=l,h.state=n.memoizedState,h.refs={},ku(n),_=s.contextType,h.context=typeof _=="object"&&_!==null?It(_):li,h.state=n.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Yu(n,s,_,l),h.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(_=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),_!==h.state&&Zu.enqueueReplaceState(h,h.state,null),ko(n,l,h,f),To(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(e===null){h=n.stateNode;var k=n.memoizedProps,D=Es(s,k);h.props=D;var H=h.context,Y=s.contextType;_=li,typeof Y=="object"&&Y!==null&&(_=It(Y));var W=s.getDerivedStateFromProps;Y=typeof W=="function"||typeof h.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,Y||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(k||H!==_)&&eg(n,h,l,_),Ia=!1;var P=n.memoizedState;h.state=P,ko(n,l,h,f),To(),H=n.memoizedState,k||P!==H||Ia?(typeof W=="function"&&(Yu(n,s,W,l),H=n.memoizedState),(D=Ia||Jm(n,s,D,l,P,H,_))?(Y||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=H),h.props=l,h.state=H,h.context=_,l=D):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{h=n.stateNode,Cu(e,n),_=n.memoizedProps,Y=Es(s,_),h.props=Y,W=n.pendingProps,P=h.context,H=s.contextType,D=li,typeof H=="object"&&H!==null&&(D=It(H)),k=s.getDerivedStateFromProps,(H=typeof k=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==W||P!==D)&&eg(n,h,l,D),Ia=!1,P=n.memoizedState,h.state=P,ko(n,l,h,f),To();var K=n.memoizedState;_!==W||P!==K||Ia||e!==null&&e.dependencies!==null&&Kl(e.dependencies)?(typeof k=="function"&&(Yu(n,s,k,l),K=n.memoizedState),(Y=Ia||Jm(n,s,Y,l,P,K,D)||e!==null&&e.dependencies!==null&&Kl(e.dependencies))?(H||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,K,D),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,K,D)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=K),h.props=l,h.state=K,h.context=D,l=Y):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(n.flags|=1024),l=!1)}return h=l,fr(e,n),l=(n.flags&128)!==0,h||l?(h=n.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&l?(n.child=ks(n,e.child,null,f),n.child=ks(n,null,s,f)):Lt(e,n,s,f),n.memoizedState=h.state,e=n.child):e=ua(e,n,f),e}function mg(e,n,s,l){return ys(),n.flags|=256,Lt(e,n,s,l),n.child}var Ju={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ed(e){return{baseLanes:e,cachePool:sm()}}function td(e,n,s){return e=e!==null?e.childLanes&~s:0,n&&(e|=cn),e}function gg(e,n,s){var l=n.pendingProps,f=!1,h=(n.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(vt.current&2)!==0),_&&(f=!0,n.flags&=-129),_=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ie){if(f?za(n):Va(),(e=it)?(e=kv(e,Cn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ra!==null?{id:Vn,overflow:Hn}:null,retryLane:536870912,hydrationErrors:null},s=Zp(e),s.return=n,n.child=s,Bt=n,it=null)):e=null,e===null)throw Oa(n);return Ld(e)?n.lanes=32:n.lanes=536870912,null}var k=l.children;return l=l.fallback,f?(Va(),f=n.mode,k=hr({mode:"hidden",children:k},f),l=vs(l,f,s,null),k.return=n,l.return=n,k.sibling=l,n.child=k,l=n.child,l.memoizedState=ed(s),l.childLanes=td(e,_,s),n.memoizedState=Ju,wo(null,l)):(za(n),nd(n,k))}var D=e.memoizedState;if(D!==null&&(k=D.dehydrated,k!==null)){if(h)n.flags&256?(za(n),n.flags&=-257,n=ad(e,n,s)):n.memoizedState!==null?(Va(),n.child=e.child,n.flags|=128,n=null):(Va(),k=l.fallback,f=n.mode,l=hr({mode:"visible",children:l.children},f),k=vs(k,f,s,null),k.flags|=2,l.return=n,k.return=n,l.sibling=k,n.child=l,ks(n,e.child,null,s),l=n.child,l.memoizedState=ed(s),l.childLanes=td(e,_,s),n.memoizedState=Ju,n=wo(null,l));else if(za(n),Ld(k)){if(_=k.nextSibling&&k.nextSibling.dataset,_)var H=_.dgst;_=H,l=Error(o(419)),l.stack="",l.digest=_,vo({value:l,source:null,stack:null}),n=ad(e,n,s)}else if(St||di(e,n,s,!1),_=(s&e.childLanes)!==0,St||_){if(_=Je,_!==null&&(l=np(_,s),l!==0&&l!==D.retryLane))throw D.retryLane=l,gs(e,l),en(_,e,l),Qu;Id(k)||Sr(),n=ad(e,n,s)}else Id(k)?(n.flags|=192,n.child=e.child,n=null):(e=D.treeContext,it=Nn(k.nextSibling),Bt=n,Ie=!0,Ma=null,Cn=!1,e!==null&&Wp(n,e),n=nd(n,l.children),n.flags|=4096);return n}return f?(Va(),k=l.fallback,f=n.mode,D=e.child,H=D.sibling,l=sa(D,{mode:"hidden",children:l.children}),l.subtreeFlags=D.subtreeFlags&65011712,H!==null?k=sa(H,k):(k=vs(k,f,s,null),k.flags|=2),k.return=n,l.return=n,l.sibling=k,n.child=l,wo(null,l),l=n.child,k=e.child.memoizedState,k===null?k=ed(s):(f=k.cachePool,f!==null?(D=xt._currentValue,f=f.parent!==D?{parent:D,pool:D}:f):f=sm(),k={baseLanes:k.baseLanes|s,cachePool:f}),l.memoizedState=k,l.childLanes=td(e,_,s),n.memoizedState=Ju,wo(e.child,l)):(za(n),s=e.child,e=s.sibling,s=sa(s,{mode:"visible",children:l.children}),s.return=n,s.sibling=null,e!==null&&(_=n.deletions,_===null?(n.deletions=[e],n.flags|=16):_.push(e)),n.child=s,n.memoizedState=null,s)}function nd(e,n){return n=hr({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function hr(e,n){return e=sn(22,e,null,n),e.lanes=0,e}function ad(e,n,s){return ks(n,e.child,null,s),e=nd(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function vg(e,n,s){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),yu(e.return,n,s)}function sd(e,n,s,l,f,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:f,treeForkCount:h}:(_.isBackwards=n,_.rendering=null,_.renderingStartTime=0,_.last=l,_.tail=s,_.tailMode=f,_.treeForkCount=h)}function yg(e,n,s){var l=n.pendingProps,f=l.revealOrder,h=l.tail;l=l.children;var _=vt.current,k=(_&2)!==0;if(k?(_=_&1|2,n.flags|=128):_&=1,be(vt,_),Lt(e,n,l,s),l=Ie?go:0,!k&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vg(e,s,n);else if(e.tag===19)vg(e,s,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(s=n.child,f=null;s!==null;)e=s.alternate,e!==null&&tr(e)===null&&(f=s),s=s.sibling;s=f,s===null?(f=n.child,n.child=null):(f=s.sibling,s.sibling=null),sd(n,!1,f,s,h,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&tr(e)===null){n.child=f;break}e=f.sibling,f.sibling=s,s=f,f=e}sd(n,!0,s,null,h,l);break;case"together":sd(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function ua(e,n,s){if(e!==null&&(n.dependencies=e.dependencies),Ga|=n.lanes,(s&n.childLanes)===0)if(e!==null){if(di(e,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(o(153));if(n.child!==null){for(e=n.child,s=sa(e,e.pendingProps),n.child=s,s.return=n;e.sibling!==null;)e=e.sibling,s=s.sibling=sa(e,e.pendingProps),s.return=n;s.sibling=null}return n.child}function id(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Kl(e)))}function Y1(e,n,s){switch(n.tag){case 3:Me(n,n.stateNode.containerInfo),Ba(n,xt,e.memoizedState.cache),ys();break;case 27:case 5:Na(n);break;case 4:Me(n,n.stateNode.containerInfo);break;case 10:Ba(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Au(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(za(n),n.flags|=128,null):(s&n.child.childLanes)!==0?gg(e,n,s):(za(n),e=ua(e,n,s),e!==null?e.sibling:null);za(n);break;case 19:var f=(e.flags&128)!==0;if(l=(s&n.childLanes)!==0,l||(di(e,n,s,!1),l=(s&n.childLanes)!==0),f){if(l)return yg(e,n,s);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),be(vt,vt.current),l)break;return null;case 22:return n.lanes=0,ug(e,n,s,n.pendingProps);case 24:Ba(n,xt,e.memoizedState.cache)}return ua(e,n,s)}function bg(e,n,s){if(e!==null)if(e.memoizedProps!==n.pendingProps)St=!0;else{if(!id(e,s)&&(n.flags&128)===0)return St=!1,Y1(e,n,s);St=(e.flags&131072)!==0}else St=!1,Ie&&(n.flags&1048576)!==0&&Qp(n,go,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(e=Ss(n.elementType),n.type=e,typeof e=="function")uu(e)?(l=Es(e,l),n.tag=1,n=pg(null,n,e,l,s)):(n.tag=0,n=Wu(null,n,e,l,s));else{if(e!=null){var f=e.$$typeof;if(f===R){n.tag=11,n=lg(null,n,e,l,s);break e}else if(f===z){n.tag=14,n=rg(null,n,e,l,s);break e}}throw n=U(e)||e,Error(o(306,n,""))}}return n;case 0:return Wu(e,n,n.type,n.pendingProps,s);case 1:return l=n.type,f=Es(l,n.pendingProps),pg(e,n,l,f,s);case 3:e:{if(Me(n,n.stateNode.containerInfo),e===null)throw Error(o(387));l=n.pendingProps;var h=n.memoizedState;f=h.element,Cu(e,n),ko(n,l,null,s);var _=n.memoizedState;if(l=_.cache,Ba(n,xt,l),l!==h.cache&&bu(n,[xt],s,!0),To(),l=_.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:_.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=mg(e,n,l,s);break e}else if(l!==f){f=Sn(Error(o(424)),n),vo(f),n=mg(e,n,l,s);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(it=Nn(e.firstChild),Bt=n,Ie=!0,Ma=null,Cn=!0,s=um(n,null,l,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ys(),l===f){n=ua(e,n,s);break e}Lt(e,n,l,s)}n=n.child}return n;case 26:return fr(e,n),e===null?(s=Av(n.type,null,n.pendingProps,null))?n.memoizedState=s:Ie||(s=n.type,e=n.pendingProps,l=wr(ee.current).createElement(s),l[Ot]=n,l[Yt]=e,Ut(l,s,e),Dt(l),n.stateNode=l):n.memoizedState=Av(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Na(n),e===null&&Ie&&(l=n.stateNode=Nv(n.type,n.pendingProps,ee.current),Bt=n,Cn=!0,f=it,Ya(n.type)?(Ud=f,it=Nn(l.firstChild)):it=f),Lt(e,n,n.pendingProps.children,s),fr(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ie&&((f=l=it)&&(l=kS(l,n.type,n.pendingProps,Cn),l!==null?(n.stateNode=l,Bt=n,it=Nn(l.firstChild),Cn=!1,f=!0):f=!1),f||Oa(n)),Na(n),f=n.type,h=n.pendingProps,_=e!==null?e.memoizedProps:null,l=h.children,Md(f,h)?l=null:_!==null&&Md(f,_)&&(n.flags|=32),n.memoizedState!==null&&(f=Ru(e,n,z1,null,null,s),$o._currentValue=f),fr(e,n),Lt(e,n,l,s),n.child;case 6:return e===null&&Ie&&((e=s=it)&&(s=CS(s,n.pendingProps,Cn),s!==null?(n.stateNode=s,Bt=n,it=null,e=!0):e=!1),e||Oa(n)),null;case 13:return gg(e,n,s);case 4:return Me(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=ks(n,null,l,s):Lt(e,n,l,s),n.child;case 11:return lg(e,n,n.type,n.pendingProps,s);case 7:return Lt(e,n,n.pendingProps,s),n.child;case 8:return Lt(e,n,n.pendingProps.children,s),n.child;case 12:return Lt(e,n,n.pendingProps.children,s),n.child;case 10:return l=n.pendingProps,Ba(n,n.type,l.value),Lt(e,n,l.children,s),n.child;case 9:return f=n.type._context,l=n.pendingProps.children,xs(n),f=It(f),l=l(f),n.flags|=1,Lt(e,n,l,s),n.child;case 14:return rg(e,n,n.type,n.pendingProps,s);case 15:return cg(e,n,n.type,n.pendingProps,s);case 19:return yg(e,n,s);case 31:return K1(e,n,s);case 22:return ug(e,n,s,n.pendingProps);case 24:return xs(n),l=It(xt),e===null?(f=Su(),f===null&&(f=Je,h=xu(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=s),f=h),n.memoizedState={parent:l,cache:f},ku(n),Ba(n,xt,f)):((e.lanes&s)!==0&&(Cu(e,n),ko(n,null,null,s),To()),f=e.memoizedState,h=n.memoizedState,f.parent!==l?(f={parent:l,cache:l},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),Ba(n,xt,l)):(l=h.cache,Ba(n,xt,l),l!==f.cache&&bu(n,[xt],s,!0))),Lt(e,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(o(156,n.tag))}function da(e){e.flags|=4}function od(e,n,s,l,f){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(qg())e.flags|=8192;else throw Ts=Ql,Tu}else e.flags&=-16777217}function xg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Bv(n))if(qg())e.flags|=8192;else throw Ts=Ql,Tu}function pr(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Jh():536870912,e.lanes|=n,Ti|=n)}function Ao(e,n){if(!Ie)switch(e.tailMode){case"hidden":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ot(e){var n=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(n)for(var f=e.child;f!==null;)s|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)s|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=s,n}function Z1(e,n,s){var l=n.pendingProps;switch(pu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(n),null;case 1:return ot(n),null;case 3:return s=n.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),la(xt),On(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ui(n)?da(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,gu())),ot(n),null;case 26:var f=n.type,h=n.memoizedState;return e===null?(da(n),h!==null?(ot(n),xg(n,h)):(ot(n),od(n,f,null,l,s))):h?h!==e.memoizedState?(da(n),ot(n),xg(n,h)):(ot(n),n.flags&=-16777217):(e=e.memoizedProps,e!==l&&da(n),ot(n),od(n,f,e,l,s)),null;case 27:if(gn(n),s=ee.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&da(n);else{if(!l){if(n.stateNode===null)throw Error(o(166));return ot(n),null}e=ne.current,ui(n)?Jp(n):(e=Nv(f,l,s),n.stateNode=e,da(n))}return ot(n),null;case 5:if(gn(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&da(n);else{if(!l){if(n.stateNode===null)throw Error(o(166));return ot(n),null}if(h=ne.current,ui(n))Jp(n);else{var _=wr(ee.current);switch(h){case 1:h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=_.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?_.createElement("select",{is:l.is}):_.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?_.createElement(f,{is:l.is}):_.createElement(f)}}h[Ot]=n,h[Yt]=l;e:for(_=n.child;_!==null;){if(_.tag===5||_.tag===6)h.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===n)break e;for(;_.sibling===null;){if(_.return===null||_.return===n)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}n.stateNode=h;e:switch(Ut(h,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&da(n)}}return ot(n),od(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,s),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&da(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(o(166));if(e=ee.current,ui(n)){if(e=n.stateNode,s=n.memoizedProps,l=null,f=Bt,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}e[Ot]=n,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||gv(e.nodeValue,s)),e||Oa(n,!0)}else e=wr(e).createTextNode(l),e[Ot]=n,n.stateNode=e}return ot(n),null;case 31:if(s=n.memoizedState,e===null||e.memoizedState!==null){if(l=ui(n),s!==null){if(e===null){if(!l)throw Error(o(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Ot]=n}else ys(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ot(n),e=!1}else s=gu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return n.flags&256?(ln(n),n):(ln(n),null);if((n.flags&128)!==0)throw Error(o(558))}return ot(n),null;case 13:if(l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=ui(n),l!==null&&l.dehydrated!==null){if(e===null){if(!f)throw Error(o(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(o(317));f[Ot]=n}else ys(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ot(n),f=!1}else f=gu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(ln(n),n):(ln(n),null)}return ln(n),(n.flags&128)!==0?(n.lanes=s,n):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=n.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==f&&(l.flags|=2048)),s!==e&&s&&(n.child.flags|=8192),pr(n,n.updateQueue),ot(n),null);case 4:return On(),e===null&&jd(n.stateNode.containerInfo),ot(n),null;case 10:return la(n.type),ot(n),null;case 19:if(Te(vt),l=n.memoizedState,l===null)return ot(n),null;if(f=(n.flags&128)!==0,h=l.rendering,h===null)if(f)Ao(l,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=tr(e),h!==null){for(n.flags|=128,Ao(l,!1),e=h.updateQueue,n.updateQueue=e,pr(n,e),n.subtreeFlags=0,e=s,s=n.child;s!==null;)Yp(s,e),s=s.sibling;return be(vt,vt.current&1|2),Ie&&ia(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&Vt()>br&&(n.flags|=128,f=!0,Ao(l,!1),n.lanes=4194304)}else{if(!f)if(e=tr(h),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,pr(n,e),Ao(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Ie)return ot(n),null}else 2*Vt()-l.renderingStartTime>br&&s!==536870912&&(n.flags|=128,f=!0,Ao(l,!1),n.lanes=4194304);l.isBackwards?(h.sibling=n.child,n.child=h):(e=l.last,e!==null?e.sibling=h:n.child=h,l.last=h)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Vt(),e.sibling=null,s=vt.current,be(vt,f?s&1|2:s&1),Ie&&ia(n,l.treeForkCount),e):(ot(n),null);case 22:case 23:return ln(n),wu(),l=n.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(s&536870912)!==0&&(n.flags&128)===0&&(ot(n),n.subtreeFlags&6&&(n.flags|=8192)):ot(n),s=n.updateQueue,s!==null&&pr(n,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==s&&(n.flags|=2048),e!==null&&Te(_s),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),la(xt),ot(n),null;case 25:return null;case 30:return null}throw Error(o(156,n.tag))}function X1(e,n){switch(pu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return la(xt),On(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return gn(n),null;case 31:if(n.memoizedState!==null){if(ln(n),n.alternate===null)throw Error(o(340));ys()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(ln(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(o(340));ys()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Te(vt),null;case 4:return On(),null;case 10:return la(n.type),null;case 22:case 23:return ln(n),wu(),e!==null&&Te(_s),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return la(xt),null;case 25:return null;default:return null}}function _g(e,n){switch(pu(n),n.tag){case 3:la(xt),On();break;case 26:case 27:case 5:gn(n);break;case 4:On();break;case 31:n.memoizedState!==null&&ln(n);break;case 13:ln(n);break;case 19:Te(vt);break;case 10:la(n.type);break;case 22:case 23:ln(n),wu(),e!==null&&Te(_s);break;case 24:la(xt)}}function Do(e,n){try{var s=n.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var f=l.next;s=f;do{if((s.tag&e)===e){l=void 0;var h=s.create,_=s.inst;l=h(),_.destroy=l}s=s.next}while(s!==f)}}catch(k){Ye(n,n.return,k)}}function Ha(e,n,s){try{var l=n.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var h=f.next;l=h;do{if((l.tag&e)===e){var _=l.inst,k=_.destroy;if(k!==void 0){_.destroy=void 0,f=n;var D=s,H=k;try{H()}catch(Y){Ye(f,D,Y)}}}l=l.next}while(l!==h)}}catch(Y){Ye(n,n.return,Y)}}function Sg(e){var n=e.updateQueue;if(n!==null){var s=e.stateNode;try{fm(n,s)}catch(l){Ye(e,e.return,l)}}}function Tg(e,n,s){s.props=Es(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){Ye(e,n,l)}}function Ro(e,n){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(f){Ye(e,n,f)}}function Pn(e,n){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(f){Ye(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){Ye(e,n,f)}else s.current=null}function kg(e){var n=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(f){Ye(e,e.return,f)}}function ld(e,n,s){try{var l=e.stateNode;yS(l,e.type,s,n),l[Yt]=n}catch(f){Ye(e,e.return,f)}}function Cg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ya(e.type)||e.tag===4}function rd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cg(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.tag===27&&Ya(e.type)||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 cd(e,n,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(e),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=na));else if(l!==4&&(l===27&&Ya(e.type)&&(s=e.stateNode,n=null),e=e.child,e!==null))for(cd(e,n,s),e=e.sibling;e!==null;)cd(e,n,s),e=e.sibling}function mr(e,n,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(l!==4&&(l===27&&Ya(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(mr(e,n,s),e=e.sibling;e!==null;)mr(e,n,s),e=e.sibling}function Eg(e){var n=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Ut(n,l,s),n[Ot]=e,n[Yt]=s}catch(h){Ye(e,e.return,h)}}var fa=!1,Tt=!1,ud=!1,Ng=typeof WeakSet=="function"?WeakSet:Set,Rt=null;function Q1(e,n){if(e=e.containerInfo,Dd=Ir,e=zp(e),au(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var f=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var _=0,k=-1,D=-1,H=0,Y=0,W=e,P=null;t:for(;;){for(var K;W!==s||f!==0&&W.nodeType!==3||(k=_+f),W!==h||l!==0&&W.nodeType!==3||(D=_+l),W.nodeType===3&&(_+=W.nodeValue.length),(K=W.firstChild)!==null;)P=W,W=K;for(;;){if(W===e)break t;if(P===s&&++H===f&&(k=_),P===h&&++Y===l&&(D=_),(K=W.nextSibling)!==null)break;W=P,P=W.parentNode}W=K}s=k===-1||D===-1?null:{start:k,end:D}}else s=null}s=s||{start:0,end:0}}else s=null;for(Rd={focusedElem:e,selectionRange:s},Ir=!1,Rt=n;Rt!==null;)if(n=Rt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Rt=e;else for(;Rt!==null;){switch(n=Rt,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)f=e[s],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=n,f=h.memoizedProps,h=h.memoizedState,l=s.stateNode;try{var de=Es(s.type,f);e=l.getSnapshotBeforeUpdate(de,h),l.__reactInternalSnapshotBeforeUpdate=e}catch(ve){Ye(s,s.return,ve)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,s=e.nodeType,s===9)Bd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Bd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=n.sibling,e!==null){e.return=n.return,Rt=e;break}Rt=n.return}}function jg(e,n,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:pa(e,s),l&4&&Do(5,s);break;case 1:if(pa(e,s),l&4)if(e=s.stateNode,n===null)try{e.componentDidMount()}catch(_){Ye(s,s.return,_)}else{var f=Es(s.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(_){Ye(s,s.return,_)}}l&64&&Sg(s),l&512&&Ro(s,s.return);break;case 3:if(pa(e,s),l&64&&(e=s.updateQueue,e!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{fm(e,n)}catch(_){Ye(s,s.return,_)}}break;case 27:n===null&&l&4&&Eg(s);case 26:case 5:pa(e,s),n===null&&l&4&&kg(s),l&512&&Ro(s,s.return);break;case 12:pa(e,s);break;case 31:pa(e,s),l&4&&Dg(e,s);break;case 13:pa(e,s),l&4&&Rg(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=oS.bind(null,s),ES(e,s))));break;case 22:if(l=s.memoizedState!==null||fa,!l){n=n!==null&&n.memoizedState!==null||Tt,f=fa;var h=Tt;fa=l,(Tt=n)&&!h?ma(e,s,(s.subtreeFlags&8772)!==0):pa(e,s),fa=f,Tt=h}break;case 30:break;default:pa(e,s)}}function wg(e){var n=e.alternate;n!==null&&(e.alternate=null,wg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Vc(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var dt=null,Xt=!1;function ha(e,n,s){for(s=s.child;s!==null;)Ag(e,n,s),s=s.sibling}function Ag(e,n,s){if(Ae&&typeof Ae.onCommitFiberUnmount=="function")try{Ae.onCommitFiberUnmount(tt,s)}catch{}switch(s.tag){case 26:Tt||Pn(s,n),ha(e,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Tt||Pn(s,n);var l=dt,f=Xt;Ya(s.type)&&(dt=s.stateNode,Xt=!1),ha(e,n,s),Ho(s.stateNode),dt=l,Xt=f;break;case 5:Tt||Pn(s,n);case 6:if(l=dt,f=Xt,dt=null,ha(e,n,s),dt=l,Xt=f,dt!==null)if(Xt)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(s.stateNode)}catch(h){Ye(s,n,h)}else try{dt.removeChild(s.stateNode)}catch(h){Ye(s,n,h)}break;case 18:dt!==null&&(Xt?(e=dt,Sv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Di(e)):Sv(dt,s.stateNode));break;case 4:l=dt,f=Xt,dt=s.stateNode.containerInfo,Xt=!0,ha(e,n,s),dt=l,Xt=f;break;case 0:case 11:case 14:case 15:Ha(2,s,n),Tt||Ha(4,s,n),ha(e,n,s);break;case 1:Tt||(Pn(s,n),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Tg(s,n,l)),ha(e,n,s);break;case 21:ha(e,n,s);break;case 22:Tt=(l=Tt)||s.memoizedState!==null,ha(e,n,s),Tt=l;break;default:ha(e,n,s)}}function Dg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Di(e)}catch(s){Ye(n,n.return,s)}}}function Rg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Di(e)}catch(s){Ye(n,n.return,s)}}function W1(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Ng),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Ng),n;default:throw Error(o(435,e.tag))}}function gr(e,n){var s=W1(e);n.forEach(function(l){if(!s.has(l)){s.add(l);var f=lS.bind(null,e,l);l.then(f,f)}})}function Qt(e,n){var s=n.deletions;if(s!==null)for(var l=0;l<s.length;l++){var f=s[l],h=e,_=n,k=_;e:for(;k!==null;){switch(k.tag){case 27:if(Ya(k.type)){dt=k.stateNode,Xt=!1;break e}break;case 5:dt=k.stateNode,Xt=!1;break e;case 3:case 4:dt=k.stateNode.containerInfo,Xt=!0;break e}k=k.return}if(dt===null)throw Error(o(160));Ag(h,_,f),dt=null,Xt=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Mg(n,e),n=n.sibling}var In=null;function Mg(e,n){var s=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Qt(n,e),Wt(e),l&4&&(Ha(3,e,e.return),Do(3,e),Ha(5,e,e.return));break;case 1:Qt(n,e),Wt(e),l&512&&(Tt||s===null||Pn(s,s.return)),l&64&&fa&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var f=In;if(Qt(n,e),Wt(e),l&512&&(Tt||s===null||Pn(s,s.return)),l&4){var h=s!==null?s.memoizedState:null;if(l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null){e:{l=e.type,s=e.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":h=f.getElementsByTagName("title")[0],(!h||h[so]||h[Ot]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(l),f.head.insertBefore(h,f.querySelector("head > title"))),Ut(h,l,s),h[Ot]=e,Dt(h),l=h;break e;case"link":var _=Mv("link","href",f).get(l+(s.href||""));if(_){for(var k=0;k<_.length;k++)if(h=_[k],h.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&h.getAttribute("rel")===(s.rel==null?null:s.rel)&&h.getAttribute("title")===(s.title==null?null:s.title)&&h.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(k,1);break t}}h=f.createElement(l),Ut(h,l,s),f.head.appendChild(h);break;case"meta":if(_=Mv("meta","content",f).get(l+(s.content||""))){for(k=0;k<_.length;k++)if(h=_[k],h.getAttribute("content")===(s.content==null?null:""+s.content)&&h.getAttribute("name")===(s.name==null?null:s.name)&&h.getAttribute("property")===(s.property==null?null:s.property)&&h.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&h.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(k,1);break t}}h=f.createElement(l),Ut(h,l,s),f.head.appendChild(h);break;default:throw Error(o(468,l))}h[Ot]=e,Dt(h),l=h}e.stateNode=l}else Ov(f,e.type,e.stateNode);else e.stateNode=Rv(f,l,e.memoizedProps);else h!==l?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,l===null?Ov(f,e.type,e.stateNode):Rv(f,l,e.memoizedProps)):l===null&&e.stateNode!==null&&ld(e,e.memoizedProps,s.memoizedProps)}break;case 27:Qt(n,e),Wt(e),l&512&&(Tt||s===null||Pn(s,s.return)),s!==null&&l&4&&ld(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Qt(n,e),Wt(e),l&512&&(Tt||s===null||Pn(s,s.return)),e.flags&32){f=e.stateNode;try{ei(f,"")}catch(de){Ye(e,e.return,de)}}l&4&&e.stateNode!=null&&(f=e.memoizedProps,ld(e,f,s!==null?s.memoizedProps:f)),l&1024&&(ud=!0);break;case 6:if(Qt(n,e),Wt(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,s=e.stateNode;try{s.nodeValue=l}catch(de){Ye(e,e.return,de)}}break;case 3:if(Rr=null,f=In,In=Ar(n.containerInfo),Qt(n,e),In=f,Wt(e),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Di(n.containerInfo)}catch(de){Ye(e,e.return,de)}ud&&(ud=!1,Og(e));break;case 4:l=In,In=Ar(e.stateNode.containerInfo),Qt(n,e),Wt(e),In=l;break;case 12:Qt(n,e),Wt(e);break;case 31:Qt(n,e),Wt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gr(e,l)));break;case 13:Qt(n,e),Wt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(yr=Vt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gr(e,l)));break;case 22:f=e.memoizedState!==null;var D=s!==null&&s.memoizedState!==null,H=fa,Y=Tt;if(fa=H||f,Tt=Y||D,Qt(n,e),Tt=Y,fa=H,Wt(e),l&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(s===null||D||fa||Tt||Ns(e)),s=null,n=e;;){if(n.tag===5||n.tag===26){if(s===null){D=s=n;try{if(h=D.stateNode,f)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{k=D.stateNode;var W=D.memoizedProps.style,P=W!=null&&W.hasOwnProperty("display")?W.display:null;k.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(de){Ye(D,D.return,de)}}}else if(n.tag===6){if(s===null){D=n;try{D.stateNode.nodeValue=f?"":D.memoizedProps}catch(de){Ye(D,D.return,de)}}}else if(n.tag===18){if(s===null){D=n;try{var K=D.stateNode;f?Tv(K,!0):Tv(D.stateNode,!1)}catch(de){Ye(D,D.return,de)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=e.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,gr(e,s))));break;case 19:Qt(n,e),Wt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gr(e,l)));break;case 30:break;case 21:break;default:Qt(n,e),Wt(e)}}function Wt(e){var n=e.flags;if(n&2){try{for(var s,l=e.return;l!==null;){if(Cg(l)){s=l;break}l=l.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var f=s.stateNode,h=rd(e);mr(e,h,f);break;case 5:var _=s.stateNode;s.flags&32&&(ei(_,""),s.flags&=-33);var k=rd(e);mr(e,k,_);break;case 3:case 4:var D=s.stateNode.containerInfo,H=rd(e);cd(e,H,D);break;default:throw Error(o(161))}}catch(Y){Ye(e,e.return,Y)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Og(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Og(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function pa(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)jg(e,n.alternate,n),n=n.sibling}function Ns(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Ha(4,n,n.return),Ns(n);break;case 1:Pn(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&Tg(n,n.return,s),Ns(n);break;case 27:Ho(n.stateNode);case 26:case 5:Pn(n,n.return),Ns(n);break;case 22:n.memoizedState===null&&Ns(n);break;case 30:Ns(n);break;default:Ns(n)}e=e.sibling}}function ma(e,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var l=n.alternate,f=e,h=n,_=h.flags;switch(h.tag){case 0:case 11:case 15:ma(f,h,s),Do(4,h);break;case 1:if(ma(f,h,s),l=h,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(H){Ye(l,l.return,H)}if(l=h,f=l.updateQueue,f!==null){var k=l.stateNode;try{var D=f.shared.hiddenCallbacks;if(D!==null)for(f.shared.hiddenCallbacks=null,f=0;f<D.length;f++)dm(D[f],k)}catch(H){Ye(l,l.return,H)}}s&&_&64&&Sg(h),Ro(h,h.return);break;case 27:Eg(h);case 26:case 5:ma(f,h,s),s&&l===null&&_&4&&kg(h),Ro(h,h.return);break;case 12:ma(f,h,s);break;case 31:ma(f,h,s),s&&_&4&&Dg(f,h);break;case 13:ma(f,h,s),s&&_&4&&Rg(f,h);break;case 22:h.memoizedState===null&&ma(f,h,s),Ro(h,h.return);break;case 30:break;default:ma(f,h,s)}n=n.sibling}}function dd(e,n){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&yo(s))}function fd(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&yo(e))}function Ln(e,n,s,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Bg(e,n,s,l),n=n.sibling}function Bg(e,n,s,l){var f=n.flags;switch(n.tag){case 0:case 11:case 15:Ln(e,n,s,l),f&2048&&Do(9,n);break;case 1:Ln(e,n,s,l);break;case 3:Ln(e,n,s,l),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&yo(e)));break;case 12:if(f&2048){Ln(e,n,s,l),e=n.stateNode;try{var h=n.memoizedProps,_=h.id,k=h.onPostCommit;typeof k=="function"&&k(_,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){Ye(n,n.return,D)}}else Ln(e,n,s,l);break;case 31:Ln(e,n,s,l);break;case 13:Ln(e,n,s,l);break;case 23:break;case 22:h=n.stateNode,_=n.alternate,n.memoizedState!==null?h._visibility&2?Ln(e,n,s,l):Mo(e,n):h._visibility&2?Ln(e,n,s,l):(h._visibility|=2,xi(e,n,s,l,(n.subtreeFlags&10256)!==0||!1)),f&2048&&dd(_,n);break;case 24:Ln(e,n,s,l),f&2048&&fd(n.alternate,n);break;default:Ln(e,n,s,l)}}function xi(e,n,s,l,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,_=n,k=s,D=l,H=_.flags;switch(_.tag){case 0:case 11:case 15:xi(h,_,k,D,f),Do(8,_);break;case 23:break;case 22:var Y=_.stateNode;_.memoizedState!==null?Y._visibility&2?xi(h,_,k,D,f):Mo(h,_):(Y._visibility|=2,xi(h,_,k,D,f)),f&&H&2048&&dd(_.alternate,_);break;case 24:xi(h,_,k,D,f),f&&H&2048&&fd(_.alternate,_);break;default:xi(h,_,k,D,f)}n=n.sibling}}function Mo(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=e,l=n,f=l.flags;switch(l.tag){case 22:Mo(s,l),f&2048&&dd(l.alternate,l);break;case 24:Mo(s,l),f&2048&&fd(l.alternate,l);break;default:Mo(s,l)}n=n.sibling}}var Oo=8192;function _i(e,n,s){if(e.subtreeFlags&Oo)for(e=e.child;e!==null;)Ig(e,n,s),e=e.sibling}function Ig(e,n,s){switch(e.tag){case 26:_i(e,n,s),e.flags&Oo&&e.memoizedState!==null&&US(s,In,e.memoizedState,e.memoizedProps);break;case 5:_i(e,n,s);break;case 3:case 4:var l=In;In=Ar(e.stateNode.containerInfo),_i(e,n,s),In=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Oo,Oo=16777216,_i(e,n,s),Oo=l):_i(e,n,s));break;default:_i(e,n,s)}}function Lg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Bo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var l=n[s];Rt=l,zg(l,e)}Lg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ug(e),e=e.sibling}function Ug(e){switch(e.tag){case 0:case 11:case 15:Bo(e),e.flags&2048&&Ha(9,e,e.return);break;case 3:Bo(e);break;case 12:Bo(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,vr(e)):Bo(e);break;default:Bo(e)}}function vr(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var l=n[s];Rt=l,zg(l,e)}Lg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Ha(8,n,n.return),vr(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,vr(n));break;default:vr(n)}e=e.sibling}}function zg(e,n){for(;Rt!==null;){var s=Rt;switch(s.tag){case 0:case 11:case 15:Ha(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:yo(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,Rt=l;else e:for(s=e;Rt!==null;){l=Rt;var f=l.sibling,h=l.return;if(wg(l),l===s){Rt=null;break e}if(f!==null){f.return=h,Rt=f;break e}Rt=h}}}var J1={getCacheForType:function(e){var n=It(xt),s=n.data.get(e);return s===void 0&&(s=e(),n.data.set(e,s)),s},cacheSignal:function(){return It(xt).controller.signal}},eS=typeof WeakMap=="function"?WeakMap:Map,Ge=0,Je=null,De=null,Oe=0,Ke=0,rn=null,Pa=!1,Si=!1,hd=!1,ga=0,mt=0,Ga=0,js=0,pd=0,cn=0,Ti=0,Io=null,Jt=null,md=!1,yr=0,Vg=0,br=1/0,xr=null,$a=null,jt=0,Fa=null,ki=null,va=0,gd=0,vd=null,Hg=null,Lo=0,yd=null;function un(){return(Ge&2)!==0&&Oe!==0?Oe&-Oe:B.T!==null?kd():ap()}function Pg(){if(cn===0)if((Oe&536870912)===0||Ie){var e=yn;yn<<=1,(yn&3932160)===0&&(yn=262144),cn=e}else cn=536870912;return e=on.current,e!==null&&(e.flags|=32),cn}function en(e,n,s){(e===Je&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)&&(Ci(e,0),qa(e,Oe,cn,!1)),ao(e,s),((Ge&2)===0||e!==Je)&&(e===Je&&((Ge&2)===0&&(js|=s),mt===4&&qa(e,Oe,cn,!1)),Gn(e))}function Gg(e,n,s){if((Ge&6)!==0)throw Error(o(327));var l=!s&&(n&127)===0&&(n&e.expiredLanes)===0||no(e,n),f=l?aS(e,n):xd(e,n,!0),h=l;do{if(f===0){Si&&!l&&qa(e,n,0,!1);break}else{if(s=e.current.alternate,h&&!tS(s)){f=xd(e,n,!1),h=!1;continue}if(f===2){if(h=n,e.errorRecoveryDisabledLanes&h)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){n=_;e:{var k=e;f=Io;var D=k.current.memoizedState.isDehydrated;if(D&&(Ci(k,_).flags|=256),_=xd(k,_,!1),_!==2){if(hd&&!D){k.errorRecoveryDisabledLanes|=h,js|=h,f=4;break e}h=Jt,Jt=f,h!==null&&(Jt===null?Jt=h:Jt.push.apply(Jt,h))}f=_}if(h=!1,f!==2)continue}}if(f===1){Ci(e,0),qa(e,n,0,!0);break}e:{switch(l=e,h=f,h){case 0:case 1:throw Error(o(345));case 4:if((n&4194048)!==n)break;case 6:qa(l,n,cn,!Pa);break e;case 2:Jt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((n&62914560)===n&&(f=yr+300-Vt(),10<f)){if(qa(l,n,cn,!Pa),Al(l,0,!0)!==0)break e;va=n,l.timeoutHandle=xv($g.bind(null,l,s,Jt,xr,md,n,cn,js,Ti,Pa,h,"Throttled",-0,0),f);break e}$g(l,s,Jt,xr,md,n,cn,js,Ti,Pa,h,null,-0,0)}}break}while(!0);Gn(e)}function $g(e,n,s,l,f,h,_,k,D,H,Y,W,P,K){if(e.timeoutHandle=-1,W=n.subtreeFlags,W&8192||(W&16785408)===16785408){W={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:na},Ig(n,h,W);var de=(h&62914560)===h?yr-Vt():(h&4194048)===h?Vg-Vt():0;if(de=zS(W,de),de!==null){va=h,e.cancelPendingCommit=de(Wg.bind(null,e,n,h,s,l,f,_,k,D,Y,W,null,P,K)),qa(e,h,_,!H);return}}Wg(e,n,h,s,l,f,_,k,D)}function tS(e){for(var n=e;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var f=s[l],h=f.getSnapshot;f=f.value;try{if(!an(h(),f))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function qa(e,n,s,l){n&=~pd,n&=~js,e.suspendedLanes|=n,e.pingedLanes&=~n,l&&(e.warmLanes|=n),l=e.expirationTimes;for(var f=n;0<f;){var h=31-Fe(f),_=1<<h;l[h]=-1,f&=~_}s!==0&&ep(e,s,n)}function _r(){return(Ge&6)===0?(Uo(0),!1):!0}function bd(){if(De!==null){if(Ke===0)var e=De.return;else e=De,oa=bs=null,Bu(e),mi=null,xo=0,e=De;for(;e!==null;)_g(e.alternate,e),e=e.return;De=null}}function Ci(e,n){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,_S(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),va=0,bd(),Je=e,De=s=sa(e.current,null),Oe=n,Ke=0,rn=null,Pa=!1,Si=no(e,n),hd=!1,Ti=cn=pd=js=Ga=mt=0,Jt=Io=null,md=!1,(n&8)!==0&&(n|=n&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=n;0<l;){var f=31-Fe(l),h=1<<f;n|=e[f],l&=~h}return ga=n,Pl(),s}function Fg(e,n){Ee=null,B.H=jo,n===pi||n===Xl?(n=lm(),Ke=3):n===Tu?(n=lm(),Ke=4):Ke=n===Qu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,rn=n,De===null&&(mt=1,ur(e,Sn(n,e.current)))}function qg(){var e=on.current;return e===null?!0:(Oe&4194048)===Oe?En===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?e===En:!1}function Kg(){var e=B.H;return B.H=jo,e===null?jo:e}function Yg(){var e=B.A;return B.A=J1,e}function Sr(){mt=4,Pa||(Oe&4194048)!==Oe&&on.current!==null||(Si=!0),(Ga&134217727)===0&&(js&134217727)===0||Je===null||qa(Je,Oe,cn,!1)}function xd(e,n,s){var l=Ge;Ge|=2;var f=Kg(),h=Yg();(Je!==e||Oe!==n)&&(xr=null,Ci(e,n)),n=!1;var _=mt;e:do try{if(Ke!==0&&De!==null){var k=De,D=rn;switch(Ke){case 8:bd(),_=6;break e;case 3:case 2:case 9:case 6:on.current===null&&(n=!0);var H=Ke;if(Ke=0,rn=null,Ei(e,k,D,H),s&&Si){_=0;break e}break;default:H=Ke,Ke=0,rn=null,Ei(e,k,D,H)}}nS(),_=mt;break}catch(Y){Fg(e,Y)}while(!0);return n&&e.shellSuspendCounter++,oa=bs=null,Ge=l,B.H=f,B.A=h,De===null&&(Je=null,Oe=0,Pl()),_}function nS(){for(;De!==null;)Zg(De)}function aS(e,n){var s=Ge;Ge|=2;var l=Kg(),f=Yg();Je!==e||Oe!==n?(xr=null,br=Vt()+500,Ci(e,n)):Si=no(e,n);e:do try{if(Ke!==0&&De!==null){n=De;var h=rn;t:switch(Ke){case 1:Ke=0,rn=null,Ei(e,n,h,1);break;case 2:case 9:if(im(h)){Ke=0,rn=null,Xg(n);break}n=function(){Ke!==2&&Ke!==9||Je!==e||(Ke=7),Gn(e)},h.then(n,n);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:im(h)?(Ke=0,rn=null,Xg(n)):(Ke=0,rn=null,Ei(e,n,h,7));break;case 5:var _=null;switch(De.tag){case 26:_=De.memoizedState;case 5:case 27:var k=De;if(_?Bv(_):k.stateNode.complete){Ke=0,rn=null;var D=k.sibling;if(D!==null)De=D;else{var H=k.return;H!==null?(De=H,Tr(H)):De=null}break t}}Ke=0,rn=null,Ei(e,n,h,5);break;case 6:Ke=0,rn=null,Ei(e,n,h,6);break;case 8:bd(),mt=6;break e;default:throw Error(o(462))}}sS();break}catch(Y){Fg(e,Y)}while(!0);return oa=bs=null,B.H=l,B.A=f,Ge=s,De!==null?0:(Je=null,Oe=0,Pl(),mt)}function sS(){for(;De!==null&&!jl();)Zg(De)}function Zg(e){var n=bg(e.alternate,e,ga);e.memoizedProps=e.pendingProps,n===null?Tr(e):De=n}function Xg(e){var n=e,s=n.alternate;switch(n.tag){case 15:case 0:n=hg(s,n,n.pendingProps,n.type,void 0,Oe);break;case 11:n=hg(s,n,n.pendingProps,n.type.render,n.ref,Oe);break;case 5:Bu(n);default:_g(s,n),n=De=Yp(n,ga),n=bg(s,n,ga)}e.memoizedProps=e.pendingProps,n===null?Tr(e):De=n}function Ei(e,n,s,l){oa=bs=null,Bu(n),mi=null,xo=0;var f=n.return;try{if(q1(e,f,n,s,Oe)){mt=1,ur(e,Sn(s,e.current)),De=null;return}}catch(h){if(f!==null)throw De=f,h;mt=1,ur(e,Sn(s,e.current)),De=null;return}n.flags&32768?(Ie||l===1?e=!0:Si||(Oe&536870912)!==0?e=!1:(Pa=e=!0,(l===2||l===9||l===3||l===6)&&(l=on.current,l!==null&&l.tag===13&&(l.flags|=16384))),Qg(n,e)):Tr(n)}function Tr(e){var n=e;do{if((n.flags&32768)!==0){Qg(n,Pa);return}e=n.return;var s=Z1(n.alternate,n,ga);if(s!==null){De=s;return}if(n=n.sibling,n!==null){De=n;return}De=n=e}while(n!==null);mt===0&&(mt=5)}function Qg(e,n){do{var s=X1(e.alternate,e);if(s!==null){s.flags&=32767,De=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(e=e.sibling,e!==null)){De=e;return}De=e=s}while(e!==null);mt=6,De=null}function Wg(e,n,s,l,f,h,_,k,D){e.cancelPendingCommit=null;do kr();while(jt!==0);if((Ge&6)!==0)throw Error(o(327));if(n!==null){if(n===e.current)throw Error(o(177));if(h=n.lanes|n.childLanes,h|=ru,L_(e,s,h,_,k,D),e===Je&&(De=Je=null,Oe=0),ki=n,Fa=e,va=s,gd=h,vd=f,Hg=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,rS(ue,function(){return av(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=B.T,B.T=null,f=q.p,q.p=2,_=Ge,Ge|=4;try{Q1(e,n,s)}finally{Ge=_,q.p=f,B.T=l}}jt=1,Jg(),ev(),tv()}}function Jg(){if(jt===1){jt=0;var e=Fa,n=ki,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=B.T,B.T=null;var l=q.p;q.p=2;var f=Ge;Ge|=4;try{Mg(n,e);var h=Rd,_=zp(e.containerInfo),k=h.focusedElem,D=h.selectionRange;if(_!==k&&k&&k.ownerDocument&&Up(k.ownerDocument.documentElement,k)){if(D!==null&&au(k)){var H=D.start,Y=D.end;if(Y===void 0&&(Y=H),"selectionStart"in k)k.selectionStart=H,k.selectionEnd=Math.min(Y,k.value.length);else{var W=k.ownerDocument||document,P=W&&W.defaultView||window;if(P.getSelection){var K=P.getSelection(),de=k.textContent.length,ve=Math.min(D.start,de),Qe=D.end===void 0?ve:Math.min(D.end,de);!K.extend&&ve>Qe&&(_=Qe,Qe=ve,ve=_);var I=Lp(k,ve),M=Lp(k,Qe);if(I&&M&&(K.rangeCount!==1||K.anchorNode!==I.node||K.anchorOffset!==I.offset||K.focusNode!==M.node||K.focusOffset!==M.offset)){var V=W.createRange();V.setStart(I.node,I.offset),K.removeAllRanges(),ve>Qe?(K.addRange(V),K.extend(M.node,M.offset)):(V.setEnd(M.node,M.offset),K.addRange(V))}}}}for(W=[],K=k;K=K.parentNode;)K.nodeType===1&&W.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<W.length;k++){var Z=W[k];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Ir=!!Dd,Rd=Dd=null}finally{Ge=f,q.p=l,B.T=s}}e.current=n,jt=2}}function ev(){if(jt===2){jt=0;var e=Fa,n=ki,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=B.T,B.T=null;var l=q.p;q.p=2;var f=Ge;Ge|=4;try{jg(e,n.alternate,n)}finally{Ge=f,q.p=l,B.T=s}}jt=3}}function tv(){if(jt===4||jt===3){jt=0,wl();var e=Fa,n=ki,s=va,l=Hg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?jt=5:(jt=0,ki=Fa=null,nv(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&($a=null),Uc(s),n=n.stateNode,Ae&&typeof Ae.onCommitFiberRoot=="function")try{Ae.onCommitFiberRoot(tt,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=B.T,f=q.p,q.p=2,B.T=null;try{for(var h=e.onRecoverableError,_=0;_<l.length;_++){var k=l[_];h(k.value,{componentStack:k.stack})}}finally{B.T=n,q.p=f}}(va&3)!==0&&kr(),Gn(e),f=e.pendingLanes,(s&261930)!==0&&(f&42)!==0?e===yd?Lo++:(Lo=0,yd=e):Lo=0,Uo(0)}}function nv(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,yo(n)))}function kr(){return Jg(),ev(),tv(),av()}function av(){if(jt!==5)return!1;var e=Fa,n=gd;gd=0;var s=Uc(va),l=B.T,f=q.p;try{q.p=32>s?32:s,B.T=null,s=vd,vd=null;var h=Fa,_=va;if(jt=0,ki=Fa=null,va=0,(Ge&6)!==0)throw Error(o(331));var k=Ge;if(Ge|=4,Ug(h.current),Bg(h,h.current,_,s),Ge=k,Uo(0,!1),Ae&&typeof Ae.onPostCommitFiberRoot=="function")try{Ae.onPostCommitFiberRoot(tt,h)}catch{}return!0}finally{q.p=f,B.T=l,nv(e,n)}}function sv(e,n,s){n=Sn(s,n),n=Xu(e.stateNode,n,2),e=Ua(e,n,2),e!==null&&(ao(e,2),Gn(e))}function Ye(e,n,s){if(e.tag===3)sv(e,e,s);else for(;n!==null;){if(n.tag===3){sv(n,e,s);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&($a===null||!$a.has(l))){e=Sn(s,e),s=ig(2),l=Ua(n,s,2),l!==null&&(og(s,l,n,e),ao(l,2),Gn(l));break}}n=n.return}}function _d(e,n,s){var l=e.pingCache;if(l===null){l=e.pingCache=new eS;var f=new Set;l.set(n,f)}else f=l.get(n),f===void 0&&(f=new Set,l.set(n,f));f.has(s)||(hd=!0,f.add(s),e=iS.bind(null,e,n,s),n.then(e,e))}function iS(e,n,s){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Je===e&&(Oe&s)===s&&(mt===4||mt===3&&(Oe&62914560)===Oe&&300>Vt()-yr?(Ge&2)===0&&Ci(e,0):pd|=s,Ti===Oe&&(Ti=0)),Gn(e)}function iv(e,n){n===0&&(n=Jh()),e=gs(e,n),e!==null&&(ao(e,n),Gn(e))}function oS(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),iv(e,s)}function lS(e,n){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(s=f.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(n),iv(e,s)}function rS(e,n){return qs(e,n)}var Cr=null,Ni=null,Sd=!1,Er=!1,Td=!1,Ka=0;function Gn(e){e!==Ni&&e.next===null&&(Ni===null?Cr=Ni=e:Ni=Ni.next=e),Er=!0,Sd||(Sd=!0,uS())}function Uo(e,n){if(!Td&&Er){Td=!0;do for(var s=!1,l=Cr;l!==null;){if(e!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var _=l.suspendedLanes,k=l.pingedLanes;h=(1<<31-Fe(42|e)+1)-1,h&=f&~(_&~k),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,cv(l,h))}else h=Oe,h=Al(l,l===Je?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||no(l,h)||(s=!0,cv(l,h));l=l.next}while(s);Td=!1}}function cS(){ov()}function ov(){Er=Sd=!1;var e=0;Ka!==0&&xS()&&(e=Ka);for(var n=Vt(),s=null,l=Cr;l!==null;){var f=l.next,h=lv(l,n);h===0?(l.next=null,s===null?Cr=f:s.next=f,f===null&&(Ni=s)):(s=l,(e!==0||(h&3)!==0)&&(Er=!0)),l=f}jt!==0&&jt!==5||Uo(e),Ka!==0&&(Ka=0)}function lv(e,n){for(var s=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-Fe(h),k=1<<_,D=f[_];D===-1?((k&s)===0||(k&l)!==0)&&(f[_]=I_(k,n)):D<=n&&(e.expiredLanes|=k),h&=~k}if(n=Je,s=Oe,s=Al(e,e===n?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===n&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Ks(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||no(e,s)){if(n=s&-s,n===e.callbackPriority)return n;switch(l!==null&&Ks(l),Uc(s)){case 2:case 8:s=re;break;case 32:s=ue;break;case 268435456:s=ge;break;default:s=ue}return l=rv.bind(null,e),s=qs(s,l),e.callbackPriority=n,e.callbackNode=s,n}return l!==null&&l!==null&&Ks(l),e.callbackPriority=2,e.callbackNode=null,2}function rv(e,n){if(jt!==0&&jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(kr()&&e.callbackNode!==s)return null;var l=Oe;return l=Al(e,e===Je?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Gg(e,l,n),lv(e,Vt()),e.callbackNode!=null&&e.callbackNode===s?rv.bind(null,e):null)}function cv(e,n){if(kr())return null;Gg(e,n,!0)}function uS(){SS(function(){(Ge&6)!==0?qs(X,cS):ov()})}function kd(){if(Ka===0){var e=fi;e===0&&(e=ja,ja<<=1,(ja&261888)===0&&(ja=256)),Ka=e}return Ka}function uv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ol(""+e)}function dv(e,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,e.id&&s.setAttribute("form",e.id),n.parentNode.insertBefore(s,n),e=new FormData(e),s.parentNode.removeChild(s),e}function dS(e,n,s,l,f){if(n==="submit"&&s&&s.stateNode===f){var h=uv((f[Yt]||null).action),_=l.submitter;_&&(n=(n=_[Yt]||null)?uv(n.formAction):_.getAttribute("formAction"),n!==null&&(h=n,_=null));var k=new Ul("action","action",null,l,f);e.push({event:k,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ka!==0){var D=_?dv(f,_):new FormData(f);$u(s,{pending:!0,data:D,method:f.method,action:h},null,D)}}else typeof h=="function"&&(k.preventDefault(),D=_?dv(f,_):new FormData(f),$u(s,{pending:!0,data:D,method:f.method,action:h},h,D))},currentTarget:f}]})}}for(var Cd=0;Cd<lu.length;Cd++){var Ed=lu[Cd],fS=Ed.toLowerCase(),hS=Ed[0].toUpperCase()+Ed.slice(1);Bn(fS,"on"+hS)}Bn(Pp,"onAnimationEnd"),Bn(Gp,"onAnimationIteration"),Bn($p,"onAnimationStart"),Bn("dblclick","onDoubleClick"),Bn("focusin","onFocus"),Bn("focusout","onBlur"),Bn(w1,"onTransitionRun"),Bn(A1,"onTransitionStart"),Bn(D1,"onTransitionCancel"),Bn(Fp,"onTransitionEnd"),Ws("onMouseEnter",["mouseout","mouseover"]),Ws("onMouseLeave",["mouseout","mouseover"]),Ws("onPointerEnter",["pointerout","pointerover"]),Ws("onPointerLeave",["pointerout","pointerover"]),fs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fs("onBeforeInput",["compositionend","keypress","textInput","paste"]),fs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zo="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(" "),pS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zo));function fv(e,n){n=(n&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],f=l.event;l=l.listeners;e:{var h=void 0;if(n)for(var _=l.length-1;0<=_;_--){var k=l[_],D=k.instance,H=k.currentTarget;if(k=k.listener,D!==h&&f.isPropagationStopped())break e;h=k,f.currentTarget=H;try{h(f)}catch(Y){Hl(Y)}f.currentTarget=null,h=D}else for(_=0;_<l.length;_++){if(k=l[_],D=k.instance,H=k.currentTarget,k=k.listener,D!==h&&f.isPropagationStopped())break e;h=k,f.currentTarget=H;try{h(f)}catch(Y){Hl(Y)}f.currentTarget=null,h=D}}}}function Re(e,n){var s=n[zc];s===void 0&&(s=n[zc]=new Set);var l=e+"__bubble";s.has(l)||(hv(n,e,2,!1),s.add(l))}function Nd(e,n,s){var l=0;n&&(l|=4),hv(s,e,l,n)}var Nr="_reactListening"+Math.random().toString(36).slice(2);function jd(e){if(!e[Nr]){e[Nr]=!0,op.forEach(function(s){s!=="selectionchange"&&(pS.has(s)||Nd(s,!1,e),Nd(s,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Nr]||(n[Nr]=!0,Nd("selectionchange",!1,n))}}function hv(e,n,s,l){switch(Pv(n)){case 2:var f=PS;break;case 8:f=GS;break;default:f=Gd}s=f.bind(null,n,s,e),f=void 0,!Yc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(n,s,{capture:!0,passive:f}):e.addEventListener(n,s,!0):f!==void 0?e.addEventListener(n,s,{passive:f}):e.addEventListener(n,s,!1)}function wd(e,n,s,l,f){var h=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var _=l.tag;if(_===3||_===4){var k=l.stateNode.containerInfo;if(k===f)break;if(_===4)for(_=l.return;_!==null;){var D=_.tag;if((D===3||D===4)&&_.stateNode.containerInfo===f)return;_=_.return}for(;k!==null;){if(_=Zs(k),_===null)return;if(D=_.tag,D===5||D===6||D===26||D===27){l=h=_;continue e}k=k.parentNode}}l=l.return}yp(function(){var H=h,Y=qc(s),W=[];e:{var P=qp.get(e);if(P!==void 0){var K=Ul,de=e;switch(e){case"keypress":if(Il(s)===0)break e;case"keydown":case"keyup":K=l1;break;case"focusin":de="focus",K=Wc;break;case"focusout":de="blur",K=Wc;break;case"beforeblur":case"afterblur":K=Wc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=_p;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=Z_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=u1;break;case Pp:case Gp:case $p:K=W_;break;case Fp:K=f1;break;case"scroll":case"scrollend":K=K_;break;case"wheel":K=p1;break;case"copy":case"cut":case"paste":K=e1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Tp;break;case"toggle":case"beforetoggle":K=g1}var ve=(n&4)!==0,Qe=!ve&&(e==="scroll"||e==="scrollend"),I=ve?P!==null?P+"Capture":null:P;ve=[];for(var M=H,V;M!==null;){var Z=M;if(V=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||V===null||I===null||(Z=oo(M,I),Z!=null&&ve.push(Vo(M,Z,V))),Qe)break;M=M.return}0<ve.length&&(P=new K(P,de,null,s,Y),W.push({event:P,listeners:ve}))}}if((n&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",P&&s!==Fc&&(de=s.relatedTarget||s.fromElement)&&(Zs(de)||de[Ys]))break e;if((K||P)&&(P=Y.window===Y?Y:(P=Y.ownerDocument)?P.defaultView||P.parentWindow:window,K?(de=s.relatedTarget||s.toElement,K=H,de=de?Zs(de):null,de!==null&&(Qe=u(de),ve=de.tag,de!==Qe||ve!==5&&ve!==27&&ve!==6)&&(de=null)):(K=null,de=H),K!==de)){if(ve=_p,Z="onMouseLeave",I="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ve=Tp,Z="onPointerLeave",I="onPointerEnter",M="pointer"),Qe=K==null?P:io(K),V=de==null?P:io(de),P=new ve(Z,M+"leave",K,s,Y),P.target=Qe,P.relatedTarget=V,Z=null,Zs(Y)===H&&(ve=new ve(I,M+"enter",de,s,Y),ve.target=V,ve.relatedTarget=Qe,Z=ve),Qe=Z,K&&de)t:{for(ve=mS,I=K,M=de,V=0,Z=I;Z;Z=ve(Z))V++;Z=0;for(var pe=M;pe;pe=ve(pe))Z++;for(;0<V-Z;)I=ve(I),V--;for(;0<Z-V;)M=ve(M),Z--;for(;V--;){if(I===M||M!==null&&I===M.alternate){ve=I;break t}I=ve(I),M=ve(M)}ve=null}else ve=null;K!==null&&pv(W,P,K,ve,!1),de!==null&&Qe!==null&&pv(W,Qe,de,ve,!0)}}e:{if(P=H?io(H):window,K=P.nodeName&&P.nodeName.toLowerCase(),K==="select"||K==="input"&&P.type==="file")var Ve=Dp;else if(wp(P))if(Rp)Ve=E1;else{Ve=k1;var he=T1}else K=P.nodeName,!K||K.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?H&&$c(H.elementType)&&(Ve=Dp):Ve=C1;if(Ve&&(Ve=Ve(e,H))){Ap(W,Ve,s,Y);break e}he&&he(e,P,H),e==="focusout"&&H&&P.type==="number"&&H.memoizedProps.value!=null&&Gc(P,"number",P.value)}switch(he=H?io(H):window,e){case"focusin":(wp(he)||he.contentEditable==="true")&&(si=he,su=H,mo=null);break;case"focusout":mo=su=si=null;break;case"mousedown":iu=!0;break;case"contextmenu":case"mouseup":case"dragend":iu=!1,Vp(W,s,Y);break;case"selectionchange":if(j1)break;case"keydown":case"keyup":Vp(W,s,Y)}var Ne;if(eu)e:{switch(e){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else ai?Np(e,s)&&(Be="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Be="onCompositionStart");Be&&(kp&&s.locale!=="ko"&&(ai||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&ai&&(Ne=bp()):(Da=Y,Zc="value"in Da?Da.value:Da.textContent,ai=!0)),he=jr(H,Be),0<he.length&&(Be=new Sp(Be,e,null,s,Y),W.push({event:Be,listeners:he}),Ne?Be.data=Ne:(Ne=jp(s),Ne!==null&&(Be.data=Ne)))),(Ne=y1?b1(e,s):x1(e,s))&&(Be=jr(H,"onBeforeInput"),0<Be.length&&(he=new Sp("onBeforeInput","beforeinput",null,s,Y),W.push({event:he,listeners:Be}),he.data=Ne)),dS(W,e,H,s,Y)}fv(W,n)})}function Vo(e,n,s){return{instance:e,listener:n,currentTarget:s}}function jr(e,n){for(var s=n+"Capture",l=[];e!==null;){var f=e,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=oo(e,s),f!=null&&l.unshift(Vo(e,f,h)),f=oo(e,n),f!=null&&l.push(Vo(e,f,h))),e.tag===3)return l;e=e.return}return[]}function mS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pv(e,n,s,l,f){for(var h=n._reactName,_=[];s!==null&&s!==l;){var k=s,D=k.alternate,H=k.stateNode;if(k=k.tag,D!==null&&D===l)break;k!==5&&k!==26&&k!==27||H===null||(D=H,f?(H=oo(s,h),H!=null&&_.unshift(Vo(s,H,D))):f||(H=oo(s,h),H!=null&&_.push(Vo(s,H,D)))),s=s.return}_.length!==0&&e.push({event:n,listeners:_})}var gS=/\r\n?/g,vS=/\u0000|\uFFFD/g;function mv(e){return(typeof e=="string"?e:""+e).replace(gS,`
|
|
26
|
-
`).replace(vS,"")}function gv(e,n){return n=mv(n),mv(e)===n}function Xe(e,n,s,l,f,h){switch(s){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||ei(e,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&ei(e,""+l);break;case"className":Rl(e,"class",l);break;case"tabIndex":Rl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Rl(e,s,l);break;case"style":gp(e,l,h);break;case"data":if(n!=="object"){Rl(e,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Ol(""+l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(s==="formAction"?(n!=="input"&&Xe(e,n,"name",f.name,f,null),Xe(e,n,"formEncType",f.formEncType,f,null),Xe(e,n,"formMethod",f.formMethod,f,null),Xe(e,n,"formTarget",f.formTarget,f,null)):(Xe(e,n,"encType",f.encType,f,null),Xe(e,n,"method",f.method,f,null),Xe(e,n,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Ol(""+l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=na);break;case"onScroll":l!=null&&Re("scroll",e);break;case"onScrollEnd":l!=null&&Re("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(f.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}s=Ol(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""+l):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":Re("beforetoggle",e),Re("toggle",e),Dl(e,"popover",l);break;case"xlinkActuate":ta(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":ta(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":ta(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":ta(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":ta(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":ta(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":ta(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":ta(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":ta(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Dl(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=F_.get(s)||s,Dl(e,s,l))}}function Ad(e,n,s,l,f,h){switch(s){case"style":gp(e,l,h);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(f.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof l=="string"?ei(e,l):(typeof l=="number"||typeof l=="bigint")&&ei(e,""+l);break;case"onScroll":l!=null&&Re("scroll",e);break;case"onScrollEnd":l!=null&&Re("scrollend",e);break;case"onClick":l!=null&&(e.onclick=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lp.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),n=s.slice(2,f?s.length-7:void 0),h=e[Yt]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(n,h,f),typeof l=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(n,l,f);break e}s in e?e[s]=l:l===!0?e.setAttribute(s,""):Dl(e,s,l)}}}function Ut(e,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",e),Re("load",e);var l=!1,f=!1,h;for(h in s)if(s.hasOwnProperty(h)){var _=s[h];if(_!=null)switch(h){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,n));default:Xe(e,n,h,_,s,null)}}f&&Xe(e,n,"srcSet",s.srcSet,s,null),l&&Xe(e,n,"src",s.src,s,null);return;case"input":Re("invalid",e);var k=h=_=f=null,D=null,H=null;for(l in s)if(s.hasOwnProperty(l)){var Y=s[l];if(Y!=null)switch(l){case"name":f=Y;break;case"type":_=Y;break;case"checked":D=Y;break;case"defaultChecked":H=Y;break;case"value":h=Y;break;case"defaultValue":k=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(o(137,n));break;default:Xe(e,n,l,Y,s,null)}}fp(e,h,k,D,H,_,f,!1);return;case"select":Re("invalid",e),l=_=h=null;for(f in s)if(s.hasOwnProperty(f)&&(k=s[f],k!=null))switch(f){case"value":h=k;break;case"defaultValue":_=k;break;case"multiple":l=k;default:Xe(e,n,f,k,s,null)}n=h,s=_,e.multiple=!!l,n!=null?Js(e,!!l,n,!1):s!=null&&Js(e,!!l,s,!0);return;case"textarea":Re("invalid",e),h=f=l=null;for(_ in s)if(s.hasOwnProperty(_)&&(k=s[_],k!=null))switch(_){case"value":l=k;break;case"defaultValue":f=k;break;case"children":h=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(o(91));break;default:Xe(e,n,_,k,s,null)}pp(e,l,f,h);return;case"option":for(D in s)if(s.hasOwnProperty(D)&&(l=s[D],l!=null))switch(D){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Xe(e,n,D,l,s,null)}return;case"dialog":Re("beforetoggle",e),Re("toggle",e),Re("cancel",e),Re("close",e);break;case"iframe":case"object":Re("load",e);break;case"video":case"audio":for(l=0;l<zo.length;l++)Re(zo[l],e);break;case"image":Re("error",e),Re("load",e);break;case"details":Re("toggle",e);break;case"embed":case"source":case"link":Re("error",e),Re("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(H in s)if(s.hasOwnProperty(H)&&(l=s[H],l!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,n));default:Xe(e,n,H,l,s,null)}return;default:if($c(n)){for(Y in s)s.hasOwnProperty(Y)&&(l=s[Y],l!==void 0&&Ad(e,n,Y,l,s,void 0));return}}for(k in s)s.hasOwnProperty(k)&&(l=s[k],l!=null&&Xe(e,n,k,l,s,null))}function yS(e,n,s,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,_=null,k=null,D=null,H=null,Y=null;for(K in s){var W=s[K];if(s.hasOwnProperty(K)&&W!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":D=W;default:l.hasOwnProperty(K)||Xe(e,n,K,null,l,W)}}for(var P in l){var K=l[P];if(W=s[P],l.hasOwnProperty(P)&&(K!=null||W!=null))switch(P){case"type":h=K;break;case"name":f=K;break;case"checked":H=K;break;case"defaultChecked":Y=K;break;case"value":_=K;break;case"defaultValue":k=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(o(137,n));break;default:K!==W&&Xe(e,n,P,K,l,W)}}Pc(e,_,k,D,H,Y,h,f);return;case"select":K=_=k=P=null;for(h in s)if(D=s[h],s.hasOwnProperty(h)&&D!=null)switch(h){case"value":break;case"multiple":K=D;default:l.hasOwnProperty(h)||Xe(e,n,h,null,l,D)}for(f in l)if(h=l[f],D=s[f],l.hasOwnProperty(f)&&(h!=null||D!=null))switch(f){case"value":P=h;break;case"defaultValue":k=h;break;case"multiple":_=h;default:h!==D&&Xe(e,n,f,h,l,D)}n=k,s=_,l=K,P!=null?Js(e,!!s,P,!1):!!l!=!!s&&(n!=null?Js(e,!!s,n,!0):Js(e,!!s,s?[]:"",!1));return;case"textarea":K=P=null;for(k in s)if(f=s[k],s.hasOwnProperty(k)&&f!=null&&!l.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Xe(e,n,k,null,l,f)}for(_ in l)if(f=l[_],h=s[_],l.hasOwnProperty(_)&&(f!=null||h!=null))switch(_){case"value":P=f;break;case"defaultValue":K=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:f!==h&&Xe(e,n,_,f,l,h)}hp(e,P,K);return;case"option":for(var de in s)if(P=s[de],s.hasOwnProperty(de)&&P!=null&&!l.hasOwnProperty(de))switch(de){case"selected":e.selected=!1;break;default:Xe(e,n,de,null,l,P)}for(D in l)if(P=l[D],K=s[D],l.hasOwnProperty(D)&&P!==K&&(P!=null||K!=null))switch(D){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:Xe(e,n,D,P,l,K)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in s)P=s[ve],s.hasOwnProperty(ve)&&P!=null&&!l.hasOwnProperty(ve)&&Xe(e,n,ve,null,l,P);for(H in l)if(P=l[H],K=s[H],l.hasOwnProperty(H)&&P!==K&&(P!=null||K!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(o(137,n));break;default:Xe(e,n,H,P,l,K)}return;default:if($c(n)){for(var Qe in s)P=s[Qe],s.hasOwnProperty(Qe)&&P!==void 0&&!l.hasOwnProperty(Qe)&&Ad(e,n,Qe,void 0,l,P);for(Y in l)P=l[Y],K=s[Y],!l.hasOwnProperty(Y)||P===K||P===void 0&&K===void 0||Ad(e,n,Y,P,l,K);return}}for(var I in s)P=s[I],s.hasOwnProperty(I)&&P!=null&&!l.hasOwnProperty(I)&&Xe(e,n,I,null,l,P);for(W in l)P=l[W],K=s[W],!l.hasOwnProperty(W)||P===K||P==null&&K==null||Xe(e,n,W,P,l,K)}function vv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function bS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var f=s[l],h=f.transferSize,_=f.initiatorType,k=f.duration;if(h&&k&&vv(_)){for(_=0,k=f.responseEnd,l+=1;l<s.length;l++){var D=s[l],H=D.startTime;if(H>k)break;var Y=D.transferSize,W=D.initiatorType;Y&&vv(W)&&(D=D.responseEnd,_+=Y*(D<k?1:(k-H)/(D-H)))}if(--l,n+=8*(h+_)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Dd=null,Rd=null;function wr(e){return e.nodeType===9?e:e.ownerDocument}function yv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function bv(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Md(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Od=null;function xS(){var e=window.event;return e&&e.type==="popstate"?e===Od?!1:(Od=e,!0):(Od=null,!1)}var xv=typeof setTimeout=="function"?setTimeout:void 0,_S=typeof clearTimeout=="function"?clearTimeout:void 0,_v=typeof Promise=="function"?Promise:void 0,SS=typeof queueMicrotask=="function"?queueMicrotask:typeof _v<"u"?function(e){return _v.resolve(null).then(e).catch(TS)}:xv;function TS(e){setTimeout(function(){throw e})}function Ya(e){return e==="head"}function Sv(e,n){var s=n,l=0;do{var f=s.nextSibling;if(e.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(f),Di(n);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Ho(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Ho(s);for(var h=s.firstChild;h;){var _=h.nextSibling,k=h.nodeName;h[so]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=_}}else s==="body"&&Ho(e.ownerDocument.body);s=f}while(s);Di(n)}function Tv(e,n){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function Bd(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Bd(s),Vc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function kS(e,n,s,l){for(;e.nodeType===1;){var f=s;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[so])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Nn(e.nextSibling),e===null)break}return null}function CS(e,n,s){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Nn(e.nextSibling),e===null))return null;return e}function kv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Nn(e.nextSibling),e===null))return null;return e}function Id(e){return e.data==="$?"||e.data==="$~"}function Ld(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ES(e,n){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||s.readyState!=="loading")n();else{var l=function(){n(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Nn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Ud=null;function Cv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(n===0)return Nn(e.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}e=e.nextSibling}return null}function Ev(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return e;n--}else s!=="/$"&&s!=="/&"||n++}e=e.previousSibling}return null}function Nv(e,n,s){switch(n=wr(s),e){case"html":if(e=n.documentElement,!e)throw Error(o(452));return e;case"head":if(e=n.head,!e)throw Error(o(453));return e;case"body":if(e=n.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Ho(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Vc(e)}var jn=new Map,jv=new Set;function Ar(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ya=q.d;q.d={f:NS,r:jS,D:wS,C:AS,L:DS,m:RS,X:OS,S:MS,M:BS};function NS(){var e=ya.f(),n=_r();return e||n}function jS(e){var n=Xs(e);n!==null&&n.tag===5&&n.type==="form"?Fm(n):ya.r(e)}var ji=typeof document>"u"?null:document;function wv(e,n,s){var l=ji;if(l&&typeof n=="string"&&n){var f=xn(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),jv.has(f)||(jv.add(f),e={rel:e,crossOrigin:s,href:n},l.querySelector(f)===null&&(n=l.createElement("link"),Ut(n,"link",e),Dt(n),l.head.appendChild(n)))}}function wS(e){ya.D(e),wv("dns-prefetch",e,null)}function AS(e,n){ya.C(e,n),wv("preconnect",e,n)}function DS(e,n,s){ya.L(e,n,s);var l=ji;if(l&&e&&n){var f='link[rel="preload"][as="'+xn(n)+'"]';n==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+xn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+xn(s.imageSizes)+'"]')):f+='[href="'+xn(e)+'"]';var h=f;switch(n){case"style":h=wi(e);break;case"script":h=Ai(e)}jn.has(h)||(e=y({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:e,as:n},s),jn.set(h,e),l.querySelector(f)!==null||n==="style"&&l.querySelector(Po(h))||n==="script"&&l.querySelector(Go(h))||(n=l.createElement("link"),Ut(n,"link",e),Dt(n),l.head.appendChild(n)))}}function RS(e,n){ya.m(e,n);var s=ji;if(s&&e){var l=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+xn(l)+'"][href="'+xn(e)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ai(e)}if(!jn.has(h)&&(e=y({rel:"modulepreload",href:e},n),jn.set(h,e),s.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Go(h)))return}l=s.createElement("link"),Ut(l,"link",e),Dt(l),s.head.appendChild(l)}}}function MS(e,n,s){ya.S(e,n,s);var l=ji;if(l&&e){var f=Qs(l).hoistableStyles,h=wi(e);n=n||"default";var _=f.get(h);if(!_){var k={loading:0,preload:null};if(_=l.querySelector(Po(h)))k.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":n},s),(s=jn.get(h))&&zd(e,s);var D=_=l.createElement("link");Dt(D),Ut(D,"link",e),D._p=new Promise(function(H,Y){D.onload=H,D.onerror=Y}),D.addEventListener("load",function(){k.loading|=1}),D.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Dr(_,n,l)}_={type:"stylesheet",instance:_,count:1,state:k},f.set(h,_)}}}function OS(e,n){ya.X(e,n);var s=ji;if(s&&e){var l=Qs(s).hoistableScripts,f=Ai(e),h=l.get(f);h||(h=s.querySelector(Go(f)),h||(e=y({src:e,async:!0},n),(n=jn.get(f))&&Vd(e,n),h=s.createElement("script"),Dt(h),Ut(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function BS(e,n){ya.M(e,n);var s=ji;if(s&&e){var l=Qs(s).hoistableScripts,f=Ai(e),h=l.get(f);h||(h=s.querySelector(Go(f)),h||(e=y({src:e,async:!0,type:"module"},n),(n=jn.get(f))&&Vd(e,n),h=s.createElement("script"),Dt(h),Ut(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function Av(e,n,s,l){var f=(f=ee.current)?Ar(f):null;if(!f)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=wi(s.href),s=Qs(f).hoistableStyles,l=s.get(n),l||(l={type:"style",instance:null,count:0,state:null},s.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=wi(s.href);var h=Qs(f).hoistableStyles,_=h.get(e);if(_||(f=f.ownerDocument||f,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,_),(h=f.querySelector(Po(e)))&&!h._p&&(_.instance=h,_.state.loading=5),jn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},jn.set(e,s),h||IS(f,e,s,_.state))),n&&l===null)throw Error(o(528,""));return _}if(n&&l!==null)throw Error(o(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ai(s),s=Qs(f).hoistableScripts,l=s.get(n),l||(l={type:"script",instance:null,count:0,state:null},s.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function wi(e){return'href="'+xn(e)+'"'}function Po(e){return'link[rel="stylesheet"]['+e+"]"}function Dv(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function IS(e,n,s,l){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=e.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),Ut(n,"link",s),Dt(n),e.head.appendChild(n))}function Ai(e){return'[src="'+xn(e)+'"]'}function Go(e){return"script[async]"+e}function Rv(e,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+xn(s.href)+'"]');if(l)return n.instance=l,Dt(l),l;var f=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Dt(l),Ut(l,"style",f),Dr(l,s.precedence,e),n.instance=l;case"stylesheet":f=wi(s.href);var h=e.querySelector(Po(f));if(h)return n.state.loading|=4,n.instance=h,Dt(h),h;l=Dv(s),(f=jn.get(f))&&zd(l,f),h=(e.ownerDocument||e).createElement("link"),Dt(h);var _=h;return _._p=new Promise(function(k,D){_.onload=k,_.onerror=D}),Ut(h,"link",l),n.state.loading|=4,Dr(h,s.precedence,e),n.instance=h;case"script":return h=Ai(s.src),(f=e.querySelector(Go(h)))?(n.instance=f,Dt(f),f):(l=s,(f=jn.get(h))&&(l=y({},s),Vd(l,f)),e=e.ownerDocument||e,f=e.createElement("script"),Dt(f),Ut(f,"link",l),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(o(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,Dr(l,s.precedence,e));return n.instance}function Dr(e,n,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,_=0;_<l.length;_++){var k=l[_];if(k.dataset.precedence===n)h=k;else if(h!==f)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(e,n.firstChild))}function zd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Vd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Rr=null;function Mv(e,n,s){if(Rr===null){var l=new Map,f=Rr=new Map;f.set(s,l)}else f=Rr,l=f.get(s),l||(l=new Map,f.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),f=0;f<s.length;f++){var h=s[f];if(!(h[so]||h[Ot]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(n)||"";_=e+_;var k=l.get(_);k?k.push(h):l.set(_,[h])}}return l}function Ov(e,n,s){e=e.ownerDocument||e,e.head.insertBefore(s,n==="title"?e.querySelector("head > title"):null)}function LS(e,n,s){if(s===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Bv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function US(e,n,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=wi(l.href),h=n.querySelector(Po(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Mr.bind(e),n.then(e,e)),s.state.loading|=4,s.instance=h,Dt(h);return}h=n.ownerDocument||n,l=Dv(l),(f=jn.get(f))&&zd(l,f),h=h.createElement("link"),Dt(h);var _=h;_._p=new Promise(function(k,D){_.onload=k,_.onerror=D}),Ut(h,"link",l),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Mr.bind(e),n.addEventListener("load",s),n.addEventListener("error",s))}}var Hd=0;function zS(e,n){return e.stylesheets&&e.count===0&&Br(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&Br(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Hd===0&&(Hd=62500*bS());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Br(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Hd?50:800)+n);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function Mr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Br(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Or=null;function Br(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Or=new Map,n.forEach(VS,e),Or=null,Mr.call(e))}function VS(e,n){if(!(n.state.loading&4)){var s=Or.get(e);if(s)var l=s.get(null);else{s=new Map,Or.set(e,s);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var _=f[h];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),l=_)}l&&s.set(null,l)}f=n.instance,_=f.getAttribute("data-precedence"),h=s.get(_)||l,h===l&&s.set(null,f),s.set(_,f),this.count++,l=Mr.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),h?h.parentNode.insertBefore(f,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var $o={$$typeof:A,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function HS(e,n,s,l,f,h,_,k,D){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ic(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ic(0),this.hiddenUpdates=Ic(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Iv(e,n,s,l,f,h,_,k,D,H,Y,W){return e=new HS(e,n,s,_,D,H,Y,W,k),n=1,h===!0&&(n|=24),h=sn(3,null,null,n),e.current=h,h.stateNode=e,n=xu(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:l,isDehydrated:s,cache:n},ku(h),e}function Lv(e){return e?(e=li,e):li}function Uv(e,n,s,l,f,h){f=Lv(f),l.context===null?l.context=f:l.pendingContext=f,l=La(n),l.payload={element:s},h=h===void 0?null:h,h!==null&&(l.callback=h),s=Ua(e,l,n),s!==null&&(en(s,e,n),So(s,e,n))}function zv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<n?s:n}}function Pd(e,n){zv(e,n),(e=e.alternate)&&zv(e,n)}function Vv(e){if(e.tag===13||e.tag===31){var n=gs(e,67108864);n!==null&&en(n,e,67108864),Pd(e,67108864)}}function Hv(e){if(e.tag===13||e.tag===31){var n=un();n=Lc(n);var s=gs(e,n);s!==null&&en(s,e,n),Pd(e,n)}}var Ir=!0;function PS(e,n,s,l){var f=B.T;B.T=null;var h=q.p;try{q.p=2,Gd(e,n,s,l)}finally{q.p=h,B.T=f}}function GS(e,n,s,l){var f=B.T;B.T=null;var h=q.p;try{q.p=8,Gd(e,n,s,l)}finally{q.p=h,B.T=f}}function Gd(e,n,s,l){if(Ir){var f=$d(l);if(f===null)wd(e,n,l,Lr,s),Gv(e,l);else if(FS(f,e,n,s,l))l.stopPropagation();else if(Gv(e,l),n&4&&-1<$S.indexOf(e)){for(;f!==null;){var h=Xs(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=ds(h.pendingLanes);if(_!==0){var k=h;for(k.pendingLanes|=2,k.entangledLanes|=2;_;){var D=1<<31-Fe(_);k.entanglements[1]|=D,_&=~D}Gn(h),(Ge&6)===0&&(br=Vt()+500,Uo(0))}}break;case 31:case 13:k=gs(h,2),k!==null&&en(k,h,2),_r(),Pd(h,2)}if(h=$d(l),h===null&&wd(e,n,l,Lr,s),h===f)break;f=h}f!==null&&l.stopPropagation()}else wd(e,n,l,null,s)}}function $d(e){return e=qc(e),Fd(e)}var Lr=null;function Fd(e){if(Lr=null,e=Zs(e),e!==null){var n=u(e);if(n===null)e=null;else{var s=n.tag;if(s===13){if(e=d(n),e!==null)return e;e=null}else if(s===31){if(e=p(n),e!==null)return e;e=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Lr=e,null}function Pv(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Bc()){case X:return 2;case re:return 8;case ue:case Se:return 32;case ge:return 268435456;default:return 32}default:return 32}}var qd=!1,Za=null,Xa=null,Qa=null,Fo=new Map,qo=new Map,Wa=[],$S="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".split(" ");function Gv(e,n){switch(e){case"focusin":case"focusout":Za=null;break;case"dragenter":case"dragleave":Xa=null;break;case"mouseover":case"mouseout":Qa=null;break;case"pointerover":case"pointerout":Fo.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":qo.delete(n.pointerId)}}function Ko(e,n,s,l,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:s,eventSystemFlags:l,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Xs(n),n!==null&&Vv(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function FS(e,n,s,l,f){switch(n){case"focusin":return Za=Ko(Za,e,n,s,l,f),!0;case"dragenter":return Xa=Ko(Xa,e,n,s,l,f),!0;case"mouseover":return Qa=Ko(Qa,e,n,s,l,f),!0;case"pointerover":var h=f.pointerId;return Fo.set(h,Ko(Fo.get(h)||null,e,n,s,l,f)),!0;case"gotpointercapture":return h=f.pointerId,qo.set(h,Ko(qo.get(h)||null,e,n,s,l,f)),!0}return!1}function $v(e){var n=Zs(e.target);if(n!==null){var s=u(n);if(s!==null){if(n=s.tag,n===13){if(n=d(s),n!==null){e.blockedOn=n,sp(e.priority,function(){Hv(s)});return}}else if(n===31){if(n=p(s),n!==null){e.blockedOn=n,sp(e.priority,function(){Hv(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ur(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var s=$d(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);Fc=l,s.target.dispatchEvent(l),Fc=null}else return n=Xs(s),n!==null&&Vv(n),e.blockedOn=s,!1;n.shift()}return!0}function Fv(e,n,s){Ur(e)&&s.delete(n)}function qS(){qd=!1,Za!==null&&Ur(Za)&&(Za=null),Xa!==null&&Ur(Xa)&&(Xa=null),Qa!==null&&Ur(Qa)&&(Qa=null),Fo.forEach(Fv),qo.forEach(Fv)}function zr(e,n){e.blockedOn===n&&(e.blockedOn=null,qd||(qd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qS)))}var Vr=null;function qv(e){Vr!==e&&(Vr=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vr===e&&(Vr=null);for(var n=0;n<e.length;n+=3){var s=e[n],l=e[n+1],f=e[n+2];if(typeof l!="function"){if(Fd(l||s)===null)continue;break}var h=Xs(s);h!==null&&(e.splice(n,3),n-=3,$u(h,{pending:!0,data:f,method:s.method,action:l},l,f))}}))}function Di(e){function n(D){return zr(D,e)}Za!==null&&zr(Za,e),Xa!==null&&zr(Xa,e),Qa!==null&&zr(Qa,e),Fo.forEach(n),qo.forEach(n);for(var s=0;s<Wa.length;s++){var l=Wa[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Wa.length&&(s=Wa[0],s.blockedOn===null);)$v(s),s.blockedOn===null&&Wa.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var f=s[l],h=s[l+1],_=f[Yt]||null;if(typeof h=="function")_||qv(s);else if(_){var k=null;if(h&&h.hasAttribute("formAction")){if(f=h,_=h[Yt]||null)k=_.formAction;else if(Fd(f)!==null)continue}else k=_.action;typeof k=="function"?s[l+1]=k:(s.splice(l,3),l-=3),qv(s)}}}function Kv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(_){return f=_})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Kd(e){this._internalRoot=e}Hr.prototype.render=Kd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(o(409));var s=n.current,l=un();Uv(s,l,e,n,null,null)},Hr.prototype.unmount=Kd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Uv(e.current,2,null,e,null,null),_r(),n[Ys]=null}};function Hr(e){this._internalRoot=e}Hr.prototype.unstable_scheduleHydration=function(e){if(e){var n=ap();e={blockedOn:null,target:e,priority:n};for(var s=0;s<Wa.length&&n!==0&&n<Wa[s].priority;s++);Wa.splice(s,0,e),s===0&&$v(e)}};var Yv=a.version;if(Yv!=="19.2.4")throw Error(o(527,Yv,"19.2.4"));q.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var KS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pr.isDisabled&&Pr.supportsFiber)try{tt=Pr.inject(KS),Ae=Pr}catch{}}return Yo.createRoot=function(e,n){if(!r(e))throw Error(o(299));var s=!1,l="",f=tg,h=ng,_=ag;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(_=n.onRecoverableError)),n=Iv(e,1,!1,null,null,s,l,null,f,h,_,Kv),e[Ys]=n.current,jd(e),new Kd(n)},Yo.hydrateRoot=function(e,n,s){if(!r(e))throw Error(o(299));var l=!1,f="",h=tg,_=ng,k=ag,D=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError),s.formState!==void 0&&(D=s.formState)),n=Iv(e,1,!0,n,s??null,l,f,D,h,_,k,Kv),n.context=Lv(null),s=n.current,l=un(),l=Lc(l),f=La(l),f.callback=null,Ua(s,f,l),s=l,n.current.lanes=s,ao(n,s),Gn(n),e[Ys]=n.current,jd(e),new Hr(n)},Yo.version="19.2.4",Yo}var ty;function cT(){if(ty)return Yd.exports;ty=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(a){console.error(a)}}return t(),Yd.exports=rT(),Yd.exports}var uT=cT();const dT="modulepreload",fT=function(t){return"/"+t},ny={},hT=function(a,i,o){let r=Promise.resolve();if(i&&i.length>0){let d=function(g){return Promise.all(g.map(v=>Promise.resolve(v).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),m=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));r=d(i.map(g=>{if(g=fT(g),g in ny)return;ny[g]=!0;const v=g.endsWith(".css"),y=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${y}`))return;const x=document.createElement("link");if(x.rel=v?"stylesheet":dT,v||(x.as="script"),x.crossOrigin="",x.href=g,m&&x.setAttribute("nonce",m),document.head.appendChild(x),v)return new Promise((S,T)=>{x.addEventListener("load",S),x.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${g}`)))})}))}function u(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return r.then(d=>{for(const p of d||[])p.status==="rejected"&&u(p.reason);return a().catch(u)})};function Kt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function hl(t,a){return console.warn(`[ws] Malformed "${t}" message: ${a}`),!1}function pT(t){return Kt(t)&&typeof t.id=="string"&&typeof t.type=="string"&&typeof t.timestamp=="string"&&Kt(t.payload)}function mT(t){return Kt(t)&&typeof t.id=="string"&&typeof t.displayName=="string"&&typeof t.adapterType=="string"&&typeof t.status=="string"&&typeof t.bootstrapped=="boolean"&&(typeof t.adapterConfig=="string"||t.adapterConfig===void 0)}function gT(t){return{...t,adapterConfig:t.adapterConfig??"{}"}}function ay(t){return Kt(t)&&typeof t.id=="string"&&typeof t.environmentId=="string"&&typeof t.runtime=="string"&&typeof t.status=="string"&&typeof t.prompt=="string"&&typeof t.startedAt=="string"&&(t.endedAt===void 0||typeof t.endedAt=="string")&&(t.error===void 0||typeof t.error=="string")&&(t.endReason===void 0||typeof t.endReason=="string")}function sy(t){return Kt(t)&&typeof t.sessionId=="string"&&typeof t.eventType=="string"&&typeof t.timestamp=="string"&&typeof t.content=="string"&&(t.raw===void 0||typeof t.raw=="string")}function vT(t){return Kt(t)&&typeof t.id=="string"&&typeof t.name=="string"&&typeof t.description=="string"&&typeof t.repoUrl=="string"&&typeof t.environmentId=="string"&&typeof t.status=="string"&&typeof t.worktreeBasePath=="string"&&typeof t.useWorktrees=="boolean"&&(t.defaultPersonaId===void 0||typeof t.defaultPersonaId=="string")&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"}function yT(t){return Kt(t)&&typeof t.id=="string"&&(typeof t.workspaceId=="string"||t.workspaceId===void 0)&&typeof t.title=="string"&&typeof t.status=="string"&&typeof t.branch=="string"&&typeof t.sortOrder=="number"&&typeof t.depth=="number"&&(t.defaultPersonaId===void 0||typeof t.defaultPersonaId=="string")&&Array.isArray(t.dependsOn)&&Array.isArray(t.childTaskIds)}function bT(t){return Kt(t)&&typeof t.id=="string"&&typeof t.workspaceId=="string"&&typeof t.taskId=="string"&&typeof t.sessionId=="string"&&typeof t.category=="string"&&typeof t.title=="string"&&typeof t.content=="string"&&Array.isArray(t.tags)&&typeof t.createdAt=="string"}function xT(t){return Kt(t)&&typeof t.name=="string"&&typeof t.tokenType=="string"&&typeof t.envVar=="string"&&typeof t.filePath=="string"&&typeof t.expiresAt=="string"}const _T=new Set(["off","subscription","api_key"]),$r=new Set(["off","on"]);function iy(t){return Kt(t)&&_T.has(t.claude)&&$r.has(t.github)&&$r.has(t.copilot)&&$r.has(t.codex)&&$r.has(t.goose)}function ST(t){return Kt(t)&&typeof t.name=="string"&&typeof t.repository=="string"&&typeof t.state=="string"&&typeof t.gitStatus=="string"}function TT(t){return Kt(t)&&typeof t.id=="string"&&typeof t.name=="string"&&typeof t.description=="string"&&typeof t.systemPrompt=="string"&&typeof t.toolConfig=="string"&&typeof t.runtime=="string"&&typeof t.model=="string"&&typeof t.maxTurns=="number"&&typeof t.mcpServers=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"&&typeof t.type=="string"&&typeof t.script=="string"}function Yn(t,a,i,o){return Array.isArray(t)?t.filter((r,u)=>a(r)?!0:(hl(i,`item at index ${u} in "${o}" has unexpected shape`),!1)):(hl(i,`expected "${o}" to be an array, got ${typeof t}`),[])}function kT(t){let a;try{a=JSON.parse(t)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!Kt(a)||typeof a.type!="string"){console.warn("[ws] Received WebSocket message without a string 'type' field:",a);return}return typeof a.id=="string"&&typeof a.timestamp=="string"?{id:a.id,type:a.type,timestamp:a.timestamp,payload:Kt(a.payload)?a.payload:{}}:{type:a.type,payload:Kt(a.payload)?a.payload:void 0}}function tb(t){switch(t){case"waiting_input":return"idle";case"completed":return"stopped";case"killed":return"stopped";case"failed":return"stopped";default:return t}}function nb(t){switch(t){case"completed":return"completed";case"killed":return"killed";case"failed":return"interrupted";default:return}}const CT=3e3,Ri=5e3,ET=4001;/**
|
|
27
|
-
* react-router v7.13.1
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Remix Software Inc.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
33
|
-
*
|
|
34
|
-
* @license MIT
|
|
35
|
-
*/var oy="popstate";function ly(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function NT(t={}){function a(o,r){var g;let u=(g=r.state)==null?void 0:g.masked,{pathname:d,search:p,hash:m}=u||o.location;return kf("",{pathname:d,search:p,hash:m},r.state&&r.state.usr||null,r.state&&r.state.key||"default",u?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function i(o,r){return typeof r=="string"?r:pl(r)}return wT(a,i,null,t)}function rt(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function Rn(t,a){if(!t){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function jT(){return Math.random().toString(36).substring(2,10)}function ry(t,a){return{usr:t.state,key:t.key,idx:a,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function kf(t,a,i=null,o,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof a=="string"?Zi(a):a,state:i,key:a&&a.key||o||jT(),unstable_mask:r}}function pl({pathname:t="/",search:a="",hash:i=""}){return a&&a!=="?"&&(t+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(t+=i.charAt(0)==="#"?i:"#"+i),t}function Zi(t){let a={};if(t){let i=t.indexOf("#");i>=0&&(a.hash=t.substring(i),t=t.substring(0,i));let o=t.indexOf("?");o>=0&&(a.search=t.substring(o),t=t.substring(0,o)),t&&(a.pathname=t)}return a}function wT(t,a,i,o={}){let{window:r=document.defaultView,v5Compat:u=!1}=o,d=r.history,p="POP",m=null,g=v();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function v(){return(d.state||{idx:null}).idx}function y(){p="POP";let N=v(),C=N==null?null:N-g;g=N,m&&m({action:p,location:E.location,delta:C})}function x(N,C){p="PUSH";let j=ly(N)?N:kf(E.location,N,C);g=v()+1;let A=ry(j,g),R=E.createHref(j.unstable_mask||j);try{d.pushState(A,"",R)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;r.location.assign(R)}u&&m&&m({action:p,location:E.location,delta:1})}function S(N,C){p="REPLACE";let j=ly(N)?N:kf(E.location,N,C);g=v();let A=ry(j,g),R=E.createHref(j.unstable_mask||j);d.replaceState(A,"",R),u&&m&&m({action:p,location:E.location,delta:0})}function T(N){return AT(N)}let E={get action(){return p},get location(){return t(r,d)},listen(N){if(m)throw new Error("A history only accepts one active listener");return r.addEventListener(oy,y),m=N,()=>{r.removeEventListener(oy,y),m=null}},createHref(N){return a(r,N)},createURL:T,encodeLocation(N){let C=T(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:x,replace:S,go(N){return d.go(N)}};return E}function AT(t,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),rt(i,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:pl(t);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=i+o),new URL(o,i)}function ab(t,a,i="/"){return DT(t,a,i,!1)}function DT(t,a,i,o){let r=typeof a=="string"?Zi(a):a,u=Ta(r.pathname||"/",i);if(u==null)return null;let d=sb(t);RT(d);let p=null;for(let m=0;p==null&&m<d.length;++m){let g=ob(u);p=HT(d[m],g,o)}return p}function sb(t,a=[],i=[],o="",r=!1){let u=(d,p,m=r,g)=>{let v={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:p,route:d};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(o)&&m)return;rt(v.relativePath.startsWith(o),`Absolute route path "${v.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(o.length)}let y=Zn([o,v.relativePath]),x=i.concat(v);d.children&&d.children.length>0&&(rt(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),sb(d.children,a,x,y,m)),!(d.path==null&&!d.index)&&a.push({path:y,score:zT(y,d.index),routesMeta:x})};return t.forEach((d,p)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))u(d,p);else for(let g of ib(d.path))u(d,p,!0,g)}),a}function ib(t){let a=t.split("/");if(a.length===0)return[];let[i,...o]=a,r=i.endsWith("?"),u=i.replace(/\?$/,"");if(o.length===0)return r?[u,""]:[u];let d=ib(o.join("/")),p=[];return p.push(...d.map(m=>m===""?u:[u,m].join("/"))),r&&p.push(...d),p.map(m=>t.startsWith("/")&&m===""?"/":m)}function RT(t){t.sort((a,i)=>a.score!==i.score?i.score-a.score:VT(a.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var MT=/^:[\w-]+$/,OT=3,BT=2,IT=1,LT=10,UT=-2,cy=t=>t==="*";function zT(t,a){let i=t.split("/"),o=i.length;return i.some(cy)&&(o+=UT),a&&(o+=BT),i.filter(r=>!cy(r)).reduce((r,u)=>r+(MT.test(u)?OT:u===""?IT:LT),o)}function VT(t,a){return t.length===a.length&&t.slice(0,-1).every((o,r)=>o===a[r])?t[t.length-1]-a[a.length-1]:0}function HT(t,a,i=!1){let{routesMeta:o}=t,r={},u="/",d=[];for(let p=0;p<o.length;++p){let m=o[p],g=p===o.length-1,v=u==="/"?a:a.slice(u.length)||"/",y=ml({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},v),x=m.route;if(!y&&g&&i&&!o[o.length-1].route.index&&(y=ml({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!y)return null;Object.assign(r,y.params),d.push({params:r,pathname:Zn([u,y.pathname]),pathnameBase:qT(Zn([u,y.pathnameBase])),route:x}),y.pathnameBase!=="/"&&(u=Zn([u,y.pathnameBase]))}return d}function ml(t,a){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[i,o]=PT(t.path,t.caseSensitive,t.end),r=a.match(i);if(!r)return null;let u=r[0],d=u.replace(/(.)\/+$/,"$1"),p=r.slice(1);return{params:o.reduce((g,{paramName:v,isOptional:y},x)=>{if(v==="*"){let T=p[x]||"";d=u.slice(0,u.length-T.length).replace(/(.)\/+$/,"$1")}const S=p[x];return y&&!S?g[v]=void 0:g[v]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:d,pattern:t}}function PT(t,a=!1,i=!0){Rn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let o=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,p,m,g,v)=>{if(o.push({paramName:p,isOptional:m!=null}),m){let y=v.charAt(g+d.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,a?void 0:"i"),o]}function ob(t){try{return t.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Rn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),t}}function Ta(t,a){if(a==="/")return t;if(!t.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,o=t.charAt(i);return o&&o!=="/"?null:t.slice(i)||"/"}var GT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function $T(t,a="/"){let{pathname:i,search:o="",hash:r=""}=typeof t=="string"?Zi(t):t,u;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?u=uy(i.substring(1),"/"):u=uy(i,a)):u=a,{pathname:u,search:KT(o),hash:YT(r)}}function uy(t,a){let i=a.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?i.length>1&&i.pop():r!=="."&&i.push(r)}),i.length>1?i.join("/"):"/"}function Qd(t,a,i,o){return`Cannot include a '${t}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function FT(t){return t.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function ah(t){let a=FT(t);return a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase)}function Sc(t,a,i,o=!1){let r;typeof t=="string"?r=Zi(t):(r={...t},rt(!r.pathname||!r.pathname.includes("?"),Qd("?","pathname","search",r)),rt(!r.pathname||!r.pathname.includes("#"),Qd("#","pathname","hash",r)),rt(!r.search||!r.search.includes("#"),Qd("#","search","hash",r)));let u=t===""||r.pathname==="",d=u?"/":r.pathname,p;if(d==null)p=i;else{let y=a.length-1;if(!o&&d.startsWith("..")){let x=d.split("/");for(;x[0]==="..";)x.shift(),y-=1;r.pathname=x.join("/")}p=y>=0?a[y]:"/"}let m=$T(r,p),g=d&&d!=="/"&&d.endsWith("/"),v=(u||d===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(g||v)&&(m.pathname+="/"),m}var Zn=t=>t.join("/").replace(/\/\/+/g,"/"),qT=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),KT=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,YT=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,ZT=class{constructor(t,a,i,o=!1){this.status=t,this.statusText=a||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function XT(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function QT(t){return t.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var lb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function rb(t,a){let i=t;if(typeof i!="string"||!GT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,r=!1;if(lb)try{let u=new URL(window.location.href),d=i.startsWith("//")?new URL(u.protocol+i):new URL(i),p=Ta(d.pathname,a);d.origin===u.origin&&p!=null?i=p+d.search+d.hash:r=!0}catch{Rn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:r,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var cb=["POST","PUT","PATCH","DELETE"];new Set(cb);var WT=["GET",...cb];new Set(WT);var Xi=b.createContext(null);Xi.displayName="DataRouter";var Tc=b.createContext(null);Tc.displayName="DataRouterState";var JT=b.createContext(!1),ub=b.createContext({isTransitioning:!1});ub.displayName="ViewTransition";var ek=b.createContext(new Map);ek.displayName="Fetchers";var tk=b.createContext(null);tk.displayName="Await";var mn=b.createContext(null);mn.displayName="Navigation";var Sl=b.createContext(null);Sl.displayName="Location";var Mn=b.createContext({outlet:null,matches:[],isDataRoute:!1});Mn.displayName="Route";var sh=b.createContext(null);sh.displayName="RouteError";var db="REACT_ROUTER_ERROR",nk="REDIRECT",ak="ROUTE_ERROR_RESPONSE";function sk(t){if(t.startsWith(`${db}:${nk}:{`))try{let a=JSON.parse(t.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function ik(t){if(t.startsWith(`${db}:${ak}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new ZT(a.status,a.statusText,a.data)}catch{}}function ok(t,{relative:a}={}){rt(Vs(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:o}=b.useContext(mn),{hash:r,pathname:u,search:d}=Tl(t,{relative:a}),p=u;return i!=="/"&&(p=u==="/"?i:Zn([i,u])),o.createHref({pathname:p,search:d,hash:r})}function Vs(){return b.useContext(Sl)!=null}function At(){return rt(Vs(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Sl).location}function kt(t){rt(Vs(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=At();return b.useMemo(()=>ml(t,ob(a)),[a,t])}var fb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function hb(t){b.useContext(mn).static||b.useLayoutEffect(t)}function kc(){let{isDataRoute:t}=b.useContext(Mn);return t?_k():lk()}function lk(){rt(Vs(),"useNavigate() may be used only in the context of a <Router> component.");let t=b.useContext(Xi),{basename:a,navigator:i}=b.useContext(mn),{matches:o}=b.useContext(Mn),{pathname:r}=At(),u=JSON.stringify(ah(o)),d=b.useRef(!1);return hb(()=>{d.current=!0}),b.useCallback((m,g={})=>{if(Rn(d.current,fb),!d.current)return;if(typeof m=="number"){i.go(m);return}let v=Sc(m,JSON.parse(u),r,g.relative==="path");t==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:Zn([a,v.pathname])),(g.replace?i.replace:i.push)(v,g.state,g)},[a,i,u,r,t])}var rk=b.createContext(null);function ck(t){let a=b.useContext(Mn).outlet;return b.useMemo(()=>a&&b.createElement(rk.Provider,{value:t},a),[a,t])}function rs(){let{matches:t}=b.useContext(Mn),a=t[t.length-1];return a?a.params:{}}function Tl(t,{relative:a}={}){let{matches:i}=b.useContext(Mn),{pathname:o}=At(),r=JSON.stringify(ah(i));return b.useMemo(()=>Sc(t,JSON.parse(r),o,a==="path"),[t,r,o,a])}function uk(t,a){return pb(t,a)}function pb(t,a,i){var N;rt(Vs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=b.useContext(mn),{matches:r}=b.useContext(Mn),u=r[r.length-1],d=u?u.params:{},p=u?u.pathname:"/",m=u?u.pathnameBase:"/",g=u&&u.route;{let C=g&&g.path||"";gb(p,!g||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
36
|
-
|
|
37
|
-
Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let v=At(),y;if(a){let C=typeof a=="string"?Zi(a):a;rt(m==="/"||((N=C.pathname)==null?void 0:N.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${C.pathname}" was given in the \`location\` prop.`),y=C}else y=v;let x=y.pathname||"/",S=x;if(m!=="/"){let C=m.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(C.length).join("/")}let T=ab(t,{pathname:S});Rn(g||T!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Rn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=mk(T&&T.map(C=>Object.assign({},C,{params:Object.assign({},d,C.params),pathname:Zn([m,o.encodeLocation?o.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:Zn([m,o.encodeLocation?o.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),r,i);return a&&E?b.createElement(Sl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...y},navigationType:"POP"}},E):E}function dk(){let t=xk(),a=XT(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),i=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",t),d=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:u},"ErrorBoundary")," or"," ",b.createElement("code",{style:u},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},a),i?b.createElement("pre",{style:r},i):null,d)}var fk=b.createElement(dk,null),mb=class extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,a){return a.location!==t.location||a.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:a.error,location:a.location,revalidation:t.revalidation||a.revalidation}}componentDidCatch(t,a){this.props.onError?this.props.onError(t,a):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const i=ik(t.digest);i&&(t=i)}let a=t!==void 0?b.createElement(Mn.Provider,{value:this.props.routeContext},b.createElement(sh.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?b.createElement(hk,{error:t},a):a}};mb.contextType=JT;var Wd=new WeakMap;function hk({children:t,error:a}){let{basename:i}=b.useContext(mn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=sk(a.digest);if(o){let r=Wd.get(a);if(r)throw r;let u=rb(o.location,i);if(lb&&!Wd.get(a))if(u.isExternal||o.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw Wd.set(a,d),d}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return t}function pk({routeContext:t,match:a,children:i}){let o=b.useContext(Xi);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),b.createElement(Mn.Provider,{value:t},i)}function mk(t,a=[],i){let o=i==null?void 0:i.state;if(t==null){if(!o)return null;if(o.errors)t=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)t=o.matches;else return null}let r=t,u=o==null?void 0:o.errors;if(u!=null){let v=r.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);rt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),r=r.slice(0,Math.min(r.length,v+1))}let d=!1,p=-1;if(i&&o){d=o.renderFallback;for(let v=0;v<r.length;v++){let y=r[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=v),y.route.id){let{loaderData:x,errors:S}=o,T=y.route.loader&&!x.hasOwnProperty(y.route.id)&&(!S||S[y.route.id]===void 0);if(y.route.lazy||T){i.isStatic&&(d=!0),p>=0?r=r.slice(0,p+1):r=[r[0]];break}}}}let m=i==null?void 0:i.onError,g=o&&m?(v,y)=>{var x,S;m(v,{location:o.location,params:((S=(x=o.matches)==null?void 0:x[0])==null?void 0:S.params)??{},unstable_pattern:QT(o.matches),errorInfo:y})}:void 0;return r.reduceRight((v,y,x)=>{let S,T=!1,E=null,N=null;o&&(S=u&&y.route.id?u[y.route.id]:void 0,E=y.route.errorElement||fk,d&&(p<0&&x===0?(gb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,N=null):p===x&&(T=!0,N=y.route.hydrateFallbackElement||null)));let C=a.concat(r.slice(0,x+1)),j=()=>{let A;return S?A=E:T?A=N:y.route.Component?A=b.createElement(y.route.Component,null):y.route.element?A=y.route.element:A=v,b.createElement(pk,{match:y,routeContext:{outlet:v,matches:C,isDataRoute:o!=null},children:A})};return o&&(y.route.ErrorBoundary||y.route.errorElement||x===0)?b.createElement(mb,{location:o.location,revalidation:o.revalidation,component:E,error:S,children:j(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:g}):j()},null)}function ih(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gk(t){let a=b.useContext(Xi);return rt(a,ih(t)),a}function vk(t){let a=b.useContext(Tc);return rt(a,ih(t)),a}function yk(t){let a=b.useContext(Mn);return rt(a,ih(t)),a}function oh(t){let a=yk(t),i=a.matches[a.matches.length-1];return rt(i.route.id,`${t} can only be used on routes that contain a unique "id"`),i.route.id}function bk(){return oh("useRouteId")}function xk(){var o;let t=b.useContext(sh),a=vk("useRouteError"),i=oh("useRouteError");return t!==void 0?t:(o=a.errors)==null?void 0:o[i]}function _k(){let{router:t}=gk("useNavigate"),a=oh("useNavigate"),i=b.useRef(!1);return hb(()=>{i.current=!0}),b.useCallback(async(r,u={})=>{Rn(i.current,fb),i.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:a,...u}))},[t,a])}var dy={};function gb(t,a,i){!a&&!dy[t]&&(dy[t]=!0,Rn(!1,i))}b.memo(Sk);function Sk({routes:t,future:a,state:i,isStatic:o,onError:r}){return pb(t,void 0,{state:i,isStatic:o,onError:r})}function Fn({to:t,replace:a,state:i,relative:o}){rt(Vs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=b.useContext(mn);Rn(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=b.useContext(Mn),{pathname:d}=At(),p=kc(),m=Sc(t,ah(u),d,o==="path"),g=JSON.stringify(m);return b.useEffect(()=>{p(JSON.parse(g),{replace:a,state:i,relative:o})},[p,g,o,a,i]),null}function Hs(t){return ck(t.context)}function Ce(t){rt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Tk({basename:t="/",children:a=null,location:i,navigationType:o="POP",navigator:r,static:u=!1,unstable_useTransitions:d}){rt(!Vs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=t.replace(/^\/*/,"/"),m=b.useMemo(()=>({basename:p,navigator:r,static:u,unstable_useTransitions:d,future:{}}),[p,r,u,d]);typeof i=="string"&&(i=Zi(i));let{pathname:g="/",search:v="",hash:y="",state:x=null,key:S="default",unstable_mask:T}=i,E=b.useMemo(()=>{let N=Ta(g,p);return N==null?null:{location:{pathname:N,search:v,hash:y,state:x,key:S,unstable_mask:T},navigationType:o}},[p,g,v,y,x,S,o,T]);return Rn(E!=null,`<Router basename="${p}"> is not able to match the URL "${g}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:b.createElement(mn.Provider,{value:m},b.createElement(Sl.Provider,{children:a,value:E}))}function kk({children:t,location:a}){return uk(Cf(t),a)}function Cf(t,a=[]){let i=[];return b.Children.forEach(t,(o,r)=>{if(!b.isValidElement(o))return;let u=[...a,r];if(o.type===b.Fragment){i.push.apply(i,Cf(o.props.children,u));return}rt(o.type===Ce,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),rt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=Cf(o.props.children,u)),i.push(d)}),i}var nc="get",ac="application/x-www-form-urlencoded";function Cc(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Ck(t){return Cc(t)&&t.tagName.toLowerCase()==="button"}function Ek(t){return Cc(t)&&t.tagName.toLowerCase()==="form"}function Nk(t){return Cc(t)&&t.tagName.toLowerCase()==="input"}function jk(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function wk(t,a){return t.button===0&&(!a||a==="_self")&&!jk(t)}function Ef(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((a,i)=>{let o=t[i];return a.concat(Array.isArray(o)?o.map(r=>[i,r]):[[i,o]])},[]))}function Ak(t,a){let i=Ef(t);return a&&a.forEach((o,r)=>{i.has(r)||a.getAll(r).forEach(u=>{i.append(r,u)})}),i}var Fr=null;function Dk(){if(Fr===null)try{new FormData(document.createElement("form"),0),Fr=!1}catch{Fr=!0}return Fr}var Rk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jd(t){return t!=null&&!Rk.has(t)?(Rn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ac}"`),null):t}function Mk(t,a){let i,o,r,u,d;if(Ek(t)){let p=t.getAttribute("action");o=p?Ta(p,a):null,i=t.getAttribute("method")||nc,r=Jd(t.getAttribute("enctype"))||ac,u=new FormData(t)}else if(Ck(t)||Nk(t)&&(t.type==="submit"||t.type==="image")){let p=t.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=t.getAttribute("formaction")||p.getAttribute("action");if(o=m?Ta(m,a):null,i=t.getAttribute("formmethod")||p.getAttribute("method")||nc,r=Jd(t.getAttribute("formenctype"))||Jd(p.getAttribute("enctype"))||ac,u=new FormData(p,t),!Dk()){let{name:g,type:v,value:y}=t;if(v==="image"){let x=g?`${g}.`:"";u.append(`${x}x`,"0"),u.append(`${x}y`,"0")}else g&&u.append(g,y)}}else{if(Cc(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=nc,o=null,r=ac,d=t}return u&&r==="text/plain"&&(d=u,u=void 0),{action:o,method:i.toLowerCase(),encType:r,formData:u,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lh(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function Ok(t,a,i,o){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return i?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${o}`:r.pathname=`${r.pathname}.${o}`:r.pathname==="/"?r.pathname=`_root.${o}`:a&&Ta(r.pathname,a)==="/"?r.pathname=`${a.replace(/\/$/,"")}/_root.${o}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${o}`,r}async function Bk(t,a){if(t.id in a)return a[t.id];try{let i=await import(t.module);return a[t.id]=i,i}catch(i){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ik(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function Lk(t,a,i){let o=await Promise.all(t.map(async r=>{let u=a.routes[r.route.id];if(u){let d=await Bk(u,i);return d.links?d.links():[]}return[]}));return Hk(o.flat(1).filter(Ik).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function fy(t,a,i,o,r,u){let d=(m,g)=>i[g]?m.route.id!==i[g].route.id:!0,p=(m,g)=>{var v;return i[g].pathname!==m.pathname||((v=i[g].route.path)==null?void 0:v.endsWith("*"))&&i[g].params["*"]!==m.params["*"]};return u==="assets"?a.filter((m,g)=>d(m,g)||p(m,g)):u==="data"?a.filter((m,g)=>{var y;let v=o.routes[m.route.id];if(!v||!v.hasLoader)return!1;if(d(m,g)||p(m,g))return!0;if(m.route.shouldRevalidate){let x=m.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((y=i[0])==null?void 0:y.params)||{},nextUrl:new URL(t,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function Uk(t,a,{includeHydrateFallback:i}={}){return zk(t.map(o=>{let r=a.routes[o.route.id];if(!r)return[];let u=[r.module];return r.clientActionModule&&(u=u.concat(r.clientActionModule)),r.clientLoaderModule&&(u=u.concat(r.clientLoaderModule)),i&&r.hydrateFallbackModule&&(u=u.concat(r.hydrateFallbackModule)),r.imports&&(u=u.concat(r.imports)),u}).flat(1))}function zk(t){return[...new Set(t)]}function Vk(t){let a={},i=Object.keys(t).sort();for(let o of i)a[o]=t[o];return a}function Hk(t,a){let i=new Set;return new Set(a),t.reduce((o,r)=>{let u=JSON.stringify(Vk(r));return i.has(u)||(i.add(u),o.push({key:u,link:r})),o},[])}function vb(){let t=b.useContext(Xi);return lh(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Pk(){let t=b.useContext(Tc);return lh(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var rh=b.createContext(void 0);rh.displayName="FrameworkContext";function yb(){let t=b.useContext(rh);return lh(t,"You must render this element inside a <HydratedRouter> element"),t}function Gk(t,a){let i=b.useContext(rh),[o,r]=b.useState(!1),[u,d]=b.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:v,onTouchStart:y}=a,x=b.useRef(null);b.useEffect(()=>{if(t==="render"&&d(!0),t==="viewport"){let E=C=>{C.forEach(j=>{d(j.isIntersecting)})},N=new IntersectionObserver(E,{threshold:.5});return x.current&&N.observe(x.current),()=>{N.disconnect()}}},[t]),b.useEffect(()=>{if(o){let E=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(E)}}},[o]);let S=()=>{r(!0)},T=()=>{r(!1),d(!1)};return i?t!=="intent"?[u,x,{}]:[u,x,{onFocus:Zo(p,S),onBlur:Zo(m,T),onMouseEnter:Zo(g,S),onMouseLeave:Zo(v,T),onTouchStart:Zo(y,S)}]:[!1,x,{}]}function Zo(t,a){return i=>{t&&t(i),i.defaultPrevented||a(i)}}function $k({page:t,...a}){let{router:i}=vb(),o=b.useMemo(()=>ab(i.routes,t,i.basename),[i.routes,t,i.basename]);return o?b.createElement(qk,{page:t,matches:o,...a}):null}function Fk(t){let{manifest:a,routeModules:i}=yb(),[o,r]=b.useState([]);return b.useEffect(()=>{let u=!1;return Lk(t,a,i).then(d=>{u||r(d)}),()=>{u=!0}},[t,a,i]),o}function qk({page:t,matches:a,...i}){let o=At(),{future:r,manifest:u,routeModules:d}=yb(),{basename:p}=vb(),{loaderData:m,matches:g}=Pk(),v=b.useMemo(()=>fy(t,a,g,u,o,"data"),[t,a,g,u,o]),y=b.useMemo(()=>fy(t,a,g,u,o,"assets"),[t,a,g,u,o]),x=b.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let E=new Set,N=!1;if(a.forEach(j=>{var R;let A=u.routes[j.route.id];!A||!A.hasLoader||(!v.some(w=>w.route.id===j.route.id)&&j.route.id in m&&((R=d[j.route.id])!=null&&R.shouldRevalidate)||A.hasClientLoader?N=!0:E.add(j.route.id))}),E.size===0)return[];let C=Ok(t,p,r.unstable_trailingSlashAwareDataRequests,"data");return N&&E.size>0&&C.searchParams.set("_routes",a.filter(j=>E.has(j.route.id)).map(j=>j.route.id).join(",")),[C.pathname+C.search]},[p,r.unstable_trailingSlashAwareDataRequests,m,o,u,v,a,t,d]),S=b.useMemo(()=>Uk(y,u),[y,u]),T=Fk(y);return b.createElement(b.Fragment,null,x.map(E=>b.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...i})),S.map(E=>b.createElement("link",{key:E,rel:"modulepreload",href:E,...i})),T.map(({key:E,link:N})=>b.createElement("link",{key:E,nonce:i.nonce,...N,crossOrigin:N.crossOrigin??i.crossOrigin})))}function Kk(...t){return a=>{t.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var Yk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Yk&&(window.__reactRouterVersion="7.13.1")}catch{}function Zk({basename:t,children:a,unstable_useTransitions:i,window:o}){let r=b.useRef();r.current==null&&(r.current=NT({window:o,v5Compat:!0}));let u=r.current,[d,p]=b.useState({action:u.action,location:u.location}),m=b.useCallback(g=>{i===!1?p(g):b.startTransition(()=>p(g))},[i]);return b.useLayoutEffect(()=>u.listen(m),[u,m]),b.createElement(Tk,{basename:t,children:a,location:d.location,navigationType:d.action,navigator:u,unstable_useTransitions:i})}var bb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ch=b.forwardRef(function({onClick:a,discover:i="render",prefetch:o="none",relative:r,reloadDocument:u,replace:d,unstable_mask:p,state:m,target:g,to:v,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:S,...T},E){let{basename:N,navigator:C,unstable_useTransitions:j}=b.useContext(mn),A=typeof v=="string"&&bb.test(v),R=rb(v,N);v=R.to;let w=ok(v,{relative:r}),G=At(),z=null;if(p){let Q=Sc(p,[],G.unstable_mask?G.unstable_mask.pathname:"/",!0);N!=="/"&&(Q.pathname=Q.pathname==="/"?N:Zn([N,Q.pathname])),z=C.createHref(Q)}let[O,$,J]=Gk(o,T),ae=Jk(v,{replace:d,unstable_mask:p,state:m,target:g,preventScrollReset:y,relative:r,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:j});function se(Q){a&&a(Q),Q.defaultPrevented||ae(Q)}let te=!(R.isExternal||u),U=b.createElement("a",{...T,...J,href:(te?z:void 0)||R.absoluteURL||w,onClick:te?se:a,ref:Kk(E,$),target:g,"data-discover":!A&&i==="render"?"true":void 0});return O&&!A?b.createElement(b.Fragment,null,U,b.createElement($k,{page:w})):U});ch.displayName="Link";var Xk=b.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:o="",end:r=!1,style:u,to:d,viewTransition:p,children:m,...g},v){let y=Tl(d,{relative:g.relative}),x=At(),S=b.useContext(Tc),{navigator:T,basename:E}=b.useContext(mn),N=S!=null&&sC(y)&&p===!0,C=T.encodeLocation?T.encodeLocation(y).pathname:y.pathname,j=x.pathname,A=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(j=j.toLowerCase(),A=A?A.toLowerCase():null,C=C.toLowerCase()),A&&E&&(A=Ta(A,E)||A);const R=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let w=j===C||!r&&j.startsWith(C)&&j.charAt(R)==="/",G=A!=null&&(A===C||!r&&A.startsWith(C)&&A.charAt(C.length)==="/"),z={isActive:w,isPending:G,isTransitioning:N},O=w?a:void 0,$;typeof o=="function"?$=o(z):$=[o,w?"active":null,G?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let J=typeof u=="function"?u(z):u;return b.createElement(ch,{...g,"aria-current":O,className:$,ref:v,style:J,to:d,viewTransition:p},typeof m=="function"?m(z):m)});Xk.displayName="NavLink";var Qk=b.forwardRef(({discover:t="render",fetcherKey:a,navigate:i,reloadDocument:o,replace:r,state:u,method:d=nc,action:p,onSubmit:m,relative:g,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:x,...S},T)=>{let{unstable_useTransitions:E}=b.useContext(mn),N=nC(),C=aC(p,{relative:g}),j=d.toLowerCase()==="get"?"get":"post",A=typeof p=="string"&&bb.test(p),R=w=>{if(m&&m(w),w.defaultPrevented)return;w.preventDefault();let G=w.nativeEvent.submitter,z=(G==null?void 0:G.getAttribute("formmethod"))||d,O=()=>N(G||w.currentTarget,{fetcherKey:a,method:z,navigate:i,replace:r,state:u,relative:g,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:x});E&&i!==!1?b.startTransition(()=>O()):O()};return b.createElement("form",{ref:T,method:j,action:C,onSubmit:o?m:R,...S,"data-discover":!A&&t==="render"?"true":void 0})});Qk.displayName="Form";function Wk(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xb(t){let a=b.useContext(Xi);return rt(a,Wk(t)),a}function Jk(t,{target:a,replace:i,unstable_mask:o,state:r,preventScrollReset:u,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let v=kc(),y=At(),x=Tl(t,{relative:d});return b.useCallback(S=>{if(wk(S,a)){S.preventDefault();let T=i!==void 0?i:pl(y)===pl(x),E=()=>v(t,{replace:T,unstable_mask:o,state:r,preventScrollReset:u,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m});g?b.startTransition(()=>E()):E()}},[y,v,x,i,o,r,a,t,u,d,p,m,g])}function uh(t){Rn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=b.useRef(Ef(t)),i=b.useRef(!1),o=At(),r=b.useMemo(()=>Ak(o.search,i.current?null:a.current),[o.search]),u=kc(),d=b.useCallback((p,m)=>{const g=Ef(typeof p=="function"?p(new URLSearchParams(r)):p);i.current=!0,u("?"+g,m)},[u,r]);return[r,d]}var eC=0,tC=()=>`__${String(++eC)}__`;function nC(){let{router:t}=xb("useSubmit"),{basename:a}=b.useContext(mn),i=bk(),o=t.fetch,r=t.navigate;return b.useCallback(async(u,d={})=>{let{action:p,method:m,encType:g,formData:v,body:y}=Mk(u,a);if(d.navigate===!1){let x=d.fetcherKey||tC();await o(x,i,d.action||p,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:y,formMethod:d.method||m,formEncType:d.encType||g,flushSync:d.flushSync})}else await r(d.action||p,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:y,formMethod:d.method||m,formEncType:d.encType||g,replace:d.replace,state:d.state,fromRouteId:i,flushSync:d.flushSync,viewTransition:d.viewTransition})},[o,r,a,i])}function aC(t,{relative:a}={}){let{basename:i}=b.useContext(mn),o=b.useContext(Mn);rt(o,"useFormAction must be used inside a RouteContext");let[r]=o.matches.slice(-1),u={...Tl(t||".",{relative:a})},d=At();if(t==null){u.search=d.search;let p=new URLSearchParams(u.search),m=p.getAll("index");if(m.some(v=>v==="")){p.delete("index"),m.filter(y=>y).forEach(y=>p.append("index",y));let v=p.toString();u.search=v?`?${v}`:""}}return(!t||t===".")&&r.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:Zn([i,u.pathname])),pl(u)}function sC(t,{relative:a}={}){let i=b.useContext(ub);rt(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=xb("useViewTransitionState"),r=Tl(t,{relative:a});if(!i.isTransitioning)return!1;let u=Ta(i.currentLocation.pathname,o)||i.currentLocation.pathname,d=Ta(i.nextLocation.pathname,o)||i.nextLocation.pathname;return ml(r.pathname,d)!=null||ml(r.pathname,u)!=null}function Mt(){const t=kc();return b.useCallback((a,i)=>{typeof a=="number"?t(a):t(a,i)},[t])}function _b(t){return`/sessions/${encodeURIComponent(t)}`}function Pi(t,a){return a?`/environments/${encodeURIComponent(a)}/workspaces/${encodeURIComponent(t)}`:`/workspaces/${encodeURIComponent(t)}`}function ka(t,a,i,o){const r=encodeURIComponent(t);let u;return i&&o?u=`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(i)}/tasks/${r}`:i?u=`/workspaces/${encodeURIComponent(i)}/tasks/${r}`:u=`/tasks/${r}`,a?`${u}/${a}`:u}function iC(t,a,i){return a&&i?`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(t)}/edit`:a?`/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(t)}/edit`:`/tasks/${encodeURIComponent(t)}/edit`}function Qi(t,a,i){const o=new URLSearchParams;t&&o.set("workspace",t),a&&o.set("parent",a);const r=o.toString();if(t&&i){const u=`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(t)}/tasks/new`;return a?`${u}?parent=${encodeURIComponent(a)}`:u}return r?`/tasks/new?${r}`:"/tasks/new"}function Sb(t){return`/sessions/new?${new URLSearchParams({env:t}).toString()}`}const Gi="/environments",oC="/environments/new";function $i(t){return`/environments/${encodeURIComponent(t)}`}function lC(t){return`/environments/${encodeURIComponent(t)}/edit`}const ol="/settings",rC="/settings/credentials",cC="/pair",uC="/chat",Us="/",dC="/tasks",Tb="/workspaces/new",kb="/knowledge";function fC(t,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",o=b.useRef(void 0),[r,u]=b.useState(!1),d=b.useRef(a.onMessage);d.current=a.onMessage;const p=b.useRef(a.onConnect);p.current=a.onConnect;const m=b.useRef(a.onDisconnect);m.current=a.onDisconnect;const g=b.useCallback(v=>{var y;((y=o.current)==null?void 0:y.readyState)===WebSocket.OPEN&&o.current.send(JSON.stringify(v))},[]);return b.useEffect(()=>{let v,y;function x(){v=new WebSocket(i),o.current=v,v.onopen=()=>{u(!0),p.current(g)},v.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const T=kT(S.data);T&&d.current(T)},v.onclose=S=>{var T;if(u(!1),o.current=void 0,(T=m.current)==null||T.call(m),clearTimeout(y),S.code===ET){window.location.href=cC;return}y=setTimeout(x,CT)},v.onerror=()=>{v.close()}}return x(),()=>{clearTimeout(y),v==null||v.close()}},[i,g]),{connected:r,send:g}}const hC=5e3;function pC(t){const[a,i]=b.useState([]),[o,r]=b.useState({}),u=b.useCallback(x=>{switch(x.type){case"environment.added":return!0;case"environment.removed":{const S=x.payload.environmentId;return S&&(i(T=>T.filter(E=>E.id!==S)),r(T=>{const E={...T};return delete E[S],E})),t({type:"list_sessions"}),!0}case"environment.changed":return t({type:"list_environments"}),!0;case"environment.provision_progress":{const S=x.payload;if(typeof S.environmentId!="string"||typeof S.stage!="string"||typeof S.message!="string"||typeof S.progress!="number")return hl("environment.provision_progress","invalid payload"),!0;if(r(T=>({...T,[S.environmentId]:{stage:S.stage,message:S.message,progress:S.progress}})),S.stage==="ready"){const T=S.environmentId;setTimeout(()=>{r(E=>{const N={...E};return delete N[T],N})},hC)}return!0}default:return!1}},[t]),d=b.useCallback(x=>{var S;switch(x.type){case"environments":return i(Yn((S=x.payload)==null?void 0:S.environments,mT,"environments","environments").map(gT)),!0;default:return!1}},[]),p=b.useCallback((x,S,T)=>{t({type:"add_environment",payload:{displayName:x,adapterType:S,adapterConfig:T||{}}})},[t]),m=b.useCallback((x,S)=>{const T={environmentId:x,...S};t({type:"update_environment",payload:T})},[t]),g=b.useCallback(x=>{t({type:"provision_environment",payload:{environmentId:x}})},[t]),v=b.useCallback(x=>{t({type:"stop_environment",payload:{environmentId:x}})},[t]),y=b.useCallback(x=>{t({type:"remove_environment",payload:{environmentId:x}})},[t]);return{environments:a,provisionStatus:o,addEnvironment:p,updateEnvironment:m,provisionEnvironment:g,stopEnvironment:v,removeEnvironment:y,handleMessage:d,handleEvent:u}}const ef=new Set(["pending","running","idle"]),mC=new Set(["stopped","suspended"]),hy=["pending","running","idle"];function gC(t){const[a,i]=b.useState([]),[o,r]=b.useState([]),[u,d]=b.useState(0),[p,m]=b.useState(void 0),[g,v]=b.useState({}),y=b.useCallback(j=>{var A,R,w,G,z;switch(j.type){case"sessions":return i(O=>{var ae;const $=Yn((ae=j.payload)==null?void 0:ae.sessions,ay,"sessions","sessions"),J=new Map(O.map(se=>[se.id,se]));return $.map(se=>{const te=J.get(se.id),U=te==null?void 0:te.status;return!U||U===se.status?se:mC.has(U)&&ef.has(se.status)?{...se,status:U,...te.endReason!==void 0?{endReason:te.endReason}:{}}:ef.has(U)&&ef.has(se.status)&&hy.indexOf(U)>hy.indexOf(se.status)?{...se,status:U}:se})}),!0;case"session_event":{if(!sy(j.payload))return hl("session_event","payload is not a valid SessionEvent"),!0;const O=j.payload;let $=0;if(r(J=>{const ae=[...J,O];return ae.length>Ri?($=ae.length-Ri,ae.slice(-Ri)):ae}),$>0&&d(J=>J+$),O.eventType==="usage")try{const J=JSON.parse(O.content),ae=Number(J.input_tokens)||0,se=Number(J.output_tokens)||0,te=Number(J.cost_usd)||0;(ae>0||se>0||te>0)&&i(U=>U.map(Q=>Q.id===O.sessionId?{...Q,inputTokens:(Q.inputTokens??0)+ae,outputTokens:(Q.outputTokens??0)+se,costUsd:(Q.costUsd??0)+te}:Q))}catch{}if(O.eventType==="status"){const J=tb(O.content),ae=nb(O.content);i(se=>se.some(U=>U.id===O.sessionId)?se.map(U=>U.id===O.sessionId?{...U,status:J,...ae!==void 0?{endReason:ae}:{}}:U):[...se,{id:O.sessionId,environmentId:"",runtime:"",status:J,prompt:"",startedAt:O.timestamp,...ae!==void 0?{endReason:ae}:{}}])}return!0}case"session_events":{const O=Yn((A=j.payload)==null?void 0:A.events,sy,"session_events","events"),$=(R=j.payload)==null?void 0:R.sessionId;if(typeof $!="string")return hl("session_events","missing or non-string sessionId"),!0;if(O.length>0){let J=0;r(ae=>{const se=new Set;for(const Q of ae)Q.sessionId===$&&se.add(`${Q.timestamp}|${Q.eventType}`);const te=O.filter(Q=>!se.has(`${Q.timestamp}|${Q.eventType}`)),U=[...ae,...te].sort((Q,B)=>Q.sessionId!==B.sessionId?0:Q.timestamp.localeCompare(B.timestamp));return U.length>Ri?(J=U.length-Ri,U.slice(-Ri)):U}),J>0&&d(ae=>ae+J)}return!0}case"spawned":{const O=(w=j.payload)==null?void 0:w.sessionId;return typeof O=="string"&&O&&m(O),t({type:"list_sessions"}),!0}case"task_sessions":{const O=(G=j.payload)==null?void 0:G.taskId;if(typeof O!="string"||!O)return!0;const $=Yn((z=j.payload)==null?void 0:z.sessions,ay,"task_sessions","sessions");return v(J=>({...J,[O]:$})),!0}default:return!1}},[t]),x=b.useCallback((j,A,R,w)=>{t({type:"spawn",payload:{environmentId:j,prompt:A,personaId:R||"",worktreeBasePath:w||""}})},[t]),S=b.useCallback((j,A)=>{t({type:"send_input",payload:{sessionId:j,text:A}})},[t]),T=b.useCallback(j=>{t({type:"kill",payload:{sessionId:j}})},[t]),E=b.useCallback(j=>{t({type:"get_session_events",payload:{sessionId:j}})},[t]),N=b.useCallback(()=>{r([]),d(0)},[]),C=b.useCallback(j=>{t({type:"get_task_sessions",payload:{taskId:j}})},[t]);return{sessions:a,events:o,eventsDropped:u,lastSpawnedId:p,taskSessions:g,spawn:x,sendInput:S,kill:T,loadSessionEvents:E,clearEvents:N,loadTaskSessions:C,handleMessage:y}}const vC=15e3;function yC(t){const[a,i]=b.useState([]),[o,r]=b.useState(!1),u=b.useRef(new Map),d=b.useCallback(()=>{r(u.current.size>0)},[]),p=b.useCallback(S=>{switch(S.type){case"workspace.created":{const T=typeof S.payload.requestId=="string"?S.payload.requestId:"";if(T){const E=u.current.get(T);E&&(clearTimeout(E.timer),u.current.delete(T),d(),E.onSuccess())}return t({type:"list_workspaces"}),!0}case"workspace.archived":case"workspace.updated":return t({type:"list_workspaces"}),!0;default:return!1}},[t,d]),m=b.useCallback(S=>{var T,E,N;switch(S.type){case"workspaces":return i(Yn((T=S.payload)==null?void 0:T.workspaces,vT,"workspaces","workspaces")),!0;case"create_workspace_error":{const C=typeof((E=S.payload)==null?void 0:E.requestId)=="string"?S.payload.requestId:"",j=typeof((N=S.payload)==null?void 0:N.message)=="string"?S.payload.message:"Failed to create workspace";if(r(!1),C){const A=u.current.get(C);A?(clearTimeout(A.timer),u.current.delete(C),d(),A.onError(j)):console.error("Received create_workspace_error for unknown requestId",{requestId:C,errorMessage:j})}else console.error("Received create_workspace_error without requestId",{errorMessage:j});return!0}default:return!1}},[d]),g=b.useCallback(()=>{for(const[,S]of u.current)clearTimeout(S.timer),S.onError("Disconnected");u.current.clear(),d()},[d]),v=b.useCallback((S,T,E,N,C,j,A,R,w)=>{const G={name:S,description:T||"",repoUrl:E||"",environmentId:N||"",defaultPersonaId:C||"",useWorktrees:j??!0,worktreeBasePath:A||""},z=crypto.randomUUID();G.requestId=z;const O=w??(()=>{}),$=setTimeout(()=>{u.current.delete(z)&&(d(),O("Request timed out"))},vC);u.current.set(z,{onSuccess:R??(()=>{}),onError:O,timer:$}),d(),t({type:"create_workspace",payload:G})},[t,d]),y=b.useCallback(S=>{t({type:"archive_workspace",payload:{workspaceId:S}})},[t]),x=b.useCallback((S,T)=>{t({type:"update_workspace",payload:{workspaceId:S,...T}})},[t]);return{workspaces:a,workspaceCreating:o,createWorkspace:v,archiveWorkspace:y,updateWorkspace:x,handleMessage:m,handleEvent:p,onDisconnect:g}}const bC=15e3;function xC(t){const[a,i]=b.useState([]),[o,r]=b.useState(void 0),u=b.useRef(new Map),d=b.useCallback(j=>{const A=j.payload;switch(j.type){case"task.created":{const R=typeof A.requestId=="string"?A.requestId:"";if(R){const G=u.current.get(R);G&&(clearTimeout(G.timer),u.current.delete(R),G.onSuccess())}const w=typeof A.workspaceId=="string"?A.workspaceId:"";return w&&t({type:"list_tasks",payload:{workspaceId:w}}),!0}case"task.started":{const R=typeof A.taskId=="string"?A.taskId:"",w=typeof A.sessionId=="string"?A.sessionId:"",G=typeof A.workspaceId=="string"?A.workspaceId:"";return r(z=>R&&z===R?void 0:z),w&&(t({type:"list_sessions"}),R&&i(z=>z.map(O=>O.id===R?{...O,latestSessionId:w}:O))),G?t({type:"list_tasks",payload:{workspaceId:G}}):R&&i(z=>{const O=z.find($=>$.id===R);return O!=null&&O.workspaceId?t({type:"list_tasks",payload:{workspaceId:O.workspaceId}}):t({type:"list_tasks",payload:{}}),z}),!0}case"task.completed":case"task.deleted":case"task.updated":{const R=typeof A.workspaceId=="string"?A.workspaceId:"",w=typeof A.taskId=="string"?A.taskId:"";return R?t({type:"list_tasks",payload:{workspaceId:R}}):w&&i(G=>{const z=G.find(O=>O.id===w);return z!=null&&z.workspaceId?t({type:"list_tasks",payload:{workspaceId:z.workspaceId}}):t({type:"list_tasks",payload:{}}),G}),!0}default:return!1}},[t]),p=b.useCallback(j=>{var A,R,w,G;switch(j.type){case"tasks":{const z=Yn((A=j.payload)==null?void 0:A.tasks,yT,"tasks","tasks"),O=typeof((R=j.payload)==null?void 0:R.workspaceId)=="string"&&j.payload.workspaceId?j.payload.workspaceId:"";return O?(i($=>[...$.filter(J=>J.workspaceId!==O),...z]),!0):(i($=>{const J=new Set(z.map(ae=>ae.id));return[...$.filter(ae=>!J.has(ae.id)),...z]}),!0)}case"create_task_error":{const z=typeof((w=j.payload)==null?void 0:w.requestId)=="string"?j.payload.requestId:"",O=typeof((G=j.payload)==null?void 0:G.message)=="string"?j.payload.message:"Failed to create task";if(z){const $=u.current.get(z);$?(clearTimeout($.timer),u.current.delete(z),$.onError(O)):console.error("[useTasks] create_task_error with unknown requestId:",O)}else console.error("[useTasks] create_task_error:",O);return!0}default:return!1}},[]),m=b.useCallback(()=>{r(void 0);for(const[,j]of u.current)clearTimeout(j.timer),j.onError("Disconnected");u.current.clear()},[]),g=b.useCallback(j=>{t({type:"list_tasks",payload:{workspaceId:j}})},[t]),v=b.useCallback(()=>{t({type:"list_tasks",payload:{}})},[t]),y=b.useCallback((j,A,R,w,G,z,O,$,J)=>{const ae={workspaceId:j,title:A,description:R||"",dependsOn:w||[],parentTaskId:G||"",defaultPersonaId:z||"",canDecompose:O||!1};if($||J){const se=crypto.randomUUID();ae.requestId=se;const te=J??(()=>{}),U=setTimeout(()=>{u.current.delete(se)&&te("Request timed out")},bC);u.current.set(se,{onSuccess:$??(()=>{}),onError:te,timer:U})}t({type:"create_task",payload:ae})},[t]),x=b.useCallback((j,A,R,w)=>{r(j),t({type:"start_task",payload:{taskId:j,personaId:A||"",environmentId:R||"",notes:w||""}})},[t]),S=b.useCallback(j=>{t({type:"stop_task",payload:{taskId:j}})},[t]),T=b.useCallback(j=>{t({type:"complete_task",payload:{taskId:j}})},[t]),E=b.useCallback(j=>{t({type:"resume_task",payload:{taskId:j}})},[t]),N=b.useCallback((j,A,R,w,G)=>{const z={taskId:j,title:A,description:R,dependsOn:w};G!==void 0&&(z.defaultPersonaId=G),t({type:"update_task",payload:z})},[t]),C=b.useCallback(j=>{t({type:"delete_task",payload:{taskId:j}})},[t]);return{tasks:a,taskStartingId:o,loadTasks:g,loadAllTasks:v,createTask:y,startTask:x,stopTask:S,completeTask:T,resumeTask:E,updateTask:N,deleteTask:C,handleMessage:p,handleEvent:d,onDisconnect:m}}function _C(t){const[a,i]=b.useState([]),o=b.useCallback(p=>{if(p.type==="finding.posted"){const m=typeof p.payload.workspaceId=="string"?p.payload.workspaceId:"";return m&&t({type:"list_findings",payload:{workspaceId:m}}),!0}return!1},[t]),r=b.useCallback(p=>{var m;switch(p.type){case"findings":return i(Yn((m=p.payload)==null?void 0:m.findings,bT,"findings","findings")),!0;default:return!1}},[]),u=b.useCallback(p=>{t({type:"list_findings",payload:{workspaceId:p}})},[t]),d=b.useCallback((p,m,g,v,y)=>{t({type:"post_finding",payload:{workspaceId:p,title:m,content:g,category:v||"general",tags:y||[]}})},[t]);return{findings:a,loadFindings:u,postFinding:d,handleMessage:r,handleEvent:o}}function SC(t){const[a,i]=b.useState([]),o=b.useCallback(m=>m.type==="token.changed"?(t({type:"list_tokens"}),!0):!1,[t]),r=b.useCallback(m=>{var g;switch(m.type){case"tokens":return i(Yn((g=m.payload)==null?void 0:g.tokens,xT,"tokens","tokens")),!0;default:return!1}},[]),u=b.useCallback(()=>{t({type:"list_tokens"})},[t]),d=b.useCallback((m,g,v,y,x)=>{t({type:"set_token",payload:{name:m,value:g,tokenType:v,envVar:y,filePath:x}})},[t]),p=b.useCallback(m=>{t({type:"delete_token",payload:{name:m}})},[t]);return{tokens:a,loadTokens:u,setToken:d,deleteToken:p,handleMessage:r,handleEvent:o}}function TC(t){const[a,i]=b.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),o=b.useCallback(d=>d.type==="credential.providers_changed"?(iy(d.payload)&&i(d.payload),!0):!1,[]),r=b.useCallback(d=>{switch(d.type){case"credential_providers":return iy(d.payload)&&i(d.payload),!0;default:return!1}},[]),u=b.useCallback(d=>{t({type:"set_credential_providers",payload:d})},[t]);return{credentialProviders:a,updateCredentialProviders:u,handleMessage:r,handleEvent:o}}function kC(t,a){const[i,o]=b.useState([]),[r,u]=b.useState(""),[d,p]=b.useState(""),[m,g]=b.useState(!1),v=b.useCallback(S=>{var T,E,N;switch(S.type){case"codespaces_list":{const C=Yn((T=S.payload)==null?void 0:T.codespaces,ST,"codespaces_list","codespaces"),j=typeof((E=S.payload)==null?void 0:E.error)=="string"?S.payload.error:"";return o(C),p(j),!0}case"codespace_created":return g(!1),t({type:"list_codespaces"}),!0;case"codespace_create_error":{g(!1);const C=typeof((N=S.payload)==null?void 0:N.message)=="string"?S.payload.message:"Failed to create codespace";return u(C),!0}default:return!1}},[t]),y=b.useCallback(()=>{t({type:"list_codespaces"})},[t]),x=b.useCallback((S,T)=>{if(!a){u("Not connected to server. Please try again once the connection is restored.");return}g(!0),u("");const E={repo:S};T&&(E.machine=T),t({type:"create_codespace",payload:E})},[t,a]);return{codespaces:i,codespaceError:r,codespaceListError:d,codespaceCreating:m,listCodespaces:y,createCodespace:x,handleMessage:v}}function CC(t){const[a,i]=b.useState([]),o=b.useCallback(m=>{switch(m.type){case"persona.created":case"persona.updated":case"persona.deleted":return t({type:"list_personas"}),!0;default:return!1}},[t]),r=b.useCallback(m=>{var g;switch(m.type){case"personas":{const v=Yn((g=m.payload)==null?void 0:g.personas,TT,"personas","personas");return i(v),!0}default:return!1}},[]),u=b.useCallback((m,g,v,y,x,S,T,E)=>{t({type:"create_persona",payload:{name:m,description:g,systemPrompt:v,runtime:y||"",model:x||"",maxTurns:S||0,type:T||"agent",script:E||""}})},[t]),d=b.useCallback((m,g,v,y,x,S,T,E,N)=>{const C={personaId:m};g!==void 0&&(C.name=g),v!==void 0&&(C.description=v),y!==void 0&&(C.systemPrompt=y),x!==void 0&&(C.runtime=x),S!==void 0&&(C.model=S),T!==void 0&&(C.maxTurns=T),E!==void 0&&(C.type=E),N!==void 0&&(C.script=N),t({type:"update_persona",payload:C})},[t]),p=b.useCallback(m=>{t({type:"delete_persona",payload:{personaId:m}})},[t]);return{personas:a,createPersona:u,updatePersona:d,deletePersona:p,handleMessage:r,handleEvent:o}}function qr(t,a=0){return{id:t.id,label:t.title||t.label||t.id,kind:t.kind,category:t.category,sourceType:t.sourceType,sourceId:t.sourceId,content:t.content,tags:t.tags,workspaceId:t.workspaceId,createdAt:t.createdAt,updatedAt:t.updatedAt,val:a}}function tf(t){return{source:t.fromId,target:t.toId,type:t.type}}const EC=new Set(["knowledge.listRecent.result","knowledge.search.result","knowledge.getNode.result","knowledge.expand.result"]);function NC(t){const[a,i]=b.useState(new Map),[o,r]=b.useState([]),[u,d]=b.useState(void 0),[p,m]=b.useState(void 0),[g,v]=b.useState(!1),[y,x]=b.useState(""),S=b.useCallback(R=>{v(!0),t({type:"knowledge.listRecent",payload:{limit:30,workspaceId:R}})},[t]),T=b.useCallback(R=>{R.trim()&&(x(R),m(void 0),d(void 0),v(!0),t({type:"knowledge.search",payload:{query:R,limit:20}}))},[t]),E=b.useCallback(()=>{x(""),S()},[S]),N=b.useCallback(R=>{m(R),t({type:"knowledge.getNode",payload:{id:R}})},[t]),C=b.useCallback(()=>{m(void 0),d(void 0)},[]),j=b.useCallback(R=>{t({type:"knowledge.expand",payload:{id:R,depth:1}})},[t]),A=b.useCallback(R=>{if(!EC.has(R.type))return!1;const w=R.payload??{};switch(R.type){case"knowledge.listRecent.result":{if(w.error)return v(!1),!0;const G=w.nodes??[],z=w.edges??[],O=new Map,$=[];for(const J of G)O.set(J.id,qr(J));for(const J of z)$.push(tf(J));for(const J of $){const ae=O.get(J.source);ae&&(ae.val+=1);const se=O.get(J.target);se&&(se.val+=1)}return i(O),r($),v(!1),!0}case"knowledge.search.result":{if(w.error)return v(!1),!0;const G=w.results??[],z=new Map,O=[];for(const $ of G){const J=$.node,ae=$.edges??[];z.set(J.id,qr(J,ae.length));for(const se of ae)O.push(tf(se))}return i(z),r(O),v(!1),!0}case"knowledge.getNode.result":{if(w.error)return d(void 0),!0;const G=w.node,z=w.edges??[];return d({node:qr(G,z.length),edges:z.map(O=>({fromId:O.fromId,toId:O.toId,type:O.type,metadata:O.metadata}))}),!0}case"knowledge.expand.result":{const G=w.nodes??[],z=w.edges??[];return i(O=>{const $=new Map(O);for(const J of G)$.has(J.id)||$.set(J.id,qr(J));return $}),r(O=>{const $=new Set(O.map(ae=>`${ae.source}:${ae.target}:${ae.type}`)),J=[];for(const ae of z){const se=tf(ae),te=`${se.source}:${se.target}:${se.type}`;$.has(te)||J.push(se)}return[...O,...J]}),!0}}return!1},[]);return{graphData:{nodes:[...a.values()],links:o},selectedNode:u,selectedId:p,loading:g,searchQuery:y,search:T,clearSearch:E,selectNode:N,clearSelection:C,expandNode:j,loadRecent:S,handleMessage:A}}function jC(t){const[a,i]=b.useState(""),[o,r]=b.useState(void 0),[u,d]=b.useState({}),{connected:p,send:m}=fC(t,{onMessage:$,onConnect:J,onDisconnect:ae}),g=pC(m),v=gC(m),y=yC(m),x=xC(m),S=_C(m),T=SC(m),E=TC(m),N=kC(m,p),C=CC(m),j=NC(m),A="default_persona_id",R="onboarding_completed",w=b.useCallback(te=>{i(te),m({type:"set_setting",payload:{key:A,value:te}})},[m]),G=b.useCallback(()=>{r(!0),m({type:"set_setting",payload:{key:R,value:"true"}})},[m]),z=b.useCallback((te,U)=>{m({type:"get_usage",payload:{scope:te,id:U}})},[m]);function O(te){const U=te.payload.key,Q=te.payload.value;if(te.type==="setting.changed"){U===A&&i(Q??""),U===R&&r(Q==="true");return}g.handleEvent(te)||y.handleEvent(te)||x.handleEvent(te)||S.handleEvent(te)||T.handleEvent(te)||E.handleEvent(te)||C.handleEvent(te)}function $(te){var U,Q,B,q,oe;if(pT(te)){O(te);return}if(te.type==="usage_stats"){const le=((U=te.payload)==null?void 0:U.scope)||"",F=((Q=te.payload)==null?void 0:Q.id)||"";if(le&&F){const ye=`${le}:${F}`;d(Te=>{var be,ne,ce,ee;return{...Te,[ye]:{inputTokens:Number((be=te.payload)==null?void 0:be.inputTokens)||0,outputTokens:Number((ne=te.payload)==null?void 0:ne.outputTokens)||0,costUsd:Number((ce=te.payload)==null?void 0:ce.costUsd)||0,sessionCount:Number((ee=te.payload)==null?void 0:ee.sessionCount)||0}}})}return}if(te.type==="setting"){const le=(B=te.payload)==null?void 0:B.key,F=(q=te.payload)==null?void 0:q.value;le===A&&i(F??""),le===R&&r(F==="true");return}if(!g.handleMessage(te)&&!v.handleMessage(te)&&!y.handleMessage(te)&&!x.handleMessage(te)&&!S.handleMessage(te)&&!T.handleMessage(te)&&!E.handleMessage(te)&&!N.handleMessage(te)&&!C.handleMessage(te)&&!j.handleMessage(te)&&te.type==="error"){console.error("[ws]",(oe=te.payload)==null?void 0:oe.message);return}}function J(te){te({type:"list_environments"}),te({type:"list_sessions"}),te({type:"list_workspaces"}),te({type:"list_tokens"}),te({type:"get_credential_providers"}),te({type:"list_personas"}),te({type:"get_setting",payload:{key:A}}),te({type:"get_setting",payload:{key:R}}),te({type:"list_tasks",payload:{}}),te({type:"subscribe_all"})}function ae(){y.onDisconnect(),x.onDisconnect()}const se=b.useCallback(()=>{m({type:"list_environments"}),m({type:"list_sessions"}),m({type:"list_workspaces"}),m({type:"list_tokens"})},[m]);return{connected:p,send:m,environments:g.environments,sessions:v.sessions,events:v.events,eventsDropped:v.eventsDropped,lastSpawnedId:v.lastSpawnedId,workspaces:y.workspaces,tasks:x.tasks,findings:S.findings,tokens:T.tokens,spawn:v.spawn,sendInput:v.sendInput,kill:v.kill,refresh:se,loadSessionEvents:v.loadSessionEvents,clearEvents:v.clearEvents,createWorkspace:y.createWorkspace,archiveWorkspace:y.archiveWorkspace,updateWorkspace:y.updateWorkspace,loadTasks:x.loadTasks,loadAllTasks:x.loadAllTasks,createTask:x.createTask,startTask:x.startTask,stopTask:x.stopTask,completeTask:x.completeTask,resumeTask:x.resumeTask,updateTask:x.updateTask,deleteTask:x.deleteTask,loadFindings:S.loadFindings,postFinding:S.postFinding,addEnvironment:g.addEnvironment,updateEnvironment:g.updateEnvironment,loadTokens:T.loadTokens,setToken:T.setToken,deleteToken:T.deleteToken,credentialProviders:E.credentialProviders,updateCredentialProviders:E.updateCredentialProviders,provisionStatus:g.provisionStatus,provisionEnvironment:g.provisionEnvironment,stopEnvironment:g.stopEnvironment,removeEnvironment:g.removeEnvironment,codespaces:N.codespaces,codespaceError:N.codespaceError,codespaceListError:N.codespaceListError,codespaceCreating:N.codespaceCreating,listCodespaces:N.listCodespaces,createCodespace:N.createCodespace,workspaceCreating:y.workspaceCreating,taskStartingId:x.taskStartingId,personas:C.personas,createPersona:C.createPersona,updatePersona:C.updatePersona,deletePersona:C.deletePersona,taskSessions:v.taskSessions,loadTaskSessions:v.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:w,onboardingCompleted:o,completeOnboarding:G,usageCache:u,loadUsage:z,knowledge:j}}const dh=b.createContext(void 0);function wC({children:t}){const a=jC();return c.jsx(dh.Provider,{value:a,children:t})}function ut(){const t=b.useContext(dh);if(!t)throw new Error("useGrackle must be used within GrackleProvider");return t}const AC=[{id:"env-local-01",displayName:"Local Dev",adapterType:"local",adapterConfig:"{}",status:"connected",bootstrapped:!0},{id:"env-docker-01",displayName:"Docker Sandbox",adapterType:"docker",adapterConfig:'{"image":"node:20"}',status:"connected",bootstrapped:!0},{id:"env-cs-01",displayName:"GitHub Codespace",adapterType:"codespace",adapterConfig:'{"codespaceName":"my-codespace"}',status:"connected",bootstrapped:!0},{id:"env-remote-01",displayName:"Staging (SSH)",adapterType:"ssh",adapterConfig:'{"host":"192.168.1.10","user":"deploy","sshPort":22}',status:"disconnected",bootstrapped:!1}],DC=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation",inputTokens:84200,outputTokens:12750,costUsd:.41},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z",inputTokens:42600,outputTokens:8100,costUsd:.22},{id:"sess-002",environmentId:"env-docker-01",runtime:"claude-code",status:"stopped",endReason:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z",endedAt:"2026-02-27T07:33:00Z",inputTokens:31400,outputTokens:9800,costUsd:.18},{id:"sess-003",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z",endedAt:"2026-02-26T23:10:00Z",inputTokens:56300,outputTokens:14200,costUsd:.31},{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z",inputTokens:18900,outputTokens:4500,costUsd:.1},{id:"sess-005",environmentId:"env-cs-01",runtime:"claude-code",status:"suspended",prompt:"Refactor database connection pooling for multi-tenant isolation",startedAt:"2026-02-27T06:00:00Z",inputTokens:67800,outputTokens:19300,costUsd:.38}],RC=[{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T14:00:01Z",content:"running"},{sessionId:"sess-001-prev",eventType:"output",timestamp:"2026-02-26T14:00:05Z",content:"Reading src/middleware/auth.ts to understand the current authentication flow..."},{sessionId:"sess-001-prev",eventType:"error",timestamp:"2026-02-26T15:12:00Z",content:"Context window exceeded before completing implementation"},{sessionId:"sess-001",eventType:"status",timestamp:"2026-02-27T08:15:01Z",content:"running"},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:02Z",content:"Analyzing current authentication middleware in src/middleware/auth.ts..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:04Z",content:`Found 3 files using session-based auth:
|
|
38
|
-
- src/middleware/auth.ts
|
|
39
|
-
- src/routes/login.ts
|
|
40
|
-
- src/routes/protected.ts`},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:07Z",content:"Installing jsonwebtoken and @types/jsonwebtoken..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:12Z",content:`Rewriting auth middleware:
|
|
41
|
-
\`\`\`typescript
|
|
42
|
-
import jwt from "jsonwebtoken";
|
|
43
|
-
import type { Request, Response, NextFunction } from "express";
|
|
44
|
-
|
|
45
|
-
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
46
|
-
|
|
47
|
-
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
48
|
-
const header = req.headers.authorization;
|
|
49
|
-
if (!header?.startsWith("Bearer ")) {
|
|
50
|
-
res.status(401).json({ error: "Missing token" });
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
try {
|
|
54
|
-
const decoded = jwt.verify(header.slice(7), JWT_SECRET);
|
|
55
|
-
req.user = decoded;
|
|
56
|
-
next();
|
|
57
|
-
} catch {
|
|
58
|
-
res.status(403).json({ error: "Invalid token" });
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
\`\`\``},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:18Z",content:"Updated login route to issue JWT tokens with 24h expiry."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:22Z",content:"Running test suite... 14 tests passed, 2 updated, 0 failed."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:30:05Z",content:"Generating pytest tests for POST /api/register endpoint..."},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:32:00Z",content:"Created 8 test cases covering: valid registration, duplicate email, weak password, missing fields, SQL injection, XSS payload, rate limit, and CORS headers."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"}],MC=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",environmentId:"env-local-01",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-01-15T10:00:00Z",updatedAt:"2026-01-15T10:00:00Z"},{id:"proj-beta",name:"Data Pipeline",description:"ETL pipelines for analytics and reporting",repoUrl:"https://github.com/acme/data-pipeline",environmentId:"env-docker-01",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-02-01T14:30:00Z",updatedAt:"2026-02-01T14:30:00Z"},{id:"proj-gamma",name:"Mobile App",description:"React Native cross-platform mobile application",repoUrl:"",environmentId:"env-local-01",status:"archived",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],OC=[{id:"task-001",workspaceId:"proj-alpha",title:"Implement JWT authentication",description:"Replace session-based auth with JWT tokens across all protected routes",status:"working",branch:"feat/jwt-auth",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-001a","task-001b","task-001c"],canDecompose:!0,defaultPersonaId:""},{id:"task-001a",workspaceId:"proj-alpha",title:"Design token schema",description:"Define JWT payload structure, expiry, and refresh token strategy",status:"complete",branch:"feat/jwt-auth/design-token-schema",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:10:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-001b",workspaceId:"proj-alpha",title:"Implement auth middleware",description:"Build Express middleware that verifies JWT Bearer tokens",status:"working",branch:"feat/jwt-auth/implement-auth-middleware",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:15:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-001c",workspaceId:"proj-alpha",title:"Write auth integration tests",description:"End-to-end tests for login flow, token refresh, and protected route access",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-25T10:20:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-002",workspaceId:"proj-alpha",title:"Add rate limiting",description:"Implement token-bucket rate limiting for public API endpoints",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:05:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-003",workspaceId:"proj-alpha",title:"Set up OpenAPI documentation",description:"Generate Swagger docs from route decorators and serve at /api/docs",status:"paused",branch:"feat/openapi-docs",latestSessionId:"sess-002",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-24T16:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-004",workspaceId:"proj-alpha",title:"Database connection pooling",description:"Switch from single connection to a connection pool with health checks",status:"complete",branch:"feat/db-pool",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-23T11:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-005",workspaceId:"proj-alpha",title:"Fix N+1 query in user list",description:"Use a JOIN instead of per-row lookups in GET /api/users",status:"not_started",branch:"fix/user-list-n1",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:5,createdAt:"2026-02-22T09:30:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006",workspaceId:"proj-beta",title:"Add Parquet export support",description:"Allow pipeline outputs to be written as Parquet files for Spark consumption",status:"working",branch:"feat/parquet-export",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-006a","task-006b","task-006c","task-006d"],canDecompose:!0,defaultPersonaId:""},{id:"task-006a",workspaceId:"proj-beta",title:"Define Parquet schema mapping",description:"Map internal column types to Arrow/Parquet type system",status:"complete",branch:"feat/parquet-export/define-parquet-schema-mapping",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:05:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006b",workspaceId:"proj-beta",title:"Implement row-group writer",description:"Write buffered row groups with configurable batch size",status:"complete",branch:"feat/parquet-export/implement-row-group-writer",latestSessionId:"",dependsOn:["task-006a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:10:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006c",workspaceId:"proj-beta",title:"Add compression options",description:"Support Snappy, ZSTD, and GZIP compression for Parquet output",status:"working",branch:"feat/parquet-export/add-compression-options",latestSessionId:"sess-004",dependsOn:["task-006b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T08:15:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006d",workspaceId:"proj-beta",title:"Write Parquet integration tests",description:"Round-trip tests: write Parquet, read back with pyarrow, verify data integrity",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-006c"],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-26T08:20:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-007",workspaceId:"proj-beta",title:"Implement incremental loads",description:"Track watermarks so pipelines only process new/changed rows",status:"working",branch:"feat/incremental",latestSessionId:"sess-004",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:30:00Z",parentTaskId:"",depth:0,childTaskIds:["task-007a","task-007b"],canDecompose:!0,defaultPersonaId:""},{id:"task-007a",workspaceId:"proj-beta",title:"Design watermark storage",description:"Define schema for per-pipeline high-watermark tracking",status:"complete",branch:"feat/incremental/design-watermark-storage",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:35:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-007b",workspaceId:"proj-beta",title:"Implement change detection query",description:"Generate WHERE clauses from watermarks to fetch only changed rows",status:"failed",branch:"feat/incremental/implement-change-detection-query",latestSessionId:"",dependsOn:["task-007a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:40:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-008",workspaceId:"proj-beta",title:"Add pipeline monitoring dashboard",description:"Real-time metrics for pipeline throughput, latency, and error rates",status:"paused",branch:"feat/monitoring",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T09:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""}],py=[{id:"find-001",workspaceId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"architecture",title:"Auth middleware is tightly coupled to Express",content:"The current auth middleware directly references Express Request/Response types. Consider extracting a framework-agnostic token verification layer so we can reuse it in the WebSocket auth path.",tags:["auth","decoupling","middleware"],createdAt:"2026-02-27T08:16:00Z"},{id:"find-002",workspaceId:"proj-alpha",taskId:"task-003",sessionId:"sess-002",category:"api",title:"Missing pagination on GET /api/users",content:"The users endpoint returns all rows without limit/offset. For datasets over 10k rows this will cause timeouts. Recommend cursor-based pagination with a default page size of 50.",tags:["api","pagination","performance"],createdAt:"2026-02-27T07:31:00Z"},{id:"find-003",workspaceId:"proj-alpha",taskId:"task-005",sessionId:"sess-003",category:"bug",title:"Race condition in session cleanup",content:"When two requests hit /api/logout concurrently, the second call throws a 500 because the session row has already been deleted. Needs an idempotent DELETE or a conditional check.",tags:["bug","concurrency","sessions"],createdAt:"2026-02-26T22:50:00Z"},{id:"find-004",workspaceId:"proj-alpha",taskId:"task-004",sessionId:"",category:"decision",title:"Chose pg-pool over knex connection pool",content:"pg-pool gives us direct control over idle timeout, max connections, and health check queries. Knex wraps pg-pool anyway and adds overhead we don't need since we write raw SQL.",tags:["database","decision","postgres"],createdAt:"2026-02-23T11:30:00Z"},{id:"find-005",workspaceId:"proj-alpha",taskId:"",sessionId:"",category:"dependency",title:"jsonwebtoken has 3 high-severity CVEs",content:"The jsonwebtoken package (v8.x) has known vulnerabilities. Consider migrating to jose which is maintained, supports ESM, and covers the same JWS/JWE surface area with zero dependencies.",tags:["security","dependency","jwt"],createdAt:"2026-02-27T08:20:00Z"},{id:"find-006",workspaceId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"pattern",title:"Consistent error response shape",content:"All error responses should follow the shape `{ error: string, code: string, details?: unknown }`. Currently some routes return `{ message: string }` and others return `{ error: string }`.",tags:["api","consistency","error-handling"],createdAt:"2026-02-27T08:17:00Z"},{id:"find-007",workspaceId:"proj-beta",taskId:"task-007",sessionId:"sess-004",category:"architecture",title:"Watermark storage should be pluggable",content:"The incremental load watermarks are currently stored in a local SQLite file. For production multi-worker scenarios, this needs to be backed by a shared store (Redis or Postgres).",tags:["architecture","pipeline","scalability"],createdAt:"2026-02-27T09:05:00Z"}],BC=[{name:"anthropic",tokenType:"env_var",envVar:"ANTHROPIC_API_KEY",filePath:"",expiresAt:""},{name:"github",tokenType:"env_var",envVar:"GITHUB_TOKEN",filePath:"",expiresAt:"2026-12-31T23:59:59Z"},{name:"gcp-service-account",tokenType:"file",envVar:"",filePath:"/home/user/.config/gcloud/credentials.json",expiresAt:""}],IC=[{id:"persona-arch",name:"Software Architect",description:"Designs system architecture, defines interfaces, and decomposes large features into implementable tasks.",systemPrompt:"You are a senior software architect. Focus on clean interfaces, separation of concerns, and scalable patterns. When decomposing work, create concrete subtasks with clear acceptance criteria.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z",type:"agent",script:""},{id:"persona-fe",name:"Frontend Engineer",description:"React specialist — builds UI components, writes CSS, implements routing, and creates Playwright tests.",systemPrompt:"You are a frontend engineer specializing in React, TypeScript, and modern CSS. Follow component composition patterns, use semantic HTML, and write accessible markup.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z",type:"agent",script:""},{id:"persona-reviewer",name:"Code Reviewer",description:"Reviews diffs for correctness, security, and style. Posts findings for issues discovered.",systemPrompt:"You are a meticulous code reviewer. Check for security vulnerabilities, performance issues, and style consistency. Post findings for anything noteworthy.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z",type:"agent",script:""},{id:"persona-tester",name:"QA Engineer",description:"Writes comprehensive test suites — unit tests, integration tests, and E2E Playwright specs.",systemPrompt:"You are a QA engineer focused on test coverage. Write tests that cover happy paths, edge cases, error scenarios, and accessibility. Use Playwright for E2E tests.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z",type:"agent",script:""},{id:"persona-lint",name:"Lint & Format",description:"Scripted persona — runs ESLint and Prettier on changed files, auto-fixes violations, and posts a findings summary.",systemPrompt:"",toolConfig:"{}",runtime:"genaiscript",model:"",maxTurns:1,mcpServers:"[]",createdAt:"2026-02-21T09:00:00Z",updatedAt:"2026-02-21T09:00:00Z",type:"script",script:`const files = env.files.filter(f => /\\.(ts|tsx|js)$/.test(f.filename));
|
|
62
|
-
for (const f of files) {
|
|
63
|
-
const eslintResult = await host.exec("npx", ["eslint", "--fix", f.filename]);
|
|
64
|
-
if (eslintResult.exitCode !== 0) {
|
|
65
|
-
env.findings.push({ category: "lint", title: \`Lint issues in \${f.filename}\`, content: eslintResult.stderr });
|
|
66
|
-
}
|
|
67
|
-
const prettierResult = await host.exec("npx", ["prettier", "--write", f.filename]);
|
|
68
|
-
if (prettierResult.exitCode !== 0) {
|
|
69
|
-
env.findings.push({ category: "format", title: \`Prettier issues in \${f.filename}\`, content: prettierResult.stderr });
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
env.findings.push({ category: "summary", title: "Lint & format pass complete", content: \`Ran ESLint and Prettier on \${files.length} files\` });`}],LC={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z"},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Implement auth middleware",startedAt:"2026-02-27T08:15:00Z"}],"task-006c":[{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Add compression options",startedAt:"2026-02-27T09:00:00Z"}]};function wt(t){return new Date(Date.now()+t).toISOString()}const my=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:wt(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:wt(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:wt(1600),content:`Found 5 endpoints that need refactoring:
|
|
73
|
-
- GET /api/users
|
|
74
|
-
- POST /api/users
|
|
75
|
-
- GET /api/users/:id
|
|
76
|
-
- PUT /api/users/:id
|
|
77
|
-
- DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:wt(2800),content:"Refactoring to use Express Router with middleware chain...\n```typescript\nconst router = Router();\nrouter.use(authenticate);\nrouter.use(validateBody);\n```"}},{delayMs:4e3,event:{eventType:"output",timestamp:wt(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:wt(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:wt(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:wt(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:wt(1400),content:`Found tables to modify:
|
|
78
|
-
- users (add column: last_login_at)
|
|
79
|
-
- sessions (add index on expires_at)
|
|
80
|
-
- audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:wt(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
|
|
81
|
-
The table has 50,000+ rows — this may lock the table briefly.
|
|
82
|
-
|
|
83
|
-
Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:wt(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:wt(1e3),content:`Migration 001_add_last_login.sql applied successfully.
|
|
84
|
-
Migration 002_sessions_index.sql applied successfully.
|
|
85
|
-
Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:wt(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:wt(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:wt(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:wt(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:wt(1800),content:`Writing test cases:
|
|
86
|
-
- should calculate monthly total
|
|
87
|
-
- should apply discount codes
|
|
88
|
-
- should handle currency conversion
|
|
89
|
-
- should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:wt(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
|
|
90
|
-
The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:wt(3500),content:"failed"}}]}],gy=400;function UC({children:t}){const[a,i]=b.useState(AC),[o,r]=b.useState(DC),[u,d]=b.useState(RC),[p,m]=b.useState(void 0),[g,v]=b.useState(MC),[y,x]=b.useState(OC),[S,T]=b.useState(py),[E,N]=b.useState(BC),[C,j]=b.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[A,R]=b.useState(IC),[w]=b.useState(LC),[G,z]=b.useState(""),O=b.useRef(0),$=b.useRef(0),J=b.useRef(new Set),ae=b.useRef(new Map),se=b.useRef(y);se.current=y;const te=b.useRef(new Map),U=b.useRef(new Map),Q=b.useCallback(X=>(O.current+=1,`mock-${X}-${String(O.current).padStart(3,"0")}`),[]),B=b.useCallback(()=>{const X=my[$.current%my.length];return $.current+=1,X},[]),q=b.useCallback((X,re,ue)=>{const Se=setTimeout(()=>{var ge;J.current.delete(Se),ue&&((ge=ae.current.get(ue))==null||ge.delete(Se)),X()},re);J.current.add(Se),ue&&(ae.current.has(ue)||ae.current.set(ue,new Set),ae.current.get(ue).add(Se))},[]),oe=b.useCallback(X=>{const re=ae.current.get(X);re&&(re.forEach(ue=>{clearTimeout(ue),J.current.delete(ue)}),ae.current.delete(X))},[]),le=b.useCallback((X,re,ue)=>{r(Se=>Se.map(ge=>ge.id===X?{...ge,status:re,...ue!==void 0?{endReason:ue}:{}}:ge))},[]),F=b.useCallback(X=>{d(re=>[...re,X])},[]),ye=b.useCallback((X,re,ue)=>{re.forEach((Se,ge)=>{q(()=>{const We={sessionId:X,...Se.event,timestamp:new Date().toISOString()};if(F(We),Se.event.eventType==="status"){const je=tb(Se.event.content),tt=nb(Se.event.content);le(X,je,tt)}ge===re.length-1&&ue&&ue()},Se.delayMs,X)})},[q,F,le]),Te=b.useCallback((X,re,ue,Se)=>{console.log("[MockGrackle] spawn",{environmentId:X,prompt:re,runtime:Se});const ge=Q("sess"),We={id:ge,environmentId:X,runtime:Se||"claude-code",status:"running",prompt:re,startedAt:new Date().toISOString()};r(tt=>[...tt,We]),m(ge);const je=B();if(console.log(`[MockGrackle] Playing scenario: ${je.label}`),je.pauseForInput){const tt=je.pauseAfterStep??je.steps.length-1,Ae=je.steps.slice(0,tt+1),st=Ae.length>0?Ae[Ae.length-1].delayMs:0;ye(ge,Ae),q(()=>{le(ge,"idle"),F({sessionId:ge,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},st+gy,ge),je.resumeSteps&&te.current.set(ge,je.resumeSteps)}else ye(ge,je.steps)},[Q,B,ye,q,le,F]),be=b.useCallback(X=>{console.log("[MockGrackle] kill",X),oe(X),te.current.delete(X),le(X,"stopped","killed"),F({sessionId:X,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),x(re=>re.map(ue=>ue.latestSessionId===X&&ue.status==="working"?{...ue,status:"not_started"}:ue))},[oe,le,F]),ne=b.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),ce=b.useCallback(X=>{console.log("[MockGrackle] loadSessionEvents",X)},[]),ee=b.useCallback(()=>{console.log("[MockGrackle] clearEvents"),d([])},[]),et=b.useCallback((X,re,ue,Se,ge,We,je,tt,Ae)=>{console.log("[MockGrackle] createWorkspace",{name:X,description:re});const st={id:Q("proj"),name:X,description:re||"",repoUrl:ue||"",environmentId:Se||"",status:"active",worktreeBasePath:je||"",useWorktrees:We??!0,defaultPersonaId:ge||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(Fe=>[...Fe,st]),tt&&tt()},[Q]),Me=b.useCallback(X=>{console.log("[MockGrackle] archiveWorkspace",X),v(re=>re.map(ue=>ue.id===X?{...ue,status:"archived"}:ue))},[]),On=b.useCallback(X=>{console.log("[MockGrackle] loadTasks",X)},[]),Na=b.useCallback((X,re,ue,Se,ge,We,je,tt,Ae)=>{console.log("[MockGrackle] createTask",{workspaceId:X,title:re,parentTaskId:ge}),x(st=>{const $t=st.filter(yn=>yn.workspaceId===X).reduce((yn,wa)=>Math.max(yn,wa.sortOrder),0),nn=ge?st.find(yn=>yn.id===ge):void 0;if(ge&&!nn)return console.warn("[MockGrackle] Parent task not found:",ge),st;if(nn&&!nn.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",ge),st;const Ht=nn?nn.depth+1:0,ja={id:Q("task"),workspaceId:X,title:re,description:ue||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:Se||[],reviewNotes:void 0,sortOrder:$t+1,createdAt:new Date().toISOString(),parentTaskId:ge||"",depth:Ht,childTaskIds:[],canDecompose:je??!ge,defaultPersonaId:We||""};return[...st,ja]}),tt&&tt()},[Q]),gn=b.useCallback((X,re,ue,Se)=>{var st;console.log("[MockGrackle] startTask",{taskId:X});const ge=se.current.find(Fe=>Fe.id===X),We=(ge==null?void 0:ge.title)??"",je=Q("sess"),tt={id:je,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:We||X,startedAt:new Date().toISOString()};r(Fe=>[...Fe,tt]),x(Fe=>Fe.map($t=>$t.id===X?{...$t,status:"working",latestSessionId:je,branch:`mock/${X.slice(0,8)}`}:$t));const Ae=B();if(console.log(`[MockGrackle] Playing task scenario: ${Ae.label}`),Ae.pauseForInput){const Fe=Ae.pauseAfterStep??Ae.steps.length-1,$t=Ae.steps.slice(0,Fe+1),nn=$t.length>0?$t[$t.length-1].delayMs:0;if(ye(je,$t),q(()=>{le(je,"idle"),F({sessionId:je,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},nn+gy,je),Ae.resumeSteps){const Ht=[...Ae.resumeSteps];te.current.set(je,Ht);const ja=Ht.reduce((yn,wa)=>Math.max(yn,wa.delayMs),0);U.current.set(je,{taskId:X,delayAfterResume:ja+200})}}else{const Fe=Ae.steps.length>0?Ae.steps[Ae.steps.length-1].delayMs:0;ye(je,Ae.steps);const $t=(st=Ae.steps[Ae.steps.length-1])==null?void 0:st.event.content;q(()=>{$t==="completed"?x(nn=>nn.map(Ht=>Ht.id===X&&Ht.status==="working"?{...Ht,status:"paused"}:Ht)):$t==="failed"&&x(nn=>nn.map(Ht=>Ht.id===X&&Ht.status==="working"?{...Ht,status:"failed"}:Ht))},Fe+100,je)}},[Q,B,ye,q,le,F]),Jn=b.useCallback((X,re)=>{console.log("[MockGrackle] sendInput",{sessionId:X,text:re}),F({sessionId:X,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${re}`}),le(X,"running"),F({sessionId:X,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const ue=te.current.get(X);if(ue)te.current.delete(X),ye(X,ue);else{const ge=[{delayMs:500,event:{eventType:"output",timestamp:new Date().toISOString(),content:"I received your input, continuing..."}},{delayMs:1500,event:{eventType:"status",timestamp:new Date().toISOString(),content:"completed"}}];ye(X,ge)}const Se=U.current.get(X);Se&&(U.current.delete(X),q(()=>{x(ge=>ge.map(We=>We.id===Se.taskId&&We.status==="working"?{...We,status:"paused"}:We))},Se.delayAfterResume,X))},[F,le,ye,q]),ea=b.useCallback(X=>{console.log("[MockGrackle] completeTask",X),x(re=>re.map(ue=>ue.id===X?{...ue,status:"complete"}:ue))},[]),vn=b.useCallback(X=>{console.log("[MockGrackle] resumeTask",X)},[]),zn=b.useCallback((X,re,ue,Se,ge)=>{console.log("[MockGrackle] updateTask",{taskId:X,title:re}),x(We=>We.map(je=>je.id===X?{...je,title:re.trim()||je.title,description:ue,dependsOn:Se,...ge!==void 0?{defaultPersonaId:ge}:{}}:je))},[]),ke=b.useCallback(X=>{console.log("[MockGrackle] deleteTask",X),x(re=>re.filter(ue=>ue.id!==X))},[]),Nt=b.useCallback(X=>{console.log("[MockGrackle] loadFindings",X),T(py.filter(re=>re.workspaceId===X))},[]),to=b.useCallback((X,re,ue,Se,ge)=>{console.log("[MockGrackle] postFinding",{workspaceId:X,title:re});const We={id:Q("find"),workspaceId:X,taskId:"",sessionId:"",category:Se||"general",title:re,content:ue,tags:ge||[],createdAt:new Date().toISOString()};T(je=>[...je,We])},[Q]),Fs=b.useCallback((X,re,ue)=>{console.log("[MockGrackle] addEnvironment",{displayName:X,adapterType:re,adapterConfig:ue})},[]),qs=b.useCallback((X,re)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:X,...re}),i(ue=>ue.map(Se=>Se.id!==X?Se:{...Se,...re.displayName!==void 0?{displayName:re.displayName}:{},...re.adapterConfig!==void 0?{adapterConfig:JSON.stringify(re.adapterConfig)}:{}}))},[]),Ks=b.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),jl=b.useCallback((X,re,ue,Se,ge)=>{console.log("[MockGrackle] setToken",{name:X,tokenType:ue}),N(We=>[...We.filter(tt=>tt.name!==X),{name:X,tokenType:ue,envVar:Se,filePath:ge,expiresAt:""}])},[]),wl=b.useCallback(X=>{console.log("[MockGrackle] deleteToken",X),N(re=>re.filter(ue=>ue.name!==X))},[]),Vt=b.useCallback(X=>{console.log("[MockGrackle] updateCredentialProviders",X),j(X)},[]);b.useEffect(()=>()=>{J.current.forEach(clearTimeout),J.current.clear()},[]);const Bc=b.useMemo(()=>({connected:!0,send:()=>{},environments:a,sessions:o,events:u,eventsDropped:0,lastSpawnedId:p,workspaces:g,tasks:y,findings:S,tokens:E,credentialProviders:C,spawn:Te,sendInput:Jn,kill:be,refresh:ne,loadSessionEvents:ce,clearEvents:ee,createWorkspace:et,archiveWorkspace:Me,updateWorkspace:(X,re)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:X,...re}),v(ue=>ue.map(Se=>Se.id!==X?Se:{...Se,...re.name!==void 0?{name:re.name}:{},...re.description!==void 0?{description:re.description}:{},...re.repoUrl!==void 0?{repoUrl:re.repoUrl}:{},...re.environmentId!==void 0?{environmentId:re.environmentId}:{},...re.worktreeBasePath!==void 0?{worktreeBasePath:re.worktreeBasePath}:{},...re.useWorktrees!==void 0?{useWorktrees:re.useWorktrees}:{},...re.defaultPersonaId!==void 0?{defaultPersonaId:re.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:On,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:Na,startTask:gn,stopTask:X=>{console.log("[MockGrackle] stopTask",{taskId:X}),ea(X)},completeTask:ea,resumeTask:vn,updateTask:zn,deleteTask:ke,loadFindings:Nt,postFinding:to,addEnvironment:Fs,updateEnvironment:qs,loadTokens:Ks,setToken:jl,deleteToken:wl,updateCredentialProviders:Vt,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:A,createPersona:(X,re,ue,Se,ge,We,je,tt)=>{console.log("[MockGrackle] createPersona",{name:X});const Ae={id:`mock-persona-${Date.now()}`,name:X,description:re,systemPrompt:ue,toolConfig:"{}",runtime:Se??"claude-code",model:ge||"",maxTurns:We||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:je||"agent",script:tt||""};R(st=>[...st,Ae])},updatePersona:(X,re,ue,Se,ge,We,je,tt,Ae)=>{console.log("[MockGrackle] updatePersona",{personaId:X,name:re}),R(st=>st.map(Fe=>Fe.id!==X?Fe:{...Fe,...re!==void 0?{name:re}:{},...ue!==void 0?{description:ue}:{},...Se!==void 0?{systemPrompt:Se}:{},...ge!==void 0?{runtime:ge}:{},...We!==void 0?{model:We}:{},...je!==void 0?{maxTurns:je}:{},...tt!==void 0?{type:tt}:{},...Ae!==void 0?{script:Ae}:{},updatedAt:new Date().toISOString()}))},deletePersona:X=>{console.log("[MockGrackle] deletePersona",X),R(re=>re.filter(ue=>ue.id!==X))},taskSessions:w,loadTaskSessions:X=>{console.log("[MockGrackle] loadTaskSessions",X)},appDefaultPersonaId:G,setAppDefaultPersonaId:X=>{console.log("[MockGrackle] setAppDefaultPersonaId",X),z(X)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")},usageCache:{"workspace:proj-alpha":{inputTokens:214500,outputTokens:44850,costUsd:1.12,sessionCount:4},"workspace:proj-beta":{inputTokens:86700,outputTokens:23800,costUsd:.48,sessionCount:3},"task:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1},"task_tree:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task_tree:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1}},loadUsage:(X,re)=>{console.log(`[MockGrackle] loadUsage(${X}, ${re})`)},knowledge:{graphData:{nodes:[],links:[]},selectedNode:void 0,loading:!1,selectedId:void 0,searchQuery:"",search:()=>{},clearSearch:()=>{},selectNode:()=>{},clearSelection:()=>{},expandNode:()=>{},loadRecent:()=>{},handleMessage:()=>!1}}),[a,o,u,p,g,y,S,E,C,A,w,G,Te,Jn,be,ne,ce,ee,et,Me,On,Na,gn,ea,vn,zn,ke,Nt,to,Fs,qs,Ks,jl,wl,Vt]);return c.jsx(dh.Provider,{value:Bc,children:t})}const Cb=b.createContext(void 0),zC=4e3;function VC({children:t}){const[a,i]=b.useState([]),o=b.useRef(0),r=b.useCallback(d=>{i(p=>p.filter(m=>m.id!==d))},[]),u=b.useCallback((d,p="info",m=zC)=>{const g=`toast-${++o.current}`;i(v=>[...v,{id:g,message:d,variant:p,duration:m}])},[]);return c.jsx(Cb.Provider,{value:{toasts:a,showToast:u,dismissToast:r},children:t})}function Ps(){const t=b.useContext(Cb);if(!t)throw new Error("useToast must be used within ToastProvider");return t}const Ec=[{id:"grackle",label:"Grackle",description:"The default Grackle theme — iridescent purple on clean dark.",swatches:["#0e1218","#8b5cf6","#60a5fa","#e5e7eb","#34d399"],variantLightId:"grackle-light",variantDarkId:"grackle-dark"},{id:"grackle-light",label:"Grackle Light",description:"Light Grackle variant.",hidden:!0},{id:"grackle-dark",label:"Grackle Dark",description:"Dark Grackle variant.",hidden:!0},{id:"glass",label:"Glassmorphism",description:"Dark frosted-glass aesthetic with backdrop blur effects.",swatches:["#0a0c14","#4ecca3","#70a1ff","#e2e8f0","#a855f7"]},{id:"matrix",label:"Matrix",description:"Phosphor-green CRT terminal with scanlines and glow.",swatches:["#050505","#00ff41","#00bfff","#33ff77","#ffb000"]},{id:"brutalist",label:"Neubrutalism",description:"Thick borders, raw colors, bold type — ugly on purpose.",swatches:["#f5f0e8","#ff5757","#5ce1e6","#1a1a1a","#ffde59"],variantLightId:"brutalist-light",variantDarkId:"brutalist-dark"},{id:"brutalist-light",label:"Neubrutalism Light",description:"Light neubrutalism variant.",hidden:!0},{id:"brutalist-dark",label:"Neubrutalism Dark",description:"Dark neubrutalism variant.",hidden:!0},{id:"monokai",label:"Monokai",description:"Classic warm editor palette — pink, green, and purple.",swatches:["#272822","#f92672","#a6e22e","#f8f8f2","#ae81ff"],variantLightId:"monokai-light",variantDarkId:"monokai-dark"},{id:"monokai-dark",label:"Monokai Dark",description:"Dark Monokai variant.",hidden:!0},{id:"monokai-light",label:"Monokai Light",description:"Light Monokai variant.",hidden:!0},{id:"ubuntu",label:"Ubuntu",description:"Aubergine terminal with the GNOME Tango palette.",swatches:["#300a24","#8ae234","#ef2929","#eeeeec","#fce94f"]},{id:"sandstone",label:"Sandstone",description:"Warm terracotta accent on dark brown, in the style of Claude Code.",swatches:["#1a1815","#C15F3C","#6b8afd","#e8e6e3","#a78bfa"]},{id:"verdigris",label:"Verdigris",description:"Teal accent on charcoal, in the style of ChatGPT.",swatches:["#141414","#00a67e","#3b82f6","#ececec","#ab68ff"]},{id:"primer",label:"Primer",description:"Blue accent on ink-dark grey, in the style of GitHub.",swatches:["#0d1117","#58a6ff","#3fb950","#c9d1d9","#bc8cff"]}],Eb=new Set(Ec.map(t=>t.id)),vy="grackle";function Nf(t){return Ec.find(a=>a.id===t)}const jf="grackle-theme",Nb="grackle-prefer-system",jb="(prefers-color-scheme: dark)";let el=[],sc;function nf(){sc=void 0;for(const t of el)t()}function wf(){return typeof window>"u"?!1:window.matchMedia(jb).matches}function ll(){if(typeof localStorage>"u")return vy;try{const t=localStorage.getItem(jf);if(t!==null&&Eb.has(t))return t}catch{}return vy}function uc(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(Nb)==="true"}catch{return!1}}function Af(t){return Ec.find(a=>a.variantLightId===t||a.variantDarkId===t)}function wb(t,a){const i=Nf(t);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?wf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const o=Af(t);if(o!=null&&o.variantLightId&&o.variantDarkId)return wf()?o.variantDarkId:o.variantLightId}return t}function Bi(t,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=wb(t,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Bi(ll(),uc());function HC(){return sc===void 0&&(sc={themeId:ll(),systemDark:wf(),preferSystem:uc()}),sc}function PC(t){return el=[...el,t],()=>{el=el.filter(a=>a!==t)}}function GC(){const t=b.useSyncExternalStore(PC,HC),{themeId:a,preferSystem:i}=t,o=wb(a,i),r=b.useCallback(d=>{if(Eb.has(d)){try{localStorage.setItem(jf,d)}catch{}Bi(d,uc(),!0),nf()}},[]),u=b.useCallback(d=>{try{localStorage.setItem(Nb,d?"true":"false")}catch{}if(d){const p=ll(),m=Nf(p);if(m!=null&&m.hidden){const g=Af(p);if(g)try{localStorage.setItem(jf,g.id)}catch{}}}Bi(ll(),d,!0),nf()},[]);return b.useEffect(()=>{Bi(a,i)},[a,i]),b.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia(jb),p=()=>{const m=ll(),g=uc();if(g){const v=Nf(m);if(v!=null&&v.variantDarkId&&v.variantLightId&&Bi(m,g),v!=null&&v.hidden){const y=Af(m);y!=null&&y.variantDarkId&&y.variantLightId&&Bi(m,g)}}nf()};return d.addEventListener("change",p),()=>{d.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:o,preferSystem:i,setPreferSystem:u}}const Ab=b.createContext(void 0);function $C({children:t}){const a=GC();return c.jsx(Ab.Provider,{value:a,children:t})}function Db(){const t=b.useContext(Ab);if(!t)throw new Error("useThemeContext must be used within ThemeProvider");return t}const FC="_container_1mq5u_1",qC="_hamburger_1mq5u_33",KC="_brand_1mq5u_49",YC="_brandLogo_1mq5u_68",ZC="_info_1mq5u_75",XC="_connectionLabel_1mq5u_90",QC="_connectionDot_1mq5u_103",WC="_connected_1mq5u_106",JC="_disconnected_1mq5u_110",ba={container:FC,hamburger:qC,brand:KC,brandLogo:YC,info:ZC,connectionLabel:XC,connectionDot:QC,connected:WC,disconnected:JC};function eE({connected:t,environments:a,sessions:i,onToggleSidebar:o,sidebarOpen:r}){const u=Mt(),d=a.length,p=a.filter(g=>g.status==="connected").length,m=i.filter(g=>["running","idle"].includes(g.status)).length;return c.jsxs("div",{className:ba.container,children:[o&&c.jsx("button",{type:"button",className:ba.hamburger,onClick:o,"aria-label":"Toggle sidebar","aria-expanded":r,children:"☰"}),c.jsxs("button",{type:"button",className:ba.brand,onClick:()=>u(Us),title:"Home",children:[c.jsx("img",{src:"/icon-192x192.png",alt:"",className:ba.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),c.jsxs("div",{className:ba.info,children:[c.jsxs("span",{"aria-label":t?"Connected":"Disconnected",children:[c.jsx("span",{className:`${ba.connectionDot} ${t?ba.connected:ba.disconnected}`,"aria-hidden":"true",children:"●"})," ",c.jsx("span",{className:ba.connectionLabel,"aria-hidden":"true",children:t?"Connected":"Disconnected"})]}),c.jsxs("span",{children:[p,"/",d," env",d!==1?"s":""]}),c.jsxs("span",{children:[m," active"]})]})]})}const tE="_nav_13gkc_1",nE="_tab_13gkc_35",aE="_tabIcon_13gkc_68",sE="_tabLabel_13gkc_79",iE="_tabActive_13gkc_84",Xo={nav:tE,tab:nE,tabIcon:aE,tabLabel:sE,tabActive:iE},ws=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:Us,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:uC,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:dC,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:Gi,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:"🧠",route:kb,testId:"sidebar-tab-knowledge"},{view:"settings",label:"Settings",icon:"⚙️",route:rC,testId:"sidebar-tab-settings"}];function oE(t){return t===Us||t==="/"?"dashboard":t.startsWith("/chat")||t.startsWith("/sessions")?"chat":t.startsWith("/workspaces")||t.startsWith("/environments")?"environments":t.startsWith(kb)?"knowledge":t.startsWith(ol)?"settings":"tasks"}function lE(){const t=At(),a=Mt(),i=b.useRef(null),o=oE(t.pathname),r=b.useCallback(d=>{a(d.route)},[a]),u=b.useCallback(d=>{var y,x;const p=(y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),g=m>=0?m:ws.findIndex(S=>S.view===o);let v=g;if(d.key==="ArrowRight")d.preventDefault(),v=(g+1)%ws.length;else if(d.key==="ArrowLeft")d.preventDefault(),v=(g-1+ws.length)%ws.length;else if(d.key==="Home")d.preventDefault(),v=0;else if(d.key==="End")d.preventDefault(),v=ws.length-1;else return;a(ws[v].route),(x=p[v])==null||x.focus()},[o,a]);return c.jsx("nav",{className:Xo.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:u,"data-testid":"sidebar-nav",children:ws.map(d=>{const p=d.view===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Xo.tab} ${p?Xo.tabActive:""}`,onClick:()=>r(d),"data-testid":d.testId,title:d.label,"aria-label":d.label,children:[c.jsx("span",{className:Xo.tabIcon,"aria-hidden":"true",children:d.icon}),c.jsx("span",{className:Xo.tabLabel,children:d.label})]},d.view)})})}const Rb=b.createContext(void 0),Mb=b.createContext(void 0);function rE({children:t}){const[a,i]=b.useState(void 0),o=b.useCallback(r=>{i(r)},[]);return c.jsx(Mb.Provider,{value:o,children:c.jsx(Rb.Provider,{value:a,children:t})})}function Ob(){return b.useContext(Rb)}function cE(){const t=b.useContext(Mb);if(t===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return t}const uE="_container_pi6ii_1",dE="_content_pi6ii_66",yy={container:uE,content:dE},fE=320,Bb=220,Ib=600,Lb="grackle-sidebar-width";function hE(){try{const t=localStorage.getItem(Lb);if(t!==null){const a=Number(t);if(Number.isFinite(a)&&a>=Bb&&a<=Ib)return a}}catch{}return fE}function pE(t){try{localStorage.setItem(Lb,String(t))}catch{}}function mE(){const[t]=b.useState(hE),a=b.useRef(null),i=Ob();if(b.useEffect(()=>{const o=a.current;if(!o)return;const r=new ResizeObserver(u=>{for(const d of u){const p=d.borderBoxSize[0];if(p){const m=Math.round(p.inlineSize);m>=Bb&&m<=Ib&&pE(m)}}});return r.observe(o),()=>{r.disconnect()}},[]),i!==void 0)return c.jsx("div",{className:yy.container,ref:a,"data-testid":"sidebar",style:{width:t},children:c.jsx("div",{className:yy.content,children:i})})}function Nc(t){const a=cE();b.useLayoutEffect(()=>(a(t),()=>{a(void 0)}),[t,a])}const fh=b.createContext({});function hh(t){const a=b.useRef(null);return a.current===null&&(a.current=t()),a.current}const jc=b.createContext(null),ph=b.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class gE extends b.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=i.offsetHeight||0,o.width=i.offsetWidth||0,o.top=i.offsetTop,o.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function vE({children:t,isPresent:a}){const i=b.useId(),o=b.useRef(null),r=b.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=b.useContext(ph);return b.useInsertionEffect(()=>{const{width:d,height:p,top:m,left:g}=r.current;if(a||!o.current||!d||!p)return;o.current.dataset.motionPopId=i;const v=document.createElement("style");return u&&(v.nonce=u),document.head.appendChild(v),v.sheet&&v.sheet.insertRule(`
|
|
91
|
-
[data-motion-pop-id="${i}"] {
|
|
92
|
-
position: absolute !important;
|
|
93
|
-
width: ${d}px !important;
|
|
94
|
-
height: ${p}px !important;
|
|
95
|
-
top: ${m}px !important;
|
|
96
|
-
left: ${g}px !important;
|
|
97
|
-
}
|
|
98
|
-
`),()=>{document.head.removeChild(v)}},[a]),c.jsx(gE,{isPresent:a,childRef:o,sizeRef:r,children:b.cloneElement(t,{ref:o})})}const yE=({children:t,initial:a,isPresent:i,onExitComplete:o,custom:r,presenceAffectsLayout:u,mode:d})=>{const p=hh(bE),m=b.useId(),g=b.useCallback(y=>{p.set(y,!0);for(const x of p.values())if(!x)return;o&&o()},[p,o]),v=b.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:y=>(p.set(y,!1),()=>p.delete(y))}),u?[Math.random(),g]:[i,g]);return b.useMemo(()=>{p.forEach((y,x)=>p.set(x,!1))},[i]),b.useEffect(()=>{!i&&!p.size&&o&&o()},[i]),d==="popLayout"&&(t=c.jsx(vE,{isPresent:i,children:t})),c.jsx(jc.Provider,{value:v,children:t})};function bE(){return new Map}function Ub(t=!0){const a=b.useContext(jc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:o,register:r}=a,u=b.useId();b.useEffect(()=>{t&&r(u)},[t]);const d=b.useCallback(()=>t&&o&&o(u),[u,o,t]);return!i&&o?[!1,d]:[!0]}const Kr=t=>t.key||"";function by(t){const a=[];return b.Children.forEach(t,i=>{b.isValidElement(i)&&a.push(i)}),a}const mh=typeof window<"u",zb=mh?b.useLayoutEffect:b.useEffect,Wn=({children:t,custom:a,initial:i=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:u="sync",propagate:d=!1})=>{const[p,m]=Ub(d),g=b.useMemo(()=>by(t),[t]),v=d&&!p?[]:g.map(Kr),y=b.useRef(!0),x=b.useRef(g),S=hh(()=>new Map),[T,E]=b.useState(g),[N,C]=b.useState(g);zb(()=>{y.current=!1,x.current=g;for(let R=0;R<N.length;R++){const w=Kr(N[R]);v.includes(w)?S.delete(w):S.get(w)!==!0&&S.set(w,!1)}},[N,v.length,v.join("-")]);const j=[];if(g!==T){let R=[...g];for(let w=0;w<N.length;w++){const G=N[w],z=Kr(G);v.includes(z)||(R.splice(w,0,G),j.push(G))}u==="wait"&&j.length&&(R=j),C(by(R)),E(g);return}const{forceRender:A}=b.useContext(fh);return c.jsx(c.Fragment,{children:N.map(R=>{const w=Kr(R),G=d&&!p?!1:g===N||v.includes(w),z=()=>{if(S.has(w))S.set(w,!0);else return;let O=!0;S.forEach($=>{$||(O=!1)}),O&&(A==null||A(),C(x.current),d&&(m==null||m()),o&&o())};return c.jsx(yE,{isPresent:G,initial:!y.current||i?void 0:!1,custom:G?void 0:a,presenceAffectsLayout:r,mode:u,onExitComplete:G?void 0:z,children:R},w)})})},hn=t=>t;let Vb=hn;const xE={useManualTiming:!1};function _E(t){let a=new Set,i=new Set,o=!1,r=!1;const u=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function p(g){u.has(g)&&(m.schedule(g),t()),g(d)}const m={schedule:(g,v=!1,y=!1)=>{const S=y&&o?a:i;return v&&u.add(g),S.has(g)||S.add(g),g},cancel:g=>{i.delete(g),u.delete(g)},process:g=>{if(d=g,o){r=!0;return}o=!0,[a,i]=[i,a],a.forEach(p),a.clear(),o=!1,r&&(r=!1,m.process(g))}};return m}const Yr=["read","resolveKeyframes","update","preRender","render","postRender"],SE=40;function Hb(t,a){let i=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},u=()=>i=!0,d=Yr.reduce((C,j)=>(C[j]=_E(u),C),{}),{read:p,resolveKeyframes:m,update:g,preRender:v,render:y,postRender:x}=d,S=()=>{const C=performance.now();i=!1,r.delta=o?1e3/60:Math.max(Math.min(C-r.timestamp,SE),1),r.timestamp=C,r.isProcessing=!0,p.process(r),m.process(r),g.process(r),v.process(r),y.process(r),x.process(r),r.isProcessing=!1,i&&a&&(o=!1,t(S))},T=()=>{i=!0,o=!0,r.isProcessing||t(S)};return{schedule:Yr.reduce((C,j)=>{const A=d[j];return C[j]=(R,w=!1,G=!1)=>(i||T(),A.schedule(R,w,G)),C},{}),cancel:C=>{for(let j=0;j<Yr.length;j++)d[Yr[j]].cancel(C)},state:r,steps:d}}const{schedule:ct,cancel:is,state:zt,steps:af}=Hb(typeof requestAnimationFrame<"u"?requestAnimationFrame:hn,!0),Pb=b.createContext({strict:!1}),xy={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 xy)Fi[t]={isEnabled:a=>xy[t].some(i=>!!a[i])};function TE(t){for(const a in t)Fi[a]={...Fi[a],...t[a]}}const kE=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 dc(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||kE.has(t)}let Gb=t=>!dc(t);function CE(t){t&&(Gb=a=>a.startsWith("on")?!dc(a):t(a))}try{CE(require("@emotion/is-prop-valid").default)}catch{}function EE(t,a,i){const o={};for(const r in t)r==="values"&&typeof t.values=="object"||(Gb(r)||i===!0&&dc(r)||!a&&!dc(r)||t.draggable&&r.startsWith("onDrag"))&&(o[r]=t[r]);return o}function NE(t){if(typeof Proxy>"u")return t;const a=new Map,i=(...o)=>t(...o);return new Proxy(i,{get:(o,r)=>r==="create"?t:(a.has(r)||a.set(r,t(r)),a.get(r))})}const wc=b.createContext({});function gl(t){return typeof t=="string"||Array.isArray(t)}function Ac(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const gh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vh=["initial",...gh];function Dc(t){return Ac(t.animate)||vh.some(a=>gl(t[a]))}function $b(t){return!!(Dc(t)||t.variants)}function jE(t,a){if(Dc(t)){const{initial:i,animate:o}=t;return{initial:i===!1||gl(i)?i:void 0,animate:gl(o)?o:void 0}}return t.inherit!==!1?a:{}}function wE(t){const{initial:a,animate:i}=jE(t,b.useContext(wc));return b.useMemo(()=>({initial:a,animate:i}),[_y(a),_y(i)])}function _y(t){return Array.isArray(t)?t.join(" "):t}const AE=Symbol.for("motionComponentSymbol");function Ii(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function DE(t,a,i){return b.useCallback(o=>{o&&t.onMount&&t.onMount(o),a&&(o?a.mount(o):a.unmount()),i&&(typeof i=="function"?i(o):Ii(i)&&(i.current=o))},[a])}const yh=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),RE="framerAppearId",Fb="data-"+yh(RE),{schedule:bh}=Hb(queueMicrotask,!1),qb=b.createContext({});function ME(t,a,i,o,r){var u,d;const{visualElement:p}=b.useContext(wc),m=b.useContext(Pb),g=b.useContext(jc),v=b.useContext(ph).reducedMotion,y=b.useRef(null);o=o||m.renderer,!y.current&&o&&(y.current=o(t,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:v}));const x=y.current,S=b.useContext(qb);x&&!x.projection&&r&&(x.type==="html"||x.type==="svg")&&OE(y.current,i,r,S);const T=b.useRef(!1);b.useInsertionEffect(()=>{x&&T.current&&x.update(i,g)});const E=i[Fb],N=b.useRef(!!E&&!(!((u=window.MotionHandoffIsComplete)===null||u===void 0)&&u.call(window,E))&&((d=window.MotionHasOptimisedAnimation)===null||d===void 0?void 0:d.call(window,E)));return zb(()=>{x&&(T.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),bh.render(x.render),N.current&&x.animationState&&x.animationState.animateChanges())}),b.useEffect(()=>{x&&(!N.current&&x.animationState&&x.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)===null||C===void 0||C.call(window,E)}),N.current=!1))}),x}function OE(t,a,i,o){const{layoutId:r,layout:u,drag:d,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;t.projection=new i(t.latestValues,a["data-framer-portal-id"]?void 0:Kb(t.parent)),t.projection.setOptions({layoutId:r,layout:u,alwaysMeasureLayout:!!d||p&&Ii(p),visualElement:t,animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:m,layoutRoot:g})}function Kb(t){if(t)return t.options.allowProjection!==!1?t.projection:Kb(t.parent)}function BE({preloadedFeatures:t,createVisualElement:a,useRender:i,useVisualState:o,Component:r}){var u,d;t&&TE(t);function p(g,v){let y;const x={...b.useContext(ph),...g,layoutId:IE(g)},{isStatic:S}=x,T=wE(g),E=o(g,S);if(!S&&mh){LE();const N=UE(x);y=N.MeasureLayout,T.visualElement=ME(r,E,x,a,N.ProjectionNode)}return c.jsxs(wc.Provider,{value:T,children:[y&&T.visualElement?c.jsx(y,{visualElement:T.visualElement,...x}):null,i(r,g,DE(E,T.visualElement,v),E,S,T.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(d=(u=r.displayName)!==null&&u!==void 0?u:r.name)!==null&&d!==void 0?d:""})`}`;const m=b.forwardRef(p);return m[AE]=r,m}function IE({layoutId:t}){const a=b.useContext(fh).id;return a&&t!==void 0?a+"-"+t:t}function LE(t,a){b.useContext(Pb).strict}function UE(t){const{drag:a,layout:i}=Fi;if(!a&&!i)return{};const o={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(t)||i!=null&&i.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const zE=["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 xh(t){return typeof t!="string"||t.includes("-")?!1:!!(zE.indexOf(t)>-1||/[A-Z]/u.test(t))}function Sy(t){const a=[{},{}];return t==null||t.values.forEach((i,o)=>{a[0][o]=i.get(),a[1][o]=i.getVelocity()}),a}function _h(t,a,i,o){if(typeof a=="function"){const[r,u]=Sy(o);a=a(i!==void 0?i:t.custom,r,u)}if(typeof a=="string"&&(a=t.variants&&t.variants[a]),typeof a=="function"){const[r,u]=Sy(o);a=a(i!==void 0?i:t.custom,r,u)}return a}const Df=t=>Array.isArray(t),VE=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),HE=t=>Df(t)?t[t.length-1]||0:t,Gt=t=>!!(t&&t.getVelocity);function ic(t){const a=Gt(t)?t.get():t;return VE(a)?a.toValue():a}function PE({scrapeMotionValuesFromProps:t,createRenderState:a,onUpdate:i},o,r,u){const d={latestValues:GE(o,r,u,t),renderState:a()};return i&&(d.onMount=p=>i({props:o,current:p,...d}),d.onUpdate=p=>i(p)),d}const Yb=t=>(a,i)=>{const o=b.useContext(wc),r=b.useContext(jc),u=()=>PE(t,a,o,r);return i?u():hh(u)};function GE(t,a,i,o){const r={},u=o(t,{});for(const x in u)r[x]=ic(u[x]);let{initial:d,animate:p}=t;const m=Dc(t),g=$b(t);a&&g&&!m&&t.inherit!==!1&&(d===void 0&&(d=a.initial),p===void 0&&(p=a.animate));let v=i?i.initial===!1:!1;v=v||d===!1;const y=v?p:d;if(y&&typeof y!="boolean"&&!Ac(y)){const x=Array.isArray(y)?y:[y];for(let S=0;S<x.length;S++){const T=_h(t,x[S]);if(T){const{transitionEnd:E,transition:N,...C}=T;for(const j in C){let A=C[j];if(Array.isArray(A)){const R=v?A.length-1:0;A=A[R]}A!==null&&(r[j]=A)}for(const j in E)r[j]=E[j]}}}return r}const Wi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Gs=new Set(Wi),Zb=t=>a=>typeof a=="string"&&a.startsWith(t),Xb=Zb("--"),$E=Zb("var(--"),Sh=t=>$E(t)?FE.test(t.split("/*")[0].trim()):!1,FE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Qb=(t,a)=>a&&typeof t=="number"?a.transform(t):t,Ca=(t,a,i)=>i>a?a:i<t?t:i,Ji={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},vl={...Ji,transform:t=>Ca(0,1,t)},Zr={...Ji,default:1},kl=t=>({test:a=>typeof a=="string"&&a.endsWith(t)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${t}`}),ts=kl("deg"),Xn=kl("%"),xe=kl("px"),qE=kl("vh"),KE=kl("vw"),Ty={...Xn,parse:t=>Xn.parse(t)/100,transform:t=>Xn.transform(t*100)},YE={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,backgroundPositionX:xe,backgroundPositionY:xe},ZE={rotate:ts,rotateX:ts,rotateY:ts,rotateZ:ts,scale:Zr,scaleX:Zr,scaleY:Zr,scaleZ:Zr,skew:ts,skewX:ts,skewY:ts,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:vl,originX:Ty,originY:Ty,originZ:xe},ky={...Ji,transform:Math.round},Th={...YE,...ZE,zIndex:ky,size:xe,fillOpacity:vl,strokeOpacity:vl,numOctaves:ky},XE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},QE=Wi.length;function WE(t,a,i){let o="",r=!0;for(let u=0;u<QE;u++){const d=Wi[u],p=t[d];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(d.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const g=Qb(p,Th[d]);if(!m){r=!1;const v=XE[d]||d;o+=`${v}(${g}) `}i&&(a[d]=g)}}return o=o.trim(),i?o=i(a,r?"":o):r&&(o="none"),o}function kh(t,a,i){const{style:o,vars:r,transformOrigin:u}=t;let d=!1,p=!1;for(const m in a){const g=a[m];if(Gs.has(m)){d=!0;continue}else if(Xb(m)){r[m]=g;continue}else{const v=Qb(g,Th[m]);m.startsWith("origin")?(p=!0,u[m]=v):o[m]=v}}if(a.transform||(d||i?o.transform=WE(a,t.transform,i):o.transform&&(o.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:v=0}=u;o.transformOrigin=`${m} ${g} ${v}`}}const JE={offset:"stroke-dashoffset",array:"stroke-dasharray"},eN={offset:"strokeDashoffset",array:"strokeDasharray"};function tN(t,a,i=1,o=0,r=!0){t.pathLength=1;const u=r?JE:eN;t[u.offset]=xe.transform(-o);const d=xe.transform(a),p=xe.transform(i);t[u.array]=`${d} ${p}`}function Cy(t,a,i){return typeof t=="string"?t:xe.transform(a+i*t)}function nN(t,a,i){const o=Cy(a,t.x,t.width),r=Cy(i,t.y,t.height);return`${o} ${r}`}function Ch(t,{attrX:a,attrY:i,attrScale:o,originX:r,originY:u,pathLength:d,pathSpacing:p=1,pathOffset:m=0,...g},v,y){if(kh(t,g,y),v){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:x,style:S,dimensions:T}=t;x.transform&&(T&&(S.transform=x.transform),delete x.transform),T&&(r!==void 0||u!==void 0||S.transform)&&(S.transformOrigin=nN(T,r!==void 0?r:.5,u!==void 0?u:.5)),a!==void 0&&(x.x=a),i!==void 0&&(x.y=i),o!==void 0&&(x.scale=o),d!==void 0&&tN(x,d,p,m,!1)}const Eh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Wb=()=>({...Eh(),attrs:{}}),Nh=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Jb(t,{style:a,vars:i},o,r){Object.assign(t.style,a,r&&r.getProjectionStyles(o));for(const u in i)t.style.setProperty(u,i[u])}const ex=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 tx(t,a,i,o){Jb(t,a,void 0,o);for(const r in a.attrs)t.setAttribute(ex.has(r)?r:yh(r),a.attrs[r])}const fc={};function aN(t){Object.assign(fc,t)}function nx(t,{layout:a,layoutId:i}){return Gs.has(t)||t.startsWith("origin")||(a||i!==void 0)&&(!!fc[t]||t==="opacity")}function jh(t,a,i){var o;const{style:r}=t,u={};for(const d in r)(Gt(r[d])||a.style&&Gt(a.style[d])||nx(d,t)||((o=i==null?void 0:i.getValue(d))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(u[d]=r[d]);return u}function ax(t,a,i){const o=jh(t,a,i);for(const r in t)if(Gt(t[r])||Gt(a[r])){const u=Wi.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[u]=t[r]}return o}function sN(t,a){try{a.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}}const Ey=["x","y","width","height","cx","cy","r"],iN={useVisualState:Yb({scrapeMotionValuesFromProps:ax,createRenderState:Wb,onUpdate:({props:t,prevProps:a,current:i,renderState:o,latestValues:r})=>{if(!i)return;let u=!!t.drag;if(!u){for(const p in r)if(Gs.has(p)){u=!0;break}}if(!u)return;let d=!a;if(a)for(let p=0;p<Ey.length;p++){const m=Ey[p];t[m]!==a[m]&&(d=!0)}d&&ct.read(()=>{sN(i,o),ct.render(()=>{Ch(o,r,Nh(i.tagName),t.transformTemplate),tx(i,o)})})}})},oN={useVisualState:Yb({scrapeMotionValuesFromProps:jh,createRenderState:Eh})};function sx(t,a,i){for(const o in a)!Gt(a[o])&&!nx(o,i)&&(t[o]=a[o])}function lN({transformTemplate:t},a){return b.useMemo(()=>{const i=Eh();return kh(i,a,t),Object.assign({},i.vars,i.style)},[a])}function rN(t,a){const i=t.style||{},o={};return sx(o,i,t),Object.assign(o,lN(t,a)),o}function cN(t,a){const i={},o=rN(t,a);return t.drag&&t.dragListener!==!1&&(i.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)&&(i.tabIndex=0),i.style=o,i}function uN(t,a,i,o){const r=b.useMemo(()=>{const u=Wb();return Ch(u,a,Nh(o),t.transformTemplate),{...u.attrs,style:{...u.style}}},[a]);if(t.style){const u={};sx(u,t.style,t),r.style={...u,...r.style}}return r}function dN(t=!1){return(i,o,r,{latestValues:u},d)=>{const m=(xh(i)?uN:cN)(o,u,d,i),g=EE(o,typeof i=="string",t),v=i!==b.Fragment?{...g,...m,ref:r}:{},{children:y}=o,x=b.useMemo(()=>Gt(y)?y.get():y,[y]);return b.createElement(i,{...v,children:x})}}function fN(t,a){return function(o,{forwardMotionProps:r}={forwardMotionProps:!1}){const d={...xh(o)?iN:oN,preloadedFeatures:t,useRender:dN(r),createVisualElement:a,Component:o};return BE(d)}}function ix(t,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==t.length)return!1;for(let o=0;o<i;o++)if(a[o]!==t[o])return!1;return!0}function Rc(t,a,i){const o=t.getProps();return _h(o,a,i!==void 0?i:o.custom,t)}function wh(t,a){return t?t[a]||t.default||t:void 0}const ox=new Set(["width","height","top","left","right","bottom",...Wi]);let oc;function hN(){oc=void 0}const Qn={now:()=>(oc===void 0&&Qn.set(zt.isProcessing||xE.useManualTiming?zt.timestamp:performance.now()),oc),set:t=>{oc=t,queueMicrotask(hN)}};function Ah(t,a){t.indexOf(a)===-1&&t.push(a)}function Dh(t,a){const i=t.indexOf(a);i>-1&&t.splice(i,1)}class Rh{constructor(){this.subscriptions=[]}add(a){return Ah(this.subscriptions,a),()=>Dh(this.subscriptions,a)}notify(a,i,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,o);else for(let u=0;u<r;u++){const d=this.subscriptions[u];d&&d(a,i,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function lx(t,a){return a?t*(1e3/a):0}const Ny=30,pN=t=>!isNaN(parseFloat(t));class mN{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,r=!0)=>{const u=Qn.now();this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=Qn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=pN(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,i){this.events[a]||(this.events[a]=new Rh);const o=this.events[a].add(i);return a==="change"?()=>{o(),ct.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,i){this.passiveEffect=a,this.stopPassiveEffect=i}set(a,i=!0){!i||!this.passiveEffect?this.updateAndNotify(a,i):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,i,o){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-o}jump(a,i=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=Qn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>Ny)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Ny);return lx(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(a){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=a(i),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 yl(t,a){return new mN(t,a)}function gN(t,a,i){t.hasValue(a)?t.getValue(a).set(i):t.addValue(a,yl(i))}function vN(t,a){const i=Rc(t,a);let{transitionEnd:o={},transition:r={},...u}=i||{};u={...u,...o};for(const d in u){const p=HE(u[d]);gN(t,d,p)}}function yN(t){return!!(Gt(t)&&t.add)}function Rf(t,a){const i=t.getValue("willChange");if(yN(i))return i.add(a)}function rx(t){return t.props[Fb]}function Mh(t){let a;return()=>(a===void 0&&(a=t()),a)}const bN=Mh(()=>window.ScrollTimeline!==void 0);class xN{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}get finished(){return Promise.all(this.animations.map(a=>"finished"in a?a.finished:a))}getAll(a){return this.animations[0][a]}setAll(a,i){for(let o=0;o<this.animations.length;o++)this.animations[o][a]=i}attachTimeline(a,i){const o=this.animations.map(r=>{if(bN()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{o.forEach((r,u)=>{r&&r(),this.animations[u].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let i=0;i<this.animations.length;i++)a=Math.max(a,this.animations[i].duration);return a}runAll(a){this.animations.forEach(i=>i[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class _N extends xN{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const _a=t=>t*1e3,Sa=t=>t/1e3;function Oh(t){return typeof t=="function"}function jy(t,a){t.timeline=a,t.onfinish=null}const Bh=t=>Array.isArray(t)&&typeof t[0]=="number",SN={linearEasing:void 0};function TN(t,a){const i=Mh(t);return()=>{var o;return(o=SN[a])!==null&&o!==void 0?o:i()}}const hc=TN(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),qi=(t,a,i)=>{const o=a-t;return o===0?1:(i-t)/o},cx=(t,a,i=10)=>{let o="";const r=Math.max(Math.round(a/i),2);for(let u=0;u<r;u++)o+=t(qi(0,r-1,u))+", ";return`linear(${o.substring(0,o.length-2)})`};function ux(t){return!!(typeof t=="function"&&hc()||!t||typeof t=="string"&&(t in Mf||hc())||Bh(t)||Array.isArray(t)&&t.every(ux))}const tl=([t,a,i,o])=>`cubic-bezier(${t}, ${a}, ${i}, ${o})`,Mf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tl([0,.65,.55,1]),circOut:tl([.55,0,1,.45]),backIn:tl([.31,.01,.66,-.59]),backOut:tl([.33,1.53,.69,.99])};function dx(t,a){if(t)return typeof t=="function"&&hc()?cx(t,a):Bh(t)?tl(t):Array.isArray(t)?t.map(i=>dx(i,a)||Mf.easeOut):Mf[t]}const fx=(t,a,i)=>(((1-3*i+3*a)*t+(3*i-6*a))*t+3*a)*t,kN=1e-7,CN=12;function EN(t,a,i,o,r){let u,d,p=0;do d=a+(i-a)/2,u=fx(d,o,r)-t,u>0?i=d:a=d;while(Math.abs(u)>kN&&++p<CN);return d}function Cl(t,a,i,o){if(t===a&&i===o)return hn;const r=u=>EN(u,0,1,t,i);return u=>u===0||u===1?u:fx(r(u),a,o)}const hx=t=>a=>a<=.5?t(2*a)/2:(2-t(2*(1-a)))/2,px=t=>a=>1-t(1-a),mx=Cl(.33,1.53,.69,.99),Ih=px(mx),gx=hx(Ih),vx=t=>(t*=2)<1?.5*Ih(t):.5*(2-Math.pow(2,-10*(t-1))),Lh=t=>1-Math.sin(Math.acos(t)),yx=px(Lh),bx=hx(Lh),xx=t=>/^0[^.\s]+$/u.test(t);function NN(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||xx(t):!0}const rl=t=>Math.round(t*1e5)/1e5,Uh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jN(t){return t==null}const wN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zh=(t,a)=>i=>!!(typeof i=="string"&&wN.test(i)&&i.startsWith(t)||a&&!jN(i)&&Object.prototype.hasOwnProperty.call(i,a)),_x=(t,a,i)=>o=>{if(typeof o!="string")return o;const[r,u,d,p]=o.match(Uh);return{[t]:parseFloat(r),[a]:parseFloat(u),[i]:parseFloat(d),alpha:p!==void 0?parseFloat(p):1}},AN=t=>Ca(0,255,t),sf={...Ji,transform:t=>Math.round(AN(t))},Is={test:zh("rgb","red"),parse:_x("red","green","blue"),transform:({red:t,green:a,blue:i,alpha:o=1})=>"rgba("+sf.transform(t)+", "+sf.transform(a)+", "+sf.transform(i)+", "+rl(vl.transform(o))+")"};function DN(t){let a="",i="",o="",r="";return t.length>5?(a=t.substring(1,3),i=t.substring(3,5),o=t.substring(5,7),r=t.substring(7,9)):(a=t.substring(1,2),i=t.substring(2,3),o=t.substring(3,4),r=t.substring(4,5),a+=a,i+=i,o+=o,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const Of={test:zh("#"),parse:DN,transform:Is.transform},Li={test:zh("hsl","hue"),parse:_x("hue","saturation","lightness"),transform:({hue:t,saturation:a,lightness:i,alpha:o=1})=>"hsla("+Math.round(t)+", "+Xn.transform(rl(a))+", "+Xn.transform(rl(i))+", "+rl(vl.transform(o))+")"},Pt={test:t=>Is.test(t)||Of.test(t)||Li.test(t),parse:t=>Is.test(t)?Is.parse(t):Li.test(t)?Li.parse(t):Of.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Is.transform(t):Li.transform(t)},RN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function MN(t){var a,i;return isNaN(t)&&typeof t=="string"&&(((a=t.match(Uh))===null||a===void 0?void 0:a.length)||0)+(((i=t.match(RN))===null||i===void 0?void 0:i.length)||0)>0}const Sx="number",Tx="color",ON="var",BN="var(",wy="${}",IN=/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 bl(t){const a=t.toString(),i=[],o={color:[],number:[],var:[]},r=[];let u=0;const p=a.replace(IN,m=>(Pt.test(m)?(o.color.push(u),r.push(Tx),i.push(Pt.parse(m))):m.startsWith(BN)?(o.var.push(u),r.push(ON),i.push(m)):(o.number.push(u),r.push(Sx),i.push(parseFloat(m))),++u,wy)).split(wy);return{values:i,split:p,indexes:o,types:r}}function kx(t){return bl(t).values}function Cx(t){const{split:a,types:i}=bl(t),o=a.length;return r=>{let u="";for(let d=0;d<o;d++)if(u+=a[d],r[d]!==void 0){const p=i[d];p===Sx?u+=rl(r[d]):p===Tx?u+=Pt.transform(r[d]):u+=r[d]}return u}}const LN=t=>typeof t=="number"?0:t;function UN(t){const a=kx(t);return Cx(t)(a.map(LN))}const os={test:MN,parse:kx,createTransformer:Cx,getAnimatableNone:UN},zN=new Set(["brightness","contrast","saturate","opacity"]);function VN(t){const[a,i]=t.slice(0,-1).split("(");if(a==="drop-shadow")return t;const[o]=i.match(Uh)||[];if(!o)return t;const r=i.replace(o,"");let u=zN.has(a)?1:0;return o!==i&&(u*=100),a+"("+u+r+")"}const HN=/\b([a-z-]*)\(.*?\)/gu,Bf={...os,getAnimatableNone:t=>{const a=t.match(HN);return a?a.map(VN).join(" "):t}},PN={...Th,color:Pt,backgroundColor:Pt,outlineColor:Pt,fill:Pt,stroke:Pt,borderColor:Pt,borderTopColor:Pt,borderRightColor:Pt,borderBottomColor:Pt,borderLeftColor:Pt,filter:Bf,WebkitFilter:Bf},Vh=t=>PN[t];function Ex(t,a){let i=Vh(t);return i!==Bf&&(i=os),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const GN=new Set(["auto","none","0"]);function $N(t,a,i){let o=0,r;for(;o<t.length&&!r;){const u=t[o];typeof u=="string"&&!GN.has(u)&&bl(u).values.length&&(r=t[o]),o++}if(r&&i)for(const u of a)t[u]=Ex(i,r)}const Ay=t=>t===Ji||t===xe,Dy=(t,a)=>parseFloat(t.split(", ")[a]),Ry=(t,a)=>(i,{transform:o})=>{if(o==="none"||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/u);if(r)return Dy(r[1],a);{const u=o.match(/^matrix\((.+)\)$/u);return u?Dy(u[1],t):0}},FN=new Set(["x","y","z"]),qN=Wi.filter(t=>!FN.has(t));function KN(t){const a=[];return qN.forEach(i=>{const o=t.getValue(i);o!==void 0&&(a.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),a}const Ki={width:({x:t},{paddingLeft:a="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(a)-parseFloat(i),height:({y:t},{paddingTop:a="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(a)-parseFloat(i),top:(t,{top:a})=>parseFloat(a),left:(t,{left:a})=>parseFloat(a),bottom:({y:t},{top:a})=>parseFloat(a)+(t.max-t.min),right:({x:t},{left:a})=>parseFloat(a)+(t.max-t.min),x:Ry(4,13),y:Ry(5,14)};Ki.translateX=Ki.x;Ki.translateY=Ki.y;const Ls=new Set;let If=!1,Lf=!1;function Nx(){if(Lf){const t=Array.from(Ls).filter(o=>o.needsMeasurement),a=new Set(t.map(o=>o.element)),i=new Map;a.forEach(o=>{const r=KN(o);r.length&&(i.set(o,r),o.render())}),t.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const r=i.get(o);r&&r.forEach(([u,d])=>{var p;(p=o.getValue(u))===null||p===void 0||p.set(d)})}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}Lf=!1,If=!1,Ls.forEach(t=>t.complete()),Ls.clear()}function jx(){Ls.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Lf=!0)})}function YN(){jx(),Nx()}class Hh{constructor(a,i,o,r,u,d=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=o,this.motionValue=r,this.element=u,this.isAsync=d}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ls.add(this),If||(If=!0,ct.read(jx),ct.resolveKeyframes(Nx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:o,motionValue:r}=this;for(let u=0;u<a.length;u++)if(a[u]===null)if(u===0){const d=r==null?void 0:r.get(),p=a[a.length-1];if(d!==void 0)a[0]=d;else if(o&&i){const m=o.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),r&&d===void 0&&r.set(a[0])}else a[u]=a[u-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ls.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ls.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const wx=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ZN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function XN(t){const a=ZN.exec(t);if(!a)return[,];const[,i,o,r]=a;return[`--${i??o}`,r]}function Ax(t,a,i=1){const[o,r]=XN(t);if(!o)return;const u=window.getComputedStyle(a).getPropertyValue(o);if(u){const d=u.trim();return wx(d)?parseFloat(d):d}return Sh(r)?Ax(r,a,i+1):r}const Dx=t=>a=>a.test(t),QN={test:t=>t==="auto",parse:t=>t},Rx=[Ji,xe,Xn,ts,KE,qE,QN],My=t=>Rx.find(Dx(t));class Mx extends Hh{constructor(a,i,o,r,u){super(a,i,o,r,u,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:o}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<a.length;m++){let g=a[m];if(typeof g=="string"&&(g=g.trim(),Sh(g))){const v=Ax(g,i.current);v!==void 0&&(a[m]=v),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!ox.has(o)||a.length!==2)return;const[r,u]=a,d=My(r),p=My(u);if(d!==p)if(Ay(d)&&Ay(p))for(let m=0;m<a.length;m++){const g=a[m];typeof g=="string"&&(a[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,o=[];for(let r=0;r<a.length;r++)NN(a[r])&&o.push(r);o.length&&$N(a,o,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:o}=this;if(!a||!a.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ki[o](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&a.getValue(o,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:o,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const u=i.getValue(o);u&&u.jump(this.measuredOrigin,!1);const d=r.length-1,p=r[d];r[d]=Ki[o](i.measureViewportBox(),window.getComputedStyle(i.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([m,g])=>{i.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const Oy=(t,a)=>a==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(os.test(t)||t==="0")&&!t.startsWith("url("));function WN(t){const a=t[0];if(t.length===1)return!0;for(let i=0;i<t.length;i++)if(t[i]!==a)return!0}function JN(t,a,i,o){const r=t[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const u=t[t.length-1],d=Oy(r,a),p=Oy(u,a);return!d||!p?!1:WN(t)||(i==="spring"||Oh(i))&&o}const ej=t=>t!==null;function Mc(t,{repeat:a,repeatType:i="loop"},o){const r=t.filter(ej),u=a&&i!=="loop"&&a%2===1?0:r.length-1;return!u||o===void 0?r[u]:o}const tj=40;class Ox{constructor({autoplay:a=!0,delay:i=0,type:o="keyframes",repeat:r=0,repeatDelay:u=0,repeatType:d="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Qn.now(),this.options={autoplay:a,delay:i,type:o,repeat:r,repeatDelay:u,repeatType:d,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>tj?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&YN(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Qn.now(),this.hasAttemptedResolve=!0;const{name:o,type:r,velocity:u,delay:d,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!JN(a,o,r,u))if(d)this.options.duration=0;else{m&&m(Mc(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const v=this.initPlayback(a,i);v!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...v},this.onPostResolved())}onPostResolved(){}then(a,i){return this.currentFinishedPromise.then(a,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const Uf=2e4;function Bx(t){let a=0;const i=50;let o=t.next(a);for(;!o.done&&a<Uf;)a+=i,o=t.next(a);return a>=Uf?1/0:a}const ht=(t,a,i)=>t+(a-t)*i;function of(t,a,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+(a-t)*6*i:i<1/2?a:i<2/3?t+(a-t)*(2/3-i)*6:t}function nj({hue:t,saturation:a,lightness:i,alpha:o}){t/=360,a/=100,i/=100;let r=0,u=0,d=0;if(!a)r=u=d=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=of(m,p,t+1/3),u=of(m,p,t),d=of(m,p,t-1/3)}return{red:Math.round(r*255),green:Math.round(u*255),blue:Math.round(d*255),alpha:o}}function pc(t,a){return i=>i>0?a:t}const lf=(t,a,i)=>{const o=t*t,r=i*(a*a-o)+o;return r<0?0:Math.sqrt(r)},aj=[Of,Is,Li],sj=t=>aj.find(a=>a.test(t));function By(t){const a=sj(t);if(!a)return!1;let i=a.parse(t);return a===Li&&(i=nj(i)),i}const Iy=(t,a)=>{const i=By(t),o=By(a);if(!i||!o)return pc(t,a);const r={...i};return u=>(r.red=lf(i.red,o.red,u),r.green=lf(i.green,o.green,u),r.blue=lf(i.blue,o.blue,u),r.alpha=ht(i.alpha,o.alpha,u),Is.transform(r))},ij=(t,a)=>i=>a(t(i)),El=(...t)=>t.reduce(ij),zf=new Set(["none","hidden"]);function oj(t,a){return zf.has(t)?i=>i<=0?t:a:i=>i>=1?a:t}function lj(t,a){return i=>ht(t,a,i)}function Ph(t){return typeof t=="number"?lj:typeof t=="string"?Sh(t)?pc:Pt.test(t)?Iy:uj:Array.isArray(t)?Ix:typeof t=="object"?Pt.test(t)?Iy:rj:pc}function Ix(t,a){const i=[...t],o=i.length,r=t.map((u,d)=>Ph(u)(u,a[d]));return u=>{for(let d=0;d<o;d++)i[d]=r[d](u);return i}}function rj(t,a){const i={...t,...a},o={};for(const r in i)t[r]!==void 0&&a[r]!==void 0&&(o[r]=Ph(t[r])(t[r],a[r]));return r=>{for(const u in o)i[u]=o[u](r);return i}}function cj(t,a){var i;const o=[],r={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const d=a.types[u],p=t.indexes[d][r[d]],m=(i=t.values[p])!==null&&i!==void 0?i:0;o[u]=m,r[d]++}return o}const uj=(t,a)=>{const i=os.createTransformer(a),o=bl(t),r=bl(a);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?zf.has(t)&&!r.values.length||zf.has(a)&&!o.values.length?oj(t,a):El(Ix(cj(o,r),r.values),i):pc(t,a)};function Lx(t,a,i){return typeof t=="number"&&typeof a=="number"&&typeof i=="number"?ht(t,a,i):Ph(t)(t,a)}const dj=5;function Ux(t,a,i){const o=Math.max(a-dj,0);return lx(i-t(o),a-o)}const gt={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},rf=.001;function fj({duration:t=gt.duration,bounce:a=gt.bounce,velocity:i=gt.velocity,mass:o=gt.mass}){let r,u,d=1-a;d=Ca(gt.minDamping,gt.maxDamping,d),t=Ca(gt.minDuration,gt.maxDuration,Sa(t)),d<1?(r=g=>{const v=g*d,y=v*t,x=v-i,S=Vf(g,d),T=Math.exp(-y);return rf-x/S*T},u=g=>{const y=g*d*t,x=y*i+i,S=Math.pow(d,2)*Math.pow(g,2)*t,T=Math.exp(-y),E=Vf(Math.pow(g,2),d);return(-r(g)+rf>0?-1:1)*((x-S)*T)/E}):(r=g=>{const v=Math.exp(-g*t),y=(g-i)*t+1;return-rf+v*y},u=g=>{const v=Math.exp(-g*t),y=(i-g)*(t*t);return v*y});const p=5/t,m=pj(r,u,p);if(t=_a(t),isNaN(m))return{stiffness:gt.stiffness,damping:gt.damping,duration:t};{const g=Math.pow(m,2)*o;return{stiffness:g,damping:d*2*Math.sqrt(o*g),duration:t}}}const hj=12;function pj(t,a,i){let o=i;for(let r=1;r<hj;r++)o=o-t(o)/a(o);return o}function Vf(t,a){return t*Math.sqrt(1-a*a)}const mj=["duration","bounce"],gj=["stiffness","damping","mass"];function Ly(t,a){return a.some(i=>t[i]!==void 0)}function vj(t){let a={velocity:gt.velocity,stiffness:gt.stiffness,damping:gt.damping,mass:gt.mass,isResolvedFromDuration:!1,...t};if(!Ly(t,gj)&&Ly(t,mj))if(t.visualDuration){const i=t.visualDuration,o=2*Math.PI/(i*1.2),r=o*o,u=2*Ca(.05,1,1-(t.bounce||0))*Math.sqrt(r);a={...a,mass:gt.mass,stiffness:r,damping:u}}else{const i=fj(t);a={...a,...i,mass:gt.mass},a.isResolvedFromDuration=!0}return a}function zx(t=gt.visualDuration,a=gt.bounce){const i=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:a}:t;let{restSpeed:o,restDelta:r}=i;const u=i.keyframes[0],d=i.keyframes[i.keyframes.length-1],p={done:!1,value:u},{stiffness:m,damping:g,mass:v,duration:y,velocity:x,isResolvedFromDuration:S}=vj({...i,velocity:-Sa(i.velocity||0)}),T=x||0,E=g/(2*Math.sqrt(m*v)),N=d-u,C=Sa(Math.sqrt(m/v)),j=Math.abs(N)<5;o||(o=j?gt.restSpeed.granular:gt.restSpeed.default),r||(r=j?gt.restDelta.granular:gt.restDelta.default);let A;if(E<1){const w=Vf(C,E);A=G=>{const z=Math.exp(-E*C*G);return d-z*((T+E*C*N)/w*Math.sin(w*G)+N*Math.cos(w*G))}}else if(E===1)A=w=>d-Math.exp(-C*w)*(N+(T+C*N)*w);else{const w=C*Math.sqrt(E*E-1);A=G=>{const z=Math.exp(-E*C*G),O=Math.min(w*G,300);return d-z*((T+E*C*N)*Math.sinh(O)+w*N*Math.cosh(O))/w}}const R={calculatedDuration:S&&y||null,next:w=>{const G=A(w);if(S)p.done=w>=y;else{let z=0;E<1&&(z=w===0?_a(T):Ux(A,w,G));const O=Math.abs(z)<=o,$=Math.abs(d-G)<=r;p.done=O&&$}return p.value=p.done?d:G,p},toString:()=>{const w=Math.min(Bx(R),Uf),G=cx(z=>R.next(w*z).value,w,30);return w+"ms "+G}};return R}function Uy({keyframes:t,velocity:a=0,power:i=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:u=500,modifyTarget:d,min:p,max:m,restDelta:g=.5,restSpeed:v}){const y=t[0],x={done:!1,value:y},S=O=>p!==void 0&&O<p||m!==void 0&&O>m,T=O=>p===void 0?m:m===void 0||Math.abs(p-O)<Math.abs(m-O)?p:m;let E=i*a;const N=y+E,C=d===void 0?N:d(N);C!==N&&(E=C-y);const j=O=>-E*Math.exp(-O/o),A=O=>C+j(O),R=O=>{const $=j(O),J=A(O);x.done=Math.abs($)<=g,x.value=x.done?C:J};let w,G;const z=O=>{S(x.value)&&(w=O,G=zx({keyframes:[x.value,T(x.value)],velocity:Ux(A,O,x.value),damping:r,stiffness:u,restDelta:g,restSpeed:v}))};return z(0),{calculatedDuration:null,next:O=>{let $=!1;return!G&&w===void 0&&($=!0,R(O),z(O)),w!==void 0&&O>=w?G.next(O-w):(!$&&R(O),x)}}}const yj=Cl(.42,0,1,1),bj=Cl(0,0,.58,1),Vx=Cl(.42,0,.58,1),xj=t=>Array.isArray(t)&&typeof t[0]!="number",_j={linear:hn,easeIn:yj,easeInOut:Vx,easeOut:bj,circIn:Lh,circInOut:bx,circOut:yx,backIn:Ih,backInOut:gx,backOut:mx,anticipate:vx},zy=t=>{if(Bh(t)){Vb(t.length===4);const[a,i,o,r]=t;return Cl(a,i,o,r)}else if(typeof t=="string")return _j[t];return t};function Sj(t,a,i){const o=[],r=i||Lx,u=t.length-1;for(let d=0;d<u;d++){let p=r(t[d],t[d+1]);if(a){const m=Array.isArray(a)?a[d]||hn:a;p=El(m,p)}o.push(p)}return o}function Tj(t,a,{clamp:i=!0,ease:o,mixer:r}={}){const u=t.length;if(Vb(u===a.length),u===1)return()=>a[0];if(u===2&&a[0]===a[1])return()=>a[1];const d=t[0]===t[1];t[0]>t[u-1]&&(t=[...t].reverse(),a=[...a].reverse());const p=Sj(a,o,r),m=p.length,g=v=>{if(d&&v<t[0])return a[0];let y=0;if(m>1)for(;y<t.length-2&&!(v<t[y+1]);y++);const x=qi(t[y],t[y+1],v);return p[y](x)};return i?v=>g(Ca(t[0],t[u-1],v)):g}function kj(t,a){const i=t[t.length-1];for(let o=1;o<=a;o++){const r=qi(0,a,o);t.push(ht(i,1,r))}}function Cj(t){const a=[0];return kj(a,t.length-1),a}function Ej(t,a){return t.map(i=>i*a)}function Nj(t,a){return t.map(()=>a||Vx).splice(0,t.length-1)}function mc({duration:t=300,keyframes:a,times:i,ease:o="easeInOut"}){const r=xj(o)?o.map(zy):zy(o),u={done:!1,value:a[0]},d=Ej(i&&i.length===a.length?i:Cj(a),t),p=Tj(d,a,{ease:Array.isArray(r)?r:Nj(a,r)});return{calculatedDuration:t,next:m=>(u.value=p(m),u.done=m>=t,u)}}const jj=t=>{const a=({timestamp:i})=>t(i);return{start:()=>ct.update(a,!0),stop:()=>is(a),now:()=>zt.isProcessing?zt.timestamp:Qn.now()}},wj={decay:Uy,inertia:Uy,tween:mc,keyframes:mc,spring:zx},Aj=t=>t/100;class Gh extends Ox{constructor(a){super(a),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:i,motionValue:o,element:r,keyframes:u}=this.options,d=(r==null?void 0:r.KeyframeResolver)||Hh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new d(u,p,i,o,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:o=0,repeatDelay:r=0,repeatType:u,velocity:d=0}=this.options,p=Oh(i)?i:wj[i]||mc;let m,g;p!==mc&&typeof a[0]!="number"&&(m=El(Aj,Lx(a[0],a[1])),a=[0,100]);const v=p({...this.options,keyframes:a});u==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-d})),v.calculatedDuration===null&&(v.calculatedDuration=Bx(v));const{calculatedDuration:y}=v,x=y+r,S=x*(o+1)-r;return{generator:v,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:y,resolvedDuration:x,totalDuration:S}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,i=!1){const{resolved:o}=this;if(!o){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:r,generator:u,mirroredGenerator:d,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:v,resolvedDuration:y}=o;if(this.startTime===null)return u.next(0);const{delay:x,repeat:S,repeatType:T,repeatDelay:E,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-v/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const C=this.currentTime-x*(this.speed>=0?1:-1),j=this.speed>=0?C<0:C>v;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=v);let A=this.currentTime,R=u;if(S){const O=Math.min(this.currentTime,v)/y;let $=Math.floor(O),J=O%1;!J&&O>=1&&(J=1),J===1&&$--,$=Math.min($,S+1),!!($%2)&&(T==="reverse"?(J=1-J,E&&(J-=E/y)):T==="mirror"&&(R=d)),A=Ca(0,1,J)*y}const w=j?{done:!1,value:m[0]}:R.next(A);p&&(w.value=p(w.value));let{done:G}=w;!j&&g!==null&&(G=this.speed>=0?this.currentTime>=v:this.currentTime<=0);const z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&G);return z&&r!==void 0&&(w.value=Mc(m,this.options,r)),N&&N(w.value),z&&this.finish(),w}get duration(){const{resolved:a}=this;return a?Sa(a.calculatedDuration):0}get time(){return Sa(this.currentTime)}set time(a){a=_a(a),this.currentTime=a,this.holdTime!==null||this.speed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.speed)}get speed(){return this.playbackSpeed}set speed(a){const i=this.playbackSpeed!==a;this.playbackSpeed=a,i&&(this.time=Sa(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=jj,onPlay:i,startTime:o}=this.options;this.driver||(this.driver=a(u=>this.tick(u))),i&&i();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):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 a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}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(a){return this.startTime=0,this.tick(a,!0)}}const Dj=new Set(["opacity","clipPath","filter","transform"]);function Rj(t,a,i,{delay:o=0,duration:r=300,repeat:u=0,repeatType:d="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const v=dx(p,r);return Array.isArray(v)&&(g.easing=v),t.animate(g,{delay:o,duration:r,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:u+1,direction:d==="reverse"?"alternate":"normal"})}const Mj=Mh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),gc=10,Oj=2e4;function Bj(t){return Oh(t.type)||t.type==="spring"||!ux(t.ease)}function Ij(t,a){const i=new Gh({...a,keyframes:t,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:t[0]};const r=[];let u=0;for(;!o.done&&u<Oj;)o=i.sample(u),r.push(o.value),u+=gc;return{times:void 0,keyframes:r,duration:u-gc,ease:"linear"}}const Hx={anticipate:vx,backInOut:gx,circInOut:bx};function Lj(t){return t in Hx}class Vy extends Ox{constructor(a){super(a);const{name:i,motionValue:o,element:r,keyframes:u}=this.options;this.resolver=new Mx(u,(d,p)=>this.onKeyframesResolved(d,p),i,o,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:o=300,times:r,ease:u,type:d,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof u=="string"&&hc()&&Lj(u)&&(u=Hx[u]),Bj(this.options)){const{onComplete:y,onUpdate:x,motionValue:S,element:T,...E}=this.options,N=Ij(a,E);a=N.keyframes,a.length===1&&(a[1]=a[0]),o=N.duration,r=N.times,u=N.ease,d="keyframes"}const v=Rj(p.owner.current,m,a,{...this.options,duration:o,times:r,ease:u});return v.startTime=g??this.calcStartTime(),this.pendingTimeline?(jy(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:y}=this.options;p.set(Mc(a,this.options,i)),y&&y(),this.cancel(),this.resolveFinishedPromise()},{animation:v,duration:o,times:r,type:d,ease:u,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return Sa(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return Sa(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.currentTime=_a(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:i}=a;return i.playbackRate}set speed(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:i}=a;return i.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:i}=a;return i.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:i}=this;if(!i)return hn;const{animation:o}=i;jy(o,a)}return hn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:i,keyframes:o,duration:r,type:u,ease:d,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:v,onComplete:y,element:x,...S}=this.options,T=new Gh({...S,keyframes:o,duration:r,type:u,ease:d,times:p,isGenerator:!0}),E=_a(this.time);g.setWithVelocity(T.sample(E-gc).value,T.sample(E).value,gc)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:o,repeatDelay:r,repeatType:u,damping:d,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=i.owner.getProps();return Mj()&&o&&Dj.has(o)&&!m&&!g&&!r&&u!=="mirror"&&d!==0&&p!=="inertia"}}const Uj={type:"spring",stiffness:500,damping:25,restSpeed:10},zj=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Vj={type:"keyframes",duration:.8},Hj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Pj=(t,{keyframes:a})=>a.length>2?Vj:Gs.has(t)?t.startsWith("scale")?zj(a[1]):Uj:Hj;function Gj({when:t,delay:a,delayChildren:i,staggerChildren:o,staggerDirection:r,repeat:u,repeatType:d,repeatDelay:p,from:m,elapsed:g,...v}){return!!Object.keys(v).length}const $h=(t,a,i,o={},r,u)=>d=>{const p=wh(o,t)||{},m=p.delay||o.delay||0;let{elapsed:g=0}=o;g=g-_a(m);let v={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-g,onUpdate:x=>{a.set(x),p.onUpdate&&p.onUpdate(x)},onComplete:()=>{d(),p.onComplete&&p.onComplete()},name:t,motionValue:a,element:u?void 0:r};Gj(p)||(v={...v,...Pj(t,v)}),v.duration&&(v.duration=_a(v.duration)),v.repeatDelay&&(v.repeatDelay=_a(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let y=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(v.duration=0,v.delay===0&&(y=!0)),y&&!u&&a.get()!==void 0){const x=Mc(v.keyframes,p);if(x!==void 0)return ct.update(()=>{v.onUpdate(x),v.onComplete()}),new _N([])}return!u&&Vy.supports(v)?new Vy(v):new Gh(v)};function $j({protectedKeys:t,needsAnimating:a},i){const o=t.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,o}function Px(t,a,{delay:i=0,transitionOverride:o,type:r}={}){var u;let{transition:d=t.getDefaultTransition(),transitionEnd:p,...m}=a;o&&(d=o);const g=[],v=r&&t.animationState&&t.animationState.getState()[r];for(const y in m){const x=t.getValue(y,(u=t.latestValues[y])!==null&&u!==void 0?u:null),S=m[y];if(S===void 0||v&&$j(v,y))continue;const T={delay:i,...wh(d||{},y)};let E=!1;if(window.MotionHandoffAnimation){const C=rx(t);if(C){const j=window.MotionHandoffAnimation(C,y,ct);j!==null&&(T.startTime=j,E=!0)}}Rf(t,y),x.start($h(y,x,S,t.shouldReduceMotion&&ox.has(y)?{type:!1}:T,t,E));const N=x.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{ct.update(()=>{p&&vN(t,p)})}),g}function Hf(t,a,i={}){var o;const r=Rc(t,a,i.type==="exit"?(o=t.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:u=t.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(u=i.transitionOverride);const d=r?()=>Promise.all(Px(t,r,i)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(g=0)=>{const{delayChildren:v=0,staggerChildren:y,staggerDirection:x}=u;return Fj(t,a,v+g,y,x,i)}:()=>Promise.resolve(),{when:m}=u;if(m){const[g,v]=m==="beforeChildren"?[d,p]:[p,d];return g().then(()=>v())}else return Promise.all([d(),p(i.delay)])}function Fj(t,a,i=0,o=0,r=1,u){const d=[],p=(t.variantChildren.size-1)*o,m=r===1?(g=0)=>g*o:(g=0)=>p-g*o;return Array.from(t.variantChildren).sort(qj).forEach((g,v)=>{g.notify("AnimationStart",a),d.push(Hf(g,a,{...u,delay:i+m(v)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(d)}function qj(t,a){return t.sortNodePosition(a)}function Kj(t,a,i={}){t.notify("AnimationStart",a);let o;if(Array.isArray(a)){const r=a.map(u=>Hf(t,u,i));o=Promise.all(r)}else if(typeof a=="string")o=Hf(t,a,i);else{const r=typeof a=="function"?Rc(t,a,i.custom):a;o=Promise.all(Px(t,r,i))}return o.then(()=>{t.notify("AnimationComplete",a)})}const Yj=vh.length;function Gx(t){if(!t)return;if(!t.isControllingVariants){const i=t.parent?Gx(t.parent)||{}:{};return t.props.initial!==void 0&&(i.initial=t.props.initial),i}const a={};for(let i=0;i<Yj;i++){const o=vh[i],r=t.props[o];(gl(r)||r===!1)&&(a[o]=r)}return a}const Zj=[...gh].reverse(),Xj=gh.length;function Qj(t){return a=>Promise.all(a.map(({animation:i,options:o})=>Kj(t,i,o)))}function Wj(t){let a=Qj(t),i=Hy(),o=!0;const r=m=>(g,v)=>{var y;const x=Rc(t,v,m==="exit"?(y=t.presenceContext)===null||y===void 0?void 0:y.custom:void 0);if(x){const{transition:S,transitionEnd:T,...E}=x;g={...g,...E,...T}}return g};function u(m){a=m(t)}function d(m){const{props:g}=t,v=Gx(t.parent)||{},y=[],x=new Set;let S={},T=1/0;for(let N=0;N<Xj;N++){const C=Zj[N],j=i[C],A=g[C]!==void 0?g[C]:v[C],R=gl(A),w=C===m?j.isActive:null;w===!1&&(T=N);let G=A===v[C]&&A!==g[C]&&R;if(G&&o&&t.manuallyAnimateOnMount&&(G=!1),j.protectedKeys={...S},!j.isActive&&w===null||!A&&!j.prevProp||Ac(A)||typeof A=="boolean")continue;const z=Jj(j.prevProp,A);let O=z||C===m&&j.isActive&&!G&&R||N>T&&R,$=!1;const J=Array.isArray(A)?A:[A];let ae=J.reduce(r(C),{});w===!1&&(ae={});const{prevResolvedValues:se={}}=j,te={...se,...ae},U=q=>{O=!0,x.has(q)&&($=!0,x.delete(q)),j.needsAnimating[q]=!0;const oe=t.getValue(q);oe&&(oe.liveStyle=!1)};for(const q in te){const oe=ae[q],le=se[q];if(S.hasOwnProperty(q))continue;let F=!1;Df(oe)&&Df(le)?F=!ix(oe,le):F=oe!==le,F?oe!=null?U(q):x.add(q):oe!==void 0&&x.has(q)?U(q):j.protectedKeys[q]=!0}j.prevProp=A,j.prevResolvedValues=ae,j.isActive&&(S={...S,...ae}),o&&t.blockInitialAnimation&&(O=!1),O&&(!(G&&z)||$)&&y.push(...J.map(q=>({animation:q,options:{type:C}})))}if(x.size){const N={};x.forEach(C=>{const j=t.getBaseTarget(C),A=t.getValue(C);A&&(A.liveStyle=!0),N[C]=j??null}),y.push({animation:N})}let E=!!y.length;return o&&(g.initial===!1||g.initial===g.animate)&&!t.manuallyAnimateOnMount&&(E=!1),o=!1,E?a(y):Promise.resolve()}function p(m,g){var v;if(i[m].isActive===g)return Promise.resolve();(v=t.variantChildren)===null||v===void 0||v.forEach(x=>{var S;return(S=x.animationState)===null||S===void 0?void 0:S.setActive(m,g)}),i[m].isActive=g;const y=d(m);for(const x in i)i[x].protectedKeys={};return y}return{animateChanges:d,setActive:p,setAnimateFunction:u,getState:()=>i,reset:()=>{i=Hy(),o=!0}}}function Jj(t,a){return typeof a=="string"?a!==t:Array.isArray(a)?!ix(a,t):!1}function As(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hy(){return{animate:As(!0),whileInView:As(),whileHover:As(),whileTap:As(),whileDrag:As(),whileFocus:As(),exit:As()}}class cs{constructor(a){this.isMounted=!1,this.node=a}update(){}}class ew extends cs{constructor(a){super(a),a.animationState||(a.animationState=Wj(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();Ac(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:i}=this.node.prevProps||{};a!==i&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)===null||a===void 0||a.call(this)}}let tw=0;class nw extends cs{constructor(){super(...arguments),this.id=tw++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)return;const r=this.node.animationState.setActive("exit",!a);i&&!a&&r.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const aw={animation:{Feature:ew},exit:{Feature:nw}},Un={x:!1,y:!1};function $x(){return Un.x||Un.y}function sw(t){return t==="x"||t==="y"?Un[t]?null:(Un[t]=!0,()=>{Un[t]=!1}):Un.x||Un.y?null:(Un.x=Un.y=!0,()=>{Un.x=Un.y=!1})}const Fh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function xl(t,a,i,o={passive:!0}){return t.addEventListener(a,i,o),()=>t.removeEventListener(a,i)}function Nl(t){return{point:{x:t.pageX,y:t.pageY}}}const iw=t=>a=>Fh(a)&&t(a,Nl(a));function cl(t,a,i,o){return xl(t,a,iw(i),o)}const Py=(t,a)=>Math.abs(t-a);function ow(t,a){const i=Py(t.x,a.x),o=Py(t.y,a.y);return Math.sqrt(i**2+o**2)}class Fx{constructor(a,i,{transformPagePoint:o,contextWindow:r,dragSnapToOrigin:u=!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=uf(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,S=ow(y.offset,{x:0,y:0})>=3;if(!x&&!S)return;const{point:T}=y,{timestamp:E}=zt;this.history.push({...T,timestamp:E});const{onStart:N,onMove:C}=this.handlers;x||(N&&N(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,y)},this.handlePointerMove=(y,x)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=cf(x,this.transformPagePoint),ct.update(this.updatePoint,!0)},this.handlePointerUp=(y,x)=>{this.end();const{onEnd:S,onSessionEnd:T,resumeAnimation:E}=this.handlers;if(this.dragSnapToOrigin&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=uf(y.type==="pointercancel"?this.lastMoveEventInfo:cf(x,this.transformPagePoint),this.history);this.startEvent&&S&&S(y,N),T&&T(y,N)},!Fh(a))return;this.dragSnapToOrigin=u,this.handlers=i,this.transformPagePoint=o,this.contextWindow=r||window;const d=Nl(a),p=cf(d,this.transformPagePoint),{point:m}=p,{timestamp:g}=zt;this.history=[{...m,timestamp:g}];const{onSessionStart:v}=i;v&&v(a,uf(p,this.history)),this.removeListeners=El(cl(this.contextWindow,"pointermove",this.handlePointerMove),cl(this.contextWindow,"pointerup",this.handlePointerUp),cl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),is(this.updatePoint)}}function cf(t,a){return a?{point:a(t.point)}:t}function Gy(t,a){return{x:t.x-a.x,y:t.y-a.y}}function uf({point:t},a){return{point:t,delta:Gy(t,qx(a)),offset:Gy(t,lw(a)),velocity:rw(a,.1)}}function lw(t){return t[0]}function qx(t){return t[t.length-1]}function rw(t,a){if(t.length<2)return{x:0,y:0};let i=t.length-1,o=null;const r=qx(t);for(;i>=0&&(o=t[i],!(r.timestamp-o.timestamp>_a(a)));)i--;if(!o)return{x:0,y:0};const u=Sa(r.timestamp-o.timestamp);if(u===0)return{x:0,y:0};const d={x:(r.x-o.x)/u,y:(r.y-o.y)/u};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}const Kx=1e-4,cw=1-Kx,uw=1+Kx,Yx=.01,dw=0-Yx,fw=0+Yx;function pn(t){return t.max-t.min}function hw(t,a,i){return Math.abs(t-a)<=i}function $y(t,a,i,o=.5){t.origin=o,t.originPoint=ht(a.min,a.max,t.origin),t.scale=pn(i)/pn(a),t.translate=ht(i.min,i.max,t.origin)-t.originPoint,(t.scale>=cw&&t.scale<=uw||isNaN(t.scale))&&(t.scale=1),(t.translate>=dw&&t.translate<=fw||isNaN(t.translate))&&(t.translate=0)}function ul(t,a,i,o){$y(t.x,a.x,i.x,o?o.originX:void 0),$y(t.y,a.y,i.y,o?o.originY:void 0)}function Fy(t,a,i){t.min=i.min+a.min,t.max=t.min+pn(a)}function pw(t,a,i){Fy(t.x,a.x,i.x),Fy(t.y,a.y,i.y)}function qy(t,a,i){t.min=a.min-i.min,t.max=t.min+pn(a)}function dl(t,a,i){qy(t.x,a.x,i.x),qy(t.y,a.y,i.y)}function mw(t,{min:a,max:i},o){return a!==void 0&&t<a?t=o?ht(a,t,o.min):Math.max(t,a):i!==void 0&&t>i&&(t=o?ht(i,t,o.max):Math.min(t,i)),t}function Ky(t,a,i){return{min:a!==void 0?t.min+a:void 0,max:i!==void 0?t.max+i-(t.max-t.min):void 0}}function gw(t,{top:a,left:i,bottom:o,right:r}){return{x:Ky(t.x,i,r),y:Ky(t.y,a,o)}}function Yy(t,a){let i=a.min-t.min,o=a.max-t.max;return a.max-a.min<t.max-t.min&&([i,o]=[o,i]),{min:i,max:o}}function vw(t,a){return{x:Yy(t.x,a.x),y:Yy(t.y,a.y)}}function yw(t,a){let i=.5;const o=pn(t),r=pn(a);return r>o?i=qi(a.min,a.max-o,t.min):o>r&&(i=qi(t.min,t.max-r,a.min)),Ca(0,1,i)}function bw(t,a){const i={};return a.min!==void 0&&(i.min=a.min-t.min),a.max!==void 0&&(i.max=a.max-t.min),i}const Pf=.35;function xw(t=Pf){return t===!1?t=0:t===!0&&(t=Pf),{x:Zy(t,"left","right"),y:Zy(t,"top","bottom")}}function Zy(t,a,i){return{min:Xy(t,a),max:Xy(t,i)}}function Xy(t,a){return typeof t=="number"?t:t[a]||0}const Qy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ui=()=>({x:Qy(),y:Qy()}),Wy=()=>({min:0,max:0}),bt=()=>({x:Wy(),y:Wy()});function Dn(t){return[t("x"),t("y")]}function Zx({top:t,left:a,right:i,bottom:o}){return{x:{min:a,max:i},y:{min:t,max:o}}}function _w({x:t,y:a}){return{top:a.min,right:t.max,bottom:a.max,left:t.min}}function Sw(t,a){if(!a)return t;const i=a({x:t.left,y:t.top}),o=a({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function df(t){return t===void 0||t===1}function Gf({scale:t,scaleX:a,scaleY:i}){return!df(t)||!df(a)||!df(i)}function Ms(t){return Gf(t)||Xx(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Xx(t){return Jy(t.x)||Jy(t.y)}function Jy(t){return t&&t!=="0%"}function vc(t,a,i){const o=t-i,r=a*o;return i+r}function e0(t,a,i,o,r){return r!==void 0&&(t=vc(t,r,o)),vc(t,i,o)+a}function $f(t,a=0,i=1,o,r){t.min=e0(t.min,a,i,o,r),t.max=e0(t.max,a,i,o,r)}function Qx(t,{x:a,y:i}){$f(t.x,a.translate,a.scale,a.originPoint),$f(t.y,i.translate,i.scale,i.originPoint)}const t0=.999999999999,n0=1.0000000000001;function Tw(t,a,i,o=!1){const r=i.length;if(!r)return;a.x=a.y=1;let u,d;for(let p=0;p<r;p++){u=i[p],d=u.projectionDelta;const{visualElement:m}=u.options;m&&m.props.style&&m.props.style.display==="contents"||(o&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Vi(t,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),d&&(a.x*=d.x.scale,a.y*=d.y.scale,Qx(t,d)),o&&Ms(u.latestValues)&&Vi(t,u.latestValues))}a.x<n0&&a.x>t0&&(a.x=1),a.y<n0&&a.y>t0&&(a.y=1)}function zi(t,a){t.min=t.min+a,t.max=t.max+a}function a0(t,a,i,o,r=.5){const u=ht(t.min,t.max,r);$f(t,a,i,u,o)}function Vi(t,a){a0(t.x,a.x,a.scaleX,a.scale,a.originX),a0(t.y,a.y,a.scaleY,a.scale,a.originY)}function Wx(t,a){return Zx(Sw(t.getBoundingClientRect(),a))}function kw(t,a,i){const o=Wx(t,i),{scroll:r}=a;return r&&(zi(o.x,r.offset.x),zi(o.y,r.offset.y)),o}const Jx=({current:t})=>t?t.ownerDocument.defaultView:null,Cw=new WeakMap;class Ew{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=bt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=v=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(Nl(v).point)},u=(v,y)=>{const{drag:x,dragPropagation:S,onDragStart:T}=this.getProps();if(x&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=sw(x),!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),Dn(N=>{let C=this.getAxisMotionValue(N).get()||0;if(Xn.test(C)){const{projection:j}=this.visualElement;if(j&&j.layout){const A=j.layout.layoutBox[N];A&&(C=pn(A)*(parseFloat(C)/100))}}this.originPoint[N]=C}),T&&ct.postRender(()=>T(v,y)),Rf(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},d=(v,y)=>{const{dragPropagation:x,dragDirectionLock:S,onDirectionLock:T,onDrag:E}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:N}=y;if(S&&this.currentDirection===null){this.currentDirection=Nw(N),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",y.point,N),this.updateAxis("y",y.point,N),this.visualElement.render(),E&&E(v,y)},p=(v,y)=>this.stop(v,y),m=()=>Dn(v=>{var y;return this.getAnimationState(v)==="paused"&&((y=this.getAxisMotionValue(v).animation)===null||y===void 0?void 0:y.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new Fx(a,{onSessionStart:r,onStart:u,onMove:d,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:Jx(this.visualElement)})}stop(a,i){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:u}=this.getProps();u&&ct.postRender(()=>u(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,o){const{drag:r}=this.getProps();if(!o||!Xr(a,r,this.currentDirection))return;const u=this.getAxisMotionValue(a);let d=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(d=mw(d,this.constraints[a],this.elastic[a])),u.set(d)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:o}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,u=this.constraints;i&&Ii(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=gw(r.layoutBox,i):this.constraints=!1,this.elastic=xw(o),u!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Dn(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=bw(r.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Ii(a))return!1;const o=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const u=kw(o,r.root,this.visualElement.getTransformPagePoint());let d=vw(r.layout.layoutBox,u);if(i){const p=i(_w(d));this.hasMutatedConstraints=!!p,p&&(d=Zx(p))}return d}startAnimation(a){const{drag:i,dragMomentum:o,dragElastic:r,dragTransition:u,dragSnapToOrigin:d,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=Dn(v=>{if(!Xr(v,i,this.currentDirection))return;let y=m&&m[v]||{};d&&(y={min:0,max:0});const x=r?200:1e6,S=r?40:1e7,T={type:"inertia",velocity:o?a[v]:0,bounceStiffness:x,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(v,T)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const o=this.getAxisMotionValue(a);return Rf(this.visualElement,a),o.start($h(a,o,0,i,this.visualElement,!1))}stopAnimation(){Dn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){Dn(a=>{var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(a){var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(a){const i=`_drag${a.toUpperCase()}`,o=this.visualElement.getProps(),r=o[i];return r||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){Dn(i=>{const{drag:o}=this.getProps();if(!Xr(i,o,this.currentDirection))return;const{projection:r}=this.visualElement,u=this.getAxisMotionValue(i);if(r&&r.layout){const{min:d,max:p}=r.layout.layoutBox[i];u.set(a[i]-ht(d,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:o}=this.visualElement;if(!Ii(i)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Dn(d=>{const p=this.getAxisMotionValue(d);if(p&&this.constraints!==!1){const m=p.get();r[d]=yw({min:m,max:m},this.constraints[d])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),Dn(d=>{if(!Xr(d,a,null))return;const p=this.getAxisMotionValue(d),{min:m,max:g}=this.constraints[d];p.set(ht(m,g,r[d]))})}addListeners(){if(!this.visualElement.current)return;Cw.set(this.visualElement,this);const a=this.visualElement.current,i=cl(a,"pointerdown",m=>{const{drag:g,dragListener:v=!0}=this.getProps();g&&v&&this.start(m)}),o=()=>{const{dragConstraints:m}=this.getProps();Ii(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,u=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),ct.read(o);const d=xl(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(Dn(v=>{const y=this.getAxisMotionValue(v);y&&(this.originPoint[v]+=m[v].translate,y.set(y.get()+m[v].translate))}),this.visualElement.render())}));return()=>{d(),i(),u(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:u=!1,dragElastic:d=Pf,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:o,dragPropagation:r,dragConstraints:u,dragElastic:d,dragMomentum:p}}}function Xr(t,a,i){return(a===!0||a===t)&&(i===null||i===t)}function Nw(t,a=10){let i=null;return Math.abs(t.y)>a?i="y":Math.abs(t.x)>a&&(i="x"),i}class jw extends cs{constructor(a){super(a),this.removeGroupControls=hn,this.removeListeners=hn,this.controls=new Ew(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||hn}unmount(){this.removeGroupControls(),this.removeListeners()}}const s0=t=>(a,i)=>{t&&ct.postRender(()=>t(a,i))};class ww extends cs{constructor(){super(...arguments),this.removePointerDownListener=hn}onPointerDown(a){this.session=new Fx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:s0(a),onStart:s0(i),onMove:o,onEnd:(u,d)=>{delete this.session,r&&ct.postRender(()=>r(u,d))}}}mount(){this.removePointerDownListener=cl(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const lc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function i0(t,a){return a.max===a.min?0:t/(a.max-a.min)*100}const Qo={correct:(t,a)=>{if(!a.target)return t;if(typeof t=="string")if(xe.test(t))t=parseFloat(t);else return t;const i=i0(t,a.target.x),o=i0(t,a.target.y);return`${i}% ${o}%`}},Aw={correct:(t,{treeScale:a,projectionDelta:i})=>{const o=t,r=os.parse(t);if(r.length>5)return o;const u=os.createTransformer(t),d=typeof r[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;r[0+d]/=p,r[1+d]/=m;const g=ht(p,m,.5);return typeof r[2+d]=="number"&&(r[2+d]/=g),typeof r[3+d]=="number"&&(r[3+d]/=g),u(r)}};class Dw extends b.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o,layoutId:r}=this.props,{projection:u}=a;aN(Rw),u&&(i.group&&i.group.add(u),o&&o.register&&r&&o.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),lc.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:o,drag:r,isPresent:u}=this.props,d=o.projection;return d&&(d.isPresent=u,r||a.layoutDependency!==i||i===void 0?d.willUpdate():this.safeToRemove(),a.isPresent!==u&&(u?d.promote():d.relegate()||ct.postRender(()=>{const p=d.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),bh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function e_(t){const[a,i]=Ub(),o=b.useContext(fh);return c.jsx(Dw,{...t,layoutGroup:o,switchLayoutGroup:b.useContext(qb),isPresent:a,safeToRemove:i})}const Rw={borderRadius:{...Qo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Qo,borderTopRightRadius:Qo,borderBottomLeftRadius:Qo,borderBottomRightRadius:Qo,boxShadow:Aw};function Mw(t,a,i){const o=Gt(t)?t:yl(t);return o.start($h("",o,a,i)),o.animation}function Ow(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Bw=(t,a)=>t.depth-a.depth;class Iw{constructor(){this.children=[],this.isDirty=!1}add(a){Ah(this.children,a),this.isDirty=!0}remove(a){Dh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(Bw),this.isDirty=!1,this.children.forEach(a)}}function Lw(t,a){const i=Qn.now(),o=({timestamp:r})=>{const u=r-i;u>=a&&(is(o),t(u-a))};return ct.read(o,!0),()=>is(o)}const t_=["TopLeft","TopRight","BottomLeft","BottomRight"],Uw=t_.length,o0=t=>typeof t=="string"?parseFloat(t):t,l0=t=>typeof t=="number"||xe.test(t);function zw(t,a,i,o,r,u){r?(t.opacity=ht(0,i.opacity!==void 0?i.opacity:1,Vw(o)),t.opacityExit=ht(a.opacity!==void 0?a.opacity:1,0,Hw(o))):u&&(t.opacity=ht(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,o));for(let d=0;d<Uw;d++){const p=`border${t_[d]}Radius`;let m=r0(a,p),g=r0(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||l0(m)===l0(g)?(t[p]=Math.max(ht(o0(m),o0(g),o),0),(Xn.test(g)||Xn.test(m))&&(t[p]+="%")):t[p]=g}(a.rotate||i.rotate)&&(t.rotate=ht(a.rotate||0,i.rotate||0,o))}function r0(t,a){return t[a]!==void 0?t[a]:t.borderRadius}const Vw=n_(0,.5,yx),Hw=n_(.5,.95,hn);function n_(t,a,i){return o=>o<t?0:o>a?1:i(qi(t,a,o))}function c0(t,a){t.min=a.min,t.max=a.max}function wn(t,a){c0(t.x,a.x),c0(t.y,a.y)}function u0(t,a){t.translate=a.translate,t.scale=a.scale,t.originPoint=a.originPoint,t.origin=a.origin}function d0(t,a,i,o,r){return t-=a,t=vc(t,1/i,o),r!==void 0&&(t=vc(t,1/r,o)),t}function Pw(t,a=0,i=1,o=.5,r,u=t,d=t){if(Xn.test(a)&&(a=parseFloat(a),a=ht(d.min,d.max,a/100)-d.min),typeof a!="number")return;let p=ht(u.min,u.max,o);t===u&&(p-=a),t.min=d0(t.min,a,i,p,r),t.max=d0(t.max,a,i,p,r)}function f0(t,a,[i,o,r],u,d){Pw(t,a[i],a[o],a[r],a.scale,u,d)}const Gw=["x","scaleX","originX"],$w=["y","scaleY","originY"];function h0(t,a,i,o){f0(t.x,a,Gw,i?i.x:void 0,o?o.x:void 0),f0(t.y,a,$w,i?i.y:void 0,o?o.y:void 0)}function p0(t){return t.translate===0&&t.scale===1}function a_(t){return p0(t.x)&&p0(t.y)}function m0(t,a){return t.min===a.min&&t.max===a.max}function Fw(t,a){return m0(t.x,a.x)&&m0(t.y,a.y)}function g0(t,a){return Math.round(t.min)===Math.round(a.min)&&Math.round(t.max)===Math.round(a.max)}function s_(t,a){return g0(t.x,a.x)&&g0(t.y,a.y)}function v0(t){return pn(t.x)/pn(t.y)}function y0(t,a){return t.translate===a.translate&&t.scale===a.scale&&t.originPoint===a.originPoint}class qw{constructor(){this.members=[]}add(a){Ah(this.members,a),a.scheduleRender()}remove(a){if(Dh(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(r=>a===r);if(i===0)return!1;let o;for(let r=i;r>=0;r--){const u=this.members[r];if(u.isPresent!==!1){o=u;break}}return o?(this.promote(o),!0):!1}promote(a,i){const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.instance&&o.scheduleRender(),a.scheduleRender(),a.resumeFrom=o,i&&(a.resumeFrom.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:o}=a;i.onExitComplete&&i.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Kw(t,a,i){let o="";const r=t.x.translate/a.x,u=t.y.translate/a.y,d=(i==null?void 0:i.z)||0;if((r||u||d)&&(o=`translate3d(${r}px, ${u}px, ${d}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:v,rotateX:y,rotateY:x,skewX:S,skewY:T}=i;g&&(o=`perspective(${g}px) ${o}`),v&&(o+=`rotate(${v}deg) `),y&&(o+=`rotateX(${y}deg) `),x&&(o+=`rotateY(${x}deg) `),S&&(o+=`skewX(${S}deg) `),T&&(o+=`skewY(${T}deg) `)}const p=t.x.scale*a.x,m=t.y.scale*a.y;return(p!==1||m!==1)&&(o+=`scale(${p}, ${m})`),o||"none"}const Os={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},nl=typeof window<"u"&&window.MotionDebug!==void 0,ff=["","X","Y","Z"],Yw={visibility:"hidden"},b0=1e3;let Zw=0;function hf(t,a,i,o){const{latestValues:r}=a;r[t]&&(i[t]=r[t],a.setStaticValue(t,0),o&&(o[t]=0))}function i_(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:a}=t.options;if(!a)return;const i=rx(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:u}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",ct,!(r||u))}const{parent:o}=t;o&&!o.hasCheckedOptimisedAppear&&i_(o)}function o_({attachResizeListener:t,defaultParent:a,measureScroll:i,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(d={},p=a==null?void 0:a()){this.id=Zw++,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,nl&&(Os.totalNodes=Os.resolvedTargetDeltas=Os.recalculatedProjection=0),this.nodes.forEach(Ww),this.nodes.forEach(aA),this.nodes.forEach(sA),this.nodes.forEach(Jw),nl&&window.MotionDebug.record(Os)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new Iw)}addEventListener(d,p){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new Rh),this.eventHandlers.get(d).add(p)}notifyListeners(d,...p){const m=this.eventHandlers.get(d);m&&m.notify(...p)}hasListeners(d){return this.eventHandlers.has(d)}mount(d,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ow(d),this.instance=d;const{layoutId:m,layout:g,visualElement:v}=this.options;if(v&&!v.current&&v.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),t){let y;const x=()=>this.root.updateBlockedByResize=!1;t(d,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=Lw(x,250),lc.hasAnimatedSinceResize&&(lc.hasAnimatedSinceResize=!1,this.nodes.forEach(_0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&v&&(m||g)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:x,hasRelativeTargetChanged:S,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const E=this.options.transition||v.getDefaultTransition()||cA,{onLayoutAnimationStart:N,onLayoutAnimationComplete:C}=v.getProps(),j=!this.targetLayout||!s_(this.targetLayout,T)||S,A=!x&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||x&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(y,A);const R={...wh(E,"layout"),onPlay:N,onComplete:C};(v.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R)}else x||_0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,is(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(iA),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&i_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const y=this.path[v];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(x0);return}this.isUpdating||this.nodes.forEach(tA),this.isUpdating=!1,this.nodes.forEach(nA),this.nodes.forEach(Xw),this.nodes.forEach(Qw),this.clearAllSnapshots();const p=Qn.now();zt.delta=Ca(0,1e3/60,p-zt.timestamp),zt.timestamp=p,zt.isProcessing=!0,af.update.process(zt),af.preRender.process(zt),af.render.process(zt),zt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eA),this.sharedNodes.forEach(oA)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ct.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 d=this.layout;this.layout=this.measure(!1),this.layoutCorrected=bt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,d?d.layoutBox:void 0)}updateScroll(d="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(p=!1),p){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!r)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!a_(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,v=g!==this.prevTransformTemplateValue;d&&(p||Ms(this.latestValues)||v)&&(r(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return d&&(m=this.removeTransform(m)),uA(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:p}=this.options;if(!p)return bt();const m=p.measureViewportBox();if(!(((d=this.scroll)===null||d===void 0?void 0:d.wasRoot)||this.path.some(dA))){const{scroll:v}=this.root;v&&(zi(m.x,v.offset.x),zi(m.y,v.offset.y))}return m}removeElementScroll(d){var p;const m=bt();if(wn(m,d),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const v=this.path[g],{scroll:y,options:x}=v;v!==this.root&&y&&x.layoutScroll&&(y.wasRoot&&wn(m,d),zi(m.x,y.offset.x),zi(m.y,y.offset.y))}return m}applyTransform(d,p=!1){const m=bt();wn(m,d);for(let g=0;g<this.path.length;g++){const v=this.path[g];!p&&v.options.layoutScroll&&v.scroll&&v!==v.root&&Vi(m,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),Ms(v.latestValues)&&Vi(m,v.latestValues)}return Ms(this.latestValues)&&Vi(m,this.latestValues),m}removeTransform(d){const p=bt();wn(p,d);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!Ms(g.latestValues))continue;Gf(g.latestValues)&&g.updateSnapshot();const v=bt(),y=g.measurePageBox();wn(v,y),h0(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,v)}return Ms(this.latestValues)&&h0(p,this.latestValues),p}setTargetDelta(d){this.targetDelta=d,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(d){this.options={...this.options,...d,crossfade:d.crossfade!==void 0?d.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!==zt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!1){var p;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(d||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:x}=this.options;if(!(!this.layout||!(y||x))){if(this.resolvedRelativeTargetAt=zt.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=bt(),this.relativeTargetOrigin=bt(),dl(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),wn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=bt(),this.targetWithTransforms=bt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),pw(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):wn(this.target,this.layout.layoutBox),Qx(this.target,this.targetDelta)):wn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const S=this.getClosestProjectingParent();S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=bt(),this.relativeTargetOrigin=bt(),dl(this.relativeTargetOrigin,this.target,S.target),wn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}nl&&Os.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Gf(this.parent.latestValues)||Xx(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 d;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((d=this.parent)===null||d===void 0)&&d.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===zt.timestamp&&(g=!1),g)return;const{layout:v,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||!(v||y))return;wn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,S=this.treeScale.y;Tw(this.layoutCorrected,this.treeScale,this.path,m),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=bt());const{target:T}=p;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(u0(this.prevProjectionDelta.x,this.projectionDelta.x),u0(this.prevProjectionDelta.y,this.projectionDelta.y)),ul(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==S||!y0(this.projectionDelta.x,this.prevProjectionDelta.x)||!y0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T)),nl&&Os.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),d){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ui(),this.projectionDelta=Ui(),this.projectionDeltaWithTransform=Ui()}setAnimationOrigin(d,p=!1){const m=this.snapshot,g=m?m.latestValues:{},v={...this.latestValues},y=Ui();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const x=bt(),S=m?m.source:void 0,T=this.layout?this.layout.source:void 0,E=S!==T,N=this.getStack(),C=!N||N.members.length<=1,j=!!(E&&!C&&this.options.crossfade===!0&&!this.path.some(rA));this.animationProgress=0;let A;this.mixTargetDelta=R=>{const w=R/1e3;S0(y.x,d.x,w),S0(y.y,d.y,w),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(dl(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),lA(this.relativeTarget,this.relativeTargetOrigin,x,w),A&&Fw(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=bt()),wn(A,this.relativeTarget)),E&&(this.animationValues=v,zw(v,g,this.latestValues,w,j,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(is(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ct.update(()=>{lc.hasAnimatedSinceResize=!0,this.currentAnimation=Mw(0,b0,{...d,onUpdate:p=>{this.mixTargetDelta(p),d.onUpdate&&d.onUpdate(p)},onComplete:()=>{d.onComplete&&d.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 d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(b0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:v}=d;if(!(!p||!m||!g)){if(this!==d&&this.layout&&g&&l_(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||bt();const y=pn(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+y;const x=pn(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+x}wn(p,m),Vi(p,v),ul(this.projectionDeltaWithTransform,this.layoutCorrected,p,v)}}registerSharedNode(d,p){this.sharedNodes.has(d)||this.sharedNodes.set(d,new qw),this.sharedNodes.get(d).add(p);const g=p.options.initialPromotionConfig;p.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(p):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){var d;const{layoutId:p}=this.options;return p?((d=this.getStack())===null||d===void 0?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:p}=this.options;return p?(d=this.getStack())===null||d===void 0?void 0:d.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),d&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let p=!1;const{latestValues:m}=d;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&hf("z",d,g,this.animationValues);for(let v=0;v<ff.length;v++)hf(`rotate${ff[v]}`,d,g,this.animationValues),hf(`skew${ff[v]}`,d,g,this.animationValues);d.render();for(const v in g)d.setStaticValue(v,g[v]),this.animationValues&&(this.animationValues[v]=g[v]);d.scheduleRender()}getProjectionStyles(d){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Yw;const g={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=ic(d==null?void 0:d.pointerEvents)||"",g.transform=v?v(this.latestValues,""):"none",g;const y=this.getLead();if(!this.projectionDelta||!this.layout||!y.target){const E={};return this.options.layoutId&&(E.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,E.pointerEvents=ic(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!Ms(this.latestValues)&&(E.transform=v?v({},""):"none",this.hasProjected=!1),E}const x=y.animationValues||y.latestValues;this.applyTransformsToTarget(),g.transform=Kw(this.projectionDeltaWithTransform,this.treeScale,x),v&&(g.transform=v(x,g.transform));const{x:S,y:T}=this.projectionDelta;g.transformOrigin=`${S.origin*100}% ${T.origin*100}% 0`,y.animationValues?g.opacity=y===this?(m=(p=x.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:g.opacity=y===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const E in fc){if(x[E]===void 0)continue;const{correct:N,applyTo:C}=fc[E],j=g.transform==="none"?x[E]:N(x[E],y);if(C){const A=C.length;for(let R=0;R<A;R++)g[C[R]]=j}else g[E]=j}return this.options.layoutId&&(g.pointerEvents=y===this?ic(d==null?void 0:d.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>{var p;return(p=d.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(x0),this.root.sharedNodes.clear()}}}function Xw(t){t.updateLayout()}function Qw(t){var a;const i=((a=t.resumeFrom)===null||a===void 0?void 0:a.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:r}=t.layout,{animationType:u}=t.options,d=i.source!==t.layout.source;u==="size"?Dn(y=>{const x=d?i.measuredBox[y]:i.layoutBox[y],S=pn(x);x.min=o[y].min,x.max=x.min+S}):l_(u,i.layoutBox,o)&&Dn(y=>{const x=d?i.measuredBox[y]:i.layoutBox[y],S=pn(o[y]);x.max=x.min+S,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[y].max=t.relativeTarget[y].min+S)});const p=Ui();ul(p,o,i.layoutBox);const m=Ui();d?ul(m,t.applyTransform(r,!0),i.measuredBox):ul(m,o,i.layoutBox);const g=!a_(p);let v=!1;if(!t.resumeFrom){const y=t.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:x,layout:S}=y;if(x&&S){const T=bt();dl(T,i.layoutBox,x.layoutBox);const E=bt();dl(E,o,S.layoutBox),s_(T,E)||(v=!0),y.options.layoutRoot&&(t.relativeTarget=E,t.relativeTargetOrigin=T,t.relativeParent=y)}}}t.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:v})}else if(t.isLead()){const{onExitComplete:o}=t.options;o&&o()}t.options.transition=void 0}function Ww(t){nl&&Os.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 Jw(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function eA(t){t.clearSnapshot()}function x0(t){t.clearMeasurements()}function tA(t){t.isLayoutDirty=!1}function nA(t){const{visualElement:a}=t.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),t.resetTransform()}function _0(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function aA(t){t.resolveTargetDelta()}function sA(t){t.calcProjection()}function iA(t){t.resetSkewAndRotation()}function oA(t){t.removeLeadSnapshot()}function S0(t,a,i){t.translate=ht(a.translate,0,i),t.scale=ht(a.scale,1,i),t.origin=a.origin,t.originPoint=a.originPoint}function T0(t,a,i,o){t.min=ht(a.min,i.min,o),t.max=ht(a.max,i.max,o)}function lA(t,a,i,o){T0(t.x,a.x,i.x,o),T0(t.y,a.y,i.y,o)}function rA(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const cA={duration:.45,ease:[.4,0,.1,1]},k0=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),C0=k0("applewebkit/")&&!k0("chrome/")?Math.round:hn;function E0(t){t.min=C0(t.min),t.max=C0(t.max)}function uA(t){E0(t.x),E0(t.y)}function l_(t,a,i){return t==="position"||t==="preserve-aspect"&&!hw(v0(a),v0(i),.2)}function dA(t){var a;return t!==t.root&&((a=t.scroll)===null||a===void 0?void 0:a.wasRoot)}const fA=o_({attachResizeListener:(t,a)=>xl(t,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pf={current:void 0},r_=o_({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!pf.current){const t=new fA({});t.mount(window),t.setOptions({layoutScroll:!0}),pf.current=t}return pf.current},resetTransform:(t,a)=>{t.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),hA={pan:{Feature:ww},drag:{Feature:jw,ProjectionNode:r_,MeasureLayout:e_}};function pA(t,a,i){var o;if(t instanceof Element)return[t];if(typeof t=="string"){let r=document;const u=(o=void 0)!==null&&o!==void 0?o:r.querySelectorAll(t);return u?Array.from(u):[]}return Array.from(t)}function c_(t,a){const i=pA(t),o=new AbortController,r={passive:!0,...a,signal:o.signal};return[i,r,()=>o.abort()]}function N0(t){return a=>{a.pointerType==="touch"||$x()||t(a)}}function mA(t,a,i={}){const[o,r,u]=c_(t,i),d=N0(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const v=N0(y=>{g(y),m.removeEventListener("pointerleave",v)});m.addEventListener("pointerleave",v,r)});return o.forEach(p=>{p.addEventListener("pointerenter",d,r)}),u}function j0(t,a,i){const{props:o}=t;t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,u=o[r];u&&ct.postRender(()=>u(a,Nl(a)))}class gA extends cs{mount(){const{current:a}=this.node;a&&(this.unmount=mA(a,i=>(j0(this.node,i,"Start"),o=>j0(this.node,o,"End"))))}unmount(){}}class vA extends cs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch{a=!0}!a||!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=El(xl(this.node.current,"focus",()=>this.onFocus()),xl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const u_=(t,a)=>a?t===a?!0:u_(t,a.parentElement):!1,yA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function bA(t){return yA.has(t.tagName)||t.tabIndex!==-1}const al=new WeakSet;function w0(t){return a=>{a.key==="Enter"&&t(a)}}function mf(t,a){t.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const xA=(t,a)=>{const i=t.currentTarget;if(!i)return;const o=w0(()=>{if(al.has(i))return;mf(i,"down");const r=w0(()=>{mf(i,"up")}),u=()=>mf(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",u,a)});i.addEventListener("keydown",o,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),a)};function A0(t){return Fh(t)&&!$x()}function _A(t,a,i={}){const[o,r,u]=c_(t,i),d=p=>{const m=p.currentTarget;if(!A0(p)||al.has(m))return;al.add(m);const g=a(p),v=(S,T)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",x),!(!A0(S)||!al.has(m))&&(al.delete(m),typeof g=="function"&&g(S,{success:T}))},y=S=>{v(S,i.useGlobalTarget||u_(m,S.target))},x=S=>{v(S,!1)};window.addEventListener("pointerup",y,r),window.addEventListener("pointercancel",x,r)};return o.forEach(p=>{!bA(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",d,r),p.addEventListener("focus",g=>xA(g,r),r)}),u}function D0(t,a,i){const{props:o}=t;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),u=o[r];u&&ct.postRender(()=>u(a,Nl(a)))}class SA extends cs{mount(){const{current:a}=this.node;a&&(this.unmount=_A(a,i=>(D0(this.node,i,"Start"),(o,{success:r})=>D0(this.node,o,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ff=new WeakMap,gf=new WeakMap,TA=t=>{const a=Ff.get(t.target);a&&a(t)},kA=t=>{t.forEach(TA)};function CA({root:t,...a}){const i=t||document;gf.has(i)||gf.set(i,{});const o=gf.get(i),r=JSON.stringify(a);return o[r]||(o[r]=new IntersectionObserver(kA,{root:t,...a})),o[r]}function EA(t,a,i){const o=CA(a);return Ff.set(t,i),o.observe(t),()=>{Ff.delete(t),o.unobserve(t)}}const NA={some:0,all:1};class jA extends cs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:o,amount:r="some",once:u}=a,d={root:i?i.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:NA[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,u&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:v,onViewportLeave:y}=this.node.getProps(),x=g?v:y;x&&x(m)};return EA(this.node.current,d,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(wA(a,i))&&this.startObserver()}unmount(){}}function wA({viewport:t={}},{viewport:a={}}={}){return i=>t[i]!==a[i]}const AA={inView:{Feature:jA},tap:{Feature:SA},focus:{Feature:vA},hover:{Feature:gA}},DA={layout:{ProjectionNode:r_,MeasureLayout:e_}},yc={current:null},qh={current:!1};function d_(){if(qh.current=!0,!!mh)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),a=()=>yc.current=t.matches;t.addListener(a),a()}else yc.current=!1}const RA=[...Rx,Pt,os],MA=t=>RA.find(Dx(t)),R0=new WeakMap;function OA(t,a,i){for(const o in a){const r=a[o],u=i[o];if(Gt(r))t.addValue(o,r);else if(Gt(u))t.addValue(o,yl(r,{owner:t}));else if(u!==r)if(t.hasValue(o)){const d=t.getValue(o);d.liveStyle===!0?d.jump(r):d.hasAnimated||d.set(r)}else{const d=t.getStaticValue(o);t.addValue(o,yl(d!==void 0?d:r,{owner:t}))}}for(const o in i)a[o]===void 0&&t.removeValue(o);return a}const M0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class BA{scrapeMotionValuesFromProps(a,i,o){return{}}constructor({parent:a,props:i,presenceContext:o,reducedMotionConfig:r,blockInitialAnimation:u,visualState:d},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Hh,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 S=Qn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,ct.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:v}=d;this.onUpdate=v,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=g,this.parent=a,this.props=i,this.presenceContext=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!u,this.isControllingVariants=Dc(i),this.isVariantNode=$b(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:y,...x}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in x){const T=x[S];m[S]!==void 0&&Gt(T)&&T.set(m[S],!1)}}mount(a){this.current=a,R0.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,o)=>this.bindToMotionValue(o,i)),qh.current||d_(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:yc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){R0.delete(this.current),this.projection&&this.projection.unmount(),is(this.notifyUpdate),is(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const i=this.features[a];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(a,i){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const o=Gs.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&ct.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),u=i.on("renderRequest",this.scheduleRender);let d;window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),u(),d&&d(),i.owner&&i.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in Fi){const i=Fi[a];if(!i)continue;const{isEnabled:o,Feature:r}=i;if(!this.features[a]&&r&&o(this.props)&&(this.features[a]=new r(this)),this.features[a]){const u=this.features[a];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):bt()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,i){this.latestValues[a]=i}update(a,i){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let o=0;o<M0.length;o++){const r=M0[o];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const u="on"+r,d=a[u];d&&(this.propEventSubscriptions[r]=this.on(r,d))}this.prevMotionValues=OA(this,this.scrapeMotionValuesFromProps(a,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]: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(a){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(a),()=>i.variantChildren.delete(a)}addValue(a,i){const o=this.values.get(a);i!==o&&(o&&this.removeValue(a),this.bindToMotionValue(a,i),this.values.set(a,i),this.latestValues[a]=i.get())}removeValue(a){this.values.delete(a);const i=this.valueSubscriptions.get(a);i&&(i(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,i){if(this.props.values&&this.props.values[a])return this.props.values[a];let o=this.values.get(a);return o===void 0&&i!==void 0&&(o=yl(i===null?void 0:i,{owner:this}),this.addValue(a,o)),o}readValue(a,i){var o;let r=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(o=this.getBaseTargetFromProps(this.props,a))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,a,this.options);return r!=null&&(typeof r=="string"&&(wx(r)||xx(r))?r=parseFloat(r):!MA(r)&&os.test(i)&&(r=Ex(a,i)),this.setBaseTarget(a,Gt(r)?r.get():r)),Gt(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:o}=this.props;let r;if(typeof o=="string"||typeof o=="object"){const d=_h(this.props,o,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);d&&(r=d[a])}if(o&&r!==void 0)return r;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!Gt(u)?u:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new Rh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class f_ extends BA{constructor(){super(...arguments),this.KeyframeResolver=Mx}sortInstanceNodePosition(a,i){return a.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(a,i){return a.style?a.style[i]:void 0}removeValueFromRenderState(a,{vars:i,style:o}){delete i[a],delete o[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Gt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function IA(t){return window.getComputedStyle(t)}class LA extends f_{constructor(){super(...arguments),this.type="html",this.renderInstance=Jb}readValueFromInstance(a,i){if(Gs.has(i)){const o=Vh(i);return o&&o.default||0}else{const o=IA(a),r=(Xb(i)?o.getPropertyValue(i):o[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Wx(a,i)}build(a,i,o){kh(a,i,o.transformTemplate)}scrapeMotionValuesFromProps(a,i,o){return jh(a,i,o)}}class UA extends f_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=bt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Gs.has(i)){const o=Vh(i);return o&&o.default||0}return i=ex.has(i)?i:yh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,o){return ax(a,i,o)}build(a,i,o){Ch(a,i,this.isSVGTag,o.transformTemplate)}renderInstance(a,i,o,r){tx(a,i,o,r)}mount(a){this.isSVGTag=Nh(a.tagName),super.mount(a)}}const zA=(t,a)=>xh(t)?new UA(a):new LA(a,{allowProjection:t!==b.Fragment}),VA=fN({...aw,...AA,...hA,...DA},zA),Et=NE(VA);function HA(){!qh.current&&d_();const[t]=b.useState(yc.current);return t}var nt;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TEXT=1]="TEXT",t[t.TOOL_USE=2]="TOOL_USE",t[t.TOOL_RESULT=3]="TOOL_RESULT",t[t.ERROR=4]="ERROR",t[t.STATUS=5]="STATUS",t[t.SYSTEM=6]="SYSTEM",t[t.FINDING=7]="FINDING",t[t.SUBTASK_CREATE=8]="SUBTASK_CREATE",t[t.USER_INPUT=9]="USER_INPUT",t[t.SIGNAL=10]="SIGNAL",t[t.USAGE=11]="USAGE"})(nt||(nt={}));var Ct;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.NOT_STARTED=1]="NOT_STARTED",t[t.WORKING=3]="WORKING",t[t.PAUSED=4]="PAUSED",t[t.COMPLETE=5]="COMPLETE",t[t.FAILED=6]="FAILED"})(Ct||(Ct={}));var ns;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ACTIVE=1]="ACTIVE",t[t.ARCHIVED=2]="ARCHIVED"})(ns||(ns={}));var as;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OPEN=1]="OPEN",t[t.CLOSED=2]="CLOSED"})(as||(as={}));var qn;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OFF=1]="OFF",t[t.SUBSCRIPTION=2]="SUBSCRIPTION",t[t.API_KEY=3]="API_KEY"})(qn||(qn={}));var ss;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OFF=1]="OFF",t[t.ON=2]="ON"})(ss||(ss={}));const PA=8,O0="system",Wo="system";Object.assign(Object.create(null),{"":nt.UNSPECIFIED,text:nt.TEXT,tool_use:nt.TOOL_USE,tool_result:nt.TOOL_RESULT,error:nt.ERROR,status:nt.STATUS,system:nt.SYSTEM,finding:nt.FINDING,subtask_create:nt.SUBTASK_CREATE,user_input:nt.USER_INPUT,signal:nt.SIGNAL,usage:nt.USAGE});nt.UNSPECIFIED+"",nt.TEXT+"",nt.TOOL_USE+"",nt.TOOL_RESULT+"",nt.ERROR+"",nt.STATUS+"",nt.SYSTEM+"",nt.FINDING+"",nt.SUBTASK_CREATE+"",nt.USER_INPUT+"",nt.SIGNAL+"",nt.USAGE+"";Object.assign(Object.create(null),{"":Ct.UNSPECIFIED,not_started:Ct.NOT_STARTED,working:Ct.WORKING,paused:Ct.PAUSED,complete:Ct.COMPLETE,failed:Ct.FAILED,pending:Ct.NOT_STARTED,assigned:Ct.NOT_STARTED,in_progress:Ct.WORKING,waiting_input:Ct.PAUSED,review:Ct.PAUSED,done:Ct.COMPLETE});Ct.UNSPECIFIED+"",Ct.NOT_STARTED+"",Ct.WORKING+"",Ct.PAUSED+"",Ct.COMPLETE+"",Ct.FAILED+"";Object.assign(Object.create(null),{"":ns.UNSPECIFIED,active:ns.ACTIVE,archived:ns.ARCHIVED});ns.UNSPECIFIED+"",ns.ACTIVE+"",ns.ARCHIVED+"";Object.assign(Object.create(null),{"":as.UNSPECIFIED,open:as.OPEN,closed:as.CLOSED});as.UNSPECIFIED+"",as.OPEN+"",as.CLOSED+"";Object.assign(Object.create(null),{"":qn.UNSPECIFIED,off:qn.OFF,subscription:qn.SUBSCRIPTION,api_key:qn.API_KEY});qn.UNSPECIFIED+"",qn.OFF+"",qn.SUBSCRIPTION+"",qn.API_KEY+"";Object.assign(Object.create(null),{"":ss.UNSPECIFIED,off:ss.OFF,on:ss.ON});ss.UNSPECIFIED+"",ss.OFF+"",ss.ON+"";function Ea(t){return Array.isArray?Array.isArray(t):m_(t)==="[object Array]"}function GA(t){if(typeof t=="string")return t;let a=t+"";return a=="0"&&1/t==-1/0?"-0":a}function $A(t){return t==null?"":GA(t)}function Kn(t){return typeof t=="string"}function h_(t){return typeof t=="number"}function FA(t){return t===!0||t===!1||qA(t)&&m_(t)=="[object Boolean]"}function p_(t){return typeof t=="object"}function qA(t){return p_(t)&&t!==null}function fn(t){return t!=null}function vf(t){return!t.trim().length}function m_(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const KA="Incorrect 'index' type",YA=t=>`Invalid value for key ${t}`,ZA=t=>`Pattern length exceeds max of ${t}.`,XA=t=>`Missing ${t} property in key`,QA=t=>`Property 'weight' in key '${t}' must be a positive integer`,B0=Object.prototype.hasOwnProperty;class WA{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(o=>{let r=g_(o);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(o=>{o.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function g_(t){let a=null,i=null,o=null,r=1,u=null;if(Kn(t)||Ea(t))o=t,a=I0(t),i=qf(t);else{if(!B0.call(t,"name"))throw new Error(XA("name"));const d=t.name;if(o=d,B0.call(t,"weight")&&(r=t.weight,r<=0))throw new Error(QA(d));a=I0(d),i=qf(d),u=t.getFn}return{path:a,id:i,weight:r,src:o,getFn:u}}function I0(t){return Ea(t)?t:t.split(".")}function qf(t){return Ea(t)?t.join("."):t}function JA(t,a){let i=[],o=!1;const r=(u,d,p)=>{if(fn(u))if(!d[p])i.push(u);else{let m=d[p];const g=u[m];if(!fn(g))return;if(p===d.length-1&&(Kn(g)||h_(g)||FA(g)))i.push($A(g));else if(Ea(g)){o=!0;for(let v=0,y=g.length;v<y;v+=1)r(g[v],d,p+1)}else d.length&&r(g,d,p+1)}};return r(t,Kn(a)?a.split("."):a,0),o?i:i[0]}const e2={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},t2={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,a)=>t.score===a.score?t.idx<a.idx?-1:1:t.score<a.score?-1:1},n2={location:0,threshold:.6,distance:100},a2={useExtendedSearch:!1,getFn:JA,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var _e={...t2,...e2,...n2,...a2};const s2=/[^ ]+/g;function i2(t=1,a=3){const i=new Map,o=Math.pow(10,a);return{get(r){const u=r.match(s2).length;if(i.has(u))return i.get(u);const d=1/Math.pow(u,.5*t),p=parseFloat(Math.round(d*o)/o);return i.set(u,p),p},clear(){i.clear()}}}class Kh{constructor({getFn:a=_e.getFn,fieldNormWeight:i=_e.fieldNormWeight}={}){this.norm=i2(i,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((i,o)=>{this._keysMap[i.id]=o})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Kn(this.docs[0])?this.docs.forEach((a,i)=>{this._addString(a,i)}):this.docs.forEach((a,i)=>{this._addObject(a,i)}),this.norm.clear())}add(a){const i=this.size();Kn(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,o=this.size();i<o;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!fn(a)||vf(a))return;let o={v:a,i,n:this.norm.get(a)};this.records.push(o)}_addObject(a,i){let o={i,$:{}};this.keys.forEach((r,u)=>{let d=r.getFn?r.getFn(a):this.getFn(a,r.path);if(fn(d)){if(Ea(d)){let p=[];const m=[{nestedArrIndex:-1,value:d}];for(;m.length;){const{nestedArrIndex:g,value:v}=m.pop();if(fn(v))if(Kn(v)&&!vf(v)){let y={v,i:g,n:this.norm.get(v)};p.push(y)}else Ea(v)&&v.forEach((y,x)=>{m.push({nestedArrIndex:x,value:y})})}o.$[u]=p}else if(Kn(d)&&!vf(d)){let p={v:d,n:this.norm.get(d)};o.$[u]=p}}}),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function v_(t,a,{getFn:i=_e.getFn,fieldNormWeight:o=_e.fieldNormWeight}={}){const r=new Kh({getFn:i,fieldNormWeight:o});return r.setKeys(t.map(g_)),r.setSources(a),r.create(),r}function o2(t,{getFn:a=_e.getFn,fieldNormWeight:i=_e.fieldNormWeight}={}){const{keys:o,records:r}=t,u=new Kh({getFn:a,fieldNormWeight:i});return u.setKeys(o),u.setIndexRecords(r),u}function Qr(t,{errors:a=0,currentLocation:i=0,expectedLocation:o=0,distance:r=_e.distance,ignoreLocation:u=_e.ignoreLocation}={}){const d=a/t.length;if(u)return d;const p=Math.abs(o-i);return r?d+p/r:p?1:d}function l2(t=[],a=_e.minMatchCharLength){let i=[],o=-1,r=-1,u=0;for(let d=t.length;u<d;u+=1){let p=t[u];p&&o===-1?o=u:!p&&o!==-1&&(r=u-1,r-o+1>=a&&i.push([o,r]),o=-1)}return t[u-1]&&u-o>=a&&i.push([o,u-1]),i}const Bs=32;function r2(t,a,i,{location:o=_e.location,distance:r=_e.distance,threshold:u=_e.threshold,findAllMatches:d=_e.findAllMatches,minMatchCharLength:p=_e.minMatchCharLength,includeMatches:m=_e.includeMatches,ignoreLocation:g=_e.ignoreLocation}={}){if(a.length>Bs)throw new Error(ZA(Bs));const v=a.length,y=t.length,x=Math.max(0,Math.min(o,y));let S=u,T=x;const E=p>1||m,N=E?Array(y):[];let C;for(;(C=t.indexOf(a,T))>-1;){let z=Qr(a,{currentLocation:C,expectedLocation:x,distance:r,ignoreLocation:g});if(S=Math.min(z,S),T=C+v,E){let O=0;for(;O<v;)N[C+O]=1,O+=1}}T=-1;let j=[],A=1,R=v+y;const w=1<<v-1;for(let z=0;z<v;z+=1){let O=0,$=R;for(;O<$;)Qr(a,{errors:z,currentLocation:x+$,expectedLocation:x,distance:r,ignoreLocation:g})<=S?O=$:R=$,$=Math.floor((R-O)/2+O);R=$;let J=Math.max(1,x-$+1),ae=d?y:Math.min(x+$,y)+v,se=Array(ae+2);se[ae+1]=(1<<z)-1;for(let U=ae;U>=J;U-=1){let Q=U-1,B=i[t.charAt(Q)];if(E&&(N[Q]=+!!B),se[U]=(se[U+1]<<1|1)&B,z&&(se[U]|=(j[U+1]|j[U])<<1|1|j[U+1]),se[U]&w&&(A=Qr(a,{errors:z,currentLocation:Q,expectedLocation:x,distance:r,ignoreLocation:g}),A<=S)){if(S=A,T=Q,T<=x)break;J=Math.max(1,2*x-T)}}if(Qr(a,{errors:z+1,currentLocation:x,expectedLocation:x,distance:r,ignoreLocation:g})>S)break;j=se}const G={isMatch:T>=0,score:Math.max(.001,A)};if(E){const z=l2(N,p);z.length?m&&(G.indices=z):G.isMatch=!1}return G}function c2(t){let a={};for(let i=0,o=t.length;i<o;i+=1){const r=t.charAt(i);a[r]=(a[r]||0)|1<<o-i-1}return a}const bc=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t);class y_{constructor(a,{location:i=_e.location,threshold:o=_e.threshold,distance:r=_e.distance,includeMatches:u=_e.includeMatches,findAllMatches:d=_e.findAllMatches,minMatchCharLength:p=_e.minMatchCharLength,isCaseSensitive:m=_e.isCaseSensitive,ignoreDiacritics:g=_e.ignoreDiacritics,ignoreLocation:v=_e.ignoreLocation}={}){if(this.options={location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:v},a=m?a:a.toLowerCase(),a=g?bc(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const y=(S,T)=>{this.chunks.push({pattern:S,alphabet:c2(S),startIndex:T})},x=this.pattern.length;if(x>Bs){let S=0;const T=x%Bs,E=x-T;for(;S<E;)y(this.pattern.substr(S,Bs),S),S+=Bs;if(T){const N=x-Bs;y(this.pattern.substr(N),N)}}else y(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=o?bc(a):a,this.pattern===a){let E={isMatch:!0,score:0};return r&&(E.indices=[[0,a.length-1]]),E}const{location:u,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:v}=this.options;let y=[],x=0,S=!1;this.chunks.forEach(({pattern:E,alphabet:N,startIndex:C})=>{const{isMatch:j,score:A,indices:R}=r2(a,E,N,{location:u+C,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:v});j&&(S=!0),x+=A,j&&R&&(y=[...y,...R])});let T={isMatch:S,score:S?x/this.chunks.length:1};return S&&r&&(T.indices=y),T}}class us{constructor(a){this.pattern=a}static isMultiMatch(a){return L0(a,this.multiRegex)}static isSingleMatch(a){return L0(a,this.singleRegex)}search(){}}function L0(t,a){const i=t.match(a);return i?i[1]:null}class u2 extends us{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){const i=a===this.pattern;return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class d2 extends us{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const o=a.indexOf(this.pattern)===-1;return{isMatch:o,score:o?0:1,indices:[0,a.length-1]}}}class f2 extends us{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){const i=a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class h2 extends us{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){const i=!a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class p2 extends us{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){const i=a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[a.length-this.pattern.length,a.length-1]}}}class m2 extends us{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){const i=!a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class b_ extends us{constructor(a,{location:i=_e.location,threshold:o=_e.threshold,distance:r=_e.distance,includeMatches:u=_e.includeMatches,findAllMatches:d=_e.findAllMatches,minMatchCharLength:p=_e.minMatchCharLength,isCaseSensitive:m=_e.isCaseSensitive,ignoreDiacritics:g=_e.ignoreDiacritics,ignoreLocation:v=_e.ignoreLocation}={}){super(a),this._bitapSearch=new y_(a,{location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:v})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class x_ extends us{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,o;const r=[],u=this.pattern.length;for(;(o=a.indexOf(this.pattern,i))>-1;)i=o+u,r.push([o,i-1]);const d=!!r.length;return{isMatch:d,score:d?0:1,indices:r}}}const Kf=[u2,x_,f2,h2,m2,p2,d2,b_],U0=Kf.length,g2=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,v2="|";function y2(t,a={}){return t.split(v2).map(i=>{let o=i.trim().split(g2).filter(u=>u&&!!u.trim()),r=[];for(let u=0,d=o.length;u<d;u+=1){const p=o[u];let m=!1,g=-1;for(;!m&&++g<U0;){const v=Kf[g];let y=v.isMultiMatch(p);y&&(r.push(new v(y,a)),m=!0)}if(!m)for(g=-1;++g<U0;){const v=Kf[g];let y=v.isSingleMatch(p);if(y){r.push(new v(y,a));break}}}return r})}const b2=new Set([b_.type,x_.type]);class x2{constructor(a,{isCaseSensitive:i=_e.isCaseSensitive,ignoreDiacritics:o=_e.ignoreDiacritics,includeMatches:r=_e.includeMatches,minMatchCharLength:u=_e.minMatchCharLength,ignoreLocation:d=_e.ignoreLocation,findAllMatches:p=_e.findAllMatches,location:m=_e.location,threshold:g=_e.threshold,distance:v=_e.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r,minMatchCharLength:u,findAllMatches:p,ignoreLocation:d,location:m,threshold:g,distance:v},a=i?a:a.toLowerCase(),a=o?bc(a):a,this.pattern=a,this.query=y2(this.pattern,this.options)}static condition(a,i){return i.useExtendedSearch}searchIn(a){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:o,isCaseSensitive:r,ignoreDiacritics:u}=this.options;a=r?a:a.toLowerCase(),a=u?bc(a):a;let d=0,p=[],m=0;for(let g=0,v=i.length;g<v;g+=1){const y=i[g];p.length=0,d=0;for(let x=0,S=y.length;x<S;x+=1){const T=y[x],{isMatch:E,indices:N,score:C}=T.search(a);if(E){if(d+=1,m+=C,o){const j=T.constructor.type;b2.has(j)?p=[...p,...N]:p.push(N)}}else{m=0,d=0,p.length=0;break}}if(d){let x={isMatch:!0,score:m/d};return o&&(x.indices=p),x}}return{isMatch:!1,score:1}}}const Yf=[];function _2(...t){Yf.push(...t)}function Zf(t,a){for(let i=0,o=Yf.length;i<o;i+=1){let r=Yf[i];if(r.condition(t,a))return new r(t,a)}return new y_(t,a)}const xc={AND:"$and",OR:"$or"},Xf={PATH:"$path",PATTERN:"$val"},Qf=t=>!!(t[xc.AND]||t[xc.OR]),S2=t=>!!t[Xf.PATH],T2=t=>!Ea(t)&&p_(t)&&!Qf(t),z0=t=>({[xc.AND]:Object.keys(t).map(a=>({[a]:t[a]}))});function __(t,a,{auto:i=!0}={}){const o=r=>{let u=Object.keys(r);const d=S2(r);if(!d&&u.length>1&&!Qf(r))return o(z0(r));if(T2(r)){const m=d?r[Xf.PATH]:u[0],g=d?r[Xf.PATTERN]:r[m];if(!Kn(g))throw new Error(YA(m));const v={keyId:qf(m),pattern:g};return i&&(v.searcher=Zf(g,a)),v}let p={children:[],operator:u[0]};return u.forEach(m=>{const g=r[m];Ea(g)&&g.forEach(v=>{p.children.push(o(v))})}),p};return Qf(t)||(t=z0(t)),o(t)}function k2(t,{ignoreFieldNorm:a=_e.ignoreFieldNorm}){t.forEach(i=>{let o=1;i.matches.forEach(({key:r,norm:u,score:d})=>{const p=r?r.weight:null;o*=Math.pow(d===0&&p?Number.EPSILON:d,(p||1)*(a?1:u))}),i.score=o})}function C2(t,a){const i=t.matches;a.matches=[],fn(i)&&i.forEach(o=>{if(!fn(o.indices)||!o.indices.length)return;const{indices:r,value:u}=o;let d={indices:r,value:u};o.key&&(d.key=o.key.src),o.idx>-1&&(d.refIndex=o.idx),a.matches.push(d)})}function E2(t,a){a.score=t.score}function N2(t,a,{includeMatches:i=_e.includeMatches,includeScore:o=_e.includeScore}={}){const r=[];return i&&r.push(C2),o&&r.push(E2),t.map(u=>{const{idx:d}=u,p={item:a[d],refIndex:d};return r.length&&r.forEach(m=>{m(u,p)}),p})}class eo{constructor(a,i={},o){this.options={..._e,...i},this.options.useExtendedSearch,this._keyStore=new WA(this.options.keys),this.setCollection(a,o)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof Kh))throw new Error(KA);this._myIndex=i||v_(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){fn(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let o=0,r=this._docs.length;o<r;o+=1){const u=this._docs[o];a(u,o)&&(this.removeAt(o),o-=1,r-=1,i.push(u))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:o,includeScore:r,shouldSort:u,sortFn:d,ignoreFieldNorm:p}=this.options;let m=Kn(a)?Kn(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return k2(m,{ignoreFieldNorm:p}),u&&m.sort(d),h_(i)&&i>-1&&(m=m.slice(0,i)),N2(m,this._docs,{includeMatches:o,includeScore:r})}_searchStringList(a){const i=Zf(a,this.options),{records:o}=this._myIndex,r=[];return o.forEach(({v:u,i:d,n:p})=>{if(!fn(u))return;const{isMatch:m,score:g,indices:v}=i.searchIn(u);m&&r.push({item:u,idx:d,matches:[{score:g,value:u,norm:p,indices:v}]})}),r}_searchLogical(a){const i=__(a,this.options),o=(p,m,g)=>{if(!p.children){const{keyId:y,searcher:x}=p,S=this._findMatches({key:this._keyStore.get(y),value:this._myIndex.getValueForItemAtKeyId(m,y),searcher:x});return S&&S.length?[{idx:g,item:m,matches:S}]:[]}const v=[];for(let y=0,x=p.children.length;y<x;y+=1){const S=p.children[y],T=o(S,m,g);if(T.length)v.push(...T);else if(p.operator===xc.AND)return[]}return v},r=this._myIndex.records,u={},d=[];return r.forEach(({$:p,i:m})=>{if(fn(p)){let g=o(i,p,m);g.length&&(u[m]||(u[m]={idx:m,item:p,matches:[]},d.push(u[m])),g.forEach(({matches:v})=>{u[m].matches.push(...v)}))}}),d}_searchObjectList(a){const i=Zf(a,this.options),{keys:o,records:r}=this._myIndex,u=[];return r.forEach(({$:d,i:p})=>{if(!fn(d))return;let m=[];o.forEach((g,v)=>{m.push(...this._findMatches({key:g,value:d[v],searcher:i}))}),m.length&&u.push({idx:p,item:d,matches:m})}),u}_findMatches({key:a,value:i,searcher:o}){if(!fn(i))return[];let r=[];if(Ea(i))i.forEach(({v:u,i:d,n:p})=>{if(!fn(u))return;const{isMatch:m,score:g,indices:v}=o.searchIn(u);m&&r.push({score:g,key:a,value:u,idx:d,norm:p,indices:v})});else{const{v:u,n:d}=i,{isMatch:p,score:m,indices:g}=o.searchIn(u);p&&r.push({score:m,key:a,value:u,norm:d,indices:g})}return r}}eo.version="7.1.0";eo.createIndex=v_;eo.parseIndex=o2;eo.config=_e;eo.parseQuery=__;_2(x2);function j2(t,a,i,o){if(!a.trim())return[];const r=.3;return new eo(t,{keys:i,threshold:r,ignoreLocation:!0,includeScore:!0,includeMatches:!0,minMatchCharLength:2}).search(a).map(m=>({item:m.item,score:m.score??1,matches:(m.matches??[]).map(g=>({key:g.key??"",indices:g.indices}))}))}const Wf={not_started:{color:"var(--text-tertiary)",icon:"○",label:"Not Started"},working:{color:"var(--accent-green)",icon:"●",label:"Working"},paused:{color:"var(--accent-yellow)",icon:"◉",label:"Paused"},complete:{color:"var(--accent-green)",icon:"✓",label:"Complete"},failed:{color:"var(--accent-red)",icon:"✗",label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:"⦸",label:"Blocked"}};function ls(t){return t==="blocked"?Wf.blocked:Wf[Yh(t)]}const w2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function A2(t){return w2[Yh(t)]??"statusPending"}const D2=["working","paused","failed","not_started","blocked","complete"],V0=["not_started","working","paused","complete","failed"],R2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Yh(t){return t in Wf&&t!=="blocked"?t:R2[t]??"not_started"}const M2={not_started:"--text-tertiary",working:"--accent-green",paused:"--accent-yellow",complete:"--accent-green",failed:"--accent-red",pending:"--text-tertiary",assigned:"--text-tertiary",in_progress:"--accent-green",review:"--accent-yellow",done:"--accent-green",waiting_input:"--accent-yellow"};function O2(t){if(t.length===0)return[];const a=[...t].sort((o,r)=>o[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let o=1;o<a.length;o++){const r=i[i.length-1],[u,d]=a[o];u<=r[1]+1?r[1]=Math.max(r[1],d):i.push([u,d])}return i}function S_({text:t,indices:a,highlightClass:i}){if(!a||a.length===0)return c.jsx(c.Fragment,{children:t});const o=O2(a),r=[];let u=0;for(const[d,p]of o)d>u&&r.push(c.jsx("span",{children:t.slice(u,d)},`p${u}`)),r.push(c.jsx("mark",{className:i,children:t.slice(d,p+1)},`m${d}`)),u=p+1;return u<t.length&&r.push(c.jsx("span",{children:t.slice(u)},`p${u}`)),c.jsx(c.Fragment,{children:r})}function B2(t){const a=new Map(t.map(o=>[o.id,{...o,children:[]}])),i=[];for(const o of a.values())o.parentTaskId&&a.has(o.parentTaskId)?a.get(o.parentTaskId).children.push(o):i.push(o);for(const o of a.values())o.children.sort((r,u)=>r.sortOrder-u.sortOrder);return i.sort((o,r)=>o.sortOrder-r.sortOrder)}function I2(t,a){const i=new Map;for(const u of t){const p=u.dependsOn.length>0&&u.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":u.status,m=i.get(p);m?m.push(u):i.set(p,[u])}const o=[],r=new Set;for(const u of D2){r.add(u);const d=i.get(u);if(d&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ls(u);o.push({status:u,label:p.label,style:p,tasks:d})}}for(const[u,d]of i)if(!r.has(u)&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ls(u);o.push({status:u,label:p.label,style:p,tasks:d})}return o}const L2="_container_z4i38_1",U2="_header_z4i38_5",z2="_headerActions_z4i38_17",V2="_searchInput_z4i38_23",H2="_searchHighlight_z4i38_56",P2="_groupToggle_z4i38_62",G2="_groupToggleActive_z4i38_89",$2="_addButton_z4i38_93",F2="_taskRow_z4i38_120",q2="_selected_z4i38_140",K2="_expandArrow_z4i38_150",Y2="_expanded_z4i38_157",Z2="_leafSpacer_z4i38_161",X2="_taskStatusIcon_z4i38_166",Q2="_taskTitle_z4i38_170",W2="_workspaceBadge_z4i38_177",J2="_childCountBadge_z4i38_195",eD="_dependencyBadge_z4i38_208",tD="_blockedBadge_z4i38_220",nD="_addChildButton_z4i38_225",aD="_emptyState_z4i38_268",sD="_statusGroupHeader_z4i38_275",iD="_statusGroupIcon_z4i38_294",oD="_statusGroupLabel_z4i38_298",lD="_statusGroupCount_z4i38_303",Le={container:L2,header:U2,headerActions:z2,searchInput:V2,searchHighlight:H2,groupToggle:P2,groupToggleActive:G2,addButton:$2,taskRow:F2,selected:q2,expandArrow:K2,expanded:Y2,leafSpacer:Z2,taskStatusIcon:X2,taskTitle:Q2,workspaceBadge:W2,childCountBadge:J2,dependencyBadge:eD,blockedBadge:tD,addChildButton:nD,emptyState:aD,statusGroupHeader:sD,statusGroupIcon:iD,statusGroupLabel:oD,statusGroupCount:lD},rD=[{name:"title",weight:2},{name:"description",weight:1}],T_=16,cD=16,k_="grackle-task-group-by-status";function H0(){try{return localStorage.getItem(k_)==="true"}catch{return!1}}function uD(t){try{localStorage.setItem(k_,String(t))}catch{}}function dD({group:t,isExpanded:a,onToggle:i,selectedTaskId:o,navigate:r,titleHighlights:u,workspaceNames:d}){return c.jsxs("div",{"data-testid":`status-group-${t.status}`,children:[c.jsxs("div",{className:Le.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i())},children:[c.jsx("span",{className:`${Le.expandArrow} ${a?Le.expanded:""}`,children:"▸"}),c.jsx("span",{className:Le.statusGroupIcon,style:{color:t.style.color},children:t.style.icon}),c.jsx("span",{className:Le.statusGroupLabel,children:t.label}),c.jsx("span",{className:Le.statusGroupCount,children:t.tasks.length})]}),c.jsx(Wn,{children:a&&c.jsx(Et.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:t.tasks.map(p=>{const m=ls(p.status),g=o===p.id,v=p.parentTaskId||!p.workspaceId?void 0:d.get(p.workspaceId);return c.jsxs("div",{onClick:()=>r(ka(p.id)),className:`${Le.taskRow} ${g?Le.selected:""}`,style:{"--task-indent":`${T_}px`},"data-task-id":p.id,children:[c.jsx("span",{className:Le.leafSpacer}),c.jsx("span",{className:Le.taskStatusIcon,style:{color:m.color},children:m.icon}),c.jsx("span",{className:Le.taskTitle,title:p.title,children:c.jsx(S_,{text:p.title,indices:u.get(p.id),highlightClass:Le.searchHighlight})}),v&&c.jsx("span",{className:Le.workspaceBadge,title:v,children:v})]},p.id)})})})]})}function C_({node:t,depth:a,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,taskStatusById:d,titleHighlights:p,workspaceNames:m}){const g=ls(t.status),v=t.dependsOn.length>0&&t.dependsOn.some(C=>d.get(C)!=="complete"),y=i.has(t.id),x=t.children.length>0,S=r===t.id,T=T_+a*cD,N=a===0&&!t.parentTaskId&&t.workspaceId?m.get(t.workspaceId):void 0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{onClick:()=>u(ka(t.id)),className:`${Le.taskRow} ${S?Le.selected:""}`,style:{"--task-indent":`${T}px`},"data-task-id":t.id,children:[x&&c.jsx("span",{className:`${Le.expandArrow} ${y?Le.expanded:""}`,role:"button",tabIndex:0,"aria-label":y?"Collapse task":"Expand task",onClick:C=>{C.stopPropagation(),o(t.id)},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),C.stopPropagation(),o(t.id))},children:"▸"}),!x&&c.jsx("span",{className:Le.leafSpacer}),c.jsx("span",{className:Le.taskStatusIcon,style:{color:g.color},children:g.icon}),c.jsx("span",{className:Le.taskTitle,title:t.title,children:c.jsx(S_,{text:t.title,indices:p.get(t.id),highlightClass:Le.searchHighlight})}),N&&c.jsx("span",{className:Le.workspaceBadge,title:N,children:N}),x&&c.jsxs("span",{className:Le.childCountBadge,children:[t.children.filter(C=>C.status==="complete").length,"/",t.children.length]}),t.dependsOn.length>0&&c.jsx("span",{className:`${Le.dependencyBadge} ${v?Le.blockedBadge:""}`,title:`Depends on: ${t.dependsOn.join(", ")}`,children:v?"blocked":"dep"}),a<PA&&c.jsx("button",{onClick:C=>{C.stopPropagation(),u(Qi(t.workspaceId,t.id))},title:"Add child task","aria-label":"Add child task",className:Le.addChildButton,children:"+"})]}),c.jsx(Wn,{children:x&&y&&c.jsx(Et.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:t.children.map(C=>c.jsx(C_,{node:C,depth:a+1,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,taskStatusById:d,titleHighlights:p,workspaceNames:m},C.id))})})]})}function fD({workspaces:t,tasks:a}){const i=Mt(),[o,r]=b.useState(new Set),[u,d]=b.useState(new Set),[p,m]=b.useState(H0),[g,v]=b.useState(H0),[y,x]=b.useState(new Map),S=kt("/tasks/:taskId/*"),T=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,E=b.useMemo(()=>new Map(a.map(U=>[U.id,U.status])),[a]),N=b.useMemo(()=>new Map(t.map(U=>[U.id,U.name])),[t]),C=()=>{const U=!p;uD(U),m(U),U&&(v(!0),x(new Map))},j=U=>{x(Q=>{const B=new Map(Q),q=B.has(U)?B.get(U):g;return B.set(U,!q),B})},A=U=>y.has(U)?y.get(U):g,R=U=>{r(Q=>{const B=new Set(Q);return B.has(U)?(B.delete(U),d(q=>new Set(q).add(U))):(B.add(U),d(q=>{const oe=new Set(q);return oe.delete(U),oe})),B})};b.useEffect(()=>{const U=new Set(a.filter(Q=>Q.parentTaskId).map(Q=>Q.parentTaskId));U.size>0&&r(Q=>{const B=new Set(Q);for(const q of U)u.has(q)||B.add(q);return B})},[a,u]);const[w,G]=b.useState(""),{directMatchTaskIds:z,treeMatchTaskIds:O,titleHighlights:$}=b.useMemo(()=>{if(!w.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const U=j2(a,w,rD),Q=new Set(U.map(le=>le.item.id)),B=new Map;for(const le of U){const F=le.matches.find(ye=>ye.key==="title");F&&B.set(le.item.id,F.indices)}const q=new Set(Q),oe=new Map(a.map(le=>[le.id,le]));for(const le of[...Q]){let F=oe.get(le);for(;F!=null&&F.parentTaskId;)q.add(F.parentTaskId),F=oe.get(F.parentTaskId)}return{directMatchTaskIds:Q,treeMatchTaskIds:q,titleHighlights:B}},[w,a]),J=z!==null,ae=J?p?z:O:null,se=ae?a.filter(U=>ae.has(U.id)):a,te=p?[]:B2(se);return c.jsxs("div",{className:Le.container,children:[c.jsxs("div",{className:Le.header,children:[c.jsx("span",{children:"Tasks"}),c.jsxs("div",{className:Le.headerActions,children:[c.jsx("button",{className:`${Le.groupToggle} ${p?Le.groupToggleActive:""}`,onClick:C,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,title:p?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),c.jsx("button",{className:Le.addButton,onClick:()=>i(Qi()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&c.jsx("input",{type:"text",value:w,onChange:U=>G(U.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Le.searchInput,"data-testid":"sidebar-search"}),p?I2(se,E).map(U=>c.jsx(dD,{group:U,isExpanded:A(U.status),onToggle:()=>j(U.status),selectedTaskId:T,navigate:i,titleHighlights:$,workspaceNames:N},U.status)):te.map(U=>c.jsx(C_,{node:U,depth:0,expandedTasks:o,toggleTask:R,selectedTaskId:T,navigate:i,taskStatusById:E,titleHighlights:$,workspaceNames:N},U.id)),se.length===0&&!J&&c.jsx("div",{className:Le.emptyState,children:"No tasks yet. Click + to create one."}),se.length===0&&J&&c.jsx("div",{className:Le.emptyState,children:"No matching tasks"})]})}const hD="_nav_14i94_1",pD="_tab_14i94_24",mD="_tabActive_14i94_62",gD="_tabLabel_14i94_75",vD="_statusDot_14i94_81",yD="_pulse_14i94_87",bD="_addButton_14i94_99",xD="_empty_14i94_132",es={nav:hD,tab:pD,tabActive:mD,tabLabel:gD,statusDot:vD,pulse:yD,addButton:bD,empty:xD},_D={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function SD({environments:t}){const a=Mt(),i=b.useRef(null),o=kt("/environments/:environmentId"),r=kt("/environments/:environmentId/edit"),u=kt("/environments/:environmentId/workspaces/:workspaceId"),d=kt("/environments/:environmentId/workspaces/:workspaceId/*"),p=(o==null?void 0:o.params.environmentId)??(r==null?void 0:r.params.environmentId)??(u==null?void 0:u.params.environmentId)??(d==null?void 0:d.params.environmentId),m=p==="new"?void 0:p,g=b.useCallback(x=>{a($i(x))},[a]),v=b.useCallback(x=>{var C;const S=(C=i.current)==null?void 0:C.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const T=Array.from(S).findIndex(j=>j===document.activeElement),E=T>=0?T:t.findIndex(j=>j.id===m);let N=E;if(x.key==="ArrowDown")x.preventDefault(),N=(E+1)%S.length;else if(x.key==="ArrowUp")x.preventDefault(),N=(E-1+S.length)%S.length;else if(x.key==="Home")x.preventDefault(),N=0;else if(x.key==="End")x.preventDefault(),N=S.length-1;else return;N<t.length&&a($i(t[N].id)),S[N].focus()},[m,t,a]),y=m??(t.length>0?t[0].id:void 0);return c.jsxs("div",{className:es.nav,"data-testid":"environment-nav",children:[c.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:v,children:t.map(x=>{const S=x.id===m,T=x.id===y,E=_D[x.status]||"var(--text-tertiary)",N=x.status==="connected";return c.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:T?0:-1,className:`${es.tab} ${S?es.tabActive:""}`,onClick:()=>g(x.id),"data-testid":"env-nav-item",children:[c.jsx("span",{className:`${es.statusDot} ${N?es.pulse:""}`,style:{color:E},children:"●"}),c.jsx("span",{className:es.tabLabel,title:x.displayName||x.id,children:x.displayName||x.id})]},x.id)})}),c.jsx("button",{type:"button",className:es.addButton,onClick:()=>a(oC),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),t.length===0&&c.jsx("div",{className:es.empty,children:"No environments yet."})]})}const TD="_nav_1bhou_1",kD="_tab_1bhou_24",CD="_tabIcon_1bhou_62",ED="_tabActive_1bhou_68",Wr={nav:TD,tab:kD,tabIcon:CD,tabActive:ED},xa=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function ND(){var d;const t=At(),a=Mt(),i=b.useRef(null),o=((d=xa.find(p=>t.pathname===`${ol}/${p.path}`))==null?void 0:d.path)??xa[0].path,r=b.useCallback(p=>{a(`${ol}/${p}`)},[a]),u=b.useCallback(p=>{var S,T;const m=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(E=>E===document.activeElement),v=g>=0?g:xa.findIndex(E=>E.path===o);let y=v;if(p.key==="ArrowDown")p.preventDefault(),y=(v+1)%xa.length;else if(p.key==="ArrowUp")p.preventDefault(),y=(v-1+xa.length)%xa.length;else if(p.key==="Home")p.preventDefault(),y=0;else if(p.key==="End")p.preventDefault(),y=xa.length-1;else return;const x=xa[y].path;a(`${ol}/${x}`),(T=m[y])==null||T.focus()},[o,a]);return c.jsx("nav",{className:Wr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:u,children:xa.map(p=>{const m=p.path===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Wr.tab} ${m?Wr.tabActive:""}`,onClick:()=>r(p.path),children:[c.jsx("span",{className:Wr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const jD="_nav_1snmp_1",wD="_searchForm_1snmp_8",AD="_searchInput_1snmp_15",DD="_searchButton_1snmp_33",RD="_clearButton_1snmp_68",MD="_workspaceSelect_1snmp_85",OD="_listHeader_1snmp_99",BD="_nodeList_1snmp_108",ID="_nodeItem_1snmp_116",LD="_indicator_1snmp_129",UD="_label_1snmp_136",zD="_badge_1snmp_145",An={nav:jD,searchForm:wD,searchInput:AD,searchButton:DD,clearButton:RD,workspaceSelect:MD,listHeader:OD,nodeList:BD,nodeItem:ID,indicator:LD,label:UD,badge:zD};function VD(){const{knowledge:t,workspaces:a}=ut(),[i,o]=b.useState(""),r=b.useCallback(m=>{m.preventDefault(),i.trim()&&t.search(i.trim())},[i,t]),u=b.useCallback(()=>{o(""),t.clearSearch()},[t]),d=b.useCallback(m=>{t.selectNode(m)},[t]),p=b.useCallback(m=>{o(""),t.loadRecent(m||void 0)},[t]);return c.jsxs("div",{className:An.nav,"data-testid":"knowledge-nav",children:[c.jsxs("form",{className:An.searchForm,onSubmit:r,children:[c.jsx("input",{className:An.searchInput,type:"text",placeholder:"Search...",value:i,onChange:m=>{o(m.target.value)},"data-testid":"knowledge-search-input"}),c.jsx("button",{type:"submit",className:An.searchButton,disabled:t.loading,children:"Go"})]}),t.searchQuery&&c.jsx("button",{type:"button",className:An.clearButton,onClick:u,children:"Clear search"}),c.jsxs("select",{className:An.workspaceSelect,onChange:m=>{p(m.target.value)},"data-testid":"knowledge-workspace-filter",children:[c.jsx("option",{value:"",children:"All workspaces"}),a.map(m=>c.jsx("option",{value:m.id,children:m.name},m.id))]}),c.jsxs("div",{className:An.listHeader,children:["Nodes (",t.graphData.nodes.length,")"]}),c.jsx("ul",{className:An.nodeList,children:t.graphData.nodes.map(m=>c.jsxs("li",{className:An.nodeItem,onClick:()=>{d(m.id)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d(m.id))},role:"button",tabIndex:0,children:[c.jsx("span",{className:An.indicator,style:{backgroundColor:m.kind==="reference"?"#4A9EFF":m.category==="decision"?"#22C55E":m.category==="concept"?"#A855F7":m.category==="snippet"?"#6B7280":"#EAB308"}}),c.jsx("span",{className:An.label,children:m.label}),c.jsx("span",{className:An.badge,children:m.kind==="reference"?m.sourceType:m.category})]},m.id))})]})}function HD(){const{workspaces:t,tasks:a}=ut(),i=b.useMemo(()=>c.jsx(fD,{workspaces:t,tasks:a}),[t,a]);return Nc(i),c.jsx(Hs,{})}function PD(){const{environments:t}=ut(),a=b.useMemo(()=>c.jsx(SD,{environments:t}),[t]);return Nc(a),c.jsx(Hs,{})}function GD(){const t=b.useMemo(()=>c.jsx(ND,{}),[]);return Nc(t),c.jsx(Hs,{})}function $D(){const t=b.useMemo(()=>c.jsx(VD,{}),[]);return Nc(t),c.jsx(Hs,{})}const FD="_bar_tnfsh_1",qD="_btnPrimary_tnfsh_32",KD="_statusText_tnfsh_85",YD="_statusCompleted_tnfsh_90",ZD="_statusFailed_tnfsh_94",XD="_statusBlocked_tnfsh_98",QD="_hintText_tnfsh_103",ft={bar:FD,btnPrimary:qD,statusText:KD,statusCompleted:YD,statusFailed:ZD,statusBlocked:XD,hintText:QD};function WD({sessions:t,tasks:a,environments:i}){const o=Mt(),r=At(),u=kt("/sessions/:sessionId"),d=kt("/tasks/:taskId"),p=kt("/tasks/:taskId/stream"),m=kt("/tasks/:taskId/findings"),g=kt("/tasks/:taskId/edit"),v=kt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),y=kt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),x=kt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=kt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),T=kt("/sessions/new"),E=kt("/environments/:environmentId/workspaces/:workspaceId"),N=kt("/tasks/new"),C=kt("/chat"),j=kt("/"),A=kt("/settings/*"),R=u==null?void 0:u.params.sessionId,w=(d==null?void 0:d.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(v==null?void 0:v.params.taskId)??(y==null?void 0:y.params.taskId)??(x==null?void 0:x.params.taskId)??(S==null?void 0:S.params.taskId),G=v??y??x??S,z=(G==null?void 0:G.params.environmentId)??(E==null?void 0:E.params.environmentId),O=r.pathname.startsWith("/environments")&&!E&&!G,$=!!C,J=!!T,ae=!!E&&!v&&!y&&!x&&!S,se=!!N;if(!!j&&!J&&!ae&&!se||!!A||(!!g||!!S)||se||O||J)return c.jsx(c.Fragment,{});if($)return i.find(q=>q.adapterType==="local"&&q.status==="connected")?c.jsx(c.Fragment,{}):c.jsx("div",{className:ft.bar,children:c.jsx("span",{className:ft.hintText,children:"Add a local environment to start chatting"})});if(ae)return c.jsx("div",{className:ft.bar,children:c.jsx("span",{className:ft.hintText,children:"Select a task or click + to create one"})});if(w){const B=a.find(le=>le.id===w);if(!B)return c.jsx("div",{className:ft.bar,children:c.jsx("span",{className:ft.hintText,children:"Loading..."})});const q=new Map(a.map(le=>[le.id,le])),oe=B.dependsOn.some(le=>{const F=q.get(le);return F!==void 0&&F.status!=="complete"});if(B.status==="not_started"){const le=oe?B.dependsOn.map(F=>q.get(F)).filter(F=>F&&F.status!=="complete").map(F=>F.title):[];return c.jsx("div",{className:ft.bar,children:oe?c.jsxs("span",{className:ft.statusBlocked,children:["Blocked by: ",le.join(", ")]}):c.jsx("span",{className:ft.hintText,children:"Use the buttons above to start or manage this task"})})}if(B.status==="working"||B.status==="paused"){const le=B.latestSessionId||void 0,F=le?t.find(Te=>Te.id===le):void 0;return F&&F.status!=="stopped"?c.jsx(c.Fragment,{}):c.jsx("div",{className:ft.bar,children:c.jsx("span",{className:ft.hintText,children:"Waiting for agent..."})})}if(B.status==="complete")return c.jsxs("div",{className:ft.bar,children:[c.jsx("span",{className:`${ft.statusText} ${ft.statusCompleted}`,children:"Task completed"}),c.jsx("button",{onClick:()=>o(Qi(B.workspaceId,void 0,z)),className:ft.btnPrimary,children:"+ New Task"})]});if(B.status==="failed")return c.jsx("div",{className:ft.bar,children:c.jsx("span",{className:`${ft.statusText} ${ft.statusFailed}`,children:"Task failed"})})}if(R){const B=t.find(le=>le.id===R),q=(B==null?void 0:B.status)==="stopped";if(B!==void 0&&!q)return c.jsx(c.Fragment,{});if(q)return c.jsxs("div",{className:ft.bar,children:[c.jsxs("span",{className:`${ft.statusText} ${ft.hintText}`,children:["Session ",B.endReason||B.status]}),c.jsx("button",{onClick:()=>o(Sb(B.environmentId)),className:ft.btnPrimary,children:"+ New Chat"})]})}return c.jsx("div",{className:ft.bar,children:c.jsx("span",{className:ft.hintText,children:"Loading..."})})}const JD="_toast_da8ll_1",eR="_success_da8ll_18",tR="_icon_da8ll_22",nR="_error_da8ll_25",aR="_warning_da8ll_32",sR="_info_da8ll_38",iR="_message_da8ll_53",oR="_close_da8ll_60",Jo={toast:JD,success:eR,icon:tR,error:nR,warning:aR,info:sR,message:iR,close:oR},lR={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function rR({toast:t,onDismiss:a}){return b.useEffect(()=>{const i=setTimeout(()=>a(t.id),t.duration);return()=>clearTimeout(i)},[t.id,t.duration,a]),c.jsxs(Et.div,{className:`${Jo.toast} ${Jo[t.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[c.jsx("span",{className:Jo.icon,"aria-hidden":"true",children:lR[t.variant]}),c.jsx("span",{className:Jo.message,children:t.message}),c.jsx("button",{type:"button",className:Jo.close,onClick:()=>a(t.id),"aria-label":"Dismiss notification",children:"×"})]})}const cR="_container_qqse2_1",uR={container:cR};function dR(){const{toasts:t,dismissToast:a}=Ps();return c.jsx("div",{className:uR.container,"data-testid":"toast-container",children:c.jsx(Wn,{children:t.map(i=>c.jsx(rR,{toast:i,onDismiss:a},i.id))})})}const fR="_breadcrumbs_17or2_1",hR="_list_17or2_11",pR="_item_17or2_21",mR="_separator_17or2_28",gR="_link_17or2_34",vR="_current_17or2_57",Mi={breadcrumbs:fR,list:hR,item:pR,separator:mR,link:gR,current:vR},yR="›";function $s({segments:t}){return c.jsx("nav",{className:Mi.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:c.jsx("ol",{className:Mi.list,children:t.map((a,i)=>{const o=i===t.length-1;return c.jsxs("li",{className:Mi.item,children:[i>0&&c.jsx("span",{className:Mi.separator,"aria-hidden":"true",children:yR}),a.url&&!o?c.jsx(ch,{className:Mi.link,to:a.url,title:a.label,children:a.label}):c.jsx("span",{className:Mi.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function Jf(){Jf=function(r,u){return new i(r,void 0,u)};var t=RegExp.prototype,a=new WeakMap;function i(r,u,d){var p=new RegExp(r,u);return a.set(p,d||a.get(r)),_c(p,i.prototype)}function o(r,u){var d=a.get(u);return Object.keys(d).reduce(function(p,m){var g=d[m];if(typeof g=="number")p[m]=r[g];else{for(var v=0;r[g[v]]===void 0&&v+1<g.length;)v++;p[m]=r[g[v]]}return p},Object.create(null))}return(function(r,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(u&&u.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),u&&_c(r,u)})(i,RegExp),i.prototype.exec=function(r){var u=t.exec.call(this,r);if(u){u.groups=o(u,this);var d=u.indices;d&&(d.groups=o(d,this))}return u},i.prototype[Symbol.replace]=function(r,u){if(typeof u=="string"){var d=a.get(this);return t[Symbol.replace].call(this,r,u.replace(/\$<([^>]+)>/g,function(m,g){var v=d[g];return"$"+(Array.isArray(v)?v.join("$"):v)}))}if(typeof u=="function"){var p=this;return t[Symbol.replace].call(this,r,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(o(m,p)),u.apply(this,m)})}return t[Symbol.replace].call(this,r,u)},Jf.apply(this,arguments)}function _c(t,a){return _c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},_c(t,a)}function P0(t,a){(a==null||a>t.length)&&(a=t.length);for(var i=0,o=new Array(a);i<a;i++)o[i]=t[i];return o}function yf(t,a){var i=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=(function(r,u){if(r){if(typeof r=="string")return P0(r,u);var d=Object.prototype.toString.call(r).slice(8,-1);return d==="Object"&&r.constructor&&(d=r.constructor.name),d==="Map"||d==="Set"?Array.from(r):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?P0(r,u):void 0}})(t))||a){i&&(t=i);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
99
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var bR=(function(t){return function(a){return a===void 0&&(a={}),(function(o,r){if(r&&!o.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(t,a.defaultLanguage),function(o){XS(o,"element",i)};function i(o,r,u){var d,p;if(u&&u.tagName==="pre"&&o.tagName==="code"){var m=(o==null||(d=o.data)==null?void 0:d.meta)||(o==null||(p=o.properties)==null?void 0:p.metastring)||"";o.properties.className?typeof o.properties.className=="boolean"?o.properties.className=[]:Array.isArray(o.properties.className)||(o.properties.className=[o.properties.className]):o.properties.className=[];var g,v,y=(function(w){for(var G,z=yf(w.properties.className);!(G=z()).done;){var O=G.value;if(O.slice(0,9)==="language-")return O.slice(9).toLowerCase()}return null})(o);if(!y&&a.defaultLanguage&&o.properties.className.push("language-"+(y=a.defaultLanguage)),o.properties.className.push("code-highlight"),y)try{var x,S;S=(x=y)!=null&&x.includes("diff-")?y.split("-")[1]:y,g=t.highlight(Gr(o),S),u.properties.className=(u.properties.className||[]).concat("language-"+S)}catch(w){if(!a.ignoreMissing||!/Unknown language/.test(w.message))throw w;g=o}else g=o;g.children=(v=1,function w(G){return G.reduce(function(z,O){if(O.type==="text"){var $=O.value,J=($.match(/\n/g)||"").length;if(J===0)O.position={start:{line:v,column:1},end:{line:v,column:1}},z.push(O);else for(var ae,se=$.split(`
|
|
100
|
-
`),te=yf(se.entries());!(ae=te()).done;){var U=ae.value,Q=U[0],B=U[1];z.push({type:"text",value:Q===se.length-1?B:B+`
|
|
101
|
-
`,position:{start:{line:v+Q,column:1},end:{line:v+Q,column:1}}})}return v+=J,z}if(Object.prototype.hasOwnProperty.call(O,"children")){var q=v;return O.children=w(O.children),z.push(O),O.position={start:{line:q,column:1},end:{line:v,column:1}},z}return z.push(O),z},[])})(g.children),g.position=g.children.length>0?{start:{line:g.children[0].position.start.line,column:0},end:{line:g.children[g.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var T,E=(function(w){var G=/{([\d,-]+)}/,z=w.split(",").map(function(J){return J.trim()}).join();if(G.test(z)){var O=G.exec(z)[1],$=WS(O);return function(J){return $.includes(J+1)}}return function(){return!1}})(m),N=(function(w){var G=Jf(/showLineNumbers=(\d+)/i,{lines:1});if(G.test(w)){var z=G.exec(w);return Number(z.groups.lines)}return 1})(m),C=(function(w){for(var G=new Array(w),z=0;z<w;z++)G[z]={type:"element",tagName:"span",properties:{className:[]},children:[]};return G})(g.position.end.line),j=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],A=function(){var w,G,z=T.value,O=z[0],$=z[1];$.properties.className=["code-line"];var J=JS(g,function(ae){return ae.position.start.line<=O+1&&ae.position.end.line>=O+1});$.children=J.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(y))&&!j.some(function(ae){return m.toLowerCase().includes(ae)})&&($.properties.line=[(O+N).toString()],$.properties.className.push("line-number")),E(O)&&$.properties.className.push("highlight-line"),(y==="diff"||(w=y)!=null&&w.includes("diff-"))&&Gr($).substring(0,1)==="-"?$.properties.className.push("deleted"):(y==="diff"||(G=y)!=null&&G.includes("diff-"))&&Gr($).substring(0,1)==="+"&&$.properties.className.push("inserted")},R=yf(C.entries());!(T=R()).done;)A();C.length>0&&Gr(C[C.length-1]).trim()===""&&C.pop(),o.children=C}}}})(QS);function E_(t){if(t>=1e6)return`${(t/1e6).toFixed(1)}M`;if(t>=1e3){const a=Number((t/1e3).toFixed(1));return a>=1e3?`${(t/1e6).toFixed(1)}M`:`${a.toFixed(1)}k`}return String(t)}function Yi(t){return t===0?"-":t<.01?`$${t.toFixed(4)}`:`$${t.toFixed(2)}`}const xR="_systemContextEvent_1qbiw_1",_R="_systemContextHeader_1qbiw_7",SR="_systemContextBadge_1qbiw_28",TR="_systemContextToggle_1qbiw_37",kR="_systemContextPre_1qbiw_43",CR="_systemContextEllipsis_1qbiw_54",ER="_systemEvent_1qbiw_58",NR="_systemTimestamp_1qbiw_65",jR="_textEvent_1qbiw_69",wR="_toolUseEvent_1qbiw_155",AR="_toolUseHeader_1qbiw_175",DR="_toolUsePrefix_1qbiw_182",RR="_toolUseName_1qbiw_187",MR="_toolUseArgs_1qbiw_192",OR="_toolResultEvent_1qbiw_203",BR="_toolResultHeader_1qbiw_208",IR="_toolResultIndicatorOk_1qbiw_232",LR="_toolResultIndicatorError_1qbiw_239",UR="_toolResultLabel_1qbiw_246",zR="_toolResultToggle_1qbiw_250",VR="_toolResultCommand_1qbiw_256",HR="_toolResultEllipsis_1qbiw_266",PR="_toolResultPre_1qbiw_270",GR="_errorEvent_1qbiw_291",$R="_statusEvent_1qbiw_299",FR="_userInputEvent_1qbiw_308",qR="_userInputContent_1qbiw_314",KR="_signalEvent_1qbiw_331",YR="_signalBadge_1qbiw_342",ZR="_signalContent_1qbiw_351",XR="_usageEvent_1qbiw_356",QR="_usageBadge_1qbiw_363",WR="_defaultEvent_1qbiw_372",ze={systemContextEvent:xR,systemContextHeader:_R,systemContextBadge:SR,systemContextToggle:TR,systemContextPre:kR,systemContextEllipsis:CR,systemEvent:ER,systemTimestamp:NR,textEvent:jR,toolUseEvent:wR,toolUseHeader:AR,toolUsePrefix:DR,toolUseName:RR,toolUseArgs:MR,toolResultEvent:OR,toolResultHeader:BR,toolResultIndicatorOk:IR,toolResultIndicatorError:LR,toolResultLabel:UR,toolResultToggle:zR,toolResultCommand:VR,toolResultEllipsis:HR,toolResultPre:PR,errorEvent:GR,statusEvent:$R,userInputEvent:FR,userInputContent:qR,signalEvent:KR,signalBadge:YR,signalContent:ZR,usageEvent:XR,usageBadge:QR,defaultEvent:WR},G0=3;function JR({content:t}){const[a,i]=b.useState(!1),o=t.split(`
|
|
102
|
-
`),r=o.length>G0,u=a?t:o.slice(0,G0).join(`
|
|
103
|
-
`);return c.jsxs("div",{className:ze.systemContextEvent,"data-testid":"system-context-event",children:[c.jsxs("button",{type:"button",className:ze.systemContextHeader,onClick:()=>{i(d=>!d)},"aria-expanded":a,children:[c.jsx("span",{className:ze.systemContextBadge,children:"SYSTEM PROMPT"}),r&&c.jsx("span",{className:ze.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),c.jsxs("pre",{className:ze.systemContextPre,children:[u,!a&&r&&c.jsx("span",{className:ze.systemContextEllipsis,children:"…"})]})]})}function eM({time:t,content:a}){return c.jsxs("div",{className:ze.systemEvent,children:[c.jsxs("span",{className:ze.systemTimestamp,children:["[",t,"]"]})," ",a]})}function tM({content:t}){return c.jsx("div",{className:ze.textEvent,children:c.jsx(th,{remarkPlugins:[nh],rehypePlugins:[bR],children:t})})}function nM({content:t}){let a="",i=t;try{const o=JSON.parse(t);a=o.tool||"",i=JSON.stringify(o.args,null,2)}catch{}return c.jsxs("div",{className:ze.toolUseEvent,children:[c.jsxs("div",{className:ze.toolUseHeader,children:[c.jsx("span",{className:ze.toolUsePrefix,children:">"}),a?c.jsx("span",{className:ze.toolUseName,children:a}):null]}),c.jsx("pre",{className:ze.toolUseArgs,children:i})]})}const $0=5;function aM(t,a){if(a==null)return"";if(typeof a!="object")return String(a);const i=a;if(typeof i.command=="string")return i.command;if(typeof i.file_path=="string")return i.file_path;if(typeof i.pattern=="string"){const o=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${o}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const o=JSON.stringify(a);return o.length>150?`${o.slice(0,150)}…`:o}catch{return""}}function sM({content:t,raw:a,toolUseCtx:i}){const[o,r]=b.useState(!1);let u=!1;if(a)try{u=JSON.parse(a).is_error===!0}catch{}const d=t.split(`
|
|
104
|
-
`),p=d.length>$0,m=o?t:d.slice(0,$0).join(`
|
|
105
|
-
`),v=((i==null?void 0:i.tool)??"")||(u?"Tool error":"Tool output"),y=i?aM(i.tool,i.args):"",x=c.jsxs(c.Fragment,{children:[c.jsx("span",{className:u?ze.toolResultIndicatorError:ze.toolResultIndicatorOk,"aria-label":u?"error":"success","data-testid":u?"tool-result-indicator-error":"tool-result-indicator-ok",children:u?"✗":"✓"}),c.jsx("span",{className:ze.toolResultLabel,"data-testid":"tool-result-label",children:v}),p&&c.jsx("span",{className:ze.toolResultToggle,"aria-hidden":"true",children:o?"▾":"▸"})]});return c.jsxs("div",{className:ze.toolResultEvent,"data-testid":"tool-result",children:[p?c.jsx("button",{className:ze.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{r(S=>!S)},"aria-expanded":o,children:x}):c.jsx("div",{className:ze.toolResultHeader,"data-testid":"tool-result-header",children:x}),y&&c.jsx("div",{className:ze.toolResultCommand,children:y}),c.jsxs("pre",{className:ze.toolResultPre,"data-testid":"tool-result-content",children:[m,!o&&p&&c.jsx("span",{className:ze.toolResultEllipsis,children:"…"})]})]})}function iM({content:t}){return c.jsxs("div",{className:ze.errorEvent,children:["Error: ",t]})}function oM({content:t}){return c.jsxs("div",{className:ze.statusEvent,children:["--- ",t," ---"]})}function lM({content:t}){return c.jsx("div",{className:ze.userInputEvent,children:c.jsx("span",{className:ze.userInputContent,children:t})})}function rM({content:t}){return c.jsxs("div",{className:ze.signalEvent,"data-testid":"signal-event",children:[c.jsx("span",{className:ze.signalBadge,children:"SIGNAL"}),c.jsx("span",{className:ze.signalContent,children:t})]})}function cM({content:t}){let a=t;try{const i=JSON.parse(t),o=Number(i.input_tokens)||0,r=Number(i.output_tokens)||0,u=E_(o+r),d=Yi(Number(i.cost_usd)||0);a=`${u} tokens · ${d}`}catch{}return c.jsx("div",{className:ze.usageEvent,"data-testid":"usage-event",children:c.jsx("span",{className:ze.usageBadge,children:a})})}function uM({content:t}){return c.jsx("div",{className:ze.defaultEvent,children:t})}function dM({event:t,toolUseCtx:a}){const i=new Date(t.timestamp).toLocaleTimeString();switch(t.eventType){case"system":{if(t.raw)try{if(JSON.parse(t.raw).systemContext===!0)return c.jsx(JR,{content:t.content})}catch{}return c.jsx(eM,{time:i,content:t.content})}case"text":case"output":return c.jsx(tM,{content:t.content});case"tool_use":return c.jsx(nM,{content:t.content});case"tool_result":return c.jsx(sM,{content:t.content,raw:t.raw,toolUseCtx:a});case"error":return c.jsx(iM,{content:t.content});case"status":return c.jsx(oM,{content:t.content});case"user_input":return c.jsx(lM,{content:t.content});case"signal":return c.jsx(rM,{content:t.content});case"usage":return c.jsx(cM,{content:t.content});default:return c.jsx(uM,{content:t.content})}}const fM="_overlay_cmicx_1",hM="_dialog_cmicx_11",pM="_title_cmicx_30",mM="_description_cmicx_38",gM="_actions_cmicx_45",vM="_cancelButton_cmicx_52",yM="_confirmButton_cmicx_79",Ds={overlay:fM,dialog:hM,title:pM,description:mM,actions:gM,cancelButton:vM,confirmButton:yM};function Oc({isOpen:t,title:a,description:i,confirmLabel:o="Delete",onConfirm:r,onCancel:u}){const d=b.useId(),p=b.useId();return c.jsx(Wn,{children:t&&c.jsx(Et.div,{className:Ds.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:u,onKeyDown:m=>{m.key==="Escape"&&u()},role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":i?p:void 0,children:c.jsxs(Et.div,{className:Ds.dialog,initial:{opacity:0,scale:.93,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.93,y:-10},transition:{duration:.15,ease:[.16,1,.3,1]},onClick:m=>m.stopPropagation(),children:[c.jsx("h3",{id:d,className:Ds.title,children:a}),i&&c.jsx("p",{id:p,className:Ds.description,children:i}),c.jsxs("div",{className:Ds.actions,children:[c.jsx("button",{type:"button",className:Ds.cancelButton,onClick:u,autoFocus:!0,children:"Cancel"}),c.jsx("button",{type:"button",className:Ds.confirmButton,onClick:r,children:o})]})]})})})}const bM="_spinner_1uyt1_1",xM="_spin_1uyt1_1",_M="_sm_1uyt1_14",SM="_md_1uyt1_20",TM="_lg_1uyt1_26",kM="_xl_1uyt1_32",F0={spinner:bM,spin:xM,sm:_M,md:SM,lg:TM,xl:kM};function N_({size:t="md",className:a,label:i="Loading",liveRegion:o=!1}){return c.jsx("span",{className:`${F0.spinner} ${F0[t]} ${a??""}`,role:o?"status":void 0,"aria-label":i,"aria-hidden":o?void 0:!0})}const CM="_splash_1bn1g_1",EM="_logo_1bn1g_11",q0={splash:CM,logo:EM};function j_(){return c.jsxs("div",{className:q0.splash,"data-testid":"splash-screen",children:[c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:q0.logo}),c.jsx(N_,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function NM(t,a){const i=b.useRef(null);b.useEffect(()=>{const o=i.current;if(i.current=t,o===null)return;const r=new Map;for(const d of o)r.set(d.id,d);const u=new Set;for(const d of t){u.add(d.id);const p=r.get(d.id);if(p&&p.status!==d.status&&d.status!=="sleeping"){if(d.status==="connecting"){a("Provisioning environment…","info");continue}d.status==="connected"?a("Environment connected","success"):d.status==="error"?a("Environment provision failed","error"):d.status==="disconnected"&&(p.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const d of o)u.has(d.id)||a("Environment removed","info")},[t,a])}function jM(t,a,i){const o=t.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,r=w_(a),u=a.filter(m=>eh(m,r)).length,d=a.filter(m=>m.status==="paused"||m.status==="failed"||eh(m,r)).length,p=i.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:o,blockedTasks:u,attentionTasks:d,unhealthyEnvironments:p}}function w_(t){const a=new Map;for(const i of t)a.set(i.id,i.status);return a}function eh(t,a){return t.dependsOn.some(i=>a.get(i)!=="complete")}function wM(t,a){var d;const i=new Map;for(const p of a)i.set(p.id,p);const o=w_(t),r=[];for(const p of t){const m=p.workspaceId?((d=i.get(p.workspaceId))==null?void 0:d.name)??"Unknown":"Unknown";p.status==="failed"?r.push({task:p,reason:"failed",workspaceName:m}):eh(p,o)?r.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&r.push({task:p,reason:"paused",workspaceName:m})}const u={failed:0,blocked:1,paused:2};return r.sort((p,m)=>(u[p.reason]??3)-(u[m.reason]??3)),r}function AM(t,a){const i=new Map;for(const o of a)i.set(o.id,o);return t.filter(o=>o.status==="running"||o.status==="idle"||o.status==="waiting").map(o=>{var r;return{session:o,environmentName:((r=i.get(o.environmentId))==null?void 0:r.displayName)??"Unknown"}})}function DM(t,a,i){const o=new Map;for(const r of a){if(!r.workspaceId)continue;let u=o.get(r.workspaceId);u||(u={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},o.set(r.workspaceId,u)),u.totalTasks+=1,r.status==="complete"?u.completedTasks+=1:r.status==="working"?u.workingTasks+=1:r.status==="failed"&&(u.failedTasks+=1)}return t.map(r=>{const u=o.get(r.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:r,totalTasks:u.totalTasks,completedTasks:u.completedTasks,workingTasks:u.workingTasks,failedTasks:u.failedTasks}})}const RM="_dashboard_16pzm_1",MM="_kpiStrip_16pzm_11",OM="_kpiCard_16pzm_23",BM="_kpiValue_16pzm_68",IM="_kpiLabel_16pzm_76",LM="_bodyGrid_16pzm_84",UM="_section_16pzm_96",zM="_sectionHeader_16pzm_109",VM="_sectionIcon_16pzm_118",HM="_sectionTitle_16pzm_123",PM="_sectionCount_16pzm_131",GM="_sectionBody_16pzm_138",$M="_emptyHint_16pzm_143",FM="_sessionRow_16pzm_150",qM="_sessionPrompt_16pzm_177",KM="_sessionEnv_16pzm_186",YM="_sessionRuntime_16pzm_192",ZM="_sessionStatus_16pzm_198",XM="_statusDot_16pzm_207",QM="_attentionRow_16pzm_233",WM="_attentionTitle_16pzm_259",JM="_attentionMeta_16pzm_267",e3="_reasonBadge_16pzm_274",t3="_bottomGrid_16pzm_301",n3="_envRow_16pzm_312",a3="_envName_16pzm_323",s3="_envStatusBadge_16pzm_333",i3="_workspaceRow_16pzm_369",o3="_workspaceTop_16pzm_395",l3="_workspaceName_16pzm_401",r3="_workspaceCounts_16pzm_407",c3="_progressBar_16pzm_415",u3="_progressFill_16pzm_422",me={dashboard:RM,kpiStrip:MM,kpiCard:OM,kpiValue:BM,kpiLabel:IM,bodyGrid:LM,section:UM,sectionHeader:zM,sectionIcon:VM,sectionTitle:HM,sectionCount:PM,sectionBody:GM,emptyHint:$M,sessionRow:FM,sessionPrompt:qM,sessionEnv:KM,sessionRuntime:YM,sessionStatus:ZM,statusDot:XM,attentionRow:QM,attentionTitle:WM,attentionMeta:JM,reasonBadge:e3,bottomGrid:t3,envRow:n3,envName:a3,envStatusBadge:s3,workspaceRow:i3,workspaceTop:o3,workspaceName:l3,workspaceCounts:r3,progressBar:c3,progressFill:u3},d3={hidden:{opacity:0,y:12},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.3,ease:"easeOut"}})},Jr={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:.15+t*.08,duration:.35,ease:"easeOut"}})};function f3(t,a,i,o){const r=[`${t} of ${a} tasks completed`];return i>0&&r.push(`${i} in progress`),o>0&&r.push(`${o} failed`),r.join(", ")}function ec({value:t,label:a,accent:i,index:o,testId:r}){return c.jsxs(Et.div,{className:me.kpiCard,"data-accent":i,"data-testid":r,variants:d3,initial:"hidden",animate:"visible",custom:o,children:[c.jsx("span",{className:me.kpiValue,children:t}),c.jsx("span",{className:me.kpiLabel,children:a})]})}function h3(){const{workspaces:t,tasks:a,sessions:i,environments:o,loadTasks:r}=ut(),u=Mt(),d=b.useRef(new Set);b.useEffect(()=>{for(const y of t)d.current.has(y.id)||(d.current.add(y.id),r(y.id))},[t,r]);const p=b.useMemo(()=>jM(i,a,o),[i,a,o]),m=b.useMemo(()=>AM(i,o),[i,o]),g=b.useMemo(()=>wM(a,t),[a,t]),v=b.useMemo(()=>DM(t,a),[t,a,o]);return c.jsxs("div",{className:me.dashboard,"data-testid":"dashboard",children:[c.jsxs("div",{className:me.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[c.jsx(ec,{value:p.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),c.jsx(ec,{value:p.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),c.jsx(ec,{value:p.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),c.jsx(ec,{value:p.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),c.jsxs("div",{className:me.bodyGrid,children:[c.jsxs(Et.div,{className:me.section,variants:Jr,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"●"}),c.jsx("span",{className:me.sectionTitle,children:"Active Sessions"}),c.jsx("span",{className:me.sectionCount,children:m.length})]}),c.jsx("div",{className:me.sectionBody,children:m.length===0?c.jsx("div",{className:me.emptyHint,children:"No active sessions"}):m.map(({session:y,environmentName:x})=>c.jsxs("button",{type:"button",className:me.sessionRow,onClick:()=>u(_b(y.id)),"data-testid":"session-row",children:[c.jsx("span",{className:me.sessionPrompt,title:y.prompt,children:y.prompt||"—"}),c.jsx("span",{className:me.sessionEnv,children:x}),c.jsx("span",{className:me.sessionRuntime,children:y.runtime}),c.jsxs("span",{className:me.sessionStatus,children:[c.jsx("span",{className:me.statusDot,"data-status":y.status}),y.status]})]},y.id))})]}),c.jsxs(Et.div,{className:me.section,variants:Jr,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"⚑"}),c.jsx("span",{className:me.sectionTitle,children:"Needs Attention"}),c.jsx("span",{className:me.sectionCount,children:g.length})]}),c.jsx("div",{className:me.sectionBody,children:g.length===0?c.jsx("div",{className:me.emptyHint,children:"All clear"}):g.map(({task:y,reason:x,workspaceName:S})=>c.jsxs("button",{type:"button",className:me.attentionRow,onClick:()=>u(ka(y.id)),"data-testid":"attention-row",children:[c.jsxs("div",{className:me.attentionTitle,children:[c.jsx("span",{className:me.reasonBadge,"data-reason":x,children:x}),y.title]}),c.jsx("div",{className:me.attentionMeta,children:c.jsx("span",{children:S})})]},y.id))})]})]}),c.jsxs("div",{className:me.bottomGrid,children:[c.jsxs(Et.div,{className:me.section,variants:Jr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"◈"}),c.jsx("span",{className:me.sectionTitle,children:"Environment Health"}),c.jsx("span",{className:me.sectionCount,children:o.length})]}),c.jsx("div",{className:me.sectionBody,children:o.length===0?c.jsx("div",{className:me.emptyHint,children:"No environments configured"}):o.map(y=>c.jsxs("div",{className:me.envRow,"data-testid":"dashboard-env-row",children:[c.jsx("span",{className:me.envName,children:y.displayName}),c.jsx("span",{className:me.envStatusBadge,"data-status":y.status,children:y.status})]},y.id))})]}),c.jsxs(Et.div,{className:me.section,variants:Jr,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"▦"}),c.jsx("span",{className:me.sectionTitle,children:"Workspaces"}),c.jsx("span",{className:me.sectionCount,children:t.length})]}),c.jsx("div",{className:me.sectionBody,children:v.length===0?c.jsx("div",{className:me.emptyHint,children:"No workspaces yet"}):v.map(({workspace:y,totalTasks:x,completedTasks:S,workingTasks:T,failedTasks:E})=>{const N=x>0?Math.round(S/x*100):0;return c.jsxs("button",{type:"button",className:me.workspaceRow,onClick:()=>u(Pi(y.id,y.environmentId)),"data-testid":"workspace-row",children:[c.jsxs("div",{className:me.workspaceTop,children:[c.jsx("span",{className:me.workspaceName,children:y.name}),c.jsxs("span",{className:me.workspaceCounts,"aria-label":f3(S,x,T,E),children:[S,"/",x,T>0&&c.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",T]}),E>0&&c.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",E]})]})]}),x>0&&c.jsx("div",{className:me.progressBar,children:c.jsx("div",{className:me.progressFill,style:{width:`${N}%`}})})]},y.id)})})]})]})]})}const p3="_panelContainer_aei9x_1",m3="_emptyState_aei9x_8",g3="_fadeIn_aei9x_1",v3="_workspaceSummary_aei9x_17",y3="_workspaceSummaryTitle_aei9x_28",b3="_workspaceSummarySubtitle_aei9x_32",x3="_header_aei9x_36",_3="_headerInfo_aei9x_69",S3="_killButton_aei9x_75",T3="_headerTitle_aei9x_104",k3="_headerActions_aei9x_119",C3="_taskStatusBadge_aei9x_126",E3="_taskBranch_aei9x_135",N3="_taskBlockedBadge_aei9x_141",j3="_btnPrimary_aei9x_149",w3="_btnDanger_aei9x_180",A3="_btnGhost_aei9x_219",D3="_rejectInput_aei9x_245",R3="_tabBar_aei9x_275",M3="_tab_aei9x_275",O3="_active_aei9x_301",B3="_eventScroll_aei9x_306",I3="_tabContent_aei9x_312",L3="_noContext_aei9x_317",U3="_overviewContent_aei9x_323",z3="_overviewDashboard_aei9x_332",V3="_overviewHero_aei9x_338",H3="_statusBadge_aei9x_345",P3="_statusPending_aei9x_357",G3="_statusAssigned_aei9x_362",$3="_statusInProgress_aei9x_367",F3="_statusReview_aei9x_372",q3="_statusDone_aei9x_377",K3="_statusFailed_aei9x_382",Y3="_statusWaitingInput_aei9x_387",Z3="_overviewBranchPill_aei9x_392",X3="_branchLink_aei9x_407",Q3="_overviewSection_aei9x_418",W3="_overviewLabel_aei9x_424",J3="_overviewValue_aei9x_431",eO="_overviewMuted_aei9x_436",tO="_overviewMarkdown_aei9x_442",nO="_envRow_aei9x_511",aO="_envDot_aei9x_517",sO="_envDotGreen_aei9x_524",iO="_envDotYellow_aei9x_528",oO="_envDotRed_aei9x_532",lO="_envDotGray_aei9x_536",rO="_depList_aei9x_540",cO="_depItem_aei9x_546",uO="_depBlocked_aei9x_553",dO="_depDone_aei9x_557",fO="_timeline_aei9x_561",hO="_timelineRow_aei9x_567",pO="_timelineKey_aei9x_574",mO="_timelineValue_aei9x_580",gO="_timelineDelta_aei9x_584",vO="_reviewNotes_aei9x_595",yO="_overviewDescription_aei9x_606",bO="_waitingMessage_aei9x_612",xO="_errorMessage_aei9x_616",_O="_eventOverflowWarning_aei9x_620",SO="_attemptSelector_aei9x_634",TO="_attemptLabel_aei9x_650",kO="_attemptButton_aei9x_654",CO="_attemptActive_aei9x_671",EO="_attemptStatus_aei9x_677",NO="_emptyCta_aei9x_683",jO="_ctaTitle_aei9x_695",wO="_ctaDescription_aei9x_701",AO="_ctaButton_aei9x_708",DO="_ctaCreateForm_aei9x_743",RO="_ctaCreateInput_aei9x_749",MO="_ctaCreateOk_aei9x_780",OO="_ctaLink_aei9x_815",BO="_workspaceHeader_aei9x_829",IO="_workspaceName_aei9x_854",LO="_workspaceMeta_aei9x_867",UO="_metaRow_aei9x_875",zO="_metaLabel_aei9x_888",VO="_metaValue_aei9x_903",HO="_archiveButton_aei9x_913",PO="_repoLink_aei9x_943",GO="_metaToggle_aei9x_953",$O="_metaToggleArrow_aei9x_974",FO="_metaToggleArrowOpen_aei9x_979",qO="_progressBarContainer_aei9x_983",KO="_progressBar_aei9x_983",YO="_progressFill_aei9x_999",ZO="_progressLabel_aei9x_1006",XO="_metaTimestamps_aei9x_1013",QO="_metaTimestamp_aei9x_1013",L={panelContainer:p3,emptyState:m3,fadeIn:g3,workspaceSummary:v3,workspaceSummaryTitle:y3,workspaceSummarySubtitle:b3,header:x3,headerInfo:_3,killButton:S3,headerTitle:T3,headerActions:k3,taskStatusBadge:C3,taskBranch:E3,taskBlockedBadge:N3,btnPrimary:j3,btnDanger:w3,btnGhost:A3,rejectInput:D3,tabBar:R3,tab:M3,active:O3,eventScroll:B3,tabContent:I3,noContext:L3,overviewContent:U3,overviewDashboard:z3,overviewHero:V3,statusBadge:H3,statusPending:P3,statusAssigned:G3,statusInProgress:$3,statusReview:F3,statusDone:q3,statusFailed:K3,statusWaitingInput:Y3,overviewBranchPill:Z3,branchLink:X3,overviewSection:Q3,overviewLabel:W3,overviewValue:J3,overviewMuted:eO,overviewMarkdown:tO,envRow:nO,envDot:aO,envDotGreen:sO,envDotYellow:iO,envDotRed:oO,envDotGray:lO,depList:rO,depItem:cO,depBlocked:uO,depDone:dO,timeline:fO,timelineRow:hO,timelineKey:pO,timelineValue:mO,timelineDelta:gO,reviewNotes:vO,overviewDescription:yO,waitingMessage:bO,errorMessage:xO,eventOverflowWarning:_O,attemptSelector:SO,attemptLabel:TO,attemptButton:kO,attemptActive:CO,attemptStatus:EO,emptyCta:NO,ctaTitle:jO,ctaDescription:wO,ctaButton:AO,ctaCreateForm:DO,ctaCreateInput:RO,ctaCreateOk:MO,ctaLink:OO,workspaceHeader:BO,workspaceName:IO,workspaceMeta:LO,metaRow:UO,metaLabel:zO,metaValue:VO,archiveButton:HO,repoLink:PO,metaToggle:GO,metaToggleArrow:$O,metaToggleArrowOpen:FO,progressBarContainer:qO,progressBar:KO,progressFill:YO,progressLabel:ZO,metaTimestamps:XO,metaTimestamp:QO};function WO(){return c.jsx("div",{className:L.emptyState,children:"Select a task or click + to create one"})}function JO(){return c.jsx("div",{className:L.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function eB(){const{workspaces:t,environments:a}=ut(),i=Mt(),o=a.length>0;return t.length>0?c.jsx(h3,{}):c.jsxs("div",{className:L.emptyCta,"data-testid":"welcome-cta",children:[c.jsx("div",{className:L.ctaTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:L.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),c.jsx("button",{className:L.ctaButton,onClick:()=>i(Tb),disabled:!o,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!o&&c.jsx("div",{className:L.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const A_=50;function tB(t,a,i,o,r=A_){return o?t<r:a-t-i<r}function nB(t,a){const i=a-t;return i>0?i:0}function aB({scrollRef:t,contentLength:a,isReversed:i}){const[o,r]=b.useState(!0),u=b.useRef(0),d=b.useRef(!1),p=b.useRef(0);b.useEffect(()=>{const g=t.current;if(!g)return;let v=!0;const y=()=>{p.current||(p.current=requestAnimationFrame(()=>{p.current=0;const x=tB(g.scrollTop,g.scrollHeight,g.clientHeight,i,A_);x!==v&&(v=x,r(x))}))};return g.addEventListener("scroll",y,{passive:!0}),()=>{g.removeEventListener("scroll",y),p.current&&(cancelAnimationFrame(p.current),p.current=0)}},[t,i]),b.useLayoutEffect(()=>{const g=t.current;!g||d.current||(d.current=!0,i?g.scrollTop=0:g.scrollTop=g.scrollHeight,r(!0))},[t,i]),b.useLayoutEffect(()=>{const g=t.current;if(g){if(i&&!o){const v=nB(u.current,g.scrollHeight);v>0&&(g.scrollTop+=v)}o&&(i?g.scrollTo({top:0,behavior:"smooth"}):g.scrollTo({top:g.scrollHeight,behavior:"smooth"})),u.current=g.scrollHeight}},[a,o,i,t]);const m=b.useCallback(()=>{const g=t.current;if(!g)return;const v=i?0:g.scrollHeight;g.scrollTo({top:v,behavior:"smooth"}),r(!0)},[t,i]);return{isAtAnchor:o,scrollToAnchor:m}}const sB="_wrapper_p24zt_1",iB="_scrollContainer_p24zt_9",oB="_toolbar_p24zt_15",lB="_directionToggle_p24zt_22",rB="_scrollToAnchor_p24zt_60",cB="_scrollToAnchorBottom_p24zt_84",uB="_scrollToAnchorTop_p24zt_88",Rs={wrapper:sB,scrollContainer:iB,toolbar:oB,directionToggle:lB,scrollToAnchor:rB,scrollToAnchorBottom:cB,scrollToAnchorTop:uB},D_="grackle-stream-direction";function dB(){try{return localStorage.getItem(D_)==="reversed"}catch{return!1}}function fB({eventsDropped:t}){return t<=0?c.jsx(c.Fragment,{}):c.jsxs("div",{className:L.eventOverflowWarning,role:"alert",children:["⚠"," ",t.toLocaleString()," older event",t===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function Zh({events:t,eventsDropped:a,emptyState:i}){const o=b.useRef(null),[r,u]=b.useState(dB),d=HA(),p=b.useMemo(()=>r?[...t].reverse():t,[t,r]),{isAtAnchor:m,scrollToAnchor:g}=aB({scrollRef:o,contentLength:t.length,isReversed:r}),v=()=>{const S=!r;u(S);try{localStorage.setItem(D_,S?"reversed":"default")}catch{}},y=d?0:.2,x=r?-8:8;return c.jsxs("div",{className:Rs.wrapper,children:[c.jsx("div",{className:Rs.toolbar,children:c.jsx("button",{className:Rs.directionToggle,onClick:v,title:r?"Showing newest first":"Showing oldest first","aria-label":r?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:r?"↓":"↑"})}),c.jsxs("div",{ref:o,className:Rs.scrollContainer,"data-testid":"event-stream-scroll",children:[t.length===0&&i,c.jsx(fB,{eventsDropped:a}),c.jsx(Wn,{initial:!1,children:p.map((S,T)=>{const E=r?t.length-1-T:T;return c.jsx(Et.div,{initial:{opacity:0,y:x},animate:{opacity:1,y:0},transition:{duration:y,ease:"easeOut"},children:c.jsx(dM,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${E}`)})})]}),c.jsx(Wn,{children:!m&&c.jsxs(Et.button,{className:`${Rs.scrollToAnchor} ${r?Rs.scrollToAnchorTop:Rs.scrollToAnchorBottom}`,onClick:g,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.15},"aria-label":"Scroll to latest","data-testid":"scroll-to-anchor",children:[r?"↑":"↓"," New events"]})})]})}const hB="_bar_1xhb4_1",pB="_input_1xhb4_32",mB="_select_1xhb4_67",gB="_btnPrimary_1xhb4_103",vB="_btnDanger_1xhb4_134",yB="_btnGhost_1xhb4_173",bB="_badge_1xhb4_195",xB="_disconnectHint_1xhb4_205",tn={bar:hB,input:pB,select:mB,btnPrimary:gB,btnDanger:vB,btnGhost:yB,badge:bB,disconnectHint:xB};function _B(t,a){if(!t)return!1;const i=a.find(o=>o.id===t);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function SB({environmentId:t,onReconnect:a}){return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:tn.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),c.jsx("button",{type:"button",onClick:()=>a(t),className:tn.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function _l({mode:t,sessionId:a,environmentId:i,taskId:o,showStop:r,showPersonaSelect:u,onSessionKill:d,personas:p,environments:m,onSendInput:g,onSpawn:v,onStartTask:y,onProvisionEnvironment:x}){const{showToast:S}=Ps(),[T,E]=b.useState(""),[N,C]=b.useState(""),j=_B(i,m),A=R=>{if(R.preventDefault(),!!T.trim())if(t==="send"){if(!a||j)return;g(a,T),E("")}else if(t==="spawn"){if(!i)return;v(i,T,N),S("Session started","success"),E(""),C("")}else{if(!o)return;y(o,void 0,i,T),E("")}};return t==="spawn"?c.jsxs("form",{onSubmit:A,className:tn.bar,children:[c.jsx("span",{className:tn.badge,children:"new chat"}),c.jsx("input",{type:"text",value:T,onChange:R=>E(R.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:tn.input}),u&&c.jsxs("select",{value:N,onChange:R=>C(R.target.value),className:tn.select,children:[c.jsx("option",{value:"",children:"(Default)"}),p.map(R=>c.jsx("option",{value:R.id,children:R.name},R.id))]}),c.jsx("button",{type:"submit",disabled:!T.trim()||!i,className:tn.btnPrimary,children:"Go"})]}):t==="start"?c.jsxs("form",{onSubmit:A,className:tn.bar,children:[c.jsx("input",{type:"text",value:T,onChange:R=>E(R.target.value),placeholder:"Type a message...",autoFocus:!0,className:tn.input}),c.jsx("button",{type:"submit",disabled:!T.trim(),className:tn.btnPrimary,children:"Send"})]}):c.jsxs("form",{onSubmit:A,className:tn.bar,children:[j&&i&&c.jsx(SB,{environmentId:i,onReconnect:x}),c.jsx("input",{type:"text",value:T,onChange:R=>E(R.target.value),placeholder:"Type a message...",autoFocus:!j,disabled:j,className:tn.input}),c.jsx("span",{title:j?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!T.trim()||j,className:tn.btnPrimary,children:"Send"})}),r&&d&&c.jsx("button",{type:"button",onClick:d,className:tn.btnDanger,title:"Stop session",children:"Stop"})]})}function Xh(t){const a=[];for(const i of t){const o=a[a.length-1];i.eventType==="text"&&(o==null?void 0:o.eventType)==="text"?a[a.length-1]={...o,content:o.content+i.content}:a.push(i)}return a}function Qh(t){const a=new Map;for(const u of t)if(u.raw)try{a.set(u,JSON.parse(u.raw))}catch{}const i=new Map;for(const u of t){if(u.eventType!=="tool_use")continue;const d=a.get(u);if(!(!d||typeof d.id!="string"))try{const p=JSON.parse(u.content);i.set(d.id,{tool:p.tool,args:p.args})}catch{}}const o=new Set;return t.map(u=>{if(u.eventType!=="tool_result")return u;const d=a.get(u);if(!d||typeof d.tool_use_id!="string")return u;const p=i.get(d.tool_use_id);return p?(o.add(d.tool_use_id),{...u,toolUseCtx:p}):u}).filter(u=>{if(u.eventType!=="tool_use")return!0;const d=a.get(u);return d&&typeof d.id=="string"?!o.has(d.id):!0})}const TB="_panelContainer_pz4cr_1",kB="_emptyState_pz4cr_8",CB="_emptyTitle_pz4cr_20",EB="_emptyDescription_pz4cr_26",NB="_emptyHint_pz4cr_32",sl={panelContainer:TB,emptyState:kB,emptyTitle:CB,emptyDescription:EB,emptyHint:NB};function jB({hasLocalEnvironment:t}){return c.jsxs("div",{className:sl.emptyState,"data-testid":"chat-empty-state",children:[c.jsx("div",{className:sl.emptyTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:sl.emptyDescription,children:t?"Type a message below to start chatting with the System agent. It can help you plan work, create tasks, and coordinate agents.":"Add a local environment in Settings to start chatting."}),!t&&c.jsx("div",{className:sl.emptyHint,children:"Go to Settings → Environments to add one."})]})}function wB(){const{tasks:t,sessions:a,events:i,eventsDropped:o,environments:r,loadTaskSessions:u,loadSessionEvents:d,kill:p,taskSessions:m,sendInput:g,spawn:v,startTask:y,personas:x,provisionEnvironment:S}=ut(),T=b.useRef(void 0),E=t.find(R=>R.id===Wo),N=E!=null&&E.latestSessionId?a.find(R=>R.id===E.latestSessionId)??(m[Wo]??[]).find(R=>R.id===E.latestSessionId):void 0;b.useEffect(()=>{u(Wo)},[u]),b.useEffect(()=>{E!=null&&E.latestSessionId&&u(Wo)},[E==null?void 0:E.latestSessionId,u]),b.useEffect(()=>{N&&N.id!==T.current&&(T.current=N.id,d(N.id))},[N==null?void 0:N.id,d]);const C=b.useMemo(()=>{if(!N)return[];const R=i.filter(w=>w.sessionId===N.id);return Qh(Xh(R))},[i,N==null?void 0:N.id]),j=r.find(R=>R.adapterType==="local"&&R.status==="connected"),A=N!==void 0&&N.status!=="stopped"&&N.status!=="suspended";return c.jsxs("div",{className:sl.panelContainer,"data-testid":"chat-page",children:[c.jsx(Zh,{events:C,eventsDropped:o,emptyState:c.jsx(jB,{hasLocalEnvironment:!!j})}),j&&A&&c.jsx(_l,{mode:"send",sessionId:N.id,environmentId:N.environmentId,showStop:!0,onSessionKill:()=>p(N.id),personas:x,environments:r,onSendInput:g,onSpawn:v,onStartTask:y,onProvisionEnvironment:S}),j&&!A&&c.jsx(_l,{mode:"start",taskId:Wo,environmentId:j.id,personas:x,environments:r,onSendInput:g,onSpawn:v,onStartTask:y,onProvisionEnvironment:S})]})}function AB(t,a){const i=[];let o=t;const r=new Set;for(;o&&a.has(o)&&!r.has(o);){r.add(o);const u=a.get(o);i.unshift(u),o=u.parentTaskId||void 0}return i}const zs={label:"Home",url:Us};function DB(t){return t?[zs,{label:"Settings",url:ol},{label:t,url:void 0}]:[zs,{label:"Settings",url:void 0}]}const R_={label:"Environments",url:Gi};function RB(){return[zs,{label:"Environments",url:void 0}]}function MB(){return[zs,{label:"New Chat",url:void 0}]}function OB(t){return[zs,{label:`Session ${t.slice(0,8)}`,url:void 0}]}function BB(t,a,i,o){const r=i.find(d=>d.id===t),u=o.find(d=>d.id===a);return[zs,R_,{label:(u==null?void 0:u.displayName)??"Environment",url:$i(a)},{label:(r==null?void 0:r.name)??"Workspace",url:void 0}]}function IB(t,a,i,o,r){const u=AB(t,r),d=r.get(t),p=d==null?void 0:d.workspaceId,m=p?i.find(S=>S.id===p):void 0,g=a??(m==null?void 0:m.environmentId),v=g?o.find(S=>S.id===g):void 0,y=[zs];v&&g&&(y.push(R_),y.push({label:v.displayName,url:$i(g)})),m&&g&&y.push({label:m.name,url:Pi(m.id,g)});for(let S=0;S<u.length-1;S++)y.push({label:u[S].title,url:ka(u[S].id,void 0,p,g)});const x=u[u.length-1];return y.push({label:(x==null?void 0:x.title)??t,url:void 0}),y}function LB(){const t=MB(),[a]=uh(),i=a.get("env")??"",{sendInput:o,spawn:r,startTask:u,personas:d,environments:p,provisionEnvironment:m}=ut();return c.jsxs("div",{className:L.panelContainer,children:[c.jsx($s,{segments:t}),c.jsx("div",{className:L.emptyState,children:"Enter a prompt below to start a new session"}),c.jsx(_l,{mode:"spawn",environmentId:i,showPersonaSelect:!0,personas:d,environments:p,onSendInput:o,onSpawn:r,onStartTask:u,onProvisionEnvironment:m})]})}function UB({sessionId:t,session:a,isActive:i,onKill:o}){return c.jsxs("div",{className:L.header,children:[c.jsxs("span",{children:["Session: ",t.slice(0,8),a&&` | ${a.runtime} | ${a.endReason||a.status}`,a!=null&&a.inputTokens||a!=null&&a.outputTokens||a!=null&&a.costUsd?` | ${E_((a.inputTokens??0)+(a.outputTokens??0))} tokens · ${Yi(a.costUsd??0)}`:""]}),c.jsxs("span",{className:L.headerInfo,children:[a&&c.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&c.jsx("button",{onClick:()=>o(t),title:"Stop session",className:L.killButton,children:"×"})]})]})}function zB({session:t}){const a=t&&(t.status==="stopped"||t.status==="suspended"),i=a?`Session ${t.endReason||t.status} with no events recorded.`:"Waiting for events...";return c.jsx("div",{className:a?L.errorMessage:L.waitingMessage,children:i})}function VB(){const{sessionId:t}=rs(),{events:a,eventsDropped:i,sessions:o,kill:r,loadSessionEvents:u,sendInput:d,spawn:p,startTask:m,personas:g,environments:v,provisionEnvironment:y}=ut(),x=b.useRef(void 0),S=OB(t),T=o.find(C=>C.id===t)??void 0,E=b.useMemo(()=>{const C=t?a.filter(j=>j.sessionId===t):[];return Qh(Xh(C))},[a,t]);if(b.useEffect(()=>{t&&t!==x.current&&(x.current=t,u(t))},[t,u]),!t)return c.jsx("div",{className:L.emptyState,children:"No session selected"});const N=(T==null?void 0:T.status)==="running"||(T==null?void 0:T.status)==="idle";return c.jsxs("div",{className:L.panelContainer,children:[c.jsx($s,{segments:S}),c.jsx(UB,{sessionId:t,session:T,isActive:N,onKill:r}),c.jsx(Zh,{events:E,eventsDropped:i,emptyState:c.jsx(zB,{session:T})}),N&&c.jsx(_l,{mode:"send",sessionId:t,environmentId:T.environmentId,showStop:!0,onSessionKill:()=>r(t),personas:g,environments:v,onSendInput:d,onSpawn:p,onStartTask:m,onProvisionEnvironment:y})]})}const K0=220,Y0=70,HB=40,PB=60,GB="hierarchy",$B="dependency";function FB(t){return b.useMemo(()=>{if(t.length===0)return{nodes:[],edges:[]};const a=new Zv.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:HB,ranksep:PB});const i=new Map(t.map(d=>[d.id,d])),o=new Map;for(const d of t)if(d.parentTaskId&&i.has(d.parentTaskId)){const p=o.get(d.parentTaskId)||[];p.push(d),o.set(d.parentTaskId,p)}for(const d of t)a.setNode(d.id,{width:K0,height:Y0});const r=[];for(const d of t){if(d.parentTaskId&&i.has(d.parentTaskId)){const p=`hierarchy-${d.parentTaskId}-${d.id}`;a.setEdge(d.parentTaskId,d.id,{},p),r.push({id:p,source:d.parentTaskId,target:d.id,type:"smoothstep",data:{edgeType:GB},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of d.dependsOn)if(i.has(p)){const m=`dependency-${p}-${d.id}`;a.setEdge(p,d.id,{},m),r.push({id:m,source:p,target:d.id,type:"smoothstep",data:{edgeType:$B},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Zv.layout(a),{nodes:t.map(d=>{const p=a.node(d.id),m=o.get(d.id)||[];return{id:d.id,type:"task",position:{x:p.x-K0/2,y:p.y-Y0/2},data:{task:d,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:d.dependsOn.length>0}}}),edges:r}},[t])}const qB="_dagContainer_js4w6_1",KB="_taskNode_js4w6_26",YB="_taskNodeBorder_js4w6_54",ZB="_taskNodeContent_js4w6_60",XB="_taskNodeHeader_js4w6_70",QB="_taskNodeIcon_js4w6_77",WB="_taskNodeTitle_js4w6_82",JB="_taskNodeBadges_js4w6_90",e6="_childBadge_js4w6_95",t6="_depBadge_js4w6_107",n6="_handle_js4w6_119",a6="_emptyCta_js4w6_126",s6="_ctaDescription_js4w6_137",i6="_ctaButton_js4w6_144",qt={dagContainer:qB,taskNode:KB,taskNodeBorder:YB,taskNodeContent:ZB,taskNodeHeader:XB,taskNodeIcon:QB,taskNodeTitle:WB,taskNodeBadges:JB,childBadge:e6,depBadge:t6,handle:n6,emptyCta:a6,ctaDescription:s6,ctaButton:i6};function o6({data:t}){const{task:a,childCount:i,doneChildCount:o,hasDependencies:r}=t,u=ls(a.status);return c.jsxs("div",{className:qt.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[c.jsx(Xv,{type:"target",position:Qv.Top,className:qt.handle}),c.jsx("div",{className:qt.taskNodeBorder,style:{backgroundColor:u.color}}),c.jsxs("div",{className:qt.taskNodeContent,children:[c.jsxs("div",{className:qt.taskNodeHeader,children:[c.jsx("span",{className:qt.taskNodeIcon,style:{color:u.color},children:u.icon}),c.jsx("span",{className:qt.taskNodeTitle,children:a.title})]}),c.jsxs("div",{className:qt.taskNodeBadges,children:[i>0&&c.jsxs("span",{className:qt.childBadge,children:[o,"/",i]}),r&&c.jsx("span",{className:qt.depBadge,children:"dep"})]})]}),c.jsx(Xv,{type:"source",position:Qv.Bottom,className:qt.handle})]})}const l6=M2,r6={task:o6};function c6({workspaceId:t,environmentId:a,tasks:i}){const o=Mt(),{resolvedThemeId:r}=Db(),u=b.useMemo(()=>i.filter(y=>y.workspaceId===t),[i,t]),{nodes:d,edges:p}=FB(u),m=b.useMemo(()=>{const y=getComputedStyle(document.documentElement),x={};for(const[S,T]of Object.entries(l6))x[S]=y.getPropertyValue(T).trim()||"#6b7a8d";return x},[r]),g=b.useCallback((y,x)=>{o(ka(x.id,void 0,t,a))},[o,t,a]),v=b.useCallback(y=>{const x=y.data;return m[x.task.status]||m.pending},[m]);return u.length===0?c.jsxs("div",{className:qt.emptyCta,children:[c.jsx("button",{className:qt.ctaButton,onClick:()=>o(Qi(t,void 0,a)),children:"Create Task"}),c.jsx("div",{className:qt.ctaDescription,children:"Create tasks to see the dependency graph"})]}):c.jsx("div",{className:qt.dagContainer,children:c.jsxs(tT,{nodes:d,edges:p,nodeTypes:r6,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[c.jsx(nT,{variant:aT.Dots,gap:24,size:1,color:"var(--text-disabled)"}),c.jsx(sT,{showInteractive:!1}),c.jsx(iT,{nodeColor:v,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function u6({tasks:t,taskStatusById:a,sessionStatusByTaskId:i}){const o=new Map;for(const u of t)if(u.parentTaskId){const d=o.get(u.parentTaskId);d?d.push(u):o.set(u.parentTaskId,[u])}const r=new Map(V0.map(u=>[u,[]]));for(const u of t){const d=Yh(u.status),p=u.dependsOn.length>0&&u.dependsOn.some(T=>a.get(T)!=="complete"),m=o.get(u.id)??[],g=m.length,v=m.filter(T=>T.status==="complete").length;let y;if(d==="paused"&&i){const T=i.get(u.id);T==="idle"?y="Needs input":T==="completed"&&(y="Ready to complete")}const x={task:u,isBlocked:p,childCount:g,doneChildCount:v,pausedSubBadge:y},S=r.get(d);S?S.push(x):r.get("not_started").push(x)}for(const u of r.values())u.sort((d,p)=>d.task.sortOrder-p.task.sortOrder);return V0.map(u=>{const d=ls(u);return{status:u,label:d.label,style:d,tasks:r.get(u)??[]}})}const d6="_boardContainer_1c4y1_1",f6="_column_1c4y1_17",h6="_columnHeader_1c4y1_34",p6="_columnIcon_1c4y1_47",m6="_columnLabel_1c4y1_52",g6="_columnCount_1c4y1_57",v6="_cardList_1c4y1_67",y6="_emptyPlaceholder_1c4y1_76",b6="_card_1c4y1_67",x6="_cardHeader_1c4y1_107",_6="_cardStatusIcon_1c4y1_113",S6="_cardTitle_1c4y1_119",T6="_cardBadges_1c4y1_127",k6="_badge_1c4y1_134",C6="_blockedBadge_1c4y1_146",E6="_childBadge_1c4y1_151",N6="_depBadge_1c4y1_155",j6="_parentBadge_1c4y1_159",w6="_pausedSubBadge_1c4y1_166",A6="_personaBadge_1c4y1_170",D6="_envBadge_1c4y1_174",R6="_emptyCta_1c4y1_178",M6="_ctaButton_1c4y1_188",O6="_ctaDescription_1c4y1_204",qe={boardContainer:d6,column:f6,columnHeader:h6,columnIcon:p6,columnLabel:m6,columnCount:g6,cardList:v6,emptyPlaceholder:y6,card:b6,cardHeader:x6,cardStatusIcon:_6,cardTitle:S6,cardBadges:T6,badge:k6,blockedBadge:C6,childBadge:E6,depBadge:N6,parentBadge:j6,pausedSubBadge:w6,personaBadge:A6,envBadge:D6,emptyCta:R6,ctaButton:M6,ctaDescription:O6};function B6({workspaceId:t,environmentId:a,tasks:i,sessions:o,personas:r,environments:u}){const d=Mt(),p=b.useMemo(()=>i.filter(x=>x.workspaceId===t),[i,t]),m=b.useMemo(()=>new Map(i.map(x=>[x.id,x.status])),[i]),g=b.useMemo(()=>new Map(p.map(x=>[x.id,x])),[p]),v=b.useMemo(()=>{const x=new Map(o.map(j=>[j.id,j])),S=new Map(r.map(j=>[j.id,j])),T=new Map(u.map(j=>[j.id,j])),E=new Map,N=new Map,C=new Map;for(const j of p)if(j.latestSessionId){const A=x.get(j.latestSessionId);if(A){if(E.set(j.id,A.endReason||A.status),A.personaId){const R=S.get(A.personaId);R&&N.set(j.id,R.name)}if(A.environmentId){const R=T.get(A.environmentId);R&&C.set(j.id,R.displayName)}}}return{sessionStatusByTaskId:E,personaNameByTaskId:N,environmentNameByTaskId:C}},[p,o,r,u]),y=b.useMemo(()=>u6({tasks:p,taskStatusById:m,sessionStatusByTaskId:v.sessionStatusByTaskId}),[p,m,v]);return p.length===0?c.jsxs("div",{className:qe.emptyCta,"data-testid":"board-empty-cta",children:[c.jsx("button",{className:qe.ctaButton,onClick:()=>d(Qi(t,void 0,a)),children:"Create Task"}),c.jsx("div",{className:qe.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):c.jsx("div",{className:qe.boardContainer,"data-testid":"board-container",children:y.map(x=>c.jsxs("section",{className:qe.column,"data-testid":`board-column-${x.status}`,"aria-label":`${x.label}, ${x.tasks.length} ${x.tasks.length===1?"task":"tasks"}`,children:[c.jsxs("div",{className:qe.columnHeader,children:[c.jsx("span",{className:qe.columnIcon,style:{color:x.style.color},children:x.style.icon}),c.jsx("span",{className:qe.columnLabel,children:x.label}),c.jsx("span",{className:qe.columnCount,"data-testid":`board-count-${x.status}`,children:x.tasks.length})]}),c.jsx("div",{className:qe.cardList,children:x.tasks.length===0?c.jsx("div",{className:qe.emptyPlaceholder,children:"No tasks"}):c.jsx(Wn,{mode:"popLayout",children:x.tasks.map(S=>c.jsx(Et.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:c.jsx(I6,{boardTask:S,tasksById:g,personaName:v.personaNameByTaskId.get(S.task.id),envName:v.environmentNameByTaskId.get(S.task.id),onClick:()=>d(ka(S.task.id,void 0,t,a))})},S.task.id))})})]},x.status))})}function I6({boardTask:t,tasksById:a,personaName:i,envName:o,onClick:r}){const{task:u,isBlocked:d,childCount:p,doneChildCount:m,pausedSubBadge:g}=t,v=ls(u.status),y=u.parentTaskId?a.get(u.parentTaskId):void 0;return c.jsxs("div",{className:qe.card,tabIndex:0,role:"button","data-testid":`board-card-${u.id}`,onClick:r,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),r())},children:[c.jsxs("div",{className:qe.cardHeader,children:[c.jsx("span",{className:qe.cardStatusIcon,style:{color:v.color},children:v.icon}),c.jsx("span",{className:qe.cardTitle,children:u.title})]}),c.jsxs("div",{className:qe.cardBadges,children:[y&&c.jsx("span",{className:`${qe.badge} ${qe.parentBadge}`,title:y.title,children:y.title}),p>0&&c.jsxs("span",{className:`${qe.badge} ${qe.childBadge}`,children:[m,"/",p]}),d&&c.jsx("span",{className:`${qe.badge} ${qe.blockedBadge}`,children:"blocked"}),u.dependsOn.length>0&&!d&&c.jsx("span",{className:`${qe.badge} ${qe.depBadge}`,children:"dep"}),g&&c.jsx("span",{className:`${qe.badge} ${qe.pausedSubBadge}`,children:g}),i&&c.jsx("span",{className:`${qe.badge} ${qe.personaBadge}`,children:i}),o&&c.jsx("span",{className:`${qe.badge} ${qe.envBadge}`,children:o})]})]})}function Wh(t){const{value:a,onSave:i,validate:o,fieldId:r,activeFieldId:u,onActivate:d,enterToSave:p=!0,trimOnSave:m=!0}=t,[g,v]=b.useState(""),[y,x]=b.useState(""),S=b.useRef(!1),T=u===r,E=b.useCallback(z=>{v(z),x("")},[]),N=b.useCallback(()=>{x("")},[]),C=b.useCallback(()=>{S.current=!1,d==null||d(null),v(""),x("")},[d]),j=b.useCallback(()=>{const z=m?g.trim():g;if(o){const $=o(g);if($){x($);return}}const O=m?a.trim():a;if(z===O){C();return}i(z),C()},[g,a,m,o,i,C]),A=b.useCallback(()=>{S.current=!0,d==null||d(r),v(a),x("")},[r,a,d]),R=b.useCallback(z=>{if(S.current){S.current=!1;return}z.relatedTarget instanceof HTMLElement&&z.relatedTarget.dataset.editAction===r||j()},[r,j]),w=b.useCallback(z=>{z.key==="Escape"?C():z.key==="Enter"&&p&&j()},[C,p,j]),G=(()=>{if(!T)return!1;const z=m?a.trim():a;return(m?g.trim():g)!==z})();return b.useEffect(()=>{!T&&(g!==""||y!=="")&&(v(""),x(""))},[T,g,y]),{isEditing:T,draft:g,error:y,isDirty:G,startEdit:A,cancelEdit:C,save:j,setDraft:E,clearError:N,handleBlur:R,handleKeyDown:w,ignoreInitialBlurRef:S}}const L6="_editFieldWrapper_yuzty_1",U6="_editInput_yuzty_10",z6="_editTextarea_yuzty_42",V6="_editSelect_yuzty_78",H6="_editError_yuzty_111",P6="_editInputInvalid_yuzty_118",G6="_editHint_yuzty_123",$6="_unsavedDot_yuzty_132",F6="_metaValueClickable_yuzty_140",q6="_editButton_yuzty_159",K6="_metaPlaceholder_yuzty_175",Y6="_worktreeToggle_yuzty_180",Pe={editFieldWrapper:L6,editInput:U6,editTextarea:z6,editSelect:V6,editError:H6,editInputInvalid:P6,editHint:G6,unsavedDot:$6,metaValueClickable:F6,editButton:q6,metaPlaceholder:K6,worktreeToggle:Y6};function dn(t){const{value:a,onSave:i,validate:o,mode:r="edit",fieldId:u="text",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,maxLength:y,ariaLabel:x,"data-testid":S}=t,T=b.useRef(null),E=Wh({value:a,onSave:i,validate:o,fieldId:u,activeFieldId:d,onActivate:p,enterToSave:!0,trimOnSave:!0});if(b.useEffect(()=>{if(E.isEditing){const C=window.setTimeout(()=>{var j;(j=T.current)==null||j.focus()},0);return()=>window.clearTimeout(C)}},[E.isEditing]),r==="create"){const C=A=>{m==null||m(A.target.value)},j=o==null?void 0:o(a);return c.jsxs("div",{className:Pe.editFieldWrapper,children:[c.jsx("input",{className:`${Pe.editInput} ${j?Pe.editInputInvalid:""}`,value:a,onChange:C,maxLength:y,placeholder:v,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),j&&c.jsx("span",{className:Pe.editError,"data-testid":"edit-error",children:j})]})}if(E.isEditing)return c.jsxs("div",{className:Pe.editFieldWrapper,children:[c.jsx("input",{ref:T,className:`${Pe.editInput} ${E.error?Pe.editInputInvalid:""}`,value:E.draft,onChange:C=>E.setDraft(C.target.value),onBlur:E.handleBlur,onKeyDown:E.handleKeyDown,maxLength:y,placeholder:v,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),E.isDirty&&c.jsx("span",{className:Pe.unsavedDot,title:"Unsaved changes"}),E.error&&c.jsx("span",{className:Pe.editError,"data-testid":"edit-error",children:E.error}),c.jsx("span",{className:Pe.editHint,children:"Enter to save · Esc to cancel"})]});const N=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:Pe.metaValueClickable,onClick:()=>E.startEdit(),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),E.startEdit())},title:"Click to edit","aria-label":x,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:a?c.jsx("span",{children:a}):c.jsx("span",{className:Pe.metaPlaceholder,children:v||"None"}),c.jsx("span",{className:Pe.editButton,"aria-hidden":"true",children:"✏️"})]})}function Z6(t){const{value:a,onSave:i,validate:o,mode:r="edit",fieldId:u="textarea",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:y,"data-testid":x}=t,S=b.useRef(null),T=Wh({value:a,onSave:i,validate:o,fieldId:u,activeFieldId:d,onActivate:p,enterToSave:!1,trimOnSave:!1});if(b.useEffect(()=>{if(T.isEditing){const N=window.setTimeout(()=>{var C;(C=S.current)==null||C.focus()},0);return()=>window.clearTimeout(N)}},[T.isEditing]),r==="create"){const N=j=>{m==null||m(j.target.value)},C=o==null?void 0:o(a);return c.jsxs("div",{className:Pe.editFieldWrapper,children:[c.jsx("textarea",{className:`${Pe.editTextarea} ${C?Pe.editInputInvalid:""}`,value:a,onChange:N,placeholder:v,"aria-label":y,"data-testid":x?`${x}-input`:void 0}),C&&c.jsx("span",{className:Pe.editError,"data-testid":"edit-error",children:C})]})}if(T.isEditing)return c.jsxs("div",{className:Pe.editFieldWrapper,children:[c.jsx("textarea",{ref:S,className:`${Pe.editTextarea} ${T.error?Pe.editInputInvalid:""}`,value:T.draft,onChange:N=>T.setDraft(N.target.value),onBlur:T.handleBlur,onKeyDown:T.handleKeyDown,title:y,"aria-label":y,"data-testid":x?`${x}-input`:void 0}),T.isDirty&&c.jsx("span",{className:Pe.unsavedDot,title:"Unsaved changes"}),T.error&&c.jsx("span",{className:Pe.editError,"data-testid":"edit-error",children:T.error}),c.jsx("span",{className:Pe.editHint,children:"Tab to save · Esc to cancel"})]});const E=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:Pe.metaValueClickable,onClick:()=>T.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),T.startEdit())},title:"Click to edit","aria-label":y,"data-testid":x?`${x}-button`:void 0,children:[E!==void 0?E:a?c.jsx("span",{children:a}):c.jsx("span",{className:Pe.metaPlaceholder,children:v||"None"}),c.jsx("span",{className:Pe.editButton,"aria-hidden":"true",children:"✏️"})]})}function M_(t){var A;const{value:a,onSave:i,mode:o="edit",options:r,fieldId:u="select",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:y,"data-testid":x}=t,S=b.useRef(null),T=Wh({value:a,onSave:i,fieldId:u,activeFieldId:d,onActivate:p,enterToSave:!1,trimOnSave:!1});b.useEffect(()=>{if(T.isEditing){const R=window.setTimeout(()=>{var w;(w=S.current)==null||w.focus()},0);return()=>window.clearTimeout(R)}},[T.isEditing]);const E=b.useCallback(R=>{const w=R.target.value;T.ignoreInitialBlurRef.current=!1,w!==a&&i(w),T.cancelEdit()},[a,i,T]),N=b.useCallback(R=>{if(T.ignoreInitialBlurRef.current){T.ignoreInitialBlurRef.current=!1;return}R.relatedTarget instanceof HTMLElement&&R.relatedTarget.dataset.editAction===u||T.cancelEdit()},[u,T]);if(o==="create")return c.jsx("select",{className:Pe.editSelect,value:a,onChange:R=>m==null?void 0:m(R.target.value),"aria-label":y,"data-testid":x?`${x}-select`:void 0,children:r.map(R=>c.jsx("option",{value:R.value,children:R.label},R.value))});if(T.isEditing)return c.jsx("select",{ref:S,className:Pe.editSelect,value:T.draft,onChange:E,onBlur:N,title:y,"aria-label":y,"data-testid":x?`${x}-select`:void 0,children:r.map(R=>c.jsx("option",{value:R.value,children:R.label},R.value))});const C=g==null?void 0:g(a),j=(A=r.find(R=>R.value===a))==null?void 0:A.label;return c.jsxs("button",{type:"button",className:Pe.metaValueClickable,onClick:()=>T.startEdit(),title:"Click to change","aria-label":y,"data-testid":x?`${x}-button`:void 0,children:[C!==void 0?C:j?c.jsx("span",{children:j}):c.jsx("span",{className:Pe.metaPlaceholder,children:v||"None"}),c.jsx("span",{className:Pe.editButton,"aria-hidden":"true",children:"✏️"})]})}function X6(t){const{checked:a,onChange:i,label:o,ariaLabel:r,"data-testid":u}=t;return c.jsxs("label",{className:Pe.worktreeToggle,"data-testid":u,children:[c.jsx("input",{type:"checkbox",checked:a,onChange:d=>i(d.target.checked),"aria-label":r}),c.jsx("span",{children:o})]})}const Q6="_envRow_1e1r5_1",W6="_envDot_1e1r5_7",J6="_envDotGreen_1e1r5_14",eI="_envDotYellow_1e1r5_18",tI="_envDotRed_1e1r5_22",nI="_envDotGray_1e1r5_26",Hi={envRow:Q6,envDot:W6,envDotGreen:J6,envDotYellow:eI,envDotRed:tI,envDotGray:nI};function aI(t){const a=t.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Hi.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Hi.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Hi.envDotRed:Hi.envDotGray}function sI(t){const{value:a,onSave:i,environments:o,allowNone:r=!1,fieldId:u="environment",activeFieldId:d,onActivate:p,placeholder:m="No environment",ariaLabel:g="Environment","data-testid":v}=t,y=o.find(T=>T.id===a),x=[...r?[{value:"",label:"None"}]:[],...o.map(T=>({value:T.id,label:T.displayName}))],S=()=>{if(y)return c.jsxs("span",{className:Hi.envRow,children:[c.jsx("span",{className:`${Hi.envDot} ${aI(y.status)}`}),y.displayName]})};return c.jsx(M_,{value:a,onSave:i,options:x,fieldId:u,activeFieldId:d,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:g,"data-testid":v})}function Z0(t){if(!t)return"";const a=new Date(t);if(isNaN(a.getTime()))return"";const o=Date.now()-a.getTime();if(o<0)return"just now";const r=Math.floor(o/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const u=Math.floor(r/60);if(u<24)return`${u}h ago`;const d=Math.floor(u/24);return d<30?`${d}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const bf=100;function iI(){const{workspaceId:t,environmentId:a}=rs(),i=Mt(),{tasks:o,environments:r,workspaces:u,personas:d,sessions:p,archiveWorkspace:m,updateWorkspace:g,usageCache:v,loadUsage:y}=ut(),[x,S]=b.useState("tasks"),[T,E]=b.useState(!1),[N,C]=b.useState(null),[j,A]=b.useState(!1),R=b.useRef(void 0),w=u.find(U=>U.id===t),G=a??(w==null?void 0:w.environmentId)??"",z=BB(t,G,u,r);b.useEffect(()=>{const U=R.current;R.current=t,!(U===void 0||U===t)&&N!==null&&C(null)},[t,N]);const O=p.reduce((U,Q)=>U+(Q.costUsd??0),0);b.useEffect(()=>{t&&y("workspace",t)},[t,y,O]);const $=t?v[`workspace:${t}`]:void 0,J=o.filter(U=>U.workspaceId===t),ae=J.filter(U=>U.status==="complete").length,se=J.length,te=se>0?Math.round(ae/se*100):0;return c.jsxs("div",{className:L.panelContainer,children:[c.jsx($s,{segments:z}),c.jsxs("div",{className:L.workspaceHeader,children:[c.jsx("span",{className:L.workspaceName,"data-testid":"workspace-name",children:c.jsx(dn,{value:(w==null?void 0:w.name)||"",onSave:U=>{w&&g(w.id,{name:U})},validate:U=>{const Q=U.trim();if(!Q)return"Name is required";if(Q.length>bf)return`Max ${bf} characters`},maxLength:bf,fieldId:"name",activeFieldId:N,onActivate:C,ariaLabel:"Workspace name",renderDisplay:U=>U||t||void 0,"data-testid":"edit-name"})}),c.jsx("button",{className:L.archiveButton,onClick:()=>E(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),c.jsxs("button",{className:L.metaToggle,onClick:()=>A(!j),"aria-expanded":!j,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[c.jsx("span",{className:`${L.metaToggleArrow} ${j?"":L.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!j&&c.jsxs("div",{className:L.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Description"}),c.jsx("div",{className:L.metaValue,children:c.jsx(Z6,{value:(w==null?void 0:w.description)||"",onSave:U=>{w&&g(w.id,{description:U})},fieldId:"description",activeFieldId:N,onActivate:C,renderDisplay:U=>U?c.jsx("span",{className:L.overviewMarkdown,children:c.jsx(th,{remarkPlugins:[nh],children:U})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Repository"}),c.jsx("div",{className:L.metaValue,children:c.jsx(dn,{value:(w==null?void 0:w.repoUrl)||"",onSave:U=>{w&&g(w.id,{repoUrl:U})},validate:U=>{const Q=U.trim();if(Q&&!/^https?:\/\/.+/.test(Q))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:N,onActivate:C,renderDisplay:U=>U&&/^https?:\/\//i.test(U)?c.jsx("a",{className:L.repoLink,href:U,target:"_blank",rel:"noopener noreferrer",onClick:Q=>Q.stopPropagation(),children:U}):U?c.jsx("span",{children:U}):void 0,placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Environment"}),c.jsx("div",{className:L.metaValue,children:c.jsx(sI,{value:(w==null?void 0:w.environmentId)||"",onSave:U=>{w&&U&&g(w.id,{environmentId:U})},environments:r,fieldId:"environmentId",activeFieldId:N,onActivate:C,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Persona"}),c.jsx("div",{className:L.metaValue,children:c.jsx(M_,{value:(w==null?void 0:w.defaultPersonaId)||"",onSave:U=>{w&&g(w.id,{defaultPersonaId:U})},options:[{value:"",label:"(Inherit)"},...d.map(U=>({value:U.id,label:U.name}))],fieldId:"defaultPersonaId",activeFieldId:N,onActivate:C,renderDisplay:U=>{const Q=d.find(B=>B.id===U);if(Q)return c.jsx("span",{children:Q.name})},placeholder:(w==null?void 0:w.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Worktrees"}),c.jsx("div",{className:L.metaValue,children:c.jsx(X6,{checked:(w==null?void 0:w.useWorktrees)??!0,onChange:U=>{w&&g(w.id,{useWorktrees:U})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Working Dir"}),c.jsx("div",{className:L.metaValue,children:c.jsx(dn,{value:(w==null?void 0:w.worktreeBasePath)||"",onSave:U=>{w&&g(w.id,{worktreeBasePath:U})},fieldId:"worktreeBasePath",activeFieldId:N,onActivate:C,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-worktree-base-path"})})]}),w&&c.jsxs("div",{className:L.metaTimestamps,children:[c.jsxs("span",{className:L.metaTimestamp,children:["Created ",Z0(w.createdAt)]}),w.updatedAt&&w.updatedAt!==w.createdAt&&c.jsxs("span",{className:L.metaTimestamp,children:["· Updated ",Z0(w.updatedAt)]})]})]}),se>0&&c.jsxs("div",{className:L.progressBarContainer,"data-testid":"progress-bar",children:[c.jsx("div",{className:L.progressBar,children:c.jsx("div",{className:L.progressFill,style:{width:`${te}%`}})}),c.jsxs("span",{className:L.progressLabel,children:[ae,"/",se]})]}),$&&$.costUsd>0&&c.jsx("div",{className:L.progressBarContainer,children:c.jsxs("span",{className:L.progressLabel,children:["Usage: ",Yi($.costUsd)," (",$.sessionCount," session",$.sessionCount!==1?"s":"",")"]})}),c.jsxs("div",{className:L.tabBar,role:"tablist","aria-label":"Workspace view",children:[c.jsx("button",{role:"tab","aria-selected":x==="graph",className:`${L.tab} ${x==="graph"?L.active:""}`,onClick:()=>S("graph"),children:"Graph"}),c.jsx("button",{role:"tab","aria-selected":x==="board",className:`${L.tab} ${x==="board"?L.active:""}`,onClick:()=>S("board"),"data-testid":"board-tab",children:"Board"}),c.jsx("button",{role:"tab","aria-selected":x==="tasks",className:`${L.tab} ${x==="tasks"?L.active:""}`,onClick:()=>S("tasks"),children:"Tasks"})]}),x==="tasks"&&se>0&&c.jsxs("div",{className:L.workspaceSummary,children:[c.jsx("span",{className:L.workspaceSummaryTitle,children:`${ae}/${se} tasks complete`}),c.jsx("span",{className:L.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),x==="tasks"&&se===0&&c.jsxs("div",{className:L.emptyCta,children:[c.jsx("button",{className:L.ctaButton,onClick:()=>i(Qi(t,void 0,G)),children:"Create Task"}),c.jsx("div",{className:L.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),x==="board"&&c.jsx(B6,{workspaceId:t,environmentId:G,tasks:o,sessions:p,personas:d,environments:r}),x==="graph"&&c.jsx(c6,{workspaceId:t,environmentId:G,tasks:o}),c.jsx(Oc,{isOpen:T,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{w&&(m(w.id),i("/",{replace:!0})),E(!1)},onCancel:()=>E(!1)})]})}const oI="_formContent_ymnez_1",lI="_section_ymnez_13",rI="_label_ymnez_19",cI="_titleInput_ymnez_26",uI="_descriptionTextarea_ymnez_58",dI="_selectField_ymnez_94",fI="_checkboxRow_ymnez_128",hI="_checkboxLabel_ymnez_141",pI="_fieldError_ymnez_146",lt={formContent:oI,section:lI,label:rI,titleInput:cI,descriptionTextarea:uI,selectField:dI,checkboxRow:fI,checkboxLabel:hI,fieldError:pI};function mI(t,a){return{name:(t==null?void 0:t.name)??"",description:(t==null?void 0:t.description)??"",repoUrl:(t==null?void 0:t.repoUrl)??"",environmentId:(t==null?void 0:t.environmentId)??a??"",defaultPersonaId:(t==null?void 0:t.defaultPersonaId)??"",useWorktrees:(t==null?void 0:t.useWorktrees)??!0,worktreeBasePath:(t==null?void 0:t.worktreeBasePath)??""}}const gI=100;function vI({values:t,onChange:a,environments:i,personas:o,errors:r,disabled:u,autoFocusName:d}){const p=(m,g)=>{a({...t,[m]:g})};return c.jsxs("div",{className:lt.formContent,children:[c.jsxs("div",{className:lt.section,children:[c.jsx("label",{className:lt.label,htmlFor:"ws-name",children:"Name"}),c.jsx("input",{id:"ws-name",className:lt.titleInput,type:"text",value:t.name,onChange:m=>p("name",m.target.value),placeholder:"Workspace name",maxLength:gI,autoFocus:d,disabled:u,"data-testid":"workspace-form-name"}),(r==null?void 0:r.name)&&c.jsx("span",{className:lt.fieldError,"data-testid":"workspace-form-error-name",children:r.name})]}),c.jsxs("div",{className:lt.section,children:[c.jsx("label",{className:lt.label,htmlFor:"ws-description",children:"Description"}),c.jsx("textarea",{id:"ws-description",className:lt.descriptionTextarea,value:t.description,onChange:m=>p("description",m.target.value),placeholder:"Optional description (Markdown supported)",disabled:u,"data-testid":"workspace-form-description"})]}),c.jsxs("div",{className:lt.section,children:[c.jsx("label",{className:lt.label,htmlFor:"ws-repo",children:"Repository URL"}),c.jsx("input",{id:"ws-repo",className:lt.titleInput,type:"text",value:t.repoUrl,onChange:m=>p("repoUrl",m.target.value),placeholder:"https://github.com/org/repo",disabled:u,"data-testid":"workspace-form-repo"}),(r==null?void 0:r.repoUrl)&&c.jsx("span",{className:lt.fieldError,"data-testid":"workspace-form-error-repoUrl",children:r.repoUrl})]}),c.jsxs("div",{className:lt.section,children:[c.jsx("label",{className:lt.label,htmlFor:"ws-environment",children:"Environment"}),c.jsxs("select",{id:"ws-environment",className:lt.selectField,value:t.environmentId,onChange:m=>p("environmentId",m.target.value),disabled:u,"data-testid":"workspace-form-environment",children:[c.jsx("option",{value:"",children:"Select environment…"}),i.map(m=>c.jsx("option",{value:m.id,children:m.displayName||m.id},m.id))]}),(r==null?void 0:r.environmentId)&&c.jsx("span",{className:lt.fieldError,"data-testid":"workspace-form-error-environmentId",children:r.environmentId})]}),c.jsxs("div",{className:lt.section,children:[c.jsx("label",{className:lt.label,htmlFor:"ws-persona",children:"Default Persona"}),c.jsxs("select",{id:"ws-persona",className:lt.selectField,value:t.defaultPersonaId,onChange:m=>p("defaultPersonaId",m.target.value),disabled:u,"data-testid":"workspace-form-persona",children:[c.jsx("option",{value:"",children:"(Inherit)"}),o.map(m=>c.jsx("option",{value:m.id,children:m.name},m.id))]})]}),c.jsx("div",{className:lt.section,children:c.jsxs("label",{className:lt.checkboxRow,children:[c.jsx("input",{type:"checkbox",checked:t.useWorktrees,onChange:m=>p("useWorktrees",m.target.checked),disabled:u,"data-testid":"workspace-form-worktrees"}),c.jsx("span",{className:lt.checkboxLabel,children:"Enable worktree isolation"})]})}),c.jsxs("div",{className:lt.section,children:[c.jsx("label",{className:lt.label,htmlFor:"ws-workdir",children:"Working Directory"}),c.jsx("input",{id:"ws-workdir",className:lt.titleInput,type:"text",value:t.worktreeBasePath,onChange:m=>p("worktreeBasePath",m.target.value),placeholder:"Default (server default)",disabled:u,"data-testid":"workspace-form-workdir"})]})]})}const yI="_container_cddyd_1",bI="_header_cddyd_8",xI="_headerTitle_cddyd_35",_I="_badge_cddyd_44",SI="_headerActions_cddyd_54",TI="_body_cddyd_61",kI="_formContent_cddyd_73",CI="_section_cddyd_85",EI="_label_cddyd_91",NI="_titleInput_cddyd_98",jI="_descriptionTextarea_cddyd_131",wI="_parentContext_cddyd_167",AI="_parentLabel_cddyd_175",DI="_parentName_cddyd_182",RI="_personaSelect_cddyd_186",MI="_depList_cddyd_220",OI="_depItem_cddyd_226",BI="_depItemSelected_cddyd_248",II="_noDeps_cddyd_252",LI="_btnPrimary_cddyd_258",UI="_btnGhost_cddyd_289",we={container:yI,header:bI,headerTitle:xI,badge:_I,headerActions:SI,body:TI,formContent:kI,section:CI,label:EI,titleInput:NI,descriptionTextarea:jI,parentContext:wI,parentLabel:AI,parentName:DI,personaSelect:RI,depList:MI,depItem:OI,depItemSelected:BI,noDeps:II,btnPrimary:LI,btnGhost:UI};function zI(t){const a={};return t.name.trim()||(a.name="Name is required"),t.repoUrl.trim()&&!/^https?:\/\/.+/i.test(t.repoUrl.trim())&&(a.repoUrl="Must be a valid http(s) URL"),t.environmentId||(a.environmentId="Environment is required"),Object.keys(a).length>0?a:void 0}const VI=[{label:"Home",url:Us},{label:"New Workspace",url:void 0}];function HI(){const[t]=uh(),a=t.get("environment")??void 0,{environments:i,personas:o,createWorkspace:r,workspaceCreating:u}=ut(),{showToast:d}=Ps(),p=Mt(),[m,g]=b.useState(()=>{var N;return mI(void 0,a||((N=i[0])==null?void 0:N.id))}),[v,y]=b.useState(),[x,S]=b.useState();b.useEffect(()=>{a||m.environmentId||i.length===0||g(N=>{var C;return N.environmentId?N:{...N,environmentId:((C=i[0])==null?void 0:C.id)??""}})},[i,a,m.environmentId]);const T=()=>{const N=zI(m);if(N){y(N),S(void 0);return}y(void 0),S(void 0),r(m.name.trim(),m.description,m.repoUrl.trim(),m.environmentId,m.defaultPersonaId,m.useWorktrees,m.worktreeBasePath,()=>{d("Workspace created","success"),p(Us,{replace:!0})},C=>{S(C)})},E=()=>{p(a?$i(a):Us,{replace:!0})};return c.jsxs("div",{className:we.container,children:[c.jsxs("div",{className:we.header,children:[c.jsx("div",{className:we.headerTitle,children:c.jsx($s,{segments:VI})}),c.jsxs("div",{className:we.headerActions,children:[c.jsx("button",{className:we.btnGhost,onClick:E,disabled:u,"data-testid":"workspace-create-cancel",children:"Cancel"}),c.jsx("button",{className:we.btnPrimary,onClick:T,disabled:u||!m.name.trim()||!m.environmentId,"data-testid":"workspace-create-save",children:u?c.jsx(N_,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),c.jsxs("div",{className:we.body,children:[c.jsx(vI,{values:m,onChange:N=>{g(N),y(void 0),S(void 0)},environments:i,personas:o,errors:v,disabled:u,autoFocusName:!0}),x&&c.jsx("div",{className:we.error,"data-testid":"workspace-create-submit-error",children:x})]})]})}function O_({mode:t,taskId:a,workspaceId:i,parentTaskId:o,environmentId:r,tasks:u,workspaces:d,personas:p,onCreateTask:m,onUpdateTask:g}){const{showToast:v}=Ps(),y=Mt(),x=t==="edit",S=x&&a?u.find(ee=>ee.id===a):void 0,T=x?(S==null?void 0:S.workspaceId)??"":i??"",[E,N]=b.useState(T),C=T||E,j=d.find(ee=>ee.id===C),A=r??(j==null?void 0:j.environmentId),R=!x&&!i,w=x?(S==null?void 0:S.parentTaskId)??"":o??"",G=w?u.find(ee=>ee.id===w):void 0,[z,O]=b.useState((S==null?void 0:S.title)??""),[$,J]=b.useState((S==null?void 0:S.description)??""),[ae,se]=b.useState((S==null?void 0:S.dependsOn)??[]),[te,U]=b.useState((S==null?void 0:S.defaultPersonaId)??""),[Q,B]=b.useState((S==null?void 0:S.canDecompose)??!1),[q,oe]=b.useState(!1),le=b.useRef(!1);b.useEffect(()=>{x&&S&&!le.current&&(le.current=!0,O(S.title),J(S.description),se(S.dependsOn),U(S.defaultPersonaId),B(S.canDecompose))},[x,S]);const F=u.filter(ee=>ee.workspaceId===C&&(!x||ee.id!==a)&&ee.id!==w),ye=z.trim().length>0&&(!x||S!==void 0)&&C.length>0,Te=ee=>{se(et=>et.includes(ee)?et.filter(Me=>Me!==ee):[...et,ee])},be=()=>{!ye||q||x&&S===void 0||(x&&a?(g(a,z.trim(),$,ae,te),v("Task updated","success"),y(ka(a,void 0,C,A),{replace:!0})):(oe(!0),m(C,z.trim(),$,ae.length>0?ae:void 0,w||void 0,te,Q,()=>{v("Task created","success"),y(i?Pi(i,A):"/tasks",{replace:!0})},ee=>{v(ee,"error"),oe(!1)})))},ne=()=>{y(x&&a?ka(a,void 0,C,A):i?Pi(i,A):"/tasks")},ce=x?"edit task":w?"child task":"new task";return c.jsxs("div",{className:we.container,children:[c.jsxs("div",{className:we.header,children:[c.jsxs("div",{className:we.headerTitle,children:[c.jsx("span",{className:we.badge,children:ce}),G&&c.jsxs("span",{className:we.parentContext,children:[c.jsx("span",{className:we.parentLabel,children:"Child of"}),c.jsx("span",{className:we.parentName,children:G.title})]})]}),c.jsxs("div",{className:we.headerActions,children:[c.jsx("button",{onClick:be,disabled:!ye||q,className:we.btnPrimary,"data-testid":"task-edit-save",children:q?"Creating…":x?"Save Changes":"Create"}),c.jsx("button",{onClick:ne,className:we.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:we.body,children:c.jsxs("div",{className:we.formContent,children:[R&&c.jsxs("div",{className:we.section,children:[c.jsx("label",{className:we.label,htmlFor:"task-edit-workspace",children:"Workspace"}),c.jsxs("select",{id:"task-edit-workspace",value:E,onChange:ee=>N(ee.target.value),className:we.personaSelect,"data-testid":"task-edit-workspace",children:[c.jsx("option",{value:"",children:"Select a workspace..."}),d.map(ee=>c.jsx("option",{value:ee.id,children:ee.name},ee.id))]})]}),c.jsxs("div",{className:we.section,children:[c.jsx("label",{className:we.label,htmlFor:"task-edit-title",children:"Title"}),c.jsx("input",{id:"task-edit-title",type:"text",value:z,onChange:ee=>O(ee.target.value),placeholder:"Task title...",autoFocus:!0,className:we.titleInput,"data-testid":"task-edit-title",onKeyDown:ee=>{ee.key==="Enter"&&ye&&be()}})]}),c.jsxs("div",{className:we.section,children:[c.jsx("label",{className:we.label,htmlFor:"task-edit-description",children:"Description"}),c.jsx("textarea",{id:"task-edit-description",value:$,onChange:ee=>J(ee.target.value),placeholder:"Describe the task... (markdown supported)",className:we.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),c.jsxs("div",{className:we.section,children:[c.jsx("label",{className:we.label,htmlFor:"task-edit-persona",children:"Default Persona"}),c.jsxs("select",{id:"task-edit-persona",value:te,onChange:ee=>U(ee.target.value),className:we.personaSelect,"data-testid":"task-edit-persona",children:[c.jsx("option",{value:"",children:"(Inherit)"}),p.map(ee=>c.jsx("option",{value:ee.id,children:ee.name},ee.id))]})]}),!x&&c.jsx("div",{className:we.section,children:c.jsxs("label",{className:we.depItem,"data-testid":"task-edit-can-decompose",children:[c.jsx("input",{type:"checkbox",checked:Q,onChange:ee=>B(ee.target.checked)}),"Can spawn subtasks"]})}),c.jsxs("div",{className:we.section,children:[c.jsx("div",{className:we.label,children:"Dependencies"}),F.length===0?c.jsx("div",{className:we.noDeps,children:"No other tasks in this workspace"}):c.jsx("div",{className:we.depList,children:F.map(ee=>{const et=ae.includes(ee.id);return c.jsxs("label",{className:`${we.depItem} ${et?we.depItemSelected:""}`,"data-testid":`dep-option-${ee.id}`,children:[c.jsx("input",{type:"checkbox",checked:et,onChange:()=>Te(ee.id)}),ee.title,c.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",ee.status,")"]})]},ee.id)})})]})]})})]})}function X0(){const{workspaceId:t,environmentId:a}=rs(),[i]=uh(),o=t??i.get("workspace")??"",r=i.get("parent")??void 0,{tasks:u,workspaces:d,personas:p,createTask:m,updateTask:g}=ut();return c.jsx(O_,{mode:"new",workspaceId:o,parentTaskId:r,environmentId:a,tasks:u,workspaces:d,personas:p,onCreateTask:m,onUpdateTask:g})}function Q0(){const{taskId:t,workspaceId:a,environmentId:i}=rs(),{tasks:o,workspaces:r,personas:u,createTask:d,updateTask:p}=ut();return c.jsx(O_,{mode:"edit",taskId:t,workspaceId:a,environmentId:i,tasks:o,workspaces:r,personas:u,onCreateTask:d,onUpdateTask:p})}const PI="_container_1pqxm_1",GI="_emptyState_1pqxm_8",$I="_card_1pqxm_14",FI="_cardHeader_1pqxm_34",qI="_categoryBadge_1pqxm_46",KI="_findingTitle_1pqxm_54",YI="_findingDate_1pqxm_60",ZI="_findingContent_1pqxm_72",XI="_tags_1pqxm_78",QI="_tag_1pqxm_78",$n={container:PI,emptyState:GI,card:$I,cardHeader:FI,categoryBadge:qI,findingTitle:KI,findingDate:YI,findingContent:ZI,tags:XI,tag:QI};function WI(t){const a=new Date(t),i=new Date,o=i.getTime()-a.getTime(),r=Math.floor(o/1e3),u=Math.floor(r/60),d=Math.floor(u/60),p=Math.floor(d/24);if(r<60)return"just now";if(u<60)return`${u}m ago`;if(d<24)return`${d}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const m=a.getFullYear()===i.getFullYear(),g=a.toLocaleString("en-US",{month:"short"}),v=a.getDate();return m?`${g} ${v}`:`${g} ${v} ${a.getFullYear()}`}const W0={architecture:{text:"var(--accent-blue)",bg:"var(--accent-blue-dim)"},api:{text:"var(--accent-green)",bg:"var(--accent-green-dim)"},bug:{text:"var(--accent-red)",bg:"var(--accent-red-dim)"},decision:{text:"var(--accent-yellow)",bg:"var(--accent-yellow-dim)"},dependency:{text:"var(--accent-purple)",bg:"var(--accent-purple-dim)"},pattern:{text:"var(--accent-cyan)",bg:"var(--accent-cyan-dim)"},general:{text:"var(--text-secondary)",bg:"var(--bg-elevated)"}};function JI({findings:t}){return t.length===0?c.jsx("div",{className:$n.emptyState,children:"No findings yet. Agents will post discoveries here."}):c.jsx("div",{className:$n.container,children:t.map((a,i)=>{const o=W0[a.category]||W0.general;return c.jsxs(Et.div,{className:$n.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:i*.05,duration:.2},children:[c.jsxs("div",{className:$n.cardHeader,children:[c.jsx("span",{className:$n.categoryBadge,style:{background:o.bg,color:o.text},children:a.category}),c.jsx("span",{className:$n.findingTitle,children:a.title}),c.jsx("span",{className:$n.findingDate,title:a.createdAt,children:WI(a.createdAt)})]}),c.jsx("div",{className:$n.findingContent,children:a.content.length>300?a.content.slice(0,300)+"...":a.content}),a.tags.length>0&&c.jsx("div",{className:$n.tags,children:a.tags.map(r=>c.jsx("span",{className:$n.tag,style:{color:o.text,textShadow:`0 0 8px ${o.text}`},children:r},r))})]},a.id)})})}function tc(t){if(!t)return"—";const a=new Date(t);return isNaN(a.getTime())?"—":a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function xf(t,a){if(!t||!a)return;const i=new Date(a).getTime()-new Date(t).getTime();if(isNaN(i)||i<0)return;const o=Math.floor(i/6e4),r=Math.floor(i%6e4/1e3);if(o===0)return`${r}s`;const u=Math.floor(o/60),d=o%60;return u===0?`${o}m ${r}s`:`${u}h ${d}m`}function J0(t){const a=t.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?L.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?L.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?L.envDotRed:L.envDotGray}function e4({status:t}){const a=ls(t),i=A2(t);return c.jsx("span",{className:`${L.statusBadge} ${L[i]??L.statusPending}`,children:a.label})}function t4({task:t,tasksById:a,environments:i,workspaces:o,taskSessions:r,selectedEnvId:u}){const{loadUsage:d,usageCache:p}=ut(),m=r.reduce((A,R)=>A+(R.costUsd??0),0);b.useEffect(()=>{d("task",t.id),t.childTaskIds.length>0&&d("task_tree",t.id)},[t.id,t.childTaskIds.length,d,m]);const g=`task:${t.id}`,v=g in p?p[g]:void 0,y=`task_tree:${t.id}`,x=t.childTaskIds.length>0&&y in p?p[y]:void 0,S=r.length>0?r[r.length-1]:void 0,T=(S==null?void 0:S.environmentId)??"",E=T?i.find(A=>A.id===T):void 0,N=o.find(A=>A.id===t.workspaceId),C=i.find(A=>A.id===u),j=t.branch&&(N!=null&&N.repoUrl)?`${N.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(t.branch)}`:void 0;return c.jsxs("div",{className:L.overviewDashboard,children:[c.jsxs("div",{className:L.overviewHero,children:[c.jsx(e4,{status:t.status}),t.branch&&c.jsx("span",{className:L.overviewBranchPill,children:j?c.jsxs("a",{href:j,target:"_blank",rel:"noreferrer noopener",className:L.branchLink,children:["🔗"," ",t.branch]}):c.jsxs("span",{children:["🔗"," ",t.branch]})})]}),typeof t.description=="string"&&t.description&&c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Description"}),c.jsx("div",{className:L.overviewMarkdown,children:c.jsx(th,{remarkPlugins:[nh],children:t.description})})]}),c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Environment"}),T&&E?c.jsxs("div",{className:L.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${L.envDot} ${J0(E.status)}`,title:E.status,"aria-label":`Status: ${E.status}`,role:"img"}),c.jsx("span",{className:L.overviewValue,children:E.displayName})]}):C?c.jsxs("div",{className:L.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${L.envDot} ${J0(C.status)}`,title:C.status,"aria-label":`Status: ${C.status}`,role:"img"}),c.jsx("span",{className:L.overviewValue,children:C.displayName}),c.jsx("span",{className:L.overviewMuted,children:"(workspace default)"})]}):c.jsx("div",{className:L.overviewMuted,children:"Set in workspace settings"})]}),c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Dependencies"}),t.dependsOn.length===0?c.jsx("div",{className:L.overviewMuted,children:"None"}):c.jsx("div",{className:L.depList,children:t.dependsOn.map(A=>{const R=a.get(A),w=(R==null?void 0:R.status)==="complete";return c.jsxs("div",{className:`${L.depItem} ${w?L.depDone:L.depBlocked}`,children:[c.jsx("span",{children:w?"✓":"○"}),c.jsx("span",{children:(R==null?void 0:R.title)??A})]},A)})})]}),c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Timeline"}),c.jsxs("div",{className:L.timeline,children:[t.createdAt&&c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Created"}),c.jsx("span",{className:L.timelineValue,children:tc(t.createdAt)})]}),t.assignedAt&&(()=>{const A=xf(t.createdAt,t.assignedAt);return c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Assigned"}),c.jsx("span",{className:L.timelineValue,children:tc(t.assignedAt)}),A!==void 0&&c.jsx("span",{className:L.timelineDelta,children:A})]})})(),t.startedAt&&(()=>{const A=xf(t.assignedAt??t.createdAt,t.startedAt);return c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Started"}),c.jsx("span",{className:L.timelineValue,children:tc(t.startedAt)}),A!==void 0&&c.jsx("span",{className:L.timelineDelta,children:A})]})})(),t.completedAt&&(()=>{const A=xf(t.startedAt,t.completedAt);return c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Completed"}),c.jsx("span",{className:L.timelineValue,children:tc(t.completedAt)}),A!==void 0&&c.jsx("span",{className:L.timelineDelta,children:A})]})})(),!t.createdAt&&!t.assignedAt&&!t.startedAt&&!t.completedAt&&c.jsx("div",{className:L.overviewMuted,children:"No timing data"})]})]}),v&&v.costUsd>0&&c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Usage"}),c.jsxs("div",{className:L.timeline,children:[c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Cost"}),c.jsx("span",{className:L.timelineValue,children:Yi(v.costUsd)}),c.jsxs("span",{className:L.timelineDelta,children:[v.sessionCount," session",v.sessionCount!==1?"s":""]})]}),x&&x.costUsd>v.costUsd&&c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Total (incl. subtasks)"}),c.jsx("span",{className:L.timelineValue,children:Yi(x.costUsd)}),c.jsxs("span",{className:L.timelineDelta,children:[x.sessionCount," session",x.sessionCount!==1?"s":""]})]})]})]}),t.reviewNotes&&c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Review Notes"}),c.jsx("div",{className:L.reviewNotes,children:t.reviewNotes})]})]})}function n4({task:t,sessionId:a,isBlocked:i,onStart:o,onResume:r,onStop:u,onPause:d,onDelete:p,onEdit:m}){if(t.status==="not_started")return i?c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:m,className:L.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})]}):c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:o,className:L.btnPrimary,children:"Start"}),c.jsx("button",{onClick:m,className:L.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})]});if(t.status==="working")return c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:u,className:L.btnDanger,children:"Stop"}),c.jsx("button",{onClick:d,disabled:!a,className:L.btnGhost,children:"Pause"})]});if(t.status==="paused")return c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:u,className:L.btnPrimary,children:"Stop"}),c.jsx("button",{onClick:r,className:L.btnGhost,children:"Resume"}),c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})]});if(t.status==="complete")return c.jsx("div",{className:L.headerActions,children:c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})});if(t.status==="failed")return c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:o,className:L.btnPrimary,children:"Retry"}),c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})]})}function a4({taskSessions:t,selectedSessionId:a,onSelect:i}){if(!(t.length<2))return c.jsxs("div",{className:L.attemptSelector,"data-testid":"attempt-selector",children:[c.jsx("span",{className:L.attemptLabel,children:"Attempts:"}),t.map((o,r)=>{const u=o.id===a,d=o.status==="stopped"&&o.endReason==="completed"?"✓":o.status==="stopped"?"✗":o.status==="running"||o.status==="idle"?"●":"";return c.jsxs("button",{className:`${L.attemptButton} ${u?L.attemptActive:""}`,onClick:()=>i(o.id),title:`Attempt #${r+1} — ${o.status}`,"aria-label":`Attempt #${r+1}, ${o.status}`,"aria-pressed":u,"data-testid":`attempt-${r+1}`,children:["#",r+1,d&&c.jsx("span",{className:L.attemptStatus,children:d})]},o.id)})]})}function Oi(){const{taskId:t,workspaceId:a,environmentId:i}=rs(),o=At(),r=Mt(),{events:u,eventsDropped:d,tasks:p,sessions:m,environments:g,findings:v,loadSessionEvents:y,loadFindings:x,kill:S,startTask:T,stopTask:E,resumeTask:N,deleteTask:C,workspaces:j,taskSessions:A,loadTaskSessions:R,sendInput:w,spawn:G,personas:z,provisionEnvironment:O}=ut(),$=b.useRef(void 0),J=b.useRef(void 0),ae=b.useRef(void 0),se=b.useRef(void 0),te=b.useRef(void 0),U=o.pathname.endsWith("/stream")?"stream":o.pathname.endsWith("/findings")?"findings":"overview",[Q,B]=b.useState(U),[q,oe]=b.useState(!1),[le,F]=b.useState(void 0),[ye,Te]=b.useState(""),be=b.useRef(U);U!==be.current&&(be.current=U,U!==Q&&B(U));const ne=p.find(ke=>ke.id===t),ce=(ne==null?void 0:ne.workspaceId)||void 0,ee=j.find(ke=>ke.id===ce);b.useEffect(()=>{if(ye===""){if(ee!=null&&ee.environmentId)Te(ee.environmentId);else if(g.length>0){const ke=g.find(Nt=>Nt.status==="connected");Te((ke==null?void 0:ke.id)??g[0].id)}}},[ye,ee==null?void 0:ee.environmentId,g]);const et=ne?A[ne.id]??[]:[];let Me;le&&et.some(ke=>ke.id===le)?Me=le:Me=(ne==null?void 0:ne.latestSessionId)||void 0;const On=()=>{oe(!0)},Na=()=>{if(!ne)return;C(ne.id),oe(!1);const ke=i??(ee==null?void 0:ee.environmentId);r(ne.workspaceId&&ke?Pi(ne.workspaceId,ke):"/",{replace:!0})};if((ne==null?void 0:ne.id)!==J.current&&(J.current=ne==null?void 0:ne.id,le!==void 0&&F(void 0),ye!==""&&Te("")),b.useEffect(()=>{if(!(ne!=null&&ne.id))return;const ke=ne.id!==se.current,Nt=ne.latestSessionId!==te.current;(ke||Nt)&&(se.current=ne.id,te.current=ne.latestSessionId,R(ne.id))},[ne==null?void 0:ne.id,ne==null?void 0:ne.latestSessionId,R]),(ne==null?void 0:ne.status)!==ae.current){const ke=ae.current===void 0;ae.current=ne==null?void 0:ne.status;const Nt=(ne==null?void 0:ne.status)==="not_started"?"overview":(ne==null?void 0:ne.status)==="working"||(ne==null?void 0:ne.status)==="paused"?"stream":(ne==null?void 0:ne.status)==="complete"?"findings":void 0;Nt&&Nt!==Q&&!(ke&&U!=="overview")&&B(Nt)}const gn=b.useMemo(()=>new Map(p.map(ke=>[ke.id,ke])),[p]),Jn=b.useMemo(()=>{const ke=Me?u.filter(Nt=>Nt.sessionId===Me):[];return Qh(Xh(ke))},[u,Me]),ea=ne?ne.dependsOn.some(ke=>{const Nt=gn.get(ke);return Nt!==void 0&&Nt.status!=="complete"}):!1,vn=b.useMemo(()=>IB(t,i,j,g,gn),[t,i,j,g,gn]);b.useEffect(()=>{Me&&Me!==$.current&&($.current=Me,y(Me))},[Me,y]),b.useEffect(()=>{Q==="findings"&&ce&&x(ce)},[Q,ce,x]);const zn=ke=>{B(ke),r(ka(t,ke==="overview"?void 0:ke,a,i))};return c.jsxs("div",{className:L.panelContainer,children:[c.jsx($s,{segments:vn}),c.jsxs("div",{className:L.header,children:[c.jsxs("span",{className:L.headerTitle,children:[c.jsx("span",{"data-testid":"task-title",children:(ne==null?void 0:ne.title)||t}),ne&&c.jsx("span",{className:L.taskStatusBadge,"data-testid":"task-status",children:ne.status}),(ne==null?void 0:ne.branch)&&c.jsx("span",{className:L.taskBranch,children:ne.branch}),ea&&c.jsx("span",{className:L.taskBlockedBadge,children:"blocked"})]}),ne&&c.jsx(n4,{task:ne,sessionId:Me,isBlocked:ea,onStart:()=>T(ne.id,void 0,ye),onResume:()=>N(ne.id),onStop:()=>E(ne.id),onPause:()=>Me&&S(Me),onDelete:On,onEdit:()=>r(iC(ne.id,a,i))})]}),c.jsxs("div",{className:L.tabBar,role:"tablist","aria-label":"Task view",children:[c.jsx("button",{role:"tab","aria-selected":Q==="overview",className:`${L.tab} ${Q==="overview"?L.active:""}`,onClick:()=>zn("overview"),children:"Overview"}),c.jsx("button",{role:"tab","aria-selected":Q==="stream",className:`${L.tab} ${Q==="stream"?L.active:""}`,onClick:()=>zn("stream"),children:"Stream"}),c.jsx("button",{role:"tab","aria-selected":Q==="findings",className:`${L.tab} ${Q==="findings"?L.active:""}`,onClick:()=>zn("findings"),children:"Findings"})]}),c.jsxs(Wn,{mode:"wait",children:[Q==="overview"&&c.jsx(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:L.overviewContent,"data-testid":"task-overview",children:ne?c.jsx(t4,{task:ne,tasksById:gn,environments:g,workspaces:j,taskSessions:et,selectedEnvId:ye}):c.jsx("div",{className:L.waitingMessage,children:"No additional details"})},"overview"),Q==="stream"&&c.jsxs(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[c.jsx(a4,{taskSessions:et,selectedSessionId:Me,onSelect:ke=>F(ke)}),c.jsx(Zh,{events:Jn,eventsDropped:d,emptyState:!Me&&ne?c.jsxs("div",{className:L.emptyCta,children:[c.jsx("button",{className:L.ctaButton,onClick:()=>T(ne.id,void 0,ye),children:"Start Task"}),c.jsx("div",{className:L.ctaDescription,children:"Click to begin agent execution"})]}):Me&&Jn.length===0?c.jsx("div",{className:L.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),Q==="findings"&&c.jsx(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:L.tabContent,children:ce?c.jsx(JI,{findings:v.filter(ke=>ke.workspaceId===ce)}):c.jsx("div",{className:L.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!ne||ne.status!=="working"&&ne.status!=="paused")return;const ke=Me?m.find(Nt=>Nt.id===Me):void 0;if(!(!ke||ke.status==="stopped"))return c.jsx(_l,{mode:"send",sessionId:ke.id,environmentId:ke.environmentId,personas:z,environments:g,onSendInput:w,onSpawn:G,onStartTask:T,onProvisionEnvironment:O})})(),ne&&c.jsx(Oc,{isOpen:q,title:"Delete Task?",description:`"${ne.title}" will be permanently removed.`,onConfirm:Na,onCancel:()=>oe(!1)})]})}const s4="_container_legrg_1",i4="_header_legrg_8",o4="_headerTitle_legrg_35",l4="_badge_legrg_44",r4="_headerActions_legrg_54",c4="_body_legrg_61",u4="_formContent_legrg_73",d4="_section_legrg_85",f4="_label_legrg_91",h4="_nameInput_legrg_98",p4="_fieldInput_legrg_131",m4="_adapterSelect_legrg_164",g4="_readOnlyValue_legrg_198",v4="_codespaceSection_legrg_204",y4="_codespaceActions_legrg_210",b4="_creatingHint_legrg_216",x4="_errorHint_legrg_222",_4="_btnPrimary_legrg_235",S4="_btnGhost_legrg_266",ie={container:s4,header:i4,headerTitle:o4,badge:l4,headerActions:r4,body:c4,formContent:u4,section:d4,label:f4,nameInput:h4,fieldInput:p4,adapterSelect:m4,readOnlyValue:g4,codespaceSection:v4,codespaceActions:y4,creatingHint:b4,errorHint:x4,btnPrimary:_4,btnGhost:S4},rc=1,cc=65535;function _f(t){if(!t.trim())return!0;const a=Number(t);return Number.isInteger(a)&&a>=rc&&a<=cc}function Sf(t){try{const a=JSON.parse(t);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function T4({codespaceName:t,onCodespaceNameChange:a,envName:i,onEnvNameChange:o,codespaces:r,codespaceError:u,codespaceListError:d,codespaceCreating:p,onCreateCodespace:m}){const[g,v]=b.useState("pick"),[y,x]=b.useState(""),[S,T]=b.useState("");return g==="create"?c.jsxs("div",{className:ie.codespaceSection,children:[c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"Repository"}),c.jsx("input",{type:"text",value:y,onChange:E=>x(E.target.value),placeholder:"owner/repo",className:ie.fieldInput,"data-testid":"env-codespace-repo"})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"Machine Type"}),c.jsx("input",{type:"text",value:S,onChange:E=>T(E.target.value),placeholder:"Machine type (optional)...",className:ie.fieldInput,"data-testid":"env-codespace-machine"})]}),c.jsxs("div",{className:ie.codespaceActions,children:[c.jsx("button",{onClick:()=>{y.trim()&&(m(y.trim(),S.trim()||void 0),v("pick"),x(""),T(""))},disabled:!y.trim(),className:ie.btnPrimary,children:"Create"}),c.jsx("button",{onClick:()=>{v("pick"),x(""),T("")},className:ie.btnGhost,children:"Cancel"})]})]}):c.jsx("div",{className:ie.codespaceSection,children:c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"Codespace"}),!d&&c.jsxs("select",{value:t,onChange:E=>{E.target.value==="__create__"?(v("create"),a("")):(a(E.target.value),E.target.value&&!i.trim()&&o(E.target.value))},disabled:p,className:ie.adapterSelect,"data-testid":"env-codespace-select",children:[c.jsx("option",{value:"",children:"Select a codespace..."}),r.map(E=>c.jsxs("option",{value:E.name,children:[E.name," (",E.repository,") — ",E.state]},E.name)),c.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&c.jsx("span",{className:ie.creatingHint,children:"Creating codespace..."}),d&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:ie.errorHint,children:d}),c.jsx("input",{type:"text",value:t,onChange:E=>a(E.target.value),placeholder:"Or enter codespace name manually...",className:ie.fieldInput,"data-testid":"env-codespace-manual"})]}),u&&!d&&c.jsx("span",{className:ie.errorHint,children:u})]})})}function B_({mode:t,environmentId:a,environments:i,onAddEnvironment:o,onUpdateEnvironment:r,onListCodespaces:u,codespaces:d,codespaceError:p,codespaceListError:m,codespaceCreating:g,onCreateCodespace:v}){const{showToast:y}=Ps(),x=Mt(),S=t==="edit",T=S&&a?i.find(ce=>ce.id===a):void 0,[E,N]=b.useState(""),[C,j]=b.useState("local"),[A,R]=b.useState(""),[w,G]=b.useState(""),[z,O]=b.useState(""),[$,J]=b.useState(""),[ae,se]=b.useState(""),[te,U]=b.useState(""),[Q,B]=b.useState(""),[q,oe]=b.useState(null),le=b.useCallback(()=>{const ce={};if(C==="local"){if(A.trim()&&(ce.host=A.trim()),w.trim()){const ee=Number(w);Number.isInteger(ee)&&(ce.port=ee)}}else if(C==="ssh"){if(ce.host=A.trim(),z.trim()&&(ce.user=z.trim()),w.trim()){const ee=Number(w);Number.isInteger(ee)&&(ce.sshPort=ee)}$.trim()&&(ce.identityFile=$.trim())}else C==="docker"?(ae.trim()&&(ce.image=ae.trim()),te.trim()&&(ce.repo=te.trim())):C==="codespace"&&(ce.codespaceName=Q.trim());return ce},[C,A,w,z,$,ae,te,Q]),F=()=>!(!E.trim()||C==="ssh"&&!A.trim()||C==="codespace"&&!Q.trim()||(C==="local"||C==="ssh")&&!_f(w)),ye=()=>{F()&&(o(E.trim(),C,le()),y("Environment added successfully","success"),x(Gi,{replace:!0}))},Te=()=>{x(a?$i(a):Gi)},be=b.useCallback((ce,ee)=>{if(!T||!a)return;const et=Sf(T.adapterConfig),Me=ee.trim();Me?et[ce]=Me:delete et[ce],r(a,{adapterConfig:et})},[T,a,r]),ne=b.useCallback((ce,ee)=>{if(!T||!a)return;const et=Sf(T.adapterConfig);if(ee.trim()){const Me=Number(ee);Number.isInteger(Me)&&Me>=rc&&Me<=cc&&(et[ce]=Me)}else delete et[ce];r(a,{adapterConfig:et})},[T,a,r]);if(S){if(!T)return c.jsxs("div",{className:ie.container,children:[c.jsxs("div",{className:ie.header,children:[c.jsx("div",{className:ie.headerTitle,children:c.jsx("span",{className:ie.badge,children:"edit environment"})}),c.jsx("div",{className:ie.headerActions,children:c.jsx("button",{onClick:Te,className:ie.btnGhost,children:"Back"})})]}),c.jsx("div",{className:ie.body,children:c.jsx("div",{className:ie.formContent,children:c.jsx("span",{className:ie.readOnlyValue,children:"Environment not found"})})})]});const ce=Sf(T.adapterConfig);return c.jsxs("div",{className:ie.container,"data-testid":"env-edit-panel",children:[c.jsxs("div",{className:ie.header,children:[c.jsx("div",{className:ie.headerTitle,children:c.jsx("span",{className:ie.badge,children:"edit environment"})}),c.jsx("div",{className:ie.headerActions,children:c.jsx("button",{onClick:Te,className:ie.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),c.jsx("div",{className:ie.body,children:c.jsxs("div",{className:ie.formContent,children:[c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"Name"}),c.jsx(dn,{value:T.displayName,onSave:ee=>{a&&r(a,{displayName:ee})},validate:ee=>ee.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:q,onActivate:oe,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"Adapter Type"}),c.jsx("span",{className:ie.readOnlyValue,"data-testid":"env-edit-adapter-type",children:T.adapterType})]}),T.adapterType==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"Host"}),c.jsx(dn,{value:String(ce.host??""),onSave:ee=>be("host",ee),mode:"edit",fieldId:"host",activeFieldId:q,onActivate:oe,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"Port"}),c.jsx(dn,{value:String(ce.port??""),onSave:ee=>ne("port",ee),validate:ee=>_f(ee)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:q,onActivate:oe,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),T.adapterType==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"Host"}),c.jsx(dn,{value:String(ce.host??""),onSave:ee=>be("host",ee),validate:ee=>ee.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:q,onActivate:oe,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"User"}),c.jsx(dn,{value:String(ce.user??""),onSave:ee=>be("user",ee),mode:"edit",fieldId:"user",activeFieldId:q,onActivate:oe,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"SSH Port"}),c.jsx(dn,{value:String(ce.sshPort??""),onSave:ee=>ne("sshPort",ee),validate:ee=>_f(ee)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:q,onActivate:oe,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"Identity File"}),c.jsx(dn,{value:String(ce.identityFile??""),onSave:ee=>be("identityFile",ee),mode:"edit",fieldId:"identityFile",activeFieldId:q,onActivate:oe,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),T.adapterType==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"Image"}),c.jsx(dn,{value:String(ce.image??""),onSave:ee=>be("image",ee),mode:"edit",fieldId:"image",activeFieldId:q,onActivate:oe,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"Repo"}),c.jsx(dn,{value:String(ce.repo??""),onSave:ee=>be("repo",ee),mode:"edit",fieldId:"repo",activeFieldId:q,onActivate:oe,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),T.adapterType==="codespace"&&c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,children:"Codespace Name"}),c.jsx(dn,{value:String(ce.codespaceName??""),onSave:ee=>be("codespaceName",ee),validate:ee=>ee.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:q,onActivate:oe,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return c.jsxs("div",{className:ie.container,"data-testid":"env-create-panel",children:[c.jsxs("div",{className:ie.header,children:[c.jsx("div",{className:ie.headerTitle,children:c.jsx("span",{className:ie.badge,children:"new environment"})}),c.jsxs("div",{className:ie.headerActions,children:[c.jsx("button",{onClick:ye,disabled:!F(),className:ie.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),c.jsx("button",{onClick:Te,className:ie.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:ie.body,children:c.jsxs("div",{className:ie.formContent,children:[c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,htmlFor:"env-create-name",children:"Name"}),c.jsx("input",{id:"env-create-name",type:"text",value:E,onChange:ce=>N(ce.target.value),placeholder:"Environment name...",autoFocus:!0,className:ie.nameInput,"data-testid":"env-create-name",onKeyDown:ce=>{ce.key==="Enter"&&F()&&ye()}})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),c.jsxs("select",{id:"env-create-adapter",value:C,onChange:ce=>{j(ce.target.value),ce.target.value==="codespace"&&u()},className:ie.adapterSelect,"data-testid":"env-create-adapter",children:[c.jsx("option",{value:"local",children:"local"}),c.jsx("option",{value:"ssh",children:"ssh"}),c.jsx("option",{value:"docker",children:"docker"}),c.jsx("option",{value:"codespace",children:"codespace"})]})]}),C==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:ce=>R(ce.target.value),placeholder:"Host (optional)...",className:ie.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,htmlFor:"env-create-port",children:"Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:rc,max:cc,value:w,onChange:ce=>G(ce.target.value),placeholder:"Port (optional)...",className:ie.fieldInput,"data-testid":"env-create-port"})]})]}),C==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:ce=>R(ce.target.value),placeholder:"Host (required)...",className:ie.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,htmlFor:"env-create-user",children:"User"}),c.jsx("input",{id:"env-create-user",type:"text",value:z,onChange:ce=>O(ce.target.value),placeholder:"User (optional)...",className:ie.fieldInput,"data-testid":"env-create-user"})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,htmlFor:"env-create-port",children:"SSH Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:rc,max:cc,value:w,onChange:ce=>G(ce.target.value),placeholder:"SSH port (optional)...",className:ie.fieldInput,"data-testid":"env-create-port"})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,htmlFor:"env-create-identity",children:"Identity File"}),c.jsx("input",{id:"env-create-identity",type:"text",value:$,onChange:ce=>J(ce.target.value),placeholder:"Identity file (optional)...",className:ie.fieldInput,"data-testid":"env-create-identity"})]})]}),C==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,htmlFor:"env-create-image",children:"Image"}),c.jsx("input",{id:"env-create-image",type:"text",value:ae,onChange:ce=>se(ce.target.value),placeholder:"Image (optional)...",className:ie.fieldInput,"data-testid":"env-create-image"})]}),c.jsxs("div",{className:ie.section,children:[c.jsx("label",{className:ie.label,htmlFor:"env-create-repo",children:"Repo"}),c.jsx("input",{id:"env-create-repo",type:"text",value:te,onChange:ce=>U(ce.target.value),placeholder:"Repo (optional)...",className:ie.fieldInput,"data-testid":"env-create-repo"})]})]}),C==="codespace"&&c.jsx(T4,{codespaceName:Q,onCodespaceNameChange:B,envName:E,onEnvNameChange:N,codespaces:d,codespaceError:p,codespaceListError:m,codespaceCreating:g,onCreateCodespace:v})]})})]})}function k4(){const{environments:t,addEnvironment:a,updateEnvironment:i,listCodespaces:o,codespaces:r,codespaceError:u,codespaceListError:d,codespaceCreating:p,createCodespace:m}=ut();return c.jsx(B_,{mode:"new",environments:t,onAddEnvironment:a,onUpdateEnvironment:i,onListCodespaces:o,codespaces:r,codespaceError:u,codespaceListError:d,codespaceCreating:p,onCreateCodespace:m})}function C4(){const{environmentId:t}=rs(),{environments:a,addEnvironment:i,updateEnvironment:o,listCodespaces:r,codespaces:u,codespaceError:d,codespaceListError:p,codespaceCreating:m,createCodespace:g}=ut();return c.jsx(B_,{mode:"edit",environmentId:t,environments:a,onAddEnvironment:i,onUpdateEnvironment:o,onListCodespaces:r,codespaces:u,codespaceError:d,codespaceListError:p,codespaceCreating:m,onCreateCodespace:g})}const E4="_layout_11u79_1",N4="_content_11u79_8",j4="_tabPanel_11u79_14",fl={layout:E4,content:N4,tabPanel:j4};function w4(){const t=RB();return c.jsxs("div",{className:fl.layout,children:[c.jsx($s,{segments:t}),c.jsx("div",{className:fl.content,children:c.jsx(Hs,{})})]})}const A4="_container_13sb6_1",D4="_envHeader_13sb6_6",R4="_envTitleRow_13sb6_10",M4="_statusDot_13sb6_16",O4="_envName_13sb6_21",B4="_statusBadge_13sb6_27",I4="_envMeta_13sb6_33",L4="_metaTag_13sb6_39",U4="_actions_13sb6_51",z4="_provisionMessage_13sb6_59",V4="_errorMessage_13sb6_64",H4="_section_13sb6_69",P4="_sectionHeader_13sb6_73",G4="_cardList_13sb6_121",$4="_card_13sb6_121",F4="_cardHeader_13sb6_138",q4="_cardName_13sb6_144",K4="_cardActions_13sb6_149",Y4="_cardDescription_13sb6_154",Z4="_cardMeta_13sb6_160",X4="_repoLink_13sb6_166",Q4="_empty_13sb6_174",W4="_btnPrimary_13sb6_180",J4="_btnOutline_13sb6_214",e5="_btnSmall_13sb6_241",t5="_btnDanger_13sb6_267",Ue={container:A4,envHeader:D4,envTitleRow:R4,statusDot:M4,envName:O4,statusBadge:B4,envMeta:I4,metaTag:L4,actions:U4,provisionMessage:z4,errorMessage:V4,section:H4,sectionHeader:P4,cardList:G4,card:$4,cardHeader:F4,cardName:q4,cardActions:K4,cardDescription:Y4,cardMeta:Z4,repoLink:X4,empty:Q4,btnPrimary:W4,btnOutline:J4,btnSmall:e5,btnDanger:t5},n5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function a5(){const{environmentId:t}=rs(),a=Mt(),{environments:i,workspaces:o,sessions:r,provisionStatus:u,provisionEnvironment:d,stopEnvironment:p,removeEnvironment:m,archiveWorkspace:g}=ut(),[v,y]=b.useState(!1),[x,S]=b.useState(void 0),T=i.find($=>$.id===t);if(!t||!T)return c.jsx(Fn,{to:Gi,replace:!0});const E=o.filter($=>$.environmentId===T.id),N=r.filter($=>$.environmentId===T.id),C=N.reduce(($,J)=>$+(J.costUsd??0),0),j=n5[T.status]||"var(--text-tertiary)",A=T.status==="connected",R=T.status==="connecting",w=T.status==="disconnected"||T.status==="error",G=T.id in u?u[T.id]:void 0,z=()=>{m(T.id),y(!1),a(Gi,{replace:!0})},O=$=>{g($),S(void 0)};return c.jsxs("div",{className:Ue.container,children:[c.jsx(Oc,{isOpen:v,title:"Delete Environment?",description:`"${T.displayName||T.id}" will be permanently removed along with all its data.`,onConfirm:z,onCancel:()=>y(!1)}),c.jsxs("div",{className:Ue.envHeader,children:[c.jsxs("div",{className:Ue.envTitleRow,children:[c.jsx("span",{className:Ue.statusDot,style:{color:j},children:"●"}),c.jsx("h2",{className:Ue.envName,children:T.displayName||T.id}),c.jsx("span",{className:Ue.statusBadge,style:{color:j},children:T.status})]}),c.jsxs("div",{className:Ue.envMeta,children:[c.jsxs("span",{className:Ue.metaTag,children:["Adapter: ",T.adapterType]}),N.length>0&&c.jsxs("span",{className:Ue.metaTag,children:[N.length," session",N.length!==1?"s":""]}),C>0&&c.jsxs("span",{className:Ue.metaTag,children:["Cost: ",Yi(C)]})]})]}),c.jsxs("div",{className:Ue.actions,children:[A&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:Ue.btnPrimary,onClick:()=>a(Sb(T.id)),children:"New Chat"}),c.jsx("button",{className:Ue.btnOutline,onClick:()=>p(T.id),children:"Stop"})]}),w&&c.jsx("button",{className:Ue.btnPrimary,onClick:()=>d(T.id),children:T.status==="error"?"Retry":"Connect"}),R&&G!==void 0&&c.jsx("span",{className:Ue.provisionMessage,children:G.message}),T.status==="error"&&(G==null?void 0:G.stage)==="error"&&c.jsx("span",{className:Ue.errorMessage,children:G.message}),c.jsx("button",{className:Ue.btnOutline,onClick:()=>a(lC(T.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),c.jsx("button",{className:Ue.btnDanger,onClick:()=>y(!0),children:"Delete"})]}),c.jsxs("div",{className:Ue.section,children:[c.jsxs("div",{className:Ue.sectionHeader,children:[c.jsx("h3",{children:"Workspaces"}),c.jsx("button",{className:Ue.btnPrimary,onClick:()=>a(`${Tb}?environment=${encodeURIComponent(T.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"})]}),E.length===0&&c.jsx("p",{className:Ue.empty,children:"No workspaces yet. Create one to get started."}),c.jsx("div",{className:Ue.cardList,children:E.map($=>c.jsx(s5,{workspace:$,confirmArchiveId:x,onOpen:()=>a(Pi($.id,T.id)),onArchive:()=>S($.id),onConfirmArchive:()=>O($.id),onCancelArchive:()=>S(void 0)},$.id))})]})]})}function s5({workspace:t,confirmArchiveId:a,onOpen:i,onArchive:o,onConfirmArchive:r,onCancelArchive:u}){const d=a===t.id,p=t.repoUrl&&/^https?:\/\//.test(t.repoUrl);return c.jsxs("div",{className:Ue.card,"data-testid":"workspace-card",children:[c.jsxs("div",{className:Ue.cardHeader,children:[c.jsx("strong",{className:Ue.cardName,children:t.name}),c.jsxs("div",{className:Ue.cardActions,children:[c.jsx("button",{className:Ue.btnSmall,onClick:i,children:"Open"}),d?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:Ue.btnDanger,onClick:r,children:"Confirm"}),c.jsx("button",{className:Ue.btnSmall,onClick:u,children:"Cancel"})]}):c.jsx("button",{className:Ue.btnSmall,onClick:o,children:"Archive"})]})]}),t.description&&c.jsx("p",{className:Ue.cardDescription,children:t.description}),t.repoUrl&&c.jsx("div",{className:Ue.cardMeta,children:p?c.jsx("a",{href:t.repoUrl,target:"_blank",rel:"noopener noreferrer",className:Ue.repoLink,children:t.repoUrl}):c.jsx("span",{children:t.repoUrl})})]})}const i5={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function o5(){const a=At().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=i5[a],o=DB(i);return c.jsxs("div",{className:fl.layout,children:[c.jsx($s,{segments:o}),c.jsx("div",{className:fl.content,children:c.jsx("div",{className:fl.tabPanel,children:c.jsx(Hs,{})},a)})]})}const l5="_section_1ingb_14",r5="_sectionTitle_1ingb_26",c5="_sectionDescription_1ingb_35",u5="_tokenList_1ingb_48",d5="_tokenRow_1ingb_55",f5="_tokenBadge_1ingb_68",h5="_tokenName_1ingb_83",p5="_tokenTarget_1ingb_90",m5="_deleteButton_1ingb_99",g5="_addForm_1ingb_113",v5="_formRow_1ingb_119",y5="_input_1ingb_125",b5="_select_1ingb_155",x5="_addButton_1ingb_187",_5="_emptyStateInfo_1ingb_221",S5="_themeOptions_1ingb_229",T5="_themeOption_1ingb_229",k5="_themeOptionSelected_1ingb_254",C5="_themeOptionHeader_1ingb_259",E5="_themeOptionLabel_1ingb_266",N5="_themeOptionDesc_1ingb_273",j5="_variantToggle_1ingb_279",w5="_variantButton_1ingb_286",A5="_variantActive_1ingb_305",D5="_themeSwatches_1ingb_311",R5="_themeSwatch_1ingb_311",M5="_systemToggle_1ingb_325",O5="_systemToggleHint_1ingb_341",B5="_themeActive_1ingb_348",I5="_aboutGrid_1ingb_354",L5="_aboutItem_1ingb_360",U5="_aboutLabel_1ingb_373",z5="_aboutValue_1ingb_379",V5="_aboutDot_1ingb_387",H5="_aboutDotConnected_1ingb_394",P5="_aboutDotDisconnected_1ingb_398",fe={section:l5,sectionTitle:r5,sectionDescription:c5,tokenList:u5,tokenRow:d5,tokenBadge:f5,tokenName:h5,tokenTarget:p5,deleteButton:m5,addForm:g5,formRow:v5,input:y5,select:b5,addButton:x5,emptyStateInfo:_5,themeOptions:S5,themeOption:T5,themeOptionSelected:k5,themeOptionHeader:C5,themeOptionLabel:E5,themeOptionDesc:N5,variantToggle:j5,variantButton:w5,variantActive:A5,themeSwatches:D5,themeSwatch:R5,systemToggle:M5,systemToggleHint:O5,themeActive:B5,aboutGrid:I5,aboutItem:L5,aboutLabel:U5,aboutValue:z5,aboutDot:V5,aboutDotConnected:H5,aboutDotDisconnected:P5},G5=[{key:"claude",label:"Claude",description:"Forward Claude credentials for AI agent access.",options:[{value:"off",label:"Off"},{value:"subscription",label:"Subscription"},{value:"api_key",label:"API Key"}]},{key:"github",label:"GitHub",description:"Forward GITHUB_TOKEN and GH_TOKEN for git operations.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"copilot",label:"Copilot",description:"Forward Copilot tokens (COPILOT_GITHUB_TOKEN, CLI config).",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"codex",label:"Codex",description:"Forward OPENAI_API_KEY for Codex/OpenAI access.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"goose",label:"Goose",description:"Forward Goose config and API keys for Goose agent access.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]}];function $5({credentialProviders:t,onUpdateCredentialProviders:a}){const i=(o,r)=>{const u={...t};o==="claude"?u.claude=r:u[o]=r,a(u)};return c.jsxs("section",{className:fe.section,children:[c.jsx("h3",{className:fe.sectionTitle,children:"Credential Providers"}),c.jsx("p",{className:fe.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),c.jsx("div",{className:fe.tokenList,children:G5.map(o=>c.jsxs("div",{className:fe.tokenRow,children:[c.jsx("span",{className:fe.tokenName,children:o.label}),c.jsx("span",{className:fe.tokenTarget,children:o.description}),c.jsx("select",{className:fe.select,value:t[o.key],onChange:r=>i(o.key,r.target.value),children:o.options.map(r=>c.jsx("option",{value:r.value,children:r.label},r.value))})]},o.key))})]})}const F5=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function q5({tokens:t,onSetToken:a,onDeleteToken:i}){const{showToast:o}=Ps(),[r,u]=b.useState(""),[d,p]=b.useState(""),[m,g]=b.useState("env_var"),[v,y]=b.useState(""),[x,S]=b.useState(null),T=C=>{if(C.preventDefault(),!r||!d)return;const j=m==="env_var"?v||r.toUpperCase()+"_TOKEN":"";a(r,d,m,j,m==="file"?v:""),o("Token saved successfully","success"),u(""),p(""),y("")},E=C=>{S(C)},N=()=>{x&&(i(x),o("Token deleted","info")),S(null)};return c.jsxs(c.Fragment,{children:[c.jsx(Oc,{isOpen:x!==null,title:"Delete Token?",description:x?`"${x}" will be permanently removed.`:void 0,onConfirm:N,onCancel:()=>S(null)}),c.jsxs("section",{className:fe.section,children:[c.jsx("h3",{className:fe.sectionTitle,children:"Tokens"}),c.jsx("p",{className:fe.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),t.length===0?c.jsx("div",{className:fe.emptyStateInfo,children:"Add your first API token to enable service integrations."}):c.jsx("div",{className:fe.tokenList,children:t.map(C=>c.jsxs("div",{className:fe.tokenRow,children:[c.jsx("span",{className:fe.tokenBadge,children:C.tokenType}),c.jsx("span",{className:fe.tokenName,children:C.name}),c.jsx("span",{className:fe.tokenTarget,children:C.tokenType==="env_var"?C.envVar:C.filePath}),c.jsx("button",{className:fe.deleteButton,onClick:()=>E(C.name),title:`Delete ${C.name}`,children:"×"})]},C.name))}),c.jsxs("form",{className:fe.addForm,onSubmit:T,children:[c.jsxs("div",{className:fe.formRow,children:[c.jsx("input",{className:fe.input,type:"text",placeholder:"Token name",value:r,onChange:C=>u(C.target.value)}),c.jsx("input",{className:fe.input,type:"password",placeholder:"Value",value:d,onChange:C=>p(C.target.value)})]}),c.jsxs("div",{className:fe.formRow,children:[c.jsx("select",{className:fe.select,value:m,onChange:C=>g(C.target.value),children:F5.map(C=>c.jsx("option",{value:C.value,children:C.label},C.value))}),c.jsx("input",{className:fe.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:v,onChange:C=>y(C.target.value)}),c.jsx("button",{className:fe.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function K5(){const{tokens:t,setToken:a,deleteToken:i,credentialProviders:o,updateCredentialProviders:r}=ut();return c.jsxs(c.Fragment,{children:[c.jsx($5,{credentialProviders:o,onUpdateCredentialProviders:r}),c.jsx(q5,{tokens:t,onSetToken:a,onDeleteToken:i})]})}const Y5="_container_xb7ms_1",Z5="_header_xb7ms_7",X5="_form_xb7ms_19",Q5="_formActions_xb7ms_87",W5="_list_xb7ms_93",J5="_card_xb7ms_99",eL="_active_xb7ms_109",tL="_cardHeader_xb7ms_113",nL="_cardTitle_xb7ms_123",aL="_defaultBadge_xb7ms_129",sL="_cardActions_xb7ms_143",iL="_description_xb7ms_148",oL="_meta_xb7ms_154",lL="_promptDetails_xb7ms_171",rL="_promptText_xb7ms_183",cL="_empty_xb7ms_200",uL="_btnPrimary_xb7ms_206",dL="_btnSecondary_xb7ms_240",fL="_btnSmall_xb7ms_267",hL="_btnDanger_xb7ms_293",pL="_typeToggle_xb7ms_336",mL="_typeBadge_xb7ms_350",gL="_scriptEditor_xb7ms_364",vL="_optional_xb7ms_371",$e={container:Y5,header:Z5,form:X5,formActions:Q5,list:W5,card:J5,active:eL,cardHeader:tL,cardTitle:nL,defaultBadge:aL,cardActions:sL,description:iL,meta:oL,promptDetails:lL,promptText:rL,empty:cL,btnPrimary:uL,btnSecondary:dL,btnSmall:fL,btnDanger:hL,typeToggle:pL,typeBadge:mL,scriptEditor:gL,optional:vL};function yL({personas:t,appDefaultPersonaId:a,onCreatePersona:i,onUpdatePersona:o,onDeletePersona:r,onSetAppDefaultPersonaId:u}){const[d,p]=b.useState(null),[m,g]=b.useState(!1),[v,y]=b.useState(null),[x,S]=b.useState(""),[T,E]=b.useState(""),[N,C]=b.useState(""),[j,A]=b.useState("claude-code"),[R,w]=b.useState("sonnet"),[G,z]=b.useState(0),[O,$]=b.useState("agent"),[J,ae]=b.useState(""),se=()=>{S(""),E(""),C(""),A("claude-code"),w("sonnet"),z(0),$("agent"),ae("")},te=()=>{se(),p(null),g(!0)},U=F=>{S(F.name),E(F.description),C(F.systemPrompt);const ye=F.type==="script"?"script":"agent";A(ye==="script"?F.runtime||"genaiscript":F.runtime),w(F.model),z(F.maxTurns),$(ye),ae(F.script||""),p(F),g(!1)},Q=F=>{$(F),F==="script"?A("genaiscript"):j==="genaiscript"&&A("claude-code")},B=F=>{if(F.preventDefault(),!!x.trim()){if(O==="script"){if(!J.trim())return}else if(!N.trim()||!j||!R)return;d?(o(d.id,x,T,N,j,R,G,O,J),p(null)):(i(x,T,N,j,R,G,O,J),g(!1)),se()}},q=F=>{r(F),y(null),(d==null?void 0:d.id)===F&&(p(null),se())},oe=()=>{p(null),g(!1),se()},le=()=>c.jsxs("form",{onSubmit:B,className:$e.form,children:[c.jsx("h3",{children:d?"Edit Persona":"Create Persona"}),c.jsxs("div",{className:$e.typeToggle,"data-testid":"persona-type-toggle",children:[c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:O==="agent",onChange:()=>Q("agent")}),"Agent"]}),c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"script",checked:O==="script",onChange:()=>Q("script")}),"Script"]})]}),c.jsxs("label",{children:["Name",c.jsx("input",{type:"text",value:x,onChange:F=>S(F.target.value),placeholder:O==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0})]}),c.jsxs("label",{children:["Description",c.jsx("input",{type:"text",value:T,onChange:F=>E(F.target.value),placeholder:"Brief description..."})]}),c.jsxs("label",{children:["Runtime",c.jsx("select",{value:j,onChange:F=>A(F.target.value),"data-testid":"persona-runtime-select",children:O==="script"?c.jsx("option",{value:"genaiscript",children:"genaiscript"}):c.jsxs(c.Fragment,{children:[c.jsx("option",{value:"claude-code",children:"claude-code"}),c.jsx("option",{value:"codex",children:"codex"}),c.jsx("option",{value:"copilot",children:"copilot"}),c.jsx("option",{value:"goose",children:"goose"}),c.jsx("option",{value:"stub",children:"stub"}),c.jsx("option",{value:"claude-code-acp",children:"claude-code-acp (experimental)"}),c.jsx("option",{value:"codex-acp",children:"codex-acp (experimental)"}),c.jsx("option",{value:"copilot-acp",children:"copilot-acp (experimental)"})]})})]}),O==="agent"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model",c.jsx("input",{type:"text",value:R,onChange:F=>w(F.target.value),placeholder:"e.g. sonnet"})]}),c.jsxs("label",{children:["Max Turns",c.jsx("input",{type:"number",value:G,onChange:F=>z(parseInt(F.target.value,10)||0),min:0})]}),c.jsxs("label",{children:["System Prompt",c.jsx("textarea",{value:N,onChange:F=>C(F.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]})]}),O==="script"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model ",c.jsx("span",{className:$e.optional,children:"(optional)"}),c.jsx("input",{type:"text",value:R,onChange:F=>w(F.target.value),placeholder:"e.g. sonnet (leave empty for script-only)"})]}),c.jsxs("label",{children:["System Prompt ",c.jsx("span",{className:$e.optional,children:"(optional)"}),c.jsx("textarea",{value:N,onChange:F=>C(F.target.value),placeholder:"Optional context for the script...",rows:4})]}),c.jsxs("label",{children:["Script",c.jsx("textarea",{value:J,onChange:F=>ae(F.target.value),placeholder:`script({ model: "openai:gpt-4o" });
|
|
106
|
-
|
|
107
|
-
const grackle = await host.mcpServer({
|
|
108
|
-
id: "grackle",
|
|
109
|
-
url: env.vars.GRACKLE_MCP_URL,
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
$\`Summarize the current tasks.\`;`,rows:20,className:$e.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),c.jsxs("div",{className:$e.formActions,children:[c.jsx("button",{type:"submit",className:$e.btnPrimary,children:d?"Save":"Create"}),c.jsx("button",{type:"button",onClick:oe,className:$e.btnSecondary,children:"Cancel"})]})]});return c.jsxs("div",{className:$e.container,children:[c.jsxs("div",{className:$e.header,children:[c.jsx("h2",{children:"Personas"}),c.jsx("button",{onClick:te,className:$e.btnPrimary,children:"+ New Persona"})]}),(m||d)&&le(),t.length===0&&!m?c.jsx("p",{className:$e.empty,children:"No personas yet. Create one to get started."}):c.jsx("div",{className:$e.list,children:t.map(F=>{const ye=a===F.id,Te=F.type==="script";return c.jsxs("div",{className:`${$e.card} ${(d==null?void 0:d.id)===F.id?$e.active:""}`,"data-testid":`persona-card-${F.id}`,children:[c.jsxs("div",{className:$e.cardHeader,children:[c.jsxs("span",{className:$e.cardTitle,children:[c.jsx("strong",{children:F.name}),c.jsx("span",{className:$e.typeBadge,"data-testid":`persona-type-badge-${F.id}`,children:Te?"Script":"Agent"}),ye&&c.jsx("span",{className:$e.defaultBadge,"data-testid":`persona-default-badge-${F.id}`,children:"App Default"})]}),c.jsxs("div",{className:$e.cardActions,children:[!ye&&c.jsx("button",{onClick:()=>u(F.id),className:$e.btnSmall,"data-testid":`persona-set-default-${F.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>U(F),className:$e.btnSmall,children:"Edit"}),v===F.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>q(F.id),className:$e.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>y(null),className:$e.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>y(F.id),className:$e.btnSmall,children:"Delete"})]})]}),F.description&&c.jsx("p",{className:$e.description,children:F.description}),c.jsxs("div",{className:$e.meta,children:[F.runtime&&c.jsxs("span",{children:["Runtime: ",F.runtime]}),F.model&&c.jsxs("span",{children:["Model: ",F.model]}),F.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",F.maxTurns]})]}),Te?c.jsxs("details",{className:$e.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:$e.promptText,children:F.script})]}):c.jsxs("details",{className:$e.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:$e.promptText,children:F.systemPrompt})]})]},F.id)})})]})}function bL(){const{personas:t,createPersona:a,updatePersona:i,deletePersona:o,appDefaultPersonaId:r,setAppDefaultPersonaId:u}=ut();return c.jsx(yL,{personas:t,appDefaultPersonaId:r,onCreatePersona:a,onUpdatePersona:i,onDeletePersona:o,onSetAppDefaultPersonaId:u})}function xL(){const{themeId:t,resolvedThemeId:a,setTheme:i,preferSystem:o,setPreferSystem:r}=Db();return c.jsxs("section",{className:fe.section,children:[c.jsx("h3",{className:fe.sectionTitle,children:"Appearance"}),c.jsx("p",{className:fe.sectionDescription,children:"Choose how Grackle looks across the app."}),c.jsx("div",{className:fe.themeOptions,children:Ec.filter(u=>!u.hidden).map(u=>{const d=!!(u.variantLightId&&u.variantDarkId),p=d?t===u.id||t===u.variantLightId||t===u.variantDarkId:t===u.id,m=d&&a===u.variantLightId;return c.jsxs("button",{type:"button",className:`${fe.themeOption} ${p?fe.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(u.id),children:[c.jsxs("span",{className:fe.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:fe.themeOptionLabel,children:u.label}),c.jsx("span",{className:fe.themeOptionDesc,children:u.description})]}),d&&c.jsxs("span",{className:fe.variantToggle,children:[c.jsx("span",{role:"button",tabIndex:0,className:`${fe.variantButton} ${p&&m?fe.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),c.jsx("span",{role:"button",tabIndex:0,className:`${fe.variantButton} ${p&&!m?fe.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),u.swatches&&c.jsx("span",{className:fe.themeSwatches,children:u.swatches.map((g,v)=>c.jsx("span",{className:fe.themeSwatch,style:{background:g}},v))})]},u.id)})}),c.jsxs("label",{className:fe.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:o,onChange:u=>r(u.target.checked)}),c.jsx("span",{children:"Match system light/dark preference"})]}),c.jsx("p",{className:fe.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),c.jsxs("p",{className:fe.themeActive,children:["Active theme: ",c.jsx("strong",{children:a})]})]})}function _L(){return c.jsx(xL,{})}function SL({connected:t,environments:a,sessions:i}){const o=a.filter(d=>d.status==="connected").length,r=a.length,u=i.filter(d=>["running","idle"].includes(d.status)).length;return c.jsxs("section",{className:fe.section,"data-testid":"about-panel",children:[c.jsx("h3",{className:fe.sectionTitle,children:"About"}),c.jsx("p",{className:fe.sectionDescription,children:"Connection status and application information."}),c.jsxs("div",{className:fe.aboutGrid,children:[c.jsxs("div",{className:fe.aboutItem,children:[c.jsx("span",{className:fe.aboutLabel,children:"Connection"}),c.jsxs("span",{className:fe.aboutValue,children:[c.jsx("span",{className:`${fe.aboutDot} ${t?fe.aboutDotConnected:fe.aboutDotDisconnected}`}),t?"Connected":"Disconnected"]})]}),c.jsxs("div",{className:fe.aboutItem,children:[c.jsx("span",{className:fe.aboutLabel,children:"Environments"}),c.jsxs("span",{className:fe.aboutValue,children:[o,"/",r," connected"]})]}),c.jsxs("div",{className:fe.aboutItem,children:[c.jsx("span",{className:fe.aboutLabel,children:"Active Sessions"}),c.jsx("span",{className:fe.aboutValue,children:u})]}),c.jsxs("div",{className:fe.aboutItem,children:[c.jsx("span",{className:fe.aboutLabel,children:"Version"}),c.jsx("span",{className:fe.aboutValue,children:"0.74.0"})]})]})]})}function TL(){const{connected:t,environments:a,sessions:i}=ut();return c.jsx(SL,{connected:t,environments:a,sessions:i})}const kL="_wizard_1260s_1",CL="_container_1260s_10",EL="_stepContent_1260s_19",NL="_logoArea_1260s_28",jL="_logoImage_1260s_32",wL="_heading_1260s_41",AL="_tagline_1260s_49",DL="_subtitle_1260s_56",RL="_featureList_1260s_64",ML="_runtimeGrid_1260s_89",OL="_runtimeCard_1260s_101",BL="_runtimeName_1260s_133",IL="_runtimeDescription_1260s_139",LL="_buttonRow_1260s_144",UL="_primaryButton_1260s_151",zL="_ghostButton_1260s_185",VL="_dots_1260s_213",HL="_dot_1260s_213",at={wizard:kL,container:CL,stepContent:EL,logoArea:NL,logoImage:jL,heading:wL,tagline:AL,subtitle:DL,featureList:RL,runtimeGrid:ML,runtimeCard:OL,runtimeName:BL,runtimeDescription:IL,buttonRow:LL,primaryButton:UL,ghostButton:zL,dots:VL,dot:HL};function PL({onNext:t}){return c.jsxs("div",{className:at.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:at.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:at.logoImage})}),c.jsx("h1",{className:at.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:at.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:at.primaryButton,onClick:t,"data-testid":"setup-get-started",children:"Get Started"})]})}function GL({onNext:t,onBack:a}){return c.jsxs("div",{className:at.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:at.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:at.featureList,children:[c.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),c.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),c.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),c.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),c.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),c.jsxs("div",{className:at.buttonRow,children:[c.jsx("button",{type:"button",className:at.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:at.primaryButton,onClick:t,"data-testid":"setup-about-next",children:"Next"})]})]})}const $L=[{id:"claude-code",name:"Claude Code",description:"Anthropic's agentic coding tool"},{id:"copilot",name:"Copilot Coding Agent",description:"GitHub's AI pair programmer"},{id:"codex",name:"Codex CLI",description:"OpenAI's coding agent"},{id:"goose",name:"Goose",description:"Block's open-source AI coding agent"}];function FL({currentRuntime:t,onFinish:a,onBack:i,finishDisabled:o}){const[r,u]=b.useState(t||"claude-code");return b.useEffect(()=>{t&&u(t)},[t]),c.jsxs("div",{className:at.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:at.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:at.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:at.runtimeGrid,children:$L.map(d=>c.jsxs("button",{type:"button",className:at.runtimeCard,"data-selected":r===d.id,"aria-pressed":r===d.id,"data-testid":`runtime-card-${d.id}`,onClick:()=>u(d.id),children:[c.jsx("span",{className:at.runtimeName,children:d.name}),c.jsx("span",{className:at.runtimeDescription,children:d.description})]},d.id))}),c.jsxs("div",{className:at.buttonRow,children:[c.jsx("button",{type:"button",className:at.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:at.primaryButton,onClick:()=>a(r),disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const qL=3,eb={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function KL(){const{personas:t,updatePersona:a,completeOnboarding:i,onboardingCompleted:o}=ut(),r=Mt(),[u,d]=b.useState(0),p=t.find(g=>g.id==="claude-code"),m=b.useCallback(g=>{if(p&&g!==p.runtime){const y=eb[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,y)}const v=t.find(y=>y.id===O0);if(v&&g!==v.runtime){const y=eb[g]??"sonnet";a(O0,void 0,void 0,void 0,g,y)}i(),r("/",{replace:!0})},[p,t,a,i,r]);return o===!0?c.jsx(Fn,{to:"/",replace:!0}):c.jsx("div",{className:at.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:at.container,children:[c.jsx(Wn,{mode:"wait",children:c.jsxs(Et.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&c.jsx(PL,{onNext:()=>d(1)}),u===1&&c.jsx(GL,{onNext:()=>d(2),onBack:()=>d(0)}),u===2&&c.jsx(FL,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>d(1),finishDisabled:!p})]},u)}),c.jsx("div",{className:at.dots,children:Array.from({length:qL},(g,v)=>c.jsx("span",{className:at.dot,"data-active":v===u},v))})]})})}const YL="_root_zndgp_1",ZL="_body_zndgp_7",XL="_main_zndgp_19",QL="_sidebarWrapper_zndgp_26",WL="_overlay_zndgp_51",il={root:YL,body:ZL,main:XL,sidebarWrapper:QL,overlay:WL},JL=b.lazy(()=>hT(()=>import("./KnowledgePage-BUipATbG.js"),__vite__mapDeps([0,1,2,3])).then(t=>({default:t.KnowledgePage}))),e8=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function t8(){const{connected:t,environments:a,sessions:i,tasks:o}=ut(),r=At(),d=Ob()!==void 0,[p,m]=b.useState(!1),g=b.useCallback(()=>m(v=>!v),[]);return b.useEffect(()=>{m(!1)},[r.pathname]),b.useEffect(()=>{if(!p)return;const v=y=>{y.key==="Escape"&&m(!1)};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[p]),c.jsxs(c.Fragment,{children:[c.jsx(eE,{connected:t,environments:a,sessions:i,onToggleSidebar:d?g:void 0,sidebarOpen:p}),c.jsx(lE,{}),c.jsxs("div",{className:il.body,children:[d&&c.jsx("div",{className:il.sidebarWrapper,"data-sidebar-open":p,children:c.jsx(mE,{})}),d&&p&&c.jsx("div",{className:il.overlay,"data-testid":"drawer-overlay",onClick:()=>m(!1)}),c.jsxs("div",{className:il.main,children:[c.jsx(Hs,{}),c.jsx(WD,{sessions:i,tasks:o,environments:a})]})]}),c.jsx(dR,{})]})}function n8(){const{lastSpawnedId:t,environments:a,connected:i,onboardingCompleted:o}=ut(),{showToast:r}=Ps();NM(a,r);const u=Mt(),d=At();return b.useEffect(()=>{t&&!d.pathname.includes("/tasks/")&&u(_b(t),{replace:!0})},[t,u,d.pathname]),i&&o===!1?c.jsx(Fn,{to:"/setup",replace:!0}):c.jsx(rE,{children:c.jsx("div",{className:il.root,children:c.jsx(t8,{})})})}function Tf(){const{workspaceId:t}=rs(),{workspaces:a}=ut(),i=At(),o=a.find(m=>m.id===t);if(!(o!=null&&o.environmentId))return a.length===0?void 0:c.jsx(Fn,{to:"/environments",replace:!0});const r=encodeURIComponent(t),u=`/workspaces/${r}`,d=i.pathname.startsWith(u)?i.pathname.slice(u.length):"",p=`/environments/${encodeURIComponent(o.environmentId)}/workspaces/${r}${d}${i.search}${i.hash}`;return c.jsx(Fn,{to:p,replace:!0})}function a8(){return c.jsxs(kk,{children:[c.jsx(Ce,{path:"setup",element:c.jsx(KL,{})}),c.jsxs(Ce,{element:c.jsx(n8,{}),children:[c.jsx(Ce,{index:!0,element:c.jsx(eB,{})}),c.jsx(Ce,{path:"chat",element:c.jsx(wB,{})}),c.jsx(Ce,{path:"sessions/new",element:c.jsx(LB,{})}),c.jsx(Ce,{path:"sessions/:sessionId",element:c.jsx(VB,{})}),c.jsx(Ce,{element:c.jsx($D,{}),children:c.jsx(Ce,{path:"knowledge",element:c.jsx(b.Suspense,{fallback:c.jsx(j_,{}),children:c.jsx(JL,{})})})}),c.jsxs(Ce,{element:c.jsx(HD,{}),children:[c.jsx(Ce,{path:"tasks",element:c.jsx(WO,{})}),c.jsx(Ce,{path:"tasks/new",element:c.jsx(X0,{})}),c.jsx(Ce,{path:"tasks/:taskId",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"tasks/:taskId/stream",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"tasks/:taskId/findings",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"tasks/:taskId/edit",element:c.jsx(Q0,{})})]}),c.jsxs(Ce,{element:c.jsx(PD,{}),children:[c.jsx(Ce,{path:"workspaces",element:c.jsx(Fn,{to:"/environments",replace:!0})}),c.jsx(Ce,{path:"workspaces/new",element:c.jsx(HI,{})}),c.jsx(Ce,{path:"workspaces/:workspaceId",element:c.jsx(Tf,{})}),c.jsx(Ce,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Tf,{})}),c.jsx(Ce,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:c.jsx(Tf,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId",element:c.jsx(iI,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:c.jsx(X0,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(Q0,{})}),c.jsxs(Ce,{path:"environments",element:c.jsx(w4,{}),children:[c.jsx(Ce,{index:!0,element:c.jsx(JO,{})}),c.jsx(Ce,{path:"new",element:c.jsx(k4,{})}),c.jsx(Ce,{path:":environmentId",element:c.jsx(a5,{})}),c.jsx(Ce,{path:":environmentId/edit",element:c.jsx(C4,{})})]})]}),c.jsx(Ce,{element:c.jsx(GD,{}),children:c.jsxs(Ce,{path:"settings",element:c.jsx(o5,{}),children:[c.jsx(Ce,{index:!0,element:c.jsx(Fn,{to:"credentials",replace:!0})}),c.jsx(Ce,{path:"environments",element:c.jsx(Fn,{to:"/environments",replace:!0})}),c.jsx(Ce,{path:"credentials",element:c.jsx(K5,{})}),c.jsx(Ce,{path:"tokens",element:c.jsx(Fn,{to:"../credentials",replace:!0})}),c.jsx(Ce,{path:"personas",element:c.jsx(bL,{})}),c.jsx(Ce,{path:"appearance",element:c.jsx(_L,{})}),c.jsx(Ce,{path:"about",element:c.jsx(TL,{})})]})}),c.jsx(Ce,{path:"*",element:c.jsx(Fn,{to:"/",replace:!0})})]})]})}const s8=1e4;function i8(){const{onboardingCompleted:t}=ut(),[a,i]=b.useState(!1);b.useEffect(()=>{if(t!==void 0)return;const r=setTimeout(()=>i(!0),s8);return()=>clearTimeout(r)},[t]);const o=t===void 0&&!a;return c.jsx(Wn,{mode:"wait",children:o?c.jsx(Et.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(j_,{})},"splash"):c.jsx(Et.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(Zk,{children:c.jsx(a8,{})})},"app")})}function o8(){const t=e8?UC:wC;return c.jsx($C,{children:c.jsx(VC,{children:c.jsx(t,{children:c.jsx(i8,{})})})})}uT.createRoot(document.getElementById("root")).render(c.jsx(b.StrictMode,{children:c.jsx(o8,{})}));export{$s as B,kb as K,ut as a,_b as s,ka as t,Mt as u};
|