@grackle-ai/web 0.82.1 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{KnowledgePage-DQBwMH_z.js → KnowledgePage-BWBPbY0I.js} +1 -1
- package/dist/assets/grpc-DU5jMhZD.js +2 -0
- package/dist/assets/index-BQcllX_W.css +1 -0
- package/dist/assets/index-CqI2R3WB.js +502 -0
- package/dist/index.html +3 -3
- package/package.json +2 -2
- package/dist/assets/grpc-_MkPbpJw.js +0 -2
- package/dist/assets/index-ByrN_J-u.css +0 -1
- package/dist/assets/index-CMGy6WTe.js +0 -158
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-DQBwMH_z.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/grpc-_MkPbpJw.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as HS,a as y,j as r,v as PS,b as GS,t as Ur,i as $S,f as qS,M as Qf,c as Jf}from"./markdown-gcy1Jmzi.js";import{r as KS,d as Kg,H as Fg,P as Yg,i as FS,B as YS,a as ZS,C as XS,M as WS}from"./dagview-BA5TtMAQ.js";import{c as QS,a as JS,G as eT,e as tT,w as nT,t as aT,p as Vr,b as sT,C as eh,f as iT,M as oT,R as Fo,A as W0,D as Q0,W as lT,O as rT,d as cT,S as Zg}from"./grpc-_MkPbpJw.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function i(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(c){if(c.ep)return;c.ep=!0;const u=i(c);fetch(c.href,u)}})();var Pd={exports:{}},Yo={},Gd={exports:{}},$d={};/**
|
|
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 Xg;function uT(){return Xg||(Xg=1,(function(n){function a(O,G){var W=O.length;O.push(G);e:for(;0<W;){var le=W-1>>>1,re=O[le];if(0<c(re,G))O[le]=G,O[W]=re,W=le;else break e}}function i(O){return O.length===0?null:O[0]}function o(O){if(O.length===0)return null;var G=O[0],W=O.pop();if(W!==G){O[0]=W;e:for(var le=0,re=O.length,Re=re>>>1;le<Re;){var we=2*(le+1)-1,Te=O[we],Be=we+1,ue=O[Be];if(0>c(Te,W))Be<re&&0>c(ue,Te)?(O[le]=ue,O[Be]=W,le=Be):(O[le]=Te,O[we]=W,le=we);else if(Be<re&&0>c(ue,W))O[le]=ue,O[Be]=W,le=Be;else break e}}return G}function c(O,G){var W=O.sortIndex-G.sortIndex;return W!==0?W:O.id-G.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var m=[],v=[],g=1,b=null,x=3,S=!1,T=!1,w=!1,N=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(O){for(var G=i(v);G!==null;){if(G.callback===null)o(v);else if(G.startTime<=O)o(v),G.sortIndex=G.expirationTime,a(m,G);else break;G=i(v)}}function C(O){if(w=!1,R(O),!T)if(i(m)!==null)T=!0,z||(z=!0,ne());else{var G=i(v);G!==null&&ae(C,G.startTime-O)}}var z=!1,H=-1,B=5,K=-1;function Q(){return N?!0:!(n.unstable_now()-K<B)}function se(){if(N=!1,z){var O=n.unstable_now();K=O;var G=!0;try{e:{T=!1,w&&(w=!1,E(H),H=-1),S=!0;var W=x;try{t:{for(R(O),b=i(m);b!==null&&!(b.expirationTime>O&&Q());){var le=b.callback;if(typeof le=="function"){b.callback=null,x=b.priorityLevel;var re=le(b.expirationTime<=O);if(O=n.unstable_now(),typeof re=="function"){b.callback=re,R(O),G=!0;break t}b===i(m)&&o(m),R(O)}else o(m);b=i(m)}if(b!==null)G=!0;else{var Re=i(v);Re!==null&&ae(C,Re.startTime-O),G=!1}}break e}finally{b=null,x=W,S=!1}G=void 0}}finally{G?ne():z=!1}}}var ne;if(typeof A=="function")ne=function(){A(se)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,q=ce.port2;ce.port1.onmessage=se,ne=function(){q.postMessage(null)}}else ne=function(){k(se,0)};function ae(O,G){H=k(function(){O(n.unstable_now())},G)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<O?Math.floor(1e3/O):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(O){switch(x){case 1:case 2:case 3:var G=3;break;default:G=x}var W=x;x=G;try{return O()}finally{x=W}},n.unstable_requestPaint=function(){N=!0},n.unstable_runWithPriority=function(O,G){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var W=x;x=O;try{return G()}finally{x=W}},n.unstable_scheduleCallback=function(O,G,W){var le=n.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?le+W:le):W=le,O){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=W+re,O={id:g++,callback:G,priorityLevel:O,startTime:W,expirationTime:re,sortIndex:-1},W>le?(O.sortIndex=W,a(v,O),i(m)===null&&O===i(v)&&(w?(E(H),H=-1):w=!0,ae(C,W-le))):(O.sortIndex=re,a(m,O),T||S||(T=!0,z||(z=!0,ne()))),O},n.unstable_shouldYield=Q,n.unstable_wrapCallback=function(O){var G=x;return function(){var W=x;x=G;try{return O.apply(this,arguments)}finally{x=W}}}})($d)),$d}var Wg;function dT(){return Wg||(Wg=1,Gd.exports=uT()),Gd.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 Qg;function fT(){if(Qg)return Yo;Qg=1;var n=dT(),a=HS(),i=KS();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" 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 u(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(u(e)!==e)throw Error(o(188))}function v(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,l=t;;){var d=s.return;if(d===null)break;var h=d.alternate;if(h===null){if(l=d.return,l!==null){s=l;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===s)return m(d),e;if(h===l)return m(d),t;h=h.sibling}throw Error(o(188))}if(s.return!==l.return)s=d,l=h;else{for(var _=!1,j=d.child;j;){if(j===s){_=!0,s=d,l=h;break}if(j===l){_=!0,l=d,s=h;break}j=j.sibling}if(!_){for(j=h.child;j;){if(j===s){_=!0,s=h,l=d;break}if(j===l){_=!0,l=h,s=d;break}j=j.sibling}if(!_)throw Error(o(189))}}if(s.alternate!==l)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function ne(e){return e===null||typeof e!="object"?null:(e=se&&e[se]||e["@@iterator"],typeof e=="function"?e:null)}var ce=Symbol.for("react.client.reference");function q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case k:return"Profiler";case N:return"StrictMode";case C:return"Suspense";case z:return"SuspenseList";case K:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case A:return e.displayName||"Context";case E:return(e._context.displayName||"Context")+".Consumer";case R:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return t=e.displayName||null,t!==null?t:q(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return q(e(t))}catch{}}return null}var ae=Array.isArray,O=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},le=[],re=-1;function Re(e){return{current:e}}function we(e){0>re||(e.current=le[re],le[re]=null,re--)}function Te(e,t){re++,le[re]=e.current,e.current=t}var Be=Re(null),ue=Re(null),ve=Re(null),he=Re(null);function $e(e,t){switch(Te(ve,t),Te(ue,e),Te(Be,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?mg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=mg(t),e=vg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}we(Be),Te(Be,e)}function Ft(){we(Be),we(ue),we(ve)}function te(e){e.memoizedState!==null&&Te(he,e);var t=Be.current,s=vg(t,e.type);t!==s&&(Te(ue,e),Te(Be,s))}function J(e){ue.current===e&&(we(Be),we(ue)),he.current===e&&(we(he),Go._currentValue=W)}var Ce,cn;function Ve(e){if(Ce===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||"",cn=-1<s.stack.indexOf(`
|
|
19
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
20
|
-
`+Ce+e+cn}var qn=!1;function Kn(e,t){if(!e||qn)return"";qn=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch($){var P=$}Reflect.construct(e,[],X)}else{try{X.call()}catch($){P=$}e.call(X.prototype)}}else{try{throw Error()}catch($){P=$}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch($){if($&&P&&typeof $.stack=="string")return[$.stack,P.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),_=h[0],j=h[1];if(_&&j){var D=_.split(`
|
|
21
|
-
`),V=j.split(`
|
|
22
|
-
`);for(d=l=0;l<D.length&&!D[l].includes("DetermineComponentFrameRoot");)l++;for(;d<V.length&&!V[d].includes("DetermineComponentFrameRoot");)d++;if(l===D.length||d===V.length)for(l=D.length-1,d=V.length-1;1<=l&&0<=d&&D[l]!==V[d];)d--;for(;1<=l&&0<=d;l--,d--)if(D[l]!==V[d]){if(l!==1||d!==1)do if(l--,d--,0>d||D[l]!==V[d]){var Y=`
|
|
23
|
-
`+D[l].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=l&&0<=d);break}}}finally{qn=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Ve(s):""}function zn(e,t){switch(e.tag){case 26:case 27:case 5:return Ve(e.type);case 16:return Ve("Lazy");case 13:return e.child!==t&&t!==null?Ve("Suspense Fallback"):Ve("Suspense");case 19:return Ve("SuspenseList");case 0:case 15:return Kn(e.type,!1);case 11:return Kn(e.type.render,!1);case 1:return Kn(e.type,!0);case 31:return Ve("Activity");default:return""}}function Fn(e){try{var t="",s=null;do t+=zn(e,s),s=e,e=e.return;while(e);return t}catch(l){return`
|
|
24
|
-
Error generating stack: `+l.message+`
|
|
25
|
-
`+l.stack}}var Sn=Object.prototype.hasOwnProperty,Ra=n.unstable_scheduleCallback,un=n.unstable_cancelCallback,Ae=n.unstable_shouldYield,Dt=n.unstable_requestPaint,Yt=n.unstable_now,jl=n.unstable_getCurrentPriorityLevel,eo=n.unstable_ImmediatePriority,Nl=n.unstable_UserBlockingPriority,F=n.unstable_NormalPriority,oe=n.unstable_LowPriority,de=n.unstable_IdlePriority,Ne=n.log,_e=n.unstable_setDisableYieldValue,Ze=null,be=null;function Qe(e){if(typeof Ne=="function"&&_e(e),be&&typeof be.setStrictMode=="function")try{be.setStrictMode(Ze,e)}catch{}}var Oe=Math.clz32?Math.clz32:Ut,kt=Math.log,Rt=Math.LN2;function Ut(e){return e>>>=0,e===0?32:31-(kt(e)/Rt|0)|0}var Mt=256,pt=262144,Un=4194304;function Wt(e){var t=e&42;if(t!==0)return t;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 Ma(e,t,s){var l=e.pendingLanes;if(l===0)return 0;var d=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var j=l&134217727;return j!==0?(l=j&~h,l!==0?d=Wt(l):(_&=j,_!==0?d=Wt(_):s||(s=j&~e,s!==0&&(d=Wt(s))))):(j=l&~h,j!==0?d=Wt(j):_!==0?d=Wt(_):s||(s=l&~e,s!==0&&(d=Wt(s)))),d===0?0:t!==0&&t!==d&&(t&h)===0&&(h=d&-d,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:d}function to(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function C_(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Xh(){var e=Un;return Un<<=1,(Un&62914560)===0&&(Un=4194304),e}function Ac(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function no(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function E_(e,t,s,l,d,h){var _=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var j=e.entanglements,D=e.expirationTimes,V=e.hiddenUpdates;for(s=_&~s;0<s;){var Y=31-Oe(s),X=1<<Y;j[Y]=0,D[Y]=-1;var P=V[Y];if(P!==null)for(V[Y]=null,Y=0;Y<P.length;Y++){var $=P[Y];$!==null&&($.lane&=-536870913)}s&=~X}l!==0&&Wh(e,l,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~t))}function Wh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Oe(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function Qh(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var l=31-Oe(s),d=1<<l;d&t|e[l]&t&&(e[l]|=t),s&=~d}}function Jh(e,t){var s=t&-t;return s=(s&42)!==0?1:Dc(s),(s&(e.suspendedLanes|t))!==0?0:s}function Dc(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 Rc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ep(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:Ug(e.type))}function tp(e,t){var s=G.p;try{return G.p=e,t()}finally{G.p=s}}var Oa=Math.random().toString(36).slice(2),Vt="__reactFiber$"+Oa,tn="__reactProps$"+Oa,Zs="__reactContainer$"+Oa,Mc="__reactEvents$"+Oa,A_="__reactListeners$"+Oa,D_="__reactHandles$"+Oa,np="__reactResources$"+Oa,ao="__reactMarker$"+Oa;function Oc(e){delete e[Vt],delete e[tn],delete e[Mc],delete e[A_],delete e[D_]}function Xs(e){var t=e[Vt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Zs]||s[Vt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Tg(e);e!==null;){if(s=e[Vt])return s;e=Tg(e)}return t}e=s,s=e.parentNode}return null}function Ws(e){if(e=e[Vt]||e[Zs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function so(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Qs(e){var t=e[np];return t||(t=e[np]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function It(e){e[ao]=!0}var ap=new Set,sp={};function ps(e,t){Js(e,t),Js(e+"Capture",t)}function Js(e,t){for(sp[e]=t,e=0;e<t.length;e++)ap.add(t[e])}var R_=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]*$"),ip={},op={};function M_(e){return Sn.call(op,e)?!0:Sn.call(ip,e)?!1:R_.test(e)?op[e]=!0:(ip[e]=!0,!1)}function wl(e,t,s){if(M_(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Cl(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function sa(e,t,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+l)}}function Tn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function O_(e,t,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,h=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(_){s=""+_,h.call(this,_)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bc(e){if(!e._valueTracker){var t=lp(e)?"checked":"value";e._valueTracker=O_(e,t,""+e[t])}}function rp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),l="";return e&&(l=lp(e)?e.checked?"true":"false":e.value),e=l,e!==s?(t.setValue(e),!0):!1}function El(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 B_=/[\n"\\]/g;function kn(e){return e.replace(B_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Lc(e,t,s,l,d,h,_,j){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),t!=null?_==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Tn(t)):e.value!==""+Tn(t)&&(e.value=""+Tn(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?Ic(e,_,Tn(t)):s!=null?Ic(e,_,Tn(s)):l!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+Tn(j):e.removeAttribute("name")}function cp(e,t,s,l,d,h,_,j){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){Bc(e);return}s=s!=null?""+Tn(s):"",t=t!=null?""+Tn(t):s,j||t===e.value||(e.value=t),e.defaultValue=t}l=l??d,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=_),Bc(e)}function Ic(e,t,s){t==="number"&&El(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function ei(e,t,s,l){if(e=e.options,t){t={};for(var d=0;d<s.length;d++)t["$"+s[d]]=!0;for(s=0;s<e.length;s++)d=t.hasOwnProperty("$"+e[s].value),e[s].selected!==d&&(e[s].selected=d),d&&l&&(e[s].defaultSelected=!0)}else{for(s=""+Tn(s),t=null,d=0;d<e.length;d++){if(e[d].value===s){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function up(e,t,s){if(t!=null&&(t=""+Tn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Tn(s):""}function dp(e,t,s,l){if(t==null){if(l!=null){if(s!=null)throw Error(o(92));if(ae(l)){if(1<l.length)throw Error(o(93));l=l[0]}s=l}s==null&&(s=""),t=s}s=Tn(t),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),Bc(e)}function ti(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var L_=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 fp(e,t,s){var l=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,s):typeof s!="number"||s===0||L_.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function hp(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var d in t)l=t[d],t.hasOwnProperty(d)&&s[d]!==l&&fp(e,d,l)}else for(var h in t)t.hasOwnProperty(h)&&fp(e,h,t[h])}function zc(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 I_=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"]]),z_=/^[\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 Al(e){return z_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ia(){}var Uc=null;function Vc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ni=null,ai=null;function pp(e){var t=Ws(e);if(t&&(e=t.stateNode)){var s=e[tn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Lc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+kn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var l=s[t];if(l!==e&&l.form===e.form){var d=l[tn]||null;if(!d)throw Error(o(90));Lc(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<s.length;t++)l=s[t],l.form===e.form&&rp(l)}break e;case"textarea":up(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&ei(e,!!s.multiple,t,!1)}}}var Hc=!1;function mp(e,t,s){if(Hc)return e(t,s);Hc=!0;try{var l=e(t);return l}finally{if(Hc=!1,(ni!==null||ai!==null)&&(gr(),ni&&(t=ni,e=ai,ai=ni=null,pp(t),e)))for(t=0;t<e.length;t++)pp(e[t])}}function io(e,t){var s=e.stateNode;if(s===null)return null;var l=s[tn]||null;if(l===null)return null;s=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var oa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pc=!1;if(oa)try{var oo={};Object.defineProperty(oo,"passive",{get:function(){Pc=!0}}),window.addEventListener("test",oo,oo),window.removeEventListener("test",oo,oo)}catch{Pc=!1}var Ba=null,Gc=null,Dl=null;function vp(){if(Dl)return Dl;var e,t=Gc,s=t.length,l,d="value"in Ba?Ba.value:Ba.textContent,h=d.length;for(e=0;e<s&&t[e]===d[e];e++);var _=s-e;for(l=1;l<=_&&t[s-l]===d[h-l];l++);return Dl=d.slice(e,1<l?1-l:void 0)}function Rl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ml(){return!0}function gp(){return!1}function nn(e){function t(s,l,d,h,_){this._reactName=s,this._targetInst=d,this.type=l,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(s=e[j],this[j]=s?s(h):h[j]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ml:gp,this.isPropagationStopped=gp,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ml)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ml)},persist:function(){},isPersistent:Ml}),t}var ms={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ol=nn(ms),lo=b({},ms,{view:0,detail:0}),U_=nn(lo),$c,qc,ro,Bl=b({},lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fc,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!==ro&&(ro&&e.type==="mousemove"?($c=e.screenX-ro.screenX,qc=e.screenY-ro.screenY):qc=$c=0,ro=e),$c)},movementY:function(e){return"movementY"in e?e.movementY:qc}}),yp=nn(Bl),V_=b({},Bl,{dataTransfer:0}),H_=nn(V_),P_=b({},lo,{relatedTarget:0}),Kc=nn(P_),G_=b({},ms,{animationName:0,elapsedTime:0,pseudoElement:0}),$_=nn(G_),q_=b({},ms,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),K_=nn(q_),F_=b({},ms,{data:0}),bp=nn(F_),Y_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Z_={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"},X_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function W_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=X_[e])?!!t[e]:!1}function Fc(){return W_}var Q_=b({},lo,{key:function(e){if(e.key){var t=Y_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Rl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Z_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fc,charCode:function(e){return e.type==="keypress"?Rl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Rl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),J_=nn(Q_),e1=b({},Bl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xp=nn(e1),t1=b({},lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fc}),n1=nn(t1),a1=b({},ms,{propertyName:0,elapsedTime:0,pseudoElement:0}),s1=nn(a1),i1=b({},Bl,{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}),o1=nn(i1),l1=b({},ms,{newState:0,oldState:0}),r1=nn(l1),c1=[9,13,27,32],Yc=oa&&"CompositionEvent"in window,co=null;oa&&"documentMode"in document&&(co=document.documentMode);var u1=oa&&"TextEvent"in window&&!co,_p=oa&&(!Yc||co&&8<co&&11>=co),Sp=" ",Tp=!1;function kp(e,t){switch(e){case"keyup":return c1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var si=!1;function d1(e,t){switch(e){case"compositionend":return jp(t);case"keypress":return t.which!==32?null:(Tp=!0,Sp);case"textInput":return e=t.data,e===Sp&&Tp?null:e;default:return null}}function f1(e,t){if(si)return e==="compositionend"||!Yc&&kp(e,t)?(e=vp(),Dl=Gc=Ba=null,si=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return _p&&t.locale!=="ko"?null:t.data;default:return null}}var h1={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 Np(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!h1[e.type]:t==="textarea"}function wp(e,t,s,l){ni?ai?ai.push(l):ai=[l]:ni=l,t=kr(t,"onChange"),0<t.length&&(s=new Ol("onChange","change",null,s,l),e.push({event:s,listeners:t}))}var uo=null,fo=null;function p1(e){cg(e,0)}function Ll(e){var t=so(e);if(rp(t))return e}function Cp(e,t){if(e==="change")return t}var Ep=!1;if(oa){var Zc;if(oa){var Xc="oninput"in document;if(!Xc){var Ap=document.createElement("div");Ap.setAttribute("oninput","return;"),Xc=typeof Ap.oninput=="function"}Zc=Xc}else Zc=!1;Ep=Zc&&(!document.documentMode||9<document.documentMode)}function Dp(){uo&&(uo.detachEvent("onpropertychange",Rp),fo=uo=null)}function Rp(e){if(e.propertyName==="value"&&Ll(fo)){var t=[];wp(t,fo,e,Vc(e)),mp(p1,t)}}function m1(e,t,s){e==="focusin"?(Dp(),uo=t,fo=s,uo.attachEvent("onpropertychange",Rp)):e==="focusout"&&Dp()}function v1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ll(fo)}function g1(e,t){if(e==="click")return Ll(t)}function y1(e,t){if(e==="input"||e==="change")return Ll(t)}function b1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dn=typeof Object.is=="function"?Object.is:b1;function ho(e,t){if(dn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var d=s[l];if(!Sn.call(t,d)||!dn(e[d],t[d]))return!1}return!0}function Mp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Op(e,t){var s=Mp(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=t&&l>=t)return{node:s,offset:t-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Mp(s)}}function Bp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=El(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=El(e.document)}return t}function Wc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var x1=oa&&"documentMode"in document&&11>=document.documentMode,ii=null,Qc=null,po=null,Jc=!1;function Ip(e,t,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Jc||ii==null||ii!==El(l)||(l=ii,"selectionStart"in l&&Wc(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}),po&&ho(po,l)||(po=l,l=kr(Qc,"onSelect"),0<l.length&&(t=new Ol("onSelect","select",null,t,s),e.push({event:t,listeners:l}),t.target=ii)))}function vs(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var oi={animationend:vs("Animation","AnimationEnd"),animationiteration:vs("Animation","AnimationIteration"),animationstart:vs("Animation","AnimationStart"),transitionrun:vs("Transition","TransitionRun"),transitionstart:vs("Transition","TransitionStart"),transitioncancel:vs("Transition","TransitionCancel"),transitionend:vs("Transition","TransitionEnd")},eu={},zp={};oa&&(zp=document.createElement("div").style,"AnimationEvent"in window||(delete oi.animationend.animation,delete oi.animationiteration.animation,delete oi.animationstart.animation),"TransitionEvent"in window||delete oi.transitionend.transition);function gs(e){if(eu[e])return eu[e];if(!oi[e])return e;var t=oi[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in zp)return eu[e]=t[s];return e}var Up=gs("animationend"),Vp=gs("animationiteration"),Hp=gs("animationstart"),_1=gs("transitionrun"),S1=gs("transitionstart"),T1=gs("transitioncancel"),Pp=gs("transitionend"),Gp=new Map,tu="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(" ");tu.push("scrollEnd");function Vn(e,t){Gp.set(e,t),ps(t,[e])}var Il=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=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(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},jn=[],li=0,nu=0;function zl(){for(var e=li,t=nu=li=0;t<e;){var s=jn[t];jn[t++]=null;var l=jn[t];jn[t++]=null;var d=jn[t];jn[t++]=null;var h=jn[t];if(jn[t++]=null,l!==null&&d!==null){var _=l.pending;_===null?d.next=d:(d.next=_.next,_.next=d),l.pending=d}h!==0&&$p(s,d,h)}}function Ul(e,t,s,l){jn[li++]=e,jn[li++]=t,jn[li++]=s,jn[li++]=l,nu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function au(e,t,s,l){return Ul(e,t,s,l),Vl(e)}function ys(e,t){return Ul(e,null,null,t),Vl(e)}function $p(e,t,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var d=!1,h=e.return;h!==null;)h.childLanes|=s,l=h.alternate,l!==null&&(l.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&t!==null&&(d=31-Oe(s),e=h.hiddenUpdates,l=e[d],l===null?e[d]=[t]:l.push(t),t.lane=s|536870912),h):null}function Vl(e){if(50<Lo)throw Lo=0,fd=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ri={};function k1(e,t,s,l){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,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 fn(e,t,s,l){return new k1(e,t,s,l)}function su(e){return e=e.prototype,!(!e||!e.isReactComponent)}function la(e,t){var s=e.alternate;return s===null?(s=fn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function qp(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Hl(e,t,s,l,d,h){var _=0;if(l=e,typeof e=="function")su(e)&&(_=1);else if(typeof e=="string")_=ES(e,s,Be.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case K:return e=fn(31,s,t,d),e.elementType=K,e.lanes=h,e;case w:return bs(s.children,d,h,t);case N:_=8,d|=24;break;case k:return e=fn(12,s,t,d|2),e.elementType=k,e.lanes=h,e;case C:return e=fn(13,s,t,d),e.elementType=C,e.lanes=h,e;case z:return e=fn(19,s,t,d),e.elementType=z,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:_=10;break e;case E:_=9;break e;case R:_=11;break e;case H:_=14;break e;case B:_=16,l=null;break e}_=29,s=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=fn(_,s,t,d),t.elementType=e,t.type=l,t.lanes=h,t}function bs(e,t,s,l){return e=fn(7,e,l,t),e.lanes=s,e}function iu(e,t,s){return e=fn(6,e,null,t),e.lanes=s,e}function Kp(e){var t=fn(18,null,null,0);return t.stateNode=e,t}function ou(e,t,s){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fp=new WeakMap;function Nn(e,t){if(typeof e=="object"&&e!==null){var s=Fp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Fn(t)},Fp.set(e,t),t)}return{value:e,source:t,stack:Fn(t)}}var ci=[],ui=0,Pl=null,mo=0,wn=[],Cn=0,La=null,Yn=1,Zn="";function ra(e,t){ci[ui++]=mo,ci[ui++]=Pl,Pl=e,mo=t}function Yp(e,t,s){wn[Cn++]=Yn,wn[Cn++]=Zn,wn[Cn++]=La,La=e;var l=Yn;e=Zn;var d=32-Oe(l)-1;l&=~(1<<d),s+=1;var h=32-Oe(t)+d;if(30<h){var _=d-d%5;h=(l&(1<<_)-1).toString(32),l>>=_,d-=_,Yn=1<<32-Oe(t)+d|s<<d|l,Zn=h+e}else Yn=1<<h|s<<d|l,Zn=e}function lu(e){e.return!==null&&(ra(e,1),Yp(e,1,0))}function ru(e){for(;e===Pl;)Pl=ci[--ui],ci[ui]=null,mo=ci[--ui],ci[ui]=null;for(;e===La;)La=wn[--Cn],wn[Cn]=null,Zn=wn[--Cn],wn[Cn]=null,Yn=wn[--Cn],wn[Cn]=null}function Zp(e,t){wn[Cn++]=Yn,wn[Cn++]=Zn,wn[Cn++]=La,Yn=t.id,Zn=t.overflow,La=e}var Ht=null,ot=null,He=!1,Ia=null,En=!1,cu=Error(o(519));function za(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vo(Nn(t,e)),cu}function Xp(e){var t=e.stateNode,s=e.type,l=e.memoizedProps;switch(t[Vt]=e,t[tn]=l,s){case"dialog":Ie("cancel",t),Ie("close",t);break;case"iframe":case"object":case"embed":Ie("load",t);break;case"video":case"audio":for(s=0;s<zo.length;s++)Ie(zo[s],t);break;case"source":Ie("error",t);break;case"img":case"image":case"link":Ie("error",t),Ie("load",t);break;case"details":Ie("toggle",t);break;case"input":Ie("invalid",t),cp(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ie("invalid",t);break;case"textarea":Ie("invalid",t),dp(t,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||l.suppressHydrationWarning===!0||hg(t.textContent,s)?(l.popover!=null&&(Ie("beforetoggle",t),Ie("toggle",t)),l.onScroll!=null&&Ie("scroll",t),l.onScrollEnd!=null&&Ie("scrollend",t),l.onClick!=null&&(t.onclick=ia),t=!0):t=!1,t||za(e,!0)}function Wp(e){for(Ht=e.return;Ht;)switch(Ht.tag){case 5:case 31:case 13:En=!1;return;case 27:case 3:En=!0;return;default:Ht=Ht.return}}function di(e){if(e!==Ht)return!1;if(!He)return Wp(e),He=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||wd(e.type,e.memoizedProps)),s=!s),s&&ot&&za(e),Wp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ot=Sg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ot=Sg(e)}else t===27?(t=ot,Qa(e.type)?(e=Rd,Rd=null,ot=e):ot=t):ot=Ht?Dn(e.stateNode.nextSibling):null;return!0}function xs(){ot=Ht=null,He=!1}function uu(){var e=Ia;return e!==null&&(ln===null?ln=e:ln.push.apply(ln,e),Ia=null),e}function vo(e){Ia===null?Ia=[e]:Ia.push(e)}var du=Re(null),_s=null,ca=null;function Ua(e,t,s){Te(du,t._currentValue),t._currentValue=s}function ua(e){e._currentValue=du.current,we(du)}function fu(e,t,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===s)break;e=e.return}}function hu(e,t,s,l){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var _=d.child;h=h.firstContext;e:for(;h!==null;){var j=h;h=d;for(var D=0;D<t.length;D++)if(j.context===t[D]){h.lanes|=s,j=h.alternate,j!==null&&(j.lanes|=s),fu(h.return,s,e),l||(_=null);break e}h=j.next}}else if(d.tag===18){if(_=d.return,_===null)throw Error(o(341));_.lanes|=s,h=_.alternate,h!==null&&(h.lanes|=s),fu(_,s,e),_=null}else _=d.child;if(_!==null)_.return=d;else for(_=d;_!==null;){if(_===e){_=null;break}if(d=_.sibling,d!==null){d.return=_.return,_=d;break}_=_.return}d=_}}function fi(e,t,s,l){e=null;for(var d=t,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var _=d.alternate;if(_===null)throw Error(o(387));if(_=_.memoizedProps,_!==null){var j=d.type;dn(d.pendingProps.value,_.value)||(e!==null?e.push(j):e=[j])}}else if(d===he.current){if(_=d.alternate,_===null)throw Error(o(387));_.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Go):e=[Go])}d=d.return}e!==null&&hu(t,e,s,l),t.flags|=262144}function Gl(e){for(e=e.firstContext;e!==null;){if(!dn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ss(e){_s=e,ca=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pt(e){return Qp(_s,e)}function $l(e,t){return _s===null&&Ss(e),Qp(e,t)}function Qp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},ca===null){if(e===null)throw Error(o(308));ca=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ca=ca.next=t;return s}var j1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},N1=n.unstable_scheduleCallback,w1=n.unstable_NormalPriority,jt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pu(){return{controller:new j1,data:new Map,refCount:0}}function go(e){e.refCount--,e.refCount===0&&N1(w1,function(){e.controller.abort()})}var yo=null,mu=0,hi=0,pi=null;function C1(e,t){if(yo===null){var s=yo=[];mu=0,hi=yd(),pi={status:"pending",value:void 0,then:function(l){s.push(l)}}}return mu++,t.then(Jp,Jp),t}function Jp(){if(--mu===0&&yo!==null){pi!==null&&(pi.status="fulfilled");var e=yo;yo=null,hi=0,pi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function E1(e,t){var s=[],l={status:"pending",value:null,reason:null,then:function(d){s.push(d)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var d=0;d<s.length;d++)(0,s[d])(t)},function(d){for(l.status="rejected",l.reason=d,d=0;d<s.length;d++)(0,s[d])(void 0)}),l}var em=O.S;O.S=function(e,t){Iv=Yt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&C1(e,t),em!==null&&em(e,t)};var Ts=Re(null);function vu(){var e=Ts.current;return e!==null?e:st.pooledCache}function ql(e,t){t===null?Te(Ts,Ts.current):Te(Ts,t.pool)}function tm(){var e=vu();return e===null?null:{parent:jt._currentValue,pool:e}}var mi=Error(o(460)),gu=Error(o(474)),Kl=Error(o(542)),Fl={then:function(){}};function nm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function am(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(ia,ia),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,im(e),e;default:if(typeof t.status=="string")t.then(ia,ia);else{if(e=st,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=l}},function(l){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,im(e),e}throw js=t,mi}}function ks(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(js=s,mi):s}}var js=null;function sm(){if(js===null)throw Error(o(459));var e=js;return js=null,e}function im(e){if(e===mi||e===Kl)throw Error(o(483))}var vi=null,bo=0;function Yl(e){var t=bo;return bo+=1,vi===null&&(vi=[]),am(vi,e,t)}function xo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Zl(e,t){throw t.$$typeof===x?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function om(e){function t(L,M){if(e){var U=L.deletions;U===null?(L.deletions=[M],L.flags|=16):U.push(M)}}function s(L,M){if(!e)return null;for(;M!==null;)t(L,M),M=M.sibling;return null}function l(L){for(var M=new Map;L!==null;)L.key!==null?M.set(L.key,L):M.set(L.index,L),L=L.sibling;return M}function d(L,M){return L=la(L,M),L.index=0,L.sibling=null,L}function h(L,M,U){return L.index=U,e?(U=L.alternate,U!==null?(U=U.index,U<M?(L.flags|=67108866,M):U):(L.flags|=67108866,M)):(L.flags|=1048576,M)}function _(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function j(L,M,U,Z){return M===null||M.tag!==6?(M=iu(U,L.mode,Z),M.return=L,M):(M=d(M,U),M.return=L,M)}function D(L,M,U,Z){var ge=U.type;return ge===w?Y(L,M,U.props.children,Z,U.key):M!==null&&(M.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===B&&ks(ge)===M.type)?(M=d(M,U.props),xo(M,U),M.return=L,M):(M=Hl(U.type,U.key,U.props,null,L.mode,Z),xo(M,U),M.return=L,M)}function V(L,M,U,Z){return M===null||M.tag!==4||M.stateNode.containerInfo!==U.containerInfo||M.stateNode.implementation!==U.implementation?(M=ou(U,L.mode,Z),M.return=L,M):(M=d(M,U.children||[]),M.return=L,M)}function Y(L,M,U,Z,ge){return M===null||M.tag!==7?(M=bs(U,L.mode,Z,ge),M.return=L,M):(M=d(M,U),M.return=L,M)}function X(L,M,U){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=iu(""+M,L.mode,U),M.return=L,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case S:return U=Hl(M.type,M.key,M.props,null,L.mode,U),xo(U,M),U.return=L,U;case T:return M=ou(M,L.mode,U),M.return=L,M;case B:return M=ks(M),X(L,M,U)}if(ae(M)||ne(M))return M=bs(M,L.mode,U,null),M.return=L,M;if(typeof M.then=="function")return X(L,Yl(M),U);if(M.$$typeof===A)return X(L,$l(L,M),U);Zl(L,M)}return null}function P(L,M,U,Z){var ge=M!==null?M.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return ge!==null?null:j(L,M,""+U,Z);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return U.key===ge?D(L,M,U,Z):null;case T:return U.key===ge?V(L,M,U,Z):null;case B:return U=ks(U),P(L,M,U,Z)}if(ae(U)||ne(U))return ge!==null?null:Y(L,M,U,Z,null);if(typeof U.then=="function")return P(L,M,Yl(U),Z);if(U.$$typeof===A)return P(L,M,$l(L,U),Z);Zl(L,U)}return null}function $(L,M,U,Z,ge){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return L=L.get(U)||null,j(M,L,""+Z,ge);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:return L=L.get(Z.key===null?U:Z.key)||null,D(M,L,Z,ge);case T:return L=L.get(Z.key===null?U:Z.key)||null,V(M,L,Z,ge);case B:return Z=ks(Z),$(L,M,U,Z,ge)}if(ae(Z)||ne(Z))return L=L.get(U)||null,Y(M,L,Z,ge,null);if(typeof Z.then=="function")return $(L,M,U,Yl(Z),ge);if(Z.$$typeof===A)return $(L,M,U,$l(M,Z),ge);Zl(M,Z)}return null}function pe(L,M,U,Z){for(var ge=null,Ke=null,me=M,De=M=0,Ue=null;me!==null&&De<U.length;De++){me.index>De?(Ue=me,me=null):Ue=me.sibling;var Fe=P(L,me,U[De],Z);if(Fe===null){me===null&&(me=Ue);break}e&&me&&Fe.alternate===null&&t(L,me),M=h(Fe,M,De),Ke===null?ge=Fe:Ke.sibling=Fe,Ke=Fe,me=Ue}if(De===U.length)return s(L,me),He&&ra(L,De),ge;if(me===null){for(;De<U.length;De++)me=X(L,U[De],Z),me!==null&&(M=h(me,M,De),Ke===null?ge=me:Ke.sibling=me,Ke=me);return He&&ra(L,De),ge}for(me=l(me);De<U.length;De++)Ue=$(me,L,De,U[De],Z),Ue!==null&&(e&&Ue.alternate!==null&&me.delete(Ue.key===null?De:Ue.key),M=h(Ue,M,De),Ke===null?ge=Ue:Ke.sibling=Ue,Ke=Ue);return e&&me.forEach(function(as){return t(L,as)}),He&&ra(L,De),ge}function xe(L,M,U,Z){if(U==null)throw Error(o(151));for(var ge=null,Ke=null,me=M,De=M=0,Ue=null,Fe=U.next();me!==null&&!Fe.done;De++,Fe=U.next()){me.index>De?(Ue=me,me=null):Ue=me.sibling;var as=P(L,me,Fe.value,Z);if(as===null){me===null&&(me=Ue);break}e&&me&&as.alternate===null&&t(L,me),M=h(as,M,De),Ke===null?ge=as:Ke.sibling=as,Ke=as,me=Ue}if(Fe.done)return s(L,me),He&&ra(L,De),ge;if(me===null){for(;!Fe.done;De++,Fe=U.next())Fe=X(L,Fe.value,Z),Fe!==null&&(M=h(Fe,M,De),Ke===null?ge=Fe:Ke.sibling=Fe,Ke=Fe);return He&&ra(L,De),ge}for(me=l(me);!Fe.done;De++,Fe=U.next())Fe=$(me,L,De,Fe.value,Z),Fe!==null&&(e&&Fe.alternate!==null&&me.delete(Fe.key===null?De:Fe.key),M=h(Fe,M,De),Ke===null?ge=Fe:Ke.sibling=Fe,Ke=Fe);return e&&me.forEach(function(VS){return t(L,VS)}),He&&ra(L,De),ge}function at(L,M,U,Z){if(typeof U=="object"&&U!==null&&U.type===w&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case S:e:{for(var ge=U.key;M!==null;){if(M.key===ge){if(ge=U.type,ge===w){if(M.tag===7){s(L,M.sibling),Z=d(M,U.props.children),Z.return=L,L=Z;break e}}else if(M.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===B&&ks(ge)===M.type){s(L,M.sibling),Z=d(M,U.props),xo(Z,U),Z.return=L,L=Z;break e}s(L,M);break}else t(L,M);M=M.sibling}U.type===w?(Z=bs(U.props.children,L.mode,Z,U.key),Z.return=L,L=Z):(Z=Hl(U.type,U.key,U.props,null,L.mode,Z),xo(Z,U),Z.return=L,L=Z)}return _(L);case T:e:{for(ge=U.key;M!==null;){if(M.key===ge)if(M.tag===4&&M.stateNode.containerInfo===U.containerInfo&&M.stateNode.implementation===U.implementation){s(L,M.sibling),Z=d(M,U.children||[]),Z.return=L,L=Z;break e}else{s(L,M);break}else t(L,M);M=M.sibling}Z=ou(U,L.mode,Z),Z.return=L,L=Z}return _(L);case B:return U=ks(U),at(L,M,U,Z)}if(ae(U))return pe(L,M,U,Z);if(ne(U)){if(ge=ne(U),typeof ge!="function")throw Error(o(150));return U=ge.call(U),xe(L,M,U,Z)}if(typeof U.then=="function")return at(L,M,Yl(U),Z);if(U.$$typeof===A)return at(L,M,$l(L,U),Z);Zl(L,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,M!==null&&M.tag===6?(s(L,M.sibling),Z=d(M,U),Z.return=L,L=Z):(s(L,M),Z=iu(U,L.mode,Z),Z.return=L,L=Z),_(L)):s(L,M)}return function(L,M,U,Z){try{bo=0;var ge=at(L,M,U,Z);return vi=null,ge}catch(me){if(me===mi||me===Kl)throw me;var Ke=fn(29,me,null,L.mode);return Ke.lanes=Z,Ke.return=L,Ke}finally{}}}var Ns=om(!0),lm=om(!1),Va=!1;function yu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pa(e,t,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Xe&2)!==0){var d=l.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),l.pending=t,t=Vl(e),$p(e,null,s),t}return Ul(e,l,t,s),Vl(e)}function _o(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,Qh(e,s)}}function xu(e,t){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var d=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?d=h=_:h=h.next=_,s=s.next}while(s!==null);h===null?d=h=t:h=h.next=t}else d=h=t;s={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var _u=!1;function So(){if(_u){var e=pi;if(e!==null)throw e}}function To(e,t,s,l){_u=!1;var d=e.updateQueue;Va=!1;var h=d.firstBaseUpdate,_=d.lastBaseUpdate,j=d.shared.pending;if(j!==null){d.shared.pending=null;var D=j,V=D.next;D.next=null,_===null?h=V:_.next=V,_=D;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,j=Y.lastBaseUpdate,j!==_&&(j===null?Y.firstBaseUpdate=V:j.next=V,Y.lastBaseUpdate=D))}if(h!==null){var X=d.baseState;_=0,Y=V=D=null,j=h;do{var P=j.lane&-536870913,$=P!==j.lane;if($?(ze&P)===P:(l&P)===P){P!==0&&P===hi&&(_u=!0),Y!==null&&(Y=Y.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var pe=e,xe=j;P=t;var at=s;switch(xe.tag){case 1:if(pe=xe.payload,typeof pe=="function"){X=pe.call(at,X,P);break e}X=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=xe.payload,P=typeof pe=="function"?pe.call(at,X,P):pe,P==null)break e;X=b({},X,P);break e;case 2:Va=!0}}P=j.callback,P!==null&&(e.flags|=64,$&&(e.flags|=8192),$=d.callbacks,$===null?d.callbacks=[P]:$.push(P))}else $={lane:P,tag:j.tag,payload:j.payload,callback:j.callback,next:null},Y===null?(V=Y=$,D=X):Y=Y.next=$,_|=P;if(j=j.next,j===null){if(j=d.shared.pending,j===null)break;$=j,j=$.next,$.next=null,d.lastBaseUpdate=$,d.shared.pending=null}}while(!0);Y===null&&(D=X),d.baseState=D,d.firstBaseUpdate=V,d.lastBaseUpdate=Y,h===null&&(d.shared.lanes=0),Fa|=_,e.lanes=_,e.memoizedState=X}}function rm(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function cm(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)rm(s[e],t)}var gi=Re(null),Xl=Re(0);function um(e,t){e=ba,Te(Xl,e),Te(gi,t),ba=e|t.baseLanes}function Su(){Te(Xl,ba),Te(gi,gi.current)}function Tu(){ba=Xl.current,we(gi),we(Xl)}var hn=Re(null),An=null;function Ga(e){var t=e.alternate;Te(_t,_t.current&1),Te(hn,e),An===null&&(t===null||gi.current!==null||t.memoizedState!==null)&&(An=e)}function ku(e){Te(_t,_t.current),Te(hn,e),An===null&&(An=e)}function dm(e){e.tag===22?(Te(_t,_t.current),Te(hn,e),An===null&&(An=e)):$a()}function $a(){Te(_t,_t.current),Te(hn,hn.current)}function pn(e){we(hn),An===e&&(An=null),we(_t)}var _t=Re(0);function Wl(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Ad(s)||Dd(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var da=0,Ee=null,tt=null,Nt=null,Ql=!1,yi=!1,ws=!1,Jl=0,ko=0,bi=null,A1=0;function gt(){throw Error(o(321))}function ju(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!dn(e[s],t[s]))return!1;return!0}function Nu(e,t,s,l,d,h){return da=h,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Ym:Hu,ws=!1,h=s(l,d),ws=!1,yi&&(h=hm(t,s,l,d)),fm(e),h}function fm(e){O.H=wo;var t=tt!==null&&tt.next!==null;if(da=0,Nt=tt=Ee=null,Ql=!1,ko=0,bi=null,t)throw Error(o(300));e===null||wt||(e=e.dependencies,e!==null&&Gl(e)&&(wt=!0))}function hm(e,t,s,l){Ee=e;var d=0;do{if(yi&&(bi=null),ko=0,yi=!1,25<=d)throw Error(o(301));if(d+=1,Nt=tt=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}O.H=Zm,h=t(s,l)}while(yi);return h}function D1(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?jo(t):t,e=e.useState()[0],(tt!==null?tt.memoizedState:null)!==e&&(Ee.flags|=1024),t}function wu(){var e=Jl!==0;return Jl=0,e}function Cu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Eu(e){if(Ql){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ql=!1}da=0,Nt=tt=Ee=null,yi=!1,ko=Jl=0,bi=null}function Qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?Ee.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function St(){if(tt===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=tt.next;var t=Nt===null?Ee.memoizedState:Nt.next;if(t!==null)Nt=t,tt=e;else{if(e===null)throw Ee.alternate===null?Error(o(467)):Error(o(310));tt=e,e={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},Nt===null?Ee.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function er(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(e){var t=ko;return ko+=1,bi===null&&(bi=[]),e=am(bi,e,t),t=Ee,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Ym:Hu),e}function tr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return jo(e);if(e.$$typeof===A)return Pt(e)}throw Error(o(438,String(e)))}function Au(e){var t=null,s=Ee.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var l=Ee.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=er(),Ee.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),l=0;l<e;l++)s[l]=Q;return t.index++,s}function fa(e,t){return typeof t=="function"?t(e):t}function nr(e){var t=St();return Du(t,tt,e)}function Du(e,t,s){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=s;var d=e.baseQueue,h=l.pending;if(h!==null){if(d!==null){var _=d.next;d.next=h.next,h.next=_}t.baseQueue=d=h,l.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{t=d.next;var j=_=null,D=null,V=t,Y=!1;do{var X=V.lane&-536870913;if(X!==V.lane?(ze&X)===X:(da&X)===X){var P=V.revertLane;if(P===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),X===hi&&(Y=!0);else if((da&P)===P){V=V.next,P===hi&&(Y=!0);continue}else X={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(j=D=X,_=h):D=D.next=X,Ee.lanes|=P,Fa|=P;X=V.action,ws&&s(h,X),h=V.hasEagerState?V.eagerState:s(h,X)}else P={lane:X,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(j=D=P,_=h):D=D.next=P,Ee.lanes|=X,Fa|=X;V=V.next}while(V!==null&&V!==t);if(D===null?_=h:D.next=j,!dn(h,e.memoizedState)&&(wt=!0,Y&&(s=pi,s!==null)))throw s;e.memoizedState=h,e.baseState=_,e.baseQueue=D,l.lastRenderedState=h}return d===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Ru(e){var t=St(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var l=s.dispatch,d=s.pending,h=t.memoizedState;if(d!==null){s.pending=null;var _=d=d.next;do h=e(h,_.action),_=_.next;while(_!==d);dn(h,t.memoizedState)||(wt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,l]}function pm(e,t,s){var l=Ee,d=St(),h=He;if(h){if(s===void 0)throw Error(o(407));s=s()}else s=t();var _=!dn((tt||d).memoizedState,s);if(_&&(d.memoizedState=s,wt=!0),d=d.queue,Bu(gm.bind(null,l,d,e),[e]),d.getSnapshot!==t||_||Nt!==null&&Nt.memoizedState.tag&1){if(l.flags|=2048,xi(9,{destroy:void 0},vm.bind(null,l,d,s,t),null),st===null)throw Error(o(349));h||(da&127)!==0||mm(l,t,s)}return s}function mm(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ee.updateQueue,t===null?(t=er(),Ee.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function vm(e,t,s,l){t.value=s,t.getSnapshot=l,ym(t)&&bm(e)}function gm(e,t,s){return s(function(){ym(t)&&bm(e)})}function ym(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!dn(e,s)}catch{return!0}}function bm(e){var t=ys(e,2);t!==null&&rn(t,e,2)}function Mu(e){var t=Qt();if(typeof e=="function"){var s=e;if(e=s(),ws){Qe(!0);try{s()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:e},t}function xm(e,t,s,l){return e.baseState=s,Du(e,tt,typeof l=="function"?l:fa)}function R1(e,t,s,l,d){if(ir(e))throw Error(o(485));if(e=t.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){h.listeners.push(_)}};O.T!==null?s(!0):h.isTransition=!1,l(h),s=t.pending,s===null?(h.next=t.pending=h,_m(t,h)):(h.next=s.next,t.pending=s.next=h)}}function _m(e,t){var s=t.action,l=t.payload,d=e.state;if(t.isTransition){var h=O.T,_={};O.T=_;try{var j=s(d,l),D=O.S;D!==null&&D(_,j),Sm(e,t,j)}catch(V){Ou(e,t,V)}finally{h!==null&&_.types!==null&&(h.types=_.types),O.T=h}}else try{h=s(d,l),Sm(e,t,h)}catch(V){Ou(e,t,V)}}function Sm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Tm(e,t,l)},function(l){return Ou(e,t,l)}):Tm(e,t,s)}function Tm(e,t,s){t.status="fulfilled",t.value=s,km(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,_m(e,s)))}function Ou(e,t,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=s,km(t),t=t.next;while(t!==l)}e.action=null}function km(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function jm(e,t){return t}function Nm(e,t){if(He){var s=st.formState;if(s!==null){e:{var l=Ee;if(He){if(ot){t:{for(var d=ot,h=En;d.nodeType!==8;){if(!h){d=null;break t}if(d=Dn(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){ot=Dn(d.nextSibling),l=d.data==="F!";break e}}za(l)}l=!1}l&&(t=s[0])}}return s=Qt(),s.memoizedState=s.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jm,lastRenderedState:t},s.queue=l,s=qm.bind(null,Ee,l),l.dispatch=s,l=Mu(!1),h=Vu.bind(null,Ee,!1,l.queue),l=Qt(),d={state:t,dispatch:null,action:e,pending:null},l.queue=d,s=R1.bind(null,Ee,d,h,s),d.dispatch=s,l.memoizedState=e,[t,s,!1]}function wm(e){var t=St();return Cm(t,tt,e)}function Cm(e,t,s){if(t=Du(e,t,jm)[0],e=nr(fa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=jo(t)}catch(_){throw _===mi?Kl:_}else l=t;t=St();var d=t.queue,h=d.dispatch;return s!==t.memoizedState&&(Ee.flags|=2048,xi(9,{destroy:void 0},M1.bind(null,d,s),null)),[l,h,e]}function M1(e,t){e.action=t}function Em(e){var t=St(),s=tt;if(s!==null)return Cm(t,s,e);St(),t=t.memoizedState,s=St();var l=s.queue.dispatch;return s.memoizedState=e,[t,l,!1]}function xi(e,t,s,l){return e={tag:e,create:s,deps:l,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=er(),Ee.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,t.lastEffect=e),e}function Am(){return St().memoizedState}function ar(e,t,s,l){var d=Qt();Ee.flags|=e,d.memoizedState=xi(1|t,{destroy:void 0},s,l===void 0?null:l)}function sr(e,t,s,l){var d=St();l=l===void 0?null:l;var h=d.memoizedState.inst;tt!==null&&l!==null&&ju(l,tt.memoizedState.deps)?d.memoizedState=xi(t,h,s,l):(Ee.flags|=e,d.memoizedState=xi(1|t,h,s,l))}function Dm(e,t){ar(8390656,8,e,t)}function Bu(e,t){sr(2048,8,e,t)}function O1(e){Ee.flags|=4;var t=Ee.updateQueue;if(t===null)t=er(),Ee.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Rm(e){var t=St().memoizedState;return O1({ref:t,nextImpl:e}),function(){if((Xe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Mm(e,t){return sr(4,2,e,t)}function Om(e,t){return sr(4,4,e,t)}function Bm(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Lm(e,t,s){s=s!=null?s.concat([e]):null,sr(4,4,Bm.bind(null,t,e),s)}function Lu(){}function Im(e,t){var s=St();t=t===void 0?null:t;var l=s.memoizedState;return t!==null&&ju(t,l[1])?l[0]:(s.memoizedState=[e,t],e)}function zm(e,t){var s=St();t=t===void 0?null:t;var l=s.memoizedState;if(t!==null&&ju(t,l[1]))return l[0];if(l=e(),ws){Qe(!0);try{e()}finally{Qe(!1)}}return s.memoizedState=[l,t],l}function Iu(e,t,s){return s===void 0||(da&1073741824)!==0&&(ze&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Uv(),Ee.lanes|=e,Fa|=e,s)}function Um(e,t,s,l){return dn(s,t)?s:gi.current!==null?(e=Iu(e,s,l),dn(e,t)||(wt=!0),e):(da&42)===0||(da&1073741824)!==0&&(ze&261930)===0?(wt=!0,e.memoizedState=s):(e=Uv(),Ee.lanes|=e,Fa|=e,t)}function Vm(e,t,s,l,d){var h=G.p;G.p=h!==0&&8>h?h:8;var _=O.T,j={};O.T=j,Vu(e,!1,t,s);try{var D=d(),V=O.S;if(V!==null&&V(j,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var Y=E1(D,l);No(e,t,Y,gn(e))}else No(e,t,l,gn(e))}catch(X){No(e,t,{then:function(){},status:"rejected",reason:X},gn())}finally{G.p=h,_!==null&&j.types!==null&&(_.types=j.types),O.T=_}}function B1(){}function zu(e,t,s,l){if(e.tag!==5)throw Error(o(476));var d=Hm(e).queue;Vm(e,d,t,W,s===null?B1:function(){return Pm(e),s(l)})}function Hm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:W},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Pm(e){var t=Hm(e);t.next===null&&(t=e.alternate.memoizedState),No(e,t.next.queue,{},gn())}function Uu(){return Pt(Go)}function Gm(){return St().memoizedState}function $m(){return St().memoizedState}function L1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=gn();e=Ha(s);var l=Pa(t,e,s);l!==null&&(rn(l,t,s),_o(l,t,s)),t={cache:pu()},e.payload=t;return}t=t.return}}function I1(e,t,s){var l=gn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},ir(e)?Km(t,s):(s=au(e,t,s,l),s!==null&&(rn(s,e,l),Fm(s,t,l)))}function qm(e,t,s){var l=gn();No(e,t,s,l)}function No(e,t,s,l){var d={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(ir(e))Km(t,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var _=t.lastRenderedState,j=h(_,s);if(d.hasEagerState=!0,d.eagerState=j,dn(j,_))return Ul(e,t,d,0),st===null&&zl(),!1}catch{}finally{}if(s=au(e,t,d,l),s!==null)return rn(s,e,l),Fm(s,t,l),!0}return!1}function Vu(e,t,s,l){if(l={lane:2,revertLane:yd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ir(e)){if(t)throw Error(o(479))}else t=au(e,s,l,2),t!==null&&rn(t,e,2)}function ir(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Km(e,t){yi=Ql=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Fm(e,t,s){if((s&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,Qh(e,s)}}var wo={readContext:Pt,use:tr,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};wo.useEffectEvent=gt;var Ym={readContext:Pt,use:tr,useCallback:function(e,t){return Qt().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:Dm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,ar(4194308,4,Bm.bind(null,t,e),s)},useLayoutEffect:function(e,t){return ar(4194308,4,e,t)},useInsertionEffect:function(e,t){ar(4,2,e,t)},useMemo:function(e,t){var s=Qt();t=t===void 0?null:t;var l=e();if(ws){Qe(!0);try{e()}finally{Qe(!1)}}return s.memoizedState=[l,t],l},useReducer:function(e,t,s){var l=Qt();if(s!==void 0){var d=s(t);if(ws){Qe(!0);try{s(t)}finally{Qe(!1)}}}else d=t;return l.memoizedState=l.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},l.queue=e,e=e.dispatch=I1.bind(null,Ee,e),[l.memoizedState,e]},useRef:function(e){var t=Qt();return e={current:e},t.memoizedState=e},useState:function(e){e=Mu(e);var t=e.queue,s=qm.bind(null,Ee,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Lu,useDeferredValue:function(e,t){var s=Qt();return Iu(s,e,t)},useTransition:function(){var e=Mu(!1);return e=Vm.bind(null,Ee,e.queue,!0,!1),Qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var l=Ee,d=Qt();if(He){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),st===null)throw Error(o(349));(ze&127)!==0||mm(l,t,s)}d.memoizedState=s;var h={value:s,getSnapshot:t};return d.queue=h,Dm(gm.bind(null,l,h,e),[e]),l.flags|=2048,xi(9,{destroy:void 0},vm.bind(null,l,h,s,t),null),s},useId:function(){var e=Qt(),t=st.identifierPrefix;if(He){var s=Zn,l=Yn;s=(l&~(1<<32-Oe(l)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Jl++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=A1++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Uu,useFormState:Nm,useActionState:Nm,useOptimistic:function(e){var t=Qt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Vu.bind(null,Ee,!0,s),s.dispatch=t,[e,t]},useMemoCache:Au,useCacheRefresh:function(){return Qt().memoizedState=L1.bind(null,Ee)},useEffectEvent:function(e){var t=Qt(),s={impl:e};return t.memoizedState=s,function(){if((Xe&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Hu={readContext:Pt,use:tr,useCallback:Im,useContext:Pt,useEffect:Bu,useImperativeHandle:Lm,useInsertionEffect:Mm,useLayoutEffect:Om,useMemo:zm,useReducer:nr,useRef:Am,useState:function(){return nr(fa)},useDebugValue:Lu,useDeferredValue:function(e,t){var s=St();return Um(s,tt.memoizedState,e,t)},useTransition:function(){var e=nr(fa)[0],t=St().memoizedState;return[typeof e=="boolean"?e:jo(e),t]},useSyncExternalStore:pm,useId:Gm,useHostTransitionStatus:Uu,useFormState:wm,useActionState:wm,useOptimistic:function(e,t){var s=St();return xm(s,tt,e,t)},useMemoCache:Au,useCacheRefresh:$m};Hu.useEffectEvent=Rm;var Zm={readContext:Pt,use:tr,useCallback:Im,useContext:Pt,useEffect:Bu,useImperativeHandle:Lm,useInsertionEffect:Mm,useLayoutEffect:Om,useMemo:zm,useReducer:Ru,useRef:Am,useState:function(){return Ru(fa)},useDebugValue:Lu,useDeferredValue:function(e,t){var s=St();return tt===null?Iu(s,e,t):Um(s,tt.memoizedState,e,t)},useTransition:function(){var e=Ru(fa)[0],t=St().memoizedState;return[typeof e=="boolean"?e:jo(e),t]},useSyncExternalStore:pm,useId:Gm,useHostTransitionStatus:Uu,useFormState:Em,useActionState:Em,useOptimistic:function(e,t){var s=St();return tt!==null?xm(s,tt,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Au,useCacheRefresh:$m};Zm.useEffectEvent=Rm;function Pu(e,t,s,l){t=e.memoizedState,s=s(l,t),s=s==null?t:b({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Gu={enqueueSetState:function(e,t,s){e=e._reactInternals;var l=gn(),d=Ha(l);d.payload=t,s!=null&&(d.callback=s),t=Pa(e,d,l),t!==null&&(rn(t,e,l),_o(t,e,l))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var l=gn(),d=Ha(l);d.tag=1,d.payload=t,s!=null&&(d.callback=s),t=Pa(e,d,l),t!==null&&(rn(t,e,l),_o(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=gn(),l=Ha(s);l.tag=2,t!=null&&(l.callback=t),t=Pa(e,l,s),t!==null&&(rn(t,e,s),_o(t,e,s))}};function Xm(e,t,s,l,d,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,_):t.prototype&&t.prototype.isPureReactComponent?!ho(s,l)||!ho(d,h):!0}function Wm(e,t,s,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,l),t.state!==e&&Gu.enqueueReplaceState(t,t.state,null)}function Cs(e,t){var s=t;if("ref"in t){s={};for(var l in t)l!=="ref"&&(s[l]=t[l])}if(e=e.defaultProps){s===t&&(s=b({},s));for(var d in e)s[d]===void 0&&(s[d]=e[d])}return s}function Qm(e){Il(e)}function Jm(e){console.error(e)}function ev(e){Il(e)}function or(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function tv(e,t,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function $u(e,t,s){return s=Ha(s),s.tag=3,s.payload={element:null},s.callback=function(){or(e,t)},s}function nv(e){return e=Ha(e),e.tag=3,e}function av(e,t,s,l){var d=s.type.getDerivedStateFromError;if(typeof d=="function"){var h=l.value;e.payload=function(){return d(h)},e.callback=function(){tv(t,s,l)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){tv(t,s,l),typeof d!="function"&&(Ya===null?Ya=new Set([this]):Ya.add(this));var j=l.stack;this.componentDidCatch(l.value,{componentStack:j!==null?j:""})})}function z1(e,t,s,l,d){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=s.alternate,t!==null&&fi(t,s,d,!0),s=hn.current,s!==null){switch(s.tag){case 31:case 13:return An===null?yr():s.alternate===null&&yt===0&&(yt=3),s.flags&=-257,s.flags|=65536,s.lanes=d,l===Fl?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([l]):t.add(l),md(e,l,d)),!1;case 22:return s.flags|=65536,l===Fl?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([l]):s.add(l)),md(e,l,d)),!1}throw Error(o(435,s.tag))}return md(e,l,d),yr(),!1}if(He)return t=hn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,l!==cu&&(e=Error(o(422),{cause:l}),vo(Nn(e,s)))):(l!==cu&&(t=Error(o(423),{cause:l}),vo(Nn(t,s))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,l=Nn(l,s),d=$u(e.stateNode,l,d),xu(e,d),yt!==4&&(yt=2)),!1;var h=Error(o(520),{cause:l});if(h=Nn(h,s),Bo===null?Bo=[h]:Bo.push(h),yt!==4&&(yt=2),t===null)return!0;l=Nn(l,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=d&-d,s.lanes|=e,e=$u(s.stateNode,l,e),xu(s,e),!1;case 1:if(t=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Ya===null||!Ya.has(h))))return s.flags|=65536,d&=-d,s.lanes|=d,d=nv(d),av(d,e,s,l),xu(s,d),!1}s=s.return}while(s!==null);return!1}var qu=Error(o(461)),wt=!1;function Gt(e,t,s,l){t.child=e===null?lm(t,null,s,l):Ns(t,e.child,s,l)}function sv(e,t,s,l,d){s=s.render;var h=t.ref;if("ref"in l){var _={};for(var j in l)j!=="ref"&&(_[j]=l[j])}else _=l;return Ss(t),l=Nu(e,t,s,_,h,d),j=wu(),e!==null&&!wt?(Cu(e,t,d),ha(e,t,d)):(He&&j&&lu(t),t.flags|=1,Gt(e,t,l,d),t.child)}function iv(e,t,s,l,d){if(e===null){var h=s.type;return typeof h=="function"&&!su(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,ov(e,t,h,l,d)):(e=Hl(s.type,null,l,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Ju(e,d)){var _=h.memoizedProps;if(s=s.compare,s=s!==null?s:ho,s(_,l)&&e.ref===t.ref)return ha(e,t,d)}return t.flags|=1,e=la(h,l),e.ref=t.ref,e.return=t,t.child=e}function ov(e,t,s,l,d){if(e!==null){var h=e.memoizedProps;if(ho(h,l)&&e.ref===t.ref)if(wt=!1,t.pendingProps=l=h,Ju(e,d))(e.flags&131072)!==0&&(wt=!0);else return t.lanes=e.lanes,ha(e,t,d)}return Ku(e,t,s,l,d)}function lv(e,t,s,l){var d=l.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(l=t.child=e.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~h}else l=0,t.child=null;return rv(e,t,h,s,l)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ql(t,h!==null?h.cachePool:null),h!==null?um(t,h):Su(),dm(t);else return l=t.lanes=536870912,rv(e,t,h!==null?h.baseLanes|s:s,s,l)}else h!==null?(ql(t,h.cachePool),um(t,h),$a(),t.memoizedState=null):(e!==null&&ql(t,null),Su(),$a());return Gt(e,t,d,s),t.child}function Co(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rv(e,t,s,l,d){var h=vu();return h=h===null?null:{parent:jt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&ql(t,null),Su(),dm(t),e!==null&&fi(e,t,l,!0),t.childLanes=d,null}function lr(e,t){return t=cr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cv(e,t,s){return Ns(t,e.child,null,s),e=lr(t,t.pendingProps),e.flags|=2,pn(t),t.memoizedState=null,e}function U1(e,t,s){var l=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(l.mode==="hidden")return e=lr(t,l),t.lanes=536870912,Co(null,e);if(ku(t),(e=ot)?(e=_g(e,En),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:La!==null?{id:Yn,overflow:Zn}:null,retryLane:536870912,hydrationErrors:null},s=Kp(e),s.return=t,t.child=s,Ht=t,ot=null)):e=null,e===null)throw za(t);return t.lanes=536870912,null}return lr(t,l)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(ku(t),d)if(t.flags&256)t.flags&=-257,t=cv(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(wt||fi(e,t,s,!1),d=(s&e.childLanes)!==0,wt||d){if(l=st,l!==null&&(_=Jh(l,s),_!==0&&_!==h.retryLane))throw h.retryLane=_,ys(e,_),rn(l,e,_),qu;yr(),t=cv(e,t,s)}else e=h.treeContext,ot=Dn(_.nextSibling),Ht=t,He=!0,Ia=null,En=!1,e!==null&&Zp(t,e),t=lr(t,l),t.flags|=4096;return t}return e=la(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function rr(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Ku(e,t,s,l,d){return Ss(t),s=Nu(e,t,s,l,void 0,d),l=wu(),e!==null&&!wt?(Cu(e,t,d),ha(e,t,d)):(He&&l&&lu(t),t.flags|=1,Gt(e,t,s,d),t.child)}function uv(e,t,s,l,d,h){return Ss(t),t.updateQueue=null,s=hm(t,l,s,d),fm(e),l=wu(),e!==null&&!wt?(Cu(e,t,h),ha(e,t,h)):(He&&l&&lu(t),t.flags|=1,Gt(e,t,s,h),t.child)}function dv(e,t,s,l,d){if(Ss(t),t.stateNode===null){var h=ri,_=s.contextType;typeof _=="object"&&_!==null&&(h=Pt(_)),h=new s(l,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Gu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=l,h.state=t.memoizedState,h.refs={},yu(t),_=s.contextType,h.context=typeof _=="object"&&_!==null?Pt(_):ri,h.state=t.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Pu(t,s,_,l),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(_=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),_!==h.state&&Gu.enqueueReplaceState(h,h.state,null),To(t,l,h,d),So(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){h=t.stateNode;var j=t.memoizedProps,D=Cs(s,j);h.props=D;var V=h.context,Y=s.contextType;_=ri,typeof Y=="object"&&Y!==null&&(_=Pt(Y));var X=s.getDerivedStateFromProps;Y=typeof X=="function"||typeof h.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,Y||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(j||V!==_)&&Wm(t,h,l,_),Va=!1;var P=t.memoizedState;h.state=P,To(t,l,h,d),So(),V=t.memoizedState,j||P!==V||Va?(typeof X=="function"&&(Pu(t,s,X,l),V=t.memoizedState),(D=Va||Xm(t,s,D,l,P,V,_))?(Y||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=V),h.props=l,h.state=V,h.context=_,l=D):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{h=t.stateNode,bu(e,t),_=t.memoizedProps,Y=Cs(s,_),h.props=Y,X=t.pendingProps,P=h.context,V=s.contextType,D=ri,typeof V=="object"&&V!==null&&(D=Pt(V)),j=s.getDerivedStateFromProps,(V=typeof j=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==X||P!==D)&&Wm(t,h,l,D),Va=!1,P=t.memoizedState,h.state=P,To(t,l,h,d),So();var $=t.memoizedState;_!==X||P!==$||Va||e!==null&&e.dependencies!==null&&Gl(e.dependencies)?(typeof j=="function"&&(Pu(t,s,j,l),$=t.memoizedState),(Y=Va||Xm(t,s,Y,l,P,$,D)||e!==null&&e.dependencies!==null&&Gl(e.dependencies))?(V||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,$,D),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,$,D)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=$),h.props=l,h.state=$,h.context=D,l=Y):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),l=!1)}return h=l,rr(e,t),l=(t.flags&128)!==0,h||l?(h=t.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&l?(t.child=Ns(t,e.child,null,d),t.child=Ns(t,null,s,d)):Gt(e,t,s,d),t.memoizedState=h.state,e=t.child):e=ha(e,t,d),e}function fv(e,t,s,l){return xs(),t.flags|=256,Gt(e,t,s,l),t.child}var Fu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yu(e){return{baseLanes:e,cachePool:tm()}}function Zu(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=vn),e}function hv(e,t,s){var l=t.pendingProps,d=!1,h=(t.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(_t.current&2)!==0),_&&(d=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(d?Ga(t):$a(),(e=ot)?(e=_g(e,En),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:La!==null?{id:Yn,overflow:Zn}:null,retryLane:536870912,hydrationErrors:null},s=Kp(e),s.return=t,t.child=s,Ht=t,ot=null)):e=null,e===null)throw za(t);return Dd(e)?t.lanes=32:t.lanes=536870912,null}var j=l.children;return l=l.fallback,d?($a(),d=t.mode,j=cr({mode:"hidden",children:j},d),l=bs(l,d,s,null),j.return=t,l.return=t,j.sibling=l,t.child=j,l=t.child,l.memoizedState=Yu(s),l.childLanes=Zu(e,_,s),t.memoizedState=Fu,Co(null,l)):(Ga(t),Xu(t,j))}var D=e.memoizedState;if(D!==null&&(j=D.dehydrated,j!==null)){if(h)t.flags&256?(Ga(t),t.flags&=-257,t=Wu(e,t,s)):t.memoizedState!==null?($a(),t.child=e.child,t.flags|=128,t=null):($a(),j=l.fallback,d=t.mode,l=cr({mode:"visible",children:l.children},d),j=bs(j,d,s,null),j.flags|=2,l.return=t,j.return=t,l.sibling=j,t.child=l,Ns(t,e.child,null,s),l=t.child,l.memoizedState=Yu(s),l.childLanes=Zu(e,_,s),t.memoizedState=Fu,t=Co(null,l));else if(Ga(t),Dd(j)){if(_=j.nextSibling&&j.nextSibling.dataset,_)var V=_.dgst;_=V,l=Error(o(419)),l.stack="",l.digest=_,vo({value:l,source:null,stack:null}),t=Wu(e,t,s)}else if(wt||fi(e,t,s,!1),_=(s&e.childLanes)!==0,wt||_){if(_=st,_!==null&&(l=Jh(_,s),l!==0&&l!==D.retryLane))throw D.retryLane=l,ys(e,l),rn(_,e,l),qu;Ad(j)||yr(),t=Wu(e,t,s)}else Ad(j)?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,ot=Dn(j.nextSibling),Ht=t,He=!0,Ia=null,En=!1,e!==null&&Zp(t,e),t=Xu(t,l.children),t.flags|=4096);return t}return d?($a(),j=l.fallback,d=t.mode,D=e.child,V=D.sibling,l=la(D,{mode:"hidden",children:l.children}),l.subtreeFlags=D.subtreeFlags&65011712,V!==null?j=la(V,j):(j=bs(j,d,s,null),j.flags|=2),j.return=t,l.return=t,l.sibling=j,t.child=l,Co(null,l),l=t.child,j=e.child.memoizedState,j===null?j=Yu(s):(d=j.cachePool,d!==null?(D=jt._currentValue,d=d.parent!==D?{parent:D,pool:D}:d):d=tm(),j={baseLanes:j.baseLanes|s,cachePool:d}),l.memoizedState=j,l.childLanes=Zu(e,_,s),t.memoizedState=Fu,Co(e.child,l)):(Ga(t),s=e.child,e=s.sibling,s=la(s,{mode:"visible",children:l.children}),s.return=t,s.sibling=null,e!==null&&(_=t.deletions,_===null?(t.deletions=[e],t.flags|=16):_.push(e)),t.child=s,t.memoizedState=null,s)}function Xu(e,t){return t=cr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function cr(e,t){return e=fn(22,e,null,t),e.lanes=0,e}function Wu(e,t,s){return Ns(t,e.child,null,s),e=Xu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pv(e,t,s){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),fu(e.return,t,s)}function Qu(e,t,s,l,d,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:d,treeForkCount:h}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=l,_.tail=s,_.tailMode=d,_.treeForkCount=h)}function mv(e,t,s){var l=t.pendingProps,d=l.revealOrder,h=l.tail;l=l.children;var _=_t.current,j=(_&2)!==0;if(j?(_=_&1|2,t.flags|=128):_&=1,Te(_t,_),Gt(e,t,l,s),l=He?mo:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&pv(e,s,t);else if(e.tag===19)pv(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(s=t.child,d=null;s!==null;)e=s.alternate,e!==null&&Wl(e)===null&&(d=s),s=s.sibling;s=d,s===null?(d=t.child,t.child=null):(d=s.sibling,s.sibling=null),Qu(t,!1,d,s,h,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Wl(e)===null){t.child=d;break}e=d.sibling,d.sibling=s,s=d,d=e}Qu(t,!0,s,null,h,l);break;case"together":Qu(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ha(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Fa|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(fi(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,s=la(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=la(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Ju(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Gl(e)))}function V1(e,t,s){switch(t.tag){case 3:$e(t,t.stateNode.containerInfo),Ua(t,jt,e.memoizedState.cache),xs();break;case 27:case 5:te(t);break;case 4:$e(t,t.stateNode.containerInfo);break;case 10:Ua(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ku(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Ga(t),t.flags|=128,null):(s&t.child.childLanes)!==0?hv(e,t,s):(Ga(t),e=ha(e,t,s),e!==null?e.sibling:null);Ga(t);break;case 19:var d=(e.flags&128)!==0;if(l=(s&t.childLanes)!==0,l||(fi(e,t,s,!1),l=(s&t.childLanes)!==0),d){if(l)return mv(e,t,s);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Te(_t,_t.current),l)break;return null;case 22:return t.lanes=0,lv(e,t,s,t.pendingProps);case 24:Ua(t,jt,e.memoizedState.cache)}return ha(e,t,s)}function vv(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)wt=!0;else{if(!Ju(e,s)&&(t.flags&128)===0)return wt=!1,V1(e,t,s);wt=(e.flags&131072)!==0}else wt=!1,He&&(t.flags&1048576)!==0&&Yp(t,mo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=ks(t.elementType),t.type=e,typeof e=="function")su(e)?(l=Cs(e,l),t.tag=1,t=dv(null,t,e,l,s)):(t.tag=0,t=Ku(null,t,e,l,s));else{if(e!=null){var d=e.$$typeof;if(d===R){t.tag=11,t=sv(null,t,e,l,s);break e}else if(d===H){t.tag=14,t=iv(null,t,e,l,s);break e}}throw t=q(e)||e,Error(o(306,t,""))}}return t;case 0:return Ku(e,t,t.type,t.pendingProps,s);case 1:return l=t.type,d=Cs(l,t.pendingProps),dv(e,t,l,d,s);case 3:e:{if($e(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var h=t.memoizedState;d=h.element,bu(e,t),To(t,l,null,s);var _=t.memoizedState;if(l=_.cache,Ua(t,jt,l),l!==h.cache&&hu(t,[jt],s,!0),So(),l=_.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=fv(e,t,l,s);break e}else if(l!==d){d=Nn(Error(o(424)),t),vo(d),t=fv(e,t,l,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ot=Dn(e.firstChild),Ht=t,He=!0,Ia=null,En=!0,s=lm(t,null,l,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(xs(),l===d){t=ha(e,t,s);break e}Gt(e,t,l,s)}t=t.child}return t;case 26:return rr(e,t),e===null?(s=wg(t.type,null,t.pendingProps,null))?t.memoizedState=s:He||(s=t.type,e=t.pendingProps,l=jr(ve.current).createElement(s),l[Vt]=t,l[tn]=e,$t(l,s,e),It(l),t.stateNode=l):t.memoizedState=wg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return te(t),e===null&&He&&(l=t.stateNode=kg(t.type,t.pendingProps,ve.current),Ht=t,En=!0,d=ot,Qa(t.type)?(Rd=d,ot=Dn(l.firstChild)):ot=d),Gt(e,t,t.pendingProps.children,s),rr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((d=l=ot)&&(l=vS(l,t.type,t.pendingProps,En),l!==null?(t.stateNode=l,Ht=t,ot=Dn(l.firstChild),En=!1,d=!0):d=!1),d||za(t)),te(t),d=t.type,h=t.pendingProps,_=e!==null?e.memoizedProps:null,l=h.children,wd(d,h)?l=null:_!==null&&wd(d,_)&&(t.flags|=32),t.memoizedState!==null&&(d=Nu(e,t,D1,null,null,s),Go._currentValue=d),rr(e,t),Gt(e,t,l,s),t.child;case 6:return e===null&&He&&((e=s=ot)&&(s=gS(s,t.pendingProps,En),s!==null?(t.stateNode=s,Ht=t,ot=null,e=!0):e=!1),e||za(t)),null;case 13:return hv(e,t,s);case 4:return $e(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Ns(t,null,l,s):Gt(e,t,l,s),t.child;case 11:return sv(e,t,t.type,t.pendingProps,s);case 7:return Gt(e,t,t.pendingProps,s),t.child;case 8:return Gt(e,t,t.pendingProps.children,s),t.child;case 12:return Gt(e,t,t.pendingProps.children,s),t.child;case 10:return l=t.pendingProps,Ua(t,t.type,l.value),Gt(e,t,l.children,s),t.child;case 9:return d=t.type._context,l=t.pendingProps.children,Ss(t),d=Pt(d),l=l(d),t.flags|=1,Gt(e,t,l,s),t.child;case 14:return iv(e,t,t.type,t.pendingProps,s);case 15:return ov(e,t,t.type,t.pendingProps,s);case 19:return mv(e,t,s);case 31:return U1(e,t,s);case 22:return lv(e,t,s,t.pendingProps);case 24:return Ss(t),l=Pt(jt),e===null?(d=vu(),d===null&&(d=st,h=pu(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=s),d=h),t.memoizedState={parent:l,cache:d},yu(t),Ua(t,jt,d)):((e.lanes&s)!==0&&(bu(e,t),To(t,null,null,s),So()),d=e.memoizedState,h=t.memoizedState,d.parent!==l?(d={parent:l,cache:l},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),Ua(t,jt,l)):(l=h.cache,Ua(t,jt,l),l!==d.cache&&hu(t,[jt],s,!0))),Gt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function pa(e){e.flags|=4}function ed(e,t,s,l,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Gv())e.flags|=8192;else throw js=Fl,gu}else e.flags&=-16777217}function gv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Rg(t))if(Gv())e.flags|=8192;else throw js=Fl,gu}function ur(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Xh():536870912,e.lanes|=t,ki|=t)}function Eo(e,t){if(!He)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(t)for(var d=e.child;d!==null;)s|=d.lanes|d.childLanes,l|=d.subtreeFlags&65011712,l|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)s|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=s,t}function H1(e,t,s){var l=t.pendingProps;switch(ru(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return lt(t),null;case 3:return s=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ua(jt),Ft(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(di(t)?pa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,uu())),lt(t),null;case 26:var d=t.type,h=t.memoizedState;return e===null?(pa(t),h!==null?(lt(t),gv(t,h)):(lt(t),ed(t,d,null,l,s))):h?h!==e.memoizedState?(pa(t),lt(t),gv(t,h)):(lt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&pa(t),lt(t),ed(t,d,e,l,s)),null;case 27:if(J(t),s=ve.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&pa(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return lt(t),null}e=Be.current,di(t)?Xp(t):(e=kg(d,l,s),t.stateNode=e,pa(t))}return lt(t),null;case 5:if(J(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&pa(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return lt(t),null}if(h=Be.current,di(t))Xp(t);else{var _=jr(ve.current);switch(h){case 1:h=_.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=_.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=_.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=_.createElementNS("http://www.w3.org/1998/Math/MathML",d);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(d,{is:l.is}):_.createElement(d)}}h[Vt]=t,h[tn]=l;e:for(_=t.child;_!==null;){if(_.tag===5||_.tag===6)h.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===t)break e;for(;_.sibling===null;){if(_.return===null||_.return===t)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}t.stateNode=h;e:switch($t(h,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&pa(t)}}return lt(t),ed(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&pa(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=ve.current,di(t)){if(e=t.stateNode,s=t.memoizedProps,l=null,d=Ht,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}e[Vt]=t,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||hg(e.nodeValue,s)),e||za(t,!0)}else e=jr(e).createTextNode(l),e[Vt]=t,t.stateNode=e}return lt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(l=di(t),s!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Vt]=t}else xs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),e=!1}else s=uu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(pn(t),t):(pn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return lt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=di(t),l!==null&&l.dehydrated!==null){if(e===null){if(!d)throw Error(o(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));d[Vt]=t}else xs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),d=!1}else d=uu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(pn(t),t):(pn(t),null)}return pn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=t.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==d&&(l.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),ur(t,t.updateQueue),lt(t),null);case 4:return Ft(),e===null&&Sd(t.stateNode.containerInfo),lt(t),null;case 10:return ua(t.type),lt(t),null;case 19:if(we(_t),l=t.memoizedState,l===null)return lt(t),null;if(d=(t.flags&128)!==0,h=l.rendering,h===null)if(d)Eo(l,!1);else{if(yt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Wl(e),h!==null){for(t.flags|=128,Eo(l,!1),e=h.updateQueue,t.updateQueue=e,ur(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)qp(s,e),s=s.sibling;return Te(_t,_t.current&1|2),He&&ra(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Yt()>mr&&(t.flags|=128,d=!0,Eo(l,!1),t.lanes=4194304)}else{if(!d)if(e=Wl(h),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,ur(t,e),Eo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!He)return lt(t),null}else 2*Yt()-l.renderingStartTime>mr&&s!==536870912&&(t.flags|=128,d=!0,Eo(l,!1),t.lanes=4194304);l.isBackwards?(h.sibling=t.child,t.child=h):(e=l.last,e!==null?e.sibling=h:t.child=h,l.last=h)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Yt(),e.sibling=null,s=_t.current,Te(_t,d?s&1|2:s&1),He&&ra(t,l.treeForkCount),e):(lt(t),null);case 22:case 23:return pn(t),Tu(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(s&536870912)!==0&&(t.flags&128)===0&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),s=t.updateQueue,s!==null&&ur(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==s&&(t.flags|=2048),e!==null&&we(Ts),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ua(jt),lt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function P1(e,t){switch(ru(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ua(jt),Ft(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return J(t),null;case 31:if(t.memoizedState!==null){if(pn(t),t.alternate===null)throw Error(o(340));xs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(pn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));xs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return we(_t),null;case 4:return Ft(),null;case 10:return ua(t.type),null;case 22:case 23:return pn(t),Tu(),e!==null&&we(Ts),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ua(jt),null;case 25:return null;default:return null}}function yv(e,t){switch(ru(t),t.tag){case 3:ua(jt),Ft();break;case 26:case 27:case 5:J(t);break;case 4:Ft();break;case 31:t.memoizedState!==null&&pn(t);break;case 13:pn(t);break;case 19:we(_t);break;case 10:ua(t.type);break;case 22:case 23:pn(t),Tu(),e!==null&&we(Ts);break;case 24:ua(jt)}}function Ao(e,t){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var d=l.next;s=d;do{if((s.tag&e)===e){l=void 0;var h=s.create,_=s.inst;l=h(),_.destroy=l}s=s.next}while(s!==d)}}catch(j){et(t,t.return,j)}}function qa(e,t,s){try{var l=t.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var h=d.next;l=h;do{if((l.tag&e)===e){var _=l.inst,j=_.destroy;if(j!==void 0){_.destroy=void 0,d=t;var D=s,V=j;try{V()}catch(Y){et(d,D,Y)}}}l=l.next}while(l!==h)}}catch(Y){et(t,t.return,Y)}}function bv(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{cm(t,s)}catch(l){et(e,e.return,l)}}}function xv(e,t,s){s.props=Cs(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){et(e,t,l)}}function Do(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(d){et(e,t,d)}}function Xn(e,t){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(d){et(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(d){et(e,t,d)}else s.current=null}function _v(e){var t=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(d){et(e,e.return,d)}}function td(e,t,s){try{var l=e.stateNode;uS(l,e.type,s,t),l[tn]=t}catch(d){et(e,e.return,d)}}function Sv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qa(e.type)||e.tag===4}function nd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Sv(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&&Qa(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 ad(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=ia));else if(l!==4&&(l===27&&Qa(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(ad(e,t,s),e=e.sibling;e!==null;)ad(e,t,s),e=e.sibling}function dr(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(l!==4&&(l===27&&Qa(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(dr(e,t,s),e=e.sibling;e!==null;)dr(e,t,s),e=e.sibling}function Tv(e){var t=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);$t(t,l,s),t[Vt]=e,t[tn]=s}catch(h){et(e,e.return,h)}}var ma=!1,Ct=!1,sd=!1,kv=typeof WeakSet=="function"?WeakSet:Set,zt=null;function G1(e,t){if(e=e.containerInfo,jd=Rr,e=Lp(e),Wc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var d=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var _=0,j=-1,D=-1,V=0,Y=0,X=e,P=null;t:for(;;){for(var $;X!==s||d!==0&&X.nodeType!==3||(j=_+d),X!==h||l!==0&&X.nodeType!==3||(D=_+l),X.nodeType===3&&(_+=X.nodeValue.length),($=X.firstChild)!==null;)P=X,X=$;for(;;){if(X===e)break t;if(P===s&&++V===d&&(j=_),P===h&&++Y===l&&(D=_),($=X.nextSibling)!==null)break;X=P,P=X.parentNode}X=$}s=j===-1||D===-1?null:{start:j,end:D}}else s=null}s=s||{start:0,end:0}}else s=null;for(Nd={focusedElem:e,selectionRange:s},Rr=!1,zt=t;zt!==null;)if(t=zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,zt=e;else for(;zt!==null;){switch(t=zt,h=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)d=e[s],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=t,d=h.memoizedProps,h=h.memoizedState,l=s.stateNode;try{var pe=Cs(s.type,d);e=l.getSnapshotBeforeUpdate(pe,h),l.__reactInternalSnapshotBeforeUpdate=e}catch(xe){et(s,s.return,xe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Ed(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ed(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function jv(e,t,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:ga(e,s),l&4&&Ao(5,s);break;case 1:if(ga(e,s),l&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(_){et(s,s.return,_)}else{var d=Cs(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){et(s,s.return,_)}}l&64&&bv(s),l&512&&Do(s,s.return);break;case 3:if(ga(e,s),l&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{cm(e,t)}catch(_){et(s,s.return,_)}}break;case 27:t===null&&l&4&&Tv(s);case 26:case 5:ga(e,s),t===null&&l&4&&_v(s),l&512&&Do(s,s.return);break;case 12:ga(e,s);break;case 31:ga(e,s),l&4&&Cv(e,s);break;case 13:ga(e,s),l&4&&Ev(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Q1.bind(null,s),yS(e,s))));break;case 22:if(l=s.memoizedState!==null||ma,!l){t=t!==null&&t.memoizedState!==null||Ct,d=ma;var h=Ct;ma=l,(Ct=t)&&!h?ya(e,s,(s.subtreeFlags&8772)!==0):ga(e,s),ma=d,Ct=h}break;case 30:break;default:ga(e,s)}}function Nv(e){var t=e.alternate;t!==null&&(e.alternate=null,Nv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Oc(t)),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 ft=null,an=!1;function va(e,t,s){for(s=s.child;s!==null;)wv(e,t,s),s=s.sibling}function wv(e,t,s){if(be&&typeof be.onCommitFiberUnmount=="function")try{be.onCommitFiberUnmount(Ze,s)}catch{}switch(s.tag){case 26:Ct||Xn(s,t),va(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ct||Xn(s,t);var l=ft,d=an;Qa(s.type)&&(ft=s.stateNode,an=!1),va(e,t,s),Vo(s.stateNode),ft=l,an=d;break;case 5:Ct||Xn(s,t);case 6:if(l=ft,d=an,ft=null,va(e,t,s),ft=l,an=d,ft!==null)if(an)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(s.stateNode)}catch(h){et(s,t,h)}else try{ft.removeChild(s.stateNode)}catch(h){et(s,t,h)}break;case 18:ft!==null&&(an?(e=ft,bg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Ri(e)):bg(ft,s.stateNode));break;case 4:l=ft,d=an,ft=s.stateNode.containerInfo,an=!0,va(e,t,s),ft=l,an=d;break;case 0:case 11:case 14:case 15:qa(2,s,t),Ct||qa(4,s,t),va(e,t,s);break;case 1:Ct||(Xn(s,t),l=s.stateNode,typeof l.componentWillUnmount=="function"&&xv(s,t,l)),va(e,t,s);break;case 21:va(e,t,s);break;case 22:Ct=(l=Ct)||s.memoizedState!==null,va(e,t,s),Ct=l;break;default:va(e,t,s)}}function Cv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ri(e)}catch(s){et(t,t.return,s)}}}function Ev(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ri(e)}catch(s){et(t,t.return,s)}}function $1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new kv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new kv),t;default:throw Error(o(435,e.tag))}}function fr(e,t){var s=$1(e);t.forEach(function(l){if(!s.has(l)){s.add(l);var d=J1.bind(null,e,l);l.then(d,d)}})}function sn(e,t){var s=t.deletions;if(s!==null)for(var l=0;l<s.length;l++){var d=s[l],h=e,_=t,j=_;e:for(;j!==null;){switch(j.tag){case 27:if(Qa(j.type)){ft=j.stateNode,an=!1;break e}break;case 5:ft=j.stateNode,an=!1;break e;case 3:case 4:ft=j.stateNode.containerInfo,an=!0;break e}j=j.return}if(ft===null)throw Error(o(160));wv(h,_,d),ft=null,an=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Av(t,e),t=t.sibling}var Hn=null;function Av(e,t){var s=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:sn(t,e),on(e),l&4&&(qa(3,e,e.return),Ao(3,e),qa(5,e,e.return));break;case 1:sn(t,e),on(e),l&512&&(Ct||s===null||Xn(s,s.return)),l&64&&ma&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var d=Hn;if(sn(t,e),on(e),l&512&&(Ct||s===null||Xn(s,s.return)),l&4){var h=s!==null?s.memoizedState:null;if(l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null){e:{l=e.type,s=e.memoizedProps,d=d.ownerDocument||d;t:switch(l){case"title":h=d.getElementsByTagName("title")[0],(!h||h[ao]||h[Vt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(l),d.head.insertBefore(h,d.querySelector("head > title"))),$t(h,l,s),h[Vt]=e,It(h),l=h;break e;case"link":var _=Ag("link","href",d).get(l+(s.href||""));if(_){for(var j=0;j<_.length;j++)if(h=_[j],h.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&h.getAttribute("rel")===(s.rel==null?null:s.rel)&&h.getAttribute("title")===(s.title==null?null:s.title)&&h.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(j,1);break t}}h=d.createElement(l),$t(h,l,s),d.head.appendChild(h);break;case"meta":if(_=Ag("meta","content",d).get(l+(s.content||""))){for(j=0;j<_.length;j++)if(h=_[j],h.getAttribute("content")===(s.content==null?null:""+s.content)&&h.getAttribute("name")===(s.name==null?null:s.name)&&h.getAttribute("property")===(s.property==null?null:s.property)&&h.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&h.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(j,1);break t}}h=d.createElement(l),$t(h,l,s),d.head.appendChild(h);break;default:throw Error(o(468,l))}h[Vt]=e,It(h),l=h}e.stateNode=l}else Dg(d,e.type,e.stateNode);else e.stateNode=Eg(d,l,e.memoizedProps);else h!==l?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,l===null?Dg(d,e.type,e.stateNode):Eg(d,l,e.memoizedProps)):l===null&&e.stateNode!==null&&td(e,e.memoizedProps,s.memoizedProps)}break;case 27:sn(t,e),on(e),l&512&&(Ct||s===null||Xn(s,s.return)),s!==null&&l&4&&td(e,e.memoizedProps,s.memoizedProps);break;case 5:if(sn(t,e),on(e),l&512&&(Ct||s===null||Xn(s,s.return)),e.flags&32){d=e.stateNode;try{ti(d,"")}catch(pe){et(e,e.return,pe)}}l&4&&e.stateNode!=null&&(d=e.memoizedProps,td(e,d,s!==null?s.memoizedProps:d)),l&1024&&(sd=!0);break;case 6:if(sn(t,e),on(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,s=e.stateNode;try{s.nodeValue=l}catch(pe){et(e,e.return,pe)}}break;case 3:if(Cr=null,d=Hn,Hn=Nr(t.containerInfo),sn(t,e),Hn=d,on(e),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Ri(t.containerInfo)}catch(pe){et(e,e.return,pe)}sd&&(sd=!1,Dv(e));break;case 4:l=Hn,Hn=Nr(e.stateNode.containerInfo),sn(t,e),on(e),Hn=l;break;case 12:sn(t,e),on(e);break;case 31:sn(t,e),on(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,fr(e,l)));break;case 13:sn(t,e),on(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(pr=Yt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,fr(e,l)));break;case 22:d=e.memoizedState!==null;var D=s!==null&&s.memoizedState!==null,V=ma,Y=Ct;if(ma=V||d,Ct=Y||D,sn(t,e),Ct=Y,ma=V,on(e),l&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(s===null||D||ma||Ct||Es(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){D=s=t;try{if(h=D.stateNode,d)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{j=D.stateNode;var X=D.memoizedProps.style,P=X!=null&&X.hasOwnProperty("display")?X.display:null;j.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(pe){et(D,D.return,pe)}}}else if(t.tag===6){if(s===null){D=t;try{D.stateNode.nodeValue=d?"":D.memoizedProps}catch(pe){et(D,D.return,pe)}}}else if(t.tag===18){if(s===null){D=t;try{var $=D.stateNode;d?xg($,!0):xg(D.stateNode,!1)}catch(pe){et(D,D.return,pe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,fr(e,s))));break;case 19:sn(t,e),on(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,fr(e,l)));break;case 30:break;case 21:break;default:sn(t,e),on(e)}}function on(e){var t=e.flags;if(t&2){try{for(var s,l=e.return;l!==null;){if(Sv(l)){s=l;break}l=l.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var d=s.stateNode,h=nd(e);dr(e,h,d);break;case 5:var _=s.stateNode;s.flags&32&&(ti(_,""),s.flags&=-33);var j=nd(e);dr(e,j,_);break;case 3:case 4:var D=s.stateNode.containerInfo,V=nd(e);ad(e,V,D);break;default:throw Error(o(161))}}catch(Y){et(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Dv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ga(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)jv(e,t.alternate,t),t=t.sibling}function Es(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qa(4,t,t.return),Es(t);break;case 1:Xn(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&xv(t,t.return,s),Es(t);break;case 27:Vo(t.stateNode);case 26:case 5:Xn(t,t.return),Es(t);break;case 22:t.memoizedState===null&&Es(t);break;case 30:Es(t);break;default:Es(t)}e=e.sibling}}function ya(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,d=e,h=t,_=h.flags;switch(h.tag){case 0:case 11:case 15:ya(d,h,s),Ao(4,h);break;case 1:if(ya(d,h,s),l=h,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(V){et(l,l.return,V)}if(l=h,d=l.updateQueue,d!==null){var j=l.stateNode;try{var D=d.shared.hiddenCallbacks;if(D!==null)for(d.shared.hiddenCallbacks=null,d=0;d<D.length;d++)rm(D[d],j)}catch(V){et(l,l.return,V)}}s&&_&64&&bv(h),Do(h,h.return);break;case 27:Tv(h);case 26:case 5:ya(d,h,s),s&&l===null&&_&4&&_v(h),Do(h,h.return);break;case 12:ya(d,h,s);break;case 31:ya(d,h,s),s&&_&4&&Cv(d,h);break;case 13:ya(d,h,s),s&&_&4&&Ev(d,h);break;case 22:h.memoizedState===null&&ya(d,h,s),Do(h,h.return);break;case 30:break;default:ya(d,h,s)}t=t.sibling}}function id(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&go(s))}function od(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&go(e))}function Pn(e,t,s,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Rv(e,t,s,l),t=t.sibling}function Rv(e,t,s,l){var d=t.flags;switch(t.tag){case 0:case 11:case 15:Pn(e,t,s,l),d&2048&&Ao(9,t);break;case 1:Pn(e,t,s,l);break;case 3:Pn(e,t,s,l),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&go(e)));break;case 12:if(d&2048){Pn(e,t,s,l),e=t.stateNode;try{var h=t.memoizedProps,_=h.id,j=h.onPostCommit;typeof j=="function"&&j(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){et(t,t.return,D)}}else Pn(e,t,s,l);break;case 31:Pn(e,t,s,l);break;case 13:Pn(e,t,s,l);break;case 23:break;case 22:h=t.stateNode,_=t.alternate,t.memoizedState!==null?h._visibility&2?Pn(e,t,s,l):Ro(e,t):h._visibility&2?Pn(e,t,s,l):(h._visibility|=2,_i(e,t,s,l,(t.subtreeFlags&10256)!==0||!1)),d&2048&&id(_,t);break;case 24:Pn(e,t,s,l),d&2048&&od(t.alternate,t);break;default:Pn(e,t,s,l)}}function _i(e,t,s,l,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,_=t,j=s,D=l,V=_.flags;switch(_.tag){case 0:case 11:case 15:_i(h,_,j,D,d),Ao(8,_);break;case 23:break;case 22:var Y=_.stateNode;_.memoizedState!==null?Y._visibility&2?_i(h,_,j,D,d):Ro(h,_):(Y._visibility|=2,_i(h,_,j,D,d)),d&&V&2048&&id(_.alternate,_);break;case 24:_i(h,_,j,D,d),d&&V&2048&&od(_.alternate,_);break;default:_i(h,_,j,D,d)}t=t.sibling}}function Ro(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,l=t,d=l.flags;switch(l.tag){case 22:Ro(s,l),d&2048&&id(l.alternate,l);break;case 24:Ro(s,l),d&2048&&od(l.alternate,l);break;default:Ro(s,l)}t=t.sibling}}var Mo=8192;function Si(e,t,s){if(e.subtreeFlags&Mo)for(e=e.child;e!==null;)Mv(e,t,s),e=e.sibling}function Mv(e,t,s){switch(e.tag){case 26:Si(e,t,s),e.flags&Mo&&e.memoizedState!==null&&AS(s,Hn,e.memoizedState,e.memoizedProps);break;case 5:Si(e,t,s);break;case 3:case 4:var l=Hn;Hn=Nr(e.stateNode.containerInfo),Si(e,t,s),Hn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Mo,Mo=16777216,Si(e,t,s),Mo=l):Si(e,t,s));break;default:Si(e,t,s)}}function Ov(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Oo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];zt=l,Lv(l,e)}Ov(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bv(e),e=e.sibling}function Bv(e){switch(e.tag){case 0:case 11:case 15:Oo(e),e.flags&2048&&qa(9,e,e.return);break;case 3:Oo(e);break;case 12:Oo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,hr(e)):Oo(e);break;default:Oo(e)}}function hr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];zt=l,Lv(l,e)}Ov(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qa(8,t,t.return),hr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,hr(t));break;default:hr(t)}e=e.sibling}}function Lv(e,t){for(;zt!==null;){var s=zt;switch(s.tag){case 0:case 11:case 15:qa(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:go(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,zt=l;else e:for(s=e;zt!==null;){l=zt;var d=l.sibling,h=l.return;if(Nv(l),l===s){zt=null;break e}if(d!==null){d.return=h,zt=d;break e}zt=h}}}var q1={getCacheForType:function(e){var t=Pt(jt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Pt(jt).controller.signal}},K1=typeof WeakMap=="function"?WeakMap:Map,Xe=0,st=null,Le=null,ze=0,Je=0,mn=null,Ka=!1,Ti=!1,ld=!1,ba=0,yt=0,Fa=0,As=0,rd=0,vn=0,ki=0,Bo=null,ln=null,cd=!1,pr=0,Iv=0,mr=1/0,vr=null,Ya=null,Ot=0,Za=null,ji=null,xa=0,ud=0,dd=null,zv=null,Lo=0,fd=null;function gn(){return(Xe&2)!==0&&ze!==0?ze&-ze:O.T!==null?yd():ep()}function Uv(){if(vn===0)if((ze&536870912)===0||He){var e=pt;pt<<=1,(pt&3932160)===0&&(pt=262144),vn=e}else vn=536870912;return e=hn.current,e!==null&&(e.flags|=32),vn}function rn(e,t,s){(e===st&&(Je===2||Je===9)||e.cancelPendingCommit!==null)&&(Ni(e,0),Xa(e,ze,vn,!1)),no(e,s),((Xe&2)===0||e!==st)&&(e===st&&((Xe&2)===0&&(As|=s),yt===4&&Xa(e,ze,vn,!1)),Wn(e))}function Vv(e,t,s){if((Xe&6)!==0)throw Error(o(327));var l=!s&&(t&127)===0&&(t&e.expiredLanes)===0||to(e,t),d=l?Z1(e,t):pd(e,t,!0),h=l;do{if(d===0){Ti&&!l&&Xa(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!F1(s)){d=pd(e,t,!1),h=!1;continue}if(d===2){if(h=t,e.errorRecoveryDisabledLanes&h)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){t=_;e:{var j=e;d=Bo;var D=j.current.memoizedState.isDehydrated;if(D&&(Ni(j,_).flags|=256),_=pd(j,_,!1),_!==2){if(ld&&!D){j.errorRecoveryDisabledLanes|=h,As|=h,d=4;break e}h=ln,ln=d,h!==null&&(ln===null?ln=h:ln.push.apply(ln,h))}d=_}if(h=!1,d!==2)continue}}if(d===1){Ni(e,0),Xa(e,t,0,!0);break}e:{switch(l=e,h=d,h){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Xa(l,t,vn,!Ka);break e;case 2:ln=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(d=pr+300-Yt(),10<d)){if(Xa(l,t,vn,!Ka),Ma(l,0,!0)!==0)break e;xa=t,l.timeoutHandle=gg(Hv.bind(null,l,s,ln,vr,cd,t,vn,As,ki,Ka,h,"Throttled",-0,0),d);break e}Hv(l,s,ln,vr,cd,t,vn,As,ki,Ka,h,null,-0,0)}}break}while(!0);Wn(e)}function Hv(e,t,s,l,d,h,_,j,D,V,Y,X,P,$){if(e.timeoutHandle=-1,X=t.subtreeFlags,X&8192||(X&16785408)===16785408){X={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ia},Mv(t,h,X);var pe=(h&62914560)===h?pr-Yt():(h&4194048)===h?Iv-Yt():0;if(pe=DS(X,pe),pe!==null){xa=h,e.cancelPendingCommit=pe(Zv.bind(null,e,t,h,s,l,d,_,j,D,Y,X,null,P,$)),Xa(e,h,_,!V);return}}Zv(e,t,h,s,l,d,_,j,D)}function F1(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var d=s[l],h=d.getSnapshot;d=d.value;try{if(!dn(h(),d))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Xa(e,t,s,l){t&=~rd,t&=~As,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var d=t;0<d;){var h=31-Oe(d),_=1<<h;l[h]=-1,d&=~_}s!==0&&Wh(e,s,t)}function gr(){return(Xe&6)===0?(Io(0),!1):!0}function hd(){if(Le!==null){if(Je===0)var e=Le.return;else e=Le,ca=_s=null,Eu(e),vi=null,bo=0,e=Le;for(;e!==null;)yv(e.alternate,e),e=e.return;Le=null}}function Ni(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,hS(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),xa=0,hd(),st=e,Le=s=la(e.current,null),ze=t,Je=0,mn=null,Ka=!1,Ti=to(e,t),ld=!1,ki=vn=rd=As=Fa=yt=0,ln=Bo=null,cd=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var d=31-Oe(l),h=1<<d;t|=e[d],l&=~h}return ba=t,zl(),s}function Pv(e,t){Ee=null,O.H=wo,t===mi||t===Kl?(t=sm(),Je=3):t===gu?(t=sm(),Je=4):Je=t===qu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,mn=t,Le===null&&(yt=1,or(e,Nn(t,e.current)))}function Gv(){var e=hn.current;return e===null?!0:(ze&4194048)===ze?An===null:(ze&62914560)===ze||(ze&536870912)!==0?e===An:!1}function $v(){var e=O.H;return O.H=wo,e===null?wo:e}function qv(){var e=O.A;return O.A=q1,e}function yr(){yt=4,Ka||(ze&4194048)!==ze&&hn.current!==null||(Ti=!0),(Fa&134217727)===0&&(As&134217727)===0||st===null||Xa(st,ze,vn,!1)}function pd(e,t,s){var l=Xe;Xe|=2;var d=$v(),h=qv();(st!==e||ze!==t)&&(vr=null,Ni(e,t)),t=!1;var _=yt;e:do try{if(Je!==0&&Le!==null){var j=Le,D=mn;switch(Je){case 8:hd(),_=6;break e;case 3:case 2:case 9:case 6:hn.current===null&&(t=!0);var V=Je;if(Je=0,mn=null,wi(e,j,D,V),s&&Ti){_=0;break e}break;default:V=Je,Je=0,mn=null,wi(e,j,D,V)}}Y1(),_=yt;break}catch(Y){Pv(e,Y)}while(!0);return t&&e.shellSuspendCounter++,ca=_s=null,Xe=l,O.H=d,O.A=h,Le===null&&(st=null,ze=0,zl()),_}function Y1(){for(;Le!==null;)Kv(Le)}function Z1(e,t){var s=Xe;Xe|=2;var l=$v(),d=qv();st!==e||ze!==t?(vr=null,mr=Yt()+500,Ni(e,t)):Ti=to(e,t);e:do try{if(Je!==0&&Le!==null){t=Le;var h=mn;t:switch(Je){case 1:Je=0,mn=null,wi(e,t,h,1);break;case 2:case 9:if(nm(h)){Je=0,mn=null,Fv(t);break}t=function(){Je!==2&&Je!==9||st!==e||(Je=7),Wn(e)},h.then(t,t);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:nm(h)?(Je=0,mn=null,Fv(t)):(Je=0,mn=null,wi(e,t,h,7));break;case 5:var _=null;switch(Le.tag){case 26:_=Le.memoizedState;case 5:case 27:var j=Le;if(_?Rg(_):j.stateNode.complete){Je=0,mn=null;var D=j.sibling;if(D!==null)Le=D;else{var V=j.return;V!==null?(Le=V,br(V)):Le=null}break t}}Je=0,mn=null,wi(e,t,h,5);break;case 6:Je=0,mn=null,wi(e,t,h,6);break;case 8:hd(),yt=6;break e;default:throw Error(o(462))}}X1();break}catch(Y){Pv(e,Y)}while(!0);return ca=_s=null,O.H=l,O.A=d,Xe=s,Le!==null?0:(st=null,ze=0,zl(),yt)}function X1(){for(;Le!==null&&!Ae();)Kv(Le)}function Kv(e){var t=vv(e.alternate,e,ba);e.memoizedProps=e.pendingProps,t===null?br(e):Le=t}function Fv(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=uv(s,t,t.pendingProps,t.type,void 0,ze);break;case 11:t=uv(s,t,t.pendingProps,t.type.render,t.ref,ze);break;case 5:Eu(t);default:yv(s,t),t=Le=qp(t,ba),t=vv(s,t,ba)}e.memoizedProps=e.pendingProps,t===null?br(e):Le=t}function wi(e,t,s,l){ca=_s=null,Eu(t),vi=null,bo=0;var d=t.return;try{if(z1(e,d,t,s,ze)){yt=1,or(e,Nn(s,e.current)),Le=null;return}}catch(h){if(d!==null)throw Le=d,h;yt=1,or(e,Nn(s,e.current)),Le=null;return}t.flags&32768?(He||l===1?e=!0:Ti||(ze&536870912)!==0?e=!1:(Ka=e=!0,(l===2||l===9||l===3||l===6)&&(l=hn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Yv(t,e)):br(t)}function br(e){var t=e;do{if((t.flags&32768)!==0){Yv(t,Ka);return}e=t.return;var s=H1(t.alternate,t,ba);if(s!==null){Le=s;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);yt===0&&(yt=5)}function Yv(e,t){do{var s=P1(e.alternate,e);if(s!==null){s.flags&=32767,Le=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=s}while(e!==null);yt=6,Le=null}function Zv(e,t,s,l,d,h,_,j,D){e.cancelPendingCommit=null;do xr();while(Ot!==0);if((Xe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(h=t.lanes|t.childLanes,h|=nu,E_(e,s,h,_,j,D),e===st&&(Le=st=null,ze=0),ji=t,Za=e,xa=s,ud=h,dd=d,zv=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,eS(F,function(){return eg(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=O.T,O.T=null,d=G.p,G.p=2,_=Xe,Xe|=4;try{G1(e,t,s)}finally{Xe=_,G.p=d,O.T=l}}Ot=1,Xv(),Wv(),Qv()}}function Xv(){if(Ot===1){Ot=0;var e=Za,t=ji,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=O.T,O.T=null;var l=G.p;G.p=2;var d=Xe;Xe|=4;try{Av(t,e);var h=Nd,_=Lp(e.containerInfo),j=h.focusedElem,D=h.selectionRange;if(_!==j&&j&&j.ownerDocument&&Bp(j.ownerDocument.documentElement,j)){if(D!==null&&Wc(j)){var V=D.start,Y=D.end;if(Y===void 0&&(Y=V),"selectionStart"in j)j.selectionStart=V,j.selectionEnd=Math.min(Y,j.value.length);else{var X=j.ownerDocument||document,P=X&&X.defaultView||window;if(P.getSelection){var $=P.getSelection(),pe=j.textContent.length,xe=Math.min(D.start,pe),at=D.end===void 0?xe:Math.min(D.end,pe);!$.extend&&xe>at&&(_=at,at=xe,xe=_);var L=Op(j,xe),M=Op(j,at);if(L&&M&&($.rangeCount!==1||$.anchorNode!==L.node||$.anchorOffset!==L.offset||$.focusNode!==M.node||$.focusOffset!==M.offset)){var U=X.createRange();U.setStart(L.node,L.offset),$.removeAllRanges(),xe>at?($.addRange(U),$.extend(M.node,M.offset)):(U.setEnd(M.node,M.offset),$.addRange(U))}}}}for(X=[],$=j;$=$.parentNode;)$.nodeType===1&&X.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<X.length;j++){var Z=X[j];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Rr=!!jd,Nd=jd=null}finally{Xe=d,G.p=l,O.T=s}}e.current=t,Ot=2}}function Wv(){if(Ot===2){Ot=0;var e=Za,t=ji,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=O.T,O.T=null;var l=G.p;G.p=2;var d=Xe;Xe|=4;try{jv(e,t.alternate,t)}finally{Xe=d,G.p=l,O.T=s}}Ot=3}}function Qv(){if(Ot===4||Ot===3){Ot=0,Dt();var e=Za,t=ji,s=xa,l=zv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ot=5:(Ot=0,ji=Za=null,Jv(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Ya=null),Rc(s),t=t.stateNode,be&&typeof be.onCommitFiberRoot=="function")try{be.onCommitFiberRoot(Ze,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=O.T,d=G.p,G.p=2,O.T=null;try{for(var h=e.onRecoverableError,_=0;_<l.length;_++){var j=l[_];h(j.value,{componentStack:j.stack})}}finally{O.T=t,G.p=d}}(xa&3)!==0&&xr(),Wn(e),d=e.pendingLanes,(s&261930)!==0&&(d&42)!==0?e===fd?Lo++:(Lo=0,fd=e):Lo=0,Io(0)}}function Jv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,go(t)))}function xr(){return Xv(),Wv(),Qv(),eg()}function eg(){if(Ot!==5)return!1;var e=Za,t=ud;ud=0;var s=Rc(xa),l=O.T,d=G.p;try{G.p=32>s?32:s,O.T=null,s=dd,dd=null;var h=Za,_=xa;if(Ot=0,ji=Za=null,xa=0,(Xe&6)!==0)throw Error(o(331));var j=Xe;if(Xe|=4,Bv(h.current),Rv(h,h.current,_,s),Xe=j,Io(0,!1),be&&typeof be.onPostCommitFiberRoot=="function")try{be.onPostCommitFiberRoot(Ze,h)}catch{}return!0}finally{G.p=d,O.T=l,Jv(e,t)}}function tg(e,t,s){t=Nn(s,t),t=$u(e.stateNode,t,2),e=Pa(e,t,2),e!==null&&(no(e,2),Wn(e))}function et(e,t,s){if(e.tag===3)tg(e,e,s);else for(;t!==null;){if(t.tag===3){tg(t,e,s);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ya===null||!Ya.has(l))){e=Nn(s,e),s=nv(2),l=Pa(t,s,2),l!==null&&(av(s,l,t,e),no(l,2),Wn(l));break}}t=t.return}}function md(e,t,s){var l=e.pingCache;if(l===null){l=e.pingCache=new K1;var d=new Set;l.set(t,d)}else d=l.get(t),d===void 0&&(d=new Set,l.set(t,d));d.has(s)||(ld=!0,d.add(s),e=W1.bind(null,e,t,s),t.then(e,e))}function W1(e,t,s){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,st===e&&(ze&s)===s&&(yt===4||yt===3&&(ze&62914560)===ze&&300>Yt()-pr?(Xe&2)===0&&Ni(e,0):rd|=s,ki===ze&&(ki=0)),Wn(e)}function ng(e,t){t===0&&(t=Xh()),e=ys(e,t),e!==null&&(no(e,t),Wn(e))}function Q1(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),ng(e,s)}function J1(e,t){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),ng(e,s)}function eS(e,t){return Ra(e,t)}var _r=null,Ci=null,vd=!1,Sr=!1,gd=!1,Wa=0;function Wn(e){e!==Ci&&e.next===null&&(Ci===null?_r=Ci=e:Ci=Ci.next=e),Sr=!0,vd||(vd=!0,nS())}function Io(e,t){if(!gd&&Sr){gd=!0;do for(var s=!1,l=_r;l!==null;){if(e!==0){var d=l.pendingLanes;if(d===0)var h=0;else{var _=l.suspendedLanes,j=l.pingedLanes;h=(1<<31-Oe(42|e)+1)-1,h&=d&~(_&~j),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,og(l,h))}else h=ze,h=Ma(l,l===st?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||to(l,h)||(s=!0,og(l,h));l=l.next}while(s);gd=!1}}function tS(){ag()}function ag(){Sr=vd=!1;var e=0;Wa!==0&&fS()&&(e=Wa);for(var t=Yt(),s=null,l=_r;l!==null;){var d=l.next,h=sg(l,t);h===0?(l.next=null,s===null?_r=d:s.next=d,d===null&&(Ci=s)):(s=l,(e!==0||(h&3)!==0)&&(Sr=!0)),l=d}Ot!==0&&Ot!==5||Io(e),Wa!==0&&(Wa=0)}function sg(e,t){for(var s=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-Oe(h),j=1<<_,D=d[_];D===-1?((j&s)===0||(j&l)!==0)&&(d[_]=C_(j,t)):D<=t&&(e.expiredLanes|=j),h&=~j}if(t=st,s=ze,s=Ma(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===t&&(Je===2||Je===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&un(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||to(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(l!==null&&un(l),Rc(s)){case 2:case 8:s=Nl;break;case 32:s=F;break;case 268435456:s=de;break;default:s=F}return l=ig.bind(null,e),s=Ra(s,l),e.callbackPriority=t,e.callbackNode=s,t}return l!==null&&l!==null&&un(l),e.callbackPriority=2,e.callbackNode=null,2}function ig(e,t){if(Ot!==0&&Ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(xr()&&e.callbackNode!==s)return null;var l=ze;return l=Ma(e,e===st?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Vv(e,l,t),sg(e,Yt()),e.callbackNode!=null&&e.callbackNode===s?ig.bind(null,e):null)}function og(e,t){if(xr())return null;Vv(e,t,!0)}function nS(){pS(function(){(Xe&6)!==0?Ra(eo,tS):ag()})}function yd(){if(Wa===0){var e=hi;e===0&&(e=Mt,Mt<<=1,(Mt&261888)===0&&(Mt=256)),Wa=e}return Wa}function lg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Al(""+e)}function rg(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function aS(e,t,s,l,d){if(t==="submit"&&s&&s.stateNode===d){var h=lg((d[tn]||null).action),_=l.submitter;_&&(t=(t=_[tn]||null)?lg(t.formAction):_.getAttribute("formAction"),t!==null&&(h=t,_=null));var j=new Ol("action","action",null,l,d);e.push({event:j,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Wa!==0){var D=_?rg(d,_):new FormData(d);zu(s,{pending:!0,data:D,method:d.method,action:h},null,D)}}else typeof h=="function"&&(j.preventDefault(),D=_?rg(d,_):new FormData(d),zu(s,{pending:!0,data:D,method:d.method,action:h},h,D))},currentTarget:d}]})}}for(var bd=0;bd<tu.length;bd++){var xd=tu[bd],sS=xd.toLowerCase(),iS=xd[0].toUpperCase()+xd.slice(1);Vn(sS,"on"+iS)}Vn(Up,"onAnimationEnd"),Vn(Vp,"onAnimationIteration"),Vn(Hp,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(_1,"onTransitionRun"),Vn(S1,"onTransitionStart"),Vn(T1,"onTransitionCancel"),Vn(Pp,"onTransitionEnd"),Js("onMouseEnter",["mouseout","mouseover"]),Js("onMouseLeave",["mouseout","mouseover"]),Js("onPointerEnter",["pointerout","pointerover"]),Js("onPointerLeave",["pointerout","pointerover"]),ps("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ps("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ps("onBeforeInput",["compositionend","keypress","textInput","paste"]),ps("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ps("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ps("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),oS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zo));function cg(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],d=l.event;l=l.listeners;e:{var h=void 0;if(t)for(var _=l.length-1;0<=_;_--){var j=l[_],D=j.instance,V=j.currentTarget;if(j=j.listener,D!==h&&d.isPropagationStopped())break e;h=j,d.currentTarget=V;try{h(d)}catch(Y){Il(Y)}d.currentTarget=null,h=D}else for(_=0;_<l.length;_++){if(j=l[_],D=j.instance,V=j.currentTarget,j=j.listener,D!==h&&d.isPropagationStopped())break e;h=j,d.currentTarget=V;try{h(d)}catch(Y){Il(Y)}d.currentTarget=null,h=D}}}}function Ie(e,t){var s=t[Mc];s===void 0&&(s=t[Mc]=new Set);var l=e+"__bubble";s.has(l)||(ug(t,e,2,!1),s.add(l))}function _d(e,t,s){var l=0;t&&(l|=4),ug(s,e,l,t)}var Tr="_reactListening"+Math.random().toString(36).slice(2);function Sd(e){if(!e[Tr]){e[Tr]=!0,ap.forEach(function(s){s!=="selectionchange"&&(oS.has(s)||_d(s,!1,e),_d(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tr]||(t[Tr]=!0,_d("selectionchange",!1,t))}}function ug(e,t,s,l){switch(Ug(t)){case 2:var d=OS;break;case 8:d=BS;break;default:d=Id}s=d.bind(null,t,s,e),d=void 0,!Pc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),l?d!==void 0?e.addEventListener(t,s,{capture:!0,passive:d}):e.addEventListener(t,s,!0):d!==void 0?e.addEventListener(t,s,{passive:d}):e.addEventListener(t,s,!1)}function Td(e,t,s,l,d){var h=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var _=l.tag;if(_===3||_===4){var j=l.stateNode.containerInfo;if(j===d)break;if(_===4)for(_=l.return;_!==null;){var D=_.tag;if((D===3||D===4)&&_.stateNode.containerInfo===d)return;_=_.return}for(;j!==null;){if(_=Xs(j),_===null)return;if(D=_.tag,D===5||D===6||D===26||D===27){l=h=_;continue e}j=j.parentNode}}l=l.return}mp(function(){var V=h,Y=Vc(s),X=[];e:{var P=Gp.get(e);if(P!==void 0){var $=Ol,pe=e;switch(e){case"keypress":if(Rl(s)===0)break e;case"keydown":case"keyup":$=J_;break;case"focusin":pe="focus",$=Kc;break;case"focusout":pe="blur",$=Kc;break;case"beforeblur":case"afterblur":$=Kc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=yp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=H_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=n1;break;case Up:case Vp:case Hp:$=$_;break;case Pp:$=s1;break;case"scroll":case"scrollend":$=U_;break;case"wheel":$=o1;break;case"copy":case"cut":case"paste":$=K_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=xp;break;case"toggle":case"beforetoggle":$=r1}var xe=(t&4)!==0,at=!xe&&(e==="scroll"||e==="scrollend"),L=xe?P!==null?P+"Capture":null:P;xe=[];for(var M=V,U;M!==null;){var Z=M;if(U=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||U===null||L===null||(Z=io(M,L),Z!=null&&xe.push(Uo(M,Z,U))),at)break;M=M.return}0<xe.length&&(P=new $(P,pe,null,s,Y),X.push({event:P,listeners:xe}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",$=e==="mouseout"||e==="pointerout",P&&s!==Uc&&(pe=s.relatedTarget||s.fromElement)&&(Xs(pe)||pe[Zs]))break e;if(($||P)&&(P=Y.window===Y?Y:(P=Y.ownerDocument)?P.defaultView||P.parentWindow:window,$?(pe=s.relatedTarget||s.toElement,$=V,pe=pe?Xs(pe):null,pe!==null&&(at=u(pe),xe=pe.tag,pe!==at||xe!==5&&xe!==27&&xe!==6)&&(pe=null)):($=null,pe=V),$!==pe)){if(xe=yp,Z="onMouseLeave",L="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(xe=xp,Z="onPointerLeave",L="onPointerEnter",M="pointer"),at=$==null?P:so($),U=pe==null?P:so(pe),P=new xe(Z,M+"leave",$,s,Y),P.target=at,P.relatedTarget=U,Z=null,Xs(Y)===V&&(xe=new xe(L,M+"enter",pe,s,Y),xe.target=U,xe.relatedTarget=at,Z=xe),at=Z,$&&pe)t:{for(xe=lS,L=$,M=pe,U=0,Z=L;Z;Z=xe(Z))U++;Z=0;for(var ge=M;ge;ge=xe(ge))Z++;for(;0<U-Z;)L=xe(L),U--;for(;0<Z-U;)M=xe(M),Z--;for(;U--;){if(L===M||M!==null&&L===M.alternate){xe=L;break t}L=xe(L),M=xe(M)}xe=null}else xe=null;$!==null&&dg(X,P,$,xe,!1),pe!==null&&at!==null&&dg(X,at,pe,xe,!0)}}e:{if(P=V?so(V):window,$=P.nodeName&&P.nodeName.toLowerCase(),$==="select"||$==="input"&&P.type==="file")var Ke=Cp;else if(Np(P))if(Ep)Ke=y1;else{Ke=v1;var me=m1}else $=P.nodeName,!$||$.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?V&&zc(V.elementType)&&(Ke=Cp):Ke=g1;if(Ke&&(Ke=Ke(e,V))){wp(X,Ke,s,Y);break e}me&&me(e,P,V),e==="focusout"&&V&&P.type==="number"&&V.memoizedProps.value!=null&&Ic(P,"number",P.value)}switch(me=V?so(V):window,e){case"focusin":(Np(me)||me.contentEditable==="true")&&(ii=me,Qc=V,po=null);break;case"focusout":po=Qc=ii=null;break;case"mousedown":Jc=!0;break;case"contextmenu":case"mouseup":case"dragend":Jc=!1,Ip(X,s,Y);break;case"selectionchange":if(x1)break;case"keydown":case"keyup":Ip(X,s,Y)}var De;if(Yc)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else si?kp(e,s)&&(Ue="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ue="onCompositionStart");Ue&&(_p&&s.locale!=="ko"&&(si||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&si&&(De=vp()):(Ba=Y,Gc="value"in Ba?Ba.value:Ba.textContent,si=!0)),me=kr(V,Ue),0<me.length&&(Ue=new bp(Ue,e,null,s,Y),X.push({event:Ue,listeners:me}),De?Ue.data=De:(De=jp(s),De!==null&&(Ue.data=De)))),(De=u1?d1(e,s):f1(e,s))&&(Ue=kr(V,"onBeforeInput"),0<Ue.length&&(me=new bp("onBeforeInput","beforeinput",null,s,Y),X.push({event:me,listeners:Ue}),me.data=De)),aS(X,e,V,s,Y)}cg(X,t)})}function Uo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function kr(e,t){for(var s=t+"Capture",l=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=io(e,s),d!=null&&l.unshift(Uo(e,d,h)),d=io(e,t),d!=null&&l.push(Uo(e,d,h))),e.tag===3)return l;e=e.return}return[]}function lS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function dg(e,t,s,l,d){for(var h=t._reactName,_=[];s!==null&&s!==l;){var j=s,D=j.alternate,V=j.stateNode;if(j=j.tag,D!==null&&D===l)break;j!==5&&j!==26&&j!==27||V===null||(D=V,d?(V=io(s,h),V!=null&&_.unshift(Uo(s,V,D))):d||(V=io(s,h),V!=null&&_.push(Uo(s,V,D)))),s=s.return}_.length!==0&&e.push({event:t,listeners:_})}var rS=/\r\n?/g,cS=/\u0000|\uFFFD/g;function fg(e){return(typeof e=="string"?e:""+e).replace(rS,`
|
|
26
|
-
`).replace(cS,"")}function hg(e,t){return t=fg(t),fg(e)===t}function nt(e,t,s,l,d,h){switch(s){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ti(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ti(e,""+l);break;case"className":Cl(e,"class",l);break;case"tabIndex":Cl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Cl(e,s,l);break;case"style":hp(e,l,h);break;case"data":if(t!=="object"){Cl(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Al(""+l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(s==="formAction"?(t!=="input"&&nt(e,t,"name",d.name,d,null),nt(e,t,"formEncType",d.formEncType,d,null),nt(e,t,"formMethod",d.formMethod,d,null),nt(e,t,"formTarget",d.formTarget,d,null)):(nt(e,t,"encType",d.encType,d,null),nt(e,t,"method",d.method,d,null),nt(e,t,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Al(""+l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=ia);break;case"onScroll":l!=null&&Ie("scroll",e);break;case"onScrollEnd":l!=null&&Ie("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}s=Al(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""+l):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":Ie("beforetoggle",e),Ie("toggle",e),wl(e,"popover",l);break;case"xlinkActuate":sa(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":sa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":sa(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":sa(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":sa(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":sa(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":sa(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":sa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":sa(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":wl(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=I_.get(s)||s,wl(e,s,l))}}function kd(e,t,s,l,d,h){switch(s){case"style":hp(e,l,h);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof l=="string"?ti(e,l):(typeof l=="number"||typeof l=="bigint")&&ti(e,""+l);break;case"onScroll":l!=null&&Ie("scroll",e);break;case"onScrollEnd":l!=null&&Ie("scrollend",e);break;case"onClick":l!=null&&(e.onclick=ia);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sp.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(d=s.endsWith("Capture"),t=s.slice(2,d?s.length-7:void 0),h=e[tn]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(t,h,d),typeof l=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,l,d);break e}s in e?e[s]=l:l===!0?e.setAttribute(s,""):wl(e,s,l)}}}function $t(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",e),Ie("load",e);var l=!1,d=!1,h;for(h in s)if(s.hasOwnProperty(h)){var _=s[h];if(_!=null)switch(h){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:nt(e,t,h,_,s,null)}}d&&nt(e,t,"srcSet",s.srcSet,s,null),l&&nt(e,t,"src",s.src,s,null);return;case"input":Ie("invalid",e);var j=h=_=d=null,D=null,V=null;for(l in s)if(s.hasOwnProperty(l)){var Y=s[l];if(Y!=null)switch(l){case"name":d=Y;break;case"type":_=Y;break;case"checked":D=Y;break;case"defaultChecked":V=Y;break;case"value":h=Y;break;case"defaultValue":j=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(o(137,t));break;default:nt(e,t,l,Y,s,null)}}cp(e,h,j,D,V,_,d,!1);return;case"select":Ie("invalid",e),l=_=h=null;for(d in s)if(s.hasOwnProperty(d)&&(j=s[d],j!=null))switch(d){case"value":h=j;break;case"defaultValue":_=j;break;case"multiple":l=j;default:nt(e,t,d,j,s,null)}t=h,s=_,e.multiple=!!l,t!=null?ei(e,!!l,t,!1):s!=null&&ei(e,!!l,s,!0);return;case"textarea":Ie("invalid",e),h=d=l=null;for(_ in s)if(s.hasOwnProperty(_)&&(j=s[_],j!=null))switch(_){case"value":l=j;break;case"defaultValue":d=j;break;case"children":h=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(o(91));break;default:nt(e,t,_,j,s,null)}dp(e,l,d,h);return;case"option":for(D in s)if(s.hasOwnProperty(D)&&(l=s[D],l!=null))switch(D){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:nt(e,t,D,l,s,null)}return;case"dialog":Ie("beforetoggle",e),Ie("toggle",e),Ie("cancel",e),Ie("close",e);break;case"iframe":case"object":Ie("load",e);break;case"video":case"audio":for(l=0;l<zo.length;l++)Ie(zo[l],e);break;case"image":Ie("error",e),Ie("load",e);break;case"details":Ie("toggle",e);break;case"embed":case"source":case"link":Ie("error",e),Ie("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(V in s)if(s.hasOwnProperty(V)&&(l=s[V],l!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:nt(e,t,V,l,s,null)}return;default:if(zc(t)){for(Y in s)s.hasOwnProperty(Y)&&(l=s[Y],l!==void 0&&kd(e,t,Y,l,s,void 0));return}}for(j in s)s.hasOwnProperty(j)&&(l=s[j],l!=null&&nt(e,t,j,l,s,null))}function uS(e,t,s,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,_=null,j=null,D=null,V=null,Y=null;for($ in s){var X=s[$];if(s.hasOwnProperty($)&&X!=null)switch($){case"checked":break;case"value":break;case"defaultValue":D=X;default:l.hasOwnProperty($)||nt(e,t,$,null,l,X)}}for(var P in l){var $=l[P];if(X=s[P],l.hasOwnProperty(P)&&($!=null||X!=null))switch(P){case"type":h=$;break;case"name":d=$;break;case"checked":V=$;break;case"defaultChecked":Y=$;break;case"value":_=$;break;case"defaultValue":j=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(o(137,t));break;default:$!==X&&nt(e,t,P,$,l,X)}}Lc(e,_,j,D,V,Y,h,d);return;case"select":$=_=j=P=null;for(h in s)if(D=s[h],s.hasOwnProperty(h)&&D!=null)switch(h){case"value":break;case"multiple":$=D;default:l.hasOwnProperty(h)||nt(e,t,h,null,l,D)}for(d in l)if(h=l[d],D=s[d],l.hasOwnProperty(d)&&(h!=null||D!=null))switch(d){case"value":P=h;break;case"defaultValue":j=h;break;case"multiple":_=h;default:h!==D&&nt(e,t,d,h,l,D)}t=j,s=_,l=$,P!=null?ei(e,!!s,P,!1):!!l!=!!s&&(t!=null?ei(e,!!s,t,!0):ei(e,!!s,s?[]:"",!1));return;case"textarea":$=P=null;for(j in s)if(d=s[j],s.hasOwnProperty(j)&&d!=null&&!l.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:nt(e,t,j,null,l,d)}for(_ in l)if(d=l[_],h=s[_],l.hasOwnProperty(_)&&(d!=null||h!=null))switch(_){case"value":P=d;break;case"defaultValue":$=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:d!==h&&nt(e,t,_,d,l,h)}up(e,P,$);return;case"option":for(var pe in s)if(P=s[pe],s.hasOwnProperty(pe)&&P!=null&&!l.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:nt(e,t,pe,null,l,P)}for(D in l)if(P=l[D],$=s[D],l.hasOwnProperty(D)&&P!==$&&(P!=null||$!=null))switch(D){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:nt(e,t,D,P,l,$)}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 xe in s)P=s[xe],s.hasOwnProperty(xe)&&P!=null&&!l.hasOwnProperty(xe)&&nt(e,t,xe,null,l,P);for(V in l)if(P=l[V],$=s[V],l.hasOwnProperty(V)&&P!==$&&(P!=null||$!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(o(137,t));break;default:nt(e,t,V,P,l,$)}return;default:if(zc(t)){for(var at in s)P=s[at],s.hasOwnProperty(at)&&P!==void 0&&!l.hasOwnProperty(at)&&kd(e,t,at,void 0,l,P);for(Y in l)P=l[Y],$=s[Y],!l.hasOwnProperty(Y)||P===$||P===void 0&&$===void 0||kd(e,t,Y,P,l,$);return}}for(var L in s)P=s[L],s.hasOwnProperty(L)&&P!=null&&!l.hasOwnProperty(L)&&nt(e,t,L,null,l,P);for(X in l)P=l[X],$=s[X],!l.hasOwnProperty(X)||P===$||P==null&&$==null||nt(e,t,X,P,l,$)}function pg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function dS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var d=s[l],h=d.transferSize,_=d.initiatorType,j=d.duration;if(h&&j&&pg(_)){for(_=0,j=d.responseEnd,l+=1;l<s.length;l++){var D=s[l],V=D.startTime;if(V>j)break;var Y=D.transferSize,X=D.initiatorType;Y&&pg(X)&&(D=D.responseEnd,_+=Y*(D<j?1:(j-V)/(D-V)))}if(--l,t+=8*(h+_)/(d.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var jd=null,Nd=null;function jr(e){return e.nodeType===9?e:e.ownerDocument}function mg(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 vg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function wd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Cd=null;function fS(){var e=window.event;return e&&e.type==="popstate"?e===Cd?!1:(Cd=e,!0):(Cd=null,!1)}var gg=typeof setTimeout=="function"?setTimeout:void 0,hS=typeof clearTimeout=="function"?clearTimeout:void 0,yg=typeof Promise=="function"?Promise:void 0,pS=typeof queueMicrotask=="function"?queueMicrotask:typeof yg<"u"?function(e){return yg.resolve(null).then(e).catch(mS)}:gg;function mS(e){setTimeout(function(){throw e})}function Qa(e){return e==="head"}function bg(e,t){var s=t,l=0;do{var d=s.nextSibling;if(e.removeChild(s),d&&d.nodeType===8)if(s=d.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(d),Ri(t);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Vo(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Vo(s);for(var h=s.firstChild;h;){var _=h.nextSibling,j=h.nodeName;h[ao]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=_}}else s==="body"&&Vo(e.ownerDocument.body);s=d}while(s);Ri(t)}function xg(e,t){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function Ed(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Ed(s),Oc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function vS(e,t,s,l){for(;e.nodeType===1;){var d=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[ao])switch(t){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!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Dn(e.nextSibling),e===null)break}return null}function gS(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Dn(e.nextSibling),e===null))return null;return e}function _g(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Dn(e.nextSibling),e===null))return null;return e}function Ad(e){return e.data==="$?"||e.data==="$~"}function Dd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function yS(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var l=function(){t(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Dn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Rd=null;function Sg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Dn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function Tg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function kg(e,t,s){switch(t=jr(s),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Vo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Oc(e)}var Rn=new Map,jg=new Set;function Nr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _a=G.d;G.d={f:bS,r:xS,D:_S,C:SS,L:TS,m:kS,X:NS,S:jS,M:wS};function bS(){var e=_a.f(),t=gr();return e||t}function xS(e){var t=Ws(e);t!==null&&t.tag===5&&t.type==="form"?Pm(t):_a.r(e)}var Ei=typeof document>"u"?null:document;function Ng(e,t,s){var l=Ei;if(l&&typeof t=="string"&&t){var d=kn(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof s=="string"&&(d+='[crossorigin="'+s+'"]'),jg.has(d)||(jg.add(d),e={rel:e,crossOrigin:s,href:t},l.querySelector(d)===null&&(t=l.createElement("link"),$t(t,"link",e),It(t),l.head.appendChild(t)))}}function _S(e){_a.D(e),Ng("dns-prefetch",e,null)}function SS(e,t){_a.C(e,t),Ng("preconnect",e,t)}function TS(e,t,s){_a.L(e,t,s);var l=Ei;if(l&&e&&t){var d='link[rel="preload"][as="'+kn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(d+='[imagesrcset="'+kn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(d+='[imagesizes="'+kn(s.imageSizes)+'"]')):d+='[href="'+kn(e)+'"]';var h=d;switch(t){case"style":h=Ai(e);break;case"script":h=Di(e)}Rn.has(h)||(e=b({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Rn.set(h,e),l.querySelector(d)!==null||t==="style"&&l.querySelector(Ho(h))||t==="script"&&l.querySelector(Po(h))||(t=l.createElement("link"),$t(t,"link",e),It(t),l.head.appendChild(t)))}}function kS(e,t){_a.m(e,t);var s=Ei;if(s&&e){var l=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+kn(l)+'"][href="'+kn(e)+'"]',h=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Di(e)}if(!Rn.has(h)&&(e=b({rel:"modulepreload",href:e},t),Rn.set(h,e),s.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Po(h)))return}l=s.createElement("link"),$t(l,"link",e),It(l),s.head.appendChild(l)}}}function jS(e,t,s){_a.S(e,t,s);var l=Ei;if(l&&e){var d=Qs(l).hoistableStyles,h=Ai(e);t=t||"default";var _=d.get(h);if(!_){var j={loading:0,preload:null};if(_=l.querySelector(Ho(h)))j.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Rn.get(h))&&Md(e,s);var D=_=l.createElement("link");It(D),$t(D,"link",e),D._p=new Promise(function(V,Y){D.onload=V,D.onerror=Y}),D.addEventListener("load",function(){j.loading|=1}),D.addEventListener("error",function(){j.loading|=2}),j.loading|=4,wr(_,t,l)}_={type:"stylesheet",instance:_,count:1,state:j},d.set(h,_)}}}function NS(e,t){_a.X(e,t);var s=Ei;if(s&&e){var l=Qs(s).hoistableScripts,d=Di(e),h=l.get(d);h||(h=s.querySelector(Po(d)),h||(e=b({src:e,async:!0},t),(t=Rn.get(d))&&Od(e,t),h=s.createElement("script"),It(h),$t(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function wS(e,t){_a.M(e,t);var s=Ei;if(s&&e){var l=Qs(s).hoistableScripts,d=Di(e),h=l.get(d);h||(h=s.querySelector(Po(d)),h||(e=b({src:e,async:!0,type:"module"},t),(t=Rn.get(d))&&Od(e,t),h=s.createElement("script"),It(h),$t(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function wg(e,t,s,l){var d=(d=ve.current)?Nr(d):null;if(!d)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Ai(s.href),s=Qs(d).hoistableStyles,l=s.get(t),l||(l={type:"style",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Ai(s.href);var h=Qs(d).hoistableStyles,_=h.get(e);if(_||(d=d.ownerDocument||d,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,_),(h=d.querySelector(Ho(e)))&&!h._p&&(_.instance=h,_.state.loading=5),Rn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Rn.set(e,s),h||CS(d,e,s,_.state))),t&&l===null)throw Error(o(528,""));return _}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Di(s),s=Qs(d).hoistableScripts,l=s.get(t),l||(l={type:"script",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ai(e){return'href="'+kn(e)+'"'}function Ho(e){return'link[rel="stylesheet"]['+e+"]"}function Cg(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function CS(e,t,s,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),$t(t,"link",s),It(t),e.head.appendChild(t))}function Di(e){return'[src="'+kn(e)+'"]'}function Po(e){return"script[async]"+e}function Eg(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+kn(s.href)+'"]');if(l)return t.instance=l,It(l),l;var d=b({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),It(l),$t(l,"style",d),wr(l,s.precedence,e),t.instance=l;case"stylesheet":d=Ai(s.href);var h=e.querySelector(Ho(d));if(h)return t.state.loading|=4,t.instance=h,It(h),h;l=Cg(s),(d=Rn.get(d))&&Md(l,d),h=(e.ownerDocument||e).createElement("link"),It(h);var _=h;return _._p=new Promise(function(j,D){_.onload=j,_.onerror=D}),$t(h,"link",l),t.state.loading|=4,wr(h,s.precedence,e),t.instance=h;case"script":return h=Di(s.src),(d=e.querySelector(Po(h)))?(t.instance=d,It(d),d):(l=s,(d=Rn.get(h))&&(l=b({},s),Od(l,d)),e=e.ownerDocument||e,d=e.createElement("script"),It(d),$t(d,"link",l),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,wr(l,s.precedence,e));return t.instance}function wr(e,t,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,h=d,_=0;_<l.length;_++){var j=l[_];if(j.dataset.precedence===t)h=j;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Md(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Od(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Cr=null;function Ag(e,t,s){if(Cr===null){var l=new Map,d=Cr=new Map;d.set(s,l)}else d=Cr,l=d.get(s),l||(l=new Map,d.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),d=0;d<s.length;d++){var h=s[d];if(!(h[ao]||h[Vt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(t)||"";_=e+_;var j=l.get(_);j?j.push(h):l.set(_,[h])}}return l}function Dg(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function ES(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Rg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function AS(e,t,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var d=Ai(l.href),h=t.querySelector(Ho(d));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Er.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,It(h);return}h=t.ownerDocument||t,l=Cg(l),(d=Rn.get(d))&&Md(l,d),h=h.createElement("link"),It(h);var _=h;_._p=new Promise(function(j,D){_.onload=j,_.onerror=D}),$t(h,"link",l),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Er.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Bd=0;function DS(e,t){return e.stylesheets&&e.count===0&&Dr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&Dr(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Bd===0&&(Bd=62500*dS());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Dr(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Bd?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function Er(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ar=null;function Dr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ar=new Map,t.forEach(RS,e),Ar=null,Er.call(e))}function RS(e,t){if(!(t.state.loading&4)){var s=Ar.get(e);if(s)var l=s.get(null);else{s=new Map,Ar.set(e,s);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var _=d[h];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),l=_)}l&&s.set(null,l)}d=t.instance,_=d.getAttribute("data-precedence"),h=s.get(_)||l,h===l&&s.set(null,d),s.set(_,d),this.count++,l=Er.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Go={$$typeof:A,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function MS(e,t,s,l,d,h,_,j,D){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ac(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ac(0),this.hiddenUpdates=Ac(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Mg(e,t,s,l,d,h,_,j,D,V,Y,X){return e=new MS(e,t,s,_,D,V,Y,X,j),t=1,h===!0&&(t|=24),h=fn(3,null,null,t),e.current=h,h.stateNode=e,t=pu(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:l,isDehydrated:s,cache:t},yu(h),e}function Og(e){return e?(e=ri,e):ri}function Bg(e,t,s,l,d,h){d=Og(d),l.context===null?l.context=d:l.pendingContext=d,l=Ha(t),l.payload={element:s},h=h===void 0?null:h,h!==null&&(l.callback=h),s=Pa(e,l,t),s!==null&&(rn(s,e,t),_o(s,e,t))}function Lg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Ld(e,t){Lg(e,t),(e=e.alternate)&&Lg(e,t)}function Ig(e){if(e.tag===13||e.tag===31){var t=ys(e,67108864);t!==null&&rn(t,e,67108864),Ld(e,67108864)}}function zg(e){if(e.tag===13||e.tag===31){var t=gn();t=Dc(t);var s=ys(e,t);s!==null&&rn(s,e,t),Ld(e,t)}}var Rr=!0;function OS(e,t,s,l){var d=O.T;O.T=null;var h=G.p;try{G.p=2,Id(e,t,s,l)}finally{G.p=h,O.T=d}}function BS(e,t,s,l){var d=O.T;O.T=null;var h=G.p;try{G.p=8,Id(e,t,s,l)}finally{G.p=h,O.T=d}}function Id(e,t,s,l){if(Rr){var d=zd(l);if(d===null)Td(e,t,l,Mr,s),Vg(e,l);else if(IS(d,e,t,s,l))l.stopPropagation();else if(Vg(e,l),t&4&&-1<LS.indexOf(e)){for(;d!==null;){var h=Ws(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=Wt(h.pendingLanes);if(_!==0){var j=h;for(j.pendingLanes|=2,j.entangledLanes|=2;_;){var D=1<<31-Oe(_);j.entanglements[1]|=D,_&=~D}Wn(h),(Xe&6)===0&&(mr=Yt()+500,Io(0))}}break;case 31:case 13:j=ys(h,2),j!==null&&rn(j,h,2),gr(),Ld(h,2)}if(h=zd(l),h===null&&Td(e,t,l,Mr,s),h===d)break;d=h}d!==null&&l.stopPropagation()}else Td(e,t,l,null,s)}}function zd(e){return e=Vc(e),Ud(e)}var Mr=null;function Ud(e){if(Mr=null,e=Xs(e),e!==null){var t=u(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=f(t),e!==null)return e;e=null}else if(s===31){if(e=p(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Mr=e,null}function Ug(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(jl()){case eo:return 2;case Nl:return 8;case F:case oe:return 32;case de:return 268435456;default:return 32}default:return 32}}var Vd=!1,Ja=null,es=null,ts=null,$o=new Map,qo=new Map,ns=[],LS="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 Vg(e,t){switch(e){case"focusin":case"focusout":Ja=null;break;case"dragenter":case"dragleave":es=null;break;case"mouseover":case"mouseout":ts=null;break;case"pointerover":case"pointerout":$o.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qo.delete(t.pointerId)}}function Ko(e,t,s,l,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:l,nativeEvent:h,targetContainers:[d]},t!==null&&(t=Ws(t),t!==null&&Ig(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function IS(e,t,s,l,d){switch(t){case"focusin":return Ja=Ko(Ja,e,t,s,l,d),!0;case"dragenter":return es=Ko(es,e,t,s,l,d),!0;case"mouseover":return ts=Ko(ts,e,t,s,l,d),!0;case"pointerover":var h=d.pointerId;return $o.set(h,Ko($o.get(h)||null,e,t,s,l,d)),!0;case"gotpointercapture":return h=d.pointerId,qo.set(h,Ko(qo.get(h)||null,e,t,s,l,d)),!0}return!1}function Hg(e){var t=Xs(e.target);if(t!==null){var s=u(t);if(s!==null){if(t=s.tag,t===13){if(t=f(s),t!==null){e.blockedOn=t,tp(e.priority,function(){zg(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,tp(e.priority,function(){zg(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Or(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=zd(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);Uc=l,s.target.dispatchEvent(l),Uc=null}else return t=Ws(s),t!==null&&Ig(t),e.blockedOn=s,!1;t.shift()}return!0}function Pg(e,t,s){Or(e)&&s.delete(t)}function zS(){Vd=!1,Ja!==null&&Or(Ja)&&(Ja=null),es!==null&&Or(es)&&(es=null),ts!==null&&Or(ts)&&(ts=null),$o.forEach(Pg),qo.forEach(Pg)}function Br(e,t){e.blockedOn===t&&(e.blockedOn=null,Vd||(Vd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,zS)))}var Lr=null;function Gg(e){Lr!==e&&(Lr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Lr===e&&(Lr=null);for(var t=0;t<e.length;t+=3){var s=e[t],l=e[t+1],d=e[t+2];if(typeof l!="function"){if(Ud(l||s)===null)continue;break}var h=Ws(s);h!==null&&(e.splice(t,3),t-=3,zu(h,{pending:!0,data:d,method:s.method,action:l},l,d))}}))}function Ri(e){function t(D){return Br(D,e)}Ja!==null&&Br(Ja,e),es!==null&&Br(es,e),ts!==null&&Br(ts,e),$o.forEach(t),qo.forEach(t);for(var s=0;s<ns.length;s++){var l=ns[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ns.length&&(s=ns[0],s.blockedOn===null);)Hg(s),s.blockedOn===null&&ns.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var d=s[l],h=s[l+1],_=d[tn]||null;if(typeof h=="function")_||Gg(s);else if(_){var j=null;if(h&&h.hasAttribute("formAction")){if(d=h,_=h[tn]||null)j=_.formAction;else if(Ud(d)!==null)continue}else j=_.action;typeof j=="function"?s[l+1]=j:(s.splice(l,3),l-=3),Gg(s)}}}function $g(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(_){return d=_})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function Hd(e){this._internalRoot=e}Ir.prototype.render=Hd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,l=gn();Bg(s,l,e,t,null,null)},Ir.prototype.unmount=Hd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bg(e.current,2,null,e,null,null),gr(),t[Zs]=null}};function Ir(e){this._internalRoot=e}Ir.prototype.unstable_scheduleHydration=function(e){if(e){var t=ep();e={blockedOn:null,target:e,priority:t};for(var s=0;s<ns.length&&t!==0&&t<ns[s].priority;s++);ns.splice(s,0,e),s===0&&Hg(e)}};var qg=a.version;if(qg!=="19.2.4")throw Error(o(527,qg,"19.2.4"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=v(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var US={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zr.isDisabled&&zr.supportsFiber)try{Ze=zr.inject(US),be=zr}catch{}}return Yo.createRoot=function(e,t){if(!c(e))throw Error(o(299));var s=!1,l="",d=Qm,h=Jm,_=ev;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(_=t.onRecoverableError)),t=Mg(e,1,!1,null,null,s,l,null,d,h,_,$g),e[Zs]=t.current,Sd(e),new Hd(t)},Yo.hydrateRoot=function(e,t,s){if(!c(e))throw Error(o(299));var l=!1,d="",h=Qm,_=Jm,j=ev,D=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.formState!==void 0&&(D=s.formState)),t=Mg(e,1,!0,t,s??null,l,d,D,h,_,j,$g),t.context=Og(null),s=t.current,l=gn(),l=Dc(l),d=Ha(l),d.callback=null,Pa(s,d,l),s=l,t.current.lanes=s,no(t,s),Wn(t),e[Zs]=t.current,Sd(e),new Ir(t)},Yo.version="19.2.4",Yo}var Jg;function hT(){if(Jg)return Pd.exports;Jg=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Pd.exports=fT(),Pd.exports}var pT=hT();const mT="modulepreload",vT=function(n){return"/"+n},ey={},gT=function(a,i,o){let c=Promise.resolve();if(i&&i.length>0){let f=function(v){return Promise.all(v.map(g=>Promise.resolve(g).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=f(i.map(v=>{if(v=vT(v),v in ey)return;ey[v]=!0;const g=v.endsWith(".css"),b=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${b}`))return;const x=document.createElement("link");if(x.rel=g?"stylesheet":mT,g||(x.as="script"),x.crossOrigin="",x.href=v,m&&x.setAttribute("nonce",m),document.head.appendChild(x),g)return new Promise((S,T)=>{x.addEventListener("load",S),x.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${v}`)))})}))}function u(f){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=f,window.dispatchEvent(p),!p.defaultPrevented)throw f}return c.then(f=>{for(const p of f||[])p.status==="rejected"&&u(p.reason);return a().catch(u)})};function Vs(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function J0(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function yT(n){return Vs(n)&&typeof n.id=="string"&&typeof n.type=="string"&&typeof n.timestamp=="string"&&Vs(n.payload)}function bT(n){return Vs(n)&&typeof n.sessionId=="string"&&typeof n.eventType=="string"&&typeof n.timestamp=="string"&&typeof n.content=="string"&&(n.raw===void 0||typeof n.raw=="string")}const xT=new Set(["off","subscription","api_key"]),Hr=new Set(["off","on"]);function _T(n){return Vs(n)&&xT.has(n.claude)&&Hr.has(n.github)&&Hr.has(n.copilot)&&Hr.has(n.codex)&&Hr.has(n.goose)}function ST(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!Vs(a)||typeof a.type!="string"){console.warn("[ws] Received WebSocket message without a string 'type' field:",a);return}return typeof a.id=="string"&&typeof a.timestamp=="string"?{id:a.id,type:a.type,timestamp:a.timestamp,payload:Vs(a.payload)?a.payload:{}}:{type:a.type,payload:Vs(a.payload)?a.payload:void 0}}function eb(n){switch(n){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 n}}function tb(n){switch(n){case"completed":return"completed";case"killed":return"killed";case"failed":return"interrupted";case"interrupted":return"interrupted";case"terminated":return"terminated";default:return}}const TT=3e3,Mi=5e3,kT=4001;/**
|
|
27
|
-
* react-router v7.13.2
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Remix Software Inc.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
33
|
-
*
|
|
34
|
-
* @license MIT
|
|
35
|
-
*/var ty="popstate";function ny(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function jT(n={}){function a(o,c){var v;let u=(v=c.state)==null?void 0:v.masked,{pathname:f,search:p,hash:m}=u||o.location;return Nf("",{pathname:f,search:p,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default",u?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function i(o,c){return typeof c=="string"?c:dl(c)}return wT(a,i,null,n)}function ct(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Ln(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function NT(){return Math.random().toString(36).substring(2,10)}function ay(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Nf(n,a,i=null,o,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Xi(a):a,state:i,key:a&&a.key||o||NT(),unstable_mask:c}}function dl({pathname:n="/",search:a="",hash:i=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(n+=i.charAt(0)==="#"?i:"#"+i),n}function Xi(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let o=n.indexOf("?");o>=0&&(a.search=n.substring(o),n=n.substring(0,o)),n&&(a.pathname=n)}return a}function wT(n,a,i,o={}){let{window:c=document.defaultView,v5Compat:u=!1}=o,f=c.history,p="POP",m=null,v=g();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function g(){return(f.state||{idx:null}).idx}function b(){p="POP";let N=g(),k=N==null?null:N-v;v=N,m&&m({action:p,location:w.location,delta:k})}function x(N,k){p="PUSH";let E=ny(N)?N:Nf(w.location,N,k);v=g()+1;let A=ay(E,v),R=w.createHref(E.unstable_mask||E);try{f.pushState(A,"",R)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;c.location.assign(R)}u&&m&&m({action:p,location:w.location,delta:1})}function S(N,k){p="REPLACE";let E=ny(N)?N:Nf(w.location,N,k);v=g();let A=ay(E,v),R=w.createHref(E.unstable_mask||E);f.replaceState(A,"",R),u&&m&&m({action:p,location:w.location,delta:0})}function T(N){return CT(N)}let w={get action(){return p},get location(){return n(c,f)},listen(N){if(m)throw new Error("A history only accepts one active listener");return c.addEventListener(ty,b),m=N,()=>{c.removeEventListener(ty,b),m=null}},createHref(N){return a(c,N)},createURL:T,encodeLocation(N){let k=T(N);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:x,replace:S,go(N){return f.go(N)}};return w}function CT(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),ct(i,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:dl(n);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=i+o),new URL(o,i)}function nb(n,a,i="/"){return ET(n,a,i,!1)}function ET(n,a,i,o){let c=typeof a=="string"?Xi(a):a,u=Ea(c.pathname||"/",i);if(u==null)return null;let f=ab(n);AT(f);let p=null;for(let m=0;p==null&&m<f.length;++m){let v=ib(u);p=UT(f[m],v,o)}return p}function ab(n,a=[],i=[],o="",c=!1){let u=(f,p,m=c,v)=>{let g={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(o)&&m)return;ct(g.relativePath.startsWith(o),`Absolute route path "${g.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(o.length)}let b=Jn([o,g.relativePath]),x=i.concat(g);f.children&&f.children.length>0&&(ct(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),ab(f.children,a,x,b,m)),!(f.path==null&&!f.index)&&a.push({path:b,score:IT(b,f.index),routesMeta:x})};return n.forEach((f,p)=>{var m;if(f.path===""||!((m=f.path)!=null&&m.includes("?")))u(f,p);else for(let v of sb(f.path))u(f,p,!0,v)}),a}function sb(n){let a=n.split("/");if(a.length===0)return[];let[i,...o]=a,c=i.endsWith("?"),u=i.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let f=sb(o.join("/")),p=[];return p.push(...f.map(m=>m===""?u:[u,m].join("/"))),c&&p.push(...f),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function AT(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:zT(a.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var DT=/^:[\w-]+$/,RT=3,MT=2,OT=1,BT=10,LT=-2,sy=n=>n==="*";function IT(n,a){let i=n.split("/"),o=i.length;return i.some(sy)&&(o+=LT),a&&(o+=MT),i.filter(c=>!sy(c)).reduce((c,u)=>c+(DT.test(u)?RT:u===""?OT:BT),o)}function zT(n,a){return n.length===a.length&&n.slice(0,-1).every((o,c)=>o===a[c])?n[n.length-1]-a[a.length-1]:0}function UT(n,a,i=!1){let{routesMeta:o}=n,c={},u="/",f=[];for(let p=0;p<o.length;++p){let m=o[p],v=p===o.length-1,g=u==="/"?a:a.slice(u.length)||"/",b=fl({path:m.relativePath,caseSensitive:m.caseSensitive,end:v},g),x=m.route;if(!b&&v&&i&&!o[o.length-1].route.index&&(b=fl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:Jn([u,b.pathname]),pathnameBase:$T(Jn([u,b.pathnameBase])),route:x}),b.pathnameBase!=="/"&&(u=Jn([u,b.pathnameBase]))}return f}function fl(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,o]=VT(n.path,n.caseSensitive,n.end),c=a.match(i);if(!c)return null;let u=c[0],f=u.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:o.reduce((v,{paramName:g,isOptional:b},x)=>{if(g==="*"){let T=p[x]||"";f=u.slice(0,u.length-T.length).replace(/(.)\/+$/,"$1")}const S=p[x];return b&&!S?v[g]=void 0:v[g]=(S||"").replace(/%2F/g,"/"),v},{}),pathname:u,pathnameBase:f,pattern:n}}function VT(n,a=!1,i=!0){Ln(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let o=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,m,v,g)=>{if(o.push({paramName:p,isOptional:m!=null}),m){let b=g.charAt(v+f.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function ib(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Ln(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function Ea(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,o=n.charAt(i);return o&&o!=="/"?null:n.slice(i)||"/"}var HT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function PT(n,a="/"){let{pathname:i,search:o="",hash:c=""}=typeof n=="string"?Xi(n):n,u;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?u=iy(i.substring(1),"/"):u=iy(i,a)):u=a,{pathname:u,search:qT(o),hash:KT(c)}}function iy(n,a){let i=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(c=>{c===".."?i.length>1&&i.pop():c!=="."&&i.push(c)}),i.length>1?i.join("/"):"/"}function qd(n,a,i,o){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function GT(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function th(n){let a=GT(n);return a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase)}function yc(n,a,i,o=!1){let c;typeof n=="string"?c=Xi(n):(c={...n},ct(!c.pathname||!c.pathname.includes("?"),qd("?","pathname","search",c)),ct(!c.pathname||!c.pathname.includes("#"),qd("#","pathname","hash",c)),ct(!c.search||!c.search.includes("#"),qd("#","search","hash",c)));let u=n===""||c.pathname==="",f=u?"/":c.pathname,p;if(f==null)p=i;else{let b=a.length-1;if(!o&&f.startsWith("..")){let x=f.split("/");for(;x[0]==="..";)x.shift(),b-=1;c.pathname=x.join("/")}p=b>=0?a[b]:"/"}let m=PT(c,p),v=f&&f!=="/"&&f.endsWith("/"),g=(u||f===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(v||g)&&(m.pathname+="/"),m}var Jn=n=>n.join("/").replace(/\/\/+/g,"/"),$T=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),qT=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,KT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,FT=class{constructor(n,a,i,o=!1){this.status=n,this.statusText=a||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function YT(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function ZT(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ob=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lb(n,a){let i=n;if(typeof i!="string"||!HT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,c=!1;if(ob)try{let u=new URL(window.location.href),f=i.startsWith("//")?new URL(u.protocol+i):new URL(i),p=Ea(f.pathname,a);f.origin===u.origin&&p!=null?i=p+f.search+f.hash:c=!0}catch{Ln(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:c,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var rb=["POST","PUT","PATCH","DELETE"];new Set(rb);var XT=["GET",...rb];new Set(XT);var Wi=y.createContext(null);Wi.displayName="DataRouter";var bc=y.createContext(null);bc.displayName="DataRouterState";var WT=y.createContext(!1),cb=y.createContext({isTransitioning:!1});cb.displayName="ViewTransition";var QT=y.createContext(new Map);QT.displayName="Fetchers";var JT=y.createContext(null);JT.displayName="Await";var _n=y.createContext(null);_n.displayName="Navigation";var bl=y.createContext(null);bl.displayName="Location";var In=y.createContext({outlet:null,matches:[],isDataRoute:!1});In.displayName="Route";var nh=y.createContext(null);nh.displayName="RouteError";var ub="REACT_ROUTER_ERROR",ek="REDIRECT",tk="ROUTE_ERROR_RESPONSE";function nk(n){if(n.startsWith(`${ub}:${ek}:{`))try{let a=JSON.parse(n.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function ak(n){if(n.startsWith(`${ub}:${tk}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new FT(a.status,a.statusText,a.data)}catch{}}function sk(n,{relative:a}={}){ct(qs(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:o}=y.useContext(_n),{hash:c,pathname:u,search:f}=xl(n,{relative:a}),p=u;return i!=="/"&&(p=u==="/"?i:Jn([i,u])),o.createHref({pathname:p,search:f,hash:c})}function qs(){return y.useContext(bl)!=null}function Lt(){return ct(qs(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(bl).location}function Et(n){ct(qs(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=Lt();return y.useMemo(()=>fl(n,ib(a)),[a,n])}var db="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fb(n){y.useContext(_n).static||y.useLayoutEffect(n)}function xc(){let{isDataRoute:n}=y.useContext(In);return n?bk():ik()}function ik(){ct(qs(),"useNavigate() may be used only in the context of a <Router> component.");let n=y.useContext(Wi),{basename:a,navigator:i}=y.useContext(_n),{matches:o}=y.useContext(In),{pathname:c}=Lt(),u=JSON.stringify(th(o)),f=y.useRef(!1);return fb(()=>{f.current=!0}),y.useCallback((m,v={})=>{if(Ln(f.current,db),!f.current)return;if(typeof m=="number"){i.go(m);return}let g=yc(m,JSON.parse(u),c,v.relative==="path");n==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:Jn([a,g.pathname])),(v.replace?i.replace:i.push)(g,v.state,v)},[a,i,u,c,n])}var ok=y.createContext(null);function lk(n){let a=y.useContext(In).outlet;return y.useMemo(()=>a&&y.createElement(ok.Provider,{value:n},a),[a,n])}function ds(){let{matches:n}=y.useContext(In),a=n[n.length-1];return a?a.params:{}}function xl(n,{relative:a}={}){let{matches:i}=y.useContext(In),{pathname:o}=Lt(),c=JSON.stringify(th(i));return y.useMemo(()=>yc(n,JSON.parse(c),o,a==="path"),[n,c,o,a])}function rk(n,a){return hb(n,a)}function hb(n,a,i){var N;ct(qs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=y.useContext(_n),{matches:c}=y.useContext(In),u=c[c.length-1],f=u?u.params:{},p=u?u.pathname:"/",m=u?u.pathnameBase:"/",v=u&&u.route;{let k=v&&v.path||"";mb(p,!v||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
36
|
-
|
|
37
|
-
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let g=Lt(),b;if(a){let k=typeof a=="string"?Xi(a):a;ct(m==="/"||((N=k.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 "${k.pathname}" was given in the \`location\` prop.`),b=k}else b=g;let x=b.pathname||"/",S=x;if(m!=="/"){let k=m.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(k.length).join("/")}let T=nb(n,{pathname:S});Ln(v||T!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Ln(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${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=hk(T&&T.map(k=>Object.assign({},k,{params:Object.assign({},f,k.params),pathname:Jn([m,o.encodeLocation?o.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?m:Jn([m,o.encodeLocation?o.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),c,i);return a&&w?y.createElement(bl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},w):w}function ck(){let n=yk(),a=YT(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},f=null;return console.error("Error handled by React Router default ErrorBoundary:",n),f=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:u},"ErrorBoundary")," or"," ",y.createElement("code",{style:u},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},a),i?y.createElement("pre",{style:c},i):null,f)}var uk=y.createElement(ck,null),pb=class extends y.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const i=ak(n.digest);i&&(n=i)}let a=n!==void 0?y.createElement(In.Provider,{value:this.props.routeContext},y.createElement(nh.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?y.createElement(dk,{error:n},a):a}};pb.contextType=WT;var Kd=new WeakMap;function dk({children:n,error:a}){let{basename:i}=y.useContext(_n);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=nk(a.digest);if(o){let c=Kd.get(a);if(c)throw c;let u=lb(o.location,i);if(ob&&!Kd.get(a))if(u.isExternal||o.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw Kd.set(a,f),f}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return n}function fk({routeContext:n,match:a,children:i}){let o=y.useContext(Wi);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),y.createElement(In.Provider,{value:n},i)}function hk(n,a=[],i){let o=i==null?void 0:i.state;if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let c=n,u=o==null?void 0:o.errors;if(u!=null){let g=c.findIndex(b=>b.route.id&&(u==null?void 0:u[b.route.id])!==void 0);ct(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),c=c.slice(0,Math.min(c.length,g+1))}let f=!1,p=-1;if(i&&o){f=o.renderFallback;for(let g=0;g<c.length;g++){let b=c[g];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(p=g),b.route.id){let{loaderData:x,errors:S}=o,T=b.route.loader&&!x.hasOwnProperty(b.route.id)&&(!S||S[b.route.id]===void 0);if(b.route.lazy||T){i.isStatic&&(f=!0),p>=0?c=c.slice(0,p+1):c=[c[0]];break}}}}let m=i==null?void 0:i.onError,v=o&&m?(g,b)=>{var x,S;m(g,{location:o.location,params:((S=(x=o.matches)==null?void 0:x[0])==null?void 0:S.params)??{},unstable_pattern:ZT(o.matches),errorInfo:b})}:void 0;return c.reduceRight((g,b,x)=>{let S,T=!1,w=null,N=null;o&&(S=u&&b.route.id?u[b.route.id]:void 0,w=b.route.errorElement||uk,f&&(p<0&&x===0?(mb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,N=null):p===x&&(T=!0,N=b.route.hydrateFallbackElement||null)));let k=a.concat(c.slice(0,x+1)),E=()=>{let A;return S?A=w:T?A=N:b.route.Component?A=y.createElement(b.route.Component,null):b.route.element?A=b.route.element:A=g,y.createElement(fk,{match:b,routeContext:{outlet:g,matches:k,isDataRoute:o!=null},children:A})};return o&&(b.route.ErrorBoundary||b.route.errorElement||x===0)?y.createElement(pb,{location:o.location,revalidation:o.revalidation,component:w,error:S,children:E(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:v}):E()},null)}function ah(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function pk(n){let a=y.useContext(Wi);return ct(a,ah(n)),a}function mk(n){let a=y.useContext(bc);return ct(a,ah(n)),a}function vk(n){let a=y.useContext(In);return ct(a,ah(n)),a}function sh(n){let a=vk(n),i=a.matches[a.matches.length-1];return ct(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function gk(){return sh("useRouteId")}function yk(){var o;let n=y.useContext(nh),a=mk("useRouteError"),i=sh("useRouteError");return n!==void 0?n:(o=a.errors)==null?void 0:o[i]}function bk(){let{router:n}=pk("useNavigate"),a=sh("useNavigate"),i=y.useRef(!1);return fb(()=>{i.current=!0}),y.useCallback(async(c,u={})=>{Ln(i.current,db),i.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...u}))},[n,a])}var oy={};function mb(n,a,i){!a&&!oy[n]&&(oy[n]=!0,Ln(!1,i))}y.memo(xk);function xk({routes:n,future:a,state:i,isStatic:o,onError:c}){return hb(n,void 0,{state:i,isStatic:o,onError:c})}function $n({to:n,replace:a,state:i,relative:o}){ct(qs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(_n);Ln(!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:u}=y.useContext(In),{pathname:f}=Lt(),p=xc(),m=yc(n,th(u),f,o==="path"),v=JSON.stringify(m);return y.useEffect(()=>{p(JSON.parse(v),{replace:a,state:i,relative:o})},[p,v,o,a,i]),null}function Ks(n){return lk(n.context)}function je(n){ct(!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 _k({basename:n="/",children:a=null,location:i,navigationType:o="POP",navigator:c,static:u=!1,unstable_useTransitions:f}){ct(!qs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),m=y.useMemo(()=>({basename:p,navigator:c,static:u,unstable_useTransitions:f,future:{}}),[p,c,u,f]);typeof i=="string"&&(i=Xi(i));let{pathname:v="/",search:g="",hash:b="",state:x=null,key:S="default",unstable_mask:T}=i,w=y.useMemo(()=>{let N=Ea(v,p);return N==null?null:{location:{pathname:N,search:g,hash:b,state:x,key:S,unstable_mask:T},navigationType:o}},[p,v,g,b,x,S,o,T]);return Ln(w!=null,`<Router basename="${p}"> is not able to match the URL "${v}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(_n.Provider,{value:m},y.createElement(bl.Provider,{children:a,value:w}))}function Sk({children:n,location:a}){return rk(wf(n),a)}function wf(n,a=[]){let i=[];return y.Children.forEach(n,(o,c)=>{if(!y.isValidElement(o))return;let u=[...a,c];if(o.type===y.Fragment){i.push.apply(i,wf(o.props.children,u));return}ct(o.type===je,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ct(!o.props.index||!o.props.children,"An index route cannot have child routes.");let f={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(f.children=wf(o.props.children,u)),i.push(f)}),i}var Jr="get",ec="application/x-www-form-urlencoded";function _c(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function Tk(n){return _c(n)&&n.tagName.toLowerCase()==="button"}function kk(n){return _c(n)&&n.tagName.toLowerCase()==="form"}function jk(n){return _c(n)&&n.tagName.toLowerCase()==="input"}function Nk(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function wk(n,a){return n.button===0&&(!a||a==="_self")&&!Nk(n)}function Cf(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let o=n[i];return a.concat(Array.isArray(o)?o.map(c=>[i,c]):[[i,o]])},[]))}function Ck(n,a){let i=Cf(n);return a&&a.forEach((o,c)=>{i.has(c)||a.getAll(c).forEach(u=>{i.append(c,u)})}),i}var Pr=null;function Ek(){if(Pr===null)try{new FormData(document.createElement("form"),0),Pr=!1}catch{Pr=!0}return Pr}var Ak=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Fd(n){return n!=null&&!Ak.has(n)?(Ln(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ec}"`),null):n}function Dk(n,a){let i,o,c,u,f;if(kk(n)){let p=n.getAttribute("action");o=p?Ea(p,a):null,i=n.getAttribute("method")||Jr,c=Fd(n.getAttribute("enctype"))||ec,u=new FormData(n)}else if(Tk(n)||jk(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=n.getAttribute("formaction")||p.getAttribute("action");if(o=m?Ea(m,a):null,i=n.getAttribute("formmethod")||p.getAttribute("method")||Jr,c=Fd(n.getAttribute("formenctype"))||Fd(p.getAttribute("enctype"))||ec,u=new FormData(p,n),!Ek()){let{name:v,type:g,value:b}=n;if(g==="image"){let x=v?`${v}.`:"";u.append(`${x}x`,"0"),u.append(`${x}y`,"0")}else v&&u.append(v,b)}}else{if(_c(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Jr,o=null,c=ec,f=n}return u&&c==="text/plain"&&(f=u,u=void 0),{action:o,method:i.toLowerCase(),encType:c,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ih(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Rk(n,a,i,o){let c=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:a&&Ea(c.pathname,a)==="/"?c.pathname=`${a.replace(/\/$/,"")}/_root.${o}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${o}`,c}async function Mk(n,a){if(n.id in a)return a[n.id];try{let i=await import(n.module);return a[n.id]=i,i}catch(i){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ok(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function Bk(n,a,i){let o=await Promise.all(n.map(async c=>{let u=a.routes[c.route.id];if(u){let f=await Mk(u,i);return f.links?f.links():[]}return[]}));return Uk(o.flat(1).filter(Ok).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function ly(n,a,i,o,c,u){let f=(m,v)=>i[v]?m.route.id!==i[v].route.id:!0,p=(m,v)=>{var g;return i[v].pathname!==m.pathname||((g=i[v].route.path)==null?void 0:g.endsWith("*"))&&i[v].params["*"]!==m.params["*"]};return u==="assets"?a.filter((m,v)=>f(m,v)||p(m,v)):u==="data"?a.filter((m,v)=>{var b;let g=o.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(f(m,v)||p(m,v))return!0;if(m.route.shouldRevalidate){let x=m.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((b=i[0])==null?void 0:b.params)||{},nextUrl:new URL(n,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function Lk(n,a,{includeHydrateFallback:i}={}){return Ik(n.map(o=>{let c=a.routes[o.route.id];if(!c)return[];let u=[c.module];return c.clientActionModule&&(u=u.concat(c.clientActionModule)),c.clientLoaderModule&&(u=u.concat(c.clientLoaderModule)),i&&c.hydrateFallbackModule&&(u=u.concat(c.hydrateFallbackModule)),c.imports&&(u=u.concat(c.imports)),u}).flat(1))}function Ik(n){return[...new Set(n)]}function zk(n){let a={},i=Object.keys(n).sort();for(let o of i)a[o]=n[o];return a}function Uk(n,a){let i=new Set;return new Set(a),n.reduce((o,c)=>{let u=JSON.stringify(zk(c));return i.has(u)||(i.add(u),o.push({key:u,link:c})),o},[])}function vb(){let n=y.useContext(Wi);return ih(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Vk(){let n=y.useContext(bc);return ih(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var oh=y.createContext(void 0);oh.displayName="FrameworkContext";function gb(){let n=y.useContext(oh);return ih(n,"You must render this element inside a <HydratedRouter> element"),n}function Hk(n,a){let i=y.useContext(oh),[o,c]=y.useState(!1),[u,f]=y.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:v,onMouseLeave:g,onTouchStart:b}=a,x=y.useRef(null);y.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let w=k=>{k.forEach(E=>{f(E.isIntersecting)})},N=new IntersectionObserver(w,{threshold:.5});return x.current&&N.observe(x.current),()=>{N.disconnect()}}},[n]),y.useEffect(()=>{if(o){let w=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(w)}}},[o]);let S=()=>{c(!0)},T=()=>{c(!1),f(!1)};return i?n!=="intent"?[u,x,{}]:[u,x,{onFocus:Zo(p,S),onBlur:Zo(m,T),onMouseEnter:Zo(v,S),onMouseLeave:Zo(g,T),onTouchStart:Zo(b,S)}]:[!1,x,{}]}function Zo(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function Pk({page:n,...a}){let{router:i}=vb(),o=y.useMemo(()=>nb(i.routes,n,i.basename),[i.routes,n,i.basename]);return o?y.createElement($k,{page:n,matches:o,...a}):null}function Gk(n){let{manifest:a,routeModules:i}=gb(),[o,c]=y.useState([]);return y.useEffect(()=>{let u=!1;return Bk(n,a,i).then(f=>{u||c(f)}),()=>{u=!0}},[n,a,i]),o}function $k({page:n,matches:a,...i}){let o=Lt(),{future:c,manifest:u,routeModules:f}=gb(),{basename:p}=vb(),{loaderData:m,matches:v}=Vk(),g=y.useMemo(()=>ly(n,a,v,u,o,"data"),[n,a,v,u,o]),b=y.useMemo(()=>ly(n,a,v,u,o,"assets"),[n,a,v,u,o]),x=y.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let w=new Set,N=!1;if(a.forEach(E=>{var R;let A=u.routes[E.route.id];!A||!A.hasLoader||(!g.some(C=>C.route.id===E.route.id)&&E.route.id in m&&((R=f[E.route.id])!=null&&R.shouldRevalidate)||A.hasClientLoader?N=!0:w.add(E.route.id))}),w.size===0)return[];let k=Rk(n,p,c.unstable_trailingSlashAwareDataRequests,"data");return N&&w.size>0&&k.searchParams.set("_routes",a.filter(E=>w.has(E.route.id)).map(E=>E.route.id).join(",")),[k.pathname+k.search]},[p,c.unstable_trailingSlashAwareDataRequests,m,o,u,g,a,n,f]),S=y.useMemo(()=>Lk(b,u),[b,u]),T=Gk(b);return y.createElement(y.Fragment,null,x.map(w=>y.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...i})),S.map(w=>y.createElement("link",{key:w,rel:"modulepreload",href:w,...i})),T.map(({key:w,link:N})=>y.createElement("link",{key:w,nonce:i.nonce,...N,crossOrigin:N.crossOrigin??i.crossOrigin})))}function qk(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var Kk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Kk&&(window.__reactRouterVersion="7.13.2")}catch{}function Fk({basename:n,children:a,unstable_useTransitions:i,window:o}){let c=y.useRef();c.current==null&&(c.current=jT({window:o,v5Compat:!0}));let u=c.current,[f,p]=y.useState({action:u.action,location:u.location}),m=y.useCallback(v=>{i===!1?p(v):y.startTransition(()=>p(v))},[i]);return y.useLayoutEffect(()=>u.listen(m),[u,m]),y.createElement(_k,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:u,unstable_useTransitions:i})}var yb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lh=y.forwardRef(function({onClick:a,discover:i="render",prefetch:o="none",relative:c,reloadDocument:u,replace:f,unstable_mask:p,state:m,target:v,to:g,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:S,...T},w){let{basename:N,navigator:k,unstable_useTransitions:E}=y.useContext(_n),A=typeof g=="string"&&yb.test(g),R=lb(g,N);g=R.to;let C=sk(g,{relative:c}),z=Lt(),H=null;if(p){let ae=yc(p,[],z.unstable_mask?z.unstable_mask.pathname:"/",!0);N!=="/"&&(ae.pathname=ae.pathname==="/"?N:Jn([N,ae.pathname])),H=k.createHref(ae)}let[B,K,Q]=Hk(o,T),se=Wk(g,{replace:f,unstable_mask:p,state:m,target:v,preventScrollReset:b,relative:c,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:E});function ne(ae){a&&a(ae),ae.defaultPrevented||se(ae)}let ce=!(R.isExternal||u),q=y.createElement("a",{...T,...Q,href:(ce?H:void 0)||R.absoluteURL||C,onClick:ce?ne:a,ref:qk(w,K),target:v,"data-discover":!A&&i==="render"?"true":void 0});return B&&!A?y.createElement(y.Fragment,null,q,y.createElement(Pk,{page:C})):q});lh.displayName="Link";var Yk=y.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:o="",end:c=!1,style:u,to:f,viewTransition:p,children:m,...v},g){let b=xl(f,{relative:v.relative}),x=Lt(),S=y.useContext(bc),{navigator:T,basename:w}=y.useContext(_n),N=S!=null&&nj(b)&&p===!0,k=T.encodeLocation?T.encodeLocation(b).pathname:b.pathname,E=x.pathname,A=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(E=E.toLowerCase(),A=A?A.toLowerCase():null,k=k.toLowerCase()),A&&w&&(A=Ea(A,w)||A);const R=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let C=E===k||!c&&E.startsWith(k)&&E.charAt(R)==="/",z=A!=null&&(A===k||!c&&A.startsWith(k)&&A.charAt(k.length)==="/"),H={isActive:C,isPending:z,isTransitioning:N},B=C?a:void 0,K;typeof o=="function"?K=o(H):K=[o,C?"active":null,z?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let Q=typeof u=="function"?u(H):u;return y.createElement(lh,{...v,"aria-current":B,className:K,ref:g,style:Q,to:f,viewTransition:p},typeof m=="function"?m(H):m)});Yk.displayName="NavLink";var Zk=y.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:o,replace:c,state:u,method:f=Jr,action:p,onSubmit:m,relative:v,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:x,...S},T)=>{let{unstable_useTransitions:w}=y.useContext(_n),N=ej(),k=tj(p,{relative:v}),E=f.toLowerCase()==="get"?"get":"post",A=typeof p=="string"&&yb.test(p),R=C=>{if(m&&m(C),C.defaultPrevented)return;C.preventDefault();let z=C.nativeEvent.submitter,H=(z==null?void 0:z.getAttribute("formmethod"))||f,B=()=>N(z||C.currentTarget,{fetcherKey:a,method:H,navigate:i,replace:c,state:u,relative:v,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:x});w&&i!==!1?y.startTransition(()=>B()):B()};return y.createElement("form",{ref:T,method:E,action:k,onSubmit:o?m:R,...S,"data-discover":!A&&n==="render"?"true":void 0})});Zk.displayName="Form";function Xk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bb(n){let a=y.useContext(Wi);return ct(a,Xk(n)),a}function Wk(n,{target:a,replace:i,unstable_mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:v}={}){let g=xc(),b=Lt(),x=xl(n,{relative:f});return y.useCallback(S=>{if(wk(S,a)){S.preventDefault();let T=i!==void 0?i:dl(b)===dl(x),w=()=>g(n,{replace:T,unstable_mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,unstable_defaultShouldRevalidate:m});v?y.startTransition(()=>w()):w()}},[b,g,x,i,o,c,a,n,u,f,p,m,v])}function rh(n){Ln(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=y.useRef(Cf(n)),i=y.useRef(!1),o=Lt(),c=y.useMemo(()=>Ck(o.search,i.current?null:a.current),[o.search]),u=xc(),f=y.useCallback((p,m)=>{const v=Cf(typeof p=="function"?p(new URLSearchParams(c)):p);i.current=!0,u("?"+v,m)},[u,c]);return[c,f]}var Qk=0,Jk=()=>`__${String(++Qk)}__`;function ej(){let{router:n}=bb("useSubmit"),{basename:a}=y.useContext(_n),i=gk(),o=n.fetch,c=n.navigate;return y.useCallback(async(u,f={})=>{let{action:p,method:m,encType:v,formData:g,body:b}=Dk(u,a);if(f.navigate===!1){let x=f.fetcherKey||Jk();await o(x,i,f.action||p,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:b,formMethod:f.method||m,formEncType:f.encType||v,flushSync:f.flushSync})}else await c(f.action||p,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:b,formMethod:f.method||m,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:i,flushSync:f.flushSync,viewTransition:f.viewTransition})},[o,c,a,i])}function tj(n,{relative:a}={}){let{basename:i}=y.useContext(_n),o=y.useContext(In);ct(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),u={...xl(n||".",{relative:a})},f=Lt();if(n==null){u.search=f.search;let p=new URLSearchParams(u.search),m=p.getAll("index");if(m.some(g=>g==="")){p.delete("index"),m.filter(b=>b).forEach(b=>p.append("index",b));let g=p.toString();u.search=g?`?${g}`:""}}return(!n||n===".")&&c.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:Jn([i,u.pathname])),dl(u)}function nj(n,{relative:a}={}){let i=y.useContext(cb);ct(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=bb("useViewTransitionState"),c=xl(n,{relative:a});if(!i.isTransitioning)return!1;let u=Ea(i.currentLocation.pathname,o)||i.currentLocation.pathname,f=Ea(i.nextLocation.pathname,o)||i.nextLocation.pathname;return fl(c.pathname,f)!=null||fl(c.pathname,u)!=null}function xt(){const n=xc();return y.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function xb(n){return`/sessions/${encodeURIComponent(n)}`}function Gi(n,a){return a?`/environments/${encodeURIComponent(a)}/workspaces/${encodeURIComponent(n)}`:`/workspaces/${encodeURIComponent(n)}`}function na(n,a,i,o){const c=encodeURIComponent(n);let u;return i&&o?u=`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(i)}/tasks/${c}`:i?u=`/workspaces/${encodeURIComponent(i)}/tasks/${c}`:u=`/tasks/${c}`,a?`${u}/${a}`:u}function Fs(n,a,i){const o=new URLSearchParams;n&&o.set("workspace",n),a&&o.set("parent",a);const c=o.toString();if(n&&i){const u=`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(n)}/tasks/new`;return a?`${u}?parent=${encodeURIComponent(a)}`:u}return c?`/tasks/new?${c}`:"/tasks/new"}function _b(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const $i="/environments",aj="/environments/new";function qi(n){return`/environments/${encodeURIComponent(n)}`}function sj(n){return`/environments/${encodeURIComponent(n)}/edit`}const Pi="/settings",ij="/settings/credentials",Yd="/settings/personas",oj="/settings/personas/new";function Sb(n){return`/settings/personas/${encodeURIComponent(n)}`}const lj="/settings/shortcuts",rj="/pair",cj="/chat",Ps="/",uj="/tasks",Tb="/workspaces/new",kb="/knowledge";function dj(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",o=y.useRef(void 0),[c,u]=y.useState(!1),f=y.useRef(a.onMessage);f.current=a.onMessage;const p=y.useRef(a.onConnect);p.current=a.onConnect;const m=y.useRef(a.onDisconnect);m.current=a.onDisconnect;const v=y.useCallback(g=>{var b;((b=o.current)==null?void 0:b.readyState)===WebSocket.OPEN&&o.current.send(JSON.stringify(g))},[]);return y.useEffect(()=>{let g,b;function x(){g=new WebSocket(i),o.current=g,g.onopen=()=>{u(!0),p.current(v)},g.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const T=ST(S.data);T&&f.current(T)},g.onclose=S=>{var T;if(u(!1),o.current=void 0,(T=m.current)==null||T.call(m),clearTimeout(b),S.code===kT){window.location.href=rj;return}b=setTimeout(x,TT)},g.onerror=()=>{g.close()}}return x(),()=>{clearTimeout(b),g==null||g.close()}},[i,v]),{connected:c,send:v}}const fj=new Proxy(globalThis.fetch,{apply(n,a,i){return Reflect.apply(globalThis.fetch,a,i)}}),hj=QS({baseUrl:"/",fetch:fj}),ke=JS(eT,hj);function pj(n){return{id:n.id,displayName:n.displayName,adapterType:n.adapterType,adapterConfig:n.adapterConfig||"{}",status:n.status,bootstrapped:n.bootstrapped}}function ry(n){return{id:n.id,environmentId:n.environmentId,runtime:n.runtime,status:n.status,prompt:n.prompt,startedAt:n.startedAt,endedAt:n.endedAt||void 0,error:n.error||void 0,endReason:n.endReason||void 0,personaId:n.personaId||void 0,inputTokens:n.inputTokens,outputTokens:n.outputTokens,costUsd:n.costUsd}}function mj(n){return{sessionId:n.sessionId,eventType:tT(n.type),timestamp:n.timestamp,content:n.content,raw:n.raw||void 0}}function vj(n){return{id:n.id,name:n.name,description:n.description,repoUrl:n.repoUrl,environmentId:n.environmentId,status:nT(n.status),workingDirectory:n.workingDirectory,useWorktrees:n.useWorktrees,defaultPersonaId:n.defaultPersonaId,createdAt:n.createdAt,updatedAt:n.updatedAt}}function cy(n){return{id:n.id,workspaceId:n.workspaceId??void 0,title:n.title,description:n.description,status:aT(n.status),branch:n.branch,latestSessionId:n.latestSessionId,dependsOn:[...n.dependsOn],sortOrder:n.sortOrder,createdAt:n.createdAt,startedAt:n.startedAt||void 0,completedAt:n.completedAt||void 0,parentTaskId:n.parentTaskId,depth:n.depth,childTaskIds:[...n.childTaskIds],canDecompose:n.canDecompose,defaultPersonaId:n.defaultPersonaId,workpad:n.workpad}}function gj(n){return{id:n.id,workspaceId:n.workspaceId,taskId:n.taskId,sessionId:n.sessionId,category:n.category,title:n.title,content:n.content,tags:[...n.tags],createdAt:n.createdAt}}function yj(n){return{name:n.name,tokenType:n.type,envVar:n.envVar,filePath:n.filePath,expiresAt:n.expiresAt}}function bj(n){return{claude:sT(n.claude),github:Vr(n.github),copilot:Vr(n.copilot),codex:Vr(n.codex),goose:Vr(n.goose)}}function xj(n){return{name:n.name,repository:n.repository,state:n.state,gitStatus:n.gitStatus}}function Zd(n){return{id:n.id,name:n.name,description:n.description,systemPrompt:n.systemPrompt,toolConfig:n.toolConfig?JSON.stringify({allowedTools:[...n.toolConfig.allowedTools],disallowedTools:[...n.toolConfig.disallowedTools]}):"{}",runtime:n.runtime,model:n.model,maxTurns:n.maxTurns,mcpServers:JSON.stringify(n.mcpServers.map(a=>({name:a.name,command:a.command,args:[...a.args],tools:[...a.tools]}))),createdAt:n.createdAt,updatedAt:n.updatedAt,type:n.type||"agent",script:n.script,allowedMcpTools:[...n.allowedMcpTools]}}function _j(n){return{inputTokens:n.inputTokens,outputTokens:n.outputTokens,costUsd:n.costUsd,sessionCount:n.sessionCount}}function Gr(n,a=0){return{id:n.id,label:n.title||n.label||n.id,kind:n.kind,category:n.category||void 0,sourceType:n.sourceType||void 0,sourceId:n.sourceId||void 0,content:n.content||void 0,tags:n.tags.length>0?[...n.tags]:void 0,workspaceId:n.workspaceId||void 0,createdAt:n.createdAt||void 0,updatedAt:n.updatedAt||void 0,val:a}}function Xd(n){return{source:n.fromId,target:n.toId,type:n.type}}const uy=5e3;function Sj(){const[n,a]=y.useState([]),[i,o]=y.useState({}),c=y.useCallback(()=>{ke.listEnvironments({}).then(x=>{a(x.environments.map(pj))},()=>{})},[]),u=y.useCallback(x=>{switch(x.type){case"environment.added":return!0;case"environment.removed":{const S=x.payload.environmentId;return S&&(a(T=>T.filter(w=>w.id!==S)),o(T=>{const w={...T};return delete w[S],w})),!0}case"environment.changed":return c(),!0;case"environment.provision_progress":{const S=x.payload;if(typeof S.environmentId!="string"||typeof S.stage!="string"||typeof S.message!="string"||typeof S.progress!="number")return J0("environment.provision_progress","invalid payload"),!0;if(o(T=>({...T,[S.environmentId]:{stage:S.stage,message:S.message,progress:S.progress}})),S.stage==="ready"){const T=S.environmentId;setTimeout(()=>{o(w=>{const N={...w};return delete N[T],N})},uy)}return!0}default:return!1}},[c]),f=y.useCallback(x=>{var S;if(x.type==="environments"){const T=Array.isArray((S=x.payload)==null?void 0:S.environments)?x.payload.environments:[];return a(T),!0}return!1},[]),p=y.useCallback((x,S,T)=>{ke.addEnvironment({displayName:x,adapterType:S,adapterConfig:JSON.stringify(T??{})}).catch(()=>{})},[]),m=y.useCallback((x,S)=>{ke.updateEnvironment({id:x,displayName:S.displayName,adapterConfig:S.adapterConfig?JSON.stringify(S.adapterConfig):void 0}).catch(()=>{})},[]),v=y.useCallback((x,S)=>{(async()=>{try{const w=ke.provisionEnvironment({id:x,force:S??!1});for await(const N of w)o(k=>({...k,[x]:{stage:N.stage,message:N.message,progress:N.progress}})),N.stage==="ready"&&setTimeout(()=>{o(k=>{const E={...k};return delete E[x],E})},uy)}catch{o(w=>{const N={...w};return delete N[x],N})}})().catch(()=>{})},[]),g=y.useCallback(x=>{ke.stopEnvironment({id:x}).catch(()=>{})},[]),b=y.useCallback(x=>{ke.removeEnvironment({id:x}).catch(()=>{})},[]);return{environments:n,provisionStatus:i,loadEnvironments:c,addEnvironment:p,updateEnvironment:m,provisionEnvironment:v,stopEnvironment:g,removeEnvironment:b,handleEvent:u,handleLegacyMessage:f}}const Wd=new Set(["pending","running","idle"]),Tj=new Set(["completed","failed","interrupted","hibernating","suspended"]),dy=["pending","running","idle"];function kj(){const[n,a]=y.useState([]),[i,o]=y.useState([]),[c,u]=y.useState(0),[f,p]=y.useState(void 0),[m,v]=y.useState({}),g=y.useCallback(()=>{ke.listSessions({}).then(R=>{const C=R.sessions.map(ry);a(z=>{const H=new Map(z.map(B=>[B.id,B]));return C.map(B=>{const K=H.get(B.id),Q=K==null?void 0:K.status;return!Q||Q===B.status?B:Tj.has(Q)&&Wd.has(B.status)?{...B,status:Q,...K.endReason!==void 0?{endReason:K.endReason}:{}}:Wd.has(Q)&&Wd.has(B.status)&&dy.indexOf(Q)>dy.indexOf(B.status)?{...B,status:Q}:B})})},()=>{})},[]),b=y.useCallback(R=>{if(R.type!=="session_event")return!1;if(!bT(R.payload))return J0("session_event","payload is not a valid SessionEvent"),!0;const C=R.payload;let z=0;if(o(H=>{const B=[...H,C];return B.length>Mi?(z=B.length-Mi,B.slice(-Mi)):B}),z>0&&u(H=>H+z),C.eventType==="usage")try{const H=JSON.parse(C.content),B=Number(H.input_tokens)||0,K=Number(H.output_tokens)||0,Q=Number(H.cost_usd)||0;(B>0||K>0||Q>0)&&a(se=>se.map(ne=>ne.id===C.sessionId?{...ne,inputTokens:(ne.inputTokens??0)+B,outputTokens:(ne.outputTokens??0)+K,costUsd:(ne.costUsd??0)+Q}:ne))}catch{}if(C.eventType==="status"){const H=eb(C.content),B=tb(C.content);a(K=>K.some(se=>se.id===C.sessionId)?K.map(se=>se.id===C.sessionId?{...se,status:H,...B!==void 0?{endReason:B}:{}}:se):[...K,{id:C.sessionId,environmentId:"",runtime:"",status:H,prompt:"",startedAt:C.timestamp,...B!==void 0?{endReason:B}:{}}])}return!0},[]),x=y.useCallback(R=>{var C,z,H,B,K;switch(R.type){case"sessions":{const Q=Array.isArray((C=R.payload)==null?void 0:C.sessions)?R.payload.sessions:[];return a(Q),!0}case"spawned":{const Q=(z=R.payload)==null?void 0:z.sessionId;return typeof Q=="string"&&Q&&p(Q),g(),!0}case"session_events":{const Q=Array.isArray((H=R.payload)==null?void 0:H.events)?R.payload.events:[];return Q.length>0&&o(Q),!0}case"task_sessions":{const Q=(B=R.payload)==null?void 0:B.taskId;if(typeof Q=="string"&&Q){const se=Array.isArray((K=R.payload)==null?void 0:K.sessions)?R.payload.sessions:[];v(ne=>({...ne,[Q]:se}))}return!0}default:return!1}},[g]),S=y.useCallback((R,C,z,H)=>{ke.spawnAgent({environmentId:R,prompt:C,personaId:z||"",workingDirectory:H||""}).then(B=>{p(B.id),g()},()=>{})},[g]),T=y.useCallback((R,C)=>{ke.sendInput({sessionId:R,text:C}).catch(()=>{})},[]),w=y.useCallback(R=>{ke.killAgent({id:R,graceful:!1}).catch(()=>{})},[]),N=y.useCallback(R=>{ke.killAgent({id:R,graceful:!0}).catch(()=>{})},[]),k=y.useCallback(R=>{ke.getSessionEvents({id:R}).then(C=>{const z=C.events.map(mj);if(z.length>0){let H=0;o(B=>{const K=new Set;for(const ne of B)ne.sessionId===R&&K.add(`${ne.timestamp}|${ne.eventType}`);const Q=z.filter(ne=>!K.has(`${ne.timestamp}|${ne.eventType}`)),se=[...B,...Q].sort((ne,ce)=>ne.sessionId!==ce.sessionId?0:ne.timestamp.localeCompare(ce.timestamp));return se.length>Mi?(H=se.length-Mi,se.slice(-Mi)):se}),H>0&&u(B=>B+H)}},()=>{})},[]),E=y.useCallback(()=>{o([]),u(0)},[]),A=y.useCallback(R=>{ke.getTaskSessions({id:R}).then(C=>{const z=C.sessions.map(ry);v(H=>({...H,[R]:z}))},()=>{})},[]);return{sessions:n,events:i,eventsDropped:c,lastSpawnedId:f,taskSessions:m,loadSessions:g,spawn:S,sendInput:T,kill:w,stopGraceful:N,loadSessionEvents:k,clearEvents:E,loadTaskSessions:A,handleMessage:b,handleLegacyMessage:x}}function jj(){const[n,a]=y.useState([]),[i,o]=y.useState(!1),c=y.useCallback(()=>{ke.listWorkspaces({}).then(g=>{a(g.workspaces.map(vj))},()=>{})},[]),u=y.useCallback(g=>{switch(g.type){case"workspace.created":return o(!1),c(),!0;case"workspace.archived":case"workspace.updated":return c(),!0;default:return!1}},[c]),f=y.useCallback(()=>{o(!1)},[]),p=y.useCallback((g,b,x,S,T,w,N,k,E)=>{o(!0),ke.createWorkspace({name:g,description:b||"",repoUrl:x||"",environmentId:S||"",defaultPersonaId:T||void 0,useWorktrees:w??!0,workingDirectory:N||void 0}).then(()=>{o(!1),k==null||k()},A=>{o(!1);const R=A instanceof eh?A.message:"Failed to create workspace";E==null||E(R)})},[]),m=y.useCallback(g=>{ke.archiveWorkspace({id:g}).catch(()=>{})},[]),v=y.useCallback((g,b)=>{ke.updateWorkspace({id:g,...b}).catch(()=>{})},[]);return{workspaces:n,workspaceCreating:i,loadWorkspaces:c,createWorkspace:p,archiveWorkspace:m,updateWorkspace:v,handleEvent:u,onDisconnect:f}}function Nj(){const[n,a]=y.useState([]),[i,o]=y.useState(void 0),c=y.useCallback(k=>{ke.listTasks({workspaceId:k}).then(E=>{const A=E.tasks.map(cy);a(R=>[...R.filter(C=>C.workspaceId!==k),...A])},()=>{})},[]),u=y.useCallback(()=>{ke.listTasks({}).then(k=>{const E=k.tasks.map(cy);a(A=>{const R=new Set(E.map(C=>C.id));return[...A.filter(C=>!R.has(C.id)),...E]})},()=>{})},[]),f=y.useCallback((k,E)=>{k?c(k):E&&a(A=>{const R=A.find(C=>C.id===E);return R!=null&&R.workspaceId?c(R.workspaceId):u(),A})},[c,u]),p=y.useCallback(k=>{const E=k.payload;switch(k.type){case"task.created":{const A=typeof E.workspaceId=="string"?E.workspaceId:"";return A&&c(A),!0}case"task.started":{const A=typeof E.taskId=="string"?E.taskId:"",R=typeof E.sessionId=="string"?E.sessionId:"",C=typeof E.workspaceId=="string"?E.workspaceId:"";return o(z=>A&&z===A?void 0:z),R&&A&&a(z=>z.map(H=>H.id===A?{...H,latestSessionId:R}:H)),f(C,A),!0}case"task.completed":case"task.deleted":case"task.updated":{const A=typeof E.workspaceId=="string"?E.workspaceId:"",R=typeof E.taskId=="string"?E.taskId:"";return f(A,R),!0}default:return!1}},[c,f]),m=y.useCallback(()=>{o(void 0)},[]),v=y.useCallback(k=>{var E,A;if(k.type==="tasks"){const R=Array.isArray((E=k.payload)==null?void 0:E.tasks)?k.payload.tasks:[],C=typeof((A=k.payload)==null?void 0:A.workspaceId)=="string"&&k.payload.workspaceId?k.payload.workspaceId:"";return a(C?z=>[...z.filter(H=>H.workspaceId!==C),...R]:z=>{const H=new Set(R.map(B=>B.id));return[...z.filter(B=>!H.has(B.id)),...R]}),!0}return!1},[]),g=y.useCallback((k,E,A,R,C,z,H,B,K)=>{ke.createTask({workspaceId:k,title:E,description:A||"",dependsOn:R||[],parentTaskId:C||"",defaultPersonaId:z||void 0,canDecompose:H??void 0}).then(()=>{B==null||B()},Q=>{const se=Q instanceof eh?Q.message:"Failed to create task";K==null||K(se)})},[]),b=y.useCallback((k,E,A,R)=>{o(k),ke.startTask({taskId:k,personaId:E||"",environmentId:A||"",notes:R||""}).catch(()=>{o(void 0)})},[]),x=y.useCallback(k=>{ke.stopTask({id:k}).catch(()=>{})},[]),S=y.useCallback(k=>{ke.completeTask({id:k}).catch(()=>{})},[]),T=y.useCallback(k=>{ke.resumeTask({id:k}).catch(()=>{})},[]),w=y.useCallback((k,E,A,R,C)=>{ke.updateTask({id:k,title:E,description:A,dependsOn:R,...C!==void 0?{defaultPersonaId:C}:{}}).catch(()=>{})},[]),N=y.useCallback(k=>{ke.deleteTask({id:k}).catch(()=>{})},[]);return{tasks:n,taskStartingId:i,loadTasks:c,loadAllTasks:u,createTask:g,startTask:b,stopTask:x,completeTask:S,resumeTask:T,updateTask:w,deleteTask:N,handleEvent:p,onDisconnect:m,handleLegacyMessage:v}}function wj(){const[n,a]=y.useState([]),i=y.useCallback(u=>{ke.queryFindings({workspaceId:u}).then(f=>{a(f.findings.map(gj))},()=>{})},[]),o=y.useCallback(u=>{if(u.type==="finding.posted"){const f=typeof u.payload.workspaceId=="string"?u.payload.workspaceId:"";return f&&i(f),!0}return!1},[i]),c=y.useCallback((u,f,p,m,v)=>{ke.postFinding({workspaceId:u,title:f,content:p,category:m??"general",tags:v??[]}).catch(()=>{})},[]);return{findings:n,loadFindings:i,postFinding:c,handleEvent:o}}function Cj(){const[n,a]=y.useState([]),i=y.useCallback(()=>{ke.listTokens({}).then(f=>{a(f.tokens.map(yj))},()=>{})},[]),o=y.useCallback(f=>f.type==="token.changed"?(i(),!0):!1,[i]),c=y.useCallback((f,p,m,v,g)=>{ke.setToken({name:f,value:p,type:m,envVar:v,filePath:g}).catch(()=>{})},[]),u=y.useCallback(f=>{ke.deleteToken({name:f}).catch(()=>{})},[]);return{tokens:n,loadTokens:i,setToken:c,deleteToken:u,handleEvent:o}}function Ej(){const[n,a]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),i=y.useCallback(()=>{ke.getCredentialProviders({}).then(u=>{a(bj(u))},()=>{})},[]),o=y.useCallback(u=>u.type==="credential.providers_changed"?(_T(u.payload)&&a(u.payload),!0):!1,[]),c=y.useCallback(u=>{const f=[{provider:"claude",value:u.claude},{provider:"github",value:u.github},{provider:"copilot",value:u.copilot},{provider:"codex",value:u.codex},{provider:"goose",value:u.goose}];for(const{provider:p,value:m}of f)ke.setCredentialProvider({provider:p,value:m}).catch(()=>{})},[]);return{credentialProviders:n,loadCredentials:i,updateCredentialProviders:c,handleEvent:o}}function Aj(){const[n,a]=y.useState([]),[i,o]=y.useState(""),[c,u]=y.useState(""),[f,p]=y.useState(!1),m=y.useCallback(()=>{ke.listCodespaces({}).then(g=>{a(g.codespaces.map(xj)),u(g.error)},()=>{})},[]),v=y.useCallback((g,b)=>{p(!0),o(""),ke.createCodespace({repo:g,machine:b??""}).then(()=>{p(!1),m()},x=>{p(!1);const S=x instanceof eh?x.message:"Failed to create codespace";o(S)})},[m]);return{codespaces:n,codespaceError:i,codespaceListError:c,codespaceCreating:f,listCodespaces:m,createCodespace:v}}function Dj(){const[n,a]=y.useState([]),i=y.useCallback(()=>{ke.listPersonas({}).then(p=>{a(p.personas.map(Zd))},()=>{})},[]),o=y.useCallback(p=>{switch(p.type){case"persona.created":case"persona.updated":case"persona.deleted":return i(),!0;default:return!1}},[i]),c=y.useCallback((p,m,v,g,b,x,S,T,w)=>ke.createPersona({name:p,description:m,systemPrompt:v,runtime:g||"",model:b||"",maxTurns:x||0,type:S||"agent",script:T||"",allowedMcpTools:w||[]}).then(N=>{const k=Zd(N);return a(E=>[...E.filter(A=>A.id!==k.id),k]),k}),[]),u=y.useCallback((p,m,v,g,b,x,S,T,w,N)=>{const k={id:p};return m!==void 0&&(k.name=m),v!==void 0&&(k.description=v),g!==void 0&&(k.systemPrompt=g),b!==void 0&&(k.runtime=b),x!==void 0&&(k.model=x),S!==void 0&&(k.maxTurns=S),T!==void 0&&(k.type=T),w!==void 0&&(k.script=w),N!==void 0&&(k.allowedMcpTools=N),ke.updatePersona(k).then(E=>{const A=Zd(E);return a(R=>R.map(C=>C.id===A.id?A:C)),A})},[]),f=y.useCallback(async p=>{await ke.deletePersona({id:p}),a(m=>m.filter(v=>v.id!==p))},[]);return{personas:n,loadPersonas:i,createPersona:c,updatePersona:u,deletePersona:f,handleEvent:o}}function Rj(n){if(n)try{return JSON.parse(n)}catch{return}}function Mj(){const[n,a]=y.useState(new Map),[i,o]=y.useState([]),[c,u]=y.useState(void 0),[f,p]=y.useState(void 0),[m,v]=y.useState(!1),[g,b]=y.useState(""),x=y.useRef(""),S=y.useCallback(R=>{const C=R??"";x.current=C,b(""),v(!0),ke.listRecentKnowledgeNodes({limit:30,workspaceId:C}).then(z=>{const H=new Map,B=[];for(const K of z.nodes)H.set(K.id,Gr(K));for(const K of z.edges)B.push(Xd(K));for(const K of B){const Q=H.get(K.source);Q&&(Q.val+=1);const se=H.get(K.target);se&&(se.val+=1)}a(H),o(B),v(!1)},()=>{v(!1)})},[]),T=y.useCallback(R=>{R.trim()&&(b(R),p(void 0),u(void 0),v(!0),ke.searchKnowledge({query:R,limit:20,workspaceId:x.current}).then(C=>{const z=new Map,H=[];for(const B of C.results){B.node&&z.set(B.node.id,Gr(B.node,B.edges.length));for(const K of B.edges)H.push(Xd(K))}a(z),o(H),v(!1)},()=>{v(!1)}))},[]),w=y.useCallback(()=>{S(x.current)},[S]),N=y.useCallback(R=>{p(R),ke.getKnowledgeNode({id:R}).then(C=>{if(!C.node){u(void 0);return}u({node:Gr(C.node,C.edges.length),edges:C.edges.map(z=>({fromId:z.fromId,toId:z.toId,type:z.type,metadata:Rj(z.metadataJson)}))})},()=>{u(void 0)})},[]),k=y.useCallback(()=>{p(void 0),u(void 0)},[]),E=y.useCallback(R=>{ke.expandKnowledgeNode({id:R,depth:1}).then(C=>{a(z=>{const H=new Map(z);for(const B of C.nodes)H.has(B.id)||H.set(B.id,Gr(B));return H}),o(z=>{const H=new Set(z.map(K=>`${K.source}:${K.target}:${K.type}`)),B=[];for(const K of C.edges){const Q=Xd(K),se=`${Q.source}:${Q.target}:${Q.type}`;H.has(se)||B.push(Q)}return[...z,...B]})},()=>{})},[]),A=y.useCallback(R=>!1,[]);return{graphData:{nodes:[...n.values()],links:i},selectedNode:c,selectedId:f,loading:m,searchQuery:g,search:T,clearSearch:w,selectNode:N,clearSelection:k,expandNode:E,loadRecent:S,handleEvent:A}}function Oj(n){const[a,i]=y.useState(""),[o,c]=y.useState(void 0),[u,f]=y.useState({}),{connected:p,send:m}=dj(n,{onMessage:K,onConnect:Q,onDisconnect:se}),v=Sj(),g=kj(),b=jj(),x=Nj(),S=wj(),T=Cj(),w=Ej(),N=Aj(),k=Dj(),E=Mj(),A="default_persona_id",R="onboarding_completed",C=y.useCallback(async ce=>{const q=await ke.setSetting({key:A,value:ce});i(q.value)},[]),z=y.useCallback(()=>{c(!0),ke.setSetting({key:R,value:"true"}).catch(()=>{})},[]),H=y.useCallback((ce,q)=>{ke.getUsage({scope:ce,id:q}).then(ae=>{const O=`${ce}:${q}`;f(G=>({...G,[O]:_j(ae)}))},()=>{})},[]);function B(ce){const q=ce.payload.key,ae=ce.payload.value;if(ce.type==="setting.changed"){q===A&&i(ae??""),q===R&&c(ae==="true");return}if(v.handleEvent(ce)){(ce.type==="environment.removed"||ce.type==="environment.changed")&&g.loadSessions();return}if(!b.handleEvent(ce)){if(x.handleEvent(ce)){ce.type==="task.started"&&g.loadSessions();return}S.handleEvent(ce)||T.handleEvent(ce)||w.handleEvent(ce)||k.handleEvent(ce)||E.handleEvent(ce)}}function K(ce){var q,ae,O,G;if(yT(ce)){B(ce);return}if(!g.handleMessage(ce)&&!((q=g.handleLegacyMessage)!=null&&q.call(g,ce))&&!((ae=v.handleLegacyMessage)!=null&&ae.call(v,ce))&&!((O=x.handleLegacyMessage)!=null&&O.call(x,ce))&&ce.type==="error"){console.error("[ws]",(G=ce.payload)==null?void 0:G.message);return}}function Q(ce){v.loadEnvironments(),g.loadSessions(),b.loadWorkspaces(),T.loadTokens(),w.loadCredentials(),k.loadPersonas(),ke.getSetting({key:A}).then(q=>{i(q.value)},()=>{}),ke.getSetting({key:R}).then(q=>{c(q.value==="true")},()=>{}),x.loadAllTasks(),ce({type:"subscribe_all"})}function se(){b.onDisconnect(),x.onDisconnect()}const ne=y.useCallback(()=>{v.loadEnvironments(),g.loadSessions(),b.loadWorkspaces(),T.loadTokens()},[v.loadEnvironments,g.loadSessions,b.loadWorkspaces,T.loadTokens]);return{connected:p,send:m,environments:v.environments,sessions:g.sessions,events:g.events,eventsDropped:g.eventsDropped,lastSpawnedId:g.lastSpawnedId,workspaces:b.workspaces,tasks:x.tasks,findings:S.findings,tokens:T.tokens,spawn:g.spawn,sendInput:g.sendInput,kill:g.kill,stopGraceful:g.stopGraceful,refresh:ne,loadSessionEvents:g.loadSessionEvents,clearEvents:g.clearEvents,loadWorkspaces:b.loadWorkspaces,createWorkspace:b.createWorkspace,archiveWorkspace:b.archiveWorkspace,updateWorkspace:b.updateWorkspace,loadTasks:x.loadTasks,loadAllTasks:x.loadAllTasks,createTask:x.createTask,startTask:x.startTask,stopTask:x.stopTask,completeTask:x.completeTask,resumeTask:x.resumeTask,updateTask:x.updateTask,deleteTask:x.deleteTask,loadFindings:S.loadFindings,postFinding:S.postFinding,loadEnvironments:v.loadEnvironments,addEnvironment:v.addEnvironment,updateEnvironment:v.updateEnvironment,loadTokens:T.loadTokens,setToken:T.setToken,deleteToken:T.deleteToken,credentialProviders:w.credentialProviders,updateCredentialProviders:w.updateCredentialProviders,provisionStatus:v.provisionStatus,provisionEnvironment:v.provisionEnvironment,stopEnvironment:v.stopEnvironment,removeEnvironment:v.removeEnvironment,codespaces:N.codespaces,codespaceError:N.codespaceError,codespaceListError:N.codespaceListError,codespaceCreating:N.codespaceCreating,listCodespaces:N.listCodespaces,createCodespace:N.createCodespace,workspaceCreating:b.workspaceCreating,taskStartingId:x.taskStartingId,personas:k.personas,createPersona:k.createPersona,updatePersona:k.updatePersona,deletePersona:k.deletePersona,taskSessions:g.taskSessions,loadTaskSessions:g.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:C,onboardingCompleted:o,completeOnboarding:z,usageCache:u,loadUsage:H,knowledge:E}}const ch=y.createContext(void 0);function Bj({children:n}){const a=Oj();return r.jsx(ch.Provider,{value:a,children:n})}function dt(){const n=y.useContext(ch);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const Lj=[{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}],Ij=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation",inputTokens:84200,outputTokens:12750,costUsd:.41},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z",inputTokens:42600,outputTokens:8100,costUsd:.22},{id:"sess-002",environmentId:"env-docker-01",runtime:"claude-code",status:"stopped",endReason:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z",endedAt:"2026-02-27T07:33:00Z",inputTokens:31400,outputTokens:9800,costUsd:.18},{id:"sess-003",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z",endedAt:"2026-02-26T23:10:00Z",inputTokens:56300,outputTokens:14200,costUsd:.31},{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z",inputTokens:18900,outputTokens:4500,costUsd:.1},{id:"sess-005",environmentId:"env-cs-01",runtime:"claude-code",status:"suspended",prompt:"Refactor database connection pooling for multi-tenant isolation",startedAt:"2026-02-27T06:00:00Z",inputTokens:67800,outputTokens:19300,costUsd:.38}],zj=[{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T14:00:01Z",content:"running"},{sessionId:"sess-001-prev",eventType:"output",timestamp:"2026-02-26T14:00:05Z",content:"Reading src/middleware/auth.ts to understand the current authentication flow..."},{sessionId:"sess-001-prev",eventType:"error",timestamp:"2026-02-26T15:12:00Z",content:"Context window exceeded before completing implementation"},{sessionId:"sess-001",eventType:"status",timestamp:"2026-02-27T08:15:01Z",content:"running"},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:02Z",content:"Analyzing current authentication middleware in src/middleware/auth.ts..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:04Z",content:`Found 3 files using session-based auth:
|
|
38
|
-
- src/middleware/auth.ts
|
|
39
|
-
- src/routes/login.ts
|
|
40
|
-
- src/routes/protected.ts`},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:07Z",content:"Installing jsonwebtoken and @types/jsonwebtoken..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:12Z",content:`Rewriting auth middleware:
|
|
41
|
-
\`\`\`typescript
|
|
42
|
-
import jwt from "jsonwebtoken";
|
|
43
|
-
import type { Request, Response, NextFunction } from "express";
|
|
44
|
-
|
|
45
|
-
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
46
|
-
|
|
47
|
-
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
48
|
-
const header = req.headers.authorization;
|
|
49
|
-
if (!header?.startsWith("Bearer ")) {
|
|
50
|
-
res.status(401).json({ error: "Missing token" });
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
try {
|
|
54
|
-
const decoded = jwt.verify(header.slice(7), JWT_SECRET);
|
|
55
|
-
req.user = decoded;
|
|
56
|
-
next();
|
|
57
|
-
} catch {
|
|
58
|
-
res.status(403).json({ error: "Invalid token" });
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
\`\`\``},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:18Z",content:"Updated login route to issue JWT tokens with 24h expiry."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:22Z",content:"Running test suite... 14 tests passed, 2 updated, 0 failed."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:30:05Z",content:"Generating pytest tests for POST /api/register endpoint..."},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:32:00Z",content:"Created 8 test cases covering: valid registration, duplicate email, weak password, missing fields, SQL injection, XSS payload, rate limit, and CORS headers."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"}],Uj=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",environmentId:"env-local-01",status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-01-15T10:00:00Z",updatedAt:"2026-01-15T10:00:00Z"},{id:"proj-beta",name:"Data Pipeline",description:"ETL pipelines for analytics and reporting",repoUrl:"https://github.com/acme/data-pipeline",environmentId:"env-docker-01",status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-02-01T14:30:00Z",updatedAt:"2026-02-01T14:30:00Z"},{id:"proj-gamma",name:"Mobile App",description:"React Native cross-platform mobile application",repoUrl:"",environmentId:"env-local-01",status:"archived",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],Vj=[{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""}],fy=[{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"}],Hj=[{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:""}],Pj=[{id:"persona-arch",name:"Software Architect",description:"Designs system architecture, defines interfaces, and decomposes large features into implementable tasks.",systemPrompt:"You are a senior software architect. Focus on clean interfaces, separation of concerns, and scalable patterns. When decomposing work, create concrete subtasks with clear acceptance criteria.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z",type:"agent",script:"",allowedMcpTools:[]},{id:"persona-fe",name:"Frontend Engineer",description:"React specialist — builds UI components, writes CSS, implements routing, and creates Playwright tests.",systemPrompt:"You are a frontend engineer specializing in React, TypeScript, and modern CSS. Follow component composition patterns, use semantic HTML, and write accessible markup.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z",type:"agent",script:"",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-5-20250929",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z",type:"agent",script:"",allowedMcpTools:[]},{id:"persona-tester",name:"QA Engineer",description:"Writes comprehensive test suites — unit tests, integration tests, and E2E Playwright specs.",systemPrompt:"You are a QA engineer focused on test coverage. Write tests that cover happy paths, edge cases, error scenarios, and accessibility. Use Playwright for E2E tests.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z",type:"agent",script:"",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));
|
|
62
|
-
for (const f of files) {
|
|
63
|
-
const eslintResult = await host.exec("npx", ["eslint", "--fix", f.filename]);
|
|
64
|
-
if (eslintResult.exitCode !== 0) {
|
|
65
|
-
env.findings.push({ category: "lint", title: \`Lint issues in \${f.filename}\`, content: eslintResult.stderr });
|
|
66
|
-
}
|
|
67
|
-
const prettierResult = await host.exec("npx", ["prettier", "--write", f.filename]);
|
|
68
|
-
if (prettierResult.exitCode !== 0) {
|
|
69
|
-
env.findings.push({ category: "format", title: \`Prettier issues in \${f.filename}\`, content: prettierResult.stderr });
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
env.findings.push({ category: "summary", title: "Lint & format pass complete", content: \`Ran ESLint and Prettier on \${files.length} files\` });`,allowedMcpTools:[]}],Gj={"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 qe(n){return new Date(Date.now()+n).toISOString()}const hy=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:qe(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:qe(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:qe(1600),content:`Found 5 endpoints that need refactoring:
|
|
73
|
-
- GET /api/users
|
|
74
|
-
- POST /api/users
|
|
75
|
-
- GET /api/users/:id
|
|
76
|
-
- PUT /api/users/:id
|
|
77
|
-
- DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:qe(2800),content:"Refactoring to use Express Router with middleware chain...\n```typescript\nconst router = Router();\nrouter.use(authenticate);\nrouter.use(validateBody);\n```"}},{delayMs:4e3,event:{eventType:"output",timestamp:qe(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:qe(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:qe(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:qe(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:qe(1400),content:`Found tables to modify:
|
|
78
|
-
- users (add column: last_login_at)
|
|
79
|
-
- sessions (add index on expires_at)
|
|
80
|
-
- audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:qe(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
|
|
81
|
-
The table has 50,000+ rows — this may lock the table briefly.
|
|
82
|
-
|
|
83
|
-
Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:qe(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:qe(1e3),content:`Migration 001_add_last_login.sql applied successfully.
|
|
84
|
-
Migration 002_sessions_index.sql applied successfully.
|
|
85
|
-
Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:qe(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:qe(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:qe(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:qe(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:qe(1800),content:`Writing test cases:
|
|
86
|
-
- should calculate monthly total
|
|
87
|
-
- should apply discount codes
|
|
88
|
-
- should handle currency conversion
|
|
89
|
-
- should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:qe(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
|
|
90
|
-
The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:qe(3500),content:"failed"}}]},{label:"Fix Auth Bug",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:qe(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:qe(600),content:"Let me investigate the authentication bug..."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:qe(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:qe(1800),content:`import jwt from "jsonwebtoken";
|
|
91
|
-
import type { Request, Response, NextFunction } from "express";
|
|
92
|
-
|
|
93
|
-
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
94
|
-
|
|
95
|
-
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
96
|
-
const header = req.headers.authorization;
|
|
97
|
-
if (!header?.startsWith("Bearer ")) {
|
|
98
|
-
res.status(401).json({ error: "Missing token" });
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
try {
|
|
102
|
-
const decoded = jwt.verify(header.slice(7), JWT_SECRET);
|
|
103
|
-
if (decoded.exp > Date.now() / 1000) {
|
|
104
|
-
res.status(403).json({ error: "Token expired" });
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
req.user = decoded;
|
|
108
|
-
next();
|
|
109
|
-
} catch {
|
|
110
|
-
res.status(403).json({ error: "Invalid token" });
|
|
111
|
-
}
|
|
112
|
-
}`,raw:JSON.stringify({tool_use_id:"tool-mock-001",is_error:!1})}},{delayMs:2600,event:{eventType:"text",timestamp:qe(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:qe(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:qe(4e3),content:"File updated successfully",raw:JSON.stringify({tool_use_id:"tool-mock-002",is_error:!1})}},{delayMs:4600,event:{eventType:"tool_use",timestamp:qe(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:qe(5800),content:`[exit 0] > jest --grep auth
|
|
113
|
-
|
|
114
|
-
PASS src/auth.test.ts
|
|
115
|
-
✓ validates JWT token (12ms)
|
|
116
|
-
✓ rejects expired token (3ms)
|
|
117
|
-
✓ handles missing header (1ms)
|
|
118
|
-
|
|
119
|
-
Tests: 3 passed, 3 total
|
|
120
|
-
Time: 1.234s`,raw:JSON.stringify({tool_use_id:"tool-mock-003",is_error:!1})}},{delayMs:6400,event:{eventType:"tool_use",timestamp:qe(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:qe(7e3),content:`src/middleware/auth.ts:14: if (decoded.exp < Date.now() / 1000) {
|
|
121
|
-
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:qe(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:qe(8400),content:JSON.stringify({input_tokens:42600,output_tokens:1850,cost_usd:.12})}},{delayMs:8800,event:{eventType:"status",timestamp:qe(8800),content:"completed"}}]}],py=400;function $j({children:n}){const[a,i]=y.useState(Lj),[o,c]=y.useState(Ij),[u,f]=y.useState(zj),[p,m]=y.useState(void 0),[v,g]=y.useState(Uj),[b,x]=y.useState(Vj),[S,T]=y.useState(fy),[w,N]=y.useState(Hj),[k,E]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[A,R]=y.useState(Pj),[C]=y.useState(Gj),[z,H]=y.useState(""),B=y.useRef(0),K=y.useRef(0),Q=y.useRef(new Set),se=y.useRef(new Map),ne=y.useRef(b);ne.current=b;const ce=y.useRef(new Map),q=y.useRef(new Map),ae=y.useCallback(F=>(B.current+=1,`mock-${F}-${String(B.current).padStart(3,"0")}`),[]),O=y.useCallback(()=>{const F=hy[K.current%hy.length];return K.current+=1,F},[]),G=y.useCallback((F,oe,de)=>{const Ne=setTimeout(()=>{var _e;Q.current.delete(Ne),de&&((_e=se.current.get(de))==null||_e.delete(Ne)),F()},oe);Q.current.add(Ne),de&&(se.current.has(de)||se.current.set(de,new Set),se.current.get(de).add(Ne))},[]),W=y.useCallback(F=>{const oe=se.current.get(F);oe&&(oe.forEach(de=>{clearTimeout(de),Q.current.delete(de)}),se.current.delete(F))},[]),le=y.useCallback((F,oe,de)=>{c(Ne=>Ne.map(_e=>_e.id===F?{..._e,status:oe,...de!==void 0?{endReason:de}:{}}:_e))},[]),re=y.useCallback(F=>{f(oe=>[...oe,F])},[]),Re=y.useCallback((F,oe,de)=>{oe.forEach((Ne,_e)=>{G(()=>{const Ze={sessionId:F,...Ne.event,timestamp:new Date().toISOString()};if(re(Ze),Ne.event.eventType==="status"){const be=eb(Ne.event.content),Qe=tb(Ne.event.content);le(F,be,Qe)}_e===oe.length-1&&de&&de()},Ne.delayMs,F)})},[G,re,le]),we=y.useCallback((F,oe,de,Ne)=>{console.log("[MockGrackle] spawn",{environmentId:F,prompt:oe,runtime:Ne});const _e=ae("sess"),Ze={id:_e,environmentId:F,runtime:Ne||"claude-code",status:"running",prompt:oe,startedAt:new Date().toISOString()};c(Qe=>[...Qe,Ze]),m(_e);const be=O();if(console.log(`[MockGrackle] Playing scenario: ${be.label}`),be.pauseForInput){const Qe=be.pauseAfterStep??be.steps.length-1,Oe=be.steps.slice(0,Qe+1),kt=Oe.length>0?Oe[Oe.length-1].delayMs:0;Re(_e,Oe),G(()=>{le(_e,"idle"),re({sessionId:_e,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},kt+py,_e),be.resumeSteps&&ce.current.set(_e,be.resumeSteps)}else Re(_e,be.steps)},[ae,O,Re,G,le,re]),Te=y.useCallback(F=>{console.log("[MockGrackle] kill",F),W(F),ce.current.delete(F),le(F,"stopped","killed"),re({sessionId:F,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),x(oe=>oe.map(de=>de.latestSessionId===F&&de.status==="working"?{...de,status:"not_started"}:de))},[W,le,re]),Be=y.useCallback(F=>{console.log("[MockGrackle] stopGraceful",F),W(F),ce.current.delete(F),le(F,"stopped","terminated"),re({sessionId:F,eventType:"status",timestamp:new Date().toISOString(),content:"terminated"}),x(oe=>oe.map(de=>de.latestSessionId===F&&de.status==="working"?{...de,status:"not_started"}:de))},[W,le,re]),ue=y.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),ve=y.useCallback(F=>{console.log("[MockGrackle] loadSessionEvents",F)},[]),he=y.useCallback(()=>{console.log("[MockGrackle] clearEvents"),f([])},[]),$e=y.useCallback((F,oe,de,Ne,_e,Ze,be,Qe,Oe)=>{console.log("[MockGrackle] createWorkspace",{name:F,description:oe});const kt={id:ae("proj"),name:F,description:oe||"",repoUrl:de||"",environmentId:Ne||"",status:"active",workingDirectory:be||"",useWorktrees:Ze??!0,defaultPersonaId:_e||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(Rt=>[...Rt,kt]),Qe&&Qe()},[ae]),Ft=y.useCallback(F=>{console.log("[MockGrackle] archiveWorkspace",F),g(oe=>oe.map(de=>de.id===F?{...de,status:"archived"}:de))},[]),te=y.useCallback(F=>{console.log("[MockGrackle] loadTasks",F)},[]),J=y.useCallback((F,oe,de,Ne,_e,Ze,be,Qe,Oe)=>{console.log("[MockGrackle] createTask",{workspaceId:F,title:oe,parentTaskId:_e}),x(kt=>{const Ut=kt.filter(Wt=>Wt.workspaceId===F).reduce((Wt,Ma)=>Math.max(Wt,Ma.sortOrder),0),Mt=_e?kt.find(Wt=>Wt.id===_e):void 0;if(_e&&!Mt)return console.warn("[MockGrackle] Parent task not found:",_e),kt;if(Mt&&!Mt.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",_e),kt;const pt=Mt?Mt.depth+1:0,Un={id:ae("task"),workspaceId:F,title:oe,description:de||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:Ne||[],reviewNotes:void 0,sortOrder:Ut+1,createdAt:new Date().toISOString(),parentTaskId:_e||"",depth:pt,childTaskIds:[],canDecompose:be??!_e,defaultPersonaId:Ze||"",workpad:""};return[...kt,Un]}),Qe&&Qe()},[ae]),Ce=y.useCallback((F,oe,de,Ne)=>{var kt;console.log("[MockGrackle] startTask",{taskId:F});const _e=ne.current.find(Rt=>Rt.id===F),Ze=(_e==null?void 0:_e.title)??"",be=ae("sess"),Qe={id:be,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Ze||F,startedAt:new Date().toISOString()};c(Rt=>[...Rt,Qe]),x(Rt=>Rt.map(Ut=>Ut.id===F?{...Ut,status:"working",latestSessionId:be,branch:`mock/${F.slice(0,8)}`}:Ut));const Oe=O();if(console.log(`[MockGrackle] Playing task scenario: ${Oe.label}`),Oe.pauseForInput){const Rt=Oe.pauseAfterStep??Oe.steps.length-1,Ut=Oe.steps.slice(0,Rt+1),Mt=Ut.length>0?Ut[Ut.length-1].delayMs:0;if(Re(be,Ut),G(()=>{le(be,"idle"),re({sessionId:be,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Mt+py,be),Oe.resumeSteps){const pt=[...Oe.resumeSteps];ce.current.set(be,pt);const Un=pt.reduce((Wt,Ma)=>Math.max(Wt,Ma.delayMs),0);q.current.set(be,{taskId:F,delayAfterResume:Un+200})}}else{const Rt=Oe.steps.length>0?Oe.steps[Oe.steps.length-1].delayMs:0;Re(be,Oe.steps);const Ut=(kt=Oe.steps[Oe.steps.length-1])==null?void 0:kt.event.content;G(()=>{Ut==="completed"?x(Mt=>Mt.map(pt=>pt.id===F&&pt.status==="working"?{...pt,status:"paused"}:pt)):Ut==="failed"&&x(Mt=>Mt.map(pt=>pt.id===F&&pt.status==="working"?{...pt,status:"failed"}:pt))},Rt+100,be)}},[ae,O,Re,G,le,re]),cn=y.useCallback((F,oe)=>{console.log("[MockGrackle] sendInput",{sessionId:F,text:oe}),re({sessionId:F,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${oe}`}),le(F,"running"),re({sessionId:F,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const de=ce.current.get(F);if(de)ce.current.delete(F),Re(F,de);else{const _e=[{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"}}];Re(F,_e)}const Ne=q.current.get(F);Ne&&(q.current.delete(F),G(()=>{x(_e=>_e.map(Ze=>Ze.id===Ne.taskId&&Ze.status==="working"?{...Ze,status:"paused"}:Ze))},Ne.delayAfterResume,F))},[re,le,Re,G]),Ve=y.useCallback(F=>{console.log("[MockGrackle] completeTask",F),x(oe=>oe.map(de=>de.id===F?{...de,status:"complete"}:de))},[]),qn=y.useCallback(F=>{console.log("[MockGrackle] resumeTask",F)},[]),Kn=y.useCallback((F,oe,de,Ne,_e)=>{console.log("[MockGrackle] updateTask",{taskId:F,title:oe}),x(Ze=>Ze.map(be=>be.id===F?{...be,title:oe.trim()||be.title,description:de,dependsOn:Ne,..._e!==void 0?{defaultPersonaId:_e}:{}}:be))},[]),zn=y.useCallback(F=>{console.log("[MockGrackle] deleteTask",F),x(oe=>oe.filter(de=>de.id!==F))},[]),Fn=y.useCallback(F=>{console.log("[MockGrackle] loadFindings",F),T(fy.filter(oe=>oe.workspaceId===F))},[]),Sn=y.useCallback((F,oe,de,Ne,_e)=>{console.log("[MockGrackle] postFinding",{workspaceId:F,title:oe});const Ze={id:ae("find"),workspaceId:F,taskId:"",sessionId:"",category:Ne||"general",title:oe,content:de,tags:_e||[],createdAt:new Date().toISOString()};T(be=>[...be,Ze])},[ae]),Ra=y.useCallback(()=>{console.log("[MockGrackle] loadEnvironments")},[]),un=y.useCallback((F,oe,de)=>{console.log("[MockGrackle] addEnvironment",{displayName:F,adapterType:oe,adapterConfig:de})},[]),Ae=y.useCallback((F,oe)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:F,...oe}),i(de=>de.map(Ne=>Ne.id!==F?Ne:{...Ne,...oe.displayName!==void 0?{displayName:oe.displayName}:{},...oe.adapterConfig!==void 0?{adapterConfig:JSON.stringify(oe.adapterConfig)}:{}}))},[]),Dt=y.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),Yt=y.useCallback((F,oe,de,Ne,_e)=>{console.log("[MockGrackle] setToken",{name:F,tokenType:de}),N(Ze=>[...Ze.filter(Qe=>Qe.name!==F),{name:F,tokenType:de,envVar:Ne,filePath:_e,expiresAt:""}])},[]),jl=y.useCallback(F=>{console.log("[MockGrackle] deleteToken",F),N(oe=>oe.filter(de=>de.name!==F))},[]),eo=y.useCallback(F=>{console.log("[MockGrackle] updateCredentialProviders",F),E(F)},[]);y.useEffect(()=>()=>{Q.current.forEach(clearTimeout),Q.current.clear()},[]);const Nl=y.useMemo(()=>({connected:!0,send:()=>{},environments:a,sessions:o,events:u,eventsDropped:0,lastSpawnedId:p,workspaces:v,tasks:b,findings:S,tokens:w,credentialProviders:k,spawn:we,sendInput:cn,kill:Te,stopGraceful:Be,refresh:ue,loadSessionEvents:ve,clearEvents:he,loadWorkspaces:()=>{console.log("[MockGrackle] loadWorkspaces")},createWorkspace:$e,archiveWorkspace:Ft,updateWorkspace:(F,oe)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:F,...oe}),g(de=>de.map(Ne=>Ne.id!==F?Ne:{...Ne,...oe.name!==void 0?{name:oe.name}:{},...oe.description!==void 0?{description:oe.description}:{},...oe.repoUrl!==void 0?{repoUrl:oe.repoUrl}:{},...oe.environmentId!==void 0?{environmentId:oe.environmentId}:{},...oe.workingDirectory!==void 0?{workingDirectory:oe.workingDirectory}:{},...oe.useWorktrees!==void 0?{useWorktrees:oe.useWorktrees}:{},...oe.defaultPersonaId!==void 0?{defaultPersonaId:oe.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:te,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:J,startTask:Ce,stopTask:F=>{console.log("[MockGrackle] stopTask",{taskId:F}),Ve(F)},completeTask:Ve,resumeTask:qn,updateTask:Kn,deleteTask:zn,loadFindings:Fn,postFinding:Sn,loadEnvironments:Ra,addEnvironment:un,updateEnvironment:Ae,loadTokens:Dt,setToken:Yt,deleteToken:jl,updateCredentialProviders:eo,provisionStatus:{},provisionEnvironment:(F,oe)=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:A,createPersona:async(F,oe,de,Ne,_e,Ze,be,Qe,Oe)=>{console.log("[MockGrackle] createPersona",{name:F});const kt={id:`mock-persona-${Date.now()}`,name:F,description:oe,systemPrompt:de,toolConfig:"{}",runtime:Ne??"claude-code",model:_e||"",maxTurns:Ze||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:be||"agent",script:Qe||"",allowedMcpTools:Oe||[]};return R(Rt=>[...Rt,kt]),kt},updatePersona:async(F,oe,de,Ne,_e,Ze,be,Qe,Oe,kt)=>{console.log("[MockGrackle] updatePersona",{personaId:F,name:oe});const Rt=A.find(pt=>pt.id===F);if(!Rt)throw new Error(`Persona not found: ${F}`);const Ut=new Date().toISOString(),Mt={...Rt,...oe!==void 0?{name:oe}:{},...de!==void 0?{description:de}:{},...Ne!==void 0?{systemPrompt:Ne}:{},..._e!==void 0?{runtime:_e}:{},...Ze!==void 0?{model:Ze}:{},...be!==void 0?{maxTurns:be}:{},...Qe!==void 0?{type:Qe}:{},...Oe!==void 0?{script:Oe}:{},...kt!==void 0?{allowedMcpTools:kt}:{},updatedAt:Ut};return R(pt=>pt.map(Un=>Un.id===F?Mt:Un)),Mt},deletePersona:async F=>{console.log("[MockGrackle] deletePersona",F),R(oe=>oe.filter(de=>de.id!==F))},taskSessions:C,loadTaskSessions:F=>{console.log("[MockGrackle] loadTaskSessions",F)},appDefaultPersonaId:z,setAppDefaultPersonaId:async F=>{console.log("[MockGrackle] setAppDefaultPersonaId",F),H(F)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")},usageCache:{"workspace:proj-alpha":{inputTokens:214500,outputTokens:44850,costUsd:1.12,sessionCount:4},"workspace:proj-beta":{inputTokens:86700,outputTokens:23800,costUsd:.48,sessionCount:3},"task:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1},"task_tree:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task_tree:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1}},loadUsage:(F,oe)=>{console.log(`[MockGrackle] loadUsage(${F}, ${oe})`)},knowledge:{graphData:{nodes:[],links:[]},selectedNode:void 0,loading:!1,selectedId:void 0,searchQuery:"",search:()=>{},clearSearch:()=>{},selectNode:()=>{},clearSelection:()=>{},expandNode:()=>{},loadRecent:()=>{},handleEvent:()=>!1}}),[a,o,u,p,v,b,S,w,k,A,C,z,we,cn,Te,Be,ue,ve,he,$e,Ft,te,J,Ce,Ve,qn,Kn,zn,Fn,Sn,Ra,un,Ae,Dt,Yt,jl,eo]);return r.jsx(ch.Provider,{value:Nl,children:n})}const jb=y.createContext(void 0),qj=4e3;function Kj({children:n}){const[a,i]=y.useState([]),o=y.useRef(0),c=y.useCallback(f=>{i(p=>p.filter(m=>m.id!==f))},[]),u=y.useCallback((f,p="info",m=qj)=>{const v=`toast-${++o.current}`;i(g=>[...g,{id:v,message:f,variant:p,duration:m}])},[]);return r.jsx(jb.Provider,{value:{toasts:a,showToast:u,dismissToast:c},children:n})}function Da(){const n=y.useContext(jb);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const Sc=[{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"]}],Nb=new Set(Sc.map(n=>n.id)),my="grackle";function Ef(n){return Sc.find(a=>a.id===n)}const Af="grackle-theme",wb="grackle-prefer-system",Cb="(prefers-color-scheme: dark)";let el=[],tc;function Qd(){tc=void 0;for(const n of el)n()}function Df(){return typeof window>"u"?!1:window.matchMedia(Cb).matches}function il(){if(typeof localStorage>"u")return my;try{const n=localStorage.getItem(Af);if(n!==null&&Nb.has(n))return n}catch{}return my}function lc(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(wb)==="true"}catch{return!1}}function Rf(n){return Sc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function Eb(n,a){const i=Ef(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?Df()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const o=Rf(n);if(o!=null&&o.variantLightId&&o.variantDarkId)return Df()?o.variantDarkId:o.variantLightId}return n}function Bi(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=Eb(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Bi(il(),lc());function Fj(){return tc===void 0&&(tc={themeId:il(),systemDark:Df(),preferSystem:lc()}),tc}function Yj(n){return el=[...el,n],()=>{el=el.filter(a=>a!==n)}}function Zj(){const n=y.useSyncExternalStore(Yj,Fj),{themeId:a,preferSystem:i}=n,o=Eb(a,i),c=y.useCallback(f=>{if(Nb.has(f)){try{localStorage.setItem(Af,f)}catch{}Bi(f,lc(),!0),Qd()}},[]),u=y.useCallback(f=>{try{localStorage.setItem(wb,f?"true":"false")}catch{}if(f){const p=il(),m=Ef(p);if(m!=null&&m.hidden){const v=Rf(p);if(v)try{localStorage.setItem(Af,v.id)}catch{}}}Bi(il(),f,!0),Qd()},[]);return y.useEffect(()=>{Bi(a,i)},[a,i]),y.useEffect(()=>{if(typeof window>"u")return;const f=window.matchMedia(Cb),p=()=>{const m=il(),v=lc();if(v){const g=Ef(m);if(g!=null&&g.variantDarkId&&g.variantLightId&&Bi(m,v),g!=null&&g.hidden){const b=Rf(m);b!=null&&b.variantDarkId&&b.variantLightId&&Bi(m,v)}}Qd()};return f.addEventListener("change",p),()=>{f.removeEventListener("change",p)}},[]),{themeId:a,setTheme:c,resolvedThemeId:o,preferSystem:i,setPreferSystem:u}}const Ab=y.createContext(void 0);function Xj({children:n}){const a=Zj();return r.jsx(Ab.Provider,{value:a,children:n})}function Db(){const n=y.useContext(Ab);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const Wj="_container_1mq5u_1",Qj="_hamburger_1mq5u_33",Jj="_brand_1mq5u_49",eN="_brandLogo_1mq5u_68",tN="_info_1mq5u_75",nN="_connectionLabel_1mq5u_90",aN="_connectionDot_1mq5u_103",sN="_connected_1mq5u_106",iN="_disconnected_1mq5u_110",Sa={container:Wj,hamburger:Qj,brand:Jj,brandLogo:eN,info:tN,connectionLabel:nN,connectionDot:aN,connected:sN,disconnected:iN};function oN({connected:n,environments:a,sessions:i,onToggleSidebar:o,sidebarOpen:c}){const u=xt(),f=a.length,p=a.filter(v=>v.status==="connected").length,m=i.filter(v=>["running","idle"].includes(v.status)).length;return r.jsxs("div",{className:Sa.container,children:[o&&r.jsx("button",{type:"button",className:Sa.hamburger,onClick:o,"aria-label":"Toggle sidebar","aria-expanded":c,children:"☰"}),r.jsxs("button",{type:"button",className:Sa.brand,onClick:()=>u(Ps),title:"Home",children:[r.jsx("img",{src:"/icon-192x192.png",alt:"",className:Sa.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),r.jsxs("div",{className:Sa.info,children:[r.jsxs("span",{"aria-label":n?"Connected":"Disconnected",children:[r.jsx("span",{className:`${Sa.connectionDot} ${n?Sa.connected:Sa.disconnected}`,"aria-hidden":"true",children:"●"})," ",r.jsx("span",{className:Sa.connectionLabel,"aria-hidden":"true",children:n?"Connected":"Disconnected"})]}),r.jsxs("span",{children:[p,"/",f," env",f!==1?"s":""]}),r.jsxs("span",{children:[m," active"]})]})]})}const lN="_nav_13gkc_1",rN="_tab_13gkc_35",cN="_tabIcon_13gkc_68",uN="_tabLabel_13gkc_79",dN="_tabActive_13gkc_84",Xo={nav:lN,tab:rN,tabIcon:cN,tabLabel:uN,tabActive:dN},Ds=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:Ps,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:cj,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:uj,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:$i,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:"🧠",route:kb,testId:"sidebar-tab-knowledge"},{view:"settings",label:"Settings",icon:"⚙️",route:ij,testId:"sidebar-tab-settings"}];function fN(n){return n===Ps||n==="/"?"dashboard":n.startsWith("/chat")||n.startsWith("/sessions")?"chat":n.startsWith("/workspaces")||n.startsWith("/environments")?"environments":n.startsWith(kb)?"knowledge":n.startsWith(Pi)?"settings":"tasks"}function hN(){const n=Lt(),a=xt(),i=y.useRef(null),o=fN(n.pathname),c=y.useCallback(f=>{a(f.route)},[a]),u=y.useCallback(f=>{var b,x;const p=(b=i.current)==null?void 0:b.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),v=m>=0?m:Ds.findIndex(S=>S.view===o);let g=v;if(f.key==="ArrowRight"||f.key==="j"||f.key==="J")f.preventDefault(),g=(v+1)%Ds.length;else if(f.key==="ArrowLeft"||f.key==="k"||f.key==="K")f.preventDefault(),g=(v-1+Ds.length)%Ds.length;else if(f.key==="Home")f.preventDefault(),g=0;else if(f.key==="End")f.preventDefault(),g=Ds.length-1;else return;a(Ds[g].route),(x=p[g])==null||x.focus()},[o,a]);return r.jsx("nav",{className:Xo.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:u,"data-testid":"sidebar-nav",children:Ds.map(f=>{const p=f.view===o;return r.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Xo.tab} ${p?Xo.tabActive:""}`,onClick:()=>c(f),"data-testid":f.testId,title:f.label,"aria-label":f.label,children:[r.jsx("span",{className:Xo.tabIcon,"aria-hidden":"true",children:f.icon}),r.jsx("span",{className:Xo.tabLabel,children:f.label})]},f.view)})})}const Rb=y.createContext(void 0),Mb=y.createContext(void 0);function pN({children:n}){const[a,i]=y.useState(void 0),o=y.useCallback(c=>{i(c)},[]);return r.jsx(Mb.Provider,{value:o,children:r.jsx(Rb.Provider,{value:a,children:n})})}function Ob(){return y.useContext(Rb)}function mN(){const n=y.useContext(Mb);if(n===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return n}const vN="_container_pi6ii_1",gN="_content_pi6ii_66",vy={container:vN,content:gN},yN=320,Bb=220,Lb=600,Ib="grackle-sidebar-width";function bN(){try{const n=localStorage.getItem(Ib);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=Bb&&a<=Lb)return a}}catch{}return yN}function xN(n){try{localStorage.setItem(Ib,String(n))}catch{}}function _N(){const[n]=y.useState(bN),a=y.useRef(null),i=Ob();if(y.useEffect(()=>{const o=a.current;if(!o)return;const c=new ResizeObserver(u=>{for(const f of u){const p=f.borderBoxSize[0];if(p){const m=Math.round(p.inlineSize);m>=Bb&&m<=Lb&&xN(m)}}});return c.observe(o),()=>{c.disconnect()}},[]),i!==void 0)return r.jsx("div",{className:vy.container,ref:a,"data-testid":"sidebar",style:{width:n},children:r.jsx("div",{className:vy.content,children:i})})}function Tc(n){const a=mN();y.useLayoutEffect(()=>(a(n),()=>{a(void 0)}),[n,a])}const uh=y.createContext({});function dh(n){const a=y.useRef(null);return a.current===null&&(a.current=n()),a.current}const kc=y.createContext(null),fh=y.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class SN extends y.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=i.offsetHeight||0,o.width=i.offsetWidth||0,o.top=i.offsetTop,o.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function TN({children:n,isPresent:a}){const i=y.useId(),o=y.useRef(null),c=y.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=y.useContext(fh);return y.useInsertionEffect(()=>{const{width:f,height:p,top:m,left:v}=c.current;if(a||!o.current||!f||!p)return;o.current.dataset.motionPopId=i;const g=document.createElement("style");return u&&(g.nonce=u),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(`
|
|
122
|
-
[data-motion-pop-id="${i}"] {
|
|
123
|
-
position: absolute !important;
|
|
124
|
-
width: ${f}px !important;
|
|
125
|
-
height: ${p}px !important;
|
|
126
|
-
top: ${m}px !important;
|
|
127
|
-
left: ${v}px !important;
|
|
128
|
-
}
|
|
129
|
-
`),()=>{document.head.removeChild(g)}},[a]),r.jsx(SN,{isPresent:a,childRef:o,sizeRef:c,children:y.cloneElement(n,{ref:o})})}const kN=({children:n,initial:a,isPresent:i,onExitComplete:o,custom:c,presenceAffectsLayout:u,mode:f})=>{const p=dh(jN),m=y.useId(),v=y.useCallback(b=>{p.set(b,!0);for(const x of p.values())if(!x)return;o&&o()},[p,o]),g=y.useMemo(()=>({id:m,initial:a,isPresent:i,custom:c,onExitComplete:v,register:b=>(p.set(b,!1),()=>p.delete(b))}),u?[Math.random(),v]:[i,v]);return y.useMemo(()=>{p.forEach((b,x)=>p.set(x,!1))},[i]),y.useEffect(()=>{!i&&!p.size&&o&&o()},[i]),f==="popLayout"&&(n=r.jsx(TN,{isPresent:i,children:n})),r.jsx(kc.Provider,{value:g,children:n})};function jN(){return new Map}function zb(n=!0){const a=y.useContext(kc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:o,register:c}=a,u=y.useId();y.useEffect(()=>{n&&c(u)},[n]);const f=y.useCallback(()=>n&&o&&o(u),[u,o,n]);return!i&&o?[!1,f]:[!0]}const $r=n=>n.key||"";function gy(n){const a=[];return y.Children.forEach(n,i=>{y.isValidElement(i)&&a.push(i)}),a}const hh=typeof window<"u",Ub=hh?y.useLayoutEffect:y.useEffect,aa=({children:n,custom:a,initial:i=!0,onExitComplete:o,presenceAffectsLayout:c=!0,mode:u="sync",propagate:f=!1})=>{const[p,m]=zb(f),v=y.useMemo(()=>gy(n),[n]),g=f&&!p?[]:v.map($r),b=y.useRef(!0),x=y.useRef(v),S=dh(()=>new Map),[T,w]=y.useState(v),[N,k]=y.useState(v);Ub(()=>{b.current=!1,x.current=v;for(let R=0;R<N.length;R++){const C=$r(N[R]);g.includes(C)?S.delete(C):S.get(C)!==!0&&S.set(C,!1)}},[N,g.length,g.join("-")]);const E=[];if(v!==T){let R=[...v];for(let C=0;C<N.length;C++){const z=N[C],H=$r(z);g.includes(H)||(R.splice(C,0,z),E.push(z))}u==="wait"&&E.length&&(R=E),k(gy(R)),w(v);return}const{forceRender:A}=y.useContext(uh);return r.jsx(r.Fragment,{children:N.map(R=>{const C=$r(R),z=f&&!p?!1:v===N||g.includes(C),H=()=>{if(S.has(C))S.set(C,!0);else return;let B=!0;S.forEach(K=>{K||(B=!1)}),B&&(A==null||A(),k(x.current),f&&(m==null||m()),o&&o())};return r.jsx(kN,{isPresent:z,initial:!b.current||i?void 0:!1,custom:z?void 0:a,presenceAffectsLayout:c,mode:u,onExitComplete:z?void 0:H,children:R},C)})})},bn=n=>n;let Vb=bn;const NN={useManualTiming:!1};function wN(n){let a=new Set,i=new Set,o=!1,c=!1;const u=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function p(v){u.has(v)&&(m.schedule(v),n()),v(f)}const m={schedule:(v,g=!1,b=!1)=>{const S=b&&o?a:i;return g&&u.add(v),S.has(v)||S.add(v),v},cancel:v=>{i.delete(v),u.delete(v)},process:v=>{if(f=v,o){c=!0;return}o=!0,[a,i]=[i,a],a.forEach(p),a.clear(),o=!1,c&&(c=!1,m.process(v))}};return m}const qr=["read","resolveKeyframes","update","preRender","render","postRender"],CN=40;function Hb(n,a){let i=!1,o=!0;const c={delta:0,timestamp:0,isProcessing:!1},u=()=>i=!0,f=qr.reduce((k,E)=>(k[E]=wN(u),k),{}),{read:p,resolveKeyframes:m,update:v,preRender:g,render:b,postRender:x}=f,S=()=>{const k=performance.now();i=!1,c.delta=o?1e3/60:Math.max(Math.min(k-c.timestamp,CN),1),c.timestamp=k,c.isProcessing=!0,p.process(c),m.process(c),v.process(c),g.process(c),b.process(c),x.process(c),c.isProcessing=!1,i&&a&&(o=!1,n(S))},T=()=>{i=!0,o=!0,c.isProcessing||n(S)};return{schedule:qr.reduce((k,E)=>{const A=f[E];return k[E]=(R,C=!1,z=!1)=>(i||T(),A.schedule(R,C,z)),k},{}),cancel:k=>{for(let E=0;E<qr.length;E++)f[qr[E]].cancel(k)},state:c,steps:f}}const{schedule:ut,cancel:rs,state:qt,steps:Jd}=Hb(typeof requestAnimationFrame<"u"?requestAnimationFrame:bn,!0),Pb=y.createContext({strict:!1}),yy={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"]},Ki={};for(const n in yy)Ki[n]={isEnabled:a=>yy[n].some(i=>!!a[i])};function EN(n){for(const a in n)Ki[a]={...Ki[a],...n[a]}}const AN=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 rc(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||AN.has(n)}let Gb=n=>!rc(n);function DN(n){n&&(Gb=a=>a.startsWith("on")?!rc(a):n(a))}try{DN(require("@emotion/is-prop-valid").default)}catch{}function RN(n,a,i){const o={};for(const c in n)c==="values"&&typeof n.values=="object"||(Gb(c)||i===!0&&rc(c)||!a&&!rc(c)||n.draggable&&c.startsWith("onDrag"))&&(o[c]=n[c]);return o}function MN(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...o)=>n(...o);return new Proxy(i,{get:(o,c)=>c==="create"?n:(a.has(c)||a.set(c,n(c)),a.get(c))})}const jc=y.createContext({});function hl(n){return typeof n=="string"||Array.isArray(n)}function Nc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const ph=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mh=["initial",...ph];function wc(n){return Nc(n.animate)||mh.some(a=>hl(n[a]))}function $b(n){return!!(wc(n)||n.variants)}function ON(n,a){if(wc(n)){const{initial:i,animate:o}=n;return{initial:i===!1||hl(i)?i:void 0,animate:hl(o)?o:void 0}}return n.inherit!==!1?a:{}}function BN(n){const{initial:a,animate:i}=ON(n,y.useContext(jc));return y.useMemo(()=>({initial:a,animate:i}),[by(a),by(i)])}function by(n){return Array.isArray(n)?n.join(" "):n}const LN=Symbol.for("motionComponentSymbol");function Li(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function IN(n,a,i){return y.useCallback(o=>{o&&n.onMount&&n.onMount(o),a&&(o?a.mount(o):a.unmount()),i&&(typeof i=="function"?i(o):Li(i)&&(i.current=o))},[a])}const vh=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),zN="framerAppearId",qb="data-"+vh(zN),{schedule:gh}=Hb(queueMicrotask,!1),Kb=y.createContext({});function UN(n,a,i,o,c){var u,f;const{visualElement:p}=y.useContext(jc),m=y.useContext(Pb),v=y.useContext(kc),g=y.useContext(fh).reducedMotion,b=y.useRef(null);o=o||m.renderer,!b.current&&o&&(b.current=o(n,{visualState:a,parent:p,props:i,presenceContext:v,blockInitialAnimation:v?v.initial===!1:!1,reducedMotionConfig:g}));const x=b.current,S=y.useContext(Kb);x&&!x.projection&&c&&(x.type==="html"||x.type==="svg")&&VN(b.current,i,c,S);const T=y.useRef(!1);y.useInsertionEffect(()=>{x&&T.current&&x.update(i,v)});const w=i[qb],N=y.useRef(!!w&&!(!((u=window.MotionHandoffIsComplete)===null||u===void 0)&&u.call(window,w))&&((f=window.MotionHasOptimisedAnimation)===null||f===void 0?void 0:f.call(window,w)));return Ub(()=>{x&&(T.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),gh.render(x.render),N.current&&x.animationState&&x.animationState.animateChanges())}),y.useEffect(()=>{x&&(!N.current&&x.animationState&&x.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)===null||k===void 0||k.call(window,w)}),N.current=!1))}),x}function VN(n,a,i,o){const{layoutId:c,layout:u,drag:f,dragConstraints:p,layoutScroll:m,layoutRoot:v}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:Fb(n.parent)),n.projection.setOptions({layoutId:c,layout:u,alwaysMeasureLayout:!!f||p&&Li(p),visualElement:n,animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:m,layoutRoot:v})}function Fb(n){if(n)return n.options.allowProjection!==!1?n.projection:Fb(n.parent)}function HN({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:o,Component:c}){var u,f;n&&EN(n);function p(v,g){let b;const x={...y.useContext(fh),...v,layoutId:PN(v)},{isStatic:S}=x,T=BN(v),w=o(v,S);if(!S&&hh){GN();const N=$N(x);b=N.MeasureLayout,T.visualElement=UN(c,w,x,a,N.ProjectionNode)}return r.jsxs(jc.Provider,{value:T,children:[b&&T.visualElement?r.jsx(b,{visualElement:T.visualElement,...x}):null,i(c,v,IN(w,T.visualElement,g),w,S,T.visualElement)]})}p.displayName=`motion.${typeof c=="string"?c:`create(${(f=(u=c.displayName)!==null&&u!==void 0?u:c.name)!==null&&f!==void 0?f:""})`}`;const m=y.forwardRef(p);return m[LN]=c,m}function PN({layoutId:n}){const a=y.useContext(uh).id;return a&&n!==void 0?a+"-"+n:n}function GN(n,a){y.useContext(Pb).strict}function $N(n){const{drag:a,layout:i}=Ki;if(!a&&!i)return{};const o={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(n)||i!=null&&i.isEnabled(n)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const qN=["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 yh(n){return typeof n!="string"||n.includes("-")?!1:!!(qN.indexOf(n)>-1||/[A-Z]/u.test(n))}function xy(n){const a=[{},{}];return n==null||n.values.forEach((i,o)=>{a[0][o]=i.get(),a[1][o]=i.getVelocity()}),a}function bh(n,a,i,o){if(typeof a=="function"){const[c,u]=xy(o);a=a(i!==void 0?i:n.custom,c,u)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[c,u]=xy(o);a=a(i!==void 0?i:n.custom,c,u)}return a}const Mf=n=>Array.isArray(n),KN=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),FN=n=>Mf(n)?n[n.length-1]||0:n,Xt=n=>!!(n&&n.getVelocity);function nc(n){const a=Xt(n)?n.get():n;return KN(a)?a.toValue():a}function YN({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},o,c,u){const f={latestValues:ZN(o,c,u,n),renderState:a()};return i&&(f.onMount=p=>i({props:o,current:p,...f}),f.onUpdate=p=>i(p)),f}const Yb=n=>(a,i)=>{const o=y.useContext(jc),c=y.useContext(kc),u=()=>YN(n,a,o,c);return i?u():dh(u)};function ZN(n,a,i,o){const c={},u=o(n,{});for(const x in u)c[x]=nc(u[x]);let{initial:f,animate:p}=n;const m=wc(n),v=$b(n);a&&v&&!m&&n.inherit!==!1&&(f===void 0&&(f=a.initial),p===void 0&&(p=a.animate));let g=i?i.initial===!1:!1;g=g||f===!1;const b=g?p:f;if(b&&typeof b!="boolean"&&!Nc(b)){const x=Array.isArray(b)?b:[b];for(let S=0;S<x.length;S++){const T=bh(n,x[S]);if(T){const{transitionEnd:w,transition:N,...k}=T;for(const E in k){let A=k[E];if(Array.isArray(A)){const R=g?A.length-1:0;A=A[R]}A!==null&&(c[E]=A)}for(const E in w)c[E]=w[E]}}}return c}const Qi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ys=new Set(Qi),Zb=n=>a=>typeof a=="string"&&a.startsWith(n),Xb=Zb("--"),XN=Zb("var(--"),xh=n=>XN(n)?WN.test(n.split("/*")[0].trim()):!1,WN=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Wb=(n,a)=>a&&typeof n=="number"?a.transform(n):n,Aa=(n,a,i)=>i>a?a:i<n?n:i,Ji={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},pl={...Ji,transform:n=>Aa(0,1,n)},Kr={...Ji,default:1},_l=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),ls=_l("deg"),ea=_l("%"),Se=_l("px"),QN=_l("vh"),JN=_l("vw"),_y={...ea,parse:n=>ea.parse(n)/100,transform:n=>ea.transform(n*100)},ew={borderWidth:Se,borderTopWidth:Se,borderRightWidth:Se,borderBottomWidth:Se,borderLeftWidth:Se,borderRadius:Se,radius:Se,borderTopLeftRadius:Se,borderTopRightRadius:Se,borderBottomRightRadius:Se,borderBottomLeftRadius:Se,width:Se,maxWidth:Se,height:Se,maxHeight:Se,top:Se,right:Se,bottom:Se,left:Se,padding:Se,paddingTop:Se,paddingRight:Se,paddingBottom:Se,paddingLeft:Se,margin:Se,marginTop:Se,marginRight:Se,marginBottom:Se,marginLeft:Se,backgroundPositionX:Se,backgroundPositionY:Se},tw={rotate:ls,rotateX:ls,rotateY:ls,rotateZ:ls,scale:Kr,scaleX:Kr,scaleY:Kr,scaleZ:Kr,skew:ls,skewX:ls,skewY:ls,distance:Se,translateX:Se,translateY:Se,translateZ:Se,x:Se,y:Se,z:Se,perspective:Se,transformPerspective:Se,opacity:pl,originX:_y,originY:_y,originZ:Se},Sy={...Ji,transform:Math.round},_h={...ew,...tw,zIndex:Sy,size:Se,fillOpacity:pl,strokeOpacity:pl,numOctaves:Sy},nw={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},aw=Qi.length;function sw(n,a,i){let o="",c=!0;for(let u=0;u<aw;u++){const f=Qi[u],p=n[f];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(f.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const v=Wb(p,_h[f]);if(!m){c=!1;const g=nw[f]||f;o+=`${g}(${v}) `}i&&(a[f]=v)}}return o=o.trim(),i?o=i(a,c?"":o):c&&(o="none"),o}function Sh(n,a,i){const{style:o,vars:c,transformOrigin:u}=n;let f=!1,p=!1;for(const m in a){const v=a[m];if(Ys.has(m)){f=!0;continue}else if(Xb(m)){c[m]=v;continue}else{const g=Wb(v,_h[m]);m.startsWith("origin")?(p=!0,u[m]=g):o[m]=g}}if(a.transform||(f||i?o.transform=sw(a,n.transform,i):o.transform&&(o.transform="none")),p){const{originX:m="50%",originY:v="50%",originZ:g=0}=u;o.transformOrigin=`${m} ${v} ${g}`}}const iw={offset:"stroke-dashoffset",array:"stroke-dasharray"},ow={offset:"strokeDashoffset",array:"strokeDasharray"};function lw(n,a,i=1,o=0,c=!0){n.pathLength=1;const u=c?iw:ow;n[u.offset]=Se.transform(-o);const f=Se.transform(a),p=Se.transform(i);n[u.array]=`${f} ${p}`}function Ty(n,a,i){return typeof n=="string"?n:Se.transform(a+i*n)}function rw(n,a,i){const o=Ty(a,n.x,n.width),c=Ty(i,n.y,n.height);return`${o} ${c}`}function Th(n,{attrX:a,attrY:i,attrScale:o,originX:c,originY:u,pathLength:f,pathSpacing:p=1,pathOffset:m=0,...v},g,b){if(Sh(n,v,b),g){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:x,style:S,dimensions:T}=n;x.transform&&(T&&(S.transform=x.transform),delete x.transform),T&&(c!==void 0||u!==void 0||S.transform)&&(S.transformOrigin=rw(T,c!==void 0?c:.5,u!==void 0?u:.5)),a!==void 0&&(x.x=a),i!==void 0&&(x.y=i),o!==void 0&&(x.scale=o),f!==void 0&&lw(x,f,p,m,!1)}const kh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Qb=()=>({...kh(),attrs:{}}),jh=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Jb(n,{style:a,vars:i},o,c){Object.assign(n.style,a,c&&c.getProjectionStyles(o));for(const u in i)n.style.setProperty(u,i[u])}const ex=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function tx(n,a,i,o){Jb(n,a,void 0,o);for(const c in a.attrs)n.setAttribute(ex.has(c)?c:vh(c),a.attrs[c])}const cc={};function cw(n){Object.assign(cc,n)}function nx(n,{layout:a,layoutId:i}){return Ys.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!cc[n]||n==="opacity")}function Nh(n,a,i){var o;const{style:c}=n,u={};for(const f in c)(Xt(c[f])||a.style&&Xt(a.style[f])||nx(f,n)||((o=i==null?void 0:i.getValue(f))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(u[f]=c[f]);return u}function ax(n,a,i){const o=Nh(n,a,i);for(const c in n)if(Xt(n[c])||Xt(a[c])){const u=Qi.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;o[u]=n[c]}return o}function uw(n,a){try{a.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}}const ky=["x","y","width","height","cx","cy","r"],dw={useVisualState:Yb({scrapeMotionValuesFromProps:ax,createRenderState:Qb,onUpdate:({props:n,prevProps:a,current:i,renderState:o,latestValues:c})=>{if(!i)return;let u=!!n.drag;if(!u){for(const p in c)if(Ys.has(p)){u=!0;break}}if(!u)return;let f=!a;if(a)for(let p=0;p<ky.length;p++){const m=ky[p];n[m]!==a[m]&&(f=!0)}f&&ut.read(()=>{uw(i,o),ut.render(()=>{Th(o,c,jh(i.tagName),n.transformTemplate),tx(i,o)})})}})},fw={useVisualState:Yb({scrapeMotionValuesFromProps:Nh,createRenderState:kh})};function sx(n,a,i){for(const o in a)!Xt(a[o])&&!nx(o,i)&&(n[o]=a[o])}function hw({transformTemplate:n},a){return y.useMemo(()=>{const i=kh();return Sh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function pw(n,a){const i=n.style||{},o={};return sx(o,i,n),Object.assign(o,hw(n,a)),o}function mw(n,a){const i={},o=pw(n,a);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=o,i}function vw(n,a,i,o){const c=y.useMemo(()=>{const u=Qb();return Th(u,a,jh(o),n.transformTemplate),{...u.attrs,style:{...u.style}}},[a]);if(n.style){const u={};sx(u,n.style,n),c.style={...u,...c.style}}return c}function gw(n=!1){return(i,o,c,{latestValues:u},f)=>{const m=(yh(i)?vw:mw)(o,u,f,i),v=RN(o,typeof i=="string",n),g=i!==y.Fragment?{...v,...m,ref:c}:{},{children:b}=o,x=y.useMemo(()=>Xt(b)?b.get():b,[b]);return y.createElement(i,{...g,children:x})}}function yw(n,a){return function(o,{forwardMotionProps:c}={forwardMotionProps:!1}){const f={...yh(o)?dw:fw,preloadedFeatures:n,useRender:gw(c),createVisualElement:a,Component:o};return HN(f)}}function ix(n,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==n.length)return!1;for(let o=0;o<i;o++)if(a[o]!==n[o])return!1;return!0}function Cc(n,a,i){const o=n.getProps();return bh(o,a,i!==void 0?i:o.custom,n)}function wh(n,a){return n?n[a]||n.default||n:void 0}const ox=new Set(["width","height","top","left","right","bottom",...Qi]);let ac;function bw(){ac=void 0}const ta={now:()=>(ac===void 0&&ta.set(qt.isProcessing||NN.useManualTiming?qt.timestamp:performance.now()),ac),set:n=>{ac=n,queueMicrotask(bw)}};function Ch(n,a){n.indexOf(a)===-1&&n.push(a)}function Eh(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class Ah{constructor(){this.subscriptions=[]}add(a){return Ch(this.subscriptions,a),()=>Eh(this.subscriptions,a)}notify(a,i,o){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](a,i,o);else for(let u=0;u<c;u++){const f=this.subscriptions[u];f&&f(a,i,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function lx(n,a){return a?n*(1e3/a):0}const jy=30,xw=n=>!isNaN(parseFloat(n));class _w{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,c=!0)=>{const u=ta.now();this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),c&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=ta.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=xw(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,i){this.events[a]||(this.events[a]=new Ah);const o=this.events[a].add(i);return a==="change"?()=>{o(),ut.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,i){this.passiveEffect=a,this.stopPassiveEffect=i}set(a,i=!0){!i||!this.passiveEffect?this.updateAndNotify(a,i):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,i,o){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-o}jump(a,i=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=ta.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>jy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,jy);return lx(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(a){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=a(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ml(n,a){return new _w(n,a)}function Sw(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,ml(i))}function Tw(n,a){const i=Cc(n,a);let{transitionEnd:o={},transition:c={},...u}=i||{};u={...u,...o};for(const f in u){const p=FN(u[f]);Sw(n,f,p)}}function kw(n){return!!(Xt(n)&&n.add)}function Of(n,a){const i=n.getValue("willChange");if(kw(i))return i.add(a)}function rx(n){return n.props[qb]}function Dh(n){let a;return()=>(a===void 0&&(a=n()),a)}const jw=Dh(()=>window.ScrollTimeline!==void 0);class Nw{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}get finished(){return Promise.all(this.animations.map(a=>"finished"in a?a.finished:a))}getAll(a){return this.animations[0][a]}setAll(a,i){for(let o=0;o<this.animations.length;o++)this.animations[o][a]=i}attachTimeline(a,i){const o=this.animations.map(c=>{if(jw()&&c.attachTimeline)return c.attachTimeline(a);if(typeof i=="function")return i(c)});return()=>{o.forEach((c,u)=>{c&&c(),this.animations[u].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let i=0;i<this.animations.length;i++)a=Math.max(a,this.animations[i].duration);return a}runAll(a){this.animations.forEach(i=>i[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ww extends Nw{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const Na=n=>n*1e3,wa=n=>n/1e3;function Rh(n){return typeof n=="function"}function Ny(n,a){n.timeline=a,n.onfinish=null}const Mh=n=>Array.isArray(n)&&typeof n[0]=="number",Cw={linearEasing:void 0};function Ew(n,a){const i=Dh(n);return()=>{var o;return(o=Cw[a])!==null&&o!==void 0?o:i()}}const uc=Ew(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Fi=(n,a,i)=>{const o=a-n;return o===0?1:(i-n)/o},cx=(n,a,i=10)=>{let o="";const c=Math.max(Math.round(a/i),2);for(let u=0;u<c;u++)o+=n(Fi(0,c-1,u))+", ";return`linear(${o.substring(0,o.length-2)})`};function ux(n){return!!(typeof n=="function"&&uc()||!n||typeof n=="string"&&(n in Bf||uc())||Mh(n)||Array.isArray(n)&&n.every(ux))}const tl=([n,a,i,o])=>`cubic-bezier(${n}, ${a}, ${i}, ${o})`,Bf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tl([0,.65,.55,1]),circOut:tl([.55,0,1,.45]),backIn:tl([.31,.01,.66,-.59]),backOut:tl([.33,1.53,.69,.99])};function dx(n,a){if(n)return typeof n=="function"&&uc()?cx(n,a):Mh(n)?tl(n):Array.isArray(n)?n.map(i=>dx(i,a)||Bf.easeOut):Bf[n]}const fx=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,Aw=1e-7,Dw=12;function Rw(n,a,i,o,c){let u,f,p=0;do f=a+(i-a)/2,u=fx(f,o,c)-n,u>0?i=f:a=f;while(Math.abs(u)>Aw&&++p<Dw);return f}function Sl(n,a,i,o){if(n===a&&i===o)return bn;const c=u=>Rw(u,0,1,n,i);return u=>u===0||u===1?u:fx(c(u),a,o)}const hx=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,px=n=>a=>1-n(1-a),mx=Sl(.33,1.53,.69,.99),Oh=px(mx),vx=hx(Oh),gx=n=>(n*=2)<1?.5*Oh(n):.5*(2-Math.pow(2,-10*(n-1))),Bh=n=>1-Math.sin(Math.acos(n)),yx=px(Bh),bx=hx(Bh),xx=n=>/^0[^.\s]+$/u.test(n);function Mw(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||xx(n):!0}const ol=n=>Math.round(n*1e5)/1e5,Lh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ow(n){return n==null}const Bw=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ih=(n,a)=>i=>!!(typeof i=="string"&&Bw.test(i)&&i.startsWith(n)||a&&!Ow(i)&&Object.prototype.hasOwnProperty.call(i,a)),_x=(n,a,i)=>o=>{if(typeof o!="string")return o;const[c,u,f,p]=o.match(Lh);return{[n]:parseFloat(c),[a]:parseFloat(u),[i]:parseFloat(f),alpha:p!==void 0?parseFloat(p):1}},Lw=n=>Aa(0,255,n),ef={...Ji,transform:n=>Math.round(Lw(n))},zs={test:Ih("rgb","red"),parse:_x("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:o=1})=>"rgba("+ef.transform(n)+", "+ef.transform(a)+", "+ef.transform(i)+", "+ol(pl.transform(o))+")"};function Iw(n){let a="",i="",o="",c="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),o=n.substring(5,7),c=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),o=n.substring(3,4),c=n.substring(4,5),a+=a,i+=i,o+=o,c+=c),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:c?parseInt(c,16)/255:1}}const Lf={test:Ih("#"),parse:Iw,transform:zs.transform},Ii={test:Ih("hsl","hue"),parse:_x("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:o=1})=>"hsla("+Math.round(n)+", "+ea.transform(ol(a))+", "+ea.transform(ol(i))+", "+ol(pl.transform(o))+")"},Zt={test:n=>zs.test(n)||Lf.test(n)||Ii.test(n),parse:n=>zs.test(n)?zs.parse(n):Ii.test(n)?Ii.parse(n):Lf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?zs.transform(n):Ii.transform(n)},zw=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Uw(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(Lh))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(zw))===null||i===void 0?void 0:i.length)||0)>0}const Sx="number",Tx="color",Vw="var",Hw="var(",wy="${}",Pw=/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 vl(n){const a=n.toString(),i=[],o={color:[],number:[],var:[]},c=[];let u=0;const p=a.replace(Pw,m=>(Zt.test(m)?(o.color.push(u),c.push(Tx),i.push(Zt.parse(m))):m.startsWith(Hw)?(o.var.push(u),c.push(Vw),i.push(m)):(o.number.push(u),c.push(Sx),i.push(parseFloat(m))),++u,wy)).split(wy);return{values:i,split:p,indexes:o,types:c}}function kx(n){return vl(n).values}function jx(n){const{split:a,types:i}=vl(n),o=a.length;return c=>{let u="";for(let f=0;f<o;f++)if(u+=a[f],c[f]!==void 0){const p=i[f];p===Sx?u+=ol(c[f]):p===Tx?u+=Zt.transform(c[f]):u+=c[f]}return u}}const Gw=n=>typeof n=="number"?0:n;function $w(n){const a=kx(n);return jx(n)(a.map(Gw))}const cs={test:Uw,parse:kx,createTransformer:jx,getAnimatableNone:$w},qw=new Set(["brightness","contrast","saturate","opacity"]);function Kw(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[o]=i.match(Lh)||[];if(!o)return n;const c=i.replace(o,"");let u=qw.has(a)?1:0;return o!==i&&(u*=100),a+"("+u+c+")"}const Fw=/\b([a-z-]*)\(.*?\)/gu,If={...cs,getAnimatableNone:n=>{const a=n.match(Fw);return a?a.map(Kw).join(" "):n}},Yw={..._h,color:Zt,backgroundColor:Zt,outlineColor:Zt,fill:Zt,stroke:Zt,borderColor:Zt,borderTopColor:Zt,borderRightColor:Zt,borderBottomColor:Zt,borderLeftColor:Zt,filter:If,WebkitFilter:If},zh=n=>Yw[n];function Nx(n,a){let i=zh(n);return i!==If&&(i=cs),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const Zw=new Set(["auto","none","0"]);function Xw(n,a,i){let o=0,c;for(;o<n.length&&!c;){const u=n[o];typeof u=="string"&&!Zw.has(u)&&vl(u).values.length&&(c=n[o]),o++}if(c&&i)for(const u of a)n[u]=Nx(i,c)}const Cy=n=>n===Ji||n===Se,Ey=(n,a)=>parseFloat(n.split(", ")[a]),Ay=(n,a)=>(i,{transform:o})=>{if(o==="none"||!o)return 0;const c=o.match(/^matrix3d\((.+)\)$/u);if(c)return Ey(c[1],a);{const u=o.match(/^matrix\((.+)\)$/u);return u?Ey(u[1],n):0}},Ww=new Set(["x","y","z"]),Qw=Qi.filter(n=>!Ww.has(n));function Jw(n){const a=[];return Qw.forEach(i=>{const o=n.getValue(i);o!==void 0&&(a.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),a}const Yi={width:({x:n},{paddingLeft:a="0",paddingRight:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),height:({y:n},{paddingTop:a="0",paddingBottom:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),top:(n,{top:a})=>parseFloat(a),left:(n,{left:a})=>parseFloat(a),bottom:({y:n},{top:a})=>parseFloat(a)+(n.max-n.min),right:({x:n},{left:a})=>parseFloat(a)+(n.max-n.min),x:Ay(4,13),y:Ay(5,14)};Yi.translateX=Yi.x;Yi.translateY=Yi.y;const Hs=new Set;let zf=!1,Uf=!1;function wx(){if(Uf){const n=Array.from(Hs).filter(o=>o.needsMeasurement),a=new Set(n.map(o=>o.element)),i=new Map;a.forEach(o=>{const c=Jw(o);c.length&&(i.set(o,c),o.render())}),n.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const c=i.get(o);c&&c.forEach(([u,f])=>{var p;(p=o.getValue(u))===null||p===void 0||p.set(f)})}),n.forEach(o=>o.measureEndState()),n.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}Uf=!1,zf=!1,Hs.forEach(n=>n.complete()),Hs.clear()}function Cx(){Hs.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Uf=!0)})}function eC(){Cx(),wx()}class Uh{constructor(a,i,o,c,u,f=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=o,this.motionValue=c,this.element=u,this.isAsync=f}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Hs.add(this),zf||(zf=!0,ut.read(Cx),ut.resolveKeyframes(wx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:o,motionValue:c}=this;for(let u=0;u<a.length;u++)if(a[u]===null)if(u===0){const f=c==null?void 0:c.get(),p=a[a.length-1];if(f!==void 0)a[0]=f;else if(o&&i){const m=o.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),c&&f===void 0&&c.set(a[0])}else a[u]=a[u-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Hs.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Hs.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Ex=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),tC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function nC(n){const a=tC.exec(n);if(!a)return[,];const[,i,o,c]=a;return[`--${i??o}`,c]}function Ax(n,a,i=1){const[o,c]=nC(n);if(!o)return;const u=window.getComputedStyle(a).getPropertyValue(o);if(u){const f=u.trim();return Ex(f)?parseFloat(f):f}return xh(c)?Ax(c,a,i+1):c}const Dx=n=>a=>a.test(n),aC={test:n=>n==="auto",parse:n=>n},Rx=[Ji,Se,ea,ls,JN,QN,aC],Dy=n=>Rx.find(Dx(n));class Mx extends Uh{constructor(a,i,o,c,u){super(a,i,o,c,u,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:o}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<a.length;m++){let v=a[m];if(typeof v=="string"&&(v=v.trim(),xh(v))){const g=Ax(v,i.current);g!==void 0&&(a[m]=g),m===a.length-1&&(this.finalKeyframe=v)}}if(this.resolveNoneKeyframes(),!ox.has(o)||a.length!==2)return;const[c,u]=a,f=Dy(c),p=Dy(u);if(f!==p)if(Cy(f)&&Cy(p))for(let m=0;m<a.length;m++){const v=a[m];typeof v=="string"&&(a[m]=parseFloat(v))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,o=[];for(let c=0;c<a.length;c++)Mw(a[c])&&o.push(c);o.length&&Xw(a,o,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:o}=this;if(!a||!a.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Yi[o](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const c=i[i.length-1];c!==void 0&&a.getValue(o,c).jump(c,!1)}measureEndState(){var a;const{element:i,name:o,unresolvedKeyframes:c}=this;if(!i||!i.current)return;const u=i.getValue(o);u&&u.jump(this.measuredOrigin,!1);const f=c.length-1,p=c[f];c[f]=Yi[o](i.measureViewportBox(),window.getComputedStyle(i.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([m,v])=>{i.getValue(m).set(v)}),this.resolveNoneKeyframes()}}const Ry=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(cs.test(n)||n==="0")&&!n.startsWith("url("));function sC(n){const a=n[0];if(n.length===1)return!0;for(let i=0;i<n.length;i++)if(n[i]!==a)return!0}function iC(n,a,i,o){const c=n[0];if(c===null)return!1;if(a==="display"||a==="visibility")return!0;const u=n[n.length-1],f=Ry(c,a),p=Ry(u,a);return!f||!p?!1:sC(n)||(i==="spring"||Rh(i))&&o}const oC=n=>n!==null;function Ec(n,{repeat:a,repeatType:i="loop"},o){const c=n.filter(oC),u=a&&i!=="loop"&&a%2===1?0:c.length-1;return!u||o===void 0?c[u]:o}const lC=40;class Ox{constructor({autoplay:a=!0,delay:i=0,type:o="keyframes",repeat:c=0,repeatDelay:u=0,repeatType:f="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ta.now(),this.options={autoplay:a,delay:i,type:o,repeat:c,repeatDelay:u,repeatType:f,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>lC?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&eC(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=ta.now(),this.hasAttemptedResolve=!0;const{name:o,type:c,velocity:u,delay:f,onComplete:p,onUpdate:m,isGenerator:v}=this.options;if(!v&&!iC(a,o,c,u))if(f)this.options.duration=0;else{m&&m(Ec(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const g=this.initPlayback(a,i);g!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...g},this.onPostResolved())}onPostResolved(){}then(a,i){return this.currentFinishedPromise.then(a,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const Vf=2e4;function Bx(n){let a=0;const i=50;let o=n.next(a);for(;!o.done&&a<Vf;)a+=i,o=n.next(a);return a>=Vf?1/0:a}const vt=(n,a,i)=>n+(a-n)*i;function tf(n,a,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?n+(a-n)*6*i:i<1/2?a:i<2/3?n+(a-n)*(2/3-i)*6:n}function rC({hue:n,saturation:a,lightness:i,alpha:o}){n/=360,a/=100,i/=100;let c=0,u=0,f=0;if(!a)c=u=f=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;c=tf(m,p,n+1/3),u=tf(m,p,n),f=tf(m,p,n-1/3)}return{red:Math.round(c*255),green:Math.round(u*255),blue:Math.round(f*255),alpha:o}}function dc(n,a){return i=>i>0?a:n}const nf=(n,a,i)=>{const o=n*n,c=i*(a*a-o)+o;return c<0?0:Math.sqrt(c)},cC=[Lf,zs,Ii],uC=n=>cC.find(a=>a.test(n));function My(n){const a=uC(n);if(!a)return!1;let i=a.parse(n);return a===Ii&&(i=rC(i)),i}const Oy=(n,a)=>{const i=My(n),o=My(a);if(!i||!o)return dc(n,a);const c={...i};return u=>(c.red=nf(i.red,o.red,u),c.green=nf(i.green,o.green,u),c.blue=nf(i.blue,o.blue,u),c.alpha=vt(i.alpha,o.alpha,u),zs.transform(c))},dC=(n,a)=>i=>a(n(i)),Tl=(...n)=>n.reduce(dC),Hf=new Set(["none","hidden"]);function fC(n,a){return Hf.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function hC(n,a){return i=>vt(n,a,i)}function Vh(n){return typeof n=="number"?hC:typeof n=="string"?xh(n)?dc:Zt.test(n)?Oy:vC:Array.isArray(n)?Lx:typeof n=="object"?Zt.test(n)?Oy:pC:dc}function Lx(n,a){const i=[...n],o=i.length,c=n.map((u,f)=>Vh(u)(u,a[f]));return u=>{for(let f=0;f<o;f++)i[f]=c[f](u);return i}}function pC(n,a){const i={...n,...a},o={};for(const c in i)n[c]!==void 0&&a[c]!==void 0&&(o[c]=Vh(n[c])(n[c],a[c]));return c=>{for(const u in o)i[u]=o[u](c);return i}}function mC(n,a){var i;const o=[],c={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const f=a.types[u],p=n.indexes[f][c[f]],m=(i=n.values[p])!==null&&i!==void 0?i:0;o[u]=m,c[f]++}return o}const vC=(n,a)=>{const i=cs.createTransformer(a),o=vl(n),c=vl(a);return o.indexes.var.length===c.indexes.var.length&&o.indexes.color.length===c.indexes.color.length&&o.indexes.number.length>=c.indexes.number.length?Hf.has(n)&&!c.values.length||Hf.has(a)&&!o.values.length?fC(n,a):Tl(Lx(mC(o,c),c.values),i):dc(n,a)};function Ix(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?vt(n,a,i):Vh(n)(n,a)}const gC=5;function zx(n,a,i){const o=Math.max(a-gC,0);return lx(i-n(o),a-o)}const bt={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},af=.001;function yC({duration:n=bt.duration,bounce:a=bt.bounce,velocity:i=bt.velocity,mass:o=bt.mass}){let c,u,f=1-a;f=Aa(bt.minDamping,bt.maxDamping,f),n=Aa(bt.minDuration,bt.maxDuration,wa(n)),f<1?(c=v=>{const g=v*f,b=g*n,x=g-i,S=Pf(v,f),T=Math.exp(-b);return af-x/S*T},u=v=>{const b=v*f*n,x=b*i+i,S=Math.pow(f,2)*Math.pow(v,2)*n,T=Math.exp(-b),w=Pf(Math.pow(v,2),f);return(-c(v)+af>0?-1:1)*((x-S)*T)/w}):(c=v=>{const g=Math.exp(-v*n),b=(v-i)*n+1;return-af+g*b},u=v=>{const g=Math.exp(-v*n),b=(i-v)*(n*n);return g*b});const p=5/n,m=xC(c,u,p);if(n=Na(n),isNaN(m))return{stiffness:bt.stiffness,damping:bt.damping,duration:n};{const v=Math.pow(m,2)*o;return{stiffness:v,damping:f*2*Math.sqrt(o*v),duration:n}}}const bC=12;function xC(n,a,i){let o=i;for(let c=1;c<bC;c++)o=o-n(o)/a(o);return o}function Pf(n,a){return n*Math.sqrt(1-a*a)}const _C=["duration","bounce"],SC=["stiffness","damping","mass"];function By(n,a){return a.some(i=>n[i]!==void 0)}function TC(n){let a={velocity:bt.velocity,stiffness:bt.stiffness,damping:bt.damping,mass:bt.mass,isResolvedFromDuration:!1,...n};if(!By(n,SC)&&By(n,_C))if(n.visualDuration){const i=n.visualDuration,o=2*Math.PI/(i*1.2),c=o*o,u=2*Aa(.05,1,1-(n.bounce||0))*Math.sqrt(c);a={...a,mass:bt.mass,stiffness:c,damping:u}}else{const i=yC(n);a={...a,...i,mass:bt.mass},a.isResolvedFromDuration=!0}return a}function Ux(n=bt.visualDuration,a=bt.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:o,restDelta:c}=i;const u=i.keyframes[0],f=i.keyframes[i.keyframes.length-1],p={done:!1,value:u},{stiffness:m,damping:v,mass:g,duration:b,velocity:x,isResolvedFromDuration:S}=TC({...i,velocity:-wa(i.velocity||0)}),T=x||0,w=v/(2*Math.sqrt(m*g)),N=f-u,k=wa(Math.sqrt(m/g)),E=Math.abs(N)<5;o||(o=E?bt.restSpeed.granular:bt.restSpeed.default),c||(c=E?bt.restDelta.granular:bt.restDelta.default);let A;if(w<1){const C=Pf(k,w);A=z=>{const H=Math.exp(-w*k*z);return f-H*((T+w*k*N)/C*Math.sin(C*z)+N*Math.cos(C*z))}}else if(w===1)A=C=>f-Math.exp(-k*C)*(N+(T+k*N)*C);else{const C=k*Math.sqrt(w*w-1);A=z=>{const H=Math.exp(-w*k*z),B=Math.min(C*z,300);return f-H*((T+w*k*N)*Math.sinh(B)+C*N*Math.cosh(B))/C}}const R={calculatedDuration:S&&b||null,next:C=>{const z=A(C);if(S)p.done=C>=b;else{let H=0;w<1&&(H=C===0?Na(T):zx(A,C,z));const B=Math.abs(H)<=o,K=Math.abs(f-z)<=c;p.done=B&&K}return p.value=p.done?f:z,p},toString:()=>{const C=Math.min(Bx(R),Vf),z=cx(H=>R.next(C*H).value,C,30);return C+"ms "+z}};return R}function Ly({keyframes:n,velocity:a=0,power:i=.8,timeConstant:o=325,bounceDamping:c=10,bounceStiffness:u=500,modifyTarget:f,min:p,max:m,restDelta:v=.5,restSpeed:g}){const b=n[0],x={done:!1,value:b},S=B=>p!==void 0&&B<p||m!==void 0&&B>m,T=B=>p===void 0?m:m===void 0||Math.abs(p-B)<Math.abs(m-B)?p:m;let w=i*a;const N=b+w,k=f===void 0?N:f(N);k!==N&&(w=k-b);const E=B=>-w*Math.exp(-B/o),A=B=>k+E(B),R=B=>{const K=E(B),Q=A(B);x.done=Math.abs(K)<=v,x.value=x.done?k:Q};let C,z;const H=B=>{S(x.value)&&(C=B,z=Ux({keyframes:[x.value,T(x.value)],velocity:zx(A,B,x.value),damping:c,stiffness:u,restDelta:v,restSpeed:g}))};return H(0),{calculatedDuration:null,next:B=>{let K=!1;return!z&&C===void 0&&(K=!0,R(B),H(B)),C!==void 0&&B>=C?z.next(B-C):(!K&&R(B),x)}}}const kC=Sl(.42,0,1,1),jC=Sl(0,0,.58,1),Vx=Sl(.42,0,.58,1),NC=n=>Array.isArray(n)&&typeof n[0]!="number",wC={linear:bn,easeIn:kC,easeInOut:Vx,easeOut:jC,circIn:Bh,circInOut:bx,circOut:yx,backIn:Oh,backInOut:vx,backOut:mx,anticipate:gx},Iy=n=>{if(Mh(n)){Vb(n.length===4);const[a,i,o,c]=n;return Sl(a,i,o,c)}else if(typeof n=="string")return wC[n];return n};function CC(n,a,i){const o=[],c=i||Ix,u=n.length-1;for(let f=0;f<u;f++){let p=c(n[f],n[f+1]);if(a){const m=Array.isArray(a)?a[f]||bn:a;p=Tl(m,p)}o.push(p)}return o}function EC(n,a,{clamp:i=!0,ease:o,mixer:c}={}){const u=n.length;if(Vb(u===a.length),u===1)return()=>a[0];if(u===2&&a[0]===a[1])return()=>a[1];const f=n[0]===n[1];n[0]>n[u-1]&&(n=[...n].reverse(),a=[...a].reverse());const p=CC(a,o,c),m=p.length,v=g=>{if(f&&g<n[0])return a[0];let b=0;if(m>1)for(;b<n.length-2&&!(g<n[b+1]);b++);const x=Fi(n[b],n[b+1],g);return p[b](x)};return i?g=>v(Aa(n[0],n[u-1],g)):v}function AC(n,a){const i=n[n.length-1];for(let o=1;o<=a;o++){const c=Fi(0,a,o);n.push(vt(i,1,c))}}function DC(n){const a=[0];return AC(a,n.length-1),a}function RC(n,a){return n.map(i=>i*a)}function MC(n,a){return n.map(()=>a||Vx).splice(0,n.length-1)}function fc({duration:n=300,keyframes:a,times:i,ease:o="easeInOut"}){const c=NC(o)?o.map(Iy):Iy(o),u={done:!1,value:a[0]},f=RC(i&&i.length===a.length?i:DC(a),n),p=EC(f,a,{ease:Array.isArray(c)?c:MC(a,c)});return{calculatedDuration:n,next:m=>(u.value=p(m),u.done=m>=n,u)}}const OC=n=>{const a=({timestamp:i})=>n(i);return{start:()=>ut.update(a,!0),stop:()=>rs(a),now:()=>qt.isProcessing?qt.timestamp:ta.now()}},BC={decay:Ly,inertia:Ly,tween:fc,keyframes:fc,spring:Ux},LC=n=>n/100;class Hh extends Ox{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:i,motionValue:o,element:c,keyframes:u}=this.options,f=(c==null?void 0:c.KeyframeResolver)||Uh,p=(m,v)=>this.onKeyframesResolved(m,v);this.resolver=new f(u,p,i,o,c),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:o=0,repeatDelay:c=0,repeatType:u,velocity:f=0}=this.options,p=Rh(i)?i:BC[i]||fc;let m,v;p!==fc&&typeof a[0]!="number"&&(m=Tl(LC,Ix(a[0],a[1])),a=[0,100]);const g=p({...this.options,keyframes:a});u==="mirror"&&(v=p({...this.options,keyframes:[...a].reverse(),velocity:-f})),g.calculatedDuration===null&&(g.calculatedDuration=Bx(g));const{calculatedDuration:b}=g,x=b+c,S=x*(o+1)-c;return{generator:g,mirroredGenerator:v,mapPercentToKeyframes:m,calculatedDuration:b,resolvedDuration:x,totalDuration:S}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,i=!1){const{resolved:o}=this;if(!o){const{keyframes:B}=this.options;return{done:!0,value:B[B.length-1]}}const{finalKeyframe:c,generator:u,mirroredGenerator:f,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:v,totalDuration:g,resolvedDuration:b}=o;if(this.startTime===null)return u.next(0);const{delay:x,repeat:S,repeatType:T,repeatDelay:w,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-g/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const k=this.currentTime-x*(this.speed>=0?1:-1),E=this.speed>=0?k<0:k>g;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=g);let A=this.currentTime,R=u;if(S){const B=Math.min(this.currentTime,g)/b;let K=Math.floor(B),Q=B%1;!Q&&B>=1&&(Q=1),Q===1&&K--,K=Math.min(K,S+1),!!(K%2)&&(T==="reverse"?(Q=1-Q,w&&(Q-=w/b)):T==="mirror"&&(R=f)),A=Aa(0,1,Q)*b}const C=E?{done:!1,value:m[0]}:R.next(A);p&&(C.value=p(C.value));let{done:z}=C;!E&&v!==null&&(z=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const H=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&z);return H&&c!==void 0&&(C.value=Ec(m,this.options,c)),N&&N(C.value),H&&this.finish(),C}get duration(){const{resolved:a}=this;return a?wa(a.calculatedDuration):0}get time(){return wa(this.currentTime)}set time(a){a=Na(a),this.currentTime=a,this.holdTime!==null||this.speed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.speed)}get speed(){return this.playbackSpeed}set speed(a){const i=this.playbackSpeed!==a;this.playbackSpeed=a,i&&(this.time=wa(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=OC,onPlay:i,startTime:o}=this.options;this.driver||(this.driver=a(u=>this.tick(u))),i&&i();const c=this.driver.now();this.holdTime!==null?this.startTime=c-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=c):this.startTime=o??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const IC=new Set(["opacity","clipPath","filter","transform"]);function zC(n,a,i,{delay:o=0,duration:c=300,repeat:u=0,repeatType:f="loop",ease:p="easeInOut",times:m}={}){const v={[a]:i};m&&(v.offset=m);const g=dx(p,c);return Array.isArray(g)&&(v.easing=g),n.animate(v,{delay:o,duration:c,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:u+1,direction:f==="reverse"?"alternate":"normal"})}const UC=Dh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),hc=10,VC=2e4;function HC(n){return Rh(n.type)||n.type==="spring"||!ux(n.ease)}function PC(n,a){const i=new Hh({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:n[0]};const c=[];let u=0;for(;!o.done&&u<VC;)o=i.sample(u),c.push(o.value),u+=hc;return{times:void 0,keyframes:c,duration:u-hc,ease:"linear"}}const Hx={anticipate:gx,backInOut:vx,circInOut:bx};function GC(n){return n in Hx}class zy extends Ox{constructor(a){super(a);const{name:i,motionValue:o,element:c,keyframes:u}=this.options;this.resolver=new Mx(u,(f,p)=>this.onKeyframesResolved(f,p),i,o,c),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:o=300,times:c,ease:u,type:f,motionValue:p,name:m,startTime:v}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof u=="string"&&uc()&&GC(u)&&(u=Hx[u]),HC(this.options)){const{onComplete:b,onUpdate:x,motionValue:S,element:T,...w}=this.options,N=PC(a,w);a=N.keyframes,a.length===1&&(a[1]=a[0]),o=N.duration,c=N.times,u=N.ease,f="keyframes"}const g=zC(p.owner.current,m,a,{...this.options,duration:o,times:c,ease:u});return g.startTime=v??this.calcStartTime(),this.pendingTimeline?(Ny(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:b}=this.options;p.set(Ec(a,this.options,i)),b&&b(),this.cancel(),this.resolveFinishedPromise()},{animation:g,duration:o,times:c,type:f,ease:u,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return wa(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return wa(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.currentTime=Na(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:i}=a;return i.playbackRate}set speed(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:i}=a;return i.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:i}=a;return i.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:i}=this;if(!i)return bn;const{animation:o}=i;Ny(o,a)}return bn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:i,keyframes:o,duration:c,type:u,ease:f,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:v,onUpdate:g,onComplete:b,element:x,...S}=this.options,T=new Hh({...S,keyframes:o,duration:c,type:u,ease:f,times:p,isGenerator:!0}),w=Na(this.time);v.setWithVelocity(T.sample(w-hc).value,T.sample(w).value,hc)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:o,repeatDelay:c,repeatType:u,damping:f,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:v}=i.owner.getProps();return UC()&&o&&IC.has(o)&&!m&&!v&&!c&&u!=="mirror"&&f!==0&&p!=="inertia"}}const $C={type:"spring",stiffness:500,damping:25,restSpeed:10},qC=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),KC={type:"keyframes",duration:.8},FC={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},YC=(n,{keyframes:a})=>a.length>2?KC:Ys.has(n)?n.startsWith("scale")?qC(a[1]):$C:FC;function ZC({when:n,delay:a,delayChildren:i,staggerChildren:o,staggerDirection:c,repeat:u,repeatType:f,repeatDelay:p,from:m,elapsed:v,...g}){return!!Object.keys(g).length}const Ph=(n,a,i,o={},c,u)=>f=>{const p=wh(o,n)||{},m=p.delay||o.delay||0;let{elapsed:v=0}=o;v=v-Na(m);let g={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-v,onUpdate:x=>{a.set(x),p.onUpdate&&p.onUpdate(x)},onComplete:()=>{f(),p.onComplete&&p.onComplete()},name:n,motionValue:a,element:u?void 0:c};ZC(p)||(g={...g,...YC(n,g)}),g.duration&&(g.duration=Na(g.duration)),g.repeatDelay&&(g.repeatDelay=Na(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let b=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(g.duration=0,g.delay===0&&(b=!0)),b&&!u&&a.get()!==void 0){const x=Ec(g.keyframes,p);if(x!==void 0)return ut.update(()=>{g.onUpdate(x),g.onComplete()}),new ww([])}return!u&&zy.supports(g)?new zy(g):new Hh(g)};function XC({protectedKeys:n,needsAnimating:a},i){const o=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,o}function Px(n,a,{delay:i=0,transitionOverride:o,type:c}={}){var u;let{transition:f=n.getDefaultTransition(),transitionEnd:p,...m}=a;o&&(f=o);const v=[],g=c&&n.animationState&&n.animationState.getState()[c];for(const b in m){const x=n.getValue(b,(u=n.latestValues[b])!==null&&u!==void 0?u:null),S=m[b];if(S===void 0||g&&XC(g,b))continue;const T={delay:i,...wh(f||{},b)};let w=!1;if(window.MotionHandoffAnimation){const k=rx(n);if(k){const E=window.MotionHandoffAnimation(k,b,ut);E!==null&&(T.startTime=E,w=!0)}}Of(n,b),x.start(Ph(b,x,S,n.shouldReduceMotion&&ox.has(b)?{type:!1}:T,n,w));const N=x.animation;N&&v.push(N)}return p&&Promise.all(v).then(()=>{ut.update(()=>{p&&Tw(n,p)})}),v}function Gf(n,a,i={}){var o;const c=Cc(n,a,i.type==="exit"?(o=n.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:u=n.getDefaultTransition()||{}}=c||{};i.transitionOverride&&(u=i.transitionOverride);const f=c?()=>Promise.all(Px(n,c,i)):()=>Promise.resolve(),p=n.variantChildren&&n.variantChildren.size?(v=0)=>{const{delayChildren:g=0,staggerChildren:b,staggerDirection:x}=u;return WC(n,a,g+v,b,x,i)}:()=>Promise.resolve(),{when:m}=u;if(m){const[v,g]=m==="beforeChildren"?[f,p]:[p,f];return v().then(()=>g())}else return Promise.all([f(),p(i.delay)])}function WC(n,a,i=0,o=0,c=1,u){const f=[],p=(n.variantChildren.size-1)*o,m=c===1?(v=0)=>v*o:(v=0)=>p-v*o;return Array.from(n.variantChildren).sort(QC).forEach((v,g)=>{v.notify("AnimationStart",a),f.push(Gf(v,a,{...u,delay:i+m(g)}).then(()=>v.notify("AnimationComplete",a)))}),Promise.all(f)}function QC(n,a){return n.sortNodePosition(a)}function JC(n,a,i={}){n.notify("AnimationStart",a);let o;if(Array.isArray(a)){const c=a.map(u=>Gf(n,u,i));o=Promise.all(c)}else if(typeof a=="string")o=Gf(n,a,i);else{const c=typeof a=="function"?Cc(n,a,i.custom):a;o=Promise.all(Px(n,c,i))}return o.then(()=>{n.notify("AnimationComplete",a)})}const eE=mh.length;function Gx(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?Gx(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<eE;i++){const o=mh[i],c=n.props[o];(hl(c)||c===!1)&&(a[o]=c)}return a}const tE=[...ph].reverse(),nE=ph.length;function aE(n){return a=>Promise.all(a.map(({animation:i,options:o})=>JC(n,i,o)))}function sE(n){let a=aE(n),i=Uy(),o=!0;const c=m=>(v,g)=>{var b;const x=Cc(n,g,m==="exit"?(b=n.presenceContext)===null||b===void 0?void 0:b.custom:void 0);if(x){const{transition:S,transitionEnd:T,...w}=x;v={...v,...w,...T}}return v};function u(m){a=m(n)}function f(m){const{props:v}=n,g=Gx(n.parent)||{},b=[],x=new Set;let S={},T=1/0;for(let N=0;N<nE;N++){const k=tE[N],E=i[k],A=v[k]!==void 0?v[k]:g[k],R=hl(A),C=k===m?E.isActive:null;C===!1&&(T=N);let z=A===g[k]&&A!==v[k]&&R;if(z&&o&&n.manuallyAnimateOnMount&&(z=!1),E.protectedKeys={...S},!E.isActive&&C===null||!A&&!E.prevProp||Nc(A)||typeof A=="boolean")continue;const H=iE(E.prevProp,A);let B=H||k===m&&E.isActive&&!z&&R||N>T&&R,K=!1;const Q=Array.isArray(A)?A:[A];let se=Q.reduce(c(k),{});C===!1&&(se={});const{prevResolvedValues:ne={}}=E,ce={...ne,...se},q=G=>{B=!0,x.has(G)&&(K=!0,x.delete(G)),E.needsAnimating[G]=!0;const W=n.getValue(G);W&&(W.liveStyle=!1)};for(const G in ce){const W=se[G],le=ne[G];if(S.hasOwnProperty(G))continue;let re=!1;Mf(W)&&Mf(le)?re=!ix(W,le):re=W!==le,re?W!=null?q(G):x.add(G):W!==void 0&&x.has(G)?q(G):E.protectedKeys[G]=!0}E.prevProp=A,E.prevResolvedValues=se,E.isActive&&(S={...S,...se}),o&&n.blockInitialAnimation&&(B=!1),B&&(!(z&&H)||K)&&b.push(...Q.map(G=>({animation:G,options:{type:k}})))}if(x.size){const N={};x.forEach(k=>{const E=n.getBaseTarget(k),A=n.getValue(k);A&&(A.liveStyle=!0),N[k]=E??null}),b.push({animation:N})}let w=!!b.length;return o&&(v.initial===!1||v.initial===v.animate)&&!n.manuallyAnimateOnMount&&(w=!1),o=!1,w?a(b):Promise.resolve()}function p(m,v){var g;if(i[m].isActive===v)return Promise.resolve();(g=n.variantChildren)===null||g===void 0||g.forEach(x=>{var S;return(S=x.animationState)===null||S===void 0?void 0:S.setActive(m,v)}),i[m].isActive=v;const b=f(m);for(const x in i)i[x].protectedKeys={};return b}return{animateChanges:f,setActive:p,setAnimateFunction:u,getState:()=>i,reset:()=>{i=Uy(),o=!0}}}function iE(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!ix(a,n):!1}function Rs(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Uy(){return{animate:Rs(!0),whileInView:Rs(),whileHover:Rs(),whileTap:Rs(),whileDrag:Rs(),whileFocus:Rs(),exit:Rs()}}class fs{constructor(a){this.isMounted=!1,this.node=a}update(){}}class oE extends fs{constructor(a){super(a),a.animationState||(a.animationState=sE(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();Nc(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:i}=this.node.prevProps||{};a!==i&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)===null||a===void 0||a.call(this)}}let lE=0;class rE extends fs{constructor(){super(...arguments),this.id=lE++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)return;const c=this.node.animationState.setActive("exit",!a);i&&!a&&c.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const cE={animation:{Feature:oE},exit:{Feature:rE}},Gn={x:!1,y:!1};function $x(){return Gn.x||Gn.y}function uE(n){return n==="x"||n==="y"?Gn[n]?null:(Gn[n]=!0,()=>{Gn[n]=!1}):Gn.x||Gn.y?null:(Gn.x=Gn.y=!0,()=>{Gn.x=Gn.y=!1})}const Gh=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function gl(n,a,i,o={passive:!0}){return n.addEventListener(a,i,o),()=>n.removeEventListener(a,i)}function kl(n){return{point:{x:n.pageX,y:n.pageY}}}const dE=n=>a=>Gh(a)&&n(a,kl(a));function ll(n,a,i,o){return gl(n,a,dE(i),o)}const Vy=(n,a)=>Math.abs(n-a);function fE(n,a){const i=Vy(n.x,a.x),o=Vy(n.y,a.y);return Math.sqrt(i**2+o**2)}class qx{constructor(a,i,{transformPagePoint:o,contextWindow:c,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=of(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,S=fE(b.offset,{x:0,y:0})>=3;if(!x&&!S)return;const{point:T}=b,{timestamp:w}=qt;this.history.push({...T,timestamp:w});const{onStart:N,onMove:k}=this.handlers;x||(N&&N(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=sf(x,this.transformPagePoint),ut.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:S,onSessionEnd:T,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=of(b.type==="pointercancel"?this.lastMoveEventInfo:sf(x,this.transformPagePoint),this.history);this.startEvent&&S&&S(b,N),T&&T(b,N)},!Gh(a))return;this.dragSnapToOrigin=u,this.handlers=i,this.transformPagePoint=o,this.contextWindow=c||window;const f=kl(a),p=sf(f,this.transformPagePoint),{point:m}=p,{timestamp:v}=qt;this.history=[{...m,timestamp:v}];const{onSessionStart:g}=i;g&&g(a,of(p,this.history)),this.removeListeners=Tl(ll(this.contextWindow,"pointermove",this.handlePointerMove),ll(this.contextWindow,"pointerup",this.handlePointerUp),ll(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),rs(this.updatePoint)}}function sf(n,a){return a?{point:a(n.point)}:n}function Hy(n,a){return{x:n.x-a.x,y:n.y-a.y}}function of({point:n},a){return{point:n,delta:Hy(n,Kx(a)),offset:Hy(n,hE(a)),velocity:pE(a,.1)}}function hE(n){return n[0]}function Kx(n){return n[n.length-1]}function pE(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,o=null;const c=Kx(n);for(;i>=0&&(o=n[i],!(c.timestamp-o.timestamp>Na(a)));)i--;if(!o)return{x:0,y:0};const u=wa(c.timestamp-o.timestamp);if(u===0)return{x:0,y:0};const f={x:(c.x-o.x)/u,y:(c.y-o.y)/u};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}const Fx=1e-4,mE=1-Fx,vE=1+Fx,Yx=.01,gE=0-Yx,yE=0+Yx;function xn(n){return n.max-n.min}function bE(n,a,i){return Math.abs(n-a)<=i}function Py(n,a,i,o=.5){n.origin=o,n.originPoint=vt(a.min,a.max,n.origin),n.scale=xn(i)/xn(a),n.translate=vt(i.min,i.max,n.origin)-n.originPoint,(n.scale>=mE&&n.scale<=vE||isNaN(n.scale))&&(n.scale=1),(n.translate>=gE&&n.translate<=yE||isNaN(n.translate))&&(n.translate=0)}function rl(n,a,i,o){Py(n.x,a.x,i.x,o?o.originX:void 0),Py(n.y,a.y,i.y,o?o.originY:void 0)}function Gy(n,a,i){n.min=i.min+a.min,n.max=n.min+xn(a)}function xE(n,a,i){Gy(n.x,a.x,i.x),Gy(n.y,a.y,i.y)}function $y(n,a,i){n.min=a.min-i.min,n.max=n.min+xn(a)}function cl(n,a,i){$y(n.x,a.x,i.x),$y(n.y,a.y,i.y)}function _E(n,{min:a,max:i},o){return a!==void 0&&n<a?n=o?vt(a,n,o.min):Math.max(n,a):i!==void 0&&n>i&&(n=o?vt(i,n,o.max):Math.min(n,i)),n}function qy(n,a,i){return{min:a!==void 0?n.min+a:void 0,max:i!==void 0?n.max+i-(n.max-n.min):void 0}}function SE(n,{top:a,left:i,bottom:o,right:c}){return{x:qy(n.x,i,c),y:qy(n.y,a,o)}}function Ky(n,a){let i=a.min-n.min,o=a.max-n.max;return a.max-a.min<n.max-n.min&&([i,o]=[o,i]),{min:i,max:o}}function TE(n,a){return{x:Ky(n.x,a.x),y:Ky(n.y,a.y)}}function kE(n,a){let i=.5;const o=xn(n),c=xn(a);return c>o?i=Fi(a.min,a.max-o,n.min):o>c&&(i=Fi(n.min,n.max-c,a.min)),Aa(0,1,i)}function jE(n,a){const i={};return a.min!==void 0&&(i.min=a.min-n.min),a.max!==void 0&&(i.max=a.max-n.min),i}const $f=.35;function NE(n=$f){return n===!1?n=0:n===!0&&(n=$f),{x:Fy(n,"left","right"),y:Fy(n,"top","bottom")}}function Fy(n,a,i){return{min:Yy(n,a),max:Yy(n,i)}}function Yy(n,a){return typeof n=="number"?n:n[a]||0}const Zy=()=>({translate:0,scale:1,origin:0,originPoint:0}),zi=()=>({x:Zy(),y:Zy()}),Xy=()=>({min:0,max:0}),Tt=()=>({x:Xy(),y:Xy()});function Bn(n){return[n("x"),n("y")]}function Zx({top:n,left:a,right:i,bottom:o}){return{x:{min:a,max:i},y:{min:n,max:o}}}function wE({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function CE(n,a){if(!a)return n;const i=a({x:n.left,y:n.top}),o=a({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function lf(n){return n===void 0||n===1}function qf({scale:n,scaleX:a,scaleY:i}){return!lf(n)||!lf(a)||!lf(i)}function Ls(n){return qf(n)||Xx(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Xx(n){return Wy(n.x)||Wy(n.y)}function Wy(n){return n&&n!=="0%"}function pc(n,a,i){const o=n-i,c=a*o;return i+c}function Qy(n,a,i,o,c){return c!==void 0&&(n=pc(n,c,o)),pc(n,i,o)+a}function Kf(n,a=0,i=1,o,c){n.min=Qy(n.min,a,i,o,c),n.max=Qy(n.max,a,i,o,c)}function Wx(n,{x:a,y:i}){Kf(n.x,a.translate,a.scale,a.originPoint),Kf(n.y,i.translate,i.scale,i.originPoint)}const Jy=.999999999999,e0=1.0000000000001;function EE(n,a,i,o=!1){const c=i.length;if(!c)return;a.x=a.y=1;let u,f;for(let p=0;p<c;p++){u=i[p],f=u.projectionDelta;const{visualElement:m}=u.options;m&&m.props.style&&m.props.style.display==="contents"||(o&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Vi(n,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),f&&(a.x*=f.x.scale,a.y*=f.y.scale,Wx(n,f)),o&&Ls(u.latestValues)&&Vi(n,u.latestValues))}a.x<e0&&a.x>Jy&&(a.x=1),a.y<e0&&a.y>Jy&&(a.y=1)}function Ui(n,a){n.min=n.min+a,n.max=n.max+a}function t0(n,a,i,o,c=.5){const u=vt(n.min,n.max,c);Kf(n,a,i,u,o)}function Vi(n,a){t0(n.x,a.x,a.scaleX,a.scale,a.originX),t0(n.y,a.y,a.scaleY,a.scale,a.originY)}function Qx(n,a){return Zx(CE(n.getBoundingClientRect(),a))}function AE(n,a,i){const o=Qx(n,i),{scroll:c}=a;return c&&(Ui(o.x,c.offset.x),Ui(o.y,c.offset.y)),o}const Jx=({current:n})=>n?n.ownerDocument.defaultView:null,DE=new WeakMap;class RE{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Tt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const c=g=>{const{dragSnapToOrigin:b}=this.getProps();b?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(kl(g).point)},u=(g,b)=>{const{drag:x,dragPropagation:S,onDragStart:T}=this.getProps();if(x&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=uE(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),Bn(N=>{let k=this.getAxisMotionValue(N).get()||0;if(ea.test(k)){const{projection:E}=this.visualElement;if(E&&E.layout){const A=E.layout.layoutBox[N];A&&(k=xn(A)*(parseFloat(k)/100))}}this.originPoint[N]=k}),T&&ut.postRender(()=>T(g,b)),Of(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},f=(g,b)=>{const{dragPropagation:x,dragDirectionLock:S,onDirectionLock:T,onDrag:w}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:N}=b;if(S&&this.currentDirection===null){this.currentDirection=ME(N),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",b.point,N),this.updateAxis("y",b.point,N),this.visualElement.render(),w&&w(g,b)},p=(g,b)=>this.stop(g,b),m=()=>Bn(g=>{var b;return this.getAnimationState(g)==="paused"&&((b=this.getAxisMotionValue(g).animation)===null||b===void 0?void 0:b.play())}),{dragSnapToOrigin:v}=this.getProps();this.panSession=new qx(a,{onSessionStart:c,onStart:u,onMove:f,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:v,contextWindow:Jx(this.visualElement)})}stop(a,i){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:c}=i;this.startAnimation(c);const{onDragEnd:u}=this.getProps();u&&ut.postRender(()=>u(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,o){const{drag:c}=this.getProps();if(!o||!Fr(a,c,this.currentDirection))return;const u=this.getAxisMotionValue(a);let f=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(f=_E(f,this.constraints[a],this.elastic[a])),u.set(f)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:o}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,u=this.constraints;i&&Li(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&c?this.constraints=SE(c.layoutBox,i):this.constraints=!1,this.elastic=NE(o),u!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&Bn(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=jE(c.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Li(a))return!1;const o=a.current,{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const u=AE(o,c.root,this.visualElement.getTransformPagePoint());let f=TE(c.layout.layoutBox,u);if(i){const p=i(wE(f));this.hasMutatedConstraints=!!p,p&&(f=Zx(p))}return f}startAnimation(a){const{drag:i,dragMomentum:o,dragElastic:c,dragTransition:u,dragSnapToOrigin:f,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},v=Bn(g=>{if(!Fr(g,i,this.currentDirection))return;let b=m&&m[g]||{};f&&(b={min:0,max:0});const x=c?200:1e6,S=c?40:1e7,T={type:"inertia",velocity:o?a[g]:0,bounceStiffness:x,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...b};return this.startAxisValueAnimation(g,T)});return Promise.all(v).then(p)}startAxisValueAnimation(a,i){const o=this.getAxisMotionValue(a);return Of(this.visualElement,a),o.start(Ph(a,o,0,i,this.visualElement,!1))}stopAnimation(){Bn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){Bn(a=>{var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(a){var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(a){const i=`_drag${a.toUpperCase()}`,o=this.visualElement.getProps(),c=o[i];return c||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){Bn(i=>{const{drag:o}=this.getProps();if(!Fr(i,o,this.currentDirection))return;const{projection:c}=this.visualElement,u=this.getAxisMotionValue(i);if(c&&c.layout){const{min:f,max:p}=c.layout.layoutBox[i];u.set(a[i]-vt(f,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:o}=this.visualElement;if(!Li(i)||!o||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};Bn(f=>{const p=this.getAxisMotionValue(f);if(p&&this.constraints!==!1){const m=p.get();c[f]=kE({min:m,max:m},this.constraints[f])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),Bn(f=>{if(!Fr(f,a,null))return;const p=this.getAxisMotionValue(f),{min:m,max:v}=this.constraints[f];p.set(vt(m,v,c[f]))})}addListeners(){if(!this.visualElement.current)return;DE.set(this.visualElement,this);const a=this.visualElement.current,i=ll(a,"pointerdown",m=>{const{drag:v,dragListener:g=!0}=this.getProps();v&&g&&this.start(m)}),o=()=>{const{dragConstraints:m}=this.getProps();Li(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:c}=this.visualElement,u=c.addEventListener("measure",o);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),ut.read(o);const f=gl(window,"resize",()=>this.scalePositionWithinConstraints()),p=c.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:v})=>{this.isDragging&&v&&(Bn(g=>{const b=this.getAxisMotionValue(g);b&&(this.originPoint[g]+=m[g].translate,b.set(b.get()+m[g].translate))}),this.visualElement.render())}));return()=>{f(),i(),u(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:o=!1,dragPropagation:c=!1,dragConstraints:u=!1,dragElastic:f=$f,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:o,dragPropagation:c,dragConstraints:u,dragElastic:f,dragMomentum:p}}}function Fr(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function ME(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class OE extends fs{constructor(a){super(a),this.removeGroupControls=bn,this.removeListeners=bn,this.controls=new RE(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||bn}unmount(){this.removeGroupControls(),this.removeListeners()}}const n0=n=>(a,i)=>{n&&ut.postRender(()=>n(a,i))};class BE extends fs{constructor(){super(...arguments),this.removePointerDownListener=bn}onPointerDown(a){this.session=new qx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:o,onPanEnd:c}=this.node.getProps();return{onSessionStart:n0(a),onStart:n0(i),onMove:o,onEnd:(u,f)=>{delete this.session,c&&ut.postRender(()=>c(u,f))}}}mount(){this.removePointerDownListener=ll(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const sc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function a0(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Wo={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(Se.test(n))n=parseFloat(n);else return n;const i=a0(n,a.target.x),o=a0(n,a.target.y);return`${i}% ${o}%`}},LE={correct:(n,{treeScale:a,projectionDelta:i})=>{const o=n,c=cs.parse(n);if(c.length>5)return o;const u=cs.createTransformer(n),f=typeof c[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;c[0+f]/=p,c[1+f]/=m;const v=vt(p,m,.5);return typeof c[2+f]=="number"&&(c[2+f]/=v),typeof c[3+f]=="number"&&(c[3+f]/=v),u(c)}};class IE extends y.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o,layoutId:c}=this.props,{projection:u}=a;cw(zE),u&&(i.group&&i.group.add(u),o&&o.register&&c&&o.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),sc.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:o,drag:c,isPresent:u}=this.props,f=o.projection;return f&&(f.isPresent=u,c||a.layoutDependency!==i||i===void 0?f.willUpdate():this.safeToRemove(),a.isPresent!==u&&(u?f.promote():f.relegate()||ut.postRender(()=>{const p=f.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),gh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o}=this.props,{projection:c}=a;c&&(c.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(c),o&&o.deregister&&o.deregister(c))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function e_(n){const[a,i]=zb(),o=y.useContext(uh);return r.jsx(IE,{...n,layoutGroup:o,switchLayoutGroup:y.useContext(Kb),isPresent:a,safeToRemove:i})}const zE={borderRadius:{...Wo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wo,borderTopRightRadius:Wo,borderBottomLeftRadius:Wo,borderBottomRightRadius:Wo,boxShadow:LE};function UE(n,a,i){const o=Xt(n)?n:ml(n);return o.start(Ph("",o,a,i)),o.animation}function VE(n){return n instanceof SVGElement&&n.tagName!=="svg"}const HE=(n,a)=>n.depth-a.depth;class PE{constructor(){this.children=[],this.isDirty=!1}add(a){Ch(this.children,a),this.isDirty=!0}remove(a){Eh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(HE),this.isDirty=!1,this.children.forEach(a)}}function GE(n,a){const i=ta.now(),o=({timestamp:c})=>{const u=c-i;u>=a&&(rs(o),n(u-a))};return ut.read(o,!0),()=>rs(o)}const t_=["TopLeft","TopRight","BottomLeft","BottomRight"],$E=t_.length,s0=n=>typeof n=="string"?parseFloat(n):n,i0=n=>typeof n=="number"||Se.test(n);function qE(n,a,i,o,c,u){c?(n.opacity=vt(0,i.opacity!==void 0?i.opacity:1,KE(o)),n.opacityExit=vt(a.opacity!==void 0?a.opacity:1,0,FE(o))):u&&(n.opacity=vt(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,o));for(let f=0;f<$E;f++){const p=`border${t_[f]}Radius`;let m=o0(a,p),v=o0(i,p);if(m===void 0&&v===void 0)continue;m||(m=0),v||(v=0),m===0||v===0||i0(m)===i0(v)?(n[p]=Math.max(vt(s0(m),s0(v),o),0),(ea.test(v)||ea.test(m))&&(n[p]+="%")):n[p]=v}(a.rotate||i.rotate)&&(n.rotate=vt(a.rotate||0,i.rotate||0,o))}function o0(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const KE=n_(0,.5,yx),FE=n_(.5,.95,bn);function n_(n,a,i){return o=>o<n?0:o>a?1:i(Fi(n,a,o))}function l0(n,a){n.min=a.min,n.max=a.max}function Mn(n,a){l0(n.x,a.x),l0(n.y,a.y)}function r0(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function c0(n,a,i,o,c){return n-=a,n=pc(n,1/i,o),c!==void 0&&(n=pc(n,1/c,o)),n}function YE(n,a=0,i=1,o=.5,c,u=n,f=n){if(ea.test(a)&&(a=parseFloat(a),a=vt(f.min,f.max,a/100)-f.min),typeof a!="number")return;let p=vt(u.min,u.max,o);n===u&&(p-=a),n.min=c0(n.min,a,i,p,c),n.max=c0(n.max,a,i,p,c)}function u0(n,a,[i,o,c],u,f){YE(n,a[i],a[o],a[c],a.scale,u,f)}const ZE=["x","scaleX","originX"],XE=["y","scaleY","originY"];function d0(n,a,i,o){u0(n.x,a,ZE,i?i.x:void 0,o?o.x:void 0),u0(n.y,a,XE,i?i.y:void 0,o?o.y:void 0)}function f0(n){return n.translate===0&&n.scale===1}function a_(n){return f0(n.x)&&f0(n.y)}function h0(n,a){return n.min===a.min&&n.max===a.max}function WE(n,a){return h0(n.x,a.x)&&h0(n.y,a.y)}function p0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function s_(n,a){return p0(n.x,a.x)&&p0(n.y,a.y)}function m0(n){return xn(n.x)/xn(n.y)}function v0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class QE{constructor(){this.members=[]}add(a){Ch(this.members,a),a.scheduleRender()}remove(a){if(Eh(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(c=>a===c);if(i===0)return!1;let o;for(let c=i;c>=0;c--){const u=this.members[c];if(u.isPresent!==!1){o=u;break}}return o?(this.promote(o),!0):!1}promote(a,i){const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.instance&&o.scheduleRender(),a.scheduleRender(),a.resumeFrom=o,i&&(a.resumeFrom.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:c}=a.options;c===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:o}=a;i.onExitComplete&&i.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function JE(n,a,i){let o="";const c=n.x.translate/a.x,u=n.y.translate/a.y,f=(i==null?void 0:i.z)||0;if((c||u||f)&&(o=`translate3d(${c}px, ${u}px, ${f}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:v,rotate:g,rotateX:b,rotateY:x,skewX:S,skewY:T}=i;v&&(o=`perspective(${v}px) ${o}`),g&&(o+=`rotate(${g}deg) `),b&&(o+=`rotateX(${b}deg) `),x&&(o+=`rotateY(${x}deg) `),S&&(o+=`skewX(${S}deg) `),T&&(o+=`skewY(${T}deg) `)}const p=n.x.scale*a.x,m=n.y.scale*a.y;return(p!==1||m!==1)&&(o+=`scale(${p}, ${m})`),o||"none"}const Is={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},nl=typeof window<"u"&&window.MotionDebug!==void 0,rf=["","X","Y","Z"],e2={visibility:"hidden"},g0=1e3;let t2=0;function cf(n,a,i,o){const{latestValues:c}=a;c[n]&&(i[n]=c[n],a.setStaticValue(n,0),o&&(o[n]=0))}function i_(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=rx(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:c,layoutId:u}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",ut,!(c||u))}const{parent:o}=n;o&&!o.hasCheckedOptimisedAppear&&i_(o)}function o_({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:o,resetTransform:c}){return class{constructor(f={},p=a==null?void 0:a()){this.id=t2++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,nl&&(Is.totalNodes=Is.resolvedTargetDeltas=Is.recalculatedProjection=0),this.nodes.forEach(s2),this.nodes.forEach(c2),this.nodes.forEach(u2),this.nodes.forEach(i2),nl&&window.MotionDebug.record(Is)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,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 PE)}addEventListener(f,p){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new Ah),this.eventHandlers.get(f).add(p)}notifyListeners(f,...p){const m=this.eventHandlers.get(f);m&&m.notify(...p)}hasListeners(f){return this.eventHandlers.has(f)}mount(f,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=VE(f),this.instance=f;const{layoutId:m,layout:v,visualElement:g}=this.options;if(g&&!g.current&&g.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(v||m)&&(this.isLayoutDirty=!0),n){let b;const x=()=>this.root.updateBlockedByResize=!1;n(f,()=>{this.root.updateBlockedByResize=!0,b&&b(),b=GE(x,250),sc.hasAnimatedSinceResize&&(sc.hasAnimatedSinceResize=!1,this.nodes.forEach(b0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&g&&(m||v)&&this.addEventListener("didUpdate",({delta:b,hasLayoutChanged:x,hasRelativeTargetChanged:S,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||g.getDefaultTransition()||m2,{onLayoutAnimationStart:N,onLayoutAnimationComplete:k}=g.getProps(),E=!this.targetLayout||!s_(this.targetLayout,T)||S,A=!x&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||x&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(b,A);const R={...wh(w,"layout"),onPlay:N,onComplete:k};(g.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R)}else x||b0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,rs(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(d2),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&i_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const b=this.path[g];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 v=this.getTransformTemplate();this.prevTransformTemplateValue=v?v(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(y0);return}this.isUpdating||this.nodes.forEach(l2),this.isUpdating=!1,this.nodes.forEach(r2),this.nodes.forEach(n2),this.nodes.forEach(a2),this.clearAllSnapshots();const p=ta.now();qt.delta=Aa(0,1e3/60,p-qt.timestamp),qt.timestamp=p,qt.isProcessing=!0,Jd.update.process(qt),Jd.preRender.process(qt),Jd.render.process(qt),qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,gh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(o2),this.sharedNodes.forEach(f2)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ut.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ut.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 f=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Tt(),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,f?f.layoutBox:void 0)}updateScroll(f="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(p=!1),p){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!c)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!a_(this.projectionDelta),m=this.getTransformTemplate(),v=m?m(this.latestValues,""):void 0,g=v!==this.prevTransformTemplateValue;f&&(p||Ls(this.latestValues)||g)&&(c(this.instance,v),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return f&&(m=this.removeTransform(m)),v2(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:p}=this.options;if(!p)return Tt();const m=p.measureViewportBox();if(!(((f=this.scroll)===null||f===void 0?void 0:f.wasRoot)||this.path.some(g2))){const{scroll:g}=this.root;g&&(Ui(m.x,g.offset.x),Ui(m.y,g.offset.y))}return m}removeElementScroll(f){var p;const m=Tt();if(Mn(m,f),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let v=0;v<this.path.length;v++){const g=this.path[v],{scroll:b,options:x}=g;g!==this.root&&b&&x.layoutScroll&&(b.wasRoot&&Mn(m,f),Ui(m.x,b.offset.x),Ui(m.y,b.offset.y))}return m}applyTransform(f,p=!1){const m=Tt();Mn(m,f);for(let v=0;v<this.path.length;v++){const g=this.path[v];!p&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Vi(m,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),Ls(g.latestValues)&&Vi(m,g.latestValues)}return Ls(this.latestValues)&&Vi(m,this.latestValues),m}removeTransform(f){const p=Tt();Mn(p,f);for(let m=0;m<this.path.length;m++){const v=this.path[m];if(!v.instance||!Ls(v.latestValues))continue;qf(v.latestValues)&&v.updateSnapshot();const g=Tt(),b=v.measurePageBox();Mn(g,b),d0(p,v.latestValues,v.snapshot?v.snapshot.layoutBox:void 0,g)}return Ls(this.latestValues)&&d0(p,this.latestValues),p}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.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!==qt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!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 v=!!this.resumingFrom||this!==m;if(!(f||v&&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=qt.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Tt(),this.relativeTargetOrigin=Tt(),cl(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Mn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Tt(),this.targetWithTransforms=Tt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),xE(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Mn(this.target,this.layout.layoutBox),Wx(this.target,this.targetDelta)):Mn(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=Tt(),this.relativeTargetOrigin=Tt(),cl(this.relativeTargetOrigin,this.target,S.target),Mn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}nl&&Is.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||qf(this.parent.latestValues)||Xx(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var f;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let v=!0;if((this.isProjectionDirty||!((f=this.parent)===null||f===void 0)&&f.isProjectionDirty)&&(v=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(v=!1),this.resolvedRelativeTargetAt===qt.timestamp&&(v=!1),v)return;const{layout:g,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||!(g||b))return;Mn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,S=this.treeScale.y;EE(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=Tt());const{target:T}=p;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(r0(this.prevProjectionDelta.x,this.projectionDelta.x),r0(this.prevProjectionDelta.y,this.projectionDelta.y)),rl(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==S||!v0(this.projectionDelta.x,this.prevProjectionDelta.x)||!v0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T)),nl&&Is.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),f){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=zi(),this.projectionDelta=zi(),this.projectionDeltaWithTransform=zi()}setAnimationOrigin(f,p=!1){const m=this.snapshot,v=m?m.latestValues:{},g={...this.latestValues},b=zi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const x=Tt(),S=m?m.source:void 0,T=this.layout?this.layout.source:void 0,w=S!==T,N=this.getStack(),k=!N||N.members.length<=1,E=!!(w&&!k&&this.options.crossfade===!0&&!this.path.some(p2));this.animationProgress=0;let A;this.mixTargetDelta=R=>{const C=R/1e3;x0(b.x,f.x,C),x0(b.y,f.y,C),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(cl(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h2(this.relativeTarget,this.relativeTargetOrigin,x,C),A&&WE(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=Tt()),Mn(A,this.relativeTarget)),w&&(this.animationValues=g,qE(g,v,this.latestValues,C,E,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(rs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ut.update(()=>{sc.hasAnimatedSinceResize=!0,this.currentAnimation=UE(0,g0,{...f,onUpdate:p=>{this.mixTargetDelta(p),f.onUpdate&&f.onUpdate(p)},onComplete:()=>{f.onComplete&&f.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 f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(g0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:p,target:m,layout:v,latestValues:g}=f;if(!(!p||!m||!v)){if(this!==f&&this.layout&&v&&l_(this.options.animationType,this.layout.layoutBox,v.layoutBox)){m=this.target||Tt();const b=xn(this.layout.layoutBox.x);m.x.min=f.target.x.min,m.x.max=m.x.min+b;const x=xn(this.layout.layoutBox.y);m.y.min=f.target.y.min,m.y.max=m.y.min+x}Mn(p,m),Vi(p,g),rl(this.projectionDeltaWithTransform,this.layoutCorrected,p,g)}}registerSharedNode(f,p){this.sharedNodes.has(f)||this.sharedNodes.set(f,new QE),this.sharedNodes.get(f).add(p);const v=p.options.initialPromotionConfig;p.promote({transition:v?v.transition:void 0,preserveFollowOpacity:v&&v.shouldPreserveFollowOpacity?v.shouldPreserveFollowOpacity(p):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){var f;const{layoutId:p}=this.options;return p?((f=this.getStack())===null||f===void 0?void 0:f.lead)||this:this}getPrevLead(){var f;const{layoutId:p}=this.options;return p?(f=this.getStack())===null||f===void 0?void 0:f.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:p,preserveFollowOpacity:m}={}){const v=this.getStack();v&&v.promote(this,m),f&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let p=!1;const{latestValues:m}=f;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const v={};m.z&&cf("z",f,v,this.animationValues);for(let g=0;g<rf.length;g++)cf(`rotate${rf[g]}`,f,v,this.animationValues),cf(`skew${rf[g]}`,f,v,this.animationValues);f.render();for(const g in v)f.setStaticValue(g,v[g]),this.animationValues&&(this.animationValues[g]=v[g]);f.scheduleRender()}getProjectionStyles(f){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return e2;const v={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,v.opacity="",v.pointerEvents=nc(f==null?void 0:f.pointerEvents)||"",v.transform=g?g(this.latestValues,""):"none",v;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=nc(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!Ls(this.latestValues)&&(w.transform=g?g({},""):"none",this.hasProjected=!1),w}const x=b.animationValues||b.latestValues;this.applyTransformsToTarget(),v.transform=JE(this.projectionDeltaWithTransform,this.treeScale,x),g&&(v.transform=g(x,v.transform));const{x:S,y:T}=this.projectionDelta;v.transformOrigin=`${S.origin*100}% ${T.origin*100}% 0`,b.animationValues?v.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:v.opacity=b===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const w in cc){if(x[w]===void 0)continue;const{correct:N,applyTo:k}=cc[w],E=v.transform==="none"?x[w]:N(x[w],b);if(k){const A=k.length;for(let R=0;R<A;R++)v[k[R]]=E}else v[w]=E}return this.options.layoutId&&(v.pointerEvents=b===this?nc(f==null?void 0:f.pointerEvents)||"":"none"),v}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>{var p;return(p=f.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(y0),this.root.sharedNodes.clear()}}}function n2(n){n.updateLayout()}function a2(n){var a;const i=((a=n.resumeFrom)===null||a===void 0?void 0:a.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&i&&n.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:c}=n.layout,{animationType:u}=n.options,f=i.source!==n.layout.source;u==="size"?Bn(b=>{const x=f?i.measuredBox[b]:i.layoutBox[b],S=xn(x);x.min=o[b].min,x.max=x.min+S}):l_(u,i.layoutBox,o)&&Bn(b=>{const x=f?i.measuredBox[b]:i.layoutBox[b],S=xn(o[b]);x.max=x.min+S,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[b].max=n.relativeTarget[b].min+S)});const p=zi();rl(p,o,i.layoutBox);const m=zi();f?rl(m,n.applyTransform(c,!0),i.measuredBox):rl(m,o,i.layoutBox);const v=!a_(p);let g=!1;if(!n.resumeFrom){const b=n.getClosestProjectingParent();if(b&&!b.resumeFrom){const{snapshot:x,layout:S}=b;if(x&&S){const T=Tt();cl(T,i.layoutBox,x.layoutBox);const w=Tt();cl(w,o,S.layoutBox),s_(T,w)||(g=!0),b.options.layoutRoot&&(n.relativeTarget=w,n.relativeTargetOrigin=T,n.relativeParent=b)}}}n.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:v,hasRelativeTargetChanged:g})}else if(n.isLead()){const{onExitComplete:o}=n.options;o&&o()}n.options.transition=void 0}function s2(n){nl&&Is.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function i2(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function o2(n){n.clearSnapshot()}function y0(n){n.clearMeasurements()}function l2(n){n.isLayoutDirty=!1}function r2(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function b0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function c2(n){n.resolveTargetDelta()}function u2(n){n.calcProjection()}function d2(n){n.resetSkewAndRotation()}function f2(n){n.removeLeadSnapshot()}function x0(n,a,i){n.translate=vt(a.translate,0,i),n.scale=vt(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function _0(n,a,i,o){n.min=vt(a.min,i.min,o),n.max=vt(a.max,i.max,o)}function h2(n,a,i,o){_0(n.x,a.x,i.x,o),_0(n.y,a.y,i.y,o)}function p2(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const m2={duration:.45,ease:[.4,0,.1,1]},S0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),T0=S0("applewebkit/")&&!S0("chrome/")?Math.round:bn;function k0(n){n.min=T0(n.min),n.max=T0(n.max)}function v2(n){k0(n.x),k0(n.y)}function l_(n,a,i){return n==="position"||n==="preserve-aspect"&&!bE(m0(a),m0(i),.2)}function g2(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const y2=o_({attachResizeListener:(n,a)=>gl(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),uf={current:void 0},r_=o_({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!uf.current){const n=new y2({});n.mount(window),n.setOptions({layoutScroll:!0}),uf.current=n}return uf.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),b2={pan:{Feature:BE},drag:{Feature:OE,ProjectionNode:r_,MeasureLayout:e_}};function x2(n,a,i){var o;if(n instanceof Element)return[n];if(typeof n=="string"){let c=document;const u=(o=void 0)!==null&&o!==void 0?o:c.querySelectorAll(n);return u?Array.from(u):[]}return Array.from(n)}function c_(n,a){const i=x2(n),o=new AbortController,c={passive:!0,...a,signal:o.signal};return[i,c,()=>o.abort()]}function j0(n){return a=>{a.pointerType==="touch"||$x()||n(a)}}function _2(n,a,i={}){const[o,c,u]=c_(n,i),f=j0(p=>{const{target:m}=p,v=a(p);if(typeof v!="function"||!m)return;const g=j0(b=>{v(b),m.removeEventListener("pointerleave",g)});m.addEventListener("pointerleave",g,c)});return o.forEach(p=>{p.addEventListener("pointerenter",f,c)}),u}function N0(n,a,i){const{props:o}=n;n.animationState&&o.whileHover&&n.animationState.setActive("whileHover",i==="Start");const c="onHover"+i,u=o[c];u&&ut.postRender(()=>u(a,kl(a)))}class S2 extends fs{mount(){const{current:a}=this.node;a&&(this.unmount=_2(a,i=>(N0(this.node,i,"Start"),o=>N0(this.node,o,"End"))))}unmount(){}}class T2 extends fs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch{a=!0}!a||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Tl(gl(this.node.current,"focus",()=>this.onFocus()),gl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const u_=(n,a)=>a?n===a?!0:u_(n,a.parentElement):!1,k2=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function j2(n){return k2.has(n.tagName)||n.tabIndex!==-1}const al=new WeakSet;function w0(n){return a=>{a.key==="Enter"&&n(a)}}function df(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const N2=(n,a)=>{const i=n.currentTarget;if(!i)return;const o=w0(()=>{if(al.has(i))return;df(i,"down");const c=w0(()=>{df(i,"up")}),u=()=>df(i,"cancel");i.addEventListener("keyup",c,a),i.addEventListener("blur",u,a)});i.addEventListener("keydown",o,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),a)};function C0(n){return Gh(n)&&!$x()}function w2(n,a,i={}){const[o,c,u]=c_(n,i),f=p=>{const m=p.currentTarget;if(!C0(p)||al.has(m))return;al.add(m);const v=a(p),g=(S,T)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",x),!(!C0(S)||!al.has(m))&&(al.delete(m),typeof v=="function"&&v(S,{success:T}))},b=S=>{g(S,i.useGlobalTarget||u_(m,S.target))},x=S=>{g(S,!1)};window.addEventListener("pointerup",b,c),window.addEventListener("pointercancel",x,c)};return o.forEach(p=>{!j2(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",f,c),p.addEventListener("focus",v=>N2(v,c),c)}),u}function E0(n,a,i){const{props:o}=n;n.animationState&&o.whileTap&&n.animationState.setActive("whileTap",i==="Start");const c="onTap"+(i==="End"?"":i),u=o[c];u&&ut.postRender(()=>u(a,kl(a)))}class C2 extends fs{mount(){const{current:a}=this.node;a&&(this.unmount=w2(a,i=>(E0(this.node,i,"Start"),(o,{success:c})=>E0(this.node,o,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ff=new WeakMap,ff=new WeakMap,E2=n=>{const a=Ff.get(n.target);a&&a(n)},A2=n=>{n.forEach(E2)};function D2({root:n,...a}){const i=n||document;ff.has(i)||ff.set(i,{});const o=ff.get(i),c=JSON.stringify(a);return o[c]||(o[c]=new IntersectionObserver(A2,{root:n,...a})),o[c]}function R2(n,a,i){const o=D2(a);return Ff.set(n,i),o.observe(n),()=>{Ff.delete(n),o.unobserve(n)}}const M2={some:0,all:1};class O2 extends fs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:o,amount:c="some",once:u}=a,f={root:i?i.current:void 0,rootMargin:o,threshold:typeof c=="number"?c:M2[c]},p=m=>{const{isIntersecting:v}=m;if(this.isInView===v||(this.isInView=v,u&&!v&&this.hasEnteredView))return;v&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",v);const{onViewportEnter:g,onViewportLeave:b}=this.node.getProps(),x=v?g:b;x&&x(m)};return R2(this.node.current,f,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(B2(a,i))&&this.startObserver()}unmount(){}}function B2({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const L2={inView:{Feature:O2},tap:{Feature:C2},focus:{Feature:T2},hover:{Feature:S2}},I2={layout:{ProjectionNode:r_,MeasureLayout:e_}},mc={current:null},$h={current:!1};function d_(){if($h.current=!0,!!hh)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>mc.current=n.matches;n.addListener(a),a()}else mc.current=!1}const z2=[...Rx,Zt,cs],U2=n=>z2.find(Dx(n)),A0=new WeakMap;function V2(n,a,i){for(const o in a){const c=a[o],u=i[o];if(Xt(c))n.addValue(o,c);else if(Xt(u))n.addValue(o,ml(c,{owner:n}));else if(u!==c)if(n.hasValue(o)){const f=n.getValue(o);f.liveStyle===!0?f.jump(c):f.hasAnimated||f.set(c)}else{const f=n.getStaticValue(o);n.addValue(o,ml(f!==void 0?f:c,{owner:n}))}}for(const o in i)a[o]===void 0&&n.removeValue(o);return a}const D0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class H2{scrapeMotionValuesFromProps(a,i,o){return{}}constructor({parent:a,props:i,presenceContext:o,reducedMotionConfig:c,blockInitialAnimation:u,visualState:f},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Uh,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=ta.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,ut.render(this.render,!1,!0))};const{latestValues:m,renderState:v,onUpdate:g}=f;this.onUpdate=g,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=v,this.parent=a,this.props=i,this.presenceContext=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=c,this.options=p,this.blockInitialAnimation=!!u,this.isControllingVariants=wc(i),this.isVariantNode=$b(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:b,...x}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in x){const T=x[S];m[S]!==void 0&&Xt(T)&&T.set(m[S],!1)}}mount(a){this.current=a,A0.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,o)=>this.bindToMotionValue(o,i)),$h.current||d_(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:mc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){A0.delete(this.current),this.projection&&this.projection.unmount(),rs(this.notifyUpdate),rs(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const i=this.features[a];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(a,i){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const o=Ys.has(a),c=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&ut.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),u=i.on("renderRequest",this.scheduleRender);let f;window.MotionCheckAppearSync&&(f=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{c(),u(),f&&f(),i.owner&&i.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in Ki){const i=Ki[a];if(!i)continue;const{isEnabled:o,Feature:c}=i;if(!this.features[a]&&c&&o(this.props)&&(this.features[a]=new c(this)),this.features[a]){const u=this.features[a];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Tt()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,i){this.latestValues[a]=i}update(a,i){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let o=0;o<D0.length;o++){const c=D0[o];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);const u="on"+c,f=a[u];f&&(this.propEventSubscriptions[c]=this.on(c,f))}this.prevMotionValues=V2(this,this.scrapeMotionValuesFromProps(a,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(a){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(a),()=>i.variantChildren.delete(a)}addValue(a,i){const o=this.values.get(a);i!==o&&(o&&this.removeValue(a),this.bindToMotionValue(a,i),this.values.set(a,i),this.latestValues[a]=i.get())}removeValue(a){this.values.delete(a);const i=this.valueSubscriptions.get(a);i&&(i(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,i){if(this.props.values&&this.props.values[a])return this.props.values[a];let o=this.values.get(a);return o===void 0&&i!==void 0&&(o=ml(i===null?void 0:i,{owner:this}),this.addValue(a,o)),o}readValue(a,i){var o;let c=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(o=this.getBaseTargetFromProps(this.props,a))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,a,this.options);return c!=null&&(typeof c=="string"&&(Ex(c)||xx(c))?c=parseFloat(c):!U2(c)&&cs.test(i)&&(c=Nx(a,i)),this.setBaseTarget(a,Xt(c)?c.get():c)),Xt(c)?c.get():c}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:o}=this.props;let c;if(typeof o=="string"||typeof o=="object"){const f=bh(this.props,o,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);f&&(c=f[a])}if(o&&c!==void 0)return c;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!Xt(u)?u:this.initialValues[a]!==void 0&&c===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new Ah),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class f_ extends H2{constructor(){super(...arguments),this.KeyframeResolver=Mx}sortInstanceNodePosition(a,i){return a.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(a,i){return a.style?a.style[i]:void 0}removeValueFromRenderState(a,{vars:i,style:o}){delete i[a],delete o[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Xt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function P2(n){return window.getComputedStyle(n)}class G2 extends f_{constructor(){super(...arguments),this.type="html",this.renderInstance=Jb}readValueFromInstance(a,i){if(Ys.has(i)){const o=zh(i);return o&&o.default||0}else{const o=P2(a),c=(Xb(i)?o.getPropertyValue(i):o[i])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Qx(a,i)}build(a,i,o){Sh(a,i,o.transformTemplate)}scrapeMotionValuesFromProps(a,i,o){return Nh(a,i,o)}}class $2 extends f_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Tt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Ys.has(i)){const o=zh(i);return o&&o.default||0}return i=ex.has(i)?i:vh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,o){return ax(a,i,o)}build(a,i,o){Th(a,i,this.isSVGTag,o.transformTemplate)}renderInstance(a,i,o,c){tx(a,i,o,c)}mount(a){this.isSVGTag=jh(a.tagName),super.mount(a)}}const q2=(n,a)=>yh(n)?new $2(a):new G2(a,{allowProjection:n!==y.Fragment}),K2=yw({...cE,...L2,...b2,...I2},q2),At=MN(K2);function F2(){!$h.current&&d_();const[n]=y.useState(mc.current);return n}const Yf={not_started:{color:"var(--text-tertiary)",icon:"○",label:"Not Started"},working:{color:"var(--accent-green)",icon:"●",label:"Working"},paused:{color:"var(--accent-yellow)",icon:"◉",label:"Paused"},complete:{color:"var(--accent-green)",icon:"✓",label:"Complete"},failed:{color:"var(--accent-red)",icon:"✗",label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:"⦸",label:"Blocked"}};function us(n){return n==="blocked"?Yf.blocked:Yf[qh(n)]}const Y2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function Z2(n){return Y2[qh(n)]??"statusPending"}const X2=["working","paused","failed","not_started","blocked","complete"],R0=["not_started","working","paused","complete","failed"],W2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function qh(n){return n in Yf&&n!=="blocked"?n:W2[n]??"not_started"}const Q2={not_started:"--text-tertiary",working:"--accent-green",paused:"--accent-yellow",complete:"--accent-green",failed:"--accent-red",pending:"--text-tertiary",assigned:"--text-tertiary",in_progress:"--accent-green",review:"--accent-yellow",done:"--accent-green",waiting_input:"--accent-yellow"};function J2(n){if(n.length===0)return[];const a=[...n].sort((o,c)=>o[0]-c[0]),i=[[a[0][0],a[0][1]]];for(let o=1;o<a.length;o++){const c=i[i.length-1],[u,f]=a[o];u<=c[1]+1?c[1]=Math.max(c[1],f):i.push([u,f])}return i}function h_({text:n,indices:a,highlightClass:i}){if(!a||a.length===0)return r.jsx(r.Fragment,{children:n});const o=J2(a),c=[];let u=0;for(const[f,p]of o)f>u&&c.push(r.jsx("span",{children:n.slice(u,f)},`p${u}`)),c.push(r.jsx("mark",{className:i,children:n.slice(f,p+1)},`m${f}`)),u=p+1;return u<n.length&&c.push(r.jsx("span",{children:n.slice(u)},`p${u}`)),r.jsx(r.Fragment,{children:c})}function eA(n){const a=new Map(n.map(o=>[o.id,{...o,children:[]}])),i=[];for(const o of a.values())o.parentTaskId&&a.has(o.parentTaskId)?a.get(o.parentTaskId).children.push(o):i.push(o);for(const o of a.values())o.children.sort((c,u)=>c.sortOrder-u.sortOrder);return i.sort((o,c)=>o.sortOrder-c.sortOrder)}function tA(n,a){const i=new Map;for(const u of n){const p=u.dependsOn.length>0&&u.dependsOn.some(v=>a.get(v)!=="complete")?"blocked":u.status,m=i.get(p);m?m.push(u):i.set(p,[u])}const o=[],c=new Set;for(const u of X2){c.add(u);const f=i.get(u);if(f&&f.length>0){f.sort((m,v)=>m.sortOrder-v.sortOrder);const p=us(u);o.push({status:u,label:p.label,style:p,tasks:f})}}for(const[u,f]of i)if(!c.has(u)&&f.length>0){f.sort((m,v)=>m.sortOrder-v.sortOrder);const p=us(u);o.push({status:u,label:p.label,style:p,tasks:f})}return o}const nA="_container_z4i38_1",aA="_header_z4i38_5",sA="_headerActions_z4i38_17",iA="_searchInput_z4i38_23",oA="_searchHighlight_z4i38_56",lA="_groupToggle_z4i38_62",rA="_groupToggleActive_z4i38_89",cA="_addButton_z4i38_93",uA="_taskRow_z4i38_120",dA="_selected_z4i38_140",fA="_expandArrow_z4i38_150",hA="_expanded_z4i38_157",pA="_leafSpacer_z4i38_161",mA="_taskStatusIcon_z4i38_166",vA="_taskTitle_z4i38_170",gA="_workspaceBadge_z4i38_177",yA="_childCountBadge_z4i38_195",bA="_dependencyBadge_z4i38_208",xA="_blockedBadge_z4i38_220",_A="_addChildButton_z4i38_225",SA="_emptyState_z4i38_268",TA="_statusGroupHeader_z4i38_275",kA="_statusGroupIcon_z4i38_294",jA="_statusGroupLabel_z4i38_298",NA="_statusGroupCount_z4i38_303",Ge={container:nA,header:aA,headerActions:sA,searchInput:iA,searchHighlight:oA,groupToggle:lA,groupToggleActive:rA,addButton:cA,taskRow:uA,selected:dA,expandArrow:fA,expanded:hA,leafSpacer:pA,taskStatusIcon:mA,taskTitle:vA,workspaceBadge:gA,childCountBadge:yA,dependencyBadge:bA,blockedBadge:xA,addChildButton:_A,emptyState:SA,statusGroupHeader:TA,statusGroupIcon:kA,statusGroupLabel:jA,statusGroupCount:NA},wA=[{name:"title",weight:2},{name:"description",weight:1}],p_=16,CA=16,m_="grackle-task-group-by-status";function M0(){try{return localStorage.getItem(m_)==="true"}catch{return!1}}function EA(n){try{localStorage.setItem(m_,String(n))}catch{}}function AA({group:n,isExpanded:a,onToggle:i,selectedTaskId:o,navigate:c,titleHighlights:u,workspaceNames:f}){return r.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[r.jsxs("div",{className:Ge.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i())},children:[r.jsx("span",{className:`${Ge.expandArrow} ${a?Ge.expanded:""}`,children:"▸"}),r.jsx("span",{className:Ge.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),r.jsx("span",{className:Ge.statusGroupLabel,children:n.label}),r.jsx("span",{className:Ge.statusGroupCount,children:n.tasks.length})]}),r.jsx(aa,{children:a&&r.jsx(At.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:n.tasks.map(p=>{const m=us(p.status),v=o===p.id,g=p.parentTaskId||!p.workspaceId?void 0:f.get(p.workspaceId);return r.jsxs("div",{onClick:()=>c(na(p.id)),className:`${Ge.taskRow} ${v?Ge.selected:""}`,style:{"--task-indent":`${p_}px`},"data-task-id":p.id,children:[r.jsx("span",{className:Ge.leafSpacer}),r.jsx("span",{className:Ge.taskStatusIcon,style:{color:m.color},children:m.icon}),r.jsx("span",{className:Ge.taskTitle,title:p.title,children:r.jsx(h_,{text:p.title,indices:u.get(p.id),highlightClass:Ge.searchHighlight})}),g&&r.jsx("span",{className:Ge.workspaceBadge,title:g,children:g})]},p.id)})})})]})}function v_({node:n,depth:a,expandedTasks:i,toggleTask:o,selectedTaskId:c,navigate:u,taskStatusById:f,titleHighlights:p,workspaceNames:m}){const v=us(n.status),g=n.dependsOn.length>0&&n.dependsOn.some(k=>f.get(k)!=="complete"),b=i.has(n.id),x=n.children.length>0,S=c===n.id,T=p_+a*CA,N=a===0&&!n.parentTaskId&&n.workspaceId?m.get(n.workspaceId):void 0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{onClick:()=>u(na(n.id)),className:`${Ge.taskRow} ${S?Ge.selected:""}`,style:{"--task-indent":`${T}px`},"data-task-id":n.id,children:[x&&r.jsx("span",{className:`${Ge.expandArrow} ${b?Ge.expanded:""}`,role:"button",tabIndex:0,"aria-label":b?"Collapse task":"Expand task",onClick:k=>{k.stopPropagation(),o(n.id)},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),o(n.id))},children:"▸"}),!x&&r.jsx("span",{className:Ge.leafSpacer}),r.jsx("span",{className:Ge.taskStatusIcon,style:{color:v.color},children:v.icon}),r.jsx("span",{className:Ge.taskTitle,title:n.title,children:r.jsx(h_,{text:n.title,indices:p.get(n.id),highlightClass:Ge.searchHighlight})}),N&&r.jsx("span",{className:Ge.workspaceBadge,title:N,children:N}),x&&r.jsxs("span",{className:Ge.childCountBadge,children:[n.children.filter(k=>k.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&r.jsx("span",{className:`${Ge.dependencyBadge} ${g?Ge.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:g?"blocked":"dep"}),a<oT&&r.jsx("button",{onClick:k=>{k.stopPropagation(),u(Fs(n.workspaceId,n.id))},title:"Add child task","aria-label":"Add child task",className:Ge.addChildButton,children:"+"})]}),r.jsx(aa,{children:x&&b&&r.jsx(At.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:n.children.map(k=>r.jsx(v_,{node:k,depth:a+1,expandedTasks:i,toggleTask:o,selectedTaskId:c,navigate:u,taskStatusById:f,titleHighlights:p,workspaceNames:m},k.id))})})]})}function DA({workspaces:n,tasks:a}){const i=xt(),[o,c]=y.useState(new Set),[u,f]=y.useState(new Set),[p,m]=y.useState(M0),[v,g]=y.useState(M0),[b,x]=y.useState(new Map),S=Et("/tasks/:taskId/*"),T=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,w=y.useMemo(()=>new Map(a.map(q=>[q.id,q.status])),[a]),N=y.useMemo(()=>new Map(n.map(q=>[q.id,q.name])),[n]),k=()=>{const q=!p;EA(q),m(q),q&&(g(!0),x(new Map))},E=q=>{x(ae=>{const O=new Map(ae),G=O.has(q)?O.get(q):v;return O.set(q,!G),O})},A=q=>b.has(q)?b.get(q):v,R=q=>{c(ae=>{const O=new Set(ae);return O.has(q)?(O.delete(q),f(G=>new Set(G).add(q))):(O.add(q),f(G=>{const W=new Set(G);return W.delete(q),W})),O})};y.useEffect(()=>{const q=new Set(a.filter(ae=>ae.parentTaskId).map(ae=>ae.parentTaskId));q.size>0&&c(ae=>{const O=new Set(ae);for(const G of q)u.has(G)||O.add(G);return O})},[a,u]);const[C,z]=y.useState(""),{directMatchTaskIds:H,treeMatchTaskIds:B,titleHighlights:K}=y.useMemo(()=>{if(!C.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const q=iT(a,C,wA),ae=new Set(q.map(le=>le.item.id)),O=new Map;for(const le of q){const re=le.matches.find(Re=>Re.key==="title");re&&O.set(le.item.id,re.indices)}const G=new Set(ae),W=new Map(a.map(le=>[le.id,le]));for(const le of[...ae]){let re=W.get(le);for(;re!=null&&re.parentTaskId;)G.add(re.parentTaskId),re=W.get(re.parentTaskId)}return{directMatchTaskIds:ae,treeMatchTaskIds:G,titleHighlights:O}},[C,a]),Q=H!==null,se=Q?p?H:B:null,ne=se?a.filter(q=>se.has(q.id)):a,ce=p?[]:eA(ne);return r.jsxs("div",{className:Ge.container,children:[r.jsxs("div",{className:Ge.header,children:[r.jsx("span",{children:"Tasks"}),r.jsxs("div",{className:Ge.headerActions,children:[r.jsx("button",{className:`${Ge.groupToggle} ${p?Ge.groupToggleActive:""}`,onClick:k,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,title:p?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),r.jsx("button",{className:Ge.addButton,onClick:()=>i(Fs()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&r.jsx("input",{type:"text",value:C,onChange:q=>z(q.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Ge.searchInput,"data-testid":"sidebar-search"}),p?tA(ne,w).map(q=>r.jsx(AA,{group:q,isExpanded:A(q.status),onToggle:()=>E(q.status),selectedTaskId:T,navigate:i,titleHighlights:K,workspaceNames:N},q.status)):ce.map(q=>r.jsx(v_,{node:q,depth:0,expandedTasks:o,toggleTask:R,selectedTaskId:T,navigate:i,taskStatusById:w,titleHighlights:K,workspaceNames:N},q.id)),ne.length===0&&!Q&&r.jsx("div",{className:Ge.emptyState,children:"No tasks yet. Click + to create one."}),ne.length===0&&Q&&r.jsx("div",{className:Ge.emptyState,children:"No matching tasks"})]})}const RA="_nav_14i94_1",MA="_tab_14i94_24",OA="_tabActive_14i94_62",BA="_tabLabel_14i94_75",LA="_statusDot_14i94_81",IA="_pulse_14i94_87",zA="_addButton_14i94_99",UA="_empty_14i94_132",ss={nav:RA,tab:MA,tabActive:OA,tabLabel:BA,statusDot:LA,pulse:IA,addButton:zA,empty:UA},VA={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function HA({environments:n}){const a=xt(),i=y.useRef(null),o=Et("/environments/:environmentId"),c=Et("/environments/:environmentId/edit"),u=Et("/environments/:environmentId/workspaces/:workspaceId"),f=Et("/environments/:environmentId/workspaces/:workspaceId/*"),p=(o==null?void 0:o.params.environmentId)??(c==null?void 0:c.params.environmentId)??(u==null?void 0:u.params.environmentId)??(f==null?void 0:f.params.environmentId),m=p==="new"?void 0:p,v=y.useCallback(x=>{a(qi(x))},[a]),g=y.useCallback(x=>{var k;const S=(k=i.current)==null?void 0:k.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const T=Array.from(S).findIndex(E=>E===document.activeElement),w=T>=0?T:n.findIndex(E=>E.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<n.length&&a(qi(n[N].id)),S[N].focus()},[m,n,a]),b=m??(n.length>0?n[0].id:void 0);return r.jsxs("div",{className:ss.nav,"data-testid":"environment-nav",children:[r.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:g,children:n.map(x=>{const S=x.id===m,T=x.id===b,w=VA[x.status]||"var(--text-tertiary)",N=x.status==="connected";return r.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:T?0:-1,className:`${ss.tab} ${S?ss.tabActive:""}`,onClick:()=>v(x.id),"data-testid":"env-nav-item",children:[r.jsx("span",{className:`${ss.statusDot} ${N?ss.pulse:""}`,style:{color:w},children:"●"}),r.jsx("span",{className:ss.tabLabel,title:x.displayName||x.id,children:x.displayName||x.id})]},x.id)})}),r.jsx("button",{type:"button",className:ss.addButton,onClick:()=>a(aj),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),n.length===0&&r.jsx("div",{className:ss.empty,children:"No environments yet."})]})}const PA="_nav_1bhou_1",GA="_tab_1bhou_24",$A="_tabIcon_1bhou_62",qA="_tabActive_1bhou_68",Yr={nav:PA,tab:GA,tabIcon:$A,tabActive:qA},Ta=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"shortcuts",label:"Shortcuts",icon:"⌨️"},{path:"about",label:"About",icon:"ℹ️"}];function KA(){var f;const n=Lt(),a=xt(),i=y.useRef(null),o=((f=Ta.find(p=>{const m=`${Pi}/${p.path}`;return n.pathname===m||n.pathname.startsWith(`${m}/`)}))==null?void 0:f.path)??Ta[0].path,c=y.useCallback(p=>{a(`${Pi}/${p}`)},[a]),u=y.useCallback(p=>{var S,T;const m=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const v=Array.from(m).findIndex(w=>w===document.activeElement),g=v>=0?v:Ta.findIndex(w=>w.path===o);let b=g;if(p.key==="ArrowDown"||p.key==="j"||p.key==="J")p.preventDefault(),b=(g+1)%Ta.length;else if(p.key==="ArrowUp"||p.key==="k"||p.key==="K")p.preventDefault(),b=(g-1+Ta.length)%Ta.length;else if(p.key==="Home")p.preventDefault(),b=0;else if(p.key==="End")p.preventDefault(),b=Ta.length-1;else return;const x=Ta[b].path;a(`${Pi}/${x}`),(T=m[b])==null||T.focus()},[o,a]);return r.jsx("nav",{className:Yr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:u,children:Ta.map(p=>{const m=p.path===o;return r.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Yr.tab} ${m?Yr.tabActive:""}`,onClick:()=>c(p.path),children:[r.jsx("span",{className:Yr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const FA="_nav_1snmp_1",YA="_searchForm_1snmp_8",ZA="_searchInput_1snmp_15",XA="_searchButton_1snmp_33",WA="_clearButton_1snmp_68",QA="_workspaceSelect_1snmp_85",JA="_listHeader_1snmp_99",eD="_nodeList_1snmp_108",tD="_nodeItem_1snmp_116",nD="_indicator_1snmp_129",aD="_label_1snmp_136",sD="_badge_1snmp_145",On={nav:FA,searchForm:YA,searchInput:ZA,searchButton:XA,clearButton:WA,workspaceSelect:QA,listHeader:JA,nodeList:eD,nodeItem:tD,indicator:nD,label:aD,badge:sD};function iD({nodes:n,workspaces:a,loading:i,searchQuery:o,onSearch:c,onClearSearch:u,onSelectNode:f,onWorkspaceChange:p}){const[m,v]=y.useState(""),g=y.useCallback(T=>{T.preventDefault(),m.trim()&&c(m.trim())},[m,c]),b=y.useCallback(()=>{v(""),u()},[u]),x=y.useCallback(T=>{f(T)},[f]),S=y.useCallback(T=>{v(""),p(T)},[p]);return r.jsxs("div",{className:On.nav,"data-testid":"knowledge-nav",children:[r.jsxs("form",{className:On.searchForm,onSubmit:g,children:[r.jsx("input",{className:On.searchInput,type:"text",placeholder:"Search...",value:m,onChange:T=>{v(T.target.value)},"data-testid":"knowledge-search-input"}),r.jsx("button",{type:"submit",className:On.searchButton,disabled:i,children:"Go"})]}),o&&r.jsx("button",{type:"button",className:On.clearButton,onClick:b,children:"Clear search"}),r.jsxs("select",{className:On.workspaceSelect,onChange:T=>{S(T.target.value)},"data-testid":"knowledge-workspace-filter",children:[r.jsx("option",{value:"",children:"All workspaces"}),a.map(T=>r.jsx("option",{value:T.id,children:T.name},T.id))]}),r.jsxs("div",{className:On.listHeader,children:["Nodes (",n.length,")"]}),r.jsx("ul",{className:On.nodeList,children:n.map(T=>r.jsxs("li",{className:On.nodeItem,onClick:()=>{x(T.id)},onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),x(T.id))},role:"button",tabIndex:0,children:[r.jsx("span",{className:On.indicator,style:{backgroundColor:T.kind==="reference"?"#4A9EFF":T.category==="decision"?"#22C55E":T.category==="concept"?"#A855F7":T.category==="snippet"?"#6B7280":"#EAB308"}}),r.jsx("span",{className:On.label,children:T.label}),r.jsx("span",{className:On.badge,children:T.kind==="reference"?T.sourceType:T.category})]},T.id))})]})}function oD(){const{workspaces:n,tasks:a}=dt(),i=y.useMemo(()=>r.jsx(DA,{workspaces:n,tasks:a}),[n,a]);return Tc(i),r.jsx(Ks,{})}function lD(){const{environments:n}=dt(),a=y.useMemo(()=>r.jsx(HA,{environments:n}),[n]);return Tc(a),r.jsx(Ks,{})}function rD(){const n=y.useMemo(()=>r.jsx(KA,{}),[]);return Tc(n),r.jsx(Ks,{})}function cD(){const{knowledge:n,workspaces:a}=dt(),i=y.useCallback(p=>{n.search(p)},[n]),o=y.useCallback(()=>{n.clearSearch()},[n]),c=y.useCallback(p=>{n.selectNode(p)},[n]),u=y.useCallback(p=>{n.loadRecent(p||void 0)},[n]),f=y.useMemo(()=>r.jsx(iD,{nodes:n.graphData.nodes,workspaces:a,loading:n.loading,searchQuery:n.searchQuery,onSearch:i,onClearSearch:o,onSelectNode:c,onWorkspaceChange:u}),[n,a,i,o,c,u]);return Tc(f),r.jsx(Ks,{})}const uD="_bar_tnfsh_1",dD="_btnPrimary_tnfsh_32",fD="_statusText_tnfsh_85",hD="_statusCompleted_tnfsh_90",pD="_statusFailed_tnfsh_94",mD="_statusBlocked_tnfsh_98",vD="_hintText_tnfsh_103",ht={bar:uD,btnPrimary:dD,statusText:fD,statusCompleted:hD,statusFailed:pD,statusBlocked:mD,hintText:vD};function gD({sessions:n,tasks:a,environments:i}){const o=xt(),c=Lt(),u=Et("/sessions/:sessionId"),f=Et("/tasks/:taskId"),p=Et("/tasks/:taskId/stream"),m=Et("/tasks/:taskId/findings"),v=Et("/tasks/:taskId/edit"),g=Et("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),b=Et("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),x=Et("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=Et("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),T=Et("/sessions/new"),w=Et("/environments/:environmentId/workspaces/:workspaceId"),N=Et("/tasks/new"),k=Et("/chat"),E=Et("/"),A=Et("/settings/*"),R=u==null?void 0:u.params.sessionId,C=(f==null?void 0:f.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(g==null?void 0:g.params.taskId)??(b==null?void 0:b.params.taskId)??(x==null?void 0:x.params.taskId)??(S==null?void 0:S.params.taskId),z=g??b??x??S,H=(z==null?void 0:z.params.environmentId)??(w==null?void 0:w.params.environmentId),B=c.pathname.startsWith("/environments")&&!w&&!z,K=!!k,Q=!!T,se=!!w&&!g&&!b&&!x&&!S,ne=!!N;if(!!E&&!Q&&!se&&!ne||!!A||(!!v||!!S)||ne||B||Q)return r.jsx(r.Fragment,{});if(K)return i.find(G=>G.adapterType==="local"&&G.status==="connected")?r.jsx(r.Fragment,{}):r.jsx("div",{className:ht.bar,children:r.jsx("span",{className:ht.hintText,children:"Add a local environment to start chatting"})});if(se)return r.jsx("div",{className:ht.bar,children:r.jsx("span",{className:ht.hintText,children:"Select a task or click + to create one"})});if(C){const O=a.find(le=>le.id===C);if(!O)return r.jsx("div",{className:ht.bar,children:r.jsx("span",{className:ht.hintText,children:"Loading..."})});const G=new Map(a.map(le=>[le.id,le])),W=O.dependsOn.some(le=>{const re=G.get(le);return re!==void 0&&re.status!=="complete"});if(O.status==="not_started"){const le=W?O.dependsOn.map(re=>G.get(re)).filter(re=>re&&re.status!=="complete").map(re=>re.title):[];return r.jsx("div",{className:ht.bar,children:W?r.jsxs("span",{className:ht.statusBlocked,children:["Blocked by: ",le.join(", ")]}):r.jsx("span",{className:ht.hintText,children:"Use the buttons above to start or manage this task"})})}if(O.status==="working"||O.status==="paused"){const le=O.latestSessionId||void 0,re=le?n.find(we=>we.id===le):void 0;return re&&re.status!=="stopped"?r.jsx(r.Fragment,{}):r.jsx("div",{className:ht.bar,children:r.jsx("span",{className:ht.hintText,children:"Waiting for agent..."})})}if(O.status==="complete")return r.jsxs("div",{className:ht.bar,children:[r.jsx("span",{className:`${ht.statusText} ${ht.statusCompleted}`,children:"Task completed"}),r.jsx("button",{onClick:()=>o(Fs(O.workspaceId,void 0,H)),className:ht.btnPrimary,children:"+ New Task"})]});if(O.status==="failed")return r.jsx("div",{className:ht.bar,children:r.jsx("span",{className:`${ht.statusText} ${ht.statusFailed}`,children:"Task failed"})})}if(R){const O=n.find(le=>le.id===R),G=(O==null?void 0:O.status)==="stopped";if(O!==void 0&&!G)return r.jsx(r.Fragment,{});if(G)return r.jsxs("div",{className:ht.bar,children:[r.jsxs("span",{className:`${ht.statusText} ${ht.hintText}`,children:["Session ",O.endReason||O.status]}),r.jsx("button",{onClick:()=>o(_b(O.environmentId)),className:ht.btnPrimary,children:"+ New Chat"})]})}return r.jsx("div",{className:ht.bar,children:r.jsx("span",{className:ht.hintText,children:"Loading..."})})}const yD="_toast_da8ll_1",bD="_success_da8ll_18",xD="_icon_da8ll_22",_D="_error_da8ll_25",SD="_warning_da8ll_32",TD="_info_da8ll_38",kD="_message_da8ll_53",jD="_close_da8ll_60",Qo={toast:yD,success:bD,icon:xD,error:_D,warning:SD,info:TD,message:kD,close:jD},ND={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function wD({toast:n,onDismiss:a}){return y.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),r.jsxs(At.div,{className:`${Qo.toast} ${Qo[n.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:[r.jsx("span",{className:Qo.icon,"aria-hidden":"true",children:ND[n.variant]}),r.jsx("span",{className:Qo.message,children:n.message}),r.jsx("button",{type:"button",className:Qo.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const CD="_container_qqse2_1",ED={container:CD};function AD(){const{toasts:n,dismissToast:a}=Da();return r.jsx("div",{className:ED.container,"data-testid":"toast-container",children:r.jsx(aa,{children:n.map(i=>r.jsx(wD,{toast:i,onDismiss:a},i.id))})})}const DD="_callout_1jaue_1",RD="_success_1jaue_11",MD="_icon_1jaue_15",OD="_error_1jaue_18",BD="_warning_1jaue_25",LD="_info_1jaue_32",ID="_content_1jaue_48",zD="_close_1jaue_53",Jo={callout:DD,success:RD,icon:MD,error:OD,warning:BD,info:LD,content:ID,close:zD},UD={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function VD({variant:n="info",children:a,dismissible:i=!1,className:o}){const[c,u]=y.useState(!1);return r.jsx(r.Fragment,{children:!c&&r.jsxs("div",{className:[Jo.callout,Jo[n],o].filter(Boolean).join(" "),role:n==="error"||n==="warning"?"alert":"status",children:[r.jsx("span",{className:Jo.icon,"aria-hidden":"true",children:UD[n]}),r.jsx("span",{className:Jo.content,children:a}),i&&r.jsx("button",{type:"button",className:Jo.close,onClick:()=>u(!0),"aria-label":"Dismiss",children:"×"})]})})}const HD="_breadcrumbs_17or2_1",PD="_list_17or2_11",GD="_item_17or2_21",$D="_separator_17or2_28",qD="_link_17or2_34",KD="_current_17or2_57",Oi={breadcrumbs:HD,list:PD,item:GD,separator:$D,link:qD,current:KD},FD="›";function hs({segments:n}){return r.jsx("nav",{className:Oi.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:r.jsx("ol",{className:Oi.list,children:n.map((a,i)=>{const o=i===n.length-1;return r.jsxs("li",{className:Oi.item,children:[i>0&&r.jsx("span",{className:Oi.separator,"aria-hidden":"true",children:FD}),a.url&&!o?r.jsx(lh,{className:Oi.link,to:a.url,title:a.label,children:a.label}):r.jsx("span",{className:Oi.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}const YD="_btn_dwk2o_1",ZD="_sm_dwk2o_22",XD="_md_dwk2o_28",WD="_lg_dwk2o_34",QD="_primary_dwk2o_40",JD="_danger_dwk2o_55",eR="_outline_dwk2o_70",tR="_ghost_dwk2o_80",hf={btn:YD,sm:ZD,md:XD,lg:WD,primary:QD,danger:JD,outline:eR,ghost:tR},ja=y.forwardRef(function({variant:a="primary",size:i="md",className:o,children:c,...u},f){const p=[hf.btn,hf[a],hf[i],o].filter(Boolean).join(" ");return r.jsx("button",{ref:f,className:p,...u,children:c})}),nR="_banner_bxqlh_1",aR="_label_bxqlh_15",sR="_text_bxqlh_25",iR="_link_bxqlh_29",Zr={banner:nR,label:aR,text:sR,link:iR};function oR(){return r.jsxs("div",{className:Zr.banner,"data-testid":"demo-banner",children:[r.jsx("span",{className:Zr.label,children:"DEMO"}),r.jsxs("span",{className:Zr.text,children:["This is an interactive demo with mock data."," ",r.jsx("a",{href:"https://github.com/nick-pape/grackle",target:"_blank",rel:"noopener noreferrer",className:Zr.link,children:"Install Grackle"})," ","to use it for real."]})]})}const lR="_container_og0yp_1",rR="_chevronButton_og0yp_6",cR="_mainButton_og0yp_6",uR="_sm_og0yp_34",dR="_md_og0yp_34",fR="_lg_og0yp_34",hR="_primary_og0yp_57",pR="_danger_og0yp_70",mR="_outline_og0yp_83",vR="_ghost_og0yp_92",gR="_dropdown_og0yp_100",yR="_option_og0yp_113",bR="_optionLabel_og0yp_130",xR="_optionDesc_og0yp_135",ka={container:lR,chevronButton:rR,mainButton:cR,sm:uR,md:dR,lg:fR,primary:hR,danger:pR,outline:mR,ghost:vR,dropdown:gR,option:yR,optionLabel:bR,optionDesc:xR};function g_({label:n,onClick:a,options:i,variant:o="primary",size:c="md","data-testid":u}){const[f,p]=y.useState(!1),m=y.useRef(null);y.useEffect(()=>{if(!f)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)},[f]),y.useEffect(()=>{if(!f)return;function x(S){S.key==="Escape"&&p(!1)}return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[f]);const v=ka[o]||"",g=ka[c]||"",b=()=>{f&&p(!1),a()};return r.jsxs("div",{ref:m,className:ka.container,"data-testid":u,children:[r.jsx("button",{type:"button",className:`${ka.mainButton} ${v} ${g}`,onClick:b,"data-testid":u?`${u}-main`:void 0,children:n}),r.jsx("button",{type:"button",className:`${ka.chevronButton} ${v} ${g}`,onClick:()=>p(x=>!x),"aria-label":`More options for ${n}`,"aria-haspopup":"menu","aria-expanded":f,"data-testid":u?`${u}-chevron`:void 0,children:"▾"}),f&&r.jsx("div",{className:ka.dropdown,"data-testid":u?`${u}-menu`:void 0,children:i.map((x,S)=>r.jsxs("button",{type:"button",className:ka.option,onClick:()=>{x.onClick(),p(!1)},children:[r.jsx("span",{className:ka.optionLabel,children:x.label}),x.description&&r.jsx("span",{className:ka.optionDesc,children:x.description})]},S))})]})}function Zf(){Zf=function(c,u){return new i(c,void 0,u)};var n=RegExp.prototype,a=new WeakMap;function i(c,u,f){var p=new RegExp(c,u);return a.set(p,f||a.get(c)),vc(p,i.prototype)}function o(c,u){var f=a.get(u);return Object.keys(f).reduce(function(p,m){var v=f[m];if(typeof v=="number")p[m]=c[v];else{for(var g=0;c[v[g]]===void 0&&g+1<v.length;)g++;p[m]=c[v[g]]}return p},Object.create(null))}return(function(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),u&&vc(c,u)})(i,RegExp),i.prototype.exec=function(c){var u=n.exec.call(this,c);if(u){u.groups=o(u,this);var f=u.indices;f&&(f.groups=o(f,this))}return u},i.prototype[Symbol.replace]=function(c,u){if(typeof u=="string"){var f=a.get(this);return n[Symbol.replace].call(this,c,u.replace(/\$<([^>]+)>/g,function(m,v){var g=f[v];return"$"+(Array.isArray(g)?g.join("$"):g)}))}if(typeof u=="function"){var p=this;return n[Symbol.replace].call(this,c,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(o(m,p)),u.apply(this,m)})}return n[Symbol.replace].call(this,c,u)},Zf.apply(this,arguments)}function vc(n,a){return vc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},vc(n,a)}function O0(n,a){(a==null||a>n.length)&&(a=n.length);for(var i=0,o=new Array(a);i<a;i++)o[i]=n[i];return o}function pf(n,a){var i=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i)return(i=i.call(n)).next.bind(i);if(Array.isArray(n)||(i=(function(c,u){if(c){if(typeof c=="string")return O0(c,u);var f=Object.prototype.toString.call(c).slice(8,-1);return f==="Object"&&c.constructor&&(f=c.constructor.name),f==="Map"||f==="Set"?Array.from(c):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?O0(c,u):void 0}})(n))||a){i&&(n=i);var o=0;return function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
130
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var _R=(function(n){return function(a){return a===void 0&&(a={}),(function(o,c){if(c&&!o.registered(c))throw new Error('The default language "'+c+'" is not registered with refractor.')})(n,a.defaultLanguage),function(o){PS(o,"element",i)};function i(o,c,u){var f,p;if(u&&u.tagName==="pre"&&o.tagName==="code"){var m=(o==null||(f=o.data)==null?void 0:f.meta)||(o==null||(p=o.properties)==null?void 0:p.metastring)||"";o.properties.className?typeof o.properties.className=="boolean"?o.properties.className=[]:Array.isArray(o.properties.className)||(o.properties.className=[o.properties.className]):o.properties.className=[];var v,g,b=(function(C){for(var z,H=pf(C.properties.className);!(z=H()).done;){var B=z.value;if(B.slice(0,9)==="language-")return B.slice(9).toLowerCase()}return null})(o);if(!b&&a.defaultLanguage&&o.properties.className.push("language-"+(b=a.defaultLanguage)),o.properties.className.push("code-highlight"),b)try{var x,S;S=(x=b)!=null&&x.includes("diff-")?b.split("-")[1]:b,v=n.highlight(Ur(o),S),u.properties.className=(u.properties.className||[]).concat("language-"+S)}catch(C){if(!a.ignoreMissing||!/Unknown language/.test(C.message))throw C;v=o}else v=o;v.children=(g=1,function C(z){return z.reduce(function(H,B){if(B.type==="text"){var K=B.value,Q=(K.match(/\n/g)||"").length;if(Q===0)B.position={start:{line:g,column:1},end:{line:g,column:1}},H.push(B);else for(var se,ne=K.split(`
|
|
131
|
-
`),ce=pf(ne.entries());!(se=ce()).done;){var q=se.value,ae=q[0],O=q[1];H.push({type:"text",value:ae===ne.length-1?O:O+`
|
|
132
|
-
`,position:{start:{line:g+ae,column:1},end:{line:g+ae,column:1}}})}return g+=Q,H}if(Object.prototype.hasOwnProperty.call(B,"children")){var G=g;return B.children=C(B.children),H.push(B),B.position={start:{line:G,column:1},end:{line:g,column:1}},H}return H.push(B),H},[])})(v.children),v.position=v.children.length>0?{start:{line:v.children[0].position.start.line,column:0},end:{line:v.children[v.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var T,w=(function(C){var z=/{([\d,-]+)}/,H=C.split(",").map(function(Q){return Q.trim()}).join();if(z.test(H)){var B=z.exec(H)[1],K=$S(B);return function(Q){return K.includes(Q+1)}}return function(){return!1}})(m),N=(function(C){var z=Zf(/showLineNumbers=(\d+)/i,{lines:1});if(z.test(C)){var H=z.exec(C);return Number(H.groups.lines)}return 1})(m),k=(function(C){for(var z=new Array(C),H=0;H<C;H++)z[H]={type:"element",tagName:"span",properties:{className:[]},children:[]};return z})(v.position.end.line),E=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],A=function(){var C,z,H=T.value,B=H[0],K=H[1];K.properties.className=["code-line"];var Q=qS(v,function(se){return se.position.start.line<=B+1&&se.position.end.line>=B+1});K.children=Q.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(b))&&!E.some(function(se){return m.toLowerCase().includes(se)})&&(K.properties.line=[(B+N).toString()],K.properties.className.push("line-number")),w(B)&&K.properties.className.push("highlight-line"),(b==="diff"||(C=b)!=null&&C.includes("diff-"))&&Ur(K).substring(0,1)==="-"?K.properties.className.push("deleted"):(b==="diff"||(z=b)!=null&&z.includes("diff-"))&&Ur(K).substring(0,1)==="+"&&K.properties.className.push("inserted")},R=pf(k.entries());!(T=R()).done;)A();k.length>0&&Ur(k[k.length-1]).trim()===""&&k.pop(),o.children=k}}}})(GS);function y_(n){if(n>=1e6)return`${(n/1e6).toFixed(1)}M`;if(n>=1e3){const a=Number((n/1e3).toFixed(1));return a>=1e3?`${(n/1e6).toFixed(1)}M`:`${a.toFixed(1)}k`}return String(n)}function Zi(n){return n===0?"-":n<.01?`$${n.toFixed(4)}`:`$${n.toFixed(2)}`}const SR={read:"file-read",view:"file-read",edit:"file-edit",file_change:"file-edit",write:"file-write",bash:"shell",command_execution:"shell",grep:"search",glob:"search",report_intent:"metadata"};function TR(n){return SR[n.toLowerCase()]??"generic"}const kR="_card_1km4d_2",jR="_cardBlue_1km4d_20",NR="_cardOrange_1km4d_24",wR="_cardGreen_1km4d_28",CR="_cardPurple_1km4d_32",ER="_cardNeutral_1km4d_36",AR="_cardRed_1km4d_40",DR="_header_1km4d_44",RR="_icon_1km4d_51",MR="_toolName_1km4d_58",OR="_fileName_1km4d_65",BR="_badge_1km4d_74",LR="_spacer_1km4d_81",IR="_bodyToggle_1km4d_85",zR="_chevron_1km4d_103",UR="_chevronExpanded_1km4d_108",VR="_pre_1km4d_112",HR="_diffAdd_1km4d_136",PR="_diffRemove_1km4d_148",GR="_diffContext_1km4d_160",$R="_diffHeader_1km4d_169",qR="_diffLine_1km4d_175",KR="_exitOk_1km4d_181",FR="_exitError_1km4d_187",YR="_exitPending_1km4d_193",ZR="_inProgress_1km4d_207",XR="_metadata_1km4d_211",WR="_metadataPrefix_1km4d_218",ie={card:kR,cardBlue:jR,cardOrange:NR,cardGreen:wR,cardPurple:CR,cardNeutral:ER,cardRed:AR,header:DR,icon:RR,toolName:MR,fileName:OR,badge:BR,spacer:LR,bodyToggle:IR,chevron:zR,chevronExpanded:UR,pre:VR,diffAdd:HR,diffRemove:PR,diffContext:GR,diffHeader:$R,diffLine:qR,exitOk:KR,exitError:FR,exitPending:YR,inProgress:ZR,metadata:XR,metadataPrefix:WR};function QR(n){if(n==null||typeof n!="object")return"";const a=n;return typeof a.file_path=="string"?a.file_path:typeof a.path=="string"?a.path:""}function JR(n){const a=n.split(/[/\\]/);return a[a.length-1]||n}const mf=5;function B0({tool:n,args:a,result:i,isError:o,writeVariant:c}){const[u,f]=y.useState(!1),p=QR(a),m=JR(p),v=i===void 0,g=o?ie.cardRed:c?ie.cardGreen:ie.cardBlue,b=c?"var(--accent-green)":"var(--accent-blue)",x=c?"📝":"📄",S=c?"tool-card-file-write":"tool-card-file-read",T=(i==null?void 0:i.split(`
|
|
133
|
-
`))??[],w=T.length>mf,N=u?T:T.slice(0,mf);return r.jsxs("div",{className:`${ie.card} ${g} ${v?ie.inProgress:""}`,"data-testid":S,children:[r.jsxs("div",{className:ie.header,children:[r.jsx("span",{className:ie.icon,children:x}),r.jsx("span",{className:ie.toolName,style:{color:b},children:n}),m&&r.jsx("span",{className:ie.fileName,title:p,children:m}),!v&&T.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:ie.spacer}),r.jsxs("span",{className:ie.badge,children:[T.length," lines"]})]})]}),o&&i&&r.jsx("pre",{className:ie.pre,"data-testid":"tool-card-error",children:i}),!o&&!v&&T.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("pre",{className:ie.pre,"data-testid":"tool-card-content",children:N.map((k,E)=>r.jsxs("span",{className:ie.diffLine,children:[r.jsx("span",{style:{color:"var(--text-tertiary)",userSelect:"none",marginRight:"var(--space-sm)",display:"inline-block",width:"3ch",textAlign:"right"},children:E+1}),k]},E))}),w&&r.jsxs("button",{type:"button",className:ie.bodyToggle,onClick:()=>{f(k=>!k)},"aria-expanded":u,"data-testid":"tool-card-toggle",children:[r.jsx("span",{className:`${ie.chevron} ${u?ie.chevronExpanded:""}`,children:"▸"}),u?"collapse":`${T.length-mf} more lines`]})]})]})}function eM(n){const a=n.split(`
|
|
134
|
-
`),i=[];for(const o of a)o.startsWith("diff --git")||o.startsWith("index ")||(o.startsWith("--- ")||o.startsWith("+++ "))&&!o.startsWith("---- ")&&!o.startsWith("++++ ")||(o.startsWith("@@")?i.push({type:"header",content:o}):o.startsWith("+")?i.push({type:"add",content:o.slice(1)}):o.startsWith("-")?i.push({type:"remove",content:o.slice(1)}):o.startsWith(" ")?i.push({type:"context",content:o.slice(1)}):o===""&&i.push({type:"context",content:""}));return i}function tM(n,a){const i=n.split(`
|
|
135
|
-
`),o=a.split(`
|
|
136
|
-
`),c=[];for(const u of i)c.push({type:"remove",content:u});for(const u of o)c.push({type:"add",content:u});return c}function nM(n){let a=0,i=0;for(const o of n)o.type==="add"&&a++,o.type==="remove"&&i++;return{added:a,removed:i}}function aM(n){if(n==null||typeof n!="object")return"";const a=n;return typeof a.file_path=="string"&&a.file_path||typeof a.path=="string"&&a.path||""}function sM(n){if(n===void 0||typeof n!="object"||n===null)return;const a=n,i=(typeof a.old_string=="string"?a.old_string:void 0)??(typeof a.old_str=="string"?a.old_str:void 0),o=(typeof a.new_string=="string"?a.new_string:void 0)??(typeof a.new_str=="string"?a.new_str:void 0);if(i!==void 0&&o!==void 0)return{oldStr:i,newStr:o}}function iM(n){const a=n.split(/[/\\]/);return a[a.length-1]||n}function oM(n,a){if(a){let o=a;if(a.trimStart().startsWith("{"))try{const c=JSON.parse(a);typeof c.detailedContent=="string"&&(o=c.detailedContent)}catch{}if(o.includes("@@")||o.startsWith("diff ")){const c=eM(o);if(c.length>0)return c}}const i=sM(n);if(i)return tM(i.oldStr,i.newStr)}const vf=5;function lM({tool:n,args:a,result:i,isError:o,detailedResult:c}){const[u,f]=y.useState(!1),p=aM(a),m=iM(p),v=i===void 0,g=oM(a,c),b=g?nM(g):null,x=((g==null?void 0:g.length)??0)>vf,S=u?g:g==null?void 0:g.slice(0,vf);return r.jsxs("div",{className:`${ie.card} ${o?ie.cardRed:ie.cardOrange} ${v?ie.inProgress:""}`,"data-testid":"tool-card-file-edit",children:[r.jsxs("div",{className:ie.header,children:[r.jsx("span",{className:ie.icon,children:"✏️"}),r.jsx("span",{className:ie.toolName,style:{color:"var(--accent-yellow)"},children:n}),m&&r.jsx("span",{className:ie.fileName,title:p,children:m}),b&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:ie.spacer}),r.jsxs("span",{className:ie.badge,"data-testid":"tool-card-diff-stats",children:[r.jsxs("span",{style:{color:"var(--accent-green)"},children:["+",b.added]})," ",r.jsxs("span",{style:{color:"var(--accent-red)"},children:["−",b.removed]})]})]})]}),o&&i&&r.jsx("pre",{className:ie.pre,"data-testid":"tool-card-error",children:i}),!o&&S&&S.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("pre",{className:ie.pre,"data-testid":"tool-card-diff",children:S.map((T,w)=>{let N=ie.diffContext;return T.type==="add"&&(N=ie.diffAdd),T.type==="remove"&&(N=ie.diffRemove),T.type==="header"&&(N=ie.diffHeader),r.jsx("span",{className:`${ie.diffLine} ${N}`,children:T.content},w)})}),x&&r.jsxs("button",{type:"button",className:ie.bodyToggle,onClick:()=>{f(T=>!T)},"aria-expanded":u,"data-testid":"tool-card-toggle",children:[r.jsx("span",{className:`${ie.chevron} ${u?ie.chevronExpanded:""}`,children:"▸"}),u?"collapse":`${((g==null?void 0:g.length)??0)-vf} more lines`]})]}),!o&&!g&&!v&&i&&r.jsx("pre",{className:ie.pre,"data-testid":"tool-card-content",children:i})]})}const rM=/^\[exit (\d+)\]\s*/;function cM(n){const a=rM.exec(n);return a?{exitCode:Number(a[1]),output:n.slice(a[0].length)}:{exitCode:void 0,output:n}}function uM(n){if(n==null||typeof n!="object")return"";const a=n;return typeof a.command=="string"?a.command:""}function dM(n){const a=/pwsh(?:\.exe)?["']?\s+-Command\s+'(.+?)'\s*$/i.exec(n);if(a)return a[1];const i=/pwsh(?:\.exe)?["']?\s+-Command\s+"(.+?)"\s*$/i.exec(n);return i?i[1]:n}const gf=3;function fM({tool:n,args:a,result:i,isError:o}){const[c,u]=y.useState(!1),f=uM(a),p=dM(f),m=i===void 0,v=i?cM(i):null,g=(v==null?void 0:v.output.split(`
|
|
137
|
-
`))??[],b=g.length>gf,x=c?g:g.slice(0,gf),S=v==null?void 0:v.exitCode,T=o||S!==void 0&&S!==0;return r.jsxs("div",{className:`${ie.card} ${T?ie.cardRed:ie.cardNeutral}`,"data-testid":"tool-card-shell",children:[r.jsxs("div",{className:ie.header,children:[r.jsx("span",{className:ie.icon,style:{color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontWeight:"bold"},children:"$"}),r.jsx("span",{className:ie.fileName,style:{flex:1,color:"var(--text-primary)"},title:f!==p?f:void 0,"data-testid":"tool-card-command",children:p}),S!==void 0&&r.jsxs("span",{className:S===0?ie.exitOk:ie.exitError,"data-testid":"tool-card-exit-code",children:[S===0?"✓":"✗"," exit ",S]}),m&&r.jsx("span",{className:ie.exitPending,"data-testid":"tool-card-pending",children:"●"})]}),!m&&v&&v.output.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("pre",{className:ie.pre,"data-testid":"tool-card-output",children:x.join(`
|
|
138
|
-
`)}),b&&r.jsxs("button",{type:"button",className:ie.bodyToggle,onClick:()=>{u(w=>!w)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[r.jsx("span",{className:`${ie.chevron} ${c?ie.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${g.length-gf} more lines`]})]})]})}function hM(n){if(n==null||typeof n!="object")return{pattern:"",path:""};const a=n,i=typeof a.pattern=="string"?a.pattern:"",o=typeof a.path=="string"?a.path:"";return{pattern:i,path:o}}const yf=5;function pM({tool:n,args:a,result:i,isError:o}){const[c,u]=y.useState(!1),{pattern:f,path:p}=hM(a),m=i===void 0,v=(i==null?void 0:i.split(`
|
|
139
|
-
`).filter(x=>x.length>0))??[],g=v.length>yf,b=c?v:v.slice(0,yf);return r.jsxs("div",{className:`${ie.card} ${o?ie.cardRed:ie.cardPurple} ${m?ie.inProgress:""}`,"data-testid":"tool-card-search",children:[r.jsxs("div",{className:ie.header,children:[r.jsx("span",{className:ie.icon,children:"🔍"}),r.jsx("span",{className:ie.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:n}),f&&r.jsxs("span",{className:ie.fileName,"data-testid":"tool-card-pattern",children:['"',f,'"']}),p&&r.jsxs("span",{className:ie.fileName,style:{flexShrink:1},"data-testid":"tool-card-search-path",children:["in ",p]}),!m&&!o&&v.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:ie.spacer}),r.jsxs("span",{className:ie.badge,"data-testid":"tool-card-match-count",children:[v.length," ",v.length===1?"match":"matches"]})]})]}),o&&i&&r.jsx("pre",{className:ie.pre,"data-testid":"tool-card-error",children:i}),!o&&!m&&b.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("pre",{className:ie.pre,"data-testid":"tool-card-results",children:b.join(`
|
|
140
|
-
`)}),g&&r.jsxs("button",{type:"button",className:ie.bodyToggle,onClick:()=>{u(x=>!x)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[r.jsx("span",{className:`${ie.chevron} ${c?ie.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${v.length-yf} more matches`]})]})]})}function mM(n,a){if(a==null||typeof a!="object")return"";const i=a;if(typeof i.intent=="string")return i.intent;for(const o of Object.values(i))if(typeof o=="string")return o;return n}function vM({tool:n,args:a}){const i=mM(n,a);return r.jsxs("div",{className:ie.metadata,"data-testid":"tool-card-metadata",children:[r.jsx("span",{className:ie.metadataPrefix,children:"↳"}),i]})}function gM(n){const a=/^mcp__(.+?)__(.+)$/.exec(n);return a?{display:`${a[1]} / ${a[2]}`,isMcp:!0}:{display:n,isMcp:!1}}function yM(n){if(n==null)return"";if(typeof n!="object")return String(n);const a=n;if(typeof a.command=="string")return a.command;if(typeof a.file_path=="string")return a.file_path;if(typeof a.path=="string")return a.path;if(typeof a.query=="string")return a.query;if(typeof a.url=="string")return a.url;try{const i=JSON.stringify(n);return i.length>120?`${i.slice(0,120)}…`:i}catch{return""}}const bf=5;function bM({tool:n,args:a,result:i,isError:o}){const[c,u]=y.useState(!1),{display:f}=gM(n),p=yM(a),m=i===void 0,v=(i==null?void 0:i.split(`
|
|
141
|
-
`))??[],g=v.length>bf,b=c?i:v.slice(0,bf).join(`
|
|
142
|
-
`);let x="";if(a!=null)try{x=JSON.stringify(a,null,2)}catch{x=String(a)}return r.jsxs("div",{className:`${ie.card} ${o?ie.cardRed:ie.cardBlue} ${m?ie.inProgress:""}`,"data-testid":"tool-card-generic",children:[r.jsxs("div",{className:ie.header,children:[r.jsx("span",{className:ie.icon,children:"⚙"}),r.jsx("span",{className:ie.toolName,style:{color:"var(--accent-blue)"},children:f}),p&&r.jsx("span",{className:ie.fileName,children:p})]}),m&&x&&r.jsx("pre",{className:ie.pre,"data-testid":"tool-card-args",children:x}),o&&i&&r.jsx("pre",{className:ie.pre,"data-testid":"tool-card-error",children:i}),!o&&!m&&i&&r.jsxs(r.Fragment,{children:[r.jsx("pre",{className:ie.pre,"data-testid":"tool-card-result",children:b}),g&&r.jsxs("button",{type:"button",className:ie.bodyToggle,onClick:()=>{u(S=>!S)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[r.jsx("span",{className:`${ie.chevron} ${c?ie.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${v.length-bf} more lines`]})]})]})}function xf(n){switch(TR(n.tool)){case"file-read":return r.jsx(B0,{...n});case"file-edit":return r.jsx(lM,{...n});case"file-write":return r.jsx(B0,{...n,writeVariant:!0});case"shell":return r.jsx(fM,{...n});case"search":return r.jsx(pM,{...n});case"metadata":return r.jsx(vM,{...n});default:return r.jsx(bM,{...n})}}const xM="_systemContextEvent_18fue_1",_M="_systemContextHeader_18fue_7",SM="_systemContextBadge_18fue_28",TM="_systemContextToggle_18fue_37",kM="_systemContextPre_18fue_43",jM="_systemContextEllipsis_18fue_54",NM="_systemEvent_18fue_58",wM="_systemTimestamp_18fue_65",CM="_textEvent_18fue_69",EM="_errorEvent_18fue_155",AM="_statusEvent_18fue_163",DM="_userInputEvent_18fue_172",RM="_userInputContent_18fue_178",MM="_signalEvent_18fue_195",OM="_signalBadge_18fue_206",BM="_signalContent_18fue_215",LM="_usageEvent_18fue_220",IM="_usageBadge_18fue_227",zM="_defaultEvent_18fue_236",Bt={systemContextEvent:xM,systemContextHeader:_M,systemContextBadge:SM,systemContextToggle:TM,systemContextPre:kM,systemContextEllipsis:jM,systemEvent:NM,systemTimestamp:wM,textEvent:CM,errorEvent:EM,statusEvent:AM,userInputEvent:DM,userInputContent:RM,signalEvent:MM,signalBadge:OM,signalContent:BM,usageEvent:LM,usageBadge:IM,defaultEvent:zM},L0=3;function UM({content:n}){const[a,i]=y.useState(!1),o=n.split(`
|
|
143
|
-
`),c=o.length>L0,u=a?n:o.slice(0,L0).join(`
|
|
144
|
-
`);return r.jsxs("div",{className:Bt.systemContextEvent,"data-testid":"system-context-event",children:[r.jsxs("button",{type:"button",className:Bt.systemContextHeader,onClick:()=>{i(f=>!f)},"aria-expanded":a,children:[r.jsx("span",{className:Bt.systemContextBadge,children:"SYSTEM PROMPT"}),c&&r.jsx("span",{className:Bt.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),r.jsxs("pre",{className:Bt.systemContextPre,children:[u,!a&&c&&r.jsx("span",{className:Bt.systemContextEllipsis,children:"…"})]})]})}function VM({time:n,content:a}){return r.jsxs("div",{className:Bt.systemEvent,children:[r.jsxs("span",{className:Bt.systemTimestamp,children:["[",n,"]"]})," ",a]})}function HM({content:n}){return r.jsx("div",{className:Bt.textEvent,children:r.jsx(Qf,{remarkPlugins:[Jf],rehypePlugins:[_R],children:n})})}function PM({content:n}){return r.jsxs("div",{className:Bt.errorEvent,children:["Error: ",n]})}function GM({content:n}){return r.jsxs("div",{className:Bt.statusEvent,children:["--- ",n," ---"]})}function $M({content:n}){return r.jsx("div",{className:Bt.userInputEvent,children:r.jsx("span",{className:Bt.userInputContent,children:n})})}function qM({content:n}){return r.jsxs("div",{className:Bt.signalEvent,"data-testid":"signal-event",children:[r.jsx("span",{className:Bt.signalBadge,children:"SIGNAL"}),r.jsx("span",{className:Bt.signalContent,children:n})]})}function KM({content:n}){let a=n;try{const i=JSON.parse(n),o=Number(i.input_tokens)||0,c=Number(i.output_tokens)||0,u=y_(o+c),f=Zi(Number(i.cost_usd)||0);a=`${u} tokens · ${f}`}catch{}return r.jsx("div",{className:Bt.usageEvent,"data-testid":"usage-event",children:r.jsx("span",{className:Bt.usageBadge,children:a})})}function FM({content:n}){return r.jsx("div",{className:Bt.defaultEvent,children:n})}function YM({event:n,toolUseCtx:a}){const i=new Date(n.timestamp).toLocaleTimeString();switch(n.eventType){case"system":{if(n.raw)try{if(JSON.parse(n.raw).systemContext===!0)return r.jsx(UM,{content:n.content})}catch{}return r.jsx(VM,{time:i,content:n.content})}case"text":case"output":return r.jsx(HM,{content:n.content});case"tool_use":{let o="",c={};try{const u=JSON.parse(n.content);o=u.tool||"",c=u.args}catch{}return r.jsx(xf,{tool:o,args:c})}case"tool_result":{let o=!1;if(n.raw)try{o=JSON.parse(n.raw).is_error===!0}catch{}let c=n.content;if(n.content.trimStart().startsWith("{"))try{const u=JSON.parse(n.content);typeof u.content=="string"&&(c=u.content)}catch{}return a?r.jsx(xf,{tool:a.tool,args:a.args,result:c,isError:o,detailedResult:a.detailedResult}):r.jsx(xf,{tool:"Tool output",args:void 0,result:c,isError:o})}case"error":return r.jsx(PM,{content:n.content});case"status":return r.jsx(GM,{content:n.content});case"user_input":return r.jsx($M,{content:n.content});case"signal":return r.jsx(qM,{content:n.content});case"usage":return r.jsx(KM,{content:n.content});default:return r.jsx(FM,{content:n.content})}}const ZM="_overlay_cmicx_1",XM="_dialog_cmicx_11",WM="_title_cmicx_30",QM="_description_cmicx_38",JM="_actions_cmicx_45",e3="_cancelButton_cmicx_52",t3="_confirmButton_cmicx_79",Ms={overlay:ZM,dialog:XM,title:WM,description:QM,actions:JM,cancelButton:e3,confirmButton:t3};function Gs({isOpen:n,title:a,description:i,confirmLabel:o="Delete",onConfirm:c,onCancel:u}){const f=y.useId(),p=y.useId();return r.jsx(aa,{children:n&&r.jsx(At.div,{className:Ms.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:u,onKeyDown:m=>{m.key==="Escape"&&u()},role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-describedby":i?p:void 0,children:r.jsxs(At.div,{className:Ms.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:[r.jsx("h3",{id:f,className:Ms.title,children:a}),i&&r.jsx("p",{id:p,className:Ms.description,children:i}),r.jsxs("div",{className:Ms.actions,children:[r.jsx("button",{type:"button",className:Ms.cancelButton,onClick:u,autoFocus:!0,children:"Cancel"}),r.jsx("button",{type:"button",className:Ms.confirmButton,onClick:c,children:o})]})]})})})}const n3="_spinner_1uyt1_1",a3="_spin_1uyt1_1",s3="_sm_1uyt1_14",i3="_md_1uyt1_20",o3="_lg_1uyt1_26",l3="_xl_1uyt1_32",I0={spinner:n3,spin:a3,sm:s3,md:i3,lg:o3,xl:l3};function b_({size:n="md",className:a,label:i="Loading",liveRegion:o=!1}){return r.jsx("span",{className:`${I0.spinner} ${I0[n]} ${a??""}`,role:o?"status":void 0,"aria-label":i,"aria-hidden":o?void 0:!0})}const r3="_splash_1bn1g_1",c3="_logo_1bn1g_11",z0={splash:r3,logo:c3};function x_(){return r.jsxs("div",{className:z0.splash,"data-testid":"splash-screen",children:[r.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:z0.logo}),r.jsx(b_,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function u3(n,a){const i=y.useRef(null);y.useEffect(()=>{const o=i.current;if(i.current=n,o===null)return;const c=new Map;for(const f of o)c.set(f.id,f);const u=new Set;for(const f of n){u.add(f.id);const p=c.get(f.id);if(p&&p.status!==f.status&&f.status!=="sleeping"){if(f.status==="connecting"){a("Provisioning environment…","info");continue}f.status==="connected"?a("Environment connected","success"):f.status==="error"?a("Environment provision failed","error"):f.status==="disconnected"&&(p.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const f of o)u.has(f.id)||a("Environment removed","info")},[n,a])}const d3={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 f3(n){return d3[n]}function h3(n,a){if(n===void 0)return[];const i=[],o=new Map;for(const u of n)o.set(u.id,u);const c=new Set;for(const u of a){c.add(u.id);const f=o.get(u.id);if(!f||f.status===u.status)continue;const p=f3(u.status);p&&i.push(p)}for(const u of n)c.has(u.id)||i.push({message:"Task deleted",variant:"info"});return i}function p3(n,a){const i=y.useRef(void 0);y.useEffect(()=>{const o=i.current;i.current=n;const c=h3(o,n);for(const u of c)a(u.message,u.variant)},[n,a])}function m3(n,a,i){const o=n.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,c=__(a),u=a.filter(m=>Xf(m,c)).length,f=a.filter(m=>m.status==="paused"||m.status==="failed"||Xf(m,c)).length,p=i.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:o,blockedTasks:u,attentionTasks:f,unhealthyEnvironments:p}}function __(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function Xf(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function v3(n,a){var f;const i=new Map;for(const p of a)i.set(p.id,p);const o=__(n),c=[];for(const p of n){const m=p.workspaceId?((f=i.get(p.workspaceId))==null?void 0:f.name)??"Unknown":"Unknown";p.status==="failed"?c.push({task:p,reason:"failed",workspaceName:m}):Xf(p,o)?c.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&c.push({task:p,reason:"paused",workspaceName:m})}const u={failed:0,blocked:1,paused:2};return c.sort((p,m)=>(u[p.reason]??3)-(u[m.reason]??3)),c}function g3(n,a){const i=new Map;for(const o of a)i.set(o.id,o);return n.filter(o=>o.status==="running"||o.status==="idle"||o.status==="waiting").map(o=>{var c;return{session:o,environmentName:((c=i.get(o.environmentId))==null?void 0:c.displayName)??"Unknown"}})}function y3(n,a,i){const o=new Map;for(const c of a){if(!c.workspaceId)continue;let u=o.get(c.workspaceId);u||(u={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},o.set(c.workspaceId,u)),u.totalTasks+=1,c.status==="complete"?u.completedTasks+=1:c.status==="working"?u.workingTasks+=1:c.status==="failed"&&(u.failedTasks+=1)}return n.map(c=>{const u=o.get(c.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:c,totalTasks:u.totalTasks,completedTasks:u.completedTasks,workingTasks:u.workingTasks,failedTasks:u.failedTasks}})}const b3="_dashboard_16pzm_1",x3="_kpiStrip_16pzm_11",_3="_kpiCard_16pzm_23",S3="_kpiValue_16pzm_68",T3="_kpiLabel_16pzm_76",k3="_bodyGrid_16pzm_84",j3="_section_16pzm_96",N3="_sectionHeader_16pzm_109",w3="_sectionIcon_16pzm_118",C3="_sectionTitle_16pzm_123",E3="_sectionCount_16pzm_131",A3="_sectionBody_16pzm_138",D3="_emptyHint_16pzm_143",R3="_sessionRow_16pzm_150",M3="_sessionPrompt_16pzm_177",O3="_sessionEnv_16pzm_186",B3="_sessionRuntime_16pzm_192",L3="_sessionStatus_16pzm_198",I3="_statusDot_16pzm_207",z3="_attentionRow_16pzm_233",U3="_attentionTitle_16pzm_259",V3="_attentionMeta_16pzm_267",H3="_reasonBadge_16pzm_274",P3="_bottomGrid_16pzm_301",G3="_envRow_16pzm_312",$3="_envName_16pzm_323",q3="_envStatusBadge_16pzm_333",K3="_workspaceRow_16pzm_369",F3="_workspaceTop_16pzm_395",Y3="_workspaceName_16pzm_401",Z3="_workspaceCounts_16pzm_407",X3="_progressBar_16pzm_415",W3="_progressFill_16pzm_422",ye={dashboard:b3,kpiStrip:x3,kpiCard:_3,kpiValue:S3,kpiLabel:T3,bodyGrid:k3,section:j3,sectionHeader:N3,sectionIcon:w3,sectionTitle:C3,sectionCount:E3,sectionBody:A3,emptyHint:D3,sessionRow:R3,sessionPrompt:M3,sessionEnv:O3,sessionRuntime:B3,sessionStatus:L3,statusDot:I3,attentionRow:z3,attentionTitle:U3,attentionMeta:V3,reasonBadge:H3,bottomGrid:P3,envRow:G3,envName:$3,envStatusBadge:q3,workspaceRow:K3,workspaceTop:F3,workspaceName:Y3,workspaceCounts:Z3,progressBar:X3,progressFill:W3},Q3={hidden:{opacity:0,y:12},visible:n=>({opacity:1,y:0,transition:{delay:n*.06,duration:.3,ease:"easeOut"}})},Xr={hidden:{opacity:0,y:16},visible:n=>({opacity:1,y:0,transition:{delay:.15+n*.08,duration:.35,ease:"easeOut"}})};function J3(n,a,i,o){const c=[`${n} of ${a} tasks completed`];return i>0&&c.push(`${i} in progress`),o>0&&c.push(`${o} failed`),c.join(", ")}function Wr({value:n,label:a,accent:i,index:o,testId:c}){return r.jsxs(At.div,{className:ye.kpiCard,"data-accent":i,"data-testid":c,variants:Q3,initial:"hidden",animate:"visible",custom:o,children:[r.jsx("span",{className:ye.kpiValue,children:n}),r.jsx("span",{className:ye.kpiLabel,children:a})]})}function eO(){const{workspaces:n,tasks:a,sessions:i,environments:o,loadTasks:c}=dt(),u=xt(),f=y.useRef(new Set);y.useEffect(()=>{for(const b of n)f.current.has(b.id)||(f.current.add(b.id),c(b.id))},[n,c]);const p=y.useMemo(()=>m3(i,a,o),[i,a,o]),m=y.useMemo(()=>g3(i,o),[i,o]),v=y.useMemo(()=>v3(a,n),[a,n]),g=y.useMemo(()=>y3(n,a),[n,a,o]);return r.jsxs("div",{className:ye.dashboard,"data-testid":"dashboard",children:[r.jsxs("div",{className:ye.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[r.jsx(Wr,{value:p.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),r.jsx(Wr,{value:p.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),r.jsx(Wr,{value:p.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),r.jsx(Wr,{value:p.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),r.jsxs("div",{className:ye.bodyGrid,children:[r.jsxs(At.div,{className:ye.section,variants:Xr,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[r.jsxs("div",{className:ye.sectionHeader,children:[r.jsx("span",{className:ye.sectionIcon,"aria-hidden":"true",children:"●"}),r.jsx("span",{className:ye.sectionTitle,children:"Active Sessions"}),r.jsx("span",{className:ye.sectionCount,children:m.length})]}),r.jsx("div",{className:ye.sectionBody,children:m.length===0?r.jsx("div",{className:ye.emptyHint,children:"No active sessions"}):m.map(({session:b,environmentName:x})=>r.jsxs("button",{type:"button",className:ye.sessionRow,onClick:()=>u(xb(b.id)),"data-testid":"session-row",children:[r.jsx("span",{className:ye.sessionPrompt,title:b.prompt,children:b.prompt||"—"}),r.jsx("span",{className:ye.sessionEnv,children:x}),r.jsx("span",{className:ye.sessionRuntime,children:b.runtime}),r.jsxs("span",{className:ye.sessionStatus,children:[r.jsx("span",{className:ye.statusDot,"data-status":b.status}),b.status]})]},b.id))})]}),r.jsxs(At.div,{className:ye.section,variants:Xr,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[r.jsxs("div",{className:ye.sectionHeader,children:[r.jsx("span",{className:ye.sectionIcon,"aria-hidden":"true",children:"⚑"}),r.jsx("span",{className:ye.sectionTitle,children:"Needs Attention"}),r.jsx("span",{className:ye.sectionCount,children:v.length})]}),r.jsx("div",{className:ye.sectionBody,children:v.length===0?r.jsx("div",{className:ye.emptyHint,children:"All clear"}):v.map(({task:b,reason:x,workspaceName:S})=>r.jsxs("button",{type:"button",className:ye.attentionRow,onClick:()=>u(na(b.id)),"data-testid":"attention-row",children:[r.jsxs("div",{className:ye.attentionTitle,children:[r.jsx("span",{className:ye.reasonBadge,"data-reason":x,children:x}),b.title]}),r.jsx("div",{className:ye.attentionMeta,children:r.jsx("span",{children:S})})]},b.id))})]})]}),r.jsxs("div",{className:ye.bottomGrid,children:[r.jsxs(At.div,{className:ye.section,variants:Xr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[r.jsxs("div",{className:ye.sectionHeader,children:[r.jsx("span",{className:ye.sectionIcon,"aria-hidden":"true",children:"◈"}),r.jsx("span",{className:ye.sectionTitle,children:"Environment Health"}),r.jsx("span",{className:ye.sectionCount,children:o.length})]}),r.jsx("div",{className:ye.sectionBody,children:o.length===0?r.jsx("div",{className:ye.emptyHint,children:"No environments configured"}):o.map(b=>r.jsxs("div",{className:ye.envRow,"data-testid":"dashboard-env-row",children:[r.jsx("span",{className:ye.envName,children:b.displayName}),r.jsx("span",{className:ye.envStatusBadge,"data-status":b.status,children:b.status})]},b.id))})]}),r.jsxs(At.div,{className:ye.section,variants:Xr,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[r.jsxs("div",{className:ye.sectionHeader,children:[r.jsx("span",{className:ye.sectionIcon,"aria-hidden":"true",children:"▦"}),r.jsx("span",{className:ye.sectionTitle,children:"Workspaces"}),r.jsx("span",{className:ye.sectionCount,children:n.length})]}),r.jsx("div",{className:ye.sectionBody,children:g.length===0?r.jsx("div",{className:ye.emptyHint,children:"No workspaces yet"}):g.map(({workspace:b,totalTasks:x,completedTasks:S,workingTasks:T,failedTasks:w})=>{const N=x>0?Math.round(S/x*100):0;return r.jsxs("button",{type:"button",className:ye.workspaceRow,onClick:()=>u(Gi(b.id,b.environmentId)),"data-testid":"workspace-row",children:[r.jsxs("div",{className:ye.workspaceTop,children:[r.jsx("span",{className:ye.workspaceName,children:b.name}),r.jsxs("span",{className:ye.workspaceCounts,"aria-label":J3(S,x,T,w),children:[S,"/",x,T>0&&r.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",T]}),w>0&&r.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",w]})]})]}),x>0&&r.jsx("div",{className:ye.progressBar,children:r.jsx("div",{className:ye.progressFill,style:{width:`${N}%`}})})]},b.id)})})]})]})]})}const tO="_panelContainer_1h5qd_1",nO="_emptyState_1h5qd_8",aO="_fadeIn_1h5qd_1",sO="_workspaceSummary_1h5qd_17",iO="_workspaceSummaryTitle_1h5qd_28",oO="_workspaceSummarySubtitle_1h5qd_32",lO="_header_1h5qd_36",rO="_headerInfo_1h5qd_71",cO="_killButton_1h5qd_77",uO="_headerTitle_1h5qd_106",dO="_headerActions_1h5qd_121",fO="_taskStatusBadge_1h5qd_128",hO="_taskBranch_1h5qd_137",pO="_taskBlockedBadge_1h5qd_143",mO="_btnPrimary_1h5qd_151",vO="_btnDanger_1h5qd_182",gO="_btnGhost_1h5qd_221",yO="_rejectInput_1h5qd_247",bO="_tabBar_1h5qd_277",xO="_tab_1h5qd_277",_O="_active_1h5qd_303",SO="_eventScroll_1h5qd_308",TO="_tabContent_1h5qd_314",kO="_noContext_1h5qd_319",jO="_overviewContent_1h5qd_325",NO="_overviewDashboard_1h5qd_334",wO="_overviewHero_1h5qd_340",CO="_statusBadge_1h5qd_347",EO="_statusPending_1h5qd_359",AO="_statusAssigned_1h5qd_364",DO="_statusInProgress_1h5qd_369",RO="_statusReview_1h5qd_374",MO="_statusDone_1h5qd_379",OO="_statusFailed_1h5qd_384",BO="_statusWaitingInput_1h5qd_389",LO="_overviewBranchPill_1h5qd_394",IO="_branchLink_1h5qd_409",zO="_overviewSection_1h5qd_420",UO="_overviewLabel_1h5qd_426",VO="_overviewValue_1h5qd_433",HO="_overviewMuted_1h5qd_438",PO="_overviewMarkdown_1h5qd_444",GO="_envRow_1h5qd_513",$O="_envDot_1h5qd_519",qO="_envDotGreen_1h5qd_526",KO="_envDotYellow_1h5qd_530",FO="_envDotRed_1h5qd_534",YO="_envDotGray_1h5qd_538",ZO="_depList_1h5qd_542",XO="_depItem_1h5qd_548",WO="_depBlocked_1h5qd_555",QO="_depDone_1h5qd_559",JO="_timeline_1h5qd_563",e5="_timelineRow_1h5qd_569",t5="_timelineKey_1h5qd_576",n5="_timelineValue_1h5qd_582",a5="_timelineDelta_1h5qd_586",s5="_reviewNotes_1h5qd_597",i5="_overviewDescription_1h5qd_608",o5="_waitingMessage_1h5qd_614",l5="_errorMessage_1h5qd_618",r5="_eventOverflowWarning_1h5qd_622",c5="_attemptSelector_1h5qd_636",u5="_attemptLabel_1h5qd_652",d5="_attemptButton_1h5qd_656",f5="_attemptActive_1h5qd_673",h5="_attemptStatus_1h5qd_679",p5="_emptyCta_1h5qd_685",m5="_ctaTitle_1h5qd_697",v5="_ctaDescription_1h5qd_703",g5="_ctaButton_1h5qd_710",y5="_ctaCreateForm_1h5qd_745",b5="_ctaCreateInput_1h5qd_751",x5="_ctaCreateOk_1h5qd_782",_5="_ctaLink_1h5qd_817",S5="_workspaceHeader_1h5qd_831",T5="_workspaceName_1h5qd_856",k5="_workspaceMeta_1h5qd_869",j5="_metaRow_1h5qd_877",N5="_metaLabel_1h5qd_890",w5="_metaValue_1h5qd_905",C5="_archiveButton_1h5qd_915",E5="_repoLink_1h5qd_945",A5="_metaToggle_1h5qd_955",D5="_metaToggleArrow_1h5qd_976",R5="_metaToggleArrowOpen_1h5qd_981",M5="_progressBarContainer_1h5qd_985",O5="_progressBar_1h5qd_985",B5="_progressFill_1h5qd_1001",L5="_progressLabel_1h5qd_1008",I5="_metaTimestamps_1h5qd_1015",z5="_metaTimestamp_1h5qd_1015",I={panelContainer:tO,emptyState:nO,fadeIn:aO,workspaceSummary:sO,workspaceSummaryTitle:iO,workspaceSummarySubtitle:oO,header:lO,headerInfo:rO,killButton:cO,headerTitle:uO,headerActions:dO,taskStatusBadge:fO,taskBranch:hO,taskBlockedBadge:pO,btnPrimary:mO,btnDanger:vO,btnGhost:gO,rejectInput:yO,tabBar:bO,tab:xO,active:_O,eventScroll:SO,tabContent:TO,noContext:kO,overviewContent:jO,overviewDashboard:NO,overviewHero:wO,statusBadge:CO,statusPending:EO,statusAssigned:AO,statusInProgress:DO,statusReview:RO,statusDone:MO,statusFailed:OO,statusWaitingInput:BO,overviewBranchPill:LO,branchLink:IO,overviewSection:zO,overviewLabel:UO,overviewValue:VO,overviewMuted:HO,overviewMarkdown:PO,envRow:GO,envDot:$O,envDotGreen:qO,envDotYellow:KO,envDotRed:FO,envDotGray:YO,depList:ZO,depItem:XO,depBlocked:WO,depDone:QO,timeline:JO,timelineRow:e5,timelineKey:t5,timelineValue:n5,timelineDelta:a5,reviewNotes:s5,overviewDescription:i5,waitingMessage:o5,errorMessage:l5,eventOverflowWarning:r5,attemptSelector:c5,attemptLabel:u5,attemptButton:d5,attemptActive:f5,attemptStatus:h5,emptyCta:p5,ctaTitle:m5,ctaDescription:v5,ctaButton:g5,ctaCreateForm:y5,ctaCreateInput:b5,ctaCreateOk:x5,ctaLink:_5,workspaceHeader:S5,workspaceName:T5,workspaceMeta:k5,metaRow:j5,metaLabel:N5,metaValue:w5,archiveButton:C5,repoLink:E5,metaToggle:A5,metaToggleArrow:D5,metaToggleArrowOpen:R5,progressBarContainer:M5,progressBar:O5,progressFill:B5,progressLabel:L5,metaTimestamps:I5,metaTimestamp:z5};function U5(){return r.jsx("div",{className:I.emptyState,children:"Select a task or click + to create one"})}function V5(){return r.jsx("div",{className:I.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function H5(){const{workspaces:n,environments:a}=dt(),i=xt(),o=a.length>0;return n.length>0?r.jsx(eO,{}):r.jsxs("div",{className:I.emptyCta,"data-testid":"welcome-cta",children:[r.jsx("div",{className:I.ctaTitle,children:"Welcome to Grackle"}),r.jsx("div",{className:I.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r.jsx("button",{className:I.ctaButton,onClick:()=>i(Tb),disabled:!o,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!o&&r.jsx("div",{className:I.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const S_=50;function P5(n,a,i,o,c=S_){return o?n<c:a-n-i<c}function G5(n,a){const i=a-n;return i>0?i:0}function $5({scrollRef:n,contentLength:a,isReversed:i}){const[o,c]=y.useState(!0),u=y.useRef(0),f=y.useRef(!1),p=y.useRef(0);y.useEffect(()=>{const v=n.current;if(!v)return;let g=!0;const b=()=>{p.current||(p.current=requestAnimationFrame(()=>{p.current=0;const x=P5(v.scrollTop,v.scrollHeight,v.clientHeight,i,S_);x!==g&&(g=x,c(x))}))};return v.addEventListener("scroll",b,{passive:!0}),()=>{v.removeEventListener("scroll",b),p.current&&(cancelAnimationFrame(p.current),p.current=0)}},[n,i]),y.useLayoutEffect(()=>{const v=n.current;!v||f.current||(f.current=!0,i?v.scrollTop=0:v.scrollTop=v.scrollHeight,c(!0))},[n,i]),y.useLayoutEffect(()=>{const v=n.current;if(v){if(i&&!o){const g=G5(u.current,v.scrollHeight);g>0&&(v.scrollTop+=g)}o&&(i?v.scrollTo({top:0,behavior:"smooth"}):v.scrollTo({top:v.scrollHeight,behavior:"smooth"})),u.current=v.scrollHeight}},[a,o,i,n]);const m=y.useCallback(()=>{const v=n.current;if(!v)return;const g=i?0:v.scrollHeight;v.scrollTo({top:g,behavior:"smooth"}),c(!0)},[n,i]);return{isAtAnchor:o,scrollToAnchor:m}}const q5="_wrapper_p24zt_1",K5="_scrollContainer_p24zt_9",F5="_toolbar_p24zt_15",Y5="_directionToggle_p24zt_22",Z5="_scrollToAnchor_p24zt_60",X5="_scrollToAnchorBottom_p24zt_84",W5="_scrollToAnchorTop_p24zt_88",Os={wrapper:q5,scrollContainer:K5,toolbar:F5,directionToggle:Y5,scrollToAnchor:Z5,scrollToAnchorBottom:X5,scrollToAnchorTop:W5},T_="grackle-stream-direction";function Q5(){try{return localStorage.getItem(T_)==="reversed"}catch{return!1}}function J5({eventsDropped:n}){return n<=0?r.jsx(r.Fragment,{}):r.jsxs("div",{className:I.eventOverflowWarning,role:"alert",children:["⚠"," ",n.toLocaleString()," older event",n===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function Kh({events:n,eventsDropped:a,emptyState:i}){const o=y.useRef(null),[c,u]=y.useState(Q5),f=F2(),p=y.useMemo(()=>c?[...n].reverse():n,[n,c]),{isAtAnchor:m,scrollToAnchor:v}=$5({scrollRef:o,contentLength:n.length,isReversed:c}),g=()=>{const S=!c;u(S);try{localStorage.setItem(T_,S?"reversed":"default")}catch{}},b=f?0:.2,x=c?-8:8;return r.jsxs("div",{className:Os.wrapper,children:[r.jsx("div",{className:Os.toolbar,children:r.jsx("button",{className:Os.directionToggle,onClick:g,title:c?"Showing newest first":"Showing oldest first","aria-label":c?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:c?"↓":"↑"})}),r.jsxs("div",{ref:o,className:Os.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,r.jsx(J5,{eventsDropped:a}),r.jsx(aa,{initial:!1,children:p.map((S,T)=>{const w=c?n.length-1-T:T;return r.jsx(At.div,{initial:{opacity:0,y:x},animate:{opacity:1,y:0},transition:{duration:b,ease:"easeOut"},children:r.jsx(YM,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${w}`)})})]}),r.jsx(aa,{children:!m&&r.jsxs(At.button,{className:`${Os.scrollToAnchor} ${c?Os.scrollToAnchorTop:Os.scrollToAnchorBottom}`,onClick:v,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:[c?"↑":"↓"," New events"]})})]})}const e6="_bar_1xhb4_1",t6="_input_1xhb4_32",n6="_select_1xhb4_67",a6="_btnPrimary_1xhb4_103",s6="_btnGhost_1xhb4_173",i6="_badge_1xhb4_195",o6="_disconnectHint_1xhb4_205",yn={bar:e6,input:t6,select:n6,btnPrimary:a6,btnGhost:s6,badge:i6,disconnectHint:o6};function l6(n,a){if(!n)return!1;const i=a.find(o=>o.id===n);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function r6({environmentId:n,onReconnect:a}){return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:yn.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),r.jsx("button",{type:"button",onClick:()=>a(n),className:yn.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function yl({mode:n,sessionId:a,environmentId:i,taskId:o,showPersonaSelect:c,personas:u,environments:f,onSendInput:p,onSpawn:m,onStartTask:v,onProvisionEnvironment:g}){const{showToast:b}=Da(),[x,S]=y.useState(""),[T,w]=y.useState(""),N=l6(i,f),k=E=>{if(E.preventDefault(),!!x.trim())if(n==="send"){if(!a||N)return;p(a,x),S("")}else if(n==="spawn"){if(!i)return;m(i,x,T),b("Session started","success"),S(""),w("")}else{if(!o)return;v(o,void 0,i,x),S("")}};return n==="spawn"?r.jsxs("form",{onSubmit:k,className:yn.bar,children:[r.jsx("span",{className:yn.badge,children:"new chat"}),r.jsx("input",{type:"text",value:x,onChange:E=>S(E.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:yn.input}),c&&r.jsxs("select",{value:T,onChange:E=>w(E.target.value),className:yn.select,children:[r.jsx("option",{value:"",children:"(Default)"}),u.map(E=>r.jsx("option",{value:E.id,children:E.name},E.id))]}),r.jsx("button",{type:"submit",disabled:!x.trim()||!i,className:yn.btnPrimary,children:"Go"})]}):n==="start"?r.jsxs("form",{onSubmit:k,className:yn.bar,children:[r.jsx("input",{type:"text",value:x,onChange:E=>S(E.target.value),placeholder:"Type a message...",autoFocus:!0,className:yn.input}),r.jsx("button",{type:"submit",disabled:!x.trim(),className:yn.btnPrimary,children:"Send"})]}):r.jsxs("form",{onSubmit:k,className:yn.bar,children:[N&&i&&r.jsx(r6,{environmentId:i,onReconnect:g}),r.jsx("input",{type:"text",value:x,onChange:E=>S(E.target.value),placeholder:"Type a message...",autoFocus:!N,disabled:N,className:yn.input}),r.jsx("span",{title:N?"Environment is unavailable — reconnect first":void 0,children:r.jsx("button",{type:"submit",disabled:!x.trim()||N,className:yn.btnPrimary,children:"Send"})})]})}function Fh(n){const a=[];for(const i of n){const o=a[a.length-1];i.eventType==="text"&&(o==null?void 0:o.eventType)==="text"?a[a.length-1]={...o,content:o.content+i.content}:a.push(i)}return a}function Yh(n){const a=new Map;for(const u of n)if(u.raw)try{a.set(u,JSON.parse(u.raw))}catch{}const i=new Map;for(const u of n){if(u.eventType!=="tool_use")continue;const f=a.get(u);if(!(!f||typeof f.id!="string"))try{const p=JSON.parse(u.content);i.set(f.id,{tool:p.tool,args:p.args})}catch{}}const o=new Set;return n.map(u=>{if(u.eventType!=="tool_result")return u;const f=a.get(u);if(!f||typeof f.tool_use_id!="string")return u;const p=i.get(f.tool_use_id);if(!p)return u;o.add(f.tool_use_id);let m;const v=u.content.trim();if(v.startsWith("{"))try{const g=JSON.parse(v);typeof g.detailedContent=="string"&&(m=g.detailedContent)}catch{}return{...u,toolUseCtx:{...p,detailedResult:m}}}).filter(u=>{if(u.eventType!=="tool_use")return!0;const f=a.get(u);return f&&typeof f.id=="string"?!o.has(f.id):!0})}const c6="_panelContainer_19poq_1",u6="_chatHeader_19poq_8",d6="_chatHeaderInfo_19poq_37",f6="_emptyState_19poq_43",h6="_emptyTitle_19poq_55",p6="_emptyDescription_19poq_61",m6="_emptyHint_19poq_67",Us={panelContainer:c6,chatHeader:u6,chatHeaderInfo:d6,emptyState:f6,emptyTitle:h6,emptyDescription:p6,emptyHint:m6};function v6({hasLocalEnvironment:n}){return r.jsxs("div",{className:Us.emptyState,"data-testid":"chat-empty-state",children:[r.jsx("div",{className:Us.emptyTitle,children:"Welcome to Grackle"}),r.jsx("div",{className:Us.emptyDescription,children:n?"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."}),!n&&r.jsx("div",{className:Us.emptyHint,children:"Go to Settings → Environments to add one."})]})}function g6(){const{tasks:n,sessions:a,events:i,eventsDropped:o,environments:c,loadTaskSessions:u,loadSessionEvents:f,kill:p,stopGraceful:m,taskSessions:v,sendInput:g,spawn:b,startTask:x,personas:S,provisionEnvironment:T}=dt(),w=y.useRef(void 0),[N,k]=y.useState(),E=n.find(K=>K.id===Fo),A=E!=null&&E.latestSessionId?a.find(K=>K.id===E.latestSessionId)??(v[Fo]??[]).find(K=>K.id===E.latestSessionId):void 0;y.useEffect(()=>{u(Fo)},[u]),y.useEffect(()=>{E!=null&&E.latestSessionId&&u(Fo)},[E==null?void 0:E.latestSessionId,u]),y.useEffect(()=>{A&&A.id!==w.current&&(w.current=A.id,f(A.id))},[A==null?void 0:A.id,f]);const R=y.useMemo(()=>{if(!A)return[];const K=i.filter(Q=>Q.sessionId===A.id);return Yh(Fh(K))},[i,A==null?void 0:A.id]),C=c.find(K=>K.adapterType==="local"&&K.status==="connected"),z=A!==void 0&&A.status!=="stopped"&&A.status!=="suspended",H=(A==null?void 0:A.status)==="idle";y.useEffect(()=>{N&&A&&H&&(g(A.id,N),k(void 0))},[N,H,A==null?void 0:A.id,g]);const B=y.useCallback((K,Q,se,ne)=>{ne&&k(ne),x(K,Q,se)},[x]);return r.jsxs("div",{className:Us.panelContainer,"data-testid":"chat-page",children:[z&&r.jsxs("div",{className:Us.chatHeader,children:[r.jsxs("span",{className:Us.chatHeaderInfo,children:["Session: ",A.id.slice(0,8)," | ",A.runtime," | ",A.status]}),r.jsx(g_,{label:"Stop",onClick:()=>m(A.id),variant:"danger",size:"sm","data-testid":"stop-split-button",options:[{label:"Stop",description:"Graceful shutdown",onClick:()=>m(A.id)},{label:"Kill",description:"Force kill",onClick:()=>p(A.id)}]})]}),r.jsx(Kh,{events:R,eventsDropped:o,emptyState:r.jsx(v6,{hasLocalEnvironment:!!C})}),C&&z&&r.jsx(yl,{mode:"send",sessionId:A.id,environmentId:A.environmentId,personas:S,environments:c,onSendInput:g,onSpawn:b,onStartTask:x,onProvisionEnvironment:T}),C&&!z&&r.jsx(yl,{mode:"start",taskId:Fo,environmentId:C.id,personas:S,environments:c,onSendInput:g,onSpawn:b,onStartTask:B,onProvisionEnvironment:T})]})}function y6(n,a){const i=[];let o=n;const c=new Set;for(;o&&a.has(o)&&!c.has(o);){c.add(o);const u=a.get(o);i.unshift(u),o=u.parentTaskId||void 0}return i}const $s={label:"Home",url:Ps};function b6(n){return n?[$s,{label:"Settings",url:Pi},{label:n,url:void 0}]:[$s,{label:"Settings",url:void 0}]}const k_={label:"Environments",url:$i};function x6(){return[$s,{label:"Environments",url:void 0}]}function _6(){return[$s,{label:"New Chat",url:void 0}]}function S6(n){return[$s,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function T6(n,a,i,o){const c=i.find(f=>f.id===n),u=o.find(f=>f.id===a);return[$s,k_,{label:(u==null?void 0:u.displayName)??"Environment",url:qi(a)},{label:(c==null?void 0:c.name)??"Workspace",url:void 0}]}function k6(n,a,i,o,c){const u=y6(n,c),f=c.get(n),p=f==null?void 0:f.workspaceId,m=p?i.find(S=>S.id===p):void 0,v=a??(m==null?void 0:m.environmentId),g=v?o.find(S=>S.id===v):void 0,b=[$s];g&&v&&(b.push(k_),b.push({label:g.displayName,url:qi(v)})),m&&v&&b.push({label:m.name,url:Gi(m.id,v)});for(let S=0;S<u.length-1;S++)b.push({label:u[S].title,url:na(u[S].id,void 0,p,v)});const x=u[u.length-1];return b.push({label:(x==null?void 0:x.title)??n,url:void 0}),b}function j6(){const n=_6(),[a]=rh(),i=a.get("env")??"",{sendInput:o,spawn:c,startTask:u,personas:f,environments:p,provisionEnvironment:m}=dt();return r.jsxs("div",{className:I.panelContainer,children:[r.jsx(hs,{segments:n}),r.jsx("div",{className:I.emptyState,children:"Enter a prompt below to start a new session"}),r.jsx(yl,{mode:"spawn",environmentId:i,showPersonaSelect:!0,personas:f,environments:p,onSendInput:o,onSpawn:c,onStartTask:u,onProvisionEnvironment:m})]})}function N6({sessionId:n,session:a,isActive:i,onStop:o,onKill:c}){return r.jsxs("div",{className:I.header,children:[r.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.endReason||a.status}`,a!=null&&a.inputTokens||a!=null&&a.outputTokens||a!=null&&a.costUsd?` | ${y_((a.inputTokens??0)+(a.outputTokens??0))} tokens · ${Zi(a.costUsd??0)}`:""]}),r.jsxs("span",{className:I.headerInfo,children:[a&&r.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&r.jsx(g_,{label:"Stop",onClick:o,variant:"danger",size:"sm","data-testid":"stop-split-button",options:[{label:"Stop",description:"Graceful shutdown",onClick:o},{label:"Kill",description:"Force kill",onClick:c}]})]})]})}function w6({session:n}){const a=n&&(n.status==="stopped"||n.status==="suspended"),i=a?`Session ${n.endReason||n.status} with no events recorded.`:"Waiting for events...";return r.jsx("div",{className:a?I.errorMessage:I.waitingMessage,children:i})}function C6(){const{sessionId:n}=ds(),{events:a,eventsDropped:i,sessions:o,kill:c,stopGraceful:u,loadSessionEvents:f,sendInput:p,spawn:m,startTask:v,personas:g,environments:b,provisionEnvironment:x}=dt(),S=y.useRef(void 0),T=S6(n),w=o.find(E=>E.id===n)??void 0,N=y.useMemo(()=>{const E=n?a.filter(A=>A.sessionId===n):[];return Yh(Fh(E))},[a,n]);if(y.useEffect(()=>{n&&n!==S.current&&(S.current=n,f(n))},[n,f]),!n)return r.jsx("div",{className:I.emptyState,children:"No session selected"});const k=(w==null?void 0:w.status)==="running"||(w==null?void 0:w.status)==="idle";return r.jsxs("div",{className:I.panelContainer,children:[r.jsx(hs,{segments:T}),r.jsx(N6,{sessionId:n,session:w,isActive:k,onStop:()=>u(n),onKill:()=>c(n)}),r.jsx(Kh,{events:N,eventsDropped:i,emptyState:r.jsx(w6,{session:w})}),k&&r.jsx(yl,{mode:"send",sessionId:n,environmentId:w.environmentId,personas:g,environments:b,onSendInput:p,onSpawn:m,onStartTask:v,onProvisionEnvironment:x})]})}function E6(n){if(!n)return!1;const a=n.tagName;return!!(a==="INPUT"||a==="TEXTAREA"||a==="SELECT"||n.isContentEditable)}function Ca(n,a){const i=y.useRef(a);i.current=a;const{key:o,ctrl:c=!1,shift:u=!1,suppressInInputs:f=!0,enabled:p=!0}=n;y.useEffect(()=>{if(!p)return;const m=v=>{if(f&&E6(document.activeElement??void 0))return;const g=v.ctrlKey||v.metaKey;c===g&&(u&&!v.shiftKey||v.key===o&&i.current())};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[o,c,u,f,p])}const U0=220,V0=70,A6=40,D6=60,R6="hierarchy",M6="dependency";function O6(n){return y.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new Kg.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:A6,ranksep:D6});const i=new Map(n.map(f=>[f.id,f])),o=new Map;for(const f of n)if(f.parentTaskId&&i.has(f.parentTaskId)){const p=o.get(f.parentTaskId)||[];p.push(f),o.set(f.parentTaskId,p)}for(const f of n)a.setNode(f.id,{width:U0,height:V0});const c=[];for(const f of n){if(f.parentTaskId&&i.has(f.parentTaskId)){const p=`hierarchy-${f.parentTaskId}-${f.id}`;a.setEdge(f.parentTaskId,f.id,{},p),c.push({id:p,source:f.parentTaskId,target:f.id,type:"smoothstep",data:{edgeType:R6},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of f.dependsOn)if(i.has(p)){const m=`dependency-${p}-${f.id}`;a.setEdge(p,f.id,{},m),c.push({id:m,source:p,target:f.id,type:"smoothstep",data:{edgeType:M6},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Kg.layout(a),{nodes:n.map(f=>{const p=a.node(f.id),m=o.get(f.id)||[];return{id:f.id,type:"task",position:{x:p.x-U0/2,y:p.y-V0/2},data:{task:f,childCount:m.length,doneChildCount:m.filter(v=>v.status==="complete").length,hasDependencies:f.dependsOn.length>0}}}),edges:c}},[n])}const B6="_dagContainer_js4w6_1",L6="_taskNode_js4w6_26",I6="_taskNodeBorder_js4w6_54",z6="_taskNodeContent_js4w6_60",U6="_taskNodeHeader_js4w6_70",V6="_taskNodeIcon_js4w6_77",H6="_taskNodeTitle_js4w6_82",P6="_taskNodeBadges_js4w6_90",G6="_childBadge_js4w6_95",$6="_depBadge_js4w6_107",q6="_handle_js4w6_119",K6="_emptyCta_js4w6_126",F6="_ctaDescription_js4w6_137",Y6="_ctaButton_js4w6_144",en={dagContainer:B6,taskNode:L6,taskNodeBorder:I6,taskNodeContent:z6,taskNodeHeader:U6,taskNodeIcon:V6,taskNodeTitle:H6,taskNodeBadges:P6,childBadge:G6,depBadge:$6,handle:q6,emptyCta:K6,ctaDescription:F6,ctaButton:Y6};function Z6({data:n}){const{task:a,childCount:i,doneChildCount:o,hasDependencies:c}=n,u=us(a.status);return r.jsxs("div",{className:en.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[r.jsx(Fg,{type:"target",position:Yg.Top,className:en.handle}),r.jsx("div",{className:en.taskNodeBorder,style:{backgroundColor:u.color}}),r.jsxs("div",{className:en.taskNodeContent,children:[r.jsxs("div",{className:en.taskNodeHeader,children:[r.jsx("span",{className:en.taskNodeIcon,style:{color:u.color},children:u.icon}),r.jsx("span",{className:en.taskNodeTitle,children:a.title})]}),r.jsxs("div",{className:en.taskNodeBadges,children:[i>0&&r.jsxs("span",{className:en.childBadge,children:[o,"/",i]}),c&&r.jsx("span",{className:en.depBadge,children:"dep"})]})]}),r.jsx(Fg,{type:"source",position:Yg.Bottom,className:en.handle})]})}const X6=Q2,W6={task:Z6};function Q6({workspaceId:n,environmentId:a,tasks:i}){const o=xt(),{resolvedThemeId:c}=Db(),u=y.useMemo(()=>i.filter(b=>b.workspaceId===n),[i,n]),{nodes:f,edges:p}=O6(u),m=y.useMemo(()=>{const b=getComputedStyle(document.documentElement),x={};for(const[S,T]of Object.entries(X6))x[S]=b.getPropertyValue(T).trim()||"#6b7a8d";return x},[c]),v=y.useCallback((b,x)=>{o(na(x.id,void 0,n,a))},[o,n,a]),g=y.useCallback(b=>{const x=b.data;return m[x.task.status]||m.pending},[m]);return u.length===0?r.jsxs("div",{className:en.emptyCta,children:[r.jsx("button",{className:en.ctaButton,onClick:()=>o(Fs(n,void 0,a)),children:"Create Task"}),r.jsx("div",{className:en.ctaDescription,children:"Create tasks to see the dependency graph"})]}):r.jsx("div",{className:en.dagContainer,children:r.jsxs(FS,{nodes:f,edges:p,nodeTypes:W6,onNodeClick:v,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[r.jsx(YS,{variant:ZS.Dots,gap:24,size:1,color:"var(--text-disabled)"}),r.jsx(XS,{showInteractive:!1}),r.jsx(WS,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function J6({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const o=new Map;for(const u of n)if(u.parentTaskId){const f=o.get(u.parentTaskId);f?f.push(u):o.set(u.parentTaskId,[u])}const c=new Map(R0.map(u=>[u,[]]));for(const u of n){const f=qh(u.status),p=u.dependsOn.length>0&&u.dependsOn.some(T=>a.get(T)!=="complete"),m=o.get(u.id)??[],v=m.length,g=m.filter(T=>T.status==="complete").length;let b;if(f==="paused"&&i){const T=i.get(u.id);T==="idle"?b="Needs input":T==="completed"&&(b="Ready to complete")}const x={task:u,isBlocked:p,childCount:v,doneChildCount:g,pausedSubBadge:b},S=c.get(f);S?S.push(x):c.get("not_started").push(x)}for(const u of c.values())u.sort((f,p)=>f.task.sortOrder-p.task.sortOrder);return R0.map(u=>{const f=us(u);return{status:u,label:f.label,style:f,tasks:c.get(u)??[]}})}const e4="_boardContainer_1c4y1_1",t4="_column_1c4y1_17",n4="_columnHeader_1c4y1_34",a4="_columnIcon_1c4y1_47",s4="_columnLabel_1c4y1_52",i4="_columnCount_1c4y1_57",o4="_cardList_1c4y1_67",l4="_emptyPlaceholder_1c4y1_76",r4="_card_1c4y1_67",c4="_cardHeader_1c4y1_107",u4="_cardStatusIcon_1c4y1_113",d4="_cardTitle_1c4y1_119",f4="_cardBadges_1c4y1_127",h4="_badge_1c4y1_134",p4="_blockedBadge_1c4y1_146",m4="_childBadge_1c4y1_151",v4="_depBadge_1c4y1_155",g4="_parentBadge_1c4y1_159",y4="_pausedSubBadge_1c4y1_166",b4="_personaBadge_1c4y1_170",x4="_envBadge_1c4y1_174",_4="_emptyCta_1c4y1_178",S4="_ctaButton_1c4y1_188",T4="_ctaDescription_1c4y1_204",We={boardContainer:e4,column:t4,columnHeader:n4,columnIcon:a4,columnLabel:s4,columnCount:i4,cardList:o4,emptyPlaceholder:l4,card:r4,cardHeader:c4,cardStatusIcon:u4,cardTitle:d4,cardBadges:f4,badge:h4,blockedBadge:p4,childBadge:m4,depBadge:v4,parentBadge:g4,pausedSubBadge:y4,personaBadge:b4,envBadge:x4,emptyCta:_4,ctaButton:S4,ctaDescription:T4};function k4({workspaceId:n,environmentId:a,tasks:i,sessions:o,personas:c,environments:u}){const f=xt(),p=y.useMemo(()=>i.filter(x=>x.workspaceId===n),[i,n]),m=y.useMemo(()=>new Map(i.map(x=>[x.id,x.status])),[i]),v=y.useMemo(()=>new Map(p.map(x=>[x.id,x])),[p]),g=y.useMemo(()=>{const x=new Map(o.map(E=>[E.id,E])),S=new Map(c.map(E=>[E.id,E])),T=new Map(u.map(E=>[E.id,E])),w=new Map,N=new Map,k=new Map;for(const E of p)if(E.latestSessionId){const A=x.get(E.latestSessionId);if(A){if(w.set(E.id,A.endReason||A.status),A.personaId){const R=S.get(A.personaId);R&&N.set(E.id,R.name)}if(A.environmentId){const R=T.get(A.environmentId);R&&k.set(E.id,R.displayName)}}}return{sessionStatusByTaskId:w,personaNameByTaskId:N,environmentNameByTaskId:k}},[p,o,c,u]),b=y.useMemo(()=>J6({tasks:p,taskStatusById:m,sessionStatusByTaskId:g.sessionStatusByTaskId}),[p,m,g]);return p.length===0?r.jsxs("div",{className:We.emptyCta,"data-testid":"board-empty-cta",children:[r.jsx("button",{className:We.ctaButton,onClick:()=>f(Fs(n,void 0,a)),children:"Create Task"}),r.jsx("div",{className:We.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):r.jsx("div",{className:We.boardContainer,"data-testid":"board-container",children:b.map(x=>r.jsxs("section",{className:We.column,"data-testid":`board-column-${x.status}`,"aria-label":`${x.label}, ${x.tasks.length} ${x.tasks.length===1?"task":"tasks"}`,children:[r.jsxs("div",{className:We.columnHeader,children:[r.jsx("span",{className:We.columnIcon,style:{color:x.style.color},children:x.style.icon}),r.jsx("span",{className:We.columnLabel,children:x.label}),r.jsx("span",{className:We.columnCount,"data-testid":`board-count-${x.status}`,children:x.tasks.length})]}),r.jsx("div",{className:We.cardList,children:x.tasks.length===0?r.jsx("div",{className:We.emptyPlaceholder,children:"No tasks"}):r.jsx(aa,{mode:"popLayout",children:x.tasks.map(S=>r.jsx(At.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:r.jsx(j4,{boardTask:S,tasksById:v,personaName:g.personaNameByTaskId.get(S.task.id),envName:g.environmentNameByTaskId.get(S.task.id),onClick:()=>f(na(S.task.id,void 0,n,a))})},S.task.id))})})]},x.status))})}function j4({boardTask:n,tasksById:a,personaName:i,envName:o,onClick:c}){const{task:u,isBlocked:f,childCount:p,doneChildCount:m,pausedSubBadge:v}=n,g=us(u.status),b=u.parentTaskId?a.get(u.parentTaskId):void 0;return r.jsxs("div",{className:We.card,tabIndex:0,role:"button","data-testid":`board-card-${u.id}`,onClick:c,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),c())},children:[r.jsxs("div",{className:We.cardHeader,children:[r.jsx("span",{className:We.cardStatusIcon,style:{color:g.color},children:g.icon}),r.jsx("span",{className:We.cardTitle,children:u.title})]}),r.jsxs("div",{className:We.cardBadges,children:[b&&r.jsx("span",{className:`${We.badge} ${We.parentBadge}`,title:b.title,children:b.title}),p>0&&r.jsxs("span",{className:`${We.badge} ${We.childBadge}`,children:[m,"/",p]}),f&&r.jsx("span",{className:`${We.badge} ${We.blockedBadge}`,children:"blocked"}),u.dependsOn.length>0&&!f&&r.jsx("span",{className:`${We.badge} ${We.depBadge}`,children:"dep"}),v&&r.jsx("span",{className:`${We.badge} ${We.pausedSubBadge}`,children:v}),i&&r.jsx("span",{className:`${We.badge} ${We.personaBadge}`,children:i}),o&&r.jsx("span",{className:`${We.badge} ${We.envBadge}`,children:o})]})]})}function Zh(n){const{value:a,onSave:i,validate:o,fieldId:c,activeFieldId:u,onActivate:f,enterToSave:p=!0,trimOnSave:m=!0}=n,[v,g]=y.useState(""),[b,x]=y.useState(""),S=y.useRef(!1),T=u===c,w=y.useCallback(H=>{g(H),x("")},[]),N=y.useCallback(()=>{x("")},[]),k=y.useCallback(()=>{S.current=!1,f==null||f(null),g(""),x("")},[f]),E=y.useCallback(()=>{const H=m?v.trim():v;if(o){const K=o(v);if(K){x(K);return}}const B=m?a.trim():a;if(H===B){k();return}i(H),k()},[v,a,m,o,i,k]),A=y.useCallback(()=>{S.current=!0,f==null||f(c),g(a),x("")},[c,a,f]),R=y.useCallback(H=>{if(S.current){S.current=!1;return}H.relatedTarget instanceof HTMLElement&&H.relatedTarget.dataset.editAction===c||E()},[c,E]),C=y.useCallback(H=>{H.key==="Escape"?k():H.key==="Enter"&&p&&E()},[k,p,E]),z=(()=>{if(!T)return!1;const H=m?a.trim():a;return(m?v.trim():v)!==H})();return y.useEffect(()=>{!T&&(v!==""||b!=="")&&(g(""),x(""))},[T,v,b]),{isEditing:T,draft:v,error:b,isDirty:z,startEdit:A,cancelEdit:k,save:E,setDraft:w,clearError:N,handleBlur:R,handleKeyDown:C,ignoreInitialBlurRef:S}}const N4="_editFieldWrapper_yuzty_1",w4="_editInput_yuzty_10",C4="_editTextarea_yuzty_42",E4="_editSelect_yuzty_78",A4="_editError_yuzty_111",D4="_editInputInvalid_yuzty_118",R4="_editHint_yuzty_123",M4="_unsavedDot_yuzty_132",O4="_metaValueClickable_yuzty_140",B4="_editButton_yuzty_159",L4="_metaPlaceholder_yuzty_175",I4="_worktreeToggle_yuzty_180",Ye={editFieldWrapper:N4,editInput:w4,editTextarea:C4,editSelect:E4,editError:A4,editInputInvalid:D4,editHint:R4,unsavedDot:M4,metaValueClickable:O4,editButton:B4,metaPlaceholder:L4,worktreeToggle:I4};function Kt(n){const{value:a,onSave:i,validate:o,mode:c="edit",fieldId:u="text",activeFieldId:f,onActivate:p,onChange:m,renderDisplay:v,placeholder:g,maxLength:b,ariaLabel:x,"data-testid":S}=n,T=y.useRef(null),w=Zh({value:a,onSave:i,validate:o,fieldId:u,activeFieldId:f,onActivate:p,enterToSave:!0,trimOnSave:!0});if(y.useEffect(()=>{if(w.isEditing){const k=window.setTimeout(()=>{var E;(E=T.current)==null||E.focus()},0);return()=>window.clearTimeout(k)}},[w.isEditing]),c==="create"){const k=A=>{m==null||m(A.target.value)},E=o==null?void 0:o(a);return r.jsxs("div",{className:Ye.editFieldWrapper,children:[r.jsx("input",{className:`${Ye.editInput} ${E?Ye.editInputInvalid:""}`,value:a,onChange:k,maxLength:b,placeholder:g,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),E&&r.jsx("span",{className:Ye.editError,"data-testid":"edit-error",children:E})]})}if(w.isEditing)return r.jsxs("div",{className:Ye.editFieldWrapper,children:[r.jsx("input",{ref:T,className:`${Ye.editInput} ${w.error?Ye.editInputInvalid:""}`,value:w.draft,onChange:k=>w.setDraft(k.target.value),onBlur:w.handleBlur,onKeyDown:w.handleKeyDown,maxLength:b,placeholder:g,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),w.isDirty&&r.jsx("span",{className:Ye.unsavedDot,title:"Unsaved changes"}),w.error&&r.jsx("span",{className:Ye.editError,"data-testid":"edit-error",children:w.error}),r.jsx("span",{className:Ye.editHint,children:"Enter to save · Esc to cancel"})]});const N=v==null?void 0:v(a);return r.jsxs("span",{role:"button",tabIndex:0,className:Ye.metaValueClickable,onClick:()=>w.startEdit(),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),w.startEdit())},title:"Click to edit","aria-label":x,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:a?r.jsx("span",{children:a}):r.jsx("span",{className:Ye.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:Ye.editButton,"aria-hidden":"true",children:"✏️"})]})}function Wf(n){const{value:a,onSave:i,validate:o,mode:c="edit",fieldId:u="textarea",activeFieldId:f,onActivate:p,onChange:m,renderDisplay:v,placeholder:g,ariaLabel:b,"data-testid":x}=n,S=y.useRef(null),T=Zh({value:a,onSave:i,validate:o,fieldId:u,activeFieldId:f,onActivate:p,enterToSave:!1,trimOnSave:!1});if(y.useEffect(()=>{if(T.isEditing){const N=window.setTimeout(()=>{var k;(k=S.current)==null||k.focus()},0);return()=>window.clearTimeout(N)}},[T.isEditing]),c==="create"){const N=E=>{m==null||m(E.target.value)},k=o==null?void 0:o(a);return r.jsxs("div",{className:Ye.editFieldWrapper,children:[r.jsx("textarea",{className:`${Ye.editTextarea} ${k?Ye.editInputInvalid:""}`,value:a,onChange:N,placeholder:g,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),k&&r.jsx("span",{className:Ye.editError,"data-testid":"edit-error",children:k})]})}if(T.isEditing)return r.jsxs("div",{className:Ye.editFieldWrapper,children:[r.jsx("textarea",{ref:S,className:`${Ye.editTextarea} ${T.error?Ye.editInputInvalid:""}`,value:T.draft,onChange:N=>T.setDraft(N.target.value),onBlur:T.handleBlur,onKeyDown:T.handleKeyDown,title:b,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),T.isDirty&&r.jsx("span",{className:Ye.unsavedDot,title:"Unsaved changes"}),T.error&&r.jsx("span",{className:Ye.editError,"data-testid":"edit-error",children:T.error}),r.jsx("span",{className:Ye.editHint,children:"Tab to save · Esc to cancel"})]});const w=v==null?void 0:v(a);return r.jsxs("span",{role:"button",tabIndex:0,className:Ye.metaValueClickable,onClick:()=>T.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),T.startEdit())},title:"Click to edit","aria-label":b,"data-testid":x?`${x}-button`:void 0,children:[w!==void 0?w:a?r.jsx("span",{children:a}):r.jsx("span",{className:Ye.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:Ye.editButton,"aria-hidden":"true",children:"✏️"})]})}function gc(n){var A;const{value:a,onSave:i,mode:o="edit",options:c,fieldId:u="select",activeFieldId:f,onActivate:p,onChange:m,renderDisplay:v,placeholder:g,ariaLabel:b,"data-testid":x}=n,S=y.useRef(null),T=Zh({value:a,onSave:i,fieldId:u,activeFieldId:f,onActivate:p,enterToSave:!1,trimOnSave:!1});y.useEffect(()=>{if(T.isEditing){const R=window.setTimeout(()=>{var C;(C=S.current)==null||C.focus()},0);return()=>window.clearTimeout(R)}},[T.isEditing]);const w=y.useCallback(R=>{const C=R.target.value;T.ignoreInitialBlurRef.current=!1,C!==a&&i(C),T.cancelEdit()},[a,i,T]),N=y.useCallback(R=>{if(T.ignoreInitialBlurRef.current){T.ignoreInitialBlurRef.current=!1;return}R.relatedTarget instanceof HTMLElement&&R.relatedTarget.dataset.editAction===u||T.cancelEdit()},[u,T]);if(o==="create")return r.jsx("select",{className:Ye.editSelect,value:a,onChange:R=>m==null?void 0:m(R.target.value),"aria-label":b,"data-testid":x?`${x}-select`:void 0,children:c.map(R=>r.jsx("option",{value:R.value,children:R.label},R.value))});if(T.isEditing)return r.jsx("select",{ref:S,className:Ye.editSelect,value:T.draft,onChange:w,onBlur:N,title:b,"aria-label":b,"data-testid":x?`${x}-select`:void 0,children:c.map(R=>r.jsx("option",{value:R.value,children:R.label},R.value))});const k=v==null?void 0:v(a),E=(A=c.find(R=>R.value===a))==null?void 0:A.label;return r.jsxs("button",{type:"button",className:Ye.metaValueClickable,onClick:()=>T.startEdit(),title:"Click to change","aria-label":b,"data-testid":x?`${x}-button`:void 0,children:[k!==void 0?k:E?r.jsx("span",{children:E}):r.jsx("span",{className:Ye.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:Ye.editButton,"aria-hidden":"true",children:"✏️"})]})}function z4(n){const{checked:a,onChange:i,label:o,ariaLabel:c,"data-testid":u}=n;return r.jsxs("label",{className:Ye.worktreeToggle,"data-testid":u,children:[r.jsx("input",{type:"checkbox",checked:a,onChange:f=>i(f.target.checked),"aria-label":c}),r.jsx("span",{children:o})]})}const U4="_envRow_1e1r5_1",V4="_envDot_1e1r5_7",H4="_envDotGreen_1e1r5_14",P4="_envDotYellow_1e1r5_18",G4="_envDotRed_1e1r5_22",$4="_envDotGray_1e1r5_26",Hi={envRow:U4,envDot:V4,envDotGreen:H4,envDotYellow:P4,envDotRed:G4,envDotGray:$4};function q4(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Hi.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Hi.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Hi.envDotRed:Hi.envDotGray}function K4(n){const{value:a,onSave:i,environments:o,allowNone:c=!1,fieldId:u="environment",activeFieldId:f,onActivate:p,placeholder:m="No environment",ariaLabel:v="Environment","data-testid":g}=n,b=o.find(T=>T.id===a),x=[...c?[{value:"",label:"None"}]:[],...o.map(T=>({value:T.id,label:T.displayName}))],S=()=>{if(b)return r.jsxs("span",{className:Hi.envRow,children:[r.jsx("span",{className:`${Hi.envDot} ${q4(b.status)}`}),b.displayName]})};return r.jsx(gc,{value:a,onSave:i,options:x,fieldId:u,activeFieldId:f,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:v,"data-testid":g})}function H0(n){if(!n)return"";const a=new Date(n);if(isNaN(a.getTime()))return"";const o=Date.now()-a.getTime();if(o<0)return"just now";const c=Math.floor(o/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const u=Math.floor(c/60);if(u<24)return`${u}h ago`;const f=Math.floor(u/24);return f<30?`${f}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const _f=100;function F4(n){try{const a=new URL(n);return a.protocol!=="http:"&&a.protocol!=="https:"?void 0:a.toString()}catch{return}}function Y4(){const{workspaceId:n,environmentId:a}=ds(),i=xt(),{tasks:o,environments:c,workspaces:u,personas:f,sessions:p,archiveWorkspace:m,updateWorkspace:v,usageCache:g,loadUsage:b}=dt(),[x,S]=y.useState("tasks"),[T,w]=y.useState(!1),[N,k]=y.useState(null),[E,A]=y.useState(!1),R=y.useRef(void 0),C=u.find(q=>q.id===n),z=a??(C==null?void 0:C.environmentId)??"",H=T6(n,z,u,c);Ca({key:"1"},()=>S("graph")),Ca({key:"2"},()=>S("board")),Ca({key:"3"},()=>S("tasks")),y.useEffect(()=>{const q=R.current;R.current=n,!(q===void 0||q===n)&&N!==null&&k(null)},[n,N]);const B=p.reduce((q,ae)=>q+(ae.costUsd??0),0);y.useEffect(()=>{n&&b("workspace",n)},[n,b,B]);const K=n?g[`workspace:${n}`]:void 0,Q=o.filter(q=>q.workspaceId===n),se=Q.filter(q=>q.status==="complete").length,ne=Q.length,ce=ne>0?Math.round(se/ne*100):0;return r.jsxs("div",{className:I.panelContainer,children:[r.jsx(hs,{segments:H}),r.jsxs("div",{className:I.workspaceHeader,children:[r.jsx("span",{className:I.workspaceName,"data-testid":"workspace-name",children:r.jsx(Kt,{value:(C==null?void 0:C.name)||"",onSave:q=>{C&&v(C.id,{name:q})},validate:q=>{const ae=q.trim();if(!ae)return"Name is required";if(ae.length>_f)return`Max ${_f} characters`},maxLength:_f,fieldId:"name",activeFieldId:N,onActivate:k,ariaLabel:"Workspace name",renderDisplay:q=>q||n||void 0,"data-testid":"edit-name"})}),r.jsx("button",{className:I.archiveButton,onClick:()=>w(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),r.jsxs("button",{className:I.metaToggle,onClick:()=>A(!E),"aria-expanded":!E,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[r.jsx("span",{className:`${I.metaToggleArrow} ${E?"":I.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!E&&r.jsxs("div",{className:I.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Description"}),r.jsx("div",{className:I.metaValue,children:r.jsx(Wf,{value:(C==null?void 0:C.description)||"",onSave:q=>{C&&v(C.id,{description:q})},fieldId:"description",activeFieldId:N,onActivate:k,renderDisplay:q=>q?r.jsx("span",{className:I.overviewMarkdown,children:r.jsx(Qf,{remarkPlugins:[Jf],children:q})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Repository"}),r.jsx("div",{className:I.metaValue,children:r.jsx(Kt,{value:(C==null?void 0:C.repoUrl)||"",onSave:q=>{C&&v(C.id,{repoUrl:q})},validate:q=>{const ae=q.trim();if(ae&&!/^https?:\/\/.+/.test(ae))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:N,onActivate:k,renderDisplay:q=>{const ae=F4(q);return ae?r.jsx("a",{className:I.repoLink,href:ae,target:"_blank",rel:"noopener noreferrer",onClick:O=>O.stopPropagation(),children:q}):q?r.jsx("span",{children:q}):void 0},placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Environment"}),r.jsx("div",{className:I.metaValue,children:r.jsx(K4,{value:(C==null?void 0:C.environmentId)||"",onSave:q=>{C&&q&&v(C.id,{environmentId:q})},environments:c,fieldId:"environmentId",activeFieldId:N,onActivate:k,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Persona"}),r.jsx("div",{className:I.metaValue,children:r.jsx(gc,{value:(C==null?void 0:C.defaultPersonaId)||"",onSave:q=>{C&&v(C.id,{defaultPersonaId:q})},options:[{value:"",label:"(Inherit)"},...f.map(q=>({value:q.id,label:q.name}))],fieldId:"defaultPersonaId",activeFieldId:N,onActivate:k,renderDisplay:q=>{const ae=f.find(O=>O.id===q);if(ae)return r.jsx("span",{children:ae.name})},placeholder:(C==null?void 0:C.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Worktrees"}),r.jsx("div",{className:I.metaValue,children:r.jsx(z4,{checked:(C==null?void 0:C.useWorktrees)??!0,onChange:q=>{C&&v(C.id,{useWorktrees:q})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Working Dir"}),r.jsx("div",{className:I.metaValue,children:r.jsx(Kt,{value:(C==null?void 0:C.workingDirectory)||"",onSave:q=>{C&&v(C.id,{workingDirectory:q})},fieldId:"workingDirectory",activeFieldId:N,onActivate:k,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-working-directory"})})]}),C&&r.jsxs("div",{className:I.metaTimestamps,children:[r.jsxs("span",{className:I.metaTimestamp,children:["Created ",H0(C.createdAt)]}),C.updatedAt&&C.updatedAt!==C.createdAt&&r.jsxs("span",{className:I.metaTimestamp,children:["· Updated ",H0(C.updatedAt)]})]})]}),ne>0&&r.jsxs("div",{className:I.progressBarContainer,"data-testid":"progress-bar",children:[r.jsx("div",{className:I.progressBar,children:r.jsx("div",{className:I.progressFill,style:{width:`${ce}%`}})}),r.jsxs("span",{className:I.progressLabel,children:[se,"/",ne]})]}),K&&K.costUsd>0&&r.jsx("div",{className:I.progressBarContainer,children:r.jsxs("span",{className:I.progressLabel,children:["Usage: ",Zi(K.costUsd)," (",K.sessionCount," session",K.sessionCount!==1?"s":"",")"]})}),r.jsxs("div",{className:I.tabBar,role:"tablist","aria-label":"Workspace view",children:[r.jsx("button",{role:"tab","aria-selected":x==="graph",className:`${I.tab} ${x==="graph"?I.active:""}`,onClick:()=>S("graph"),children:"Graph"}),r.jsx("button",{role:"tab","aria-selected":x==="board",className:`${I.tab} ${x==="board"?I.active:""}`,onClick:()=>S("board"),"data-testid":"board-tab",children:"Board"}),r.jsx("button",{role:"tab","aria-selected":x==="tasks",className:`${I.tab} ${x==="tasks"?I.active:""}`,onClick:()=>S("tasks"),children:"Tasks"})]}),x==="tasks"&&ne>0&&r.jsxs("div",{className:I.workspaceSummary,children:[r.jsx("span",{className:I.workspaceSummaryTitle,children:`${se}/${ne} tasks complete`}),r.jsx("span",{className:I.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),x==="tasks"&&ne===0&&r.jsxs("div",{className:I.emptyCta,children:[r.jsx("button",{className:I.ctaButton,onClick:()=>i(Fs(n,void 0,z)),children:"Create Task"}),r.jsx("div",{className:I.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),x==="board"&&r.jsx(k4,{workspaceId:n,environmentId:z,tasks:o,sessions:p,personas:f,environments:c}),x==="graph"&&r.jsx(Q6,{workspaceId:n,environmentId:z,tasks:o}),r.jsx(Gs,{isOpen:T,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{C&&(m(C.id),i("/",{replace:!0})),w(!1)},onCancel:()=>w(!1)})]})}const Z4="_formContent_ymnez_1",X4="_section_ymnez_13",W4="_label_ymnez_19",Q4="_titleInput_ymnez_26",J4="_descriptionTextarea_ymnez_58",eB="_selectField_ymnez_94",tB="_checkboxRow_ymnez_128",nB="_checkboxLabel_ymnez_141",aB="_fieldError_ymnez_146",rt={formContent:Z4,section:X4,label:W4,titleInput:Q4,descriptionTextarea:J4,selectField:eB,checkboxRow:tB,checkboxLabel:nB,fieldError:aB};function sB(n,a){return{name:(n==null?void 0:n.name)??"",description:(n==null?void 0:n.description)??"",repoUrl:(n==null?void 0:n.repoUrl)??"",environmentId:(n==null?void 0:n.environmentId)??a??"",defaultPersonaId:(n==null?void 0:n.defaultPersonaId)??"",useWorktrees:(n==null?void 0:n.useWorktrees)??!0,workingDirectory:(n==null?void 0:n.workingDirectory)??""}}const iB=100;function oB({values:n,onChange:a,environments:i,personas:o,errors:c,disabled:u,autoFocusName:f}){const p=(m,v)=>{a({...n,[m]:v})};return r.jsxs("div",{className:rt.formContent,children:[r.jsxs("div",{className:rt.section,children:[r.jsx("label",{className:rt.label,htmlFor:"ws-name",children:"Name"}),r.jsx("input",{id:"ws-name",className:rt.titleInput,type:"text",value:n.name,onChange:m=>p("name",m.target.value),placeholder:"Workspace name",maxLength:iB,autoFocus:f,disabled:u,"data-testid":"workspace-form-name"}),(c==null?void 0:c.name)&&r.jsx("span",{className:rt.fieldError,"data-testid":"workspace-form-error-name",children:c.name})]}),r.jsxs("div",{className:rt.section,children:[r.jsx("label",{className:rt.label,htmlFor:"ws-description",children:"Description"}),r.jsx("textarea",{id:"ws-description",className:rt.descriptionTextarea,value:n.description,onChange:m=>p("description",m.target.value),placeholder:"Optional description (Markdown supported)",disabled:u,"data-testid":"workspace-form-description"})]}),r.jsxs("div",{className:rt.section,children:[r.jsx("label",{className:rt.label,htmlFor:"ws-repo",children:"Repository URL"}),r.jsx("input",{id:"ws-repo",className:rt.titleInput,type:"text",value:n.repoUrl,onChange:m=>p("repoUrl",m.target.value),placeholder:"https://github.com/org/repo",disabled:u,"data-testid":"workspace-form-repo"}),(c==null?void 0:c.repoUrl)&&r.jsx("span",{className:rt.fieldError,"data-testid":"workspace-form-error-repoUrl",children:c.repoUrl})]}),r.jsxs("div",{className:rt.section,children:[r.jsx("label",{className:rt.label,htmlFor:"ws-environment",children:"Environment"}),r.jsxs("select",{id:"ws-environment",className:rt.selectField,value:n.environmentId,onChange:m=>p("environmentId",m.target.value),disabled:u,"data-testid":"workspace-form-environment",children:[r.jsx("option",{value:"",children:"Select environment…"}),i.map(m=>r.jsx("option",{value:m.id,children:m.displayName||m.id},m.id))]}),(c==null?void 0:c.environmentId)&&r.jsx("span",{className:rt.fieldError,"data-testid":"workspace-form-error-environmentId",children:c.environmentId})]}),r.jsxs("div",{className:rt.section,children:[r.jsx("label",{className:rt.label,htmlFor:"ws-persona",children:"Default Persona"}),r.jsxs("select",{id:"ws-persona",className:rt.selectField,value:n.defaultPersonaId,onChange:m=>p("defaultPersonaId",m.target.value),disabled:u,"data-testid":"workspace-form-persona",children:[r.jsx("option",{value:"",children:"(Inherit)"}),o.map(m=>r.jsx("option",{value:m.id,children:m.name},m.id))]})]}),r.jsx("div",{className:rt.section,children:r.jsxs("label",{className:rt.checkboxRow,children:[r.jsx("input",{type:"checkbox",checked:n.useWorktrees,onChange:m=>p("useWorktrees",m.target.checked),disabled:u,"data-testid":"workspace-form-worktrees"}),r.jsx("span",{className:rt.checkboxLabel,children:"Enable worktree isolation"})]})}),r.jsxs("div",{className:rt.section,children:[r.jsx("label",{className:rt.label,htmlFor:"ws-workdir",children:"Working Directory"}),r.jsx("input",{id:"ws-workdir",className:rt.titleInput,type:"text",value:n.workingDirectory,onChange:m=>p("workingDirectory",m.target.value),placeholder:"Default (server default)",disabled:u,"data-testid":"workspace-form-workdir"})]})]})}const lB="_container_cddyd_1",rB="_header_cddyd_8",cB="_headerTitle_cddyd_35",uB="_badge_cddyd_44",dB="_headerActions_cddyd_54",fB="_body_cddyd_61",hB="_formContent_cddyd_73",pB="_section_cddyd_85",mB="_label_cddyd_91",vB="_titleInput_cddyd_98",gB="_descriptionTextarea_cddyd_131",yB="_parentContext_cddyd_167",bB="_parentLabel_cddyd_175",xB="_parentName_cddyd_182",_B="_personaSelect_cddyd_186",SB="_depList_cddyd_220",TB="_depItem_cddyd_226",kB="_depItemSelected_cddyd_248",jB="_noDeps_cddyd_252",NB="_btnPrimary_cddyd_258",wB="_btnGhost_cddyd_289",Me={container:lB,header:rB,headerTitle:cB,badge:uB,headerActions:dB,body:fB,formContent:hB,section:pB,label:mB,titleInput:vB,descriptionTextarea:gB,parentContext:yB,parentLabel:bB,parentName:xB,personaSelect:_B,depList:SB,depItem:TB,depItemSelected:kB,noDeps:jB,btnPrimary:NB,btnGhost:wB};function CB(n){const a={};return n.name.trim()||(a.name="Name is required"),n.repoUrl.trim()&&!/^https?:\/\/.+/i.test(n.repoUrl.trim())&&(a.repoUrl="Must be a valid http(s) URL"),n.environmentId||(a.environmentId="Environment is required"),Object.keys(a).length>0?a:void 0}const EB=[{label:"Home",url:Ps},{label:"New Workspace",url:void 0}];function AB(){const[n]=rh(),a=n.get("environment")??void 0,{environments:i,personas:o,createWorkspace:c,workspaceCreating:u}=dt(),{showToast:f}=Da(),p=xt(),[m,v]=y.useState(()=>{var N;return sB(void 0,a||((N=i[0])==null?void 0:N.id))}),[g,b]=y.useState(),[x,S]=y.useState();y.useEffect(()=>{a||m.environmentId||i.length===0||v(N=>{var k;return N.environmentId?N:{...N,environmentId:((k=i[0])==null?void 0:k.id)??""}})},[i,a,m.environmentId]);const T=()=>{const N=CB(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,()=>{f("Workspace created","success"),p(Ps,{replace:!0})},k=>{S(k)})},w=()=>{p(a?qi(a):Ps,{replace:!0})};return r.jsxs("div",{className:Me.container,children:[r.jsxs("div",{className:Me.header,children:[r.jsx("div",{className:Me.headerTitle,children:r.jsx(hs,{segments:EB})}),r.jsxs("div",{className:Me.headerActions,children:[r.jsx("button",{className:Me.btnGhost,onClick:w,disabled:u,"data-testid":"workspace-create-cancel",children:"Cancel"}),r.jsx("button",{className:Me.btnPrimary,onClick:T,disabled:u||!m.name.trim()||!m.environmentId,"data-testid":"workspace-create-save",children:u?r.jsx(b_,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),r.jsxs("div",{className:Me.body,children:[r.jsx(oB,{values:m,onChange:N=>{v(N),b(void 0),S(void 0)},environments:i,personas:o,errors:g,disabled:u,autoFocusName:!0}),x&&r.jsx("div",{className:Me.error,"data-testid":"workspace-create-submit-error",children:x})]})]})}function j_({mode:n,taskId:a,workspaceId:i,parentTaskId:o,environmentId:c,tasks:u,workspaces:f,personas:p,onCreateTask:m,onUpdateTask:v,onEditDone:g}){const{showToast:b}=Da(),x=xt(),S=n==="edit",T=S&&a?u.find(he=>he.id===a):void 0,w=S?(T==null?void 0:T.workspaceId)??"":i??"",[N,k]=y.useState(w),E=w||N,A=f.find(he=>he.id===E),R=c??(A==null?void 0:A.environmentId),C=!S&&!i,z=S?(T==null?void 0:T.parentTaskId)??"":o??"",H=z?u.find(he=>he.id===z):void 0,[B,K]=y.useState((T==null?void 0:T.title)??""),[Q,se]=y.useState((T==null?void 0:T.description)??""),[ne,ce]=y.useState((T==null?void 0:T.dependsOn)??[]),[q,ae]=y.useState((T==null?void 0:T.defaultPersonaId)??""),[O,G]=y.useState((T==null?void 0:T.canDecompose)??!1),[W,le]=y.useState(!1),re=y.useRef(!1);y.useEffect(()=>{S&&T&&!re.current&&(re.current=!0,K(T.title),se(T.description),ce(T.dependsOn),ae(T.defaultPersonaId),G(T.canDecompose))},[S,T]);const Re=u.filter(he=>he.workspaceId===E&&(!S||he.id!==a)&&he.id!==z),we=B.trim().length>0&&(!S||T!==void 0)&&E.length>0,Te=he=>{ce($e=>$e.includes(he)?$e.filter(Ft=>Ft!==he):[...$e,he])},Be=()=>{!we||W||S&&T===void 0||(S&&a?(v(a,B.trim(),Q,ne,q),b("Task updated","success"),g?g():x(na(a,void 0,E,R),{replace:!0})):(le(!0),m(E,B.trim(),Q,ne.length>0?ne:void 0,z||void 0,q,O,()=>{b("Task created","success"),x(i?Gi(i,R):"/tasks",{replace:!0})},he=>{b(he,"error"),le(!1)})))},ue=()=>{if(g){g();return}x(S&&a?na(a,void 0,E,R):i?Gi(i,R):"/tasks")},ve=S?"edit task":z?"child task":"new task";return r.jsxs("div",{className:Me.container,children:[r.jsxs("div",{className:Me.header,children:[r.jsxs("div",{className:Me.headerTitle,children:[r.jsx("span",{className:Me.badge,children:ve}),H&&r.jsxs("span",{className:Me.parentContext,children:[r.jsx("span",{className:Me.parentLabel,children:"Child of"}),r.jsx("span",{className:Me.parentName,children:H.title})]})]}),r.jsxs("div",{className:Me.headerActions,children:[r.jsx("button",{onClick:Be,disabled:!we||W,className:Me.btnPrimary,"data-testid":"task-edit-save",children:W?"Creating…":S?"Save Changes":"Create"}),r.jsx("button",{onClick:ue,className:Me.btnGhost,children:"Cancel"})]})]}),r.jsx("div",{className:Me.body,children:r.jsxs("div",{className:Me.formContent,children:[C&&r.jsxs("div",{className:Me.section,children:[r.jsx("label",{className:Me.label,htmlFor:"task-edit-workspace",children:"Workspace"}),r.jsxs("select",{id:"task-edit-workspace",value:N,onChange:he=>k(he.target.value),className:Me.personaSelect,"data-testid":"task-edit-workspace",children:[r.jsx("option",{value:"",children:"Select a workspace..."}),f.map(he=>r.jsx("option",{value:he.id,children:he.name},he.id))]})]}),r.jsxs("div",{className:Me.section,children:[r.jsx("label",{className:Me.label,htmlFor:"task-edit-title",children:"Title"}),r.jsx("input",{id:"task-edit-title",type:"text",value:B,onChange:he=>K(he.target.value),placeholder:"Task title...",autoFocus:!0,className:Me.titleInput,"data-testid":"task-edit-title",onKeyDown:he=>{he.key==="Enter"&&we&&Be()}})]}),r.jsxs("div",{className:Me.section,children:[r.jsx("label",{className:Me.label,htmlFor:"task-edit-description",children:"Description"}),r.jsx("textarea",{id:"task-edit-description",value:Q,onChange:he=>se(he.target.value),placeholder:"Describe the task... (markdown supported)",className:Me.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),r.jsxs("div",{className:Me.section,children:[r.jsx("label",{className:Me.label,htmlFor:"task-edit-persona",children:"Default Persona"}),r.jsxs("select",{id:"task-edit-persona",value:q,onChange:he=>ae(he.target.value),className:Me.personaSelect,"data-testid":"task-edit-persona",children:[r.jsx("option",{value:"",children:"(Inherit)"}),p.map(he=>r.jsx("option",{value:he.id,children:he.name},he.id))]})]}),!S&&r.jsx("div",{className:Me.section,children:r.jsxs("label",{className:Me.depItem,"data-testid":"task-edit-can-decompose",children:[r.jsx("input",{type:"checkbox",checked:O,onChange:he=>G(he.target.checked)}),"Can spawn subtasks"]})}),r.jsxs("div",{className:Me.section,children:[r.jsx("div",{className:Me.label,children:"Dependencies"}),Re.length===0?r.jsx("div",{className:Me.noDeps,children:"No other tasks in this workspace"}):r.jsx("div",{className:Me.depList,children:Re.map(he=>{const $e=ne.includes(he.id);return r.jsxs("label",{className:`${Me.depItem} ${$e?Me.depItemSelected:""}`,"data-testid":`dep-option-${he.id}`,children:[r.jsx("input",{type:"checkbox",checked:$e,onChange:()=>Te(he.id)}),he.title,r.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",he.status,")"]})]},he.id)})})]})]})})]})}function P0(){const{workspaceId:n,environmentId:a}=ds(),[i]=rh(),o=n??i.get("workspace")??"",c=i.get("parent")??void 0,{tasks:u,workspaces:f,personas:p,createTask:m,updateTask:v}=dt();return r.jsx(j_,{mode:"new",workspaceId:o,parentTaskId:c,environmentId:a,tasks:u,workspaces:f,personas:p,onCreateTask:m,onUpdateTask:v})}const DB="_container_1pqxm_1",RB="_emptyState_1pqxm_8",MB="_card_1pqxm_14",OB="_cardHeader_1pqxm_34",BB="_categoryBadge_1pqxm_46",LB="_findingTitle_1pqxm_54",IB="_findingDate_1pqxm_60",zB="_findingContent_1pqxm_72",UB="_tags_1pqxm_78",VB="_tag_1pqxm_78",Qn={container:DB,emptyState:RB,card:MB,cardHeader:OB,categoryBadge:BB,findingTitle:LB,findingDate:IB,findingContent:zB,tags:UB,tag:VB};function HB(n){const a=new Date(n),i=new Date,o=i.getTime()-a.getTime(),c=Math.floor(o/1e3),u=Math.floor(c/60),f=Math.floor(u/60),p=Math.floor(f/24);if(c<60)return"just now";if(u<60)return`${u}m ago`;if(f<24)return`${f}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const m=a.getFullYear()===i.getFullYear(),v=a.toLocaleString("en-US",{month:"short"}),g=a.getDate();return m?`${v} ${g}`:`${v} ${g} ${a.getFullYear()}`}const G0={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 PB({findings:n}){return n.length===0?r.jsx("div",{className:Qn.emptyState,children:"No findings yet. Agents will post discoveries here."}):r.jsx("div",{className:Qn.container,children:n.map((a,i)=>{const o=G0[a.category]||G0.general;return r.jsxs(At.div,{className:Qn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:i*.05,duration:.2},children:[r.jsxs("div",{className:Qn.cardHeader,children:[r.jsx("span",{className:Qn.categoryBadge,style:{background:o.bg,color:o.text},children:a.category}),r.jsx("span",{className:Qn.findingTitle,children:a.title}),r.jsx("span",{className:Qn.findingDate,title:a.createdAt,children:HB(a.createdAt)})]}),r.jsx("div",{className:Qn.findingContent,children:a.content.length>300?a.content.slice(0,300)+"...":a.content}),a.tags.length>0&&r.jsx("div",{className:Qn.tags,children:a.tags.map(c=>r.jsx("span",{className:Qn.tag,style:{color:o.text,textShadow:`0 0 8px ${o.text}`},children:c},c))})]},a.id)})})}const GB="_workpadSection_y8nj9_1",$B="_workpadLabel_y8nj9_9",qB="_workpadStatus_y8nj9_17",KB="_workpadSummary_y8nj9_23",FB="_workpadExtra_y8nj9_29",is={workpadSection:GB,workpadLabel:$B,workpadStatus:qB,workpadSummary:KB,workpadExtra:FB};function YB({workpad:n}){if(!n)return;let a;try{const i=JSON.parse(n);if(i==null||typeof i!="object"||Array.isArray(i))return;a=i}catch{return r.jsxs("div",{className:is.workpadSection,"data-testid":"workpad-panel",children:[r.jsx("div",{className:is.workpadLabel,children:"Workpad"}),r.jsx("div",{className:is.workpadExtra,children:n})]})}if(!(!a.status&&!a.summary&&!a.extra))return r.jsxs("div",{className:is.workpadSection,"data-testid":"workpad-panel",children:[r.jsx("div",{className:is.workpadLabel,children:"Workpad"}),a.status&&r.jsx("div",{className:is.workpadStatus,"data-testid":"workpad-status",children:a.status}),a.summary&&r.jsx("div",{className:is.workpadSummary,"data-testid":"workpad-summary",children:a.summary}),a.extra&&Object.keys(a.extra).length>0&&r.jsx("div",{className:is.workpadExtra,"data-testid":"workpad-extra",children:JSON.stringify(a.extra,null,2)})]})}function Qr(n){if(!n)return"—";const a=new Date(n);return isNaN(a.getTime())?"—":a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Sf(n,a){if(!n||!a)return;const i=new Date(a).getTime()-new Date(n).getTime();if(isNaN(i)||i<0)return;const o=Math.floor(i/6e4),c=Math.floor(i%6e4/1e3);if(o===0)return`${c}s`;const u=Math.floor(o/60),f=o%60;return u===0?`${o}m ${c}s`:`${u}h ${f}m`}function $0(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?I.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?I.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?I.envDotRed:I.envDotGray}function ZB({status:n}){const a=us(n),i=Z2(n);return r.jsx("span",{className:`${I.statusBadge} ${I[i]??I.statusPending}`,children:a.label})}function XB({task:n,tasksById:a,environments:i,workspaces:o,taskSessions:c,selectedEnvId:u}){const{loadUsage:f,usageCache:p}=dt(),m=c.reduce((A,R)=>A+(R.costUsd??0),0);y.useEffect(()=>{f("task",n.id),n.childTaskIds.length>0&&f("task_tree",n.id)},[n.id,n.childTaskIds.length,f,m]);const v=`task:${n.id}`,g=v in p?p[v]:void 0,b=`task_tree:${n.id}`,x=n.childTaskIds.length>0&&b in p?p[b]:void 0,S=c.length>0?c[c.length-1]:void 0,T=(S==null?void 0:S.environmentId)??"",w=T?i.find(A=>A.id===T):void 0,N=o.find(A=>A.id===n.workspaceId),k=i.find(A=>A.id===u),E=n.branch&&(N!=null&&N.repoUrl)?`${N.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return r.jsxs("div",{className:I.overviewDashboard,children:[r.jsxs("div",{className:I.overviewHero,children:[r.jsx(ZB,{status:n.status}),n.branch&&r.jsx("span",{className:I.overviewBranchPill,children:E?r.jsxs("a",{href:E,target:"_blank",rel:"noreferrer noopener",className:I.branchLink,children:["🔗"," ",n.branch]}):r.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Description"}),r.jsx("div",{className:I.overviewMarkdown,children:r.jsx(Qf,{remarkPlugins:[Jf],children:n.description})})]}),n.workpad&&r.jsx(YB,{workpad:n.workpad}),r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Environment"}),T&&w?r.jsxs("div",{className:I.envRow,"data-testid":"task-overview-environment",children:[r.jsx("span",{className:`${I.envDot} ${$0(w.status)}`,title:w.status,"aria-label":`Status: ${w.status}`,role:"img"}),r.jsx("span",{className:I.overviewValue,children:w.displayName})]}):k?r.jsxs("div",{className:I.envRow,"data-testid":"task-overview-environment",children:[r.jsx("span",{className:`${I.envDot} ${$0(k.status)}`,title:k.status,"aria-label":`Status: ${k.status}`,role:"img"}),r.jsx("span",{className:I.overviewValue,children:k.displayName}),r.jsx("span",{className:I.overviewMuted,children:"(workspace default)"})]}):r.jsx("div",{className:I.overviewMuted,children:"Set in workspace settings"})]}),r.jsxs("div",{className:I.overviewSection,"data-testid":"task-overview-dependencies",children:[r.jsx("div",{className:I.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?r.jsx("div",{className:I.overviewMuted,children:"None"}):r.jsx("div",{className:I.depList,children:n.dependsOn.map(A=>{const R=a.get(A),C=(R==null?void 0:R.status)==="complete";return r.jsxs("div",{className:`${I.depItem} ${C?I.depDone:I.depBlocked}`,children:[r.jsx("span",{children:C?"✓":"○"}),r.jsx("span",{children:(R==null?void 0:R.title)??A})]},A)})})]}),r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Timeline"}),r.jsxs("div",{className:I.timeline,children:[n.createdAt&&r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Created"}),r.jsx("span",{className:I.timelineValue,children:Qr(n.createdAt)})]}),n.assignedAt&&(()=>{const A=Sf(n.createdAt,n.assignedAt);return r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Assigned"}),r.jsx("span",{className:I.timelineValue,children:Qr(n.assignedAt)}),A!==void 0&&r.jsx("span",{className:I.timelineDelta,children:A})]})})(),n.startedAt&&(()=>{const A=Sf(n.assignedAt??n.createdAt,n.startedAt);return r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Started"}),r.jsx("span",{className:I.timelineValue,children:Qr(n.startedAt)}),A!==void 0&&r.jsx("span",{className:I.timelineDelta,children:A})]})})(),n.completedAt&&(()=>{const A=Sf(n.startedAt,n.completedAt);return r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Completed"}),r.jsx("span",{className:I.timelineValue,children:Qr(n.completedAt)}),A!==void 0&&r.jsx("span",{className:I.timelineDelta,children:A})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&r.jsx("div",{className:I.overviewMuted,children:"No timing data"})]})]}),g&&g.costUsd>0&&r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Usage"}),r.jsxs("div",{className:I.timeline,children:[r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Cost"}),r.jsx("span",{className:I.timelineValue,children:Zi(g.costUsd)}),r.jsxs("span",{className:I.timelineDelta,children:[g.sessionCount," session",g.sessionCount!==1?"s":""]})]}),x&&x.costUsd>g.costUsd&&r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Total (incl. subtasks)"}),r.jsx("span",{className:I.timelineValue,children:Zi(x.costUsd)}),r.jsxs("span",{className:I.timelineDelta,children:[x.sessionCount," session",x.sessionCount!==1?"s":""]})]})]})]}),n.reviewNotes&&r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Review Notes"}),r.jsx("div",{className:I.reviewNotes,children:n.reviewNotes})]})]})}function WB({task:n,sessionId:a,isBlocked:i,onStart:o,onResume:c,onStop:u,onPause:f,onDelete:p,onEdit:m}){if(n.status==="not_started")return i?r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{onClick:m,className:I.btnGhost,children:"Edit"}),r.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]}):r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{"data-testid":"task-header-start",onClick:o,className:I.btnPrimary,children:"Start"}),r.jsx("button",{onClick:m,className:I.btnGhost,children:"Edit"}),r.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]});if(n.status==="working")return r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{onClick:u,className:I.btnDanger,children:"Stop"}),r.jsx("button",{onClick:f,disabled:!a,className:I.btnGhost,children:"Pause"})]});if(n.status==="paused")return r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{onClick:u,className:I.btnPrimary,children:"Stop"}),r.jsx("button",{onClick:c,className:I.btnGhost,children:"Resume"}),r.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]});if(n.status==="complete")return r.jsx("div",{className:I.headerActions,children:r.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})});if(n.status==="failed")return r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{onClick:o,className:I.btnPrimary,children:"Retry"}),r.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]})}function QB({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return r.jsxs("div",{className:I.attemptSelector,"data-testid":"attempt-selector",children:[r.jsx("span",{className:I.attemptLabel,children:"Attempts:"}),n.map((o,c)=>{const u=o.id===a,f=o.status==="stopped"&&o.endReason==="completed"?"✓":o.status==="stopped"?"✗":o.status==="running"||o.status==="idle"?"●":"";return r.jsxs("button",{className:`${I.attemptButton} ${u?I.attemptActive:""}`,onClick:()=>i(o.id),title:`Attempt #${c+1} — ${o.status}`,"aria-label":`Attempt #${c+1}, ${o.status}`,"aria-pressed":u,"data-testid":`attempt-${c+1}`,children:["#",c+1,f&&r.jsx("span",{className:I.attemptStatus,children:f})]},o.id)})]})}function os(){const{taskId:n,workspaceId:a,environmentId:i}=ds(),o=Lt(),c=xt(),{events:u,eventsDropped:f,tasks:p,sessions:m,environments:v,findings:g,loadSessionEvents:b,loadFindings:x,kill:S,startTask:T,stopTask:w,resumeTask:N,deleteTask:k,createTask:E,updateTask:A,workspaces:R,taskSessions:C,loadTaskSessions:z,sendInput:H,spawn:B,personas:K,provisionEnvironment:Q}=dt(),se=y.useRef(void 0),ne=y.useRef(void 0),ce=y.useRef(void 0),q=y.useRef(void 0),ae=y.useRef(void 0),O=o.pathname.endsWith("/stream")?"stream":o.pathname.endsWith("/findings")?"findings":"overview",G=o.pathname.endsWith("/edit"),[W,le]=y.useState(O),[re,Re]=y.useState(!1),[we,Te]=y.useState(void 0),[Be,ue]=y.useState(""),[ve,he]=y.useState(G),$e=y.useRef(O),Ft=y.useRef(G),te=p.find(Ae=>Ae.id===n),J=(te==null?void 0:te.workspaceId)||void 0,Ce=R.find(Ae=>Ae.id===J);y.useEffect(()=>{O!==$e.current&&($e.current=O,O!==W&&le(O))},[O,W]),y.useEffect(()=>{G!==Ft.current&&(Ft.current=G,G!==ve&&he(G))},[G,ve]),y.useEffect(()=>{if(Be===""){if(Ce!=null&&Ce.environmentId)ue(Ce.environmentId);else if(v.length>0){const Ae=v.find(Dt=>Dt.status==="connected");ue((Ae==null?void 0:Ae.id)??v[0].id)}}},[Be,Ce==null?void 0:Ce.environmentId,v]);const cn=te?C[te.id]??[]:[];let Ve;we&&cn.some(Ae=>Ae.id===we)?Ve=we:Ve=(te==null?void 0:te.latestSessionId)||void 0;const qn=()=>{Re(!0)},Kn=()=>{if(!te)return;k(te.id),Re(!1);const Ae=i??(Ce==null?void 0:Ce.environmentId);c(te.workspaceId&&Ae?Gi(te.workspaceId,Ae):"/",{replace:!0})};y.useEffect(()=>{(te==null?void 0:te.id)!==ne.current&&(ne.current=te==null?void 0:te.id,Te(void 0),ue(""),he(G))},[te==null?void 0:te.id,G]),y.useEffect(()=>{if(!(te!=null&&te.id))return;const Ae=te.id!==q.current,Dt=te.latestSessionId!==ae.current;(Ae||Dt)&&(q.current=te.id,ae.current=te.latestSessionId,z(te.id))},[te==null?void 0:te.id,te==null?void 0:te.latestSessionId,z]),y.useEffect(()=>{if((te==null?void 0:te.status)!==ce.current){const Ae=ce.current===void 0;ce.current=te==null?void 0:te.status;const Dt=(te==null?void 0:te.status)==="not_started"?"overview":(te==null?void 0:te.status)==="working"||(te==null?void 0:te.status)==="paused"?"stream":(te==null?void 0:te.status)==="complete"?"findings":void 0;Dt&&Dt!==W&&!(Ae&&O!=="overview")&&le(Dt)}},[te==null?void 0:te.status,W,O]);const zn=y.useMemo(()=>new Map(p.map(Ae=>[Ae.id,Ae])),[p]),Fn=y.useMemo(()=>{const Ae=Ve?u.filter(Dt=>Dt.sessionId===Ve):[];return Yh(Fh(Ae))},[u,Ve]),Sn=te?te.dependsOn.some(Ae=>{const Dt=zn.get(Ae);return Dt!==void 0&&Dt.status!=="complete"}):!1,Ra=y.useMemo(()=>k6(n,i,R,v,zn),[n,i,R,v,zn]);y.useEffect(()=>{Ve&&Ve!==se.current&&(se.current=Ve,b(Ve))},[Ve,b]),y.useEffect(()=>{W==="findings"&&J&&x(J)},[W,J,x]);const un=Ae=>{le(Ae),c(na(n,Ae==="overview"?void 0:Ae,a,i))};return Ca({key:"1"},()=>un("overview")),Ca({key:"2"},()=>un("stream")),Ca({key:"3"},()=>un("findings")),r.jsxs("div",{className:I.panelContainer,children:[r.jsx(hs,{segments:Ra}),r.jsxs("div",{className:I.header,children:[r.jsxs("span",{className:I.headerTitle,children:[r.jsx("span",{"data-testid":"task-title",children:(te==null?void 0:te.title)||n}),te&&r.jsx("span",{className:I.taskStatusBadge,"data-testid":"task-status",children:te.status}),(te==null?void 0:te.branch)&&r.jsx("span",{className:I.taskBranch,children:te.branch}),Sn&&r.jsx("span",{className:I.taskBlockedBadge,children:"blocked"})]}),te&&r.jsx(WB,{task:te,sessionId:Ve,isBlocked:Sn,onStart:()=>T(te.id,void 0,Be),onResume:()=>N(te.id),onStop:()=>w(te.id),onPause:()=>Ve&&S(Ve),onDelete:qn,onEdit:()=>he(!0)})]}),r.jsxs("div",{className:I.tabBar,role:"tablist","aria-label":"Task view",children:[r.jsx("button",{role:"tab","aria-selected":W==="overview",className:`${I.tab} ${W==="overview"?I.active:""}`,onClick:()=>un("overview"),children:"Overview"}),r.jsx("button",{role:"tab","aria-selected":W==="stream",className:`${I.tab} ${W==="stream"?I.active:""}`,onClick:()=>un("stream"),children:"Stream"}),r.jsx("button",{role:"tab","aria-selected":W==="findings",className:`${I.tab} ${W==="findings"?I.active:""}`,onClick:()=>un("findings"),children:"Findings"})]}),r.jsxs(aa,{mode:"wait",children:[W==="overview"&&r.jsx(At.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:I.overviewContent,"data-testid":"task-overview",children:ve&&te?r.jsx(j_,{mode:"edit",taskId:te.id,workspaceId:J,environmentId:i,tasks:p,workspaces:R,personas:K,onCreateTask:E,onUpdateTask:A,onEditDone:()=>{G?c(na(te.id,void 0,a,i),{replace:!0}):he(!1)}}):te?r.jsx(XB,{task:te,tasksById:zn,environments:v,workspaces:R,taskSessions:cn,selectedEnvId:Be}):r.jsx("div",{className:I.waitingMessage,children:"No additional details"})},"overview"),W==="stream"&&r.jsxs(At.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:[r.jsx(QB,{taskSessions:cn,selectedSessionId:Ve,onSelect:Ae=>Te(Ae)}),r.jsx(Kh,{events:Fn,eventsDropped:f,emptyState:!Ve&&te?Sn?r.jsx("div",{className:I.emptyCta,"data-testid":"stream-blocked-message",children:r.jsx("div",{className:I.ctaDescription,children:"This task is blocked by incomplete dependencies"})}):r.jsxs("div",{className:I.emptyCta,children:[r.jsx("button",{"data-testid":"stream-start-cta",className:I.ctaButton,onClick:()=>T(te.id,void 0,Be),children:"Start Task"}),r.jsx("div",{className:I.ctaDescription,children:"Click to begin agent execution"})]}):Ve&&Fn.length===0?r.jsx("div",{className:I.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),W==="findings"&&r.jsx(At.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:I.tabContent,children:J?r.jsx(PB,{findings:g.filter(Ae=>Ae.workspaceId===J)}):r.jsx("div",{className:I.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!te||te.status!=="working"&&te.status!=="paused")return;const Ae=Ve?m.find(Dt=>Dt.id===Ve):void 0;if(!(!Ae||Ae.status==="stopped"))return r.jsx(yl,{mode:"send",sessionId:Ae.id,environmentId:Ae.environmentId,personas:K,environments:v,onSendInput:H,onSpawn:B,onStartTask:T,onProvisionEnvironment:Q})})(),te&&r.jsx(Gs,{isOpen:re,title:"Delete Task?",description:`"${te.title}" will be permanently removed.`,onConfirm:Kn,onCancel:()=>Re(!1)})]})}const JB="_container_legrg_1",eL="_header_legrg_8",tL="_headerTitle_legrg_35",nL="_badge_legrg_44",aL="_headerActions_legrg_54",sL="_body_legrg_61",iL="_formContent_legrg_73",oL="_section_legrg_85",lL="_label_legrg_91",rL="_nameInput_legrg_98",cL="_fieldInput_legrg_131",uL="_adapterSelect_legrg_164",dL="_readOnlyValue_legrg_198",fL="_codespaceSection_legrg_204",hL="_codespaceActions_legrg_210",pL="_creatingHint_legrg_216",mL="_errorHint_legrg_222",vL="_btnPrimary_legrg_235",gL="_btnGhost_legrg_266",ee={container:JB,header:eL,headerTitle:tL,badge:nL,headerActions:aL,body:sL,formContent:iL,section:oL,label:lL,nameInput:rL,fieldInput:cL,adapterSelect:uL,readOnlyValue:dL,codespaceSection:fL,codespaceActions:hL,creatingHint:pL,errorHint:mL,btnPrimary:vL,btnGhost:gL},ic=1,oc=65535;function Tf(n){if(!n.trim())return!0;const a=Number(n);return Number.isInteger(a)&&a>=ic&&a<=oc}function kf(n){try{const a=JSON.parse(n);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function yL({codespaceName:n,onCodespaceNameChange:a,envName:i,onEnvNameChange:o,codespaces:c,codespaceError:u,codespaceListError:f,codespaceCreating:p,onCreateCodespace:m}){const[v,g]=y.useState("pick"),[b,x]=y.useState(""),[S,T]=y.useState("");return v==="create"?r.jsxs("div",{className:ee.codespaceSection,children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Repository"}),r.jsx("input",{type:"text",value:b,onChange:w=>x(w.target.value),placeholder:"owner/repo",className:ee.fieldInput,"data-testid":"env-codespace-repo"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Machine Type"}),r.jsx("input",{type:"text",value:S,onChange:w=>T(w.target.value),placeholder:"Machine type (optional)...",className:ee.fieldInput,"data-testid":"env-codespace-machine"})]}),r.jsxs("div",{className:ee.codespaceActions,children:[r.jsx("button",{onClick:()=>{b.trim()&&(m(b.trim(),S.trim()||void 0),g("pick"),x(""),T(""))},disabled:!b.trim(),className:ee.btnPrimary,children:"Create"}),r.jsx("button",{onClick:()=>{g("pick"),x(""),T("")},className:ee.btnGhost,children:"Cancel"})]})]}):r.jsx("div",{className:ee.codespaceSection,children:r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Codespace"}),!f&&r.jsxs("select",{value:n,onChange:w=>{w.target.value==="__create__"?(g("create"),a("")):(a(w.target.value),w.target.value&&!i.trim()&&o(w.target.value))},disabled:p,className:ee.adapterSelect,"data-testid":"env-codespace-select",children:[r.jsx("option",{value:"",children:"Select a codespace..."}),c.map(w=>r.jsxs("option",{value:w.name,children:[w.name," (",w.repository,") — ",w.state]},w.name)),r.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&r.jsx("span",{className:ee.creatingHint,children:"Creating codespace..."}),f&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:ee.errorHint,children:f}),r.jsx("input",{type:"text",value:n,onChange:w=>a(w.target.value),placeholder:"Or enter codespace name manually...",className:ee.fieldInput,"data-testid":"env-codespace-manual"})]}),u&&!f&&r.jsx("span",{className:ee.errorHint,children:u})]})})}function N_({mode:n,environmentId:a,environments:i,onAddEnvironment:o,onUpdateEnvironment:c,onListCodespaces:u,codespaces:f,codespaceError:p,codespaceListError:m,codespaceCreating:v,onCreateCodespace:g}){const{showToast:b}=Da(),x=xt(),S=n==="edit",T=S&&a?i.find(ue=>ue.id===a):void 0,[w,N]=y.useState(""),[k,E]=y.useState("local"),[A,R]=y.useState(""),[C,z]=y.useState(""),[H,B]=y.useState(""),[K,Q]=y.useState(""),[se,ne]=y.useState(""),[ce,q]=y.useState(""),[ae,O]=y.useState(""),[G,W]=y.useState(null),le=y.useCallback(()=>{const ue={};if(k==="local"){if(A.trim()&&(ue.host=A.trim()),C.trim()){const ve=Number(C);Number.isInteger(ve)&&(ue.port=ve)}}else if(k==="ssh"){if(ue.host=A.trim(),H.trim()&&(ue.user=H.trim()),C.trim()){const ve=Number(C);Number.isInteger(ve)&&(ue.sshPort=ve)}K.trim()&&(ue.identityFile=K.trim())}else k==="docker"?(se.trim()&&(ue.image=se.trim()),ce.trim()&&(ue.repo=ce.trim())):k==="codespace"&&(ue.codespaceName=ae.trim());return ue},[k,A,C,H,K,se,ce,ae]),re=()=>!(!w.trim()||k==="ssh"&&!A.trim()||k==="codespace"&&!ae.trim()||(k==="local"||k==="ssh")&&!Tf(C)),Re=()=>{re()&&(o(w.trim(),k,le()),b("Environment added successfully","success"),x($i,{replace:!0}))},we=()=>{x(a?qi(a):$i)},Te=y.useCallback((ue,ve)=>{if(!T||!a)return;const he=kf(T.adapterConfig),$e=ve.trim();$e?he[ue]=$e:delete he[ue],c(a,{adapterConfig:he})},[T,a,c]),Be=y.useCallback((ue,ve)=>{if(!T||!a)return;const he=kf(T.adapterConfig);if(ve.trim()){const $e=Number(ve);Number.isInteger($e)&&$e>=ic&&$e<=oc&&(he[ue]=$e)}else delete he[ue];c(a,{adapterConfig:he})},[T,a,c]);if(S){if(!T)return r.jsxs("div",{className:ee.container,children:[r.jsxs("div",{className:ee.header,children:[r.jsx("div",{className:ee.headerTitle,children:r.jsx("span",{className:ee.badge,children:"edit environment"})}),r.jsx("div",{className:ee.headerActions,children:r.jsx("button",{onClick:we,className:ee.btnGhost,children:"Back"})})]}),r.jsx("div",{className:ee.body,children:r.jsx("div",{className:ee.formContent,children:r.jsx("span",{className:ee.readOnlyValue,children:"Environment not found"})})})]});const ue=kf(T.adapterConfig);return r.jsxs("div",{className:ee.container,"data-testid":"env-edit-panel",children:[r.jsxs("div",{className:ee.header,children:[r.jsx("div",{className:ee.headerTitle,children:r.jsx("span",{className:ee.badge,children:"edit environment"})}),r.jsx("div",{className:ee.headerActions,children:r.jsx("button",{onClick:we,className:ee.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),r.jsx("div",{className:ee.body,children:r.jsxs("div",{className:ee.formContent,children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Name"}),r.jsx(Kt,{value:T.displayName,onSave:ve=>{a&&c(a,{displayName:ve})},validate:ve=>ve.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:G,onActivate:W,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Adapter Type"}),r.jsx("span",{className:ee.readOnlyValue,"data-testid":"env-edit-adapter-type",children:T.adapterType})]}),T.adapterType==="local"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Host"}),r.jsx(Kt,{value:String(ue.host??""),onSave:ve=>Te("host",ve),mode:"edit",fieldId:"host",activeFieldId:G,onActivate:W,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Port"}),r.jsx(Kt,{value:String(ue.port??""),onSave:ve=>Be("port",ve),validate:ve=>Tf(ve)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:G,onActivate:W,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),T.adapterType==="ssh"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Host"}),r.jsx(Kt,{value:String(ue.host??""),onSave:ve=>Te("host",ve),validate:ve=>ve.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:G,onActivate:W,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"User"}),r.jsx(Kt,{value:String(ue.user??""),onSave:ve=>Te("user",ve),mode:"edit",fieldId:"user",activeFieldId:G,onActivate:W,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"SSH Port"}),r.jsx(Kt,{value:String(ue.sshPort??""),onSave:ve=>Be("sshPort",ve),validate:ve=>Tf(ve)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:G,onActivate:W,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Identity File"}),r.jsx(Kt,{value:String(ue.identityFile??""),onSave:ve=>Te("identityFile",ve),mode:"edit",fieldId:"identityFile",activeFieldId:G,onActivate:W,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),T.adapterType==="docker"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Image"}),r.jsx(Kt,{value:String(ue.image??""),onSave:ve=>Te("image",ve),mode:"edit",fieldId:"image",activeFieldId:G,onActivate:W,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Repo"}),r.jsx(Kt,{value:String(ue.repo??""),onSave:ve=>Te("repo",ve),mode:"edit",fieldId:"repo",activeFieldId:G,onActivate:W,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),T.adapterType==="codespace"&&r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Codespace Name"}),r.jsx(Kt,{value:String(ue.codespaceName??""),onSave:ve=>Te("codespaceName",ve),validate:ve=>ve.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:G,onActivate:W,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return r.jsxs("div",{className:ee.container,"data-testid":"env-create-panel",children:[r.jsxs("div",{className:ee.header,children:[r.jsx("div",{className:ee.headerTitle,children:r.jsx("span",{className:ee.badge,children:"new environment"})}),r.jsxs("div",{className:ee.headerActions,children:[r.jsx("button",{onClick:Re,disabled:!re(),className:ee.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),r.jsx("button",{onClick:we,className:ee.btnGhost,children:"Cancel"})]})]}),r.jsx("div",{className:ee.body,children:r.jsxs("div",{className:ee.formContent,children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-name",children:"Name"}),r.jsx("input",{id:"env-create-name",type:"text",value:w,onChange:ue=>N(ue.target.value),placeholder:"Environment name...",autoFocus:!0,className:ee.nameInput,"data-testid":"env-create-name",onKeyDown:ue=>{ue.key==="Enter"&&re()&&Re()}})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),r.jsxs("select",{id:"env-create-adapter",value:k,onChange:ue=>{E(ue.target.value),ue.target.value==="codespace"&&u()},className:ee.adapterSelect,"data-testid":"env-create-adapter",children:[r.jsx("option",{value:"local",children:"local"}),r.jsx("option",{value:"ssh",children:"ssh"}),r.jsx("option",{value:"docker",children:"docker"}),r.jsx("option",{value:"codespace",children:"codespace"})]})]}),k==="local"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-host",children:"Host"}),r.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:ue=>R(ue.target.value),placeholder:"Host (optional)...",className:ee.fieldInput,"data-testid":"env-create-host"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-port",children:"Port"}),r.jsx("input",{id:"env-create-port",type:"number",min:ic,max:oc,value:C,onChange:ue=>z(ue.target.value),placeholder:"Port (optional)...",className:ee.fieldInput,"data-testid":"env-create-port"})]})]}),k==="ssh"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-host",children:"Host"}),r.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:ue=>R(ue.target.value),placeholder:"Host (required)...",className:ee.fieldInput,"data-testid":"env-create-host"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-user",children:"User"}),r.jsx("input",{id:"env-create-user",type:"text",value:H,onChange:ue=>B(ue.target.value),placeholder:"User (optional)...",className:ee.fieldInput,"data-testid":"env-create-user"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-port",children:"SSH Port"}),r.jsx("input",{id:"env-create-port",type:"number",min:ic,max:oc,value:C,onChange:ue=>z(ue.target.value),placeholder:"SSH port (optional)...",className:ee.fieldInput,"data-testid":"env-create-port"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-identity",children:"Identity File"}),r.jsx("input",{id:"env-create-identity",type:"text",value:K,onChange:ue=>Q(ue.target.value),placeholder:"Identity file (optional)...",className:ee.fieldInput,"data-testid":"env-create-identity"})]})]}),k==="docker"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-image",children:"Image"}),r.jsx("input",{id:"env-create-image",type:"text",value:se,onChange:ue=>ne(ue.target.value),placeholder:"Image (optional)...",className:ee.fieldInput,"data-testid":"env-create-image"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-repo",children:"Repo"}),r.jsx("input",{id:"env-create-repo",type:"text",value:ce,onChange:ue=>q(ue.target.value),placeholder:"Repo (optional)...",className:ee.fieldInput,"data-testid":"env-create-repo"})]})]}),k==="codespace"&&r.jsx(yL,{codespaceName:ae,onCodespaceNameChange:O,envName:w,onEnvNameChange:N,codespaces:f,codespaceError:p,codespaceListError:m,codespaceCreating:v,onCreateCodespace:g})]})})]})}function bL(){const{environments:n,addEnvironment:a,updateEnvironment:i,listCodespaces:o,codespaces:c,codespaceError:u,codespaceListError:f,codespaceCreating:p,createCodespace:m}=dt();return r.jsx(N_,{mode:"new",environments:n,onAddEnvironment:a,onUpdateEnvironment:i,onListCodespaces:o,codespaces:c,codespaceError:u,codespaceListError:f,codespaceCreating:p,onCreateCodespace:m})}function xL(){const{environmentId:n}=ds(),{environments:a,addEnvironment:i,updateEnvironment:o,listCodespaces:c,codespaces:u,codespaceError:f,codespaceListError:p,codespaceCreating:m,createCodespace:v}=dt();return r.jsx(N_,{mode:"edit",environmentId:n,environments:a,onAddEnvironment:i,onUpdateEnvironment:o,onListCodespaces:c,codespaces:u,codespaceError:f,codespaceListError:p,codespaceCreating:m,onCreateCodespace:v})}const _L="_layout_11u79_1",SL="_content_11u79_8",TL="_tabPanel_11u79_14",ul={layout:_L,content:SL,tabPanel:TL};function kL(){const n=x6();return r.jsxs("div",{className:ul.layout,children:[r.jsx(hs,{segments:n}),r.jsx("div",{className:ul.content,children:r.jsx(Ks,{})})]})}const jL="_container_13sb6_1",NL="_envHeader_13sb6_6",wL="_envTitleRow_13sb6_10",CL="_statusDot_13sb6_16",EL="_envName_13sb6_21",AL="_statusBadge_13sb6_27",DL="_envMeta_13sb6_33",RL="_metaTag_13sb6_39",ML="_actions_13sb6_51",OL="_provisionMessage_13sb6_59",BL="_errorMessage_13sb6_64",LL="_section_13sb6_69",IL="_sectionHeader_13sb6_73",zL="_cardList_13sb6_121",UL="_card_13sb6_121",VL="_cardHeader_13sb6_138",HL="_cardName_13sb6_144",PL="_cardActions_13sb6_149",GL="_cardDescription_13sb6_154",$L="_cardMeta_13sb6_160",qL="_repoLink_13sb6_166",KL="_empty_13sb6_174",FL="_btnPrimary_13sb6_180",YL="_btnOutline_13sb6_214",ZL="_btnSmall_13sb6_241",XL="_btnDanger_13sb6_267",Pe={container:jL,envHeader:NL,envTitleRow:wL,statusDot:CL,envName:EL,statusBadge:AL,envMeta:DL,metaTag:RL,actions:ML,provisionMessage:OL,errorMessage:BL,section:LL,sectionHeader:IL,cardList:zL,card:UL,cardHeader:VL,cardName:HL,cardActions:PL,cardDescription:GL,cardMeta:$L,repoLink:qL,empty:KL,btnPrimary:FL,btnOutline:YL,btnSmall:ZL,btnDanger:XL},WL={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function QL(){const{environmentId:n}=ds(),a=xt(),{environments:i,workspaces:o,sessions:c,provisionStatus:u,provisionEnvironment:f,stopEnvironment:p,removeEnvironment:m,archiveWorkspace:v}=dt(),[g,b]=y.useState(!1),[x,S]=y.useState(!1),[T,w]=y.useState(void 0),N=i.find(ne=>ne.id===n);if(!n||!N)return r.jsx($n,{to:$i,replace:!0});const k=o.filter(ne=>ne.environmentId===N.id),E=c.filter(ne=>ne.environmentId===N.id),A=E.reduce((ne,ce)=>ne+(ce.costUsd??0),0),R=WL[N.status]||"var(--text-tertiary)",C=N.status==="connected",z=N.status==="connecting",H=N.status==="disconnected"||N.status==="error",B=N.id in u?u[N.id]:void 0,K=()=>{m(N.id),b(!1),a($i,{replace:!0})},Q=()=>{S(!1),f(N.id,!0)},se=ne=>{v(ne),w(void 0)};return r.jsxs("div",{className:Pe.container,children:[r.jsx(Gs,{isOpen:g,title:"Delete Environment?",description:`"${N.displayName||N.id}" will be permanently removed along with all its data.`,onConfirm:K,onCancel:()=>b(!1)}),r.jsx(Gs,{isOpen:x,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:Q,onCancel:()=>S(!1)}),r.jsxs("div",{className:Pe.envHeader,children:[r.jsxs("div",{className:Pe.envTitleRow,children:[r.jsx("span",{className:Pe.statusDot,style:{color:R},children:"●"}),r.jsx("h2",{className:Pe.envName,children:N.displayName||N.id}),r.jsx("span",{className:Pe.statusBadge,style:{color:R},children:N.status})]}),r.jsxs("div",{className:Pe.envMeta,children:[r.jsxs("span",{className:Pe.metaTag,children:["Adapter: ",N.adapterType]}),E.length>0&&r.jsxs("span",{className:Pe.metaTag,children:[E.length," session",E.length!==1?"s":""]}),A>0&&r.jsxs("span",{className:Pe.metaTag,children:["Cost: ",Zi(A)]})]})]}),r.jsxs("div",{className:Pe.actions,children:[C&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:Pe.btnPrimary,onClick:()=>a(_b(N.id)),children:"New Chat"}),r.jsx("button",{className:Pe.btnOutline,onClick:()=>p(N.id),children:"Stop"}),r.jsx("button",{className:Pe.btnOutline,onClick:()=>S(!0),disabled:B!==void 0,"data-testid":"env-reprovision-btn",children:"Reprovision"})]}),H&&r.jsx("button",{className:Pe.btnPrimary,onClick:()=>f(N.id),children:N.status==="error"?"Retry":"Connect"}),z&&B!==void 0&&r.jsx("span",{className:Pe.provisionMessage,children:B.message}),N.status==="error"&&(B==null?void 0:B.stage)==="error"&&r.jsx("span",{className:Pe.errorMessage,children:B.message}),r.jsx("button",{className:Pe.btnOutline,onClick:()=>a(sj(N.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),r.jsx("button",{className:Pe.btnDanger,onClick:()=>b(!0),children:"Delete"})]}),r.jsxs("div",{className:Pe.section,children:[r.jsxs("div",{className:Pe.sectionHeader,children:[r.jsx("h3",{children:"Workspaces"}),r.jsx("button",{className:Pe.btnPrimary,onClick:()=>a(`${Tb}?environment=${encodeURIComponent(N.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"})]}),k.length===0&&r.jsx("p",{className:Pe.empty,children:"No workspaces yet. Create one to get started."}),r.jsx("div",{className:Pe.cardList,children:k.map(ne=>r.jsx(JL,{workspace:ne,confirmArchiveId:T,onOpen:()=>a(Gi(ne.id,N.id)),onArchive:()=>w(ne.id),onConfirmArchive:()=>se(ne.id),onCancelArchive:()=>w(void 0)},ne.id))})]})]})}function JL({workspace:n,confirmArchiveId:a,onOpen:i,onArchive:o,onConfirmArchive:c,onCancelArchive:u}){const f=a===n.id,p=n.repoUrl&&/^https?:\/\//.test(n.repoUrl);return r.jsxs("div",{className:Pe.card,"data-testid":"workspace-card",children:[r.jsxs("div",{className:Pe.cardHeader,children:[r.jsx("strong",{className:Pe.cardName,children:n.name}),r.jsxs("div",{className:Pe.cardActions,children:[r.jsx("button",{className:Pe.btnSmall,onClick:i,children:"Open"}),f?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:Pe.btnDanger,onClick:c,children:"Confirm"}),r.jsx("button",{className:Pe.btnSmall,onClick:u,children:"Cancel"})]}):r.jsx("button",{className:Pe.btnSmall,onClick:o,children:"Archive"})]})]}),n.description&&r.jsx("p",{className:Pe.cardDescription,children:n.description}),n.repoUrl&&r.jsx("div",{className:Pe.cardMeta,children:p?r.jsx("a",{href:n.repoUrl,target:"_blank",rel:"noopener noreferrer",className:Pe.repoLink,children:n.repoUrl}):r.jsx("span",{children:n.repoUrl})})]})}const eI={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About",shortcuts:"Shortcuts"};function tI(){const a=Lt().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=eI[a],o=b6(i);return r.jsxs("div",{className:ul.layout,children:[r.jsx(hs,{segments:o}),r.jsx("div",{className:ul.content,children:r.jsx("div",{className:ul.tabPanel,children:r.jsx(Ks,{})},a)})]})}const nI="_section_1ingb_14",aI="_sectionTitle_1ingb_26",sI="_sectionDescription_1ingb_35",iI="_tokenList_1ingb_48",oI="_tokenRow_1ingb_55",lI="_tokenBadge_1ingb_68",rI="_tokenName_1ingb_83",cI="_tokenTarget_1ingb_90",uI="_deleteButton_1ingb_99",dI="_addForm_1ingb_113",fI="_formRow_1ingb_119",hI="_input_1ingb_125",pI="_select_1ingb_155",mI="_addButton_1ingb_187",vI="_emptyStateInfo_1ingb_221",gI="_themeOptions_1ingb_229",yI="_themeOption_1ingb_229",bI="_themeOptionSelected_1ingb_254",xI="_themeOptionHeader_1ingb_259",_I="_themeOptionLabel_1ingb_266",SI="_themeOptionDesc_1ingb_273",TI="_variantToggle_1ingb_279",kI="_variantButton_1ingb_286",jI="_variantActive_1ingb_305",NI="_themeSwatches_1ingb_311",wI="_themeSwatch_1ingb_311",CI="_systemToggle_1ingb_325",EI="_systemToggleHint_1ingb_341",AI="_themeActive_1ingb_348",DI="_aboutGrid_1ingb_354",RI="_aboutItem_1ingb_360",MI="_aboutLabel_1ingb_373",OI="_aboutValue_1ingb_379",BI="_aboutDot_1ingb_387",LI="_aboutDotConnected_1ingb_394",II="_aboutDotDisconnected_1ingb_398",fe={section:nI,sectionTitle:aI,sectionDescription:sI,tokenList:iI,tokenRow:oI,tokenBadge:lI,tokenName:rI,tokenTarget:cI,deleteButton:uI,addForm:dI,formRow:fI,input:hI,select:pI,addButton:mI,emptyStateInfo:vI,themeOptions:gI,themeOption:yI,themeOptionSelected:bI,themeOptionHeader:xI,themeOptionLabel:_I,themeOptionDesc:SI,variantToggle:TI,variantButton:kI,variantActive:jI,themeSwatches:NI,themeSwatch:wI,systemToggle:CI,systemToggleHint:EI,themeActive:AI,aboutGrid:DI,aboutItem:RI,aboutLabel:MI,aboutValue:OI,aboutDot:BI,aboutDotConnected:LI,aboutDotDisconnected:II},zI=[{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 UI({credentialProviders:n,onUpdateCredentialProviders:a}){const i=(o,c)=>{const u={...n};o==="claude"?u.claude=c:u[o]=c,a(u)};return r.jsxs("section",{className:fe.section,children:[r.jsx("h3",{className:fe.sectionTitle,children:"Credential Providers"}),r.jsx("p",{className:fe.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),r.jsx("div",{className:fe.tokenList,children:zI.map(o=>r.jsxs("div",{className:fe.tokenRow,children:[r.jsx("span",{className:fe.tokenName,children:o.label}),r.jsx("span",{className:fe.tokenTarget,children:o.description}),r.jsx("select",{className:fe.select,value:n[o.key],onChange:c=>i(o.key,c.target.value),children:o.options.map(c=>r.jsx("option",{value:c.value,children:c.label},c.value))})]},o.key))})]})}const VI=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function HI({tokens:n,onSetToken:a,onDeleteToken:i}){const{showToast:o}=Da(),[c,u]=y.useState(""),[f,p]=y.useState(""),[m,v]=y.useState("env_var"),[g,b]=y.useState(""),[x,S]=y.useState(null),T=k=>{if(k.preventDefault(),!c||!f)return;const E=m==="env_var"?g||c.toUpperCase()+"_TOKEN":"";a(c,f,m,E,m==="file"?g:""),o("Token saved successfully","success"),u(""),p(""),b("")},w=k=>{S(k)},N=()=>{x&&(i(x),o("Token deleted","info")),S(null)};return r.jsxs(r.Fragment,{children:[r.jsx(Gs,{isOpen:x!==null,title:"Delete Token?",description:x?`"${x}" will be permanently removed.`:void 0,onConfirm:N,onCancel:()=>S(null)}),r.jsxs("section",{className:fe.section,children:[r.jsx("h3",{className:fe.sectionTitle,children:"Tokens"}),r.jsx("p",{className:fe.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?r.jsx("div",{className:fe.emptyStateInfo,children:"Add your first API token to enable service integrations."}):r.jsx("div",{className:fe.tokenList,children:n.map(k=>r.jsxs("div",{className:fe.tokenRow,children:[r.jsx("span",{className:fe.tokenBadge,children:k.tokenType}),r.jsx("span",{className:fe.tokenName,children:k.name}),r.jsx("span",{className:fe.tokenTarget,children:k.tokenType==="env_var"?k.envVar:k.filePath}),r.jsx("button",{className:fe.deleteButton,onClick:()=>w(k.name),title:`Delete ${k.name}`,children:"×"})]},k.name))}),r.jsxs("form",{className:fe.addForm,onSubmit:T,children:[r.jsxs("div",{className:fe.formRow,children:[r.jsx("input",{className:fe.input,type:"text",placeholder:"Token name",value:c,onChange:k=>u(k.target.value)}),r.jsx("input",{className:fe.input,type:"password",placeholder:"Value",value:f,onChange:k=>p(k.target.value)})]}),r.jsxs("div",{className:fe.formRow,children:[r.jsx("select",{className:fe.select,value:m,onChange:k=>v(k.target.value),children:VI.map(k=>r.jsx("option",{value:k.value,children:k.label},k.value))}),r.jsx("input",{className:fe.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:g,onChange:k=>b(k.target.value)}),r.jsx("button",{className:fe.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function PI(){const{tokens:n,setToken:a,deleteToken:i,credentialProviders:o,updateCredentialProviders:c}=dt();return r.jsxs(r.Fragment,{children:[r.jsx(UI,{credentialProviders:o,onUpdateCredentialProviders:c}),r.jsx(HI,{tokens:n,onSetToken:a,onDeleteToken:i})]})}const GI="_container_10efq_1",$I="_header_10efq_7",qI="_form_10efq_19",KI="_formActions_10efq_87",FI="_editableSection_10efq_94",YI="_list_10efq_105",ZI="_card_10efq_111",XI="_cardHeader_10efq_125",WI="_cardTitle_10efq_135",QI="_defaultBadge_10efq_141",JI="_cardActions_10efq_155",e8="_description_10efq_160",t8="_meta_10efq_166",n8="_empty_10efq_212",a8="_typeToggle_10efq_348",s8="_typeBadge_10efq_362",i8="_scriptEditor_10efq_376",o8="_optional_10efq_383",mt={container:GI,header:$I,form:qI,formActions:KI,editableSection:FI,list:YI,card:ZI,cardHeader:XI,cardTitle:WI,defaultBadge:QI,cardActions:JI,description:e8,meta:t8,empty:n8,typeToggle:a8,typeBadge:s8,scriptEditor:i8,optional:o8};function l8({personas:n,appDefaultPersonaId:a,onDeletePersona:i,onSetAppDefaultPersonaId:o,onNavigateToNew:c,onNavigateToPersona:u}){const[f,p]=y.useState(null),m=f?n.find(g=>g.id===f):void 0,v=async g=>{await i(g),p(null)};return r.jsxs("div",{className:mt.container,children:[r.jsxs("div",{className:mt.header,children:[r.jsx("h2",{children:"Personas"}),r.jsx(ja,{variant:"primary",size:"md",onClick:c,"data-testid":"persona-new-button",children:"+ New Persona"})]}),n.length===0?r.jsx("p",{className:mt.empty,children:"No personas yet. Create one to get started."}):r.jsx("div",{className:mt.list,children:n.map(g=>{const b=a===g.id,x=g.type==="script";return r.jsxs("div",{className:mt.card,"data-testid":`persona-card-${g.id}`,onClick:()=>u(g.id),role:"button",tabIndex:0,onKeyDown:S=>{S.currentTarget===S.target&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),u(g.id))},children:[r.jsxs("div",{className:mt.cardHeader,children:[r.jsxs("span",{className:mt.cardTitle,children:[r.jsx("strong",{children:g.name}),r.jsx("span",{className:mt.typeBadge,"data-testid":`persona-type-badge-${g.id}`,children:x?"Script":"Agent"}),b&&r.jsx("span",{className:mt.defaultBadge,"data-testid":`persona-default-badge-${g.id}`,children:"App Default"})]}),r.jsxs("div",{className:mt.cardActions,onClick:S=>S.stopPropagation(),children:[!b&&r.jsx(ja,{variant:"ghost",size:"sm",onClick:()=>{o(g.id).catch(()=>{})},"data-testid":`persona-set-default-${g.id}`,title:"Set as app default persona",children:"Set Default"}),r.jsx(ja,{variant:"ghost",size:"sm",onClick:()=>u(g.id),children:"Edit"}),r.jsx(ja,{variant:"ghost",size:"sm",onClick:()=>p(g.id),"data-testid":`persona-delete-${g.id}`,children:"Delete"})]})]}),g.description&&r.jsx("p",{className:mt.description,children:g.description}),r.jsxs("div",{className:mt.meta,children:[g.runtime&&r.jsxs("span",{children:["Runtime: ",g.runtime]}),g.model&&r.jsxs("span",{children:["Model: ",g.model]}),g.maxTurns>0&&r.jsxs("span",{children:["Max turns: ",g.maxTurns]})]})]},g.id)})}),r.jsx(Gs,{isOpen:f!==null,title:"Delete Persona?",description:`"${(m==null?void 0:m.name)??""}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:()=>{f&&v(f).catch(()=>{})},onCancel:()=>p(null)})]})}function r8(){const{personas:n,deletePersona:a,appDefaultPersonaId:i,setAppDefaultPersonaId:o}=dt(),{showToast:c}=Da(),u=xt();return r.jsx(l8,{personas:n,appDefaultPersonaId:i,onDeletePersona:async f=>{try{await a(f)}catch(p){throw console.error("Failed to delete persona",{personaId:f,error:p}),c("Failed to delete persona","error"),p}},onSetAppDefaultPersonaId:async f=>{try{await o(f)}catch(p){console.error("Failed to set app default persona ID",{personaId:f,error:p}),c("Failed to set app default persona","error")}},onNavigateToNew:()=>u(oj),onNavigateToPersona:f=>u(Sb(f))})}const c8="_container_uy08i_1",u8="_header_uy08i_7",d8="_count_uy08i_13",f8="_presets_uy08i_18",h8="_presetButton_uy08i_24",p8="_filterInput_uy08i_41",m8="_groups_uy08i_53",v8="_group_uy08i_53",g8="_groupHeader_uy08i_68",y8="_groupName_uy08i_77",b8="_groupCount_uy08i_81",x8="_toolList_uy08i_87",_8="_toolItem_uy08i_95",S8="_toolName_uy08i_103",Jt={container:c8,header:u8,count:d8,presets:f8,presetButton:h8,filterInput:p8,groups:m8,group:v8,groupHeader:g8,groupName:y8,groupCount:b8,toolList:x8,toolItem:_8,toolName:S8},T8=(()=>{const n=new Map;for(const a of W0){const i=a==="get_version_status"?"version":a.split("_")[0];n.has(i)||n.set(i,[]),n.get(i).push(a)}return[...n.entries()].sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({group:a,tools:i.sort()}))})(),k8=[{name:"default",label:"Default",tools:Q0},{name:"worker",label:"Worker",tools:lT},{name:"orchestrator",label:"Orchestrator",tools:rT},{name:"admin",label:"Admin",tools:cT}];function q0({selectedTools:n,onChange:a,disabled:i}){const[o,c]=y.useState(""),u=y.useMemo(()=>new Set(n),[n]),f=y.useCallback(g=>{if(i)return;const b=new Set(u);b.has(g)?b.delete(g):b.add(g),a([...b].sort())},[u,a,i]),p=y.useCallback((g,b)=>{if(i)return;const x=new Set(u);for(const S of g)b?x.delete(S):x.add(S);a([...x].sort())},[u,a,i]),m=y.useCallback(g=>{i||a([...g].sort())},[a,i]),v=o.toLowerCase();return r.jsxs("div",{className:Jt.container,"data-testid":"mcp-tool-selector",children:[r.jsx("div",{className:Jt.header,children:r.jsx("span",{className:Jt.count,children:n.length===0?`Using default (${Q0.length} tools)`:`${n.length} of ${W0.size} tools selected`})}),r.jsxs("div",{className:Jt.presets,"data-testid":"mcp-tool-presets",children:[k8.map(g=>r.jsx("button",{type:"button",className:Jt.presetButton,disabled:i,onClick:()=>m(g.tools),"data-testid":`preset-${g.name}`,children:g.label},g.name)),r.jsx("button",{type:"button",className:Jt.presetButton,disabled:i,onClick:()=>a([]),"data-testid":"preset-clear",children:"Clear"})]}),r.jsx("input",{type:"text",className:Jt.filterInput,placeholder:"Filter tools...",value:o,onChange:g=>c(g.target.value),disabled:i,"data-testid":"mcp-tool-filter"}),r.jsx("div",{className:Jt.groups,children:T8.map(({group:g,tools:b})=>{const x=v?b.filter(T=>T.toLowerCase().includes(v)):b;if(x.length===0)return null;const S=x.every(T=>u.has(T));return r.jsxs("div",{className:Jt.group,"data-testid":`tool-group-${g}`,children:[r.jsxs("label",{className:Jt.groupHeader,children:[r.jsx("input",{type:"checkbox",checked:S,onChange:()=>p(x,S),disabled:i,"data-testid":`group-toggle-${g}`}),r.jsx("span",{className:Jt.groupName,children:g}),r.jsxs("span",{className:Jt.groupCount,children:["(",x.filter(T=>u.has(T)).length,"/",x.length,")"]})]}),r.jsx("div",{className:Jt.toolList,children:x.map(T=>r.jsxs("label",{className:Jt.toolItem,children:[r.jsx("input",{type:"checkbox",checked:u.has(T),onChange:()=>f(T),disabled:i,"data-testid":`tool-${T}`}),r.jsx("span",{className:Jt.toolName,children:T})]},T))})]},g)})})]})}const K0=[{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)"}],F0=[{value:"genaiscript",label:"genaiscript"}],j8="0";function Y0(){const{personaId:n}=ds(),a=xt(),{showToast:i}=Da(),{personas:o,createPersona:c,updatePersona:u,deletePersona:f,appDefaultPersonaId:p,setAppDefaultPersonaId:m}=dt(),v=n===void 0,g=v?void 0:o.find(x=>x.id===n);if(!v&&o.length>0&&!g)return r.jsx($n,{to:Yd,replace:!0});const b=[{label:"Settings",url:Pi},{label:"Personas",url:Yd},{label:v?"New Persona":(g==null?void 0:g.name)??"Persona",url:void 0}];return r.jsxs("div",{className:mt.container,children:[r.jsx(hs,{segments:b}),r.jsx(N8,{existing:g,isNew:v,appDefaultPersonaId:p,onCreatePersona:c,onUpdatePersona:u,onDeletePersona:f,onSetAppDefaultPersonaId:m,onDone:()=>{a(Yd)},showToast:i})]})}function N8({existing:n,isNew:a,appDefaultPersonaId:i,onCreatePersona:o,onUpdatePersona:c,onDeletePersona:u,onSetAppDefaultPersonaId:f,onDone:p,showToast:m}){const v=xt(),[g,b]=y.useState((n==null?void 0:n.name)??""),[x,S]=y.useState((n==null?void 0:n.description)??""),[T,w]=y.useState((n==null?void 0:n.systemPrompt)??""),[N,k]=y.useState((n==null?void 0:n.runtime)??"claude-code"),[E,A]=y.useState((n==null?void 0:n.model)??"sonnet"),[R,C]=y.useState((n==null?void 0:n.maxTurns)??0),[z,H]=y.useState((n==null?void 0:n.type)==="script"?"script":"agent"),[B,K]=y.useState((n==null?void 0:n.script)??""),[Q,se]=y.useState((n==null?void 0:n.allowedMcpTools)??[]),[ne,ce]=y.useState(!1),[q,ae]=y.useState(null),[O,G]=y.useState(!!a);y.useEffect(()=>{if(!a&&n&&!O){G(!0),b(n.name),S(n.description),w(n.systemPrompt);const J=n.type==="script"?"script":"agent";k(J==="script"?n.runtime||"genaiscript":n.runtime),A(n.model),C(n.maxTurns),H(J),K(n.script||""),se(n.allowedMcpTools)}},[a,n,O]);const W=J=>{H(J),J==="script"?k("genaiscript"):N==="genaiscript"&&k("claude-code")},le=!a&&n===void 0,re=g.trim().length>0&&!le&&T.trim().length>0&&(z==="script"?B.trim().length>0:!!N&&!!E),Re=a&&re,we=!a&&i===(n==null?void 0:n.id),Te=!a&&n&&!we&&z==="agent"&&!!N&&!!E,Be=(J,Ce)=>{if(!J.trim())return`${Ce} is required`},ue=J=>{if(J.preventDefault(),!(le||!re)){if(n){c(n.id,g,x,T,N,E,R,z,B).then(()=>{m("Persona updated","success"),p()},()=>{m("Failed to save persona","error")});return}o(g,x,T,N,E,R,z,B,Q).then(Ce=>{m("Persona created","success"),v(Sb(Ce.id),{replace:!0})},()=>{m("Failed to save persona","error")})}},ve=()=>{n&&u(n.id).then(()=>{m("Persona deleted","success"),p()},()=>{m("Failed to delete persona","error")})},he=async(J,Ce,cn,Ve)=>J().then(()=>{Ce(),m(cn,"success")},()=>{m(Ve,"error")}),$e=(J,Ce)=>{if(!n)return;const cn=J==="type"?String(Ce):z,Ve=J==="runtime"?String(Ce):J==="type"?String(Ce)==="script"?"genaiscript":N==="genaiscript"?"claude-code":N:N,qn=J==="model"?String(Ce):E,Kn=J==="maxTurns"?Number(Ce):R,zn=J==="systemPrompt"?String(Ce):T,Fn=J==="script"?String(Ce):B;he(()=>c(n.id,J==="name"?String(Ce):g,J==="description"?String(Ce):x,zn,Ve,qn,Kn,cn,Fn),()=>{if(J==="type"){const Sn=String(Ce)==="script"?"script":"agent";H(Sn),k(Ve)}J==="runtime"&&k(String(Ce)),J==="name"&&b(String(Ce)),J==="description"&&S(String(Ce)),J==="systemPrompt"&&w(String(Ce)),J==="model"&&A(String(Ce)),J==="maxTurns"&&C(Number(Ce)),J==="script"&&K(String(Ce))},"Persona updated","Failed to update persona").catch(()=>{})},Ft=J=>{ue(J)},te=()=>{n&&f(n.id).then(()=>{m("Set as app default","success")},()=>{m("Failed to set app default","error")})};return r.jsxs(r.Fragment,{children:[le?r.jsxs("div",{className:mt.form,children:[r.jsx("h3",{children:"Edit Persona"}),r.jsx("p",{children:"Loading persona..."})]}):a?r.jsxs("form",{onSubmit:Ft,className:mt.form,children:[r.jsx("h3",{children:"Create Persona"}),r.jsxs("div",{className:mt.typeToggle,"data-testid":"persona-type-toggle",children:[r.jsxs("label",{children:[r.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:z==="agent",onChange:()=>W("agent")}),"Agent"]}),r.jsxs("label",{children:[r.jsx("input",{type:"radio",name:"personaType",value:"script",checked:z==="script",onChange:()=>W("script")}),"Script"]})]}),r.jsxs("label",{children:["Name",r.jsx("input",{type:"text",value:g,onChange:J=>b(J.target.value),placeholder:z==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0,"data-testid":"persona-detail-name"})]}),r.jsxs("label",{children:["Description",r.jsx("input",{type:"text",value:x,onChange:J=>S(J.target.value),placeholder:"Brief description...","data-testid":"persona-detail-description"})]}),r.jsxs("label",{children:["Runtime",r.jsx("select",{value:N,onChange:J=>k(J.target.value),"data-testid":"persona-runtime-select",children:(z==="script"?F0:K0).map(J=>r.jsx("option",{value:J.value,children:J.label},J.value))})]}),z==="agent"&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{children:["Model",r.jsx("input",{type:"text",value:E,onChange:J=>A(J.target.value),placeholder:"e.g. sonnet","data-testid":"persona-detail-model"})]}),r.jsxs("label",{children:["Max Turns",r.jsx("input",{type:"number",value:R,onChange:J=>C(parseInt(J.target.value,10)||0),min:0,"data-testid":"persona-detail-max-turns"})]}),r.jsxs("label",{children:["System Prompt",r.jsx("textarea",{value:T,onChange:J=>w(J.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0,"data-testid":"persona-detail-prompt"})]})]}),z==="script"&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{children:["Model ",r.jsx("span",{className:mt.optional,children:"(optional)"}),r.jsx("input",{type:"text",value:E,onChange:J=>A(J.target.value),placeholder:"e.g. sonnet (leave empty for script-only)","data-testid":"persona-detail-model"})]}),r.jsxs("label",{children:["System Prompt",r.jsx("textarea",{value:T,onChange:J=>w(J.target.value),placeholder:"Context for the script...",rows:4,required:!0,"data-testid":"persona-detail-prompt"})]}),r.jsxs("label",{children:["Script",r.jsx("textarea",{value:B,onChange:J=>K(J.target.value),placeholder:`script({ model: "openai:gpt-4o" });
|
|
145
|
-
|
|
146
|
-
const grackle = await host.mcpServer({
|
|
147
|
-
id: "grackle",
|
|
148
|
-
url: env.vars.GRACKLE_MCP_URL,
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
$\`Summarize the current tasks.\`;`,rows:20,className:mt.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),z==="agent"&&r.jsxs("div",{children:[r.jsx("label",{children:"Allowed MCP Tools"}),r.jsx(q0,{selectedTools:Q,onChange:se})]}),r.jsxs("div",{className:mt.formActions,children:[r.jsx(ja,{type:"submit",variant:"primary",size:"md",disabled:!Re,"data-testid":"persona-detail-save",children:"Create"}),r.jsx(ja,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Cancel"})]})]}):n?r.jsxs("div",{className:mt.form,children:[r.jsx("h3",{children:"Edit Persona"}),r.jsxs("div",{className:mt.formActions,children:[r.jsx(ja,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Back to Personas"}),Te&&r.jsx(ja,{type:"button",variant:"ghost",size:"md",onClick:te,"data-testid":"persona-detail-set-default",children:"Set as App Default"}),we&&r.jsx("span",{className:mt.defaultBadge,children:"App Default"}),r.jsx(ja,{type:"button",variant:"danger",size:"md",onClick:()=>ce(!0),"data-testid":"persona-detail-delete",children:"Delete"})]}),r.jsxs("div",{className:mt.editableSection,children:[r.jsxs("label",{children:["Name",r.jsx(Kt,{value:g,onSave:J=>{$e("name",J)},validate:J=>Be(J,"Name"),fieldId:"persona-name",activeFieldId:q,onActivate:ae,ariaLabel:"Persona name","data-testid":"persona-detail-name"})]}),r.jsxs("label",{children:["Description",r.jsx(Kt,{value:x,onSave:J=>{$e("description",J)},fieldId:"persona-description",activeFieldId:q,onActivate:ae,placeholder:"Brief description...",ariaLabel:"Persona description","data-testid":"persona-detail-description"})]}),r.jsxs("label",{children:["Type",r.jsx(gc,{value:z,onSave:J=>{$e("type",J)},options:[{value:"agent",label:"Agent"},{value:"script",label:"Script"}],fieldId:"persona-type",activeFieldId:q,onActivate:ae,ariaLabel:"Persona type","data-testid":"persona-type-toggle"})]}),r.jsxs("label",{children:["Runtime",r.jsx(gc,{value:N,onSave:J=>{$e("runtime",J)},options:z==="script"?F0:K0,fieldId:"persona-runtime",activeFieldId:q,onActivate:ae,ariaLabel:"Persona runtime","data-testid":"persona-runtime"})]}),r.jsxs("label",{children:["Model",z==="script"?" (optional)":"",r.jsx(Kt,{value:E,onSave:J=>{$e("model",J)},validate:z==="agent"?J=>Be(J,"Model"):void 0,fieldId:"persona-model",activeFieldId:q,onActivate:ae,placeholder:z==="script"?"e.g. sonnet (leave empty for script-only)":"e.g. sonnet",ariaLabel:"Persona model","data-testid":"persona-detail-model"})]}),r.jsxs("label",{children:["Max Turns",r.jsx(Kt,{value:String(R),onSave:J=>{$e("maxTurns",parseInt(J,10)||0)},validate:J=>/^\d+$/.test(J.trim())?void 0:"Max Turns must be a non-negative integer",fieldId:"persona-max-turns",activeFieldId:q,onActivate:ae,placeholder:j8,ariaLabel:"Persona max turns","data-testid":"persona-detail-max-turns"})]}),r.jsxs("label",{children:["System Prompt",r.jsx(Wf,{value:T,onSave:J=>{$e("systemPrompt",J)},validate:J=>Be(J,"System Prompt"),fieldId:"persona-system-prompt",activeFieldId:q,onActivate:ae,placeholder:z==="script"?"Context for the script...":"You are a senior frontend engineer...",ariaLabel:"Persona system prompt","data-testid":"persona-detail-prompt"})]}),z==="script"&&r.jsxs("label",{children:["Script",r.jsx(Wf,{value:B,onSave:J=>{$e("script",J)},validate:J=>Be(J,"Script"),fieldId:"persona-script",activeFieldId:q,onActivate:ae,placeholder:`script({ model: "openai:gpt-4o" });
|
|
152
|
-
|
|
153
|
-
const grackle = await host.mcpServer({
|
|
154
|
-
id: "grackle",
|
|
155
|
-
url: env.vars.GRACKLE_MCP_URL,
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
$\`Summarize the current tasks.\`;`,ariaLabel:"Persona script","data-testid":"persona-script-editor"})]}),z==="agent"&&r.jsxs("div",{children:[r.jsx("label",{children:"Allowed MCP Tools"}),r.jsx(q0,{selectedTools:Q,onChange:J=>{se(J);const Ce=J.length===0?["__clear__"]:J;he(()=>c(n.id,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Ce),()=>{},"MCP tools updated","Failed to update MCP tools").catch(()=>{})}})]})]}),!Te&&!we&&r.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,r.jsx(Gs,{isOpen:ne,title:"Delete Persona?",description:`"${n==null?void 0:n.name}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:ve,onCancel:()=>ce(!1)})]})}function w8(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:o,setPreferSystem:c}=Db();return r.jsxs("section",{className:fe.section,children:[r.jsx("h3",{className:fe.sectionTitle,children:"Appearance"}),r.jsx("p",{className:fe.sectionDescription,children:"Choose how Grackle looks across the app."}),r.jsx("div",{className:fe.themeOptions,children:Sc.filter(u=>!u.hidden).map(u=>{const f=!!(u.variantLightId&&u.variantDarkId),p=f?n===u.id||n===u.variantLightId||n===u.variantDarkId:n===u.id,m=f&&a===u.variantLightId;return r.jsxs("button",{type:"button",className:`${fe.themeOption} ${p?fe.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(u.id),children:[r.jsxs("span",{className:fe.themeOptionHeader,children:[r.jsxs("span",{children:[r.jsx("span",{className:fe.themeOptionLabel,children:u.label}),r.jsx("span",{className:fe.themeOptionDesc,children:u.description})]}),f&&r.jsxs("span",{className:fe.variantToggle,children:[r.jsx("span",{role:"button",tabIndex:0,className:`${fe.variantButton} ${p&&m?fe.variantActive:""}`,onClick:v=>{v.stopPropagation(),c(!1),i(u.variantLightId)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),c(!1),i(u.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),r.jsx("span",{role:"button",tabIndex:0,className:`${fe.variantButton} ${p&&!m?fe.variantActive:""}`,onClick:v=>{v.stopPropagation(),c(!1),i(u.variantDarkId)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),c(!1),i(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),u.swatches&&r.jsx("span",{className:fe.themeSwatches,children:u.swatches.map((v,g)=>r.jsx("span",{className:fe.themeSwatch,style:{background:v}},g))})]},u.id)})}),r.jsxs("label",{className:fe.systemToggle,children:[r.jsx("input",{type:"checkbox",checked:o,onChange:u=>c(u.target.checked)}),r.jsx("span",{children:"Match system light/dark preference"})]}),r.jsx("p",{className:fe.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),r.jsxs("p",{className:fe.themeActive,children:["Active theme: ",r.jsx("strong",{children:a})]})]})}function C8(){return r.jsx(w8,{})}function E8({connected:n,environments:a,sessions:i}){const o=a.filter(f=>f.status==="connected").length,c=a.length,u=i.filter(f=>["running","idle"].includes(f.status)).length;return r.jsxs("section",{className:fe.section,"data-testid":"about-panel",children:[r.jsx("h3",{className:fe.sectionTitle,children:"About"}),r.jsx("p",{className:fe.sectionDescription,children:"Connection status and application information."}),r.jsxs("div",{className:fe.aboutGrid,children:[r.jsxs("div",{className:fe.aboutItem,children:[r.jsx("span",{className:fe.aboutLabel,children:"Connection"}),r.jsxs("span",{className:fe.aboutValue,children:[r.jsx("span",{className:`${fe.aboutDot} ${n?fe.aboutDotConnected:fe.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),r.jsxs("div",{className:fe.aboutItem,children:[r.jsx("span",{className:fe.aboutLabel,children:"Environments"}),r.jsxs("span",{className:fe.aboutValue,children:[o,"/",c," connected"]})]}),r.jsxs("div",{className:fe.aboutItem,children:[r.jsx("span",{className:fe.aboutLabel,children:"Active Sessions"}),r.jsx("span",{className:fe.aboutValue,children:u})]}),r.jsxs("div",{className:fe.aboutItem,children:[r.jsx("span",{className:fe.aboutLabel,children:"Version"}),r.jsx("span",{className:fe.aboutValue,children:"0.82.0"})]})]})]})}function A8({currentVersion:n,latestVersion:a,updateAvailable:i,isDocker:o}){if(!i)return r.jsx(r.Fragment,{});const c=o?"docker pull ghcr.io/nick-pape/grackle:latest && docker restart grackle":`npm install -g @grackle-ai/cli@${a}`;return r.jsx("div",{"data-testid":"update-banner",children:r.jsxs(VD,{variant:"info",dismissible:!0,children:[r.jsxs("strong",{children:["Grackle v",a]})," is available (you have v",n,")."," ","Run: ",r.jsx("code",{children:c})]})})}function D8(){const[n,a]=y.useState(void 0);return y.useEffect(()=>{let i=!1;return ke.getVersionStatus({}).then(o=>{i||a({currentVersion:o.currentVersion,latestVersion:o.latestVersion,updateAvailable:o.updateAvailable,isDocker:o.isDocker})},()=>{}),()=>{i=!0}},[]),n}function R8(){const{connected:n,environments:a,sessions:i}=dt(),o=D8();return r.jsxs(r.Fragment,{children:[o&&r.jsx(A8,{currentVersion:o.currentVersion,latestVersion:o.latestVersion,updateAvailable:o.updateAvailable,isDocker:o.isDocker}),r.jsx(E8,{connected:n,environments:a,sessions:i})]})}const M8="_group_1iprv_1",O8="_groupTitle_1iprv_8",B8="_shortcutList_1iprv_17",L8="_shortcutRow_1iprv_23",I8="_keys_1iprv_36",z8="_kbd_1iprv_43",U8="_description_1iprv_60",Bs={group:M8,groupTitle:O8,shortcutList:B8,shortcutRow:L8,keys:I8,kbd:z8,description:U8},V8=[{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 H8(){return r.jsxs("section",{className:fe.section,"data-testid":"keyboard-shortcuts-panel",children:[r.jsx("h3",{className:fe.sectionTitle,children:"Keyboard Shortcuts"}),r.jsx("p",{className:fe.sectionDescription,children:"Keyboard shortcuts for navigating and interacting with Grackle. Global shortcuts are suppressed while typing in text fields."}),V8.map(n=>r.jsxs("div",{className:Bs.group,children:[r.jsx("h4",{className:Bs.groupTitle,children:n.title}),r.jsx("div",{className:Bs.shortcutList,children:n.shortcuts.map(a=>r.jsxs("div",{className:Bs.shortcutRow,children:[r.jsx("span",{className:Bs.keys,children:a.keys.map(i=>r.jsx("kbd",{className:Bs.kbd,children:i},i))}),r.jsx("span",{className:Bs.description,children:a.description})]},a.description))})]},n.title))]})}function P8(){return r.jsx(H8,{})}const Z0=Fs();function G8(){const n=xt();return Ca({key:"?"},()=>{n(lj)}),Ca({key:"n"},()=>{n(Z0)}),Ca({key:"N"},()=>{n(Z0)}),r.jsx(r.Fragment,{})}const $8="_wizard_1260s_1",q8="_container_1260s_10",K8="_stepContent_1260s_19",F8="_logoArea_1260s_28",Y8="_logoImage_1260s_32",Z8="_heading_1260s_41",X8="_tagline_1260s_49",W8="_subtitle_1260s_56",Q8="_featureList_1260s_64",J8="_runtimeGrid_1260s_89",ez="_runtimeCard_1260s_101",tz="_runtimeName_1260s_133",nz="_runtimeDescription_1260s_139",az="_buttonRow_1260s_144",sz="_primaryButton_1260s_151",iz="_ghostButton_1260s_185",oz="_dots_1260s_213",lz="_dot_1260s_213",it={wizard:$8,container:q8,stepContent:K8,logoArea:F8,logoImage:Y8,heading:Z8,tagline:X8,subtitle:W8,featureList:Q8,runtimeGrid:J8,runtimeCard:ez,runtimeName:tz,runtimeDescription:nz,buttonRow:az,primaryButton:sz,ghostButton:iz,dots:oz,dot:lz};function rz({onNext:n}){return r.jsxs("div",{className:it.stepContent,"data-testid":"setup-welcome",children:[r.jsx("div",{className:it.logoArea,children:r.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:it.logoImage})}),r.jsx("h1",{className:it.heading,children:"Welcome to Grackle"}),r.jsx("p",{className:it.tagline,children:"Multi-agent orchestration for software teams"}),r.jsx("button",{type:"button",className:it.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function cz({onNext:n,onBack:a}){return r.jsxs("div",{className:it.stepContent,"data-testid":"setup-about",children:[r.jsx("h2",{className:it.heading,children:"What is Grackle?"}),r.jsxs("ul",{className:it.featureList,children:[r.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),r.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),r.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),r.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),r.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),r.jsxs("div",{className:it.buttonRow,children:[r.jsx("button",{type:"button",className:it.ghostButton,onClick:a,children:"Back"}),r.jsx("button",{type:"button",className:it.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const uz=[{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 dz({currentRuntime:n,onFinish:a,onBack:i,finishDisabled:o}){const[c,u]=y.useState(n||"claude-code");return y.useEffect(()=>{n&&u(n)},[n]),r.jsxs("div",{className:it.stepContent,"data-testid":"setup-runtime",children:[r.jsx("h2",{className:it.heading,children:"Choose Your Runtime"}),r.jsx("p",{className:it.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),r.jsx("div",{className:it.runtimeGrid,children:uz.map(f=>r.jsxs("button",{type:"button",className:it.runtimeCard,"data-selected":c===f.id,"aria-pressed":c===f.id,"data-testid":`runtime-card-${f.id}`,onClick:()=>u(f.id),children:[r.jsx("span",{className:it.runtimeName,children:f.name}),r.jsx("span",{className:it.runtimeDescription,children:f.description})]},f.id))}),r.jsxs("div",{className:it.buttonRow,children:[r.jsx("button",{type:"button",className:it.ghostButton,onClick:i,children:"Back"}),r.jsx("button",{type:"button",className:it.primaryButton,onClick:()=>a(c),disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const fz=3,X0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function hz(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:o}=dt(),c=xt(),[u,f]=y.useState(0),p=n.find(v=>v.id==="claude-code"),m=y.useCallback(v=>{if(p&&v!==p.runtime){const b=X0[v]??"sonnet";a(p.id,void 0,void 0,void 0,v,b).catch(()=>{})}const g=n.find(b=>b.id===Zg);if(g&&v!==g.runtime){const b=X0[v]??"sonnet";a(Zg,void 0,void 0,void 0,v,b).catch(()=>{})}i(),c("/",{replace:!0})},[p,n,a,i,c]);return o===!0?r.jsx($n,{to:"/",replace:!0}):r.jsx("div",{className:it.wizard,"data-testid":"setup-wizard",children:r.jsxs("div",{className:it.container,children:[r.jsx(aa,{mode:"wait",children:r.jsxs(At.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&r.jsx(rz,{onNext:()=>f(1)}),u===1&&r.jsx(cz,{onNext:()=>f(2),onBack:()=>f(0)}),u===2&&r.jsx(dz,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>f(1),finishDisabled:!p})]},u)}),r.jsx("div",{className:it.dots,children:Array.from({length:fz},(v,g)=>r.jsx("span",{className:it.dot,"data-active":g===u},g))})]})})}const pz="_root_zndgp_1",mz="_body_zndgp_7",vz="_main_zndgp_19",gz="_sidebarWrapper_zndgp_26",yz="_overlay_zndgp_51",sl={root:pz,body:mz,main:vz,sidebarWrapper:gz,overlay:yz},bz=y.lazy(()=>gT(()=>import("./KnowledgePage-DQBwMH_z.js"),__vite__mapDeps([0,1,2,3,4])).then(n=>({default:n.KnowledgePage}))),w_=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function xz(){const{connected:n,environments:a,sessions:i,tasks:o}=dt(),c=Lt(),f=Ob()!==void 0,[p,m]=y.useState(!1),v=y.useCallback(()=>m(g=>!g),[]);return y.useEffect(()=>{m(!1)},[c.pathname]),y.useEffect(()=>{if(!p)return;const g=b=>{b.key==="Escape"&&m(!1)};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[p]),r.jsxs(r.Fragment,{children:[r.jsx(oN,{connected:n,environments:a,sessions:i,onToggleSidebar:f?v:void 0,sidebarOpen:p}),r.jsx(hN,{}),r.jsxs("div",{className:sl.body,children:[f&&r.jsx("div",{className:sl.sidebarWrapper,"data-sidebar-open":p,children:r.jsx(_N,{})}),f&&p&&r.jsx("div",{className:sl.overlay,"data-testid":"drawer-overlay",onClick:()=>m(!1)}),r.jsxs("div",{className:sl.main,children:[r.jsx(Ks,{}),r.jsx(gD,{sessions:i,tasks:o,environments:a})]})]}),r.jsx(AD,{}),r.jsx(G8,{})]})}function _z(){const{lastSpawnedId:n,environments:a,tasks:i,connected:o,onboardingCompleted:c}=dt(),{showToast:u}=Da();u3(a,u),p3(i,u);const f=xt(),p=Lt();return y.useEffect(()=>{n&&!p.pathname.includes("/tasks/")&&f(xb(n),{replace:!0})},[n,f,p.pathname]),o&&c===!1?r.jsx($n,{to:"/setup",replace:!0}):r.jsx(pN,{children:r.jsxs("div",{className:sl.root,children:[w_&&r.jsx(oR,{}),r.jsx(xz,{})]})})}function jf(){const{workspaceId:n}=ds(),{workspaces:a}=dt(),i=Lt(),o=a.find(m=>m.id===n);if(!(o!=null&&o.environmentId))return a.length===0?void 0:r.jsx($n,{to:"/environments",replace:!0});const c=encodeURIComponent(n),u=`/workspaces/${c}`,f=i.pathname.startsWith(u)?i.pathname.slice(u.length):"",p=`/environments/${encodeURIComponent(o.environmentId)}/workspaces/${c}${f}${i.search}${i.hash}`;return r.jsx($n,{to:p,replace:!0})}function Sz(){return r.jsxs(Sk,{children:[r.jsx(je,{path:"setup",element:r.jsx(hz,{})}),r.jsxs(je,{element:r.jsx(_z,{}),children:[r.jsx(je,{index:!0,element:r.jsx(H5,{})}),r.jsx(je,{path:"chat",element:r.jsx(g6,{})}),r.jsx(je,{path:"sessions/new",element:r.jsx(j6,{})}),r.jsx(je,{path:"sessions/:sessionId",element:r.jsx(C6,{})}),r.jsx(je,{element:r.jsx(cD,{}),children:r.jsx(je,{path:"knowledge",element:r.jsx(y.Suspense,{fallback:r.jsx(x_,{}),children:r.jsx(bz,{})})})}),r.jsxs(je,{element:r.jsx(oD,{}),children:[r.jsx(je,{path:"tasks",element:r.jsx(U5,{})}),r.jsx(je,{path:"tasks/new",element:r.jsx(P0,{})}),r.jsx(je,{path:"tasks/:taskId",element:r.jsx(os,{})}),r.jsx(je,{path:"tasks/:taskId/edit",element:r.jsx(os,{})}),r.jsx(je,{path:"tasks/:taskId/stream",element:r.jsx(os,{})}),r.jsx(je,{path:"tasks/:taskId/findings",element:r.jsx(os,{})})]}),r.jsxs(je,{element:r.jsx(lD,{}),children:[r.jsx(je,{path:"workspaces",element:r.jsx($n,{to:"/environments",replace:!0})}),r.jsx(je,{path:"workspaces/new",element:r.jsx(AB,{})}),r.jsx(je,{path:"workspaces/:workspaceId",element:r.jsx(jf,{})}),r.jsx(je,{path:"workspaces/:workspaceId/tasks/:taskId",element:r.jsx(jf,{})}),r.jsx(je,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:r.jsx(jf,{})}),r.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId",element:r.jsx(Y4,{})}),r.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:r.jsx(P0,{})}),r.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:r.jsx(os,{})}),r.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:r.jsx(os,{})}),r.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:r.jsx(os,{})}),r.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:r.jsx(os,{})}),r.jsxs(je,{path:"environments",element:r.jsx(kL,{}),children:[r.jsx(je,{index:!0,element:r.jsx(V5,{})}),r.jsx(je,{path:"new",element:r.jsx(bL,{})}),r.jsx(je,{path:":environmentId",element:r.jsx(QL,{})}),r.jsx(je,{path:":environmentId/edit",element:r.jsx(xL,{})})]})]}),r.jsx(je,{element:r.jsx(rD,{}),children:r.jsxs(je,{path:"settings",element:r.jsx(tI,{}),children:[r.jsx(je,{index:!0,element:r.jsx($n,{to:"credentials",replace:!0})}),r.jsx(je,{path:"environments",element:r.jsx($n,{to:"/environments",replace:!0})}),r.jsx(je,{path:"credentials",element:r.jsx(PI,{})}),r.jsx(je,{path:"tokens",element:r.jsx($n,{to:"../credentials",replace:!0})}),r.jsx(je,{path:"personas",element:r.jsx(r8,{})}),r.jsx(je,{path:"personas/new",element:r.jsx(Y0,{})}),r.jsx(je,{path:"personas/:personaId",element:r.jsx(Y0,{})}),r.jsx(je,{path:"appearance",element:r.jsx(C8,{})}),r.jsx(je,{path:"shortcuts",element:r.jsx(P8,{})}),r.jsx(je,{path:"about",element:r.jsx(R8,{})})]})}),r.jsx(je,{path:"*",element:r.jsx($n,{to:"/",replace:!0})})]})]})}const Tz=1e4;function kz(){const{onboardingCompleted:n}=dt(),[a,i]=y.useState(!1);y.useEffect(()=>{if(n!==void 0)return;const c=setTimeout(()=>i(!0),Tz);return()=>clearTimeout(c)},[n]);const o=n===void 0&&!a;return r.jsx(aa,{mode:"wait",children:o?r.jsx(At.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:r.jsx(x_,{})},"splash"):r.jsx(At.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:r.jsx(Fk,{basename:"/".replace(/\/$/,""),children:r.jsx(Sz,{})})},"app")})}function jz(){const n=w_?$j:Bj;return r.jsx(Xj,{children:r.jsx(Kj,{children:r.jsx(n,{children:r.jsx(kz,{})})})})}pT.createRoot(document.getElementById("root")).render(r.jsx(y.StrictMode,{children:r.jsx(jz,{})}));export{hs as B,kb as K,dt as a,xb as s,na as t,xt as u};
|