@grackle-ai/web 0.96.0 → 0.96.2
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,715 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-Bo3IzpNg.js","assets/dagview-tHPW3Rz3.js","assets/grpc-CkqXCGns.js","assets/markdown-Yr3vTPLR.js","assets/KnowledgePage-BmY14aDt.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as eT,a as tT,b as y,j as i,d as K0,H as Y0,P as J0,i as nT,B as sT,c as aT,C as iT,M as oT,e as rT}from"./dagview-tHPW3Rz3.js";import{c as lT,a as cT,G as dT,f as uT,M as fT,A as rx,D as lx,W as pT,O as mT,b as hT,C as Do,d as cx,e as dx,w as gT,t as vT,p as Cc,g as yT,R as Rr,S as W0}from"./grpc-CkqXCGns.js";import{v as bT,r as xT,t as Ec,i as _T,f as kT,M as md,a as hd}from"./markdown-Yr3vTPLR.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))r(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const u of d.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function o(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function r(c){if(c.ep)return;c.ep=!0;const d=o(c);fetch(c.href,d)}})();var zf={exports:{}},Mr={},$f={exports:{}},Uf={};/**
|
|
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 X0;function ST(){return X0||(X0=1,(function(t){function s(E,F){var ae=E.length;E.push(F);e:for(;0<ae;){var me=ae-1>>>1,de=E[me];if(0<c(de,F))E[me]=F,E[ae]=de,ae=me;else break e}}function o(E){return E.length===0?null:E[0]}function r(E){if(E.length===0)return null;var F=E[0],ae=E.pop();if(ae!==F){E[0]=ae;e:for(var me=0,de=E.length,Oe=de>>>1;me<Oe;){var ke=2*(me+1)-1,Ee=E[ke],ze=ke+1,ue=E[ze];if(0>c(Ee,ae))ze<de&&0>c(ue,Ee)?(E[me]=ue,E[ze]=ae,me=ze):(E[me]=Ee,E[ke]=ae,me=ke);else if(ze<de&&0>c(ue,ae))E[me]=ue,E[ze]=ae,me=ze;else break e}}return F}function c(E,F){var ae=E.sortIndex-F.sortIndex;return ae!==0?ae:E.id-F.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;t.unstable_now=function(){return d.now()}}else{var u=Date,p=u.now();t.unstable_now=function(){return u.now()-p}}var m=[],g=[],v=1,b=null,x=3,S=!1,k=!1,w=!1,N=!1,T=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function B(E){for(var F=o(g);F!==null;){if(F.callback===null)r(g);else if(F.startTime<=E)r(g),F.sortIndex=F.expirationTime,s(m,F);else break;F=o(g)}}function A(E){if(w=!1,B(E),!k)if(o(m)!==null)k=!0,M||(M=!0,P());else{var F=o(g);F!==null&&oe(A,F.startTime-E)}}var M=!1,D=-1,z=5,U=-1;function X(){return N?!0:!(t.unstable_now()-U<z)}function Q(){if(N=!1,M){var E=t.unstable_now();U=E;var F=!0;try{e:{k=!1,w&&(w=!1,C(D),D=-1),S=!0;var ae=x;try{t:{for(B(E),b=o(m);b!==null&&!(b.expirationTime>E&&X());){var me=b.callback;if(typeof me=="function"){b.callback=null,x=b.priorityLevel;var de=me(b.expirationTime<=E);if(E=t.unstable_now(),typeof de=="function"){b.callback=de,B(E),F=!0;break t}b===o(m)&&r(m),B(E)}else r(m);b=o(m)}if(b!==null)F=!0;else{var Oe=o(g);Oe!==null&&oe(A,Oe.startTime-E),F=!1}}break e}finally{b=null,x=ae,S=!1}F=void 0}}finally{F?P():M=!1}}}var P;if(typeof R=="function")P=function(){R(Q)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,H=re.port2;re.port1.onmessage=Q,P=function(){H.postMessage(null)}}else P=function(){T(Q,0)};function oe(E,F){D=T(function(){E(t.unstable_now())},F)}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(E){E.callback=null},t.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<E?Math.floor(1e3/E):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(E){switch(x){case 1:case 2:case 3:var F=3;break;default:F=x}var ae=x;x=F;try{return E()}finally{x=ae}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(E,F){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var ae=x;x=E;try{return F()}finally{x=ae}},t.unstable_scheduleCallback=function(E,F,ae){var me=t.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?me+ae:me):ae=me,E){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=ae+de,E={id:v++,callback:F,priorityLevel:E,startTime:ae,expirationTime:de,sortIndex:-1},ae>me?(E.sortIndex=ae,s(g,E),o(m)===null&&E===o(g)&&(w?(C(D),D=-1):w=!0,oe(A,ae-me))):(E.sortIndex=de,s(m,E),k||S||(k=!0,M||(M=!0,P()))),E},t.unstable_shouldYield=X,t.unstable_wrapCallback=function(E){var F=x;return function(){var ae=x;x=F;try{return E.apply(this,arguments)}finally{x=ae}}}})(Uf)),Uf}var Q0;function TT(){return Q0||(Q0=1,$f.exports=ST()),$f.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 wT(){if(ey)return Mr;ey=1;var t=TT(),s=eT(),o=tT();function r(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}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 c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var n=e,a=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(a=n.return),e=n.return;while(e)}return n.tag===3?a:null}function u(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(d(e)!==e)throw Error(r(188))}function g(e){var n=e.alternate;if(!n){if(n=d(e),n===null)throw Error(r(188));return n!==e?null:e}for(var a=e,l=n;;){var f=a.return;if(f===null)break;var h=f.alternate;if(h===null){if(l=f.return,l!==null){a=l;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===a)return m(f),e;if(h===l)return m(f),n;h=h.sibling}throw Error(r(188))}if(a.return!==l.return)a=f,l=h;else{for(var _=!1,j=f.child;j;){if(j===a){_=!0,a=f,l=h;break}if(j===l){_=!0,l=f,a=h;break}j=j.sibling}if(!_){for(j=h.child;j;){if(j===a){_=!0,a=h,l=f;break}if(j===l){_=!0,l=h,a=f;break}j=j.sibling}if(!_)throw Error(r(189))}}if(a.alternate!==l)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?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 b=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),R=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=Q&&e[Q]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function H(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case T:return"Profiler";case N:return"StrictMode";case A:return"Suspense";case M:return"SuspenseList";case U:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case R:return e.displayName||"Context";case C:return(e._context.displayName||"Context")+".Consumer";case B:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return n=e.displayName||null,n!==null?n:H(e.type)||"Memo";case z:n=e._payload,e=e._init;try{return H(e(n))}catch{}}return null}var oe=Array.isArray,E=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},me=[],de=-1;function Oe(e){return{current:e}}function ke(e){0>de||(e.current=me[de],me[de]=null,de--)}function Ee(e,n){de++,me[de]=e.current,e.current=n}var ze=Oe(null),ue=Oe(null),xe=Oe(null),he=Oe(null);function Le(e,n){switch(Ee(xe,n),Ee(ue,e),Ee(ze,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?v0(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=v0(n),e=y0(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ke(ze),Ee(ze,e)}function mt(){ke(ze),ke(ue),ke(xe)}function vn(e){e.memoizedState!==null&&Ee(he,e);var n=ze.current,a=y0(n,e.type);n!==a&&(Ee(ue,e),Ee(ze,a))}function se(e){ue.current===e&&(ke(ze),ke(ue)),he.current===e&&(ke(he),Cr._currentValue=ae)}var qe,Nt;function J(e){if(qe===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);qe=n&&n[1]||"",Nt=-1<a.stack.indexOf(`
|
|
19
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
20
|
-
`+qe+e+Nt}var wt=!1;function Vt(e,n){if(!e||wt)return"";wt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(K){var Z=K}Reflect.construct(e,[],te)}else{try{te.call()}catch(K){Z=K}e.call(te.prototype)}}else{try{throw Error()}catch(K){Z=K}(te=e())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(K){if(K&&Z&&typeof K.stack=="string")return[K.stack,Z.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],j=h[1];if(_&&j){var I=_.split(`
|
|
21
|
-
`),G=j.split(`
|
|
22
|
-
`);for(f=l=0;l<I.length&&!I[l].includes("DetermineComponentFrameRoot");)l++;for(;f<G.length&&!G[f].includes("DetermineComponentFrameRoot");)f++;if(l===I.length||f===G.length)for(l=I.length-1,f=G.length-1;1<=l&&0<=f&&I[l]!==G[f];)f--;for(;1<=l&&0<=f;l--,f--)if(I[l]!==G[f]){if(l!==1||f!==1)do if(l--,f--,0>f||I[l]!==G[f]){var W=`
|
|
23
|
-
`+I[l].replace(" at new "," at ");return e.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",e.displayName)),W}while(1<=l&&0<=f);break}}}finally{wt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?J(a):""}function es(e,n){switch(e.tag){case 26:case 27:case 5:return J(e.type);case 16:return J("Lazy");case 13:return e.child!==n&&n!==null?J("Suspense Fallback"):J("Suspense");case 19:return J("SuspenseList");case 0:case 15:return Vt(e.type,!1);case 11:return Vt(e.type.render,!1);case 1:return Vt(e.type,!0);case 31:return J("Activity");default:return""}}function pt(e){try{var n="",a=null;do n+=es(e,a),a=e,e=e.return;while(e);return n}catch(l){return`
|
|
24
|
-
Error generating stack: `+l.message+`
|
|
25
|
-
`+l.stack}}var hs=Object.prototype.hasOwnProperty,ia=t.unstable_scheduleCallback,ts=t.unstable_cancelCallback,Za=t.unstable_shouldYield,oa=t.unstable_requestPaint,Kt=t.unstable_now,Di=t.unstable_getCurrentPriorityLevel,ra=t.unstable_ImmediatePriority,Ka=t.unstable_UserBlockingPriority,ns=t.unstable_NormalPriority,Ri=t.unstable_LowPriority,Ln=t.unstable_IdlePriority,De=t.log,Ye=t.unstable_setDisableYieldValue,Yt=null,kt=null;function un(e){if(typeof De=="function"&&Ye(e),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(Yt,e)}catch{}}var Jt=Math.clz32?Math.clz32:Oi,Mi=Math.log,Ii=Math.LN2;function Oi(e){return e>>>=0,e===0?32:31-(Mi(e)/Ii|0)|0}var Ya=256,Ja=262144,Wa=4194304;function Cs(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 V(e,n,a){var l=e.pendingLanes;if(l===0)return 0;var f=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var j=l&134217727;return j!==0?(l=j&~h,l!==0?f=Cs(l):(_&=j,_!==0?f=Cs(_):a||(a=j&~e,a!==0&&(f=Cs(a))))):(j=l&~h,j!==0?f=Cs(j):_!==0?f=Cs(_):a||(a=l&~e,a!==0&&(f=Cs(a)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,a=n&-n,h>=a||h===32&&(a&4194048)!==0)?n:f}function ne(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function le(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 fe(){var e=Wa;return Wa<<=1,(Wa&62914560)===0&&(Wa=4194304),e}function ge(e){for(var n=[],a=0;31>a;a++)n.push(e);return n}function Pe(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Se(e,n,a,l,f,h){var _=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var j=e.entanglements,I=e.expirationTimes,G=e.hiddenUpdates;for(a=_&~a;0<a;){var W=31-Jt(a),te=1<<W;j[W]=0,I[W]=-1;var Z=G[W];if(Z!==null)for(G[W]=null,W=0;W<Z.length;W++){var K=Z[W];K!==null&&(K.lane&=-536870913)}a&=~te}l!==0&&Me(e,l,0),h!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~n))}function Me(e,n,a){e.pendingLanes|=n,e.suspendedLanes&=~n;var l=31-Jt(n);e.entangledLanes|=n,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function Je(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var l=31-Jt(a),f=1<<l;f&n|e[l]&n&&(e[l]|=n),a&=~f}}function dt(e,n){var a=n&-n;return a=(a&42)!==0?1:We(a),(a&(e.suspendedLanes|n))!==0?0:a}function We(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 qt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function tn(){var e=F.p;return e!==0?e:(e=window.event,e===void 0?32:P0(e.type))}function Mt(e,n){var a=F.p;try{return F.p=e,n()}finally{F.p=a}}var fn=Math.random().toString(36).slice(2),ht="__reactFiber$"+fn,Wt="__reactProps$"+fn,Bi="__reactContainer$"+fn,Cd="__reactEvents$"+fn,V1="__reactListeners$"+fn,q1="__reactHandles$"+fn,ah="__reactResources$"+fn,Vo="__reactMarker$"+fn;function Ed(e){delete e[ht],delete e[Wt],delete e[Cd],delete e[V1],delete e[q1]}function Li(e){var n=e[ht];if(n)return n;for(var a=e.parentNode;a;){if(n=a[Bi]||a[ht]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=w0(e);e!==null;){if(a=e[ht])return a;e=w0(e)}return n}e=a,a=e.parentNode}return null}function zi(e){if(e=e[ht]||e[Bi]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function qo(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(r(33))}function $i(e){var n=e[ah];return n||(n=e[ah]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Xt(e){e[Vo]=!0}var ih=new Set,oh={};function Xa(e,n){Ui(e,n),Ui(e+"Capture",n)}function Ui(e,n){for(oh[e]=n,e=0;e<n.length;e++)ih.add(n[e])}var G1=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]*$"),rh={},lh={};function F1(e){return hs.call(lh,e)?!0:hs.call(rh,e)?!1:G1.test(e)?lh[e]=!0:(rh[e]=!0,!1)}function gl(e,n,a){if(F1(n))if(a===null)e.removeAttribute(n);else{switch(typeof a){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,""+a)}}function vl(e,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+a)}}function Es(e,n,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(n,a,""+l)}}function zn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ch(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Z1(e,n,a){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(_){a=""+_,h.call(this,_)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(_){a=""+_},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ad(e){if(!e._valueTracker){var n=ch(e)?"checked":"value";e._valueTracker=Z1(e,n,""+e[n])}}function dh(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),l="";return e&&(l=ch(e)?e.checked?"true":"false":e.value),e=l,e!==a?(n.setValue(e),!0):!1}function yl(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 K1=/[\n"\\]/g;function $n(e){return e.replace(K1,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Dd(e,n,a,l,f,h,_,j){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=""+zn(n)):e.value!==""+zn(n)&&(e.value=""+zn(n)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),n!=null?Rd(e,_,zn(n)):a!=null?Rd(e,_,zn(a)):l!=null&&e.removeAttribute("value"),f==null&&h!=null&&(e.defaultChecked=!!h),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+zn(j):e.removeAttribute("name")}function uh(e,n,a,l,f,h,_,j){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||a!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Ad(e);return}a=a!=null?""+zn(a):"",n=n!=null?""+zn(n):a,j||n===e.value||(e.value=n),e.defaultValue=n}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=j?e.checked:!!l,e.defaultChecked=!!l,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Ad(e)}function Rd(e,n,a){n==="number"&&yl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Pi(e,n,a,l){if(e=e.options,n){n={};for(var f=0;f<a.length;f++)n["$"+a[f]]=!0;for(a=0;a<e.length;a++)f=n.hasOwnProperty("$"+e[a].value),e[a].selected!==f&&(e[a].selected=f),f&&l&&(e[a].defaultSelected=!0)}else{for(a=""+zn(a),n=null,f=0;f<e.length;f++){if(e[f].value===a){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function fh(e,n,a){if(n!=null&&(n=""+zn(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+zn(a):""}function ph(e,n,a,l){if(n==null){if(l!=null){if(a!=null)throw Error(r(92));if(oe(l)){if(1<l.length)throw Error(r(93));l=l[0]}a=l}a==null&&(a=""),n=a}a=zn(n),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),Ad(e)}function Hi(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var Y1=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 mh(e,n,a){var l=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":l?e.setProperty(n,a):typeof a!="number"||a===0||Y1.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function hh(e,n,a){if(n!=null&&typeof n!="object")throw Error(r(62));if(e=e.style,a!=null){for(var l in a)!a.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)&&a[f]!==l&&mh(e,f,l)}else for(var h in n)n.hasOwnProperty(h)&&mh(e,h,n[h])}function Md(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 J1=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"]]),W1=/^[\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 bl(e){return W1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function As(){}var Id=null;function Od(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vi=null,qi=null;function gh(e){var n=zi(e);if(n&&(e=n.stateNode)){var a=e[Wt]||null;e:switch(e=n.stateNode,n.type){case"input":if(Dd(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+$n(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var l=a[n];if(l!==e&&l.form===e.form){var f=l[Wt]||null;if(!f)throw Error(r(90));Dd(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<a.length;n++)l=a[n],l.form===e.form&&dh(l)}break e;case"textarea":fh(e,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&Pi(e,!!a.multiple,n,!1)}}}var Bd=!1;function vh(e,n,a){if(Bd)return e(n,a);Bd=!0;try{var l=e(n);return l}finally{if(Bd=!1,(Vi!==null||qi!==null)&&(oc(),Vi&&(n=Vi,e=qi,qi=Vi=null,gh(n),e)))for(n=0;n<e.length;n++)gh(e[n])}}function Go(e,n){var a=e.stateNode;if(a===null)return null;var l=a[Wt]||null;if(l===null)return null;a=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(a&&typeof a!="function")throw Error(r(231,n,typeof a));return a}var Ds=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ld=!1;if(Ds)try{var Fo={};Object.defineProperty(Fo,"passive",{get:function(){Ld=!0}}),window.addEventListener("test",Fo,Fo),window.removeEventListener("test",Fo,Fo)}catch{Ld=!1}var la=null,zd=null,xl=null;function yh(){if(xl)return xl;var e,n=zd,a=n.length,l,f="value"in la?la.value:la.textContent,h=f.length;for(e=0;e<a&&n[e]===f[e];e++);var _=a-e;for(l=1;l<=_&&n[a-l]===f[h-l];l++);return xl=f.slice(e,1<l?1-l:void 0)}function _l(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 kl(){return!0}function bh(){return!1}function yn(e){function n(a,l,f,h,_){this._reactName=a,this._targetInst=f,this.type=l,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(a=e[j],this[j]=a?a(h):h[j]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?kl:bh,this.isPropagationStopped=bh,this}return b(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=kl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=kl)},persist:function(){},isPersistent:kl}),n}var Qa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sl=yn(Qa),Zo=b({},Qa,{view:0,detail:0}),X1=yn(Zo),$d,Ud,Ko,Tl=b({},Zo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hd,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!==Ko&&(Ko&&e.type==="mousemove"?($d=e.screenX-Ko.screenX,Ud=e.screenY-Ko.screenY):Ud=$d=0,Ko=e),$d)},movementY:function(e){return"movementY"in e?e.movementY:Ud}}),xh=yn(Tl),Q1=b({},Tl,{dataTransfer:0}),ek=yn(Q1),tk=b({},Zo,{relatedTarget:0}),Pd=yn(tk),nk=b({},Qa,{animationName:0,elapsedTime:0,pseudoElement:0}),sk=yn(nk),ak=b({},Qa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ik=yn(ak),ok=b({},Qa,{data:0}),_h=yn(ok),rk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lk={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"},ck={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dk(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=ck[e])?!!n[e]:!1}function Hd(){return dk}var uk=b({},Zo,{key:function(e){if(e.key){var n=rk[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=_l(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?lk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hd,charCode:function(e){return e.type==="keypress"?_l(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_l(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fk=yn(uk),pk=b({},Tl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kh=yn(pk),mk=b({},Zo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hd}),hk=yn(mk),gk=b({},Qa,{propertyName:0,elapsedTime:0,pseudoElement:0}),vk=yn(gk),yk=b({},Tl,{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}),bk=yn(yk),xk=b({},Qa,{newState:0,oldState:0}),_k=yn(xk),kk=[9,13,27,32],Vd=Ds&&"CompositionEvent"in window,Yo=null;Ds&&"documentMode"in document&&(Yo=document.documentMode);var Sk=Ds&&"TextEvent"in window&&!Yo,Sh=Ds&&(!Vd||Yo&&8<Yo&&11>=Yo),Th=" ",wh=!1;function jh(e,n){switch(e){case"keyup":return kk.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gi=!1;function Tk(e,n){switch(e){case"compositionend":return Nh(n);case"keypress":return n.which!==32?null:(wh=!0,Th);case"textInput":return e=n.data,e===Th&&wh?null:e;default:return null}}function wk(e,n){if(Gi)return e==="compositionend"||!Vd&&jh(e,n)?(e=yh(),xl=zd=la=null,Gi=!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 Sh&&n.locale!=="ko"?null:n.data;default:return null}}var jk={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 Ch(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!jk[e.type]:n==="textarea"}function Eh(e,n,a,l){Vi?qi?qi.push(l):qi=[l]:Vi=l,n=pc(n,"onChange"),0<n.length&&(a=new Sl("onChange","change",null,a,l),e.push({event:a,listeners:n}))}var Jo=null,Wo=null;function Nk(e){u0(e,0)}function wl(e){var n=qo(e);if(dh(n))return e}function Ah(e,n){if(e==="change")return n}var Dh=!1;if(Ds){var qd;if(Ds){var Gd="oninput"in document;if(!Gd){var Rh=document.createElement("div");Rh.setAttribute("oninput","return;"),Gd=typeof Rh.oninput=="function"}qd=Gd}else qd=!1;Dh=qd&&(!document.documentMode||9<document.documentMode)}function Mh(){Jo&&(Jo.detachEvent("onpropertychange",Ih),Wo=Jo=null)}function Ih(e){if(e.propertyName==="value"&&wl(Wo)){var n=[];Eh(n,Wo,e,Od(e)),vh(Nk,n)}}function Ck(e,n,a){e==="focusin"?(Mh(),Jo=n,Wo=a,Jo.attachEvent("onpropertychange",Ih)):e==="focusout"&&Mh()}function Ek(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return wl(Wo)}function Ak(e,n){if(e==="click")return wl(n)}function Dk(e,n){if(e==="input"||e==="change")return wl(n)}function Rk(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var wn=typeof Object.is=="function"?Object.is:Rk;function Xo(e,n){if(wn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var a=Object.keys(e),l=Object.keys(n);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var f=a[l];if(!hs.call(n,f)||!wn(e[f],n[f]))return!1}return!0}function Oh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bh(e,n){var a=Oh(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=n&&l>=n)return{node:a,offset:n-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Oh(a)}}function Lh(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Lh(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function zh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=yl(e.document);n instanceof e.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)e=n.contentWindow;else break;n=yl(e.document)}return n}function Fd(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 Mk=Ds&&"documentMode"in document&&11>=document.documentMode,Fi=null,Zd=null,Qo=null,Kd=!1;function $h(e,n,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Kd||Fi==null||Fi!==yl(l)||(l=Fi,"selectionStart"in l&&Fd(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}),Qo&&Xo(Qo,l)||(Qo=l,l=pc(Zd,"onSelect"),0<l.length&&(n=new Sl("onSelect","select",null,n,a),e.push({event:n,listeners:l}),n.target=Fi)))}function ei(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var Zi={animationend:ei("Animation","AnimationEnd"),animationiteration:ei("Animation","AnimationIteration"),animationstart:ei("Animation","AnimationStart"),transitionrun:ei("Transition","TransitionRun"),transitionstart:ei("Transition","TransitionStart"),transitioncancel:ei("Transition","TransitionCancel"),transitionend:ei("Transition","TransitionEnd")},Yd={},Uh={};Ds&&(Uh=document.createElement("div").style,"AnimationEvent"in window||(delete Zi.animationend.animation,delete Zi.animationiteration.animation,delete Zi.animationstart.animation),"TransitionEvent"in window||delete Zi.transitionend.transition);function ti(e){if(Yd[e])return Yd[e];if(!Zi[e])return e;var n=Zi[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in Uh)return Yd[e]=n[a];return e}var Ph=ti("animationend"),Hh=ti("animationiteration"),Vh=ti("animationstart"),Ik=ti("transitionrun"),Ok=ti("transitionstart"),Bk=ti("transitioncancel"),qh=ti("transitionend"),Gh=new Map,Jd="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(" ");Jd.push("scrollEnd");function ss(e,n){Gh.set(e,n),Xa(n,[e])}var jl=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)},Un=[],Ki=0,Wd=0;function Nl(){for(var e=Ki,n=Wd=Ki=0;n<e;){var a=Un[n];Un[n++]=null;var l=Un[n];Un[n++]=null;var f=Un[n];Un[n++]=null;var h=Un[n];if(Un[n++]=null,l!==null&&f!==null){var _=l.pending;_===null?f.next=f:(f.next=_.next,_.next=f),l.pending=f}h!==0&&Fh(a,f,h)}}function Cl(e,n,a,l){Un[Ki++]=e,Un[Ki++]=n,Un[Ki++]=a,Un[Ki++]=l,Wd|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Xd(e,n,a,l){return Cl(e,n,a,l),El(e)}function ni(e,n){return Cl(e,null,null,n),El(e)}function Fh(e,n,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var f=!1,h=e.return;h!==null;)h.childLanes|=a,l=h.alternate,l!==null&&(l.childLanes|=a),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-Jt(a),e=h.hiddenUpdates,l=e[f],l===null?e[f]=[n]:l.push(n),n.lane=a|536870912),h):null}function El(e){if(50<_r)throw _r=0,lf=null,Error(r(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Yi={};function Lk(e,n,a,l){this.tag=e,this.key=a,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 jn(e,n,a,l){return new Lk(e,n,a,l)}function Qd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Rs(e,n){var a=e.alternate;return a===null?(a=jn(e.tag,n,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=n,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,n=e.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Zh(e,n){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,n=a.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Al(e,n,a,l,f,h){var _=0;if(l=e,typeof e=="function")Qd(e)&&(_=1);else if(typeof e=="string")_=HS(e,a,ze.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case U:return e=jn(31,a,n,f),e.elementType=U,e.lanes=h,e;case w:return si(a.children,f,h,n);case N:_=8,f|=24;break;case T:return e=jn(12,a,n,f|2),e.elementType=T,e.lanes=h,e;case A:return e=jn(13,a,n,f),e.elementType=A,e.lanes=h,e;case M:return e=jn(19,a,n,f),e.elementType=M,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case R:_=10;break e;case C:_=9;break e;case B:_=11;break e;case D:_=14;break e;case z:_=16,l=null;break e}_=29,a=Error(r(130,e===null?"null":typeof e,"")),l=null}return n=jn(_,a,n,f),n.elementType=e,n.type=l,n.lanes=h,n}function si(e,n,a,l){return e=jn(7,e,l,n),e.lanes=a,e}function eu(e,n,a){return e=jn(6,e,null,n),e.lanes=a,e}function Kh(e){var n=jn(18,null,null,0);return n.stateNode=e,n}function tu(e,n,a){return n=jn(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Yh=new WeakMap;function Pn(e,n){if(typeof e=="object"&&e!==null){var a=Yh.get(e);return a!==void 0?a:(n={value:e,source:n,stack:pt(n)},Yh.set(e,n),n)}return{value:e,source:n,stack:pt(n)}}var Ji=[],Wi=0,Dl=null,er=0,Hn=[],Vn=0,ca=null,gs=1,vs="";function Ms(e,n){Ji[Wi++]=er,Ji[Wi++]=Dl,Dl=e,er=n}function Jh(e,n,a){Hn[Vn++]=gs,Hn[Vn++]=vs,Hn[Vn++]=ca,ca=e;var l=gs;e=vs;var f=32-Jt(l)-1;l&=~(1<<f),a+=1;var h=32-Jt(n)+f;if(30<h){var _=f-f%5;h=(l&(1<<_)-1).toString(32),l>>=_,f-=_,gs=1<<32-Jt(n)+f|a<<f|l,vs=h+e}else gs=1<<h|a<<f|l,vs=e}function nu(e){e.return!==null&&(Ms(e,1),Jh(e,1,0))}function su(e){for(;e===Dl;)Dl=Ji[--Wi],Ji[Wi]=null,er=Ji[--Wi],Ji[Wi]=null;for(;e===ca;)ca=Hn[--Vn],Hn[Vn]=null,vs=Hn[--Vn],Hn[Vn]=null,gs=Hn[--Vn],Hn[Vn]=null}function Wh(e,n){Hn[Vn++]=gs,Hn[Vn++]=vs,Hn[Vn++]=ca,gs=n.id,vs=n.overflow,ca=e}var nn=null,gt=null,Ge=!1,da=null,qn=!1,au=Error(r(519));function ua(e){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw tr(Pn(n,e)),au}function Xh(e){var n=e.stateNode,a=e.type,l=e.memoizedProps;switch(n[ht]=e,n[Wt]=l,a){case"dialog":Ue("cancel",n),Ue("close",n);break;case"iframe":case"object":case"embed":Ue("load",n);break;case"video":case"audio":for(a=0;a<Sr.length;a++)Ue(Sr[a],n);break;case"source":Ue("error",n);break;case"img":case"image":case"link":Ue("error",n),Ue("load",n);break;case"details":Ue("toggle",n);break;case"input":Ue("invalid",n),uh(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ue("invalid",n);break;case"textarea":Ue("invalid",n),ph(n,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||l.suppressHydrationWarning===!0||h0(n.textContent,a)?(l.popover!=null&&(Ue("beforetoggle",n),Ue("toggle",n)),l.onScroll!=null&&Ue("scroll",n),l.onScrollEnd!=null&&Ue("scrollend",n),l.onClick!=null&&(n.onclick=As),n=!0):n=!1,n||ua(e,!0)}function Qh(e){for(nn=e.return;nn;)switch(nn.tag){case 5:case 31:case 13:qn=!1;return;case 27:case 3:qn=!0;return;default:nn=nn.return}}function Xi(e){if(e!==nn)return!1;if(!Ge)return Qh(e),Ge=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Sf(e.type,e.memoizedProps)),a=!a),a&>&&ua(e),Qh(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));gt=T0(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));gt=T0(e)}else n===27?(n=gt,wa(e.type)?(e=Cf,Cf=null,gt=e):gt=n):gt=nn?Fn(e.stateNode.nextSibling):null;return!0}function ai(){gt=nn=null,Ge=!1}function iu(){var e=da;return e!==null&&(kn===null?kn=e:kn.push.apply(kn,e),da=null),e}function tr(e){da===null?da=[e]:da.push(e)}var ou=Oe(null),ii=null,Is=null;function fa(e,n,a){Ee(ou,n._currentValue),n._currentValue=a}function Os(e){e._currentValue=ou.current,ke(ou)}function ru(e,n,a){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===a)break;e=e.return}}function lu(e,n,a,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 j=h;h=f;for(var I=0;I<n.length;I++)if(j.context===n[I]){h.lanes|=a,j=h.alternate,j!==null&&(j.lanes|=a),ru(h.return,a,e),l||(_=null);break e}h=j.next}}else if(f.tag===18){if(_=f.return,_===null)throw Error(r(341));_.lanes|=a,h=_.alternate,h!==null&&(h.lanes|=a),ru(_,a,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 Qi(e,n,a,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(r(387));if(_=_.memoizedProps,_!==null){var j=f.type;wn(f.pendingProps.value,_.value)||(e!==null?e.push(j):e=[j])}}else if(f===he.current){if(_=f.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Cr):e=[Cr])}f=f.return}e!==null&&lu(n,e,a,l),n.flags|=262144}function Rl(e){for(e=e.firstContext;e!==null;){if(!wn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function oi(e){ii=e,Is=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function sn(e){return eg(ii,e)}function Ml(e,n){return ii===null&&oi(e),eg(e,n)}function eg(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},Is===null){if(e===null)throw Error(r(308));Is=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Is=Is.next=n;return a}var zk=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){n.aborted=!0,e.forEach(function(a){return a()})}},$k=t.unstable_scheduleCallback,Uk=t.unstable_NormalPriority,$t={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cu(){return{controller:new zk,data:new Map,refCount:0}}function nr(e){e.refCount--,e.refCount===0&&$k(Uk,function(){e.controller.abort()})}var sr=null,du=0,eo=0,to=null;function Pk(e,n){if(sr===null){var a=sr=[];du=0,eo=mf(),to={status:"pending",value:void 0,then:function(l){a.push(l)}}}return du++,n.then(tg,tg),n}function tg(){if(--du===0&&sr!==null){to!==null&&(to.status="fulfilled");var e=sr;sr=null,eo=0,to=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Hk(e,n){var a=[],l={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return e.then(function(){l.status="fulfilled",l.value=n;for(var f=0;f<a.length;f++)(0,a[f])(n)},function(f){for(l.status="rejected",l.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),l}var ng=E.S;E.S=function(e,n){$v=Kt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Pk(e,n),ng!==null&&ng(e,n)};var ri=Oe(null);function uu(){var e=ri.current;return e!==null?e:ut.pooledCache}function Il(e,n){n===null?Ee(ri,ri.current):Ee(ri,n.pool)}function sg(){var e=uu();return e===null?null:{parent:$t._currentValue,pool:e}}var no=Error(r(460)),fu=Error(r(474)),Ol=Error(r(542)),Bl={then:function(){}};function ag(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ig(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(As,As),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,rg(e),e;default:if(typeof n.status=="string")n.then(As,As);else{if(e=ut,e!==null&&100<e.shellSuspendCounter)throw Error(r(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,rg(e),e}throw ci=n,no}}function li(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ci=a,no):a}}var ci=null;function og(){if(ci===null)throw Error(r(459));var e=ci;return ci=null,e}function rg(e){if(e===no||e===Ol)throw Error(r(483))}var so=null,ar=0;function Ll(e){var n=ar;return ar+=1,so===null&&(so=[]),ig(so,e,n)}function ir(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function zl(e,n){throw n.$$typeof===x?Error(r(525)):(e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function lg(e){function n($,L){if(e){var q=$.deletions;q===null?($.deletions=[L],$.flags|=16):q.push(L)}}function a($,L){if(!e)return null;for(;L!==null;)n($,L),L=L.sibling;return null}function l($){for(var L=new Map;$!==null;)$.key!==null?L.set($.key,$):L.set($.index,$),$=$.sibling;return L}function f($,L){return $=Rs($,L),$.index=0,$.sibling=null,$}function h($,L,q){return $.index=q,e?(q=$.alternate,q!==null?(q=q.index,q<L?($.flags|=67108866,L):q):($.flags|=67108866,L)):($.flags|=1048576,L)}function _($){return e&&$.alternate===null&&($.flags|=67108866),$}function j($,L,q,ee){return L===null||L.tag!==6?(L=eu(q,$.mode,ee),L.return=$,L):(L=f(L,q),L.return=$,L)}function I($,L,q,ee){var Te=q.type;return Te===w?W($,L,q.props.children,ee,q.key):L!==null&&(L.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===z&&li(Te)===L.type)?(L=f(L,q.props),ir(L,q),L.return=$,L):(L=Al(q.type,q.key,q.props,null,$.mode,ee),ir(L,q),L.return=$,L)}function G($,L,q,ee){return L===null||L.tag!==4||L.stateNode.containerInfo!==q.containerInfo||L.stateNode.implementation!==q.implementation?(L=tu(q,$.mode,ee),L.return=$,L):(L=f(L,q.children||[]),L.return=$,L)}function W($,L,q,ee,Te){return L===null||L.tag!==7?(L=si(q,$.mode,ee,Te),L.return=$,L):(L=f(L,q),L.return=$,L)}function te($,L,q){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=eu(""+L,$.mode,q),L.return=$,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case S:return q=Al(L.type,L.key,L.props,null,$.mode,q),ir(q,L),q.return=$,q;case k:return L=tu(L,$.mode,q),L.return=$,L;case z:return L=li(L),te($,L,q)}if(oe(L)||P(L))return L=si(L,$.mode,q,null),L.return=$,L;if(typeof L.then=="function")return te($,Ll(L),q);if(L.$$typeof===R)return te($,Ml($,L),q);zl($,L)}return null}function Z($,L,q,ee){var Te=L!==null?L.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return Te!==null?null:j($,L,""+q,ee);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case S:return q.key===Te?I($,L,q,ee):null;case k:return q.key===Te?G($,L,q,ee):null;case z:return q=li(q),Z($,L,q,ee)}if(oe(q)||P(q))return Te!==null?null:W($,L,q,ee,null);if(typeof q.then=="function")return Z($,L,Ll(q),ee);if(q.$$typeof===R)return Z($,L,Ml($,q),ee);zl($,q)}return null}function K($,L,q,ee,Te){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return $=$.get(q)||null,j(L,$,""+ee,Te);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case S:return $=$.get(ee.key===null?q:ee.key)||null,I(L,$,ee,Te);case k:return $=$.get(ee.key===null?q:ee.key)||null,G(L,$,ee,Te);case z:return ee=li(ee),K($,L,q,ee,Te)}if(oe(ee)||P(ee))return $=$.get(q)||null,W(L,$,ee,Te,null);if(typeof ee.then=="function")return K($,L,q,Ll(ee),Te);if(ee.$$typeof===R)return K($,L,q,Ml(L,ee),Te);zl(L,ee)}return null}function ye($,L,q,ee){for(var Te=null,Xe=null,be=L,Be=L=0,Ve=null;be!==null&&Be<q.length;Be++){be.index>Be?(Ve=be,be=null):Ve=be.sibling;var Qe=Z($,be,q[Be],ee);if(Qe===null){be===null&&(be=Ve);break}e&&be&&Qe.alternate===null&&n($,be),L=h(Qe,L,Be),Xe===null?Te=Qe:Xe.sibling=Qe,Xe=Qe,be=Ve}if(Be===q.length)return a($,be),Ge&&Ms($,Be),Te;if(be===null){for(;Be<q.length;Be++)be=te($,q[Be],ee),be!==null&&(L=h(be,L,Be),Xe===null?Te=be:Xe.sibling=be,Xe=be);return Ge&&Ms($,Be),Te}for(be=l(be);Be<q.length;Be++)Ve=K(be,$,Be,q[Be],ee),Ve!==null&&(e&&Ve.alternate!==null&&be.delete(Ve.key===null?Be:Ve.key),L=h(Ve,L,Be),Xe===null?Te=Ve:Xe.sibling=Ve,Xe=Ve);return e&&be.forEach(function(Aa){return n($,Aa)}),Ge&&Ms($,Be),Te}function Ne($,L,q,ee){if(q==null)throw Error(r(151));for(var Te=null,Xe=null,be=L,Be=L=0,Ve=null,Qe=q.next();be!==null&&!Qe.done;Be++,Qe=q.next()){be.index>Be?(Ve=be,be=null):Ve=be.sibling;var Aa=Z($,be,Qe.value,ee);if(Aa===null){be===null&&(be=Ve);break}e&&be&&Aa.alternate===null&&n($,be),L=h(Aa,L,Be),Xe===null?Te=Aa:Xe.sibling=Aa,Xe=Aa,be=Ve}if(Qe.done)return a($,be),Ge&&Ms($,Be),Te;if(be===null){for(;!Qe.done;Be++,Qe=q.next())Qe=te($,Qe.value,ee),Qe!==null&&(L=h(Qe,L,Be),Xe===null?Te=Qe:Xe.sibling=Qe,Xe=Qe);return Ge&&Ms($,Be),Te}for(be=l(be);!Qe.done;Be++,Qe=q.next())Qe=K(be,$,Be,Qe.value,ee),Qe!==null&&(e&&Qe.alternate!==null&&be.delete(Qe.key===null?Be:Qe.key),L=h(Qe,L,Be),Xe===null?Te=Qe:Xe.sibling=Qe,Xe=Qe);return e&&be.forEach(function(QS){return n($,QS)}),Ge&&Ms($,Be),Te}function ct($,L,q,ee){if(typeof q=="object"&&q!==null&&q.type===w&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case S:e:{for(var Te=q.key;L!==null;){if(L.key===Te){if(Te=q.type,Te===w){if(L.tag===7){a($,L.sibling),ee=f(L,q.props.children),ee.return=$,$=ee;break e}}else if(L.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===z&&li(Te)===L.type){a($,L.sibling),ee=f(L,q.props),ir(ee,q),ee.return=$,$=ee;break e}a($,L);break}else n($,L);L=L.sibling}q.type===w?(ee=si(q.props.children,$.mode,ee,q.key),ee.return=$,$=ee):(ee=Al(q.type,q.key,q.props,null,$.mode,ee),ir(ee,q),ee.return=$,$=ee)}return _($);case k:e:{for(Te=q.key;L!==null;){if(L.key===Te)if(L.tag===4&&L.stateNode.containerInfo===q.containerInfo&&L.stateNode.implementation===q.implementation){a($,L.sibling),ee=f(L,q.children||[]),ee.return=$,$=ee;break e}else{a($,L);break}else n($,L);L=L.sibling}ee=tu(q,$.mode,ee),ee.return=$,$=ee}return _($);case z:return q=li(q),ct($,L,q,ee)}if(oe(q))return ye($,L,q,ee);if(P(q)){if(Te=P(q),typeof Te!="function")throw Error(r(150));return q=Te.call(q),Ne($,L,q,ee)}if(typeof q.then=="function")return ct($,L,Ll(q),ee);if(q.$$typeof===R)return ct($,L,Ml($,q),ee);zl($,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,L!==null&&L.tag===6?(a($,L.sibling),ee=f(L,q),ee.return=$,$=ee):(a($,L),ee=eu(q,$.mode,ee),ee.return=$,$=ee),_($)):a($,L)}return function($,L,q,ee){try{ar=0;var Te=ct($,L,q,ee);return so=null,Te}catch(be){if(be===no||be===Ol)throw be;var Xe=jn(29,be,null,$.mode);return Xe.lanes=ee,Xe.return=$,Xe}finally{}}}var di=lg(!0),cg=lg(!1),pa=!1;function pu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mu(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 ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ha(e,n,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(nt&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,n=El(e),Fh(e,null,a),n}return Cl(e,l,n,a),El(e)}function or(e,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,a|=l,n.lanes=a,Je(e,a)}}function hu(e,n){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var f=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var _={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?f=h=_:h=h.next=_,a=a.next}while(a!==null);h===null?f=h=n:h=h.next=n}else f=h=n;a={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=n:e.next=n,a.lastBaseUpdate=n}var gu=!1;function rr(){if(gu){var e=to;if(e!==null)throw e}}function lr(e,n,a,l){gu=!1;var f=e.updateQueue;pa=!1;var h=f.firstBaseUpdate,_=f.lastBaseUpdate,j=f.shared.pending;if(j!==null){f.shared.pending=null;var I=j,G=I.next;I.next=null,_===null?h=G:_.next=G,_=I;var W=e.alternate;W!==null&&(W=W.updateQueue,j=W.lastBaseUpdate,j!==_&&(j===null?W.firstBaseUpdate=G:j.next=G,W.lastBaseUpdate=I))}if(h!==null){var te=f.baseState;_=0,W=G=I=null,j=h;do{var Z=j.lane&-536870913,K=Z!==j.lane;if(K?(He&Z)===Z:(l&Z)===Z){Z!==0&&Z===eo&&(gu=!0),W!==null&&(W=W.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var ye=e,Ne=j;Z=n;var ct=a;switch(Ne.tag){case 1:if(ye=Ne.payload,typeof ye=="function"){te=ye.call(ct,te,Z);break e}te=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ne.payload,Z=typeof ye=="function"?ye.call(ct,te,Z):ye,Z==null)break e;te=b({},te,Z);break e;case 2:pa=!0}}Z=j.callback,Z!==null&&(e.flags|=64,K&&(e.flags|=8192),K=f.callbacks,K===null?f.callbacks=[Z]:K.push(Z))}else K={lane:Z,tag:j.tag,payload:j.payload,callback:j.callback,next:null},W===null?(G=W=K,I=te):W=W.next=K,_|=Z;if(j=j.next,j===null){if(j=f.shared.pending,j===null)break;K=j,j=K.next,K.next=null,f.lastBaseUpdate=K,f.shared.pending=null}}while(!0);W===null&&(I=te),f.baseState=I,f.firstBaseUpdate=G,f.lastBaseUpdate=W,h===null&&(f.shared.lanes=0),xa|=_,e.lanes=_,e.memoizedState=te}}function dg(e,n){if(typeof e!="function")throw Error(r(191,e));e.call(n)}function ug(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)dg(a[e],n)}var ao=Oe(null),$l=Oe(0);function fg(e,n){e=qs,Ee($l,e),Ee(ao,n),qs=e|n.baseLanes}function vu(){Ee($l,qs),Ee(ao,ao.current)}function yu(){qs=$l.current,ke(ao),ke($l)}var Nn=Oe(null),Gn=null;function ga(e){var n=e.alternate;Ee(It,It.current&1),Ee(Nn,e),Gn===null&&(n===null||ao.current!==null||n.memoizedState!==null)&&(Gn=e)}function bu(e){Ee(It,It.current),Ee(Nn,e),Gn===null&&(Gn=e)}function pg(e){e.tag===22?(Ee(It,It.current),Ee(Nn,e),Gn===null&&(Gn=e)):va()}function va(){Ee(It,It.current),Ee(Nn,Nn.current)}function Cn(e){ke(Nn),Gn===e&&(Gn=null),ke(It)}var It=Oe(0);function Ul(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||jf(a)||Nf(a)))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 Bs=0,Ie=null,rt=null,Ut=null,Pl=!1,io=!1,ui=!1,Hl=0,cr=0,oo=null,Vk=0;function Ct(){throw Error(r(321))}function xu(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!wn(e[a],n[a]))return!1;return!0}function _u(e,n,a,l,f,h){return Bs=h,Ie=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,E.H=e===null||e.memoizedState===null?Jg:Bu,ui=!1,h=a(l,f),ui=!1,io&&(h=hg(n,a,l,f)),mg(e),h}function mg(e){E.H=fr;var n=rt!==null&&rt.next!==null;if(Bs=0,Ut=rt=Ie=null,Pl=!1,cr=0,oo=null,n)throw Error(r(300));e===null||Pt||(e=e.dependencies,e!==null&&Rl(e)&&(Pt=!0))}function hg(e,n,a,l){Ie=e;var f=0;do{if(io&&(oo=null),cr=0,io=!1,25<=f)throw Error(r(301));if(f+=1,Ut=rt=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}E.H=Wg,h=n(a,l)}while(io);return h}function qk(){var e=E.H,n=e.useState()[0];return n=typeof n.then=="function"?dr(n):n,e=e.useState()[0],(rt!==null?rt.memoizedState:null)!==e&&(Ie.flags|=1024),n}function ku(){var e=Hl!==0;return Hl=0,e}function Su(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function Tu(e){if(Pl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Pl=!1}Bs=0,Ut=rt=Ie=null,io=!1,cr=Hl=0,oo=null}function pn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Ie.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function Ot(){if(rt===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=rt.next;var n=Ut===null?Ie.memoizedState:Ut.next;if(n!==null)Ut=n,rt=e;else{if(e===null)throw Ie.alternate===null?Error(r(467)):Error(r(310));rt=e,e={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},Ut===null?Ie.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function Vl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function dr(e){var n=cr;return cr+=1,oo===null&&(oo=[]),e=ig(oo,e,n),n=Ie,(Ut===null?n.memoizedState:Ut.next)===null&&(n=n.alternate,E.H=n===null||n.memoizedState===null?Jg:Bu),e}function ql(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return dr(e);if(e.$$typeof===R)return sn(e)}throw Error(r(438,String(e)))}function wu(e){var n=null,a=Ie.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var l=Ie.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}),a===null&&(a=Vl(),Ie.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(e),l=0;l<e;l++)a[l]=X;return n.index++,a}function Ls(e,n){return typeof n=="function"?n(e):n}function Gl(e){var n=Ot();return ju(n,rt,e)}function ju(e,n,a){var l=e.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=a;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 j=_=null,I=null,G=n,W=!1;do{var te=G.lane&-536870913;if(te!==G.lane?(He&te)===te:(Bs&te)===te){var Z=G.revertLane;if(Z===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),te===eo&&(W=!0);else if((Bs&Z)===Z){G=G.next,Z===eo&&(W=!0);continue}else te={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},I===null?(j=I=te,_=h):I=I.next=te,Ie.lanes|=Z,xa|=Z;te=G.action,ui&&a(h,te),h=G.hasEagerState?G.eagerState:a(h,te)}else Z={lane:te,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},I===null?(j=I=Z,_=h):I=I.next=Z,Ie.lanes|=te,xa|=te;G=G.next}while(G!==null&&G!==n);if(I===null?_=h:I.next=j,!wn(h,e.memoizedState)&&(Pt=!0,W&&(a=to,a!==null)))throw a;e.memoizedState=h,e.baseState=_,e.baseQueue=I,l.lastRenderedState=h}return f===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Nu(e){var n=Ot(),a=n.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=e;var l=a.dispatch,f=a.pending,h=n.memoizedState;if(f!==null){a.pending=null;var _=f=f.next;do h=e(h,_.action),_=_.next;while(_!==f);wn(h,n.memoizedState)||(Pt=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),a.lastRenderedState=h}return[h,l]}function gg(e,n,a){var l=Ie,f=Ot(),h=Ge;if(h){if(a===void 0)throw Error(r(407));a=a()}else a=n();var _=!wn((rt||f).memoizedState,a);if(_&&(f.memoizedState=a,Pt=!0),f=f.queue,Au(bg.bind(null,l,f,e),[e]),f.getSnapshot!==n||_||Ut!==null&&Ut.memoizedState.tag&1){if(l.flags|=2048,ro(9,{destroy:void 0},yg.bind(null,l,f,a,n),null),ut===null)throw Error(r(349));h||(Bs&127)!==0||vg(l,n,a)}return a}function vg(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=Ie.updateQueue,n===null?(n=Vl(),Ie.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function yg(e,n,a,l){n.value=a,n.getSnapshot=l,xg(n)&&_g(e)}function bg(e,n,a){return a(function(){xg(n)&&_g(e)})}function xg(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!wn(e,a)}catch{return!0}}function _g(e){var n=ni(e,2);n!==null&&Sn(n,e,2)}function Cu(e){var n=pn();if(typeof e=="function"){var a=e;if(e=a(),ui){un(!0);try{a()}finally{un(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ls,lastRenderedState:e},n}function kg(e,n,a,l){return e.baseState=a,ju(e,rt,typeof l=="function"?l:Ls)}function Gk(e,n,a,l,f){if(Kl(e))throw Error(r(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(_)}};E.T!==null?a(!0):h.isTransition=!1,l(h),a=n.pending,a===null?(h.next=n.pending=h,Sg(n,h)):(h.next=a.next,n.pending=a.next=h)}}function Sg(e,n){var a=n.action,l=n.payload,f=e.state;if(n.isTransition){var h=E.T,_={};E.T=_;try{var j=a(f,l),I=E.S;I!==null&&I(_,j),Tg(e,n,j)}catch(G){Eu(e,n,G)}finally{h!==null&&_.types!==null&&(h.types=_.types),E.T=h}}else try{h=a(f,l),Tg(e,n,h)}catch(G){Eu(e,n,G)}}function Tg(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){wg(e,n,l)},function(l){return Eu(e,n,l)}):wg(e,n,a)}function wg(e,n,a){n.status="fulfilled",n.value=a,jg(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,Sg(e,a)))}function Eu(e,n,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=a,jg(n),n=n.next;while(n!==l)}e.action=null}function jg(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Ng(e,n){return n}function Cg(e,n){if(Ge){var a=ut.formState;if(a!==null){e:{var l=Ie;if(Ge){if(gt){t:{for(var f=gt,h=qn;f.nodeType!==8;){if(!h){f=null;break t}if(f=Fn(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){gt=Fn(f.nextSibling),l=f.data==="F!";break e}}ua(l)}l=!1}l&&(n=a[0])}}return a=pn(),a.memoizedState=a.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ng,lastRenderedState:n},a.queue=l,a=Zg.bind(null,Ie,l),l.dispatch=a,l=Cu(!1),h=Ou.bind(null,Ie,!1,l.queue),l=pn(),f={state:n,dispatch:null,action:e,pending:null},l.queue=f,a=Gk.bind(null,Ie,f,h,a),f.dispatch=a,l.memoizedState=e,[n,a,!1]}function Eg(e){var n=Ot();return Ag(n,rt,e)}function Ag(e,n,a){if(n=ju(e,n,Ng)[0],e=Gl(Ls)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=dr(n)}catch(_){throw _===no?Ol:_}else l=n;n=Ot();var f=n.queue,h=f.dispatch;return a!==n.memoizedState&&(Ie.flags|=2048,ro(9,{destroy:void 0},Fk.bind(null,f,a),null)),[l,h,e]}function Fk(e,n){e.action=n}function Dg(e){var n=Ot(),a=rt;if(a!==null)return Ag(n,a,e);Ot(),n=n.memoizedState,a=Ot();var l=a.queue.dispatch;return a.memoizedState=e,[n,l,!1]}function ro(e,n,a,l){return e={tag:e,create:a,deps:l,inst:n,next:null},n=Ie.updateQueue,n===null&&(n=Vl(),Ie.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,n.lastEffect=e),e}function Rg(){return Ot().memoizedState}function Fl(e,n,a,l){var f=pn();Ie.flags|=e,f.memoizedState=ro(1|n,{destroy:void 0},a,l===void 0?null:l)}function Zl(e,n,a,l){var f=Ot();l=l===void 0?null:l;var h=f.memoizedState.inst;rt!==null&&l!==null&&xu(l,rt.memoizedState.deps)?f.memoizedState=ro(n,h,a,l):(Ie.flags|=e,f.memoizedState=ro(1|n,h,a,l))}function Mg(e,n){Fl(8390656,8,e,n)}function Au(e,n){Zl(2048,8,e,n)}function Zk(e){Ie.flags|=4;var n=Ie.updateQueue;if(n===null)n=Vl(),Ie.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function Ig(e){var n=Ot().memoizedState;return Zk({ref:n,nextImpl:e}),function(){if((nt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function Og(e,n){return Zl(4,2,e,n)}function Bg(e,n){return Zl(4,4,e,n)}function Lg(e,n){if(typeof n=="function"){e=e();var a=n(e);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function zg(e,n,a){a=a!=null?a.concat([e]):null,Zl(4,4,Lg.bind(null,n,e),a)}function Du(){}function $g(e,n){var a=Ot();n=n===void 0?null:n;var l=a.memoizedState;return n!==null&&xu(n,l[1])?l[0]:(a.memoizedState=[e,n],e)}function Ug(e,n){var a=Ot();n=n===void 0?null:n;var l=a.memoizedState;if(n!==null&&xu(n,l[1]))return l[0];if(l=e(),ui){un(!0);try{e()}finally{un(!1)}}return a.memoizedState=[l,n],l}function Ru(e,n,a){return a===void 0||(Bs&1073741824)!==0&&(He&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=Pv(),Ie.lanes|=e,xa|=e,a)}function Pg(e,n,a,l){return wn(a,n)?a:ao.current!==null?(e=Ru(e,a,l),wn(e,n)||(Pt=!0),e):(Bs&42)===0||(Bs&1073741824)!==0&&(He&261930)===0?(Pt=!0,e.memoizedState=a):(e=Pv(),Ie.lanes|=e,xa|=e,n)}function Hg(e,n,a,l,f){var h=F.p;F.p=h!==0&&8>h?h:8;var _=E.T,j={};E.T=j,Ou(e,!1,n,a);try{var I=f(),G=E.S;if(G!==null&&G(j,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var W=Hk(I,l);ur(e,n,W,Dn(e))}else ur(e,n,l,Dn(e))}catch(te){ur(e,n,{then:function(){},status:"rejected",reason:te},Dn())}finally{F.p=h,_!==null&&j.types!==null&&(_.types=j.types),E.T=_}}function Kk(){}function Mu(e,n,a,l){if(e.tag!==5)throw Error(r(476));var f=Vg(e).queue;Hg(e,f,n,ae,a===null?Kk:function(){return qg(e),a(l)})}function Vg(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ls,lastRenderedState:ae},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ls,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function qg(e){var n=Vg(e);n.next===null&&(n=e.alternate.memoizedState),ur(e,n.next.queue,{},Dn())}function Iu(){return sn(Cr)}function Gg(){return Ot().memoizedState}function Fg(){return Ot().memoizedState}function Yk(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=Dn();e=ma(a);var l=ha(n,e,a);l!==null&&(Sn(l,n,a),or(l,n,a)),n={cache:cu()},e.payload=n;return}n=n.return}}function Jk(e,n,a){var l=Dn();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Kl(e)?Kg(n,a):(a=Xd(e,n,a,l),a!==null&&(Sn(a,e,l),Yg(a,n,l)))}function Zg(e,n,a){var l=Dn();ur(e,n,a,l)}function ur(e,n,a,l){var f={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Kl(e))Kg(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,j=h(_,a);if(f.hasEagerState=!0,f.eagerState=j,wn(j,_))return Cl(e,n,f,0),ut===null&&Nl(),!1}catch{}finally{}if(a=Xd(e,n,f,l),a!==null)return Sn(a,e,l),Yg(a,n,l),!0}return!1}function Ou(e,n,a,l){if(l={lane:2,revertLane:mf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Kl(e)){if(n)throw Error(r(479))}else n=Xd(e,a,l,2),n!==null&&Sn(n,e,2)}function Kl(e){var n=e.alternate;return e===Ie||n!==null&&n===Ie}function Kg(e,n){io=Pl=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function Yg(e,n,a){if((a&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,a|=l,n.lanes=a,Je(e,a)}}var fr={readContext:sn,use:ql,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};fr.useEffectEvent=Ct;var Jg={readContext:sn,use:ql,useCallback:function(e,n){return pn().memoizedState=[e,n===void 0?null:n],e},useContext:sn,useEffect:Mg,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,Fl(4194308,4,Lg.bind(null,n,e),a)},useLayoutEffect:function(e,n){return Fl(4194308,4,e,n)},useInsertionEffect:function(e,n){Fl(4,2,e,n)},useMemo:function(e,n){var a=pn();n=n===void 0?null:n;var l=e();if(ui){un(!0);try{e()}finally{un(!1)}}return a.memoizedState=[l,n],l},useReducer:function(e,n,a){var l=pn();if(a!==void 0){var f=a(n);if(ui){un(!0);try{a(n)}finally{un(!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=Jk.bind(null,Ie,e),[l.memoizedState,e]},useRef:function(e){var n=pn();return e={current:e},n.memoizedState=e},useState:function(e){e=Cu(e);var n=e.queue,a=Zg.bind(null,Ie,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:Du,useDeferredValue:function(e,n){var a=pn();return Ru(a,e,n)},useTransition:function(){var e=Cu(!1);return e=Hg.bind(null,Ie,e.queue,!0,!1),pn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var l=Ie,f=pn();if(Ge){if(a===void 0)throw Error(r(407));a=a()}else{if(a=n(),ut===null)throw Error(r(349));(He&127)!==0||vg(l,n,a)}f.memoizedState=a;var h={value:a,getSnapshot:n};return f.queue=h,Mg(bg.bind(null,l,h,e),[e]),l.flags|=2048,ro(9,{destroy:void 0},yg.bind(null,l,h,a,n),null),a},useId:function(){var e=pn(),n=ut.identifierPrefix;if(Ge){var a=vs,l=gs;a=(l&~(1<<32-Jt(l)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Hl++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=Vk++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Iu,useFormState:Cg,useActionState:Cg,useOptimistic:function(e){var n=pn();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Ou.bind(null,Ie,!0,a),a.dispatch=n,[e,n]},useMemoCache:wu,useCacheRefresh:function(){return pn().memoizedState=Yk.bind(null,Ie)},useEffectEvent:function(e){var n=pn(),a={impl:e};return n.memoizedState=a,function(){if((nt&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Bu={readContext:sn,use:ql,useCallback:$g,useContext:sn,useEffect:Au,useImperativeHandle:zg,useInsertionEffect:Og,useLayoutEffect:Bg,useMemo:Ug,useReducer:Gl,useRef:Rg,useState:function(){return Gl(Ls)},useDebugValue:Du,useDeferredValue:function(e,n){var a=Ot();return Pg(a,rt.memoizedState,e,n)},useTransition:function(){var e=Gl(Ls)[0],n=Ot().memoizedState;return[typeof e=="boolean"?e:dr(e),n]},useSyncExternalStore:gg,useId:Gg,useHostTransitionStatus:Iu,useFormState:Eg,useActionState:Eg,useOptimistic:function(e,n){var a=Ot();return kg(a,rt,e,n)},useMemoCache:wu,useCacheRefresh:Fg};Bu.useEffectEvent=Ig;var Wg={readContext:sn,use:ql,useCallback:$g,useContext:sn,useEffect:Au,useImperativeHandle:zg,useInsertionEffect:Og,useLayoutEffect:Bg,useMemo:Ug,useReducer:Nu,useRef:Rg,useState:function(){return Nu(Ls)},useDebugValue:Du,useDeferredValue:function(e,n){var a=Ot();return rt===null?Ru(a,e,n):Pg(a,rt.memoizedState,e,n)},useTransition:function(){var e=Nu(Ls)[0],n=Ot().memoizedState;return[typeof e=="boolean"?e:dr(e),n]},useSyncExternalStore:gg,useId:Gg,useHostTransitionStatus:Iu,useFormState:Dg,useActionState:Dg,useOptimistic:function(e,n){var a=Ot();return rt!==null?kg(a,rt,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:wu,useCacheRefresh:Fg};Wg.useEffectEvent=Ig;function Lu(e,n,a,l){n=e.memoizedState,a=a(l,n),a=a==null?n:b({},n,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var zu={enqueueSetState:function(e,n,a){e=e._reactInternals;var l=Dn(),f=ma(l);f.payload=n,a!=null&&(f.callback=a),n=ha(e,f,l),n!==null&&(Sn(n,e,l),or(n,e,l))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var l=Dn(),f=ma(l);f.tag=1,f.payload=n,a!=null&&(f.callback=a),n=ha(e,f,l),n!==null&&(Sn(n,e,l),or(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=Dn(),l=ma(a);l.tag=2,n!=null&&(l.callback=n),n=ha(e,l,a),n!==null&&(Sn(n,e,a),or(n,e,a))}};function Xg(e,n,a,l,f,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,_):n.prototype&&n.prototype.isPureReactComponent?!Xo(a,l)||!Xo(f,h):!0}function Qg(e,n,a,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,l),n.state!==e&&zu.enqueueReplaceState(n,n.state,null)}function fi(e,n){var a=n;if("ref"in n){a={};for(var l in n)l!=="ref"&&(a[l]=n[l])}if(e=e.defaultProps){a===n&&(a=b({},a));for(var f in e)a[f]===void 0&&(a[f]=e[f])}return a}function ev(e){jl(e)}function tv(e){console.error(e)}function nv(e){jl(e)}function Yl(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function sv(e,n,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function $u(e,n,a){return a=ma(a),a.tag=3,a.payload={element:null},a.callback=function(){Yl(e,n)},a}function av(e){return e=ma(e),e.tag=3,e}function iv(e,n,a,l){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var h=l.value;e.payload=function(){return f(h)},e.callback=function(){sv(n,a,l)}}var _=a.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){sv(n,a,l),typeof f!="function"&&(_a===null?_a=new Set([this]):_a.add(this));var j=l.stack;this.componentDidCatch(l.value,{componentStack:j!==null?j:""})})}function Wk(e,n,a,l,f){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=a.alternate,n!==null&&Qi(n,a,f,!0),a=Nn.current,a!==null){switch(a.tag){case 31:case 13:return Gn===null?rc():a.alternate===null&&Et===0&&(Et=3),a.flags&=-257,a.flags|=65536,a.lanes=f,l===Bl?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([l]):n.add(l),uf(e,l,f)),!1;case 22:return a.flags|=65536,l===Bl?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([l]):a.add(l)),uf(e,l,f)),!1}throw Error(r(435,a.tag))}return uf(e,l,f),rc(),!1}if(Ge)return n=Nn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,l!==au&&(e=Error(r(422),{cause:l}),tr(Pn(e,a)))):(l!==au&&(n=Error(r(423),{cause:l}),tr(Pn(n,a))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,l=Pn(l,a),f=$u(e.stateNode,l,f),hu(e,f),Et!==4&&(Et=2)),!1;var h=Error(r(520),{cause:l});if(h=Pn(h,a),xr===null?xr=[h]:xr.push(h),Et!==4&&(Et=2),n===null)return!0;l=Pn(l,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=f&-f,a.lanes|=e,e=$u(a.stateNode,l,e),hu(a,e),!1;case 1:if(n=a.type,h=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(_a===null||!_a.has(h))))return a.flags|=65536,f&=-f,a.lanes|=f,f=av(f),iv(f,e,a,l),hu(a,f),!1}a=a.return}while(a!==null);return!1}var Uu=Error(r(461)),Pt=!1;function an(e,n,a,l){n.child=e===null?cg(n,null,a,l):di(n,e.child,a,l)}function ov(e,n,a,l,f){a=a.render;var h=n.ref;if("ref"in l){var _={};for(var j in l)j!=="ref"&&(_[j]=l[j])}else _=l;return oi(n),l=_u(e,n,a,_,h,f),j=ku(),e!==null&&!Pt?(Su(e,n,f),zs(e,n,f)):(Ge&&j&&nu(n),n.flags|=1,an(e,n,l,f),n.child)}function rv(e,n,a,l,f){if(e===null){var h=a.type;return typeof h=="function"&&!Qd(h)&&h.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=h,lv(e,n,h,l,f)):(e=Al(a.type,null,l,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!Ku(e,f)){var _=h.memoizedProps;if(a=a.compare,a=a!==null?a:Xo,a(_,l)&&e.ref===n.ref)return zs(e,n,f)}return n.flags|=1,e=Rs(h,l),e.ref=n.ref,e.return=n,n.child=e}function lv(e,n,a,l,f){if(e!==null){var h=e.memoizedProps;if(Xo(h,l)&&e.ref===n.ref)if(Pt=!1,n.pendingProps=l=h,Ku(e,f))(e.flags&131072)!==0&&(Pt=!0);else return n.lanes=e.lanes,zs(e,n,f)}return Pu(e,n,a,l,f)}function cv(e,n,a,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|a:a,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 dv(e,n,h,a,l)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Il(n,h!==null?h.cachePool:null),h!==null?fg(n,h):vu(),pg(n);else return l=n.lanes=536870912,dv(e,n,h!==null?h.baseLanes|a:a,a,l)}else h!==null?(Il(n,h.cachePool),fg(n,h),va(),n.memoizedState=null):(e!==null&&Il(n,null),vu(),va());return an(e,n,f,a),n.child}function pr(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function dv(e,n,a,l,f){var h=uu();return h=h===null?null:{parent:$t._currentValue,pool:h},n.memoizedState={baseLanes:a,cachePool:h},e!==null&&Il(n,null),vu(),pg(n),e!==null&&Qi(e,n,l,!0),n.childLanes=f,null}function Jl(e,n){return n=Xl({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function uv(e,n,a){return di(n,e.child,null,a),e=Jl(n,n.pendingProps),e.flags|=2,Cn(n),n.memoizedState=null,e}function Xk(e,n,a){var l=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Ge){if(l.mode==="hidden")return e=Jl(n,l),n.lanes=536870912,pr(null,e);if(bu(n),(e=gt)?(e=S0(e,qn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ca!==null?{id:gs,overflow:vs}:null,retryLane:536870912,hydrationErrors:null},a=Kh(e),a.return=n,n.child=a,nn=n,gt=null)):e=null,e===null)throw ua(n);return n.lanes=536870912,null}return Jl(n,l)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(bu(n),f)if(n.flags&256)n.flags&=-257,n=uv(e,n,a);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(r(558));else if(Pt||Qi(e,n,a,!1),f=(a&e.childLanes)!==0,Pt||f){if(l=ut,l!==null&&(_=dt(l,a),_!==0&&_!==h.retryLane))throw h.retryLane=_,ni(e,_),Sn(l,e,_),Uu;rc(),n=uv(e,n,a)}else e=h.treeContext,gt=Fn(_.nextSibling),nn=n,Ge=!0,da=null,qn=!1,e!==null&&Wh(n,e),n=Jl(n,l),n.flags|=4096;return n}return e=Rs(e.child,{mode:l.mode,children:l.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Wl(e,n){var a=n.ref;if(a===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(e===null||e.ref!==a)&&(n.flags|=4194816)}}function Pu(e,n,a,l,f){return oi(n),a=_u(e,n,a,l,void 0,f),l=ku(),e!==null&&!Pt?(Su(e,n,f),zs(e,n,f)):(Ge&&l&&nu(n),n.flags|=1,an(e,n,a,f),n.child)}function fv(e,n,a,l,f,h){return oi(n),n.updateQueue=null,a=hg(n,l,a,f),mg(e),l=ku(),e!==null&&!Pt?(Su(e,n,h),zs(e,n,h)):(Ge&&l&&nu(n),n.flags|=1,an(e,n,a,h),n.child)}function pv(e,n,a,l,f){if(oi(n),n.stateNode===null){var h=Yi,_=a.contextType;typeof _=="object"&&_!==null&&(h=sn(_)),h=new a(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={},pu(n),_=a.contextType,h.context=typeof _=="object"&&_!==null?sn(_):Yi,h.state=n.memoizedState,_=a.getDerivedStateFromProps,typeof _=="function"&&(Lu(n,a,_,l),h.state=n.memoizedState),typeof a.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),lr(n,l,h,f),rr(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(e===null){h=n.stateNode;var j=n.memoizedProps,I=fi(a,j);h.props=I;var G=h.context,W=a.contextType;_=Yi,typeof W=="object"&&W!==null&&(_=sn(W));var te=a.getDerivedStateFromProps;W=typeof te=="function"||typeof h.getSnapshotBeforeUpdate=="function",j=n.pendingProps!==j,W||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(j||G!==_)&&Qg(n,h,l,_),pa=!1;var Z=n.memoizedState;h.state=Z,lr(n,l,h,f),rr(),G=n.memoizedState,j||Z!==G||pa?(typeof te=="function"&&(Lu(n,a,te,l),G=n.memoizedState),(I=pa||Xg(n,a,I,l,Z,G,_))?(W||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=G),h.props=l,h.state=G,h.context=_,l=I):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{h=n.stateNode,mu(e,n),_=n.memoizedProps,W=fi(a,_),h.props=W,te=n.pendingProps,Z=h.context,G=a.contextType,I=Yi,typeof G=="object"&&G!==null&&(I=sn(G)),j=a.getDerivedStateFromProps,(G=typeof j=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==te||Z!==I)&&Qg(n,h,l,I),pa=!1,Z=n.memoizedState,h.state=Z,lr(n,l,h,f),rr();var K=n.memoizedState;_!==te||Z!==K||pa||e!==null&&e.dependencies!==null&&Rl(e.dependencies)?(typeof j=="function"&&(Lu(n,a,j,l),K=n.memoizedState),(W=pa||Xg(n,a,W,l,Z,K,I)||e!==null&&e.dependencies!==null&&Rl(e.dependencies))?(G||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,K,I),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,K,I)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&Z===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&Z===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=K),h.props=l,h.state=K,h.context=I,l=W):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&Z===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&Z===e.memoizedState||(n.flags|=1024),l=!1)}return h=l,Wl(e,n),l=(n.flags&128)!==0,h||l?(h=n.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&l?(n.child=di(n,e.child,null,f),n.child=di(n,null,a,f)):an(e,n,a,f),n.memoizedState=h.state,e=n.child):e=zs(e,n,f),e}function mv(e,n,a,l){return ai(),n.flags|=256,an(e,n,a,l),n.child}var Hu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vu(e){return{baseLanes:e,cachePool:sg()}}function qu(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=An),e}function hv(e,n,a){var l=n.pendingProps,f=!1,h=(n.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(It.current&2)!==0),_&&(f=!0,n.flags&=-129),_=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ge){if(f?ga(n):va(),(e=gt)?(e=S0(e,qn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ca!==null?{id:gs,overflow:vs}:null,retryLane:536870912,hydrationErrors:null},a=Kh(e),a.return=n,n.child=a,nn=n,gt=null)):e=null,e===null)throw ua(n);return Nf(e)?n.lanes=32:n.lanes=536870912,null}var j=l.children;return l=l.fallback,f?(va(),f=n.mode,j=Xl({mode:"hidden",children:j},f),l=si(l,f,a,null),j.return=n,l.return=n,j.sibling=l,n.child=j,l=n.child,l.memoizedState=Vu(a),l.childLanes=qu(e,_,a),n.memoizedState=Hu,pr(null,l)):(ga(n),Gu(n,j))}var I=e.memoizedState;if(I!==null&&(j=I.dehydrated,j!==null)){if(h)n.flags&256?(ga(n),n.flags&=-257,n=Fu(e,n,a)):n.memoizedState!==null?(va(),n.child=e.child,n.flags|=128,n=null):(va(),j=l.fallback,f=n.mode,l=Xl({mode:"visible",children:l.children},f),j=si(j,f,a,null),j.flags|=2,l.return=n,j.return=n,l.sibling=j,n.child=l,di(n,e.child,null,a),l=n.child,l.memoizedState=Vu(a),l.childLanes=qu(e,_,a),n.memoizedState=Hu,n=pr(null,l));else if(ga(n),Nf(j)){if(_=j.nextSibling&&j.nextSibling.dataset,_)var G=_.dgst;_=G,l=Error(r(419)),l.stack="",l.digest=_,tr({value:l,source:null,stack:null}),n=Fu(e,n,a)}else if(Pt||Qi(e,n,a,!1),_=(a&e.childLanes)!==0,Pt||_){if(_=ut,_!==null&&(l=dt(_,a),l!==0&&l!==I.retryLane))throw I.retryLane=l,ni(e,l),Sn(_,e,l),Uu;jf(j)||rc(),n=Fu(e,n,a)}else jf(j)?(n.flags|=192,n.child=e.child,n=null):(e=I.treeContext,gt=Fn(j.nextSibling),nn=n,Ge=!0,da=null,qn=!1,e!==null&&Wh(n,e),n=Gu(n,l.children),n.flags|=4096);return n}return f?(va(),j=l.fallback,f=n.mode,I=e.child,G=I.sibling,l=Rs(I,{mode:"hidden",children:l.children}),l.subtreeFlags=I.subtreeFlags&65011712,G!==null?j=Rs(G,j):(j=si(j,f,a,null),j.flags|=2),j.return=n,l.return=n,l.sibling=j,n.child=l,pr(null,l),l=n.child,j=e.child.memoizedState,j===null?j=Vu(a):(f=j.cachePool,f!==null?(I=$t._currentValue,f=f.parent!==I?{parent:I,pool:I}:f):f=sg(),j={baseLanes:j.baseLanes|a,cachePool:f}),l.memoizedState=j,l.childLanes=qu(e,_,a),n.memoizedState=Hu,pr(e.child,l)):(ga(n),a=e.child,e=a.sibling,a=Rs(a,{mode:"visible",children:l.children}),a.return=n,a.sibling=null,e!==null&&(_=n.deletions,_===null?(n.deletions=[e],n.flags|=16):_.push(e)),n.child=a,n.memoizedState=null,a)}function Gu(e,n){return n=Xl({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Xl(e,n){return e=jn(22,e,null,n),e.lanes=0,e}function Fu(e,n,a){return di(n,e.child,null,a),e=Gu(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function gv(e,n,a){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),ru(e.return,n,a)}function Zu(e,n,a,l,f,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:f,treeForkCount:h}:(_.isBackwards=n,_.rendering=null,_.renderingStartTime=0,_.last=l,_.tail=a,_.tailMode=f,_.treeForkCount=h)}function vv(e,n,a){var l=n.pendingProps,f=l.revealOrder,h=l.tail;l=l.children;var _=It.current,j=(_&2)!==0;if(j?(_=_&1|2,n.flags|=128):_&=1,Ee(It,_),an(e,n,l,a),l=Ge?er:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gv(e,a,n);else if(e.tag===19)gv(e,a,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(a=n.child,f=null;a!==null;)e=a.alternate,e!==null&&Ul(e)===null&&(f=a),a=a.sibling;a=f,a===null?(f=n.child,n.child=null):(f=a.sibling,a.sibling=null),Zu(n,!1,f,a,h,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&Ul(e)===null){n.child=f;break}e=f.sibling,f.sibling=a,a=f,f=e}Zu(n,!0,a,null,h,l);break;case"together":Zu(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function zs(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),xa|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(Qi(e,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(r(153));if(n.child!==null){for(e=n.child,a=Rs(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=Rs(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function Ku(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Rl(e)))}function Qk(e,n,a){switch(n.tag){case 3:Le(n,n.stateNode.containerInfo),fa(n,$t,e.memoizedState.cache),ai();break;case 27:case 5:vn(n);break;case 4:Le(n,n.stateNode.containerInfo);break;case 10:fa(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,bu(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(ga(n),n.flags|=128,null):(a&n.child.childLanes)!==0?hv(e,n,a):(ga(n),e=zs(e,n,a),e!==null?e.sibling:null);ga(n);break;case 19:var f=(e.flags&128)!==0;if(l=(a&n.childLanes)!==0,l||(Qi(e,n,a,!1),l=(a&n.childLanes)!==0),f){if(l)return vv(e,n,a);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ee(It,It.current),l)break;return null;case 22:return n.lanes=0,cv(e,n,a,n.pendingProps);case 24:fa(n,$t,e.memoizedState.cache)}return zs(e,n,a)}function yv(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)Pt=!0;else{if(!Ku(e,a)&&(n.flags&128)===0)return Pt=!1,Qk(e,n,a);Pt=(e.flags&131072)!==0}else Pt=!1,Ge&&(n.flags&1048576)!==0&&Jh(n,er,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(e=li(n.elementType),n.type=e,typeof e=="function")Qd(e)?(l=fi(e,l),n.tag=1,n=pv(null,n,e,l,a)):(n.tag=0,n=Pu(null,n,e,l,a));else{if(e!=null){var f=e.$$typeof;if(f===B){n.tag=11,n=ov(null,n,e,l,a);break e}else if(f===D){n.tag=14,n=rv(null,n,e,l,a);break e}}throw n=H(e)||e,Error(r(306,n,""))}}return n;case 0:return Pu(e,n,n.type,n.pendingProps,a);case 1:return l=n.type,f=fi(l,n.pendingProps),pv(e,n,l,f,a);case 3:e:{if(Le(n,n.stateNode.containerInfo),e===null)throw Error(r(387));l=n.pendingProps;var h=n.memoizedState;f=h.element,mu(e,n),lr(n,l,null,a);var _=n.memoizedState;if(l=_.cache,fa(n,$t,l),l!==h.cache&&lu(n,[$t],a,!0),rr(),l=_.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:_.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=mv(e,n,l,a);break e}else if(l!==f){f=Pn(Error(r(424)),n),tr(f),n=mv(e,n,l,a);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(gt=Fn(e.firstChild),nn=n,Ge=!0,da=null,qn=!0,a=cg(n,null,l,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(ai(),l===f){n=zs(e,n,a);break e}an(e,n,l,a)}n=n.child}return n;case 26:return Wl(e,n),e===null?(a=E0(n.type,null,n.pendingProps,null))?n.memoizedState=a:Ge||(a=n.type,e=n.pendingProps,l=mc(xe.current).createElement(a),l[ht]=n,l[Wt]=e,on(l,a,e),Xt(l),n.stateNode=l):n.memoizedState=E0(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return vn(n),e===null&&Ge&&(l=n.stateNode=j0(n.type,n.pendingProps,xe.current),nn=n,qn=!0,f=gt,wa(n.type)?(Cf=f,gt=Fn(l.firstChild)):gt=f),an(e,n,n.pendingProps.children,a),Wl(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ge&&((f=l=gt)&&(l=ES(l,n.type,n.pendingProps,qn),l!==null?(n.stateNode=l,nn=n,gt=Fn(l.firstChild),qn=!1,f=!0):f=!1),f||ua(n)),vn(n),f=n.type,h=n.pendingProps,_=e!==null?e.memoizedProps:null,l=h.children,Sf(f,h)?l=null:_!==null&&Sf(f,_)&&(n.flags|=32),n.memoizedState!==null&&(f=_u(e,n,qk,null,null,a),Cr._currentValue=f),Wl(e,n),an(e,n,l,a),n.child;case 6:return e===null&&Ge&&((e=a=gt)&&(a=AS(a,n.pendingProps,qn),a!==null?(n.stateNode=a,nn=n,gt=null,e=!0):e=!1),e||ua(n)),null;case 13:return hv(e,n,a);case 4:return Le(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=di(n,null,l,a):an(e,n,l,a),n.child;case 11:return ov(e,n,n.type,n.pendingProps,a);case 7:return an(e,n,n.pendingProps,a),n.child;case 8:return an(e,n,n.pendingProps.children,a),n.child;case 12:return an(e,n,n.pendingProps.children,a),n.child;case 10:return l=n.pendingProps,fa(n,n.type,l.value),an(e,n,l.children,a),n.child;case 9:return f=n.type._context,l=n.pendingProps.children,oi(n),f=sn(f),l=l(f),n.flags|=1,an(e,n,l,a),n.child;case 14:return rv(e,n,n.type,n.pendingProps,a);case 15:return lv(e,n,n.type,n.pendingProps,a);case 19:return vv(e,n,a);case 31:return Xk(e,n,a);case 22:return cv(e,n,a,n.pendingProps);case 24:return oi(n),l=sn($t),e===null?(f=uu(),f===null&&(f=ut,h=cu(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=a),f=h),n.memoizedState={parent:l,cache:f},pu(n),fa(n,$t,f)):((e.lanes&a)!==0&&(mu(e,n),lr(n,null,null,a),rr()),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),fa(n,$t,l)):(l=h.cache,fa(n,$t,l),l!==f.cache&&lu(n,[$t],a,!0))),an(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function $s(e){e.flags|=4}function Yu(e,n,a,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(Gv())e.flags|=8192;else throw ci=Bl,fu}else e.flags&=-16777217}function bv(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!I0(n))if(Gv())e.flags|=8192;else throw ci=Bl,fu}function Ql(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?fe():536870912,e.lanes|=n,fo|=n)}function mr(e,n){if(!Ge)switch(e.tailMode){case"hidden":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function vt(e){var n=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(n)for(var f=e.child;f!==null;)a|=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;)a|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=a,n}function eS(e,n,a){var l=n.pendingProps;switch(su(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(n),null;case 1:return vt(n),null;case 3:return a=n.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Os($t),mt(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Xi(n)?$s(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,iu())),vt(n),null;case 26:var f=n.type,h=n.memoizedState;return e===null?($s(n),h!==null?(vt(n),bv(n,h)):(vt(n),Yu(n,f,null,l,a))):h?h!==e.memoizedState?($s(n),vt(n),bv(n,h)):(vt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==l&&$s(n),vt(n),Yu(n,f,e,l,a)),null;case 27:if(se(n),a=xe.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&$s(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return vt(n),null}e=ze.current,Xi(n)?Xh(n):(e=j0(f,l,a),n.stateNode=e,$s(n))}return vt(n),null;case 5:if(se(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&$s(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return vt(n),null}if(h=ze.current,Xi(n))Xh(n);else{var _=mc(xe.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[ht]=n,h[Wt]=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(on(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&&$s(n)}}return vt(n),Yu(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&$s(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(r(166));if(e=xe.current,Xi(n)){if(e=n.stateNode,a=n.memoizedProps,l=null,f=nn,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}e[ht]=n,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||h0(e.nodeValue,a)),e||ua(n,!0)}else e=mc(e).createTextNode(l),e[ht]=n,n.stateNode=e}return vt(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(l=Xi(n),a!==null){if(e===null){if(!l)throw Error(r(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[ht]=n}else ai(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),e=!1}else a=iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(Cn(n),n):(Cn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return vt(n),null;case 13:if(l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=Xi(n),l!==null&&l.dehydrated!==null){if(e===null){if(!f)throw Error(r(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[ht]=n}else ai(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),f=!1}else f=iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Cn(n),n):(Cn(n),null)}return Cn(n),(n.flags&128)!==0?(n.lanes=a,n):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(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)),a!==e&&a&&(n.child.flags|=8192),Ql(n,n.updateQueue),vt(n),null);case 4:return mt(),e===null&&yf(n.stateNode.containerInfo),vt(n),null;case 10:return Os(n.type),vt(n),null;case 19:if(ke(It),l=n.memoizedState,l===null)return vt(n),null;if(f=(n.flags&128)!==0,h=l.rendering,h===null)if(f)mr(l,!1);else{if(Et!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Ul(e),h!==null){for(n.flags|=128,mr(l,!1),e=h.updateQueue,n.updateQueue=e,Ql(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)Zh(a,e),a=a.sibling;return Ee(It,It.current&1|2),Ge&&Ms(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&Kt()>ac&&(n.flags|=128,f=!0,mr(l,!1),n.lanes=4194304)}else{if(!f)if(e=Ul(h),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,Ql(n,e),mr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Ge)return vt(n),null}else 2*Kt()-l.renderingStartTime>ac&&a!==536870912&&(n.flags|=128,f=!0,mr(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=Kt(),e.sibling=null,a=It.current,Ee(It,f?a&1|2:a&1),Ge&&Ms(n,l.treeForkCount),e):(vt(n),null);case 22:case 23:return Cn(n),yu(),l=n.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(a&536870912)!==0&&(n.flags&128)===0&&(vt(n),n.subtreeFlags&6&&(n.flags|=8192)):vt(n),a=n.updateQueue,a!==null&&Ql(n,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==a&&(n.flags|=2048),e!==null&&ke(ri),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),Os($t),vt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function tS(e,n){switch(su(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Os($t),mt(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return se(n),null;case 31:if(n.memoizedState!==null){if(Cn(n),n.alternate===null)throw Error(r(340));ai()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Cn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));ai()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return ke(It),null;case 4:return mt(),null;case 10:return Os(n.type),null;case 22:case 23:return Cn(n),yu(),e!==null&&ke(ri),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Os($t),null;case 25:return null;default:return null}}function xv(e,n){switch(su(n),n.tag){case 3:Os($t),mt();break;case 26:case 27:case 5:se(n);break;case 4:mt();break;case 31:n.memoizedState!==null&&Cn(n);break;case 13:Cn(n);break;case 19:ke(It);break;case 10:Os(n.type);break;case 22:case 23:Cn(n),yu(),e!==null&&ke(ri);break;case 24:Os($t)}}function hr(e,n){try{var a=n.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var f=l.next;a=f;do{if((a.tag&e)===e){l=void 0;var h=a.create,_=a.inst;l=h(),_.destroy=l}a=a.next}while(a!==f)}}catch(j){it(n,n.return,j)}}function ya(e,n,a){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,j=_.destroy;if(j!==void 0){_.destroy=void 0,f=n;var I=a,G=j;try{G()}catch(W){it(f,I,W)}}}l=l.next}while(l!==h)}}catch(W){it(n,n.return,W)}}function _v(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{ug(n,a)}catch(l){it(e,e.return,l)}}}function kv(e,n,a){a.props=fi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){it(e,n,l)}}function gr(e,n){try{var a=e.ref;if(a!==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 a=="function"?e.refCleanup=a(l):a.current=l}}catch(f){it(e,n,f)}}function ys(e,n){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(f){it(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){it(e,n,f)}else a.current=null}function Sv(e){var n=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(f){it(e,e.return,f)}}function Ju(e,n,a){try{var l=e.stateNode;SS(l,e.type,a,n),l[Wt]=n}catch(f){it(e,e.return,f)}}function Tv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wa(e.type)||e.tag===4}function Wu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tv(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&&wa(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 Xu(e,n,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(e),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=As));else if(l!==4&&(l===27&&wa(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(Xu(e,n,a),e=e.sibling;e!==null;)Xu(e,n,a),e=e.sibling}function ec(e,n,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?a.insertBefore(e,n):a.appendChild(e);else if(l!==4&&(l===27&&wa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ec(e,n,a),e=e.sibling;e!==null;)ec(e,n,a),e=e.sibling}function wv(e){var n=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);on(n,l,a),n[ht]=e,n[Wt]=a}catch(h){it(e,e.return,h)}}var Us=!1,Ht=!1,Qu=!1,jv=typeof WeakSet=="function"?WeakSet:Set,Qt=null;function nS(e,n){if(e=e.containerInfo,_f=_c,e=zh(e),Fd(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var f=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var _=0,j=-1,I=-1,G=0,W=0,te=e,Z=null;t:for(;;){for(var K;te!==a||f!==0&&te.nodeType!==3||(j=_+f),te!==h||l!==0&&te.nodeType!==3||(I=_+l),te.nodeType===3&&(_+=te.nodeValue.length),(K=te.firstChild)!==null;)Z=te,te=K;for(;;){if(te===e)break t;if(Z===a&&++G===f&&(j=_),Z===h&&++W===l&&(I=_),(K=te.nextSibling)!==null)break;te=Z,Z=te.parentNode}te=K}a=j===-1||I===-1?null:{start:j,end:I}}else a=null}a=a||{start:0,end:0}}else a=null;for(kf={focusedElem:e,selectionRange:a},_c=!1,Qt=n;Qt!==null;)if(n=Qt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Qt=e;else for(;Qt!==null;){switch(n=Qt,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(a=0;a<e.length;a++)f=e[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,a=n,f=h.memoizedProps,h=h.memoizedState,l=a.stateNode;try{var ye=fi(a.type,f);e=l.getSnapshotBeforeUpdate(ye,h),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){it(a,a.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)wf(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":wf(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(r(163))}if(e=n.sibling,e!==null){e.return=n.return,Qt=e;break}Qt=n.return}}function Nv(e,n,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Hs(e,a),l&4&&hr(5,a);break;case 1:if(Hs(e,a),l&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(_){it(a,a.return,_)}else{var f=fi(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(_){it(a,a.return,_)}}l&64&&_v(a),l&512&&gr(a,a.return);break;case 3:if(Hs(e,a),l&64&&(e=a.updateQueue,e!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{ug(e,n)}catch(_){it(a,a.return,_)}}break;case 27:n===null&&l&4&&wv(a);case 26:case 5:Hs(e,a),n===null&&l&4&&Sv(a),l&512&&gr(a,a.return);break;case 12:Hs(e,a);break;case 31:Hs(e,a),l&4&&Av(e,a);break;case 13:Hs(e,a),l&4&&Dv(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=uS.bind(null,a),DS(e,a))));break;case 22:if(l=a.memoizedState!==null||Us,!l){n=n!==null&&n.memoizedState!==null||Ht,f=Us;var h=Ht;Us=l,(Ht=n)&&!h?Vs(e,a,(a.subtreeFlags&8772)!==0):Hs(e,a),Us=f,Ht=h}break;case 30:break;default:Hs(e,a)}}function Cv(e){var n=e.alternate;n!==null&&(e.alternate=null,Cv(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Ed(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 St=null,bn=!1;function Ps(e,n,a){for(a=a.child;a!==null;)Ev(e,n,a),a=a.sibling}function Ev(e,n,a){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(Yt,a)}catch{}switch(a.tag){case 26:Ht||ys(a,n),Ps(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ht||ys(a,n);var l=St,f=bn;wa(a.type)&&(St=a.stateNode,bn=!1),Ps(e,n,a),wr(a.stateNode),St=l,bn=f;break;case 5:Ht||ys(a,n);case 6:if(l=St,f=bn,St=null,Ps(e,n,a),St=l,bn=f,St!==null)if(bn)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(a.stateNode)}catch(h){it(a,n,h)}else try{St.removeChild(a.stateNode)}catch(h){it(a,n,h)}break;case 18:St!==null&&(bn?(e=St,_0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),xo(e)):_0(St,a.stateNode));break;case 4:l=St,f=bn,St=a.stateNode.containerInfo,bn=!0,Ps(e,n,a),St=l,bn=f;break;case 0:case 11:case 14:case 15:ya(2,a,n),Ht||ya(4,a,n),Ps(e,n,a);break;case 1:Ht||(ys(a,n),l=a.stateNode,typeof l.componentWillUnmount=="function"&&kv(a,n,l)),Ps(e,n,a);break;case 21:Ps(e,n,a);break;case 22:Ht=(l=Ht)||a.memoizedState!==null,Ps(e,n,a),Ht=l;break;default:Ps(e,n,a)}}function Av(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{xo(e)}catch(a){it(n,n.return,a)}}}function Dv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{xo(e)}catch(a){it(n,n.return,a)}}function sS(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new jv),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new jv),n;default:throw Error(r(435,e.tag))}}function tc(e,n){var a=sS(e);n.forEach(function(l){if(!a.has(l)){a.add(l);var f=fS.bind(null,e,l);l.then(f,f)}})}function xn(e,n){var a=n.deletions;if(a!==null)for(var l=0;l<a.length;l++){var f=a[l],h=e,_=n,j=_;e:for(;j!==null;){switch(j.tag){case 27:if(wa(j.type)){St=j.stateNode,bn=!1;break e}break;case 5:St=j.stateNode,bn=!1;break e;case 3:case 4:St=j.stateNode.containerInfo,bn=!0;break e}j=j.return}if(St===null)throw Error(r(160));Ev(h,_,f),St=null,bn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Rv(n,e),n=n.sibling}var as=null;function Rv(e,n){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:xn(n,e),_n(e),l&4&&(ya(3,e,e.return),hr(3,e),ya(5,e,e.return));break;case 1:xn(n,e),_n(e),l&512&&(Ht||a===null||ys(a,a.return)),l&64&&Us&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var f=as;if(xn(n,e),_n(e),l&512&&(Ht||a===null||ys(a,a.return)),l&4){var h=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":h=f.getElementsByTagName("title")[0],(!h||h[Vo]||h[ht]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(l),f.head.insertBefore(h,f.querySelector("head > title"))),on(h,l,a),h[ht]=e,Xt(h),l=h;break e;case"link":var _=R0("link","href",f).get(l+(a.href||""));if(_){for(var j=0;j<_.length;j++)if(h=_[j],h.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&h.getAttribute("rel")===(a.rel==null?null:a.rel)&&h.getAttribute("title")===(a.title==null?null:a.title)&&h.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){_.splice(j,1);break t}}h=f.createElement(l),on(h,l,a),f.head.appendChild(h);break;case"meta":if(_=R0("meta","content",f).get(l+(a.content||""))){for(j=0;j<_.length;j++)if(h=_[j],h.getAttribute("content")===(a.content==null?null:""+a.content)&&h.getAttribute("name")===(a.name==null?null:a.name)&&h.getAttribute("property")===(a.property==null?null:a.property)&&h.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&h.getAttribute("charset")===(a.charSet==null?null:a.charSet)){_.splice(j,1);break t}}h=f.createElement(l),on(h,l,a),f.head.appendChild(h);break;default:throw Error(r(468,l))}h[ht]=e,Xt(h),l=h}e.stateNode=l}else M0(f,e.type,e.stateNode);else e.stateNode=D0(f,l,e.memoizedProps);else h!==l?(h===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):h.count--,l===null?M0(f,e.type,e.stateNode):D0(f,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Ju(e,e.memoizedProps,a.memoizedProps)}break;case 27:xn(n,e),_n(e),l&512&&(Ht||a===null||ys(a,a.return)),a!==null&&l&4&&Ju(e,e.memoizedProps,a.memoizedProps);break;case 5:if(xn(n,e),_n(e),l&512&&(Ht||a===null||ys(a,a.return)),e.flags&32){f=e.stateNode;try{Hi(f,"")}catch(ye){it(e,e.return,ye)}}l&4&&e.stateNode!=null&&(f=e.memoizedProps,Ju(e,f,a!==null?a.memoizedProps:f)),l&1024&&(Qu=!0);break;case 6:if(xn(n,e),_n(e),l&4){if(e.stateNode===null)throw Error(r(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(ye){it(e,e.return,ye)}}break;case 3:if(vc=null,f=as,as=hc(n.containerInfo),xn(n,e),as=f,_n(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{xo(n.containerInfo)}catch(ye){it(e,e.return,ye)}Qu&&(Qu=!1,Mv(e));break;case 4:l=as,as=hc(e.stateNode.containerInfo),xn(n,e),_n(e),as=l;break;case 12:xn(n,e),_n(e);break;case 31:xn(n,e),_n(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,tc(e,l)));break;case 13:xn(n,e),_n(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(sc=Kt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,tc(e,l)));break;case 22:f=e.memoizedState!==null;var I=a!==null&&a.memoizedState!==null,G=Us,W=Ht;if(Us=G||f,Ht=W||I,xn(n,e),Ht=W,Us=G,_n(e),l&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(a===null||I||Us||Ht||pi(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){I=a=n;try{if(h=I.stateNode,f)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{j=I.stateNode;var te=I.memoizedProps.style,Z=te!=null&&te.hasOwnProperty("display")?te.display:null;j.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(ye){it(I,I.return,ye)}}}else if(n.tag===6){if(a===null){I=n;try{I.stateNode.nodeValue=f?"":I.memoizedProps}catch(ye){it(I,I.return,ye)}}}else if(n.tag===18){if(a===null){I=n;try{var K=I.stateNode;f?k0(K,!0):k0(I.stateNode,!1)}catch(ye){it(I,I.return,ye)}}}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;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,tc(e,a))));break;case 19:xn(n,e),_n(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,tc(e,l)));break;case 30:break;case 21:break;default:xn(n,e),_n(e)}}function _n(e){var n=e.flags;if(n&2){try{for(var a,l=e.return;l!==null;){if(Tv(l)){a=l;break}l=l.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var f=a.stateNode,h=Wu(e);ec(e,h,f);break;case 5:var _=a.stateNode;a.flags&32&&(Hi(_,""),a.flags&=-33);var j=Wu(e);ec(e,j,_);break;case 3:case 4:var I=a.stateNode.containerInfo,G=Wu(e);Xu(e,G,I);break;default:throw Error(r(161))}}catch(W){it(e,e.return,W)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Mv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Mv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Hs(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Nv(e,n.alternate,n),n=n.sibling}function pi(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ya(4,n,n.return),pi(n);break;case 1:ys(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&kv(n,n.return,a),pi(n);break;case 27:wr(n.stateNode);case 26:case 5:ys(n,n.return),pi(n);break;case 22:n.memoizedState===null&&pi(n);break;case 30:pi(n);break;default:pi(n)}e=e.sibling}}function Vs(e,n,a){for(a=a&&(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:Vs(f,h,a),hr(4,h);break;case 1:if(Vs(f,h,a),l=h,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(G){it(l,l.return,G)}if(l=h,f=l.updateQueue,f!==null){var j=l.stateNode;try{var I=f.shared.hiddenCallbacks;if(I!==null)for(f.shared.hiddenCallbacks=null,f=0;f<I.length;f++)dg(I[f],j)}catch(G){it(l,l.return,G)}}a&&_&64&&_v(h),gr(h,h.return);break;case 27:wv(h);case 26:case 5:Vs(f,h,a),a&&l===null&&_&4&&Sv(h),gr(h,h.return);break;case 12:Vs(f,h,a);break;case 31:Vs(f,h,a),a&&_&4&&Av(f,h);break;case 13:Vs(f,h,a),a&&_&4&&Dv(f,h);break;case 22:h.memoizedState===null&&Vs(f,h,a),gr(h,h.return);break;case 30:break;default:Vs(f,h,a)}n=n.sibling}}function ef(e,n){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&nr(a))}function tf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&nr(e))}function is(e,n,a,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Iv(e,n,a,l),n=n.sibling}function Iv(e,n,a,l){var f=n.flags;switch(n.tag){case 0:case 11:case 15:is(e,n,a,l),f&2048&&hr(9,n);break;case 1:is(e,n,a,l);break;case 3:is(e,n,a,l),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&nr(e)));break;case 12:if(f&2048){is(e,n,a,l),e=n.stateNode;try{var h=n.memoizedProps,_=h.id,j=h.onPostCommit;typeof j=="function"&&j(_,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(I){it(n,n.return,I)}}else is(e,n,a,l);break;case 31:is(e,n,a,l);break;case 13:is(e,n,a,l);break;case 23:break;case 22:h=n.stateNode,_=n.alternate,n.memoizedState!==null?h._visibility&2?is(e,n,a,l):vr(e,n):h._visibility&2?is(e,n,a,l):(h._visibility|=2,lo(e,n,a,l,(n.subtreeFlags&10256)!==0||!1)),f&2048&&ef(_,n);break;case 24:is(e,n,a,l),f&2048&&tf(n.alternate,n);break;default:is(e,n,a,l)}}function lo(e,n,a,l,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,_=n,j=a,I=l,G=_.flags;switch(_.tag){case 0:case 11:case 15:lo(h,_,j,I,f),hr(8,_);break;case 23:break;case 22:var W=_.stateNode;_.memoizedState!==null?W._visibility&2?lo(h,_,j,I,f):vr(h,_):(W._visibility|=2,lo(h,_,j,I,f)),f&&G&2048&&ef(_.alternate,_);break;case 24:lo(h,_,j,I,f),f&&G&2048&&tf(_.alternate,_);break;default:lo(h,_,j,I,f)}n=n.sibling}}function vr(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=e,l=n,f=l.flags;switch(l.tag){case 22:vr(a,l),f&2048&&ef(l.alternate,l);break;case 24:vr(a,l),f&2048&&tf(l.alternate,l);break;default:vr(a,l)}n=n.sibling}}var yr=8192;function co(e,n,a){if(e.subtreeFlags&yr)for(e=e.child;e!==null;)Ov(e,n,a),e=e.sibling}function Ov(e,n,a){switch(e.tag){case 26:co(e,n,a),e.flags&yr&&e.memoizedState!==null&&VS(a,as,e.memoizedState,e.memoizedProps);break;case 5:co(e,n,a);break;case 3:case 4:var l=as;as=hc(e.stateNode.containerInfo),co(e,n,a),as=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=yr,yr=16777216,co(e,n,a),yr=l):co(e,n,a));break;default:co(e,n,a)}}function Bv(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 br(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var l=n[a];Qt=l,zv(l,e)}Bv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Lv(e),e=e.sibling}function Lv(e){switch(e.tag){case 0:case 11:case 15:br(e),e.flags&2048&&ya(9,e,e.return);break;case 3:br(e);break;case 12:br(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,nc(e)):br(e);break;default:br(e)}}function nc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var l=n[a];Qt=l,zv(l,e)}Bv(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ya(8,n,n.return),nc(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,nc(n));break;default:nc(n)}e=e.sibling}}function zv(e,n){for(;Qt!==null;){var a=Qt;switch(a.tag){case 0:case 11:case 15:ya(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:nr(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Qt=l;else e:for(a=e;Qt!==null;){l=Qt;var f=l.sibling,h=l.return;if(Cv(l),l===a){Qt=null;break e}if(f!==null){f.return=h,Qt=f;break e}Qt=h}}}var aS={getCacheForType:function(e){var n=sn($t),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return sn($t).controller.signal}},iS=typeof WeakMap=="function"?WeakMap:Map,nt=0,ut=null,$e=null,He=0,at=0,En=null,ba=!1,uo=!1,nf=!1,qs=0,Et=0,xa=0,mi=0,sf=0,An=0,fo=0,xr=null,kn=null,af=!1,sc=0,$v=0,ac=1/0,ic=null,_a=null,Gt=0,ka=null,po=null,Gs=0,of=0,rf=null,Uv=null,_r=0,lf=null;function Dn(){return(nt&2)!==0&&He!==0?He&-He:E.T!==null?mf():tn()}function Pv(){if(An===0)if((He&536870912)===0||Ge){var e=Ja;Ja<<=1,(Ja&3932160)===0&&(Ja=262144),An=e}else An=536870912;return e=Nn.current,e!==null&&(e.flags|=32),An}function Sn(e,n,a){(e===ut&&(at===2||at===9)||e.cancelPendingCommit!==null)&&(mo(e,0),Sa(e,He,An,!1)),Pe(e,a),((nt&2)===0||e!==ut)&&(e===ut&&((nt&2)===0&&(mi|=a),Et===4&&Sa(e,He,An,!1)),bs(e))}function Hv(e,n,a){if((nt&6)!==0)throw Error(r(327));var l=!a&&(n&127)===0&&(n&e.expiredLanes)===0||ne(e,n),f=l?lS(e,n):df(e,n,!0),h=l;do{if(f===0){uo&&!l&&Sa(e,n,0,!1);break}else{if(a=e.current.alternate,h&&!oS(a)){f=df(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 j=e;f=xr;var I=j.current.memoizedState.isDehydrated;if(I&&(mo(j,_).flags|=256),_=df(j,_,!1),_!==2){if(nf&&!I){j.errorRecoveryDisabledLanes|=h,mi|=h,f=4;break e}h=kn,kn=f,h!==null&&(kn===null?kn=h:kn.push.apply(kn,h))}f=_}if(h=!1,f!==2)continue}}if(f===1){mo(e,0),Sa(e,n,0,!0);break}e:{switch(l=e,h=f,h){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:Sa(l,n,An,!ba);break e;case 2:kn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=sc+300-Kt(),10<f)){if(Sa(l,n,An,!ba),V(l,0,!0)!==0)break e;Gs=n,l.timeoutHandle=b0(Vv.bind(null,l,a,kn,ic,af,n,An,mi,fo,ba,h,"Throttled",-0,0),f);break e}Vv(l,a,kn,ic,af,n,An,mi,fo,ba,h,null,-0,0)}}break}while(!0);bs(e)}function Vv(e,n,a,l,f,h,_,j,I,G,W,te,Z,K){if(e.timeoutHandle=-1,te=n.subtreeFlags,te&8192||(te&16785408)===16785408){te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:As},Ov(n,h,te);var ye=(h&62914560)===h?sc-Kt():(h&4194048)===h?$v-Kt():0;if(ye=qS(te,ye),ye!==null){Gs=h,e.cancelPendingCommit=ye(Wv.bind(null,e,n,h,a,l,f,_,j,I,W,te,null,Z,K)),Sa(e,h,_,!G);return}}Wv(e,n,h,a,l,f,_,j,I)}function oS(e){for(var n=e;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var f=a[l],h=f.getSnapshot;f=f.value;try{if(!wn(h(),f))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;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 Sa(e,n,a,l){n&=~sf,n&=~mi,e.suspendedLanes|=n,e.pingedLanes&=~n,l&&(e.warmLanes|=n),l=e.expirationTimes;for(var f=n;0<f;){var h=31-Jt(f),_=1<<h;l[h]=-1,f&=~_}a!==0&&Me(e,a,n)}function oc(){return(nt&6)===0?(kr(0),!1):!0}function cf(){if($e!==null){if(at===0)var e=$e.return;else e=$e,Is=ii=null,Tu(e),so=null,ar=0,e=$e;for(;e!==null;)xv(e.alternate,e),e=e.return;$e=null}}function mo(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,jS(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Gs=0,cf(),ut=e,$e=a=Rs(e.current,null),He=n,at=0,En=null,ba=!1,uo=ne(e,n),nf=!1,fo=An=sf=mi=xa=Et=0,kn=xr=null,af=!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-Jt(l),h=1<<f;n|=e[f],l&=~h}return qs=n,Nl(),a}function qv(e,n){Ie=null,E.H=fr,n===no||n===Ol?(n=og(),at=3):n===fu?(n=og(),at=4):at=n===Uu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,En=n,$e===null&&(Et=1,Yl(e,Pn(n,e.current)))}function Gv(){var e=Nn.current;return e===null?!0:(He&4194048)===He?Gn===null:(He&62914560)===He||(He&536870912)!==0?e===Gn:!1}function Fv(){var e=E.H;return E.H=fr,e===null?fr:e}function Zv(){var e=E.A;return E.A=aS,e}function rc(){Et=4,ba||(He&4194048)!==He&&Nn.current!==null||(uo=!0),(xa&134217727)===0&&(mi&134217727)===0||ut===null||Sa(ut,He,An,!1)}function df(e,n,a){var l=nt;nt|=2;var f=Fv(),h=Zv();(ut!==e||He!==n)&&(ic=null,mo(e,n)),n=!1;var _=Et;e:do try{if(at!==0&&$e!==null){var j=$e,I=En;switch(at){case 8:cf(),_=6;break e;case 3:case 2:case 9:case 6:Nn.current===null&&(n=!0);var G=at;if(at=0,En=null,ho(e,j,I,G),a&&uo){_=0;break e}break;default:G=at,at=0,En=null,ho(e,j,I,G)}}rS(),_=Et;break}catch(W){qv(e,W)}while(!0);return n&&e.shellSuspendCounter++,Is=ii=null,nt=l,E.H=f,E.A=h,$e===null&&(ut=null,He=0,Nl()),_}function rS(){for(;$e!==null;)Kv($e)}function lS(e,n){var a=nt;nt|=2;var l=Fv(),f=Zv();ut!==e||He!==n?(ic=null,ac=Kt()+500,mo(e,n)):uo=ne(e,n);e:do try{if(at!==0&&$e!==null){n=$e;var h=En;t:switch(at){case 1:at=0,En=null,ho(e,n,h,1);break;case 2:case 9:if(ag(h)){at=0,En=null,Yv(n);break}n=function(){at!==2&&at!==9||ut!==e||(at=7),bs(e)},h.then(n,n);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:ag(h)?(at=0,En=null,Yv(n)):(at=0,En=null,ho(e,n,h,7));break;case 5:var _=null;switch($e.tag){case 26:_=$e.memoizedState;case 5:case 27:var j=$e;if(_?I0(_):j.stateNode.complete){at=0,En=null;var I=j.sibling;if(I!==null)$e=I;else{var G=j.return;G!==null?($e=G,lc(G)):$e=null}break t}}at=0,En=null,ho(e,n,h,5);break;case 6:at=0,En=null,ho(e,n,h,6);break;case 8:cf(),Et=6;break e;default:throw Error(r(462))}}cS();break}catch(W){qv(e,W)}while(!0);return Is=ii=null,E.H=l,E.A=f,nt=a,$e!==null?0:(ut=null,He=0,Nl(),Et)}function cS(){for(;$e!==null&&!Za();)Kv($e)}function Kv(e){var n=yv(e.alternate,e,qs);e.memoizedProps=e.pendingProps,n===null?lc(e):$e=n}function Yv(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=fv(a,n,n.pendingProps,n.type,void 0,He);break;case 11:n=fv(a,n,n.pendingProps,n.type.render,n.ref,He);break;case 5:Tu(n);default:xv(a,n),n=$e=Zh(n,qs),n=yv(a,n,qs)}e.memoizedProps=e.pendingProps,n===null?lc(e):$e=n}function ho(e,n,a,l){Is=ii=null,Tu(n),so=null,ar=0;var f=n.return;try{if(Wk(e,f,n,a,He)){Et=1,Yl(e,Pn(a,e.current)),$e=null;return}}catch(h){if(f!==null)throw $e=f,h;Et=1,Yl(e,Pn(a,e.current)),$e=null;return}n.flags&32768?(Ge||l===1?e=!0:uo||(He&536870912)!==0?e=!1:(ba=e=!0,(l===2||l===9||l===3||l===6)&&(l=Nn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Jv(n,e)):lc(n)}function lc(e){var n=e;do{if((n.flags&32768)!==0){Jv(n,ba);return}e=n.return;var a=eS(n.alternate,n,qs);if(a!==null){$e=a;return}if(n=n.sibling,n!==null){$e=n;return}$e=n=e}while(n!==null);Et===0&&(Et=5)}function Jv(e,n){do{var a=tS(e.alternate,e);if(a!==null){a.flags&=32767,$e=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){$e=e;return}$e=e=a}while(e!==null);Et=6,$e=null}function Wv(e,n,a,l,f,h,_,j,I){e.cancelPendingCommit=null;do cc();while(Gt!==0);if((nt&6)!==0)throw Error(r(327));if(n!==null){if(n===e.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=Wd,Se(e,a,h,_,j,I),e===ut&&($e=ut=null,He=0),po=n,ka=e,Gs=a,of=h,rf=f,Uv=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,pS(ns,function(){return n0(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=E.T,E.T=null,f=F.p,F.p=2,_=nt,nt|=4;try{nS(e,n,a)}finally{nt=_,F.p=f,E.T=l}}Gt=1,Xv(),Qv(),e0()}}function Xv(){if(Gt===1){Gt=0;var e=ka,n=po,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=E.T,E.T=null;var l=F.p;F.p=2;var f=nt;nt|=4;try{Rv(n,e);var h=kf,_=zh(e.containerInfo),j=h.focusedElem,I=h.selectionRange;if(_!==j&&j&&j.ownerDocument&&Lh(j.ownerDocument.documentElement,j)){if(I!==null&&Fd(j)){var G=I.start,W=I.end;if(W===void 0&&(W=G),"selectionStart"in j)j.selectionStart=G,j.selectionEnd=Math.min(W,j.value.length);else{var te=j.ownerDocument||document,Z=te&&te.defaultView||window;if(Z.getSelection){var K=Z.getSelection(),ye=j.textContent.length,Ne=Math.min(I.start,ye),ct=I.end===void 0?Ne:Math.min(I.end,ye);!K.extend&&Ne>ct&&(_=ct,ct=Ne,Ne=_);var $=Bh(j,Ne),L=Bh(j,ct);if($&&L&&(K.rangeCount!==1||K.anchorNode!==$.node||K.anchorOffset!==$.offset||K.focusNode!==L.node||K.focusOffset!==L.offset)){var q=te.createRange();q.setStart($.node,$.offset),K.removeAllRanges(),Ne>ct?(K.addRange(q),K.extend(L.node,L.offset)):(q.setEnd(L.node,L.offset),K.addRange(q))}}}}for(te=[],K=j;K=K.parentNode;)K.nodeType===1&&te.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<te.length;j++){var ee=te[j];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}_c=!!_f,kf=_f=null}finally{nt=f,F.p=l,E.T=a}}e.current=n,Gt=2}}function Qv(){if(Gt===2){Gt=0;var e=ka,n=po,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=E.T,E.T=null;var l=F.p;F.p=2;var f=nt;nt|=4;try{Nv(e,n.alternate,n)}finally{nt=f,F.p=l,E.T=a}}Gt=3}}function e0(){if(Gt===4||Gt===3){Gt=0,oa();var e=ka,n=po,a=Gs,l=Uv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Gt=5:(Gt=0,po=ka=null,t0(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(_a=null),qt(a),n=n.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(Yt,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=E.T,f=F.p,F.p=2,E.T=null;try{for(var h=e.onRecoverableError,_=0;_<l.length;_++){var j=l[_];h(j.value,{componentStack:j.stack})}}finally{E.T=n,F.p=f}}(Gs&3)!==0&&cc(),bs(e),f=e.pendingLanes,(a&261930)!==0&&(f&42)!==0?e===lf?_r++:(_r=0,lf=e):_r=0,kr(0)}}function t0(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,nr(n)))}function cc(){return Xv(),Qv(),e0(),n0()}function n0(){if(Gt!==5)return!1;var e=ka,n=of;of=0;var a=qt(Gs),l=E.T,f=F.p;try{F.p=32>a?32:a,E.T=null,a=rf,rf=null;var h=ka,_=Gs;if(Gt=0,po=ka=null,Gs=0,(nt&6)!==0)throw Error(r(331));var j=nt;if(nt|=4,Lv(h.current),Iv(h,h.current,_,a),nt=j,kr(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(Yt,h)}catch{}return!0}finally{F.p=f,E.T=l,t0(e,n)}}function s0(e,n,a){n=Pn(a,n),n=$u(e.stateNode,n,2),e=ha(e,n,2),e!==null&&(Pe(e,2),bs(e))}function it(e,n,a){if(e.tag===3)s0(e,e,a);else for(;n!==null;){if(n.tag===3){s0(n,e,a);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=Pn(a,e),a=av(2),l=ha(n,a,2),l!==null&&(iv(a,l,n,e),Pe(l,2),bs(l));break}}n=n.return}}function uf(e,n,a){var l=e.pingCache;if(l===null){l=e.pingCache=new iS;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(a)||(nf=!0,f.add(a),e=dS.bind(null,e,n,a),n.then(e,e))}function dS(e,n,a){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ut===e&&(He&a)===a&&(Et===4||Et===3&&(He&62914560)===He&&300>Kt()-sc?(nt&2)===0&&mo(e,0):sf|=a,fo===He&&(fo=0)),bs(e)}function a0(e,n){n===0&&(n=fe()),e=ni(e,n),e!==null&&(Pe(e,n),bs(e))}function uS(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),a0(e,a)}function fS(e,n){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(a=f.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(n),a0(e,a)}function pS(e,n){return ia(e,n)}var dc=null,go=null,ff=!1,uc=!1,pf=!1,Ta=0;function bs(e){e!==go&&e.next===null&&(go===null?dc=go=e:go=go.next=e),uc=!0,ff||(ff=!0,hS())}function kr(e,n){if(!pf&&uc){pf=!0;do for(var a=!1,l=dc;l!==null;){if(e!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var _=l.suspendedLanes,j=l.pingedLanes;h=(1<<31-Jt(42|e)+1)-1,h&=f&~(_&~j),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(a=!0,l0(l,h))}else h=He,h=V(l,l===ut?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||ne(l,h)||(a=!0,l0(l,h));l=l.next}while(a);pf=!1}}function mS(){i0()}function i0(){uc=ff=!1;var e=0;Ta!==0&&wS()&&(e=Ta);for(var n=Kt(),a=null,l=dc;l!==null;){var f=l.next,h=o0(l,n);h===0?(l.next=null,a===null?dc=f:a.next=f,f===null&&(go=a)):(a=l,(e!==0||(h&3)!==0)&&(uc=!0)),l=f}Gt!==0&&Gt!==5||kr(e),Ta!==0&&(Ta=0)}function o0(e,n){for(var a=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-Jt(h),j=1<<_,I=f[_];I===-1?((j&a)===0||(j&l)!==0)&&(f[_]=le(j,n)):I<=n&&(e.expiredLanes|=j),h&=~j}if(n=ut,a=He,a=V(e,e===n?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===n&&(at===2||at===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&ts(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ne(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(l!==null&&ts(l),qt(a)){case 2:case 8:a=Ka;break;case 32:a=ns;break;case 268435456:a=Ln;break;default:a=ns}return l=r0.bind(null,e),a=ia(a,l),e.callbackPriority=n,e.callbackNode=a,n}return l!==null&&l!==null&&ts(l),e.callbackPriority=2,e.callbackNode=null,2}function r0(e,n){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(cc()&&e.callbackNode!==a)return null;var l=He;return l=V(e,e===ut?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Hv(e,l,n),o0(e,Kt()),e.callbackNode!=null&&e.callbackNode===a?r0.bind(null,e):null)}function l0(e,n){if(cc())return null;Hv(e,n,!0)}function hS(){NS(function(){(nt&6)!==0?ia(ra,mS):i0()})}function mf(){if(Ta===0){var e=eo;e===0&&(e=Ya,Ya<<=1,(Ya&261888)===0&&(Ya=256)),Ta=e}return Ta}function c0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:bl(""+e)}function d0(e,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,e.id&&a.setAttribute("form",e.id),n.parentNode.insertBefore(a,n),e=new FormData(e),a.parentNode.removeChild(a),e}function gS(e,n,a,l,f){if(n==="submit"&&a&&a.stateNode===f){var h=c0((f[Wt]||null).action),_=l.submitter;_&&(n=(n=_[Wt]||null)?c0(n.formAction):_.getAttribute("formAction"),n!==null&&(h=n,_=null));var j=new Sl("action","action",null,l,f);e.push({event:j,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ta!==0){var I=_?d0(f,_):new FormData(f);Mu(a,{pending:!0,data:I,method:f.method,action:h},null,I)}}else typeof h=="function"&&(j.preventDefault(),I=_?d0(f,_):new FormData(f),Mu(a,{pending:!0,data:I,method:f.method,action:h},h,I))},currentTarget:f}]})}}for(var hf=0;hf<Jd.length;hf++){var gf=Jd[hf],vS=gf.toLowerCase(),yS=gf[0].toUpperCase()+gf.slice(1);ss(vS,"on"+yS)}ss(Ph,"onAnimationEnd"),ss(Hh,"onAnimationIteration"),ss(Vh,"onAnimationStart"),ss("dblclick","onDoubleClick"),ss("focusin","onFocus"),ss("focusout","onBlur"),ss(Ik,"onTransitionRun"),ss(Ok,"onTransitionStart"),ss(Bk,"onTransitionCancel"),ss(qh,"onTransitionEnd"),Ui("onMouseEnter",["mouseout","mouseover"]),Ui("onMouseLeave",["mouseout","mouseover"]),Ui("onPointerEnter",["pointerout","pointerover"]),Ui("onPointerLeave",["pointerout","pointerover"]),Xa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sr="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(" "),bS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Sr));function u0(e,n){n=(n&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],f=l.event;l=l.listeners;e:{var h=void 0;if(n)for(var _=l.length-1;0<=_;_--){var j=l[_],I=j.instance,G=j.currentTarget;if(j=j.listener,I!==h&&f.isPropagationStopped())break e;h=j,f.currentTarget=G;try{h(f)}catch(W){jl(W)}f.currentTarget=null,h=I}else for(_=0;_<l.length;_++){if(j=l[_],I=j.instance,G=j.currentTarget,j=j.listener,I!==h&&f.isPropagationStopped())break e;h=j,f.currentTarget=G;try{h(f)}catch(W){jl(W)}f.currentTarget=null,h=I}}}}function Ue(e,n){var a=n[Cd];a===void 0&&(a=n[Cd]=new Set);var l=e+"__bubble";a.has(l)||(f0(n,e,2,!1),a.add(l))}function vf(e,n,a){var l=0;n&&(l|=4),f0(a,e,l,n)}var fc="_reactListening"+Math.random().toString(36).slice(2);function yf(e){if(!e[fc]){e[fc]=!0,ih.forEach(function(a){a!=="selectionchange"&&(bS.has(a)||vf(a,!1,e),vf(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[fc]||(n[fc]=!0,vf("selectionchange",!1,n))}}function f0(e,n,a,l){switch(P0(n)){case 2:var f=ZS;break;case 8:f=KS;break;default:f=Mf}a=f.bind(null,n,a,e),f=void 0,!Ld||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(n,a,{capture:!0,passive:f}):e.addEventListener(n,a,!0):f!==void 0?e.addEventListener(n,a,{passive:f}):e.addEventListener(n,a,!1)}function bf(e,n,a,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 j=l.stateNode.containerInfo;if(j===f)break;if(_===4)for(_=l.return;_!==null;){var I=_.tag;if((I===3||I===4)&&_.stateNode.containerInfo===f)return;_=_.return}for(;j!==null;){if(_=Li(j),_===null)return;if(I=_.tag,I===5||I===6||I===26||I===27){l=h=_;continue e}j=j.parentNode}}l=l.return}vh(function(){var G=h,W=Od(a),te=[];e:{var Z=Gh.get(e);if(Z!==void 0){var K=Sl,ye=e;switch(e){case"keypress":if(_l(a)===0)break e;case"keydown":case"keyup":K=fk;break;case"focusin":ye="focus",K=Pd;break;case"focusout":ye="blur",K=Pd;break;case"beforeblur":case"afterblur":K=Pd;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=xh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=ek;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=hk;break;case Ph:case Hh:case Vh:K=sk;break;case qh:K=vk;break;case"scroll":case"scrollend":K=X1;break;case"wheel":K=bk;break;case"copy":case"cut":case"paste":K=ik;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=kh;break;case"toggle":case"beforetoggle":K=_k}var Ne=(n&4)!==0,ct=!Ne&&(e==="scroll"||e==="scrollend"),$=Ne?Z!==null?Z+"Capture":null:Z;Ne=[];for(var L=G,q;L!==null;){var ee=L;if(q=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||q===null||$===null||(ee=Go(L,$),ee!=null&&Ne.push(Tr(L,ee,q))),ct)break;L=L.return}0<Ne.length&&(Z=new K(Z,ye,null,a,W),te.push({event:Z,listeners:Ne}))}}if((n&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",Z&&a!==Id&&(ye=a.relatedTarget||a.fromElement)&&(Li(ye)||ye[Bi]))break e;if((K||Z)&&(Z=W.window===W?W:(Z=W.ownerDocument)?Z.defaultView||Z.parentWindow:window,K?(ye=a.relatedTarget||a.toElement,K=G,ye=ye?Li(ye):null,ye!==null&&(ct=d(ye),Ne=ye.tag,ye!==ct||Ne!==5&&Ne!==27&&Ne!==6)&&(ye=null)):(K=null,ye=G),K!==ye)){if(Ne=xh,ee="onMouseLeave",$="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=kh,ee="onPointerLeave",$="onPointerEnter",L="pointer"),ct=K==null?Z:qo(K),q=ye==null?Z:qo(ye),Z=new Ne(ee,L+"leave",K,a,W),Z.target=ct,Z.relatedTarget=q,ee=null,Li(W)===G&&(Ne=new Ne($,L+"enter",ye,a,W),Ne.target=q,Ne.relatedTarget=ct,ee=Ne),ct=ee,K&&ye)t:{for(Ne=xS,$=K,L=ye,q=0,ee=$;ee;ee=Ne(ee))q++;ee=0;for(var Te=L;Te;Te=Ne(Te))ee++;for(;0<q-ee;)$=Ne($),q--;for(;0<ee-q;)L=Ne(L),ee--;for(;q--;){if($===L||L!==null&&$===L.alternate){Ne=$;break t}$=Ne($),L=Ne(L)}Ne=null}else Ne=null;K!==null&&p0(te,Z,K,Ne,!1),ye!==null&&ct!==null&&p0(te,ct,ye,Ne,!0)}}e:{if(Z=G?qo(G):window,K=Z.nodeName&&Z.nodeName.toLowerCase(),K==="select"||K==="input"&&Z.type==="file")var Xe=Ah;else if(Ch(Z))if(Dh)Xe=Dk;else{Xe=Ek;var be=Ck}else K=Z.nodeName,!K||K.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?G&&Md(G.elementType)&&(Xe=Ah):Xe=Ak;if(Xe&&(Xe=Xe(e,G))){Eh(te,Xe,a,W);break e}be&&be(e,Z,G),e==="focusout"&&G&&Z.type==="number"&&G.memoizedProps.value!=null&&Rd(Z,"number",Z.value)}switch(be=G?qo(G):window,e){case"focusin":(Ch(be)||be.contentEditable==="true")&&(Fi=be,Zd=G,Qo=null);break;case"focusout":Qo=Zd=Fi=null;break;case"mousedown":Kd=!0;break;case"contextmenu":case"mouseup":case"dragend":Kd=!1,$h(te,a,W);break;case"selectionchange":if(Mk)break;case"keydown":case"keyup":$h(te,a,W)}var Be;if(Vd)e:{switch(e){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Gi?jh(e,a)&&(Ve="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ve="onCompositionStart");Ve&&(Sh&&a.locale!=="ko"&&(Gi||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Gi&&(Be=yh()):(la=W,zd="value"in la?la.value:la.textContent,Gi=!0)),be=pc(G,Ve),0<be.length&&(Ve=new _h(Ve,e,null,a,W),te.push({event:Ve,listeners:be}),Be?Ve.data=Be:(Be=Nh(a),Be!==null&&(Ve.data=Be)))),(Be=Sk?Tk(e,a):wk(e,a))&&(Ve=pc(G,"onBeforeInput"),0<Ve.length&&(be=new _h("onBeforeInput","beforeinput",null,a,W),te.push({event:be,listeners:Ve}),be.data=Be)),gS(te,e,G,a,W)}u0(te,n)})}function Tr(e,n,a){return{instance:e,listener:n,currentTarget:a}}function pc(e,n){for(var a=n+"Capture",l=[];e!==null;){var f=e,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Go(e,a),f!=null&&l.unshift(Tr(e,f,h)),f=Go(e,n),f!=null&&l.push(Tr(e,f,h))),e.tag===3)return l;e=e.return}return[]}function xS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function p0(e,n,a,l,f){for(var h=n._reactName,_=[];a!==null&&a!==l;){var j=a,I=j.alternate,G=j.stateNode;if(j=j.tag,I!==null&&I===l)break;j!==5&&j!==26&&j!==27||G===null||(I=G,f?(G=Go(a,h),G!=null&&_.unshift(Tr(a,G,I))):f||(G=Go(a,h),G!=null&&_.push(Tr(a,G,I)))),a=a.return}_.length!==0&&e.push({event:n,listeners:_})}var _S=/\r\n?/g,kS=/\u0000|\uFFFD/g;function m0(e){return(typeof e=="string"?e:""+e).replace(_S,`
|
|
26
|
-
`).replace(kS,"")}function h0(e,n){return n=m0(n),m0(e)===n}function lt(e,n,a,l,f,h){switch(a){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||Hi(e,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&Hi(e,""+l);break;case"className":vl(e,"class",l);break;case"tabIndex":vl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":vl(e,a,l);break;case"style":hh(e,l,h);break;case"data":if(n!=="object"){vl(e,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=bl(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"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"&&(a==="formAction"?(n!=="input"&<(e,n,"name",f.name,f,null),lt(e,n,"formEncType",f.formEncType,f,null),lt(e,n,"formMethod",f.formMethod,f,null),lt(e,n,"formTarget",f.formTarget,f,null)):(lt(e,n,"encType",f.encType,f,null),lt(e,n,"method",f.method,f,null),lt(e,n,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=bl(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=As);break;case"onScroll":l!=null&&Ue("scroll",e);break;case"onScrollEnd":l!=null&&Ue("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(a=l.__html,a!=null){if(f.children!=null)throw Error(r(60));e.innerHTML=a}}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}a=bl(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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(a,""+l):e.removeAttribute(a);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(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":Ue("beforetoggle",e),Ue("toggle",e),gl(e,"popover",l);break;case"xlinkActuate":Es(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Es(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Es(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Es(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Es(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Es(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Es(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Es(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Es(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":gl(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=J1.get(a)||a,gl(e,a,l))}}function xf(e,n,a,l,f,h){switch(a){case"style":hh(e,l,h);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(a=l.__html,a!=null){if(f.children!=null)throw Error(r(60));e.innerHTML=a}}break;case"children":typeof l=="string"?Hi(e,l):(typeof l=="number"||typeof l=="bigint")&&Hi(e,""+l);break;case"onScroll":l!=null&&Ue("scroll",e);break;case"onScrollEnd":l!=null&&Ue("scrollend",e);break;case"onClick":l!=null&&(e.onclick=As);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!oh.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),n=a.slice(2,f?a.length-7:void 0),h=e[Wt]||null,h=h!=null?h[a]:null,typeof h=="function"&&e.removeEventListener(n,h,f),typeof l=="function")){typeof h!="function"&&h!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(n,l,f);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):gl(e,a,l)}}}function on(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",e),Ue("load",e);var l=!1,f=!1,h;for(h in a)if(a.hasOwnProperty(h)){var _=a[h];if(_!=null)switch(h){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:lt(e,n,h,_,a,null)}}f&<(e,n,"srcSet",a.srcSet,a,null),l&<(e,n,"src",a.src,a,null);return;case"input":Ue("invalid",e);var j=h=_=f=null,I=null,G=null;for(l in a)if(a.hasOwnProperty(l)){var W=a[l];if(W!=null)switch(l){case"name":f=W;break;case"type":_=W;break;case"checked":I=W;break;case"defaultChecked":G=W;break;case"value":h=W;break;case"defaultValue":j=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,n));break;default:lt(e,n,l,W,a,null)}}uh(e,h,j,I,G,_,f,!1);return;case"select":Ue("invalid",e),l=_=h=null;for(f in a)if(a.hasOwnProperty(f)&&(j=a[f],j!=null))switch(f){case"value":h=j;break;case"defaultValue":_=j;break;case"multiple":l=j;default:lt(e,n,f,j,a,null)}n=h,a=_,e.multiple=!!l,n!=null?Pi(e,!!l,n,!1):a!=null&&Pi(e,!!l,a,!0);return;case"textarea":Ue("invalid",e),h=f=l=null;for(_ in a)if(a.hasOwnProperty(_)&&(j=a[_],j!=null))switch(_){case"value":l=j;break;case"defaultValue":f=j;break;case"children":h=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(r(91));break;default:lt(e,n,_,j,a,null)}ph(e,l,f,h);return;case"option":for(I in a)if(a.hasOwnProperty(I)&&(l=a[I],l!=null))switch(I){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:lt(e,n,I,l,a,null)}return;case"dialog":Ue("beforetoggle",e),Ue("toggle",e),Ue("cancel",e),Ue("close",e);break;case"iframe":case"object":Ue("load",e);break;case"video":case"audio":for(l=0;l<Sr.length;l++)Ue(Sr[l],e);break;case"image":Ue("error",e),Ue("load",e);break;case"details":Ue("toggle",e);break;case"embed":case"source":case"link":Ue("error",e),Ue("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(G in a)if(a.hasOwnProperty(G)&&(l=a[G],l!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:lt(e,n,G,l,a,null)}return;default:if(Md(n)){for(W in a)a.hasOwnProperty(W)&&(l=a[W],l!==void 0&&xf(e,n,W,l,a,void 0));return}}for(j in a)a.hasOwnProperty(j)&&(l=a[j],l!=null&<(e,n,j,l,a,null))}function SS(e,n,a,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,j=null,I=null,G=null,W=null;for(K in a){var te=a[K];if(a.hasOwnProperty(K)&&te!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":I=te;default:l.hasOwnProperty(K)||lt(e,n,K,null,l,te)}}for(var Z in l){var K=l[Z];if(te=a[Z],l.hasOwnProperty(Z)&&(K!=null||te!=null))switch(Z){case"type":h=K;break;case"name":f=K;break;case"checked":G=K;break;case"defaultChecked":W=K;break;case"value":_=K;break;case"defaultValue":j=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,n));break;default:K!==te&<(e,n,Z,K,l,te)}}Dd(e,_,j,I,G,W,h,f);return;case"select":K=_=j=Z=null;for(h in a)if(I=a[h],a.hasOwnProperty(h)&&I!=null)switch(h){case"value":break;case"multiple":K=I;default:l.hasOwnProperty(h)||lt(e,n,h,null,l,I)}for(f in l)if(h=l[f],I=a[f],l.hasOwnProperty(f)&&(h!=null||I!=null))switch(f){case"value":Z=h;break;case"defaultValue":j=h;break;case"multiple":_=h;default:h!==I&<(e,n,f,h,l,I)}n=j,a=_,l=K,Z!=null?Pi(e,!!a,Z,!1):!!l!=!!a&&(n!=null?Pi(e,!!a,n,!0):Pi(e,!!a,a?[]:"",!1));return;case"textarea":K=Z=null;for(j in a)if(f=a[j],a.hasOwnProperty(j)&&f!=null&&!l.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:lt(e,n,j,null,l,f)}for(_ in l)if(f=l[_],h=a[_],l.hasOwnProperty(_)&&(f!=null||h!=null))switch(_){case"value":Z=f;break;case"defaultValue":K=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&<(e,n,_,f,l,h)}fh(e,Z,K);return;case"option":for(var ye in a)if(Z=a[ye],a.hasOwnProperty(ye)&&Z!=null&&!l.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:lt(e,n,ye,null,l,Z)}for(I in l)if(Z=l[I],K=a[I],l.hasOwnProperty(I)&&Z!==K&&(Z!=null||K!=null))switch(I){case"selected":e.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:lt(e,n,I,Z,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 Ne in a)Z=a[Ne],a.hasOwnProperty(Ne)&&Z!=null&&!l.hasOwnProperty(Ne)&<(e,n,Ne,null,l,Z);for(G in l)if(Z=l[G],K=a[G],l.hasOwnProperty(G)&&Z!==K&&(Z!=null||K!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,n));break;default:lt(e,n,G,Z,l,K)}return;default:if(Md(n)){for(var ct in a)Z=a[ct],a.hasOwnProperty(ct)&&Z!==void 0&&!l.hasOwnProperty(ct)&&xf(e,n,ct,void 0,l,Z);for(W in l)Z=l[W],K=a[W],!l.hasOwnProperty(W)||Z===K||Z===void 0&&K===void 0||xf(e,n,W,Z,l,K);return}}for(var $ in a)Z=a[$],a.hasOwnProperty($)&&Z!=null&&!l.hasOwnProperty($)&<(e,n,$,null,l,Z);for(te in l)Z=l[te],K=a[te],!l.hasOwnProperty(te)||Z===K||Z==null&&K==null||lt(e,n,te,Z,l,K)}function g0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var f=a[l],h=f.transferSize,_=f.initiatorType,j=f.duration;if(h&&j&&g0(_)){for(_=0,j=f.responseEnd,l+=1;l<a.length;l++){var I=a[l],G=I.startTime;if(G>j)break;var W=I.transferSize,te=I.initiatorType;W&&g0(te)&&(I=I.responseEnd,_+=W*(I<j?1:(j-G)/(I-G)))}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 _f=null,kf=null;function mc(e){return e.nodeType===9?e:e.ownerDocument}function v0(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 y0(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 Sf(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 Tf=null;function wS(){var e=window.event;return e&&e.type==="popstate"?e===Tf?!1:(Tf=e,!0):(Tf=null,!1)}var b0=typeof setTimeout=="function"?setTimeout:void 0,jS=typeof clearTimeout=="function"?clearTimeout:void 0,x0=typeof Promise=="function"?Promise:void 0,NS=typeof queueMicrotask=="function"?queueMicrotask:typeof x0<"u"?function(e){return x0.resolve(null).then(e).catch(CS)}:b0;function CS(e){setTimeout(function(){throw e})}function wa(e){return e==="head"}function _0(e,n){var a=n,l=0;do{var f=a.nextSibling;if(e.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(f),xo(n);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")wr(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,wr(a);for(var h=a.firstChild;h;){var _=h.nextSibling,j=h.nodeName;h[Vo]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&h.rel.toLowerCase()==="stylesheet"||a.removeChild(h),h=_}}else a==="body"&&wr(e.ownerDocument.body);a=f}while(a);xo(n)}function k0(e,n){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function wf(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":wf(a),Ed(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function ES(e,n,a,l){for(;e.nodeType===1;){var f=a;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Vo])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=Fn(e.nextSibling),e===null)break}return null}function AS(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Fn(e.nextSibling),e===null))return null;return e}function S0(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Fn(e.nextSibling),e===null))return null;return e}function jf(e){return e.data==="$?"||e.data==="$~"}function Nf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function DS(e,n){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||a.readyState!=="loading")n();else{var l=function(){n(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Fn(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 Cf=null;function T0(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return Fn(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function w0(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return e;n--}else a!=="/$"&&a!=="/&"||n++}e=e.previousSibling}return null}function j0(e,n,a){switch(n=mc(a),e){case"html":if(e=n.documentElement,!e)throw Error(r(452));return e;case"head":if(e=n.head,!e)throw Error(r(453));return e;case"body":if(e=n.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function wr(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Ed(e)}var Zn=new Map,N0=new Set;function hc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Fs=F.d;F.d={f:RS,r:MS,D:IS,C:OS,L:BS,m:LS,X:$S,S:zS,M:US};function RS(){var e=Fs.f(),n=oc();return e||n}function MS(e){var n=zi(e);n!==null&&n.tag===5&&n.type==="form"?qg(n):Fs.r(e)}var vo=typeof document>"u"?null:document;function C0(e,n,a){var l=vo;if(l&&typeof n=="string"&&n){var f=$n(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),N0.has(f)||(N0.add(f),e={rel:e,crossOrigin:a,href:n},l.querySelector(f)===null&&(n=l.createElement("link"),on(n,"link",e),Xt(n),l.head.appendChild(n)))}}function IS(e){Fs.D(e),C0("dns-prefetch",e,null)}function OS(e,n){Fs.C(e,n),C0("preconnect",e,n)}function BS(e,n,a){Fs.L(e,n,a);var l=vo;if(l&&e&&n){var f='link[rel="preload"][as="'+$n(n)+'"]';n==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+$n(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+$n(a.imageSizes)+'"]')):f+='[href="'+$n(e)+'"]';var h=f;switch(n){case"style":h=yo(e);break;case"script":h=bo(e)}Zn.has(h)||(e=b({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),Zn.set(h,e),l.querySelector(f)!==null||n==="style"&&l.querySelector(jr(h))||n==="script"&&l.querySelector(Nr(h))||(n=l.createElement("link"),on(n,"link",e),Xt(n),l.head.appendChild(n)))}}function LS(e,n){Fs.m(e,n);var a=vo;if(a&&e){var l=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+$n(l)+'"][href="'+$n(e)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=bo(e)}if(!Zn.has(h)&&(e=b({rel:"modulepreload",href:e},n),Zn.set(h,e),a.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Nr(h)))return}l=a.createElement("link"),on(l,"link",e),Xt(l),a.head.appendChild(l)}}}function zS(e,n,a){Fs.S(e,n,a);var l=vo;if(l&&e){var f=$i(l).hoistableStyles,h=yo(e);n=n||"default";var _=f.get(h);if(!_){var j={loading:0,preload:null};if(_=l.querySelector(jr(h)))j.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":n},a),(a=Zn.get(h))&&Ef(e,a);var I=_=l.createElement("link");Xt(I),on(I,"link",e),I._p=new Promise(function(G,W){I.onload=G,I.onerror=W}),I.addEventListener("load",function(){j.loading|=1}),I.addEventListener("error",function(){j.loading|=2}),j.loading|=4,gc(_,n,l)}_={type:"stylesheet",instance:_,count:1,state:j},f.set(h,_)}}}function $S(e,n){Fs.X(e,n);var a=vo;if(a&&e){var l=$i(a).hoistableScripts,f=bo(e),h=l.get(f);h||(h=a.querySelector(Nr(f)),h||(e=b({src:e,async:!0},n),(n=Zn.get(f))&&Af(e,n),h=a.createElement("script"),Xt(h),on(h,"link",e),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function US(e,n){Fs.M(e,n);var a=vo;if(a&&e){var l=$i(a).hoistableScripts,f=bo(e),h=l.get(f);h||(h=a.querySelector(Nr(f)),h||(e=b({src:e,async:!0,type:"module"},n),(n=Zn.get(f))&&Af(e,n),h=a.createElement("script"),Xt(h),on(h,"link",e),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function E0(e,n,a,l){var f=(f=xe.current)?hc(f):null;if(!f)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=yo(a.href),a=$i(f).hoistableStyles,l=a.get(n),l||(l={type:"style",instance:null,count:0,state:null},a.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=yo(a.href);var h=$i(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(jr(e)))&&!h._p&&(_.instance=h,_.state.loading=5),Zn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Zn.set(e,a),h||PS(f,e,a,_.state))),n&&l===null)throw Error(r(528,""));return _}if(n&&l!==null)throw Error(r(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=bo(a),a=$i(f).hoistableScripts,l=a.get(n),l||(l={type:"script",instance:null,count:0,state:null},a.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function yo(e){return'href="'+$n(e)+'"'}function jr(e){return'link[rel="stylesheet"]['+e+"]"}function A0(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function PS(e,n,a,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}),on(n,"link",a),Xt(n),e.head.appendChild(n))}function bo(e){return'[src="'+$n(e)+'"]'}function Nr(e){return"script[async]"+e}function D0(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+$n(a.href)+'"]');if(l)return n.instance=l,Xt(l),l;var f=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Xt(l),on(l,"style",f),gc(l,a.precedence,e),n.instance=l;case"stylesheet":f=yo(a.href);var h=e.querySelector(jr(f));if(h)return n.state.loading|=4,n.instance=h,Xt(h),h;l=A0(a),(f=Zn.get(f))&&Ef(l,f),h=(e.ownerDocument||e).createElement("link"),Xt(h);var _=h;return _._p=new Promise(function(j,I){_.onload=j,_.onerror=I}),on(h,"link",l),n.state.loading|=4,gc(h,a.precedence,e),n.instance=h;case"script":return h=bo(a.src),(f=e.querySelector(Nr(h)))?(n.instance=f,Xt(f),f):(l=a,(f=Zn.get(h))&&(l=b({},a),Af(l,f)),e=e.ownerDocument||e,f=e.createElement("script"),Xt(f),on(f,"link",l),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,gc(l,a.precedence,e));return n.instance}function gc(e,n,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,_=0;_<l.length;_++){var j=l[_];if(j.dataset.precedence===n)h=j;else if(h!==f)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(e,n.firstChild))}function Ef(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Af(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var vc=null;function R0(e,n,a){if(vc===null){var l=new Map,f=vc=new Map;f.set(a,l)}else f=vc,l=f.get(a),l||(l=new Map,f.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),f=0;f<a.length;f++){var h=a[f];if(!(h[Vo]||h[ht]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(n)||"";_=e+_;var j=l.get(_);j?j.push(h):l.set(_,[h])}}return l}function M0(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function HS(e,n,a){if(a===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 I0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function VS(e,n,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=yo(l.href),h=n.querySelector(jr(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=yc.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=h,Xt(h);return}h=n.ownerDocument||n,l=A0(l),(f=Zn.get(f))&&Ef(l,f),h=h.createElement("link"),Xt(h);var _=h;_._p=new Promise(function(j,I){_.onload=j,_.onerror=I}),on(h,"link",l),a.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=yc.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var Df=0;function qS(e,n){return e.stylesheets&&e.count===0&&xc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&xc(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Df===0&&(Df=62500*TS());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&xc(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Df?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function yc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var bc=null;function xc(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bc=new Map,n.forEach(GS,e),bc=null,yc.call(e))}function GS(e,n){if(!(n.state.loading&4)){var a=bc.get(e);if(a)var l=a.get(null);else{a=new Map,bc.set(e,a);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")&&(a.set(_.dataset.precedence,_),l=_)}l&&a.set(null,l)}f=n.instance,_=f.getAttribute("data-precedence"),h=a.get(_)||l,h===l&&a.set(null,f),a.set(_,f),this.count++,l=yc.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 Cr={$$typeof:R,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function FS(e,n,a,l,f,h,_,j,I){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=ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ge(0),this.hiddenUpdates=ge(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function O0(e,n,a,l,f,h,_,j,I,G,W,te){return e=new FS(e,n,a,_,I,G,W,te,j),n=1,h===!0&&(n|=24),h=jn(3,null,null,n),e.current=h,h.stateNode=e,n=cu(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:l,isDehydrated:a,cache:n},pu(h),e}function B0(e){return e?(e=Yi,e):Yi}function L0(e,n,a,l,f,h){f=B0(f),l.context===null?l.context=f:l.pendingContext=f,l=ma(n),l.payload={element:a},h=h===void 0?null:h,h!==null&&(l.callback=h),a=ha(e,l,n),a!==null&&(Sn(a,e,n),or(a,e,n))}function z0(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function Rf(e,n){z0(e,n),(e=e.alternate)&&z0(e,n)}function $0(e){if(e.tag===13||e.tag===31){var n=ni(e,67108864);n!==null&&Sn(n,e,67108864),Rf(e,67108864)}}function U0(e){if(e.tag===13||e.tag===31){var n=Dn();n=We(n);var a=ni(e,n);a!==null&&Sn(a,e,n),Rf(e,n)}}var _c=!0;function ZS(e,n,a,l){var f=E.T;E.T=null;var h=F.p;try{F.p=2,Mf(e,n,a,l)}finally{F.p=h,E.T=f}}function KS(e,n,a,l){var f=E.T;E.T=null;var h=F.p;try{F.p=8,Mf(e,n,a,l)}finally{F.p=h,E.T=f}}function Mf(e,n,a,l){if(_c){var f=If(l);if(f===null)bf(e,n,l,kc,a),H0(e,l);else if(JS(f,e,n,a,l))l.stopPropagation();else if(H0(e,l),n&4&&-1<YS.indexOf(e)){for(;f!==null;){var h=zi(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=Cs(h.pendingLanes);if(_!==0){var j=h;for(j.pendingLanes|=2,j.entangledLanes|=2;_;){var I=1<<31-Jt(_);j.entanglements[1]|=I,_&=~I}bs(h),(nt&6)===0&&(ac=Kt()+500,kr(0))}}break;case 31:case 13:j=ni(h,2),j!==null&&Sn(j,h,2),oc(),Rf(h,2)}if(h=If(l),h===null&&bf(e,n,l,kc,a),h===f)break;f=h}f!==null&&l.stopPropagation()}else bf(e,n,l,null,a)}}function If(e){return e=Od(e),Of(e)}var kc=null;function Of(e){if(kc=null,e=Li(e),e!==null){var n=d(e);if(n===null)e=null;else{var a=n.tag;if(a===13){if(e=u(n),e!==null)return e;e=null}else if(a===31){if(e=p(n),e!==null)return e;e=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return kc=e,null}function P0(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(Di()){case ra:return 2;case Ka:return 8;case ns:case Ri:return 32;case Ln:return 268435456;default:return 32}default:return 32}}var Bf=!1,ja=null,Na=null,Ca=null,Er=new Map,Ar=new Map,Ea=[],YS="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 H0(e,n){switch(e){case"focusin":case"focusout":ja=null;break;case"dragenter":case"dragleave":Na=null;break;case"mouseover":case"mouseout":Ca=null;break;case"pointerover":case"pointerout":Er.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ar.delete(n.pointerId)}}function Dr(e,n,a,l,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:a,eventSystemFlags:l,nativeEvent:h,targetContainers:[f]},n!==null&&(n=zi(n),n!==null&&$0(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function JS(e,n,a,l,f){switch(n){case"focusin":return ja=Dr(ja,e,n,a,l,f),!0;case"dragenter":return Na=Dr(Na,e,n,a,l,f),!0;case"mouseover":return Ca=Dr(Ca,e,n,a,l,f),!0;case"pointerover":var h=f.pointerId;return Er.set(h,Dr(Er.get(h)||null,e,n,a,l,f)),!0;case"gotpointercapture":return h=f.pointerId,Ar.set(h,Dr(Ar.get(h)||null,e,n,a,l,f)),!0}return!1}function V0(e){var n=Li(e.target);if(n!==null){var a=d(n);if(a!==null){if(n=a.tag,n===13){if(n=u(a),n!==null){e.blockedOn=n,Mt(e.priority,function(){U0(a)});return}}else if(n===31){if(n=p(a),n!==null){e.blockedOn=n,Mt(e.priority,function(){U0(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Sc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=If(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);Id=l,a.target.dispatchEvent(l),Id=null}else return n=zi(a),n!==null&&$0(n),e.blockedOn=a,!1;n.shift()}return!0}function q0(e,n,a){Sc(e)&&a.delete(n)}function WS(){Bf=!1,ja!==null&&Sc(ja)&&(ja=null),Na!==null&&Sc(Na)&&(Na=null),Ca!==null&&Sc(Ca)&&(Ca=null),Er.forEach(q0),Ar.forEach(q0)}function Tc(e,n){e.blockedOn===n&&(e.blockedOn=null,Bf||(Bf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,WS)))}var wc=null;function G0(e){wc!==e&&(wc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){wc===e&&(wc=null);for(var n=0;n<e.length;n+=3){var a=e[n],l=e[n+1],f=e[n+2];if(typeof l!="function"){if(Of(l||a)===null)continue;break}var h=zi(a);h!==null&&(e.splice(n,3),n-=3,Mu(h,{pending:!0,data:f,method:a.method,action:l},l,f))}}))}function xo(e){function n(I){return Tc(I,e)}ja!==null&&Tc(ja,e),Na!==null&&Tc(Na,e),Ca!==null&&Tc(Ca,e),Er.forEach(n),Ar.forEach(n);for(var a=0;a<Ea.length;a++){var l=Ea[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ea.length&&(a=Ea[0],a.blockedOn===null);)V0(a),a.blockedOn===null&&Ea.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var f=a[l],h=a[l+1],_=f[Wt]||null;if(typeof h=="function")_||G0(a);else if(_){var j=null;if(h&&h.hasAttribute("formAction")){if(f=h,_=h[Wt]||null)j=_.formAction;else if(Of(f)!==null)continue}else j=_.action;typeof j=="function"?a[l+1]=j:(a.splice(l,3),l-=3),G0(a)}}}function F0(){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(a,20)}function a(){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(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Lf(e){this._internalRoot=e}jc.prototype.render=Lf.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));var a=n.current,l=Dn();L0(a,l,e,n,null,null)},jc.prototype.unmount=Lf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;L0(e.current,2,null,e,null,null),oc(),n[Bi]=null}};function jc(e){this._internalRoot=e}jc.prototype.unstable_scheduleHydration=function(e){if(e){var n=tn();e={blockedOn:null,target:e,priority:n};for(var a=0;a<Ea.length&&n!==0&&n<Ea[a].priority;a++);Ea.splice(a,0,e),a===0&&V0(e)}};var Z0=s.version;if(Z0!=="19.2.4")throw Error(r(527,Z0,"19.2.4"));F.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=g(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var XS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nc.isDisabled&&Nc.supportsFiber)try{Yt=Nc.inject(XS),kt=Nc}catch{}}return Mr.createRoot=function(e,n){if(!c(e))throw Error(r(299));var a=!1,l="",f=ev,h=tv,_=nv;return n!=null&&(n.unstable_strictMode===!0&&(a=!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=O0(e,1,!1,null,null,a,l,null,f,h,_,F0),e[Bi]=n.current,yf(e),new Lf(n)},Mr.hydrateRoot=function(e,n,a){if(!c(e))throw Error(r(299));var l=!1,f="",h=ev,_=tv,j=nv,I=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(_=a.onCaughtError),a.onRecoverableError!==void 0&&(j=a.onRecoverableError),a.formState!==void 0&&(I=a.formState)),n=O0(e,1,!0,n,a??null,l,f,I,h,_,j,F0),n.context=B0(null),a=n.current,l=Dn(),l=We(l),f=ma(l),f.callback=null,ha(a,f,l),a=l,n.current.lanes=a,Pe(n,a),bs(n),e[Bi]=n.current,yf(e),new jc(n)},Mr.version="19.2.4",Mr}var ty;function jT(){if(ty)return zf.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(s){console.error(s)}}return t(),zf.exports=wT(),zf.exports}var NT=jT();const CT="modulepreload",ET=function(t){return"/"+t},ny={},AT=function(s,o,r){let c=Promise.resolve();if(o&&o.length>0){let u=function(g){return Promise.all(g.map(v=>Promise.resolve(v).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};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"));c=u(o.map(g=>{if(g=ET(g),g in ny)return;ny[g]=!0;const v=g.endsWith(".css"),b=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${b}`))return;const x=document.createElement("link");if(x.rel=v?"stylesheet":CT,v||(x.as="script"),x.crossOrigin="",x.href=g,m&&x.setAttribute("nonce",m),document.head.appendChild(x),v)return new Promise((S,k)=>{x.addEventListener("load",S),x.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${g}`)))})}))}function d(u){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=u,window.dispatchEvent(p),!p.defaultPrevented)throw u}return c.then(u=>{for(const p of u||[])p.status==="rejected"&&d(p.reason);return s().catch(d)})},DT=new Proxy(globalThis.fetch,{apply(t,s,o){return Reflect.apply(globalThis.fetch,s,o)}}),RT=lT({baseUrl:"/",fetch:DT}),je=cT(dT,RT),MT="_bar_1xhb4_1",IT="_input_1xhb4_32",OT="_select_1xhb4_67",BT="_btnPrimary_1xhb4_103",LT="_btnGhost_1xhb4_173",zT="_badge_1xhb4_195",$T="_disconnectHint_1xhb4_205",Rn={bar:MT,input:IT,select:OT,btnPrimary:BT,btnGhost:LT,badge:zT,disconnectHint:$T};function UT(t,s){if(!t)return!1;const o=s.find(r=>r.id===t);return o!==void 0&&(o.status==="disconnected"||o.status==="error")}function PT({environmentId:t,onReconnect:s}){return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:Rn.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),i.jsx("button",{type:"button",onClick:()=>s(t),className:Rn.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function Qr({mode:t,sessionId:s,environmentId:o,taskId:r,showPersonaSelect:c,personas:d,environments:u,onSendInput:p,onSpawn:m,onStartTask:g,onProvisionEnvironment:v,onShowToast:b}){const[x,S]=y.useState(""),[k,w]=y.useState(""),N=UT(o,u),T=C=>{if(C.preventDefault(),!!x.trim())if(t==="send"){if(!s||N)return;p(s,x),S("")}else if(t==="spawn"){if(!o)return;m(o,x,k),b==null||b("Session started","success"),S(""),w("")}else{if(!r)return;g(r,void 0,o,x),S("")}};return t==="spawn"?i.jsxs("form",{onSubmit:T,className:Rn.bar,children:[i.jsx("span",{className:Rn.badge,children:"new chat"}),i.jsx("input",{type:"text",value:x,onChange:C=>S(C.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:Rn.input,"aria-label":"Enter prompt"}),c&&i.jsxs("select",{value:k,onChange:C=>w(C.target.value),className:Rn.select,"aria-label":"Select persona",children:[i.jsx("option",{value:"",children:"(Default)"}),d.map(C=>i.jsx("option",{value:C.id,children:C.name},C.id))]}),i.jsx("button",{type:"submit",disabled:!x.trim()||!o,className:Rn.btnPrimary,children:"Go"})]}):t==="start"?i.jsxs("form",{onSubmit:T,className:Rn.bar,children:[i.jsx("input",{type:"text",value:x,onChange:C=>S(C.target.value),placeholder:"Type a message...",autoFocus:!0,className:Rn.input,"aria-label":"Type a message"}),i.jsx("button",{type:"submit",disabled:!x.trim(),className:Rn.btnPrimary,children:"Send"})]}):i.jsxs("form",{onSubmit:T,className:Rn.bar,children:[N&&o&&i.jsx(PT,{environmentId:o,onReconnect:v}),i.jsx("input",{type:"text",value:x,onChange:C=>S(C.target.value),placeholder:"Type a message...",autoFocus:!N,disabled:N,className:Rn.input,"aria-label":"Type a message"}),i.jsx("span",{title:N?"Environment is unavailable — reconnect first":void 0,children:i.jsx("button",{type:"submit",disabled:!x.trim()||N,className:Rn.btnPrimary,children:"Send"})})]})}const sy=220,ay=70,HT=40,VT=60,qT="hierarchy",GT="dependency";function FT(t){return y.useMemo(()=>{if(t.length===0)return{nodes:[],edges:[]};const s=new K0.graphlib.Graph({multigraph:!0});s.setDefaultEdgeLabel(()=>({})),s.setGraph({rankdir:"TB",nodesep:HT,ranksep:VT});const o=new Map(t.map(u=>[u.id,u])),r=new Map;for(const u of t)if(u.parentTaskId&&o.has(u.parentTaskId)){const p=r.get(u.parentTaskId)||[];p.push(u),r.set(u.parentTaskId,p)}for(const u of t)s.setNode(u.id,{width:sy,height:ay});const c=[];for(const u of t){if(u.parentTaskId&&o.has(u.parentTaskId)){const p=`hierarchy-${u.parentTaskId}-${u.id}`;s.setEdge(u.parentTaskId,u.id,{},p),c.push({id:p,source:u.parentTaskId,target:u.id,type:"smoothstep",data:{edgeType:qT},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of u.dependsOn)if(o.has(p)){const m=`dependency-${p}-${u.id}`;s.setEdge(p,u.id,{},m),c.push({id:m,source:p,target:u.id,type:"smoothstep",data:{edgeType:GT},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return K0.layout(s),{nodes:t.map(u=>{const p=s.node(u.id),m=r.get(u.id)||[];return{id:u.id,type:"task",position:{x:p.x-sy/2,y:p.y-ay/2},data:{task:u,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:u.dependsOn.length>0}}}),edges:c}},[t])}/**
|
|
27
|
-
* @license lucide-react v0.474.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const ZT=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ux=(...t)=>t.filter((s,o,r)=>!!s&&s.trim()!==""&&r.indexOf(s)===o).join(" ").trim();/**
|
|
32
|
-
* @license lucide-react v0.474.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/var KT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
37
|
-
* @license lucide-react v0.474.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const YT=y.forwardRef(({color:t="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:c="",children:d,iconNode:u,...p},m)=>y.createElement("svg",{ref:m,...KT,width:s,height:s,stroke:t,strokeWidth:r?Number(o)*24/Number(s):o,className:ux("lucide",c),...p},[...u.map(([g,v])=>y.createElement(g,v)),...Array.isArray(d)?d:[d]]));/**
|
|
42
|
-
* @license lucide-react v0.474.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const Ke=(t,s)=>{const o=y.forwardRef(({className:r,...c},d)=>y.createElement(YT,{ref:d,iconNode:s,className:ux(`lucide-${ZT(t)}`,r),...c}));return o.displayName=`${t}`,o};/**
|
|
47
|
-
* @license lucide-react v0.474.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const JT=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],iy=Ke("ArrowDown",JT);/**
|
|
52
|
-
* @license lucide-react v0.474.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const WT=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],oy=Ke("ArrowUp",WT);/**
|
|
57
|
-
* @license lucide-react v0.474.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const XT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],QT=Ke("Ban",XT);/**
|
|
62
|
-
* @license lucide-react v0.474.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const e2=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],t2=Ke("Brain",e2);/**
|
|
67
|
-
* @license lucide-react v0.474.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const n2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ni=Ke("Check",n2);/**
|
|
72
|
-
* @license lucide-react v0.474.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const s2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],fx=Ke("ChevronDown",s2);/**
|
|
77
|
-
* @license lucide-react v0.474.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const a2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],aa=Ke("ChevronRight",a2);/**
|
|
82
|
-
* @license lucide-react v0.474.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const i2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],za=Ke("Circle",i2);/**
|
|
87
|
-
* @license lucide-react v0.474.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const o2=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],r2=Ke("ClipboardList",o2);/**
|
|
92
|
-
* @license lucide-react v0.474.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const l2=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],px=Ke("Clipboard",l2);/**
|
|
97
|
-
* @license lucide-react v0.474.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const c2=[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]],d2=Ke("Cog",c2);/**
|
|
102
|
-
* @license lucide-react v0.474.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const u2=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],f2=Ke("Copy",u2);/**
|
|
107
|
-
* @license lucide-react v0.474.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const p2=[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],m2=Ke("CornerDownRight",p2);/**
|
|
112
|
-
* @license lucide-react v0.474.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const h2=[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]],g2=Ke("FilePen",h2);/**
|
|
117
|
-
* @license lucide-react v0.474.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const v2=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],y2=Ke("FileText",v2);/**
|
|
122
|
-
* @license lucide-react v0.474.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const b2=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],x2=Ke("House",b2);/**
|
|
127
|
-
* @license lucide-react v0.474.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const _2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],am=Ke("Info",_2);/**
|
|
132
|
-
* @license lucide-react v0.474.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const k2=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],S2=Ke("Key",k2);/**
|
|
137
|
-
* @license lucide-react v0.474.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const T2=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],w2=Ke("Keyboard",T2);/**
|
|
142
|
-
* @license lucide-react v0.474.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const j2=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],N2=Ke("ListChecks",j2);/**
|
|
147
|
-
* @license lucide-react v0.474.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const C2=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],E2=Ke("List",C2);/**
|
|
152
|
-
* @license lucide-react v0.474.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const A2=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],D2=Ke("Loader",A2);/**
|
|
157
|
-
* @license lucide-react v0.474.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const R2=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],M2=Ke("Menu",R2);/**
|
|
162
|
-
* @license lucide-react v0.474.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const I2=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],O2=Ke("MessageSquare",I2);/**
|
|
167
|
-
* @license lucide-react v0.474.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const B2=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],L2=Ke("Monitor",B2);/**
|
|
172
|
-
* @license lucide-react v0.474.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const z2=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],$2=Ke("Palette",z2);/**
|
|
177
|
-
* @license lucide-react v0.474.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const U2=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],P2=Ke("Pause",U2);/**
|
|
182
|
-
* @license lucide-react v0.474.0 - ISC
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the ISC license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const H2=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],V2=Ke("Pencil",H2);/**
|
|
187
|
-
* @license lucide-react v0.474.0 - ISC
|
|
188
|
-
*
|
|
189
|
-
* This source code is licensed under the ISC license.
|
|
190
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const q2=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],mx=Ke("Search",q2);/**
|
|
192
|
-
* @license lucide-react v0.474.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const G2=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],F2=Ke("Settings",G2);/**
|
|
197
|
-
* @license lucide-react v0.474.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const Z2=[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],K2=Ke("SquareCheckBig",Z2);/**
|
|
202
|
-
* @license lucide-react v0.474.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const Y2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],im=Ke("TriangleAlert",Y2);/**
|
|
207
|
-
* @license lucide-react v0.474.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const J2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],W2=Ke("User",J2);/**
|
|
212
|
-
* @license lucide-react v0.474.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const X2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Va=Ke("X",X2),om=8,ot=12,en=14,Lt=16,Ep={not_started:{color:"var(--text-tertiary)",icon:i.jsx(za,{size:ot}),label:"Not Started"},working:{color:"var(--accent-green)",icon:i.jsx(za,{size:ot,fill:"currentColor"}),label:"Working"},paused:{color:"var(--accent-yellow)",icon:i.jsx(P2,{size:ot}),label:"Paused"},complete:{color:"var(--accent-green)",icon:i.jsx(Ni,{size:ot}),label:"Complete"},failed:{color:"var(--accent-red)",icon:i.jsx(Va,{size:ot}),label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:i.jsx(QT,{size:ot}),label:"Blocked"}};function $a(t){return t==="blocked"?Ep.blocked:Ep[ll(t)]}const Q2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function ew(t){return Q2[ll(t)]??"statusPending"}const tw=["working","paused","failed","not_started","blocked","complete"],ry=["not_started","working","paused","complete","failed"],nw={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function ll(t){return t in Ep&&t!=="blocked"?t:nw[t]??"not_started"}const sw={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"},aw="_dagContainer_js4w6_1",iw="_taskNode_js4w6_26",ow="_taskNodeBorder_js4w6_54",rw="_taskNodeContent_js4w6_60",lw="_taskNodeHeader_js4w6_70",cw="_taskNodeIcon_js4w6_77",dw="_taskNodeTitle_js4w6_82",uw="_taskNodeBadges_js4w6_90",fw="_childBadge_js4w6_95",pw="_depBadge_js4w6_107",mw="_handle_js4w6_119",hw="_emptyCta_js4w6_126",gw="_ctaDescription_js4w6_137",vw="_ctaButton_js4w6_144",gn={dagContainer:aw,taskNode:iw,taskNodeBorder:ow,taskNodeContent:rw,taskNodeHeader:lw,taskNodeIcon:cw,taskNodeTitle:dw,taskNodeBadges:uw,childBadge:fw,depBadge:pw,handle:mw,emptyCta:hw,ctaDescription:gw,ctaButton:vw};function yw({data:t}){const{task:s,childCount:o,doneChildCount:r,hasDependencies:c}=t,d=$a(s.status);return i.jsxs("div",{className:gn.taskNode,"data-task-id":s.id,"data-task-title":s.title,children:[i.jsx(Y0,{type:"target",position:J0.Top,className:gn.handle}),i.jsx("div",{className:gn.taskNodeBorder,style:{backgroundColor:d.color}}),i.jsxs("div",{className:gn.taskNodeContent,children:[i.jsxs("div",{className:gn.taskNodeHeader,children:[i.jsx("span",{className:gn.taskNodeIcon,style:{color:d.color},children:d.icon}),i.jsx("span",{className:gn.taskNodeTitle,children:s.title})]}),i.jsxs("div",{className:gn.taskNodeBadges,children:[o>0&&i.jsxs("span",{className:gn.childBadge,children:[r,"/",o]}),c&&i.jsx("span",{className:gn.depBadge,children:"dep"})]})]}),i.jsx(Y0,{type:"source",position:J0.Bottom,className:gn.handle})]})}/**
|
|
217
|
-
* react-router v7.13.2
|
|
218
|
-
*
|
|
219
|
-
* Copyright (c) Remix Software Inc.
|
|
220
|
-
*
|
|
221
|
-
* This source code is licensed under the MIT license found in the
|
|
222
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
223
|
-
*
|
|
224
|
-
* @license MIT
|
|
225
|
-
*/var ly="popstate";function cy(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function bw(t={}){function s(r,c){var g;let d=(g=c.state)==null?void 0:g.masked,{pathname:u,search:p,hash:m}=d||r.location;return Ap("",{pathname:u,search:p,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default",d?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function o(r,c){return typeof c=="string"?c:el(c)}return _w(s,o,null,t)}function bt(t,s){if(t===!1||t===null||typeof t>"u")throw new Error(s)}function Xn(t,s){if(!t){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function xw(){return Math.random().toString(36).substring(2,10)}function dy(t,s){return{usr:t.state,key:t.key,idx:s,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function Ap(t,s,o=null,r,c){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof s=="string"?zo(s):s,state:o,key:s&&s.key||r||xw(),unstable_mask:c}}function el({pathname:t="/",search:s="",hash:o=""}){return s&&s!=="?"&&(t+=s.charAt(0)==="?"?s:"?"+s),o&&o!=="#"&&(t+=o.charAt(0)==="#"?o:"#"+o),t}function zo(t){let s={};if(t){let o=t.indexOf("#");o>=0&&(s.hash=t.substring(o),t=t.substring(0,o));let r=t.indexOf("?");r>=0&&(s.search=t.substring(r),t=t.substring(0,r)),t&&(s.pathname=t)}return s}function _w(t,s,o,r={}){let{window:c=document.defaultView,v5Compat:d=!1}=r,u=c.history,p="POP",m=null,g=v();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function v(){return(u.state||{idx:null}).idx}function b(){p="POP";let N=v(),T=N==null?null:N-g;g=N,m&&m({action:p,location:w.location,delta:T})}function x(N,T){p="PUSH";let C=cy(N)?N:Ap(w.location,N,T);g=v()+1;let R=dy(C,g),B=w.createHref(C.unstable_mask||C);try{u.pushState(R,"",B)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;c.location.assign(B)}d&&m&&m({action:p,location:w.location,delta:1})}function S(N,T){p="REPLACE";let C=cy(N)?N:Ap(w.location,N,T);g=v();let R=dy(C,g),B=w.createHref(C.unstable_mask||C);u.replaceState(R,"",B),d&&m&&m({action:p,location:w.location,delta:0})}function k(N){return kw(N)}let w={get action(){return p},get location(){return t(c,u)},listen(N){if(m)throw new Error("A history only accepts one active listener");return c.addEventListener(ly,b),m=N,()=>{c.removeEventListener(ly,b),m=null}},createHref(N){return s(c,N)},createURL:k,encodeLocation(N){let T=k(N);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:x,replace:S,go(N){return u.go(N)}};return w}function kw(t,s=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),bt(o,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:el(t);return r=r.replace(/ $/,"%20"),!s&&r.startsWith("//")&&(r=o+r),new URL(r,o)}function hx(t,s,o="/"){return Sw(t,s,o,!1)}function Sw(t,s,o,r){let c=typeof s=="string"?zo(s):s,d=ta(c.pathname||"/",o);if(d==null)return null;let u=gx(t);Tw(u);let p=null;for(let m=0;p==null&&m<u.length;++m){let g=yx(d);p=Mw(u[m],g,r)}return p}function gx(t,s=[],o=[],r="",c=!1){let d=(u,p,m=c,g)=>{let v={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:p,route:u};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(r)&&m)return;bt(v.relativePath.startsWith(r),`Absolute route path "${v.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(r.length)}let b=Ts([r,v.relativePath]),x=o.concat(v);u.children&&u.children.length>0&&(bt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),gx(u.children,s,x,b,m)),!(u.path==null&&!u.index)&&s.push({path:b,score:Dw(b,u.index),routesMeta:x})};return t.forEach((u,p)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))d(u,p);else for(let g of vx(u.path))d(u,p,!0,g)}),s}function vx(t){let s=t.split("/");if(s.length===0)return[];let[o,...r]=s,c=o.endsWith("?"),d=o.replace(/\?$/,"");if(r.length===0)return c?[d,""]:[d];let u=vx(r.join("/")),p=[];return p.push(...u.map(m=>m===""?d:[d,m].join("/"))),c&&p.push(...u),p.map(m=>t.startsWith("/")&&m===""?"/":m)}function Tw(t){t.sort((s,o)=>s.score!==o.score?o.score-s.score:Rw(s.routesMeta.map(r=>r.childrenIndex),o.routesMeta.map(r=>r.childrenIndex)))}var ww=/^:[\w-]+$/,jw=3,Nw=2,Cw=1,Ew=10,Aw=-2,uy=t=>t==="*";function Dw(t,s){let o=t.split("/"),r=o.length;return o.some(uy)&&(r+=Aw),s&&(r+=Nw),o.filter(c=>!uy(c)).reduce((c,d)=>c+(ww.test(d)?jw:d===""?Cw:Ew),r)}function Rw(t,s){return t.length===s.length&&t.slice(0,-1).every((r,c)=>r===s[c])?t[t.length-1]-s[s.length-1]:0}function Mw(t,s,o=!1){let{routesMeta:r}=t,c={},d="/",u=[];for(let p=0;p<r.length;++p){let m=r[p],g=p===r.length-1,v=d==="/"?s:s.slice(d.length)||"/",b=tl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},v),x=m.route;if(!b&&g&&o&&!r[r.length-1].route.index&&(b=tl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!b)return null;Object.assign(c,b.params),u.push({params:c,pathname:Ts([d,b.pathname]),pathnameBase:zw(Ts([d,b.pathnameBase])),route:x}),b.pathnameBase!=="/"&&(d=Ts([d,b.pathnameBase]))}return u}function tl(t,s){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[o,r]=Iw(t.path,t.caseSensitive,t.end),c=s.match(o);if(!c)return null;let d=c[0],u=d.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:r.reduce((g,{paramName:v,isOptional:b},x)=>{if(v==="*"){let k=p[x]||"";u=d.slice(0,d.length-k.length).replace(/(.)\/+$/,"$1")}const S=p[x];return b&&!S?g[v]=void 0:g[v]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:u,pattern:t}}function Iw(t,s=!1,o=!0){Xn(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 r=[],c="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,p,m,g,v)=>{if(r.push({paramName:p,isOptional:m!=null}),m){let b=v.charAt(g+u.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),c+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?c+="\\/*$":t!==""&&t!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,s?void 0:"i"),r]}function yx(t){try{return t.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return Xn(!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 (${s}).`),t}}function ta(t,s){if(s==="/")return t;if(!t.toLowerCase().startsWith(s.toLowerCase()))return null;let o=s.endsWith("/")?s.length-1:s.length,r=t.charAt(o);return r&&r!=="/"?null:t.slice(o)||"/"}var Ow=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Bw(t,s="/"){let{pathname:o,search:r="",hash:c=""}=typeof t=="string"?zo(t):t,d;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?d=fy(o.substring(1),"/"):d=fy(o,s)):d=s,{pathname:d,search:$w(r),hash:Uw(c)}}function fy(t,s){let o=s.replace(/\/+$/,"").split("/");return t.split("/").forEach(c=>{c===".."?o.length>1&&o.pop():c!=="."&&o.push(c)}),o.length>1?o.join("/"):"/"}function Pf(t,s,o,r){return`Cannot include a '${t}' character in a manually specified \`to.${s}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Lw(t){return t.filter((s,o)=>o===0||s.route.path&&s.route.path.length>0)}function rm(t){let s=Lw(t);return s.map((o,r)=>r===s.length-1?o.pathname:o.pathnameBase)}function gd(t,s,o,r=!1){let c;typeof t=="string"?c=zo(t):(c={...t},bt(!c.pathname||!c.pathname.includes("?"),Pf("?","pathname","search",c)),bt(!c.pathname||!c.pathname.includes("#"),Pf("#","pathname","hash",c)),bt(!c.search||!c.search.includes("#"),Pf("#","search","hash",c)));let d=t===""||c.pathname==="",u=d?"/":c.pathname,p;if(u==null)p=o;else{let b=s.length-1;if(!r&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),b-=1;c.pathname=x.join("/")}p=b>=0?s[b]:"/"}let m=Bw(c,p),g=u&&u!=="/"&&u.endsWith("/"),v=(d||u===".")&&o.endsWith("/");return!m.pathname.endsWith("/")&&(g||v)&&(m.pathname+="/"),m}var Ts=t=>t.join("/").replace(/\/\/+/g,"/"),zw=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),$w=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Uw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Pw=class{constructor(t,s,o,r=!1){this.status=t,this.statusText=s||"",this.internal=r,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function Hw(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Vw(t){return t.map(s=>s.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var bx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xx(t,s){let o=t;if(typeof o!="string"||!Ow.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let r=o,c=!1;if(bx)try{let d=new URL(window.location.href),u=o.startsWith("//")?new URL(d.protocol+o):new URL(o),p=ta(u.pathname,s);u.origin===d.origin&&p!=null?o=p+u.search+u.hash:c=!0}catch{Xn(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:c,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _x=["POST","PUT","PATCH","DELETE"];new Set(_x);var qw=["GET",..._x];new Set(qw);var $o=y.createContext(null);$o.displayName="DataRouter";var vd=y.createContext(null);vd.displayName="DataRouterState";var Gw=y.createContext(!1),kx=y.createContext({isTransitioning:!1});kx.displayName="ViewTransition";var Fw=y.createContext(new Map);Fw.displayName="Fetchers";var Zw=y.createContext(null);Zw.displayName="Await";var Bn=y.createContext(null);Bn.displayName="Navigation";var cl=y.createContext(null);cl.displayName="Location";var Qn=y.createContext({outlet:null,matches:[],isDataRoute:!1});Qn.displayName="Route";var lm=y.createContext(null);lm.displayName="RouteError";var Sx="REACT_ROUTER_ERROR",Kw="REDIRECT",Yw="ROUTE_ERROR_RESPONSE";function Jw(t){if(t.startsWith(`${Sx}:${Kw}:{`))try{let s=JSON.parse(t.slice(28));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.location=="string"&&typeof s.reloadDocument=="boolean"&&typeof s.replace=="boolean")return s}catch{}}function Ww(t){if(t.startsWith(`${Sx}:${Yw}:{`))try{let s=JSON.parse(t.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new Pw(s.status,s.statusText,s.data)}catch{}}function Xw(t,{relative:s}={}){bt(Ci(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:r}=y.useContext(Bn),{hash:c,pathname:d,search:u}=dl(t,{relative:s}),p=d;return o!=="/"&&(p=d==="/"?o:Ts([o,d])),r.createHref({pathname:p,search:u,hash:c})}function Ci(){return y.useContext(cl)!=null}function Zt(){return bt(Ci(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(cl).location}function At(t){bt(Ci(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:s}=Zt();return y.useMemo(()=>tl(t,yx(s)),[s,t])}var Tx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wx(t){y.useContext(Bn).static||y.useLayoutEffect(t)}function yd(){let{isDataRoute:t}=y.useContext(Qn);return t?pj():Qw()}function Qw(){bt(Ci(),"useNavigate() may be used only in the context of a <Router> component.");let t=y.useContext($o),{basename:s,navigator:o}=y.useContext(Bn),{matches:r}=y.useContext(Qn),{pathname:c}=Zt(),d=JSON.stringify(rm(r)),u=y.useRef(!1);return wx(()=>{u.current=!0}),y.useCallback((m,g={})=>{if(Xn(u.current,Tx),!u.current)return;if(typeof m=="number"){o.go(m);return}let v=gd(m,JSON.parse(d),c,g.relative==="path");t==null&&s!=="/"&&(v.pathname=v.pathname==="/"?s:Ts([s,v.pathname])),(g.replace?o.replace:o.push)(v,g.state,g)},[s,o,d,c,t])}var ej=y.createContext(null);function tj(t){let s=y.useContext(Qn).outlet;return y.useMemo(()=>s&&y.createElement(ej.Provider,{value:t},s),[s,t])}function ms(){let{matches:t}=y.useContext(Qn),s=t[t.length-1];return s?s.params:{}}function dl(t,{relative:s}={}){let{matches:o}=y.useContext(Qn),{pathname:r}=Zt(),c=JSON.stringify(rm(o));return y.useMemo(()=>gd(t,JSON.parse(c),r,s==="path"),[t,c,r,s])}function nj(t,s){return jx(t,s)}function jx(t,s,o){var N;bt(Ci(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=y.useContext(Bn),{matches:c}=y.useContext(Qn),d=c[c.length-1],u=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",g=d&&d.route;{let T=g&&g.path||"";Cx(p,!g||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${T}">) 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.
|
|
226
|
-
|
|
227
|
-
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let v=Zt(),b;if(s){let T=typeof s=="string"?zo(s):s;bt(m==="/"||((N=T.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 "${T.pathname}" was given in the \`location\` prop.`),b=T}else b=v;let x=b.pathname||"/",S=x;if(m!=="/"){let T=m.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(T.length).join("/")}let k=hx(t,{pathname:S});Xn(g||k!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Xn(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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 w=rj(k&&k.map(T=>Object.assign({},T,{params:Object.assign({},u,T.params),pathname:Ts([m,r.encodeLocation?r.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?m:Ts([m,r.encodeLocation?r.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,o);return s&&w?y.createElement(cl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},w):w}function sj(){let t=fj(),s=Hw(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),o=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:r},d={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",t),u=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:d},"ErrorBoundary")," or"," ",y.createElement("code",{style:d},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},s),o?y.createElement("pre",{style:c},o):null,u)}var aj=y.createElement(sj,null),Nx=class extends y.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,s){return s.location!==t.location||s.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:s.error,location:s.location,revalidation:t.revalidation||s.revalidation}}componentDidCatch(t,s){this.props.onError?this.props.onError(t,s):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 o=Ww(t.digest);o&&(t=o)}let s=t!==void 0?y.createElement(Qn.Provider,{value:this.props.routeContext},y.createElement(lm.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?y.createElement(ij,{error:t},s):s}};Nx.contextType=Gw;var Hf=new WeakMap;function ij({children:t,error:s}){let{basename:o}=y.useContext(Bn);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let r=Jw(s.digest);if(r){let c=Hf.get(s);if(c)throw c;let d=xx(r.location,o);if(bx&&!Hf.get(s))if(d.isExternal||r.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:r.replace}));throw Hf.set(s,u),u}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return t}function oj({routeContext:t,match:s,children:o}){let r=y.useContext($o);return r&&r.static&&r.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=s.route.id),y.createElement(Qn.Provider,{value:t},o)}function rj(t,s=[],o){let r=o==null?void 0:o.state;if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(s.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let c=t,d=r==null?void 0:r.errors;if(d!=null){let v=c.findIndex(b=>b.route.id&&(d==null?void 0:d[b.route.id])!==void 0);bt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,v+1))}let u=!1,p=-1;if(o&&r){u=r.renderFallback;for(let v=0;v<c.length;v++){let b=c[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(p=v),b.route.id){let{loaderData:x,errors:S}=r,k=b.route.loader&&!x.hasOwnProperty(b.route.id)&&(!S||S[b.route.id]===void 0);if(b.route.lazy||k){o.isStatic&&(u=!0),p>=0?c=c.slice(0,p+1):c=[c[0]];break}}}}let m=o==null?void 0:o.onError,g=r&&m?(v,b)=>{var x,S;m(v,{location:r.location,params:((S=(x=r.matches)==null?void 0:x[0])==null?void 0:S.params)??{},unstable_pattern:Vw(r.matches),errorInfo:b})}:void 0;return c.reduceRight((v,b,x)=>{let S,k=!1,w=null,N=null;r&&(S=d&&b.route.id?d[b.route.id]:void 0,w=b.route.errorElement||aj,u&&(p<0&&x===0?(Cx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,N=null):p===x&&(k=!0,N=b.route.hydrateFallbackElement||null)));let T=s.concat(c.slice(0,x+1)),C=()=>{let R;return S?R=w:k?R=N:b.route.Component?R=y.createElement(b.route.Component,null):b.route.element?R=b.route.element:R=v,y.createElement(oj,{match:b,routeContext:{outlet:v,matches:T,isDataRoute:r!=null},children:R})};return r&&(b.route.ErrorBoundary||b.route.errorElement||x===0)?y.createElement(Nx,{location:r.location,revalidation:r.revalidation,component:w,error:S,children:C(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:g}):C()},null)}function cm(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lj(t){let s=y.useContext($o);return bt(s,cm(t)),s}function cj(t){let s=y.useContext(vd);return bt(s,cm(t)),s}function dj(t){let s=y.useContext(Qn);return bt(s,cm(t)),s}function dm(t){let s=dj(t),o=s.matches[s.matches.length-1];return bt(o.route.id,`${t} can only be used on routes that contain a unique "id"`),o.route.id}function uj(){return dm("useRouteId")}function fj(){var r;let t=y.useContext(lm),s=cj("useRouteError"),o=dm("useRouteError");return t!==void 0?t:(r=s.errors)==null?void 0:r[o]}function pj(){let{router:t}=lj("useNavigate"),s=dm("useNavigate"),o=y.useRef(!1);return wx(()=>{o.current=!0}),y.useCallback(async(c,d={})=>{Xn(o.current,Tx),o.current&&(typeof c=="number"?await t.navigate(c):await t.navigate(c,{fromRouteId:s,...d}))},[t,s])}var py={};function Cx(t,s,o){!s&&!py[t]&&(py[t]=!0,Xn(!1,o))}y.memo(mj);function mj({routes:t,future:s,state:o,isStatic:r,onError:c}){return jx(t,void 0,{state:o,isStatic:r,onError:c})}function fs({to:t,replace:s,state:o,relative:r}){bt(Ci(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(Bn);Xn(!c,"<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:d}=y.useContext(Qn),{pathname:u}=Zt(),p=yd(),m=gd(t,rm(d),u,r==="path"),g=JSON.stringify(m);return y.useEffect(()=>{p(JSON.parse(g),{replace:s,state:o,relative:r})},[p,g,r,s,o]),null}function qa(t){return tj(t.context)}function Ce(t){bt(!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 hj({basename:t="/",children:s=null,location:o,navigationType:r="POP",navigator:c,static:d=!1,unstable_useTransitions:u}){bt(!Ci(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=t.replace(/^\/*/,"/"),m=y.useMemo(()=>({basename:p,navigator:c,static:d,unstable_useTransitions:u,future:{}}),[p,c,d,u]);typeof o=="string"&&(o=zo(o));let{pathname:g="/",search:v="",hash:b="",state:x=null,key:S="default",unstable_mask:k}=o,w=y.useMemo(()=>{let N=ta(g,p);return N==null?null:{location:{pathname:N,search:v,hash:b,state:x,key:S,unstable_mask:k},navigationType:r}},[p,g,v,b,x,S,r,k]);return Xn(w!=null,`<Router basename="${p}"> is not able to match the URL "${g}${v}${b}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(Bn.Provider,{value:m},y.createElement(cl.Provider,{children:s,value:w}))}function gj({children:t,location:s}){return nj(Dp(t),s)}function Dp(t,s=[]){let o=[];return y.Children.forEach(t,(r,c)=>{if(!y.isValidElement(r))return;let d=[...s,c];if(r.type===y.Fragment){o.push.apply(o,Dp(r.props.children,d));return}bt(r.type===Ce,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let u={id:r.props.id||d.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(u.children=Dp(r.props.children,d)),o.push(u)}),o}var Gc="get",Fc="application/x-www-form-urlencoded";function bd(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function vj(t){return bd(t)&&t.tagName.toLowerCase()==="button"}function yj(t){return bd(t)&&t.tagName.toLowerCase()==="form"}function bj(t){return bd(t)&&t.tagName.toLowerCase()==="input"}function xj(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function _j(t,s){return t.button===0&&(!s||s==="_self")&&!xj(t)}function Rp(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((s,o)=>{let r=t[o];return s.concat(Array.isArray(r)?r.map(c=>[o,c]):[[o,r]])},[]))}function kj(t,s){let o=Rp(t);return s&&s.forEach((r,c)=>{o.has(c)||s.getAll(c).forEach(d=>{o.append(c,d)})}),o}var Ac=null;function Sj(){if(Ac===null)try{new FormData(document.createElement("form"),0),Ac=!1}catch{Ac=!0}return Ac}var Tj=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Vf(t){return t!=null&&!Tj.has(t)?(Xn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Fc}"`),null):t}function wj(t,s){let o,r,c,d,u;if(yj(t)){let p=t.getAttribute("action");r=p?ta(p,s):null,o=t.getAttribute("method")||Gc,c=Vf(t.getAttribute("enctype"))||Fc,d=new FormData(t)}else if(vj(t)||bj(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(r=m?ta(m,s):null,o=t.getAttribute("formmethod")||p.getAttribute("method")||Gc,c=Vf(t.getAttribute("formenctype"))||Vf(p.getAttribute("enctype"))||Fc,d=new FormData(p,t),!Sj()){let{name:g,type:v,value:b}=t;if(v==="image"){let x=g?`${g}.`:"";d.append(`${x}x`,"0"),d.append(`${x}y`,"0")}else g&&d.append(g,b)}}else{if(bd(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Gc,r=null,c=Fc,u=t}return d&&c==="text/plain"&&(u=d,d=void 0),{action:r,method:o.toLowerCase(),encType:c,formData:d,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function um(t,s){if(t===!1||t===null||typeof t>"u")throw new Error(s)}function jj(t,s,o,r){let c=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return o?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${r}`:c.pathname=`${c.pathname}.${r}`:c.pathname==="/"?c.pathname=`_root.${r}`:s&&ta(c.pathname,s)==="/"?c.pathname=`${s.replace(/\/$/,"")}/_root.${r}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${r}`,c}async function Nj(t,s){if(t.id in s)return s[t.id];try{let o=await import(t.module);return s[t.id]=o,o}catch(o){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Cj(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 Ej(t,s,o){let r=await Promise.all(t.map(async c=>{let d=s.routes[c.route.id];if(d){let u=await Nj(d,o);return u.links?u.links():[]}return[]}));return Mj(r.flat(1).filter(Cj).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function my(t,s,o,r,c,d){let u=(m,g)=>o[g]?m.route.id!==o[g].route.id:!0,p=(m,g)=>{var v;return o[g].pathname!==m.pathname||((v=o[g].route.path)==null?void 0:v.endsWith("*"))&&o[g].params["*"]!==m.params["*"]};return d==="assets"?s.filter((m,g)=>u(m,g)||p(m,g)):d==="data"?s.filter((m,g)=>{var b;let v=r.routes[m.route.id];if(!v||!v.hasLoader)return!1;if(u(m,g)||p(m,g))return!0;if(m.route.shouldRevalidate){let x=m.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((b=o[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function Aj(t,s,{includeHydrateFallback:o}={}){return Dj(t.map(r=>{let c=s.routes[r.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),o&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}function Dj(t){return[...new Set(t)]}function Rj(t){let s={},o=Object.keys(t).sort();for(let r of o)s[r]=t[r];return s}function Mj(t,s){let o=new Set;return new Set(s),t.reduce((r,c)=>{let d=JSON.stringify(Rj(c));return o.has(d)||(o.add(d),r.push({key:d,link:c})),r},[])}function Ex(){let t=y.useContext($o);return um(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Ij(){let t=y.useContext(vd);return um(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var fm=y.createContext(void 0);fm.displayName="FrameworkContext";function Ax(){let t=y.useContext(fm);return um(t,"You must render this element inside a <HydratedRouter> element"),t}function Oj(t,s){let o=y.useContext(fm),[r,c]=y.useState(!1),[d,u]=y.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:v,onTouchStart:b}=s,x=y.useRef(null);y.useEffect(()=>{if(t==="render"&&u(!0),t==="viewport"){let w=T=>{T.forEach(C=>{u(C.isIntersecting)})},N=new IntersectionObserver(w,{threshold:.5});return x.current&&N.observe(x.current),()=>{N.disconnect()}}},[t]),y.useEffect(()=>{if(r){let w=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(w)}}},[r]);let S=()=>{c(!0)},k=()=>{c(!1),u(!1)};return o?t!=="intent"?[d,x,{}]:[d,x,{onFocus:Ir(p,S),onBlur:Ir(m,k),onMouseEnter:Ir(g,S),onMouseLeave:Ir(v,k),onTouchStart:Ir(b,S)}]:[!1,x,{}]}function Ir(t,s){return o=>{t&&t(o),o.defaultPrevented||s(o)}}function Bj({page:t,...s}){let{router:o}=Ex(),r=y.useMemo(()=>hx(o.routes,t,o.basename),[o.routes,t,o.basename]);return r?y.createElement(zj,{page:t,matches:r,...s}):null}function Lj(t){let{manifest:s,routeModules:o}=Ax(),[r,c]=y.useState([]);return y.useEffect(()=>{let d=!1;return Ej(t,s,o).then(u=>{d||c(u)}),()=>{d=!0}},[t,s,o]),r}function zj({page:t,matches:s,...o}){let r=Zt(),{future:c,manifest:d,routeModules:u}=Ax(),{basename:p}=Ex(),{loaderData:m,matches:g}=Ij(),v=y.useMemo(()=>my(t,s,g,d,r,"data"),[t,s,g,d,r]),b=y.useMemo(()=>my(t,s,g,d,r,"assets"),[t,s,g,d,r]),x=y.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let w=new Set,N=!1;if(s.forEach(C=>{var B;let R=d.routes[C.route.id];!R||!R.hasLoader||(!v.some(A=>A.route.id===C.route.id)&&C.route.id in m&&((B=u[C.route.id])!=null&&B.shouldRevalidate)||R.hasClientLoader?N=!0:w.add(C.route.id))}),w.size===0)return[];let T=jj(t,p,c.unstable_trailingSlashAwareDataRequests,"data");return N&&w.size>0&&T.searchParams.set("_routes",s.filter(C=>w.has(C.route.id)).map(C=>C.route.id).join(",")),[T.pathname+T.search]},[p,c.unstable_trailingSlashAwareDataRequests,m,r,d,v,s,t,u]),S=y.useMemo(()=>Aj(b,d),[b,d]),k=Lj(b);return y.createElement(y.Fragment,null,x.map(w=>y.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...o})),S.map(w=>y.createElement("link",{key:w,rel:"modulepreload",href:w,...o})),k.map(({key:w,link:N})=>y.createElement("link",{key:w,nonce:o.nonce,...N,crossOrigin:N.crossOrigin??o.crossOrigin})))}function $j(...t){return s=>{t.forEach(o=>{typeof o=="function"?o(s):o!=null&&(o.current=s)})}}var Uj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Uj&&(window.__reactRouterVersion="7.13.2")}catch{}function Pj({basename:t,children:s,unstable_useTransitions:o,window:r}){let c=y.useRef();c.current==null&&(c.current=bw({window:r,v5Compat:!0}));let d=c.current,[u,p]=y.useState({action:d.action,location:d.location}),m=y.useCallback(g=>{o===!1?p(g):y.startTransition(()=>p(g))},[o]);return y.useLayoutEffect(()=>d.listen(m),[d,m]),y.createElement(hj,{basename:t,children:s,location:u.location,navigationType:u.action,navigator:d,unstable_useTransitions:o})}var Dx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pm=y.forwardRef(function({onClick:s,discover:o="render",prefetch:r="none",relative:c,reloadDocument:d,replace:u,unstable_mask:p,state:m,target:g,to:v,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:S,...k},w){let{basename:N,navigator:T,unstable_useTransitions:C}=y.useContext(Bn),R=typeof v=="string"&&Dx.test(v),B=xx(v,N);v=B.to;let A=Xw(v,{relative:c}),M=Zt(),D=null;if(p){let oe=gd(p,[],M.unstable_mask?M.unstable_mask.pathname:"/",!0);N!=="/"&&(oe.pathname=oe.pathname==="/"?N:Ts([N,oe.pathname])),D=T.createHref(oe)}let[z,U,X]=Oj(r,k),Q=Gj(v,{replace:u,unstable_mask:p,state:m,target:g,preventScrollReset:b,relative:c,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:C});function P(oe){s&&s(oe),oe.defaultPrevented||Q(oe)}let re=!(B.isExternal||d),H=y.createElement("a",{...k,...X,href:(re?D:void 0)||B.absoluteURL||A,onClick:re?P:s,ref:$j(w,U),target:g,"data-discover":!R&&o==="render"?"true":void 0});return z&&!R?y.createElement(y.Fragment,null,H,y.createElement(Bj,{page:A})):H});pm.displayName="Link";var Hj=y.forwardRef(function({"aria-current":s="page",caseSensitive:o=!1,className:r="",end:c=!1,style:d,to:u,viewTransition:p,children:m,...g},v){let b=dl(u,{relative:g.relative}),x=Zt(),S=y.useContext(vd),{navigator:k,basename:w}=y.useContext(Bn),N=S!=null&&Jj(b)&&p===!0,T=k.encodeLocation?k.encodeLocation(b).pathname:b.pathname,C=x.pathname,R=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;o||(C=C.toLowerCase(),R=R?R.toLowerCase():null,T=T.toLowerCase()),R&&w&&(R=ta(R,w)||R);const B=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let A=C===T||!c&&C.startsWith(T)&&C.charAt(B)==="/",M=R!=null&&(R===T||!c&&R.startsWith(T)&&R.charAt(T.length)==="/"),D={isActive:A,isPending:M,isTransitioning:N},z=A?s:void 0,U;typeof r=="function"?U=r(D):U=[r,A?"active":null,M?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let X=typeof d=="function"?d(D):d;return y.createElement(pm,{...g,"aria-current":z,className:U,ref:v,style:X,to:u,viewTransition:p},typeof m=="function"?m(D):m)});Hj.displayName="NavLink";var Vj=y.forwardRef(({discover:t="render",fetcherKey:s,navigate:o,reloadDocument:r,replace:c,state:d,method:u=Gc,action:p,onSubmit:m,relative:g,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:x,...S},k)=>{let{unstable_useTransitions:w}=y.useContext(Bn),N=Kj(),T=Yj(p,{relative:g}),C=u.toLowerCase()==="get"?"get":"post",R=typeof p=="string"&&Dx.test(p),B=A=>{if(m&&m(A),A.defaultPrevented)return;A.preventDefault();let M=A.nativeEvent.submitter,D=(M==null?void 0:M.getAttribute("formmethod"))||u,z=()=>N(M||A.currentTarget,{fetcherKey:s,method:D,navigate:o,replace:c,state:d,relative:g,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:x});w&&o!==!1?y.startTransition(()=>z()):z()};return y.createElement("form",{ref:k,method:C,action:T,onSubmit:r?m:B,...S,"data-discover":!R&&t==="render"?"true":void 0})});Vj.displayName="Form";function qj(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Rx(t){let s=y.useContext($o);return bt(s,qj(t)),s}function Gj(t,{target:s,replace:o,unstable_mask:r,state:c,preventScrollReset:d,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let v=yd(),b=Zt(),x=dl(t,{relative:u});return y.useCallback(S=>{if(_j(S,s)){S.preventDefault();let k=o!==void 0?o:el(b)===el(x),w=()=>v(t,{replace:k,unstable_mask:r,state:c,preventScrollReset:d,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m});g?y.startTransition(()=>w()):w()}},[b,v,x,o,r,c,s,t,d,u,p,m,g])}function mm(t){Xn(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 s=y.useRef(Rp(t)),o=y.useRef(!1),r=Zt(),c=y.useMemo(()=>kj(r.search,o.current?null:s.current),[r.search]),d=yd(),u=y.useCallback((p,m)=>{const g=Rp(typeof p=="function"?p(new URLSearchParams(c)):p);o.current=!0,d("?"+g,m)},[d,c]);return[c,u]}var Fj=0,Zj=()=>`__${String(++Fj)}__`;function Kj(){let{router:t}=Rx("useSubmit"),{basename:s}=y.useContext(Bn),o=uj(),r=t.fetch,c=t.navigate;return y.useCallback(async(d,u={})=>{let{action:p,method:m,encType:g,formData:v,body:b}=wj(d,s);if(u.navigate===!1){let x=u.fetcherKey||Zj();await r(x,o,u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:v,body:b,formMethod:u.method||m,formEncType:u.encType||g,flushSync:u.flushSync})}else await c(u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:v,body:b,formMethod:u.method||m,formEncType:u.encType||g,replace:u.replace,state:u.state,fromRouteId:o,flushSync:u.flushSync,viewTransition:u.viewTransition})},[r,c,s,o])}function Yj(t,{relative:s}={}){let{basename:o}=y.useContext(Bn),r=y.useContext(Qn);bt(r,"useFormAction must be used inside a RouteContext");let[c]=r.matches.slice(-1),d={...dl(t||".",{relative:s})},u=Zt();if(t==null){d.search=u.search;let p=new URLSearchParams(d.search),m=p.getAll("index");if(m.some(v=>v==="")){p.delete("index"),m.filter(b=>b).forEach(b=>p.append("index",b));let v=p.toString();d.search=v?`?${v}`:""}}return(!t||t===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(d.pathname=d.pathname==="/"?o:Ts([o,d.pathname])),el(d)}function Jj(t,{relative:s}={}){let o=y.useContext(kx);bt(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Rx("useViewTransitionState"),c=dl(t,{relative:s});if(!o.isTransitioning)return!1;let d=ta(o.currentLocation.pathname,r)||o.currentLocation.pathname,u=ta(o.nextLocation.pathname,r)||o.nextLocation.pathname;return tl(c.pathname,u)!=null||tl(c.pathname,d)!=null}function _t(){const t=yd();return y.useCallback((s,o)=>{typeof s=="number"?t(s):t(s,o)},[t])}function hm(t){return`/sessions/${encodeURIComponent(t)}`}function Ua(t,s){return s?`/environments/${encodeURIComponent(s)}/workspaces/${encodeURIComponent(t)}`:`/workspaces/${encodeURIComponent(t)}`}function In(t,s,o,r){const c=encodeURIComponent(t);let d;return o&&r?d=`/environments/${encodeURIComponent(r)}/workspaces/${encodeURIComponent(o)}/tasks/${c}`:o?d=`/workspaces/${encodeURIComponent(o)}/tasks/${c}`:d=`/tasks/${c}`,s?`${d}/${s}`:d}function Ei(t,s,o){const r=new URLSearchParams;t&&r.set("workspace",t),s&&r.set("parent",s);const c=r.toString();if(t&&o){const d=`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(t)}/tasks/new`;return s?`${d}?parent=${encodeURIComponent(s)}`:d}return c?`/tasks/new?${c}`:"/tasks/new"}function Mx(t){return`/sessions/new?${new URLSearchParams({env:t}).toString()}`}const Ro="/environments",Wj="/environments/new";function Ti(t){return`/environments/${encodeURIComponent(t)}`}function Xj(t){return`/environments/${encodeURIComponent(t)}/edit`}const Ao="/settings",Qj="/settings/credentials",qf="/settings/personas",eN="/settings/personas/new";function Ix(t){return`/settings/personas/${encodeURIComponent(t)}`}const tN="/settings/shortcuts",nN="/pair",sN="/chat",wi="/",aN="/tasks",Ox="/workspaces/new",Bx="/knowledge",xd="/findings";function iN(t,s){return t&&s?`/environments/${encodeURIComponent(s)}/workspaces/${encodeURIComponent(t)}/findings`:xd}function Mp(t,s,o){const r=encodeURIComponent(t);return s&&o?`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(s)}/findings/${r}`:`/findings/${r}`}const oN=sw,rN={task:yw};function lN({workspaceId:t,environmentId:s,tasks:o,resolvedThemeId:r}){const c=_t(),d=y.useMemo(()=>o.filter(b=>b.workspaceId===t),[o,t]),{nodes:u,edges:p}=FT(d),m=y.useMemo(()=>{const b=getComputedStyle(document.documentElement),x={};for(const[S,k]of Object.entries(oN))x[S]=b.getPropertyValue(k).trim()||"#6b7a8d";return x},[r]),g=y.useCallback((b,x)=>{c(In(x.id,void 0,t,s))},[c,t,s]),v=y.useCallback(b=>{const x=b.data;return m[x.task.status]||m.pending},[m]);return d.length===0?i.jsxs("div",{className:gn.emptyCta,children:[i.jsx("button",{className:gn.ctaButton,onClick:()=>c(Ei(t,void 0,s)),children:"Create Task"}),i.jsx("div",{className:gn.ctaDescription,children:"Create tasks to see the dependency graph"})]}):i.jsx("div",{className:gn.dagContainer,children:i.jsxs(nT,{nodes:u,edges:p,nodeTypes:rN,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[i.jsx(sT,{variant:aT.Dots,gap:24,size:1,color:"var(--text-disabled)"}),i.jsx(iT,{showInteractive:!1}),i.jsx(oT,{nodeColor:v,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}const cN="_breadcrumbs_17or2_1",dN="_list_17or2_11",uN="_item_17or2_21",fN="_separator_17or2_28",pN="_link_17or2_34",mN="_current_17or2_57",_o={breadcrumbs:cN,list:dN,item:uN,separator:fN,link:pN,current:mN};function Ns({segments:t}){return i.jsx("nav",{className:_o.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:i.jsx("ol",{className:_o.list,children:t.map((s,o)=>{const r=o===t.length-1;return i.jsxs("li",{className:_o.item,children:[o>0&&i.jsx("span",{className:_o.separator,"aria-hidden":"true",children:i.jsx(aa,{size:ot})}),s.url&&!r?i.jsx(pm,{className:_o.link,to:s.url,title:s.label,children:s.label}):i.jsx("span",{className:_o.current,"aria-current":"page",title:s.label,children:s.label})]},o)})})})}const hN="_btn_dwk2o_1",gN="_sm_dwk2o_22",vN="_md_dwk2o_28",yN="_lg_dwk2o_34",bN="_primary_dwk2o_40",xN="_danger_dwk2o_55",_N="_outline_dwk2o_70",kN="_ghost_dwk2o_80",Gf={btn:hN,sm:gN,md:vN,lg:yN,primary:bN,danger:xN,outline:_N,ghost:kN},Ws=y.forwardRef(function({variant:s="primary",size:o="md",className:r,children:c,...d},u){const p=[Gf.btn,Gf[s],Gf[o],r].filter(Boolean).join(" ");return i.jsx("button",{ref:u,className:p,...d,children:c})}),SN="_copyButton_1bqk0_1",TN={copyButton:SN},wN=2e3;function jN({text:t,className:s,"data-testid":o}){const[r,c]=y.useState(!1),d=y.useRef(void 0);y.useEffect(()=>()=>{d.current!==void 0&&clearTimeout(d.current)},[]);const u=y.useCallback(async()=>{try{await navigator.clipboard.writeText(t),c(!0),d.current!==void 0&&clearTimeout(d.current),d.current=setTimeout(()=>{c(!1),d.current=void 0},wN)}catch{}},[t]);return i.jsx("button",{type:"button",className:`${TN.copyButton} ${s??""}`,onClick:()=>{u().catch(()=>{})},"aria-label":r?"Copied":"Copy to clipboard","data-testid":o??"copy-button",children:r?i.jsx(Ni,{size:en,"aria-hidden":"true"}):i.jsx(px,{size:en,"aria-hidden":"true"})})}const NN="_banner_bxqlh_1",CN="_label_bxqlh_15",EN="_text_bxqlh_25",AN="_link_bxqlh_29",Dc={banner:NN,label:CN,text:EN,link:AN};function DN(){return i.jsxs("div",{className:Dc.banner,"data-testid":"demo-banner",children:[i.jsx("span",{className:Dc.label,children:"DEMO"}),i.jsxs("span",{className:Dc.text,children:["This is an interactive demo with mock data."," ",i.jsx("a",{href:"https://github.com/nick-pape/grackle",target:"_blank",rel:"noopener noreferrer",className:Dc.link,children:"Install Grackle"})," ","to use it for real."]})]})}const RN="_container_og0yp_1",MN="_chevronButton_og0yp_6",IN="_mainButton_og0yp_6",ON="_sm_og0yp_34",BN="_md_og0yp_34",LN="_lg_og0yp_34",zN="_primary_og0yp_57",$N="_danger_og0yp_70",UN="_outline_og0yp_83",PN="_ghost_og0yp_92",HN="_dropdown_og0yp_100",VN="_option_og0yp_113",qN="_optionLabel_og0yp_130",GN="_optionDesc_og0yp_135",Zs={container:RN,chevronButton:MN,mainButton:IN,sm:ON,md:BN,lg:LN,primary:zN,danger:$N,outline:UN,ghost:PN,dropdown:HN,option:VN,optionLabel:qN,optionDesc:GN};function Lx({label:t,onClick:s,options:o,variant:r="primary",size:c="md","data-testid":d}){const[u,p]=y.useState(!1),m=y.useRef(null);y.useEffect(()=>{if(!u)return;function x(S){m.current&&S.target instanceof Node&&!m.current.contains(S.target)&&p(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[u]),y.useEffect(()=>{if(!u)return;function x(S){S.key==="Escape"&&p(!1)}return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[u]);const g=Zs[r]||"",v=Zs[c]||"",b=()=>{u&&p(!1),s()};return i.jsxs("div",{ref:m,className:Zs.container,"data-testid":d,children:[i.jsx("button",{type:"button",className:`${Zs.mainButton} ${g} ${v}`,onClick:b,"data-testid":d?`${d}-main`:void 0,children:t}),i.jsx("button",{type:"button",className:`${Zs.chevronButton} ${g} ${v}`,onClick:()=>p(x=>!x),"aria-label":`More options for ${t}`,"aria-haspopup":"menu","aria-expanded":u,"data-testid":d?`${d}-chevron`:void 0,children:i.jsx(fx,{size:en,"aria-hidden":"true"})}),u&&i.jsx("div",{className:Zs.dropdown,"data-testid":d?`${d}-menu`:void 0,children:o.map((x,S)=>i.jsxs("button",{type:"button",className:Zs.option,onClick:()=>{x.onClick(),p(!1)},children:[i.jsx("span",{className:Zs.optionLabel,children:x.label}),x.description&&i.jsx("span",{className:Zs.optionDesc,children:x.description})]},S))})]})}function Ip(){Ip=function(c,d){return new o(c,void 0,d)};var t=RegExp.prototype,s=new WeakMap;function o(c,d,u){var p=new RegExp(c,d);return s.set(p,u||s.get(c)),Qc(p,o.prototype)}function r(c,d){var u=s.get(d);return Object.keys(u).reduce(function(p,m){var g=u[m];if(typeof g=="number")p[m]=c[g];else{for(var v=0;c[g[v]]===void 0&&v+1<g.length;)v++;p[m]=c[g[v]]}return p},Object.create(null))}return(function(c,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(d&&d.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),d&&Qc(c,d)})(o,RegExp),o.prototype.exec=function(c){var d=t.exec.call(this,c);if(d){d.groups=r(d,this);var u=d.indices;u&&(u.groups=r(u,this))}return d},o.prototype[Symbol.replace]=function(c,d){if(typeof d=="string"){var u=s.get(this);return t[Symbol.replace].call(this,c,d.replace(/\$<([^>]+)>/g,function(m,g){var v=u[g];return"$"+(Array.isArray(v)?v.join("$"):v)}))}if(typeof d=="function"){var p=this;return t[Symbol.replace].call(this,c,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(r(m,p)),d.apply(this,m)})}return t[Symbol.replace].call(this,c,d)},Ip.apply(this,arguments)}function Qc(t,s){return Qc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},Qc(t,s)}function hy(t,s){(s==null||s>t.length)&&(s=t.length);for(var o=0,r=new Array(s);o<s;o++)r[o]=t[o];return r}function Ff(t,s){var o=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o)return(o=o.call(t)).next.bind(o);if(Array.isArray(t)||(o=(function(c,d){if(c){if(typeof c=="string")return hy(c,d);var u=Object.prototype.toString.call(c).slice(8,-1);return u==="Object"&&c.constructor&&(u=c.constructor.name),u==="Map"||u==="Set"?Array.from(c):u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u)?hy(c,d):void 0}})(t))||s){o&&(t=o);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
228
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var FN=(function(t){return function(s){return s===void 0&&(s={}),(function(r,c){if(c&&!r.registered(c))throw new Error('The default language "'+c+'" is not registered with refractor.')})(t,s.defaultLanguage),function(r){bT(r,"element",o)};function o(r,c,d){var u,p;if(d&&d.tagName==="pre"&&r.tagName==="code"){var m=(r==null||(u=r.data)==null?void 0:u.meta)||(r==null||(p=r.properties)==null?void 0:p.metastring)||"";r.properties.className?typeof r.properties.className=="boolean"?r.properties.className=[]:Array.isArray(r.properties.className)||(r.properties.className=[r.properties.className]):r.properties.className=[];var g,v,b=(function(A){for(var M,D=Ff(A.properties.className);!(M=D()).done;){var z=M.value;if(z.slice(0,9)==="language-")return z.slice(9).toLowerCase()}return null})(r);if(!b&&s.defaultLanguage&&r.properties.className.push("language-"+(b=s.defaultLanguage)),r.properties.className.push("code-highlight"),b)try{var x,S;S=(x=b)!=null&&x.includes("diff-")?b.split("-")[1]:b,g=t.highlight(Ec(r),S),d.properties.className=(d.properties.className||[]).concat("language-"+S)}catch(A){if(!s.ignoreMissing||!/Unknown language/.test(A.message))throw A;g=r}else g=r;g.children=(v=1,function A(M){return M.reduce(function(D,z){if(z.type==="text"){var U=z.value,X=(U.match(/\n/g)||"").length;if(X===0)z.position={start:{line:v,column:1},end:{line:v,column:1}},D.push(z);else for(var Q,P=U.split(`
|
|
229
|
-
`),re=Ff(P.entries());!(Q=re()).done;){var H=Q.value,oe=H[0],E=H[1];D.push({type:"text",value:oe===P.length-1?E:E+`
|
|
230
|
-
`,position:{start:{line:v+oe,column:1},end:{line:v+oe,column:1}}})}return v+=X,D}if(Object.prototype.hasOwnProperty.call(z,"children")){var F=v;return z.children=A(z.children),D.push(z),z.position={start:{line:F,column:1},end:{line:v,column:1}},D}return D.push(z),D},[])})(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 k,w=(function(A){var M=/{([\d,-]+)}/,D=A.split(",").map(function(X){return X.trim()}).join();if(M.test(D)){var z=M.exec(D)[1],U=_T(z);return function(X){return U.includes(X+1)}}return function(){return!1}})(m),N=(function(A){var M=Ip(/showLineNumbers=(\d+)/i,{lines:1});if(M.test(A)){var D=M.exec(A);return Number(D.groups.lines)}return 1})(m),T=(function(A){for(var M=new Array(A),D=0;D<A;D++)M[D]={type:"element",tagName:"span",properties:{className:[]},children:[]};return M})(g.position.end.line),C=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],R=function(){var A,M,D=k.value,z=D[0],U=D[1];U.properties.className=["code-line"];var X=kT(g,function(Q){return Q.position.start.line<=z+1&&Q.position.end.line>=z+1});U.children=X.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||s.showLineNumbers===!0||typeof s.showLineNumbers=="object"&&s.showLineNumbers.includes(b))&&!C.some(function(Q){return m.toLowerCase().includes(Q)})&&(U.properties.line=[(z+N).toString()],U.properties.className.push("line-number")),w(z)&&U.properties.className.push("highlight-line"),(b==="diff"||(A=b)!=null&&A.includes("diff-"))&&Ec(U).substring(0,1)==="-"?U.properties.className.push("deleted"):(b==="diff"||(M=b)!=null&&M.includes("diff-"))&&Ec(U).substring(0,1)==="+"&&U.properties.className.push("inserted")},B=Ff(T.entries());!(k=B()).done;)R();T.length>0&&Ec(T[T.length-1]).trim()===""&&T.pop(),r.children=T}}}})(xT);function Mo(t){if(t>=1e6)return`${(t/1e6).toFixed(1)}M`;if(t>=1e3){const s=Number((t/1e3).toFixed(1));return s>=1e3?`${(t/1e6).toFixed(1)}M`:`${s.toFixed(1)}k`}return String(t)}function Ss(t){return t===0?"-":t<.01?`$${t.toFixed(4)}`:`$${t.toFixed(2)}`}const gy=new Set(["grackle"]);function Uo(t){if(t.startsWith("mcp__")){const o=t.indexOf("__",5);if(o>5){const r=t.slice(5,o);if(gy.has(r))return t.slice(o+2)}}const s=t.indexOf("-");if(s>0){const o=t.slice(0,s);if(gy.has(o))return t.slice(s+1)}return t}const ZN={read:"file-read",view:"file-read",edit:"file-edit",file_change:"file-edit",write:"file-write",bash:"shell",powershell:"shell",command_execution:"shell",grep:"search",glob:"search",todowrite:"todo",update_plan:"todo",todo_write:"todo",report_intent:"metadata",finding_post:"finding",finding_list:"finding",task_list:"task",task_create:"task",task_show:"task",task_update:"task",task_start:"task",task_complete:"task",task_resume:"task",task_delete:"task",workpad_write:"workpad",workpad_read:"workpad",knowledge_search:"knowledge",knowledge_get_node:"knowledge",knowledge_create_node:"knowledge",ipc_spawn:"ipc",ipc_write:"ipc",ipc_close:"ipc",ipc_list_fds:"ipc",ipc_terminate:"ipc",ipc_create_stream:"ipc",ipc_attach:"ipc",toolsearch:"tool-search",agent:"agent",task:"agent",read_agent:"agent"};function KN(t){const s=Uo(t);return ZN[s.toLowerCase()]??"generic"}const YN="_card_qkm9i_2",JN="_cardBlue_qkm9i_20",WN="_cardOrange_qkm9i_24",XN="_cardGreen_qkm9i_28",QN="_cardPurple_qkm9i_32",eC="_cardNeutral_qkm9i_36",tC="_cardRed_qkm9i_40",nC="_cardTeal_qkm9i_44",sC="_header_qkm9i_48",aC="_icon_qkm9i_55",iC="_toolName_qkm9i_64",oC="_fileName_qkm9i_71",rC="_badge_qkm9i_80",lC="_spacer_qkm9i_87",cC="_bodyToggle_qkm9i_91",dC="_chevron_qkm9i_109",uC="_chevronExpanded_qkm9i_115",fC="_pre_qkm9i_119",pC="_diffAdd_qkm9i_143",mC="_diffRemove_qkm9i_155",hC="_diffContext_qkm9i_167",gC="_diffHeader_qkm9i_176",vC="_diffLine_qkm9i_182",yC="_exitOk_qkm9i_188",bC="_exitError_qkm9i_194",xC="_exitPending_qkm9i_200",_C="_inProgress_qkm9i_228",kC="_metadata_qkm9i_232",SC="_metadataPrefix_qkm9i_239",O={card:YN,cardBlue:JN,cardOrange:WN,cardGreen:XN,cardPurple:QN,cardNeutral:eC,cardRed:tC,cardTeal:nC,header:sC,icon:aC,toolName:iC,fileName:oC,badge:rC,spacer:lC,bodyToggle:cC,chevron:dC,chevronExpanded:uC,pre:fC,diffAdd:pC,diffRemove:mC,diffContext:hC,diffHeader:gC,diffLine:vC,exitOk:yC,exitError:bC,exitPending:xC,inProgress:_C,metadata:kC,metadataPrefix:SC};function TC(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.file_path=="string"?s.file_path:typeof s.path=="string"?s.path:""}function wC(t){const s=t.split(/[/\\]/);return s[s.length-1]||t}const Zf=5;function vy({tool:t,args:s,result:o,isError:r,writeVariant:c}){const[d,u]=y.useState(!1),p=TC(s),m=wC(p),g=o===void 0,v=r?O.cardRed:c?O.cardGreen:O.cardBlue,b=c?"var(--accent-green)":"var(--accent-blue)",x=c?i.jsx(g2,{size:en}):i.jsx(y2,{size:en}),S=c?"tool-card-file-write":"tool-card-file-read",k=(o==null?void 0:o.split(`
|
|
231
|
-
`))??[],w=k.length>Zf,N=d?k:k.slice(0,Zf);return i.jsxs("div",{className:`${O.card} ${v} ${g?O.inProgress:""}`,"data-testid":S,children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,children:x}),i.jsx("span",{className:O.toolName,style:{color:b},children:t}),m&&i.jsx("span",{className:O.fileName,title:p,children:m}),!g&&k.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsxs("span",{className:O.badge,children:[k.length," lines"]})]})]}),r&&o&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-error",children:o}),!r&&!g&&k.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:O.pre,"data-testid":"tool-card-content",children:N.map((T,C)=>i.jsxs("span",{className:O.diffLine,children:[i.jsx("span",{style:{color:"var(--text-tertiary)",userSelect:"none",marginRight:"var(--space-sm)",display:"inline-block",width:"3ch",textAlign:"right"},children:C+1}),T]},C))}),w&&i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{u(T=>!T)},"aria-expanded":d,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${d?O.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(aa,{size:ot})}),d?"collapse":`${k.length-Zf} more lines`]})]})]})}function jC(t){const s=t.split(`
|
|
232
|
-
`),o=[];for(const r of s)r.startsWith("diff --git")||r.startsWith("index ")||(r.startsWith("--- ")||r.startsWith("+++ "))&&!r.startsWith("---- ")&&!r.startsWith("++++ ")||(r.startsWith("@@")?o.push({type:"header",content:r}):r.startsWith("+")?o.push({type:"add",content:r.slice(1)}):r.startsWith("-")?o.push({type:"remove",content:r.slice(1)}):r.startsWith(" ")?o.push({type:"context",content:r.slice(1)}):r===""&&o.push({type:"context",content:""}));return o}function NC(t,s){const o=t.split(`
|
|
233
|
-
`),r=s.split(`
|
|
234
|
-
`),c=[];for(const d of o)c.push({type:"remove",content:d});for(const d of r)c.push({type:"add",content:d});return c}function CC(t){let s=0,o=0;for(const r of t)r.type==="add"&&s++,r.type==="remove"&&o++;return{added:s,removed:o}}function EC(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.file_path=="string"&&s.file_path||typeof s.path=="string"&&s.path||""}function AC(t){if(t===void 0||typeof t!="object"||t===null)return;const s=t,o=(typeof s.old_string=="string"?s.old_string:void 0)??(typeof s.old_str=="string"?s.old_str:void 0),r=(typeof s.new_string=="string"?s.new_string:void 0)??(typeof s.new_str=="string"?s.new_str:void 0);if(o!==void 0&&r!==void 0)return{oldStr:o,newStr:r}}function DC(t){const s=t.split(/[/\\]/);return s[s.length-1]||t}function RC(t,s){if(s){let r=s;if(s.trimStart().startsWith("{"))try{const c=JSON.parse(s);typeof c.detailedContent=="string"&&(r=c.detailedContent)}catch{}if(r.includes("@@")||r.startsWith("diff ")){const c=jC(r);if(c.length>0)return c}}const o=AC(t);if(o)return NC(o.oldStr,o.newStr)}const Kf=5;function MC({tool:t,args:s,result:o,isError:r,detailedResult:c}){const[d,u]=y.useState(!1),p=EC(s),m=DC(p),g=o===void 0,v=RC(s,c),b=v?CC(v):null,x=((v==null?void 0:v.length)??0)>Kf,S=d?v:v==null?void 0:v.slice(0,Kf);return i.jsxs("div",{className:`${O.card} ${r?O.cardRed:O.cardOrange} ${g?O.inProgress:""}`,"data-testid":"tool-card-file-edit",children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,children:i.jsx(V2,{size:en})}),i.jsx("span",{className:O.toolName,style:{color:"var(--accent-yellow)"},children:t}),m&&i.jsx("span",{className:O.fileName,title:p,children:m}),b&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsxs("span",{className:O.badge,"data-testid":"tool-card-diff-stats",children:[i.jsxs("span",{style:{color:"var(--accent-green)"},children:["+",b.added]})," ",i.jsxs("span",{style:{color:"var(--accent-red)"},children:["−",b.removed]})]})]})]}),r&&o&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-error",children:o}),!r&&S&&S.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:O.pre,"data-testid":"tool-card-diff",children:S.map((k,w)=>{let N=O.diffContext;return k.type==="add"&&(N=O.diffAdd),k.type==="remove"&&(N=O.diffRemove),k.type==="header"&&(N=O.diffHeader),i.jsx("span",{className:`${O.diffLine} ${N}`,children:k.content},w)})}),x&&i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{u(k=>!k)},"aria-expanded":d,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${d?O.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(aa,{size:ot})}),d?"collapse":`${((v==null?void 0:v.length)??0)-Kf} more lines`]})]}),!r&&!v&&!g&&o&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-content",children:o})]})}const IC=/^\[exit (\d+)\]\s*/;function OC(t){const s=IC.exec(t);return s?{exitCode:Number(s[1]),output:t.slice(s[0].length)}:{exitCode:void 0,output:t}}function BC(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.command=="string"?s.command:""}function LC(t){const s=/pwsh(?:\.exe)?["']?\s+-Command\s+'([^']*)'\s*$/i.exec(t);if(s)return s[1];const o=/pwsh(?:\.exe)?["']?\s+-Command\s+"([^"]*)"\s*$/i.exec(t);return o?o[1]:t}const Yf=3;function zC({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=BC(s),p=LC(u),m=o===void 0,g=o?OC(o):null,v=(g==null?void 0:g.output.split(`
|
|
235
|
-
`))??[],b=v.length>Yf,x=c?v:v.slice(0,Yf),S=g==null?void 0:g.exitCode,k=r||S!==void 0&&S!==0;return i.jsxs("div",{className:`${O.card} ${k?O.cardRed:O.cardNeutral}`,"data-testid":"tool-card-shell",children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,style:{color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontWeight:"bold"},children:"$"}),i.jsx("span",{className:O.fileName,style:{flex:1,color:"var(--text-primary)"},title:u!==p?u:void 0,"data-testid":"tool-card-command",children:p}),S!==void 0&&i.jsxs("span",{className:S===0?O.exitOk:O.exitError,"data-testid":"tool-card-exit-code",children:[S===0?i.jsx(Ni,{size:ot,"aria-hidden":"true"}):i.jsx(Va,{size:ot,"aria-hidden":"true"})," ","exit ",S]}),m&&i.jsx("span",{className:O.exitPending,"data-testid":"tool-card-pending",children:i.jsx(D2,{size:ot,"aria-hidden":"true"})})]}),!m&&g&&g.output.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:O.pre,"data-testid":"tool-card-output",children:x.join(`
|
|
236
|
-
`)}),b&&i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{d(w=>!w)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${c?O.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(aa,{size:ot})}),c?"collapse":`${v.length-Yf} more lines`]})]})]})}function $C(t){if(t==null||typeof t!="object")return{pattern:"",path:""};const s=t,o=typeof s.pattern=="string"?s.pattern:"",r=typeof s.path=="string"?s.path:"";return{pattern:o,path:r}}const Jf=5;function UC({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),{pattern:u,path:p}=$C(s),m=o===void 0,g=(o==null?void 0:o.split(`
|
|
237
|
-
`).filter(x=>x.length>0))??[],v=g.length>Jf,b=c?g:g.slice(0,Jf);return i.jsxs("div",{className:`${O.card} ${r?O.cardRed:O.cardPurple} ${m?O.inProgress:""}`,"data-testid":"tool-card-search",children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,children:i.jsx(mx,{size:en})}),i.jsx("span",{className:O.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:t}),u&&i.jsxs("span",{className:O.fileName,"data-testid":"tool-card-pattern",children:['"',u,'"']}),p&&i.jsxs("span",{className:O.fileName,style:{flexShrink:1},"data-testid":"tool-card-search-path",children:["in ",p]}),!m&&!r&&g.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsxs("span",{className:O.badge,"data-testid":"tool-card-match-count",children:[g.length," ",g.length===1?"match":"matches"]})]})]}),r&&o&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-error",children:o}),!r&&!m&&b.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:O.pre,"data-testid":"tool-card-results",children:b.join(`
|
|
238
|
-
`)}),v&&i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{d(x=>!x)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${c?O.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(aa,{size:ot})}),c?"collapse":`${g.length-Jf} more matches`]})]})]})}const PC="_progressBar_14f5c_1",HC="_progressFill_14f5c_9",VC="_activeTask_14f5c_16",qC="_activeIcon_14f5c_27",GC="_todoPulse_14f5c_1",FC="_activeText_14f5c_34",ZC="_checklist_14f5c_48",KC="_item_14f5c_55",YC="_itemIcon_14f5c_65",JC="_itemText_14f5c_73",WC="_pending_14f5c_78",XC="_in_progress_14f5c_85",QC="_completed_14f5c_97",eE="_emptyMessage_14f5c_108",os={progressBar:PC,progressFill:HC,activeTask:VC,activeIcon:qC,todoPulse:GC,activeText:FC,checklist:ZC,item:KC,itemIcon:YC,itemText:JC,pending:WC,in_progress:XC,completed:QC,emptyMessage:eE},tE=/^[-*]\s*\[([ xX~!/])\]\s*(.+)$/;function nE(t){if(t===void 0||typeof t!="object"||t===null)return[];const s=t;return Array.isArray(s.todos)?s.todos.filter(o=>typeof o=="object"&&o!==null&&typeof o.content=="string"&&typeof o.status=="string").map(o=>({content:o.content,activeForm:typeof o.activeForm=="string"?o.activeForm:void 0,status:yy(o.status)})):Array.isArray(s.plan)?s.plan.filter(o=>typeof o=="object"&&o!==null&&typeof o.step=="string"&&typeof o.status=="string").map(o=>({content:o.step,status:yy(o.status)})):typeof s.content=="string"?sE(s.content):[]}function yy(t){switch(t.toLowerCase()){case"completed":case"done":case"complete":return"completed";case"in_progress":case"in-progress":case"working":case"active":return"in_progress";default:return"pending"}}function sE(t){const s=t.split(`
|
|
239
|
-
`),o=[];for(const r of s){const c=tE.exec(r.trim());if(c){const d=c[1],u=c[2].trim();let p="pending";d==="x"||d==="X"?p="completed":(d==="~"||d==="/"||d==="!")&&(p="in_progress"),o.push({content:u,status:p})}}return o}function aE(t){switch(t){case"completed":return i.jsx(Ni,{size:ot});case"in_progress":return i.jsx(za,{size:ot,fill:"currentColor"});default:return i.jsx(za,{size:ot})}}function iE({args:t}){const s=nE(t),o=s.filter(d=>d.status==="completed").length,r=s.find(d=>d.status==="in_progress"),c=s.length===0;return i.jsxs("div",{className:`${O.card} ${O.cardBlue}`,"data-testid":"tool-card-todo",children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,children:i.jsx(N2,{size:en})}),i.jsx("span",{className:O.toolName,style:{color:"var(--accent-blue)"},children:c?"Todos cleared":"Todos"}),!c&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsxs("span",{className:O.badge,"data-testid":"tool-card-todo-progress",children:[o,"/",s.length]})]})]}),!c&&i.jsx("div",{className:os.progressBar,"data-testid":"tool-card-todo-bar",children:i.jsx("div",{className:os.progressFill,style:{width:`${o/s.length*100}%`}})}),r&&i.jsxs("div",{className:os.activeTask,"data-testid":"tool-card-todo-active",children:[i.jsx("span",{className:os.activeIcon,children:i.jsx(za,{size:ot,fill:"currentColor"})}),i.jsx("span",{className:os.activeText,children:r.activeForm||r.content})]}),!c&&i.jsx("div",{className:os.checklist,"data-testid":"tool-card-todo-list",children:s.map((d,u)=>i.jsxs("div",{className:`${os.item} ${os[d.status]}`,"data-testid":"tool-card-todo-item",children:[i.jsx("span",{className:os.itemIcon,children:aE(d.status)}),i.jsx("span",{className:os.itemText,children:d.content})]},u))}),c&&i.jsx("div",{className:os.emptyMessage,children:"All items completed and cleared."})]})}function oE(t,s){if(s==null||typeof s!="object")return"";const o=s;if(typeof o.intent=="string")return o.intent;for(const r of Object.values(o))if(typeof r=="string")return r;return t}function rE({tool:t,args:s}){const o=oE(t,s);return i.jsxs("div",{className:O.metadata,"data-testid":"tool-card-metadata",children:[i.jsx("span",{className:O.metadataPrefix,children:i.jsx(m2,{size:ot})}),o]})}function lE(t){if(t==null||typeof t!="object")return{};const s=t;return{title:typeof s.title=="string"?s.title:void 0,category:typeof s.category=="string"?s.category:void 0,tags:Array.isArray(s.tags)?s.tags:void 0}}function cE(t){if(!t)return{};try{const s=JSON.parse(t);if(Array.isArray(s))return{list:s.filter(o=>o!==null&&typeof o=="object")};if(typeof s=="object"&&s!==null)return{single:s}}catch{}return{}}const Wf=5,Xf=5;function dE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Uo(t),p=lE(s),m=o===void 0,{single:g,list:v}=cE(o),b=(g==null?void 0:g.title)??p.title,x=v?void 0:(g==null?void 0:g.category)??p.category,S=v?void 0:(g==null?void 0:g.tags)??p.tags;return i.jsxs("div",{className:`${O.card} ${r?O.cardRed:O.cardPurple} ${m?O.inProgress:""}`,"data-testid":"tool-card-finding",children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,"aria-hidden":"true",children:"💡"}),i.jsx("span",{className:O.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:u}),b&&i.jsxs("span",{className:O.fileName,"data-testid":"tool-card-finding-title",children:['"',b,'"']}),x&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsx("span",{className:O.badge,"data-testid":"tool-card-finding-category",children:x})]}),v&&!x&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsxs("span",{className:O.badge,"data-testid":"tool-card-finding-count",children:[v.length," ",v.length===1?"finding":"findings"]})]})]}),S&&S.length>0&&i.jsx("div",{className:O.pre,style:{padding:"4px 8px",whiteSpace:"normal"},"data-testid":"tool-card-finding-tags",children:S.map((k,w)=>i.jsxs("span",{style:{display:"inline-block",marginRight:"6px",opacity:.7,fontSize:"0.85em"},children:["#",k]},w))}),m&&!b&&s!==null&&s!==void 0&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-error",children:o}),!r&&(g==null?void 0:g.content)&&i.jsx(i.Fragment,{children:(()=>{const k=g.content.split(`
|
|
240
|
-
`),w=k.length>Xf,N=c?g.content:k.slice(0,Xf).join(`
|
|
241
|
-
`);return i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:O.pre,"data-testid":"tool-card-finding-content",children:N}),w&&i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{d(T=>!T)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${c?O.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${k.length-Xf} more lines`]})]})})()}),!r&&v&&v.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:O.pre,"data-testid":"tool-card-finding-list",children:(c?v:v.slice(0,Wf)).map((k,w)=>`${k.category?`[${k.category}] `:""}${k.title??k.id??`Finding ${w+1}`}`).join(`
|
|
242
|
-
`)}),v.length>Wf&&i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{d(k=>!k)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${c?O.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${v.length-Wf} more findings`]})]})]})}function uE(t){if(t==null||typeof t!="object")return{};const s=t;return{taskId:typeof s.taskId=="string"?s.taskId:void 0,title:typeof s.title=="string"?s.title:void 0,status:typeof s.status=="string"?s.status:void 0}}function fE(t){if(!t)return{};try{const s=JSON.parse(t);if(Array.isArray(s))return{list:s.filter(o=>o!==null&&typeof o=="object")};if(typeof s=="object"&&s!==null){const o=s;return typeof o.sessionId=="string"?{sessionId:o.sessionId,single:o}:{single:o}}}catch{}return{}}function by(t){switch(t){case"complete":case"completed":return"✓";case"working":case"in_progress":return"●";case"paused":return"⏸";case"failed":return"✗";default:return"○"}}function pE(t){switch(t){case"complete":case"completed":return"var(--accent-green, #4ade80)";case"working":case"in_progress":return"var(--accent-blue, #60a5fa)";case"failed":return"var(--accent-red, #f87171)";case"paused":return"var(--text-tertiary, #888)";default:return"var(--text-secondary, #aaa)"}}const Qf=5;function mE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Uo(t),p=uE(s),m=o===void 0,{single:g,list:v,sessionId:b}=fE(o),x=(g==null?void 0:g.title)??p.title,S=(g==null?void 0:g.status)??p.status;return i.jsxs("div",{className:`${O.card} ${r?O.cardRed:O.cardBlue} ${m?O.inProgress:""}`,"data-testid":"tool-card-task",children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,"aria-hidden":"true",children:"📋"}),i.jsx("span",{className:O.toolName,style:{color:"var(--accent-blue)"},children:u}),x&&i.jsxs("span",{className:O.fileName,"data-testid":"tool-card-task-title",children:['"',x,'"']}),!x&&p.taskId&&i.jsx("span",{className:O.fileName,"data-testid":"tool-card-task-id",children:p.taskId}),S&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsxs("span",{className:O.badge,style:{color:pE(S)},"data-testid":"tool-card-task-status",children:[by(S)," ",S]})]}),v&&!S&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsxs("span",{className:O.badge,"data-testid":"tool-card-task-count",children:[v.length," ",v.length===1?"task":"tasks"]})]})]}),m&&!x&&!p.taskId&&s!==null&&s!==void 0&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-error",children:o}),!r&&b&&i.jsxs("div",{className:O.pre,style:{padding:"4px 8px",fontSize:"0.85em"},"data-testid":"tool-card-task-session",children:["session: ",b]}),!r&&g&&!v&&!b&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-task-detail",children:[g.id?`id: ${g.id}`:null,g.status?`status: ${g.status}`:null,g.branch?`branch: ${g.branch}`:null,g.latestSessionId?`session: ${g.latestSessionId}`:null].filter(Boolean).join(`
|
|
243
|
-
`)}),!r&&v&&v.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:O.pre,"data-testid":"tool-card-task-list",children:(c?v:v.slice(0,Qf)).map(k=>{const w=by(k.status),N=k.title??k.id??"untitled";return`${w} ${N}`}).join(`
|
|
244
|
-
`)}),v.length>Qf&&i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{d(k=>!k)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${c?O.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${v.length-Qf} more tasks`]})]})]})}function hE(t){if(t==null||typeof t!="object")return{};const s=t;return{status:typeof s.status=="string"?s.status:void 0,summary:typeof s.summary=="string"?s.summary:void 0}}function gE(t){if(!t)return{};try{const s=JSON.parse(t);if(typeof s!="object"||s===null)return{};const o=s,r=typeof o.workpad=="object"&&o.workpad!==null?o.workpad:o;return{status:typeof r.status=="string"?r.status:void 0,summary:typeof r.summary=="string"?r.summary:void 0,extra:typeof r.extra=="object"&&r.extra!==null?r.extra:void 0}}catch{}return{}}function vE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Uo(t),p=hE(s),m=o===void 0,g=gE(o),v=g.status??p.status,b=g.summary??p.summary;return i.jsxs("div",{className:`${O.card} ${r?O.cardRed:O.cardGreen} ${m?O.inProgress:""}`,"data-testid":"tool-card-workpad",children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,"aria-hidden":"true",children:"📓"}),i.jsx("span",{className:O.toolName,style:{color:"var(--accent-green, #4ade80)"},children:u}),v&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsx("span",{className:O.badge,"data-testid":"tool-card-workpad-status",children:v})]})]}),b&&i.jsx("pre",{className:O.pre,style:{whiteSpace:"pre-wrap"},"data-testid":"tool-card-workpad-summary",children:b}),m&&!b&&s!==null&&s!==void 0&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-error",children:o}),!r&&!m&&o&&!b&&!v&&!g.extra&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-result",children:o}),!r&&g.extra&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{d(x=>!x)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${c?O.chevronExpanded:""}`,children:"▸"}),c?"collapse":"extra data"]}),c&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-workpad-extra",children:JSON.stringify(g.extra,null,2)})]})]})}function yE(t){if(t==null||typeof t!="object")return{};const s=t;return{query:typeof s.query=="string"?s.query:void 0,id:typeof s.id=="string"?s.id:void 0}}function bE(t){if(!t)return{};try{const s=JSON.parse(t);if(typeof s!="object"||s===null)return{};const o=s;if(Array.isArray(o.results))return{results:o.results.filter(r=>r!==null&&typeof r=="object")};if(typeof o.node=="object"&&o.node!==null){const r=Array.isArray(o.edges)?o.edges.length:0;return{node:o.node,edgeCount:r}}if(typeof o.id=="string")return{node:o}}catch{}return{}}const ep=5;function xE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Uo(t),p=yE(s),m=o===void 0,g=bE(o);return i.jsxs("div",{className:`${O.card} ${r?O.cardRed:O.cardPurple} ${m?O.inProgress:""}`,"data-testid":"tool-card-knowledge",children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,"aria-hidden":"true",children:"🧠"}),i.jsx("span",{className:O.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:u}),p.query&&i.jsxs("span",{className:O.fileName,"data-testid":"tool-card-knowledge-query",children:['"',p.query,'"']}),p.id&&!p.query&&i.jsx("span",{className:O.fileName,"data-testid":"tool-card-knowledge-id",children:p.id}),g.results&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsxs("span",{className:O.badge,"data-testid":"tool-card-knowledge-count",children:[g.results.length," ",g.results.length===1?"result":"results"]})]}),g.node&&g.edgeCount!==void 0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsxs("span",{className:O.badge,"data-testid":"tool-card-knowledge-edges",children:[g.edgeCount," ",g.edgeCount===1?"edge":"edges"]})]})]}),m&&s!==null&&s!==void 0&&!p.query&&!p.id&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-error",children:o}),!r&&g.results&&g.results.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:O.pre,"data-testid":"tool-card-knowledge-results",children:(c?g.results:g.results.slice(0,ep)).map(v=>{var S,k,w;const b=((S=v.node)==null?void 0:S.title)??((k=v.node)==null?void 0:k.label)??((w=v.node)==null?void 0:w.id)??"node",x=v.score!==void 0?` (${(v.score*100).toFixed(0)}%)`:"";return`${b}${x}`}).join(`
|
|
245
|
-
`)}),g.results.length>ep&&i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{d(v=>!v)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${c?O.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${g.results.length-ep} more results`]})]}),!r&&g.node&&!g.results&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-knowledge-node",children:[g.node.id?`id: ${g.node.id}`:null,g.node.title?`title: ${g.node.title}`:null,g.node.category?`category: ${g.node.category}`:null,g.node.kind?`kind: ${g.node.kind}`:null,g.node.content?`content: ${g.node.content.length>100?g.node.content.slice(0,100)+"...":g.node.content}`:null].filter(Boolean).join(`
|
|
246
|
-
`)})]})}function _E(t){if(t==null||typeof t!="object")return{};const s=t;return{fd:typeof s.fd=="number"?s.fd:void 0,pipe:typeof s.pipe=="string"?s.pipe:void 0,prompt:typeof s.prompt=="string"?s.prompt:void 0,name:typeof s.name=="string"?s.name:void 0,message:typeof s.message=="string"?s.message:void 0}}function kE(t){if(!t)return{};try{const s=JSON.parse(t);if(typeof s!="object"||s===null)return{};const o=s;return{sessionId:typeof o.sessionId=="string"?o.sessionId:void 0,fd:typeof o.fd=="number"?o.fd:void 0,fds:Array.isArray(o.fds)?o.fds.filter(r=>r!==null&&typeof r=="object"):void 0,success:typeof o.success=="boolean"?o.success:void 0,output:typeof o.output=="string"?o.output:void 0}}catch{}return{}}function SE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Uo(t),p=_E(s),m=o===void 0,g=kE(o);let v="";p.pipe?v=`[${p.pipe}]`:p.fd!==void 0?v=`fd:${p.fd}`:p.name&&(v=`"${p.name}"`);const b=p.prompt?p.prompt.length>60?`${p.prompt.slice(0,60)}...`:p.prompt:void 0;return i.jsxs("div",{className:`${O.card} ${r?O.cardRed:O.cardOrange} ${m?O.inProgress:""}`,"data-testid":"tool-card-ipc",children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,"aria-hidden":"true",children:"🔀"}),i.jsx("span",{className:O.toolName,style:{color:"var(--accent-yellow, #fbbf24)"},children:u}),v&&i.jsx("span",{className:O.fileName,"data-testid":"tool-card-ipc-info",children:v}),b&&i.jsx("span",{className:O.fileName,title:p.prompt,"data-testid":"tool-card-ipc-prompt",children:b}),g.fds&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsxs("span",{className:O.badge,"data-testid":"tool-card-ipc-fd-count",children:[g.fds.length," ",g.fds.length===1?"fd":"fds"]})]}),g.success!==void 0&&!g.fds&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsx("span",{className:O.badge,style:{color:g.success?"var(--accent-green, #4ade80)":"var(--accent-red, #f87171)"},"data-testid":"tool-card-ipc-success",children:g.success?"✓ ok":"✗ failed"})]})]}),m&&!b&&!v&&s!==null&&s!==void 0&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-error",children:o}),!r&&g.sessionId&&i.jsxs("div",{className:O.pre,style:{padding:"4px 8px",fontSize:"0.85em"},"data-testid":"tool-card-ipc-session",children:["session: ",g.sessionId,g.fd!==void 0&&` | fd: ${g.fd}`]}),!r&&g.output&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-ipc-output",children:g.output}),!r&&g.fds&&g.fds.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:O.pre,"data-testid":"tool-card-ipc-fds",children:(c?g.fds:g.fds.slice(0,5)).map(x=>{const S=[`fd:${x.fd??"?"}`,x.permission??"",x.deliveryMode??""];return x.streamName&&S.push(x.streamName),x.owned&&S.push("(owned)"),S.filter(Boolean).join(" ")}).join(`
|
|
247
|
-
`)}),g.fds.length>5&&i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{d(x=>!x)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${c?O.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${g.fds.length-5} more fds`]})]})]})}function TE(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.query=="string"?s.query:""}const tp=8;function wE({args:t,result:s,isError:o}){const[r,c]=y.useState(!1),d=TE(t),u=s===void 0,p=(s==null?void 0:s.split(`
|
|
248
|
-
`))??[],m=p.length>tp,g=r?s:p.slice(0,tp).join(`
|
|
249
|
-
`);return i.jsxs("div",{className:`${O.card} ${o?O.cardRed:O.cardNeutral} ${u?O.inProgress:""}`,"data-testid":"tool-card-tool-search",children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,"aria-hidden":"true",children:"🔧"}),i.jsx("span",{className:O.toolName,children:"ToolSearch"}),d&&i.jsxs("span",{className:O.fileName,"data-testid":"tool-card-tool-search-query",children:['"',d,'"']}),!u&&!o&&s&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:O.spacer}),i.jsxs("span",{className:O.badge,"data-testid":"tool-card-tool-search-count",children:[p.length," lines"]})]})]}),u&&!d&&t!==null&&t!==void 0&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-args",children:JSON.stringify(t,null,2)}),o&&s&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-error",children:s}),!o&&!u&&s&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:O.pre,"data-testid":"tool-card-tool-search-result",children:g}),m&&i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{c(v=>!v)},"aria-expanded":r,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${r?O.chevronExpanded:""}`,children:"▸"}),r?"collapse":`${p.length-tp} more lines`]})]})]})}function jE(t){const s=/^mcp__([^_]+(?:_[^_]+)*)__(.+)$/.exec(t);return s?{display:`${s[1]} / ${s[2]}`,isMcp:!0}:{display:t,isMcp:!1}}function NE(t){if(t==null)return"";if(typeof t!="object")return String(t);const s=t;if(typeof s.command=="string")return s.command;if(typeof s.file_path=="string")return s.file_path;if(typeof s.path=="string")return s.path;if(typeof s.query=="string")return s.query;if(typeof s.url=="string")return s.url;try{const o=JSON.stringify(t);return o.length>120?`${o.slice(0,120)}…`:o}catch{return""}}const np=5;function CE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),{display:u}=jE(t),p=NE(s),m=o===void 0,g=(o==null?void 0:o.split(`
|
|
250
|
-
`))??[],v=g.length>np,b=c?o:g.slice(0,np).join(`
|
|
251
|
-
`);let x="";if(s!=null)try{x=JSON.stringify(s,null,2)}catch{x=String(s)}return i.jsxs("div",{className:`${O.card} ${r?O.cardRed:O.cardBlue} ${m?O.inProgress:""}`,"data-testid":"tool-card-generic",children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,children:i.jsx(d2,{size:en,"aria-hidden":"true"})}),i.jsx("span",{className:O.toolName,style:{color:"var(--accent-blue)"},children:u}),p&&i.jsx("span",{className:O.fileName,children:p})]}),m&&x&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-args",children:x}),r&&o&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-error",children:o}),!r&&!m&&o&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:O.pre,"data-testid":"tool-card-result",children:b}),v&&i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{d(S=>!S)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${c?O.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(aa,{size:ot})}),c?"collapse":`${g.length-np} more lines`]})]})]})}const EE="_badgePill_o7eqc_1",AE="_modelBadge_o7eqc_14",DE="_backgroundBadge_o7eqc_26",RE="_backgroundDot_o7eqc_36",ME="_backgroundDotPulsing_o7eqc_41",IE="_description_o7eqc_55",OE="_statusLine_o7eqc_62",BE="_statusCompleted_o7eqc_72",LE="_statusRunning_o7eqc_77",zE="_statusError_o7eqc_83",$E="_promptToggle_o7eqc_88",rs={badgePill:EE,modelBadge:AE,backgroundBadge:DE,backgroundDot:RE,backgroundDotPulsing:ME,description:IE,statusLine:OE,statusCompleted:BE,statusRunning:LE,statusError:zE,promptToggle:$E};function UE(t,s){if(s==null||typeof s!="object")return{};const o=s;return t.toLowerCase()==="read_agent"?{agentId:typeof o.agent_id=="string"?o.agent_id:void 0,isPoll:!0}:typeof o.agent_type=="string"||typeof o.name=="string"?{agentType:typeof o.agent_type=="string"?o.agent_type:void 0,description:typeof o.description=="string"?o.description:void 0,prompt:typeof o.prompt=="string"?o.prompt:void 0,isBackground:o.mode==="background",agentName:typeof o.name=="string"?o.name:void 0}:{agentType:typeof o.subagent_type=="string"?o.subagent_type:void 0,description:typeof o.description=="string"?o.description:void 0,prompt:typeof o.prompt=="string"?o.prompt:void 0,isBackground:o.run_in_background===!0,model:typeof o.model=="string"?o.model:void 0,isResume:typeof o.resume=="string"&&o.resume.length>0}}const PE=/^Agent\s+(completed|running|failed|error)\.\s*agent_id:\s*(\S+),?\s*([^\n]*)(?:\n\n([\s\S]*))?$/i;function HE(t){const s=PE.exec(t);if(!s)return;const o=s[4];return{status:s[1].toLowerCase(),agentId:s[2].replace(/,$/,""),metadata:s[3].trim(),content:o?o.trim():void 0}}const sp=5;function VE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),[u,p]=y.useState(!1),m=UE(t,s),g=o===void 0,v=m.isPoll&&o?HE(o):void 0,b=(v==null?void 0:v.content)??o,x=(b==null?void 0:b.split(`
|
|
252
|
-
`))??[],S=x.length>sp,k=c?b:x.slice(0,sp).join(`
|
|
253
|
-
`),w=m.isPoll?"Subagent":"Agent";return i.jsxs("div",{className:`${O.card} ${r?O.cardRed:O.cardTeal} ${g?O.inProgress:""}`,"data-testid":"tool-card-agent",children:[i.jsxs("div",{className:O.header,children:[i.jsx("span",{className:O.icon,style:{color:"var(--accent-teal, #2dd4bf)"},children:"▶"}),i.jsx("span",{className:O.toolName,style:{color:"var(--accent-teal, #2dd4bf)"},children:w}),m.agentType&&i.jsx("span",{className:rs.badgePill,"data-testid":"tool-card-agent-type",children:m.agentType}),m.model&&i.jsx("span",{className:rs.modelBadge,"data-testid":"tool-card-agent-model",children:m.model}),m.isBackground&&i.jsxs("span",{className:rs.backgroundBadge,"data-testid":"tool-card-agent-background",children:[i.jsx("span",{className:g?rs.backgroundDotPulsing:rs.backgroundDot,children:"●"}),"BG"]}),m.agentName&&i.jsx("span",{className:O.fileName,"data-testid":"tool-card-agent-name",children:m.agentName}),m.agentId&&i.jsx("span",{className:O.fileName,"data-testid":"tool-card-agent-id",children:m.agentId}),i.jsx("span",{className:O.spacer}),g&&!m.isBackground&&i.jsx("span",{className:O.exitPending,"data-testid":"tool-card-pending",children:"●"})]}),m.description&&i.jsx("div",{className:rs.description,"data-testid":"tool-card-agent-description",children:m.isResume?`Resuming: ${m.description}`:m.description}),v&&i.jsxs("div",{className:rs.statusLine,"data-testid":"tool-card-agent-status",children:[i.jsx("span",{className:v.status==="completed"?rs.statusCompleted:v.status==="running"?rs.statusRunning:rs.statusError,children:v.status}),v.metadata&&i.jsx("span",{children:v.metadata})]}),m.prompt&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:rs.promptToggle,onClick:()=>{p(N=>!N)},"aria-expanded":u,"data-testid":"tool-card-prompt-toggle",children:[i.jsx("span",{className:`${O.chevron} ${u?O.chevronExpanded:""}`,children:"▸"}),"prompt"]}),u&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-prompt",children:m.prompt})]}),r&&o&&i.jsx("pre",{className:O.pre,"data-testid":"tool-card-error",children:o}),!r&&!g&&b&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:O.pre,"data-testid":"tool-card-result",children:k}),S&&i.jsxs("button",{type:"button",className:O.bodyToggle,onClick:()=>{d(N=>!N)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${O.chevron} ${c?O.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${x.length-sp} more lines`]})]})]})}function ap(t){switch(KN(t.tool)){case"file-read":return i.jsx(vy,{...t});case"file-edit":return i.jsx(MC,{...t});case"file-write":return i.jsx(vy,{...t,writeVariant:!0});case"shell":return i.jsx(zC,{...t});case"search":return i.jsx(UC,{...t});case"todo":return i.jsx(iE,{...t});case"metadata":return i.jsx(rE,{...t});case"finding":return i.jsx(dE,{...t});case"task":return i.jsx(mE,{...t});case"workpad":return i.jsx(vE,{...t});case"knowledge":return i.jsx(xE,{...t});case"ipc":return i.jsx(SE,{...t});case"tool-search":return i.jsx(wE,{...t});case"agent":return i.jsx(VE,{...t});default:return i.jsx(CE,{...t})}}const qE="_systemContextEvent_hmqlm_1",GE="_systemContextHeader_hmqlm_7",FE="_systemContextBadge_hmqlm_28",ZE="_systemContextToggle_hmqlm_37",KE="_systemContextPre_hmqlm_43",YE="_systemContextEllipsis_hmqlm_54",JE="_systemEvent_hmqlm_58",WE="_systemTimestamp_hmqlm_65",XE="_textEvent_hmqlm_69",QE="_codeBlockWrapper_hmqlm_156",eA="_codeBlockCopyButton_hmqlm_159",tA="_errorEvent_hmqlm_163",nA="_statusEvent_hmqlm_171",sA="_userInputEvent_hmqlm_180",aA="_userInputContent_hmqlm_186",iA="_signalEvent_hmqlm_203",oA="_signalBadge_hmqlm_214",rA="_signalContent_hmqlm_223",lA="_usageEvent_hmqlm_228",cA="_usageBadge_hmqlm_235",dA="_defaultEvent_hmqlm_244",zt={systemContextEvent:qE,systemContextHeader:GE,systemContextBadge:FE,systemContextToggle:ZE,systemContextPre:KE,systemContextEllipsis:YE,systemEvent:JE,systemTimestamp:WE,textEvent:XE,codeBlockWrapper:QE,codeBlockCopyButton:eA,errorEvent:tA,statusEvent:nA,userInputEvent:sA,userInputContent:aA,signalEvent:iA,signalBadge:oA,signalContent:rA,usageEvent:lA,usageBadge:cA,defaultEvent:dA},xy=3;function uA({content:t}){const[s,o]=y.useState(!1),r=t.split(`
|
|
254
|
-
`),c=r.length>xy,d=s?t:r.slice(0,xy).join(`
|
|
255
|
-
`);return i.jsxs("div",{className:zt.systemContextEvent,"data-testid":"system-context-event",children:[i.jsxs("button",{type:"button",className:zt.systemContextHeader,onClick:()=>{o(u=>!u)},"aria-expanded":s,children:[i.jsx("span",{className:zt.systemContextBadge,children:"SYSTEM PROMPT"}),c&&i.jsx("span",{className:zt.systemContextToggle,"aria-hidden":"true",children:s?i.jsx(fx,{size:ot}):i.jsx(aa,{size:ot})})]}),i.jsxs("pre",{className:zt.systemContextPre,children:[d,!s&&c&&i.jsx("span",{className:zt.systemContextEllipsis,children:"…"})]})]})}function fA({time:t,content:s}){return i.jsxs("div",{className:zt.systemEvent,children:[i.jsxs("span",{className:zt.systemTimestamp,children:["[",t,"]"]})," ",s]})}function Op(t){return typeof t=="string"?t:typeof t=="number"?String(t):Array.isArray(t)?t.map(Op).join(""):t!=null&&typeof t=="object"&&"props"in t?Op(t.props.children):""}function pA({children:t,node:s,...o}){const r=Op(t);return i.jsxs("div",{className:zt.codeBlockWrapper,children:[i.jsx("pre",{...o,children:t}),i.jsx(jN,{text:r,"data-testid":"copy-code-block",className:zt.codeBlockCopyButton})]})}const mA={pre:pA};function hA({content:t}){return i.jsx("div",{className:zt.textEvent,children:i.jsx(md,{remarkPlugins:[hd],rehypePlugins:[FN],components:mA,children:t})})}function gA({content:t}){return i.jsxs("div",{className:zt.errorEvent,children:["Error: ",t]})}function vA({content:t}){return i.jsxs("div",{className:zt.statusEvent,children:["--- ",t," ---"]})}function yA({content:t}){return i.jsx("div",{className:zt.userInputEvent,children:i.jsx("span",{className:zt.userInputContent,children:t})})}function bA({content:t}){return i.jsxs("div",{className:zt.signalEvent,"data-testid":"signal-event",children:[i.jsx("span",{className:zt.signalBadge,children:"SIGNAL"}),i.jsx("span",{className:zt.signalContent,children:t})]})}function xA({content:t}){let s=t;try{const o=JSON.parse(t),r=Number(o.input_tokens)||0,c=Number(o.output_tokens)||0,d=Mo(r+c),u=Ss(Number(o.cost_usd)||0);s=`${d} tokens · ${u}`}catch{}return i.jsx("div",{className:zt.usageEvent,"data-testid":"usage-event",children:i.jsx("span",{className:zt.usageBadge,children:s})})}function _A({content:t}){return i.jsx("div",{className:zt.defaultEvent,children:t})}function kA({event:t,toolUseCtx:s,settled:o}){const r=new Date(t.timestamp).toLocaleTimeString();switch(t.eventType){case"system":{if(t.raw)try{if(JSON.parse(t.raw).systemContext===!0)return i.jsx(uA,{content:t.content})}catch{}return i.jsx(fA,{time:r,content:t.content})}case"text":case"output":return i.jsx(hA,{content:t.content});case"tool_use":{let c="",d={};try{const u=JSON.parse(t.content);c=u.tool||"",d=u.args}catch{}return i.jsx(ap,{tool:c,args:d,result:o?"":void 0})}case"tool_result":{let c=!1;if(t.raw)try{c=JSON.parse(t.raw).is_error===!0}catch{}let d=t.content;if(t.content.trimStart().startsWith("{"))try{const u=JSON.parse(t.content);typeof u.content=="string"&&(d=u.content)}catch{}return s?i.jsx(ap,{tool:s.tool,args:s.args,result:d,isError:c,detailedResult:s.detailedResult}):i.jsx(ap,{tool:"Tool output",args:void 0,result:d,isError:c})}case"error":return i.jsx(gA,{content:t.content});case"status":return i.jsx(vA,{content:t.content});case"user_input":return i.jsx(yA,{content:t.content});case"signal":return i.jsx(bA,{content:t.content});case"usage":return i.jsx(xA,{content:t.content});default:return i.jsx(_A,{content:t.content})}}const gm=y.createContext({});function vm(t){const s=y.useRef(null);return s.current===null&&(s.current=t()),s.current}const _d=y.createContext(null),ym=y.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class SA extends y.Component{getSnapshotBeforeUpdate(s){const o=this.props.childRef.current;if(o&&s.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=o.offsetHeight||0,r.width=o.offsetWidth||0,r.top=o.offsetTop,r.left=o.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function TA({children:t,isPresent:s}){const o=y.useId(),r=y.useRef(null),c=y.useRef({width:0,height:0,top:0,left:0}),{nonce:d}=y.useContext(ym);return y.useInsertionEffect(()=>{const{width:u,height:p,top:m,left:g}=c.current;if(s||!r.current||!u||!p)return;r.current.dataset.motionPopId=o;const v=document.createElement("style");return d&&(v.nonce=d),document.head.appendChild(v),v.sheet&&v.sheet.insertRule(`
|
|
256
|
-
[data-motion-pop-id="${o}"] {
|
|
257
|
-
position: absolute !important;
|
|
258
|
-
width: ${u}px !important;
|
|
259
|
-
height: ${p}px !important;
|
|
260
|
-
top: ${m}px !important;
|
|
261
|
-
left: ${g}px !important;
|
|
262
|
-
}
|
|
263
|
-
`),()=>{document.head.removeChild(v)}},[s]),i.jsx(SA,{isPresent:s,childRef:r,sizeRef:c,children:y.cloneElement(t,{ref:r})})}const wA=({children:t,initial:s,isPresent:o,onExitComplete:r,custom:c,presenceAffectsLayout:d,mode:u})=>{const p=vm(jA),m=y.useId(),g=y.useCallback(b=>{p.set(b,!0);for(const x of p.values())if(!x)return;r&&r()},[p,r]),v=y.useMemo(()=>({id:m,initial:s,isPresent:o,custom:c,onExitComplete:g,register:b=>(p.set(b,!1),()=>p.delete(b))}),d?[Math.random(),g]:[o,g]);return y.useMemo(()=>{p.forEach((b,x)=>p.set(x,!1))},[o]),y.useEffect(()=>{!o&&!p.size&&r&&r()},[o]),u==="popLayout"&&(t=i.jsx(TA,{isPresent:o,children:t})),i.jsx(_d.Provider,{value:v,children:t})};function jA(){return new Map}function zx(t=!0){const s=y.useContext(_d);if(s===null)return[!0,null];const{isPresent:o,onExitComplete:r,register:c}=s,d=y.useId();y.useEffect(()=>{t&&c(d)},[t]);const u=y.useCallback(()=>t&&r&&r(d),[d,r,t]);return!o&&r?[!1,u]:[!0]}const Rc=t=>t.key||"";function _y(t){const s=[];return y.Children.forEach(t,o=>{y.isValidElement(o)&&s.push(o)}),s}const bm=typeof window<"u",$x=bm?y.useLayoutEffect:y.useEffect,ps=({children:t,custom:s,initial:o=!0,onExitComplete:r,presenceAffectsLayout:c=!0,mode:d="sync",propagate:u=!1})=>{const[p,m]=zx(u),g=y.useMemo(()=>_y(t),[t]),v=u&&!p?[]:g.map(Rc),b=y.useRef(!0),x=y.useRef(g),S=vm(()=>new Map),[k,w]=y.useState(g),[N,T]=y.useState(g);$x(()=>{b.current=!1,x.current=g;for(let B=0;B<N.length;B++){const A=Rc(N[B]);v.includes(A)?S.delete(A):S.get(A)!==!0&&S.set(A,!1)}},[N,v.length,v.join("-")]);const C=[];if(g!==k){let B=[...g];for(let A=0;A<N.length;A++){const M=N[A],D=Rc(M);v.includes(D)||(B.splice(A,0,M),C.push(M))}d==="wait"&&C.length&&(B=C),T(_y(B)),w(g);return}const{forceRender:R}=y.useContext(gm);return i.jsx(i.Fragment,{children:N.map(B=>{const A=Rc(B),M=u&&!p?!1:g===N||v.includes(A),D=()=>{if(S.has(A))S.set(A,!0);else return;let z=!0;S.forEach(U=>{U||(z=!1)}),z&&(R==null||R(),T(x.current),u&&(m==null||m()),r&&r())};return i.jsx(wA,{isPresent:M,initial:!b.current||o?void 0:!1,custom:M?void 0:s,presenceAffectsLayout:c,mode:d,onExitComplete:M?void 0:D,children:B},A)})})},Mn=t=>t;let Ux=Mn;const NA={useManualTiming:!1};function CA(t){let s=new Set,o=new Set,r=!1,c=!1;const d=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function p(g){d.has(g)&&(m.schedule(g),t()),g(u)}const m={schedule:(g,v=!1,b=!1)=>{const S=b&&r?s:o;return v&&d.add(g),S.has(g)||S.add(g),g},cancel:g=>{o.delete(g),d.delete(g)},process:g=>{if(u=g,r){c=!0;return}r=!0,[s,o]=[o,s],s.forEach(p),s.clear(),r=!1,c&&(c=!1,m.process(g))}};return m}const Mc=["read","resolveKeyframes","update","preRender","render","postRender"],EA=40;function Px(t,s){let o=!1,r=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=()=>o=!0,u=Mc.reduce((T,C)=>(T[C]=CA(d),T),{}),{read:p,resolveKeyframes:m,update:g,preRender:v,render:b,postRender:x}=u,S=()=>{const T=performance.now();o=!1,c.delta=r?1e3/60:Math.max(Math.min(T-c.timestamp,EA),1),c.timestamp=T,c.isProcessing=!0,p.process(c),m.process(c),g.process(c),v.process(c),b.process(c),x.process(c),c.isProcessing=!1,o&&s&&(r=!1,t(S))},k=()=>{o=!0,r=!0,c.isProcessing||t(S)};return{schedule:Mc.reduce((T,C)=>{const R=u[C];return T[C]=(B,A=!1,M=!1)=>(o||k(),R.schedule(B,A,M)),T},{}),cancel:T=>{for(let C=0;C<Mc.length;C++)u[Mc[C]].cancel(T)},state:c,steps:u}}const{schedule:xt,cancel:Pa,state:rn,steps:ip}=Px(typeof requestAnimationFrame<"u"?requestAnimationFrame:Mn,!0),Hx=y.createContext({strict:!1}),ky={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"]},Io={};for(const t in ky)Io[t]={isEnabled:s=>ky[t].some(o=>!!s[o])};function AA(t){for(const s in t)Io[s]={...Io[s],...t[s]}}const DA=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 ed(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||DA.has(t)}let Vx=t=>!ed(t);function RA(t){t&&(Vx=s=>s.startsWith("on")?!ed(s):t(s))}try{RA(require("@emotion/is-prop-valid").default)}catch{}function MA(t,s,o){const r={};for(const c in t)c==="values"&&typeof t.values=="object"||(Vx(c)||o===!0&&ed(c)||!s&&!ed(c)||t.draggable&&c.startsWith("onDrag"))&&(r[c]=t[c]);return r}function IA(t){if(typeof Proxy>"u")return t;const s=new Map,o=(...r)=>t(...r);return new Proxy(o,{get:(r,c)=>c==="create"?t:(s.has(c)||s.set(c,t(c)),s.get(c))})}const kd=y.createContext({});function nl(t){return typeof t=="string"||Array.isArray(t)}function Sd(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const xm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_m=["initial",...xm];function Td(t){return Sd(t.animate)||_m.some(s=>nl(t[s]))}function qx(t){return!!(Td(t)||t.variants)}function OA(t,s){if(Td(t)){const{initial:o,animate:r}=t;return{initial:o===!1||nl(o)?o:void 0,animate:nl(r)?r:void 0}}return t.inherit!==!1?s:{}}function BA(t){const{initial:s,animate:o}=OA(t,y.useContext(kd));return y.useMemo(()=>({initial:s,animate:o}),[Sy(s),Sy(o)])}function Sy(t){return Array.isArray(t)?t.join(" "):t}const LA=Symbol.for("motionComponentSymbol");function To(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function zA(t,s,o){return y.useCallback(r=>{r&&t.onMount&&t.onMount(r),s&&(r?s.mount(r):s.unmount()),o&&(typeof o=="function"?o(r):To(o)&&(o.current=r))},[s])}const km=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),$A="framerAppearId",Gx="data-"+km($A),{schedule:Sm}=Px(queueMicrotask,!1),Fx=y.createContext({});function UA(t,s,o,r,c){var d,u;const{visualElement:p}=y.useContext(kd),m=y.useContext(Hx),g=y.useContext(_d),v=y.useContext(ym).reducedMotion,b=y.useRef(null);r=r||m.renderer,!b.current&&r&&(b.current=r(t,{visualState:s,parent:p,props:o,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:v}));const x=b.current,S=y.useContext(Fx);x&&!x.projection&&c&&(x.type==="html"||x.type==="svg")&&PA(b.current,o,c,S);const k=y.useRef(!1);y.useInsertionEffect(()=>{x&&k.current&&x.update(o,g)});const w=o[Gx],N=y.useRef(!!w&&!(!((d=window.MotionHandoffIsComplete)===null||d===void 0)&&d.call(window,w))&&((u=window.MotionHasOptimisedAnimation)===null||u===void 0?void 0:u.call(window,w)));return $x(()=>{x&&(k.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),Sm.render(x.render),N.current&&x.animationState&&x.animationState.animateChanges())}),y.useEffect(()=>{x&&(!N.current&&x.animationState&&x.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)===null||T===void 0||T.call(window,w)}),N.current=!1))}),x}function PA(t,s,o,r){const{layoutId:c,layout:d,drag:u,dragConstraints:p,layoutScroll:m,layoutRoot:g}=s;t.projection=new o(t.latestValues,s["data-framer-portal-id"]?void 0:Zx(t.parent)),t.projection.setOptions({layoutId:c,layout:d,alwaysMeasureLayout:!!u||p&&To(p),visualElement:t,animationType:typeof d=="string"?d:"both",initialPromotionConfig:r,layoutScroll:m,layoutRoot:g})}function Zx(t){if(t)return t.options.allowProjection!==!1?t.projection:Zx(t.parent)}function HA({preloadedFeatures:t,createVisualElement:s,useRender:o,useVisualState:r,Component:c}){var d,u;t&&AA(t);function p(g,v){let b;const x={...y.useContext(ym),...g,layoutId:VA(g)},{isStatic:S}=x,k=BA(g),w=r(g,S);if(!S&&bm){qA();const N=GA(x);b=N.MeasureLayout,k.visualElement=UA(c,w,x,s,N.ProjectionNode)}return i.jsxs(kd.Provider,{value:k,children:[b&&k.visualElement?i.jsx(b,{visualElement:k.visualElement,...x}):null,o(c,g,zA(w,k.visualElement,v),w,S,k.visualElement)]})}p.displayName=`motion.${typeof c=="string"?c:`create(${(u=(d=c.displayName)!==null&&d!==void 0?d:c.name)!==null&&u!==void 0?u:""})`}`;const m=y.forwardRef(p);return m[LA]=c,m}function VA({layoutId:t}){const s=y.useContext(gm).id;return s&&t!==void 0?s+"-"+t:t}function qA(t,s){y.useContext(Hx).strict}function GA(t){const{drag:s,layout:o}=Io;if(!s&&!o)return{};const r={...s,...o};return{MeasureLayout:s!=null&&s.isEnabled(t)||o!=null&&o.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const FA=["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 Tm(t){return typeof t!="string"||t.includes("-")?!1:!!(FA.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ty(t){const s=[{},{}];return t==null||t.values.forEach((o,r)=>{s[0][r]=o.get(),s[1][r]=o.getVelocity()}),s}function wm(t,s,o,r){if(typeof s=="function"){const[c,d]=Ty(r);s=s(o!==void 0?o:t.custom,c,d)}if(typeof s=="string"&&(s=t.variants&&t.variants[s]),typeof s=="function"){const[c,d]=Ty(r);s=s(o!==void 0?o:t.custom,c,d)}return s}const Bp=t=>Array.isArray(t),ZA=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),KA=t=>Bp(t)?t[t.length-1]||0:t,dn=t=>!!(t&&t.getVelocity);function Zc(t){const s=dn(t)?t.get():t;return ZA(s)?s.toValue():s}function YA({scrapeMotionValuesFromProps:t,createRenderState:s,onUpdate:o},r,c,d){const u={latestValues:JA(r,c,d,t),renderState:s()};return o&&(u.onMount=p=>o({props:r,current:p,...u}),u.onUpdate=p=>o(p)),u}const Kx=t=>(s,o)=>{const r=y.useContext(kd),c=y.useContext(_d),d=()=>YA(t,s,r,c);return o?d():vm(d)};function JA(t,s,o,r){const c={},d=r(t,{});for(const x in d)c[x]=Zc(d[x]);let{initial:u,animate:p}=t;const m=Td(t),g=qx(t);s&&g&&!m&&t.inherit!==!1&&(u===void 0&&(u=s.initial),p===void 0&&(p=s.animate));let v=o?o.initial===!1:!1;v=v||u===!1;const b=v?p:u;if(b&&typeof b!="boolean"&&!Sd(b)){const x=Array.isArray(b)?b:[b];for(let S=0;S<x.length;S++){const k=wm(t,x[S]);if(k){const{transitionEnd:w,transition:N,...T}=k;for(const C in T){let R=T[C];if(Array.isArray(R)){const B=v?R.length-1:0;R=R[B]}R!==null&&(c[C]=R)}for(const C in w)c[C]=w[C]}}}return c}const Po=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ai=new Set(Po),Yx=t=>s=>typeof s=="string"&&s.startsWith(t),Jx=Yx("--"),WA=Yx("var(--"),jm=t=>WA(t)?XA.test(t.split("/*")[0].trim()):!1,XA=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Wx=(t,s)=>s&&typeof t=="number"?s.transform(t):t,na=(t,s,o)=>o>s?s:o<t?t:o,Ho={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},sl={...Ho,transform:t=>na(0,1,t)},Ic={...Ho,default:1},ul=t=>({test:s=>typeof s=="string"&&s.endsWith(t)&&s.split(" ").length===1,parse:parseFloat,transform:s=>`${s}${t}`}),Ba=ul("deg"),ws=ul("%"),Ae=ul("px"),QA=ul("vh"),eD=ul("vw"),wy={...ws,parse:t=>ws.parse(t)/100,transform:t=>ws.transform(t*100)},tD={borderWidth:Ae,borderTopWidth:Ae,borderRightWidth:Ae,borderBottomWidth:Ae,borderLeftWidth:Ae,borderRadius:Ae,radius:Ae,borderTopLeftRadius:Ae,borderTopRightRadius:Ae,borderBottomRightRadius:Ae,borderBottomLeftRadius:Ae,width:Ae,maxWidth:Ae,height:Ae,maxHeight:Ae,top:Ae,right:Ae,bottom:Ae,left:Ae,padding:Ae,paddingTop:Ae,paddingRight:Ae,paddingBottom:Ae,paddingLeft:Ae,margin:Ae,marginTop:Ae,marginRight:Ae,marginBottom:Ae,marginLeft:Ae,backgroundPositionX:Ae,backgroundPositionY:Ae},nD={rotate:Ba,rotateX:Ba,rotateY:Ba,rotateZ:Ba,scale:Ic,scaleX:Ic,scaleY:Ic,scaleZ:Ic,skew:Ba,skewX:Ba,skewY:Ba,distance:Ae,translateX:Ae,translateY:Ae,translateZ:Ae,x:Ae,y:Ae,z:Ae,perspective:Ae,transformPerspective:Ae,opacity:sl,originX:wy,originY:wy,originZ:Ae},jy={...Ho,transform:Math.round},Nm={...tD,...nD,zIndex:jy,size:Ae,fillOpacity:sl,strokeOpacity:sl,numOctaves:jy},sD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},aD=Po.length;function iD(t,s,o){let r="",c=!0;for(let d=0;d<aD;d++){const u=Po[d],p=t[u];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(u.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||o){const g=Wx(p,Nm[u]);if(!m){c=!1;const v=sD[u]||u;r+=`${v}(${g}) `}o&&(s[u]=g)}}return r=r.trim(),o?r=o(s,c?"":r):c&&(r="none"),r}function Cm(t,s,o){const{style:r,vars:c,transformOrigin:d}=t;let u=!1,p=!1;for(const m in s){const g=s[m];if(Ai.has(m)){u=!0;continue}else if(Jx(m)){c[m]=g;continue}else{const v=Wx(g,Nm[m]);m.startsWith("origin")?(p=!0,d[m]=v):r[m]=v}}if(s.transform||(u||o?r.transform=iD(s,t.transform,o):r.transform&&(r.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:v=0}=d;r.transformOrigin=`${m} ${g} ${v}`}}const oD={offset:"stroke-dashoffset",array:"stroke-dasharray"},rD={offset:"strokeDashoffset",array:"strokeDasharray"};function lD(t,s,o=1,r=0,c=!0){t.pathLength=1;const d=c?oD:rD;t[d.offset]=Ae.transform(-r);const u=Ae.transform(s),p=Ae.transform(o);t[d.array]=`${u} ${p}`}function Ny(t,s,o){return typeof t=="string"?t:Ae.transform(s+o*t)}function cD(t,s,o){const r=Ny(s,t.x,t.width),c=Ny(o,t.y,t.height);return`${r} ${c}`}function Em(t,{attrX:s,attrY:o,attrScale:r,originX:c,originY:d,pathLength:u,pathSpacing:p=1,pathOffset:m=0,...g},v,b){if(Cm(t,g,b),v){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:x,style:S,dimensions:k}=t;x.transform&&(k&&(S.transform=x.transform),delete x.transform),k&&(c!==void 0||d!==void 0||S.transform)&&(S.transformOrigin=cD(k,c!==void 0?c:.5,d!==void 0?d:.5)),s!==void 0&&(x.x=s),o!==void 0&&(x.y=o),r!==void 0&&(x.scale=r),u!==void 0&&lD(x,u,p,m,!1)}const Am=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Xx=()=>({...Am(),attrs:{}}),Dm=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Qx(t,{style:s,vars:o},r,c){Object.assign(t.style,s,c&&c.getProjectionStyles(r));for(const d in o)t.style.setProperty(d,o[d])}const e_=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 t_(t,s,o,r){Qx(t,s,void 0,r);for(const c in s.attrs)t.setAttribute(e_.has(c)?c:km(c),s.attrs[c])}const td={};function dD(t){Object.assign(td,t)}function n_(t,{layout:s,layoutId:o}){return Ai.has(t)||t.startsWith("origin")||(s||o!==void 0)&&(!!td[t]||t==="opacity")}function Rm(t,s,o){var r;const{style:c}=t,d={};for(const u in c)(dn(c[u])||s.style&&dn(s.style[u])||n_(u,t)||((r=o==null?void 0:o.getValue(u))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(d[u]=c[u]);return d}function s_(t,s,o){const r=Rm(t,s,o);for(const c in t)if(dn(t[c])||dn(s[c])){const d=Po.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;r[d]=t[c]}return r}function uD(t,s){try{s.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{s.dimensions={x:0,y:0,width:0,height:0}}}const Cy=["x","y","width","height","cx","cy","r"],fD={useVisualState:Kx({scrapeMotionValuesFromProps:s_,createRenderState:Xx,onUpdate:({props:t,prevProps:s,current:o,renderState:r,latestValues:c})=>{if(!o)return;let d=!!t.drag;if(!d){for(const p in c)if(Ai.has(p)){d=!0;break}}if(!d)return;let u=!s;if(s)for(let p=0;p<Cy.length;p++){const m=Cy[p];t[m]!==s[m]&&(u=!0)}u&&xt.read(()=>{uD(o,r),xt.render(()=>{Em(r,c,Dm(o.tagName),t.transformTemplate),t_(o,r)})})}})},pD={useVisualState:Kx({scrapeMotionValuesFromProps:Rm,createRenderState:Am})};function a_(t,s,o){for(const r in s)!dn(s[r])&&!n_(r,o)&&(t[r]=s[r])}function mD({transformTemplate:t},s){return y.useMemo(()=>{const o=Am();return Cm(o,s,t),Object.assign({},o.vars,o.style)},[s])}function hD(t,s){const o=t.style||{},r={};return a_(r,o,t),Object.assign(r,mD(t,s)),r}function gD(t,s){const o={},r=hD(t,s);return t.drag&&t.dragListener!==!1&&(o.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(o.tabIndex=0),o.style=r,o}function vD(t,s,o,r){const c=y.useMemo(()=>{const d=Xx();return Em(d,s,Dm(r),t.transformTemplate),{...d.attrs,style:{...d.style}}},[s]);if(t.style){const d={};a_(d,t.style,t),c.style={...d,...c.style}}return c}function yD(t=!1){return(o,r,c,{latestValues:d},u)=>{const m=(Tm(o)?vD:gD)(r,d,u,o),g=MA(r,typeof o=="string",t),v=o!==y.Fragment?{...g,...m,ref:c}:{},{children:b}=r,x=y.useMemo(()=>dn(b)?b.get():b,[b]);return y.createElement(o,{...v,children:x})}}function bD(t,s){return function(r,{forwardMotionProps:c}={forwardMotionProps:!1}){const u={...Tm(r)?fD:pD,preloadedFeatures:t,useRender:yD(c),createVisualElement:s,Component:r};return HA(u)}}function i_(t,s){if(!Array.isArray(s))return!1;const o=s.length;if(o!==t.length)return!1;for(let r=0;r<o;r++)if(s[r]!==t[r])return!1;return!0}function wd(t,s,o){const r=t.getProps();return wm(r,s,o!==void 0?o:r.custom,t)}function Mm(t,s){return t?t[s]||t.default||t:void 0}const o_=new Set(["width","height","top","left","right","bottom",...Po]);let Kc;function xD(){Kc=void 0}const js={now:()=>(Kc===void 0&&js.set(rn.isProcessing||NA.useManualTiming?rn.timestamp:performance.now()),Kc),set:t=>{Kc=t,queueMicrotask(xD)}};function Im(t,s){t.indexOf(s)===-1&&t.push(s)}function Om(t,s){const o=t.indexOf(s);o>-1&&t.splice(o,1)}class Bm{constructor(){this.subscriptions=[]}add(s){return Im(this.subscriptions,s),()=>Om(this.subscriptions,s)}notify(s,o,r){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](s,o,r);else for(let d=0;d<c;d++){const u=this.subscriptions[d];u&&u(s,o,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function r_(t,s){return s?t*(1e3/s):0}const Ey=30,_D=t=>!isNaN(parseFloat(t));class kD{constructor(s,o={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,c=!0)=>{const d=js.now();this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),c&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(s),this.owner=o.owner}setCurrent(s){this.current=s,this.updatedAt=js.now(),this.canTrackVelocity===null&&s!==void 0&&(this.canTrackVelocity=_D(this.current))}setPrevFrameValue(s=this.current){this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt}onChange(s){return this.on("change",s)}on(s,o){this.events[s]||(this.events[s]=new Bm);const r=this.events[s].add(o);return s==="change"?()=>{r(),xt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const s in this.events)this.events[s].clear()}attach(s,o){this.passiveEffect=s,this.stopPassiveEffect=o}set(s,o=!0){!o||!this.passiveEffect?this.updateAndNotify(s,o):this.passiveEffect(s,this.updateAndNotify)}setWithVelocity(s,o,r){this.set(o),this.prev=void 0,this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt-r}jump(s,o=!0){this.updateAndNotify(s),this.prev=s,this.prevUpdatedAt=this.prevFrameValue=void 0,o&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const s=js.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||s-this.updatedAt>Ey)return 0;const o=Math.min(this.updatedAt-this.prevUpdatedAt,Ey);return r_(parseFloat(this.current)-parseFloat(this.prevFrameValue),o)}start(s){return this.stop(),new Promise(o=>{this.hasAnimated=!0,this.animation=s(o),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 al(t,s){return new kD(t,s)}function SD(t,s,o){t.hasValue(s)?t.getValue(s).set(o):t.addValue(s,al(o))}function TD(t,s){const o=wd(t,s);let{transitionEnd:r={},transition:c={},...d}=o||{};d={...d,...r};for(const u in d){const p=KA(d[u]);SD(t,u,p)}}function wD(t){return!!(dn(t)&&t.add)}function Lp(t,s){const o=t.getValue("willChange");if(wD(o))return o.add(s)}function l_(t){return t.props[Gx]}function Lm(t){let s;return()=>(s===void 0&&(s=t()),s)}const jD=Lm(()=>window.ScrollTimeline!==void 0);class ND{constructor(s){this.stop=()=>this.runAll("stop"),this.animations=s.filter(Boolean)}get finished(){return Promise.all(this.animations.map(s=>"finished"in s?s.finished:s))}getAll(s){return this.animations[0][s]}setAll(s,o){for(let r=0;r<this.animations.length;r++)this.animations[r][s]=o}attachTimeline(s,o){const r=this.animations.map(c=>{if(jD()&&c.attachTimeline)return c.attachTimeline(s);if(typeof o=="function")return o(c)});return()=>{r.forEach((c,d)=>{c&&c(),this.animations[d].stop()})}}get time(){return this.getAll("time")}set time(s){this.setAll("time",s)}get speed(){return this.getAll("speed")}set speed(s){this.setAll("speed",s)}get startTime(){return this.getAll("startTime")}get duration(){let s=0;for(let o=0;o<this.animations.length;o++)s=Math.max(s,this.animations[o].duration);return s}runAll(s){this.animations.forEach(o=>o[s]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class CD extends ND{then(s,o){return Promise.all(this.animations).then(s).catch(o)}}const Xs=t=>t*1e3,Qs=t=>t/1e3;function zm(t){return typeof t=="function"}function Ay(t,s){t.timeline=s,t.onfinish=null}const $m=t=>Array.isArray(t)&&typeof t[0]=="number",ED={linearEasing:void 0};function AD(t,s){const o=Lm(t);return()=>{var r;return(r=ED[s])!==null&&r!==void 0?r:o()}}const nd=AD(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Oo=(t,s,o)=>{const r=s-t;return r===0?1:(o-t)/r},c_=(t,s,o=10)=>{let r="";const c=Math.max(Math.round(s/o),2);for(let d=0;d<c;d++)r+=t(Oo(0,c-1,d))+", ";return`linear(${r.substring(0,r.length-2)})`};function d_(t){return!!(typeof t=="function"&&nd()||!t||typeof t=="string"&&(t in zp||nd())||$m(t)||Array.isArray(t)&&t.every(d_))}const Hr=([t,s,o,r])=>`cubic-bezier(${t}, ${s}, ${o}, ${r})`,zp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hr([0,.65,.55,1]),circOut:Hr([.55,0,1,.45]),backIn:Hr([.31,.01,.66,-.59]),backOut:Hr([.33,1.53,.69,.99])};function u_(t,s){if(t)return typeof t=="function"&&nd()?c_(t,s):$m(t)?Hr(t):Array.isArray(t)?t.map(o=>u_(o,s)||zp.easeOut):zp[t]}const f_=(t,s,o)=>(((1-3*o+3*s)*t+(3*o-6*s))*t+3*s)*t,DD=1e-7,RD=12;function MD(t,s,o,r,c){let d,u,p=0;do u=s+(o-s)/2,d=f_(u,r,c)-t,d>0?o=u:s=u;while(Math.abs(d)>DD&&++p<RD);return u}function fl(t,s,o,r){if(t===s&&o===r)return Mn;const c=d=>MD(d,0,1,t,o);return d=>d===0||d===1?d:f_(c(d),s,r)}const p_=t=>s=>s<=.5?t(2*s)/2:(2-t(2*(1-s)))/2,m_=t=>s=>1-t(1-s),h_=fl(.33,1.53,.69,.99),Um=m_(h_),g_=p_(Um),v_=t=>(t*=2)<1?.5*Um(t):.5*(2-Math.pow(2,-10*(t-1))),Pm=t=>1-Math.sin(Math.acos(t)),y_=m_(Pm),b_=p_(Pm),x_=t=>/^0[^.\s]+$/u.test(t);function ID(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||x_(t):!0}const Zr=t=>Math.round(t*1e5)/1e5,Hm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function OD(t){return t==null}const BD=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Vm=(t,s)=>o=>!!(typeof o=="string"&&BD.test(o)&&o.startsWith(t)||s&&!OD(o)&&Object.prototype.hasOwnProperty.call(o,s)),__=(t,s,o)=>r=>{if(typeof r!="string")return r;const[c,d,u,p]=r.match(Hm);return{[t]:parseFloat(c),[s]:parseFloat(d),[o]:parseFloat(u),alpha:p!==void 0?parseFloat(p):1}},LD=t=>na(0,255,t),op={...Ho,transform:t=>Math.round(LD(t))},ki={test:Vm("rgb","red"),parse:__("red","green","blue"),transform:({red:t,green:s,blue:o,alpha:r=1})=>"rgba("+op.transform(t)+", "+op.transform(s)+", "+op.transform(o)+", "+Zr(sl.transform(r))+")"};function zD(t){let s="",o="",r="",c="";return t.length>5?(s=t.substring(1,3),o=t.substring(3,5),r=t.substring(5,7),c=t.substring(7,9)):(s=t.substring(1,2),o=t.substring(2,3),r=t.substring(3,4),c=t.substring(4,5),s+=s,o+=o,r+=r,c+=c),{red:parseInt(s,16),green:parseInt(o,16),blue:parseInt(r,16),alpha:c?parseInt(c,16)/255:1}}const $p={test:Vm("#"),parse:zD,transform:ki.transform},wo={test:Vm("hsl","hue"),parse:__("hue","saturation","lightness"),transform:({hue:t,saturation:s,lightness:o,alpha:r=1})=>"hsla("+Math.round(t)+", "+ws.transform(Zr(s))+", "+ws.transform(Zr(o))+", "+Zr(sl.transform(r))+")"},cn={test:t=>ki.test(t)||$p.test(t)||wo.test(t),parse:t=>ki.test(t)?ki.parse(t):wo.test(t)?wo.parse(t):$p.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ki.transform(t):wo.transform(t)},$D=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function UD(t){var s,o;return isNaN(t)&&typeof t=="string"&&(((s=t.match(Hm))===null||s===void 0?void 0:s.length)||0)+(((o=t.match($D))===null||o===void 0?void 0:o.length)||0)>0}const k_="number",S_="color",PD="var",HD="var(",Dy="${}",VD=/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 il(t){const s=t.toString(),o=[],r={color:[],number:[],var:[]},c=[];let d=0;const p=s.replace(VD,m=>(cn.test(m)?(r.color.push(d),c.push(S_),o.push(cn.parse(m))):m.startsWith(HD)?(r.var.push(d),c.push(PD),o.push(m)):(r.number.push(d),c.push(k_),o.push(parseFloat(m))),++d,Dy)).split(Dy);return{values:o,split:p,indexes:r,types:c}}function T_(t){return il(t).values}function w_(t){const{split:s,types:o}=il(t),r=s.length;return c=>{let d="";for(let u=0;u<r;u++)if(d+=s[u],c[u]!==void 0){const p=o[u];p===k_?d+=Zr(c[u]):p===S_?d+=cn.transform(c[u]):d+=c[u]}return d}}const qD=t=>typeof t=="number"?0:t;function GD(t){const s=T_(t);return w_(t)(s.map(qD))}const Ha={test:UD,parse:T_,createTransformer:w_,getAnimatableNone:GD},FD=new Set(["brightness","contrast","saturate","opacity"]);function ZD(t){const[s,o]=t.slice(0,-1).split("(");if(s==="drop-shadow")return t;const[r]=o.match(Hm)||[];if(!r)return t;const c=o.replace(r,"");let d=FD.has(s)?1:0;return r!==o&&(d*=100),s+"("+d+c+")"}const KD=/\b([a-z-]*)\(.*?\)/gu,Up={...Ha,getAnimatableNone:t=>{const s=t.match(KD);return s?s.map(ZD).join(" "):t}},YD={...Nm,color:cn,backgroundColor:cn,outlineColor:cn,fill:cn,stroke:cn,borderColor:cn,borderTopColor:cn,borderRightColor:cn,borderBottomColor:cn,borderLeftColor:cn,filter:Up,WebkitFilter:Up},qm=t=>YD[t];function j_(t,s){let o=qm(t);return o!==Up&&(o=Ha),o.getAnimatableNone?o.getAnimatableNone(s):void 0}const JD=new Set(["auto","none","0"]);function WD(t,s,o){let r=0,c;for(;r<t.length&&!c;){const d=t[r];typeof d=="string"&&!JD.has(d)&&il(d).values.length&&(c=t[r]),r++}if(c&&o)for(const d of s)t[d]=j_(o,c)}const Ry=t=>t===Ho||t===Ae,My=(t,s)=>parseFloat(t.split(", ")[s]),Iy=(t,s)=>(o,{transform:r})=>{if(r==="none"||!r)return 0;const c=r.match(/^matrix3d\((.+)\)$/u);if(c)return My(c[1],s);{const d=r.match(/^matrix\((.+)\)$/u);return d?My(d[1],t):0}},XD=new Set(["x","y","z"]),QD=Po.filter(t=>!XD.has(t));function eR(t){const s=[];return QD.forEach(o=>{const r=t.getValue(o);r!==void 0&&(s.push([o,r.get()]),r.set(o.startsWith("scale")?1:0))}),s}const Bo={width:({x:t},{paddingLeft:s="0",paddingRight:o="0"})=>t.max-t.min-parseFloat(s)-parseFloat(o),height:({y:t},{paddingTop:s="0",paddingBottom:o="0"})=>t.max-t.min-parseFloat(s)-parseFloat(o),top:(t,{top:s})=>parseFloat(s),left:(t,{left:s})=>parseFloat(s),bottom:({y:t},{top:s})=>parseFloat(s)+(t.max-t.min),right:({x:t},{left:s})=>parseFloat(s)+(t.max-t.min),x:Iy(4,13),y:Iy(5,14)};Bo.translateX=Bo.x;Bo.translateY=Bo.y;const Si=new Set;let Pp=!1,Hp=!1;function N_(){if(Hp){const t=Array.from(Si).filter(r=>r.needsMeasurement),s=new Set(t.map(r=>r.element)),o=new Map;s.forEach(r=>{const c=eR(r);c.length&&(o.set(r,c),r.render())}),t.forEach(r=>r.measureInitialState()),s.forEach(r=>{r.render();const c=o.get(r);c&&c.forEach(([d,u])=>{var p;(p=r.getValue(d))===null||p===void 0||p.set(u)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Hp=!1,Pp=!1,Si.forEach(t=>t.complete()),Si.clear()}function C_(){Si.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Hp=!0)})}function tR(){C_(),N_()}class Gm{constructor(s,o,r,c,d,u=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...s],this.onComplete=o,this.name=r,this.motionValue=c,this.element=d,this.isAsync=u}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Si.add(this),Pp||(Pp=!0,xt.read(C_),xt.resolveKeyframes(N_))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:s,name:o,element:r,motionValue:c}=this;for(let d=0;d<s.length;d++)if(s[d]===null)if(d===0){const u=c==null?void 0:c.get(),p=s[s.length-1];if(u!==void 0)s[0]=u;else if(r&&o){const m=r.readValue(o,p);m!=null&&(s[0]=m)}s[0]===void 0&&(s[0]=p),c&&u===void 0&&c.set(s[0])}else s[d]=s[d-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Si.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Si.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const E_=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),nR=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function sR(t){const s=nR.exec(t);if(!s)return[,];const[,o,r,c]=s;return[`--${o??r}`,c]}function A_(t,s,o=1){const[r,c]=sR(t);if(!r)return;const d=window.getComputedStyle(s).getPropertyValue(r);if(d){const u=d.trim();return E_(u)?parseFloat(u):u}return jm(c)?A_(c,s,o+1):c}const D_=t=>s=>s.test(t),aR={test:t=>t==="auto",parse:t=>t},R_=[Ho,Ae,ws,Ba,eD,QA,aR],Oy=t=>R_.find(D_(t));class M_ extends Gm{constructor(s,o,r,c,d){super(s,o,r,c,d,!0)}readKeyframes(){const{unresolvedKeyframes:s,element:o,name:r}=this;if(!o||!o.current)return;super.readKeyframes();for(let m=0;m<s.length;m++){let g=s[m];if(typeof g=="string"&&(g=g.trim(),jm(g))){const v=A_(g,o.current);v!==void 0&&(s[m]=v),m===s.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!o_.has(r)||s.length!==2)return;const[c,d]=s,u=Oy(c),p=Oy(d);if(u!==p)if(Ry(u)&&Ry(p))for(let m=0;m<s.length;m++){const g=s[m];typeof g=="string"&&(s[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:s,name:o}=this,r=[];for(let c=0;c<s.length;c++)ID(s[c])&&r.push(c);r.length&&WD(s,r,o)}measureInitialState(){const{element:s,unresolvedKeyframes:o,name:r}=this;if(!s||!s.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Bo[r](s.measureViewportBox(),window.getComputedStyle(s.current)),o[0]=this.measuredOrigin;const c=o[o.length-1];c!==void 0&&s.getValue(r,c).jump(c,!1)}measureEndState(){var s;const{element:o,name:r,unresolvedKeyframes:c}=this;if(!o||!o.current)return;const d=o.getValue(r);d&&d.jump(this.measuredOrigin,!1);const u=c.length-1,p=c[u];c[u]=Bo[r](o.measureViewportBox(),window.getComputedStyle(o.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((s=this.removedTransforms)===null||s===void 0)&&s.length&&this.removedTransforms.forEach(([m,g])=>{o.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const By=(t,s)=>s==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ha.test(t)||t==="0")&&!t.startsWith("url("));function iR(t){const s=t[0];if(t.length===1)return!0;for(let o=0;o<t.length;o++)if(t[o]!==s)return!0}function oR(t,s,o,r){const c=t[0];if(c===null)return!1;if(s==="display"||s==="visibility")return!0;const d=t[t.length-1],u=By(c,s),p=By(d,s);return!u||!p?!1:iR(t)||(o==="spring"||zm(o))&&r}const rR=t=>t!==null;function jd(t,{repeat:s,repeatType:o="loop"},r){const c=t.filter(rR),d=s&&o!=="loop"&&s%2===1?0:c.length-1;return!d||r===void 0?c[d]:r}const lR=40;class I_{constructor({autoplay:s=!0,delay:o=0,type:r="keyframes",repeat:c=0,repeatDelay:d=0,repeatType:u="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=js.now(),this.options={autoplay:s,delay:o,type:r,repeat:c,repeatDelay:d,repeatType:u,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>lR?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&tR(),this._resolved}onKeyframesResolved(s,o){this.resolvedAt=js.now(),this.hasAttemptedResolve=!0;const{name:r,type:c,velocity:d,delay:u,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!oR(s,r,c,d))if(u)this.options.duration=0;else{m&&m(jd(s,this.options,o)),p&&p(),this.resolveFinishedPromise();return}const v=this.initPlayback(s,o);v!==!1&&(this._resolved={keyframes:s,finalKeyframe:o,...v},this.onPostResolved())}onPostResolved(){}then(s,o){return this.currentFinishedPromise.then(s,o)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(s=>{this.resolveFinishedPromise=s})}}const Vp=2e4;function O_(t){let s=0;const o=50;let r=t.next(s);for(;!r.done&&s<Vp;)s+=o,r=t.next(s);return s>=Vp?1/0:s}const jt=(t,s,o)=>t+(s-t)*o;function rp(t,s,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+(s-t)*6*o:o<1/2?s:o<2/3?t+(s-t)*(2/3-o)*6:t}function cR({hue:t,saturation:s,lightness:o,alpha:r}){t/=360,s/=100,o/=100;let c=0,d=0,u=0;if(!s)c=d=u=o;else{const p=o<.5?o*(1+s):o+s-o*s,m=2*o-p;c=rp(m,p,t+1/3),d=rp(m,p,t),u=rp(m,p,t-1/3)}return{red:Math.round(c*255),green:Math.round(d*255),blue:Math.round(u*255),alpha:r}}function sd(t,s){return o=>o>0?s:t}const lp=(t,s,o)=>{const r=t*t,c=o*(s*s-r)+r;return c<0?0:Math.sqrt(c)},dR=[$p,ki,wo],uR=t=>dR.find(s=>s.test(t));function Ly(t){const s=uR(t);if(!s)return!1;let o=s.parse(t);return s===wo&&(o=cR(o)),o}const zy=(t,s)=>{const o=Ly(t),r=Ly(s);if(!o||!r)return sd(t,s);const c={...o};return d=>(c.red=lp(o.red,r.red,d),c.green=lp(o.green,r.green,d),c.blue=lp(o.blue,r.blue,d),c.alpha=jt(o.alpha,r.alpha,d),ki.transform(c))},fR=(t,s)=>o=>s(t(o)),pl=(...t)=>t.reduce(fR),qp=new Set(["none","hidden"]);function pR(t,s){return qp.has(t)?o=>o<=0?t:s:o=>o>=1?s:t}function mR(t,s){return o=>jt(t,s,o)}function Fm(t){return typeof t=="number"?mR:typeof t=="string"?jm(t)?sd:cn.test(t)?zy:vR:Array.isArray(t)?B_:typeof t=="object"?cn.test(t)?zy:hR:sd}function B_(t,s){const o=[...t],r=o.length,c=t.map((d,u)=>Fm(d)(d,s[u]));return d=>{for(let u=0;u<r;u++)o[u]=c[u](d);return o}}function hR(t,s){const o={...t,...s},r={};for(const c in o)t[c]!==void 0&&s[c]!==void 0&&(r[c]=Fm(t[c])(t[c],s[c]));return c=>{for(const d in r)o[d]=r[d](c);return o}}function gR(t,s){var o;const r=[],c={color:0,var:0,number:0};for(let d=0;d<s.values.length;d++){const u=s.types[d],p=t.indexes[u][c[u]],m=(o=t.values[p])!==null&&o!==void 0?o:0;r[d]=m,c[u]++}return r}const vR=(t,s)=>{const o=Ha.createTransformer(s),r=il(t),c=il(s);return r.indexes.var.length===c.indexes.var.length&&r.indexes.color.length===c.indexes.color.length&&r.indexes.number.length>=c.indexes.number.length?qp.has(t)&&!c.values.length||qp.has(s)&&!r.values.length?pR(t,s):pl(B_(gR(r,c),c.values),o):sd(t,s)};function L_(t,s,o){return typeof t=="number"&&typeof s=="number"&&typeof o=="number"?jt(t,s,o):Fm(t)(t,s)}const yR=5;function z_(t,s,o){const r=Math.max(s-yR,0);return r_(o-t(r),s-r)}const Dt={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},cp=.001;function bR({duration:t=Dt.duration,bounce:s=Dt.bounce,velocity:o=Dt.velocity,mass:r=Dt.mass}){let c,d,u=1-s;u=na(Dt.minDamping,Dt.maxDamping,u),t=na(Dt.minDuration,Dt.maxDuration,Qs(t)),u<1?(c=g=>{const v=g*u,b=v*t,x=v-o,S=Gp(g,u),k=Math.exp(-b);return cp-x/S*k},d=g=>{const b=g*u*t,x=b*o+o,S=Math.pow(u,2)*Math.pow(g,2)*t,k=Math.exp(-b),w=Gp(Math.pow(g,2),u);return(-c(g)+cp>0?-1:1)*((x-S)*k)/w}):(c=g=>{const v=Math.exp(-g*t),b=(g-o)*t+1;return-cp+v*b},d=g=>{const v=Math.exp(-g*t),b=(o-g)*(t*t);return v*b});const p=5/t,m=_R(c,d,p);if(t=Xs(t),isNaN(m))return{stiffness:Dt.stiffness,damping:Dt.damping,duration:t};{const g=Math.pow(m,2)*r;return{stiffness:g,damping:u*2*Math.sqrt(r*g),duration:t}}}const xR=12;function _R(t,s,o){let r=o;for(let c=1;c<xR;c++)r=r-t(r)/s(r);return r}function Gp(t,s){return t*Math.sqrt(1-s*s)}const kR=["duration","bounce"],SR=["stiffness","damping","mass"];function $y(t,s){return s.some(o=>t[o]!==void 0)}function TR(t){let s={velocity:Dt.velocity,stiffness:Dt.stiffness,damping:Dt.damping,mass:Dt.mass,isResolvedFromDuration:!1,...t};if(!$y(t,SR)&&$y(t,kR))if(t.visualDuration){const o=t.visualDuration,r=2*Math.PI/(o*1.2),c=r*r,d=2*na(.05,1,1-(t.bounce||0))*Math.sqrt(c);s={...s,mass:Dt.mass,stiffness:c,damping:d}}else{const o=bR(t);s={...s,...o,mass:Dt.mass},s.isResolvedFromDuration=!0}return s}function $_(t=Dt.visualDuration,s=Dt.bounce){const o=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:s}:t;let{restSpeed:r,restDelta:c}=o;const d=o.keyframes[0],u=o.keyframes[o.keyframes.length-1],p={done:!1,value:d},{stiffness:m,damping:g,mass:v,duration:b,velocity:x,isResolvedFromDuration:S}=TR({...o,velocity:-Qs(o.velocity||0)}),k=x||0,w=g/(2*Math.sqrt(m*v)),N=u-d,T=Qs(Math.sqrt(m/v)),C=Math.abs(N)<5;r||(r=C?Dt.restSpeed.granular:Dt.restSpeed.default),c||(c=C?Dt.restDelta.granular:Dt.restDelta.default);let R;if(w<1){const A=Gp(T,w);R=M=>{const D=Math.exp(-w*T*M);return u-D*((k+w*T*N)/A*Math.sin(A*M)+N*Math.cos(A*M))}}else if(w===1)R=A=>u-Math.exp(-T*A)*(N+(k+T*N)*A);else{const A=T*Math.sqrt(w*w-1);R=M=>{const D=Math.exp(-w*T*M),z=Math.min(A*M,300);return u-D*((k+w*T*N)*Math.sinh(z)+A*N*Math.cosh(z))/A}}const B={calculatedDuration:S&&b||null,next:A=>{const M=R(A);if(S)p.done=A>=b;else{let D=0;w<1&&(D=A===0?Xs(k):z_(R,A,M));const z=Math.abs(D)<=r,U=Math.abs(u-M)<=c;p.done=z&&U}return p.value=p.done?u:M,p},toString:()=>{const A=Math.min(O_(B),Vp),M=c_(D=>B.next(A*D).value,A,30);return A+"ms "+M}};return B}function Uy({keyframes:t,velocity:s=0,power:o=.8,timeConstant:r=325,bounceDamping:c=10,bounceStiffness:d=500,modifyTarget:u,min:p,max:m,restDelta:g=.5,restSpeed:v}){const b=t[0],x={done:!1,value:b},S=z=>p!==void 0&&z<p||m!==void 0&&z>m,k=z=>p===void 0?m:m===void 0||Math.abs(p-z)<Math.abs(m-z)?p:m;let w=o*s;const N=b+w,T=u===void 0?N:u(N);T!==N&&(w=T-b);const C=z=>-w*Math.exp(-z/r),R=z=>T+C(z),B=z=>{const U=C(z),X=R(z);x.done=Math.abs(U)<=g,x.value=x.done?T:X};let A,M;const D=z=>{S(x.value)&&(A=z,M=$_({keyframes:[x.value,k(x.value)],velocity:z_(R,z,x.value),damping:c,stiffness:d,restDelta:g,restSpeed:v}))};return D(0),{calculatedDuration:null,next:z=>{let U=!1;return!M&&A===void 0&&(U=!0,B(z),D(z)),A!==void 0&&z>=A?M.next(z-A):(!U&&B(z),x)}}}const wR=fl(.42,0,1,1),jR=fl(0,0,.58,1),U_=fl(.42,0,.58,1),NR=t=>Array.isArray(t)&&typeof t[0]!="number",CR={linear:Mn,easeIn:wR,easeInOut:U_,easeOut:jR,circIn:Pm,circInOut:b_,circOut:y_,backIn:Um,backInOut:g_,backOut:h_,anticipate:v_},Py=t=>{if($m(t)){Ux(t.length===4);const[s,o,r,c]=t;return fl(s,o,r,c)}else if(typeof t=="string")return CR[t];return t};function ER(t,s,o){const r=[],c=o||L_,d=t.length-1;for(let u=0;u<d;u++){let p=c(t[u],t[u+1]);if(s){const m=Array.isArray(s)?s[u]||Mn:s;p=pl(m,p)}r.push(p)}return r}function AR(t,s,{clamp:o=!0,ease:r,mixer:c}={}){const d=t.length;if(Ux(d===s.length),d===1)return()=>s[0];if(d===2&&s[0]===s[1])return()=>s[1];const u=t[0]===t[1];t[0]>t[d-1]&&(t=[...t].reverse(),s=[...s].reverse());const p=ER(s,r,c),m=p.length,g=v=>{if(u&&v<t[0])return s[0];let b=0;if(m>1)for(;b<t.length-2&&!(v<t[b+1]);b++);const x=Oo(t[b],t[b+1],v);return p[b](x)};return o?v=>g(na(t[0],t[d-1],v)):g}function DR(t,s){const o=t[t.length-1];for(let r=1;r<=s;r++){const c=Oo(0,s,r);t.push(jt(o,1,c))}}function RR(t){const s=[0];return DR(s,t.length-1),s}function MR(t,s){return t.map(o=>o*s)}function IR(t,s){return t.map(()=>s||U_).splice(0,t.length-1)}function ad({duration:t=300,keyframes:s,times:o,ease:r="easeInOut"}){const c=NR(r)?r.map(Py):Py(r),d={done:!1,value:s[0]},u=MR(o&&o.length===s.length?o:RR(s),t),p=AR(u,s,{ease:Array.isArray(c)?c:IR(s,c)});return{calculatedDuration:t,next:m=>(d.value=p(m),d.done=m>=t,d)}}const OR=t=>{const s=({timestamp:o})=>t(o);return{start:()=>xt.update(s,!0),stop:()=>Pa(s),now:()=>rn.isProcessing?rn.timestamp:js.now()}},BR={decay:Uy,inertia:Uy,tween:ad,keyframes:ad,spring:$_},LR=t=>t/100;class Zm extends I_{constructor(s){super(s),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:o,motionValue:r,element:c,keyframes:d}=this.options,u=(c==null?void 0:c.KeyframeResolver)||Gm,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new u(d,p,o,r,c),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(s){const{type:o="keyframes",repeat:r=0,repeatDelay:c=0,repeatType:d,velocity:u=0}=this.options,p=zm(o)?o:BR[o]||ad;let m,g;p!==ad&&typeof s[0]!="number"&&(m=pl(LR,L_(s[0],s[1])),s=[0,100]);const v=p({...this.options,keyframes:s});d==="mirror"&&(g=p({...this.options,keyframes:[...s].reverse(),velocity:-u})),v.calculatedDuration===null&&(v.calculatedDuration=O_(v));const{calculatedDuration:b}=v,x=b+c,S=x*(r+1)-c;return{generator:v,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:b,resolvedDuration:x,totalDuration:S}}onPostResolved(){const{autoplay:s=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!s?this.pause():this.state=this.pendingPlayState}tick(s,o=!1){const{resolved:r}=this;if(!r){const{keyframes:z}=this.options;return{done:!0,value:z[z.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:u,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:v,resolvedDuration:b}=r;if(this.startTime===null)return d.next(0);const{delay:x,repeat:S,repeatType:k,repeatDelay:w,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,s):this.speed<0&&(this.startTime=Math.min(s-v/this.speed,this.startTime)),o?this.currentTime=s:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(s-this.startTime)*this.speed;const T=this.currentTime-x*(this.speed>=0?1:-1),C=this.speed>=0?T<0:T>v;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=v);let R=this.currentTime,B=d;if(S){const z=Math.min(this.currentTime,v)/b;let U=Math.floor(z),X=z%1;!X&&z>=1&&(X=1),X===1&&U--,U=Math.min(U,S+1),!!(U%2)&&(k==="reverse"?(X=1-X,w&&(X-=w/b)):k==="mirror"&&(B=u)),R=na(0,1,X)*b}const A=C?{done:!1,value:m[0]}:B.next(R);p&&(A.value=p(A.value));let{done:M}=A;!C&&g!==null&&(M=this.speed>=0?this.currentTime>=v:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return D&&c!==void 0&&(A.value=jd(m,this.options,c)),N&&N(A.value),D&&this.finish(),A}get duration(){const{resolved:s}=this;return s?Qs(s.calculatedDuration):0}get time(){return Qs(this.currentTime)}set time(s){s=Xs(s),this.currentTime=s,this.holdTime!==null||this.speed===0?this.holdTime=s:this.driver&&(this.startTime=this.driver.now()-s/this.speed)}get speed(){return this.playbackSpeed}set speed(s){const o=this.playbackSpeed!==s;this.playbackSpeed=s,o&&(this.time=Qs(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:s=OR,onPlay:o,startTime:r}=this.options;this.driver||(this.driver=s(d=>this.tick(d))),o&&o();const c=this.driver.now();this.holdTime!==null?this.startTime=c-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=c):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var s;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(s=this.currentTime)!==null&&s!==void 0?s:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:s}=this.options;s&&s()}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(s){return this.startTime=0,this.tick(s,!0)}}const zR=new Set(["opacity","clipPath","filter","transform"]);function $R(t,s,o,{delay:r=0,duration:c=300,repeat:d=0,repeatType:u="loop",ease:p="easeInOut",times:m}={}){const g={[s]:o};m&&(g.offset=m);const v=u_(p,c);return Array.isArray(v)&&(g.easing=v),t.animate(g,{delay:r,duration:c,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:d+1,direction:u==="reverse"?"alternate":"normal"})}const UR=Lm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),id=10,PR=2e4;function HR(t){return zm(t.type)||t.type==="spring"||!d_(t.ease)}function VR(t,s){const o=new Zm({...s,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const c=[];let d=0;for(;!r.done&&d<PR;)r=o.sample(d),c.push(r.value),d+=id;return{times:void 0,keyframes:c,duration:d-id,ease:"linear"}}const P_={anticipate:v_,backInOut:g_,circInOut:b_};function qR(t){return t in P_}class Hy extends I_{constructor(s){super(s);const{name:o,motionValue:r,element:c,keyframes:d}=this.options;this.resolver=new M_(d,(u,p)=>this.onKeyframesResolved(u,p),o,r,c),this.resolver.scheduleResolve()}initPlayback(s,o){let{duration:r=300,times:c,ease:d,type:u,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof d=="string"&&nd()&&qR(d)&&(d=P_[d]),HR(this.options)){const{onComplete:b,onUpdate:x,motionValue:S,element:k,...w}=this.options,N=VR(s,w);s=N.keyframes,s.length===1&&(s[1]=s[0]),r=N.duration,c=N.times,d=N.ease,u="keyframes"}const v=$R(p.owner.current,m,s,{...this.options,duration:r,times:c,ease:d});return v.startTime=g??this.calcStartTime(),this.pendingTimeline?(Ay(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:b}=this.options;p.set(jd(s,this.options,o)),b&&b(),this.cancel(),this.resolveFinishedPromise()},{animation:v,duration:r,times:c,type:u,ease:d,keyframes:s}}get duration(){const{resolved:s}=this;if(!s)return 0;const{duration:o}=s;return Qs(o)}get time(){const{resolved:s}=this;if(!s)return 0;const{animation:o}=s;return Qs(o.currentTime||0)}set time(s){const{resolved:o}=this;if(!o)return;const{animation:r}=o;r.currentTime=Xs(s)}get speed(){const{resolved:s}=this;if(!s)return 1;const{animation:o}=s;return o.playbackRate}set speed(s){const{resolved:o}=this;if(!o)return;const{animation:r}=o;r.playbackRate=s}get state(){const{resolved:s}=this;if(!s)return"idle";const{animation:o}=s;return o.playState}get startTime(){const{resolved:s}=this;if(!s)return null;const{animation:o}=s;return o.startTime}attachTimeline(s){if(!this._resolved)this.pendingTimeline=s;else{const{resolved:o}=this;if(!o)return Mn;const{animation:r}=o;Ay(r,s)}return Mn}play(){if(this.isStopped)return;const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.playState==="finished"&&this.updateFinishedPromise(),o.play()}pause(){const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:s}=this;if(!s)return;const{animation:o,keyframes:r,duration:c,type:d,ease:u,times:p}=s;if(o.playState==="idle"||o.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:v,onComplete:b,element:x,...S}=this.options,k=new Zm({...S,keyframes:r,duration:c,type:d,ease:u,times:p,isGenerator:!0}),w=Xs(this.time);g.setWithVelocity(k.sample(w-id).value,k.sample(w).value,id)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:s}=this;s&&s.animation.finish()}cancel(){const{resolved:s}=this;s&&s.animation.cancel()}static supports(s){const{motionValue:o,name:r,repeatDelay:c,repeatType:d,damping:u,type:p}=s;if(!o||!o.owner||!(o.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=o.owner.getProps();return UR()&&r&&zR.has(r)&&!m&&!g&&!c&&d!=="mirror"&&u!==0&&p!=="inertia"}}const GR={type:"spring",stiffness:500,damping:25,restSpeed:10},FR=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),ZR={type:"keyframes",duration:.8},KR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},YR=(t,{keyframes:s})=>s.length>2?ZR:Ai.has(t)?t.startsWith("scale")?FR(s[1]):GR:KR;function JR({when:t,delay:s,delayChildren:o,staggerChildren:r,staggerDirection:c,repeat:d,repeatType:u,repeatDelay:p,from:m,elapsed:g,...v}){return!!Object.keys(v).length}const Km=(t,s,o,r={},c,d)=>u=>{const p=Mm(r,t)||{},m=p.delay||r.delay||0;let{elapsed:g=0}=r;g=g-Xs(m);let v={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:s.getVelocity(),...p,delay:-g,onUpdate:x=>{s.set(x),p.onUpdate&&p.onUpdate(x)},onComplete:()=>{u(),p.onComplete&&p.onComplete()},name:t,motionValue:s,element:d?void 0:c};JR(p)||(v={...v,...YR(t,v)}),v.duration&&(v.duration=Xs(v.duration)),v.repeatDelay&&(v.repeatDelay=Xs(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let b=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(v.duration=0,v.delay===0&&(b=!0)),b&&!d&&s.get()!==void 0){const x=jd(v.keyframes,p);if(x!==void 0)return xt.update(()=>{v.onUpdate(x),v.onComplete()}),new CD([])}return!d&&Hy.supports(v)?new Hy(v):new Zm(v)};function WR({protectedKeys:t,needsAnimating:s},o){const r=t.hasOwnProperty(o)&&s[o]!==!0;return s[o]=!1,r}function H_(t,s,{delay:o=0,transitionOverride:r,type:c}={}){var d;let{transition:u=t.getDefaultTransition(),transitionEnd:p,...m}=s;r&&(u=r);const g=[],v=c&&t.animationState&&t.animationState.getState()[c];for(const b in m){const x=t.getValue(b,(d=t.latestValues[b])!==null&&d!==void 0?d:null),S=m[b];if(S===void 0||v&&WR(v,b))continue;const k={delay:o,...Mm(u||{},b)};let w=!1;if(window.MotionHandoffAnimation){const T=l_(t);if(T){const C=window.MotionHandoffAnimation(T,b,xt);C!==null&&(k.startTime=C,w=!0)}}Lp(t,b),x.start(Km(b,x,S,t.shouldReduceMotion&&o_.has(b)?{type:!1}:k,t,w));const N=x.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{xt.update(()=>{p&&TD(t,p)})}),g}function Fp(t,s,o={}){var r;const c=wd(t,s,o.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:d=t.getDefaultTransition()||{}}=c||{};o.transitionOverride&&(d=o.transitionOverride);const u=c?()=>Promise.all(H_(t,c,o)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(g=0)=>{const{delayChildren:v=0,staggerChildren:b,staggerDirection:x}=d;return XR(t,s,v+g,b,x,o)}:()=>Promise.resolve(),{when:m}=d;if(m){const[g,v]=m==="beforeChildren"?[u,p]:[p,u];return g().then(()=>v())}else return Promise.all([u(),p(o.delay)])}function XR(t,s,o=0,r=0,c=1,d){const u=[],p=(t.variantChildren.size-1)*r,m=c===1?(g=0)=>g*r:(g=0)=>p-g*r;return Array.from(t.variantChildren).sort(QR).forEach((g,v)=>{g.notify("AnimationStart",s),u.push(Fp(g,s,{...d,delay:o+m(v)}).then(()=>g.notify("AnimationComplete",s)))}),Promise.all(u)}function QR(t,s){return t.sortNodePosition(s)}function eM(t,s,o={}){t.notify("AnimationStart",s);let r;if(Array.isArray(s)){const c=s.map(d=>Fp(t,d,o));r=Promise.all(c)}else if(typeof s=="string")r=Fp(t,s,o);else{const c=typeof s=="function"?wd(t,s,o.custom):s;r=Promise.all(H_(t,c,o))}return r.then(()=>{t.notify("AnimationComplete",s)})}const tM=_m.length;function V_(t){if(!t)return;if(!t.isControllingVariants){const o=t.parent?V_(t.parent)||{}:{};return t.props.initial!==void 0&&(o.initial=t.props.initial),o}const s={};for(let o=0;o<tM;o++){const r=_m[o],c=t.props[r];(nl(c)||c===!1)&&(s[r]=c)}return s}const nM=[...xm].reverse(),sM=xm.length;function aM(t){return s=>Promise.all(s.map(({animation:o,options:r})=>eM(t,o,r)))}function iM(t){let s=aM(t),o=Vy(),r=!0;const c=m=>(g,v)=>{var b;const x=wd(t,v,m==="exit"?(b=t.presenceContext)===null||b===void 0?void 0:b.custom:void 0);if(x){const{transition:S,transitionEnd:k,...w}=x;g={...g,...w,...k}}return g};function d(m){s=m(t)}function u(m){const{props:g}=t,v=V_(t.parent)||{},b=[],x=new Set;let S={},k=1/0;for(let N=0;N<sM;N++){const T=nM[N],C=o[T],R=g[T]!==void 0?g[T]:v[T],B=nl(R),A=T===m?C.isActive:null;A===!1&&(k=N);let M=R===v[T]&&R!==g[T]&&B;if(M&&r&&t.manuallyAnimateOnMount&&(M=!1),C.protectedKeys={...S},!C.isActive&&A===null||!R&&!C.prevProp||Sd(R)||typeof R=="boolean")continue;const D=oM(C.prevProp,R);let z=D||T===m&&C.isActive&&!M&&B||N>k&&B,U=!1;const X=Array.isArray(R)?R:[R];let Q=X.reduce(c(T),{});A===!1&&(Q={});const{prevResolvedValues:P={}}=C,re={...P,...Q},H=F=>{z=!0,x.has(F)&&(U=!0,x.delete(F)),C.needsAnimating[F]=!0;const ae=t.getValue(F);ae&&(ae.liveStyle=!1)};for(const F in re){const ae=Q[F],me=P[F];if(S.hasOwnProperty(F))continue;let de=!1;Bp(ae)&&Bp(me)?de=!i_(ae,me):de=ae!==me,de?ae!=null?H(F):x.add(F):ae!==void 0&&x.has(F)?H(F):C.protectedKeys[F]=!0}C.prevProp=R,C.prevResolvedValues=Q,C.isActive&&(S={...S,...Q}),r&&t.blockInitialAnimation&&(z=!1),z&&(!(M&&D)||U)&&b.push(...X.map(F=>({animation:F,options:{type:T}})))}if(x.size){const N={};x.forEach(T=>{const C=t.getBaseTarget(T),R=t.getValue(T);R&&(R.liveStyle=!0),N[T]=C??null}),b.push({animation:N})}let w=!!b.length;return r&&(g.initial===!1||g.initial===g.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,w?s(b):Promise.resolve()}function p(m,g){var v;if(o[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)}),o[m].isActive=g;const b=u(m);for(const x in o)o[x].protectedKeys={};return b}return{animateChanges:u,setActive:p,setAnimateFunction:d,getState:()=>o,reset:()=>{o=Vy(),r=!0}}}function oM(t,s){return typeof s=="string"?s!==t:Array.isArray(s)?!i_(s,t):!1}function hi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Vy(){return{animate:hi(!0),whileInView:hi(),whileHover:hi(),whileTap:hi(),whileDrag:hi(),whileFocus:hi(),exit:hi()}}class Ga{constructor(s){this.isMounted=!1,this.node=s}update(){}}class rM extends Ga{constructor(s){super(s),s.animationState||(s.animationState=iM(s))}updateAnimationControlsSubscription(){const{animate:s}=this.node.getProps();Sd(s)&&(this.unmountControls=s.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:s}=this.node.getProps(),{animate:o}=this.node.prevProps||{};s!==o&&this.updateAnimationControlsSubscription()}unmount(){var s;this.node.animationState.reset(),(s=this.unmountControls)===null||s===void 0||s.call(this)}}let lM=0;class cM extends Ga{constructor(){super(...arguments),this.id=lM++}update(){if(!this.node.presenceContext)return;const{isPresent:s,onExitComplete:o}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||s===r)return;const c=this.node.animationState.setActive("exit",!s);o&&!s&&c.then(()=>o(this.id))}mount(){const{register:s}=this.node.presenceContext||{};s&&(this.unmount=s(this.id))}unmount(){}}const dM={animation:{Feature:rM},exit:{Feature:cM}},us={x:!1,y:!1};function q_(){return us.x||us.y}function uM(t){return t==="x"||t==="y"?us[t]?null:(us[t]=!0,()=>{us[t]=!1}):us.x||us.y?null:(us.x=us.y=!0,()=>{us.x=us.y=!1})}const Ym=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function ol(t,s,o,r={passive:!0}){return t.addEventListener(s,o,r),()=>t.removeEventListener(s,o)}function ml(t){return{point:{x:t.pageX,y:t.pageY}}}const fM=t=>s=>Ym(s)&&t(s,ml(s));function Kr(t,s,o,r){return ol(t,s,fM(o),r)}const qy=(t,s)=>Math.abs(t-s);function pM(t,s){const o=qy(t.x,s.x),r=qy(t.y,s.y);return Math.sqrt(o**2+r**2)}class G_{constructor(s,o,{transformPagePoint:r,contextWindow:c,dragSnapToOrigin:d=!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 b=up(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,S=pM(b.offset,{x:0,y:0})>=3;if(!x&&!S)return;const{point:k}=b,{timestamp:w}=rn;this.history.push({...k,timestamp:w});const{onStart:N,onMove:T}=this.handlers;x||(N&&N(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=dp(x,this.transformPagePoint),xt.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:S,onSessionEnd:k,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=up(b.type==="pointercancel"?this.lastMoveEventInfo:dp(x,this.transformPagePoint),this.history);this.startEvent&&S&&S(b,N),k&&k(b,N)},!Ym(s))return;this.dragSnapToOrigin=d,this.handlers=o,this.transformPagePoint=r,this.contextWindow=c||window;const u=ml(s),p=dp(u,this.transformPagePoint),{point:m}=p,{timestamp:g}=rn;this.history=[{...m,timestamp:g}];const{onSessionStart:v}=o;v&&v(s,up(p,this.history)),this.removeListeners=pl(Kr(this.contextWindow,"pointermove",this.handlePointerMove),Kr(this.contextWindow,"pointerup",this.handlePointerUp),Kr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(s){this.handlers=s}end(){this.removeListeners&&this.removeListeners(),Pa(this.updatePoint)}}function dp(t,s){return s?{point:s(t.point)}:t}function Gy(t,s){return{x:t.x-s.x,y:t.y-s.y}}function up({point:t},s){return{point:t,delta:Gy(t,F_(s)),offset:Gy(t,mM(s)),velocity:hM(s,.1)}}function mM(t){return t[0]}function F_(t){return t[t.length-1]}function hM(t,s){if(t.length<2)return{x:0,y:0};let o=t.length-1,r=null;const c=F_(t);for(;o>=0&&(r=t[o],!(c.timestamp-r.timestamp>Xs(s)));)o--;if(!r)return{x:0,y:0};const d=Qs(c.timestamp-r.timestamp);if(d===0)return{x:0,y:0};const u={x:(c.x-r.x)/d,y:(c.y-r.y)/d};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}const Z_=1e-4,gM=1-Z_,vM=1+Z_,K_=.01,yM=0-K_,bM=0+K_;function On(t){return t.max-t.min}function xM(t,s,o){return Math.abs(t-s)<=o}function Fy(t,s,o,r=.5){t.origin=r,t.originPoint=jt(s.min,s.max,t.origin),t.scale=On(o)/On(s),t.translate=jt(o.min,o.max,t.origin)-t.originPoint,(t.scale>=gM&&t.scale<=vM||isNaN(t.scale))&&(t.scale=1),(t.translate>=yM&&t.translate<=bM||isNaN(t.translate))&&(t.translate=0)}function Yr(t,s,o,r){Fy(t.x,s.x,o.x,r?r.originX:void 0),Fy(t.y,s.y,o.y,r?r.originY:void 0)}function Zy(t,s,o){t.min=o.min+s.min,t.max=t.min+On(s)}function _M(t,s,o){Zy(t.x,s.x,o.x),Zy(t.y,s.y,o.y)}function Ky(t,s,o){t.min=s.min-o.min,t.max=t.min+On(s)}function Jr(t,s,o){Ky(t.x,s.x,o.x),Ky(t.y,s.y,o.y)}function kM(t,{min:s,max:o},r){return s!==void 0&&t<s?t=r?jt(s,t,r.min):Math.max(t,s):o!==void 0&&t>o&&(t=r?jt(o,t,r.max):Math.min(t,o)),t}function Yy(t,s,o){return{min:s!==void 0?t.min+s:void 0,max:o!==void 0?t.max+o-(t.max-t.min):void 0}}function SM(t,{top:s,left:o,bottom:r,right:c}){return{x:Yy(t.x,o,c),y:Yy(t.y,s,r)}}function Jy(t,s){let o=s.min-t.min,r=s.max-t.max;return s.max-s.min<t.max-t.min&&([o,r]=[r,o]),{min:o,max:r}}function TM(t,s){return{x:Jy(t.x,s.x),y:Jy(t.y,s.y)}}function wM(t,s){let o=.5;const r=On(t),c=On(s);return c>r?o=Oo(s.min,s.max-r,t.min):r>c&&(o=Oo(t.min,t.max-c,s.min)),na(0,1,o)}function jM(t,s){const o={};return s.min!==void 0&&(o.min=s.min-t.min),s.max!==void 0&&(o.max=s.max-t.min),o}const Zp=.35;function NM(t=Zp){return t===!1?t=0:t===!0&&(t=Zp),{x:Wy(t,"left","right"),y:Wy(t,"top","bottom")}}function Wy(t,s,o){return{min:Xy(t,s),max:Xy(t,o)}}function Xy(t,s){return typeof t=="number"?t:t[s]||0}const Qy=()=>({translate:0,scale:1,origin:0,originPoint:0}),jo=()=>({x:Qy(),y:Qy()}),eb=()=>({min:0,max:0}),Bt=()=>({x:eb(),y:eb()});function Wn(t){return[t("x"),t("y")]}function Y_({top:t,left:s,right:o,bottom:r}){return{x:{min:s,max:o},y:{min:t,max:r}}}function CM({x:t,y:s}){return{top:s.min,right:t.max,bottom:s.max,left:t.min}}function EM(t,s){if(!s)return t;const o=s({x:t.left,y:t.top}),r=s({x:t.right,y:t.bottom});return{top:o.y,left:o.x,bottom:r.y,right:r.x}}function fp(t){return t===void 0||t===1}function Kp({scale:t,scaleX:s,scaleY:o}){return!fp(t)||!fp(s)||!fp(o)}function xi(t){return Kp(t)||J_(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function J_(t){return tb(t.x)||tb(t.y)}function tb(t){return t&&t!=="0%"}function od(t,s,o){const r=t-o,c=s*r;return o+c}function nb(t,s,o,r,c){return c!==void 0&&(t=od(t,c,r)),od(t,o,r)+s}function Yp(t,s=0,o=1,r,c){t.min=nb(t.min,s,o,r,c),t.max=nb(t.max,s,o,r,c)}function W_(t,{x:s,y:o}){Yp(t.x,s.translate,s.scale,s.originPoint),Yp(t.y,o.translate,o.scale,o.originPoint)}const sb=.999999999999,ab=1.0000000000001;function AM(t,s,o,r=!1){const c=o.length;if(!c)return;s.x=s.y=1;let d,u;for(let p=0;p<c;p++){d=o[p],u=d.projectionDelta;const{visualElement:m}=d.options;m&&m.props.style&&m.props.style.display==="contents"||(r&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Co(t,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),u&&(s.x*=u.x.scale,s.y*=u.y.scale,W_(t,u)),r&&xi(d.latestValues)&&Co(t,d.latestValues))}s.x<ab&&s.x>sb&&(s.x=1),s.y<ab&&s.y>sb&&(s.y=1)}function No(t,s){t.min=t.min+s,t.max=t.max+s}function ib(t,s,o,r,c=.5){const d=jt(t.min,t.max,c);Yp(t,s,o,d,r)}function Co(t,s){ib(t.x,s.x,s.scaleX,s.scale,s.originX),ib(t.y,s.y,s.scaleY,s.scale,s.originY)}function X_(t,s){return Y_(EM(t.getBoundingClientRect(),s))}function DM(t,s,o){const r=X_(t,o),{scroll:c}=s;return c&&(No(r.x,c.offset.x),No(r.y,c.offset.y)),r}const Q_=({current:t})=>t?t.ownerDocument.defaultView:null,RM=new WeakMap;class MM{constructor(s){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=s}start(s,{snapToCursor:o=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const c=v=>{const{dragSnapToOrigin:b}=this.getProps();b?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(ml(v).point)},d=(v,b)=>{const{drag:x,dragPropagation:S,onDragStart:k}=this.getProps();if(x&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=uM(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),Wn(N=>{let T=this.getAxisMotionValue(N).get()||0;if(ws.test(T)){const{projection:C}=this.visualElement;if(C&&C.layout){const R=C.layout.layoutBox[N];R&&(T=On(R)*(parseFloat(T)/100))}}this.originPoint[N]=T}),k&&xt.postRender(()=>k(v,b)),Lp(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},u=(v,b)=>{const{dragPropagation:x,dragDirectionLock:S,onDirectionLock:k,onDrag:w}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:N}=b;if(S&&this.currentDirection===null){this.currentDirection=IM(N),this.currentDirection!==null&&k&&k(this.currentDirection);return}this.updateAxis("x",b.point,N),this.updateAxis("y",b.point,N),this.visualElement.render(),w&&w(v,b)},p=(v,b)=>this.stop(v,b),m=()=>Wn(v=>{var b;return this.getAnimationState(v)==="paused"&&((b=this.getAxisMotionValue(v).animation)===null||b===void 0?void 0:b.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new G_(s,{onSessionStart:c,onStart:d,onMove:u,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:Q_(this.visualElement)})}stop(s,o){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&xt.postRender(()=>d(s,o))}cancel(){this.isDragging=!1;const{projection:s,animationState:o}=this.visualElement;s&&(s.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),o&&o.setActive("whileDrag",!1)}updateAxis(s,o,r){const{drag:c}=this.getProps();if(!r||!Oc(s,c,this.currentDirection))return;const d=this.getAxisMotionValue(s);let u=this.originPoint[s]+r[s];this.constraints&&this.constraints[s]&&(u=kM(u,this.constraints[s],this.elastic[s])),d.set(u)}resolveConstraints(){var s;const{dragConstraints:o,dragElastic:r}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)===null||s===void 0?void 0:s.layout,d=this.constraints;o&&To(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&c?this.constraints=SM(c.layoutBox,o):this.constraints=!1,this.elastic=NM(r),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&Wn(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=jM(c.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:s,onMeasureDragConstraints:o}=this.getProps();if(!s||!To(s))return!1;const r=s.current,{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=DM(r,c.root,this.visualElement.getTransformPagePoint());let u=TM(c.layout.layoutBox,d);if(o){const p=o(CM(u));this.hasMutatedConstraints=!!p,p&&(u=Y_(p))}return u}startAnimation(s){const{drag:o,dragMomentum:r,dragElastic:c,dragTransition:d,dragSnapToOrigin:u,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=Wn(v=>{if(!Oc(v,o,this.currentDirection))return;let b=m&&m[v]||{};u&&(b={min:0,max:0});const x=c?200:1e6,S=c?40:1e7,k={type:"inertia",velocity:r?s[v]:0,bounceStiffness:x,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...d,...b};return this.startAxisValueAnimation(v,k)});return Promise.all(g).then(p)}startAxisValueAnimation(s,o){const r=this.getAxisMotionValue(s);return Lp(this.visualElement,s),r.start(Km(s,r,0,o,this.visualElement,!1))}stopAnimation(){Wn(s=>this.getAxisMotionValue(s).stop())}pauseAnimation(){Wn(s=>{var o;return(o=this.getAxisMotionValue(s).animation)===null||o===void 0?void 0:o.pause()})}getAnimationState(s){var o;return(o=this.getAxisMotionValue(s).animation)===null||o===void 0?void 0:o.state}getAxisMotionValue(s){const o=`_drag${s.toUpperCase()}`,r=this.visualElement.getProps(),c=r[o];return c||this.visualElement.getValue(s,(r.initial?r.initial[s]:void 0)||0)}snapToCursor(s){Wn(o=>{const{drag:r}=this.getProps();if(!Oc(o,r,this.currentDirection))return;const{projection:c}=this.visualElement,d=this.getAxisMotionValue(o);if(c&&c.layout){const{min:u,max:p}=c.layout.layoutBox[o];d.set(s[o]-jt(u,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:s,dragConstraints:o}=this.getProps(),{projection:r}=this.visualElement;if(!To(o)||!r||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};Wn(u=>{const p=this.getAxisMotionValue(u);if(p&&this.constraints!==!1){const m=p.get();c[u]=wM({min:m,max:m},this.constraints[u])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Wn(u=>{if(!Oc(u,s,null))return;const p=this.getAxisMotionValue(u),{min:m,max:g}=this.constraints[u];p.set(jt(m,g,c[u]))})}addListeners(){if(!this.visualElement.current)return;RM.set(this.visualElement,this);const s=this.visualElement.current,o=Kr(s,"pointerdown",m=>{const{drag:g,dragListener:v=!0}=this.getProps();g&&v&&this.start(m)}),r=()=>{const{dragConstraints:m}=this.getProps();To(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:c}=this.visualElement,d=c.addEventListener("measure",r);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),xt.read(r);const u=ol(window,"resize",()=>this.scalePositionWithinConstraints()),p=c.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(Wn(v=>{const b=this.getAxisMotionValue(v);b&&(this.originPoint[v]+=m[v].translate,b.set(b.get()+m[v].translate))}),this.visualElement.render())}));return()=>{u(),o(),d(),p&&p()}}getProps(){const s=this.visualElement.getProps(),{drag:o=!1,dragDirectionLock:r=!1,dragPropagation:c=!1,dragConstraints:d=!1,dragElastic:u=Zp,dragMomentum:p=!0}=s;return{...s,drag:o,dragDirectionLock:r,dragPropagation:c,dragConstraints:d,dragElastic:u,dragMomentum:p}}}function Oc(t,s,o){return(s===!0||s===t)&&(o===null||o===t)}function IM(t,s=10){let o=null;return Math.abs(t.y)>s?o="y":Math.abs(t.x)>s&&(o="x"),o}class OM extends Ga{constructor(s){super(s),this.removeGroupControls=Mn,this.removeListeners=Mn,this.controls=new MM(s)}mount(){const{dragControls:s}=this.node.getProps();s&&(this.removeGroupControls=s.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Mn}unmount(){this.removeGroupControls(),this.removeListeners()}}const ob=t=>(s,o)=>{t&&xt.postRender(()=>t(s,o))};class BM extends Ga{constructor(){super(...arguments),this.removePointerDownListener=Mn}onPointerDown(s){this.session=new G_(s,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Q_(this.node)})}createPanHandlers(){const{onPanSessionStart:s,onPanStart:o,onPan:r,onPanEnd:c}=this.node.getProps();return{onSessionStart:ob(s),onStart:ob(o),onMove:r,onEnd:(d,u)=>{delete this.session,c&&xt.postRender(()=>c(d,u))}}}mount(){this.removePointerDownListener=Kr(this.node.current,"pointerdown",s=>this.onPointerDown(s))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Yc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function rb(t,s){return s.max===s.min?0:t/(s.max-s.min)*100}const Or={correct:(t,s)=>{if(!s.target)return t;if(typeof t=="string")if(Ae.test(t))t=parseFloat(t);else return t;const o=rb(t,s.target.x),r=rb(t,s.target.y);return`${o}% ${r}%`}},LM={correct:(t,{treeScale:s,projectionDelta:o})=>{const r=t,c=Ha.parse(t);if(c.length>5)return r;const d=Ha.createTransformer(t),u=typeof c[0]!="number"?1:0,p=o.x.scale*s.x,m=o.y.scale*s.y;c[0+u]/=p,c[1+u]/=m;const g=jt(p,m,.5);return typeof c[2+u]=="number"&&(c[2+u]/=g),typeof c[3+u]=="number"&&(c[3+u]/=g),d(c)}};class zM extends y.Component{componentDidMount(){const{visualElement:s,layoutGroup:o,switchLayoutGroup:r,layoutId:c}=this.props,{projection:d}=s;dD($M),d&&(o.group&&o.group.add(d),r&&r.register&&c&&r.register(d),d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,onExitComplete:()=>this.safeToRemove()})),Yc.hasEverUpdated=!0}getSnapshotBeforeUpdate(s){const{layoutDependency:o,visualElement:r,drag:c,isPresent:d}=this.props,u=r.projection;return u&&(u.isPresent=d,c||s.layoutDependency!==o||o===void 0?u.willUpdate():this.safeToRemove(),s.isPresent!==d&&(d?u.promote():u.relegate()||xt.postRender(()=>{const p=u.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:s}=this.props.visualElement;s&&(s.root.didUpdate(),Sm.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:s,layoutGroup:o,switchLayoutGroup:r}=this.props,{projection:c}=s;c&&(c.scheduleCheckAfterUnmount(),o&&o.group&&o.group.remove(c),r&&r.deregister&&r.deregister(c))}safeToRemove(){const{safeToRemove:s}=this.props;s&&s()}render(){return null}}function e1(t){const[s,o]=zx(),r=y.useContext(gm);return i.jsx(zM,{...t,layoutGroup:r,switchLayoutGroup:y.useContext(Fx),isPresent:s,safeToRemove:o})}const $M={borderRadius:{...Or,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Or,borderTopRightRadius:Or,borderBottomLeftRadius:Or,borderBottomRightRadius:Or,boxShadow:LM};function UM(t,s,o){const r=dn(t)?t:al(t);return r.start(Km("",r,s,o)),r.animation}function PM(t){return t instanceof SVGElement&&t.tagName!=="svg"}const HM=(t,s)=>t.depth-s.depth;class VM{constructor(){this.children=[],this.isDirty=!1}add(s){Im(this.children,s),this.isDirty=!0}remove(s){Om(this.children,s),this.isDirty=!0}forEach(s){this.isDirty&&this.children.sort(HM),this.isDirty=!1,this.children.forEach(s)}}function qM(t,s){const o=js.now(),r=({timestamp:c})=>{const d=c-o;d>=s&&(Pa(r),t(d-s))};return xt.read(r,!0),()=>Pa(r)}const t1=["TopLeft","TopRight","BottomLeft","BottomRight"],GM=t1.length,lb=t=>typeof t=="string"?parseFloat(t):t,cb=t=>typeof t=="number"||Ae.test(t);function FM(t,s,o,r,c,d){c?(t.opacity=jt(0,o.opacity!==void 0?o.opacity:1,ZM(r)),t.opacityExit=jt(s.opacity!==void 0?s.opacity:1,0,KM(r))):d&&(t.opacity=jt(s.opacity!==void 0?s.opacity:1,o.opacity!==void 0?o.opacity:1,r));for(let u=0;u<GM;u++){const p=`border${t1[u]}Radius`;let m=db(s,p),g=db(o,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||cb(m)===cb(g)?(t[p]=Math.max(jt(lb(m),lb(g),r),0),(ws.test(g)||ws.test(m))&&(t[p]+="%")):t[p]=g}(s.rotate||o.rotate)&&(t.rotate=jt(s.rotate||0,o.rotate||0,r))}function db(t,s){return t[s]!==void 0?t[s]:t.borderRadius}const ZM=n1(0,.5,y_),KM=n1(.5,.95,Mn);function n1(t,s,o){return r=>r<t?0:r>s?1:o(Oo(t,s,r))}function ub(t,s){t.min=s.min,t.max=s.max}function Kn(t,s){ub(t.x,s.x),ub(t.y,s.y)}function fb(t,s){t.translate=s.translate,t.scale=s.scale,t.originPoint=s.originPoint,t.origin=s.origin}function pb(t,s,o,r,c){return t-=s,t=od(t,1/o,r),c!==void 0&&(t=od(t,1/c,r)),t}function YM(t,s=0,o=1,r=.5,c,d=t,u=t){if(ws.test(s)&&(s=parseFloat(s),s=jt(u.min,u.max,s/100)-u.min),typeof s!="number")return;let p=jt(d.min,d.max,r);t===d&&(p-=s),t.min=pb(t.min,s,o,p,c),t.max=pb(t.max,s,o,p,c)}function mb(t,s,[o,r,c],d,u){YM(t,s[o],s[r],s[c],s.scale,d,u)}const JM=["x","scaleX","originX"],WM=["y","scaleY","originY"];function hb(t,s,o,r){mb(t.x,s,JM,o?o.x:void 0,r?r.x:void 0),mb(t.y,s,WM,o?o.y:void 0,r?r.y:void 0)}function gb(t){return t.translate===0&&t.scale===1}function s1(t){return gb(t.x)&&gb(t.y)}function vb(t,s){return t.min===s.min&&t.max===s.max}function XM(t,s){return vb(t.x,s.x)&&vb(t.y,s.y)}function yb(t,s){return Math.round(t.min)===Math.round(s.min)&&Math.round(t.max)===Math.round(s.max)}function a1(t,s){return yb(t.x,s.x)&&yb(t.y,s.y)}function bb(t){return On(t.x)/On(t.y)}function xb(t,s){return t.translate===s.translate&&t.scale===s.scale&&t.originPoint===s.originPoint}class QM{constructor(){this.members=[]}add(s){Im(this.members,s),s.scheduleRender()}remove(s){if(Om(this.members,s),s===this.prevLead&&(this.prevLead=void 0),s===this.lead){const o=this.members[this.members.length-1];o&&this.promote(o)}}relegate(s){const o=this.members.findIndex(c=>s===c);if(o===0)return!1;let r;for(let c=o;c>=0;c--){const d=this.members[c];if(d.isPresent!==!1){r=d;break}}return r?(this.promote(r),!0):!1}promote(s,o){const r=this.lead;if(s!==r&&(this.prevLead=r,this.lead=s,s.show(),r)){r.instance&&r.scheduleRender(),s.scheduleRender(),s.resumeFrom=r,o&&(s.resumeFrom.preserveOpacity=!0),r.snapshot&&(s.snapshot=r.snapshot,s.snapshot.latestValues=r.animationValues||r.latestValues),s.root&&s.root.isUpdating&&(s.isLayoutDirty=!0);const{crossfade:c}=s.options;c===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(s=>{const{options:o,resumingFrom:r}=s;o.onExitComplete&&o.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(s=>{s.instance&&s.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function e3(t,s,o){let r="";const c=t.x.translate/s.x,d=t.y.translate/s.y,u=(o==null?void 0:o.z)||0;if((c||d||u)&&(r=`translate3d(${c}px, ${d}px, ${u}px) `),(s.x!==1||s.y!==1)&&(r+=`scale(${1/s.x}, ${1/s.y}) `),o){const{transformPerspective:g,rotate:v,rotateX:b,rotateY:x,skewX:S,skewY:k}=o;g&&(r=`perspective(${g}px) ${r}`),v&&(r+=`rotate(${v}deg) `),b&&(r+=`rotateX(${b}deg) `),x&&(r+=`rotateY(${x}deg) `),S&&(r+=`skewX(${S}deg) `),k&&(r+=`skewY(${k}deg) `)}const p=t.x.scale*s.x,m=t.y.scale*s.y;return(p!==1||m!==1)&&(r+=`scale(${p}, ${m})`),r||"none"}const _i={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Vr=typeof window<"u"&&window.MotionDebug!==void 0,pp=["","X","Y","Z"],t3={visibility:"hidden"},_b=1e3;let n3=0;function mp(t,s,o,r){const{latestValues:c}=s;c[t]&&(o[t]=c[t],s.setStaticValue(t,0),r&&(r[t]=0))}function i1(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:s}=t.options;if(!s)return;const o=l_(s);if(window.MotionHasOptimisedAnimation(o,"transform")){const{layout:c,layoutId:d}=t.options;window.MotionCancelOptimisedAnimation(o,"transform",xt,!(c||d))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&i1(r)}function o1({attachResizeListener:t,defaultParent:s,measureScroll:o,checkIsScrollRoot:r,resetTransform:c}){return class{constructor(u={},p=s==null?void 0:s()){this.id=n3++,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,Vr&&(_i.totalNodes=_i.resolvedTargetDeltas=_i.recalculatedProjection=0),this.nodes.forEach(i3),this.nodes.forEach(d3),this.nodes.forEach(u3),this.nodes.forEach(o3),Vr&&window.MotionDebug.record(_i)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,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 VM)}addEventListener(u,p){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new Bm),this.eventHandlers.get(u).add(p)}notifyListeners(u,...p){const m=this.eventHandlers.get(u);m&&m.notify(...p)}hasListeners(u){return this.eventHandlers.has(u)}mount(u,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=PM(u),this.instance=u;const{layoutId:m,layout:g,visualElement:v}=this.options;if(v&&!v.current&&v.mount(u),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),t){let b;const x=()=>this.root.updateBlockedByResize=!1;t(u,()=>{this.root.updateBlockedByResize=!0,b&&b(),b=qM(x,250),Yc.hasAnimatedSinceResize&&(Yc.hasAnimatedSinceResize=!1,this.nodes.forEach(Sb))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&v&&(m||g)&&this.addEventListener("didUpdate",({delta:b,hasLayoutChanged:x,hasRelativeTargetChanged:S,layout:k})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||v.getDefaultTransition()||g3,{onLayoutAnimationStart:N,onLayoutAnimationComplete:T}=v.getProps(),C=!this.targetLayout||!a1(this.targetLayout,k)||S,R=!x&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||R||x&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(b,R);const B={...Mm(w,"layout"),onPlay:N,onComplete:T};(v.shouldReduceMotion||this.options.layoutRoot)&&(B.delay=0,B.type=!1),this.startAnimation(B)}else x||Sb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=k})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Pa(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(f3),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&i1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const b=this.path[v];b.shouldResetTransform=!0,b.updateScroll("snapshot"),b.options.layoutRoot&&b.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(),u&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(kb);return}this.isUpdating||this.nodes.forEach(l3),this.isUpdating=!1,this.nodes.forEach(c3),this.nodes.forEach(s3),this.nodes.forEach(a3),this.clearAllSnapshots();const p=js.now();rn.delta=na(0,1e3/60,p-rn.timestamp),rn.timestamp=p,rn.isProcessing=!0,ip.update.process(rn),ip.preRender.process(rn),ip.render.process(rn),rn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Sm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(r3),this.sharedNodes.forEach(p3)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,xt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){xt.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 u=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,u?u.layoutBox:void 0)}updateScroll(u="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(p=!1),p){const m=r(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:m,offset:o(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!c)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!s1(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,v=g!==this.prevTransformTemplateValue;u&&(p||xi(this.latestValues)||v)&&(c(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return u&&(m=this.removeTransform(m)),v3(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:p}=this.options;if(!p)return Bt();const m=p.measureViewportBox();if(!(((u=this.scroll)===null||u===void 0?void 0:u.wasRoot)||this.path.some(y3))){const{scroll:v}=this.root;v&&(No(m.x,v.offset.x),No(m.y,v.offset.y))}return m}removeElementScroll(u){var p;const m=Bt();if(Kn(m,u),!((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:b,options:x}=v;v!==this.root&&b&&x.layoutScroll&&(b.wasRoot&&Kn(m,u),No(m.x,b.offset.x),No(m.y,b.offset.y))}return m}applyTransform(u,p=!1){const m=Bt();Kn(m,u);for(let g=0;g<this.path.length;g++){const v=this.path[g];!p&&v.options.layoutScroll&&v.scroll&&v!==v.root&&Co(m,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),xi(v.latestValues)&&Co(m,v.latestValues)}return xi(this.latestValues)&&Co(m,this.latestValues),m}removeTransform(u){const p=Bt();Kn(p,u);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!xi(g.latestValues))continue;Kp(g.latestValues)&&g.updateSnapshot();const v=Bt(),b=g.measurePageBox();Kn(v,b),hb(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,v)}return xi(this.latestValues)&&hb(p,this.latestValues),p}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.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!==rn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!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(!(u||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:b,layoutId:x}=this.options;if(!(!this.layout||!(b||x))){if(this.resolvedRelativeTargetAt=rn.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(),Jr(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Kn(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(),_M(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Kn(this.target,this.layout.layoutBox),W_(this.target,this.targetDelta)):Kn(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(),Jr(this.relativeTargetOrigin,this.target,S.target),Kn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Vr&&_i.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Kp(this.parent.latestValues)||J_(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 u;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===rn.timestamp&&(g=!1),g)return;const{layout:v,layoutId:b}=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||b))return;Kn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,S=this.treeScale.y;AM(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:k}=p;if(!k){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fb(this.prevProjectionDelta.x,this.projectionDelta.x),fb(this.prevProjectionDelta.y,this.projectionDelta.y)),Yr(this.projectionDelta,this.layoutCorrected,k,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==S||!xb(this.projectionDelta.x,this.prevProjectionDelta.x)||!xb(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",k)),Vr&&_i.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),u){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=jo(),this.projectionDelta=jo(),this.projectionDeltaWithTransform=jo()}setAnimationOrigin(u,p=!1){const m=this.snapshot,g=m?m.latestValues:{},v={...this.latestValues},b=jo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const x=Bt(),S=m?m.source:void 0,k=this.layout?this.layout.source:void 0,w=S!==k,N=this.getStack(),T=!N||N.members.length<=1,C=!!(w&&!T&&this.options.crossfade===!0&&!this.path.some(h3));this.animationProgress=0;let R;this.mixTargetDelta=B=>{const A=B/1e3;Tb(b.x,u.x,A),Tb(b.y,u.y,A),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Jr(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),m3(this.relativeTarget,this.relativeTargetOrigin,x,A),R&&XM(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=Bt()),Kn(R,this.relativeTarget)),w&&(this.animationValues=v,FM(v,g,this.latestValues,A,C,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Pa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=xt.update(()=>{Yc.hasAnimatedSinceResize=!0,this.currentAnimation=UM(0,_b,{...u,onUpdate:p=>{this.mixTargetDelta(p),u.onUpdate&&u.onUpdate(p)},onComplete:()=>{u.onComplete&&u.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 u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(_b),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:v}=u;if(!(!p||!m||!g)){if(this!==u&&this.layout&&g&&r1(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||Bt();const b=On(this.layout.layoutBox.x);m.x.min=u.target.x.min,m.x.max=m.x.min+b;const x=On(this.layout.layoutBox.y);m.y.min=u.target.y.min,m.y.max=m.y.min+x}Kn(p,m),Co(p,v),Yr(this.projectionDeltaWithTransform,this.layoutCorrected,p,v)}}registerSharedNode(u,p){this.sharedNodes.has(u)||this.sharedNodes.set(u,new QM),this.sharedNodes.get(u).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 u=this.getStack();return u?u.lead===this:!0}getLead(){var u;const{layoutId:p}=this.options;return p?((u=this.getStack())===null||u===void 0?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:p}=this.options;return p?(u=this.getStack())===null||u===void 0?void 0:u.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),u&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let p=!1;const{latestValues:m}=u;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&mp("z",u,g,this.animationValues);for(let v=0;v<pp.length;v++)mp(`rotate${pp[v]}`,u,g,this.animationValues),mp(`skew${pp[v]}`,u,g,this.animationValues);u.render();for(const v in g)u.setStaticValue(v,g[v]),this.animationValues&&(this.animationValues[v]=g[v]);u.scheduleRender()}getProjectionStyles(u){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return t3;const g={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=Zc(u==null?void 0:u.pointerEvents)||"",g.transform=v?v(this.latestValues,""):"none",g;const b=this.getLead();if(!this.projectionDelta||!this.layout||!b.target){const w={};return this.options.layoutId&&(w.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,w.pointerEvents=Zc(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!xi(this.latestValues)&&(w.transform=v?v({},""):"none",this.hasProjected=!1),w}const x=b.animationValues||b.latestValues;this.applyTransformsToTarget(),g.transform=e3(this.projectionDeltaWithTransform,this.treeScale,x),v&&(g.transform=v(x,g.transform));const{x:S,y:k}=this.projectionDelta;g.transformOrigin=`${S.origin*100}% ${k.origin*100}% 0`,b.animationValues?g.opacity=b===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=b===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const w in td){if(x[w]===void 0)continue;const{correct:N,applyTo:T}=td[w],C=g.transform==="none"?x[w]:N(x[w],b);if(T){const R=T.length;for(let B=0;B<R;B++)g[T[B]]=C}else g[w]=C}return this.options.layoutId&&(g.pointerEvents=b===this?Zc(u==null?void 0:u.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>{var p;return(p=u.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(kb),this.root.sharedNodes.clear()}}}function s3(t){t.updateLayout()}function a3(t){var s;const o=((s=t.resumeFrom)===null||s===void 0?void 0:s.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:c}=t.layout,{animationType:d}=t.options,u=o.source!==t.layout.source;d==="size"?Wn(b=>{const x=u?o.measuredBox[b]:o.layoutBox[b],S=On(x);x.min=r[b].min,x.max=x.min+S}):r1(d,o.layoutBox,r)&&Wn(b=>{const x=u?o.measuredBox[b]:o.layoutBox[b],S=On(r[b]);x.max=x.min+S,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[b].max=t.relativeTarget[b].min+S)});const p=jo();Yr(p,r,o.layoutBox);const m=jo();u?Yr(m,t.applyTransform(c,!0),o.measuredBox):Yr(m,r,o.layoutBox);const g=!s1(p);let v=!1;if(!t.resumeFrom){const b=t.getClosestProjectingParent();if(b&&!b.resumeFrom){const{snapshot:x,layout:S}=b;if(x&&S){const k=Bt();Jr(k,o.layoutBox,x.layoutBox);const w=Bt();Jr(w,r,S.layoutBox),a1(k,w)||(v=!0),b.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=k,t.relativeParent=b)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:o,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:v})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function i3(t){Vr&&_i.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 o3(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function r3(t){t.clearSnapshot()}function kb(t){t.clearMeasurements()}function l3(t){t.isLayoutDirty=!1}function c3(t){const{visualElement:s}=t.options;s&&s.getProps().onBeforeLayoutMeasure&&s.notify("BeforeLayoutMeasure"),t.resetTransform()}function Sb(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function d3(t){t.resolveTargetDelta()}function u3(t){t.calcProjection()}function f3(t){t.resetSkewAndRotation()}function p3(t){t.removeLeadSnapshot()}function Tb(t,s,o){t.translate=jt(s.translate,0,o),t.scale=jt(s.scale,1,o),t.origin=s.origin,t.originPoint=s.originPoint}function wb(t,s,o,r){t.min=jt(s.min,o.min,r),t.max=jt(s.max,o.max,r)}function m3(t,s,o,r){wb(t.x,s.x,o.x,r),wb(t.y,s.y,o.y,r)}function h3(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const g3={duration:.45,ease:[.4,0,.1,1]},jb=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Nb=jb("applewebkit/")&&!jb("chrome/")?Math.round:Mn;function Cb(t){t.min=Nb(t.min),t.max=Nb(t.max)}function v3(t){Cb(t.x),Cb(t.y)}function r1(t,s,o){return t==="position"||t==="preserve-aspect"&&!xM(bb(s),bb(o),.2)}function y3(t){var s;return t!==t.root&&((s=t.scroll)===null||s===void 0?void 0:s.wasRoot)}const b3=o1({attachResizeListener:(t,s)=>ol(t,"resize",s),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),hp={current:void 0},l1=o1({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!hp.current){const t=new b3({});t.mount(window),t.setOptions({layoutScroll:!0}),hp.current=t}return hp.current},resetTransform:(t,s)=>{t.style.transform=s!==void 0?s:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),x3={pan:{Feature:BM},drag:{Feature:OM,ProjectionNode:l1,MeasureLayout:e1}};function _3(t,s,o){var r;if(t instanceof Element)return[t];if(typeof t=="string"){let c=document;const d=(r=void 0)!==null&&r!==void 0?r:c.querySelectorAll(t);return d?Array.from(d):[]}return Array.from(t)}function c1(t,s){const o=_3(t),r=new AbortController,c={passive:!0,...s,signal:r.signal};return[o,c,()=>r.abort()]}function Eb(t){return s=>{s.pointerType==="touch"||q_()||t(s)}}function k3(t,s,o={}){const[r,c,d]=c1(t,o),u=Eb(p=>{const{target:m}=p,g=s(p);if(typeof g!="function"||!m)return;const v=Eb(b=>{g(b),m.removeEventListener("pointerleave",v)});m.addEventListener("pointerleave",v,c)});return r.forEach(p=>{p.addEventListener("pointerenter",u,c)}),d}function Ab(t,s,o){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",o==="Start");const c="onHover"+o,d=r[c];d&&xt.postRender(()=>d(s,ml(s)))}class S3 extends Ga{mount(){const{current:s}=this.node;s&&(this.unmount=k3(s,o=>(Ab(this.node,o,"Start"),r=>Ab(this.node,r,"End"))))}unmount(){}}class T3 extends Ga{constructor(){super(...arguments),this.isActive=!1}onFocus(){let s=!1;try{s=this.node.current.matches(":focus-visible")}catch{s=!0}!s||!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=pl(ol(this.node.current,"focus",()=>this.onFocus()),ol(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const d1=(t,s)=>s?t===s?!0:d1(t,s.parentElement):!1,w3=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function j3(t){return w3.has(t.tagName)||t.tabIndex!==-1}const qr=new WeakSet;function Db(t){return s=>{s.key==="Enter"&&t(s)}}function gp(t,s){t.dispatchEvent(new PointerEvent("pointer"+s,{isPrimary:!0,bubbles:!0}))}const N3=(t,s)=>{const o=t.currentTarget;if(!o)return;const r=Db(()=>{if(qr.has(o))return;gp(o,"down");const c=Db(()=>{gp(o,"up")}),d=()=>gp(o,"cancel");o.addEventListener("keyup",c,s),o.addEventListener("blur",d,s)});o.addEventListener("keydown",r,s),o.addEventListener("blur",()=>o.removeEventListener("keydown",r),s)};function Rb(t){return Ym(t)&&!q_()}function C3(t,s,o={}){const[r,c,d]=c1(t,o),u=p=>{const m=p.currentTarget;if(!Rb(p)||qr.has(m))return;qr.add(m);const g=s(p),v=(S,k)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",x),!(!Rb(S)||!qr.has(m))&&(qr.delete(m),typeof g=="function"&&g(S,{success:k}))},b=S=>{v(S,o.useGlobalTarget||d1(m,S.target))},x=S=>{v(S,!1)};window.addEventListener("pointerup",b,c),window.addEventListener("pointercancel",x,c)};return r.forEach(p=>{!j3(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(o.useGlobalTarget?window:p).addEventListener("pointerdown",u,c),p.addEventListener("focus",g=>N3(g,c),c)}),d}function Mb(t,s,o){const{props:r}=t;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",o==="Start");const c="onTap"+(o==="End"?"":o),d=r[c];d&&xt.postRender(()=>d(s,ml(s)))}class E3 extends Ga{mount(){const{current:s}=this.node;s&&(this.unmount=C3(s,o=>(Mb(this.node,o,"Start"),(r,{success:c})=>Mb(this.node,r,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Jp=new WeakMap,vp=new WeakMap,A3=t=>{const s=Jp.get(t.target);s&&s(t)},D3=t=>{t.forEach(A3)};function R3({root:t,...s}){const o=t||document;vp.has(o)||vp.set(o,{});const r=vp.get(o),c=JSON.stringify(s);return r[c]||(r[c]=new IntersectionObserver(D3,{root:t,...s})),r[c]}function M3(t,s,o){const r=R3(s);return Jp.set(t,o),r.observe(t),()=>{Jp.delete(t),r.unobserve(t)}}const I3={some:0,all:1};class O3 extends Ga{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:s={}}=this.node.getProps(),{root:o,margin:r,amount:c="some",once:d}=s,u={root:o?o.current:void 0,rootMargin:r,threshold:typeof c=="number"?c:I3[c]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,d&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:v,onViewportLeave:b}=this.node.getProps(),x=g?v:b;x&&x(m)};return M3(this.node.current,u,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:s,prevProps:o}=this.node;["amount","margin","root"].some(B3(s,o))&&this.startObserver()}unmount(){}}function B3({viewport:t={}},{viewport:s={}}={}){return o=>t[o]!==s[o]}const L3={inView:{Feature:O3},tap:{Feature:E3},focus:{Feature:T3},hover:{Feature:S3}},z3={layout:{ProjectionNode:l1,MeasureLayout:e1}},rd={current:null},Jm={current:!1};function u1(){if(Jm.current=!0,!!bm)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),s=()=>rd.current=t.matches;t.addListener(s),s()}else rd.current=!1}const $3=[...R_,cn,Ha],U3=t=>$3.find(D_(t)),Ib=new WeakMap;function P3(t,s,o){for(const r in s){const c=s[r],d=o[r];if(dn(c))t.addValue(r,c);else if(dn(d))t.addValue(r,al(c,{owner:t}));else if(d!==c)if(t.hasValue(r)){const u=t.getValue(r);u.liveStyle===!0?u.jump(c):u.hasAnimated||u.set(c)}else{const u=t.getStaticValue(r);t.addValue(r,al(u!==void 0?u:c,{owner:t}))}}for(const r in o)s[r]===void 0&&t.removeValue(r);return s}const Ob=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class H3{scrapeMotionValuesFromProps(s,o,r){return{}}constructor({parent:s,props:o,presenceContext:r,reducedMotionConfig:c,blockInitialAnimation:d,visualState:u},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Gm,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=js.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,xt.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:v}=u;this.onUpdate=v,this.latestValues=m,this.baseTarget={...m},this.initialValues=o.initial?{...m}:{},this.renderState=g,this.parent=s,this.props=o,this.presenceContext=r,this.depth=s?s.depth+1:0,this.reducedMotionConfig=c,this.options=p,this.blockInitialAnimation=!!d,this.isControllingVariants=Td(o),this.isVariantNode=qx(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(s&&s.current);const{willChange:b,...x}=this.scrapeMotionValuesFromProps(o,{},this);for(const S in x){const k=x[S];m[S]!==void 0&&dn(k)&&k.set(m[S],!1)}}mount(s){this.current=s,Ib.set(s,this),this.projection&&!this.projection.instance&&this.projection.mount(s),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,r)=>this.bindToMotionValue(r,o)),Jm.current||u1(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:rd.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ib.delete(this.current),this.projection&&this.projection.unmount(),Pa(this.notifyUpdate),Pa(this.render),this.valueSubscriptions.forEach(s=>s()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const s in this.events)this.events[s].clear();for(const s in this.features){const o=this.features[s];o&&(o.unmount(),o.isMounted=!1)}this.current=null}bindToMotionValue(s,o){this.valueSubscriptions.has(s)&&this.valueSubscriptions.get(s)();const r=Ai.has(s),c=o.on("change",p=>{this.latestValues[s]=p,this.props.onUpdate&&xt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),d=o.on("renderRequest",this.scheduleRender);let u;window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,s,o)),this.valueSubscriptions.set(s,()=>{c(),d(),u&&u(),o.owner&&o.stop()})}sortNodePosition(s){return!this.current||!this.sortInstanceNodePosition||this.type!==s.type?0:this.sortInstanceNodePosition(this.current,s.current)}updateFeatures(){let s="animation";for(s in Io){const o=Io[s];if(!o)continue;const{isEnabled:r,Feature:c}=o;if(!this.features[s]&&c&&r(this.props)&&(this.features[s]=new c(this)),this.features[s]){const d=this.features[s];d.isMounted?d.update():(d.mount(),d.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Bt()}getStaticValue(s){return this.latestValues[s]}setStaticValue(s,o){this.latestValues[s]=o}update(s,o){(s.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=s,this.prevPresenceContext=this.presenceContext,this.presenceContext=o;for(let r=0;r<Ob.length;r++){const c=Ob[r];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);const d="on"+c,u=s[d];u&&(this.propEventSubscriptions[c]=this.on(c,u))}this.prevMotionValues=P3(this,this.scrapeMotionValuesFromProps(s,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(s){return this.props.variants?this.props.variants[s]: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(s){const o=this.getClosestVariantNode();if(o)return o.variantChildren&&o.variantChildren.add(s),()=>o.variantChildren.delete(s)}addValue(s,o){const r=this.values.get(s);o!==r&&(r&&this.removeValue(s),this.bindToMotionValue(s,o),this.values.set(s,o),this.latestValues[s]=o.get())}removeValue(s){this.values.delete(s);const o=this.valueSubscriptions.get(s);o&&(o(),this.valueSubscriptions.delete(s)),delete this.latestValues[s],this.removeValueFromRenderState(s,this.renderState)}hasValue(s){return this.values.has(s)}getValue(s,o){if(this.props.values&&this.props.values[s])return this.props.values[s];let r=this.values.get(s);return r===void 0&&o!==void 0&&(r=al(o===null?void 0:o,{owner:this}),this.addValue(s,r)),r}readValue(s,o){var r;let c=this.latestValues[s]!==void 0||!this.current?this.latestValues[s]:(r=this.getBaseTargetFromProps(this.props,s))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,s,this.options);return c!=null&&(typeof c=="string"&&(E_(c)||x_(c))?c=parseFloat(c):!U3(c)&&Ha.test(o)&&(c=j_(s,o)),this.setBaseTarget(s,dn(c)?c.get():c)),dn(c)?c.get():c}setBaseTarget(s,o){this.baseTarget[s]=o}getBaseTarget(s){var o;const{initial:r}=this.props;let c;if(typeof r=="string"||typeof r=="object"){const u=wm(this.props,r,(o=this.presenceContext)===null||o===void 0?void 0:o.custom);u&&(c=u[s])}if(r&&c!==void 0)return c;const d=this.getBaseTargetFromProps(this.props,s);return d!==void 0&&!dn(d)?d:this.initialValues[s]!==void 0&&c===void 0?void 0:this.baseTarget[s]}on(s,o){return this.events[s]||(this.events[s]=new Bm),this.events[s].add(o)}notify(s,...o){this.events[s]&&this.events[s].notify(...o)}}class f1 extends H3{constructor(){super(...arguments),this.KeyframeResolver=M_}sortInstanceNodePosition(s,o){return s.compareDocumentPosition(o)&2?1:-1}getBaseTargetFromProps(s,o){return s.style?s.style[o]:void 0}removeValueFromRenderState(s,{vars:o,style:r}){delete o[s],delete r[s]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:s}=this.props;dn(s)&&(this.childSubscription=s.on("change",o=>{this.current&&(this.current.textContent=`${o}`)}))}}function V3(t){return window.getComputedStyle(t)}class q3 extends f1{constructor(){super(...arguments),this.type="html",this.renderInstance=Qx}readValueFromInstance(s,o){if(Ai.has(o)){const r=qm(o);return r&&r.default||0}else{const r=V3(s),c=(Jx(o)?r.getPropertyValue(o):r[o])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(s,{transformPagePoint:o}){return X_(s,o)}build(s,o,r){Cm(s,o,r.transformTemplate)}scrapeMotionValuesFromProps(s,o,r){return Rm(s,o,r)}}class G3 extends f1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Bt}getBaseTargetFromProps(s,o){return s[o]}readValueFromInstance(s,o){if(Ai.has(o)){const r=qm(o);return r&&r.default||0}return o=e_.has(o)?o:km(o),s.getAttribute(o)}scrapeMotionValuesFromProps(s,o,r){return s_(s,o,r)}build(s,o,r){Em(s,o,this.isSVGTag,r.transformTemplate)}renderInstance(s,o,r,c){t_(s,o,r,c)}mount(s){this.isSVGTag=Dm(s.tagName),super.mount(s)}}const F3=(t,s)=>Tm(t)?new G3(s):new q3(s,{allowProjection:t!==y.Fragment}),Z3=bD({...dM,...L3,...x3,...z3},F3),Rt=IA(Z3);function K3(){!Jm.current&&u1();const[t]=y.useState(rd.current);return t}const Y3="_overlay_cmicx_1",J3="_dialog_cmicx_11",W3="_title_cmicx_30",X3="_description_cmicx_38",Q3="_actions_cmicx_45",e6="_cancelButton_cmicx_52",t6="_confirmButton_cmicx_79",gi={overlay:Y3,dialog:J3,title:W3,description:X3,actions:Q3,cancelButton:e6,confirmButton:t6};function ji({isOpen:t,title:s,description:o,confirmLabel:r="Delete",onConfirm:c,onCancel:d}){const u=y.useId(),p=y.useId();return i.jsx(ps,{children:t&&i.jsx(Rt.div,{className:gi.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:d,onKeyDown:m=>{m.key==="Escape"&&d()},role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":o?p:void 0,children:i.jsxs(Rt.div,{className:gi.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:[i.jsx("h3",{id:u,className:gi.title,children:s}),o&&i.jsx("p",{id:p,className:gi.description,children:o}),i.jsxs("div",{className:gi.actions,children:[i.jsx("button",{type:"button",className:gi.cancelButton,onClick:d,autoFocus:!0,children:"Cancel"}),i.jsx("button",{type:"button",className:gi.confirmButton,onClick:c,children:r})]})]})})})}const n6="_skeleton_1gqp4_9",s6="_circular_1gqp4_17",a6="_textContainer_1gqp4_26",i6="_card_1gqp4_31",ld={skeleton:n6,circular:s6,textContainer:a6,card:i6};function _e({width:t="100%",height:s="1rem",borderRadius:o,variant:r="rectangular",className:c}){const d=[ld.skeleton,r==="circular"?ld.circular:"",c??""].filter(Boolean).join(" ");return i.jsx("div",{className:d,style:{width:t,height:s,...o&&r!=="circular"?{borderRadius:o}:{}},"aria-hidden":"true","data-testid":"skeleton"})}function Wp({lines:t=3,lastLineWidth:s="60%",lineHeight:o="0.75rem",gap:r="var(--space-sm)",className:c}){return i.jsx("div",{className:`${ld.textContainer} ${c??""}`,style:{gap:r},"aria-hidden":"true","data-testid":"skeleton-text",children:Array.from({length:t},(d,u)=>i.jsx(_e,{width:u===t-1&&t>1?s:"100%",height:o},u))})}function cd({lines:t=2,className:s}){return i.jsxs("div",{className:`${ld.card} ${s??""}`,"aria-hidden":"true","data-testid":"skeleton-card",children:[i.jsx(_e,{width:"40%",height:"1.25rem"}),i.jsx(Wp,{lines:t})]})}const o6="_spinner_1uyt1_1",r6="_spin_1uyt1_1",l6="_sm_1uyt1_14",c6="_md_1uyt1_20",d6="_lg_1uyt1_26",u6="_xl_1uyt1_32",Bb={spinner:o6,spin:r6,sm:l6,md:c6,lg:d6,xl:u6};function p1({size:t="md",className:s,label:o="Loading",liveRegion:r=!1}){return i.jsx("span",{className:`${Bb.spinner} ${Bb[t]} ${s??""}`,role:r?"status":void 0,"aria-label":o,"aria-hidden":r?void 0:!0})}const f6="_splash_1bn1g_1",p6="_logo_1bn1g_11",Lb={splash:f6,logo:p6};function m1(){return i.jsxs("div",{className:Lb.splash,"data-testid":"splash-screen",children:[i.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:Lb.logo}),i.jsx(p1,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}const m6="_wrapper_4e5yt_1",h6="_wrapperBlock_4e5yt_6",g6="_tooltip_4e5yt_11",v6="_visible_4e5yt_31",y6="_top_4e5yt_41",b6="_bottom_4e5yt_48",x6="_left_4e5yt_55",_6="_right_4e5yt_62",Br={wrapper:m6,wrapperBlock:h6,tooltip:g6,visible:v6,top:y6,bottom:b6,left:x6,right:_6},k6=300,Bc=6;function Lo({text:t,placement:s="top",delayMs:o=k6,inline:r=!0,children:c,className:d,"data-testid":u}){const[p,m]=y.useState(!1),[g,v]=y.useState({top:0,left:0}),b=y.useRef(null),x=y.useRef(null),S=y.useRef(void 0),k=y.useId(),w=typeof document<"u",N=y.useCallback(()=>{if(!b.current||!x.current)return;const U=b.current.getBoundingClientRect(),X=x.current.getBoundingClientRect();let Q=0,P=0;switch(s){case"top":Q=U.top-X.height-Bc,P=U.left+U.width/2-X.width/2;break;case"bottom":Q=U.bottom+Bc,P=U.left+U.width/2-X.width/2;break;case"left":Q=U.top+U.height/2-X.height/2,P=U.left-X.width-Bc;break;case"right":Q=U.top+U.height/2-X.height/2,P=U.right+Bc;break}v({top:Q,left:P})},[s]),T=y.useCallback(U=>{S.current!==void 0&&clearTimeout(S.current),S.current=setTimeout(()=>{N(),m(!0),S.current=void 0},U)},[N]),C=y.useCallback(()=>{T(o)},[o,T]),R=y.useCallback(()=>{T(0)},[T]),B=y.useCallback(()=>{S.current!==void 0&&(clearTimeout(S.current),S.current=void 0),m(!1)},[]);y.useEffect(()=>{if(!p)return;const U=X=>{X.key==="Escape"&&B()};return document.addEventListener("keydown",U),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{document.removeEventListener("keydown",U),window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[p,B,N]),y.useEffect(()=>()=>{S.current!==void 0&&clearTimeout(S.current)},[]);const A=r?"span":"div",M=[r?Br.wrapper:Br.wrapperBlock,d].filter(Boolean).join(" ");let D=c;if(y.isValidElement(c)){const U=c,X=U.props["aria-describedby"],Q=p?X?`${X} ${k}`:k:X;D=y.cloneElement(U,{"aria-describedby":Q})}const z=i.jsx("div",{ref:x,id:k,role:"tooltip",className:`${Br.tooltip} ${Br[s]} ${p?Br.visible:""}`,style:{top:g.top,left:g.left},"data-testid":u??"tooltip",children:t});return i.jsxs(A,{ref:b,className:M,onMouseEnter:C,onMouseLeave:B,onFocus:R,onBlur:B,children:[D,w?rT.createPortal(z,document.body):null]})}const S6="_attemptSelector_ggigl_1",T6="_attemptLabel_ggigl_17",w6="_attemptButton_ggigl_21",j6="_attemptActive_ggigl_38",N6="_attemptStatus_ggigl_44",Lr={attemptSelector:S6,attemptLabel:T6,attemptButton:w6,attemptActive:j6,attemptStatus:N6};function C6({taskSessions:t,selectedSessionId:s,onSelect:o}){if(!(t.length<2))return i.jsxs("div",{className:Lr.attemptSelector,"data-testid":"attempt-selector",children:[i.jsx("span",{className:Lr.attemptLabel,children:"Attempts:"}),t.map((r,c)=>{const d=r.id===s,u=r.status==="stopped"&&r.endReason==="completed"?"✓":r.status==="stopped"?"✗":r.status==="running"||r.status==="idle"?"●":"";return i.jsxs("button",{className:`${Lr.attemptButton} ${d?Lr.attemptActive:""}`,onClick:()=>o(r.id),title:`Attempt #${c+1} — ${r.status}`,"aria-label":`Attempt #${c+1}, ${r.status}`,"aria-pressed":d,"data-testid":`attempt-${c+1}`,children:["#",c+1,u&&i.jsx("span",{className:Lr.attemptStatus,children:u})]},r.id)})]})}const E6="_row_ldkru_1",A6="_hoverActions_ldkru_5",D6="_hoverButton_ldkru_31",R6="_selectingRow_ldkru_72",M6="_selected_ldkru_83",I6="_checkboxArea_ldkru_90",O6="_checkbox_ldkru_90",B6="_contentArea_ldkru_106",ls={row:E6,hoverActions:A6,hoverButton:D6,selectingRow:R6,selected:M6,checkboxArea:I6,checkbox:O6,contentArea:B6};function L6({copyText:t,isContentBearing:s,isSelecting:o,isSelected:r,checkboxLabel:c,onSelect:d,onToggle:u,onCopied:p,children:m}){const[g,v]=y.useState(!1),b=y.useRef(void 0);y.useEffect(()=>()=>{b.current!==void 0&&clearTimeout(b.current)},[]);const x=y.useCallback(async()=>{try{await navigator.clipboard.writeText(t),v(!0),p==null||p(),b.current!==void 0&&clearTimeout(b.current),b.current=setTimeout(()=>{v(!1)},2e3)}catch{}},[t,p]),S=y.useCallback(k=>{!o||k.target.closest("a, button, input, textarea, select, [role=button]")||(k.preventDefault(),u(k.shiftKey))},[o,u]);return s?o?i.jsxs("div",{className:`${ls.row} ${ls.selectingRow} ${r?ls.selected:""}`,onClick:S,"data-testid":"event-selectable-row",children:[i.jsx("div",{className:ls.checkboxArea,children:i.jsx("input",{type:"checkbox",checked:r,onChange:k=>{u(k.nativeEvent.shiftKey)},onClick:k=>{k.stopPropagation()},className:ls.checkbox,"aria-label":c??"Select this event","data-testid":"event-select-checkbox"})}),i.jsx("div",{className:ls.contentArea,children:m})]}):i.jsxs("div",{className:ls.row,"data-testid":"event-hover-row",children:[i.jsxs("div",{className:ls.hoverActions,"data-testid":"event-hover-actions",children:[i.jsx("button",{type:"button",className:ls.hoverButton,onClick:()=>{x().catch(()=>{})},"aria-label":"Copy event content","data-testid":"event-hover-copy",children:g?i.jsx(Ni,{size:ot,"aria-hidden":"true"}):i.jsx(px,{size:ot,"aria-hidden":"true"})}),i.jsx("button",{type:"button",className:ls.hoverButton,onClick:d,"aria-label":"Select this event","data-testid":"event-hover-select",children:i.jsx(K2,{size:ot,"aria-hidden":"true"})})]}),m]}):i.jsx("div",{className:ls.row,children:m})}const z6="_bar_1vah7_1",$6="_left_1vah7_21",U6="_right_1vah7_27",P6="_count_1vah7_33",H6="_toggleButton_1vah7_40",V6="_copyButton_1vah7_68",q6="_cancelButton_1vah7_108",vi={bar:z6,left:$6,right:U6,count:P6,toggleButton:H6,copyButton:V6,cancelButton:q6};function G6({selectedCount:t,totalSelectable:s,onSelectAll:o,onDeselectAll:r,onCopy:c,onCancel:d}){const u=t>0&&t>=s;return i.jsxs(Rt.div,{className:vi.bar,initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:12},transition:{duration:.15},"data-testid":"floating-action-bar",children:[i.jsxs("div",{className:vi.left,children:[i.jsxs("span",{className:vi.count,"data-testid":"floating-bar-count",children:[t," selected"]}),i.jsx("button",{type:"button",className:vi.toggleButton,onClick:u?r:o,"data-testid":"floating-bar-select-all",children:u?"Deselect all":"Select all"})]}),i.jsxs("div",{className:vi.right,children:[i.jsxs("button",{type:"button",className:vi.copyButton,onClick:c,disabled:t===0,"data-testid":"floating-bar-copy",children:[i.jsx(f2,{size:ot,"aria-hidden":"true"}),"Copy"]}),i.jsx("button",{type:"button",className:vi.cancelButton,onClick:d,"aria-label":"Cancel selection","data-testid":"floating-bar-cancel",children:i.jsx(Va,{size:ot,"aria-hidden":"true"})})]})]})}const h1=50;function F6(t,s,o,r,c=h1){return r?t<c:s-t-o<c}function Z6(t,s){const o=s-t;return o>0?o:0}function K6({scrollRef:t,contentLength:s,isReversed:o,paused:r}){const[c,d]=y.useState(!0),u=y.useRef(0),p=y.useRef(!1),m=y.useRef(0);y.useEffect(()=>{const v=t.current;if(!v)return;let b=!0;const x=()=>{m.current||(m.current=requestAnimationFrame(()=>{m.current=0;const S=F6(v.scrollTop,v.scrollHeight,v.clientHeight,o,h1);S!==b&&(b=S,d(S))}))};return v.addEventListener("scroll",x,{passive:!0}),()=>{v.removeEventListener("scroll",x),m.current&&(cancelAnimationFrame(m.current),m.current=0)}},[t,o]),y.useLayoutEffect(()=>{const v=t.current;!v||p.current||(p.current=!0,o?v.scrollTop=0:v.scrollTop=v.scrollHeight,d(!0))},[t,o]),y.useLayoutEffect(()=>{const v=t.current;if(v){if(r){u.current=v.scrollHeight;return}if(o&&!c){const b=Z6(u.current,v.scrollHeight);b>0&&(v.scrollTop+=b)}c&&(o?v.scrollTo({top:0,behavior:"smooth"}):v.scrollTo({top:v.scrollHeight,behavior:"smooth"})),u.current=v.scrollHeight}},[s,c,o,r,t]);const g=y.useCallback(()=>{const v=t.current;if(!v)return;const b=o?0:v.scrollHeight;v.scrollTo({top:b,behavior:"smooth"}),d(!0)},[t,o]);return{isAtAnchor:c,scrollToAnchor:g}}const Y6=new Set(["text","output","user_input","tool_use","tool_result","error"]);function rl(t){return Y6.has(t.eventType)}function J6(t){var s;switch(t.eventType){case"tool_result":{if((s=t.toolUseCtx)!=null&&s.detailedResult)return t.toolUseCtx.detailedResult;let o=t.content;if(t.content.trimStart().startsWith("{"))try{const r=JSON.parse(t.content);typeof r.content=="string"&&(o=r.content)}catch{}return o}case"tool_use":try{const o=JSON.parse(t.content),r=o.tool??"tool",c=o.args!==void 0?JSON.stringify(o.args,void 0,2):"";return`${r}
|
|
264
|
-
${c}`}catch{return t.content}default:return t.content}}function zb(t){if(t==null)return"";if(typeof t!="object")return String(t);const s=t;return typeof s.command=="string"?`\`${s.command}\``:typeof s.file_path=="string"||typeof s.filePath=="string"?`\`${s.file_path??s.filePath}\``:typeof s.path=="string"?`\`${s.path}\``:typeof s.query=="string"?`\`${s.query}\``:typeof s.pattern=="string"?`\`${s.pattern}\``:""}function W6(t){var o;const s=[];for(const r of t){if(!rl(r))continue;const c=new Date(r.timestamp).toLocaleTimeString();switch(r.eventType){case"text":case"output":{s.push(`**Assistant** (${c}):
|
|
265
|
-
${r.content}`);break}case"user_input":{s.push(`**User** (${c}):
|
|
266
|
-
${r.content}`);break}case"tool_result":{let d=((o=r.toolUseCtx)==null?void 0:o.detailedResult)??void 0;if(!d&&(d=r.content,r.content.trimStart().startsWith("{")))try{const u=JSON.parse(r.content);typeof u.content=="string"&&(d=u.content)}catch{}if(r.toolUseCtx){const u=zb(r.toolUseCtx.args),p=u?`**Tool: ${r.toolUseCtx.tool}** ${u}`:`**Tool: ${r.toolUseCtx.tool}**`;s.push(`${p} (${c}):
|
|
267
|
-
${d}`)}else s.push(`**Tool output** (${c}):
|
|
268
|
-
${d}`);break}case"tool_use":{let d="tool",u;try{const g=JSON.parse(r.content);d=g.tool??"tool",u=g.args}catch{}const p=zb(u),m=p?`**Tool: ${d}** ${p}`:`**Tool: ${d}**`;u!==void 0?s.push(`${m} (${c}):
|
|
269
|
-
\`\`\`json
|
|
270
|
-
${JSON.stringify(u,void 0,2)}
|
|
271
|
-
\`\`\``):s.push(`${m} (${c}):`);break}case"error":{s.push(`**Error** (${c}):
|
|
272
|
-
${r.content}`);break}}}return s.join(`
|
|
273
|
-
|
|
274
|
-
`)}function X6({events:t,formatForClipboard:s}){const[o,r]=y.useState(!1),[c,d]=y.useState(new Set),u=y.useRef(void 0),p=y.useMemo(()=>c.size,[c]),m=y.useCallback(k=>{r(!0),k!==void 0?(d(new Set([k])),u.current=k):(d(new Set),u.current=void 0)},[]),g=y.useCallback(()=>{r(!1),d(new Set),u.current=void 0},[]),v=y.useCallback((k,w)=>{if(w&&u.current!==void 0){const N=Math.min(u.current,k),T=Math.max(u.current,k);d(C=>{const R=new Set(C);for(let B=N;B<=T;B++)B<t.length&&rl(t[B])&&R.add(B);return R})}else d(N=>{const T=new Set(N);return T.has(k)?T.delete(k):T.add(k),T.size===0?(r(!1),u.current=void 0):u.current=k,T})},[t]),b=y.useCallback(()=>{const k=new Set;for(let w=0;w<t.length;w++)rl(t[w])&&k.add(w);d(k)},[t]),x=y.useCallback(()=>{d(new Set)},[]),S=y.useCallback(async()=>{const w=[...c].sort((T,C)=>T-C).filter(T=>T<t.length).map(T=>t[T]);if(w.length===0)return!1;const N=s(w);try{return await navigator.clipboard.writeText(N),!0}catch{return!1}},[c,t,s]);return{isSelecting:o,selectedIndices:c,selectedCount:p,enterSelectionMode:m,cancelSelection:g,toggleEvent:v,selectAll:b,deselectAll:x,copySelected:S}}const Q6="_wrapper_1cdza_1",e4="_scrollContainer_1cdza_9",t4="_selectingPadding_1cdza_16",n4="_toolbar_1cdza_20",s4="_directionToggle_1cdza_27",a4="_scrollToAnchor_1cdza_65",i4="_scrollToAnchorBottom_1cdza_89",o4="_scrollToAnchorTop_1cdza_93",r4="_eventOverflowWarning_1cdza_97",Js={wrapper:Q6,scrollContainer:e4,selectingPadding:t4,toolbar:n4,directionToggle:s4,scrollToAnchor:a4,scrollToAnchorBottom:i4,scrollToAnchorTop:o4,eventOverflowWarning:r4};function l4(t){const s=new Date(t.timestamp).toLocaleTimeString();switch(t.eventType){case"text":case"output":return`Select message from assistant at ${s}`;case"user_input":return`Select message from user at ${s}`;case"tool_result":case"tool_use":return`Select tool event at ${s}`;case"error":return`Select error at ${s}`;default:return`Select event at ${s}`}}const g1="grackle-stream-direction";function c4(){try{return localStorage.getItem(g1)==="reversed"}catch{return!1}}function d4({eventsDropped:t}){return t<=0?i.jsx(i.Fragment,{}):i.jsxs("div",{className:Js.eventOverflowWarning,role:"alert",children:[i.jsx(im,{size:en,"aria-hidden":"true"})," ",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 Wm({events:t,eventsDropped:s,emptyState:o,onShowToast:r}){const c=y.useRef(null),[d,u]=y.useState(c4),p=K3(),m=X6({events:t,formatForClipboard:W6}),g=y.useMemo(()=>t.filter(rl).length,[t]),v=y.useMemo(()=>d?[...t].reverse():t,[t,d]),{isAtAnchor:b,scrollToAnchor:x}=K6({scrollRef:c,contentLength:t.length,isReversed:d,paused:m.isSelecting}),S=()=>{const T=!d;u(T);try{localStorage.setItem(g1,T?"reversed":"default")}catch{}};y.useEffect(()=>{if(!m.isSelecting)return;const T=C=>{C.key==="Escape"&&m.cancelSelection()};return window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}},[m.isSelecting,m.cancelSelection]);const k=y.useCallback(async()=>{await m.copySelected()&&(r==null||r(`Copied ${m.selectedCount} message${m.selectedCount===1?"":"s"} to clipboard`,"success"))},[m,r]),w=p?0:.2,N=d?-8:8;return i.jsxs("div",{className:Js.wrapper,children:[i.jsx("div",{className:Js.toolbar,children:i.jsx(Lo,{text:d?"Showing newest first":"Showing oldest first",children:i.jsx("button",{className:Js.directionToggle,onClick:S,"aria-label":d?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:d?i.jsx(iy,{size:en,"aria-hidden":"true"}):i.jsx(oy,{size:en,"aria-hidden":"true"})})})}),i.jsxs("div",{ref:c,className:`${Js.scrollContainer} ${m.isSelecting?Js.selectingPadding:""}`,"data-testid":"event-stream-scroll",children:[t.length===0&&o,i.jsx(d4,{eventsDropped:s}),i.jsx(ps,{initial:!1,children:v.map((T,C)=>{const R=d?t.length-1-C:C;return i.jsx(Rt.div,{initial:{opacity:0,y:N},animate:{opacity:1,y:0},transition:{duration:w,ease:"easeOut"},children:i.jsx(L6,{copyText:J6(T),isContentBearing:rl(T),isSelecting:m.isSelecting,isSelected:m.selectedIndices.has(R),checkboxLabel:l4(T),onSelect:()=>{m.enterSelectionMode(R)},onToggle:B=>{m.toggleEvent(R,B)},onCopied:()=>{r==null||r("Copied to clipboard","success")},children:i.jsx(kA,{event:T,toolUseCtx:T.toolUseCtx,settled:T.settled})})},`${T.sessionId}-${T.timestamp}-${R}`)})})]}),i.jsx(ps,{children:m.isSelecting&&i.jsx(G6,{selectedCount:m.selectedCount,totalSelectable:g,onSelectAll:m.selectAll,onDeselectAll:m.deselectAll,onCopy:()=>{k().catch(()=>{})},onCancel:m.cancelSelection})}),i.jsx(ps,{children:!b&&i.jsxs(Rt.button,{className:`${Js.scrollToAnchor} ${d?Js.scrollToAnchorTop:Js.scrollToAnchorBottom}`,onClick:x,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:[d?i.jsx(oy,{size:en,"aria-hidden":"true"}):i.jsx(iy,{size:en,"aria-hidden":"true"})," New events"]})})]})}function Xm(t){const{value:s,onSave:o,validate:r,fieldId:c,activeFieldId:d,onActivate:u,enterToSave:p=!0,trimOnSave:m=!0}=t,[g,v]=y.useState(""),[b,x]=y.useState(""),S=y.useRef(!1),k=d===c,w=y.useCallback(D=>{v(D),x("")},[]),N=y.useCallback(()=>{x("")},[]),T=y.useCallback(()=>{S.current=!1,u==null||u(null),v(""),x("")},[u]),C=y.useCallback(()=>{const D=m?g.trim():g;if(r){const U=r(g);if(U){x(U);return}}const z=m?s.trim():s;if(D===z){T();return}o(D),T()},[g,s,m,r,o,T]),R=y.useCallback(()=>{S.current=!0,u==null||u(c),v(s),x("")},[c,s,u]),B=y.useCallback(D=>{if(S.current){S.current=!1;return}D.relatedTarget instanceof HTMLElement&&D.relatedTarget.dataset.editAction===c||C()},[c,C]),A=y.useCallback(D=>{D.key==="Escape"?T():D.key==="Enter"&&p&&C()},[T,p,C]),M=(()=>{if(!k)return!1;const D=m?s.trim():s;return(m?g.trim():g)!==D})();return y.useEffect(()=>{!k&&(g!==""||b!=="")&&(v(""),x(""))},[k,g,b]),{isEditing:k,draft:g,error:b,isDirty:M,startEdit:R,cancelEdit:T,save:C,setDraft:w,clearError:N,handleBlur:B,handleKeyDown:A,ignoreInitialBlurRef:S}}const u4="_editFieldWrapper_yuzty_1",f4="_editInput_yuzty_10",p4="_editTextarea_yuzty_42",m4="_editSelect_yuzty_78",h4="_editError_yuzty_111",g4="_editInputInvalid_yuzty_118",v4="_editHint_yuzty_123",y4="_unsavedDot_yuzty_132",b4="_metaValueClickable_yuzty_140",x4="_editButton_yuzty_159",_4="_metaPlaceholder_yuzty_175",k4="_worktreeToggle_yuzty_180",tt={editFieldWrapper:u4,editInput:f4,editTextarea:p4,editSelect:m4,editError:h4,editInputInvalid:g4,editHint:v4,unsavedDot:y4,metaValueClickable:b4,editButton:x4,metaPlaceholder:_4,worktreeToggle:k4};function ln(t){const{value:s,onSave:o,validate:r,mode:c="edit",fieldId:d="text",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,maxLength:b,ariaLabel:x,"data-testid":S}=t,k=y.useRef(null),w=Xm({value:s,onSave:o,validate:r,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!0,trimOnSave:!0});if(y.useEffect(()=>{if(w.isEditing){const T=window.setTimeout(()=>{var C;(C=k.current)==null||C.focus()},0);return()=>window.clearTimeout(T)}},[w.isEditing]),c==="create"){const T=R=>{m==null||m(R.target.value)},C=r==null?void 0:r(s);return i.jsxs("div",{className:tt.editFieldWrapper,children:[i.jsx("input",{className:`${tt.editInput} ${C?tt.editInputInvalid:""}`,value:s,onChange:T,maxLength:b,placeholder:v,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),C&&i.jsx("span",{className:tt.editError,"data-testid":"edit-error",children:C})]})}if(w.isEditing)return i.jsxs("div",{className:tt.editFieldWrapper,children:[i.jsx("input",{ref:k,className:`${tt.editInput} ${w.error?tt.editInputInvalid:""}`,value:w.draft,onChange:T=>w.setDraft(T.target.value),onBlur:w.handleBlur,onKeyDown:w.handleKeyDown,maxLength:b,placeholder:v,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),w.isDirty&&i.jsx("span",{className:tt.unsavedDot,title:"Unsaved changes"}),w.error&&i.jsx("span",{className:tt.editError,"data-testid":"edit-error",children:w.error}),i.jsx("span",{className:tt.editHint,children:"Enter to save · Esc to cancel"})]});const N=g==null?void 0:g(s);return i.jsxs("span",{role:"button",tabIndex:0,className:tt.metaValueClickable,onClick:()=>w.startEdit(),onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),w.startEdit())},title:"Click to edit","aria-label":x,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:s?i.jsx("span",{children:s}):i.jsx("span",{className:tt.metaPlaceholder,children:v||"None"}),i.jsx("span",{className:tt.editButton,"aria-hidden":"true",children:"✏️"})]})}function Xp(t){const{value:s,onSave:o,validate:r,mode:c="edit",fieldId:d="textarea",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:b,"data-testid":x}=t,S=y.useRef(null),k=Xm({value:s,onSave:o,validate:r,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});if(y.useEffect(()=>{if(k.isEditing){const N=window.setTimeout(()=>{var T;(T=S.current)==null||T.focus()},0);return()=>window.clearTimeout(N)}},[k.isEditing]),c==="create"){const N=C=>{m==null||m(C.target.value)},T=r==null?void 0:r(s);return i.jsxs("div",{className:tt.editFieldWrapper,children:[i.jsx("textarea",{className:`${tt.editTextarea} ${T?tt.editInputInvalid:""}`,value:s,onChange:N,placeholder:v,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),T&&i.jsx("span",{className:tt.editError,"data-testid":"edit-error",children:T})]})}if(k.isEditing)return i.jsxs("div",{className:tt.editFieldWrapper,children:[i.jsx("textarea",{ref:S,className:`${tt.editTextarea} ${k.error?tt.editInputInvalid:""}`,value:k.draft,onChange:N=>k.setDraft(N.target.value),onBlur:k.handleBlur,onKeyDown:k.handleKeyDown,title:b,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),k.isDirty&&i.jsx("span",{className:tt.unsavedDot,title:"Unsaved changes"}),k.error&&i.jsx("span",{className:tt.editError,"data-testid":"edit-error",children:k.error}),i.jsx("span",{className:tt.editHint,children:"Tab to save · Esc to cancel"})]});const w=g==null?void 0:g(s);return i.jsxs("span",{role:"button",tabIndex:0,className:tt.metaValueClickable,onClick:()=>k.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),k.startEdit())},title:"Click to edit","aria-label":b,"data-testid":x?`${x}-button`:void 0,children:[w!==void 0?w:s?i.jsx("span",{children:s}):i.jsx("span",{className:tt.metaPlaceholder,children:v||"None"}),i.jsx("span",{className:tt.editButton,"aria-hidden":"true",children:"✏️"})]})}function dd(t){var R;const{value:s,onSave:o,mode:r="edit",options:c,fieldId:d="select",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:b,"data-testid":x}=t,S=y.useRef(null),k=Xm({value:s,onSave:o,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});y.useEffect(()=>{if(k.isEditing){const B=window.setTimeout(()=>{var A;(A=S.current)==null||A.focus()},0);return()=>window.clearTimeout(B)}},[k.isEditing]);const w=y.useCallback(B=>{const A=B.target.value;k.ignoreInitialBlurRef.current=!1,A!==s&&o(A),k.cancelEdit()},[s,o,k]),N=y.useCallback(B=>{if(k.ignoreInitialBlurRef.current){k.ignoreInitialBlurRef.current=!1;return}B.relatedTarget instanceof HTMLElement&&B.relatedTarget.dataset.editAction===d||k.cancelEdit()},[d,k]);if(r==="create")return i.jsx("select",{className:tt.editSelect,value:s,onChange:B=>m==null?void 0:m(B.target.value),"aria-label":b,"data-testid":x?`${x}-select`:void 0,children:c.map(B=>i.jsx("option",{value:B.value,children:B.label},B.value))});if(k.isEditing)return i.jsx("select",{ref:S,className:tt.editSelect,value:k.draft,onChange:w,onBlur:N,title:b,"aria-label":b,"data-testid":x?`${x}-select`:void 0,children:c.map(B=>i.jsx("option",{value:B.value,children:B.label},B.value))});const T=g==null?void 0:g(s),C=(R=c.find(B=>B.value===s))==null?void 0:R.label;return i.jsxs("button",{type:"button",className:tt.metaValueClickable,onClick:()=>k.startEdit(),title:"Click to change","aria-label":b,"data-testid":x?`${x}-button`:void 0,children:[T!==void 0?T:C?i.jsx("span",{children:C}):i.jsx("span",{className:tt.metaPlaceholder,children:v||"None"}),i.jsx("span",{className:tt.editButton,"aria-hidden":"true",children:"✏️"})]})}function S4(t){const{checked:s,onChange:o,label:r,ariaLabel:c,"data-testid":d}=t;return i.jsxs("label",{className:tt.worktreeToggle,"data-testid":d,children:[i.jsx("input",{type:"checkbox",checked:s,onChange:u=>o(u.target.checked),"aria-label":c}),i.jsx("span",{children:r})]})}const T4="_envRow_1e1r5_1",w4="_envDot_1e1r5_7",j4="_envDotGreen_1e1r5_14",N4="_envDotYellow_1e1r5_18",C4="_envDotRed_1e1r5_22",E4="_envDotGray_1e1r5_26",Eo={envRow:T4,envDot:w4,envDotGreen:j4,envDotYellow:N4,envDotRed:C4,envDotGray:E4};function A4(t){const s=t.toLowerCase();return s==="ready"||s==="running"||s==="available"||s==="connected"?Eo.envDotGreen:s==="provisioning"||s==="starting"||s==="pending"||s==="connecting"?Eo.envDotYellow:s==="error"||s==="failed"||s==="disconnected"?Eo.envDotRed:Eo.envDotGray}function D4(t){const{value:s,onSave:o,environments:r,allowNone:c=!1,fieldId:d="environment",activeFieldId:u,onActivate:p,placeholder:m="No environment",ariaLabel:g="Environment","data-testid":v}=t,b=r.find(k=>k.id===s),x=[...c?[{value:"",label:"None"}]:[],...r.map(k=>({value:k.id,label:k.displayName}))],S=()=>{if(b)return i.jsxs("span",{className:Eo.envRow,children:[i.jsx("span",{className:`${Eo.envDot} ${A4(b.status)}`}),b.displayName]})};return i.jsx(dd,{value:s,onSave:o,options:x,fieldId:d,activeFieldId:u,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:g,"data-testid":v})}const R4="_nav_1snmp_1",M4="_searchForm_1snmp_8",I4="_searchInput_1snmp_15",O4="_searchButton_1snmp_33",B4="_clearButton_1snmp_68",L4="_workspaceSelect_1snmp_85",z4="_listHeader_1snmp_99",$4="_nodeList_1snmp_108",U4="_nodeItem_1snmp_116",P4="_indicator_1snmp_129",H4="_label_1snmp_136",V4="_badge_1snmp_145",Yn={nav:R4,searchForm:M4,searchInput:I4,searchButton:O4,clearButton:B4,workspaceSelect:L4,listHeader:z4,nodeList:$4,nodeItem:U4,indicator:P4,label:H4,badge:V4};function q4({nodes:t,workspaces:s,loading:o,searchQuery:r,onSearch:c,onClearSearch:d,onSelectNode:u,onWorkspaceChange:p}){const[m,g]=y.useState(""),v=y.useCallback(k=>{k.preventDefault(),m.trim()&&c(m.trim())},[m,c]),b=y.useCallback(()=>{g(""),d()},[d]),x=y.useCallback(k=>{u(k)},[u]),S=y.useCallback(k=>{g(""),p(k)},[p]);return i.jsxs("div",{className:Yn.nav,"data-testid":"knowledge-nav",children:[i.jsxs("form",{className:Yn.searchForm,onSubmit:v,children:[i.jsx("input",{className:Yn.searchInput,type:"text",placeholder:"Search...",value:m,onChange:k=>{g(k.target.value)},"data-testid":"knowledge-search-input","aria-label":"Search knowledge nodes"}),i.jsx("button",{type:"submit",className:Yn.searchButton,disabled:o,children:"Go"})]}),r&&i.jsx("button",{type:"button",className:Yn.clearButton,onClick:b,children:"Clear search"}),i.jsxs("select",{className:Yn.workspaceSelect,onChange:k=>{S(k.target.value)},"data-testid":"knowledge-workspace-filter","aria-label":"Filter by workspace",children:[i.jsx("option",{value:"",children:"All workspaces"}),s.map(k=>i.jsx("option",{value:k.id,children:k.name},k.id))]}),i.jsxs("div",{className:Yn.listHeader,children:["Nodes (",t.length,")"]}),i.jsx("ul",{className:Yn.nodeList,children:t.map(k=>i.jsxs("li",{className:Yn.nodeItem,onClick:()=>{x(k.id)},onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),x(k.id))},role:"button",tabIndex:0,children:[i.jsx("span",{className:Yn.indicator,style:{backgroundColor:k.kind==="reference"?"#4A9EFF":k.category==="decision"?"#22C55E":k.category==="concept"?"#A855F7":k.category==="snippet"?"#6B7280":"#EAB308"}}),i.jsx("span",{className:Yn.label,children:k.label}),i.jsx("span",{className:Yn.badge,children:k.kind==="reference"?k.sourceType:k.category})]},k.id))})]})}const G4="_container_1mq5u_1",F4="_hamburger_1mq5u_33",Z4="_brand_1mq5u_49",K4="_brandLogo_1mq5u_68",Y4="_info_1mq5u_75",J4="_connectionLabel_1mq5u_90",W4="_connectionDot_1mq5u_103",X4="_connected_1mq5u_106",Q4="_disconnected_1mq5u_110",Ks={container:G4,hamburger:F4,brand:Z4,brandLogo:K4,info:Y4,connectionLabel:J4,connectionDot:W4,connected:X4,disconnected:Q4};function e5({connected:t,environments:s,sessions:o,onToggleSidebar:r,sidebarOpen:c}){const d=_t(),u=s.length,p=s.filter(g=>g.status==="connected").length,m=o.filter(g=>["running","idle"].includes(g.status)).length;return i.jsxs("div",{className:Ks.container,children:[r&&i.jsx("button",{type:"button",className:Ks.hamburger,onClick:r,"aria-label":"Toggle sidebar","aria-expanded":c,children:i.jsx(M2,{size:Lt,"aria-hidden":"true"})}),i.jsx(Lo,{text:"Home",placement:"bottom",children:i.jsxs("button",{type:"button",className:Ks.brand,onClick:()=>d(wi),"data-testid":"statusbar-brand",children:[i.jsx("img",{src:"/icon-192x192.png",alt:"",className:Ks.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]})}),i.jsxs("div",{className:Ks.info,children:[i.jsxs("span",{"aria-label":t?"Connected":"Disconnected",children:[i.jsx("span",{className:`${Ks.connectionDot} ${t?Ks.connected:Ks.disconnected}`,"aria-hidden":"true",children:i.jsx(za,{size:om,fill:"currentColor"})})," ",i.jsx("span",{className:Ks.connectionLabel,"aria-hidden":"true",children:t?"Connected":"Disconnected"})]}),i.jsxs("span",{children:[p,"/",u," env",u!==1?"s":""]}),i.jsxs("span",{children:[m," active"]})]})]})}const t5="_nav_13gkc_1",n5="_tab_13gkc_35",s5="_tabIcon_13gkc_68",a5="_tabLabel_13gkc_79",i5="_tabActive_13gkc_84",zr={nav:t5,tab:n5,tabIcon:s5,tabLabel:a5,tabActive:i5},yi=[{view:"dashboard",label:"Dashboard",icon:i.jsx(x2,{size:Lt}),route:wi,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:i.jsx(O2,{size:Lt}),route:sN,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:i.jsx(r2,{size:Lt}),route:aN,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:i.jsx(L2,{size:Lt}),route:Ro,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:i.jsx(t2,{size:Lt}),route:Bx,testId:"sidebar-tab-knowledge"},{view:"findings",label:"Findings",icon:i.jsx(mx,{size:Lt}),route:xd,testId:"sidebar-tab-findings"},{view:"settings",label:"Settings",icon:i.jsx(F2,{size:Lt}),route:Qj,testId:"sidebar-tab-settings"}];function o5(t){return t===wi||t==="/"?"dashboard":t.startsWith("/chat")||t.startsWith("/sessions")?"chat":t.startsWith("/workspaces")||t.startsWith("/environments")?"environments":t.startsWith(Bx)?"knowledge":t.startsWith(xd)?"findings":t.startsWith(Ao)?"settings":"tasks"}function r5(){const t=Zt(),s=_t(),o=y.useRef(null),r=o5(t.pathname),c=y.useCallback(u=>{s(u.route)},[s]),d=y.useCallback(u=>{var b,x;const p=(b=o.current)==null?void 0:b.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),g=m>=0?m:yi.findIndex(S=>S.view===r);let v=g;if(u.key==="ArrowRight"||u.key==="j"||u.key==="J")u.preventDefault(),v=(g+1)%yi.length;else if(u.key==="ArrowLeft"||u.key==="k"||u.key==="K")u.preventDefault(),v=(g-1+yi.length)%yi.length;else if(u.key==="Home")u.preventDefault(),v=0;else if(u.key==="End")u.preventDefault(),v=yi.length-1;else return;s(yi[v].route),(x=p[v])==null||x.focus()},[r,s]);return i.jsx("nav",{className:zr.nav,ref:o,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:d,"data-testid":"sidebar-nav",children:yi.map(u=>{const p=u.view===r;return i.jsx(Lo,{text:u.label,placement:"bottom",children:i.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${zr.tab} ${p?zr.tabActive:""}`,onClick:()=>c(u),"data-testid":u.testId,"aria-label":u.label,children:[i.jsx("span",{className:zr.tabIcon,"aria-hidden":"true",children:u.icon}),i.jsx("span",{className:zr.tabLabel,children:u.label})]})},u.view)})})}const l5="_container_pi6ii_1",c5="_content_pi6ii_66",$b={container:l5,content:c5},d5=320,v1=220,y1=600,b1="grackle-sidebar-width";function u5(){try{const t=localStorage.getItem(b1);if(t!==null){const s=Number(t);if(Number.isFinite(s)&&s>=v1&&s<=y1)return s}}catch{}return d5}function f5(t){try{localStorage.setItem(b1,String(t))}catch{}}function p5({content:t}){const[s]=y.useState(u5),o=y.useRef(null);if(y.useEffect(()=>{const r=o.current;if(!r)return;const c=new ResizeObserver(d=>{for(const u of d){const p=u.borderBoxSize[0];if(p){const m=Math.round(p.inlineSize);m>=v1&&m<=y1&&f5(m)}}});return c.observe(r),()=>{c.disconnect()}},[]),t!==void 0)return i.jsx("div",{className:$b.container,ref:o,"data-testid":"sidebar",style:{width:s},children:i.jsx("div",{className:$b.content,children:t})})}const m5="_bar_tnfsh_1",h5="_btnPrimary_tnfsh_32",g5="_statusText_tnfsh_85",v5="_statusCompleted_tnfsh_90",y5="_statusFailed_tnfsh_94",b5="_statusBlocked_tnfsh_98",x5="_hintText_tnfsh_103",Tt={bar:m5,btnPrimary:h5,statusText:g5,statusCompleted:v5,statusFailed:y5,statusBlocked:b5,hintText:x5};function _5({sessions:t,tasks:s,environments:o}){const r=_t(),c=Zt(),d=At("/sessions/:sessionId"),u=At("/tasks/:taskId"),p=At("/tasks/:taskId/stream"),m=At("/tasks/:taskId/findings"),g=At("/tasks/:taskId/edit"),v=At("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),b=At("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),x=At("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=At("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),k=At("/sessions/new"),w=At("/environments/:environmentId/workspaces/:workspaceId"),N=At("/tasks/new"),T=At("/chat"),C=At("/"),R=At("/settings/*"),B=d==null?void 0:d.params.sessionId,A=(u==null?void 0:u.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(v==null?void 0:v.params.taskId)??(b==null?void 0:b.params.taskId)??(x==null?void 0:x.params.taskId)??(S==null?void 0:S.params.taskId),M=v??b??x??S,D=(M==null?void 0:M.params.environmentId)??(w==null?void 0:w.params.environmentId),z=c.pathname.startsWith("/environments")&&!w&&!M,U=!!T,X=!!k,Q=!!w&&!v&&!b&&!x&&!S,P=!!N;if(!!C&&!X&&!Q&&!P||!!R||(!!g||!!S)||P||z||X)return i.jsx(i.Fragment,{});if(U)return o.find(F=>F.adapterType==="local"&&F.status==="connected")?i.jsx(i.Fragment,{}):i.jsx("div",{className:Tt.bar,children:i.jsx("span",{className:Tt.hintText,children:"Add a local environment to start chatting"})});if(Q)return i.jsx("div",{className:Tt.bar,children:i.jsx("span",{className:Tt.hintText,children:"Select a task or click + to create one"})});if(A){const E=s.find(me=>me.id===A);if(!E)return i.jsx("div",{className:Tt.bar,children:i.jsx("span",{className:Tt.hintText,children:"Loading..."})});const F=new Map(s.map(me=>[me.id,me])),ae=E.dependsOn.some(me=>{const de=F.get(me);return de!==void 0&&de.status!=="complete"});if(E.status==="not_started"){const me=ae?E.dependsOn.map(de=>F.get(de)).filter(de=>de&&de.status!=="complete").map(de=>de.title):[];return i.jsx("div",{className:Tt.bar,children:ae?i.jsxs("span",{className:Tt.statusBlocked,children:["Blocked by: ",me.join(", ")]}):i.jsx("span",{className:Tt.hintText,children:"Use the buttons above to start or manage this task"})})}if(E.status==="working"||E.status==="paused"){const me=E.latestSessionId||void 0,de=me?t.find(ke=>ke.id===me):void 0;return de&&de.status!=="stopped"?i.jsx(i.Fragment,{}):i.jsx("div",{className:Tt.bar,children:i.jsx("span",{className:Tt.hintText,children:"Waiting for agent..."})})}if(E.status==="complete")return i.jsxs("div",{className:Tt.bar,children:[i.jsx("span",{className:`${Tt.statusText} ${Tt.statusCompleted}`,children:"Task completed"}),i.jsx("button",{onClick:()=>r(Ei(E.workspaceId,void 0,D)),className:Tt.btnPrimary,children:"+ New Task"})]});if(E.status==="failed")return i.jsx("div",{className:Tt.bar,children:i.jsx("span",{className:`${Tt.statusText} ${Tt.statusFailed}`,children:"Task failed"})})}if(B){const E=t.find(me=>me.id===B),F=(E==null?void 0:E.status)==="stopped";if(E!==void 0&&!F)return i.jsx(i.Fragment,{});if(F)return i.jsxs("div",{className:Tt.bar,children:[i.jsxs("span",{className:`${Tt.statusText} ${Tt.hintText}`,children:["Session ",E.endReason||E.status]}),i.jsx("button",{onClick:()=>r(Mx(E.environmentId)),className:Tt.btnPrimary,children:"+ New Chat"})]})}return i.jsx("div",{className:Tt.bar,children:i.jsx("span",{className:Tt.hintText,children:"Loading..."})})}const k5="_nav_14i94_1",S5="_tab_14i94_24",T5="_tabActive_14i94_62",w5="_tabLabel_14i94_75",j5="_statusDot_14i94_81",N5="_pulse_14i94_87",C5="_addButton_14i94_99",E5="_empty_14i94_132",Da={nav:k5,tab:S5,tabActive:T5,tabLabel:w5,statusDot:j5,pulse:N5,addButton:C5,empty:E5},A5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function D5({environments:t}){const s=_t(),o=y.useRef(null),r=At("/environments/:environmentId"),c=At("/environments/:environmentId/edit"),d=At("/environments/:environmentId/workspaces/:workspaceId"),u=At("/environments/:environmentId/workspaces/:workspaceId/*"),p=(r==null?void 0:r.params.environmentId)??(c==null?void 0:c.params.environmentId)??(d==null?void 0:d.params.environmentId)??(u==null?void 0:u.params.environmentId),m=p==="new"?void 0:p,g=y.useCallback(x=>{s(Ti(x))},[s]),v=y.useCallback(x=>{var T;const S=(T=o.current)==null?void 0:T.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const k=Array.from(S).findIndex(C=>C===document.activeElement),w=k>=0?k:t.findIndex(C=>C.id===m);let N=w;if(x.key==="ArrowDown"||x.key==="j"||x.key==="J")x.preventDefault(),N=(w+1)%S.length;else if(x.key==="ArrowUp"||x.key==="k"||x.key==="K")x.preventDefault(),N=(w-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&&s(Ti(t[N].id)),S[N].focus()},[m,t,s]),b=m??(t.length>0?t[0].id:void 0);return i.jsxs("div",{className:Da.nav,"data-testid":"environment-nav",children:[i.jsx("nav",{ref:o,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:v,children:t.map(x=>{const S=x.id===m,k=x.id===b,w=A5[x.status]||"var(--text-tertiary)",N=x.status==="connected";return i.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:k?0:-1,className:`${Da.tab} ${S?Da.tabActive:""}`,onClick:()=>g(x.id),"data-testid":"env-nav-item",children:[i.jsx("span",{className:`${Da.statusDot} ${N?Da.pulse:""}`,style:{color:w},"aria-hidden":"true",children:i.jsx(za,{size:om,fill:"currentColor"})}),i.jsx("span",{className:Da.tabLabel,title:x.displayName||x.id,children:x.displayName||x.id})]},x.id)})}),i.jsx("button",{type:"button",className:Da.addButton,onClick:()=>s(Wj),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),t.length===0&&i.jsx("div",{className:Da.empty,children:"No environments yet."})]})}function Qm(t){const s=new Date(t),o=new Date,r=o.getTime()-s.getTime(),c=Math.floor(r/1e3),d=Math.floor(c/60),u=Math.floor(d/60),p=Math.floor(u/24);if(c<60)return"just now";if(d<60)return`${d}m ago`;if(u<24)return`${u}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const m=s.getFullYear()===o.getFullYear(),g=s.toLocaleString("en-US",{month:"short"}),v=s.getDate();return m?`${g} ${v}`:`${g} ${v} ${s.getFullYear()}`}const Ub={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 ud(t){return Ub[t]||Ub.general}const R5="_nav_dlm8m_1",M5="_categoryPills_dlm8m_24",I5="_categoryPill_dlm8m_24",O5="_tab_dlm8m_42",B5="_tabActive_dlm8m_80",L5="_tabContent_dlm8m_93",z5="_tabLabel_dlm8m_100",$5="_tabMeta_dlm8m_106",U5="_categoryDot_dlm8m_111",P5="_empty_dlm8m_118",xs={nav:R5,categoryPills:M5,categoryPill:I5,tab:O5,tabActive:B5,tabContent:L5,tabLabel:z5,tabMeta:$5,categoryDot:U5,empty:P5};function H5({findings:t,workspaceId:s,environmentId:o}){const r=_t(),c=y.useRef(null),d=At("/findings/:findingId"),u=At("/environments/:environmentId/workspaces/:workspaceId/findings/:findingId"),p=(d==null?void 0:d.params.findingId)??(u==null?void 0:u.params.findingId),m=y.useMemo(()=>{const x=new Set(t.map(S=>S.category).filter(Boolean));return Array.from(x).sort()},[t]),g=y.useCallback(x=>{r(Mp(x,s,o))},[r,s,o]),v=y.useCallback(x=>{var T;const S=(T=c.current)==null?void 0:T.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const k=Array.from(S).findIndex(C=>C===document.activeElement),w=k>=0?k:t.findIndex(C=>C.id===p);let N=w;if(x.key==="ArrowDown"||x.key==="j"||x.key==="J")x.preventDefault(),N=(w+1)%S.length;else if(x.key==="ArrowUp"||x.key==="k"||x.key==="K")x.preventDefault(),N=(w-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&&r(Mp(t[N].id,s,o)),S[N].focus()},[p,t,r,s,o]),b=p??(t.length>0?t[0].id:void 0);return i.jsxs("div",{className:xs.nav,"data-testid":"findings-nav",children:[m.length>1&&i.jsx("div",{className:xs.categoryPills,"data-testid":"findings-nav-categories",children:m.map(x=>i.jsx("span",{className:xs.categoryPill,style:{color:ud(x).text},children:x},x))}),i.jsx("nav",{ref:c,role:"tablist","aria-orientation":"vertical","aria-label":"Findings",onKeyDown:v,children:t.map(x=>{const S=x.id===p,k=x.id===b;return i.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:k?0:-1,className:`${xs.tab} ${S?xs.tabActive:""}`,onClick:()=>g(x.id),"data-testid":"finding-nav-item",children:[i.jsx("span",{className:xs.categoryDot,style:{color:ud(x.category).text},"aria-hidden":"true",children:i.jsx(za,{size:om,fill:"currentColor"})}),i.jsxs("span",{className:xs.tabContent,children:[i.jsx("span",{className:xs.tabLabel,title:x.title,children:x.title}),i.jsx("span",{className:xs.tabMeta,title:x.createdAt,children:Qm(x.createdAt)})]})]},x.id)})}),t.length===0&&i.jsx("div",{className:xs.empty,children:"No findings yet. Agents will post discoveries here."})]})}function V5(t){if(t.length===0)return[];const s=[...t].sort((r,c)=>r[0]-c[0]),o=[[s[0][0],s[0][1]]];for(let r=1;r<s.length;r++){const c=o[o.length-1],[d,u]=s[r];d<=c[1]+1?c[1]=Math.max(c[1],u):o.push([d,u])}return o}function x1({text:t,indices:s,highlightClass:o}){if(!s||s.length===0)return i.jsx(i.Fragment,{children:t});const r=V5(s),c=[];let d=0;for(const[u,p]of r)u>d&&c.push(i.jsx("span",{children:t.slice(d,u)},`p${d}`)),c.push(i.jsx("mark",{className:o,children:t.slice(u,p+1)},`m${u}`)),d=p+1;return d<t.length&&c.push(i.jsx("span",{children:t.slice(d)},`p${d}`)),i.jsx(i.Fragment,{children:c})}function q5(t){const s=new Map(t.map(r=>[r.id,{...r,children:[]}])),o=[];for(const r of s.values())r.parentTaskId&&s.has(r.parentTaskId)?s.get(r.parentTaskId).children.push(r):o.push(r);for(const r of s.values())r.children.sort((c,d)=>c.sortOrder-d.sortOrder);return o.sort((r,c)=>r.sortOrder-c.sortOrder)}function G5(t,s){const o=new Map;for(const d of t){const p=d.dependsOn.length>0&&d.dependsOn.some(g=>s.get(g)!=="complete")?"blocked":d.status,m=o.get(p);m?m.push(d):o.set(p,[d])}const r=[],c=new Set;for(const d of tw){c.add(d);const u=o.get(d);if(u&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=$a(d);r.push({status:d,label:p.label,style:p,tasks:u})}}for(const[d,u]of o)if(!c.has(d)&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=$a(d);r.push({status:d,label:p.label,style:p,tasks:u})}return r}const F5="_container_z4i38_1",Z5="_header_z4i38_5",K5="_headerActions_z4i38_17",Y5="_searchInput_z4i38_23",J5="_searchHighlight_z4i38_56",W5="_groupToggle_z4i38_62",X5="_groupToggleActive_z4i38_89",Q5="_addButton_z4i38_93",eI="_taskRow_z4i38_120",tI="_selected_z4i38_140",nI="_expandArrow_z4i38_150",sI="_expanded_z4i38_157",aI="_leafSpacer_z4i38_161",iI="_taskStatusIcon_z4i38_166",oI="_taskTitle_z4i38_170",rI="_workspaceBadge_z4i38_177",lI="_childCountBadge_z4i38_195",cI="_dependencyBadge_z4i38_208",dI="_blockedBadge_z4i38_220",uI="_addChildButton_z4i38_225",fI="_emptyState_z4i38_268",pI="_statusGroupHeader_z4i38_275",mI="_statusGroupIcon_z4i38_294",hI="_statusGroupLabel_z4i38_298",gI="_statusGroupCount_z4i38_303",Fe={container:F5,header:Z5,headerActions:K5,searchInput:Y5,searchHighlight:J5,groupToggle:W5,groupToggleActive:X5,addButton:Q5,taskRow:eI,selected:tI,expandArrow:nI,expanded:sI,leafSpacer:aI,taskStatusIcon:iI,taskTitle:oI,workspaceBadge:rI,childCountBadge:lI,dependencyBadge:cI,blockedBadge:dI,addChildButton:uI,emptyState:fI,statusGroupHeader:pI,statusGroupIcon:mI,statusGroupLabel:hI,statusGroupCount:gI},vI=[{name:"title",weight:2},{name:"description",weight:1}],_1=16,yI=16,k1="grackle-task-group-by-status";function Pb(){try{return localStorage.getItem(k1)==="true"}catch{return!1}}function bI(t){try{localStorage.setItem(k1,String(t))}catch{}}function xI({group:t,isExpanded:s,onToggle:o,selectedTaskId:r,navigate:c,titleHighlights:d,workspaceNames:u}){return i.jsxs("div",{"data-testid":`status-group-${t.status}`,children:[i.jsxs("div",{className:Fe.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":s,onClick:o,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o())},children:[i.jsx("span",{className:`${Fe.expandArrow} ${s?Fe.expanded:""}`,"aria-hidden":"true",children:i.jsx(aa,{size:ot})}),i.jsx("span",{className:Fe.statusGroupIcon,style:{color:t.style.color},"aria-hidden":"true",children:t.style.icon}),i.jsx("span",{className:Fe.statusGroupLabel,children:t.label}),i.jsx("span",{className:Fe.statusGroupCount,children:t.tasks.length})]}),i.jsx(ps,{children:s&&i.jsx(Rt.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=$a(p.status),g=r===p.id,v=p.parentTaskId||!p.workspaceId?void 0:u.get(p.workspaceId);return i.jsxs("div",{onClick:()=>c(In(p.id)),role:"button",tabIndex:0,"aria-label":p.title,onKeyDown:b=>{b.currentTarget===b.target&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),c(In(p.id)))},className:`${Fe.taskRow} ${g?Fe.selected:""}`,style:{"--task-indent":`${_1}px`},"data-task-id":p.id,children:[i.jsx("span",{className:Fe.leafSpacer}),i.jsx("span",{className:Fe.taskStatusIcon,style:{color:m.color},"aria-hidden":"true","data-testid":`task-status-${ll(p.status)}`,children:m.icon}),i.jsx("span",{className:Fe.taskTitle,title:p.title,children:i.jsx(x1,{text:p.title,indices:d.get(p.id),highlightClass:Fe.searchHighlight})}),v&&i.jsx("span",{className:Fe.workspaceBadge,title:v,children:v})]},p.id)})})})]})}function S1({node:t,depth:s,expandedTasks:o,toggleTask:r,selectedTaskId:c,navigate:d,taskStatusById:u,titleHighlights:p,workspaceNames:m}){const g=$a(t.status),v=t.dependsOn.length>0&&t.dependsOn.some(T=>u.get(T)!=="complete"),b=o.has(t.id),x=t.children.length>0,S=c===t.id,k=_1+s*yI,N=s===0&&!t.parentTaskId&&t.workspaceId?m.get(t.workspaceId):void 0;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{onClick:()=>d(In(t.id)),role:"button",tabIndex:0,"aria-label":t.title,onKeyDown:T=>{T.currentTarget===T.target&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),d(In(t.id)))},className:`${Fe.taskRow} ${S?Fe.selected:""}`,style:{"--task-indent":`${k}px`},"data-task-id":t.id,children:[x&&i.jsx("span",{className:`${Fe.expandArrow} ${b?Fe.expanded:""}`,role:"button",tabIndex:0,"aria-label":b?"Collapse task":"Expand task",onClick:T=>{T.stopPropagation(),r(t.id)},onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),T.stopPropagation(),r(t.id))},children:i.jsx(aa,{size:ot,"aria-hidden":"true"})}),!x&&i.jsx("span",{className:Fe.leafSpacer}),i.jsx("span",{className:Fe.taskStatusIcon,style:{color:g.color},"aria-hidden":"true","data-testid":`task-status-${ll(t.status)}`,children:g.icon}),i.jsx("span",{className:Fe.taskTitle,title:t.title,children:i.jsx(x1,{text:t.title,indices:p.get(t.id),highlightClass:Fe.searchHighlight})}),N&&i.jsx("span",{className:Fe.workspaceBadge,title:N,children:N}),x&&i.jsxs("span",{className:Fe.childCountBadge,children:[t.children.filter(T=>T.status==="complete").length,"/",t.children.length]}),t.dependsOn.length>0&&i.jsx("span",{className:`${Fe.dependencyBadge} ${v?Fe.blockedBadge:""}`,title:`Depends on: ${t.dependsOn.join(", ")}`,children:v?"blocked":"dep"}),s<fT&&i.jsx(Lo,{text:"Add child task",children:i.jsx("button",{onClick:T=>{T.stopPropagation(),d(Ei(t.workspaceId,t.id))},"aria-label":"Add child task",className:Fe.addChildButton,children:"+"})})]}),i.jsx(ps,{children:x&&b&&i.jsx(Rt.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(T=>i.jsx(S1,{node:T,depth:s+1,expandedTasks:o,toggleTask:r,selectedTaskId:c,navigate:d,taskStatusById:u,titleHighlights:p,workspaceNames:m},T.id))})})]})}function _I({workspaces:t,tasks:s}){const o=_t(),[r,c]=y.useState(new Set),[d,u]=y.useState(new Set),[p,m]=y.useState(Pb),[g,v]=y.useState(Pb),[b,x]=y.useState(new Map),S=At("/tasks/:taskId/*"),k=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,w=y.useMemo(()=>new Map(s.map(H=>[H.id,H.status])),[s]),N=y.useMemo(()=>new Map(t.map(H=>[H.id,H.name])),[t]),T=()=>{const H=!p;bI(H),m(H),H&&(v(!0),x(new Map))},C=H=>{x(oe=>{const E=new Map(oe),F=E.has(H)?E.get(H):g;return E.set(H,!F),E})},R=H=>b.has(H)?b.get(H):g,B=H=>{c(oe=>{const E=new Set(oe);return E.has(H)?(E.delete(H),u(F=>new Set(F).add(H))):(E.add(H),u(F=>{const ae=new Set(F);return ae.delete(H),ae})),E})};y.useEffect(()=>{const H=new Set(s.filter(oe=>oe.parentTaskId).map(oe=>oe.parentTaskId));H.size>0&&c(oe=>{const E=new Set(oe);for(const F of H)d.has(F)||E.add(F);return E})},[s,d]);const[A,M]=y.useState(""),{directMatchTaskIds:D,treeMatchTaskIds:z,titleHighlights:U}=y.useMemo(()=>{if(!A.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const H=uT(s,A,vI),oe=new Set(H.map(me=>me.item.id)),E=new Map;for(const me of H){const de=me.matches.find(Oe=>Oe.key==="title");de&&E.set(me.item.id,de.indices)}const F=new Set(oe),ae=new Map(s.map(me=>[me.id,me]));for(const me of[...oe]){let de=ae.get(me);for(;de!=null&&de.parentTaskId;)F.add(de.parentTaskId),de=ae.get(de.parentTaskId)}return{directMatchTaskIds:oe,treeMatchTaskIds:F,titleHighlights:E}},[A,s]),X=D!==null,Q=X?p?D:z:null,P=Q?s.filter(H=>Q.has(H.id)):s,re=p?[]:q5(P);return i.jsxs("div",{className:Fe.container,children:[i.jsxs("div",{className:Fe.header,children:[i.jsx("span",{children:"Tasks"}),i.jsxs("div",{className:Fe.headerActions,children:[i.jsx(Lo,{text:p?"Switch to tree view":"Group tasks by status",children:i.jsx("button",{className:`${Fe.groupToggle} ${p?Fe.groupToggleActive:""}`,onClick:T,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,"data-testid":"task-group-by-status-toggle",children:i.jsx(E2,{size:en})})}),i.jsx(Lo,{text:"New task",children:i.jsx("button",{className:Fe.addButton,onClick:()=>o(Ei()),"aria-label":"New task","data-testid":"new-task-button",children:"+"})})]})]}),s.length>0&&i.jsx("input",{type:"text",value:A,onChange:H=>M(H.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Fe.searchInput,"data-testid":"sidebar-search"}),p?G5(P,w).map(H=>i.jsx(xI,{group:H,isExpanded:R(H.status),onToggle:()=>C(H.status),selectedTaskId:k,navigate:o,titleHighlights:U,workspaceNames:N},H.status)):re.map(H=>i.jsx(S1,{node:H,depth:0,expandedTasks:r,toggleTask:B,selectedTaskId:k,navigate:o,taskStatusById:w,titleHighlights:U,workspaceNames:N},H.id)),P.length===0&&!X&&i.jsx("div",{className:Fe.emptyState,children:"No tasks yet. Click + to create one."}),P.length===0&&X&&i.jsx("div",{className:Fe.emptyState,children:"No matching tasks"})]})}const kI="_toast_ed2dk_1",SI="_success_ed2dk_18",TI="_icon_ed2dk_22",wI="_error_ed2dk_25",jI="_warning_ed2dk_32",NI="_info_ed2dk_38",CI="_message_ed2dk_53",EI="_close_ed2dk_60",$r={toast:kI,success:SI,icon:TI,error:wI,warning:jI,info:NI,message:CI,close:EI},AI={success:i.jsx(Ni,{size:Lt}),error:i.jsx(Va,{size:Lt}),warning:i.jsx(im,{size:Lt}),info:i.jsx(am,{size:Lt})};function DI({toast:t,onDismiss:s}){return y.useEffect(()=>{const o=setTimeout(()=>s(t.id),t.duration);return()=>clearTimeout(o)},[t.id,t.duration,s]),i.jsxs(Rt.div,{className:`${$r.toast} ${$r[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:[i.jsx("span",{className:$r.icon,"aria-hidden":"true",children:AI[t.variant]}),i.jsx("span",{className:$r.message,children:t.message}),i.jsx("button",{type:"button",className:$r.close,onClick:()=>s(t.id),"aria-label":"Dismiss notification",children:i.jsx(Va,{size:en,"aria-hidden":"true"})})]})}const RI="_container_qqse2_1",MI={container:RI};function II({toasts:t,onDismiss:s}){return i.jsx("div",{className:MI.container,"data-testid":"toast-container",children:i.jsx(ps,{children:t.map(o=>i.jsx(DI,{toast:o,onDismiss:s},o.id))})})}const OI="_callout_e5awm_1",BI="_success_e5awm_11",LI="_icon_e5awm_15",zI="_error_e5awm_18",$I="_warning_e5awm_25",UI="_info_e5awm_32",PI="_content_e5awm_48",HI="_close_e5awm_53",Ur={callout:OI,success:BI,icon:LI,error:zI,warning:$I,info:UI,content:PI,close:HI},VI={success:i.jsx(Ni,{size:Lt}),error:i.jsx(Va,{size:Lt}),warning:i.jsx(im,{size:Lt}),info:i.jsx(am,{size:Lt})};function qI({variant:t="info",children:s,dismissible:o=!1,className:r}){const[c,d]=y.useState(!1);return i.jsx(i.Fragment,{children:!c&&i.jsxs("div",{className:[Ur.callout,Ur[t],r].filter(Boolean).join(" "),role:t==="error"||t==="warning"?"alert":"status",children:[i.jsx("span",{className:Ur.icon,"aria-hidden":"true",children:VI[t]}),i.jsx("span",{className:Ur.content,children:s}),o&&i.jsx("button",{type:"button",className:Ur.close,onClick:()=>d(!0),"aria-label":"Dismiss",children:i.jsx(Va,{size:en,"aria-hidden":"true"})})]})})}function GI({currentVersion:t,latestVersion:s,updateAvailable:o,isDocker:r}){if(!o)return i.jsx(i.Fragment,{});const c=r?"docker pull ghcr.io/nick-pape/grackle:latest && docker restart grackle":`npm install -g @grackle-ai/cli@${s}`;return i.jsx("div",{"data-testid":"update-banner",children:i.jsxs(qI,{variant:"info",dismissible:!0,children:[i.jsxs("strong",{children:["Grackle v",s]})," is available (you have v",t,")."," ","Run: ",i.jsx("code",{children:c})]})})}const FI="_container_de44x_1",ZI="_emptyState_de44x_8",KI="_card_de44x_14",YI="_cardClickable_de44x_34",JI="_cardHeader_de44x_42",WI="_categoryBadge_de44x_54",XI="_findingTitle_de44x_62",QI="_findingDate_de44x_68",eO="_findingContent_de44x_80",tO="_tags_de44x_86",nO="_tag_de44x_86",cs={container:FI,emptyState:ZI,card:KI,cardClickable:YI,cardHeader:JI,categoryBadge:WI,findingTitle:XI,findingDate:QI,findingContent:eO,tags:tO,tag:nO};function T1({findings:t,onFindingClick:s}){return t.length===0?i.jsx("div",{className:cs.emptyState,children:"No findings yet. Agents will post discoveries here."}):i.jsx("div",{className:cs.container,children:t.map((o,r)=>{const c=ud(o.category),d=s?Rt.button:Rt.div;return i.jsxs(d,{type:s?"button":void 0,className:`${cs.card} ${s?cs.cardClickable:""}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},onClick:s?()=>{s(o.id)}:void 0,children:[i.jsxs("div",{className:cs.cardHeader,children:[i.jsx("span",{className:cs.categoryBadge,style:{background:c.bg,color:c.text},children:o.category}),i.jsx("span",{className:cs.findingTitle,children:o.title}),i.jsx("span",{className:cs.findingDate,title:o.createdAt,children:Qm(o.createdAt)})]}),i.jsx("div",{className:cs.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&i.jsx("div",{className:cs.tags,children:o.tags.map(u=>i.jsx("span",{className:cs.tag,style:{color:c.text,textShadow:`0 0 8px ${c.text}`},children:u},u))})]},o.id)})})}const sO="_section_1ingb_14",aO="_sectionTitle_1ingb_26",iO="_sectionDescription_1ingb_35",oO="_tokenList_1ingb_48",rO="_tokenRow_1ingb_55",lO="_tokenBadge_1ingb_68",cO="_tokenName_1ingb_83",dO="_tokenTarget_1ingb_90",uO="_deleteButton_1ingb_99",fO="_addForm_1ingb_113",pO="_formRow_1ingb_119",mO="_input_1ingb_125",hO="_select_1ingb_155",gO="_addButton_1ingb_187",vO="_emptyStateInfo_1ingb_221",yO="_themeOptions_1ingb_229",bO="_themeOption_1ingb_229",xO="_themeOptionSelected_1ingb_254",_O="_themeOptionHeader_1ingb_259",kO="_themeOptionLabel_1ingb_266",SO="_themeOptionDesc_1ingb_273",TO="_variantToggle_1ingb_279",wO="_variantButton_1ingb_286",jO="_variantActive_1ingb_305",NO="_themeSwatches_1ingb_311",CO="_themeSwatch_1ingb_311",EO="_systemToggle_1ingb_325",AO="_systemToggleHint_1ingb_341",DO="_themeActive_1ingb_348",RO="_aboutGrid_1ingb_354",MO="_aboutItem_1ingb_360",IO="_aboutLabel_1ingb_373",OO="_aboutValue_1ingb_379",BO="_aboutDot_1ingb_387",LO="_aboutDotConnected_1ingb_394",zO="_aboutDotDisconnected_1ingb_398",ve={section:sO,sectionTitle:aO,sectionDescription:iO,tokenList:oO,tokenRow:rO,tokenBadge:lO,tokenName:cO,tokenTarget:dO,deleteButton:uO,addForm:fO,formRow:pO,input:mO,select:hO,addButton:gO,emptyStateInfo:vO,themeOptions:yO,themeOption:bO,themeOptionSelected:xO,themeOptionHeader:_O,themeOptionLabel:kO,themeOptionDesc:SO,variantToggle:TO,variantButton:wO,variantActive:jO,themeSwatches:NO,themeSwatch:CO,systemToggle:EO,systemToggleHint:AO,themeActive:DO,aboutGrid:RO,aboutItem:MO,aboutLabel:IO,aboutValue:OO,aboutDot:BO,aboutDotConnected:LO,aboutDotDisconnected:zO},$O=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function UO({tokens:t,onSetToken:s,onDeleteToken:o,onShowToast:r}){const[c,d]=y.useState(""),[u,p]=y.useState(""),[m,g]=y.useState("env_var"),[v,b]=y.useState(""),[x,S]=y.useState(null),k=T=>{if(T.preventDefault(),!c||!u)return;const C=m==="env_var"?v||c.toUpperCase()+"_TOKEN":"";s(c,u,m,C,m==="file"?v:""),r==null||r("Token saved successfully","success"),d(""),p(""),b("")},w=T=>{S(T)},N=()=>{x&&(o(x),r==null||r("Token deleted","info")),S(null)};return i.jsxs(i.Fragment,{children:[i.jsx(ji,{isOpen:x!==null,title:"Delete Token?",description:x?`"${x}" will be permanently removed.`:void 0,onConfirm:N,onCancel:()=>S(null)}),i.jsxs("section",{className:ve.section,children:[i.jsx("h3",{className:ve.sectionTitle,children:"Tokens"}),i.jsx("p",{className:ve.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),t.length===0?i.jsx("div",{className:ve.emptyStateInfo,children:"Add your first API token to enable service integrations."}):i.jsx("div",{className:ve.tokenList,children:t.map(T=>i.jsxs("div",{className:ve.tokenRow,children:[i.jsx("span",{className:ve.tokenBadge,children:T.tokenType}),i.jsx("span",{className:ve.tokenName,children:T.name}),i.jsx("span",{className:ve.tokenTarget,children:T.tokenType==="env_var"?T.envVar:T.filePath}),i.jsx("button",{className:ve.deleteButton,onClick:()=>w(T.name),title:`Delete ${T.name}`,"aria-label":`Delete ${T.name}`,children:i.jsx(Va,{size:en,"aria-hidden":"true"})})]},T.name))}),i.jsxs("form",{className:ve.addForm,onSubmit:k,children:[i.jsxs("div",{className:ve.formRow,children:[i.jsx("input",{className:ve.input,type:"text",placeholder:"Token name",value:c,onChange:T=>d(T.target.value)}),i.jsx("input",{className:ve.input,type:"password",placeholder:"Value",value:u,onChange:T=>p(T.target.value)})]}),i.jsxs("div",{className:ve.formRow,children:[i.jsx("select",{className:ve.select,value:m,onChange:T=>g(T.target.value),children:$O.map(T=>i.jsx("option",{value:T.value,children:T.label},T.value))}),i.jsx("input",{className:ve.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:v,onChange:T=>b(T.target.value)}),i.jsx("button",{className:ve.addButton,type:"submit",children:"Add Token"})]})]})]})]})}const Nd=[{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"]}],w1=new Set(Nd.map(t=>t.id)),Hb="grackle";function Qp(t){return Nd.find(s=>s.id===t)}function PO({themeId:t,resolvedThemeId:s,onSetTheme:o,preferSystem:r,onSetPreferSystem:c}){return i.jsxs("section",{className:ve.section,children:[i.jsx("h3",{className:ve.sectionTitle,children:"Appearance"}),i.jsx("p",{className:ve.sectionDescription,children:"Choose how Grackle looks across the app."}),i.jsx("div",{className:ve.themeOptions,children:Nd.filter(d=>!d.hidden).map(d=>{const u=!!(d.variantLightId&&d.variantDarkId),p=u?t===d.id||t===d.variantLightId||t===d.variantDarkId:t===d.id,m=u&&s===d.variantLightId;return i.jsxs("button",{type:"button",className:`${ve.themeOption} ${p?ve.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>o(d.id),children:[i.jsxs("span",{className:ve.themeOptionHeader,children:[i.jsxs("span",{children:[i.jsx("span",{className:ve.themeOptionLabel,children:d.label}),i.jsx("span",{className:ve.themeOptionDesc,children:d.description})]}),u&&i.jsxs("span",{className:ve.variantToggle,children:[i.jsx("span",{role:"button",tabIndex:0,className:`${ve.variantButton} ${p&&m?ve.variantActive:""}`,onClick:g=>{g.stopPropagation(),c(!1),o(d.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),c(!1),o(d.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),i.jsx("span",{role:"button",tabIndex:0,className:`${ve.variantButton} ${p&&!m?ve.variantActive:""}`,onClick:g=>{g.stopPropagation(),c(!1),o(d.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),c(!1),o(d.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),d.swatches&&i.jsx("span",{className:ve.themeSwatches,children:d.swatches.map((g,v)=>i.jsx("span",{className:ve.themeSwatch,style:{background:g}},v))})]},d.id)})}),i.jsxs("label",{className:ve.systemToggle,children:[i.jsx("input",{type:"checkbox",checked:r,onChange:d=>c(d.target.checked)}),i.jsx("span",{children:"Match system light/dark preference"})]}),i.jsx("p",{className:ve.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),i.jsxs("p",{className:ve.themeActive,children:["Active theme: ",i.jsx("strong",{children:s})]})]})}function HO({connected:t,environments:s,sessions:o}){const r=s.filter(u=>u.status==="connected").length,c=s.length,d=o.filter(u=>["running","idle"].includes(u.status)).length;return i.jsxs("section",{className:ve.section,"data-testid":"about-panel",children:[i.jsx("h3",{className:ve.sectionTitle,children:"About"}),i.jsx("p",{className:ve.sectionDescription,children:"Connection status and application information."}),i.jsxs("div",{className:ve.aboutGrid,children:[i.jsxs("div",{className:ve.aboutItem,children:[i.jsx("span",{className:ve.aboutLabel,children:"Connection"}),i.jsxs("span",{className:ve.aboutValue,children:[i.jsx("span",{className:`${ve.aboutDot} ${t?ve.aboutDotConnected:ve.aboutDotDisconnected}`}),t?"Connected":"Disconnected"]})]}),i.jsxs("div",{className:ve.aboutItem,children:[i.jsx("span",{className:ve.aboutLabel,children:"Environments"}),i.jsxs("span",{className:ve.aboutValue,children:[r,"/",c," connected"]})]}),i.jsxs("div",{className:ve.aboutItem,children:[i.jsx("span",{className:ve.aboutLabel,children:"Active Sessions"}),i.jsx("span",{className:ve.aboutValue,children:d})]}),i.jsxs("div",{className:ve.aboutItem,children:[i.jsx("span",{className:ve.aboutLabel,children:"Version"}),i.jsx("span",{className:ve.aboutValue,children:"0.95.2"})]})]})]})}const VO="_container_cddyd_1",qO="_header_cddyd_8",GO="_headerTitle_cddyd_35",FO="_badge_cddyd_44",ZO="_headerActions_cddyd_54",KO="_body_cddyd_61",YO="_formContent_cddyd_73",JO="_section_cddyd_85",WO="_label_cddyd_91",XO="_titleInput_cddyd_98",QO="_descriptionTextarea_cddyd_131",eB="_parentContext_cddyd_167",tB="_parentLabel_cddyd_175",nB="_parentName_cddyd_182",sB="_personaSelect_cddyd_186",aB="_depList_cddyd_220",iB="_depItem_cddyd_226",oB="_depItemSelected_cddyd_248",rB="_noDeps_cddyd_252",lB="_btnPrimary_cddyd_258",cB="_btnGhost_cddyd_289",et={container:VO,header:qO,headerTitle:GO,badge:FO,headerActions:ZO,body:KO,formContent:YO,section:JO,label:WO,titleInput:XO,descriptionTextarea:QO,parentContext:eB,parentLabel:tB,parentName:nB,personaSelect:sB,depList:aB,depItem:iB,depItemSelected:oB,noDeps:rB,btnPrimary:lB,btnGhost:cB};function j1({mode:t,taskId:s,workspaceId:o,parentTaskId:r,environmentId:c,tasks:d,workspaces:u,personas:p,onCreateTask:m,onUpdateTask:g,onEditDone:v,onShowToast:b}){const x=_t(),S=t==="edit",k=S&&s?d.find(he=>he.id===s):void 0,w=S?(k==null?void 0:k.workspaceId)??"":o??"",[N,T]=y.useState(w),C=w||N,R=u.find(he=>he.id===C),B=c??(R==null?void 0:R.environmentId),A=!S&&!o,M=S?(k==null?void 0:k.parentTaskId)??"":r??"",D=M?d.find(he=>he.id===M):void 0,[z,U]=y.useState((k==null?void 0:k.title)??""),[X,Q]=y.useState((k==null?void 0:k.description)??""),[P,re]=y.useState((k==null?void 0:k.dependsOn)??[]),[H,oe]=y.useState((k==null?void 0:k.defaultPersonaId)??""),[E,F]=y.useState((k==null?void 0:k.canDecompose)??!1),[ae,me]=y.useState(!1),de=y.useRef(!1);y.useEffect(()=>{S&&k&&!de.current&&(de.current=!0,U(k.title),Q(k.description),re(k.dependsOn),oe(k.defaultPersonaId),F(k.canDecompose))},[S,k]);const Oe=d.filter(he=>he.workspaceId===C&&(!S||he.id!==s)&&he.id!==M),ke=z.trim().length>0&&(!S||k!==void 0)&&C.length>0,Ee=he=>{re(Le=>Le.includes(he)?Le.filter(mt=>mt!==he):[...Le,he])},ze=()=>{!ke||ae||S&&k===void 0||(S&&s?(g(s,z.trim(),X,P,H),b==null||b("Task updated","success"),v?v():x(In(s,void 0,C,B),{replace:!0})):(me(!0),m(C,z.trim(),X,P.length>0?P:void 0,M||void 0,H,E,()=>{b==null||b("Task created","success"),x(o?Ua(o,B):"/tasks",{replace:!0})},he=>{b==null||b(he,"error"),me(!1)})))},ue=()=>{if(v){v();return}x(S&&s?In(s,void 0,C,B):o?Ua(o,B):"/tasks")},xe=S?"edit task":M?"child task":"new task";return i.jsxs("div",{className:et.container,children:[i.jsxs("div",{className:et.header,children:[i.jsxs("div",{className:et.headerTitle,children:[i.jsx("span",{className:et.badge,children:xe}),D&&i.jsxs("span",{className:et.parentContext,children:[i.jsx("span",{className:et.parentLabel,children:"Child of"}),i.jsx("span",{className:et.parentName,children:D.title})]})]}),i.jsxs("div",{className:et.headerActions,children:[i.jsx("button",{onClick:ze,disabled:!ke||ae,className:et.btnPrimary,"data-testid":"task-edit-save",children:ae?"Creating…":S?"Save Changes":"Create"}),i.jsx("button",{onClick:ue,className:et.btnGhost,children:"Cancel"})]})]}),i.jsx("div",{className:et.body,children:i.jsxs("div",{className:et.formContent,children:[A&&i.jsxs("div",{className:et.section,children:[i.jsx("label",{className:et.label,htmlFor:"task-edit-workspace",children:"Workspace"}),i.jsxs("select",{id:"task-edit-workspace",value:N,onChange:he=>T(he.target.value),className:et.personaSelect,"data-testid":"task-edit-workspace",children:[i.jsx("option",{value:"",children:"Select a workspace..."}),u.map(he=>i.jsx("option",{value:he.id,children:he.name},he.id))]})]}),i.jsxs("div",{className:et.section,children:[i.jsx("label",{className:et.label,htmlFor:"task-edit-title",children:"Title"}),i.jsx("input",{id:"task-edit-title",type:"text",value:z,onChange:he=>U(he.target.value),placeholder:"Task title...",autoFocus:!0,className:et.titleInput,"data-testid":"task-edit-title",onKeyDown:he=>{he.key==="Enter"&&ke&&ze()}})]}),i.jsxs("div",{className:et.section,children:[i.jsx("label",{className:et.label,htmlFor:"task-edit-description",children:"Description"}),i.jsx("textarea",{id:"task-edit-description",value:X,onChange:he=>Q(he.target.value),placeholder:"Describe the task... (markdown supported)",className:et.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),i.jsxs("div",{className:et.section,children:[i.jsx("label",{className:et.label,htmlFor:"task-edit-persona",children:"Default Persona"}),i.jsxs("select",{id:"task-edit-persona",value:H,onChange:he=>oe(he.target.value),className:et.personaSelect,"data-testid":"task-edit-persona",children:[i.jsx("option",{value:"",children:"(Inherit)"}),p.map(he=>i.jsx("option",{value:he.id,children:he.name},he.id))]})]}),!S&&i.jsx("div",{className:et.section,children:i.jsxs("label",{className:et.depItem,"data-testid":"task-edit-can-decompose",children:[i.jsx("input",{type:"checkbox",checked:E,onChange:he=>F(he.target.checked)}),"Can spawn subtasks"]})}),i.jsxs("div",{className:et.section,children:[i.jsx("div",{className:et.label,children:"Dependencies"}),Oe.length===0?i.jsx("div",{className:et.noDeps,children:"No other tasks in this workspace"}):i.jsx("div",{className:et.depList,children:Oe.map(he=>{const Le=P.includes(he.id);return i.jsxs("label",{className:`${et.depItem} ${Le?et.depItemSelected:""}`,"data-testid":`dep-option-${he.id}`,children:[i.jsx("input",{type:"checkbox",checked:Le,onChange:()=>Ee(he.id)}),he.title,i.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",he.status,")"]})]},he.id)})})]})]})})]})}const dB="_actionButtons_1rjka_1",uB="_btnPrimary_1rjka_8",fB="_btnDanger_1rjka_39",pB="_btnGhost_1rjka_78",Ft={actionButtons:dB,btnPrimary:uB,btnDanger:fB,btnGhost:pB};function mB({task:t,sessionId:s,isBlocked:o,onStart:r,onResume:c,onStop:d,onPause:u,onDelete:p,onEdit:m}){if(t.status==="not_started")return o?i.jsxs("div",{className:Ft.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{onClick:m,className:Ft.btnGhost,"data-testid":"task-action-edit",children:"Edit"}),i.jsx("button",{onClick:p,className:Ft.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]}):i.jsxs("div",{className:Ft.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{"data-testid":"task-header-start",onClick:r,className:Ft.btnPrimary,children:"Start"}),i.jsx("button",{onClick:m,className:Ft.btnGhost,"data-testid":"task-action-edit",children:"Edit"}),i.jsx("button",{onClick:p,className:Ft.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]});if(t.status==="working")return i.jsxs("div",{className:Ft.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{onClick:d,className:Ft.btnDanger,"data-testid":"task-action-stop",children:"Stop"}),i.jsx("button",{onClick:u,disabled:!s,className:Ft.btnGhost,"data-testid":"task-action-pause",children:"Pause"})]});if(t.status==="paused")return i.jsxs("div",{className:Ft.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{onClick:d,className:Ft.btnPrimary,"data-testid":"task-action-stop",children:"Stop"}),i.jsx("button",{onClick:c,className:Ft.btnGhost,"data-testid":"task-action-resume",children:"Resume"}),i.jsx("button",{onClick:p,className:Ft.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]});if(t.status==="complete")return i.jsx("div",{className:Ft.actionButtons,"data-testid":"task-action-buttons",children:i.jsx("button",{onClick:p,className:Ft.btnDanger,"data-testid":"task-action-delete",children:"Delete"})});if(t.status==="failed")return i.jsxs("div",{className:Ft.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{onClick:r,className:Ft.btnPrimary,"data-testid":"task-header-start",children:"Retry"}),i.jsx("button",{onClick:p,className:Ft.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]})}const hB="_workpadSection_y8nj9_1",gB="_workpadLabel_y8nj9_9",vB="_workpadStatus_y8nj9_17",yB="_workpadSummary_y8nj9_23",bB="_workpadExtra_y8nj9_29",Ra={workpadSection:hB,workpadLabel:gB,workpadStatus:vB,workpadSummary:yB,workpadExtra:bB};function xB({workpad:t}){if(!t)return;let s;try{const o=JSON.parse(t);if(o==null||typeof o!="object"||Array.isArray(o))return;s=o}catch{return i.jsxs("div",{className:Ra.workpadSection,"data-testid":"workpad-panel",children:[i.jsx("div",{className:Ra.workpadLabel,children:"Workpad"}),i.jsx("div",{className:Ra.workpadExtra,children:t})]})}if(!(!s.status&&!s.summary&&!s.extra))return i.jsxs("div",{className:Ra.workpadSection,"data-testid":"workpad-panel",children:[i.jsx("div",{className:Ra.workpadLabel,children:"Workpad"}),s.status&&i.jsx("div",{className:Ra.workpadStatus,"data-testid":"workpad-status",children:s.status}),s.summary&&i.jsx("div",{className:Ra.workpadSummary,"data-testid":"workpad-summary",children:s.summary}),s.extra&&Object.keys(s.extra).length>0&&i.jsx("div",{className:Ra.workpadExtra,"data-testid":"workpad-extra",children:JSON.stringify(s.extra,null,2)})]})}const _B="_overviewDashboard_r05qm_1",kB="_overviewHero_r05qm_7",SB="_statusBadge_r05qm_14",TB="_statusPending_r05qm_26",wB="_statusAssigned_r05qm_31",jB="_statusInProgress_r05qm_36",NB="_statusReview_r05qm_41",CB="_statusDone_r05qm_46",EB="_statusFailed_r05qm_51",AB="_statusWaitingInput_r05qm_56",DB="_overviewBranchPill_r05qm_61",RB="_branchLink_r05qm_76",MB="_overviewSection_r05qm_87",IB="_overviewLabel_r05qm_93",OB="_overviewValue_r05qm_100",BB="_overviewMuted_r05qm_105",LB="_overviewMarkdown_r05qm_111",zB="_envRow_r05qm_180",$B="_envDot_r05qm_186",UB="_envDotGreen_r05qm_193",PB="_envDotYellow_r05qm_197",HB="_envDotRed_r05qm_201",VB="_envDotGray_r05qm_205",qB="_depList_r05qm_209",GB="_depItem_r05qm_215",FB="_depBlocked_r05qm_222",ZB="_depDone_r05qm_226",KB="_timeline_r05qm_230",YB="_timelineRow_r05qm_236",JB="_timelineKey_r05qm_243",WB="_timelineValue_r05qm_249",XB="_timelineDelta_r05qm_253",QB="_reviewNotes_r05qm_264",pe={overviewDashboard:_B,overviewHero:kB,statusBadge:SB,statusPending:TB,statusAssigned:wB,statusInProgress:jB,statusReview:NB,statusDone:CB,statusFailed:EB,statusWaitingInput:AB,overviewBranchPill:DB,branchLink:RB,overviewSection:MB,overviewLabel:IB,overviewValue:OB,overviewMuted:BB,overviewMarkdown:LB,envRow:zB,envDot:$B,envDotGreen:UB,envDotYellow:PB,envDotRed:HB,envDotGray:VB,depList:qB,depItem:GB,depBlocked:FB,depDone:ZB,timeline:KB,timelineRow:YB,timelineKey:JB,timelineValue:WB,timelineDelta:XB,reviewNotes:QB};function Lc(t){if(!t)return"—";const s=new Date(t);return isNaN(s.getTime())?"—":s.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function yp(t,s){if(!t||!s)return;const o=new Date(s).getTime()-new Date(t).getTime();if(isNaN(o)||o<0)return;const r=Math.floor(o/6e4),c=Math.floor(o%6e4/1e3);if(r===0)return`${c}s`;const d=Math.floor(r/60),u=r%60;return d===0?`${r}m ${c}s`:`${d}h ${u}m`}function Vb(t){const s=t.toLowerCase();return s==="ready"||s==="running"||s==="available"||s==="connected"?pe.envDotGreen:s==="provisioning"||s==="starting"||s==="pending"||s==="connecting"?pe.envDotYellow:s==="error"||s==="failed"||s==="disconnected"?pe.envDotRed:pe.envDotGray}function eL({status:t}){const s=$a(t),o=ew(t);return i.jsx("span",{className:`${pe.statusBadge} ${pe[o]??pe.statusPending}`,"data-testid":"task-overview-status-badge",children:s.label})}function tL({task:t,tasksById:s,environments:o,workspaces:r,taskSessions:c,selectedEnvId:d,taskUsage:u,treeUsage:p}){const m=c.length>0?c[c.length-1]:void 0,g=(m==null?void 0:m.environmentId)??"",v=g?o.find(k=>k.id===g):void 0,b=r.find(k=>k.id===t.workspaceId),x=o.find(k=>k.id===d),S=t.branch&&(b!=null&&b.repoUrl)?`${b.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(t.branch)}`:void 0;return i.jsxs("div",{className:pe.overviewDashboard,"data-testid":"task-overview-panel",children:[i.jsxs("div",{className:pe.overviewHero,children:[i.jsx(eL,{status:t.status}),t.branch&&i.jsx("span",{className:pe.overviewBranchPill,"data-testid":"task-overview-branch",children:S?i.jsxs("a",{href:S,target:"_blank",rel:"noreferrer noopener",className:pe.branchLink,children:["🔗"," ",t.branch]}):i.jsxs("span",{children:["🔗"," ",t.branch]})})]}),typeof t.description=="string"&&t.description&&i.jsxs("div",{className:pe.overviewSection,"data-testid":"task-overview-description",children:[i.jsx("div",{className:pe.overviewLabel,children:"Description"}),i.jsx("div",{className:pe.overviewMarkdown,children:i.jsx(md,{remarkPlugins:[hd],children:t.description})})]}),t.workpad&&i.jsx(xB,{workpad:t.workpad}),i.jsxs("div",{className:pe.overviewSection,children:[i.jsx("div",{className:pe.overviewLabel,children:"Environment"}),g&&v?i.jsxs("div",{className:pe.envRow,"data-testid":"task-overview-environment",children:[i.jsx("span",{className:`${pe.envDot} ${Vb(v.status)}`,title:v.status,"aria-label":`Status: ${v.status}`,role:"img"}),i.jsx("span",{className:pe.overviewValue,children:v.displayName})]}):x?i.jsxs("div",{className:pe.envRow,"data-testid":"task-overview-environment",children:[i.jsx("span",{className:`${pe.envDot} ${Vb(x.status)}`,title:x.status,"aria-label":`Status: ${x.status}`,role:"img"}),i.jsx("span",{className:pe.overviewValue,children:x.displayName}),i.jsx("span",{className:pe.overviewMuted,children:"(workspace default)"})]}):i.jsx("div",{className:pe.overviewMuted,children:"Set in workspace settings"})]}),i.jsxs("div",{className:pe.overviewSection,"data-testid":"task-overview-dependencies",children:[i.jsx("div",{className:pe.overviewLabel,children:"Dependencies"}),t.dependsOn.length===0?i.jsx("div",{className:pe.overviewMuted,children:"None"}):i.jsx("div",{className:pe.depList,children:t.dependsOn.map(k=>{const w=s.get(k),N=(w==null?void 0:w.status)==="complete";return i.jsxs("div",{className:`${pe.depItem} ${N?pe.depDone:pe.depBlocked}`,children:[i.jsx("span",{children:N?"✓":"○"}),i.jsx("span",{children:(w==null?void 0:w.title)??k})]},k)})})]}),i.jsxs("div",{className:pe.overviewSection,"data-testid":"task-overview-timeline",children:[i.jsx("div",{className:pe.overviewLabel,children:"Timeline"}),i.jsxs("div",{className:pe.timeline,children:[t.createdAt&&i.jsxs("div",{className:pe.timelineRow,children:[i.jsx("span",{className:pe.timelineKey,children:"Created"}),i.jsx("span",{className:pe.timelineValue,children:Lc(t.createdAt)})]}),t.assignedAt&&(()=>{const k=yp(t.createdAt,t.assignedAt);return i.jsxs("div",{className:pe.timelineRow,children:[i.jsx("span",{className:pe.timelineKey,children:"Assigned"}),i.jsx("span",{className:pe.timelineValue,children:Lc(t.assignedAt)}),k!==void 0&&i.jsx("span",{className:pe.timelineDelta,children:k})]})})(),t.startedAt&&(()=>{const k=yp(t.assignedAt??t.createdAt,t.startedAt);return i.jsxs("div",{className:pe.timelineRow,children:[i.jsx("span",{className:pe.timelineKey,children:"Started"}),i.jsx("span",{className:pe.timelineValue,children:Lc(t.startedAt)}),k!==void 0&&i.jsx("span",{className:pe.timelineDelta,children:k})]})})(),t.completedAt&&(()=>{const k=yp(t.startedAt,t.completedAt);return i.jsxs("div",{className:pe.timelineRow,children:[i.jsx("span",{className:pe.timelineKey,children:"Completed"}),i.jsx("span",{className:pe.timelineValue,children:Lc(t.completedAt)}),k!==void 0&&i.jsx("span",{className:pe.timelineDelta,children:k})]})})(),!t.createdAt&&!t.assignedAt&&!t.startedAt&&!t.completedAt&&i.jsx("div",{className:pe.overviewMuted,children:"No timing data"})]})]}),u&&u.costUsd>0&&i.jsxs("div",{className:pe.overviewSection,"data-testid":"task-overview-usage",children:[i.jsx("div",{className:pe.overviewLabel,children:"Usage"}),i.jsxs("div",{className:pe.timeline,children:[i.jsxs("div",{className:pe.timelineRow,children:[i.jsx("span",{className:pe.timelineKey,children:"Cost"}),i.jsx("span",{className:pe.timelineValue,children:Ss(u.costUsd)}),i.jsxs("span",{className:pe.timelineDelta,children:[u.sessionCount," session",u.sessionCount!==1?"s":""]})]}),p&&p.costUsd>u.costUsd&&i.jsxs("div",{className:pe.timelineRow,children:[i.jsx("span",{className:pe.timelineKey,children:"Total (incl. subtasks)"}),i.jsx("span",{className:pe.timelineValue,children:Ss(p.costUsd)}),i.jsxs("span",{className:pe.timelineDelta,children:[p.sessionCount," session",p.sessionCount!==1?"s":""]})]})]})]}),(t.tokenBudget>0||t.costBudgetMillicents>0)&&i.jsxs("div",{className:pe.overviewSection,"data-testid":"task-overview-budget",children:[i.jsx("div",{className:pe.overviewLabel,children:"Budget"}),i.jsxs("div",{className:pe.timeline,children:[t.tokenBudget>0&&i.jsxs("div",{className:pe.timelineRow,children:[i.jsx("span",{className:pe.timelineKey,children:"Tokens"}),i.jsxs("span",{className:pe.timelineValue,children:[Mo(((u==null?void 0:u.inputTokens)??0)+((u==null?void 0:u.outputTokens)??0))," / ",Mo(t.tokenBudget)]})]}),t.costBudgetMillicents>0&&i.jsxs("div",{className:pe.timelineRow,children:[i.jsx("span",{className:pe.timelineKey,children:"Cost"}),i.jsxs("span",{className:pe.timelineValue,children:[Ss((u==null?void 0:u.costUsd)??0)," / ",Ss(t.costBudgetMillicents/1e5)]})]})]})]}),t.reviewNotes&&i.jsxs("div",{className:pe.overviewSection,"data-testid":"task-overview-review-notes",children:[i.jsx("div",{className:pe.overviewLabel,children:"Review Notes"}),i.jsx("div",{className:pe.reviewNotes,children:t.reviewNotes})]})]})}const nL="_container_legrg_1",sL="_header_legrg_8",aL="_headerTitle_legrg_35",iL="_badge_legrg_44",oL="_headerActions_legrg_54",rL="_body_legrg_61",lL="_formContent_legrg_73",cL="_section_legrg_85",dL="_label_legrg_91",uL="_nameInput_legrg_98",fL="_fieldInput_legrg_131",pL="_adapterSelect_legrg_164",mL="_readOnlyValue_legrg_198",hL="_codespaceSection_legrg_204",gL="_codespaceActions_legrg_210",vL="_creatingHint_legrg_216",yL="_errorHint_legrg_222",bL="_btnPrimary_legrg_235",xL="_btnGhost_legrg_266",ie={container:nL,header:sL,headerTitle:aL,badge:iL,headerActions:oL,body:rL,formContent:lL,section:cL,label:dL,nameInput:uL,fieldInput:fL,adapterSelect:pL,readOnlyValue:mL,codespaceSection:hL,codespaceActions:gL,creatingHint:vL,errorHint:yL,btnPrimary:bL,btnGhost:xL},Jc=1,Wc=65535;function bp(t){if(!t.trim())return!0;const s=Number(t);return Number.isInteger(s)&&s>=Jc&&s<=Wc}function xp(t){try{const s=JSON.parse(t);if(typeof s=="object"&&s!==null&&!Array.isArray(s))return s}catch{}return{}}function _L({codespaceName:t,onCodespaceNameChange:s,envName:o,onEnvNameChange:r,codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,onCreateCodespace:m}){const[g,v]=y.useState("pick"),[b,x]=y.useState(""),[S,k]=y.useState("");return g==="create"?i.jsxs("div",{className:ie.codespaceSection,children:[i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"Repository"}),i.jsx("input",{type:"text",value:b,onChange:w=>x(w.target.value),placeholder:"owner/repo",className:ie.fieldInput,"data-testid":"env-codespace-repo"})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"Machine Type"}),i.jsx("input",{type:"text",value:S,onChange:w=>k(w.target.value),placeholder:"Machine type (optional)...",className:ie.fieldInput,"data-testid":"env-codespace-machine"})]}),i.jsxs("div",{className:ie.codespaceActions,children:[i.jsx("button",{onClick:()=>{b.trim()&&(m(b.trim(),S.trim()||void 0),v("pick"),x(""),k(""))},disabled:!b.trim(),className:ie.btnPrimary,children:"Create"}),i.jsx("button",{onClick:()=>{v("pick"),x(""),k("")},className:ie.btnGhost,children:"Cancel"})]})]}):i.jsx("div",{className:ie.codespaceSection,children:i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"Codespace"}),!u&&i.jsxs("select",{value:t,onChange:w=>{w.target.value==="__create__"?(v("create"),s("")):(s(w.target.value),w.target.value&&!o.trim()&&r(w.target.value))},disabled:p,className:ie.adapterSelect,"data-testid":"env-codespace-select",children:[i.jsx("option",{value:"",children:"Select a codespace..."}),c.map(w=>i.jsxs("option",{value:w.name,children:[w.name," (",w.repository,") — ",w.state]},w.name)),i.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&i.jsx("span",{className:ie.creatingHint,children:"Creating codespace..."}),u&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:ie.errorHint,children:u}),i.jsx("input",{type:"text",value:t,onChange:w=>s(w.target.value),placeholder:"Or enter codespace name manually...",className:ie.fieldInput,"data-testid":"env-codespace-manual"})]}),d&&!u&&i.jsx("span",{className:ie.errorHint,children:d})]})})}function N1({mode:t,environmentId:s,environments:o,onAddEnvironment:r,onUpdateEnvironment:c,onListCodespaces:d,codespaces:u,codespaceError:p,codespaceListError:m,codespaceCreating:g,onCreateCodespace:v,onShowToast:b}){const x=_t(),S=t==="edit",k=S&&s?o.find(ue=>ue.id===s):void 0,[w,N]=y.useState(""),[T,C]=y.useState("local"),[R,B]=y.useState(""),[A,M]=y.useState(""),[D,z]=y.useState(""),[U,X]=y.useState(""),[Q,P]=y.useState(""),[re,H]=y.useState(""),[oe,E]=y.useState(""),[F,ae]=y.useState(null),me=y.useCallback(()=>{const ue={};if(T==="local"){if(R.trim()&&(ue.host=R.trim()),A.trim()){const xe=Number(A);Number.isInteger(xe)&&(ue.port=xe)}}else if(T==="ssh"){if(ue.host=R.trim(),D.trim()&&(ue.user=D.trim()),A.trim()){const xe=Number(A);Number.isInteger(xe)&&(ue.sshPort=xe)}U.trim()&&(ue.identityFile=U.trim())}else T==="docker"?(Q.trim()&&(ue.image=Q.trim()),re.trim()&&(ue.repo=re.trim())):T==="codespace"&&(ue.codespaceName=oe.trim());return ue},[T,R,A,D,U,Q,re,oe]),de=()=>!(!w.trim()||T==="ssh"&&!R.trim()||T==="codespace"&&!oe.trim()||(T==="local"||T==="ssh")&&!bp(A)),Oe=()=>{de()&&(r(w.trim(),T,me()),b==null||b("Environment added successfully","success"),x(Ro,{replace:!0}))},ke=()=>{x(s?Ti(s):Ro)},Ee=y.useCallback((ue,xe)=>{if(!k||!s)return;const he=xp(k.adapterConfig),Le=xe.trim();Le?he[ue]=Le:delete he[ue],c(s,{adapterConfig:he})},[k,s,c]),ze=y.useCallback((ue,xe)=>{if(!k||!s)return;const he=xp(k.adapterConfig);if(xe.trim()){const Le=Number(xe);Number.isInteger(Le)&&Le>=Jc&&Le<=Wc&&(he[ue]=Le)}else delete he[ue];c(s,{adapterConfig:he})},[k,s,c]);if(S){if(!k)return i.jsxs("div",{className:ie.container,children:[i.jsxs("div",{className:ie.header,children:[i.jsx("div",{className:ie.headerTitle,children:i.jsx("span",{className:ie.badge,children:"edit environment"})}),i.jsx("div",{className:ie.headerActions,children:i.jsx("button",{onClick:ke,className:ie.btnGhost,children:"Back"})})]}),i.jsx("div",{className:ie.body,children:i.jsx("div",{className:ie.formContent,children:i.jsx("span",{className:ie.readOnlyValue,children:"Environment not found"})})})]});const ue=xp(k.adapterConfig);return i.jsxs("div",{className:ie.container,"data-testid":"env-edit-panel",children:[i.jsxs("div",{className:ie.header,children:[i.jsx("div",{className:ie.headerTitle,children:i.jsx("span",{className:ie.badge,children:"edit environment"})}),i.jsx("div",{className:ie.headerActions,children:i.jsx("button",{onClick:ke,className:ie.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),i.jsx("div",{className:ie.body,children:i.jsxs("div",{className:ie.formContent,children:[i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"Name"}),i.jsx(ln,{value:k.displayName,onSave:xe=>{s&&c(s,{displayName:xe})},validate:xe=>xe.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:F,onActivate:ae,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"Adapter Type"}),i.jsx("span",{className:ie.readOnlyValue,"data-testid":"env-edit-adapter-type",children:k.adapterType})]}),k.adapterType==="local"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"Host"}),i.jsx(ln,{value:String(ue.host??""),onSave:xe=>Ee("host",xe),mode:"edit",fieldId:"host",activeFieldId:F,onActivate:ae,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"Port"}),i.jsx(ln,{value:String(ue.port??""),onSave:xe=>ze("port",xe),validate:xe=>bp(xe)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:F,onActivate:ae,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),k.adapterType==="ssh"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"Host"}),i.jsx(ln,{value:String(ue.host??""),onSave:xe=>Ee("host",xe),validate:xe=>xe.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:F,onActivate:ae,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"User"}),i.jsx(ln,{value:String(ue.user??""),onSave:xe=>Ee("user",xe),mode:"edit",fieldId:"user",activeFieldId:F,onActivate:ae,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"SSH Port"}),i.jsx(ln,{value:String(ue.sshPort??""),onSave:xe=>ze("sshPort",xe),validate:xe=>bp(xe)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:F,onActivate:ae,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"Identity File"}),i.jsx(ln,{value:String(ue.identityFile??""),onSave:xe=>Ee("identityFile",xe),mode:"edit",fieldId:"identityFile",activeFieldId:F,onActivate:ae,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),k.adapterType==="docker"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"Image"}),i.jsx(ln,{value:String(ue.image??""),onSave:xe=>Ee("image",xe),mode:"edit",fieldId:"image",activeFieldId:F,onActivate:ae,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"Repo"}),i.jsx(ln,{value:String(ue.repo??""),onSave:xe=>Ee("repo",xe),mode:"edit",fieldId:"repo",activeFieldId:F,onActivate:ae,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),k.adapterType==="codespace"&&i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,children:"Codespace Name"}),i.jsx(ln,{value:String(ue.codespaceName??""),onSave:xe=>Ee("codespaceName",xe),validate:xe=>xe.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:F,onActivate:ae,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return i.jsxs("div",{className:ie.container,"data-testid":"env-create-panel",children:[i.jsxs("div",{className:ie.header,children:[i.jsx("div",{className:ie.headerTitle,children:i.jsx("span",{className:ie.badge,children:"new environment"})}),i.jsxs("div",{className:ie.headerActions,children:[i.jsx("button",{onClick:Oe,disabled:!de(),className:ie.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),i.jsx("button",{onClick:ke,className:ie.btnGhost,children:"Cancel"})]})]}),i.jsx("div",{className:ie.body,children:i.jsxs("div",{className:ie.formContent,children:[i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,htmlFor:"env-create-name",children:"Name"}),i.jsx("input",{id:"env-create-name",type:"text",value:w,onChange:ue=>N(ue.target.value),placeholder:"Environment name...",autoFocus:!0,className:ie.nameInput,"data-testid":"env-create-name",onKeyDown:ue=>{ue.key==="Enter"&&de()&&Oe()}})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),i.jsxs("select",{id:"env-create-adapter",value:T,onChange:ue=>{C(ue.target.value),ue.target.value==="codespace"&&d()},className:ie.adapterSelect,"data-testid":"env-create-adapter",children:[i.jsx("option",{value:"local",children:"local"}),i.jsx("option",{value:"ssh",children:"ssh"}),i.jsx("option",{value:"docker",children:"docker"}),i.jsx("option",{value:"codespace",children:"codespace"})]})]}),T==="local"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,htmlFor:"env-create-host",children:"Host"}),i.jsx("input",{id:"env-create-host",type:"text",value:R,onChange:ue=>B(ue.target.value),placeholder:"Host (optional)...",className:ie.fieldInput,"data-testid":"env-create-host"})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,htmlFor:"env-create-port",children:"Port"}),i.jsx("input",{id:"env-create-port",type:"number",min:Jc,max:Wc,value:A,onChange:ue=>M(ue.target.value),placeholder:"Port (optional)...",className:ie.fieldInput,"data-testid":"env-create-port"})]})]}),T==="ssh"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,htmlFor:"env-create-host",children:"Host"}),i.jsx("input",{id:"env-create-host",type:"text",value:R,onChange:ue=>B(ue.target.value),placeholder:"Host (required)...",className:ie.fieldInput,"data-testid":"env-create-host"})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,htmlFor:"env-create-user",children:"User"}),i.jsx("input",{id:"env-create-user",type:"text",value:D,onChange:ue=>z(ue.target.value),placeholder:"User (optional)...",className:ie.fieldInput,"data-testid":"env-create-user"})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,htmlFor:"env-create-port",children:"SSH Port"}),i.jsx("input",{id:"env-create-port",type:"number",min:Jc,max:Wc,value:A,onChange:ue=>M(ue.target.value),placeholder:"SSH port (optional)...",className:ie.fieldInput,"data-testid":"env-create-port"})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,htmlFor:"env-create-identity",children:"Identity File"}),i.jsx("input",{id:"env-create-identity",type:"text",value:U,onChange:ue=>X(ue.target.value),placeholder:"Identity file (optional)...",className:ie.fieldInput,"data-testid":"env-create-identity"})]})]}),T==="docker"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,htmlFor:"env-create-image",children:"Image"}),i.jsx("input",{id:"env-create-image",type:"text",value:Q,onChange:ue=>P(ue.target.value),placeholder:"Image (optional)...",className:ie.fieldInput,"data-testid":"env-create-image"})]}),i.jsxs("div",{className:ie.section,children:[i.jsx("label",{className:ie.label,htmlFor:"env-create-repo",children:"Repo"}),i.jsx("input",{id:"env-create-repo",type:"text",value:re,onChange:ue=>H(ue.target.value),placeholder:"Repo (optional)...",className:ie.fieldInput,"data-testid":"env-create-repo"})]})]}),T==="codespace"&&i.jsx(_L,{codespaceName:oe,onCodespaceNameChange:E,envName:w,onEnvNameChange:N,codespaces:u,codespaceError:p,codespaceListError:m,codespaceCreating:g,onCreateCodespace:v})]})})]})}const kL="_group_1iprv_1",SL="_groupTitle_1iprv_8",TL="_shortcutList_1iprv_17",wL="_shortcutRow_1iprv_23",jL="_keys_1iprv_36",NL="_kbd_1iprv_43",CL="_description_1iprv_60",bi={group:kL,groupTitle:SL,shortcutList:TL,shortcutRow:wL,keys:jL,kbd:NL,description:CL},EL=[{title:"Global",shortcuts:[{keys:["?"],description:"Open keyboard shortcuts reference"},{keys:["N"],description:"Create a new task"},{keys:["Escape"],description:"Close dialog or cancel editing"}]},{title:"Task Page",shortcuts:[{keys:["1"],description:"Switch to Overview tab"},{keys:["2"],description:"Switch to Stream tab"},{keys:["3"],description:"Switch to Findings tab"}]},{title:"Workspace Page",shortcuts:[{keys:["1"],description:"Switch to Graph view"},{keys:["2"],description:"Switch to Board view"},{keys:["3"],description:"Switch to Tasks view"}]},{title:"Navigation Lists",shortcuts:[{keys:["←"],description:"Previous tab (horizontal nav)"},{keys:["→"],description:"Next tab (horizontal nav)"},{keys:["↑"],description:"Previous item (vertical nav)"},{keys:["↓"],description:"Next item (vertical nav)"},{keys:["J"],description:"Next item (alias for arrow down/right)"},{keys:["K"],description:"Previous item (alias for arrow up/left)"},{keys:["Home"],description:"Jump to first item"},{keys:["End"],description:"Jump to last item"}]},{title:"Editing",shortcuts:[{keys:["Enter"],description:"Activate / save inline edit"},{keys:["Space"],description:"Activate button or start editing"},{keys:["Escape"],description:"Cancel edit and discard changes"}]},{title:"Chat",shortcuts:[{keys:["Enter"],description:"Send message (when input is focused)"}]}];function AL(){return i.jsxs("section",{className:ve.section,"data-testid":"keyboard-shortcuts-panel",children:[i.jsx("h3",{className:ve.sectionTitle,children:"Keyboard Shortcuts"}),i.jsx("p",{className:ve.sectionDescription,children:"Keyboard shortcuts for navigating and interacting with Grackle. Global shortcuts are suppressed while typing in text fields."}),EL.map(t=>i.jsxs("div",{className:bi.group,children:[i.jsx("h4",{className:bi.groupTitle,children:t.title}),i.jsx("div",{className:bi.shortcutList,children:t.shortcuts.map(s=>i.jsxs("div",{className:bi.shortcutRow,children:[i.jsx("span",{className:bi.keys,children:s.keys.map(o=>i.jsx("kbd",{className:bi.kbd,children:o},o))}),i.jsx("span",{className:bi.description,children:s.description})]},s.description))})]},t.title))]})}const DL=[{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 RL({credentialProviders:t,onUpdateCredentialProviders:s}){const o=(r,c)=>{const d={...t};r==="claude"?d.claude=c:d[r]=c,s(d)};return i.jsxs("section",{className:ve.section,children:[i.jsx("h3",{className:ve.sectionTitle,children:"Credential Providers"}),i.jsx("p",{className:ve.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),i.jsx("div",{className:ve.tokenList,children:DL.map(r=>i.jsxs("div",{className:ve.tokenRow,children:[i.jsx("span",{className:ve.tokenName,children:r.label}),i.jsx("span",{className:ve.tokenTarget,children:r.description}),i.jsx("select",{className:ve.select,value:t[r.key],onChange:c=>o(r.key,c.target.value),children:r.options.map(c=>i.jsx("option",{value:c.value,children:c.label},c.value))})]},r.key))})]})}const ML="_container_10efq_1",IL="_header_10efq_7",OL="_list_10efq_105",BL="_card_10efq_111",LL="_cardHeader_10efq_125",zL="_cardTitle_10efq_135",$L="_defaultBadge_10efq_141",UL="_cardActions_10efq_155",PL="_description_10efq_160",HL="_meta_10efq_166",VL="_empty_10efq_212",qL="_typeBadge_10efq_362",Jn={container:ML,header:IL,list:OL,card:BL,cardHeader:LL,cardTitle:zL,defaultBadge:$L,cardActions:UL,description:PL,meta:HL,empty:VL,typeBadge:qL};function GL({personas:t,appDefaultPersonaId:s,onDeletePersona:o,onSetAppDefaultPersonaId:r,onNavigateToNew:c,onNavigateToPersona:d}){const[u,p]=y.useState(null),m=u?t.find(v=>v.id===u):void 0,g=async v=>{await o(v),p(null)};return i.jsxs("div",{className:Jn.container,children:[i.jsxs("div",{className:Jn.header,children:[i.jsx("h2",{children:"Personas"}),i.jsx(Ws,{variant:"primary",size:"md",onClick:c,"data-testid":"persona-new-button",children:"+ New Persona"})]}),t.length===0?i.jsx("p",{className:Jn.empty,children:"No personas yet. Create one to get started."}):i.jsx("div",{className:Jn.list,children:t.map(v=>{const b=s===v.id,x=v.type==="script";return i.jsxs("div",{className:Jn.card,"data-testid":`persona-card-${v.id}`,onClick:()=>d(v.id),role:"button",tabIndex:0,onKeyDown:S=>{S.currentTarget===S.target&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),d(v.id))},children:[i.jsxs("div",{className:Jn.cardHeader,children:[i.jsxs("span",{className:Jn.cardTitle,children:[i.jsx("strong",{children:v.name}),i.jsx("span",{className:Jn.typeBadge,"data-testid":`persona-type-badge-${v.id}`,children:x?"Script":"Agent"}),b&&i.jsx("span",{className:Jn.defaultBadge,"data-testid":`persona-default-badge-${v.id}`,children:"App Default"})]}),i.jsxs("div",{className:Jn.cardActions,onClick:S=>S.stopPropagation(),children:[!b&&i.jsx(Ws,{variant:"ghost",size:"sm",onClick:()=>{r(v.id).catch(()=>{})},"data-testid":`persona-set-default-${v.id}`,title:"Set as app default persona",children:"Set Default"}),i.jsx(Ws,{variant:"ghost",size:"sm",onClick:()=>d(v.id),children:"Edit"}),i.jsx(Ws,{variant:"ghost",size:"sm",onClick:()=>p(v.id),"data-testid":`persona-delete-${v.id}`,children:"Delete"})]})]}),v.description&&i.jsx("p",{className:Jn.description,children:v.description}),i.jsxs("div",{className:Jn.meta,children:[v.runtime&&i.jsxs("span",{children:["Runtime: ",v.runtime]}),v.model&&i.jsxs("span",{children:["Model: ",v.model]}),v.maxTurns>0&&i.jsxs("span",{children:["Max turns: ",v.maxTurns]})]})]},v.id)})}),i.jsx(ji,{isOpen:u!==null,title:"Delete Persona?",description:`"${(m==null?void 0:m.name)??""}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:()=>{u&&g(u).catch(()=>{})},onCancel:()=>p(null)})]})}const FL="_container_uy08i_1",ZL="_header_uy08i_7",KL="_count_uy08i_13",YL="_presets_uy08i_18",JL="_presetButton_uy08i_24",WL="_filterInput_uy08i_41",XL="_groups_uy08i_53",QL="_group_uy08i_53",e8="_groupHeader_uy08i_68",t8="_groupName_uy08i_77",n8="_groupCount_uy08i_81",s8="_toolList_uy08i_87",a8="_toolItem_uy08i_95",i8="_toolName_uy08i_103",mn={container:FL,header:ZL,count:KL,presets:YL,presetButton:JL,filterInput:WL,groups:XL,group:QL,groupHeader:e8,groupName:t8,groupCount:n8,toolList:s8,toolItem:a8,toolName:i8},o8=(()=>{const t=new Map;for(const s of rx){const o=s==="get_version_status"?"version":s.split("_")[0];t.has(o)||t.set(o,[]),t.get(o).push(s)}return[...t.entries()].sort(([s],[o])=>s.localeCompare(o)).map(([s,o])=>({group:s,tools:o.sort()}))})(),r8=[{name:"default",label:"Default",tools:lx},{name:"worker",label:"Worker",tools:pT},{name:"orchestrator",label:"Orchestrator",tools:mT},{name:"admin",label:"Admin",tools:hT}];function qb({selectedTools:t,onChange:s,disabled:o}){const[r,c]=y.useState(""),d=y.useMemo(()=>new Set(t),[t]),u=y.useCallback(v=>{if(o)return;const b=new Set(d);b.has(v)?b.delete(v):b.add(v),s([...b].sort())},[d,s,o]),p=y.useCallback((v,b)=>{if(o)return;const x=new Set(d);for(const S of v)b?x.delete(S):x.add(S);s([...x].sort())},[d,s,o]),m=y.useCallback(v=>{o||s([...v].sort())},[s,o]),g=r.toLowerCase();return i.jsxs("div",{className:mn.container,"data-testid":"mcp-tool-selector",children:[i.jsx("div",{className:mn.header,children:i.jsx("span",{className:mn.count,children:t.length===0?`Using default (${lx.length} tools)`:`${t.length} of ${rx.size} tools selected`})}),i.jsxs("div",{className:mn.presets,"data-testid":"mcp-tool-presets",children:[r8.map(v=>i.jsx("button",{type:"button",className:mn.presetButton,disabled:o,onClick:()=>m(v.tools),"data-testid":`preset-${v.name}`,children:v.label},v.name)),i.jsx("button",{type:"button",className:mn.presetButton,disabled:o,onClick:()=>s([]),"data-testid":"preset-clear",children:"Clear"})]}),i.jsx("input",{type:"text",className:mn.filterInput,placeholder:"Filter tools...",value:r,onChange:v=>c(v.target.value),disabled:o,"data-testid":"mcp-tool-filter"}),i.jsx("div",{className:mn.groups,children:o8.map(({group:v,tools:b})=>{const x=g?b.filter(k=>k.toLowerCase().includes(g)):b;if(x.length===0)return null;const S=x.every(k=>d.has(k));return i.jsxs("div",{className:mn.group,"data-testid":`tool-group-${v}`,children:[i.jsxs("label",{className:mn.groupHeader,children:[i.jsx("input",{type:"checkbox",checked:S,onChange:()=>p(x,S),disabled:o,"data-testid":`group-toggle-${v}`}),i.jsx("span",{className:mn.groupName,children:v}),i.jsxs("span",{className:mn.groupCount,children:["(",x.filter(k=>d.has(k)).length,"/",x.length,")"]})]}),i.jsx("div",{className:mn.toolList,children:x.map(k=>i.jsxs("label",{className:mn.toolItem,children:[i.jsx("input",{type:"checkbox",checked:d.has(k),onChange:()=>u(k),disabled:o,"data-testid":`tool-${k}`}),i.jsx("span",{className:mn.toolName,children:k})]},k))})]},v)})})]})}const l8="_nav_1bhou_1",c8="_tab_1bhou_24",d8="_tabIcon_1bhou_62",u8="_tabActive_1bhou_68",zc={nav:l8,tab:c8,tabIcon:d8,tabActive:u8},Ys=[{path:"credentials",label:"Credentials",icon:i.jsx(S2,{size:Lt})},{path:"personas",label:"Personas",icon:i.jsx(W2,{size:Lt})},{path:"appearance",label:"Appearance",icon:i.jsx($2,{size:Lt})},{path:"shortcuts",label:"Shortcuts",icon:i.jsx(w2,{size:Lt})},{path:"about",label:"About",icon:i.jsx(am,{size:Lt})}];function f8(){var u;const t=Zt(),s=_t(),o=y.useRef(null),r=((u=Ys.find(p=>{const m=`${Ao}/${p.path}`;return t.pathname===m||t.pathname.startsWith(`${m}/`)}))==null?void 0:u.path)??Ys[0].path,c=y.useCallback(p=>{s(`${Ao}/${p}`)},[s]),d=y.useCallback(p=>{var S,k;const m=(S=o.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(w=>w===document.activeElement),v=g>=0?g:Ys.findIndex(w=>w.path===r);let b=v;if(p.key==="ArrowDown"||p.key==="j"||p.key==="J")p.preventDefault(),b=(v+1)%Ys.length;else if(p.key==="ArrowUp"||p.key==="k"||p.key==="K")p.preventDefault(),b=(v-1+Ys.length)%Ys.length;else if(p.key==="Home")p.preventDefault(),b=0;else if(p.key==="End")p.preventDefault(),b=Ys.length-1;else return;const x=Ys[b].path;s(`${Ao}/${x}`),(k=m[b])==null||k.focus()},[r,s]);return i.jsx("nav",{className:zc.nav,ref:o,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:d,children:Ys.map(p=>{const m=p.path===r;return i.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${zc.tab} ${m?zc.tabActive:""}`,onClick:()=>c(p.path),children:[i.jsx("span",{className:zc.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}function p8({tasks:t,taskStatusById:s,sessionStatusByTaskId:o}){const r=new Map;for(const d of t)if(d.parentTaskId){const u=r.get(d.parentTaskId);u?u.push(d):r.set(d.parentTaskId,[d])}const c=new Map(ry.map(d=>[d,[]]));for(const d of t){const u=ll(d.status),p=d.dependsOn.length>0&&d.dependsOn.some(k=>s.get(k)!=="complete"),m=r.get(d.id)??[],g=m.length,v=m.filter(k=>k.status==="complete").length;let b;if(u==="paused"&&o){const k=o.get(d.id);k==="idle"?b="Needs input":k==="completed"&&(b="Ready to complete")}const x={task:d,isBlocked:p,childCount:g,doneChildCount:v,pausedSubBadge:b},S=c.get(u);S?S.push(x):c.get("not_started").push(x)}for(const d of c.values())d.sort((u,p)=>u.task.sortOrder-p.task.sortOrder);return ry.map(d=>{const u=$a(d);return{status:d,label:u.label,style:u,tasks:c.get(d)??[]}})}const m8="_boardContainer_1c4y1_1",h8="_column_1c4y1_17",g8="_columnHeader_1c4y1_34",v8="_columnIcon_1c4y1_47",y8="_columnLabel_1c4y1_52",b8="_columnCount_1c4y1_57",x8="_cardList_1c4y1_67",_8="_emptyPlaceholder_1c4y1_76",k8="_card_1c4y1_67",S8="_cardHeader_1c4y1_107",T8="_cardStatusIcon_1c4y1_113",w8="_cardTitle_1c4y1_119",j8="_cardBadges_1c4y1_127",N8="_badge_1c4y1_134",C8="_blockedBadge_1c4y1_146",E8="_childBadge_1c4y1_151",A8="_depBadge_1c4y1_155",D8="_parentBadge_1c4y1_159",R8="_pausedSubBadge_1c4y1_166",M8="_personaBadge_1c4y1_170",I8="_envBadge_1c4y1_174",O8="_emptyCta_1c4y1_178",B8="_ctaButton_1c4y1_188",L8="_ctaDescription_1c4y1_204",st={boardContainer:m8,column:h8,columnHeader:g8,columnIcon:v8,columnLabel:y8,columnCount:b8,cardList:x8,emptyPlaceholder:_8,card:k8,cardHeader:S8,cardStatusIcon:T8,cardTitle:w8,cardBadges:j8,badge:N8,blockedBadge:C8,childBadge:E8,depBadge:A8,parentBadge:D8,pausedSubBadge:R8,personaBadge:M8,envBadge:I8,emptyCta:O8,ctaButton:B8,ctaDescription:L8};function z8({workspaceId:t,environmentId:s,tasks:o,sessions:r,personas:c,environments:d}){const u=_t(),p=y.useMemo(()=>o.filter(x=>x.workspaceId===t),[o,t]),m=y.useMemo(()=>new Map(o.map(x=>[x.id,x.status])),[o]),g=y.useMemo(()=>new Map(p.map(x=>[x.id,x])),[p]),v=y.useMemo(()=>{const x=new Map(r.map(C=>[C.id,C])),S=new Map(c.map(C=>[C.id,C])),k=new Map(d.map(C=>[C.id,C])),w=new Map,N=new Map,T=new Map;for(const C of p)if(C.latestSessionId){const R=x.get(C.latestSessionId);if(R){if(w.set(C.id,R.endReason||R.status),R.personaId){const B=S.get(R.personaId);B&&N.set(C.id,B.name)}if(R.environmentId){const B=k.get(R.environmentId);B&&T.set(C.id,B.displayName)}}}return{sessionStatusByTaskId:w,personaNameByTaskId:N,environmentNameByTaskId:T}},[p,r,c,d]),b=y.useMemo(()=>p8({tasks:p,taskStatusById:m,sessionStatusByTaskId:v.sessionStatusByTaskId}),[p,m,v]);return p.length===0?i.jsxs("div",{className:st.emptyCta,"data-testid":"board-empty-cta",children:[i.jsx("button",{className:st.ctaButton,onClick:()=>u(Ei(t,void 0,s)),children:"Create Task"}),i.jsx("div",{className:st.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):i.jsx("div",{className:st.boardContainer,"data-testid":"board-container",children:b.map(x=>i.jsxs("section",{className:st.column,"data-testid":`board-column-${x.status}`,"aria-label":`${x.label}, ${x.tasks.length} ${x.tasks.length===1?"task":"tasks"}`,children:[i.jsxs("div",{className:st.columnHeader,children:[i.jsx("span",{className:st.columnIcon,style:{color:x.style.color},children:x.style.icon}),i.jsx("span",{className:st.columnLabel,children:x.label}),i.jsx("span",{className:st.columnCount,"data-testid":`board-count-${x.status}`,children:x.tasks.length})]}),i.jsx("div",{className:st.cardList,children:x.tasks.length===0?i.jsx("div",{className:st.emptyPlaceholder,children:"No tasks"}):i.jsx(ps,{mode:"popLayout",children:x.tasks.map(S=>i.jsx(Rt.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:i.jsx($8,{boardTask:S,tasksById:g,personaName:v.personaNameByTaskId.get(S.task.id),envName:v.environmentNameByTaskId.get(S.task.id),onClick:()=>u(In(S.task.id,void 0,t,s))})},S.task.id))})})]},x.status))})}function $8({boardTask:t,tasksById:s,personaName:o,envName:r,onClick:c}){const{task:d,isBlocked:u,childCount:p,doneChildCount:m,pausedSubBadge:g}=t,v=$a(d.status),b=d.parentTaskId?s.get(d.parentTaskId):void 0;return i.jsxs("div",{className:st.card,tabIndex:0,role:"button","data-testid":`board-card-${d.id}`,onClick:c,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),c())},children:[i.jsxs("div",{className:st.cardHeader,children:[i.jsx("span",{className:st.cardStatusIcon,style:{color:v.color},children:v.icon}),i.jsx("span",{className:st.cardTitle,children:d.title})]}),i.jsxs("div",{className:st.cardBadges,children:[b&&i.jsx("span",{className:`${st.badge} ${st.parentBadge}`,title:b.title,children:b.title}),p>0&&i.jsxs("span",{className:`${st.badge} ${st.childBadge}`,children:[m,"/",p]}),u&&i.jsx("span",{className:`${st.badge} ${st.blockedBadge}`,children:"blocked"}),d.dependsOn.length>0&&!u&&i.jsx("span",{className:`${st.badge} ${st.depBadge}`,children:"dep"}),g&&i.jsx("span",{className:`${st.badge} ${st.pausedSubBadge}`,children:g}),o&&i.jsx("span",{className:`${st.badge} ${st.personaBadge}`,children:o}),r&&i.jsx("span",{className:`${st.badge} ${st.envBadge}`,children:r})]})]})}const U8="_formContent_ymnez_1",P8="_section_ymnez_13",H8="_label_ymnez_19",V8="_titleInput_ymnez_26",q8="_descriptionTextarea_ymnez_58",G8="_selectField_ymnez_94",F8="_checkboxRow_ymnez_128",Z8="_checkboxLabel_ymnez_141",K8="_fieldError_ymnez_146",yt={formContent:U8,section:P8,label:H8,titleInput:V8,descriptionTextarea:q8,selectField:G8,checkboxRow:F8,checkboxLabel:Z8,fieldError:K8};function Y8(t,s){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)??s??"",defaultPersonaId:(t==null?void 0:t.defaultPersonaId)??"",useWorktrees:(t==null?void 0:t.useWorktrees)??!0,workingDirectory:(t==null?void 0:t.workingDirectory)??""}}const J8=100;function W8({values:t,onChange:s,environments:o,personas:r,errors:c,disabled:d,autoFocusName:u}){const p=(m,g)=>{s({...t,[m]:g})};return i.jsxs("div",{className:yt.formContent,children:[i.jsxs("div",{className:yt.section,children:[i.jsx("label",{className:yt.label,htmlFor:"ws-name",children:"Name"}),i.jsx("input",{id:"ws-name",className:yt.titleInput,type:"text",value:t.name,onChange:m=>p("name",m.target.value),placeholder:"Workspace name",maxLength:J8,autoFocus:u,disabled:d,"data-testid":"workspace-form-name"}),(c==null?void 0:c.name)&&i.jsx("span",{className:yt.fieldError,"data-testid":"workspace-form-error-name",children:c.name})]}),i.jsxs("div",{className:yt.section,children:[i.jsx("label",{className:yt.label,htmlFor:"ws-description",children:"Description"}),i.jsx("textarea",{id:"ws-description",className:yt.descriptionTextarea,value:t.description,onChange:m=>p("description",m.target.value),placeholder:"Optional description (Markdown supported)",disabled:d,"data-testid":"workspace-form-description"})]}),i.jsxs("div",{className:yt.section,children:[i.jsx("label",{className:yt.label,htmlFor:"ws-repo",children:"Repository URL"}),i.jsx("input",{id:"ws-repo",className:yt.titleInput,type:"text",value:t.repoUrl,onChange:m=>p("repoUrl",m.target.value),placeholder:"https://github.com/org/repo",disabled:d,"data-testid":"workspace-form-repo"}),(c==null?void 0:c.repoUrl)&&i.jsx("span",{className:yt.fieldError,"data-testid":"workspace-form-error-repoUrl",children:c.repoUrl})]}),i.jsxs("div",{className:yt.section,children:[i.jsx("label",{className:yt.label,htmlFor:"ws-environment",children:"Environment"}),i.jsxs("select",{id:"ws-environment",className:yt.selectField,value:t.environmentId,onChange:m=>p("environmentId",m.target.value),disabled:d,"data-testid":"workspace-form-environment",children:[i.jsx("option",{value:"",children:"Select environment…"}),o.map(m=>i.jsx("option",{value:m.id,children:m.displayName||m.id},m.id))]}),(c==null?void 0:c.environmentId)&&i.jsx("span",{className:yt.fieldError,"data-testid":"workspace-form-error-environmentId",children:c.environmentId})]}),i.jsxs("div",{className:yt.section,children:[i.jsx("label",{className:yt.label,htmlFor:"ws-persona",children:"Default Persona"}),i.jsxs("select",{id:"ws-persona",className:yt.selectField,value:t.defaultPersonaId,onChange:m=>p("defaultPersonaId",m.target.value),disabled:d,"data-testid":"workspace-form-persona",children:[i.jsx("option",{value:"",children:"(Inherit)"}),r.map(m=>i.jsx("option",{value:m.id,children:m.name},m.id))]})]}),i.jsx("div",{className:yt.section,children:i.jsxs("label",{className:yt.checkboxRow,children:[i.jsx("input",{type:"checkbox",checked:t.useWorktrees,onChange:m=>p("useWorktrees",m.target.checked),disabled:d,"data-testid":"workspace-form-worktrees"}),i.jsx("span",{className:yt.checkboxLabel,children:"Enable worktree isolation"})]})}),i.jsxs("div",{className:yt.section,children:[i.jsx("label",{className:yt.label,htmlFor:"ws-workdir",children:"Working Directory"}),i.jsx("input",{id:"ws-workdir",className:yt.titleInput,type:"text",value:t.workingDirectory,onChange:m=>p("workingDirectory",m.target.value),placeholder:"Default (server default)",disabled:d,"data-testid":"workspace-form-workdir"})]})]})}const C1=y.createContext(void 0),X8=4e3;function Q8({children:t}){const[s,o]=y.useState([]),r=y.useRef(0),c=y.useCallback(u=>{o(p=>p.filter(m=>m.id!==u))},[]),d=y.useCallback((u,p="info",m=X8)=>{const g=`toast-${++r.current}`;o(v=>[...v,{id:g,message:u,variant:p,duration:m}])},[]);return i.jsx(C1.Provider,{value:{toasts:s,showToast:d,dismissToast:c},children:t})}function Tn(){const t=y.useContext(C1);if(!t)throw new Error("useToast must be used within ToastProvider");return t}const em="grackle-theme",E1="grackle-prefer-system",A1="(prefers-color-scheme: dark)";let Gr=[],Xc;function _p(){Xc=void 0;for(const t of Gr)t()}function tm(){return typeof window>"u"?!1:window.matchMedia(A1).matches}function Wr(){if(typeof localStorage>"u")return Hb;try{const t=localStorage.getItem(em);if(t!==null&&w1.has(t))return t}catch{}return Hb}function fd(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(E1)==="true"}catch{return!1}}function nm(t){return Nd.find(s=>s.variantLightId===t||s.variantDarkId===t)}function D1(t,s){const o=Qp(t);if(o!=null&&o.variantDarkId)return s&&o.variantLightId?tm()?o.variantDarkId:o.variantLightId:o.variantDarkId;if(o!=null&&o.hidden&&s){const r=nm(t);if(r!=null&&r.variantLightId&&r.variantDarkId)return tm()?r.variantDarkId:r.variantLightId}return t}function So(t,s,o=!1){o&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=D1(t,s),o&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&So(Wr(),fd());function ez(){return Xc===void 0&&(Xc={themeId:Wr(),systemDark:tm(),preferSystem:fd()}),Xc}function tz(t){return Gr=[...Gr,t],()=>{Gr=Gr.filter(s=>s!==t)}}function nz(){const t=y.useSyncExternalStore(tz,ez),{themeId:s,preferSystem:o}=t,r=D1(s,o),c=y.useCallback(u=>{if(w1.has(u)){try{localStorage.setItem(em,u)}catch{}So(u,fd(),!0),_p()}},[]),d=y.useCallback(u=>{try{localStorage.setItem(E1,u?"true":"false")}catch{}if(u){const p=Wr(),m=Qp(p);if(m!=null&&m.hidden){const g=nm(p);if(g)try{localStorage.setItem(em,g.id)}catch{}}}So(Wr(),u,!0),_p()},[]);return y.useEffect(()=>{So(s,o)},[s,o]),y.useEffect(()=>{if(typeof window>"u")return;const u=window.matchMedia(A1),p=()=>{const m=Wr(),g=fd();if(g){const v=Qp(m);if(v!=null&&v.variantDarkId&&v.variantLightId&&So(m,g),v!=null&&v.hidden){const b=nm(m);b!=null&&b.variantDarkId&&b.variantLightId&&So(m,g)}}_p()};return u.addEventListener("change",p),()=>{u.removeEventListener("change",p)}},[]),{themeId:s,setTheme:c,resolvedThemeId:r,preferSystem:o,setPreferSystem:d}}const R1=y.createContext(void 0);function sz({children:t}){const s=nz();return i.jsx(R1.Provider,{value:s,children:t})}function M1(){const t=y.useContext(R1);if(!t)throw new Error("useThemeContext must be used within ThemeProvider");return t}const I1=y.createContext(void 0),O1=y.createContext(void 0);function az({children:t}){const[s,o]=y.useState(void 0),r=y.useCallback(c=>{o(c)},[]);return i.jsx(O1.Provider,{value:r,children:i.jsx(I1.Provider,{value:s,children:t})})}function iz(){return y.useContext(I1)}function oz(){const t=y.useContext(O1);if(t===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return t}const eh=y.createContext(void 0);function ft(){const t=y.useContext(eh);if(!t)throw new Error("useGrackle must be used within GrackleProvider");return t}function B1(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function L1(t,s){return console.warn(`[ws] Malformed "${t}" message: ${s}`),!1}function rz(t){return B1(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")}const lz=new Set(["off","subscription","api_key"]),$c=new Set(["off","on"]);function cz(t){return B1(t)&&lz.has(t.claude)&&$c.has(t.github)&&$c.has(t.copilot)&&$c.has(t.codex)&&$c.has(t.goose)}function z1(t){switch(t){case"waiting_input":return"idle";case"completed":return"stopped";case"killed":return"stopped";case"failed":return"stopped";case"interrupted":return"stopped";case"terminated":return"stopped";default:return t}}function $1(t){switch(t){case"completed":return"completed";case"killed":return"killed";case"failed":return"interrupted";case"interrupted":return"interrupted";case"terminated":return"terminated";default:return}}const ko=5e3;function dz(t,s){const o=[];let r=t;const c=new Set;for(;r&&s.has(r)&&!c.has(r);){c.add(r);const d=s.get(r);o.unshift(d),r=d.parentTaskId||void 0}return o}const sa={label:"Home",url:wi};function uz(t){return t?[sa,{label:"Settings",url:Ao},{label:t,url:void 0}]:[sa,{label:"Settings",url:void 0}]}const th={label:"Environments",url:Ro};function fz(){return[sa,{label:"Environments",url:void 0}]}function pz(){return[sa,{label:"New Chat",url:void 0}]}function mz(t){return[sa,{label:`Session ${t.slice(0,8)}`,url:void 0}]}function hz(t,s,o,r){const c=o.find(u=>u.id===t),d=r.find(u=>u.id===s);return[sa,th,{label:(d==null?void 0:d.displayName)??"Environment",url:Ti(s)},{label:(c==null?void 0:c.name)??"Workspace",url:void 0}]}function gz(t,s,o,r,c){const d=dz(t,c),u=c.get(t),p=u==null?void 0:u.workspaceId,m=p?o.find(S=>S.id===p):void 0,g=s??(m==null?void 0:m.environmentId),v=g?r.find(S=>S.id===g):void 0,b=[sa];v&&g&&(b.push(th),b.push({label:v.displayName,url:Ti(g)})),m&&g&&b.push({label:m.name,url:Ua(m.id,g)});for(let S=0;S<d.length-1;S++)b.push({label:d[S].title,url:In(d[S].id,void 0,p,g)});const x=d[d.length-1];return b.push({label:(x==null?void 0:x.title)??t,url:void 0}),b}const vz={label:"Findings",url:xd};function yz(){return[sa,{label:"Findings",url:void 0}]}function U1(t,s,o,r,c){const d=[sa];if(s&&o){const u=r.find(m=>m.id===s),p=c.find(m=>m.id===o);d.push(th),p&&d.push({label:p.displayName,url:Ti(o)}),u&&d.push({label:u.name,url:Ua(s,o)}),d.push({label:"Findings",url:iN(s,o)})}else d.push(vz);return d.push({label:t,url:void 0}),d}function nh(t){const s=[];for(const o of t){const r=s[s.length-1];o.eventType==="text"&&(r==null?void 0:r.eventType)==="text"?s[s.length-1]={...r,content:r.content+o.content}:s.push(o)}return s}function Uc(t){if(typeof t.id=="string")return t.id;const s=t.data;if(s&&typeof s.toolCallId=="string")return s.toolCallId;const o=t.item;if(o&&typeof o.id=="string")return o.id}function bz(t){if(typeof t.tool_use_id=="string")return t.tool_use_id;const s=t.data;if(s&&typeof s.toolCallId=="string")return s.toolCallId;const o=t.item;if(o&&typeof o.id=="string")return o.id}function sh(t){const s=new Map;for(const v of t)if(v.raw)try{s.set(v,JSON.parse(v.raw))}catch{}const o=new Map;for(const v of t){if(v.eventType!=="tool_use")continue;const b=s.get(v),x=b?Uc(b):void 0;if(x)try{const S=JSON.parse(v.content);o.set(x,{tool:S.tool,args:S.args})}catch{}}const r=new Set,c=new Set,d=t.map((v,b)=>{if(v.eventType!=="tool_result")return v;const x=s.get(v),S=x?bz(x):void 0;if(!S)return v;const k=o.get(S);if(!k)return v;r.add(S),c.add(b);let w;const N=v.content.trim();if(N.startsWith("{"))try{const T=JSON.parse(N);typeof T.detailedContent=="string"&&(w=T.detailedContent)}catch{}return{...v,toolUseCtx:{...k,detailedResult:w}}}),u=[];for(let v=0;v<d.length;v++){if(d[v].eventType!=="tool_use")continue;const b=s.get(d[v]),x=b?Uc(b):void 0;x&&r.has(x)||u.push(v)}const p=[];for(let v=0;v<d.length;v++)d[v].eventType!=="tool_result"||c.has(v)||p.push(v);let m=0;for(const v of u){for(;m<p.length&&p[m]<v;)m++;if(m>=p.length)break;const b=p[m];if(b!==v+1)continue;const x=d[v],S=d[b];let k;try{const w=JSON.parse(x.content);k={tool:w.tool,args:w.args}}catch{}if(k){let w;const N=S.content.trim();if(N.startsWith("{"))try{const R=JSON.parse(N);typeof R.detailedContent=="string"&&(w=R.detailedContent)}catch{}d[b]={...S,toolUseCtx:{...k,detailedResult:w}},c.add(b);const T=s.get(x),C=T?Uc(T):void 0;C?r.add(C):(r.add(`__seq_${v}`),s.set(x,{...T??{},__seqId:`__seq_${v}`})),m++}}const g=d.filter(v=>{if(v.eventType!=="tool_use")return!0;const b=s.get(v);if(!b)return!0;const x=Uc(b);if(x&&r.has(x))return!1;const S=b.__seqId;return!(S&&r.has(S))});for(let v=0;v<g.length;v++){if(g[v].eventType!=="tool_use")continue;let b=!1;for(let x=v+1;x<g.length;x++)if(g[x].eventType!=="tool_use"){b=!0;break}b&&(g[v]={...g[v],settled:!0})}return g}function xz(t,s,o){const r=t.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,c=P1(s),d=s.filter(m=>sm(m,c)).length,u=s.filter(m=>m.status==="paused"||m.status==="failed"||sm(m,c)).length,p=o.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:r,blockedTasks:d,attentionTasks:u,unhealthyEnvironments:p}}function P1(t){const s=new Map;for(const o of t)s.set(o.id,o.status);return s}function sm(t,s){return t.dependsOn.some(o=>s.get(o)!=="complete")}function _z(t,s){var u;const o=new Map;for(const p of s)o.set(p.id,p);const r=P1(t),c=[];for(const p of t){const m=p.workspaceId?((u=o.get(p.workspaceId))==null?void 0:u.name)??"Unknown":"Unknown";p.status==="failed"?c.push({task:p,reason:"failed",workspaceName:m}):sm(p,r)?c.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&c.push({task:p,reason:"paused",workspaceName:m})}const d={failed:0,blocked:1,paused:2};return c.sort((p,m)=>(d[p.reason]??3)-(d[m.reason]??3)),c}function kz(t,s){const o=new Map;for(const r of s)o.set(r.id,r);return t.filter(r=>r.status==="running"||r.status==="idle"||r.status==="waiting").map(r=>{var c;return{session:r,environmentName:((c=o.get(r.environmentId))==null?void 0:c.displayName)??"Unknown"}})}function Sz(t,s,o){const r=new Map;for(const c of s){if(!c.workspaceId)continue;let d=r.get(c.workspaceId);d||(d={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},r.set(c.workspaceId,d)),d.totalTasks+=1,c.status==="complete"?d.completedTasks+=1:c.status==="working"?d.workingTasks+=1:c.status==="failed"&&(d.failedTasks+=1)}return t.map(c=>{const d=r.get(c.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:c,totalTasks:d.totalTasks,completedTasks:d.completedTasks,workingTasks:d.workingTasks,failedTasks:d.failedTasks}})}const ks=[{id:"kn-auth-flow",label:"Authentication Flow",kind:"knowledge",category:"concept",content:"The application uses JWT Bearer tokens for stateless authentication. Access tokens expire after 24h. Refresh tokens are stored in the database and rotated on use. The auth middleware verifies tokens and attaches the decoded payload to req.user.",tags:["auth","jwt","security"],workspaceId:"proj-alpha",createdAt:"2026-02-25T10:30:00Z",updatedAt:"2026-02-27T08:15:00Z",val:5},{id:"kn-db-schema",label:"Database Schema",kind:"knowledge",category:"concept",content:"PostgreSQL database with tables: users, sessions, refresh_tokens, audit_log. Uses UUID primary keys, TIMESTAMPTZ for all timestamps, and JSONB for flexible metadata columns. Connection pooling via pg-pool with per-tenant isolation.",tags:["database","postgres","schema"],workspaceId:"proj-alpha",createdAt:"2026-02-23T11:00:00Z",updatedAt:"2026-02-26T22:45:00Z",val:4},{id:"kn-error-handling",label:"Error Response Pattern",kind:"knowledge",category:"concept",content:"All API errors follow the shape { error: string, code: string, details?: unknown }. HTTP status codes map to: 400 (validation), 401 (unauthenticated), 403 (forbidden), 404 (not found), 409 (conflict), 429 (rate limited), 500 (internal).",tags:["api","errors","patterns"],workspaceId:"proj-alpha",createdAt:"2026-02-27T08:17:00Z",updatedAt:"2026-02-27T08:17:00Z",val:3},{id:"kn-rate-limiting",label:"Rate Limiting Strategy",kind:"knowledge",category:"concept",content:"Token-bucket algorithm with in-memory state per client IP. Default rate: 100 requests/minute, burst: 20. Returns 429 with Retry-After header. Redis adapter available for multi-instance deployments.",tags:["api","rate-limiting","infrastructure"],workspaceId:"proj-alpha",createdAt:"2026-02-27T09:00:00Z",updatedAt:"2026-02-27T09:00:00Z",val:2},{id:"kn-etl-pipeline",label:"ETL Pipeline Architecture",kind:"knowledge",category:"concept",content:"Data pipelines follow an Extract-Transform-Load pattern with pluggable stages. Each stage reads from a source (Postgres, S3, API), transforms via configurable mappers, and loads into a target (Parquet, BigQuery, S3). Incremental loads use high-watermark tracking.",tags:["etl","pipeline","architecture"],workspaceId:"proj-beta",createdAt:"2026-02-26T08:00:00Z",updatedAt:"2026-02-27T09:05:00Z",val:4},{id:"kn-parquet-format",label:"Parquet Output Format",kind:"knowledge",category:"concept",content:"Parquet files are written with row-group buffering (configurable batch size, default 10000 rows). Supports Snappy, ZSTD, and GZIP compression. Schema is derived from the internal column type system using Arrow type mapping.",tags:["parquet","data-format","compression"],workspaceId:"proj-beta",createdAt:"2026-02-26T08:05:00Z",updatedAt:"2026-02-26T08:15:00Z",val:3},{id:"kn-jwt-over-session",label:"JWT over Session Auth",kind:"knowledge",category:"decision",content:"Chose JWT tokens over server-side sessions for stateless auth. Rationale: (1) no session store needed, (2) works across microservices without shared state, (3) supports mobile clients natively. Trade-off: tokens can't be revoked instantly (mitigated by short expiry + refresh rotation).",tags:["auth","decision","jwt"],workspaceId:"proj-alpha",createdAt:"2026-02-25T10:00:00Z",updatedAt:"2026-02-25T10:00:00Z",val:3},{id:"kn-pg-pool-decision",label:"pg-pool over Knex",kind:"knowledge",category:"decision",content:"Chose pg-pool over Knex for connection pooling. pg-pool gives direct control over idle timeout, max connections, and health check queries. Knex wraps pg-pool and adds query-building overhead we don't need since we write raw SQL with parameterized queries.",tags:["database","decision","postgres"],workspaceId:"proj-alpha",createdAt:"2026-02-23T11:30:00Z",updatedAt:"2026-02-23T11:30:00Z",val:2},{id:"kn-watermark-decision",label:"Local Watermark Storage",kind:"knowledge",category:"decision",content:"Currently using local SQLite for watermark storage. This works for single-worker pipelines but needs to move to a shared store (Redis or Postgres) for production multi-worker scenarios. Tracked as a follow-up task.",tags:["pipeline","decision","watermarks"],workspaceId:"proj-beta",createdAt:"2026-02-27T09:05:00Z",updatedAt:"2026-02-27T09:05:00Z",val:2},{id:"kn-jwt-middleware",label:"JWT Verify Middleware",kind:"knowledge",category:"snippet",content:`\`\`\`typescript
|
|
275
|
-
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
276
|
-
const header = req.headers.authorization;
|
|
277
|
-
if (!header?.startsWith("Bearer ")) {
|
|
278
|
-
res.status(401).json({ error: "Missing token" });
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
const decoded = jwt.verify(header.slice(7), JWT_SECRET) as JwtPayload;
|
|
282
|
-
req.user = decoded;
|
|
283
|
-
next();
|
|
284
|
-
}
|
|
285
|
-
\`\`\``,tags:["auth","jwt","middleware","typescript"],workspaceId:"proj-alpha",createdAt:"2026-02-27T08:15:14Z",updatedAt:"2026-02-27T08:15:14Z",val:2},{id:"kn-audit-schema",label:"Audit Log Schema",kind:"knowledge",category:"snippet",content:`\`\`\`sql
|
|
286
|
-
CREATE TABLE audit_log (
|
|
287
|
-
id BIGSERIAL PRIMARY KEY,
|
|
288
|
-
user_id UUID REFERENCES users(id),
|
|
289
|
-
action TEXT NOT NULL,
|
|
290
|
-
entity_type TEXT NOT NULL,
|
|
291
|
-
entity_id TEXT NOT NULL,
|
|
292
|
-
old_value JSONB,
|
|
293
|
-
new_value JSONB,
|
|
294
|
-
ip_address INET,
|
|
295
|
-
created_at TIMESTAMPTZ DEFAULT now()
|
|
296
|
-
);
|
|
297
|
-
\`\`\``,tags:["database","audit","schema","sql"],workspaceId:"proj-alpha",createdAt:"2026-02-26T22:45:15Z",updatedAt:"2026-02-26T22:45:15Z",val:2},{id:"kn-n1-query",label:"N+1 Query in User List",kind:"knowledge",category:"insight",content:"GET /api/users performs a separate query for each user's role metadata, resulting in N+1 queries. For 500 users this adds ~2 seconds of latency. Solution: use a JOIN or batch lookup to fetch all role data in a single query.",tags:["performance","database","n+1"],workspaceId:"proj-alpha",createdAt:"2026-02-22T09:30:00Z",updatedAt:"2026-02-22T09:30:00Z",val:2},{id:"kn-session-race",label:"Session Cleanup Race Condition",kind:"knowledge",category:"insight",content:"When two concurrent requests hit /api/logout, the second call throws a 500 because the session row has already been deleted. Fix: use DELETE ... RETURNING or add IF EXISTS guard to make the operation idempotent.",tags:["bug","concurrency","sessions"],workspaceId:"proj-alpha",createdAt:"2026-02-26T22:50:00Z",updatedAt:"2026-02-26T22:50:00Z",val:2},{id:"kn-ref-task-001",label:"JWT Auth Task",kind:"reference",sourceType:"task",sourceId:"task-001",content:"Implement JWT authentication across all protected routes, replacing session-based auth.",workspaceId:"proj-alpha",createdAt:"2026-02-25T10:00:00Z",updatedAt:"2026-02-27T08:15:00Z",val:3},{id:"kn-ref-task-006",label:"Parquet Export Task",kind:"reference",sourceType:"task",sourceId:"task-006",content:"Add Parquet export support for pipeline outputs, enabling downstream Spark consumption.",workspaceId:"proj-beta",createdAt:"2026-02-26T08:00:00Z",updatedAt:"2026-02-27T09:00:00Z",val:3},{id:"kn-ref-sess-001",label:"Auth Middleware Session",kind:"reference",sourceType:"session",sourceId:"sess-001",content:"Active session implementing JWT auth middleware, rewrote auth.ts, login.ts, and test suite.",workspaceId:"proj-alpha",createdAt:"2026-02-27T08:15:00Z",updatedAt:"2026-02-27T08:15:42Z",val:2}],Ma=[{source:"kn-auth-flow",target:"kn-jwt-over-session",type:"decided_by"},{source:"kn-auth-flow",target:"kn-jwt-middleware",type:"implemented_by"},{source:"kn-auth-flow",target:"kn-ref-task-001",type:"tracked_in"},{source:"kn-auth-flow",target:"kn-error-handling",type:"relates_to"},{source:"kn-jwt-over-session",target:"kn-ref-task-001",type:"motivated_by"},{source:"kn-db-schema",target:"kn-pg-pool-decision",type:"decided_by"},{source:"kn-db-schema",target:"kn-audit-schema",type:"contains"},{source:"kn-db-schema",target:"kn-n1-query",type:"affected_by"},{source:"kn-db-schema",target:"kn-session-race",type:"affected_by"},{source:"kn-rate-limiting",target:"kn-error-handling",type:"relates_to"},{source:"kn-rate-limiting",target:"kn-auth-flow",type:"depends_on"},{source:"kn-etl-pipeline",target:"kn-parquet-format",type:"outputs_to"},{source:"kn-etl-pipeline",target:"kn-watermark-decision",type:"decided_by"},{source:"kn-etl-pipeline",target:"kn-ref-task-006",type:"tracked_in"},{source:"kn-parquet-format",target:"kn-ref-task-006",type:"tracked_in"},{source:"kn-watermark-decision",target:"kn-etl-pipeline",type:"relates_to"},{source:"kn-ref-task-001",target:"kn-ref-sess-001",type:"has_session"},{source:"kn-jwt-middleware",target:"kn-ref-sess-001",type:"created_in"},{source:"kn-audit-schema",target:"kn-db-schema",type:"part_of"}],Tz=new Map(ks.map(t=>[t.id,t]));function kp(t){const s=Tz.get(t);if(!s)throw new Error(`MOCK_KNOWLEDGE_NODES is missing node "${t}"`);return s}const Gb={"kn-auth-flow":{node:kp("kn-auth-flow"),edges:[{fromId:"kn-auth-flow",toId:"kn-jwt-over-session",type:"decided_by"},{fromId:"kn-auth-flow",toId:"kn-jwt-middleware",type:"implemented_by"},{fromId:"kn-auth-flow",toId:"kn-ref-task-001",type:"tracked_in"},{fromId:"kn-auth-flow",toId:"kn-error-handling",type:"relates_to"},{fromId:"kn-rate-limiting",toId:"kn-auth-flow",type:"depends_on"}]},"kn-db-schema":{node:kp("kn-db-schema"),edges:[{fromId:"kn-db-schema",toId:"kn-pg-pool-decision",type:"decided_by"},{fromId:"kn-db-schema",toId:"kn-audit-schema",type:"contains"},{fromId:"kn-db-schema",toId:"kn-n1-query",type:"affected_by"},{fromId:"kn-db-schema",toId:"kn-session-race",type:"affected_by"},{fromId:"kn-audit-schema",toId:"kn-db-schema",type:"part_of"}]},"kn-etl-pipeline":{node:kp("kn-etl-pipeline"),edges:[{fromId:"kn-etl-pipeline",toId:"kn-parquet-format",type:"outputs_to"},{fromId:"kn-etl-pipeline",toId:"kn-watermark-decision",type:"decided_by"},{fromId:"kn-etl-pipeline",toId:"kn-ref-task-006",type:"tracked_in"},{fromId:"kn-watermark-decision",toId:"kn-etl-pipeline",type:"relates_to"}]}},wz=[{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}],jz=[{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:"copilot",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:"codex",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}],Nz=[{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T14:00:01Z",content:"running"},{sessionId:"sess-001-prev",eventType:"system",timestamp:"2026-02-26T14:00:02Z",content:`You are a senior backend engineer. Focus on security best practices and thorough testing.
|
|
298
|
-
Project: acme/alpha — Node.js + Express REST API
|
|
299
|
-
Task: Implement auth middleware using JWT tokens`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-001-prev",eventType:"text",timestamp:"2026-02-26T14:00:05Z",content:"I'll start by reading the current authentication middleware to understand what needs to change."},{sessionId:"sess-001-prev",eventType:"tool_use",timestamp:"2026-02-26T14:00:06Z",content:JSON.stringify({tool:"Read",args:{file_path:"src/middleware/auth.ts"}}),raw:JSON.stringify({id:"tu-prev-001",type:"tool_use"})},{sessionId:"sess-001-prev",eventType:"tool_result",timestamp:"2026-02-26T14:00:07Z",content:`import session from "express-session";
|
|
300
|
-
import type { Request, Response, NextFunction } from "express";
|
|
301
|
-
|
|
302
|
-
export function requireAuth(req: Request, res: Response, next: NextFunction): void {
|
|
303
|
-
if (!req.session?.userId) {
|
|
304
|
-
res.status(401).json({ error: "Not authenticated" });
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
next();
|
|
308
|
-
}`,raw:JSON.stringify({tool_use_id:"tu-prev-001"})},{sessionId:"sess-001-prev",eventType:"text",timestamp:"2026-02-26T14:00:10Z",content:"The current auth uses express-session with server-side session storage. Let me find all files that depend on this pattern."},{sessionId:"sess-001-prev",eventType:"tool_use",timestamp:"2026-02-26T14:00:11Z",content:JSON.stringify({tool:"Grep",args:{pattern:"req\\.session",path:"src/"}}),raw:JSON.stringify({id:"tu-prev-002",type:"tool_use"})},{sessionId:"sess-001-prev",eventType:"tool_result",timestamp:"2026-02-26T14:00:12Z",content:`src/middleware/auth.ts:4: if (!req.session?.userId) {
|
|
309
|
-
src/routes/login.ts:18: req.session.userId = user.id;
|
|
310
|
-
src/routes/login.ts:19: req.session.role = user.role;
|
|
311
|
-
src/routes/protected.ts:7: const userId = req.session.userId;`,raw:JSON.stringify({tool_use_id:"tu-prev-002"})},{sessionId:"sess-001-prev",eventType:"usage",timestamp:"2026-02-26T14:30:00Z",content:JSON.stringify({input_tokens:42100,output_tokens:6350,cost_usd:.21})},{sessionId:"sess-001-prev",eventType:"text",timestamp:"2026-02-26T14:30:02Z",content:"Found 3 files using session-based auth. Now let me read the login route and the protected route to understand the full flow before making changes."},{sessionId:"sess-001-prev",eventType:"tool_use",timestamp:"2026-02-26T14:30:03Z",content:JSON.stringify({tool:"Read",args:{file_path:"src/routes/login.ts"}}),raw:JSON.stringify({id:"tu-prev-003",type:"tool_use"})},{sessionId:"sess-001-prev",eventType:"tool_result",timestamp:"2026-02-26T14:30:04Z",content:`import { Router } from "express";
|
|
312
|
-
import bcrypt from "bcrypt";
|
|
313
|
-
import { db } from "../db.js";
|
|
314
|
-
|
|
315
|
-
const router = Router();
|
|
316
|
-
|
|
317
|
-
router.post("/login", async (req, res) => {
|
|
318
|
-
const { email, password } = req.body;
|
|
319
|
-
const user = await db.users.findByEmail(email);
|
|
320
|
-
if (!user || !await bcrypt.compare(password, user.passwordHash)) {
|
|
321
|
-
return res.status(401).json({ error: "Invalid credentials" });
|
|
322
|
-
}
|
|
323
|
-
req.session.userId = user.id;
|
|
324
|
-
req.session.role = user.role;
|
|
325
|
-
res.json({ ok: true });
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
export default router;`,raw:JSON.stringify({tool_use_id:"tu-prev-003"})},{sessionId:"sess-001-prev",eventType:"error",timestamp:"2026-02-26T15:12:00Z",content:"Context window exceeded before completing implementation"},{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T15:12:01Z",content:"interrupted"},{sessionId:"sess-001",eventType:"status",timestamp:"2026-02-27T08:15:01Z",content:"running"},{sessionId:"sess-001",eventType:"system",timestamp:"2026-02-27T08:15:02Z",content:`You are a senior backend engineer. Focus on security best practices and thorough testing.
|
|
329
|
-
Project: acme/alpha — Node.js + Express REST API
|
|
330
|
-
Task: Implement auth middleware using JWT tokens
|
|
331
|
-
|
|
332
|
-
Note: A previous session attempted this task but was interrupted. Pick up where it left off.`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:04Z",content:"I'll pick up the JWT auth migration. The previous session identified 3 files that need updating. Let me verify the current state and start implementing."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:04.5Z",content:JSON.stringify({tool:"TodoWrite",args:{todos:[{content:"Install jsonwebtoken package",activeForm:"Installing jsonwebtoken",status:"pending"},{content:"Rewrite auth middleware for JWT",activeForm:"Rewriting auth middleware",status:"pending"},{content:"Update login route to issue tokens",activeForm:"Updating login route",status:"pending"},{content:"Update protected routes",activeForm:"Updating protected routes",status:"pending"},{content:"Fix and update tests",activeForm:"Fixing tests",status:"pending"},{content:"Run full test suite",activeForm:"Running tests",status:"pending"}]}})},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:05Z",content:JSON.stringify({tool:"Grep",args:{pattern:"express-session|req\\.session",path:"src/",output_mode:"files_with_matches"}}),raw:JSON.stringify({id:"tu-001-01",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:06Z",content:`src/middleware/auth.ts
|
|
333
|
-
src/routes/login.ts
|
|
334
|
-
src/routes/protected.ts`,raw:JSON.stringify({tool_use_id:"tu-001-01"})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:08Z",content:"Good, same 3 files. Let me install the JWT library first, then rewrite the middleware."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:09Z",content:JSON.stringify({tool:"Bash",args:{command:"npm install jsonwebtoken && npm install -D @types/jsonwebtoken"}}),raw:JSON.stringify({id:"tu-001-02",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:11Z",content:`added 12 packages in 3.2s
|
|
335
|
-
|
|
336
|
-
added 1 package in 0.8s`,raw:JSON.stringify({tool_use_id:"tu-001-02"})},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:11.5Z",content:JSON.stringify({tool:"TodoWrite",args:{todos:[{content:"Install jsonwebtoken package",activeForm:"Installing jsonwebtoken",status:"completed"},{content:"Rewrite auth middleware for JWT",activeForm:"Rewriting auth middleware",status:"in_progress"},{content:"Update login route to issue tokens",activeForm:"Updating login route",status:"pending"},{content:"Update protected routes",activeForm:"Updating protected routes",status:"pending"},{content:"Fix and update tests",activeForm:"Fixing tests",status:"pending"},{content:"Run full test suite",activeForm:"Running tests",status:"pending"}]}})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:12Z",content:"Now I'll rewrite the auth middleware to use JWT verification instead of session checks."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:13Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/middleware/auth.ts",content:`import jwt from "jsonwebtoken";
|
|
337
|
-
import type { Request, Response, NextFunction } from "express";
|
|
338
|
-
|
|
339
|
-
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
340
|
-
|
|
341
|
-
export interface JwtPayload {
|
|
342
|
-
userId: string;
|
|
343
|
-
role: string;
|
|
344
|
-
iat: number;
|
|
345
|
-
exp: number;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
349
|
-
const header = req.headers.authorization;
|
|
350
|
-
if (!header?.startsWith("Bearer ")) {
|
|
351
|
-
res.status(401).json({ error: "Missing or malformed token" });
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
try {
|
|
355
|
-
const decoded = jwt.verify(header.slice(7), JWT_SECRET) as JwtPayload;
|
|
356
|
-
req.user = decoded;
|
|
357
|
-
next();
|
|
358
|
-
} catch (err) {
|
|
359
|
-
if (err instanceof jwt.TokenExpiredError) {
|
|
360
|
-
res.status(401).json({ error: "Token expired" });
|
|
361
|
-
} else {
|
|
362
|
-
res.status(403).json({ error: "Invalid token" });
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
`}}),raw:JSON.stringify({id:"tu-001-03",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:14Z",content:"File written: src/middleware/auth.ts (32 lines)",raw:JSON.stringify({tool_use_id:"tu-001-03"})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:16Z",content:`Now I need to update the login route to issue JWT tokens instead of setting session data.
|
|
367
|
-
|
|
368
|
-
The new login flow will:
|
|
369
|
-
1. Validate credentials (unchanged)
|
|
370
|
-
2. Generate a JWT with \`userId\` and \`role\` claims
|
|
371
|
-
3. Return the token in the response body
|
|
372
|
-
4. Include a refresh token for long-lived sessions`},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:17Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/routes/login.ts",content:`import { Router } from "express";
|
|
373
|
-
import bcrypt from "bcrypt";
|
|
374
|
-
import jwt from "jsonwebtoken";
|
|
375
|
-
import crypto from "node:crypto";
|
|
376
|
-
import { db } from "../db.js";
|
|
377
|
-
|
|
378
|
-
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
379
|
-
const ACCESS_TOKEN_EXPIRY = "24h";
|
|
380
|
-
const REFRESH_TOKEN_BYTES = 48;
|
|
381
|
-
|
|
382
|
-
const router = Router();
|
|
383
|
-
|
|
384
|
-
router.post("/login", async (req, res) => {
|
|
385
|
-
const { email, password } = req.body;
|
|
386
|
-
const user = await db.users.findByEmail(email);
|
|
387
|
-
if (!user || !(await bcrypt.compare(password, user.passwordHash))) {
|
|
388
|
-
return res.status(401).json({ error: "Invalid credentials" });
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
const accessToken = jwt.sign(
|
|
392
|
-
{ userId: user.id, role: user.role },
|
|
393
|
-
JWT_SECRET,
|
|
394
|
-
{ expiresIn: ACCESS_TOKEN_EXPIRY },
|
|
395
|
-
);
|
|
396
|
-
|
|
397
|
-
const refreshToken = crypto.randomBytes(REFRESH_TOKEN_BYTES).toString("hex");
|
|
398
|
-
await db.refreshTokens.create({ userId: user.id, token: refreshToken });
|
|
399
|
-
|
|
400
|
-
res.json({ accessToken, refreshToken, expiresIn: ACCESS_TOKEN_EXPIRY });
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
export default router;
|
|
404
|
-
`}}),raw:JSON.stringify({id:"tu-001-04",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:18Z",content:"File written: src/routes/login.ts (33 lines)",raw:JSON.stringify({tool_use_id:"tu-001-04"})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:20Z",content:"Let me update the protected route to use the new `req.user` shape from the JWT payload."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:21Z",content:JSON.stringify({tool:"Edit",args:{file_path:"src/routes/protected.ts",old_string:"const userId = req.session.userId;",new_string:"const { userId } = req.user as JwtPayload;"}}),raw:JSON.stringify({id:"tu-001-05",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:22Z",content:"Updated src/routes/protected.ts",raw:JSON.stringify({tool_use_id:"tu-001-05"})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:24Z",content:"Now let me run the existing tests to make sure nothing is broken, then I'll add new JWT-specific tests."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:25Z",content:JSON.stringify({tool:"Bash",args:{command:"npm test"}}),raw:JSON.stringify({id:"tu-001-06",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:30Z",content:` PASS src/routes/__tests__/login.test.ts
|
|
405
|
-
PASS src/routes/__tests__/protected.test.ts
|
|
406
|
-
FAIL src/middleware/__tests__/auth.test.ts
|
|
407
|
-
x should reject missing session (12ms)
|
|
408
|
-
x should allow valid session (8ms)
|
|
409
|
-
|
|
410
|
-
2 failed, 12 passed, 14 total
|
|
411
|
-
|
|
412
|
-
Test Suites: 1 failed, 2 passed, 3 total`,raw:JSON.stringify({tool_use_id:"tu-001-06",is_error:!0})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:32Z",content:`Two tests failed because they still test the old session-based auth. I need to rewrite those tests for JWT.
|
|
413
|
-
|
|
414
|
-
Let me update the auth middleware tests:`},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:33Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/middleware/__tests__/auth.test.ts",content:`import { describe, it, expect } from "vitest";
|
|
415
|
-
import jwt from "jsonwebtoken";
|
|
416
|
-
import { verifyToken } from "../auth.js";
|
|
417
|
-
import { createMockReqRes } from "../../test-utils/mock-express.js";
|
|
418
|
-
|
|
419
|
-
const SECRET = "test-secret";
|
|
420
|
-
process.env.JWT_SECRET = SECRET;
|
|
421
|
-
|
|
422
|
-
describe("verifyToken", () => {
|
|
423
|
-
it("should reject requests without Authorization header", () => {
|
|
424
|
-
const { req, res, next } = createMockReqRes();
|
|
425
|
-
verifyToken(req, res, next);
|
|
426
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
427
|
-
});
|
|
428
|
-
|
|
429
|
-
it("should reject expired tokens", () => {
|
|
430
|
-
const token = jwt.sign({ userId: "u1", role: "user" }, SECRET, { expiresIn: "-1h" });
|
|
431
|
-
const { req, res, next } = createMockReqRes({ authorization: \`Bearer \${token}\` });
|
|
432
|
-
verifyToken(req, res, next);
|
|
433
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
434
|
-
});
|
|
435
|
-
|
|
436
|
-
it("should accept valid tokens and attach user to request", () => {
|
|
437
|
-
const token = jwt.sign({ userId: "u1", role: "admin" }, SECRET, { expiresIn: "1h" });
|
|
438
|
-
const { req, res, next } = createMockReqRes({ authorization: \`Bearer \${token}\` });
|
|
439
|
-
verifyToken(req, res, next);
|
|
440
|
-
expect(next).toHaveBeenCalled();
|
|
441
|
-
expect(req.user).toMatchObject({ userId: "u1", role: "admin" });
|
|
442
|
-
});
|
|
443
|
-
});
|
|
444
|
-
`}}),raw:JSON.stringify({id:"tu-001-07",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:34Z",content:"File written: src/middleware/__tests__/auth.test.ts (32 lines)",raw:JSON.stringify({tool_use_id:"tu-001-07"})},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:35Z",content:JSON.stringify({tool:"Bash",args:{command:"npm test"}}),raw:JSON.stringify({id:"tu-001-08",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:40Z",content:` PASS src/routes/__tests__/login.test.ts
|
|
445
|
-
PASS src/routes/__tests__/protected.test.ts
|
|
446
|
-
PASS src/middleware/__tests__/auth.test.ts
|
|
447
|
-
|
|
448
|
-
Test Suites: 3 passed, 3 total
|
|
449
|
-
Tests: 14 passed, 14 total`,raw:JSON.stringify({tool_use_id:"tu-001-08"})},{sessionId:"sess-001",eventType:"usage",timestamp:"2026-02-27T08:15:41Z",content:JSON.stringify({input_tokens:42600,output_tokens:8100,cost_usd:.22})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:42Z",content:`All 14 tests pass. Here's a summary of the changes:
|
|
450
|
-
|
|
451
|
-
### Changes made
|
|
452
|
-
|
|
453
|
-
| File | Action |
|
|
454
|
-
|------|--------|
|
|
455
|
-
| \`src/middleware/auth.ts\` | Rewrote to verify JWT Bearer tokens |
|
|
456
|
-
| \`src/routes/login.ts\` | Now issues JWT access + refresh tokens |
|
|
457
|
-
| \`src/routes/protected.ts\` | Updated to read \`req.user\` from JWT payload |
|
|
458
|
-
| \`src/middleware/__tests__/auth.test.ts\` | Updated tests for JWT verification |
|
|
459
|
-
|
|
460
|
-
### Key decisions
|
|
461
|
-
- **Access token expiry**: 24 hours (configurable via \`JWT_SECRET\` env var)
|
|
462
|
-
- **Refresh tokens**: 48-byte random hex, stored in DB
|
|
463
|
-
- **Error handling**: Distinguishes expired tokens (401) from invalid tokens (403)`},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"system",timestamp:"2026-02-27T07:30:02Z",content:`You are a QA engineer. Write comprehensive tests covering happy paths, edge cases, error scenarios, and security.
|
|
464
|
-
Project: acme/alpha — Node.js + Express REST API
|
|
465
|
-
Task: Write unit tests for the user registration endpoint`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-002",eventType:"text",timestamp:"2026-02-27T07:30:04Z",content:"I'll write thorough tests for `POST /api/register`. Let me first read the registration endpoint to understand its behavior."},{sessionId:"sess-002",eventType:"tool_use",timestamp:"2026-02-27T07:30:05Z",content:JSON.stringify({tool:"Read",args:{file_path:"src/routes/register.ts"}}),raw:JSON.stringify({id:"tu-002-01",type:"tool_use"})},{sessionId:"sess-002",eventType:"tool_result",timestamp:"2026-02-27T07:30:06Z",content:`import { Router } from "express";
|
|
466
|
-
import bcrypt from "bcrypt";
|
|
467
|
-
import { db } from "../db.js";
|
|
468
|
-
import { validateEmail, validatePassword } from "../utils/validators.js";
|
|
469
|
-
|
|
470
|
-
const SALT_ROUNDS = 12;
|
|
471
|
-
const router = Router();
|
|
472
|
-
|
|
473
|
-
router.post("/register", async (req, res) => {
|
|
474
|
-
const { name, email, password } = req.body;
|
|
475
|
-
|
|
476
|
-
if (!name || !email || !password) {
|
|
477
|
-
return res.status(400).json({ error: "Missing required fields" });
|
|
478
|
-
}
|
|
479
|
-
if (!validateEmail(email)) {
|
|
480
|
-
return res.status(400).json({ error: "Invalid email format" });
|
|
481
|
-
}
|
|
482
|
-
if (!validatePassword(password)) {
|
|
483
|
-
return res.status(400).json({ error: "Password too weak" });
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
const existing = await db.users.findByEmail(email);
|
|
487
|
-
if (existing) {
|
|
488
|
-
return res.status(409).json({ error: "Email already registered" });
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
const passwordHash = await bcrypt.hash(password, SALT_ROUNDS);
|
|
492
|
-
const user = await db.users.create({ name, email, passwordHash });
|
|
493
|
-
res.status(201).json({ id: user.id, name: user.name, email: user.email });
|
|
494
|
-
});
|
|
495
|
-
|
|
496
|
-
export default router;`,raw:JSON.stringify({tool_use_id:"tu-002-01"})},{sessionId:"sess-002",eventType:"text",timestamp:"2026-02-27T07:30:10Z",content:`Good. The endpoint validates input, checks for duplicates, hashes the password, and creates the user. I'll write tests covering:
|
|
497
|
-
|
|
498
|
-
1. **Happy path** - valid registration
|
|
499
|
-
2. **Missing fields** - each required field missing
|
|
500
|
-
3. **Invalid email** - malformed email format
|
|
501
|
-
4. **Weak password** - password validation failure
|
|
502
|
-
5. **Duplicate email** - conflict with existing user
|
|
503
|
-
6. **SQL injection** - malicious email input
|
|
504
|
-
7. **XSS payload** - HTML in the name field
|
|
505
|
-
8. **Response shape** - correct status codes and body structure`},{sessionId:"sess-002",eventType:"tool_use",timestamp:"2026-02-27T07:30:12Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/routes/__tests__/register.test.ts",content:"// [test content - 8 test cases as described above]"}}),raw:JSON.stringify({id:"tu-002-02",type:"tool_use"})},{sessionId:"sess-002",eventType:"tool_result",timestamp:"2026-02-27T07:30:13Z",content:"File written: src/routes/__tests__/register.test.ts (142 lines)",raw:JSON.stringify({tool_use_id:"tu-002-02"})},{sessionId:"sess-002",eventType:"tool_use",timestamp:"2026-02-27T07:31:00Z",content:JSON.stringify({tool:"Bash",args:{command:"npm test -- --testPathPattern=register"}}),raw:JSON.stringify({id:"tu-002-03",type:"tool_use"})},{sessionId:"sess-002",eventType:"tool_result",timestamp:"2026-02-27T07:31:30Z",content:` PASS src/routes/__tests__/register.test.ts
|
|
506
|
-
POST /api/register
|
|
507
|
-
✓ should register a valid user (28ms)
|
|
508
|
-
✓ should reject missing name (4ms)
|
|
509
|
-
✓ should reject missing email (3ms)
|
|
510
|
-
✓ should reject missing password (3ms)
|
|
511
|
-
✓ should reject invalid email format (5ms)
|
|
512
|
-
✓ should reject weak password (4ms)
|
|
513
|
-
✓ should reject duplicate email (12ms)
|
|
514
|
-
✓ should sanitize HTML in name field (6ms)
|
|
515
|
-
|
|
516
|
-
Tests: 8 passed, 8 total`,raw:JSON.stringify({tool_use_id:"tu-002-03"})},{sessionId:"sess-002",eventType:"usage",timestamp:"2026-02-27T07:32:00Z",content:JSON.stringify({input_tokens:31400,output_tokens:9800,cost_usd:.18})},{sessionId:"sess-002",eventType:"text",timestamp:"2026-02-27T07:32:30Z",content:"All 8 test cases pass. Created `src/routes/__tests__/register.test.ts` with comprehensive coverage for the registration endpoint including input validation, duplicate detection, and security edge cases."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"},{sessionId:"sess-003",eventType:"status",timestamp:"2026-02-26T22:45:01Z",content:"running"},{sessionId:"sess-003",eventType:"system",timestamp:"2026-02-26T22:45:02Z",content:`You are a database engineer. Focus on safe migrations, zero-downtime deployments, and data integrity.
|
|
517
|
-
Project: acme/alpha — Node.js + Express + PostgreSQL
|
|
518
|
-
Task: Add audit_log table and migrate schema`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-003",eventType:"text",timestamp:"2026-02-26T22:45:05Z",content:"I need to add an `audit_log` table for tracking all write operations. Let me review the current schema first."},{sessionId:"sess-003",eventType:"tool_use",timestamp:"2026-02-26T22:45:06Z",content:JSON.stringify({tool:"Read",args:{file_path:"migrations/001_initial.sql"}}),raw:JSON.stringify({id:"tu-003-01",type:"tool_use"})},{sessionId:"sess-003",eventType:"tool_result",timestamp:"2026-02-26T22:45:07Z",content:`CREATE TABLE users (
|
|
519
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
520
|
-
name TEXT NOT NULL,
|
|
521
|
-
email TEXT UNIQUE NOT NULL,
|
|
522
|
-
password_hash TEXT NOT NULL,
|
|
523
|
-
role TEXT DEFAULT 'user',
|
|
524
|
-
created_at TIMESTAMPTZ DEFAULT now(),
|
|
525
|
-
updated_at TIMESTAMPTZ DEFAULT now()
|
|
526
|
-
);
|
|
527
|
-
|
|
528
|
-
CREATE TABLE sessions (
|
|
529
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
530
|
-
user_id UUID REFERENCES users(id),
|
|
531
|
-
expires_at TIMESTAMPTZ NOT NULL,
|
|
532
|
-
created_at TIMESTAMPTZ DEFAULT now()
|
|
533
|
-
);`,raw:JSON.stringify({tool_use_id:"tu-003-01"})},{sessionId:"sess-003",eventType:"text",timestamp:"2026-02-26T22:45:12Z",content:"I see the schema. I'll create a migration that:\n1. Adds a `last_login_at` column to `users`\n2. Adds an index on `sessions.expires_at` for efficient cleanup queries\n3. Creates the `audit_log` table\n\nLet me write the migration file:"},{sessionId:"sess-003",eventType:"tool_use",timestamp:"2026-02-26T22:45:14Z",content:JSON.stringify({tool:"Write",args:{file_path:"migrations/002_audit_log.sql",content:`-- Migration: 002_audit_log
|
|
534
|
-
-- Add audit logging and user activity tracking
|
|
535
|
-
|
|
536
|
-
BEGIN;
|
|
537
|
-
|
|
538
|
-
-- 1. Add last_login_at to users
|
|
539
|
-
ALTER TABLE users ADD COLUMN last_login_at TIMESTAMPTZ;
|
|
540
|
-
|
|
541
|
-
-- 2. Index for session cleanup queries
|
|
542
|
-
CREATE INDEX CONCURRENTLY idx_sessions_expires_at ON sessions (expires_at);
|
|
543
|
-
|
|
544
|
-
-- 3. Audit log table
|
|
545
|
-
CREATE TABLE audit_log (
|
|
546
|
-
id BIGSERIAL PRIMARY KEY,
|
|
547
|
-
user_id UUID REFERENCES users(id),
|
|
548
|
-
action TEXT NOT NULL,
|
|
549
|
-
entity_type TEXT NOT NULL,
|
|
550
|
-
entity_id TEXT NOT NULL,
|
|
551
|
-
old_value JSONB,
|
|
552
|
-
new_value JSONB,
|
|
553
|
-
ip_address INET,
|
|
554
|
-
created_at TIMESTAMPTZ DEFAULT now()
|
|
555
|
-
);
|
|
556
|
-
|
|
557
|
-
CREATE INDEX idx_audit_log_user ON audit_log (user_id);
|
|
558
|
-
CREATE INDEX idx_audit_log_entity ON audit_log (entity_type, entity_id);
|
|
559
|
-
CREATE INDEX idx_audit_log_created ON audit_log (created_at);
|
|
560
|
-
|
|
561
|
-
COMMIT;
|
|
562
|
-
`}}),raw:JSON.stringify({id:"tu-003-02",type:"tool_use"})},{sessionId:"sess-003",eventType:"tool_result",timestamp:"2026-02-26T22:45:15Z",content:"File written: migrations/002_audit_log.sql (29 lines)",raw:JSON.stringify({tool_use_id:"tu-003-02"})},{sessionId:"sess-003",eventType:"text",timestamp:"2026-02-26T22:46:00Z",content:"Now I need to implement the audit middleware that logs write operations. This will intercept POST, PUT, PATCH, and DELETE requests."},{sessionId:"sess-003",eventType:"tool_use",timestamp:"2026-02-26T22:46:02Z",content:JSON.stringify({tool:"Bash",args:{command:"npm run migrate -- --dry-run"}}),raw:JSON.stringify({id:"tu-003-03",type:"tool_use"})},{sessionId:"sess-003",eventType:"tool_result",timestamp:"2026-02-26T22:46:10Z",content:`Dry run: would apply 002_audit_log.sql
|
|
563
|
-
- ALTER TABLE users ADD COLUMN last_login_at
|
|
564
|
-
- CREATE INDEX CONCURRENTLY idx_sessions_expires_at
|
|
565
|
-
- CREATE TABLE audit_log
|
|
566
|
-
- 3 indexes on audit_log
|
|
567
|
-
|
|
568
|
-
WARNING: CREATE INDEX CONCURRENTLY cannot run inside a transaction block.
|
|
569
|
-
Please split this into a separate migration step.`,raw:JSON.stringify({tool_use_id:"tu-003-03",is_error:!0})},{sessionId:"sess-003",eventType:"text",timestamp:"2026-02-26T22:46:15Z",content:"Good catch from the dry run! `CREATE INDEX CONCURRENTLY` can't run inside a transaction. I need to split the migration into two files: one for the transactional DDL and another for the concurrent index creation."},{sessionId:"sess-003",eventType:"usage",timestamp:"2026-02-26T23:00:00Z",content:JSON.stringify({input_tokens:56300,output_tokens:14200,cost_usd:.31})},{sessionId:"sess-003",eventType:"status",timestamp:"2026-02-26T23:10:00Z",content:"interrupted"},{sessionId:"sess-004",eventType:"status",timestamp:"2026-02-27T09:00:01Z",content:"running"},{sessionId:"sess-004",eventType:"system",timestamp:"2026-02-27T09:00:02Z",content:`You are a backend engineer specializing in API infrastructure.
|
|
570
|
-
Project: acme/data-pipeline — ETL pipelines for analytics
|
|
571
|
-
Task: Implement rate limiting for the public API using a token-bucket algorithm`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-004",eventType:"text",timestamp:"2026-02-27T09:00:05Z",content:"I'll implement rate limiting using a token-bucket algorithm. Let me first survey the existing API infrastructure to find the right integration point."},{sessionId:"sess-004",eventType:"tool_use",timestamp:"2026-02-27T09:00:05.5Z",content:JSON.stringify({tool:"TodoWrite",args:{todos:[{content:"Survey middleware structure",activeForm:"Surveying middleware",status:"in_progress"},{content:"Implement token-bucket algorithm",activeForm:"Implementing token bucket",status:"pending"},{content:"Add rate limit middleware to app",activeForm:"Adding middleware",status:"pending"},{content:"Write tests for rate limiting",activeForm:"Writing tests",status:"pending"},{content:"Add Redis adapter for multi-instance",activeForm:"Adding Redis adapter",status:"pending"}]}})},{sessionId:"sess-004",eventType:"tool_use",timestamp:"2026-02-27T09:00:06Z",content:JSON.stringify({tool:"Glob",args:{pattern:"src/middleware/**/*.ts"}}),raw:JSON.stringify({id:"tu-004-01",type:"tool_use"})},{sessionId:"sess-004",eventType:"tool_result",timestamp:"2026-02-27T09:00:07Z",content:`src/middleware/cors.ts
|
|
572
|
-
src/middleware/error-handler.ts
|
|
573
|
-
src/middleware/logger.ts
|
|
574
|
-
src/middleware/request-id.ts`,raw:JSON.stringify({tool_use_id:"tu-004-01"})},{sessionId:"sess-004",eventType:"tool_use",timestamp:"2026-02-27T09:00:09Z",content:JSON.stringify({tool:"TodoWrite",args:{todos:[{content:"Survey middleware structure",activeForm:"Surveying middleware",status:"completed"},{content:"Implement token-bucket algorithm",activeForm:"Implementing token bucket",status:"in_progress"},{content:"Add rate limit middleware to app",activeForm:"Adding middleware",status:"pending"},{content:"Write tests for rate limiting",activeForm:"Writing tests",status:"pending"},{content:"Add Redis adapter for multi-instance",activeForm:"Adding Redis adapter",status:"pending"}]}})},{sessionId:"sess-004",eventType:"text",timestamp:"2026-02-27T09:00:10Z",content:`Good middleware structure already in place. I'll add a \`rate-limiter.ts\` module that:
|
|
575
|
-
|
|
576
|
-
- Uses an **in-memory token bucket** per client IP
|
|
577
|
-
- Supports configurable rate (requests/second) and burst size
|
|
578
|
-
- Returns \`429 Too Many Requests\` with \`Retry-After\` header
|
|
579
|
-
- Has a Redis adapter option for multi-instance deployments
|
|
580
|
-
|
|
581
|
-
Let me implement it:`},{sessionId:"sess-004",eventType:"tool_use",timestamp:"2026-02-27T09:00:12Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/middleware/rate-limiter.ts",content:"// Token bucket rate limiter implementation"}}),raw:JSON.stringify({id:"tu-004-02",type:"tool_use"})},{sessionId:"sess-004",eventType:"tool_result",timestamp:"2026-02-27T09:00:13Z",content:"File written: src/middleware/rate-limiter.ts (87 lines)",raw:JSON.stringify({tool_use_id:"tu-004-02"})},{sessionId:"sess-004",eventType:"text",timestamp:"2026-02-27T09:00:18Z",content:"Now I need to wire the rate limiter into the Express middleware stack. It should go after the request-ID middleware but before route handlers."},{sessionId:"sess-005",eventType:"status",timestamp:"2026-02-27T06:00:01Z",content:"running"},{sessionId:"sess-005",eventType:"system",timestamp:"2026-02-27T06:00:02Z",content:`You are a database specialist. Focus on connection management, performance, and multi-tenant isolation.
|
|
582
|
-
Project: acme/alpha — Node.js + Express + PostgreSQL
|
|
583
|
-
Task: Refactor database connection pooling for multi-tenant isolation`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-005",eventType:"text",timestamp:"2026-02-27T06:00:05Z",content:"I'll refactor the DB layer to support per-tenant connection pools. This is needed because the current single-pool design means one slow tenant can exhaust connections for everyone."},{sessionId:"sess-005",eventType:"tool_use",timestamp:"2026-02-27T06:00:06Z",content:JSON.stringify({tool:"Read",args:{file_path:"src/db/pool.ts"}}),raw:JSON.stringify({id:"tu-005-01",type:"tool_use"})},{sessionId:"sess-005",eventType:"tool_result",timestamp:"2026-02-27T06:00:07Z",content:`import pg from "pg";
|
|
584
|
-
|
|
585
|
-
const pool = new pg.Pool({
|
|
586
|
-
connectionString: process.env.DATABASE_URL,
|
|
587
|
-
max: 20,
|
|
588
|
-
idleTimeoutMillis: 30000,
|
|
589
|
-
});
|
|
590
|
-
|
|
591
|
-
export { pool };`,raw:JSON.stringify({tool_use_id:"tu-005-01"})},{sessionId:"sess-005",eventType:"text",timestamp:"2026-02-27T06:00:12Z",content:`The current pool is a single shared instance with \`max: 20\`. For multi-tenant isolation, I need:
|
|
592
|
-
|
|
593
|
-
1. **A \`PoolManager\` class** that creates and caches per-tenant pools
|
|
594
|
-
2. **Configurable limits** per tenant (max connections, idle timeout)
|
|
595
|
-
3. **Health checks** with automatic pool eviction for unhealthy connections
|
|
596
|
-
4. **Graceful shutdown** that drains all pools`},{sessionId:"sess-005",eventType:"tool_use",timestamp:"2026-02-27T06:00:14Z",content:JSON.stringify({tool:"Grep",args:{pattern:"import.*pool|from.*pool",path:"src/",output_mode:"content"}}),raw:JSON.stringify({id:"tu-005-02",type:"tool_use"})},{sessionId:"sess-005",eventType:"tool_result",timestamp:"2026-02-27T06:00:15Z",content:`src/db/index.ts:1:import { pool } from "./pool.js";
|
|
597
|
-
src/routes/users.ts:2:import { pool } from "../db/pool.js";
|
|
598
|
-
src/routes/register.ts:3:import { pool } from "../db/pool.js";
|
|
599
|
-
src/routes/admin.ts:4:import { pool } from "../db/pool.js";
|
|
600
|
-
src/services/billing.ts:2:import { pool } from "../db/pool.js";
|
|
601
|
-
src/services/analytics.ts:1:import { pool } from "../db/pool.js";`,raw:JSON.stringify({tool_use_id:"tu-005-02"})},{sessionId:"sess-005",eventType:"text",timestamp:"2026-02-27T06:00:20Z",content:`Six files import the pool directly. I'll need to:
|
|
602
|
-
1. Create a new \`PoolManager\` abstraction
|
|
603
|
-
2. Update all consumers to use \`getPool(tenantId)\` instead of the global pool
|
|
604
|
-
3. Add middleware to extract tenant ID from the request
|
|
605
|
-
|
|
606
|
-
This is a significant refactor. Let me start with the PoolManager class.`},{sessionId:"sess-005",eventType:"usage",timestamp:"2026-02-27T06:30:00Z",content:JSON.stringify({input_tokens:67800,output_tokens:19300,cost_usd:.38})},{sessionId:"sess-005",eventType:"status",timestamp:"2026-02-27T06:30:01Z",content:"suspended"}],Cz=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",environmentId:"env-local-01",linkedEnvironmentIds:["env-docker-01"],status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",tokenBudget:0,costBudgetMillicents:0,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",linkedEnvironmentIds:[],status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",tokenBudget:0,costBudgetMillicents:0,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",linkedEnvironmentIds:[],status:"archived",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",tokenBudget:0,costBudgetMillicents:0,createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],Ez=[{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:"",workpad:JSON.stringify({status:"in_progress",summary:"Design and implement JWT-based authentication with access/refresh tokens, replacing session-based auth.",extra:{approach:"Replace express-session with JWT Bearer tokens. Access tokens expire in 24h, refresh tokens stored in DB.",files_changed:["src/middleware/auth.ts","src/routes/login.ts","src/routes/protected.ts"],decisions:["Chose jsonwebtoken over jose for consistency with existing codebase","24h access token expiry — long enough for dev sessions, short enough for security","Refresh tokens are 48-byte random hex stored in DB with user association"],blockers:"Need to verify token rotation strategy with security team before merging"}}),tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:JSON.stringify({status:"in_progress",summary:"Plan for adding Parquet export support, including compression options and performance benchmarks.",extra:{approach:"Use apache-arrow npm package for Parquet write support. Map internal column types to Arrow type system.",compression:{supported:["snappy","zstd","gzip"],default:"snappy"},benchmarks:{"1M rows snappy":"2.3s","1M rows zstd":"3.1s","1M rows gzip":"4.8s"}}}),tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{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:"",workpad:"",tokenBudget:0,costBudgetMillicents:0}],Pc=[{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"}],Az=[{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:""}],Dz=[{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-6",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z",type:"agent",script:"",allowedMcpTools:["task_create","task_update","task_list","finding_post","finding_list","knowledge_search","knowledge_create_node","session_spawn"]},{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-6",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z",type:"agent",script:"",allowedMcpTools:[]},{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-6",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z",type:"agent",script:"",allowedMcpTools:["finding_post","finding_list","knowledge_search"]},{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-6",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z",type:"agent",script:"",allowedMcpTools:[]},{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));
|
|
607
|
-
for (const f of files) {
|
|
608
|
-
const eslintResult = await host.exec("npx", ["eslint", "--fix", f.filename]);
|
|
609
|
-
if (eslintResult.exitCode !== 0) {
|
|
610
|
-
env.findings.push({ category: "lint", title: \`Lint issues in \${f.filename}\`, content: eslintResult.stderr });
|
|
611
|
-
}
|
|
612
|
-
const prettierResult = await host.exec("npx", ["prettier", "--write", f.filename]);
|
|
613
|
-
if (prettierResult.exitCode !== 0) {
|
|
614
|
-
env.findings.push({ category: "format", title: \`Prettier issues in \${f.filename}\`, content: prettierResult.stderr });
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
env.findings.push({ category: "summary", title: "Lint & format pass complete", content: \`Ran ESLint and Prettier on \${files.length} files\` });`,allowedMcpTools:[]}],Rz={"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 Re(t){return new Date(Date.now()+t).toISOString()}const Fb=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Re(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Re(600),content:"I'll start by finding all API route files that need refactoring."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(1200),content:JSON.stringify({tool:"Glob",args:{pattern:"src/routes/**/*.ts"}}),raw:JSON.stringify({id:"stream-a-01",type:"tool_use"})}},{delayMs:1600,event:{eventType:"tool_result",timestamp:Re(1600),content:`src/routes/users.ts
|
|
618
|
-
src/routes/auth.ts
|
|
619
|
-
src/routes/billing.ts
|
|
620
|
-
src/routes/admin.ts
|
|
621
|
-
src/routes/health.ts`,raw:JSON.stringify({tool_use_id:"stream-a-01"})}},{delayMs:2200,event:{eventType:"text",timestamp:Re(2200),content:`Found 5 route files. Let me refactor users.ts to use Express Router with a middleware chain.
|
|
622
|
-
|
|
623
|
-
\`\`\`typescript
|
|
624
|
-
const router = Router();
|
|
625
|
-
router.use(authenticate);
|
|
626
|
-
router.use(validateBody);
|
|
627
|
-
|
|
628
|
-
router.get("/", listUsers);
|
|
629
|
-
router.post("/", createUser);
|
|
630
|
-
router.get("/:id", getUser);
|
|
631
|
-
router.put("/:id", updateUser);
|
|
632
|
-
router.delete("/:id", deleteUser);
|
|
633
|
-
\`\`\``}},{delayMs:3200,event:{eventType:"tool_use",timestamp:Re(3200),content:JSON.stringify({tool:"Bash",args:{command:"npm test -- --testPathPattern=routes"}}),raw:JSON.stringify({id:"stream-a-02",type:"tool_use"})}},{delayMs:4e3,event:{eventType:"tool_result",timestamp:Re(4e3),content:` PASS src/routes/__tests__/users.test.ts
|
|
634
|
-
PASS src/routes/__tests__/auth.test.ts
|
|
635
|
-
PASS src/routes/__tests__/billing.test.ts
|
|
636
|
-
|
|
637
|
-
Test Suites: 3 passed, 3 total
|
|
638
|
-
Tests: 22 passed, 22 total`,raw:JSON.stringify({tool_use_id:"stream-a-02"})}},{delayMs:4500,event:{eventType:"usage",timestamp:Re(4500),content:JSON.stringify({input_tokens:28400,output_tokens:7200,cost_usd:.15})}},{delayMs:5e3,event:{eventType:"text",timestamp:Re(5e3),content:"All 22 tests pass. The route refactoring is complete."}},{delayMs:5500,event:{eventType:"status",timestamp:Re(5500),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:4,steps:[{delayMs:0,event:{eventType:"status",timestamp:Re(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Re(600),content:"Scanning the current database schema to plan the migration."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(1200),content:JSON.stringify({tool:"Read",args:{file_path:"migrations/001_initial.sql"}}),raw:JSON.stringify({id:"stream-b-01",type:"tool_use"})}},{delayMs:1800,event:{eventType:"tool_result",timestamp:Re(1800),content:`CREATE TABLE users (
|
|
639
|
-
id UUID PRIMARY KEY,
|
|
640
|
-
name TEXT NOT NULL,
|
|
641
|
-
email TEXT UNIQUE NOT NULL,
|
|
642
|
-
created_at TIMESTAMPTZ DEFAULT now()
|
|
643
|
-
);
|
|
644
|
-
|
|
645
|
-
CREATE TABLE sessions (
|
|
646
|
-
id UUID PRIMARY KEY,
|
|
647
|
-
user_id UUID REFERENCES users(id),
|
|
648
|
-
expires_at TIMESTAMPTZ NOT NULL
|
|
649
|
-
);`,raw:JSON.stringify({tool_use_id:"stream-b-01"})}},{delayMs:2600,event:{eventType:"text",timestamp:Re(2600),content:`I found the tables to modify:
|
|
650
|
-
- **users**: add column \`last_login_at\`
|
|
651
|
-
- **sessions**: add index on \`expires_at\`
|
|
652
|
-
- **audit_log**: new table
|
|
653
|
-
|
|
654
|
-
This migration will add a NOT NULL column to the \`users\` table. The table has **50,000+ rows** which may lock the table briefly.
|
|
655
|
-
|
|
656
|
-
Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"text",timestamp:Re(0),content:"Proceeding with migration."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(700),content:JSON.stringify({tool:"Bash",args:{command:"npm run migrate"}}),raw:JSON.stringify({id:"stream-b-02",type:"tool_use"})}},{delayMs:2200,event:{eventType:"tool_result",timestamp:Re(1700),content:`Applying 002_add_last_login.sql... done
|
|
657
|
-
Applying 003_sessions_index.sql... done
|
|
658
|
-
Applying 004_audit_log.sql... done
|
|
659
|
-
|
|
660
|
-
3 migrations applied successfully.`,raw:JSON.stringify({tool_use_id:"stream-b-02"})}},{delayMs:2800,event:{eventType:"text",timestamp:Re(2300),content:"All 3 migrations applied successfully. The `audit_log` table is ready."}},{delayMs:3200,event:{eventType:"status",timestamp:Re(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Re(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Re(600),content:"I'll generate tests for `src/services/billing.ts`. Let me read the implementation first."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(1200),content:JSON.stringify({tool:"Read",args:{file_path:"src/services/billing.ts"}}),raw:JSON.stringify({id:"stream-c-01",type:"tool_use"})}},{delayMs:1800,event:{eventType:"tool_result",timestamp:Re(1800),content:`import { StripeClient } from "./stripe-client.js";
|
|
661
|
-
import type { Invoice, LineItem } from "../types/billing.js";
|
|
662
|
-
|
|
663
|
-
export class BillingService {
|
|
664
|
-
constructor(private stripe: StripeClient) {}
|
|
665
|
-
|
|
666
|
-
async calculateMonthlyTotal(userId: string): Promise<number> {
|
|
667
|
-
const invoices = await this.stripe.listInvoices(userId);
|
|
668
|
-
return invoices.reduce((sum, inv) => sum + inv.total, 0);
|
|
669
|
-
}
|
|
670
|
-
}`,raw:JSON.stringify({tool_use_id:"stream-c-01"})}},{delayMs:2400,event:{eventType:"text",timestamp:Re(2400),content:"The billing service imports from `./stripe-client.js`. Let me check if that module exists."}},{delayMs:2800,event:{eventType:"tool_use",timestamp:Re(2800),content:JSON.stringify({tool:"Read",args:{file_path:"src/services/stripe-client.ts"}}),raw:JSON.stringify({id:"stream-c-02",type:"tool_use"})}},{delayMs:3200,event:{eventType:"tool_result",timestamp:Re(3200),content:"Error: ENOENT: no such file or directory, open 'src/services/stripe-client.ts'",raw:JSON.stringify({tool_use_id:"stream-c-02",is_error:!0})}},{delayMs:3600,event:{eventType:"error",timestamp:Re(3600),content:"Cannot resolve import 'src/services/stripe-client.ts' — module not found. The billing service depends on a Stripe client that doesn't exist in this environment."}},{delayMs:4e3,event:{eventType:"status",timestamp:Re(4e3),content:"failed"}}]},{label:"Fix Auth Bug",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Re(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Re(600),content:"Let me investigate the authentication bug..."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(1200),content:JSON.stringify({tool:"Read",args:{file_path:"/src/middleware/auth.ts"}}),raw:JSON.stringify({id:"tool-mock-001"})}},{delayMs:1800,event:{eventType:"tool_result",timestamp:Re(1800),content:`import jwt from "jsonwebtoken";
|
|
671
|
-
import type { Request, Response, NextFunction } from "express";
|
|
672
|
-
|
|
673
|
-
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
674
|
-
|
|
675
|
-
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
676
|
-
const header = req.headers.authorization;
|
|
677
|
-
if (!header?.startsWith("Bearer ")) {
|
|
678
|
-
res.status(401).json({ error: "Missing token" });
|
|
679
|
-
return;
|
|
680
|
-
}
|
|
681
|
-
try {
|
|
682
|
-
const decoded = jwt.verify(header.slice(7), JWT_SECRET);
|
|
683
|
-
if (decoded.exp > Date.now() / 1000) {
|
|
684
|
-
res.status(403).json({ error: "Token expired" });
|
|
685
|
-
return;
|
|
686
|
-
}
|
|
687
|
-
req.user = decoded;
|
|
688
|
-
next();
|
|
689
|
-
} catch {
|
|
690
|
-
res.status(403).json({ error: "Invalid token" });
|
|
691
|
-
}
|
|
692
|
-
}`,raw:JSON.stringify({tool_use_id:"tool-mock-001",is_error:!1})}},{delayMs:2600,event:{eventType:"text",timestamp:Re(2600),content:"Found the issue — the token expiry check on line 14 is using `>` instead of `<`. A token is expired when `exp < now`, but the code checks `exp > now` which means it rejects *valid* tokens and accepts *expired* ones. Let me fix it."}},{delayMs:3400,event:{eventType:"tool_use",timestamp:Re(3400),content:JSON.stringify({tool:"Edit",args:{file_path:"/src/middleware/auth.ts",old_string:" if (decoded.exp > Date.now() / 1000) {",new_string:" if (decoded.exp < Date.now() / 1000) {"}}),raw:JSON.stringify({id:"tool-mock-002"})}},{delayMs:4e3,event:{eventType:"tool_result",timestamp:Re(4e3),content:"File updated successfully",raw:JSON.stringify({tool_use_id:"tool-mock-002",is_error:!1})}},{delayMs:4600,event:{eventType:"tool_use",timestamp:Re(4600),content:JSON.stringify({tool:"Bash",args:{command:"npm test -- --grep auth"}}),raw:JSON.stringify({id:"tool-mock-003"})}},{delayMs:5800,event:{eventType:"tool_result",timestamp:Re(5800),content:`[exit 0] > jest --grep auth
|
|
693
|
-
|
|
694
|
-
PASS src/auth.test.ts
|
|
695
|
-
✓ validates JWT token (12ms)
|
|
696
|
-
✓ rejects expired token (3ms)
|
|
697
|
-
✓ handles missing header (1ms)
|
|
698
|
-
|
|
699
|
-
Tests: 3 passed, 3 total
|
|
700
|
-
Time: 1.234s`,raw:JSON.stringify({tool_use_id:"tool-mock-003",is_error:!1})}},{delayMs:6400,event:{eventType:"tool_use",timestamp:Re(6400),content:JSON.stringify({tool:"Grep",args:{pattern:"decoded\\.exp",path:"src/"}}),raw:JSON.stringify({id:"tool-mock-004"})}},{delayMs:7e3,event:{eventType:"tool_result",timestamp:Re(7e3),content:`src/middleware/auth.ts:14: if (decoded.exp < Date.now() / 1000) {
|
|
701
|
-
src/utils/token-refresh.ts:28: const remaining = decoded.exp - Date.now() / 1000;`,raw:JSON.stringify({tool_use_id:"tool-mock-004",is_error:!1})}},{delayMs:7800,event:{eventType:"text",timestamp:Re(7800),content:"Fixed. The token expiry comparison was inverted — `decoded.exp > Date.now()` should have been `<` (a token is expired when its `exp` is in the past). The other occurrence in `token-refresh.ts` uses subtraction (not comparison), so it was already correct. All 3 auth tests pass."}},{delayMs:8400,event:{eventType:"usage",timestamp:Re(8400),content:JSON.stringify({input_tokens:42600,output_tokens:1850,cost_usd:.12})}},{delayMs:8800,event:{eventType:"status",timestamp:Re(8800),content:"completed"}}]}],_s={onConnect:async()=>{},onDisconnect:()=>{},handleEvent:()=>!1},Zb=400;function Mz({children:t}){const[s,o]=y.useState(wz),[r,c]=y.useState(jz),[d,u]=y.useState(Nz),[p,m]=y.useState(void 0),[g,v]=y.useState(Cz),[b,x]=y.useState(Ez),[S,k]=y.useState(Pc),[w,N]=y.useState(void 0),T=!1,[C,R]=y.useState(Az),[B,A]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[M,D]=y.useState(Dz),[z]=y.useState(Rz),[U,X]=y.useState(""),[Q,P]=y.useState(ks),[re,H]=y.useState(Ma),[oe,E]=y.useState(void 0),[F,ae]=y.useState(void 0),[me,de]=y.useState(""),Oe=y.useRef(void 0),ke=y.useRef(0),Ee=y.useRef(0),ze=y.useRef(new Set),ue=y.useRef(new Map),xe=y.useRef(b);xe.current=b;const he=y.useRef(new Map),Le=y.useRef(new Map),mt=y.useCallback(V=>(ke.current+=1,`mock-${V}-${String(ke.current).padStart(3,"0")}`),[]),vn=y.useCallback(()=>{const V=Fb[Ee.current%Fb.length];return Ee.current+=1,V},[]),se=y.useCallback((V,ne,le)=>{const fe=setTimeout(()=>{var ge;ze.current.delete(fe),le&&((ge=ue.current.get(le))==null||ge.delete(fe)),V()},ne);ze.current.add(fe),le&&(ue.current.has(le)||ue.current.set(le,new Set),ue.current.get(le).add(fe))},[]),qe=y.useCallback(V=>{const ne=ue.current.get(V);ne&&(ne.forEach(le=>{clearTimeout(le),ze.current.delete(le)}),ue.current.delete(V))},[]),Nt=y.useCallback((V,ne,le)=>{c(fe=>fe.map(ge=>ge.id===V?{...ge,status:ne,...le!==void 0?{endReason:le}:{}}:ge))},[]),J=y.useCallback(V=>{u(ne=>[...ne,V])},[]),wt=y.useCallback((V,ne,le)=>{ne.forEach((fe,ge)=>{se(()=>{const Pe={sessionId:V,...fe.event,timestamp:new Date().toISOString()};if(J(Pe),fe.event.eventType==="status"){const Se=z1(fe.event.content),Me=$1(fe.event.content);Nt(V,Se,Me)}ge===ne.length-1&&le&&le()},fe.delayMs,V)})},[se,J,Nt]),Vt=y.useCallback(async(V,ne,le,fe)=>{console.log("[MockGrackle] spawn",{environmentId:V,prompt:ne,runtime:fe});const ge=mt("sess"),Pe={id:ge,environmentId:V,runtime:fe||"claude-code",status:"running",prompt:ne,startedAt:new Date().toISOString()};c(Me=>[...Me,Pe]),m(ge);const Se=vn();if(console.log(`[MockGrackle] Playing scenario: ${Se.label}`),Se.pauseForInput){const Me=Se.pauseAfterStep??Se.steps.length-1,Je=Se.steps.slice(0,Me+1),dt=Je.length>0?Je[Je.length-1].delayMs:0;wt(ge,Je),se(()=>{Nt(ge,"idle"),J({sessionId:ge,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},dt+Zb,ge),Se.resumeSteps&&he.current.set(ge,Se.resumeSteps)}else wt(ge,Se.steps)},[mt,vn,wt,se,Nt,J]),es=y.useCallback(async V=>{console.log("[MockGrackle] kill",V),qe(V),he.current.delete(V),Nt(V,"stopped","killed"),J({sessionId:V,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),x(ne=>ne.map(le=>le.latestSessionId===V&&le.status==="working"?{...le,status:"not_started"}:le))},[qe,Nt,J]),pt=y.useCallback(async V=>{console.log("[MockGrackle] stopGraceful",V),qe(V),he.current.delete(V),Nt(V,"stopped","terminated"),J({sessionId:V,eventType:"status",timestamp:new Date().toISOString(),content:"terminated"}),x(ne=>ne.map(le=>le.latestSessionId===V&&le.status==="working"?{...le,status:"not_started"}:le))},[qe,Nt,J]),hs=y.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),ia=y.useCallback(async V=>{console.log("[MockGrackle] loadSessionEvents",V)},[]),ts=y.useCallback(()=>{console.log("[MockGrackle] clearEvents"),u([])},[]),Za=y.useCallback(async(V,ne,le,fe,ge,Pe,Se,Me,Je)=>{console.log("[MockGrackle] createWorkspace",{name:V,description:ne});const dt={id:mt("proj"),name:V,description:ne||"",repoUrl:le||"",environmentId:fe||"",linkedEnvironmentIds:[],status:"active",workingDirectory:Se||"",useWorktrees:Pe??!0,defaultPersonaId:ge||"",tokenBudget:0,costBudgetMillicents:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(We=>[...We,dt]),Me&&Me()},[mt]),oa=y.useCallback(async V=>{console.log("[MockGrackle] archiveWorkspace",V),v(ne=>ne.map(le=>le.id===V?{...le,status:"archived"}:le))},[]),Kt=y.useCallback(async V=>{console.log("[MockGrackle] loadTasks",V)},[]),Di=y.useCallback(async(V,ne,le,fe,ge,Pe,Se,Me,Je)=>{console.log("[MockGrackle] createTask",{workspaceId:V,title:ne,parentTaskId:ge}),x(dt=>{const qt=dt.filter(ht=>ht.workspaceId===V).reduce((ht,Wt)=>Math.max(ht,Wt.sortOrder),0),tn=ge?dt.find(ht=>ht.id===ge):void 0;if(ge&&!tn)return console.warn("[MockGrackle] Parent task not found:",ge),dt;if(tn&&!tn.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",ge),dt;const Mt=tn?tn.depth+1:0,fn={id:mt("task"),workspaceId:V,title:ne,description:le||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:fe||[],reviewNotes:void 0,sortOrder:qt+1,createdAt:new Date().toISOString(),parentTaskId:ge||"",depth:Mt,childTaskIds:[],canDecompose:Se??!ge,defaultPersonaId:Pe||"",workpad:"",tokenBudget:0,costBudgetMillicents:0};return[...dt,fn]}),Me&&Me()},[mt]),ra=y.useCallback(async(V,ne,le,fe)=>{var dt;console.log("[MockGrackle] startTask",{taskId:V});const ge=xe.current.find(We=>We.id===V),Pe=(ge==null?void 0:ge.title)??"",Se=mt("sess"),Me={id:Se,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Pe||V,startedAt:new Date().toISOString()};c(We=>[...We,Me]),x(We=>We.map(qt=>qt.id===V?{...qt,status:"working",latestSessionId:Se,branch:`mock/${V.slice(0,8)}`}:qt));const Je=vn();if(console.log(`[MockGrackle] Playing task scenario: ${Je.label}`),Je.pauseForInput){const We=Je.pauseAfterStep??Je.steps.length-1,qt=Je.steps.slice(0,We+1),tn=qt.length>0?qt[qt.length-1].delayMs:0;if(wt(Se,qt),se(()=>{Nt(Se,"idle"),J({sessionId:Se,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},tn+Zb,Se),Je.resumeSteps){const Mt=[...Je.resumeSteps];he.current.set(Se,Mt);const fn=Mt.reduce((ht,Wt)=>Math.max(ht,Wt.delayMs),0);Le.current.set(Se,{taskId:V,delayAfterResume:fn+200})}}else{const We=Je.steps.length>0?Je.steps[Je.steps.length-1].delayMs:0;wt(Se,Je.steps);const qt=(dt=Je.steps[Je.steps.length-1])==null?void 0:dt.event.content;se(()=>{qt==="completed"?x(tn=>tn.map(Mt=>Mt.id===V&&Mt.status==="working"?{...Mt,status:"paused"}:Mt)):qt==="failed"&&x(tn=>tn.map(Mt=>Mt.id===V&&Mt.status==="working"?{...Mt,status:"failed"}:Mt))},We+100,Se)}},[mt,vn,wt,se,Nt,J]),Ka=y.useCallback(async(V,ne)=>{console.log("[MockGrackle] sendInput",{sessionId:V,text:ne}),J({sessionId:V,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${ne}`}),Nt(V,"running"),J({sessionId:V,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const le=he.current.get(V);if(le)he.current.delete(V),wt(V,le);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"}}];wt(V,ge)}const fe=Le.current.get(V);fe&&(Le.current.delete(V),se(()=>{x(ge=>ge.map(Pe=>Pe.id===fe.taskId&&Pe.status==="working"?{...Pe,status:"paused"}:Pe))},fe.delayAfterResume,V))},[J,Nt,wt,se]),ns=y.useCallback(async V=>{console.log("[MockGrackle] completeTask",V),x(ne=>ne.map(le=>le.id===V?{...le,status:"complete"}:le))},[]),Ri=y.useCallback(async V=>{console.log("[MockGrackle] resumeTask",V)},[]),Ln=y.useCallback(async(V,ne,le,fe,ge)=>{console.log("[MockGrackle] updateTask",{taskId:V,title:ne}),x(Pe=>Pe.map(Se=>Se.id===V?{...Se,title:ne.trim()||Se.title,description:le,dependsOn:fe,...ge!==void 0?{defaultPersonaId:ge}:{}}:Se))},[]),De=y.useCallback(async V=>{console.log("[MockGrackle] deleteTask",V),x(ne=>ne.filter(le=>le.id!==V))},[]),Ye=y.useCallback(async V=>{console.log("[MockGrackle] loadFindings",V),k(Pc.filter(ne=>ne.workspaceId===V))},[]),Yt=y.useCallback(async()=>{console.log("[MockGrackle] loadAllFindings"),k([...Pc])},[]),kt=y.useCallback(async V=>{console.log("[MockGrackle] loadFinding",V);const ne=Pc.find(le=>le.id===V);N(ne)},[]),un=y.useCallback(async(V,ne,le,fe,ge)=>{console.log("[MockGrackle] postFinding",{workspaceId:V,title:ne});const Pe={id:mt("find"),workspaceId:V,taskId:"",sessionId:"",category:fe||"general",title:ne,content:le,tags:ge||[],createdAt:new Date().toISOString()};k(Se=>[...Se,Pe])},[mt]),Jt=y.useCallback(async()=>{console.log("[MockGrackle] loadEnvironments")},[]),Mi=y.useCallback(async(V,ne,le)=>{console.log("[MockGrackle] addEnvironment",{displayName:V,adapterType:ne,adapterConfig:le})},[]),Ii=y.useCallback(async(V,ne)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:V,...ne}),o(le=>le.map(fe=>fe.id!==V?fe:{...fe,...ne.displayName!==void 0?{displayName:ne.displayName}:{},...ne.adapterConfig!==void 0?{adapterConfig:JSON.stringify(ne.adapterConfig)}:{}}))},[]),Oi=y.useCallback(async()=>{console.log("[MockGrackle] loadTokens")},[]),Ya=y.useCallback(async(V,ne,le,fe,ge)=>{console.log("[MockGrackle] setToken",{name:V,tokenType:le}),R(Pe=>[...Pe.filter(Me=>Me.name!==V),{name:V,tokenType:le,envVar:fe,filePath:ge,expiresAt:""}])},[]),Ja=y.useCallback(async V=>{console.log("[MockGrackle] deleteToken",V),R(ne=>ne.filter(le=>le.name!==V))},[]),Wa=y.useCallback(async V=>{console.log("[MockGrackle] updateCredentialProviders",V),A(V)},[]);y.useEffect(()=>()=>{ze.current.forEach(clearTimeout),ze.current.clear()},[]);const Cs=y.useMemo(()=>({connected:!0,environments:{environments:s,environmentsLoading:!1,provisionStatus:{},operationError:"",clearOperationError:()=>{},loadEnvironments:Jt,addEnvironment:Mi,updateEnvironment:Ii,provisionEnvironment:async(V,ne)=>{},stopEnvironment:async()=>{},removeEnvironment:async()=>{},domainHook:_s},sessions:{sessions:r,sessionsLoading:!1,events:d,eventsDropped:0,lastSpawnedId:p,taskSessions:z,spawn:Vt,sendInput:Ka,kill:es,stopGraceful:pt,loadSessionEvents:ia,clearEvents:ts,loadTaskSessions:async V=>{console.log("[MockGrackle] loadTaskSessions",V)},domainHook:_s},workspaces:{workspaces:g,workspacesLoading:!1,workspaceCreating:!1,loadWorkspaces:async()=>{console.log("[MockGrackle] loadWorkspaces")},createWorkspace:Za,archiveWorkspace:oa,updateWorkspace:async(V,ne)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:V,...ne}),v(le=>le.map(fe=>fe.id!==V?fe:{...fe,...ne.name!==void 0?{name:ne.name}:{},...ne.description!==void 0?{description:ne.description}:{},...ne.repoUrl!==void 0?{repoUrl:ne.repoUrl}:{},...ne.environmentId!==void 0?{environmentId:ne.environmentId}:{},...ne.workingDirectory!==void 0?{workingDirectory:ne.workingDirectory}:{},...ne.useWorktrees!==void 0?{useWorktrees:ne.useWorktrees}:{},...ne.defaultPersonaId!==void 0?{defaultPersonaId:ne.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},domainHook:_s},tasks:{tasks:b,tasksLoading:!1,taskStartingId:void 0,loadTasks:Kt,loadAllTasks:async()=>{console.log("[MockGrackle] loadAllTasks")},createTask:Di,startTask:ra,stopTask:async V=>{console.log("[MockGrackle] stopTask",{taskId:V}),await ns(V)},completeTask:ns,resumeTask:Ri,updateTask:Ln,deleteTask:De,domainHook:_s},findings:{findings:S,selectedFinding:w,findingLoading:T,findingsLoading:!1,loadFindings:Ye,loadAllFindings:Yt,loadFinding:kt,postFinding:un,domainHook:_s},tokens:{tokens:C,tokensLoading:!1,loadTokens:Oi,setToken:Ya,deleteToken:Ja,domainHook:_s},credentials:{credentialProviders:B,credentialsLoading:!1,updateCredentialProviders:Wa,domainHook:_s},codespaces:{codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:async()=>{},createCodespace:async()=>{},domainHook:_s},personas:{personas:M,personasLoading:!1,createPersona:async(V,ne,le,fe,ge,Pe,Se,Me,Je)=>{console.log("[MockGrackle] createPersona",{name:V});const dt={id:`mock-persona-${Date.now()}`,name:V,description:ne,systemPrompt:le,toolConfig:"{}",runtime:fe??"claude-code",model:ge||"",maxTurns:Pe||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Se||"agent",script:Me||"",allowedMcpTools:Je||[]};return D(We=>[...We,dt]),dt},updatePersona:async(V,ne,le,fe,ge,Pe,Se,Me,Je,dt)=>{console.log("[MockGrackle] updatePersona",{personaId:V,name:ne});const We=M.find(Mt=>Mt.id===V);if(!We)throw new Error(`Persona not found: ${V}`);const qt=new Date().toISOString(),tn={...We,...ne!==void 0?{name:ne}:{},...le!==void 0?{description:le}:{},...fe!==void 0?{systemPrompt:fe}:{},...ge!==void 0?{runtime:ge}:{},...Pe!==void 0?{model:Pe}:{},...Se!==void 0?{maxTurns:Se}:{},...Me!==void 0?{type:Me}:{},...Je!==void 0?{script:Je}:{},...dt!==void 0?{allowedMcpTools:dt}:{},updatedAt:qt};return D(Mt=>Mt.map(fn=>fn.id===V?tn:fn)),tn},deletePersona:async V=>{console.log("[MockGrackle] deletePersona",V),D(ne=>ne.filter(le=>le.id!==V))},domainHook:_s},knowledge:{graphData:{nodes:Q,links:re},selectedNode:oe,loading:!1,selectedId:F,searchQuery:me,search:async V=>{if(console.log("[MockGrackle] knowledge.search",V),!V.trim()){de(V);return}de(V);const ne=Oe.current,le=ne?ks.filter(Se=>!Se.workspaceId||Se.workspaceId===ne):ks,fe=V.toLowerCase(),ge=le.filter(Se=>{var Me,Je,dt;return Se.label.toLowerCase().includes(fe)||((Me=Se.content)==null?void 0:Me.toLowerCase().includes(fe))||((Je=Se.tags)==null?void 0:Je.some(We=>We.toLowerCase().includes(fe)))||((dt=Se.category)==null?void 0:dt.toLowerCase().includes(fe))});P(ge);const Pe=new Set(ge.map(Se=>Se.id));H(Ma.filter(Se=>Pe.has(Se.source)&&Pe.has(Se.target))),ae(void 0),E(void 0)},clearSearch:()=>{console.log("[MockGrackle] knowledge.clearSearch"),de("");const V=Oe.current,ne=V?ks.filter(fe=>!fe.workspaceId||fe.workspaceId===V):ks;P(ne);const le=new Set(ne.map(fe=>fe.id));H(Ma.filter(fe=>le.has(fe.source)&&le.has(fe.target)))},selectNode:async V=>{console.log("[MockGrackle] knowledge.selectNode",V),ae(V);const ne=V in Gb?Gb[V]:void 0;if(ne)E(ne);else{const le=ks.find(fe=>fe.id===V);if(le){const fe=Ma.filter(ge=>ge.source===V||ge.target===V).map(ge=>({fromId:ge.source,toId:ge.target,type:ge.type}));E({node:le,edges:fe})}}},clearSelection:()=>{console.log("[MockGrackle] knowledge.clearSelection"),ae(void 0),E(void 0)},expandNode:async V=>{console.log("[MockGrackle] knowledge.expandNode",V),P(ne=>{const le=new Set(ne.map(Me=>Me.id)),fe=Ma.filter(Me=>Me.source===V||Me.target===V),ge=new Set;for(const Me of fe)le.has(Me.source)||ge.add(Me.source),le.has(Me.target)||ge.add(Me.target);if(ge.size===0)return ne;const Pe=ks.filter(Me=>ge.has(Me.id)),Se=new Set([...le,...ge]);return H(Me=>{const Je=new Set(Me.map(We=>`${We.source}|${We.target}|${We.type}`)),dt=Ma.filter(We=>Se.has(We.source)&&Se.has(We.target)&&!Je.has(`${We.source}|${We.target}|${We.type}`));return dt.length>0?[...Me,...dt]:Me}),[...ne,...Pe]})},loadRecent:async V=>{if(console.log("[MockGrackle] knowledge.loadRecent",V),Oe.current=V,V){const ne=ks.filter(fe=>!fe.workspaceId||fe.workspaceId===V);P(ne);const le=new Set(ne.map(fe=>fe.id));H(Ma.filter(fe=>le.has(fe.source)&&le.has(fe.target)))}else P(ks),H(Ma);de("")},handleEvent:()=>!1,domainHook:_s},appDefaultPersonaId:U,setAppDefaultPersonaId:async V=>{console.log("[MockGrackle] setAppDefaultPersonaId",V),X(V)},onboardingCompleted:!0,completeOnboarding:async()=>{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:async(V,ne)=>{console.log(`[MockGrackle] loadUsage(${V}, ${ne})`)},refresh:hs}),[s,r,d,p,z,g,b,S,w,C,B,M,U,Q,re,oe,F,me,Vt,Ka,es,pt,ia,ts,Za,oa,Kt,Di,ra,ns,Ri,Ln,De,Ye,Yt,kt,un,Jt,Mi,Ii,Oi,Ya,Ja,Wa,hs]);return i.jsx(eh.Provider,{value:Cs,children:t})}const Iz=3e3;function Oz(t){const[s,o]=y.useState(!1),r=y.useRef(t.onSessionEvent);r.current=t.onSessionEvent;const c=y.useRef(t.onDomainEvent);c.current=t.onDomainEvent;const d=y.useRef(t.onConnect);d.current=t.onConnect;const u=y.useRef(t.onDisconnect);return u.current=t.onDisconnect,y.useEffect(()=>{let p=!1,m;async function g(){var v,b;if(!p){try{const x=je.streamEvents({});o(!0),Promise.resolve((v=d.current)==null?void 0:v.call(d)).catch(()=>{});for await(const S of x){if(p)break;const k=S.event;if(k.case==="sessionEvent"){const w=k.value;r.current({sessionId:w.sessionId,type:w.type,timestamp:w.timestamp,content:w.content,raw:w.raw})}else if(k.case==="domainEvent"){const w=k.value;c.current({id:w.id,type:w.type,timestamp:w.timestamp,payloadJson:w.payloadJson})}}}catch(x){if(x instanceof Do&&x.code===cx.Unauthenticated){window.location.href=nN;return}}p||(o(!1),(b=u.current)==null||b.call(u),m=setTimeout(()=>{g().catch(()=>{})},Iz))}}return g().catch(()=>{}),()=>{p=!0,clearTimeout(m),o(!1)}},[]),{connected:s}}function Bz(t){return{id:t.id,displayName:t.displayName,adapterType:t.adapterType,adapterConfig:t.adapterConfig||"{}",status:t.status,bootstrapped:t.bootstrapped}}function Kb(t){return{id:t.id,environmentId:t.environmentId,runtime:t.runtime,status:t.status,prompt:t.prompt,startedAt:t.startedAt,endedAt:t.endedAt||void 0,error:t.error||void 0,endReason:t.endReason||void 0,personaId:t.personaId||void 0,inputTokens:t.inputTokens,outputTokens:t.outputTokens,costUsd:t.costUsd}}function Lz(t){return{sessionId:t.sessionId,eventType:dx(t.type),timestamp:t.timestamp,content:t.content,raw:t.raw||void 0}}function zz(t){return{id:t.id,name:t.name,description:t.description,repoUrl:t.repoUrl,environmentId:t.environmentId,linkedEnvironmentIds:[...t.linkedEnvironmentIds],status:gT(t.status),workingDirectory:t.workingDirectory,useWorktrees:t.useWorktrees,defaultPersonaId:t.defaultPersonaId,tokenBudget:t.tokenBudget,costBudgetMillicents:t.costBudgetMillicents,createdAt:t.createdAt,updatedAt:t.updatedAt}}function Yb(t){return{id:t.id,workspaceId:t.workspaceId??void 0,title:t.title,description:t.description,status:vT(t.status),branch:t.branch,latestSessionId:t.latestSessionId,dependsOn:[...t.dependsOn],sortOrder:t.sortOrder,createdAt:t.createdAt,startedAt:t.startedAt||void 0,completedAt:t.completedAt||void 0,parentTaskId:t.parentTaskId,depth:t.depth,childTaskIds:[...t.childTaskIds],canDecompose:t.canDecompose,defaultPersonaId:t.defaultPersonaId,workpad:t.workpad,tokenBudget:t.tokenBudget,costBudgetMillicents:t.costBudgetMillicents}}function Sp(t){return{id:t.id,workspaceId:t.workspaceId,taskId:t.taskId,sessionId:t.sessionId,category:t.category,title:t.title,content:t.content,tags:[...t.tags],createdAt:t.createdAt}}function $z(t){return{name:t.name,tokenType:t.type,envVar:t.envVar,filePath:t.filePath,expiresAt:t.expiresAt}}function Uz(t){return{claude:yT(t.claude),github:Cc(t.github),copilot:Cc(t.copilot),codex:Cc(t.codex),goose:Cc(t.goose)}}function Pz(t){return{name:t.name,repository:t.repository,state:t.state,gitStatus:t.gitStatus}}function Tp(t){return{id:t.id,name:t.name,description:t.description,systemPrompt:t.systemPrompt,toolConfig:t.toolConfig?JSON.stringify({allowedTools:[...t.toolConfig.allowedTools],disallowedTools:[...t.toolConfig.disallowedTools]}):"{}",runtime:t.runtime,model:t.model,maxTurns:t.maxTurns,mcpServers:JSON.stringify(t.mcpServers.map(s=>({name:s.name,command:s.command,args:[...s.args],tools:[...s.tools]}))),createdAt:t.createdAt,updatedAt:t.updatedAt,type:t.type||"agent",script:t.script,allowedMcpTools:[...t.allowedMcpTools]}}function Hz(t){return{inputTokens:t.inputTokens,outputTokens:t.outputTokens,costUsd:t.costUsd,sessionCount:t.sessionCount}}function Hc(t,s=0){return{id:t.id,label:t.title||t.label||t.id,kind:t.kind,category:t.category||void 0,sourceType:t.sourceType||void 0,sourceId:t.sourceId||void 0,content:t.content||void 0,tags:t.tags.length>0?[...t.tags]:void 0,workspaceId:t.workspaceId||void 0,createdAt:t.createdAt||void 0,updatedAt:t.updatedAt||void 0,val:s}}function wp(t){return{source:t.fromId,target:t.toId,type:t.type}}function Fa(){const[t,s]=y.useState(!1),o=y.useRef(0),r=y.useCallback(c=>(o.current++,o.current===1&&s(!0),c.finally(()=>{o.current--,o.current===0&&s(!1)})),[]);return{loading:t,track:r}}const Jb=5e3;function Pr(t){return t instanceof Do?t.message:"Operation failed"}function Vz(){const[t,s]=y.useState([]),{loading:o,track:r}=Fa(),[c,d]=y.useState({}),[u,p]=y.useState(""),m=y.useCallback(()=>{p("")},[]),g=y.useCallback(async()=>{try{const C=await r(je.listEnvironments({}));s(C.environments.map(Bz))}catch{}},[r]),v=y.useCallback(C=>{switch(C.type){case"environment.added":return!0;case"environment.removed":{const R=C.payload.environmentId;return R&&(s(B=>B.filter(A=>A.id!==R)),d(B=>{const A={...B};return delete A[R],A})),!0}case"environment.changed":return g().catch(()=>{}),!0;case"environment.provision_progress":{const R=C.payload;if(typeof R.environmentId!="string"||typeof R.stage!="string"||typeof R.message!="string"||typeof R.progress!="number")return L1("environment.provision_progress","invalid payload"),!0;if(d(B=>({...B,[R.environmentId]:{stage:R.stage,message:R.message,progress:R.progress}})),R.stage==="ready"){const B=R.environmentId;setTimeout(()=>{d(A=>{const M={...A};return delete M[B],M})},Jb)}return!0}default:return!1}},[g]),b=y.useCallback(C=>{var R;if(C.type==="environments"){const B=Array.isArray((R=C.payload)==null?void 0:R.environments)?C.payload.environments:[];return s(B),!0}return!1},[]),x=y.useCallback(async(C,R,B)=>{p("");try{await je.addEnvironment({displayName:C,adapterType:R,adapterConfig:JSON.stringify(B??{})})}catch(A){p(Pr(A))}},[]),S=y.useCallback(async(C,R)=>{p("");try{await je.updateEnvironment({id:C,displayName:R.displayName,adapterConfig:R.adapterConfig?JSON.stringify(R.adapterConfig):void 0})}catch(B){p(Pr(B))}},[]),k=y.useCallback(async(C,R)=>{p("");try{const B=je.provisionEnvironment({id:C,force:R??!1});for await(const A of B)d(M=>({...M,[C]:{stage:A.stage,message:A.message,progress:A.progress}})),A.stage==="ready"&&setTimeout(()=>{d(M=>{const D={...M};return delete D[C],D})},Jb)}catch(B){d(A=>{const M={...A};return delete M[C],M}),p(Pr(B))}},[]),w=y.useCallback(async C=>{p("");try{await je.stopEnvironment({id:C})}catch(R){p(Pr(R))}},[]),N=y.useCallback(async C=>{p("");try{await je.removeEnvironment({id:C})}catch(R){p(Pr(R))}},[]);return{environments:t,environmentsLoading:o,provisionStatus:c,operationError:u,clearOperationError:m,loadEnvironments:g,addEnvironment:x,updateEnvironment:S,provisionEnvironment:k,stopEnvironment:w,removeEnvironment:N,handleEvent:v,handleLegacyMessage:b,domainHook:{onConnect:()=>g(),onDisconnect:()=>{},handleEvent:v}}}const jp=new Set(["pending","running","idle"]),qz=new Set(["completed","failed","interrupted","hibernating","suspended"]),Wb=["pending","running","idle"];function Gz(){const[t,s]=y.useState([]),{loading:o,track:r}=Fa(),[c,d]=y.useState([]),[u,p]=y.useState(0),[m,g]=y.useState(void 0),[v,b]=y.useState({}),x=y.useCallback(async()=>{try{const U=(await r(je.listSessions({}))).sessions.map(Kb);s(X=>{const Q=new Map(X.map(P=>[P.id,P]));return U.map(P=>{const re=Q.get(P.id),H=re==null?void 0:re.status;return!H||H===P.status?P:qz.has(H)&&jp.has(P.status)?{...P,status:H,...re.endReason!==void 0?{endReason:re.endReason}:{}}:jp.has(H)&&jp.has(P.status)&&Wb.indexOf(H)>Wb.indexOf(P.status)?{...P,status:H}:P})})}catch{}},[r]),S=y.useCallback(z=>{if(z.type!=="session_event")return!1;if(!rz(z.payload))return L1("session_event","payload is not a valid SessionEvent"),!0;const U=z.payload;let X=0;if(d(Q=>{const P=[...Q,U];return P.length>ko?(X=P.length-ko,P.slice(-ko)):P}),X>0&&p(Q=>Q+X),U.eventType==="usage")try{const Q=JSON.parse(U.content),P=Number(Q.input_tokens)||0,re=Number(Q.output_tokens)||0,H=Number(Q.cost_usd)||0;(P>0||re>0||H>0)&&s(oe=>oe.map(E=>E.id===U.sessionId?{...E,inputTokens:(E.inputTokens??0)+P,outputTokens:(E.outputTokens??0)+re,costUsd:(E.costUsd??0)+H}:E))}catch{}if(U.eventType==="status"){const Q=z1(U.content),P=$1(U.content);s(re=>re.some(oe=>oe.id===U.sessionId)?re.map(oe=>oe.id===U.sessionId?{...oe,status:Q,...P!==void 0?{endReason:P}:{}}:oe):[...re,{id:U.sessionId,environmentId:"",runtime:"",status:Q,prompt:"",startedAt:U.timestamp,...P!==void 0?{endReason:P}:{}}])}return!0},[]),k=y.useCallback(z=>{S({type:"session_event",payload:z})},[S]),w=y.useCallback(z=>{var U,X,Q,P,re;switch(z.type){case"sessions":{const H=Array.isArray((U=z.payload)==null?void 0:U.sessions)?z.payload.sessions:[];return s(H),!0}case"spawned":{const H=(X=z.payload)==null?void 0:X.sessionId;return typeof H=="string"&&H&&g(H),x().catch(()=>{}),!0}case"session_events":{const H=Array.isArray((Q=z.payload)==null?void 0:Q.events)?z.payload.events:[];return H.length>0&&d(H),!0}case"task_sessions":{const H=(P=z.payload)==null?void 0:P.taskId;if(typeof H=="string"&&H){const oe=Array.isArray((re=z.payload)==null?void 0:re.sessions)?z.payload.sessions:[];b(E=>({...E,[H]:oe}))}return!0}default:return!1}},[x]),N=y.useCallback(async(z,U,X,Q)=>{try{const P=await je.spawnAgent({environmentId:z,prompt:U,personaId:X||"",workingDirectory:Q||""});g(P.id),await x()}catch{}},[x]),T=y.useCallback(async(z,U)=>{try{await je.sendInput({sessionId:z,text:U})}catch{}},[]),C=y.useCallback(async z=>{try{await je.killAgent({id:z,graceful:!1})}catch{}},[]),R=y.useCallback(async z=>{try{await je.killAgent({id:z,graceful:!0})}catch{}},[]),B=y.useCallback(async z=>{try{const X=(await je.getSessionEvents({id:z})).events.map(Lz);if(X.length>0){let Q=0;d(P=>{const re=new Set;for(const E of P)E.sessionId===z&&re.add(`${E.timestamp}|${E.eventType}`);const H=X.filter(E=>!re.has(`${E.timestamp}|${E.eventType}`)),oe=[...P,...H].sort((E,F)=>E.sessionId!==F.sessionId?0:E.timestamp.localeCompare(F.timestamp));return oe.length>ko?(Q=oe.length-ko,oe.slice(-ko)):oe}),Q>0&&p(P=>P+Q)}}catch{}},[]),A=y.useCallback(()=>{d([]),p(0)},[]),M=y.useCallback(async z=>{try{const X=(await je.getTaskSessions({id:z})).sessions.map(Kb);b(Q=>({...Q,[z]:X}))}catch{}},[]);return{sessions:t,sessionsLoading:o,events:c,eventsDropped:u,lastSpawnedId:m,taskSessions:v,loadSessions:x,spawn:N,sendInput:T,kill:C,stopGraceful:R,loadSessionEvents:B,clearEvents:A,loadTaskSessions:M,handleMessage:S,handleSessionEvent:k,handleLegacyMessage:w,domainHook:{onConnect:()=>x(),onDisconnect:()=>{A()},handleEvent:()=>!1}}}function Fz(){const[t,s]=y.useState([]),{loading:o,track:r}=Fa(),[c,d]=y.useState(!1),u=y.useCallback(async()=>{try{const S=await r(je.listWorkspaces({}));s(S.workspaces.map(zz))}catch{}},[r]),p=y.useCallback(S=>{switch(S.type){case"workspace.created":return d(!1),u().catch(()=>{}),!0;case"workspace.archived":case"workspace.updated":return u().catch(()=>{}),!0;default:return!1}},[u]),m=y.useCallback(()=>{d(!1)},[]),g=y.useCallback(async(S,k,w,N,T,C,R,B,A)=>{d(!0);try{await je.createWorkspace({name:S,description:k||"",repoUrl:w||"",environmentId:N||"",defaultPersonaId:T||void 0,useWorktrees:C??!0,workingDirectory:R||void 0}),d(!1),B==null||B()}catch(M){d(!1);const D=M instanceof Do?M.message:"Failed to create workspace";A==null||A(D)}},[]),v=y.useCallback(async S=>{try{await je.archiveWorkspace({id:S})}catch{}},[]),b=y.useCallback(async(S,k)=>{try{await je.updateWorkspace({id:S,...k})}catch{}},[]);return{workspaces:t,workspacesLoading:o,workspaceCreating:c,loadWorkspaces:u,createWorkspace:g,archiveWorkspace:v,updateWorkspace:b,handleEvent:p,onDisconnect:m,domainHook:{onConnect:()=>u(),onDisconnect:m,handleEvent:p}}}function Zz(){const[t,s]=y.useState([]),{loading:o,track:r}=Fa(),[c,d]=y.useState(void 0),u=y.useRef({}),p=y.useCallback(async A=>{try{const D=(await je.listTasks({workspaceId:A})).tasks.map(Yb);s(z=>[...z.filter(U=>U.workspaceId!==A),...D])}catch{}},[]),m=y.useCallback(async()=>{try{const M=(await r(je.listTasks({}))).tasks.map(Yb);s(D=>{const z=new Set(M.map(U=>U.id));return[...D.filter(U=>!z.has(U.id)),...M]})}catch{}},[r]),g=y.useCallback((A,M)=>{const D=z=>{clearTimeout(u.current[z]),u.current[z]=setTimeout(()=>{delete u.current[z],p(z).catch(()=>{})},200)};A?D(A):M&&s(z=>{const U=z.find(X=>X.id===M);return U!=null&&U.workspaceId?D(U.workspaceId):m().catch(()=>{}),z})},[p,m]),v=y.useCallback(A=>{const M=A.payload;switch(A.type){case"task.created":{const D=typeof M.workspaceId=="string"?M.workspaceId:"";return D&&p(D).catch(()=>{}),!0}case"task.started":{const D=typeof M.taskId=="string"?M.taskId:"",z=typeof M.sessionId=="string"?M.sessionId:"",U=typeof M.workspaceId=="string"?M.workspaceId:"";return d(X=>D&&X===D?void 0:X),z&&D&&s(X=>X.map(Q=>Q.id===D?{...Q,latestSessionId:z}:Q)),g(U,D),!0}case"task.completed":case"task.deleted":case"task.reparented":case"task.updated":{const D=typeof M.workspaceId=="string"?M.workspaceId:"",z=typeof M.taskId=="string"?M.taskId:"";return d(U=>z&&U===z?void 0:U),g(D,z),!0}default:return!1}},[p,g]),b=y.useCallback(()=>{d(void 0)},[]),x=y.useCallback(A=>{var M,D;if(A.type==="tasks"){const z=Array.isArray((M=A.payload)==null?void 0:M.tasks)?A.payload.tasks:[],U=typeof((D=A.payload)==null?void 0:D.workspaceId)=="string"&&A.payload.workspaceId?A.payload.workspaceId:"";return s(U?X=>[...X.filter(Q=>Q.workspaceId!==U),...z]:X=>{const Q=new Set(z.map(P=>P.id));return[...X.filter(P=>!Q.has(P.id)),...z]}),!0}return!1},[]),S=y.useCallback(async(A,M,D,z,U,X,Q,P,re)=>{try{await je.createTask({workspaceId:A,title:M,description:D||"",dependsOn:z||[],parentTaskId:U||"",defaultPersonaId:X||void 0,canDecompose:Q??void 0}),P==null||P()}catch(H){const oe=H instanceof Do?H.message:"Failed to create task";re==null||re(oe)}},[]),k=y.useCallback(async(A,M,D,z)=>{d(A);try{await je.startTask({taskId:A,personaId:M||"",environmentId:D||"",notes:z||""})}catch(U){if(U instanceof Do&&U.code===cx.ResourceExhausted)return;d(void 0)}},[]),w=y.useCallback(async A=>{try{await je.stopTask({id:A})}catch{}},[]),N=y.useCallback(async A=>{try{await je.completeTask({id:A})}catch{}},[]),T=y.useCallback(async A=>{try{await je.resumeTask({id:A})}catch{}},[]),C=y.useCallback(async(A,M,D,z,U)=>{try{await je.updateTask({id:A,title:M,description:D,dependsOn:z,...U!==void 0?{defaultPersonaId:U}:{}})}catch{}},[]),R=y.useCallback(async A=>{try{await je.deleteTask({id:A})}catch{}},[]);return{tasks:t,tasksLoading:o,taskStartingId:c,loadTasks:p,loadAllTasks:m,createTask:S,startTask:k,stopTask:w,completeTask:N,resumeTask:T,updateTask:C,deleteTask:R,handleEvent:v,onDisconnect:b,handleLegacyMessage:x,domainHook:{onConnect:()=>m(),onDisconnect:b,handleEvent:v}}}function Kz(){const[t,s]=y.useState([]),[o,r]=y.useState(void 0),[c,d]=y.useState(!1),{loading:u,track:p}=Fa(),m=y.useCallback(async k=>{try{const w=await p(je.queryFindings({workspaceId:k}));s(w.findings.map(Sp))}catch{}},[p]),g=y.useCallback(async()=>{try{const k=await p(je.queryFindings({workspaceId:""}));s(k.findings.map(Sp))}catch{}},[p]),v=y.useCallback(async k=>{r(void 0),d(!0);try{const w=await je.getFinding({id:k});r(Sp(w))}catch{r(void 0)}finally{d(!1)}},[]),b=y.useCallback(k=>{if(k.type==="finding.posted"){const w=typeof k.payload.workspaceId=="string"?k.payload.workspaceId:"";return w&&m(w).catch(()=>{}),!0}return!1},[m]),x=y.useCallback(async(k,w,N,T,C)=>{try{await je.postFinding({workspaceId:k,title:w,content:N,category:T??"general",tags:C??[]})}catch{}},[]);return{findings:t,selectedFinding:o,findingLoading:c,findingsLoading:u,loadFindings:m,loadAllFindings:g,loadFinding:v,postFinding:x,handleEvent:b,domainHook:{onConnect:()=>g(),onDisconnect:()=>{},handleEvent:b}}}function Yz(){const[t,s]=y.useState([]),{loading:o,track:r}=Fa(),c=y.useCallback(async()=>{try{const g=await r(je.listTokens({}));s(g.tokens.map($z))}catch{}},[r]),d=y.useCallback(g=>g.type==="token.changed"?(c().catch(()=>{}),!0):!1,[c]),u=y.useCallback(async(g,v,b,x,S)=>{try{await je.setToken({name:g,value:v,type:b,envVar:x,filePath:S})}catch{}},[]),p=y.useCallback(async g=>{try{await je.deleteToken({name:g})}catch{}},[]);return{tokens:t,tokensLoading:o,loadTokens:c,setToken:u,deleteToken:p,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function Jz(){const[t,s]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),{loading:o,track:r}=Fa(),c=y.useCallback(async()=>{try{const m=await r(je.getCredentialProviders({}));s(Uz(m))}catch{}},[r]),d=y.useCallback(m=>m.type==="credential.providers_changed"?(cz(m.payload)&&s(m.payload),!0):!1,[]),u=y.useCallback(async m=>{const g=[{provider:"claude",value:m.claude},{provider:"github",value:m.github},{provider:"copilot",value:m.copilot},{provider:"codex",value:m.codex},{provider:"goose",value:m.goose}];await Promise.allSettled(g.map(({provider:v,value:b})=>je.setCredentialProvider({provider:v,value:b})))},[]);return{credentialProviders:t,credentialsLoading:o,loadCredentials:c,updateCredentialProviders:u,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function Wz(){const[t,s]=y.useState([]),[o,r]=y.useState(""),[c,d]=y.useState(""),[u,p]=y.useState(!1),m=y.useCallback(async()=>{try{const b=await je.listCodespaces({});s(b.codespaces.map(Pz)),d(b.error)}catch{}},[]),g=y.useCallback(async(b,x)=>{p(!0),r("");try{await je.createCodespace({repo:b,machine:x??""}),p(!1),await m()}catch(S){p(!1);const k=S instanceof Do?S.message:"Failed to create codespace";r(k)}},[m]);return{codespaces:t,codespaceError:o,codespaceListError:c,codespaceCreating:u,listCodespaces:m,createCodespace:g,domainHook:{onConnect:()=>m(),onDisconnect:()=>{},handleEvent:()=>!1}}}function Xz(){const[t,s]=y.useState([]),{loading:o,track:r}=Fa(),c=y.useCallback(async()=>{try{const v=await r(je.listPersonas({}));s(v.personas.map(Tp))}catch{}},[r]),d=y.useCallback(v=>{switch(v.type){case"persona.created":case"persona.updated":case"persona.deleted":return c().catch(()=>{}),!0;default:return!1}},[c]),u=y.useCallback(async(v,b,x,S,k,w,N,T,C)=>{const R=await je.createPersona({name:v,description:b,systemPrompt:x,runtime:S||"",model:k||"",maxTurns:w||0,type:N||"agent",script:T||"",allowedMcpTools:C||[]}),B=Tp(R);return s(A=>[...A.filter(M=>M.id!==B.id),B]),B},[]),p=y.useCallback(async(v,b,x,S,k,w,N,T,C,R)=>{const B={id:v};b!==void 0&&(B.name=b),x!==void 0&&(B.description=x),S!==void 0&&(B.systemPrompt=S),k!==void 0&&(B.runtime=k),w!==void 0&&(B.model=w),N!==void 0&&(B.maxTurns=N),T!==void 0&&(B.type=T),C!==void 0&&(B.script=C),R!==void 0&&(B.allowedMcpTools={tools:R});const A=await je.updatePersona(B),M=Tp(A);return s(D=>D.map(z=>z.id===M.id?M:z)),M},[]),m=y.useCallback(async v=>{await je.deletePersona({id:v}),s(b=>b.filter(x=>x.id!==v))},[]);return{personas:t,personasLoading:o,loadPersonas:c,createPersona:u,updatePersona:p,deletePersona:m,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function Qz(t){if(t)try{return JSON.parse(t)}catch{return}}function e7(){const[t,s]=y.useState(new Map),[o,r]=y.useState([]),[c,d]=y.useState(void 0),[u,p]=y.useState(void 0),[m,g]=y.useState(!1),[v,b]=y.useState(""),x=y.useRef(""),S=y.useCallback(async A=>{const M=A??"";x.current=M,b(""),g(!0);try{const D=await je.listRecentKnowledgeNodes({limit:30,workspaceId:M}),z=new Map,U=[];for(const X of D.nodes)z.set(X.id,Hc(X));for(const X of D.edges)U.push(wp(X));for(const X of U){const Q=z.get(X.source);Q&&(Q.val+=1);const P=z.get(X.target);P&&(P.val+=1)}s(z),r(U)}catch{}finally{g(!1)}},[]),k=y.useCallback(async A=>{if(A.trim()){b(A),p(void 0),d(void 0),g(!0);try{const M=await je.searchKnowledge({query:A,limit:20,workspaceId:x.current}),D=new Map,z=[];for(const U of M.results){U.node&&D.set(U.node.id,Hc(U.node,U.edges.length));for(const X of U.edges)z.push(wp(X))}s(D),r(z)}catch{}finally{g(!1)}}},[]),w=y.useCallback(()=>{S(x.current).catch(()=>{})},[S]),N=y.useCallback(async A=>{p(A);try{const M=await je.getKnowledgeNode({id:A});if(!M.node){d(void 0);return}d({node:Hc(M.node,M.edges.length),edges:M.edges.map(D=>({fromId:D.fromId,toId:D.toId,type:D.type,metadata:Qz(D.metadataJson)}))})}catch{d(void 0)}},[]),T=y.useCallback(()=>{p(void 0),d(void 0)},[]),C=y.useCallback(async A=>{try{const M=await je.expandKnowledgeNode({id:A,depth:1});s(D=>{const z=new Map(D);for(const U of M.nodes)z.has(U.id)||z.set(U.id,Hc(U));return z}),r(D=>{const z=new Set(D.map(X=>`${X.source}:${X.target}:${X.type}`)),U=[];for(const X of M.edges){const Q=wp(X),P=`${Q.source}:${Q.target}:${Q.type}`;z.has(P)||U.push(Q)}return[...D,...U]})}catch{}},[]),R=y.useCallback(A=>!1,[]),B={onConnect:async()=>{},onDisconnect:()=>{},handleEvent:R};return{graphData:{nodes:[...t.values()],links:o},selectedNode:c,selectedId:u,loading:m,searchQuery:v,search:k,clearSearch:w,selectNode:N,clearSelection:T,expandNode:C,loadRecent:S,handleEvent:R,domainHook:B}}function t7(){const t=y.useRef("default");y.useEffect(()=>{typeof Notification>"u"||(t.current=Notification.permission)},[]);function s(r){if(r.type!=="notification.escalated")return!1;if(typeof Notification>"u")return!0;if(t.current==="default")return Notification.requestPermission().then(u=>{t.current=u}).catch(()=>{}),!0;if(t.current!=="granted")return!0;const c=r.payload,d=new Notification(c.title||"Agent needs input",{body:c.message||"An agent is waiting for your input.",tag:c.escalationId,icon:"/icon-192x192.png"});return d.onclick=()=>{window.focus(),c.taskUrl&&(window.location.href=c.taskUrl),d.close()},!0}return{handleEvent:s,domainHook:{onConnect:async()=>{},onDisconnect:()=>{},handleEvent:s}}}function n7(){const[t,s]=y.useState(""),[o,r]=y.useState(void 0),[c,d]=y.useState({}),u=Vz(),p=Gz(),m=Fz(),g=Zz(),v=Kz(),b=Yz(),x=Jz(),S=Wz(),k=Xz(),w=e7(),N=t7(),T=[u.domainHook,p.domainHook,m.domainHook,g.domainHook,v.domainHook,b.domainHook,x.domainHook,S.domainHook,k.domainHook,w.domainHook,N.domainHook],{connected:C}=Oz({onSessionEvent:P=>{p.handleSessionEvent({sessionId:P.sessionId,eventType:dx(P.type),timestamp:P.timestamp,content:P.content,raw:P.raw||void 0})},onDomainEvent:P=>{try{const re=JSON.parse(P.payloadJson);z({id:P.id,type:P.type,timestamp:P.timestamp,payload:re})}catch{console.warn("[grackle] Failed to parse domain event payloadJson:",P.payloadJson)}},onConnect:U,onDisconnect:X}),R="default_persona_id",B="onboarding_completed",A=y.useCallback(async P=>{const re=await je.setSetting({key:R,value:P});s(re.value)},[]),M=y.useCallback(async()=>{r(!0);try{await je.setSetting({key:B,value:"true"})}catch{}},[]),D=y.useCallback(async(P,re)=>{try{const H=await je.getUsage({scope:P,id:re}),oe=`${P}:${re}`;d(E=>({...E,[oe]:Hz(H)}))}catch{}},[]);function z(P){const re=P.payload.key,H=P.payload.value;if(P.type==="setting.changed"){re===R&&s(H??""),re===B&&r(H==="true");return}for(const oe of T)if(oe.handleEvent(P))break;(P.type==="environment.removed"||P.type==="environment.changed"||P.type==="task.started")&&p.loadSessions().catch(()=>{})}async function U(){for(const P of T)P.onConnect().catch(()=>{});try{const P=await je.getSetting({key:R});s(P.value)}catch{}try{const P=await je.getSetting({key:B});r(P.value==="true")}catch{}}function X(){T.forEach(P=>P.onDisconnect())}const Q=y.useCallback(()=>{u.loadEnvironments().catch(()=>{}),p.loadSessions().catch(()=>{}),m.loadWorkspaces().catch(()=>{}),b.loadTokens().catch(()=>{})},[u.loadEnvironments,p.loadSessions,m.loadWorkspaces,b.loadTokens]);return{connected:C,environments:{environments:u.environments,environmentsLoading:u.environmentsLoading,provisionStatus:u.provisionStatus,operationError:u.operationError,clearOperationError:u.clearOperationError,loadEnvironments:u.loadEnvironments,addEnvironment:u.addEnvironment,updateEnvironment:u.updateEnvironment,provisionEnvironment:u.provisionEnvironment,stopEnvironment:u.stopEnvironment,removeEnvironment:u.removeEnvironment,domainHook:u.domainHook},sessions:{sessions:p.sessions,sessionsLoading:p.sessionsLoading,events:p.events,eventsDropped:p.eventsDropped,lastSpawnedId:p.lastSpawnedId,taskSessions:p.taskSessions,spawn:p.spawn,sendInput:p.sendInput,kill:p.kill,stopGraceful:p.stopGraceful,loadSessionEvents:p.loadSessionEvents,clearEvents:p.clearEvents,loadTaskSessions:p.loadTaskSessions,domainHook:p.domainHook},workspaces:{workspaces:m.workspaces,workspacesLoading:m.workspacesLoading,workspaceCreating:m.workspaceCreating,loadWorkspaces:m.loadWorkspaces,createWorkspace:m.createWorkspace,archiveWorkspace:m.archiveWorkspace,updateWorkspace:m.updateWorkspace,domainHook:m.domainHook},tasks:{tasks:g.tasks,tasksLoading:g.tasksLoading,taskStartingId:g.taskStartingId,loadTasks:g.loadTasks,loadAllTasks:g.loadAllTasks,createTask:g.createTask,startTask:g.startTask,stopTask:g.stopTask,completeTask:g.completeTask,resumeTask:g.resumeTask,updateTask:g.updateTask,deleteTask:g.deleteTask,domainHook:g.domainHook},findings:{findings:v.findings,selectedFinding:v.selectedFinding,findingLoading:v.findingLoading,findingsLoading:v.findingsLoading,loadFindings:v.loadFindings,loadAllFindings:v.loadAllFindings,loadFinding:v.loadFinding,postFinding:v.postFinding,domainHook:v.domainHook},tokens:{tokens:b.tokens,tokensLoading:b.tokensLoading,loadTokens:b.loadTokens,setToken:b.setToken,deleteToken:b.deleteToken,domainHook:b.domainHook},credentials:{credentialProviders:x.credentialProviders,credentialsLoading:x.credentialsLoading,updateCredentialProviders:x.updateCredentialProviders,domainHook:x.domainHook},codespaces:{codespaces:S.codespaces,codespaceError:S.codespaceError,codespaceListError:S.codespaceListError,codespaceCreating:S.codespaceCreating,listCodespaces:S.listCodespaces,createCodespace:S.createCodespace,domainHook:S.domainHook},personas:{personas:k.personas,personasLoading:k.personasLoading,createPersona:k.createPersona,updatePersona:k.updatePersona,deletePersona:k.deletePersona,domainHook:k.domainHook},knowledge:w,appDefaultPersonaId:t,setAppDefaultPersonaId:A,onboardingCompleted:o,completeOnboarding:M,usageCache:c,loadUsage:D,refresh:Q}}function s7({children:t}){const s=n7();return i.jsx(eh.Provider,{value:s,children:t})}function a7(t,s){const o=y.useRef(null);y.useEffect(()=>{const r=o.current;if(o.current=t,r===null)return;const c=new Map;for(const u of r)c.set(u.id,u);const d=new Set;for(const u of t){d.add(u.id);const p=c.get(u.id);if(p&&p.status!==u.status&&u.status!=="sleeping"){if(u.status==="connecting"){s("Provisioning environment…","info");continue}u.status==="connected"?s("Environment connected","success"):u.status==="error"?s("Environment provision failed","error"):u.status==="disconnected"&&(p.status==="connected"?s("Environment disconnected","warning"):s("Environment stopped","info"))}}for(const u of r)d.has(u.id)||s("Environment removed","info")},[t,s])}function i7(t,s,o){const r=y.useRef(t);y.useEffect(()=>{t&&t!==r.current&&(o(t,"error"),s()),r.current=t},[t,s,o])}const o7={working:{message:"Task is now running",variant:"info"},paused:{message:"Task paused",variant:"warning"},complete:{message:"Task complete",variant:"success"},failed:{message:"Task failed to complete",variant:"error"}};function r7(t){return o7[t]}function l7(t,s){if(t===void 0)return[];const o=[],r=new Map;for(const d of t)r.set(d.id,d);const c=new Set;for(const d of s){c.add(d.id);const u=r.get(d.id);if(!u||u.status===d.status)continue;const p=r7(d.status);p&&o.push(p)}for(const d of t)c.has(d.id)||o.push({message:"Task deleted",variant:"info"});return o}function c7(t,s){const o=y.useRef(void 0);y.useEffect(()=>{const r=o.current;o.current=t;const c=l7(r,t);for(const d of c)s(d.message,d.variant)},[t,s])}const d7="_dashboard_16pzm_1",u7="_kpiStrip_16pzm_11",f7="_kpiCard_16pzm_23",p7="_kpiValue_16pzm_68",m7="_kpiLabel_16pzm_76",h7="_bodyGrid_16pzm_84",g7="_section_16pzm_96",v7="_sectionHeader_16pzm_109",y7="_sectionIcon_16pzm_118",b7="_sectionTitle_16pzm_123",x7="_sectionCount_16pzm_131",_7="_sectionBody_16pzm_138",k7="_emptyHint_16pzm_143",S7="_sessionRow_16pzm_150",T7="_sessionPrompt_16pzm_177",w7="_sessionEnv_16pzm_186",j7="_sessionRuntime_16pzm_192",N7="_sessionStatus_16pzm_198",C7="_statusDot_16pzm_207",E7="_attentionRow_16pzm_233",A7="_attentionTitle_16pzm_259",D7="_attentionMeta_16pzm_267",R7="_reasonBadge_16pzm_274",M7="_bottomGrid_16pzm_301",I7="_envRow_16pzm_312",O7="_envName_16pzm_323",B7="_envStatusBadge_16pzm_333",L7="_workspaceRow_16pzm_369",z7="_workspaceTop_16pzm_395",$7="_workspaceName_16pzm_401",U7="_workspaceCounts_16pzm_407",P7="_progressBar_16pzm_415",H7="_progressFill_16pzm_422",ce={dashboard:d7,kpiStrip:u7,kpiCard:f7,kpiValue:p7,kpiLabel:m7,bodyGrid:h7,section:g7,sectionHeader:v7,sectionIcon:y7,sectionTitle:b7,sectionCount:x7,sectionBody:_7,emptyHint:k7,sessionRow:S7,sessionPrompt:T7,sessionEnv:w7,sessionRuntime:j7,sessionStatus:N7,statusDot:C7,attentionRow:E7,attentionTitle:A7,attentionMeta:D7,reasonBadge:R7,bottomGrid:M7,envRow:I7,envName:O7,envStatusBadge:B7,workspaceRow:L7,workspaceTop:z7,workspaceName:$7,workspaceCounts:U7,progressBar:P7,progressFill:H7};function V7(){return i.jsxs("div",{className:ce.dashboard,"aria-hidden":"true",children:[i.jsx("div",{className:ce.kpiStrip,children:Array.from({length:4},(t,s)=>i.jsxs("div",{className:ce.kpiCard,children:[i.jsx(_e,{width:"3rem",height:"2rem"}),i.jsx(_e,{width:"80%",height:"0.75rem"})]},s))}),i.jsxs("div",{className:ce.bodyGrid,children:[i.jsxs("div",{className:ce.section,children:[i.jsxs("div",{className:ce.sectionHeader,children:[i.jsx(_e,{width:"1rem",height:"1rem",variant:"circular"}),i.jsx(_e,{width:"8rem",height:"0.75rem"}),i.jsx("span",{className:ce.sectionCount,children:i.jsx(_e,{width:"1rem",height:"0.75rem"})})]}),i.jsx("div",{className:ce.sectionBody,children:Array.from({length:3},(t,s)=>i.jsxs("div",{className:ce.sessionRow,style:{cursor:"default"},children:[i.jsx(_e,{width:"60%",height:"0.875rem"}),i.jsx(_e,{width:"4rem",height:"0.75rem"}),i.jsx(_e,{width:"3rem",height:"0.75rem"}),i.jsx(_e,{width:"3rem",height:"0.75rem"})]},s))})]}),i.jsxs("div",{className:ce.section,children:[i.jsxs("div",{className:ce.sectionHeader,children:[i.jsx(_e,{width:"1rem",height:"1rem",variant:"circular"}),i.jsx(_e,{width:"8rem",height:"0.75rem"}),i.jsx("span",{className:ce.sectionCount,children:i.jsx(_e,{width:"1rem",height:"0.75rem"})})]}),i.jsx("div",{className:ce.sectionBody,children:Array.from({length:2},(t,s)=>i.jsxs("div",{className:ce.attentionRow,style:{cursor:"default"},children:[i.jsxs("div",{className:ce.attentionTitle,children:[i.jsx(_e,{width:"3rem",height:"0.875rem",borderRadius:"var(--radius-sm)"}),i.jsx(_e,{width:"70%",height:"0.875rem"})]}),i.jsx("div",{className:ce.attentionMeta,children:i.jsx(_e,{width:"5rem",height:"0.625rem"})})]},s))})]})]}),i.jsxs("div",{className:ce.bottomGrid,children:[i.jsxs("div",{className:ce.section,children:[i.jsxs("div",{className:ce.sectionHeader,children:[i.jsx(_e,{width:"1rem",height:"1rem",variant:"circular"}),i.jsx(_e,{width:"9rem",height:"0.75rem"}),i.jsx("span",{className:ce.sectionCount,children:i.jsx(_e,{width:"1rem",height:"0.75rem"})})]}),i.jsx("div",{className:ce.sectionBody,children:Array.from({length:2},(t,s)=>i.jsxs("div",{className:ce.envRow,children:[i.jsx(_e,{width:"60%",height:"0.875rem"}),i.jsx(_e,{width:"4rem",height:"0.875rem",borderRadius:"var(--radius-sm)"})]},s))})]}),i.jsxs("div",{className:ce.section,children:[i.jsxs("div",{className:ce.sectionHeader,children:[i.jsx(_e,{width:"1rem",height:"1rem",variant:"circular"}),i.jsx(_e,{width:"6rem",height:"0.75rem"}),i.jsx("span",{className:ce.sectionCount,children:i.jsx(_e,{width:"1rem",height:"0.75rem"})})]}),i.jsx("div",{className:ce.sectionBody,children:Array.from({length:2},(t,s)=>i.jsxs("div",{className:ce.workspaceRow,style:{cursor:"default"},children:[i.jsxs("div",{className:ce.workspaceTop,children:[i.jsx(_e,{width:"50%",height:"0.875rem"}),i.jsx(_e,{width:"2rem",height:"0.75rem"})]}),i.jsx("div",{className:ce.progressBar,children:i.jsx("div",{className:ce.progressFill,style:{width:"0%"}})})]},s))})]})]})]})}const q7={hidden:{opacity:0,y:12},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.3,ease:"easeOut"}})},Vc={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:.15+t*.08,duration:.35,ease:"easeOut"}})};function G7(t,s,o,r){const c=[`${t} of ${s} tasks completed`];return o>0&&c.push(`${o} in progress`),r>0&&c.push(`${r} failed`),c.join(", ")}function qc({value:t,label:s,accent:o,index:r,testId:c}){return i.jsxs(Rt.div,{className:ce.kpiCard,"data-accent":o,"data-testid":c,variants:q7,initial:"hidden",animate:"visible",custom:r,children:[i.jsx("span",{className:ce.kpiValue,children:t}),i.jsx("span",{className:ce.kpiLabel,children:s})]})}function F7(){const{workspaces:{workspaces:t,workspacesLoading:s},tasks:{tasks:o,tasksLoading:r,loadTasks:c},sessions:{sessions:d,sessionsLoading:u},environments:{environments:p,environmentsLoading:m}}=ft(),g=_t(),v=y.useRef(new Set);y.useEffect(()=>{for(const N of t)v.current.has(N.id)||(v.current.add(N.id),c(N.id).catch(()=>{}))},[t,c]);const b=y.useMemo(()=>xz(d,o,p),[d,o,p]),x=y.useMemo(()=>kz(d,p),[d,p]),S=y.useMemo(()=>_z(o,t),[o,t]),k=y.useMemo(()=>Sz(t,o),[t,o,p]);return d.length===0&&o.length===0&&p.length===0&&t.length===0&&(u||r||m||s)?i.jsx(V7,{}):i.jsxs("div",{className:ce.dashboard,"data-testid":"dashboard",children:[i.jsxs("div",{className:ce.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[i.jsx(qc,{value:b.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),i.jsx(qc,{value:b.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),i.jsx(qc,{value:b.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),i.jsx(qc,{value:b.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),i.jsxs("div",{className:ce.bodyGrid,children:[i.jsxs(Rt.div,{className:ce.section,variants:Vc,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[i.jsxs("div",{className:ce.sectionHeader,children:[i.jsx("span",{className:ce.sectionIcon,"aria-hidden":"true",children:"●"}),i.jsx("span",{className:ce.sectionTitle,children:"Active Sessions"}),i.jsx("span",{className:ce.sectionCount,children:x.length})]}),i.jsx("div",{className:ce.sectionBody,children:x.length===0?i.jsx("div",{className:ce.emptyHint,children:"No active sessions"}):x.map(({session:N,environmentName:T})=>i.jsxs("button",{type:"button",className:ce.sessionRow,onClick:()=>g(hm(N.id)),"data-testid":"session-row",children:[i.jsx("span",{className:ce.sessionPrompt,title:N.prompt,children:N.prompt||"—"}),i.jsx("span",{className:ce.sessionEnv,children:T}),i.jsx("span",{className:ce.sessionRuntime,children:N.runtime}),i.jsxs("span",{className:ce.sessionStatus,children:[i.jsx("span",{className:ce.statusDot,"data-status":N.status}),N.status]})]},N.id))})]}),i.jsxs(Rt.div,{className:ce.section,variants:Vc,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[i.jsxs("div",{className:ce.sectionHeader,children:[i.jsx("span",{className:ce.sectionIcon,"aria-hidden":"true",children:"⚑"}),i.jsx("span",{className:ce.sectionTitle,children:"Needs Attention"}),i.jsx("span",{className:ce.sectionCount,children:S.length})]}),i.jsx("div",{className:ce.sectionBody,children:S.length===0?i.jsx("div",{className:ce.emptyHint,children:"All clear"}):S.map(({task:N,reason:T,workspaceName:C})=>i.jsxs("button",{type:"button",className:ce.attentionRow,onClick:()=>g(In(N.id)),"data-testid":"attention-row",children:[i.jsxs("div",{className:ce.attentionTitle,children:[i.jsx("span",{className:ce.reasonBadge,"data-reason":T,children:T}),N.title]}),i.jsx("div",{className:ce.attentionMeta,children:i.jsx("span",{children:C})})]},N.id))})]})]}),i.jsxs("div",{className:ce.bottomGrid,children:[i.jsxs(Rt.div,{className:ce.section,variants:Vc,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[i.jsxs("div",{className:ce.sectionHeader,children:[i.jsx("span",{className:ce.sectionIcon,"aria-hidden":"true",children:"◈"}),i.jsx("span",{className:ce.sectionTitle,children:"Environment Health"}),i.jsx("span",{className:ce.sectionCount,children:p.length})]}),i.jsx("div",{className:ce.sectionBody,children:p.length===0?i.jsx("div",{className:ce.emptyHint,children:"No environments configured"}):p.map(N=>i.jsxs("div",{className:ce.envRow,"data-testid":"dashboard-env-row",children:[i.jsx("span",{className:ce.envName,children:N.displayName}),i.jsx("span",{className:ce.envStatusBadge,"data-status":N.status,children:N.status})]},N.id))})]}),i.jsxs(Rt.div,{className:ce.section,variants:Vc,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[i.jsxs("div",{className:ce.sectionHeader,children:[i.jsx("span",{className:ce.sectionIcon,"aria-hidden":"true",children:"▦"}),i.jsx("span",{className:ce.sectionTitle,children:"Workspaces"}),i.jsx("span",{className:ce.sectionCount,children:t.length})]}),i.jsx("div",{className:ce.sectionBody,children:k.length===0?i.jsx("div",{className:ce.emptyHint,children:"No workspaces yet"}):k.map(({workspace:N,totalTasks:T,completedTasks:C,workingTasks:R,failedTasks:B})=>{const A=T>0?Math.round(C/T*100):0;return i.jsxs("button",{type:"button",className:ce.workspaceRow,onClick:()=>g(Ua(N.id,N.environmentId)),"data-testid":"workspace-row",children:[i.jsxs("div",{className:ce.workspaceTop,children:[i.jsx("span",{className:ce.workspaceName,children:N.name}),i.jsxs("span",{className:ce.workspaceCounts,"aria-label":G7(C,T,R,B),children:[C,"/",T,R>0&&i.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",R]}),B>0&&i.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",B]})]})]}),T>0&&i.jsx("div",{className:ce.progressBar,children:i.jsx("div",{className:ce.progressFill,style:{width:`${A}%`}})})]},N.id)})})]})]})]})}const Z7="_panelContainer_nkct0_1",K7="_emptyState_nkct0_8",Y7="_workspaceSummary_nkct0_17",J7="_workspaceSummaryTitle_nkct0_28",W7="_workspaceSummarySubtitle_nkct0_32",X7="_header_nkct0_36",Q7="_headerInfo_nkct0_71",e$="_headerTitle_nkct0_106",t$="_taskStatusBadge_nkct0_128",n$="_taskBranch_nkct0_137",s$="_taskBlockedBadge_nkct0_143",a$="_tabBar_nkct0_277",i$="_tab_nkct0_277",o$="_active_nkct0_303",r$="_eventScroll_nkct0_308",l$="_tabContent_nkct0_314",c$="_noContext_nkct0_319",d$="_overviewContent_nkct0_325",u$="_overviewDashboard_nkct0_334",f$="_overviewHero_nkct0_340",p$="_overviewSection_nkct0_347",m$="_overviewLabel_nkct0_353",h$="_envRow_nkct0_360",g$="_timeline_nkct0_366",v$="_timelineRow_nkct0_372",y$="_waitingMessage_nkct0_379",b$="_errorMessage_nkct0_383",x$="_emptyCta_nkct0_387",_$="_ctaTitle_nkct0_399",k$="_ctaDescription_nkct0_405",S$="_ctaButton_nkct0_412",T$="_workspaceHeader_nkct0_533",w$="_workspaceName_nkct0_558",j$="_workspaceMeta_nkct0_571",N$="_metaRow_nkct0_579",C$="_metaLabel_nkct0_592",E$="_metaValue_nkct0_607",A$="_archiveButton_nkct0_617",D$="_repoLink_nkct0_647",R$="_metaToggle_nkct0_657",M$="_metaToggleArrow_nkct0_678",I$="_metaToggleArrowOpen_nkct0_683",O$="_progressBarContainer_nkct0_687",B$="_progressBar_nkct0_687",L$="_progressFill_nkct0_703",z$="_progressLabel_nkct0_710",$$="_metaTimestamps_nkct0_717",U$="_metaTimestamp_nkct0_717",P$="_metaPlaceholder_nkct0_739",H$="_linkedEnvList_nkct0_744",V$="_linkedEnvChip_nkct0_750",Y={panelContainer:Z7,emptyState:K7,workspaceSummary:Y7,workspaceSummaryTitle:J7,workspaceSummarySubtitle:W7,header:X7,headerInfo:Q7,headerTitle:e$,taskStatusBadge:t$,taskBranch:n$,taskBlockedBadge:s$,tabBar:a$,tab:i$,active:o$,eventScroll:r$,tabContent:l$,noContext:c$,overviewContent:d$,overviewDashboard:u$,overviewHero:f$,overviewSection:p$,overviewLabel:m$,envRow:h$,timeline:g$,timelineRow:v$,waitingMessage:y$,errorMessage:b$,emptyCta:x$,ctaTitle:_$,ctaDescription:k$,ctaButton:S$,workspaceHeader:T$,workspaceName:w$,workspaceMeta:j$,metaRow:N$,metaLabel:C$,metaValue:E$,archiveButton:A$,repoLink:D$,metaToggle:R$,metaToggleArrow:M$,metaToggleArrowOpen:I$,progressBarContainer:O$,progressBar:B$,progressFill:L$,progressLabel:z$,metaTimestamps:$$,metaTimestamp:U$,metaPlaceholder:P$,linkedEnvList:H$,linkedEnvChip:V$};function q$(){return i.jsx("div",{className:Y.emptyState,children:"Select a task or click + to create one"})}function G$(){return i.jsx("div",{className:Y.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function F$(){const{workspaces:{workspaces:t},environments:{environments:s}}=ft(),o=_t(),r=s.length>0;return t.length>0?i.jsx(F7,{}):i.jsxs("div",{className:Y.emptyCta,"data-testid":"welcome-cta",children:[i.jsx("div",{className:Y.ctaTitle,children:"Welcome to Grackle"}),i.jsx("div",{className:Y.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),i.jsx("button",{className:Y.ctaButton,onClick:()=>o(Ox),disabled:!r,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!r&&i.jsx("div",{className:Y.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const Z$="_panelContainer_19poq_1",K$="_chatHeader_19poq_8",Y$="_chatHeaderInfo_19poq_37",J$="_emptyState_19poq_43",W$="_emptyTitle_19poq_55",X$="_emptyDescription_19poq_61",Q$="_emptyHint_19poq_67",La={panelContainer:Z$,chatHeader:K$,chatHeaderInfo:Y$,emptyState:J$,emptyTitle:W$,emptyDescription:X$,emptyHint:Q$};function eU(){return i.jsx("div",{className:La.panelContainer,"aria-hidden":"true",children:i.jsxs("div",{style:{flex:1,overflow:"hidden",padding:"var(--space-md)",display:"flex",flexDirection:"column",gap:"var(--space-md)"},children:[i.jsx(_e,{width:"65%",height:"2.5rem",borderRadius:"var(--radius-sm)"}),i.jsx(_e,{width:"85%",height:"4rem",borderRadius:"var(--radius-sm)"}),i.jsx(_e,{width:"45%",height:"2rem",borderRadius:"var(--radius-sm)"}),i.jsx(_e,{width:"75%",height:"3rem",borderRadius:"var(--radius-sm)"}),i.jsx(_e,{width:"55%",height:"2.5rem",borderRadius:"var(--radius-sm)"})]})})}function tU({hasLocalEnvironment:t}){return i.jsxs("div",{className:La.emptyState,"data-testid":"chat-empty-state",children:[i.jsx("div",{className:La.emptyTitle,children:"Welcome to Grackle"}),i.jsx("div",{className:La.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&&i.jsx("div",{className:La.emptyHint,children:"Go to Settings → Environments to add one."})]})}function nU(){const{tasks:{tasks:t,tasksLoading:s,startTask:o},sessions:{sessions:r,sessionsLoading:c,events:d,eventsDropped:u,taskSessions:p,loadTaskSessions:m,loadSessionEvents:g,kill:v,stopGraceful:b,sendInput:x,spawn:S},environments:{environments:k,provisionEnvironment:w},personas:{personas:N}}=ft(),{showToast:T}=Tn(),C=y.useRef(void 0),[R,B]=y.useState(),A=t.find(P=>P.id===Rr),M=A!=null&&A.latestSessionId?r.find(P=>P.id===A.latestSessionId)??(p[Rr]??[]).find(P=>P.id===A.latestSessionId):void 0;y.useEffect(()=>{m(Rr).catch(()=>{})},[m]),y.useEffect(()=>{A!=null&&A.latestSessionId&&m(Rr).catch(()=>{})},[A==null?void 0:A.latestSessionId,m]),y.useEffect(()=>{M&&M.id!==C.current&&(C.current=M.id,g(M.id).catch(()=>{}))},[M==null?void 0:M.id,g]);const D=y.useMemo(()=>{if(!M)return[];const P=d.filter(re=>re.sessionId===M.id);return sh(nh(P))},[d,M==null?void 0:M.id]),z=k.find(P=>P.adapterType==="local"&&P.status==="connected"),U=M!==void 0&&M.status!=="stopped"&&M.status!=="suspended",X=(M==null?void 0:M.status)==="idle";y.useEffect(()=>{R&&M&&X&&(x(M.id,R).catch(()=>{}),B(void 0))},[R,X,M==null?void 0:M.id,x]);const Q=y.useCallback((P,re,H,oe)=>{oe&&B(oe),o(P,re,H).catch(()=>{})},[o]);return!A&&(c||s)?i.jsx(eU,{}):i.jsxs("div",{className:La.panelContainer,"data-testid":"chat-page",children:[U&&i.jsxs("div",{className:La.chatHeader,children:[i.jsxs("span",{className:La.chatHeaderInfo,children:["Session: ",M.id.slice(0,8)," | ",M.runtime," | ",M.status]}),i.jsx(Lx,{label:"Stop",onClick:()=>{b(M.id).catch(()=>{})},variant:"danger",size:"sm","data-testid":"stop-split-button",options:[{label:"Stop",description:"Graceful shutdown",onClick:()=>{b(M.id).catch(()=>{})}},{label:"Kill",description:"Force kill",onClick:()=>{v(M.id).catch(()=>{})}}]})]}),i.jsx(Wm,{events:D,eventsDropped:u,emptyState:i.jsx(tU,{hasLocalEnvironment:!!z}),onShowToast:T}),z&&U&&i.jsx(Qr,{mode:"send",sessionId:M.id,environmentId:M.environmentId,personas:N,environments:k,onSendInput:(P,re)=>{x(P,re).catch(()=>{})},onSpawn:(P,re,H)=>{S(P,re,H).catch(()=>{})},onStartTask:(P,re,H)=>{o(P,re,H).catch(()=>{})},onProvisionEnvironment:P=>{w(P).catch(()=>{})},onShowToast:T}),z&&!U&&i.jsx(Qr,{mode:"start",taskId:Rr,environmentId:z.id,personas:N,environments:k,onSendInput:(P,re)=>{x(P,re).catch(()=>{})},onSpawn:(P,re,H)=>{S(P,re,H).catch(()=>{})},onStartTask:Q,onProvisionEnvironment:P=>{w(P).catch(()=>{})},onShowToast:T})]})}function sU(){const t=pz(),[s]=mm(),o=s.get("env")??"",{sessions:{sendInput:r,spawn:c},tasks:{startTask:d},personas:{personas:u},environments:{environments:p,provisionEnvironment:m}}=ft(),{showToast:g}=Tn();return i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(Ns,{segments:t}),i.jsx("div",{className:Y.emptyState,children:"Enter a prompt below to start a new session"}),i.jsx(Qr,{mode:"spawn",environmentId:o,showPersonaSelect:!0,personas:u,environments:p,onSendInput:(v,b)=>{r(v,b).catch(()=>{})},onSpawn:(v,b,x)=>{c(v,b,x).catch(()=>{})},onStartTask:(v,b,x)=>{d(v,b,x).catch(()=>{})},onProvisionEnvironment:v=>{m(v).catch(()=>{})},onShowToast:g})]})}function aU(){return i.jsxs("div",{className:Y.panelContainer,"aria-hidden":"true",children:[i.jsxs("div",{className:Y.header,children:[i.jsx("span",{children:i.jsx(_e,{width:"10rem",height:"0.875rem"})}),i.jsx("span",{className:Y.headerInfo,children:i.jsx(_e,{width:"16rem",height:"0.875rem"})})]}),i.jsx("div",{className:Y.eventScroll,children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-md)"},children:[i.jsx(_e,{width:"70%",height:"2.5rem",borderRadius:"var(--radius-sm)"}),i.jsx(_e,{width:"90%",height:"4rem",borderRadius:"var(--radius-sm)"}),i.jsx(_e,{width:"50%",height:"2rem",borderRadius:"var(--radius-sm)"}),i.jsx(_e,{width:"80%",height:"3.5rem",borderRadius:"var(--radius-sm)"}),i.jsx(_e,{width:"60%",height:"2.5rem",borderRadius:"var(--radius-sm)"})]})})]})}function iU({sessionId:t,session:s,isActive:o,onStop:r,onKill:c}){return i.jsxs("div",{className:Y.header,children:[i.jsxs("span",{children:["Session: ",t.slice(0,8),s&&` | ${s.runtime} | ${s.endReason||s.status}`,s!=null&&s.inputTokens||s!=null&&s.outputTokens||s!=null&&s.costUsd?` | ${Mo((s.inputTokens??0)+(s.outputTokens??0))} tokens · ${Ss(s.costUsd??0)}`:""]}),i.jsxs("span",{className:Y.headerInfo,children:[s&&i.jsx("span",{children:s.prompt.length>60?s.prompt.slice(0,60)+"...":s.prompt}),o&&i.jsx(Lx,{label:"Stop",onClick:r,variant:"danger",size:"sm","data-testid":"stop-split-button",options:[{label:"Stop",description:"Graceful shutdown",onClick:r},{label:"Kill",description:"Force kill",onClick:c}]})]})]})}function oU({session:t}){const s=t&&(t.status==="stopped"||t.status==="suspended"),o=s?`Session ${t.endReason||t.status} with no events recorded.`:"Waiting for events...";return i.jsx("div",{className:s?Y.errorMessage:Y.waitingMessage,children:o})}function rU(){const{sessionId:t}=ms(),{sessions:{events:s,eventsDropped:o,sessions:r,sessionsLoading:c,kill:d,stopGraceful:u,loadSessionEvents:p,sendInput:m,spawn:g},tasks:{startTask:v},personas:{personas:b},environments:{environments:x,provisionEnvironment:S}}=ft(),{showToast:k}=Tn(),w=y.useRef(void 0),N=mz(t),T=r.find(B=>B.id===t)??void 0,C=y.useMemo(()=>{const B=t?s.filter(A=>A.sessionId===t):[];return sh(nh(B))},[s,t]);if(y.useEffect(()=>{t&&t!==w.current&&(w.current=t,p(t).catch(()=>{}))},[t,p]),!T&&c)return i.jsx(aU,{});if(!t)return i.jsx("div",{className:Y.emptyState,children:"No session selected"});const R=(T==null?void 0:T.status)==="running"||(T==null?void 0:T.status)==="idle";return i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(Ns,{segments:N}),i.jsx(iU,{sessionId:t,session:T,isActive:R,onStop:()=>{u(t).catch(()=>{})},onKill:()=>{d(t).catch(()=>{})}}),i.jsx(Wm,{events:C,eventsDropped:o,emptyState:i.jsx(oU,{session:T}),onShowToast:k}),R&&i.jsx(Qr,{mode:"send",sessionId:t,environmentId:T.environmentId,personas:b,environments:x,onSendInput:(B,A)=>{m(B,A).catch(()=>{})},onSpawn:(B,A,M)=>{g(B,A,M).catch(()=>{})},onStartTask:(B,A,M)=>{v(B,A,M).catch(()=>{})},onProvisionEnvironment:B=>{S(B).catch(()=>{})},onShowToast:k})]})}function lU(t){if(!t)return!1;const s=t.tagName;return!!(s==="INPUT"||s==="TEXTAREA"||s==="SELECT"||t.isContentEditable)}function ea(t,s){const o=y.useRef(s);o.current=s;const{key:r,ctrl:c=!1,shift:d=!1,suppressInInputs:u=!0,enabled:p=!0}=t;y.useEffect(()=>{if(!p)return;const m=g=>{if(u&&lU(document.activeElement??void 0))return;const v=g.ctrlKey||g.metaKey;c===v&&(d&&!g.shiftKey||g.key===r&&o.current())};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[r,c,d,u,p])}function cU(){return i.jsxs("div",{className:Y.panelContainer,"aria-hidden":"true",children:[i.jsx("div",{className:Y.workspaceHeader,children:i.jsx("span",{className:Y.workspaceName,children:i.jsx(_e,{width:"12rem",height:"1.25rem"})})}),i.jsx("div",{className:Y.metaToggle,style:{cursor:"default"},children:i.jsx(_e,{width:"4rem",height:"0.625rem"})}),i.jsxs("div",{className:Y.progressBarContainer,children:[i.jsx("div",{className:Y.progressBar,children:i.jsx("div",{className:Y.progressFill,style:{width:"0%"}})}),i.jsx(_e,{width:"2rem",height:"0.625rem"})]}),i.jsxs("div",{className:Y.tabBar,role:"tablist","aria-label":"Workspace view",children:[i.jsx("span",{className:`${Y.tab} ${Y.active}`,children:"Graph"}),i.jsx("span",{className:Y.tab,children:"Board"}),i.jsx("span",{className:Y.tab,children:"Tasks"})]}),i.jsx("div",{className:Y.overviewContent,children:Array.from({length:3},(t,s)=>i.jsx(cd,{lines:2},s))})]})}function Xb(t){if(!t)return"";const s=new Date(t);if(isNaN(s.getTime()))return"";const r=Date.now()-s.getTime();if(r<0)return"just now";const c=Math.floor(r/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const d=Math.floor(c/60);if(d<24)return`${d}h ago`;const u=Math.floor(d/24);return u<30?`${u}d ago`:s.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const Np=100;function dU(t){try{const s=new URL(t);return s.protocol!=="http:"&&s.protocol!=="https:"?void 0:s.toString()}catch{return}}function uU(){const{workspaceId:t,environmentId:s}=ms(),o=_t(),{tasks:{tasks:r},environments:{environments:c},workspaces:{workspaces:d,workspacesLoading:u,archiveWorkspace:p,updateWorkspace:m},personas:{personas:g},sessions:{sessions:v},usageCache:b,loadUsage:x}=ft(),{resolvedThemeId:S}=M1(),[k,w]=y.useState("tasks"),[N,T]=y.useState(!1),[C,R]=y.useState(null),[B,A]=y.useState(!1),M=y.useRef(void 0),D=d.find(E=>E.id===t),z=s??(D==null?void 0:D.environmentId)??"",U=hz(t,z,d,c);ea({key:"1"},()=>w("graph")),ea({key:"2"},()=>w("board")),ea({key:"3"},()=>w("tasks")),y.useEffect(()=>{const E=M.current;M.current=t,!(E===void 0||E===t)&&C!==null&&R(null)},[t,C]);const X=v.reduce((E,F)=>E+(F.costUsd??0),0);y.useEffect(()=>{t&&x("workspace",t).catch(()=>{})},[t,x,X]);const Q=t?b[`workspace:${t}`]:void 0,P=r.filter(E=>E.workspaceId===t),re=P.filter(E=>E.status==="complete").length,H=P.length,oe=H>0?Math.round(re/H*100):0;return!D&&u?i.jsx(cU,{}):i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(Ns,{segments:U}),i.jsxs("div",{className:Y.workspaceHeader,children:[i.jsx("span",{className:Y.workspaceName,"data-testid":"workspace-name",children:i.jsx(ln,{value:(D==null?void 0:D.name)||"",onSave:E=>{D&&m(D.id,{name:E}).catch(()=>{})},validate:E=>{const F=E.trim();if(!F)return"Name is required";if(F.length>Np)return`Max ${Np} characters`},maxLength:Np,fieldId:"name",activeFieldId:C,onActivate:R,ariaLabel:"Workspace name",renderDisplay:E=>E||t||void 0,"data-testid":"edit-name"})}),i.jsx("button",{className:Y.archiveButton,onClick:()=>T(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),i.jsxs("button",{className:Y.metaToggle,onClick:()=>A(!B),"aria-expanded":!B,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[i.jsx("span",{className:`${Y.metaToggleArrow} ${B?"":Y.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!B&&i.jsxs("div",{className:Y.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Description"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(Xp,{value:(D==null?void 0:D.description)||"",onSave:E=>{D&&m(D.id,{description:E}).catch(()=>{})},fieldId:"description",activeFieldId:C,onActivate:R,renderDisplay:E=>E?i.jsx("span",{className:Y.overviewMarkdown,children:i.jsx(md,{remarkPlugins:[hd],children:E})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Repository"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(ln,{value:(D==null?void 0:D.repoUrl)||"",onSave:E=>{D&&m(D.id,{repoUrl:E}).catch(()=>{})},validate:E=>{const F=E.trim();if(F&&!/^https?:\/\/.+/.test(F))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:C,onActivate:R,renderDisplay:E=>{const F=dU(E);return F?i.jsx("a",{className:Y.repoLink,href:F,target:"_blank",rel:"noopener noreferrer",onClick:ae=>ae.stopPropagation(),children:E}):E?i.jsx("span",{children:E}):void 0},placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Environment"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(D4,{value:(D==null?void 0:D.environmentId)||"",onSave:E=>{D&&E&&m(D.id,{environmentId:E}).catch(()=>{})},environments:c,fieldId:"environmentId",activeFieldId:C,onActivate:R,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Linked Envs"}),i.jsx("div",{className:Y.metaValue,"data-testid":"linked-environments",children:D&&D.linkedEnvironmentIds.filter(E=>E!==D.environmentId).length>0?i.jsx("span",{className:Y.linkedEnvList,children:[...new Set(D.linkedEnvironmentIds.filter(E=>E!==D.environmentId))].map(E=>{const F=c.find(ae=>ae.id===E);return i.jsx("span",{className:Y.linkedEnvChip,"data-testid":`linked-env-${E}`,children:(F==null?void 0:F.displayName)||E},E)})}):i.jsx("span",{className:Y.metaPlaceholder,children:"None"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Persona"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(dd,{value:(D==null?void 0:D.defaultPersonaId)||"",onSave:E=>{D&&m(D.id,{defaultPersonaId:E}).catch(()=>{})},options:[{value:"",label:"(Inherit)"},...g.map(E=>({value:E.id,label:E.name}))],fieldId:"defaultPersonaId",activeFieldId:C,onActivate:R,renderDisplay:E=>{const F=g.find(ae=>ae.id===E);if(F)return i.jsx("span",{children:F.name})},placeholder:(D==null?void 0:D.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Worktrees"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(S4,{checked:(D==null?void 0:D.useWorktrees)??!0,onChange:E=>{D&&m(D.id,{useWorktrees:E}).catch(()=>{})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Working Dir"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(ln,{value:(D==null?void 0:D.workingDirectory)||"",onSave:E=>{D&&m(D.id,{workingDirectory:E}).catch(()=>{})},fieldId:"workingDirectory",activeFieldId:C,onActivate:R,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-working-directory"})})]}),D&&i.jsxs("div",{className:Y.metaTimestamps,children:[i.jsxs("span",{className:Y.metaTimestamp,children:["Created ",Xb(D.createdAt)]}),D.updatedAt&&D.updatedAt!==D.createdAt&&i.jsxs("span",{className:Y.metaTimestamp,children:["· Updated ",Xb(D.updatedAt)]})]})]}),H>0&&i.jsxs("div",{className:Y.progressBarContainer,"data-testid":"progress-bar",children:[i.jsx("div",{className:Y.progressBar,children:i.jsx("div",{className:Y.progressFill,style:{width:`${oe}%`}})}),i.jsxs("span",{className:Y.progressLabel,children:[re,"/",H]})]}),Q&&Q.costUsd>0&&i.jsx("div",{className:Y.progressBarContainer,children:i.jsxs("span",{className:Y.progressLabel,children:["Usage: ",Ss(Q.costUsd)," (",Q.sessionCount," session",Q.sessionCount!==1?"s":"",")"]})}),D&&(D.tokenBudget>0||D.costBudgetMillicents>0)&&i.jsx("div",{className:Y.progressBarContainer,children:i.jsxs("span",{className:Y.progressLabel,children:["Budget:"," ",D.tokenBudget>0&&i.jsxs(i.Fragment,{children:["Tokens: ",Mo(((Q==null?void 0:Q.inputTokens)??0)+((Q==null?void 0:Q.outputTokens)??0))," / ",Mo(D.tokenBudget)]}),D.tokenBudget>0&&D.costBudgetMillicents>0&&" | ",D.costBudgetMillicents>0&&i.jsxs(i.Fragment,{children:["Cost: ",Ss((Q==null?void 0:Q.costUsd)??0)," / ",Ss(D.costBudgetMillicents/1e5)]})]})}),i.jsxs("div",{className:Y.tabBar,role:"tablist","aria-label":"Workspace view",children:[i.jsx("button",{role:"tab","aria-selected":k==="graph",className:`${Y.tab} ${k==="graph"?Y.active:""}`,onClick:()=>w("graph"),children:"Graph"}),i.jsx("button",{role:"tab","aria-selected":k==="board",className:`${Y.tab} ${k==="board"?Y.active:""}`,onClick:()=>w("board"),"data-testid":"board-tab",children:"Board"}),i.jsx("button",{role:"tab","aria-selected":k==="tasks",className:`${Y.tab} ${k==="tasks"?Y.active:""}`,onClick:()=>w("tasks"),children:"Tasks"})]}),k==="tasks"&&H>0&&i.jsxs("div",{className:Y.workspaceSummary,children:[i.jsx("span",{className:Y.workspaceSummaryTitle,children:`${re}/${H} tasks complete`}),i.jsx("span",{className:Y.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),k==="tasks"&&H===0&&i.jsxs("div",{className:Y.emptyCta,children:[i.jsx("button",{className:Y.ctaButton,onClick:()=>o(Ei(t,void 0,z)),children:"Create Task"}),i.jsx("div",{className:Y.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),k==="board"&&i.jsx(z8,{workspaceId:t,environmentId:z,tasks:r,sessions:v,personas:g,environments:c}),k==="graph"&&i.jsx(lN,{workspaceId:t,environmentId:z,tasks:r,resolvedThemeId:S}),i.jsx(ji,{isOpen:N,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{D&&(p(D.id).catch(()=>{}),o("/",{replace:!0})),T(!1)},onCancel:()=>T(!1)})]})}const fU="_container_3pgew_1",pU="_header_3pgew_8",mU="_headerTitle_3pgew_35",hU="_headerActions_3pgew_44",gU="_body_3pgew_51",vU="_btnPrimary_3pgew_63",yU="_btnGhost_3pgew_94",bU="_error_3pgew_116",Ia={container:fU,header:pU,headerTitle:mU,headerActions:hU,body:gU,btnPrimary:vU,btnGhost:yU,error:bU};function xU(t){const s={};return t.name.trim()||(s.name="Name is required"),t.repoUrl.trim()&&!/^https?:\/\/.+/i.test(t.repoUrl.trim())&&(s.repoUrl="Must be a valid http(s) URL"),t.environmentId||(s.environmentId="Environment is required"),Object.keys(s).length>0?s:void 0}const _U=[{label:"Home",url:wi},{label:"New Workspace",url:void 0}];function kU(){const[t]=mm(),s=t.get("environment")??void 0,{environments:{environments:o},personas:{personas:r},workspaces:{createWorkspace:c,workspaceCreating:d}}=ft(),{showToast:u}=Tn(),p=_t(),[m,g]=y.useState(()=>{var N;return Y8(void 0,s||((N=o[0])==null?void 0:N.id))}),[v,b]=y.useState(),[x,S]=y.useState();y.useEffect(()=>{s||m.environmentId||o.length===0||g(N=>{var T;return N.environmentId?N:{...N,environmentId:((T=o[0])==null?void 0:T.id)??""}})},[o,s,m.environmentId]);const k=()=>{const N=xU(m);if(N){b(N),S(void 0);return}b(void 0),S(void 0),c(m.name.trim(),m.description,m.repoUrl.trim(),m.environmentId,m.defaultPersonaId,m.useWorktrees,m.workingDirectory,()=>{u("Workspace created","success"),p(wi,{replace:!0})},T=>{S(T)}).catch(()=>{})},w=()=>{p(s?Ti(s):wi,{replace:!0})};return i.jsxs("div",{className:Ia.container,children:[i.jsxs("div",{className:Ia.header,children:[i.jsx("div",{className:Ia.headerTitle,children:i.jsx(Ns,{segments:_U})}),i.jsxs("div",{className:Ia.headerActions,children:[i.jsx("button",{className:Ia.btnGhost,onClick:w,disabled:d,"data-testid":"workspace-create-cancel",children:"Cancel"}),i.jsx("button",{className:Ia.btnPrimary,onClick:k,disabled:d||!m.name.trim()||!m.environmentId,"data-testid":"workspace-create-save",children:d?i.jsx(p1,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),i.jsxs("div",{className:Ia.body,children:[i.jsx(W8,{values:m,onChange:N=>{g(N),b(void 0),S(void 0)},environments:o,personas:r,errors:v,disabled:d,autoFocusName:!0}),x&&i.jsx("div",{className:Ia.error,"data-testid":"workspace-create-submit-error",children:x})]})]})}function Qb(){const{workspaceId:t,environmentId:s}=ms(),[o]=mm(),r=t??o.get("workspace")??"",c=o.get("parent")??void 0,{tasks:{tasks:d,createTask:u,updateTask:p},workspaces:{workspaces:m},personas:{personas:g}}=ft(),{showToast:v}=Tn();return i.jsx(j1,{mode:"new",workspaceId:r,parentTaskId:c,environmentId:s,tasks:d,workspaces:m,personas:g,onCreateTask:(b,x,S,k,w,N,T,C,R)=>{u(b,x,S,k,w,N,T,C,R).catch(()=>{})},onUpdateTask:(b,x,S,k,w)=>{p(b,x,S,k,w).catch(()=>{})},onShowToast:v})}function SU(){return i.jsxs("div",{className:Y.panelContainer,"aria-hidden":"true",children:[i.jsx("div",{className:Y.header,children:i.jsxs("span",{className:Y.headerTitle,children:[i.jsx(_e,{width:"12rem",height:"1rem"}),i.jsx(_e,{width:"4rem",height:"1rem",borderRadius:"var(--radius-full)"})]})}),i.jsxs("div",{className:Y.tabBar,role:"tablist","aria-label":"Task view",children:[i.jsx("span",{className:`${Y.tab} ${Y.active}`,children:"Overview"}),i.jsx("span",{className:Y.tab,children:"Stream"}),i.jsx("span",{className:Y.tab,children:"Findings"})]}),i.jsx("div",{className:Y.overviewContent,children:i.jsxs("div",{className:Y.overviewDashboard,children:[i.jsx("div",{className:Y.overviewHero,children:i.jsx(_e,{width:"5rem",height:"1.5rem",borderRadius:"var(--radius-full)"})}),i.jsxs("div",{className:Y.overviewSection,children:[i.jsx("div",{className:Y.overviewLabel,children:"Description"}),i.jsx(Wp,{lines:2})]}),i.jsxs("div",{className:Y.overviewSection,children:[i.jsx("div",{className:Y.overviewLabel,children:"Environment"}),i.jsxs("div",{className:Y.envRow,children:[i.jsx(_e,{width:"0.5rem",height:"0.5rem",variant:"circular"}),i.jsx(_e,{width:"8rem",height:"0.875rem"})]})]}),i.jsxs("div",{className:Y.overviewSection,children:[i.jsx("div",{className:Y.overviewLabel,children:"Dependencies"}),i.jsx(Wp,{lines:2})]}),i.jsxs("div",{className:Y.overviewSection,children:[i.jsx("div",{className:Y.overviewLabel,children:"Timeline"}),i.jsx("div",{className:Y.timeline,children:Array.from({length:4},(t,s)=>i.jsxs("div",{className:Y.timelineRow,children:[i.jsx(_e,{width:"4rem",height:"0.75rem"}),i.jsx(_e,{width:"10rem",height:"0.75rem"})]},s))})]})]})})]})}function Oa(){const{taskId:t,workspaceId:s,environmentId:o}=ms(),r=Zt(),c=_t(),{showToast:d}=Tn(),{sessions:{events:u,eventsDropped:p,sessions:m,loadSessionEvents:g,taskSessions:v,loadTaskSessions:b,sendInput:x,spawn:S,kill:k},tasks:{tasks:w,tasksLoading:N,startTask:T,stopTask:C,resumeTask:R,deleteTask:B,createTask:A,updateTask:M},environments:{environments:D,provisionEnvironment:z},findings:{findings:U,loadFindings:X},workspaces:{workspaces:Q},personas:{personas:P},usageCache:re,loadUsage:H}=ft(),oe=y.useRef(void 0),E=y.useRef(void 0),F=y.useRef(void 0),ae=y.useRef(void 0),me=y.useRef(void 0),de=r.pathname.endsWith("/stream")?"stream":r.pathname.endsWith("/findings")?"findings":"overview",Oe=r.pathname.endsWith("/edit"),[ke,Ee]=y.useState(de),[ze,ue]=y.useState(!1),[xe,he]=y.useState(void 0),[Le,mt]=y.useState(""),[vn,se]=y.useState(Oe),qe=y.useRef(de),Nt=y.useRef(Oe),J=w.find(De=>De.id===t),wt=(J==null?void 0:J.workspaceId)||void 0,Vt=Q.find(De=>De.id===wt);y.useEffect(()=>{de!==qe.current&&(qe.current=de,de!==ke&&Ee(de))},[de,ke]),y.useEffect(()=>{Oe!==Nt.current&&(Nt.current=Oe,Oe!==vn&&se(Oe))},[Oe,vn]),y.useEffect(()=>{if(Le===""){if(Vt!=null&&Vt.environmentId)mt(Vt.environmentId);else if(D.length>0){const De=D.find(Ye=>Ye.status==="connected");mt((De==null?void 0:De.id)??D[0].id)}}},[Le,Vt==null?void 0:Vt.environmentId,D]);const es=J?v[J.id]??[]:[];let pt;xe&&es.some(De=>De.id===xe)?pt=xe:pt=(J==null?void 0:J.latestSessionId)||void 0;const hs=()=>{ue(!0)},ia=()=>{if(!J)return;B(J.id).catch(()=>{}),ue(!1);const De=o??(Vt==null?void 0:Vt.environmentId);c(J.workspaceId&&De?Ua(J.workspaceId,De):"/",{replace:!0})};y.useEffect(()=>{(J==null?void 0:J.id)!==E.current&&(E.current=J==null?void 0:J.id,he(void 0),mt(""),se(Oe))},[J==null?void 0:J.id,Oe]),y.useEffect(()=>{if(!(J!=null&&J.id))return;const De=J.id!==ae.current,Ye=J.latestSessionId!==me.current;(De||Ye)&&(ae.current=J.id,me.current=J.latestSessionId,b(J.id).catch(()=>{}))},[J==null?void 0:J.id,J==null?void 0:J.latestSessionId,b]),y.useEffect(()=>{if((J==null?void 0:J.status)!==F.current){const De=F.current===void 0;F.current=J==null?void 0:J.status;const Ye=(J==null?void 0:J.status)==="not_started"?"overview":(J==null?void 0:J.status)==="working"||(J==null?void 0:J.status)==="paused"?"stream":(J==null?void 0:J.status)==="complete"?"findings":void 0;Ye&&Ye!==ke&&!(De&&de!=="overview")&&Ee(Ye)}},[J==null?void 0:J.status,ke,de]);const ts=y.useMemo(()=>new Map(w.map(De=>[De.id,De])),[w]),Za=y.useMemo(()=>{const De=pt?u.filter(Ye=>Ye.sessionId===pt):[];return sh(nh(De))},[u,pt]),oa=J?J.dependsOn.some(De=>{const Ye=ts.get(De);return Ye!==void 0&&Ye.status!=="complete"}):!1,Kt=y.useMemo(()=>gz(t,o,Q,D,ts),[t,o,Q,D,ts]);y.useEffect(()=>{pt&&pt!==oe.current&&(oe.current=pt,g(pt).catch(()=>{}))},[pt,g]),y.useEffect(()=>{ke==="findings"&&wt&&X(wt).catch(()=>{})},[ke,wt,X]);const Di=es.reduce((De,Ye)=>De+(Ye.costUsd??0),0);y.useEffect(()=>{J&&(H("task",J.id).catch(()=>{}),J.childTaskIds.length>0&&H("task_tree",J.id).catch(()=>{}))},[J==null?void 0:J.id,J==null?void 0:J.childTaskIds.length,H,Di]);const ra=J?`task:${J.id}`:"",Ka=ra in re?re[ra]:void 0,ns=J?`task_tree:${J.id}`:"",Ri=J&&J.childTaskIds.length>0&&ns in re?re[ns]:void 0,Ln=De=>{Ee(De),c(In(t,De==="overview"?void 0:De,s,o))};return ea({key:"1"},()=>Ln("overview")),ea({key:"2"},()=>Ln("stream")),ea({key:"3"},()=>Ln("findings")),!J&&N?i.jsx(SU,{}):i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(Ns,{segments:Kt}),i.jsxs("div",{className:Y.header,children:[i.jsxs("span",{className:Y.headerTitle,children:[i.jsx("span",{"data-testid":"task-title",children:(J==null?void 0:J.title)||t}),J&&i.jsx("span",{className:Y.taskStatusBadge,"data-testid":"task-status",children:J.status}),(J==null?void 0:J.branch)&&i.jsx("span",{className:Y.taskBranch,children:J.branch}),oa&&i.jsx("span",{className:Y.taskBlockedBadge,children:"blocked"})]}),J&&i.jsx(mB,{task:J,sessionId:pt,isBlocked:oa,onStart:()=>{T(J.id,void 0,Le).catch(()=>{})},onResume:()=>{R(J.id).catch(()=>{})},onStop:()=>{C(J.id).catch(()=>{})},onPause:()=>{pt&&k(pt).catch(()=>{})},onDelete:hs,onEdit:()=>se(!0)})]}),i.jsxs("div",{className:Y.tabBar,role:"tablist","aria-label":"Task view",children:[i.jsx("button",{role:"tab","aria-selected":ke==="overview",className:`${Y.tab} ${ke==="overview"?Y.active:""}`,onClick:()=>Ln("overview"),children:"Overview"}),i.jsx("button",{role:"tab","aria-selected":ke==="stream",className:`${Y.tab} ${ke==="stream"?Y.active:""}`,onClick:()=>Ln("stream"),children:"Stream"}),i.jsx("button",{role:"tab","aria-selected":ke==="findings",className:`${Y.tab} ${ke==="findings"?Y.active:""}`,onClick:()=>Ln("findings"),children:"Findings"})]}),i.jsxs(ps,{mode:"wait",children:[ke==="overview"&&i.jsx(Rt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:Y.overviewContent,"data-testid":"task-overview",children:vn&&J?i.jsx(j1,{mode:"edit",taskId:J.id,workspaceId:wt,environmentId:o,tasks:w,workspaces:Q,personas:P,onCreateTask:(De,Ye,Yt,kt,un,Jt,Mi,Ii,Oi)=>{A(De,Ye,Yt,kt,un,Jt,Mi,Ii,Oi).catch(()=>{})},onUpdateTask:(De,Ye,Yt,kt,un)=>{M(De,Ye,Yt,kt,un).catch(()=>{})},onEditDone:()=>{Oe?c(In(J.id,void 0,s,o),{replace:!0}):se(!1)},onShowToast:d}):J?i.jsx(tL,{task:J,tasksById:ts,environments:D,workspaces:Q,taskSessions:es,selectedEnvId:Le,taskUsage:Ka,treeUsage:Ri}):i.jsx("div",{className:Y.waitingMessage,children:"No additional details"})},"overview"),ke==="stream"&&i.jsxs(Rt.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:[i.jsx(C6,{taskSessions:es,selectedSessionId:pt,onSelect:De=>he(De)}),i.jsx(Wm,{events:Za,eventsDropped:p,emptyState:!pt&&J?oa?i.jsx("div",{className:Y.emptyCta,"data-testid":"stream-blocked-message",children:i.jsx("div",{className:Y.ctaDescription,children:"This task is blocked by incomplete dependencies"})}):i.jsxs("div",{className:Y.emptyCta,children:[i.jsx("button",{"data-testid":"stream-start-cta",className:Y.ctaButton,onClick:()=>{T(J.id,void 0,Le).catch(()=>{})},children:"Start Task"}),i.jsx("div",{className:Y.ctaDescription,children:"Click to begin agent execution"})]}):pt&&Za.length===0?i.jsx("div",{className:Y.waitingMessage,children:"Waiting for events..."}):void 0,onShowToast:d})]},"stream"),ke==="findings"&&i.jsx(Rt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:Y.tabContent,children:wt?i.jsx(T1,{findings:U.filter(De=>De.workspaceId===wt)}):i.jsx("div",{className:Y.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!J||J.status!=="working"&&J.status!=="paused")return;const De=pt?m.find(Ye=>Ye.id===pt):void 0;if(!(!De||De.status==="stopped"))return i.jsx(Qr,{mode:"send",sessionId:De.id,environmentId:De.environmentId,personas:P,environments:D,onSendInput:(Ye,Yt)=>{x(Ye,Yt).catch(()=>{})},onSpawn:(Ye,Yt,kt)=>{S(Ye,Yt,kt).catch(()=>{})},onStartTask:(Ye,Yt,kt)=>{T(Ye,Yt,kt).catch(()=>{})},onProvisionEnvironment:Ye=>{z(Ye).catch(()=>{})},onShowToast:d})})(),J&&i.jsx(ji,{isOpen:ze,title:"Delete Task?",description:`"${J.title}" will be permanently removed.`,onConfirm:ia,onCancel:()=>ue(!1)})]})}function TU(){const{environments:{environments:t,addEnvironment:s,updateEnvironment:o},codespaces:{codespaces:r,codespaceError:c,codespaceListError:d,codespaceCreating:u,listCodespaces:p,createCodespace:m}}=ft(),{showToast:g}=Tn();return i.jsx(N1,{mode:"new",environments:t,onAddEnvironment:(v,b,x)=>{s(v,b,x).catch(()=>{})},onUpdateEnvironment:(v,b)=>{o(v,b).catch(()=>{})},onListCodespaces:()=>{p().catch(()=>{})},codespaces:r,codespaceError:c,codespaceListError:d,codespaceCreating:u,onCreateCodespace:(v,b)=>{m(v,b).catch(()=>{})},onShowToast:g})}function wU(){const{environmentId:t}=ms(),{environments:{environments:s,addEnvironment:o,updateEnvironment:r},codespaces:{codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,listCodespaces:m,createCodespace:g}}=ft(),{showToast:v}=Tn();return i.jsx(N1,{mode:"edit",environmentId:t,environments:s,onAddEnvironment:(b,x,S)=>{o(b,x,S).catch(()=>{})},onUpdateEnvironment:(b,x)=>{r(b,x).catch(()=>{})},onListCodespaces:()=>{m().catch(()=>{})},codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,onCreateCodespace:(b,x)=>{g(b,x).catch(()=>{})},onShowToast:v})}const jU="_layout_11u79_1",NU="_content_11u79_8",CU="_tabPanel_11u79_14",Xr={layout:jU,content:NU,tabPanel:CU};function EU(){const t=fz();return i.jsxs("div",{className:Xr.layout,children:[i.jsx(Ns,{segments:t}),i.jsx("div",{className:Xr.content,children:i.jsx(qa,{})})]})}const AU="_container_13sb6_1",DU="_envHeader_13sb6_6",RU="_envTitleRow_13sb6_10",MU="_statusDot_13sb6_16",IU="_envName_13sb6_21",OU="_statusBadge_13sb6_27",BU="_envMeta_13sb6_33",LU="_metaTag_13sb6_39",zU="_actions_13sb6_51",$U="_provisionMessage_13sb6_59",UU="_errorMessage_13sb6_64",PU="_section_13sb6_69",HU="_sectionHeader_13sb6_73",VU="_cardList_13sb6_121",qU="_card_13sb6_121",GU="_cardHeader_13sb6_138",FU="_cardName_13sb6_144",ZU="_cardActions_13sb6_149",KU="_cardDescription_13sb6_154",YU="_cardMeta_13sb6_160",JU="_repoLink_13sb6_166",WU="_empty_13sb6_174",XU="_btnPrimary_13sb6_180",QU="_btnOutline_13sb6_214",eP="_btnSmall_13sb6_241",tP="_btnDanger_13sb6_267",we={container:AU,envHeader:DU,envTitleRow:RU,statusDot:MU,envName:IU,statusBadge:OU,envMeta:BU,metaTag:LU,actions:zU,provisionMessage:$U,errorMessage:UU,section:PU,sectionHeader:HU,cardList:VU,card:qU,cardHeader:GU,cardName:FU,cardActions:ZU,cardDescription:KU,cardMeta:YU,repoLink:JU,empty:WU,btnPrimary:XU,btnOutline:QU,btnSmall:eP,btnDanger:tP};function nP(){return i.jsxs("div",{className:we.container,"aria-hidden":"true",children:[i.jsxs("div",{className:we.envHeader,children:[i.jsxs("div",{className:we.envTitleRow,children:[i.jsx(_e,{width:"0.875rem",height:"0.875rem",variant:"circular"}),i.jsx(_e,{width:"12rem",height:"1.5rem"}),i.jsx(_e,{width:"4rem",height:"0.875rem"})]}),i.jsxs("div",{className:we.envMeta,children:[i.jsx(_e,{width:"6rem",height:"1.25rem",borderRadius:"var(--radius-sm)"}),i.jsx(_e,{width:"5rem",height:"1.25rem",borderRadius:"var(--radius-sm)"}),i.jsx(_e,{width:"4.5rem",height:"1.25rem",borderRadius:"var(--radius-sm)"})]})]}),i.jsxs("div",{className:we.actions,children:[i.jsx(_e,{width:"5rem",height:"2rem",borderRadius:"var(--radius-sm)"}),i.jsx(_e,{width:"4rem",height:"2rem",borderRadius:"var(--radius-sm)"})]}),i.jsxs("div",{className:we.section,children:[i.jsx("div",{className:we.sectionHeader,children:i.jsx("h3",{style:{margin:0},children:"Workspaces"})}),i.jsxs("div",{className:we.cardList,children:[i.jsx(cd,{lines:2}),i.jsx(cd,{lines:2})]})]})]})}const sP={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function aP(){const{environmentId:t}=ms(),s=_t(),{environments:{environments:o,environmentsLoading:r,provisionStatus:c,provisionEnvironment:d,stopEnvironment:u,removeEnvironment:p},workspaces:{workspaces:m,archiveWorkspace:g},sessions:{sessions:v}}=ft(),[b,x]=y.useState(!1),[S,k]=y.useState(!1),[w,N]=y.useState(void 0),T=o.find(H=>H.id===t);if(!T&&r)return i.jsx(nP,{});if(!t||!T)return i.jsx(fs,{to:Ro,replace:!0});const C=m.filter(H=>H.environmentId===T.id),R=m.filter(H=>H.linkedEnvironmentIds.includes(T.id)&&H.environmentId!==T.id).filter((H,oe,E)=>E.findIndex(F=>F.id===H.id)===oe),B=v.filter(H=>H.environmentId===T.id),A=B.reduce((H,oe)=>H+(oe.costUsd??0),0),M=sP[T.status]||"var(--text-tertiary)",D=T.status==="connected",z=T.status==="connecting",U=T.status==="disconnected"||T.status==="error"||T.status==="sleeping",X=T.id in c?c[T.id]:void 0,Q=()=>{p(T.id).catch(()=>{}),x(!1),s(Ro,{replace:!0})},P=()=>{k(!1),d(T.id,!0).catch(()=>{})},re=H=>{g(H).catch(()=>{}),N(void 0)};return i.jsxs("div",{className:we.container,children:[i.jsx(ji,{isOpen:b,title:"Delete Environment?",description:`"${T.displayName||T.id}" will be permanently removed along with all its data.`,onConfirm:Q,onCancel:()=>x(!1)}),i.jsx(ji,{isOpen:S,title:"Reprovision Environment?",description:"This will kill any active session and force a fresh provision cycle. The environment will be temporarily disconnected.",confirmLabel:"Reprovision",onConfirm:P,onCancel:()=>k(!1)}),i.jsxs("div",{className:we.envHeader,children:[i.jsxs("div",{className:we.envTitleRow,children:[i.jsx("span",{className:we.statusDot,style:{color:M},children:"●"}),i.jsx("h2",{className:we.envName,children:T.displayName||T.id}),i.jsx("span",{className:we.statusBadge,style:{color:M},children:T.status})]}),i.jsxs("div",{className:we.envMeta,children:[i.jsxs("span",{className:we.metaTag,children:["Adapter: ",T.adapterType]}),B.length>0&&i.jsxs("span",{className:we.metaTag,children:[B.length," session",B.length!==1?"s":""]}),A>0&&i.jsxs("span",{className:we.metaTag,children:["Cost: ",Ss(A)]})]})]}),i.jsxs("div",{className:we.actions,children:[D&&i.jsxs(i.Fragment,{children:[i.jsx("button",{className:we.btnPrimary,onClick:()=>s(Mx(T.id)),children:"New Chat"}),i.jsx("button",{className:we.btnOutline,onClick:()=>{u(T.id).catch(()=>{})},children:"Stop"}),i.jsx("button",{className:we.btnOutline,onClick:()=>k(!0),disabled:X!==void 0,"data-testid":"env-reprovision-btn",children:"Reprovision"})]}),U&&i.jsx("button",{className:we.btnPrimary,onClick:()=>{d(T.id).catch(()=>{})},children:T.status==="error"?"Retry":T.status==="sleeping"?"Wake":"Connect"}),z&&X!==void 0&&i.jsx("span",{className:we.provisionMessage,children:X.message}),T.status==="error"&&(X==null?void 0:X.stage)==="error"&&i.jsx("span",{className:we.errorMessage,children:X.message}),i.jsx("button",{className:we.btnOutline,onClick:()=>s(Xj(T.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),i.jsx("button",{className:we.btnDanger,onClick:()=>x(!0),children:"Delete"})]}),i.jsxs("div",{className:we.section,children:[i.jsxs("div",{className:we.sectionHeader,children:[i.jsx("h3",{children:"Workspaces"}),i.jsx("button",{className:we.btnPrimary,onClick:()=>s(`${Ox}?environment=${encodeURIComponent(T.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"})]}),C.length===0&&i.jsx("p",{className:we.empty,children:"No workspaces yet. Create one to get started."}),i.jsx("div",{className:we.cardList,children:C.map(H=>i.jsx(iP,{workspace:H,confirmArchiveId:w,onOpen:()=>s(Ua(H.id,T.id)),onArchive:()=>N(H.id),onConfirmArchive:()=>re(H.id),onCancelArchive:()=>N(void 0)},H.id))})]}),i.jsxs("div",{className:we.section,children:[i.jsx("div",{className:we.sectionHeader,children:i.jsx("h3",{children:"Linked Workspaces"})}),R.length===0&&i.jsx("p",{className:we.empty,"data-testid":"linked-workspaces-empty",children:"No workspaces are linked to this environment. Link one from a workspace's detail page."}),i.jsx("div",{className:we.cardList,"data-testid":"linked-workspaces-list",children:R.map(H=>{var oe;return i.jsxs("div",{className:we.card,"data-testid":"linked-workspace-card",children:[i.jsxs("div",{className:we.cardHeader,children:[i.jsx("strong",{className:we.cardName,children:H.name}),i.jsx("div",{className:we.cardActions,children:i.jsx("button",{className:we.btnSmall,onClick:()=>s(Ua(H.id,H.environmentId)),children:"Open"})})]}),H.description&&i.jsx("p",{className:we.cardDescription,children:H.description}),i.jsxs("div",{className:we.cardMeta,children:["Primary: ",((oe=o.find(E=>E.id===H.environmentId))==null?void 0:oe.displayName)||H.environmentId]})]},H.id)})})]})]})}function iP({workspace:t,confirmArchiveId:s,onOpen:o,onArchive:r,onConfirmArchive:c,onCancelArchive:d}){const u=s===t.id,p=t.repoUrl&&/^https?:\/\//.test(t.repoUrl);return i.jsxs("div",{className:we.card,"data-testid":"workspace-card",children:[i.jsxs("div",{className:we.cardHeader,children:[i.jsx("strong",{className:we.cardName,children:t.name}),i.jsxs("div",{className:we.cardActions,children:[i.jsx("button",{className:we.btnSmall,onClick:o,children:"Open"}),u?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:we.btnDanger,onClick:c,children:"Confirm"}),i.jsx("button",{className:we.btnSmall,onClick:d,children:"Cancel"})]}):i.jsx("button",{className:we.btnSmall,onClick:r,children:"Archive"})]})]}),t.description&&i.jsx("p",{className:we.cardDescription,children:t.description}),t.repoUrl&&i.jsx("div",{className:we.cardMeta,children:p?i.jsx("a",{href:t.repoUrl,target:"_blank",rel:"noopener noreferrer",className:we.repoLink,children:t.repoUrl}):i.jsx("span",{children:t.repoUrl})})]})}const oP={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About",shortcuts:"Shortcuts"};function rP(){const s=Zt().pathname.replace(/^\/settings\/?/,"").split("/")[0],o=oP[s],r=uz(o);return i.jsxs("div",{className:Xr.layout,children:[i.jsx(Ns,{segments:r}),i.jsx("div",{className:Xr.content,children:i.jsx("div",{className:Xr.tabPanel,children:i.jsx(qa,{})},s)})]})}function lP(){const{tokens:{tokens:t,setToken:s,deleteToken:o},credentials:{credentialProviders:r,updateCredentialProviders:c}}=ft(),{showToast:d}=Tn();return i.jsxs(i.Fragment,{children:[i.jsx(RL,{credentialProviders:r,onUpdateCredentialProviders:u=>{c(u).catch(()=>{})}}),i.jsx(UO,{tokens:t,onSetToken:(u,p,m,g,v)=>{s(u,p,m,g,v).catch(()=>{})},onDeleteToken:u=>{o(u).catch(()=>{})},onShowToast:d})]})}function cP(){const{personas:{personas:t,deletePersona:s},appDefaultPersonaId:o,setAppDefaultPersonaId:r}=ft(),{showToast:c}=Tn(),d=_t();return i.jsx(GL,{personas:t,appDefaultPersonaId:o,onDeletePersona:async u=>{try{await s(u)}catch(p){throw console.error("Failed to delete persona",{personaId:u,error:p}),c("Failed to delete persona","error"),p}},onSetAppDefaultPersonaId:async u=>{try{await r(u)}catch(p){console.error("Failed to set app default persona ID",{personaId:u,error:p}),c("Failed to set app default persona","error")}},onNavigateToNew:()=>d(eN),onNavigateToPersona:u=>d(Ix(u))})}const dP="_container_1ooin_1",uP="_form_1ooin_7",fP="_formActions_1ooin_75",pP="_editableSection_1ooin_82",mP="_defaultBadge_1ooin_93",hP="_typeToggle_1ooin_107",gP="_scriptEditor_1ooin_121",vP="_optional_1ooin_128",ds={container:dP,form:uP,formActions:fP,editableSection:pP,defaultBadge:mP,typeToggle:hP,scriptEditor:gP,optional:vP},ex=[{value:"claude-code",label:"claude-code"},{value:"codex",label:"codex"},{value:"copilot",label:"copilot"},{value:"goose",label:"goose"},{value:"stub",label:"stub"},{value:"claude-code-acp",label:"claude-code-acp (experimental)"},{value:"codex-acp",label:"codex-acp (experimental)"},{value:"copilot-acp",label:"copilot-acp (experimental)"}],tx=[{value:"genaiscript",label:"genaiscript"}],yP="0";function nx(){const{personaId:t}=ms(),s=_t(),{showToast:o}=Tn(),{personas:{personas:r,createPersona:c,updatePersona:d,deletePersona:u},appDefaultPersonaId:p,setAppDefaultPersonaId:m}=ft(),g=t===void 0,v=g?void 0:r.find(x=>x.id===t);if(!g&&r.length>0&&!v)return i.jsx(fs,{to:qf,replace:!0});const b=[{label:"Settings",url:Ao},{label:"Personas",url:qf},{label:g?"New Persona":(v==null?void 0:v.name)??"Persona",url:void 0}];return i.jsxs("div",{className:ds.container,children:[i.jsx(Ns,{segments:b}),i.jsx(bP,{existing:v,isNew:g,appDefaultPersonaId:p,onCreatePersona:c,onUpdatePersona:d,onDeletePersona:u,onSetAppDefaultPersonaId:m,onDone:()=>{s(qf)},showToast:o})]})}function bP({existing:t,isNew:s,appDefaultPersonaId:o,onCreatePersona:r,onUpdatePersona:c,onDeletePersona:d,onSetAppDefaultPersonaId:u,onDone:p,showToast:m}){const g=_t(),[v,b]=y.useState((t==null?void 0:t.name)??""),[x,S]=y.useState((t==null?void 0:t.description)??""),[k,w]=y.useState((t==null?void 0:t.systemPrompt)??""),[N,T]=y.useState((t==null?void 0:t.runtime)??"claude-code"),[C,R]=y.useState((t==null?void 0:t.model)??"sonnet"),[B,A]=y.useState((t==null?void 0:t.maxTurns)??0),[M,D]=y.useState((t==null?void 0:t.type)==="script"?"script":"agent"),[z,U]=y.useState((t==null?void 0:t.script)??""),[X,Q]=y.useState((t==null?void 0:t.allowedMcpTools)??[]),[P,re]=y.useState(!1),[H,oe]=y.useState(null),[E,F]=y.useState(!!s);y.useEffect(()=>{if(!s&&t&&!E){F(!0),b(t.name),S(t.description),w(t.systemPrompt);const se=t.type==="script"?"script":"agent";T(se==="script"?t.runtime||"genaiscript":t.runtime),R(t.model),A(t.maxTurns),D(se),U(t.script||""),Q(t.allowedMcpTools)}},[s,t,E]);const ae=se=>{D(se),se==="script"?T("genaiscript"):N==="genaiscript"&&T("claude-code")},me=!s&&t===void 0,de=v.trim().length>0&&!me&&k.trim().length>0&&(M==="script"?z.trim().length>0:!!N&&!!C),Oe=s&&de,ke=!s&&o===(t==null?void 0:t.id),Ee=!s&&t&&!ke&&M==="agent"&&!!N&&!!C,ze=(se,qe)=>{if(!se.trim())return`${qe} is required`},ue=se=>{if(se.preventDefault(),!(me||!de)){if(t){c(t.id,v,x,k,N,C,B,M,z).then(()=>{m("Persona updated","success"),p()},()=>{m("Failed to save persona","error")});return}r(v,x,k,N,C,B,M,z,X).then(qe=>{m("Persona created","success"),g(Ix(qe.id),{replace:!0})},()=>{m("Failed to save persona","error")})}},xe=()=>{t&&d(t.id).then(()=>{m("Persona deleted","success"),p()},()=>{m("Failed to delete persona","error")})},he=async(se,qe,Nt,J)=>se().then(()=>{qe(),m(Nt,"success")},()=>{m(J,"error")}),Le=(se,qe)=>{if(!t)return;const Nt=se==="type"?String(qe):M,J=se==="runtime"?String(qe):se==="type"?String(qe)==="script"?"genaiscript":N==="genaiscript"?"claude-code":N:N,wt=se==="model"?String(qe):C,Vt=se==="maxTurns"?Number(qe):B,es=se==="systemPrompt"?String(qe):k,pt=se==="script"?String(qe):z;he(()=>c(t.id,se==="name"?String(qe):v,se==="description"?String(qe):x,es,J,wt,Vt,Nt,pt),()=>{if(se==="type"){const hs=String(qe)==="script"?"script":"agent";D(hs),T(J)}se==="runtime"&&T(String(qe)),se==="name"&&b(String(qe)),se==="description"&&S(String(qe)),se==="systemPrompt"&&w(String(qe)),se==="model"&&R(String(qe)),se==="maxTurns"&&A(Number(qe)),se==="script"&&U(String(qe))},"Persona updated","Failed to update persona").catch(()=>{})},mt=se=>{ue(se)},vn=()=>{t&&u(t.id).then(()=>{m("Set as app default","success")},()=>{m("Failed to set app default","error")})};return i.jsxs(i.Fragment,{children:[me?i.jsxs("div",{className:ds.form,children:[i.jsx("h3",{children:"Edit Persona"}),i.jsx("p",{children:"Loading persona..."})]}):s?i.jsxs("form",{onSubmit:mt,className:ds.form,children:[i.jsx("h3",{children:"Create Persona"}),i.jsxs("div",{className:ds.typeToggle,"data-testid":"persona-type-toggle",children:[i.jsxs("label",{children:[i.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:M==="agent",onChange:()=>ae("agent")}),"Agent"]}),i.jsxs("label",{children:[i.jsx("input",{type:"radio",name:"personaType",value:"script",checked:M==="script",onChange:()=>ae("script")}),"Script"]})]}),i.jsxs("label",{children:["Name",i.jsx("input",{type:"text",value:v,onChange:se=>b(se.target.value),placeholder:M==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0,"data-testid":"persona-detail-name"})]}),i.jsxs("label",{children:["Description",i.jsx("input",{type:"text",value:x,onChange:se=>S(se.target.value),placeholder:"Brief description...","data-testid":"persona-detail-description"})]}),i.jsxs("label",{children:["Runtime",i.jsx("select",{value:N,onChange:se=>T(se.target.value),"data-testid":"persona-runtime-select",children:(M==="script"?tx:ex).map(se=>i.jsx("option",{value:se.value,children:se.label},se.value))})]}),M==="agent"&&i.jsxs(i.Fragment,{children:[i.jsxs("label",{children:["Model",i.jsx("input",{type:"text",value:C,onChange:se=>R(se.target.value),placeholder:"e.g. sonnet","data-testid":"persona-detail-model"})]}),i.jsxs("label",{children:["Max Turns",i.jsx("input",{type:"number",value:B,onChange:se=>A(parseInt(se.target.value,10)||0),min:0,"data-testid":"persona-detail-max-turns"})]}),i.jsxs("label",{children:["System Prompt",i.jsx("textarea",{value:k,onChange:se=>w(se.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0,"data-testid":"persona-detail-prompt"})]})]}),M==="script"&&i.jsxs(i.Fragment,{children:[i.jsxs("label",{children:["Model ",i.jsx("span",{className:ds.optional,children:"(optional)"}),i.jsx("input",{type:"text",value:C,onChange:se=>R(se.target.value),placeholder:"e.g. sonnet (leave empty for script-only)","data-testid":"persona-detail-model"})]}),i.jsxs("label",{children:["System Prompt",i.jsx("textarea",{value:k,onChange:se=>w(se.target.value),placeholder:"Context for the script...",rows:4,required:!0,"data-testid":"persona-detail-prompt"})]}),i.jsxs("label",{children:["Script",i.jsx("textarea",{value:z,onChange:se=>U(se.target.value),placeholder:`script({ model: "openai:gpt-4o" });
|
|
702
|
-
|
|
703
|
-
const grackle = await host.mcpServer({
|
|
704
|
-
id: "grackle",
|
|
705
|
-
url: env.vars.GRACKLE_MCP_URL,
|
|
706
|
-
});
|
|
707
|
-
|
|
708
|
-
$\`Summarize the current tasks.\`;`,rows:20,className:ds.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),M==="agent"&&i.jsxs("div",{children:[i.jsx("label",{children:"Allowed MCP Tools"}),i.jsx(qb,{selectedTools:X,onChange:Q})]}),i.jsxs("div",{className:ds.formActions,children:[i.jsx(Ws,{type:"submit",variant:"primary",size:"md",disabled:!Oe,"data-testid":"persona-detail-save",children:"Create"}),i.jsx(Ws,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Cancel"})]})]}):t?i.jsxs("div",{className:ds.form,children:[i.jsx("h3",{children:"Edit Persona"}),i.jsxs("div",{className:ds.formActions,children:[i.jsx(Ws,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Back to Personas"}),Ee&&i.jsx(Ws,{type:"button",variant:"ghost",size:"md",onClick:vn,"data-testid":"persona-detail-set-default",children:"Set as App Default"}),ke&&i.jsx("span",{className:ds.defaultBadge,children:"App Default"}),i.jsx(Ws,{type:"button",variant:"danger",size:"md",onClick:()=>re(!0),"data-testid":"persona-detail-delete",children:"Delete"})]}),i.jsxs("div",{className:ds.editableSection,children:[i.jsxs("label",{children:["Name",i.jsx(ln,{value:v,onSave:se=>{Le("name",se)},validate:se=>ze(se,"Name"),fieldId:"persona-name",activeFieldId:H,onActivate:oe,ariaLabel:"Persona name","data-testid":"persona-detail-name"})]}),i.jsxs("label",{children:["Description",i.jsx(ln,{value:x,onSave:se=>{Le("description",se)},fieldId:"persona-description",activeFieldId:H,onActivate:oe,placeholder:"Brief description...",ariaLabel:"Persona description","data-testid":"persona-detail-description"})]}),i.jsxs("label",{children:["Type",i.jsx(dd,{value:M,onSave:se=>{Le("type",se)},options:[{value:"agent",label:"Agent"},{value:"script",label:"Script"}],fieldId:"persona-type",activeFieldId:H,onActivate:oe,ariaLabel:"Persona type","data-testid":"persona-type-toggle"})]}),i.jsxs("label",{children:["Runtime",i.jsx(dd,{value:N,onSave:se=>{Le("runtime",se)},options:M==="script"?tx:ex,fieldId:"persona-runtime",activeFieldId:H,onActivate:oe,ariaLabel:"Persona runtime","data-testid":"persona-runtime"})]}),i.jsxs("label",{children:["Model",M==="script"?" (optional)":"",i.jsx(ln,{value:C,onSave:se=>{Le("model",se)},validate:M==="agent"?se=>ze(se,"Model"):void 0,fieldId:"persona-model",activeFieldId:H,onActivate:oe,placeholder:M==="script"?"e.g. sonnet (leave empty for script-only)":"e.g. sonnet",ariaLabel:"Persona model","data-testid":"persona-detail-model"})]}),i.jsxs("label",{children:["Max Turns",i.jsx(ln,{value:String(B),onSave:se=>{Le("maxTurns",parseInt(se,10)||0)},validate:se=>/^\d+$/.test(se.trim())?void 0:"Max Turns must be a non-negative integer",fieldId:"persona-max-turns",activeFieldId:H,onActivate:oe,placeholder:yP,ariaLabel:"Persona max turns","data-testid":"persona-detail-max-turns"})]}),i.jsxs("label",{children:["System Prompt",i.jsx(Xp,{value:k,onSave:se=>{Le("systemPrompt",se)},validate:se=>ze(se,"System Prompt"),fieldId:"persona-system-prompt",activeFieldId:H,onActivate:oe,placeholder:M==="script"?"Context for the script...":"You are a senior frontend engineer...",ariaLabel:"Persona system prompt","data-testid":"persona-detail-prompt"})]}),M==="script"&&i.jsxs("label",{children:["Script",i.jsx(Xp,{value:z,onSave:se=>{Le("script",se)},validate:se=>ze(se,"Script"),fieldId:"persona-script",activeFieldId:H,onActivate:oe,placeholder:`script({ model: "openai:gpt-4o" });
|
|
709
|
-
|
|
710
|
-
const grackle = await host.mcpServer({
|
|
711
|
-
id: "grackle",
|
|
712
|
-
url: env.vars.GRACKLE_MCP_URL,
|
|
713
|
-
});
|
|
714
|
-
|
|
715
|
-
$\`Summarize the current tasks.\`;`,ariaLabel:"Persona script","data-testid":"persona-script-editor"})]}),M==="agent"&&i.jsxs("div",{children:[i.jsx("label",{children:"Allowed MCP Tools"}),i.jsx(qb,{selectedTools:X,onChange:se=>{Q(se),he(()=>c(t.id,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,se),()=>{},"MCP tools updated","Failed to update MCP tools").catch(()=>{})}})]})]}),!Ee&&!ke&&i.jsx("p",{style:{fontSize:"var(--font-size-xs)",color:"var(--text-tertiary)",marginTop:"var(--space-xs)"},children:"Only agent personas with a runtime and model can be set as app default."})]}):null,i.jsx(ji,{isOpen:P,title:"Delete Persona?",description:`"${t==null?void 0:t.name}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:xe,onCancel:()=>re(!1)})]})}function xP(){const{themeId:t,resolvedThemeId:s,setTheme:o,preferSystem:r,setPreferSystem:c}=M1();return i.jsx(PO,{themeId:t,resolvedThemeId:s,onSetTheme:o,preferSystem:r,onSetPreferSystem:c})}function _P(){const[t,s]=y.useState(void 0);return y.useEffect(()=>{let o=!1;return(async()=>{try{const c=await je.getVersionStatus({});o||s({currentVersion:c.currentVersion,latestVersion:c.latestVersion,updateAvailable:c.updateAvailable,isDocker:c.isDocker})}catch{}})().catch(()=>{}),()=>{o=!0}},[]),t}function kP(){const{connected:t,environments:{environments:s},sessions:{sessions:o}}=ft(),r=_P();return i.jsxs(i.Fragment,{children:[r&&i.jsx(GI,{currentVersion:r.currentVersion,latestVersion:r.latestVersion,updateAvailable:r.updateAvailable,isDocker:r.isDocker}),i.jsx(HO,{connected:t,environments:s,sessions:o})]})}function SP(){return i.jsx(AL,{})}const sx=Ei();function TP(){const t=_t();return ea({key:"?"},()=>{t(tN)}),ea({key:"n"},()=>{t(sx)}),ea({key:"N"},()=>{t(sx)}),i.jsx(i.Fragment,{})}function hl(t){const s=oz();y.useLayoutEffect(()=>(s(t),()=>{s(void 0)}),[t,s])}function wP(){const{workspaces:{workspaces:t},tasks:{tasks:s}}=ft(),o=y.useMemo(()=>i.jsx(_I,{workspaces:t,tasks:s}),[t,s]);return hl(o),i.jsx(qa,{})}function jP(){const{environments:{environments:t}}=ft(),s=y.useMemo(()=>i.jsx(D5,{environments:t}),[t]);return hl(s),i.jsx(qa,{})}function NP(){const t=y.useMemo(()=>i.jsx(f8,{}),[]);return hl(t),i.jsx(qa,{})}function CP(){const{findings:{findings:t,loadFindings:s,loadAllFindings:o}}=ft(),{workspaceId:r,environmentId:c}=ms();y.useEffect(()=>{r?s(r).catch(()=>{}):o().catch(()=>{})},[r,s,o]);const d=y.useMemo(()=>i.jsx(H5,{findings:t,workspaceId:r,environmentId:c}),[t,r,c]);return hl(d),i.jsx(qa,{})}function EP(){const{knowledge:t,workspaces:{workspaces:s}}=ft(),o=y.useCallback(p=>{t.search(p).catch(()=>{})},[t]),r=y.useCallback(()=>{t.clearSearch()},[t]),c=y.useCallback(p=>{t.selectNode(p).catch(()=>{})},[t]),d=y.useCallback(p=>{t.loadRecent(p||void 0).catch(()=>{})},[t]),u=y.useMemo(()=>i.jsx(q4,{nodes:t.graphData.nodes,workspaces:s,loading:t.loading,searchQuery:t.searchQuery,onSearch:o,onClearSearch:r,onSelectNode:c,onWorkspaceChange:d}),[t,s,o,r,c,d]);return hl(u),i.jsx(qa,{})}const AP="_container_ce571_1",DP="_title_ce571_6",pd={container:AP,title:DP};function RP(){return i.jsxs("div",{className:pd.container,"aria-hidden":"true",children:[i.jsx("h1",{className:pd.title,children:"Findings"}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-sm)"},children:Array.from({length:4},(t,s)=>i.jsx(cd,{lines:3},s))})]})}function ax(){const{environmentId:t,workspaceId:s}=ms(),{findings:{findings:o,findingsLoading:r,loadFindings:c},workspaces:{workspaces:d},environments:{environments:u}}=ft(),p=_t();y.useEffect(()=>{s&&c(s).catch(()=>{})},[s,c]);const m=y.useCallback(v=>{p(Mp(v,s,t))},[p,s,t]);if(r)return i.jsx(RP,{});const g=s&&t?U1("Findings",s,t,d,u).slice(0,-1):yz();return i.jsxs("div",{className:pd.container,"data-testid":"findings-list-page",children:[i.jsx(Ns,{segments:g}),i.jsx("h1",{className:pd.title,children:"Findings"}),i.jsx(T1,{findings:o,onFindingClick:m})]})}const MP="_container_1wwpb_1",IP="_notFound_1wwpb_6",OP="_header_1wwpb_12",BP="_categoryBadge_1wwpb_19",LP="_title_1wwpb_28",zP="_content_1wwpb_35",$P="_tags_1wwpb_77",UP="_tag_1wwpb_77",PP="_meta_1wwpb_92",HP="_metaTimestamp_1wwpb_100",VP="_metaLink_1wwpb_105",hn={container:MP,notFound:IP,header:OP,categoryBadge:BP,title:LP,content:zP,tags:$P,tag:UP,meta:PP,metaTimestamp:HP,metaLink:VP};function ix(){const{findingId:t,environmentId:s,workspaceId:o}=ms(),{findings:{selectedFinding:r,findingLoading:c,loadFinding:d},workspaces:{workspaces:u},environments:{environments:p}}=ft(),m=_t();if(y.useEffect(()=>{t&&d(t).catch(()=>{})},[t,d]),c)return i.jsx("div",{className:hn.container,"data-testid":"finding-detail-page",children:i.jsx("div",{className:hn.notFound,children:"Loading..."})});if(!r)return i.jsx("div",{className:hn.container,"data-testid":"finding-detail-page",children:i.jsx("div",{className:hn.notFound,children:"Finding not found."})});const g=U1(r.title,o,s,u,p),v=ud(r.category);return i.jsxs("div",{className:hn.container,"data-testid":"finding-detail-page",children:[i.jsx(Ns,{segments:g}),i.jsxs("div",{className:hn.header,children:[i.jsx("span",{className:hn.categoryBadge,style:{background:v.bg,color:v.text},children:r.category}),i.jsx("h1",{className:hn.title,children:r.title})]}),r.content&&i.jsx("div",{className:hn.content,children:i.jsx(md,{remarkPlugins:[hd],children:r.content})}),r.tags.length>0&&i.jsx("div",{className:hn.tags,children:r.tags.map(b=>i.jsx("span",{className:hn.tag,children:b},b))}),i.jsxs("div",{className:hn.meta,children:[i.jsx("span",{className:hn.metaTimestamp,title:r.createdAt,children:Qm(r.createdAt)}),r.taskId&&i.jsx("button",{type:"button",className:hn.metaLink,onClick:()=>{m(In(r.taskId))},children:"View Task"}),r.sessionId&&i.jsx("button",{type:"button",className:hn.metaLink,onClick:()=>{m(hm(r.sessionId))},children:"View Session"})]})]})}const qP="_wizard_1260s_1",GP="_container_1260s_10",FP="_stepContent_1260s_19",ZP="_logoArea_1260s_28",KP="_logoImage_1260s_32",YP="_heading_1260s_41",JP="_tagline_1260s_49",WP="_subtitle_1260s_56",XP="_featureList_1260s_64",QP="_runtimeGrid_1260s_89",e9="_runtimeCard_1260s_101",t9="_runtimeName_1260s_133",n9="_runtimeDescription_1260s_139",s9="_buttonRow_1260s_144",a9="_primaryButton_1260s_151",i9="_ghostButton_1260s_185",o9="_dots_1260s_213",r9="_dot_1260s_213",Ze={wizard:qP,container:GP,stepContent:FP,logoArea:ZP,logoImage:KP,heading:YP,tagline:JP,subtitle:WP,featureList:XP,runtimeGrid:QP,runtimeCard:e9,runtimeName:t9,runtimeDescription:n9,buttonRow:s9,primaryButton:a9,ghostButton:i9,dots:o9,dot:r9};function l9({onNext:t}){return i.jsxs("div",{className:Ze.stepContent,"data-testid":"setup-welcome",children:[i.jsx("div",{className:Ze.logoArea,children:i.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:Ze.logoImage})}),i.jsx("h1",{className:Ze.heading,children:"Welcome to Grackle"}),i.jsx("p",{className:Ze.tagline,children:"Multi-agent orchestration for software teams"}),i.jsx("button",{type:"button",className:Ze.primaryButton,onClick:t,"data-testid":"setup-get-started",children:"Get Started"})]})}function c9({onNext:t,onBack:s}){return i.jsxs("div",{className:Ze.stepContent,"data-testid":"setup-about",children:[i.jsx("h2",{className:Ze.heading,children:"What is Grackle?"}),i.jsxs("ul",{className:Ze.featureList,children:[i.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),i.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),i.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),i.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),i.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),i.jsxs("div",{className:Ze.buttonRow,children:[i.jsx("button",{type:"button",className:Ze.ghostButton,onClick:s,children:"Back"}),i.jsx("button",{type:"button",className:Ze.primaryButton,onClick:t,"data-testid":"setup-about-next",children:"Next"})]})]})}const d9=[{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 u9({currentRuntime:t,onFinish:s,onBack:o,finishDisabled:r}){const[c,d]=y.useState(t||"claude-code");return y.useEffect(()=>{t&&d(t)},[t]),i.jsxs("div",{className:Ze.stepContent,"data-testid":"setup-runtime",children:[i.jsx("h2",{className:Ze.heading,children:"Choose Your Runtime"}),i.jsx("p",{className:Ze.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),i.jsx("div",{className:Ze.runtimeGrid,children:d9.map(u=>i.jsxs("button",{type:"button",className:Ze.runtimeCard,"data-selected":c===u.id,"aria-pressed":c===u.id,"data-testid":`runtime-card-${u.id}`,onClick:()=>d(u.id),children:[i.jsx("span",{className:Ze.runtimeName,children:u.name}),i.jsx("span",{className:Ze.runtimeDescription,children:u.description})]},u.id))}),i.jsxs("div",{className:Ze.buttonRow,children:[i.jsx("button",{type:"button",className:Ze.ghostButton,onClick:o,children:"Back"}),i.jsx("button",{type:"button",className:Ze.primaryButton,onClick:()=>{s(c)},disabled:r,"data-testid":"setup-runtime-next",children:"Next"})]})]})}function f9(){return typeof Notification<"u"}function p9({onFinish:t,onBack:s,finishDisabled:o}){const r=f9(),c=r&&Notification.permission!=="default";function d(){r&&Notification.requestPermission().catch(()=>{}),t()}return i.jsxs("div",{className:Ze.stepContent,"data-testid":"setup-notifications",children:[i.jsx("h2",{className:Ze.heading,children:"Stay in the Loop"}),i.jsx("p",{className:Ze.subtitle,children:"Grackle can send you a browser notification when an agent needs your input, so you never miss an important moment."}),c?i.jsx("p",{className:Ze.subtitle,children:Notification.permission==="granted"?"Notifications are already enabled.":"Notifications have been blocked. You can change this in your browser settings."}):null,i.jsxs("div",{className:Ze.buttonRow,children:[i.jsx("button",{type:"button",className:Ze.ghostButton,onClick:s,disabled:o,children:"Back"}),!c&&r?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:Ze.ghostButton,onClick:t,disabled:o,"data-testid":"setup-notifications-skip",children:"Skip"}),i.jsx("button",{type:"button",className:Ze.primaryButton,onClick:d,disabled:o,"data-testid":"setup-notifications-enable",children:"Enable Notifications"})]}):i.jsx("button",{type:"button",className:Ze.primaryButton,onClick:t,disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const m9=4,ox={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function h9(){const{personas:{personas:t,updatePersona:s},completeOnboarding:o,onboardingCompleted:r}=ft(),{showToast:c}=Tn(),d=_t(),[u,p]=y.useState(0),[m,g]=y.useState("claude-code"),[v,b]=y.useState(!1),x=t.find(w=>w.id==="claude-code"),S=y.useCallback(w=>{g(w),p(3)},[]),k=y.useCallback(()=>{const w=m;b(!0);const N=[];if(x&&w!==x.runtime){const C=ox[w]??"sonnet";N.push(s(x.id,void 0,void 0,void 0,w,C))}const T=t.find(C=>C.id===W0);if(T&&w!==T.runtime){const C=ox[w]??"sonnet";N.push(s(W0,void 0,void 0,void 0,w,C))}Promise.all(N).then(()=>o()).then(()=>{d("/",{replace:!0})},()=>{c("Failed to update runtime -- please try again","error"),b(!1)})},[m,x,t,s,o,d,c]);return r===!0?i.jsx(fs,{to:"/",replace:!0}):i.jsx("div",{className:Ze.wizard,"data-testid":"setup-wizard",children:i.jsxs("div",{className:Ze.container,children:[i.jsx(ps,{mode:"wait",children:i.jsxs(Rt.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&i.jsx(l9,{onNext:()=>p(1)}),u===1&&i.jsx(c9,{onNext:()=>p(2),onBack:()=>p(0)}),u===2&&i.jsx(u9,{currentRuntime:m,onFinish:S,onBack:()=>p(1),finishDisabled:!x}),u===3&&i.jsx(p9,{onFinish:k,onBack:()=>p(2),finishDisabled:v})]},u)}),i.jsx("div",{className:Ze.dots,children:Array.from({length:m9},(w,N)=>i.jsx("span",{className:Ze.dot,"data-active":N===u},N))})]})})}const g9="_root_zndgp_1",v9="_body_zndgp_7",y9="_main_zndgp_19",b9="_sidebarWrapper_zndgp_26",x9="_overlay_zndgp_51",Fr={root:g9,body:v9,main:y9,sidebarWrapper:b9,overlay:x9},_9=y.lazy(()=>AT(()=>import("./KnowledgePage-Bo3IzpNg.js"),__vite__mapDeps([0,1,2,3,4])).then(t=>({default:t.KnowledgePage}))),H1=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function k9(){const{connected:t,environments:{environments:s},sessions:{sessions:o},tasks:{tasks:r}}=ft(),{toasts:c,dismissToast:d}=Tn(),u=Zt(),p=iz(),m=p!==void 0,[g,v]=y.useState(!1),b=y.useCallback(()=>v(x=>!x),[]);return y.useEffect(()=>{v(!1)},[u.pathname]),y.useEffect(()=>{if(!g)return;const x=S=>{S.key==="Escape"&&v(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[g]),i.jsxs(i.Fragment,{children:[i.jsx(e5,{connected:t,environments:s,sessions:o,onToggleSidebar:m?b:void 0,sidebarOpen:g}),i.jsx(r5,{}),i.jsxs("div",{className:Fr.body,children:[m&&i.jsx("div",{className:Fr.sidebarWrapper,"data-sidebar-open":g,children:i.jsx(p5,{content:p})}),m&&g&&i.jsx("div",{className:Fr.overlay,"data-testid":"drawer-overlay",onClick:()=>v(!1)}),i.jsxs("div",{className:Fr.main,children:[i.jsx(qa,{}),i.jsx(_5,{sessions:o,tasks:r,environments:s})]})]}),i.jsx(II,{toasts:c,onDismiss:d}),i.jsx(TP,{})]})}function S9(){const{sessions:{lastSpawnedId:t},environments:{environments:s,operationError:o,clearOperationError:r},tasks:{tasks:c},connected:d,onboardingCompleted:u}=ft(),{showToast:p}=Tn();a7(s,p),c7(c,p),i7(o,r,p);const m=_t(),g=Zt();return y.useEffect(()=>{t&&!g.pathname.includes("/tasks/")&&m(hm(t),{replace:!0})},[t,m,g.pathname]),d&&u===!1?i.jsx(fs,{to:"/setup",replace:!0}):i.jsx(az,{children:i.jsxs("div",{className:Fr.root,children:[H1&&i.jsx(DN,{}),i.jsx(k9,{})]})})}function Cp(){const{workspaceId:t}=ms(),{workspaces:{workspaces:s}}=ft(),o=Zt(),r=s.find(m=>m.id===t);if(!(r!=null&&r.environmentId))return s.length===0?void 0:i.jsx(fs,{to:"/environments",replace:!0});const c=encodeURIComponent(t),d=`/workspaces/${c}`,u=o.pathname.startsWith(d)?o.pathname.slice(d.length):"",p=`/environments/${encodeURIComponent(r.environmentId)}/workspaces/${c}${u}${o.search}${o.hash}`;return i.jsx(fs,{to:p,replace:!0})}function T9(){return i.jsxs(gj,{children:[i.jsx(Ce,{path:"setup",element:i.jsx(h9,{})}),i.jsxs(Ce,{element:i.jsx(S9,{}),children:[i.jsx(Ce,{index:!0,element:i.jsx(F$,{})}),i.jsx(Ce,{path:"chat",element:i.jsx(nU,{})}),i.jsx(Ce,{path:"sessions/new",element:i.jsx(sU,{})}),i.jsx(Ce,{path:"sessions/:sessionId",element:i.jsx(rU,{})}),i.jsx(Ce,{element:i.jsx(EP,{}),children:i.jsx(Ce,{path:"knowledge",element:i.jsx(y.Suspense,{fallback:i.jsx(m1,{}),children:i.jsx(_9,{})})})}),i.jsxs(Ce,{element:i.jsx(wP,{}),children:[i.jsx(Ce,{path:"tasks",element:i.jsx(q$,{})}),i.jsx(Ce,{path:"tasks/new",element:i.jsx(Qb,{})}),i.jsx(Ce,{path:"tasks/:taskId",element:i.jsx(Oa,{})}),i.jsx(Ce,{path:"tasks/:taskId/edit",element:i.jsx(Oa,{})}),i.jsx(Ce,{path:"tasks/:taskId/stream",element:i.jsx(Oa,{})}),i.jsx(Ce,{path:"tasks/:taskId/findings",element:i.jsx(Oa,{})})]}),i.jsxs(Ce,{element:i.jsx(CP,{}),children:[i.jsx(Ce,{path:"findings",element:i.jsx(ax,{})}),i.jsx(Ce,{path:"findings/:findingId",element:i.jsx(ix,{})}),i.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/findings",element:i.jsx(ax,{})}),i.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/findings/:findingId",element:i.jsx(ix,{})})]}),i.jsxs(Ce,{element:i.jsx(jP,{}),children:[i.jsx(Ce,{path:"workspaces",element:i.jsx(fs,{to:"/environments",replace:!0})}),i.jsx(Ce,{path:"workspaces/new",element:i.jsx(kU,{})}),i.jsx(Ce,{path:"workspaces/:workspaceId",element:i.jsx(Cp,{})}),i.jsx(Ce,{path:"workspaces/:workspaceId/tasks/:taskId",element:i.jsx(Cp,{})}),i.jsx(Ce,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:i.jsx(Cp,{})}),i.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId",element:i.jsx(uU,{})}),i.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:i.jsx(Qb,{})}),i.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:i.jsx(Oa,{})}),i.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:i.jsx(Oa,{})}),i.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:i.jsx(Oa,{})}),i.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:i.jsx(Oa,{})}),i.jsxs(Ce,{path:"environments",element:i.jsx(EU,{}),children:[i.jsx(Ce,{index:!0,element:i.jsx(G$,{})}),i.jsx(Ce,{path:"new",element:i.jsx(TU,{})}),i.jsx(Ce,{path:":environmentId",element:i.jsx(aP,{})}),i.jsx(Ce,{path:":environmentId/edit",element:i.jsx(wU,{})})]})]}),i.jsx(Ce,{element:i.jsx(NP,{}),children:i.jsxs(Ce,{path:"settings",element:i.jsx(rP,{}),children:[i.jsx(Ce,{index:!0,element:i.jsx(fs,{to:"credentials",replace:!0})}),i.jsx(Ce,{path:"environments",element:i.jsx(fs,{to:"/environments",replace:!0})}),i.jsx(Ce,{path:"credentials",element:i.jsx(lP,{})}),i.jsx(Ce,{path:"tokens",element:i.jsx(fs,{to:"../credentials",replace:!0})}),i.jsx(Ce,{path:"personas",element:i.jsx(cP,{})}),i.jsx(Ce,{path:"personas/new",element:i.jsx(nx,{})}),i.jsx(Ce,{path:"personas/:personaId",element:i.jsx(nx,{})}),i.jsx(Ce,{path:"appearance",element:i.jsx(xP,{})}),i.jsx(Ce,{path:"shortcuts",element:i.jsx(SP,{})}),i.jsx(Ce,{path:"about",element:i.jsx(kP,{})})]})}),i.jsx(Ce,{path:"*",element:i.jsx(fs,{to:"/",replace:!0})})]})]})}const w9=1e4;function j9(){const{onboardingCompleted:t}=ft(),[s,o]=y.useState(!1);y.useEffect(()=>{if(t!==void 0)return;const c=setTimeout(()=>o(!0),w9);return()=>clearTimeout(c)},[t]);const r=t===void 0&&!s;return i.jsx(ps,{mode:"wait",children:r?i.jsx(Rt.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:i.jsx(m1,{})},"splash"):i.jsx(Rt.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:i.jsx(Pj,{basename:"/".replace(/\/$/,""),children:i.jsx(T9,{})})},"app")})}function N9(){const t=H1?Mz:s7;return i.jsx(sz,{children:i.jsx(Q8,{children:i.jsx(t,{children:i.jsx(j9,{})})})})}NT.createRoot(document.getElementById("root")).render(i.jsx(y.StrictMode,{children:i.jsx(N9,{})}));export{Ns as B,Bx as K,ft as a,Mp as f,hm as s,In as t,_t as u};
|