@grackle-ai/web 0.71.2 → 0.72.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.
@@ -1,112 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-SAVu8YTP.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
2
- import{r as KS,a as x,j as c,v as YS,b as ZS,t as Gr,i as XS,f as QS,M as th,c as nh}from"./markdown-gcy1Jmzi.js";import{r as WS,d as Zv,H as Xv,P as Qv,i as JS,B as eT,a as tT,C as nT,M as aT}from"./dagview-BA5TtMAQ.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function i(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(r){if(r.ep)return;r.ep=!0;const u=i(r);fetch(r.href,u)}})();var Yd={exports:{}},Ko={},Zd={exports:{}},Xd={};/**
3
- * @license React
4
- * scheduler.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var Wv;function sT(){return Wv||(Wv=1,(function(t){function a(I,Y){var oe=I.length;I.push(Y);e:for(;0<oe;){var P=oe-1>>>1,O=I[P];if(0<r(O,Y))I[P]=Y,I[oe]=O,oe=P;else break e}}function i(I){return I.length===0?null:I[0]}function o(I){if(I.length===0)return null;var Y=I[0],oe=I.pop();if(oe!==Y){I[0]=oe;e:for(var P=0,O=I.length,ie=O>>>1;P<ie;){var be=2*(P+1)-1,re=I[be],Ke=be+1,yt=I[Ke];if(0>r(re,oe))Ke<O&&0>r(yt,re)?(I[P]=yt,I[Ke]=oe,P=Ke):(I[P]=re,I[be]=oe,P=be);else if(Ke<O&&0>r(yt,oe))I[P]=yt,I[Ke]=oe,P=Ke;else break e}}return Y}function r(I,Y){var oe=I.sortIndex-Y.sortIndex;return oe!==0?oe:I.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var d=Date,p=d.now();t.unstable_now=function(){return d.now()-p}}var m=[],g=[],v=1,y=null,b=3,S=!1,T=!1,E=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function M(I){for(var Y=i(g);Y!==null;){if(Y.callback===null)o(g);else if(Y.startTime<=I)o(g),Y.sortIndex=Y.expirationTime,a(m,Y);else break;Y=i(g)}}function w(I){if(E=!1,M(I),!T)if(i(m)!==null)T=!0,$||($=!0,te());else{var Y=i(g);Y!==null&&ne(w,Y.startTime-I)}}var $=!1,V=-1,B=5,q=-1;function X(){return N?!0:!(t.unstable_now()-q<B)}function ae(){if(N=!1,$){var I=t.unstable_now();q=I;var Y=!0;try{e:{T=!1,E&&(E=!1,j(V),V=-1),S=!0;var oe=b;try{t:{for(M(I),y=i(m);y!==null&&!(y.expirationTime>I&&X());){var P=y.callback;if(typeof P=="function"){y.callback=null,b=y.priorityLevel;var O=P(y.expirationTime<=I);if(I=t.unstable_now(),typeof O=="function"){y.callback=O,M(I),Y=!0;break t}y===i(m)&&o(m),M(I)}else o(m);y=i(m)}if(y!==null)Y=!0;else{var ie=i(g);ie!==null&&ne(w,ie.startTime-I),Y=!1}}break e}finally{y=null,b=oe,S=!1}Y=void 0}}finally{Y?te():$=!1}}}var te;if(typeof D=="function")te=function(){D(ae)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,F=Q.port2;Q.port1.onmessage=ae,te=function(){F.postMessage(null)}}else te=function(){C(ae,0)};function ne(I,Y){V=C(function(){I(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(I){I.callback=null},t.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<I?Math.floor(1e3/I):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(I){switch(b){case 1:case 2:case 3:var Y=3;break;default:Y=b}var oe=b;b=Y;try{return I()}finally{b=oe}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(I,Y){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var oe=b;b=I;try{return Y()}finally{b=oe}},t.unstable_scheduleCallback=function(I,Y,oe){var P=t.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?P+oe:P):oe=P,I){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=oe+O,I={id:v++,callback:Y,priorityLevel:I,startTime:oe,expirationTime:O,sortIndex:-1},oe>P?(I.sortIndex=oe,a(g,I),i(m)===null&&I===i(g)&&(E?(j(V),V=-1):E=!0,ne(w,oe-P))):(I.sortIndex=O,a(m,I),T||S||(T=!0,$||($=!0,te()))),I},t.unstable_shouldYield=X,t.unstable_wrapCallback=function(I){var Y=b;return function(){var oe=b;b=Y;try{return I.apply(this,arguments)}finally{b=oe}}}})(Xd)),Xd}var Jv;function iT(){return Jv||(Jv=1,Zd.exports=sT()),Zd.exports}/**
11
- * @license React
12
- * react-dom-client.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var ey;function oT(){if(ey)return Ko;ey=1;var t=iT(),a=KS(),i=WS();function o(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,s=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(s=n.return),e=n.return;while(e)}return n.tag===3?s:null}function d(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(u(e)!==e)throw Error(o(188))}function g(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(o(188));return n!==e?null:e}for(var s=e,l=n;;){var f=s.return;if(f===null)break;var h=f.alternate;if(h===null){if(l=f.return,l!==null){s=l;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===s)return m(f),e;if(h===l)return m(f),n;h=h.sibling}throw Error(o(188))}if(s.return!==l.return)s=f,l=h;else{for(var _=!1,k=f.child;k;){if(k===s){_=!0,s=f,l=h;break}if(k===l){_=!0,l=f,s=h;break}k=k.sibling}if(!_){for(k=h.child;k;){if(k===s){_=!0,s=h,l=f;break}if(k===l){_=!0,l=h,s=f;break}k=k.sibling}if(!_)throw Error(o(189))}}if(s.alternate!==l)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),D=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Symbol.for("react.client.reference");function F(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case w:return"Suspense";case $:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case D:return e.displayName||"Context";case j:return(e._context.displayName||"Context")+".Consumer";case M:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return n=e.displayName||null,n!==null?n:F(e.type)||"Memo";case B:n=e._payload,e=e._init;try{return F(e(n))}catch{}}return null}var ne=Array.isArray,I=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},P=[],O=-1;function ie(e){return{current:e}}function be(e){0>O||(e.current=P[O],P[O]=null,O--)}function re(e,n){O++,P[O]=e.current,e.current=n}var Ke=ie(null),yt=ie(null),fe=ie(null),Mt=ie(null);function mn(e,n){switch(re(fe,n),re(yt,e),re(Ke,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?yv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=yv(n),e=bv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}be(Ke),re(Ke,e)}function Mn(){be(Ke),be(yt),be(fe)}function Ln(e){e.memoizedState!==null&&re(Mt,e);var n=Ke.current,s=bv(n,e.type);n!==s&&(re(yt,e),re(Ke,s))}function Te(e){yt.current===e&&(be(Ke),be(yt)),Mt.current===e&&(be(Mt),Go._currentValue=oe)}var pt,Hs;function Un(e){if(pt===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);pt=n&&n[1]||"",Hs=-1<s.stack.indexOf(`
19
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
20
- `+pt+e+Hs}var Ps=!1;function Gs(e,n){if(!e||Ps)return"";Ps=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(K){var G=K}Reflect.construct(e,[],ee)}else{try{ee.call()}catch(K){G=K}e.call(ee.prototype)}}else{try{throw Error()}catch(K){G=K}(ee=e())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(K){if(K&&G&&typeof K.stack=="string")return[K.stack,G.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),_=h[0],k=h[1];if(_&&k){var A=_.split(`
21
- `),H=k.split(`
22
- `);for(f=l=0;l<A.length&&!A[l].includes("DetermineComponentFrameRoot");)l++;for(;f<H.length&&!H[f].includes("DetermineComponentFrameRoot");)f++;if(l===A.length||f===H.length)for(l=A.length-1,f=H.length-1;1<=l&&0<=f&&A[l]!==H[f];)f--;for(;1<=l&&0<=f;l--,f--)if(A[l]!==H[f]){if(l!==1||f!==1)do if(l--,f--,0>f||A[l]!==H[f]){var Z=`
23
- `+A[l].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=l&&0<=f);break}}}finally{Ps=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Un(s):""}function Nl(e,n){switch(e.tag){case 26:case 27:case 5:return Un(e.type);case 16:return Un("Lazy");case 13:return e.child!==n&&n!==null?Un("Suspense Fallback"):Un("Suspense");case 19:return Un("SuspenseList");case 0:case 15:return Gs(e.type,!1);case 11:return Gs(e.type.render,!1);case 1:return Gs(e.type,!0);case 31:return Un("Activity");default:return""}}function eo(e){try{var n="",s=null;do n+=Nl(e,s),s=e,e=e.return;while(e);return n}catch(l){return`
24
- Error generating stack: `+l.message+`
25
- `+l.stack}}var $s=Object.prototype.hasOwnProperty,Fs=t.unstable_scheduleCallback,qs=t.unstable_cancelCallback,jl=t.unstable_shouldYield,wl=t.unstable_requestPaint,zt=t.unstable_now,Bc=t.unstable_getCurrentPriorityLevel,J=t.unstable_ImmediatePriority,le=t.unstable_UserBlockingPriority,ce=t.unstable_NormalPriority,_e=t.unstable_LowPriority,xe=t.unstable_IdlePriority,Qe=t.log,je=t.unstable_setDisableYieldValue,lt=null,Ne=null;function tt(e){if(typeof Qe=="function"&&je(e),Ne&&typeof Ne.setStrictMode=="function")try{Ne.setStrictMode(lt,e)}catch{}}var Pe=Math.clz32?Math.clz32:Vt,Gt=Math.log,tn=Math.LN2;function Vt(e){return e>>>=0,e===0?32:31-(Gt(e)/tn|0)|0}var ka=256,gn=262144,Ca=4194304;function ls(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Al(e,n,s){var l=e.pendingLanes;if(l===0)return 0;var f=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var k=l&134217727;return k!==0?(l=k&~h,l!==0?f=ls(l):(_&=k,_!==0?f=ls(_):s||(s=k&~e,s!==0&&(f=ls(s))))):(k=l&~h,k!==0?f=ls(k):_!==0?f=ls(_):s||(s=l&~e,s!==0&&(f=ls(s)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,s=n&-n,h>=s||h===32&&(s&4194048)!==0)?n:f}function to(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function O_(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jh(){var e=Ca;return Ca<<=1,(Ca&62914560)===0&&(Ca=4194304),e}function Ic(e){for(var n=[],s=0;31>s;s++)n.push(e);return n}function no(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function B_(e,n,s,l,f,h){var _=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var k=e.entanglements,A=e.expirationTimes,H=e.hiddenUpdates;for(s=_&~s;0<s;){var Z=31-Pe(s),ee=1<<Z;k[Z]=0,A[Z]=-1;var G=H[Z];if(G!==null)for(H[Z]=null,Z=0;Z<G.length;Z++){var K=G[Z];K!==null&&(K.lane&=-536870913)}s&=~ee}l!==0&&ep(e,l,0),h!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~n))}function ep(e,n,s){e.pendingLanes|=n,e.suspendedLanes&=~n;var l=31-Pe(n);e.entangledLanes|=n,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function tp(e,n){var s=e.entangledLanes|=n;for(e=e.entanglements;s;){var l=31-Pe(s),f=1<<l;f&n|e[l]&n&&(e[l]|=n),s&=~f}}function np(e,n){var s=n&-n;return s=(s&42)!==0?1:Lc(s),(s&(e.suspendedLanes|n))!==0?0:s}function Lc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Uc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ap(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:Pv(e.type))}function sp(e,n){var s=Y.p;try{return Y.p=e,n()}finally{Y.p=s}}var Ea=Math.random().toString(36).slice(2),Rt="__reactFiber$"+Ea,Kt="__reactProps$"+Ea,Ks="__reactContainer$"+Ea,zc="__reactEvents$"+Ea,I_="__reactListeners$"+Ea,L_="__reactHandles$"+Ea,ip="__reactResources$"+Ea,ao="__reactMarker$"+Ea;function Vc(e){delete e[Rt],delete e[Kt],delete e[zc],delete e[I_],delete e[L_]}function Ys(e){var n=e[Rt];if(n)return n;for(var s=e.parentNode;s;){if(n=s[Ks]||s[Rt]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=Ev(e);e!==null;){if(s=e[Rt])return s;e=Ev(e)}return n}e=s,s=e.parentNode}return null}function Zs(e){if(e=e[Rt]||e[Ks]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function so(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(o(33))}function Xs(e){var n=e[ip];return n||(n=e[ip]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function wt(e){e[ao]=!0}var op=new Set,lp={};function rs(e,n){Qs(e,n),Qs(e+"Capture",n)}function Qs(e,n){for(lp[e]=n,e=0;e<n.length;e++)op.add(n[e])}var U_=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),rp={},cp={};function z_(e){return $s.call(cp,e)?!0:$s.call(rp,e)?!1:U_.test(e)?cp[e]=!0:(rp[e]=!0,!1)}function Dl(e,n,s){if(z_(n))if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var l=n.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+s)}}function Ml(e,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+s)}}function Wn(e,n,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(n,s,""+l)}}function vn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function up(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function V_(e,n,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,h=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(_){s=""+_,h.call(this,_)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Hc(e){if(!e._valueTracker){var n=up(e)?"checked":"value";e._valueTracker=V_(e,n,""+e[n])}}function dp(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),l="";return e&&(l=up(e)?e.checked?"true":"false":e.value),e=l,e!==s?(n.setValue(e),!0):!1}function Rl(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 H_=/[\n"\\]/g;function yn(e){return e.replace(H_,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Pc(e,n,s,l,f,h,_,k){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),n!=null?_==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+vn(n)):e.value!==""+vn(n)&&(e.value=""+vn(n)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),n!=null?Gc(e,_,vn(n)):s!=null?Gc(e,_,vn(s)):l!=null&&e.removeAttribute("value"),f==null&&h!=null&&(e.defaultChecked=!!h),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+vn(k):e.removeAttribute("name")}function fp(e,n,s,l,f,h,_,k){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Hc(e);return}s=s!=null?""+vn(s):"",n=n!=null?""+vn(n):s,k||n===e.value||(e.value=n),e.defaultValue=n}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=k?e.checked:!!l,e.defaultChecked=!!l,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Hc(e)}function Gc(e,n,s){n==="number"&&Rl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ws(e,n,s,l){if(e=e.options,n){n={};for(var f=0;f<s.length;f++)n["$"+s[f]]=!0;for(s=0;s<e.length;s++)f=n.hasOwnProperty("$"+e[s].value),e[s].selected!==f&&(e[s].selected=f),f&&l&&(e[s].defaultSelected=!0)}else{for(s=""+vn(s),n=null,f=0;f<e.length;f++){if(e[f].value===s){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function hp(e,n,s){if(n!=null&&(n=""+vn(n),n!==e.value&&(e.value=n),s==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=s!=null?""+vn(s):""}function pp(e,n,s,l){if(n==null){if(l!=null){if(s!=null)throw Error(o(92));if(ne(l)){if(1<l.length)throw Error(o(93));l=l[0]}s=l}s==null&&(s=""),n=s}s=vn(n),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),Hc(e)}function Js(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}var P_=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function mp(e,n,s){var l=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":l?e.setProperty(n,s):typeof s!="number"||s===0||P_.has(n)?n==="float"?e.cssFloat=s:e[n]=(""+s).trim():e[n]=s+"px"}function gp(e,n,s){if(n!=null&&typeof n!="object")throw Error(o(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||n!=null&&n.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var f in n)l=n[f],n.hasOwnProperty(f)&&s[f]!==l&&mp(e,f,l)}else for(var h in n)n.hasOwnProperty(h)&&mp(e,h,n[h])}function $c(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var G_=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"]]),$_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ol(e){return $_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Jn(){}var Fc=null;function qc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ei=null,ti=null;function vp(e){var n=Zs(e);if(n&&(e=n.stateNode)){var s=e[Kt]||null;e:switch(e=n.stateNode,n.type){case"input":if(Pc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+yn(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var l=s[n];if(l!==e&&l.form===e.form){var f=l[Kt]||null;if(!f)throw Error(o(90));Pc(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<s.length;n++)l=s[n],l.form===e.form&&dp(l)}break e;case"textarea":hp(e,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&Ws(e,!!s.multiple,n,!1)}}}var Kc=!1;function yp(e,n,s){if(Kc)return e(n,s);Kc=!0;try{var l=e(n);return l}finally{if(Kc=!1,(ei!==null||ti!==null)&&(_r(),ei&&(n=ei,e=ti,ti=ei=null,vp(n),e)))for(n=0;n<e.length;n++)vp(e[n])}}function io(e,n){var s=e.stateNode;if(s===null)return null;var l=s[Kt]||null;if(l===null)return null;s=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,n,typeof s));return s}var ea=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yc=!1;if(ea)try{var oo={};Object.defineProperty(oo,"passive",{get:function(){Yc=!0}}),window.addEventListener("test",oo,oo),window.removeEventListener("test",oo,oo)}catch{Yc=!1}var Na=null,Zc=null,Bl=null;function bp(){if(Bl)return Bl;var e,n=Zc,s=n.length,l,f="value"in Na?Na.value:Na.textContent,h=f.length;for(e=0;e<s&&n[e]===f[e];e++);var _=s-e;for(l=1;l<=_&&n[s-l]===f[h-l];l++);return Bl=f.slice(e,1<l?1-l:void 0)}function Il(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ll(){return!0}function xp(){return!1}function Yt(e){function n(s,l,f,h,_){this._reactName=s,this._targetInst=f,this.type=l,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(s=e[k],this[k]=s?s(h):h[k]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ll:xp,this.isPropagationStopped=xp,this}return y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ll)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ll)},persist:function(){},isPersistent:Ll}),n}var cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ul=Yt(cs),lo=y({},cs,{view:0,detail:0}),F_=Yt(lo),Xc,Qc,ro,zl=y({},lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ro&&(ro&&e.type==="mousemove"?(Xc=e.screenX-ro.screenX,Qc=e.screenY-ro.screenY):Qc=Xc=0,ro=e),Xc)},movementY:function(e){return"movementY"in e?e.movementY:Qc}}),_p=Yt(zl),q_=y({},zl,{dataTransfer:0}),K_=Yt(q_),Y_=y({},lo,{relatedTarget:0}),Wc=Yt(Y_),Z_=y({},cs,{animationName:0,elapsedTime:0,pseudoElement:0}),X_=Yt(Z_),Q_=y({},cs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),W_=Yt(Q_),J_=y({},cs,{data:0}),Sp=Yt(J_),e1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},t1={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"},n1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function a1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=n1[e])?!!n[e]:!1}function Jc(){return a1}var s1=y({},lo,{key:function(e){if(e.key){var n=e1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Il(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?t1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jc,charCode:function(e){return e.type==="keypress"?Il(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Il(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),i1=Yt(s1),o1=y({},zl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tp=Yt(o1),l1=y({},lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jc}),r1=Yt(l1),c1=y({},cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),u1=Yt(c1),d1=y({},zl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),f1=Yt(d1),h1=y({},cs,{newState:0,oldState:0}),p1=Yt(h1),m1=[9,13,27,32],eu=ea&&"CompositionEvent"in window,co=null;ea&&"documentMode"in document&&(co=document.documentMode);var g1=ea&&"TextEvent"in window&&!co,kp=ea&&(!eu||co&&8<co&&11>=co),Cp=" ",Ep=!1;function Np(e,n){switch(e){case"keyup":return m1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ni=!1;function v1(e,n){switch(e){case"compositionend":return jp(n);case"keypress":return n.which!==32?null:(Ep=!0,Cp);case"textInput":return e=n.data,e===Cp&&Ep?null:e;default:return null}}function y1(e,n){if(ni)return e==="compositionend"||!eu&&Np(e,n)?(e=bp(),Bl=Zc=Na=null,ni=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return kp&&n.locale!=="ko"?null:n.data;default:return null}}var b1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wp(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!b1[e.type]:n==="textarea"}function Ap(e,n,s,l){ei?ti?ti.push(l):ti=[l]:ei=l,n=jr(n,"onChange"),0<n.length&&(s=new Ul("onChange","change",null,s,l),e.push({event:s,listeners:n}))}var uo=null,fo=null;function x1(e){fv(e,0)}function Vl(e){var n=so(e);if(dp(n))return e}function Dp(e,n){if(e==="change")return n}var Mp=!1;if(ea){var tu;if(ea){var nu="oninput"in document;if(!nu){var Rp=document.createElement("div");Rp.setAttribute("oninput","return;"),nu=typeof Rp.oninput=="function"}tu=nu}else tu=!1;Mp=tu&&(!document.documentMode||9<document.documentMode)}function Op(){uo&&(uo.detachEvent("onpropertychange",Bp),fo=uo=null)}function Bp(e){if(e.propertyName==="value"&&Vl(fo)){var n=[];Ap(n,fo,e,qc(e)),yp(x1,n)}}function _1(e,n,s){e==="focusin"?(Op(),uo=n,fo=s,uo.attachEvent("onpropertychange",Bp)):e==="focusout"&&Op()}function S1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vl(fo)}function T1(e,n){if(e==="click")return Vl(n)}function k1(e,n){if(e==="input"||e==="change")return Vl(n)}function C1(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var nn=typeof Object.is=="function"?Object.is:C1;function ho(e,n){if(nn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var s=Object.keys(e),l=Object.keys(n);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var f=s[l];if(!$s.call(n,f)||!nn(e[f],n[f]))return!1}return!0}function Ip(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lp(e,n){var s=Ip(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=n&&l>=n)return{node:s,offset:n-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Ip(s)}}function Up(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Up(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function zp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Rl(e.document);n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=Rl(e.document)}return n}function au(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var E1=ea&&"documentMode"in document&&11>=document.documentMode,ai=null,su=null,po=null,iu=!1;function Vp(e,n,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;iu||ai==null||ai!==Rl(l)||(l=ai,"selectionStart"in l&&au(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),po&&ho(po,l)||(po=l,l=jr(su,"onSelect"),0<l.length&&(n=new Ul("onSelect","select",null,n,s),e.push({event:n,listeners:l}),n.target=ai)))}function us(e,n){var s={};return s[e.toLowerCase()]=n.toLowerCase(),s["Webkit"+e]="webkit"+n,s["Moz"+e]="moz"+n,s}var si={animationend:us("Animation","AnimationEnd"),animationiteration:us("Animation","AnimationIteration"),animationstart:us("Animation","AnimationStart"),transitionrun:us("Transition","TransitionRun"),transitionstart:us("Transition","TransitionStart"),transitioncancel:us("Transition","TransitionCancel"),transitionend:us("Transition","TransitionEnd")},ou={},Hp={};ea&&(Hp=document.createElement("div").style,"AnimationEvent"in window||(delete si.animationend.animation,delete si.animationiteration.animation,delete si.animationstart.animation),"TransitionEvent"in window||delete si.transitionend.transition);function ds(e){if(ou[e])return ou[e];if(!si[e])return e;var n=si[e],s;for(s in n)if(n.hasOwnProperty(s)&&s in Hp)return ou[e]=n[s];return e}var Pp=ds("animationend"),Gp=ds("animationiteration"),$p=ds("animationstart"),N1=ds("transitionrun"),j1=ds("transitionstart"),w1=ds("transitioncancel"),Fp=ds("transitionend"),qp=new Map,lu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");lu.push("scrollEnd");function Rn(e,n){qp.set(e,n),rs(n,[e])}var Hl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},bn=[],ii=0,ru=0;function Pl(){for(var e=ii,n=ru=ii=0;n<e;){var s=bn[n];bn[n++]=null;var l=bn[n];bn[n++]=null;var f=bn[n];bn[n++]=null;var h=bn[n];if(bn[n++]=null,l!==null&&f!==null){var _=l.pending;_===null?f.next=f:(f.next=_.next,_.next=f),l.pending=f}h!==0&&Kp(s,f,h)}}function Gl(e,n,s,l){bn[ii++]=e,bn[ii++]=n,bn[ii++]=s,bn[ii++]=l,ru|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function cu(e,n,s,l){return Gl(e,n,s,l),$l(e)}function fs(e,n){return Gl(e,null,null,n),$l(e)}function Kp(e,n,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var f=!1,h=e.return;h!==null;)h.childLanes|=s,l=h.alternate,l!==null&&(l.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(f=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,f&&n!==null&&(f=31-Pe(s),e=h.hiddenUpdates,l=e[f],l===null?e[f]=[n]:l.push(n),n.lane=s|536870912),h):null}function $l(e){if(50<Io)throw Io=0,yd=null,Error(o(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var oi={};function A1(e,n,s,l){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function an(e,n,s,l){return new A1(e,n,s,l)}function uu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ta(e,n){var s=e.alternate;return s===null?(s=an(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=n,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Yp(e,n){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,n=s.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Fl(e,n,s,l,f,h){var _=0;if(l=e,typeof e=="function")uu(e)&&(_=1);else if(typeof e=="string")_=BS(e,s,Ke.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case q:return e=an(31,s,n,f),e.elementType=q,e.lanes=h,e;case E:return hs(s.children,f,h,n);case N:_=8,f|=24;break;case C:return e=an(12,s,n,f|2),e.elementType=C,e.lanes=h,e;case w:return e=an(13,s,n,f),e.elementType=w,e.lanes=h,e;case $:return e=an(19,s,n,f),e.elementType=$,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:_=10;break e;case j:_=9;break e;case M:_=11;break e;case V:_=14;break e;case B:_=16,l=null;break e}_=29,s=Error(o(130,e===null?"null":typeof e,"")),l=null}return n=an(_,s,n,f),n.elementType=e,n.type=l,n.lanes=h,n}function hs(e,n,s,l){return e=an(7,e,l,n),e.lanes=s,e}function du(e,n,s){return e=an(6,e,null,n),e.lanes=s,e}function Zp(e){var n=an(18,null,null,0);return n.stateNode=e,n}function fu(e,n,s){return n=an(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Xp=new WeakMap;function xn(e,n){if(typeof e=="object"&&e!==null){var s=Xp.get(e);return s!==void 0?s:(n={value:e,source:n,stack:eo(n)},Xp.set(e,n),n)}return{value:e,source:n,stack:eo(n)}}var li=[],ri=0,ql=null,mo=0,_n=[],Sn=0,ja=null,zn=1,Vn="";function na(e,n){li[ri++]=mo,li[ri++]=ql,ql=e,mo=n}function Qp(e,n,s){_n[Sn++]=zn,_n[Sn++]=Vn,_n[Sn++]=ja,ja=e;var l=zn;e=Vn;var f=32-Pe(l)-1;l&=~(1<<f),s+=1;var h=32-Pe(n)+f;if(30<h){var _=f-f%5;h=(l&(1<<_)-1).toString(32),l>>=_,f-=_,zn=1<<32-Pe(n)+f|s<<f|l,Vn=h+e}else zn=1<<h|s<<f|l,Vn=e}function hu(e){e.return!==null&&(na(e,1),Qp(e,1,0))}function pu(e){for(;e===ql;)ql=li[--ri],li[ri]=null,mo=li[--ri],li[ri]=null;for(;e===ja;)ja=_n[--Sn],_n[Sn]=null,Vn=_n[--Sn],_n[Sn]=null,zn=_n[--Sn],_n[Sn]=null}function Wp(e,n){_n[Sn++]=zn,_n[Sn++]=Vn,_n[Sn++]=ja,zn=n.id,Vn=n.overflow,ja=e}var Ot=null,nt=null,Re=!1,wa=null,Tn=!1,mu=Error(o(519));function Aa(e){var n=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw go(xn(n,e)),mu}function Jp(e){var n=e.stateNode,s=e.type,l=e.memoizedProps;switch(n[Rt]=e,n[Kt]=l,s){case"dialog":Ae("cancel",n),Ae("close",n);break;case"iframe":case"object":case"embed":Ae("load",n);break;case"video":case"audio":for(s=0;s<Uo.length;s++)Ae(Uo[s],n);break;case"source":Ae("error",n);break;case"img":case"image":case"link":Ae("error",n),Ae("load",n);break;case"details":Ae("toggle",n);break;case"input":Ae("invalid",n),fp(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ae("invalid",n);break;case"textarea":Ae("invalid",n),pp(n,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||l.suppressHydrationWarning===!0||gv(n.textContent,s)?(l.popover!=null&&(Ae("beforetoggle",n),Ae("toggle",n)),l.onScroll!=null&&Ae("scroll",n),l.onScrollEnd!=null&&Ae("scrollend",n),l.onClick!=null&&(n.onclick=Jn),n=!0):n=!1,n||Aa(e,!0)}function em(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:Tn=!1;return;case 27:case 3:Tn=!0;return;default:Ot=Ot.return}}function ci(e){if(e!==Ot)return!1;if(!Re)return em(e),Re=!0,!1;var n=e.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Rd(e.type,e.memoizedProps)),s=!s),s&&nt&&Aa(e),em(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));nt=Cv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));nt=Cv(e)}else n===27?(n=nt,$a(e.type)?(e=Ud,Ud=null,nt=e):nt=n):nt=Ot?Cn(e.stateNode.nextSibling):null;return!0}function ps(){nt=Ot=null,Re=!1}function gu(){var e=wa;return e!==null&&(Wt===null?Wt=e:Wt.push.apply(Wt,e),wa=null),e}function go(e){wa===null?wa=[e]:wa.push(e)}var vu=ie(null),ms=null,aa=null;function Da(e,n,s){re(vu,n._currentValue),n._currentValue=s}function sa(e){e._currentValue=vu.current,be(vu)}function yu(e,n,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===s)break;e=e.return}}function bu(e,n,s,l){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var h=f.dependencies;if(h!==null){var _=f.child;h=h.firstContext;e:for(;h!==null;){var k=h;h=f;for(var A=0;A<n.length;A++)if(k.context===n[A]){h.lanes|=s,k=h.alternate,k!==null&&(k.lanes|=s),yu(h.return,s,e),l||(_=null);break e}h=k.next}}else if(f.tag===18){if(_=f.return,_===null)throw Error(o(341));_.lanes|=s,h=_.alternate,h!==null&&(h.lanes|=s),yu(_,s,e),_=null}else _=f.child;if(_!==null)_.return=f;else for(_=f;_!==null;){if(_===e){_=null;break}if(f=_.sibling,f!==null){f.return=_.return,_=f;break}_=_.return}f=_}}function ui(e,n,s,l){e=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var _=f.alternate;if(_===null)throw Error(o(387));if(_=_.memoizedProps,_!==null){var k=f.type;nn(f.pendingProps.value,_.value)||(e!==null?e.push(k):e=[k])}}else if(f===Mt.current){if(_=f.alternate,_===null)throw Error(o(387));_.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Go):e=[Go])}f=f.return}e!==null&&bu(n,e,s,l),n.flags|=262144}function Kl(e){for(e=e.firstContext;e!==null;){if(!nn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function gs(e){ms=e,aa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Bt(e){return tm(ms,e)}function Yl(e,n){return ms===null&&gs(e),tm(e,n)}function tm(e,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},aa===null){if(e===null)throw Error(o(308));aa=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else aa=aa.next=n;return s}var D1=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){n.aborted=!0,e.forEach(function(s){return s()})}},M1=t.unstable_scheduleCallback,R1=t.unstable_NormalPriority,bt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xu(){return{controller:new D1,data:new Map,refCount:0}}function vo(e){e.refCount--,e.refCount===0&&M1(R1,function(){e.controller.abort()})}var yo=null,_u=0,di=0,fi=null;function O1(e,n){if(yo===null){var s=yo=[];_u=0,di=kd(),fi={status:"pending",value:void 0,then:function(l){s.push(l)}}}return _u++,n.then(nm,nm),n}function nm(){if(--_u===0&&yo!==null){fi!==null&&(fi.status="fulfilled");var e=yo;yo=null,di=0,fi=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function B1(e,n){var s=[],l={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return e.then(function(){l.status="fulfilled",l.value=n;for(var f=0;f<s.length;f++)(0,s[f])(n)},function(f){for(l.status="rejected",l.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),l}var am=I.S;I.S=function(e,n){Vg=zt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&O1(e,n),am!==null&&am(e,n)};var vs=ie(null);function Su(){var e=vs.current;return e!==null?e:We.pooledCache}function Zl(e,n){n===null?re(vs,vs.current):re(vs,n.pool)}function sm(){var e=Su();return e===null?null:{parent:bt._currentValue,pool:e}}var hi=Error(o(460)),Tu=Error(o(474)),Xl=Error(o(542)),Ql={then:function(){}};function im(e){return e=e.status,e==="fulfilled"||e==="rejected"}function om(e,n,s){switch(s=e[s],s===void 0?e.push(n):s!==n&&(n.then(Jn,Jn),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,rm(e),e;default:if(typeof n.status=="string")n.then(Jn,Jn);else{if(e=We,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=n,e.status="pending",e.then(function(l){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=l}},function(l){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=l}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,rm(e),e}throw bs=n,hi}}function ys(e){try{var n=e._init;return n(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(bs=s,hi):s}}var bs=null;function lm(){if(bs===null)throw Error(o(459));var e=bs;return bs=null,e}function rm(e){if(e===hi||e===Xl)throw Error(o(483))}var pi=null,bo=0;function Wl(e){var n=bo;return bo+=1,pi===null&&(pi=[]),om(pi,e,n)}function xo(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Jl(e,n){throw n.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(n),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function cm(e){function n(L,R){if(e){var z=L.deletions;z===null?(L.deletions=[R],L.flags|=16):z.push(R)}}function s(L,R){if(!e)return null;for(;R!==null;)n(L,R),R=R.sibling;return null}function l(L){for(var R=new Map;L!==null;)L.key!==null?R.set(L.key,L):R.set(L.index,L),L=L.sibling;return R}function f(L,R){return L=ta(L,R),L.index=0,L.sibling=null,L}function h(L,R,z){return L.index=z,e?(z=L.alternate,z!==null?(z=z.index,z<R?(L.flags|=67108866,R):z):(L.flags|=67108866,R)):(L.flags|=1048576,R)}function _(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function k(L,R,z,W){return R===null||R.tag!==6?(R=du(z,L.mode,W),R.return=L,R):(R=f(R,z),R.return=L,R)}function A(L,R,z,W){var pe=z.type;return pe===E?Z(L,R,z.props.children,W,z.key):R!==null&&(R.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===B&&ys(pe)===R.type)?(R=f(R,z.props),xo(R,z),R.return=L,R):(R=Fl(z.type,z.key,z.props,null,L.mode,W),xo(R,z),R.return=L,R)}function H(L,R,z,W){return R===null||R.tag!==4||R.stateNode.containerInfo!==z.containerInfo||R.stateNode.implementation!==z.implementation?(R=fu(z,L.mode,W),R.return=L,R):(R=f(R,z.children||[]),R.return=L,R)}function Z(L,R,z,W,pe){return R===null||R.tag!==7?(R=hs(z,L.mode,W,pe),R.return=L,R):(R=f(R,z),R.return=L,R)}function ee(L,R,z){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=du(""+R,L.mode,z),R.return=L,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case S:return z=Fl(R.type,R.key,R.props,null,L.mode,z),xo(z,R),z.return=L,z;case T:return R=fu(R,L.mode,z),R.return=L,R;case B:return R=ys(R),ee(L,R,z)}if(ne(R)||te(R))return R=hs(R,L.mode,z,null),R.return=L,R;if(typeof R.then=="function")return ee(L,Wl(R),z);if(R.$$typeof===D)return ee(L,Yl(L,R),z);Jl(L,R)}return null}function G(L,R,z,W){var pe=R!==null?R.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return pe!==null?null:k(L,R,""+z,W);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case S:return z.key===pe?A(L,R,z,W):null;case T:return z.key===pe?H(L,R,z,W):null;case B:return z=ys(z),G(L,R,z,W)}if(ne(z)||te(z))return pe!==null?null:Z(L,R,z,W,null);if(typeof z.then=="function")return G(L,R,Wl(z),W);if(z.$$typeof===D)return G(L,R,Yl(L,z),W);Jl(L,z)}return null}function K(L,R,z,W,pe){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return L=L.get(z)||null,k(R,L,""+W,pe);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case S:return L=L.get(W.key===null?z:W.key)||null,A(R,L,W,pe);case T:return L=L.get(W.key===null?z:W.key)||null,H(R,L,W,pe);case B:return W=ys(W),K(L,R,z,W,pe)}if(ne(W)||te(W))return L=L.get(z)||null,Z(R,L,W,pe,null);if(typeof W.then=="function")return K(L,R,z,Wl(W),pe);if(W.$$typeof===D)return K(L,R,z,Yl(R,W),pe);Jl(R,W)}return null}function ue(L,R,z,W){for(var pe=null,Le=null,he=R,Ce=R=0,Me=null;he!==null&&Ce<z.length;Ce++){he.index>Ce?(Me=he,he=null):Me=he.sibling;var Ue=G(L,he,z[Ce],W);if(Ue===null){he===null&&(he=Me);break}e&&he&&Ue.alternate===null&&n(L,he),R=h(Ue,R,Ce),Le===null?pe=Ue:Le.sibling=Ue,Le=Ue,he=Me}if(Ce===z.length)return s(L,he),Re&&na(L,Ce),pe;if(he===null){for(;Ce<z.length;Ce++)he=ee(L,z[Ce],W),he!==null&&(R=h(he,R,Ce),Le===null?pe=he:Le.sibling=he,Le=he);return Re&&na(L,Ce),pe}for(he=l(he);Ce<z.length;Ce++)Me=K(he,L,Ce,z[Ce],W),Me!==null&&(e&&Me.alternate!==null&&he.delete(Me.key===null?Ce:Me.key),R=h(Me,R,Ce),Le===null?pe=Me:Le.sibling=Me,Le=Me);return e&&he.forEach(function(Za){return n(L,Za)}),Re&&na(L,Ce),pe}function ge(L,R,z,W){if(z==null)throw Error(o(151));for(var pe=null,Le=null,he=R,Ce=R=0,Me=null,Ue=z.next();he!==null&&!Ue.done;Ce++,Ue=z.next()){he.index>Ce?(Me=he,he=null):Me=he.sibling;var Za=G(L,he,Ue.value,W);if(Za===null){he===null&&(he=Me);break}e&&he&&Za.alternate===null&&n(L,he),R=h(Za,R,Ce),Le===null?pe=Za:Le.sibling=Za,Le=Za,he=Me}if(Ue.done)return s(L,he),Re&&na(L,Ce),pe;if(he===null){for(;!Ue.done;Ce++,Ue=z.next())Ue=ee(L,Ue.value,W),Ue!==null&&(R=h(Ue,R,Ce),Le===null?pe=Ue:Le.sibling=Ue,Le=Ue);return Re&&na(L,Ce),pe}for(he=l(he);!Ue.done;Ce++,Ue=z.next())Ue=K(he,L,Ce,Ue.value,W),Ue!==null&&(e&&Ue.alternate!==null&&he.delete(Ue.key===null?Ce:Ue.key),R=h(Ue,R,Ce),Le===null?pe=Ue:Le.sibling=Ue,Le=Ue);return e&&he.forEach(function(qS){return n(L,qS)}),Re&&na(L,Ce),pe}function Xe(L,R,z,W){if(typeof z=="object"&&z!==null&&z.type===E&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case S:e:{for(var pe=z.key;R!==null;){if(R.key===pe){if(pe=z.type,pe===E){if(R.tag===7){s(L,R.sibling),W=f(R,z.props.children),W.return=L,L=W;break e}}else if(R.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===B&&ys(pe)===R.type){s(L,R.sibling),W=f(R,z.props),xo(W,z),W.return=L,L=W;break e}s(L,R);break}else n(L,R);R=R.sibling}z.type===E?(W=hs(z.props.children,L.mode,W,z.key),W.return=L,L=W):(W=Fl(z.type,z.key,z.props,null,L.mode,W),xo(W,z),W.return=L,L=W)}return _(L);case T:e:{for(pe=z.key;R!==null;){if(R.key===pe)if(R.tag===4&&R.stateNode.containerInfo===z.containerInfo&&R.stateNode.implementation===z.implementation){s(L,R.sibling),W=f(R,z.children||[]),W.return=L,L=W;break e}else{s(L,R);break}else n(L,R);R=R.sibling}W=fu(z,L.mode,W),W.return=L,L=W}return _(L);case B:return z=ys(z),Xe(L,R,z,W)}if(ne(z))return ue(L,R,z,W);if(te(z)){if(pe=te(z),typeof pe!="function")throw Error(o(150));return z=pe.call(z),ge(L,R,z,W)}if(typeof z.then=="function")return Xe(L,R,Wl(z),W);if(z.$$typeof===D)return Xe(L,R,Yl(L,z),W);Jl(L,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,R!==null&&R.tag===6?(s(L,R.sibling),W=f(R,z),W.return=L,L=W):(s(L,R),W=du(z,L.mode,W),W.return=L,L=W),_(L)):s(L,R)}return function(L,R,z,W){try{bo=0;var pe=Xe(L,R,z,W);return pi=null,pe}catch(he){if(he===hi||he===Xl)throw he;var Le=an(29,he,null,L.mode);return Le.lanes=W,Le.return=L,Le}finally{}}}var xs=cm(!0),um=cm(!1),Ma=!1;function ku(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cu(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Oa(e,n,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ve&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,n=$l(e),Kp(e,null,s),n}return Gl(e,l,n,s),$l(e)}function _o(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,s|=l,n.lanes=s,tp(e,s)}}function Eu(e,n){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var f=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?f=h=_:h=h.next=_,s=s.next}while(s!==null);h===null?f=h=n:h=h.next=n}else f=h=n;s={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}var Nu=!1;function So(){if(Nu){var e=fi;if(e!==null)throw e}}function To(e,n,s,l){Nu=!1;var f=e.updateQueue;Ma=!1;var h=f.firstBaseUpdate,_=f.lastBaseUpdate,k=f.shared.pending;if(k!==null){f.shared.pending=null;var A=k,H=A.next;A.next=null,_===null?h=H:_.next=H,_=A;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,k=Z.lastBaseUpdate,k!==_&&(k===null?Z.firstBaseUpdate=H:k.next=H,Z.lastBaseUpdate=A))}if(h!==null){var ee=f.baseState;_=0,Z=H=A=null,k=h;do{var G=k.lane&-536870913,K=G!==k.lane;if(K?(De&G)===G:(l&G)===G){G!==0&&G===di&&(Nu=!0),Z!==null&&(Z=Z.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ue=e,ge=k;G=n;var Xe=s;switch(ge.tag){case 1:if(ue=ge.payload,typeof ue=="function"){ee=ue.call(Xe,ee,G);break e}ee=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ge.payload,G=typeof ue=="function"?ue.call(Xe,ee,G):ue,G==null)break e;ee=y({},ee,G);break e;case 2:Ma=!0}}G=k.callback,G!==null&&(e.flags|=64,K&&(e.flags|=8192),K=f.callbacks,K===null?f.callbacks=[G]:K.push(G))}else K={lane:G,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Z===null?(H=Z=K,A=ee):Z=Z.next=K,_|=G;if(k=k.next,k===null){if(k=f.shared.pending,k===null)break;K=k,k=K.next,K.next=null,f.lastBaseUpdate=K,f.shared.pending=null}}while(!0);Z===null&&(A=ee),f.baseState=A,f.firstBaseUpdate=H,f.lastBaseUpdate=Z,h===null&&(f.shared.lanes=0),za|=_,e.lanes=_,e.memoizedState=ee}}function dm(e,n){if(typeof e!="function")throw Error(o(191,e));e.call(n)}function fm(e,n){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)dm(s[e],n)}var mi=ie(null),er=ie(0);function hm(e,n){e=ha,re(er,e),re(mi,n),ha=e|n.baseLanes}function ju(){re(er,ha),re(mi,mi.current)}function wu(){ha=er.current,be(mi),be(er)}var sn=ie(null),kn=null;function Ba(e){var n=e.alternate;re(mt,mt.current&1),re(sn,e),kn===null&&(n===null||mi.current!==null||n.memoizedState!==null)&&(kn=e)}function Au(e){re(mt,mt.current),re(sn,e),kn===null&&(kn=e)}function pm(e){e.tag===22?(re(mt,mt.current),re(sn,e),kn===null&&(kn=e)):Ia()}function Ia(){re(mt,mt.current),re(sn,sn.current)}function on(e){be(sn),kn===e&&(kn=null),be(mt)}var mt=ie(0);function tr(e){for(var n=e;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Id(s)||Ld(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ia=0,ke=null,Ye=null,xt=null,nr=!1,gi=!1,_s=!1,ar=0,ko=0,vi=null,I1=0;function dt(){throw Error(o(321))}function Du(e,n){if(n===null)return!1;for(var s=0;s<n.length&&s<e.length;s++)if(!nn(e[s],n[s]))return!1;return!0}function Mu(e,n,s,l,f,h){return ia=h,ke=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,I.H=e===null||e.memoizedState===null?Qm:Ku,_s=!1,h=s(l,f),_s=!1,gi&&(h=gm(n,s,l,f)),mm(e),h}function mm(e){I.H=No;var n=Ye!==null&&Ye.next!==null;if(ia=0,xt=Ye=ke=null,nr=!1,ko=0,vi=null,n)throw Error(o(300));e===null||_t||(e=e.dependencies,e!==null&&Kl(e)&&(_t=!0))}function gm(e,n,s,l){ke=e;var f=0;do{if(gi&&(vi=null),ko=0,gi=!1,25<=f)throw Error(o(301));if(f+=1,xt=Ye=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}I.H=Wm,h=n(s,l)}while(gi);return h}function L1(){var e=I.H,n=e.useState()[0];return n=typeof n.then=="function"?Co(n):n,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(ke.flags|=1024),n}function Ru(){var e=ar!==0;return ar=0,e}function Ou(e,n,s){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~s}function Bu(e){if(nr){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}nr=!1}ia=0,xt=Ye=ke=null,gi=!1,ko=ar=0,vi=null}function $t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?ke.memoizedState=xt=e:xt=xt.next=e,xt}function gt(){if(Ye===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var n=xt===null?ke.memoizedState:xt.next;if(n!==null)xt=n,Ye=e;else{if(e===null)throw ke.alternate===null?Error(o(467)):Error(o(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},xt===null?ke.memoizedState=xt=e:xt=xt.next=e}return xt}function sr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Co(e){var n=ko;return ko+=1,vi===null&&(vi=[]),e=om(vi,e,n),n=ke,(xt===null?n.memoizedState:xt.next)===null&&(n=n.alternate,I.H=n===null||n.memoizedState===null?Qm:Ku),e}function ir(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Co(e);if(e.$$typeof===D)return Bt(e)}throw Error(o(438,String(e)))}function Iu(e){var n=null,s=ke.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var l=ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(n={data:l.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=sr(),ke.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(e),l=0;l<e;l++)s[l]=X;return n.index++,s}function oa(e,n){return typeof n=="function"?n(e):n}function or(e){var n=gt();return Lu(n,Ye,e)}function Lu(e,n,s){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=s;var f=e.baseQueue,h=l.pending;if(h!==null){if(f!==null){var _=f.next;f.next=h.next,h.next=_}n.baseQueue=f=h,l.pending=null}if(h=e.baseState,f===null)e.memoizedState=h;else{n=f.next;var k=_=null,A=null,H=n,Z=!1;do{var ee=H.lane&-536870913;if(ee!==H.lane?(De&ee)===ee:(ia&ee)===ee){var G=H.revertLane;if(G===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),ee===di&&(Z=!0);else if((ia&G)===G){H=H.next,G===di&&(Z=!0);continue}else ee={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},A===null?(k=A=ee,_=h):A=A.next=ee,ke.lanes|=G,za|=G;ee=H.action,_s&&s(h,ee),h=H.hasEagerState?H.eagerState:s(h,ee)}else G={lane:ee,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},A===null?(k=A=G,_=h):A=A.next=G,ke.lanes|=ee,za|=ee;H=H.next}while(H!==null&&H!==n);if(A===null?_=h:A.next=k,!nn(h,e.memoizedState)&&(_t=!0,Z&&(s=fi,s!==null)))throw s;e.memoizedState=h,e.baseState=_,e.baseQueue=A,l.lastRenderedState=h}return f===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Uu(e){var n=gt(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var l=s.dispatch,f=s.pending,h=n.memoizedState;if(f!==null){s.pending=null;var _=f=f.next;do h=e(h,_.action),_=_.next;while(_!==f);nn(h,n.memoizedState)||(_t=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),s.lastRenderedState=h}return[h,l]}function vm(e,n,s){var l=ke,f=gt(),h=Re;if(h){if(s===void 0)throw Error(o(407));s=s()}else s=n();var _=!nn((Ye||f).memoizedState,s);if(_&&(f.memoizedState=s,_t=!0),f=f.queue,Hu(xm.bind(null,l,f,e),[e]),f.getSnapshot!==n||_||xt!==null&&xt.memoizedState.tag&1){if(l.flags|=2048,yi(9,{destroy:void 0},bm.bind(null,l,f,s,n),null),We===null)throw Error(o(349));h||(ia&127)!==0||ym(l,n,s)}return s}function ym(e,n,s){e.flags|=16384,e={getSnapshot:n,value:s},n=ke.updateQueue,n===null?(n=sr(),ke.updateQueue=n,n.stores=[e]):(s=n.stores,s===null?n.stores=[e]:s.push(e))}function bm(e,n,s,l){n.value=s,n.getSnapshot=l,_m(n)&&Sm(e)}function xm(e,n,s){return s(function(){_m(n)&&Sm(e)})}function _m(e){var n=e.getSnapshot;e=e.value;try{var s=n();return!nn(e,s)}catch{return!0}}function Sm(e){var n=fs(e,2);n!==null&&Jt(n,e,2)}function zu(e){var n=$t();if(typeof e=="function"){var s=e;if(e=s(),_s){tt(!0);try{s()}finally{tt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:e},n}function Tm(e,n,s,l){return e.baseState=s,Lu(e,Ye,typeof l=="function"?l:oa)}function U1(e,n,s,l,f){if(cr(e))throw Error(o(485));if(e=n.action,e!==null){var h={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){h.listeners.push(_)}};I.T!==null?s(!0):h.isTransition=!1,l(h),s=n.pending,s===null?(h.next=n.pending=h,km(n,h)):(h.next=s.next,n.pending=s.next=h)}}function km(e,n){var s=n.action,l=n.payload,f=e.state;if(n.isTransition){var h=I.T,_={};I.T=_;try{var k=s(f,l),A=I.S;A!==null&&A(_,k),Cm(e,n,k)}catch(H){Vu(e,n,H)}finally{h!==null&&_.types!==null&&(h.types=_.types),I.T=h}}else try{h=s(f,l),Cm(e,n,h)}catch(H){Vu(e,n,H)}}function Cm(e,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Em(e,n,l)},function(l){return Vu(e,n,l)}):Em(e,n,s)}function Em(e,n,s){n.status="fulfilled",n.value=s,Nm(n),e.state=s,n=e.pending,n!==null&&(s=n.next,s===n?e.pending=null:(s=s.next,n.next=s,km(e,s)))}function Vu(e,n,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=s,Nm(n),n=n.next;while(n!==l)}e.action=null}function Nm(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function jm(e,n){return n}function wm(e,n){if(Re){var s=We.formState;if(s!==null){e:{var l=ke;if(Re){if(nt){t:{for(var f=nt,h=Tn;f.nodeType!==8;){if(!h){f=null;break t}if(f=Cn(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){nt=Cn(f.nextSibling),l=f.data==="F!";break e}}Aa(l)}l=!1}l&&(n=s[0])}}return s=$t(),s.memoizedState=s.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jm,lastRenderedState:n},s.queue=l,s=Ym.bind(null,ke,l),l.dispatch=s,l=zu(!1),h=qu.bind(null,ke,!1,l.queue),l=$t(),f={state:n,dispatch:null,action:e,pending:null},l.queue=f,s=U1.bind(null,ke,f,h,s),f.dispatch=s,l.memoizedState=e,[n,s,!1]}function Am(e){var n=gt();return Dm(n,Ye,e)}function Dm(e,n,s){if(n=Lu(e,n,jm)[0],e=or(oa)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=Co(n)}catch(_){throw _===hi?Xl:_}else l=n;n=gt();var f=n.queue,h=f.dispatch;return s!==n.memoizedState&&(ke.flags|=2048,yi(9,{destroy:void 0},z1.bind(null,f,s),null)),[l,h,e]}function z1(e,n){e.action=n}function Mm(e){var n=gt(),s=Ye;if(s!==null)return Dm(n,s,e);gt(),n=n.memoizedState,s=gt();var l=s.queue.dispatch;return s.memoizedState=e,[n,l,!1]}function yi(e,n,s,l){return e={tag:e,create:s,deps:l,inst:n,next:null},n=ke.updateQueue,n===null&&(n=sr(),ke.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,n.lastEffect=e),e}function Rm(){return gt().memoizedState}function lr(e,n,s,l){var f=$t();ke.flags|=e,f.memoizedState=yi(1|n,{destroy:void 0},s,l===void 0?null:l)}function rr(e,n,s,l){var f=gt();l=l===void 0?null:l;var h=f.memoizedState.inst;Ye!==null&&l!==null&&Du(l,Ye.memoizedState.deps)?f.memoizedState=yi(n,h,s,l):(ke.flags|=e,f.memoizedState=yi(1|n,h,s,l))}function Om(e,n){lr(8390656,8,e,n)}function Hu(e,n){rr(2048,8,e,n)}function V1(e){ke.flags|=4;var n=ke.updateQueue;if(n===null)n=sr(),ke.updateQueue=n,n.events=[e];else{var s=n.events;s===null?n.events=[e]:s.push(e)}}function Bm(e){var n=gt().memoizedState;return V1({ref:n,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}function Im(e,n){return rr(4,2,e,n)}function Lm(e,n){return rr(4,4,e,n)}function Um(e,n){if(typeof n=="function"){e=e();var s=n(e);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function zm(e,n,s){s=s!=null?s.concat([e]):null,rr(4,4,Um.bind(null,n,e),s)}function Pu(){}function Vm(e,n){var s=gt();n=n===void 0?null:n;var l=s.memoizedState;return n!==null&&Du(n,l[1])?l[0]:(s.memoizedState=[e,n],e)}function Hm(e,n){var s=gt();n=n===void 0?null:n;var l=s.memoizedState;if(n!==null&&Du(n,l[1]))return l[0];if(l=e(),_s){tt(!0);try{e()}finally{tt(!1)}}return s.memoizedState=[l,n],l}function Gu(e,n,s){return s===void 0||(ia&1073741824)!==0&&(De&261930)===0?e.memoizedState=n:(e.memoizedState=s,e=Pg(),ke.lanes|=e,za|=e,s)}function Pm(e,n,s,l){return nn(s,n)?s:mi.current!==null?(e=Gu(e,s,l),nn(e,n)||(_t=!0),e):(ia&42)===0||(ia&1073741824)!==0&&(De&261930)===0?(_t=!0,e.memoizedState=s):(e=Pg(),ke.lanes|=e,za|=e,n)}function Gm(e,n,s,l,f){var h=Y.p;Y.p=h!==0&&8>h?h:8;var _=I.T,k={};I.T=k,qu(e,!1,n,s);try{var A=f(),H=I.S;if(H!==null&&H(k,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var Z=B1(A,l);Eo(e,n,Z,cn(e))}else Eo(e,n,l,cn(e))}catch(ee){Eo(e,n,{then:function(){},status:"rejected",reason:ee},cn())}finally{Y.p=h,_!==null&&k.types!==null&&(_.types=k.types),I.T=_}}function H1(){}function $u(e,n,s,l){if(e.tag!==5)throw Error(o(476));var f=$m(e).queue;Gm(e,f,n,oe,s===null?H1:function(){return Fm(e),s(l)})}function $m(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:oe},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:s},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Fm(e){var n=$m(e);n.next===null&&(n=e.alternate.memoizedState),Eo(e,n.next.queue,{},cn())}function Fu(){return Bt(Go)}function qm(){return gt().memoizedState}function Km(){return gt().memoizedState}function P1(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var s=cn();e=Ra(s);var l=Oa(n,e,s);l!==null&&(Jt(l,n,s),_o(l,n,s)),n={cache:xu()},e.payload=n;return}n=n.return}}function G1(e,n,s){var l=cn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},cr(e)?Zm(n,s):(s=cu(e,n,s,l),s!==null&&(Jt(s,e,l),Xm(s,n,l)))}function Ym(e,n,s){var l=cn();Eo(e,n,s,l)}function Eo(e,n,s,l){var f={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(cr(e))Zm(n,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var _=n.lastRenderedState,k=h(_,s);if(f.hasEagerState=!0,f.eagerState=k,nn(k,_))return Gl(e,n,f,0),We===null&&Pl(),!1}catch{}finally{}if(s=cu(e,n,f,l),s!==null)return Jt(s,e,l),Xm(s,n,l),!0}return!1}function qu(e,n,s,l){if(l={lane:2,revertLane:kd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},cr(e)){if(n)throw Error(o(479))}else n=cu(e,s,l,2),n!==null&&Jt(n,e,2)}function cr(e){var n=e.alternate;return e===ke||n!==null&&n===ke}function Zm(e,n){gi=nr=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function Xm(e,n,s){if((s&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,s|=l,n.lanes=s,tp(e,s)}}var No={readContext:Bt,use:ir,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt,useHostTransitionStatus:dt,useFormState:dt,useActionState:dt,useOptimistic:dt,useMemoCache:dt,useCacheRefresh:dt};No.useEffectEvent=dt;var Qm={readContext:Bt,use:ir,useCallback:function(e,n){return $t().memoizedState=[e,n===void 0?null:n],e},useContext:Bt,useEffect:Om,useImperativeHandle:function(e,n,s){s=s!=null?s.concat([e]):null,lr(4194308,4,Um.bind(null,n,e),s)},useLayoutEffect:function(e,n){return lr(4194308,4,e,n)},useInsertionEffect:function(e,n){lr(4,2,e,n)},useMemo:function(e,n){var s=$t();n=n===void 0?null:n;var l=e();if(_s){tt(!0);try{e()}finally{tt(!1)}}return s.memoizedState=[l,n],l},useReducer:function(e,n,s){var l=$t();if(s!==void 0){var f=s(n);if(_s){tt(!0);try{s(n)}finally{tt(!1)}}}else f=n;return l.memoizedState=l.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},l.queue=e,e=e.dispatch=G1.bind(null,ke,e),[l.memoizedState,e]},useRef:function(e){var n=$t();return e={current:e},n.memoizedState=e},useState:function(e){e=zu(e);var n=e.queue,s=Ym.bind(null,ke,n);return n.dispatch=s,[e.memoizedState,s]},useDebugValue:Pu,useDeferredValue:function(e,n){var s=$t();return Gu(s,e,n)},useTransition:function(){var e=zu(!1);return e=Gm.bind(null,ke,e.queue,!0,!1),$t().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,s){var l=ke,f=$t();if(Re){if(s===void 0)throw Error(o(407));s=s()}else{if(s=n(),We===null)throw Error(o(349));(De&127)!==0||ym(l,n,s)}f.memoizedState=s;var h={value:s,getSnapshot:n};return f.queue=h,Om(xm.bind(null,l,h,e),[e]),l.flags|=2048,yi(9,{destroy:void 0},bm.bind(null,l,h,s,n),null),s},useId:function(){var e=$t(),n=We.identifierPrefix;if(Re){var s=Vn,l=zn;s=(l&~(1<<32-Pe(l)-1)).toString(32)+s,n="_"+n+"R_"+s,s=ar++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=I1++,n="_"+n+"r_"+s.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Fu,useFormState:wm,useActionState:wm,useOptimistic:function(e){var n=$t();n.memoizedState=n.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=qu.bind(null,ke,!0,s),s.dispatch=n,[e,n]},useMemoCache:Iu,useCacheRefresh:function(){return $t().memoizedState=P1.bind(null,ke)},useEffectEvent:function(e){var n=$t(),s={impl:e};return n.memoizedState=s,function(){if((Ve&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Ku={readContext:Bt,use:ir,useCallback:Vm,useContext:Bt,useEffect:Hu,useImperativeHandle:zm,useInsertionEffect:Im,useLayoutEffect:Lm,useMemo:Hm,useReducer:or,useRef:Rm,useState:function(){return or(oa)},useDebugValue:Pu,useDeferredValue:function(e,n){var s=gt();return Pm(s,Ye.memoizedState,e,n)},useTransition:function(){var e=or(oa)[0],n=gt().memoizedState;return[typeof e=="boolean"?e:Co(e),n]},useSyncExternalStore:vm,useId:qm,useHostTransitionStatus:Fu,useFormState:Am,useActionState:Am,useOptimistic:function(e,n){var s=gt();return Tm(s,Ye,e,n)},useMemoCache:Iu,useCacheRefresh:Km};Ku.useEffectEvent=Bm;var Wm={readContext:Bt,use:ir,useCallback:Vm,useContext:Bt,useEffect:Hu,useImperativeHandle:zm,useInsertionEffect:Im,useLayoutEffect:Lm,useMemo:Hm,useReducer:Uu,useRef:Rm,useState:function(){return Uu(oa)},useDebugValue:Pu,useDeferredValue:function(e,n){var s=gt();return Ye===null?Gu(s,e,n):Pm(s,Ye.memoizedState,e,n)},useTransition:function(){var e=Uu(oa)[0],n=gt().memoizedState;return[typeof e=="boolean"?e:Co(e),n]},useSyncExternalStore:vm,useId:qm,useHostTransitionStatus:Fu,useFormState:Mm,useActionState:Mm,useOptimistic:function(e,n){var s=gt();return Ye!==null?Tm(s,Ye,e,n):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Iu,useCacheRefresh:Km};Wm.useEffectEvent=Bm;function Yu(e,n,s,l){n=e.memoizedState,s=s(l,n),s=s==null?n:y({},n,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Zu={enqueueSetState:function(e,n,s){e=e._reactInternals;var l=cn(),f=Ra(l);f.payload=n,s!=null&&(f.callback=s),n=Oa(e,f,l),n!==null&&(Jt(n,e,l),_o(n,e,l))},enqueueReplaceState:function(e,n,s){e=e._reactInternals;var l=cn(),f=Ra(l);f.tag=1,f.payload=n,s!=null&&(f.callback=s),n=Oa(e,f,l),n!==null&&(Jt(n,e,l),_o(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var s=cn(),l=Ra(s);l.tag=2,n!=null&&(l.callback=n),n=Oa(e,l,s),n!==null&&(Jt(n,e,s),_o(n,e,s))}};function Jm(e,n,s,l,f,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,_):n.prototype&&n.prototype.isPureReactComponent?!ho(s,l)||!ho(f,h):!0}function eg(e,n,s,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,l),n.state!==e&&Zu.enqueueReplaceState(n,n.state,null)}function Ss(e,n){var s=n;if("ref"in n){s={};for(var l in n)l!=="ref"&&(s[l]=n[l])}if(e=e.defaultProps){s===n&&(s=y({},s));for(var f in e)s[f]===void 0&&(s[f]=e[f])}return s}function tg(e){Hl(e)}function ng(e){console.error(e)}function ag(e){Hl(e)}function ur(e,n){try{var s=e.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function sg(e,n,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Xu(e,n,s){return s=Ra(s),s.tag=3,s.payload={element:null},s.callback=function(){ur(e,n)},s}function ig(e){return e=Ra(e),e.tag=3,e}function og(e,n,s,l){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var h=l.value;e.payload=function(){return f(h)},e.callback=function(){sg(n,s,l)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){sg(n,s,l),typeof f!="function"&&(Va===null?Va=new Set([this]):Va.add(this));var k=l.stack;this.componentDidCatch(l.value,{componentStack:k!==null?k:""})})}function $1(e,n,s,l,f){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=s.alternate,n!==null&&ui(n,s,f,!0),s=sn.current,s!==null){switch(s.tag){case 31:case 13:return kn===null?Sr():s.alternate===null&&ft===0&&(ft=3),s.flags&=-257,s.flags|=65536,s.lanes=f,l===Ql?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([l]):n.add(l),_d(e,l,f)),!1;case 22:return s.flags|=65536,l===Ql?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([l]):s.add(l)),_d(e,l,f)),!1}throw Error(o(435,s.tag))}return _d(e,l,f),Sr(),!1}if(Re)return n=sn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,l!==mu&&(e=Error(o(422),{cause:l}),go(xn(e,s)))):(l!==mu&&(n=Error(o(423),{cause:l}),go(xn(n,s))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,l=xn(l,s),f=Xu(e.stateNode,l,f),Eu(e,f),ft!==4&&(ft=2)),!1;var h=Error(o(520),{cause:l});if(h=xn(h,s),Bo===null?Bo=[h]:Bo.push(h),ft!==4&&(ft=2),n===null)return!0;l=xn(l,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,e=f&-f,s.lanes|=e,e=Xu(s.stateNode,l,e),Eu(s,e),!1;case 1:if(n=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Va===null||!Va.has(h))))return s.flags|=65536,f&=-f,s.lanes|=f,f=ig(f),og(f,e,s,l),Eu(s,f),!1}s=s.return}while(s!==null);return!1}var Qu=Error(o(461)),_t=!1;function It(e,n,s,l){n.child=e===null?um(n,null,s,l):xs(n,e.child,s,l)}function lg(e,n,s,l,f){s=s.render;var h=n.ref;if("ref"in l){var _={};for(var k in l)k!=="ref"&&(_[k]=l[k])}else _=l;return gs(n),l=Mu(e,n,s,_,h,f),k=Ru(),e!==null&&!_t?(Ou(e,n,f),la(e,n,f)):(Re&&k&&hu(n),n.flags|=1,It(e,n,l,f),n.child)}function rg(e,n,s,l,f){if(e===null){var h=s.type;return typeof h=="function"&&!uu(h)&&h.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=h,cg(e,n,h,l,f)):(e=Fl(s.type,null,l,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!id(e,f)){var _=h.memoizedProps;if(s=s.compare,s=s!==null?s:ho,s(_,l)&&e.ref===n.ref)return la(e,n,f)}return n.flags|=1,e=ta(h,l),e.ref=n.ref,e.return=n,n.child=e}function cg(e,n,s,l,f){if(e!==null){var h=e.memoizedProps;if(ho(h,l)&&e.ref===n.ref)if(_t=!1,n.pendingProps=l=h,id(e,f))(e.flags&131072)!==0&&(_t=!0);else return n.lanes=e.lanes,la(e,n,f)}return Wu(e,n,s,l,f)}function ug(e,n,s,l){var f=l.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(l=n.child=e.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~h}else l=0,n.child=null;return dg(e,n,h,s,l)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Zl(n,h!==null?h.cachePool:null),h!==null?hm(n,h):ju(),pm(n);else return l=n.lanes=536870912,dg(e,n,h!==null?h.baseLanes|s:s,s,l)}else h!==null?(Zl(n,h.cachePool),hm(n,h),Ia(),n.memoizedState=null):(e!==null&&Zl(n,null),ju(),Ia());return It(e,n,f,s),n.child}function jo(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function dg(e,n,s,l,f){var h=Su();return h=h===null?null:{parent:bt._currentValue,pool:h},n.memoizedState={baseLanes:s,cachePool:h},e!==null&&Zl(n,null),ju(),pm(n),e!==null&&ui(e,n,l,!0),n.childLanes=f,null}function dr(e,n){return n=hr({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function fg(e,n,s){return xs(n,e.child,null,s),e=dr(n,n.pendingProps),e.flags|=2,on(n),n.memoizedState=null,e}function F1(e,n,s){var l=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Re){if(l.mode==="hidden")return e=dr(n,l),n.lanes=536870912,jo(null,e);if(Au(n),(e=nt)?(e=kv(e,Tn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ja!==null?{id:zn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},s=Zp(e),s.return=n,n.child=s,Ot=n,nt=null)):e=null,e===null)throw Aa(n);return n.lanes=536870912,null}return dr(n,l)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(Au(n),f)if(n.flags&256)n.flags&=-257,n=fg(e,n,s);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(o(558));else if(_t||ui(e,n,s,!1),f=(s&e.childLanes)!==0,_t||f){if(l=We,l!==null&&(_=np(l,s),_!==0&&_!==h.retryLane))throw h.retryLane=_,fs(e,_),Jt(l,e,_),Qu;Sr(),n=fg(e,n,s)}else e=h.treeContext,nt=Cn(_.nextSibling),Ot=n,Re=!0,wa=null,Tn=!1,e!==null&&Wp(n,e),n=dr(n,l),n.flags|=4096;return n}return e=ta(e.child,{mode:l.mode,children:l.children}),e.ref=n.ref,n.child=e,e.return=n,e}function fr(e,n){var s=n.ref;if(s===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(n.flags|=4194816)}}function Wu(e,n,s,l,f){return gs(n),s=Mu(e,n,s,l,void 0,f),l=Ru(),e!==null&&!_t?(Ou(e,n,f),la(e,n,f)):(Re&&l&&hu(n),n.flags|=1,It(e,n,s,f),n.child)}function hg(e,n,s,l,f,h){return gs(n),n.updateQueue=null,s=gm(n,l,s,f),mm(e),l=Ru(),e!==null&&!_t?(Ou(e,n,h),la(e,n,h)):(Re&&l&&hu(n),n.flags|=1,It(e,n,s,h),n.child)}function pg(e,n,s,l,f){if(gs(n),n.stateNode===null){var h=oi,_=s.contextType;typeof _=="object"&&_!==null&&(h=Bt(_)),h=new s(l,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Zu,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=l,h.state=n.memoizedState,h.refs={},ku(n),_=s.contextType,h.context=typeof _=="object"&&_!==null?Bt(_):oi,h.state=n.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Yu(n,s,_,l),h.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(_=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),_!==h.state&&Zu.enqueueReplaceState(h,h.state,null),To(n,l,h,f),So(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(e===null){h=n.stateNode;var k=n.memoizedProps,A=Ss(s,k);h.props=A;var H=h.context,Z=s.contextType;_=oi,typeof Z=="object"&&Z!==null&&(_=Bt(Z));var ee=s.getDerivedStateFromProps;Z=typeof ee=="function"||typeof h.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,Z||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(k||H!==_)&&eg(n,h,l,_),Ma=!1;var G=n.memoizedState;h.state=G,To(n,l,h,f),So(),H=n.memoizedState,k||G!==H||Ma?(typeof ee=="function"&&(Yu(n,s,ee,l),H=n.memoizedState),(A=Ma||Jm(n,s,A,l,G,H,_))?(Z||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=H),h.props=l,h.state=H,h.context=_,l=A):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{h=n.stateNode,Cu(e,n),_=n.memoizedProps,Z=Ss(s,_),h.props=Z,ee=n.pendingProps,G=h.context,H=s.contextType,A=oi,typeof H=="object"&&H!==null&&(A=Bt(H)),k=s.getDerivedStateFromProps,(H=typeof k=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==ee||G!==A)&&eg(n,h,l,A),Ma=!1,G=n.memoizedState,h.state=G,To(n,l,h,f),So();var K=n.memoizedState;_!==ee||G!==K||Ma||e!==null&&e.dependencies!==null&&Kl(e.dependencies)?(typeof k=="function"&&(Yu(n,s,k,l),K=n.memoizedState),(Z=Ma||Jm(n,s,Z,l,G,K,A)||e!==null&&e.dependencies!==null&&Kl(e.dependencies))?(H||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,K,A),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,K,A)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=K),h.props=l,h.state=K,h.context=A,l=Z):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),l=!1)}return h=l,fr(e,n),l=(n.flags&128)!==0,h||l?(h=n.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&l?(n.child=xs(n,e.child,null,f),n.child=xs(n,null,s,f)):It(e,n,s,f),n.memoizedState=h.state,e=n.child):e=la(e,n,f),e}function mg(e,n,s,l){return ps(),n.flags|=256,It(e,n,s,l),n.child}var Ju={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ed(e){return{baseLanes:e,cachePool:sm()}}function td(e,n,s){return e=e!==null?e.childLanes&~s:0,n&&(e|=rn),e}function gg(e,n,s){var l=n.pendingProps,f=!1,h=(n.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(mt.current&2)!==0),_&&(f=!0,n.flags&=-129),_=(n.flags&32)!==0,n.flags&=-33,e===null){if(Re){if(f?Ba(n):Ia(),(e=nt)?(e=kv(e,Tn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ja!==null?{id:zn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},s=Zp(e),s.return=n,n.child=s,Ot=n,nt=null)):e=null,e===null)throw Aa(n);return Ld(e)?n.lanes=32:n.lanes=536870912,null}var k=l.children;return l=l.fallback,f?(Ia(),f=n.mode,k=hr({mode:"hidden",children:k},f),l=hs(l,f,s,null),k.return=n,l.return=n,k.sibling=l,n.child=k,l=n.child,l.memoizedState=ed(s),l.childLanes=td(e,_,s),n.memoizedState=Ju,jo(null,l)):(Ba(n),nd(n,k))}var A=e.memoizedState;if(A!==null&&(k=A.dehydrated,k!==null)){if(h)n.flags&256?(Ba(n),n.flags&=-257,n=ad(e,n,s)):n.memoizedState!==null?(Ia(),n.child=e.child,n.flags|=128,n=null):(Ia(),k=l.fallback,f=n.mode,l=hr({mode:"visible",children:l.children},f),k=hs(k,f,s,null),k.flags|=2,l.return=n,k.return=n,l.sibling=k,n.child=l,xs(n,e.child,null,s),l=n.child,l.memoizedState=ed(s),l.childLanes=td(e,_,s),n.memoizedState=Ju,n=jo(null,l));else if(Ba(n),Ld(k)){if(_=k.nextSibling&&k.nextSibling.dataset,_)var H=_.dgst;_=H,l=Error(o(419)),l.stack="",l.digest=_,go({value:l,source:null,stack:null}),n=ad(e,n,s)}else if(_t||ui(e,n,s,!1),_=(s&e.childLanes)!==0,_t||_){if(_=We,_!==null&&(l=np(_,s),l!==0&&l!==A.retryLane))throw A.retryLane=l,fs(e,l),Jt(_,e,l),Qu;Id(k)||Sr(),n=ad(e,n,s)}else Id(k)?(n.flags|=192,n.child=e.child,n=null):(e=A.treeContext,nt=Cn(k.nextSibling),Ot=n,Re=!0,wa=null,Tn=!1,e!==null&&Wp(n,e),n=nd(n,l.children),n.flags|=4096);return n}return f?(Ia(),k=l.fallback,f=n.mode,A=e.child,H=A.sibling,l=ta(A,{mode:"hidden",children:l.children}),l.subtreeFlags=A.subtreeFlags&65011712,H!==null?k=ta(H,k):(k=hs(k,f,s,null),k.flags|=2),k.return=n,l.return=n,l.sibling=k,n.child=l,jo(null,l),l=n.child,k=e.child.memoizedState,k===null?k=ed(s):(f=k.cachePool,f!==null?(A=bt._currentValue,f=f.parent!==A?{parent:A,pool:A}:f):f=sm(),k={baseLanes:k.baseLanes|s,cachePool:f}),l.memoizedState=k,l.childLanes=td(e,_,s),n.memoizedState=Ju,jo(e.child,l)):(Ba(n),s=e.child,e=s.sibling,s=ta(s,{mode:"visible",children:l.children}),s.return=n,s.sibling=null,e!==null&&(_=n.deletions,_===null?(n.deletions=[e],n.flags|=16):_.push(e)),n.child=s,n.memoizedState=null,s)}function nd(e,n){return n=hr({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function hr(e,n){return e=an(22,e,null,n),e.lanes=0,e}function ad(e,n,s){return xs(n,e.child,null,s),e=nd(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function vg(e,n,s){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),yu(e.return,n,s)}function sd(e,n,s,l,f,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:f,treeForkCount:h}:(_.isBackwards=n,_.rendering=null,_.renderingStartTime=0,_.last=l,_.tail=s,_.tailMode=f,_.treeForkCount=h)}function yg(e,n,s){var l=n.pendingProps,f=l.revealOrder,h=l.tail;l=l.children;var _=mt.current,k=(_&2)!==0;if(k?(_=_&1|2,n.flags|=128):_&=1,re(mt,_),It(e,n,l,s),l=Re?mo:0,!k&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vg(e,s,n);else if(e.tag===19)vg(e,s,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(s=n.child,f=null;s!==null;)e=s.alternate,e!==null&&tr(e)===null&&(f=s),s=s.sibling;s=f,s===null?(f=n.child,n.child=null):(f=s.sibling,s.sibling=null),sd(n,!1,f,s,h,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&tr(e)===null){n.child=f;break}e=f.sibling,f.sibling=s,s=f,f=e}sd(n,!0,s,null,h,l);break;case"together":sd(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function la(e,n,s){if(e!==null&&(n.dependencies=e.dependencies),za|=n.lanes,(s&n.childLanes)===0)if(e!==null){if(ui(e,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(o(153));if(n.child!==null){for(e=n.child,s=ta(e,e.pendingProps),n.child=s,s.return=n;e.sibling!==null;)e=e.sibling,s=s.sibling=ta(e,e.pendingProps),s.return=n;s.sibling=null}return n.child}function id(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Kl(e)))}function q1(e,n,s){switch(n.tag){case 3:mn(n,n.stateNode.containerInfo),Da(n,bt,e.memoizedState.cache),ps();break;case 27:case 5:Ln(n);break;case 4:mn(n,n.stateNode.containerInfo);break;case 10:Da(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Au(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(Ba(n),n.flags|=128,null):(s&n.child.childLanes)!==0?gg(e,n,s):(Ba(n),e=la(e,n,s),e!==null?e.sibling:null);Ba(n);break;case 19:var f=(e.flags&128)!==0;if(l=(s&n.childLanes)!==0,l||(ui(e,n,s,!1),l=(s&n.childLanes)!==0),f){if(l)return yg(e,n,s);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),re(mt,mt.current),l)break;return null;case 22:return n.lanes=0,ug(e,n,s,n.pendingProps);case 24:Da(n,bt,e.memoizedState.cache)}return la(e,n,s)}function bg(e,n,s){if(e!==null)if(e.memoizedProps!==n.pendingProps)_t=!0;else{if(!id(e,s)&&(n.flags&128)===0)return _t=!1,q1(e,n,s);_t=(e.flags&131072)!==0}else _t=!1,Re&&(n.flags&1048576)!==0&&Qp(n,mo,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(e=ys(n.elementType),n.type=e,typeof e=="function")uu(e)?(l=Ss(e,l),n.tag=1,n=pg(null,n,e,l,s)):(n.tag=0,n=Wu(null,n,e,l,s));else{if(e!=null){var f=e.$$typeof;if(f===M){n.tag=11,n=lg(null,n,e,l,s);break e}else if(f===V){n.tag=14,n=rg(null,n,e,l,s);break e}}throw n=F(e)||e,Error(o(306,n,""))}}return n;case 0:return Wu(e,n,n.type,n.pendingProps,s);case 1:return l=n.type,f=Ss(l,n.pendingProps),pg(e,n,l,f,s);case 3:e:{if(mn(n,n.stateNode.containerInfo),e===null)throw Error(o(387));l=n.pendingProps;var h=n.memoizedState;f=h.element,Cu(e,n),To(n,l,null,s);var _=n.memoizedState;if(l=_.cache,Da(n,bt,l),l!==h.cache&&bu(n,[bt],s,!0),So(),l=_.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:_.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=mg(e,n,l,s);break e}else if(l!==f){f=xn(Error(o(424)),n),go(f),n=mg(e,n,l,s);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(nt=Cn(e.firstChild),Ot=n,Re=!0,wa=null,Tn=!0,s=um(n,null,l,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ps(),l===f){n=la(e,n,s);break e}It(e,n,l,s)}n=n.child}return n;case 26:return fr(e,n),e===null?(s=Av(n.type,null,n.pendingProps,null))?n.memoizedState=s:Re||(s=n.type,e=n.pendingProps,l=wr(fe.current).createElement(s),l[Rt]=n,l[Kt]=e,Lt(l,s,e),wt(l),n.stateNode=l):n.memoizedState=Av(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Ln(n),e===null&&Re&&(l=n.stateNode=Nv(n.type,n.pendingProps,fe.current),Ot=n,Tn=!0,f=nt,$a(n.type)?(Ud=f,nt=Cn(l.firstChild)):nt=f),It(e,n,n.pendingProps.children,s),fr(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Re&&((f=l=nt)&&(l=SS(l,n.type,n.pendingProps,Tn),l!==null?(n.stateNode=l,Ot=n,nt=Cn(l.firstChild),Tn=!1,f=!0):f=!1),f||Aa(n)),Ln(n),f=n.type,h=n.pendingProps,_=e!==null?e.memoizedProps:null,l=h.children,Rd(f,h)?l=null:_!==null&&Rd(f,_)&&(n.flags|=32),n.memoizedState!==null&&(f=Mu(e,n,L1,null,null,s),Go._currentValue=f),fr(e,n),It(e,n,l,s),n.child;case 6:return e===null&&Re&&((e=s=nt)&&(s=TS(s,n.pendingProps,Tn),s!==null?(n.stateNode=s,Ot=n,nt=null,e=!0):e=!1),e||Aa(n)),null;case 13:return gg(e,n,s);case 4:return mn(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=xs(n,null,l,s):It(e,n,l,s),n.child;case 11:return lg(e,n,n.type,n.pendingProps,s);case 7:return It(e,n,n.pendingProps,s),n.child;case 8:return It(e,n,n.pendingProps.children,s),n.child;case 12:return It(e,n,n.pendingProps.children,s),n.child;case 10:return l=n.pendingProps,Da(n,n.type,l.value),It(e,n,l.children,s),n.child;case 9:return f=n.type._context,l=n.pendingProps.children,gs(n),f=Bt(f),l=l(f),n.flags|=1,It(e,n,l,s),n.child;case 14:return rg(e,n,n.type,n.pendingProps,s);case 15:return cg(e,n,n.type,n.pendingProps,s);case 19:return yg(e,n,s);case 31:return F1(e,n,s);case 22:return ug(e,n,s,n.pendingProps);case 24:return gs(n),l=Bt(bt),e===null?(f=Su(),f===null&&(f=We,h=xu(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=s),f=h),n.memoizedState={parent:l,cache:f},ku(n),Da(n,bt,f)):((e.lanes&s)!==0&&(Cu(e,n),To(n,null,null,s),So()),f=e.memoizedState,h=n.memoizedState,f.parent!==l?(f={parent:l,cache:l},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),Da(n,bt,l)):(l=h.cache,Da(n,bt,l),l!==f.cache&&bu(n,[bt],s,!0))),It(e,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(o(156,n.tag))}function ra(e){e.flags|=4}function od(e,n,s,l,f){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(qg())e.flags|=8192;else throw bs=Ql,Tu}else e.flags&=-16777217}function xg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Bv(n))if(qg())e.flags|=8192;else throw bs=Ql,Tu}function pr(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Jh():536870912,e.lanes|=n,Si|=n)}function wo(e,n){if(!Re)switch(e.tailMode){case"hidden":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function at(e){var n=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(n)for(var f=e.child;f!==null;)s|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)s|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=s,n}function K1(e,n,s){var l=n.pendingProps;switch(pu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(n),null;case 1:return at(n),null;case 3:return s=n.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),sa(bt),Mn(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ci(n)?ra(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,gu())),at(n),null;case 26:var f=n.type,h=n.memoizedState;return e===null?(ra(n),h!==null?(at(n),xg(n,h)):(at(n),od(n,f,null,l,s))):h?h!==e.memoizedState?(ra(n),at(n),xg(n,h)):(at(n),n.flags&=-16777217):(e=e.memoizedProps,e!==l&&ra(n),at(n),od(n,f,e,l,s)),null;case 27:if(Te(n),s=fe.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&ra(n);else{if(!l){if(n.stateNode===null)throw Error(o(166));return at(n),null}e=Ke.current,ci(n)?Jp(n):(e=Nv(f,l,s),n.stateNode=e,ra(n))}return at(n),null;case 5:if(Te(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&ra(n);else{if(!l){if(n.stateNode===null)throw Error(o(166));return at(n),null}if(h=Ke.current,ci(n))Jp(n);else{var _=wr(fe.current);switch(h){case 1:h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=_.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?_.createElement("select",{is:l.is}):_.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?_.createElement(f,{is:l.is}):_.createElement(f)}}h[Rt]=n,h[Kt]=l;e:for(_=n.child;_!==null;){if(_.tag===5||_.tag===6)h.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===n)break e;for(;_.sibling===null;){if(_.return===null||_.return===n)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}n.stateNode=h;e:switch(Lt(h,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ra(n)}}return at(n),od(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,s),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&ra(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(o(166));if(e=fe.current,ci(n)){if(e=n.stateNode,s=n.memoizedProps,l=null,f=Ot,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}e[Rt]=n,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||gv(e.nodeValue,s)),e||Aa(n,!0)}else e=wr(e).createTextNode(l),e[Rt]=n,n.stateNode=e}return at(n),null;case 31:if(s=n.memoizedState,e===null||e.memoizedState!==null){if(l=ci(n),s!==null){if(e===null){if(!l)throw Error(o(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Rt]=n}else ps(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;at(n),e=!1}else s=gu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return n.flags&256?(on(n),n):(on(n),null);if((n.flags&128)!==0)throw Error(o(558))}return at(n),null;case 13:if(l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=ci(n),l!==null&&l.dehydrated!==null){if(e===null){if(!f)throw Error(o(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(o(317));f[Rt]=n}else ps(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;at(n),f=!1}else f=gu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(on(n),n):(on(n),null)}return on(n),(n.flags&128)!==0?(n.lanes=s,n):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=n.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==f&&(l.flags|=2048)),s!==e&&s&&(n.child.flags|=8192),pr(n,n.updateQueue),at(n),null);case 4:return Mn(),e===null&&jd(n.stateNode.containerInfo),at(n),null;case 10:return sa(n.type),at(n),null;case 19:if(be(mt),l=n.memoizedState,l===null)return at(n),null;if(f=(n.flags&128)!==0,h=l.rendering,h===null)if(f)wo(l,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=tr(e),h!==null){for(n.flags|=128,wo(l,!1),e=h.updateQueue,n.updateQueue=e,pr(n,e),n.subtreeFlags=0,e=s,s=n.child;s!==null;)Yp(s,e),s=s.sibling;return re(mt,mt.current&1|2),Re&&na(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&zt()>br&&(n.flags|=128,f=!0,wo(l,!1),n.lanes=4194304)}else{if(!f)if(e=tr(h),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,pr(n,e),wo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Re)return at(n),null}else 2*zt()-l.renderingStartTime>br&&s!==536870912&&(n.flags|=128,f=!0,wo(l,!1),n.lanes=4194304);l.isBackwards?(h.sibling=n.child,n.child=h):(e=l.last,e!==null?e.sibling=h:n.child=h,l.last=h)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=zt(),e.sibling=null,s=mt.current,re(mt,f?s&1|2:s&1),Re&&na(n,l.treeForkCount),e):(at(n),null);case 22:case 23:return on(n),wu(),l=n.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(s&536870912)!==0&&(n.flags&128)===0&&(at(n),n.subtreeFlags&6&&(n.flags|=8192)):at(n),s=n.updateQueue,s!==null&&pr(n,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==s&&(n.flags|=2048),e!==null&&be(vs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),sa(bt),at(n),null;case 25:return null;case 30:return null}throw Error(o(156,n.tag))}function Y1(e,n){switch(pu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return sa(bt),Mn(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Te(n),null;case 31:if(n.memoizedState!==null){if(on(n),n.alternate===null)throw Error(o(340));ps()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(on(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(o(340));ps()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return be(mt),null;case 4:return Mn(),null;case 10:return sa(n.type),null;case 22:case 23:return on(n),wu(),e!==null&&be(vs),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return sa(bt),null;case 25:return null;default:return null}}function _g(e,n){switch(pu(n),n.tag){case 3:sa(bt),Mn();break;case 26:case 27:case 5:Te(n);break;case 4:Mn();break;case 31:n.memoizedState!==null&&on(n);break;case 13:on(n);break;case 19:be(mt);break;case 10:sa(n.type);break;case 22:case 23:on(n),wu(),e!==null&&be(vs);break;case 24:sa(bt)}}function Ao(e,n){try{var s=n.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var f=l.next;s=f;do{if((s.tag&e)===e){l=void 0;var h=s.create,_=s.inst;l=h(),_.destroy=l}s=s.next}while(s!==f)}}catch(k){Fe(n,n.return,k)}}function La(e,n,s){try{var l=n.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var h=f.next;l=h;do{if((l.tag&e)===e){var _=l.inst,k=_.destroy;if(k!==void 0){_.destroy=void 0,f=n;var A=s,H=k;try{H()}catch(Z){Fe(f,A,Z)}}}l=l.next}while(l!==h)}}catch(Z){Fe(n,n.return,Z)}}function Sg(e){var n=e.updateQueue;if(n!==null){var s=e.stateNode;try{fm(n,s)}catch(l){Fe(e,e.return,l)}}}function Tg(e,n,s){s.props=Ss(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){Fe(e,n,l)}}function Do(e,n){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(f){Fe(e,n,f)}}function Hn(e,n){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(f){Fe(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){Fe(e,n,f)}else s.current=null}function kg(e){var n=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(f){Fe(e,e.return,f)}}function ld(e,n,s){try{var l=e.stateNode;gS(l,e.type,s,n),l[Kt]=n}catch(f){Fe(e,e.return,f)}}function Cg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$a(e.type)||e.tag===4}function rd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&$a(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cd(e,n,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(e),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=Jn));else if(l!==4&&(l===27&&$a(e.type)&&(s=e.stateNode,n=null),e=e.child,e!==null))for(cd(e,n,s),e=e.sibling;e!==null;)cd(e,n,s),e=e.sibling}function mr(e,n,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(l!==4&&(l===27&&$a(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(mr(e,n,s),e=e.sibling;e!==null;)mr(e,n,s),e=e.sibling}function Eg(e){var n=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Lt(n,l,s),n[Rt]=e,n[Kt]=s}catch(h){Fe(e,e.return,h)}}var ca=!1,St=!1,ud=!1,Ng=typeof WeakSet=="function"?WeakSet:Set,At=null;function Z1(e,n){if(e=e.containerInfo,Dd=Ir,e=zp(e),au(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var f=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var _=0,k=-1,A=-1,H=0,Z=0,ee=e,G=null;t:for(;;){for(var K;ee!==s||f!==0&&ee.nodeType!==3||(k=_+f),ee!==h||l!==0&&ee.nodeType!==3||(A=_+l),ee.nodeType===3&&(_+=ee.nodeValue.length),(K=ee.firstChild)!==null;)G=ee,ee=K;for(;;){if(ee===e)break t;if(G===s&&++H===f&&(k=_),G===h&&++Z===l&&(A=_),(K=ee.nextSibling)!==null)break;ee=G,G=ee.parentNode}ee=K}s=k===-1||A===-1?null:{start:k,end:A}}else s=null}s=s||{start:0,end:0}}else s=null;for(Md={focusedElem:e,selectionRange:s},Ir=!1,At=n;At!==null;)if(n=At,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,At=e;else for(;At!==null;){switch(n=At,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)f=e[s],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=n,f=h.memoizedProps,h=h.memoizedState,l=s.stateNode;try{var ue=Ss(s.type,f);e=l.getSnapshotBeforeUpdate(ue,h),l.__reactInternalSnapshotBeforeUpdate=e}catch(ge){Fe(s,s.return,ge)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,s=e.nodeType,s===9)Bd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Bd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=n.sibling,e!==null){e.return=n.return,At=e;break}At=n.return}}function jg(e,n,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:da(e,s),l&4&&Ao(5,s);break;case 1:if(da(e,s),l&4)if(e=s.stateNode,n===null)try{e.componentDidMount()}catch(_){Fe(s,s.return,_)}else{var f=Ss(s.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(_){Fe(s,s.return,_)}}l&64&&Sg(s),l&512&&Do(s,s.return);break;case 3:if(da(e,s),l&64&&(e=s.updateQueue,e!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{fm(e,n)}catch(_){Fe(s,s.return,_)}}break;case 27:n===null&&l&4&&Eg(s);case 26:case 5:da(e,s),n===null&&l&4&&kg(s),l&512&&Do(s,s.return);break;case 12:da(e,s);break;case 31:da(e,s),l&4&&Dg(e,s);break;case 13:da(e,s),l&4&&Mg(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=sS.bind(null,s),kS(e,s))));break;case 22:if(l=s.memoizedState!==null||ca,!l){n=n!==null&&n.memoizedState!==null||St,f=ca;var h=St;ca=l,(St=n)&&!h?fa(e,s,(s.subtreeFlags&8772)!==0):da(e,s),ca=f,St=h}break;case 30:break;default:da(e,s)}}function wg(e){var n=e.alternate;n!==null&&(e.alternate=null,wg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Vc(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rt=null,Zt=!1;function ua(e,n,s){for(s=s.child;s!==null;)Ag(e,n,s),s=s.sibling}function Ag(e,n,s){if(Ne&&typeof Ne.onCommitFiberUnmount=="function")try{Ne.onCommitFiberUnmount(lt,s)}catch{}switch(s.tag){case 26:St||Hn(s,n),ua(e,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:St||Hn(s,n);var l=rt,f=Zt;$a(s.type)&&(rt=s.stateNode,Zt=!1),ua(e,n,s),Vo(s.stateNode),rt=l,Zt=f;break;case 5:St||Hn(s,n);case 6:if(l=rt,f=Zt,rt=null,ua(e,n,s),rt=l,Zt=f,rt!==null)if(Zt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(s.stateNode)}catch(h){Fe(s,n,h)}else try{rt.removeChild(s.stateNode)}catch(h){Fe(s,n,h)}break;case 18:rt!==null&&(Zt?(e=rt,Sv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Ai(e)):Sv(rt,s.stateNode));break;case 4:l=rt,f=Zt,rt=s.stateNode.containerInfo,Zt=!0,ua(e,n,s),rt=l,Zt=f;break;case 0:case 11:case 14:case 15:La(2,s,n),St||La(4,s,n),ua(e,n,s);break;case 1:St||(Hn(s,n),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Tg(s,n,l)),ua(e,n,s);break;case 21:ua(e,n,s);break;case 22:St=(l=St)||s.memoizedState!==null,ua(e,n,s),St=l;break;default:ua(e,n,s)}}function Dg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ai(e)}catch(s){Fe(n,n.return,s)}}}function Mg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ai(e)}catch(s){Fe(n,n.return,s)}}function X1(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Ng),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Ng),n;default:throw Error(o(435,e.tag))}}function gr(e,n){var s=X1(e);n.forEach(function(l){if(!s.has(l)){s.add(l);var f=iS.bind(null,e,l);l.then(f,f)}})}function Xt(e,n){var s=n.deletions;if(s!==null)for(var l=0;l<s.length;l++){var f=s[l],h=e,_=n,k=_;e:for(;k!==null;){switch(k.tag){case 27:if($a(k.type)){rt=k.stateNode,Zt=!1;break e}break;case 5:rt=k.stateNode,Zt=!1;break e;case 3:case 4:rt=k.stateNode.containerInfo,Zt=!0;break e}k=k.return}if(rt===null)throw Error(o(160));Ag(h,_,f),rt=null,Zt=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Rg(n,e),n=n.sibling}var On=null;function Rg(e,n){var s=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Xt(n,e),Qt(e),l&4&&(La(3,e,e.return),Ao(3,e),La(5,e,e.return));break;case 1:Xt(n,e),Qt(e),l&512&&(St||s===null||Hn(s,s.return)),l&64&&ca&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var f=On;if(Xt(n,e),Qt(e),l&512&&(St||s===null||Hn(s,s.return)),l&4){var h=s!==null?s.memoizedState:null;if(l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null){e:{l=e.type,s=e.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":h=f.getElementsByTagName("title")[0],(!h||h[ao]||h[Rt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(l),f.head.insertBefore(h,f.querySelector("head > title"))),Lt(h,l,s),h[Rt]=e,wt(h),l=h;break e;case"link":var _=Rv("link","href",f).get(l+(s.href||""));if(_){for(var k=0;k<_.length;k++)if(h=_[k],h.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&h.getAttribute("rel")===(s.rel==null?null:s.rel)&&h.getAttribute("title")===(s.title==null?null:s.title)&&h.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(k,1);break t}}h=f.createElement(l),Lt(h,l,s),f.head.appendChild(h);break;case"meta":if(_=Rv("meta","content",f).get(l+(s.content||""))){for(k=0;k<_.length;k++)if(h=_[k],h.getAttribute("content")===(s.content==null?null:""+s.content)&&h.getAttribute("name")===(s.name==null?null:s.name)&&h.getAttribute("property")===(s.property==null?null:s.property)&&h.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&h.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(k,1);break t}}h=f.createElement(l),Lt(h,l,s),f.head.appendChild(h);break;default:throw Error(o(468,l))}h[Rt]=e,wt(h),l=h}e.stateNode=l}else Ov(f,e.type,e.stateNode);else e.stateNode=Mv(f,l,e.memoizedProps);else h!==l?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,l===null?Ov(f,e.type,e.stateNode):Mv(f,l,e.memoizedProps)):l===null&&e.stateNode!==null&&ld(e,e.memoizedProps,s.memoizedProps)}break;case 27:Xt(n,e),Qt(e),l&512&&(St||s===null||Hn(s,s.return)),s!==null&&l&4&&ld(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Xt(n,e),Qt(e),l&512&&(St||s===null||Hn(s,s.return)),e.flags&32){f=e.stateNode;try{Js(f,"")}catch(ue){Fe(e,e.return,ue)}}l&4&&e.stateNode!=null&&(f=e.memoizedProps,ld(e,f,s!==null?s.memoizedProps:f)),l&1024&&(ud=!0);break;case 6:if(Xt(n,e),Qt(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,s=e.stateNode;try{s.nodeValue=l}catch(ue){Fe(e,e.return,ue)}}break;case 3:if(Mr=null,f=On,On=Ar(n.containerInfo),Xt(n,e),On=f,Qt(e),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Ai(n.containerInfo)}catch(ue){Fe(e,e.return,ue)}ud&&(ud=!1,Og(e));break;case 4:l=On,On=Ar(e.stateNode.containerInfo),Xt(n,e),Qt(e),On=l;break;case 12:Xt(n,e),Qt(e);break;case 31:Xt(n,e),Qt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gr(e,l)));break;case 13:Xt(n,e),Qt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(yr=zt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gr(e,l)));break;case 22:f=e.memoizedState!==null;var A=s!==null&&s.memoizedState!==null,H=ca,Z=St;if(ca=H||f,St=Z||A,Xt(n,e),St=Z,ca=H,Qt(e),l&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(s===null||A||ca||St||Ts(e)),s=null,n=e;;){if(n.tag===5||n.tag===26){if(s===null){A=s=n;try{if(h=A.stateNode,f)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{k=A.stateNode;var ee=A.memoizedProps.style,G=ee!=null&&ee.hasOwnProperty("display")?ee.display:null;k.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(ue){Fe(A,A.return,ue)}}}else if(n.tag===6){if(s===null){A=n;try{A.stateNode.nodeValue=f?"":A.memoizedProps}catch(ue){Fe(A,A.return,ue)}}}else if(n.tag===18){if(s===null){A=n;try{var K=A.stateNode;f?Tv(K,!0):Tv(A.stateNode,!1)}catch(ue){Fe(A,A.return,ue)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=e.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,gr(e,s))));break;case 19:Xt(n,e),Qt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gr(e,l)));break;case 30:break;case 21:break;default:Xt(n,e),Qt(e)}}function Qt(e){var n=e.flags;if(n&2){try{for(var s,l=e.return;l!==null;){if(Cg(l)){s=l;break}l=l.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var f=s.stateNode,h=rd(e);mr(e,h,f);break;case 5:var _=s.stateNode;s.flags&32&&(Js(_,""),s.flags&=-33);var k=rd(e);mr(e,k,_);break;case 3:case 4:var A=s.stateNode.containerInfo,H=rd(e);cd(e,H,A);break;default:throw Error(o(161))}}catch(Z){Fe(e,e.return,Z)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Og(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Og(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function da(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)jg(e,n.alternate,n),n=n.sibling}function Ts(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:La(4,n,n.return),Ts(n);break;case 1:Hn(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&Tg(n,n.return,s),Ts(n);break;case 27:Vo(n.stateNode);case 26:case 5:Hn(n,n.return),Ts(n);break;case 22:n.memoizedState===null&&Ts(n);break;case 30:Ts(n);break;default:Ts(n)}e=e.sibling}}function fa(e,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var l=n.alternate,f=e,h=n,_=h.flags;switch(h.tag){case 0:case 11:case 15:fa(f,h,s),Ao(4,h);break;case 1:if(fa(f,h,s),l=h,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(H){Fe(l,l.return,H)}if(l=h,f=l.updateQueue,f!==null){var k=l.stateNode;try{var A=f.shared.hiddenCallbacks;if(A!==null)for(f.shared.hiddenCallbacks=null,f=0;f<A.length;f++)dm(A[f],k)}catch(H){Fe(l,l.return,H)}}s&&_&64&&Sg(h),Do(h,h.return);break;case 27:Eg(h);case 26:case 5:fa(f,h,s),s&&l===null&&_&4&&kg(h),Do(h,h.return);break;case 12:fa(f,h,s);break;case 31:fa(f,h,s),s&&_&4&&Dg(f,h);break;case 13:fa(f,h,s),s&&_&4&&Mg(f,h);break;case 22:h.memoizedState===null&&fa(f,h,s),Do(h,h.return);break;case 30:break;default:fa(f,h,s)}n=n.sibling}}function dd(e,n){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&vo(s))}function fd(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&vo(e))}function Bn(e,n,s,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Bg(e,n,s,l),n=n.sibling}function Bg(e,n,s,l){var f=n.flags;switch(n.tag){case 0:case 11:case 15:Bn(e,n,s,l),f&2048&&Ao(9,n);break;case 1:Bn(e,n,s,l);break;case 3:Bn(e,n,s,l),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&vo(e)));break;case 12:if(f&2048){Bn(e,n,s,l),e=n.stateNode;try{var h=n.memoizedProps,_=h.id,k=h.onPostCommit;typeof k=="function"&&k(_,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){Fe(n,n.return,A)}}else Bn(e,n,s,l);break;case 31:Bn(e,n,s,l);break;case 13:Bn(e,n,s,l);break;case 23:break;case 22:h=n.stateNode,_=n.alternate,n.memoizedState!==null?h._visibility&2?Bn(e,n,s,l):Mo(e,n):h._visibility&2?Bn(e,n,s,l):(h._visibility|=2,bi(e,n,s,l,(n.subtreeFlags&10256)!==0||!1)),f&2048&&dd(_,n);break;case 24:Bn(e,n,s,l),f&2048&&fd(n.alternate,n);break;default:Bn(e,n,s,l)}}function bi(e,n,s,l,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,_=n,k=s,A=l,H=_.flags;switch(_.tag){case 0:case 11:case 15:bi(h,_,k,A,f),Ao(8,_);break;case 23:break;case 22:var Z=_.stateNode;_.memoizedState!==null?Z._visibility&2?bi(h,_,k,A,f):Mo(h,_):(Z._visibility|=2,bi(h,_,k,A,f)),f&&H&2048&&dd(_.alternate,_);break;case 24:bi(h,_,k,A,f),f&&H&2048&&fd(_.alternate,_);break;default:bi(h,_,k,A,f)}n=n.sibling}}function Mo(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=e,l=n,f=l.flags;switch(l.tag){case 22:Mo(s,l),f&2048&&dd(l.alternate,l);break;case 24:Mo(s,l),f&2048&&fd(l.alternate,l);break;default:Mo(s,l)}n=n.sibling}}var Ro=8192;function xi(e,n,s){if(e.subtreeFlags&Ro)for(e=e.child;e!==null;)Ig(e,n,s),e=e.sibling}function Ig(e,n,s){switch(e.tag){case 26:xi(e,n,s),e.flags&Ro&&e.memoizedState!==null&&IS(s,On,e.memoizedState,e.memoizedProps);break;case 5:xi(e,n,s);break;case 3:case 4:var l=On;On=Ar(e.stateNode.containerInfo),xi(e,n,s),On=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Ro,Ro=16777216,xi(e,n,s),Ro=l):xi(e,n,s));break;default:xi(e,n,s)}}function Lg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Oo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var l=n[s];At=l,zg(l,e)}Lg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ug(e),e=e.sibling}function Ug(e){switch(e.tag){case 0:case 11:case 15:Oo(e),e.flags&2048&&La(9,e,e.return);break;case 3:Oo(e);break;case 12:Oo(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,vr(e)):Oo(e);break;default:Oo(e)}}function vr(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var l=n[s];At=l,zg(l,e)}Lg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:La(8,n,n.return),vr(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,vr(n));break;default:vr(n)}e=e.sibling}}function zg(e,n){for(;At!==null;){var s=At;switch(s.tag){case 0:case 11:case 15:La(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:vo(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,At=l;else e:for(s=e;At!==null;){l=At;var f=l.sibling,h=l.return;if(wg(l),l===s){At=null;break e}if(f!==null){f.return=h,At=f;break e}At=h}}}var Q1={getCacheForType:function(e){var n=Bt(bt),s=n.data.get(e);return s===void 0&&(s=e(),n.data.set(e,s)),s},cacheSignal:function(){return Bt(bt).controller.signal}},W1=typeof WeakMap=="function"?WeakMap:Map,Ve=0,We=null,we=null,De=0,$e=0,ln=null,Ua=!1,_i=!1,hd=!1,ha=0,ft=0,za=0,ks=0,pd=0,rn=0,Si=0,Bo=null,Wt=null,md=!1,yr=0,Vg=0,br=1/0,xr=null,Va=null,Et=0,Ha=null,Ti=null,pa=0,gd=0,vd=null,Hg=null,Io=0,yd=null;function cn(){return(Ve&2)!==0&&De!==0?De&-De:I.T!==null?kd():ap()}function Pg(){if(rn===0)if((De&536870912)===0||Re){var e=gn;gn<<=1,(gn&3932160)===0&&(gn=262144),rn=e}else rn=536870912;return e=sn.current,e!==null&&(e.flags|=32),rn}function Jt(e,n,s){(e===We&&($e===2||$e===9)||e.cancelPendingCommit!==null)&&(ki(e,0),Pa(e,De,rn,!1)),no(e,s),((Ve&2)===0||e!==We)&&(e===We&&((Ve&2)===0&&(ks|=s),ft===4&&Pa(e,De,rn,!1)),Pn(e))}function Gg(e,n,s){if((Ve&6)!==0)throw Error(o(327));var l=!s&&(n&127)===0&&(n&e.expiredLanes)===0||to(e,n),f=l?tS(e,n):xd(e,n,!0),h=l;do{if(f===0){_i&&!l&&Pa(e,n,0,!1);break}else{if(s=e.current.alternate,h&&!J1(s)){f=xd(e,n,!1),h=!1;continue}if(f===2){if(h=n,e.errorRecoveryDisabledLanes&h)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){n=_;e:{var k=e;f=Bo;var A=k.current.memoizedState.isDehydrated;if(A&&(ki(k,_).flags|=256),_=xd(k,_,!1),_!==2){if(hd&&!A){k.errorRecoveryDisabledLanes|=h,ks|=h,f=4;break e}h=Wt,Wt=f,h!==null&&(Wt===null?Wt=h:Wt.push.apply(Wt,h))}f=_}if(h=!1,f!==2)continue}}if(f===1){ki(e,0),Pa(e,n,0,!0);break}e:{switch(l=e,h=f,h){case 0:case 1:throw Error(o(345));case 4:if((n&4194048)!==n)break;case 6:Pa(l,n,rn,!Ua);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((n&62914560)===n&&(f=yr+300-zt(),10<f)){if(Pa(l,n,rn,!Ua),Al(l,0,!0)!==0)break e;pa=n,l.timeoutHandle=xv($g.bind(null,l,s,Wt,xr,md,n,rn,ks,Si,Ua,h,"Throttled",-0,0),f);break e}$g(l,s,Wt,xr,md,n,rn,ks,Si,Ua,h,null,-0,0)}}break}while(!0);Pn(e)}function $g(e,n,s,l,f,h,_,k,A,H,Z,ee,G,K){if(e.timeoutHandle=-1,ee=n.subtreeFlags,ee&8192||(ee&16785408)===16785408){ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jn},Ig(n,h,ee);var ue=(h&62914560)===h?yr-zt():(h&4194048)===h?Vg-zt():0;if(ue=LS(ee,ue),ue!==null){pa=h,e.cancelPendingCommit=ue(Wg.bind(null,e,n,h,s,l,f,_,k,A,Z,ee,null,G,K)),Pa(e,h,_,!H);return}}Wg(e,n,h,s,l,f,_,k,A)}function J1(e){for(var n=e;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var f=s[l],h=f.getSnapshot;f=f.value;try{if(!nn(h(),f))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Pa(e,n,s,l){n&=~pd,n&=~ks,e.suspendedLanes|=n,e.pingedLanes&=~n,l&&(e.warmLanes|=n),l=e.expirationTimes;for(var f=n;0<f;){var h=31-Pe(f),_=1<<h;l[h]=-1,f&=~_}s!==0&&ep(e,s,n)}function _r(){return(Ve&6)===0?(Lo(0),!1):!0}function bd(){if(we!==null){if($e===0)var e=we.return;else e=we,aa=ms=null,Bu(e),pi=null,bo=0,e=we;for(;e!==null;)_g(e.alternate,e),e=e.return;we=null}}function ki(e,n){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,bS(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),pa=0,bd(),We=e,we=s=ta(e.current,null),De=n,$e=0,ln=null,Ua=!1,_i=to(e,n),hd=!1,Si=rn=pd=ks=za=ft=0,Wt=Bo=null,md=!1,(n&8)!==0&&(n|=n&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=n;0<l;){var f=31-Pe(l),h=1<<f;n|=e[f],l&=~h}return ha=n,Pl(),s}function Fg(e,n){ke=null,I.H=No,n===hi||n===Xl?(n=lm(),$e=3):n===Tu?(n=lm(),$e=4):$e=n===Qu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,ln=n,we===null&&(ft=1,ur(e,xn(n,e.current)))}function qg(){var e=sn.current;return e===null?!0:(De&4194048)===De?kn===null:(De&62914560)===De||(De&536870912)!==0?e===kn:!1}function Kg(){var e=I.H;return I.H=No,e===null?No:e}function Yg(){var e=I.A;return I.A=Q1,e}function Sr(){ft=4,Ua||(De&4194048)!==De&&sn.current!==null||(_i=!0),(za&134217727)===0&&(ks&134217727)===0||We===null||Pa(We,De,rn,!1)}function xd(e,n,s){var l=Ve;Ve|=2;var f=Kg(),h=Yg();(We!==e||De!==n)&&(xr=null,ki(e,n)),n=!1;var _=ft;e:do try{if($e!==0&&we!==null){var k=we,A=ln;switch($e){case 8:bd(),_=6;break e;case 3:case 2:case 9:case 6:sn.current===null&&(n=!0);var H=$e;if($e=0,ln=null,Ci(e,k,A,H),s&&_i){_=0;break e}break;default:H=$e,$e=0,ln=null,Ci(e,k,A,H)}}eS(),_=ft;break}catch(Z){Fg(e,Z)}while(!0);return n&&e.shellSuspendCounter++,aa=ms=null,Ve=l,I.H=f,I.A=h,we===null&&(We=null,De=0,Pl()),_}function eS(){for(;we!==null;)Zg(we)}function tS(e,n){var s=Ve;Ve|=2;var l=Kg(),f=Yg();We!==e||De!==n?(xr=null,br=zt()+500,ki(e,n)):_i=to(e,n);e:do try{if($e!==0&&we!==null){n=we;var h=ln;t:switch($e){case 1:$e=0,ln=null,Ci(e,n,h,1);break;case 2:case 9:if(im(h)){$e=0,ln=null,Xg(n);break}n=function(){$e!==2&&$e!==9||We!==e||($e=7),Pn(e)},h.then(n,n);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:im(h)?($e=0,ln=null,Xg(n)):($e=0,ln=null,Ci(e,n,h,7));break;case 5:var _=null;switch(we.tag){case 26:_=we.memoizedState;case 5:case 27:var k=we;if(_?Bv(_):k.stateNode.complete){$e=0,ln=null;var A=k.sibling;if(A!==null)we=A;else{var H=k.return;H!==null?(we=H,Tr(H)):we=null}break t}}$e=0,ln=null,Ci(e,n,h,5);break;case 6:$e=0,ln=null,Ci(e,n,h,6);break;case 8:bd(),ft=6;break e;default:throw Error(o(462))}}nS();break}catch(Z){Fg(e,Z)}while(!0);return aa=ms=null,I.H=l,I.A=f,Ve=s,we!==null?0:(We=null,De=0,Pl(),ft)}function nS(){for(;we!==null&&!jl();)Zg(we)}function Zg(e){var n=bg(e.alternate,e,ha);e.memoizedProps=e.pendingProps,n===null?Tr(e):we=n}function Xg(e){var n=e,s=n.alternate;switch(n.tag){case 15:case 0:n=hg(s,n,n.pendingProps,n.type,void 0,De);break;case 11:n=hg(s,n,n.pendingProps,n.type.render,n.ref,De);break;case 5:Bu(n);default:_g(s,n),n=we=Yp(n,ha),n=bg(s,n,ha)}e.memoizedProps=e.pendingProps,n===null?Tr(e):we=n}function Ci(e,n,s,l){aa=ms=null,Bu(n),pi=null,bo=0;var f=n.return;try{if($1(e,f,n,s,De)){ft=1,ur(e,xn(s,e.current)),we=null;return}}catch(h){if(f!==null)throw we=f,h;ft=1,ur(e,xn(s,e.current)),we=null;return}n.flags&32768?(Re||l===1?e=!0:_i||(De&536870912)!==0?e=!1:(Ua=e=!0,(l===2||l===9||l===3||l===6)&&(l=sn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Qg(n,e)):Tr(n)}function Tr(e){var n=e;do{if((n.flags&32768)!==0){Qg(n,Ua);return}e=n.return;var s=K1(n.alternate,n,ha);if(s!==null){we=s;return}if(n=n.sibling,n!==null){we=n;return}we=n=e}while(n!==null);ft===0&&(ft=5)}function Qg(e,n){do{var s=Y1(e.alternate,e);if(s!==null){s.flags&=32767,we=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(e=e.sibling,e!==null)){we=e;return}we=e=s}while(e!==null);ft=6,we=null}function Wg(e,n,s,l,f,h,_,k,A){e.cancelPendingCommit=null;do kr();while(Et!==0);if((Ve&6)!==0)throw Error(o(327));if(n!==null){if(n===e.current)throw Error(o(177));if(h=n.lanes|n.childLanes,h|=ru,B_(e,s,h,_,k,A),e===We&&(we=We=null,De=0),Ti=n,Ha=e,pa=s,gd=h,vd=f,Hg=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,oS(ce,function(){return av(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=I.T,I.T=null,f=Y.p,Y.p=2,_=Ve,Ve|=4;try{Z1(e,n,s)}finally{Ve=_,Y.p=f,I.T=l}}Et=1,Jg(),ev(),tv()}}function Jg(){if(Et===1){Et=0;var e=Ha,n=Ti,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=I.T,I.T=null;var l=Y.p;Y.p=2;var f=Ve;Ve|=4;try{Rg(n,e);var h=Md,_=zp(e.containerInfo),k=h.focusedElem,A=h.selectionRange;if(_!==k&&k&&k.ownerDocument&&Up(k.ownerDocument.documentElement,k)){if(A!==null&&au(k)){var H=A.start,Z=A.end;if(Z===void 0&&(Z=H),"selectionStart"in k)k.selectionStart=H,k.selectionEnd=Math.min(Z,k.value.length);else{var ee=k.ownerDocument||document,G=ee&&ee.defaultView||window;if(G.getSelection){var K=G.getSelection(),ue=k.textContent.length,ge=Math.min(A.start,ue),Xe=A.end===void 0?ge:Math.min(A.end,ue);!K.extend&&ge>Xe&&(_=Xe,Xe=ge,ge=_);var L=Lp(k,ge),R=Lp(k,Xe);if(L&&R&&(K.rangeCount!==1||K.anchorNode!==L.node||K.anchorOffset!==L.offset||K.focusNode!==R.node||K.focusOffset!==R.offset)){var z=ee.createRange();z.setStart(L.node,L.offset),K.removeAllRanges(),ge>Xe?(K.addRange(z),K.extend(R.node,R.offset)):(z.setEnd(R.node,R.offset),K.addRange(z))}}}}for(ee=[],K=k;K=K.parentNode;)K.nodeType===1&&ee.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<ee.length;k++){var W=ee[k];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}Ir=!!Dd,Md=Dd=null}finally{Ve=f,Y.p=l,I.T=s}}e.current=n,Et=2}}function ev(){if(Et===2){Et=0;var e=Ha,n=Ti,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=I.T,I.T=null;var l=Y.p;Y.p=2;var f=Ve;Ve|=4;try{jg(e,n.alternate,n)}finally{Ve=f,Y.p=l,I.T=s}}Et=3}}function tv(){if(Et===4||Et===3){Et=0,wl();var e=Ha,n=Ti,s=pa,l=Hg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Et=5:(Et=0,Ti=Ha=null,nv(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(Va=null),Uc(s),n=n.stateNode,Ne&&typeof Ne.onCommitFiberRoot=="function")try{Ne.onCommitFiberRoot(lt,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=I.T,f=Y.p,Y.p=2,I.T=null;try{for(var h=e.onRecoverableError,_=0;_<l.length;_++){var k=l[_];h(k.value,{componentStack:k.stack})}}finally{I.T=n,Y.p=f}}(pa&3)!==0&&kr(),Pn(e),f=e.pendingLanes,(s&261930)!==0&&(f&42)!==0?e===yd?Io++:(Io=0,yd=e):Io=0,Lo(0)}}function nv(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,vo(n)))}function kr(){return Jg(),ev(),tv(),av()}function av(){if(Et!==5)return!1;var e=Ha,n=gd;gd=0;var s=Uc(pa),l=I.T,f=Y.p;try{Y.p=32>s?32:s,I.T=null,s=vd,vd=null;var h=Ha,_=pa;if(Et=0,Ti=Ha=null,pa=0,(Ve&6)!==0)throw Error(o(331));var k=Ve;if(Ve|=4,Ug(h.current),Bg(h,h.current,_,s),Ve=k,Lo(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot=="function")try{Ne.onPostCommitFiberRoot(lt,h)}catch{}return!0}finally{Y.p=f,I.T=l,nv(e,n)}}function sv(e,n,s){n=xn(s,n),n=Xu(e.stateNode,n,2),e=Oa(e,n,2),e!==null&&(no(e,2),Pn(e))}function Fe(e,n,s){if(e.tag===3)sv(e,e,s);else for(;n!==null;){if(n.tag===3){sv(n,e,s);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Va===null||!Va.has(l))){e=xn(s,e),s=ig(2),l=Oa(n,s,2),l!==null&&(og(s,l,n,e),no(l,2),Pn(l));break}}n=n.return}}function _d(e,n,s){var l=e.pingCache;if(l===null){l=e.pingCache=new W1;var f=new Set;l.set(n,f)}else f=l.get(n),f===void 0&&(f=new Set,l.set(n,f));f.has(s)||(hd=!0,f.add(s),e=aS.bind(null,e,n,s),n.then(e,e))}function aS(e,n,s){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,We===e&&(De&s)===s&&(ft===4||ft===3&&(De&62914560)===De&&300>zt()-yr?(Ve&2)===0&&ki(e,0):pd|=s,Si===De&&(Si=0)),Pn(e)}function iv(e,n){n===0&&(n=Jh()),e=fs(e,n),e!==null&&(no(e,n),Pn(e))}function sS(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),iv(e,s)}function iS(e,n){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(s=f.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(n),iv(e,s)}function oS(e,n){return Fs(e,n)}var Cr=null,Ei=null,Sd=!1,Er=!1,Td=!1,Ga=0;function Pn(e){e!==Ei&&e.next===null&&(Ei===null?Cr=Ei=e:Ei=Ei.next=e),Er=!0,Sd||(Sd=!0,rS())}function Lo(e,n){if(!Td&&Er){Td=!0;do for(var s=!1,l=Cr;l!==null;){if(e!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var _=l.suspendedLanes,k=l.pingedLanes;h=(1<<31-Pe(42|e)+1)-1,h&=f&~(_&~k),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,cv(l,h))}else h=De,h=Al(l,l===We?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||to(l,h)||(s=!0,cv(l,h));l=l.next}while(s);Td=!1}}function lS(){ov()}function ov(){Er=Sd=!1;var e=0;Ga!==0&&yS()&&(e=Ga);for(var n=zt(),s=null,l=Cr;l!==null;){var f=l.next,h=lv(l,n);h===0?(l.next=null,s===null?Cr=f:s.next=f,f===null&&(Ei=s)):(s=l,(e!==0||(h&3)!==0)&&(Er=!0)),l=f}Et!==0&&Et!==5||Lo(e),Ga!==0&&(Ga=0)}function lv(e,n){for(var s=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-Pe(h),k=1<<_,A=f[_];A===-1?((k&s)===0||(k&l)!==0)&&(f[_]=O_(k,n)):A<=n&&(e.expiredLanes|=k),h&=~k}if(n=We,s=De,s=Al(e,e===n?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===n&&($e===2||$e===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&qs(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||to(e,s)){if(n=s&-s,n===e.callbackPriority)return n;switch(l!==null&&qs(l),Uc(s)){case 2:case 8:s=le;break;case 32:s=ce;break;case 268435456:s=xe;break;default:s=ce}return l=rv.bind(null,e),s=Fs(s,l),e.callbackPriority=n,e.callbackNode=s,n}return l!==null&&l!==null&&qs(l),e.callbackPriority=2,e.callbackNode=null,2}function rv(e,n){if(Et!==0&&Et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(kr()&&e.callbackNode!==s)return null;var l=De;return l=Al(e,e===We?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Gg(e,l,n),lv(e,zt()),e.callbackNode!=null&&e.callbackNode===s?rv.bind(null,e):null)}function cv(e,n){if(kr())return null;Gg(e,n,!0)}function rS(){xS(function(){(Ve&6)!==0?Fs(J,lS):ov()})}function kd(){if(Ga===0){var e=di;e===0&&(e=ka,ka<<=1,(ka&261888)===0&&(ka=256)),Ga=e}return Ga}function uv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ol(""+e)}function dv(e,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,e.id&&s.setAttribute("form",e.id),n.parentNode.insertBefore(s,n),e=new FormData(e),s.parentNode.removeChild(s),e}function cS(e,n,s,l,f){if(n==="submit"&&s&&s.stateNode===f){var h=uv((f[Kt]||null).action),_=l.submitter;_&&(n=(n=_[Kt]||null)?uv(n.formAction):_.getAttribute("formAction"),n!==null&&(h=n,_=null));var k=new Ul("action","action",null,l,f);e.push({event:k,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ga!==0){var A=_?dv(f,_):new FormData(f);$u(s,{pending:!0,data:A,method:f.method,action:h},null,A)}}else typeof h=="function"&&(k.preventDefault(),A=_?dv(f,_):new FormData(f),$u(s,{pending:!0,data:A,method:f.method,action:h},h,A))},currentTarget:f}]})}}for(var Cd=0;Cd<lu.length;Cd++){var Ed=lu[Cd],uS=Ed.toLowerCase(),dS=Ed[0].toUpperCase()+Ed.slice(1);Rn(uS,"on"+dS)}Rn(Pp,"onAnimationEnd"),Rn(Gp,"onAnimationIteration"),Rn($p,"onAnimationStart"),Rn("dblclick","onDoubleClick"),Rn("focusin","onFocus"),Rn("focusout","onBlur"),Rn(N1,"onTransitionRun"),Rn(j1,"onTransitionStart"),Rn(w1,"onTransitionCancel"),Rn(Fp,"onTransitionEnd"),Qs("onMouseEnter",["mouseout","mouseover"]),Qs("onMouseLeave",["mouseout","mouseover"]),Qs("onPointerEnter",["pointerout","pointerover"]),Qs("onPointerLeave",["pointerout","pointerover"]),rs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),rs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),rs("onBeforeInput",["compositionend","keypress","textInput","paste"]),rs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uo="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(" "),fS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Uo));function fv(e,n){n=(n&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],f=l.event;l=l.listeners;e:{var h=void 0;if(n)for(var _=l.length-1;0<=_;_--){var k=l[_],A=k.instance,H=k.currentTarget;if(k=k.listener,A!==h&&f.isPropagationStopped())break e;h=k,f.currentTarget=H;try{h(f)}catch(Z){Hl(Z)}f.currentTarget=null,h=A}else for(_=0;_<l.length;_++){if(k=l[_],A=k.instance,H=k.currentTarget,k=k.listener,A!==h&&f.isPropagationStopped())break e;h=k,f.currentTarget=H;try{h(f)}catch(Z){Hl(Z)}f.currentTarget=null,h=A}}}}function Ae(e,n){var s=n[zc];s===void 0&&(s=n[zc]=new Set);var l=e+"__bubble";s.has(l)||(hv(n,e,2,!1),s.add(l))}function Nd(e,n,s){var l=0;n&&(l|=4),hv(s,e,l,n)}var Nr="_reactListening"+Math.random().toString(36).slice(2);function jd(e){if(!e[Nr]){e[Nr]=!0,op.forEach(function(s){s!=="selectionchange"&&(fS.has(s)||Nd(s,!1,e),Nd(s,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Nr]||(n[Nr]=!0,Nd("selectionchange",!1,n))}}function hv(e,n,s,l){switch(Pv(n)){case 2:var f=VS;break;case 8:f=HS;break;default:f=Gd}s=f.bind(null,n,s,e),f=void 0,!Yc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(n,s,{capture:!0,passive:f}):e.addEventListener(n,s,!0):f!==void 0?e.addEventListener(n,s,{passive:f}):e.addEventListener(n,s,!1)}function wd(e,n,s,l,f){var h=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var _=l.tag;if(_===3||_===4){var k=l.stateNode.containerInfo;if(k===f)break;if(_===4)for(_=l.return;_!==null;){var A=_.tag;if((A===3||A===4)&&_.stateNode.containerInfo===f)return;_=_.return}for(;k!==null;){if(_=Ys(k),_===null)return;if(A=_.tag,A===5||A===6||A===26||A===27){l=h=_;continue e}k=k.parentNode}}l=l.return}yp(function(){var H=h,Z=qc(s),ee=[];e:{var G=qp.get(e);if(G!==void 0){var K=Ul,ue=e;switch(e){case"keypress":if(Il(s)===0)break e;case"keydown":case"keyup":K=i1;break;case"focusin":ue="focus",K=Wc;break;case"focusout":ue="blur",K=Wc;break;case"beforeblur":case"afterblur":K=Wc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=_p;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=K_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=r1;break;case Pp:case Gp:case $p:K=X_;break;case Fp:K=u1;break;case"scroll":case"scrollend":K=F_;break;case"wheel":K=f1;break;case"copy":case"cut":case"paste":K=W_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Tp;break;case"toggle":case"beforetoggle":K=p1}var ge=(n&4)!==0,Xe=!ge&&(e==="scroll"||e==="scrollend"),L=ge?G!==null?G+"Capture":null:G;ge=[];for(var R=H,z;R!==null;){var W=R;if(z=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||z===null||L===null||(W=io(R,L),W!=null&&ge.push(zo(R,W,z))),Xe)break;R=R.return}0<ge.length&&(G=new K(G,ue,null,s,Z),ee.push({event:G,listeners:ge}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",G&&s!==Fc&&(ue=s.relatedTarget||s.fromElement)&&(Ys(ue)||ue[Ks]))break e;if((K||G)&&(G=Z.window===Z?Z:(G=Z.ownerDocument)?G.defaultView||G.parentWindow:window,K?(ue=s.relatedTarget||s.toElement,K=H,ue=ue?Ys(ue):null,ue!==null&&(Xe=u(ue),ge=ue.tag,ue!==Xe||ge!==5&&ge!==27&&ge!==6)&&(ue=null)):(K=null,ue=H),K!==ue)){if(ge=_p,W="onMouseLeave",L="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(ge=Tp,W="onPointerLeave",L="onPointerEnter",R="pointer"),Xe=K==null?G:so(K),z=ue==null?G:so(ue),G=new ge(W,R+"leave",K,s,Z),G.target=Xe,G.relatedTarget=z,W=null,Ys(Z)===H&&(ge=new ge(L,R+"enter",ue,s,Z),ge.target=z,ge.relatedTarget=Xe,W=ge),Xe=W,K&&ue)t:{for(ge=hS,L=K,R=ue,z=0,W=L;W;W=ge(W))z++;W=0;for(var pe=R;pe;pe=ge(pe))W++;for(;0<z-W;)L=ge(L),z--;for(;0<W-z;)R=ge(R),W--;for(;z--;){if(L===R||R!==null&&L===R.alternate){ge=L;break t}L=ge(L),R=ge(R)}ge=null}else ge=null;K!==null&&pv(ee,G,K,ge,!1),ue!==null&&Xe!==null&&pv(ee,Xe,ue,ge,!0)}}e:{if(G=H?so(H):window,K=G.nodeName&&G.nodeName.toLowerCase(),K==="select"||K==="input"&&G.type==="file")var Le=Dp;else if(wp(G))if(Mp)Le=k1;else{Le=S1;var he=_1}else K=G.nodeName,!K||K.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?H&&$c(H.elementType)&&(Le=Dp):Le=T1;if(Le&&(Le=Le(e,H))){Ap(ee,Le,s,Z);break e}he&&he(e,G,H),e==="focusout"&&H&&G.type==="number"&&H.memoizedProps.value!=null&&Gc(G,"number",G.value)}switch(he=H?so(H):window,e){case"focusin":(wp(he)||he.contentEditable==="true")&&(ai=he,su=H,po=null);break;case"focusout":po=su=ai=null;break;case"mousedown":iu=!0;break;case"contextmenu":case"mouseup":case"dragend":iu=!1,Vp(ee,s,Z);break;case"selectionchange":if(E1)break;case"keydown":case"keyup":Vp(ee,s,Z)}var Ce;if(eu)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else ni?Np(e,s)&&(Me="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Me="onCompositionStart");Me&&(kp&&s.locale!=="ko"&&(ni||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&ni&&(Ce=bp()):(Na=Z,Zc="value"in Na?Na.value:Na.textContent,ni=!0)),he=jr(H,Me),0<he.length&&(Me=new Sp(Me,e,null,s,Z),ee.push({event:Me,listeners:he}),Ce?Me.data=Ce:(Ce=jp(s),Ce!==null&&(Me.data=Ce)))),(Ce=g1?v1(e,s):y1(e,s))&&(Me=jr(H,"onBeforeInput"),0<Me.length&&(he=new Sp("onBeforeInput","beforeinput",null,s,Z),ee.push({event:he,listeners:Me}),he.data=Ce)),cS(ee,e,H,s,Z)}fv(ee,n)})}function zo(e,n,s){return{instance:e,listener:n,currentTarget:s}}function jr(e,n){for(var s=n+"Capture",l=[];e!==null;){var f=e,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=io(e,s),f!=null&&l.unshift(zo(e,f,h)),f=io(e,n),f!=null&&l.push(zo(e,f,h))),e.tag===3)return l;e=e.return}return[]}function hS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pv(e,n,s,l,f){for(var h=n._reactName,_=[];s!==null&&s!==l;){var k=s,A=k.alternate,H=k.stateNode;if(k=k.tag,A!==null&&A===l)break;k!==5&&k!==26&&k!==27||H===null||(A=H,f?(H=io(s,h),H!=null&&_.unshift(zo(s,H,A))):f||(H=io(s,h),H!=null&&_.push(zo(s,H,A)))),s=s.return}_.length!==0&&e.push({event:n,listeners:_})}var pS=/\r\n?/g,mS=/\u0000|\uFFFD/g;function mv(e){return(typeof e=="string"?e:""+e).replace(pS,`
26
- `).replace(mS,"")}function gv(e,n){return n=mv(n),mv(e)===n}function Ze(e,n,s,l,f,h){switch(s){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||Js(e,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&Js(e,""+l);break;case"className":Ml(e,"class",l);break;case"tabIndex":Ml(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ml(e,s,l);break;case"style":gp(e,l,h);break;case"data":if(n!=="object"){Ml(e,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Ol(""+l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(s==="formAction"?(n!=="input"&&Ze(e,n,"name",f.name,f,null),Ze(e,n,"formEncType",f.formEncType,f,null),Ze(e,n,"formMethod",f.formMethod,f,null),Ze(e,n,"formTarget",f.formTarget,f,null)):(Ze(e,n,"encType",f.encType,f,null),Ze(e,n,"method",f.method,f,null),Ze(e,n,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Ol(""+l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=Jn);break;case"onScroll":l!=null&&Ae("scroll",e);break;case"onScrollEnd":l!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(f.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}s=Ol(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""+l):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),Dl(e,"popover",l);break;case"xlinkActuate":Wn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Wn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Wn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Wn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Wn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Wn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Dl(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=G_.get(s)||s,Dl(e,s,l))}}function Ad(e,n,s,l,f,h){switch(s){case"style":gp(e,l,h);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(f.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof l=="string"?Js(e,l):(typeof l=="number"||typeof l=="bigint")&&Js(e,""+l);break;case"onScroll":l!=null&&Ae("scroll",e);break;case"onScrollEnd":l!=null&&Ae("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Jn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lp.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),n=s.slice(2,f?s.length-7:void 0),h=e[Kt]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(n,h,f),typeof l=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(n,l,f);break e}s in e?e[s]=l:l===!0?e.setAttribute(s,""):Dl(e,s,l)}}}function Lt(e,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ae("error",e),Ae("load",e);var l=!1,f=!1,h;for(h in s)if(s.hasOwnProperty(h)){var _=s[h];if(_!=null)switch(h){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,n));default:Ze(e,n,h,_,s,null)}}f&&Ze(e,n,"srcSet",s.srcSet,s,null),l&&Ze(e,n,"src",s.src,s,null);return;case"input":Ae("invalid",e);var k=h=_=f=null,A=null,H=null;for(l in s)if(s.hasOwnProperty(l)){var Z=s[l];if(Z!=null)switch(l){case"name":f=Z;break;case"type":_=Z;break;case"checked":A=Z;break;case"defaultChecked":H=Z;break;case"value":h=Z;break;case"defaultValue":k=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(o(137,n));break;default:Ze(e,n,l,Z,s,null)}}fp(e,h,k,A,H,_,f,!1);return;case"select":Ae("invalid",e),l=_=h=null;for(f in s)if(s.hasOwnProperty(f)&&(k=s[f],k!=null))switch(f){case"value":h=k;break;case"defaultValue":_=k;break;case"multiple":l=k;default:Ze(e,n,f,k,s,null)}n=h,s=_,e.multiple=!!l,n!=null?Ws(e,!!l,n,!1):s!=null&&Ws(e,!!l,s,!0);return;case"textarea":Ae("invalid",e),h=f=l=null;for(_ in s)if(s.hasOwnProperty(_)&&(k=s[_],k!=null))switch(_){case"value":l=k;break;case"defaultValue":f=k;break;case"children":h=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(o(91));break;default:Ze(e,n,_,k,s,null)}pp(e,l,f,h);return;case"option":for(A in s)if(s.hasOwnProperty(A)&&(l=s[A],l!=null))switch(A){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ze(e,n,A,l,s,null)}return;case"dialog":Ae("beforetoggle",e),Ae("toggle",e),Ae("cancel",e),Ae("close",e);break;case"iframe":case"object":Ae("load",e);break;case"video":case"audio":for(l=0;l<Uo.length;l++)Ae(Uo[l],e);break;case"image":Ae("error",e),Ae("load",e);break;case"details":Ae("toggle",e);break;case"embed":case"source":case"link":Ae("error",e),Ae("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(H in s)if(s.hasOwnProperty(H)&&(l=s[H],l!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,n));default:Ze(e,n,H,l,s,null)}return;default:if($c(n)){for(Z in s)s.hasOwnProperty(Z)&&(l=s[Z],l!==void 0&&Ad(e,n,Z,l,s,void 0));return}}for(k in s)s.hasOwnProperty(k)&&(l=s[k],l!=null&&Ze(e,n,k,l,s,null))}function gS(e,n,s,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,_=null,k=null,A=null,H=null,Z=null;for(K in s){var ee=s[K];if(s.hasOwnProperty(K)&&ee!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":A=ee;default:l.hasOwnProperty(K)||Ze(e,n,K,null,l,ee)}}for(var G in l){var K=l[G];if(ee=s[G],l.hasOwnProperty(G)&&(K!=null||ee!=null))switch(G){case"type":h=K;break;case"name":f=K;break;case"checked":H=K;break;case"defaultChecked":Z=K;break;case"value":_=K;break;case"defaultValue":k=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(o(137,n));break;default:K!==ee&&Ze(e,n,G,K,l,ee)}}Pc(e,_,k,A,H,Z,h,f);return;case"select":K=_=k=G=null;for(h in s)if(A=s[h],s.hasOwnProperty(h)&&A!=null)switch(h){case"value":break;case"multiple":K=A;default:l.hasOwnProperty(h)||Ze(e,n,h,null,l,A)}for(f in l)if(h=l[f],A=s[f],l.hasOwnProperty(f)&&(h!=null||A!=null))switch(f){case"value":G=h;break;case"defaultValue":k=h;break;case"multiple":_=h;default:h!==A&&Ze(e,n,f,h,l,A)}n=k,s=_,l=K,G!=null?Ws(e,!!s,G,!1):!!l!=!!s&&(n!=null?Ws(e,!!s,n,!0):Ws(e,!!s,s?[]:"",!1));return;case"textarea":K=G=null;for(k in s)if(f=s[k],s.hasOwnProperty(k)&&f!=null&&!l.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Ze(e,n,k,null,l,f)}for(_ in l)if(f=l[_],h=s[_],l.hasOwnProperty(_)&&(f!=null||h!=null))switch(_){case"value":G=f;break;case"defaultValue":K=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:f!==h&&Ze(e,n,_,f,l,h)}hp(e,G,K);return;case"option":for(var ue in s)if(G=s[ue],s.hasOwnProperty(ue)&&G!=null&&!l.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:Ze(e,n,ue,null,l,G)}for(A in l)if(G=l[A],K=s[A],l.hasOwnProperty(A)&&G!==K&&(G!=null||K!=null))switch(A){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:Ze(e,n,A,G,l,K)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ge in s)G=s[ge],s.hasOwnProperty(ge)&&G!=null&&!l.hasOwnProperty(ge)&&Ze(e,n,ge,null,l,G);for(H in l)if(G=l[H],K=s[H],l.hasOwnProperty(H)&&G!==K&&(G!=null||K!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(o(137,n));break;default:Ze(e,n,H,G,l,K)}return;default:if($c(n)){for(var Xe in s)G=s[Xe],s.hasOwnProperty(Xe)&&G!==void 0&&!l.hasOwnProperty(Xe)&&Ad(e,n,Xe,void 0,l,G);for(Z in l)G=l[Z],K=s[Z],!l.hasOwnProperty(Z)||G===K||G===void 0&&K===void 0||Ad(e,n,Z,G,l,K);return}}for(var L in s)G=s[L],s.hasOwnProperty(L)&&G!=null&&!l.hasOwnProperty(L)&&Ze(e,n,L,null,l,G);for(ee in l)G=l[ee],K=s[ee],!l.hasOwnProperty(ee)||G===K||G==null&&K==null||Ze(e,n,ee,G,l,K)}function vv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function vS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var f=s[l],h=f.transferSize,_=f.initiatorType,k=f.duration;if(h&&k&&vv(_)){for(_=0,k=f.responseEnd,l+=1;l<s.length;l++){var A=s[l],H=A.startTime;if(H>k)break;var Z=A.transferSize,ee=A.initiatorType;Z&&vv(ee)&&(A=A.responseEnd,_+=Z*(A<k?1:(k-H)/(A-H)))}if(--l,n+=8*(h+_)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Dd=null,Md=null;function wr(e){return e.nodeType===9?e:e.ownerDocument}function yv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function bv(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Rd(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Od=null;function yS(){var e=window.event;return e&&e.type==="popstate"?e===Od?!1:(Od=e,!0):(Od=null,!1)}var xv=typeof setTimeout=="function"?setTimeout:void 0,bS=typeof clearTimeout=="function"?clearTimeout:void 0,_v=typeof Promise=="function"?Promise:void 0,xS=typeof queueMicrotask=="function"?queueMicrotask:typeof _v<"u"?function(e){return _v.resolve(null).then(e).catch(_S)}:xv;function _S(e){setTimeout(function(){throw e})}function $a(e){return e==="head"}function Sv(e,n){var s=n,l=0;do{var f=s.nextSibling;if(e.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(f),Ai(n);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,k=h.nodeName;h[ao]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=_}}else s==="body"&&Vo(e.ownerDocument.body);s=f}while(s);Ai(n)}function Tv(e,n){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function Bd(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Bd(s),Vc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function SS(e,n,s,l){for(;e.nodeType===1;){var f=s;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[ao])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Cn(e.nextSibling),e===null)break}return null}function TS(e,n,s){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Cn(e.nextSibling),e===null))return null;return e}function kv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Cn(e.nextSibling),e===null))return null;return e}function Id(e){return e.data==="$?"||e.data==="$~"}function Ld(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function kS(e,n){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||s.readyState!=="loading")n();else{var l=function(){n(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Cn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Ud=null;function Cv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(n===0)return Cn(e.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}e=e.nextSibling}return null}function Ev(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return e;n--}else s!=="/$"&&s!=="/&"||n++}e=e.previousSibling}return null}function Nv(e,n,s){switch(n=wr(s),e){case"html":if(e=n.documentElement,!e)throw Error(o(452));return e;case"head":if(e=n.head,!e)throw Error(o(453));return e;case"body":if(e=n.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Vo(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Vc(e)}var En=new Map,jv=new Set;function Ar(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ma=Y.d;Y.d={f:CS,r:ES,D:NS,C:jS,L:wS,m:AS,X:MS,S:DS,M:RS};function CS(){var e=ma.f(),n=_r();return e||n}function ES(e){var n=Zs(e);n!==null&&n.tag===5&&n.type==="form"?Fm(n):ma.r(e)}var Ni=typeof document>"u"?null:document;function wv(e,n,s){var l=Ni;if(l&&typeof n=="string"&&n){var f=yn(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),jv.has(f)||(jv.add(f),e={rel:e,crossOrigin:s,href:n},l.querySelector(f)===null&&(n=l.createElement("link"),Lt(n,"link",e),wt(n),l.head.appendChild(n)))}}function NS(e){ma.D(e),wv("dns-prefetch",e,null)}function jS(e,n){ma.C(e,n),wv("preconnect",e,n)}function wS(e,n,s){ma.L(e,n,s);var l=Ni;if(l&&e&&n){var f='link[rel="preload"][as="'+yn(n)+'"]';n==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+yn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+yn(s.imageSizes)+'"]')):f+='[href="'+yn(e)+'"]';var h=f;switch(n){case"style":h=ji(e);break;case"script":h=wi(e)}En.has(h)||(e=y({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:e,as:n},s),En.set(h,e),l.querySelector(f)!==null||n==="style"&&l.querySelector(Ho(h))||n==="script"&&l.querySelector(Po(h))||(n=l.createElement("link"),Lt(n,"link",e),wt(n),l.head.appendChild(n)))}}function AS(e,n){ma.m(e,n);var s=Ni;if(s&&e){var l=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+yn(l)+'"][href="'+yn(e)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=wi(e)}if(!En.has(h)&&(e=y({rel:"modulepreload",href:e},n),En.set(h,e),s.querySelector(f)===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"),Lt(l,"link",e),wt(l),s.head.appendChild(l)}}}function DS(e,n,s){ma.S(e,n,s);var l=Ni;if(l&&e){var f=Xs(l).hoistableStyles,h=ji(e);n=n||"default";var _=f.get(h);if(!_){var k={loading:0,preload:null};if(_=l.querySelector(Ho(h)))k.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":n},s),(s=En.get(h))&&zd(e,s);var A=_=l.createElement("link");wt(A),Lt(A,"link",e),A._p=new Promise(function(H,Z){A.onload=H,A.onerror=Z}),A.addEventListener("load",function(){k.loading|=1}),A.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Dr(_,n,l)}_={type:"stylesheet",instance:_,count:1,state:k},f.set(h,_)}}}function MS(e,n){ma.X(e,n);var s=Ni;if(s&&e){var l=Xs(s).hoistableScripts,f=wi(e),h=l.get(f);h||(h=s.querySelector(Po(f)),h||(e=y({src:e,async:!0},n),(n=En.get(f))&&Vd(e,n),h=s.createElement("script"),wt(h),Lt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function RS(e,n){ma.M(e,n);var s=Ni;if(s&&e){var l=Xs(s).hoistableScripts,f=wi(e),h=l.get(f);h||(h=s.querySelector(Po(f)),h||(e=y({src:e,async:!0,type:"module"},n),(n=En.get(f))&&Vd(e,n),h=s.createElement("script"),wt(h),Lt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function Av(e,n,s,l){var f=(f=fe.current)?Ar(f):null;if(!f)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=ji(s.href),s=Xs(f).hoistableStyles,l=s.get(n),l||(l={type:"style",instance:null,count:0,state:null},s.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=ji(s.href);var h=Xs(f).hoistableStyles,_=h.get(e);if(_||(f=f.ownerDocument||f,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,_),(h=f.querySelector(Ho(e)))&&!h._p&&(_.instance=h,_.state.loading=5),En.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},En.set(e,s),h||OS(f,e,s,_.state))),n&&l===null)throw Error(o(528,""));return _}if(n&&l!==null)throw Error(o(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=wi(s),s=Xs(f).hoistableScripts,l=s.get(n),l||(l={type:"script",instance:null,count:0,state:null},s.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ji(e){return'href="'+yn(e)+'"'}function Ho(e){return'link[rel="stylesheet"]['+e+"]"}function Dv(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function OS(e,n,s,l){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=e.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),Lt(n,"link",s),wt(n),e.head.appendChild(n))}function wi(e){return'[src="'+yn(e)+'"]'}function Po(e){return"script[async]"+e}function Mv(e,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+yn(s.href)+'"]');if(l)return n.instance=l,wt(l),l;var f=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),wt(l),Lt(l,"style",f),Dr(l,s.precedence,e),n.instance=l;case"stylesheet":f=ji(s.href);var h=e.querySelector(Ho(f));if(h)return n.state.loading|=4,n.instance=h,wt(h),h;l=Dv(s),(f=En.get(f))&&zd(l,f),h=(e.ownerDocument||e).createElement("link"),wt(h);var _=h;return _._p=new Promise(function(k,A){_.onload=k,_.onerror=A}),Lt(h,"link",l),n.state.loading|=4,Dr(h,s.precedence,e),n.instance=h;case"script":return h=wi(s.src),(f=e.querySelector(Po(h)))?(n.instance=f,wt(f),f):(l=s,(f=En.get(h))&&(l=y({},s),Vd(l,f)),e=e.ownerDocument||e,f=e.createElement("script"),wt(f),Lt(f,"link",l),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(o(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,Dr(l,s.precedence,e));return n.instance}function Dr(e,n,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,_=0;_<l.length;_++){var k=l[_];if(k.dataset.precedence===n)h=k;else if(h!==f)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(e,n.firstChild))}function zd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Vd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Mr=null;function Rv(e,n,s){if(Mr===null){var l=new Map,f=Mr=new Map;f.set(s,l)}else f=Mr,l=f.get(s),l||(l=new Map,f.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),f=0;f<s.length;f++){var h=s[f];if(!(h[ao]||h[Rt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(n)||"";_=e+_;var k=l.get(_);k?k.push(h):l.set(_,[h])}}return l}function Ov(e,n,s){e=e.ownerDocument||e,e.head.insertBefore(s,n==="title"?e.querySelector("head > title"):null)}function BS(e,n,s){if(s===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Bv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function IS(e,n,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=ji(l.href),h=n.querySelector(Ho(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Rr.bind(e),n.then(e,e)),s.state.loading|=4,s.instance=h,wt(h);return}h=n.ownerDocument||n,l=Dv(l),(f=En.get(f))&&zd(l,f),h=h.createElement("link"),wt(h);var _=h;_._p=new Promise(function(k,A){_.onload=k,_.onerror=A}),Lt(h,"link",l),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Rr.bind(e),n.addEventListener("load",s),n.addEventListener("error",s))}}var Hd=0;function LS(e,n){return e.stylesheets&&e.count===0&&Br(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&Br(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Hd===0&&(Hd=62500*vS());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Br(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Hd?50:800)+n);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function Rr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Br(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Or=null;function Br(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Or=new Map,n.forEach(US,e),Or=null,Rr.call(e))}function US(e,n){if(!(n.state.loading&4)){var s=Or.get(e);if(s)var l=s.get(null);else{s=new Map,Or.set(e,s);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var _=f[h];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),l=_)}l&&s.set(null,l)}f=n.instance,_=f.getAttribute("data-precedence"),h=s.get(_)||l,h===l&&s.set(null,f),s.set(_,f),this.count++,l=Rr.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),h?h.parentNode.insertBefore(f,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var Go={$$typeof:D,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function zS(e,n,s,l,f,h,_,k,A){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ic(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ic(0),this.hiddenUpdates=Ic(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function Iv(e,n,s,l,f,h,_,k,A,H,Z,ee){return e=new zS(e,n,s,_,A,H,Z,ee,k),n=1,h===!0&&(n|=24),h=an(3,null,null,n),e.current=h,h.stateNode=e,n=xu(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:l,isDehydrated:s,cache:n},ku(h),e}function Lv(e){return e?(e=oi,e):oi}function Uv(e,n,s,l,f,h){f=Lv(f),l.context===null?l.context=f:l.pendingContext=f,l=Ra(n),l.payload={element:s},h=h===void 0?null:h,h!==null&&(l.callback=h),s=Oa(e,l,n),s!==null&&(Jt(s,e,n),_o(s,e,n))}function zv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<n?s:n}}function Pd(e,n){zv(e,n),(e=e.alternate)&&zv(e,n)}function Vv(e){if(e.tag===13||e.tag===31){var n=fs(e,67108864);n!==null&&Jt(n,e,67108864),Pd(e,67108864)}}function Hv(e){if(e.tag===13||e.tag===31){var n=cn();n=Lc(n);var s=fs(e,n);s!==null&&Jt(s,e,n),Pd(e,n)}}var Ir=!0;function VS(e,n,s,l){var f=I.T;I.T=null;var h=Y.p;try{Y.p=2,Gd(e,n,s,l)}finally{Y.p=h,I.T=f}}function HS(e,n,s,l){var f=I.T;I.T=null;var h=Y.p;try{Y.p=8,Gd(e,n,s,l)}finally{Y.p=h,I.T=f}}function Gd(e,n,s,l){if(Ir){var f=$d(l);if(f===null)wd(e,n,l,Lr,s),Gv(e,l);else if(GS(f,e,n,s,l))l.stopPropagation();else if(Gv(e,l),n&4&&-1<PS.indexOf(e)){for(;f!==null;){var h=Zs(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=ls(h.pendingLanes);if(_!==0){var k=h;for(k.pendingLanes|=2,k.entangledLanes|=2;_;){var A=1<<31-Pe(_);k.entanglements[1]|=A,_&=~A}Pn(h),(Ve&6)===0&&(br=zt()+500,Lo(0))}}break;case 31:case 13:k=fs(h,2),k!==null&&Jt(k,h,2),_r(),Pd(h,2)}if(h=$d(l),h===null&&wd(e,n,l,Lr,s),h===f)break;f=h}f!==null&&l.stopPropagation()}else wd(e,n,l,null,s)}}function $d(e){return e=qc(e),Fd(e)}var Lr=null;function Fd(e){if(Lr=null,e=Ys(e),e!==null){var n=u(e);if(n===null)e=null;else{var s=n.tag;if(s===13){if(e=d(n),e!==null)return e;e=null}else if(s===31){if(e=p(n),e!==null)return e;e=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Lr=e,null}function Pv(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Bc()){case J:return 2;case le:return 8;case ce:case _e:return 32;case xe:return 268435456;default:return 32}default:return 32}}var qd=!1,Fa=null,qa=null,Ka=null,$o=new Map,Fo=new Map,Ya=[],PS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Gv(e,n){switch(e){case"focusin":case"focusout":Fa=null;break;case"dragenter":case"dragleave":qa=null;break;case"mouseover":case"mouseout":Ka=null;break;case"pointerover":case"pointerout":$o.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fo.delete(n.pointerId)}}function qo(e,n,s,l,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:s,eventSystemFlags:l,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Zs(n),n!==null&&Vv(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function GS(e,n,s,l,f){switch(n){case"focusin":return Fa=qo(Fa,e,n,s,l,f),!0;case"dragenter":return qa=qo(qa,e,n,s,l,f),!0;case"mouseover":return Ka=qo(Ka,e,n,s,l,f),!0;case"pointerover":var h=f.pointerId;return $o.set(h,qo($o.get(h)||null,e,n,s,l,f)),!0;case"gotpointercapture":return h=f.pointerId,Fo.set(h,qo(Fo.get(h)||null,e,n,s,l,f)),!0}return!1}function $v(e){var n=Ys(e.target);if(n!==null){var s=u(n);if(s!==null){if(n=s.tag,n===13){if(n=d(s),n!==null){e.blockedOn=n,sp(e.priority,function(){Hv(s)});return}}else if(n===31){if(n=p(s),n!==null){e.blockedOn=n,sp(e.priority,function(){Hv(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ur(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var s=$d(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);Fc=l,s.target.dispatchEvent(l),Fc=null}else return n=Zs(s),n!==null&&Vv(n),e.blockedOn=s,!1;n.shift()}return!0}function Fv(e,n,s){Ur(e)&&s.delete(n)}function $S(){qd=!1,Fa!==null&&Ur(Fa)&&(Fa=null),qa!==null&&Ur(qa)&&(qa=null),Ka!==null&&Ur(Ka)&&(Ka=null),$o.forEach(Fv),Fo.forEach(Fv)}function zr(e,n){e.blockedOn===n&&(e.blockedOn=null,qd||(qd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,$S)))}var Vr=null;function qv(e){Vr!==e&&(Vr=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vr===e&&(Vr=null);for(var n=0;n<e.length;n+=3){var s=e[n],l=e[n+1],f=e[n+2];if(typeof l!="function"){if(Fd(l||s)===null)continue;break}var h=Zs(s);h!==null&&(e.splice(n,3),n-=3,$u(h,{pending:!0,data:f,method:s.method,action:l},l,f))}}))}function Ai(e){function n(A){return zr(A,e)}Fa!==null&&zr(Fa,e),qa!==null&&zr(qa,e),Ka!==null&&zr(Ka,e),$o.forEach(n),Fo.forEach(n);for(var s=0;s<Ya.length;s++){var l=Ya[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ya.length&&(s=Ya[0],s.blockedOn===null);)$v(s),s.blockedOn===null&&Ya.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var f=s[l],h=s[l+1],_=f[Kt]||null;if(typeof h=="function")_||qv(s);else if(_){var k=null;if(h&&h.hasAttribute("formAction")){if(f=h,_=h[Kt]||null)k=_.formAction;else if(Fd(f)!==null)continue}else k=_.action;typeof k=="function"?s[l+1]=k:(s.splice(l,3),l-=3),qv(s)}}}function Kv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(_){return f=_})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Kd(e){this._internalRoot=e}Hr.prototype.render=Kd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(o(409));var s=n.current,l=cn();Uv(s,l,e,n,null,null)},Hr.prototype.unmount=Kd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Uv(e.current,2,null,e,null,null),_r(),n[Ks]=null}};function Hr(e){this._internalRoot=e}Hr.prototype.unstable_scheduleHydration=function(e){if(e){var n=ap();e={blockedOn:null,target:e,priority:n};for(var s=0;s<Ya.length&&n!==0&&n<Ya[s].priority;s++);Ya.splice(s,0,e),s===0&&$v(e)}};var Yv=a.version;if(Yv!=="19.2.4")throw Error(o(527,Yv,"19.2.4"));Y.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var FS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pr.isDisabled&&Pr.supportsFiber)try{lt=Pr.inject(FS),Ne=Pr}catch{}}return Ko.createRoot=function(e,n){if(!r(e))throw Error(o(299));var s=!1,l="",f=tg,h=ng,_=ag;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(_=n.onRecoverableError)),n=Iv(e,1,!1,null,null,s,l,null,f,h,_,Kv),e[Ks]=n.current,jd(e),new Kd(n)},Ko.hydrateRoot=function(e,n,s){if(!r(e))throw Error(o(299));var l=!1,f="",h=tg,_=ng,k=ag,A=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError),s.formState!==void 0&&(A=s.formState)),n=Iv(e,1,!0,n,s??null,l,f,A,h,_,k,Kv),n.context=Lv(null),s=n.current,l=cn(),l=Lc(l),f=Ra(l),f.callback=null,Oa(s,f,l),s=l,n.current.lanes=s,no(n,s),Pn(n),e[Ks]=n.current,jd(e),new Hr(n)},Ko.version="19.2.4",Ko}var ty;function lT(){if(ty)return Yd.exports;ty=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),Yd.exports=oT(),Yd.exports}var rT=lT();const cT="modulepreload",uT=function(t){return"/"+t},ny={},dT=function(a,i,o){let r=Promise.resolve();if(i&&i.length>0){let d=function(g){return Promise.all(g.map(v=>Promise.resolve(v).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),m=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));r=d(i.map(g=>{if(g=uT(g),g in ny)return;ny[g]=!0;const v=g.endsWith(".css"),y=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${y}`))return;const b=document.createElement("link");if(b.rel=v?"stylesheet":cT,v||(b.as="script"),b.crossOrigin="",b.href=g,m&&b.setAttribute("nonce",m),document.head.appendChild(b),v)return new Promise((S,T)=>{b.addEventListener("load",S),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${g}`)))})}))}function u(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return r.then(d=>{for(const p of d||[])p.status==="rejected"&&u(p.reason);return a().catch(u)})};function qt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function fl(t,a){return console.warn(`[ws] Malformed "${t}" message: ${a}`),!1}function fT(t){return qt(t)&&typeof t.id=="string"&&typeof t.type=="string"&&typeof t.timestamp=="string"&&qt(t.payload)}function hT(t){return qt(t)&&typeof t.id=="string"&&typeof t.displayName=="string"&&typeof t.adapterType=="string"&&typeof t.status=="string"&&typeof t.bootstrapped=="boolean"&&(typeof t.adapterConfig=="string"||t.adapterConfig===void 0)}function pT(t){return{...t,adapterConfig:t.adapterConfig??"{}"}}function ay(t){return qt(t)&&typeof t.id=="string"&&typeof t.environmentId=="string"&&typeof t.runtime=="string"&&typeof t.status=="string"&&typeof t.prompt=="string"&&typeof t.startedAt=="string"&&(t.endedAt===void 0||typeof t.endedAt=="string")&&(t.error===void 0||typeof t.error=="string")}function sy(t){return qt(t)&&typeof t.sessionId=="string"&&typeof t.eventType=="string"&&typeof t.timestamp=="string"&&typeof t.content=="string"&&(t.raw===void 0||typeof t.raw=="string")}function mT(t){return qt(t)&&typeof t.id=="string"&&typeof t.name=="string"&&typeof t.description=="string"&&typeof t.repoUrl=="string"&&typeof t.environmentId=="string"&&typeof t.status=="string"&&typeof t.worktreeBasePath=="string"&&typeof t.useWorktrees=="boolean"&&(t.defaultPersonaId===void 0||typeof t.defaultPersonaId=="string")&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"}function gT(t){return qt(t)&&typeof t.id=="string"&&(typeof t.workspaceId=="string"||t.workspaceId===void 0)&&typeof t.title=="string"&&typeof t.status=="string"&&typeof t.branch=="string"&&typeof t.sortOrder=="number"&&typeof t.depth=="number"&&(t.defaultPersonaId===void 0||typeof t.defaultPersonaId=="string")&&Array.isArray(t.dependsOn)&&Array.isArray(t.childTaskIds)}function vT(t){return qt(t)&&typeof t.id=="string"&&typeof t.workspaceId=="string"&&typeof t.taskId=="string"&&typeof t.sessionId=="string"&&typeof t.category=="string"&&typeof t.title=="string"&&typeof t.content=="string"&&Array.isArray(t.tags)&&typeof t.createdAt=="string"}function yT(t){return qt(t)&&typeof t.name=="string"&&typeof t.tokenType=="string"&&typeof t.envVar=="string"&&typeof t.filePath=="string"&&typeof t.expiresAt=="string"}const bT=new Set(["off","subscription","api_key"]),$r=new Set(["off","on"]);function iy(t){return qt(t)&&bT.has(t.claude)&&$r.has(t.github)&&$r.has(t.copilot)&&$r.has(t.codex)&&$r.has(t.goose)}function xT(t){return qt(t)&&typeof t.name=="string"&&typeof t.repository=="string"&&typeof t.state=="string"&&typeof t.gitStatus=="string"}function _T(t){return qt(t)&&typeof t.id=="string"&&typeof t.name=="string"&&typeof t.description=="string"&&typeof t.systemPrompt=="string"&&typeof t.toolConfig=="string"&&typeof t.runtime=="string"&&typeof t.model=="string"&&typeof t.maxTurns=="number"&&typeof t.mcpServers=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"&&typeof t.type=="string"&&typeof t.script=="string"}function Kn(t,a,i,o){return Array.isArray(t)?t.filter((r,u)=>a(r)?!0:(fl(i,`item at index ${u} in "${o}" has unexpected shape`),!1)):(fl(i,`expected "${o}" to be an array, got ${typeof t}`),[])}function ST(t){let a;try{a=JSON.parse(t)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!qt(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:qt(a.payload)?a.payload:{}}:{type:a.type,payload:qt(a.payload)?a.payload:void 0}}function TT(t){switch(t){case"waiting_input":return"idle";case"killed":return"interrupted";default:return t}}const kT=3e3,Di=5e3,CT=4001;/**
27
- * react-router v7.13.1
28
- *
29
- * Copyright (c) Remix Software Inc.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE.md file in the root directory of this source tree.
33
- *
34
- * @license MIT
35
- */var oy="popstate";function ly(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function ET(t={}){function a(o,r){var g;let u=(g=r.state)==null?void 0:g.masked,{pathname:d,search:p,hash:m}=u||o.location;return kf("",{pathname:d,search:p,hash:m},r.state&&r.state.usr||null,r.state&&r.state.key||"default",u?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function i(o,r){return typeof r=="string"?r:hl(r)}return jT(a,i,null,t)}function it(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function An(t,a){if(!t){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function NT(){return Math.random().toString(36).substring(2,10)}function ry(t,a){return{usr:t.state,key:t.key,idx:a,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function kf(t,a,i=null,o,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof a=="string"?Yi(a):a,state:i,key:a&&a.key||o||NT(),unstable_mask:r}}function hl({pathname:t="/",search:a="",hash:i=""}){return a&&a!=="?"&&(t+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(t+=i.charAt(0)==="#"?i:"#"+i),t}function Yi(t){let a={};if(t){let i=t.indexOf("#");i>=0&&(a.hash=t.substring(i),t=t.substring(0,i));let o=t.indexOf("?");o>=0&&(a.search=t.substring(o),t=t.substring(0,o)),t&&(a.pathname=t)}return a}function jT(t,a,i,o={}){let{window:r=document.defaultView,v5Compat:u=!1}=o,d=r.history,p="POP",m=null,g=v();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function v(){return(d.state||{idx:null}).idx}function y(){p="POP";let N=v(),C=N==null?null:N-g;g=N,m&&m({action:p,location:E.location,delta:C})}function b(N,C){p="PUSH";let j=ly(N)?N:kf(E.location,N,C);g=v()+1;let D=ry(j,g),M=E.createHref(j.unstable_mask||j);try{d.pushState(D,"",M)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;r.location.assign(M)}u&&m&&m({action:p,location:E.location,delta:1})}function S(N,C){p="REPLACE";let j=ly(N)?N:kf(E.location,N,C);g=v();let D=ry(j,g),M=E.createHref(j.unstable_mask||j);d.replaceState(D,"",M),u&&m&&m({action:p,location:E.location,delta:0})}function T(N){return wT(N)}let E={get action(){return p},get location(){return t(r,d)},listen(N){if(m)throw new Error("A history only accepts one active listener");return r.addEventListener(oy,y),m=N,()=>{r.removeEventListener(oy,y),m=null}},createHref(N){return a(r,N)},createURL:T,encodeLocation(N){let C=T(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:S,go(N){return d.go(N)}};return E}function wT(t,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),it(i,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:hl(t);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=i+o),new URL(o,i)}function tb(t,a,i="/"){return AT(t,a,i,!1)}function AT(t,a,i,o){let r=typeof a=="string"?Yi(a):a,u=xa(r.pathname||"/",i);if(u==null)return null;let d=nb(t);DT(d);let p=null;for(let m=0;p==null&&m<d.length;++m){let g=sb(u);p=VT(d[m],g,o)}return p}function nb(t,a=[],i=[],o="",r=!1){let u=(d,p,m=r,g)=>{let v={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:p,route:d};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(o)&&m)return;it(v.relativePath.startsWith(o),`Absolute route path "${v.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(o.length)}let y=Yn([o,v.relativePath]),b=i.concat(v);d.children&&d.children.length>0&&(it(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),nb(d.children,a,b,y,m)),!(d.path==null&&!d.index)&&a.push({path:y,score:UT(y,d.index),routesMeta:b})};return t.forEach((d,p)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))u(d,p);else for(let g of ab(d.path))u(d,p,!0,g)}),a}function ab(t){let a=t.split("/");if(a.length===0)return[];let[i,...o]=a,r=i.endsWith("?"),u=i.replace(/\?$/,"");if(o.length===0)return r?[u,""]:[u];let d=ab(o.join("/")),p=[];return p.push(...d.map(m=>m===""?u:[u,m].join("/"))),r&&p.push(...d),p.map(m=>t.startsWith("/")&&m===""?"/":m)}function DT(t){t.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 MT=/^:[\w-]+$/,RT=3,OT=2,BT=1,IT=10,LT=-2,cy=t=>t==="*";function UT(t,a){let i=t.split("/"),o=i.length;return i.some(cy)&&(o+=LT),a&&(o+=OT),i.filter(r=>!cy(r)).reduce((r,u)=>r+(MT.test(u)?RT:u===""?BT:IT),o)}function zT(t,a){return t.length===a.length&&t.slice(0,-1).every((o,r)=>o===a[r])?t[t.length-1]-a[a.length-1]:0}function VT(t,a,i=!1){let{routesMeta:o}=t,r={},u="/",d=[];for(let p=0;p<o.length;++p){let m=o[p],g=p===o.length-1,v=u==="/"?a:a.slice(u.length)||"/",y=pl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},v),b=m.route;if(!y&&g&&i&&!o[o.length-1].route.index&&(y=pl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!y)return null;Object.assign(r,y.params),d.push({params:r,pathname:Yn([u,y.pathname]),pathnameBase:FT(Yn([u,y.pathnameBase])),route:b}),y.pathnameBase!=="/"&&(u=Yn([u,y.pathnameBase]))}return d}function pl(t,a){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[i,o]=HT(t.path,t.caseSensitive,t.end),r=a.match(i);if(!r)return null;let u=r[0],d=u.replace(/(.)\/+$/,"$1"),p=r.slice(1);return{params:o.reduce((g,{paramName:v,isOptional:y},b)=>{if(v==="*"){let T=p[b]||"";d=u.slice(0,u.length-T.length).replace(/(.)\/+$/,"$1")}const S=p[b];return y&&!S?g[v]=void 0:g[v]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:d,pattern:t}}function HT(t,a=!1,i=!0){An(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let o=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,p,m,g,v)=>{if(o.push({paramName:p,isOptional:m!=null}),m){let y=v.charAt(g+d.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,a?void 0:"i"),o]}function sb(t){try{return t.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return An(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),t}}function xa(t,a){if(a==="/")return t;if(!t.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,o=t.charAt(i);return o&&o!=="/"?null:t.slice(i)||"/"}var PT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function GT(t,a="/"){let{pathname:i,search:o="",hash:r=""}=typeof t=="string"?Yi(t):t,u;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?u=uy(i.substring(1),"/"):u=uy(i,a)):u=a,{pathname:u,search:qT(o),hash:KT(r)}}function uy(t,a){let i=a.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?i.length>1&&i.pop():r!=="."&&i.push(r)}),i.length>1?i.join("/"):"/"}function Qd(t,a,i,o){return`Cannot include a '${t}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function $T(t){return t.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function ah(t){let a=$T(t);return a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase)}function Sc(t,a,i,o=!1){let r;typeof t=="string"?r=Yi(t):(r={...t},it(!r.pathname||!r.pathname.includes("?"),Qd("?","pathname","search",r)),it(!r.pathname||!r.pathname.includes("#"),Qd("#","pathname","hash",r)),it(!r.search||!r.search.includes("#"),Qd("#","search","hash",r)));let u=t===""||r.pathname==="",d=u?"/":r.pathname,p;if(d==null)p=i;else{let y=a.length-1;if(!o&&d.startsWith("..")){let b=d.split("/");for(;b[0]==="..";)b.shift(),y-=1;r.pathname=b.join("/")}p=y>=0?a[y]:"/"}let m=GT(r,p),g=d&&d!=="/"&&d.endsWith("/"),v=(u||d===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(g||v)&&(m.pathname+="/"),m}var Yn=t=>t.join("/").replace(/\/\/+/g,"/"),FT=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),qT=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,KT=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,YT=class{constructor(t,a,i,o=!1){this.status=t,this.statusText=a||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function ZT(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function XT(t){return t.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ib=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ob(t,a){let i=t;if(typeof i!="string"||!PT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,r=!1;if(ib)try{let u=new URL(window.location.href),d=i.startsWith("//")?new URL(u.protocol+i):new URL(i),p=xa(d.pathname,a);d.origin===u.origin&&p!=null?i=p+d.search+d.hash:r=!0}catch{An(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:r,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var lb=["POST","PUT","PATCH","DELETE"];new Set(lb);var QT=["GET",...lb];new Set(QT);var Zi=x.createContext(null);Zi.displayName="DataRouter";var Tc=x.createContext(null);Tc.displayName="DataRouterState";var WT=x.createContext(!1),rb=x.createContext({isTransitioning:!1});rb.displayName="ViewTransition";var JT=x.createContext(new Map);JT.displayName="Fetchers";var ek=x.createContext(null);ek.displayName="Await";var pn=x.createContext(null);pn.displayName="Navigation";var _l=x.createContext(null);_l.displayName="Location";var Dn=x.createContext({outlet:null,matches:[],isDataRoute:!1});Dn.displayName="Route";var sh=x.createContext(null);sh.displayName="RouteError";var cb="REACT_ROUTER_ERROR",tk="REDIRECT",nk="ROUTE_ERROR_RESPONSE";function ak(t){if(t.startsWith(`${cb}:${tk}:{`))try{let a=JSON.parse(t.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function sk(t){if(t.startsWith(`${cb}:${nk}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new YT(a.status,a.statusText,a.data)}catch{}}function ik(t,{relative:a}={}){it(Is(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:o}=x.useContext(pn),{hash:r,pathname:u,search:d}=Sl(t,{relative:a}),p=u;return i!=="/"&&(p=u==="/"?i:Yn([i,u])),o.createHref({pathname:p,search:d,hash:r})}function Is(){return x.useContext(_l)!=null}function jt(){return it(Is(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(_l).location}function Tt(t){it(Is(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=jt();return x.useMemo(()=>pl(t,sb(a)),[a,t])}var ub="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function db(t){x.useContext(pn).static||x.useLayoutEffect(t)}function kc(){let{isDataRoute:t}=x.useContext(Dn);return t?xk():ok()}function ok(){it(Is(),"useNavigate() may be used only in the context of a <Router> component.");let t=x.useContext(Zi),{basename:a,navigator:i}=x.useContext(pn),{matches:o}=x.useContext(Dn),{pathname:r}=jt(),u=JSON.stringify(ah(o)),d=x.useRef(!1);return db(()=>{d.current=!0}),x.useCallback((m,g={})=>{if(An(d.current,ub),!d.current)return;if(typeof m=="number"){i.go(m);return}let v=Sc(m,JSON.parse(u),r,g.relative==="path");t==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:Yn([a,v.pathname])),(g.replace?i.replace:i.push)(v,g.state,g)},[a,i,u,r,t])}var lk=x.createContext(null);function rk(t){let a=x.useContext(Dn).outlet;return x.useMemo(()=>a&&x.createElement(lk.Provider,{value:t},a),[a,t])}function ss(){let{matches:t}=x.useContext(Dn),a=t[t.length-1];return a?a.params:{}}function Sl(t,{relative:a}={}){let{matches:i}=x.useContext(Dn),{pathname:o}=jt(),r=JSON.stringify(ah(i));return x.useMemo(()=>Sc(t,JSON.parse(r),o,a==="path"),[t,r,o,a])}function ck(t,a){return fb(t,a)}function fb(t,a,i){var N;it(Is(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=x.useContext(pn),{matches:r}=x.useContext(Dn),u=r[r.length-1],d=u?u.params:{},p=u?u.pathname:"/",m=u?u.pathnameBase:"/",g=u&&u.route;{let C=g&&g.path||"";pb(p,!g||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
36
-
37
- Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let v=jt(),y;if(a){let C=typeof a=="string"?Yi(a):a;it(m==="/"||((N=C.pathname)==null?void 0:N.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${C.pathname}" was given in the \`location\` prop.`),y=C}else y=v;let b=y.pathname||"/",S=b;if(m!=="/"){let C=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let T=tb(t,{pathname:S});An(g||T!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),An(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=pk(T&&T.map(C=>Object.assign({},C,{params:Object.assign({},d,C.params),pathname:Yn([m,o.encodeLocation?o.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:Yn([m,o.encodeLocation?o.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),r,i);return a&&E?x.createElement(_l.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...y},navigationType:"POP"}},E):E}function uk(){let t=bk(),a=ZT(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),i=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",t),d=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:u},"ErrorBoundary")," or"," ",x.createElement("code",{style:u},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},a),i?x.createElement("pre",{style:r},i):null,d)}var dk=x.createElement(uk,null),hb=class extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,a){return a.location!==t.location||a.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:a.error,location:a.location,revalidation:t.revalidation||a.revalidation}}componentDidCatch(t,a){this.props.onError?this.props.onError(t,a):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const i=sk(t.digest);i&&(t=i)}let a=t!==void 0?x.createElement(Dn.Provider,{value:this.props.routeContext},x.createElement(sh.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?x.createElement(fk,{error:t},a):a}};hb.contextType=WT;var Wd=new WeakMap;function fk({children:t,error:a}){let{basename:i}=x.useContext(pn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=ak(a.digest);if(o){let r=Wd.get(a);if(r)throw r;let u=ob(o.location,i);if(ib&&!Wd.get(a))if(u.isExternal||o.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw Wd.set(a,d),d}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return t}function hk({routeContext:t,match:a,children:i}){let o=x.useContext(Zi);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),x.createElement(Dn.Provider,{value:t},i)}function pk(t,a=[],i){let o=i==null?void 0:i.state;if(t==null){if(!o)return null;if(o.errors)t=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)t=o.matches;else return null}let r=t,u=o==null?void 0:o.errors;if(u!=null){let v=r.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);it(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),r=r.slice(0,Math.min(r.length,v+1))}let d=!1,p=-1;if(i&&o){d=o.renderFallback;for(let v=0;v<r.length;v++){let y=r[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=v),y.route.id){let{loaderData:b,errors:S}=o,T=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!S||S[y.route.id]===void 0);if(y.route.lazy||T){i.isStatic&&(d=!0),p>=0?r=r.slice(0,p+1):r=[r[0]];break}}}}let m=i==null?void 0:i.onError,g=o&&m?(v,y)=>{var b,S;m(v,{location:o.location,params:((S=(b=o.matches)==null?void 0:b[0])==null?void 0:S.params)??{},unstable_pattern:XT(o.matches),errorInfo:y})}:void 0;return r.reduceRight((v,y,b)=>{let S,T=!1,E=null,N=null;o&&(S=u&&y.route.id?u[y.route.id]:void 0,E=y.route.errorElement||dk,d&&(p<0&&b===0?(pb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,N=null):p===b&&(T=!0,N=y.route.hydrateFallbackElement||null)));let C=a.concat(r.slice(0,b+1)),j=()=>{let D;return S?D=E:T?D=N:y.route.Component?D=x.createElement(y.route.Component,null):y.route.element?D=y.route.element:D=v,x.createElement(hk,{match:y,routeContext:{outlet:v,matches:C,isDataRoute:o!=null},children:D})};return o&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?x.createElement(hb,{location:o.location,revalidation:o.revalidation,component:E,error:S,children:j(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:g}):j()},null)}function ih(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function mk(t){let a=x.useContext(Zi);return it(a,ih(t)),a}function gk(t){let a=x.useContext(Tc);return it(a,ih(t)),a}function vk(t){let a=x.useContext(Dn);return it(a,ih(t)),a}function oh(t){let a=vk(t),i=a.matches[a.matches.length-1];return it(i.route.id,`${t} can only be used on routes that contain a unique "id"`),i.route.id}function yk(){return oh("useRouteId")}function bk(){var o;let t=x.useContext(sh),a=gk("useRouteError"),i=oh("useRouteError");return t!==void 0?t:(o=a.errors)==null?void 0:o[i]}function xk(){let{router:t}=mk("useNavigate"),a=oh("useNavigate"),i=x.useRef(!1);return db(()=>{i.current=!0}),x.useCallback(async(r,u={})=>{An(i.current,ub),i.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:a,...u}))},[t,a])}var dy={};function pb(t,a,i){!a&&!dy[t]&&(dy[t]=!0,An(!1,i))}x.memo(_k);function _k({routes:t,future:a,state:i,isStatic:o,onError:r}){return fb(t,void 0,{state:i,isStatic:o,onError:r})}function $n({to:t,replace:a,state:i,relative:o}){it(Is(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=x.useContext(pn);An(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=x.useContext(Dn),{pathname:d}=jt(),p=kc(),m=Sc(t,ah(u),d,o==="path"),g=JSON.stringify(m);return x.useEffect(()=>{p(JSON.parse(g),{replace:a,state:i,relative:o})},[p,g,o,a,i]),null}function Ls(t){return rk(t.context)}function Se(t){it(!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 Sk({basename:t="/",children:a=null,location:i,navigationType:o="POP",navigator:r,static:u=!1,unstable_useTransitions:d}){it(!Is(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=t.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:p,navigator:r,static:u,unstable_useTransitions:d,future:{}}),[p,r,u,d]);typeof i=="string"&&(i=Yi(i));let{pathname:g="/",search:v="",hash:y="",state:b=null,key:S="default",unstable_mask:T}=i,E=x.useMemo(()=>{let N=xa(g,p);return N==null?null:{location:{pathname:N,search:v,hash:y,state:b,key:S,unstable_mask:T},navigationType:o}},[p,g,v,y,b,S,o,T]);return An(E!=null,`<Router basename="${p}"> is not able to match the URL "${g}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:x.createElement(pn.Provider,{value:m},x.createElement(_l.Provider,{children:a,value:E}))}function Tk({children:t,location:a}){return ck(Cf(t),a)}function Cf(t,a=[]){let i=[];return x.Children.forEach(t,(o,r)=>{if(!x.isValidElement(o))return;let u=[...a,r];if(o.type===x.Fragment){i.push.apply(i,Cf(o.props.children,u));return}it(o.type===Se,`[${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>`),it(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=Cf(o.props.children,u)),i.push(d)}),i}var nc="get",ac="application/x-www-form-urlencoded";function Cc(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function kk(t){return Cc(t)&&t.tagName.toLowerCase()==="button"}function Ck(t){return Cc(t)&&t.tagName.toLowerCase()==="form"}function Ek(t){return Cc(t)&&t.tagName.toLowerCase()==="input"}function Nk(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function jk(t,a){return t.button===0&&(!a||a==="_self")&&!Nk(t)}function Ef(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((a,i)=>{let o=t[i];return a.concat(Array.isArray(o)?o.map(r=>[i,r]):[[i,o]])},[]))}function wk(t,a){let i=Ef(t);return a&&a.forEach((o,r)=>{i.has(r)||a.getAll(r).forEach(u=>{i.append(r,u)})}),i}var Fr=null;function Ak(){if(Fr===null)try{new FormData(document.createElement("form"),0),Fr=!1}catch{Fr=!0}return Fr}var Dk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jd(t){return t!=null&&!Dk.has(t)?(An(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ac}"`),null):t}function Mk(t,a){let i,o,r,u,d;if(Ck(t)){let p=t.getAttribute("action");o=p?xa(p,a):null,i=t.getAttribute("method")||nc,r=Jd(t.getAttribute("enctype"))||ac,u=new FormData(t)}else if(kk(t)||Ek(t)&&(t.type==="submit"||t.type==="image")){let p=t.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=t.getAttribute("formaction")||p.getAttribute("action");if(o=m?xa(m,a):null,i=t.getAttribute("formmethod")||p.getAttribute("method")||nc,r=Jd(t.getAttribute("formenctype"))||Jd(p.getAttribute("enctype"))||ac,u=new FormData(p,t),!Ak()){let{name:g,type:v,value:y}=t;if(v==="image"){let b=g?`${g}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else g&&u.append(g,y)}}else{if(Cc(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=nc,o=null,r=ac,d=t}return u&&r==="text/plain"&&(d=u,u=void 0),{action:o,method:i.toLowerCase(),encType:r,formData:u,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lh(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function Rk(t,a,i,o){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return i?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${o}`:r.pathname=`${r.pathname}.${o}`:r.pathname==="/"?r.pathname=`_root.${o}`:a&&xa(r.pathname,a)==="/"?r.pathname=`${a.replace(/\/$/,"")}/_root.${o}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${o}`,r}async function Ok(t,a){if(t.id in a)return a[t.id];try{let i=await import(t.module);return a[t.id]=i,i}catch(i){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Bk(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function Ik(t,a,i){let o=await Promise.all(t.map(async r=>{let u=a.routes[r.route.id];if(u){let d=await Ok(u,i);return d.links?d.links():[]}return[]}));return Vk(o.flat(1).filter(Bk).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function fy(t,a,i,o,r,u){let d=(m,g)=>i[g]?m.route.id!==i[g].route.id:!0,p=(m,g)=>{var v;return i[g].pathname!==m.pathname||((v=i[g].route.path)==null?void 0:v.endsWith("*"))&&i[g].params["*"]!==m.params["*"]};return u==="assets"?a.filter((m,g)=>d(m,g)||p(m,g)):u==="data"?a.filter((m,g)=>{var y;let v=o.routes[m.route.id];if(!v||!v.hasLoader)return!1;if(d(m,g)||p(m,g))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((y=i[0])==null?void 0:y.params)||{},nextUrl:new URL(t,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function Lk(t,a,{includeHydrateFallback:i}={}){return Uk(t.map(o=>{let r=a.routes[o.route.id];if(!r)return[];let u=[r.module];return r.clientActionModule&&(u=u.concat(r.clientActionModule)),r.clientLoaderModule&&(u=u.concat(r.clientLoaderModule)),i&&r.hydrateFallbackModule&&(u=u.concat(r.hydrateFallbackModule)),r.imports&&(u=u.concat(r.imports)),u}).flat(1))}function Uk(t){return[...new Set(t)]}function zk(t){let a={},i=Object.keys(t).sort();for(let o of i)a[o]=t[o];return a}function Vk(t,a){let i=new Set;return new Set(a),t.reduce((o,r)=>{let u=JSON.stringify(zk(r));return i.has(u)||(i.add(u),o.push({key:u,link:r})),o},[])}function mb(){let t=x.useContext(Zi);return lh(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Hk(){let t=x.useContext(Tc);return lh(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var rh=x.createContext(void 0);rh.displayName="FrameworkContext";function gb(){let t=x.useContext(rh);return lh(t,"You must render this element inside a <HydratedRouter> element"),t}function Pk(t,a){let i=x.useContext(rh),[o,r]=x.useState(!1),[u,d]=x.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:v,onTouchStart:y}=a,b=x.useRef(null);x.useEffect(()=>{if(t==="render"&&d(!0),t==="viewport"){let E=C=>{C.forEach(j=>{d(j.isIntersecting)})},N=new IntersectionObserver(E,{threshold:.5});return b.current&&N.observe(b.current),()=>{N.disconnect()}}},[t]),x.useEffect(()=>{if(o){let E=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(E)}}},[o]);let S=()=>{r(!0)},T=()=>{r(!1),d(!1)};return i?t!=="intent"?[u,b,{}]:[u,b,{onFocus:Yo(p,S),onBlur:Yo(m,T),onMouseEnter:Yo(g,S),onMouseLeave:Yo(v,T),onTouchStart:Yo(y,S)}]:[!1,b,{}]}function Yo(t,a){return i=>{t&&t(i),i.defaultPrevented||a(i)}}function Gk({page:t,...a}){let{router:i}=mb(),o=x.useMemo(()=>tb(i.routes,t,i.basename),[i.routes,t,i.basename]);return o?x.createElement(Fk,{page:t,matches:o,...a}):null}function $k(t){let{manifest:a,routeModules:i}=gb(),[o,r]=x.useState([]);return x.useEffect(()=>{let u=!1;return Ik(t,a,i).then(d=>{u||r(d)}),()=>{u=!0}},[t,a,i]),o}function Fk({page:t,matches:a,...i}){let o=jt(),{future:r,manifest:u,routeModules:d}=gb(),{basename:p}=mb(),{loaderData:m,matches:g}=Hk(),v=x.useMemo(()=>fy(t,a,g,u,o,"data"),[t,a,g,u,o]),y=x.useMemo(()=>fy(t,a,g,u,o,"assets"),[t,a,g,u,o]),b=x.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let E=new Set,N=!1;if(a.forEach(j=>{var M;let D=u.routes[j.route.id];!D||!D.hasLoader||(!v.some(w=>w.route.id===j.route.id)&&j.route.id in m&&((M=d[j.route.id])!=null&&M.shouldRevalidate)||D.hasClientLoader?N=!0:E.add(j.route.id))}),E.size===0)return[];let C=Rk(t,p,r.unstable_trailingSlashAwareDataRequests,"data");return N&&E.size>0&&C.searchParams.set("_routes",a.filter(j=>E.has(j.route.id)).map(j=>j.route.id).join(",")),[C.pathname+C.search]},[p,r.unstable_trailingSlashAwareDataRequests,m,o,u,v,a,t,d]),S=x.useMemo(()=>Lk(y,u),[y,u]),T=$k(y);return x.createElement(x.Fragment,null,b.map(E=>x.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...i})),S.map(E=>x.createElement("link",{key:E,rel:"modulepreload",href:E,...i})),T.map(({key:E,link:N})=>x.createElement("link",{key:E,nonce:i.nonce,...N,crossOrigin:N.crossOrigin??i.crossOrigin})))}function qk(...t){return a=>{t.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.1")}catch{}function Yk({basename:t,children:a,unstable_useTransitions:i,window:o}){let r=x.useRef();r.current==null&&(r.current=ET({window:o,v5Compat:!0}));let u=r.current,[d,p]=x.useState({action:u.action,location:u.location}),m=x.useCallback(g=>{i===!1?p(g):x.startTransition(()=>p(g))},[i]);return x.useLayoutEffect(()=>u.listen(m),[u,m]),x.createElement(Sk,{basename:t,children:a,location:d.location,navigationType:d.action,navigator:u,unstable_useTransitions:i})}var vb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ch=x.forwardRef(function({onClick:a,discover:i="render",prefetch:o="none",relative:r,reloadDocument:u,replace:d,unstable_mask:p,state:m,target:g,to:v,preventScrollReset:y,viewTransition:b,unstable_defaultShouldRevalidate:S,...T},E){let{basename:N,navigator:C,unstable_useTransitions:j}=x.useContext(pn),D=typeof v=="string"&&vb.test(v),M=ob(v,N);v=M.to;let w=ik(v,{relative:r}),$=jt(),V=null;if(p){let ne=Sc(p,[],$.unstable_mask?$.unstable_mask.pathname:"/",!0);N!=="/"&&(ne.pathname=ne.pathname==="/"?N:Yn([N,ne.pathname])),V=C.createHref(ne)}let[B,q,X]=Pk(o,T),ae=Wk(v,{replace:d,unstable_mask:p,state:m,target:g,preventScrollReset:y,relative:r,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:j});function te(ne){a&&a(ne),ne.defaultPrevented||ae(ne)}let Q=!(M.isExternal||u),F=x.createElement("a",{...T,...X,href:(Q?V:void 0)||M.absoluteURL||w,onClick:Q?te:a,ref:qk(E,q),target:g,"data-discover":!D&&i==="render"?"true":void 0});return B&&!D?x.createElement(x.Fragment,null,F,x.createElement(Gk,{page:w})):F});ch.displayName="Link";var Zk=x.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:o="",end:r=!1,style:u,to:d,viewTransition:p,children:m,...g},v){let y=Sl(d,{relative:g.relative}),b=jt(),S=x.useContext(Tc),{navigator:T,basename:E}=x.useContext(pn),N=S!=null&&aC(y)&&p===!0,C=T.encodeLocation?T.encodeLocation(y).pathname:y.pathname,j=b.pathname,D=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(j=j.toLowerCase(),D=D?D.toLowerCase():null,C=C.toLowerCase()),D&&E&&(D=xa(D,E)||D);const M=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let w=j===C||!r&&j.startsWith(C)&&j.charAt(M)==="/",$=D!=null&&(D===C||!r&&D.startsWith(C)&&D.charAt(C.length)==="/"),V={isActive:w,isPending:$,isTransitioning:N},B=w?a:void 0,q;typeof o=="function"?q=o(V):q=[o,w?"active":null,$?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let X=typeof u=="function"?u(V):u;return x.createElement(ch,{...g,"aria-current":B,className:q,ref:v,style:X,to:d,viewTransition:p},typeof m=="function"?m(V):m)});Zk.displayName="NavLink";var Xk=x.forwardRef(({discover:t="render",fetcherKey:a,navigate:i,reloadDocument:o,replace:r,state:u,method:d=nc,action:p,onSubmit:m,relative:g,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:b,...S},T)=>{let{unstable_useTransitions:E}=x.useContext(pn),N=tC(),C=nC(p,{relative:g}),j=d.toLowerCase()==="get"?"get":"post",D=typeof p=="string"&&vb.test(p),M=w=>{if(m&&m(w),w.defaultPrevented)return;w.preventDefault();let $=w.nativeEvent.submitter,V=($==null?void 0:$.getAttribute("formmethod"))||d,B=()=>N($||w.currentTarget,{fetcherKey:a,method:V,navigate:i,replace:r,state:u,relative:g,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:b});E&&i!==!1?x.startTransition(()=>B()):B()};return x.createElement("form",{ref:T,method:j,action:C,onSubmit:o?m:M,...S,"data-discover":!D&&t==="render"?"true":void 0})});Xk.displayName="Form";function Qk(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yb(t){let a=x.useContext(Zi);return it(a,Qk(t)),a}function Wk(t,{target:a,replace:i,unstable_mask:o,state:r,preventScrollReset:u,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let v=kc(),y=jt(),b=Sl(t,{relative:d});return x.useCallback(S=>{if(jk(S,a)){S.preventDefault();let T=i!==void 0?i:hl(y)===hl(b),E=()=>v(t,{replace:T,unstable_mask:o,state:r,preventScrollReset:u,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m});g?x.startTransition(()=>E()):E()}},[y,v,b,i,o,r,a,t,u,d,p,m,g])}function uh(t){An(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=x.useRef(Ef(t)),i=x.useRef(!1),o=jt(),r=x.useMemo(()=>wk(o.search,i.current?null:a.current),[o.search]),u=kc(),d=x.useCallback((p,m)=>{const g=Ef(typeof p=="function"?p(new URLSearchParams(r)):p);i.current=!0,u("?"+g,m)},[u,r]);return[r,d]}var Jk=0,eC=()=>`__${String(++Jk)}__`;function tC(){let{router:t}=yb("useSubmit"),{basename:a}=x.useContext(pn),i=yk(),o=t.fetch,r=t.navigate;return x.useCallback(async(u,d={})=>{let{action:p,method:m,encType:g,formData:v,body:y}=Mk(u,a);if(d.navigate===!1){let b=d.fetcherKey||eC();await o(b,i,d.action||p,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:y,formMethod:d.method||m,formEncType:d.encType||g,flushSync:d.flushSync})}else await r(d.action||p,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:y,formMethod:d.method||m,formEncType:d.encType||g,replace:d.replace,state:d.state,fromRouteId:i,flushSync:d.flushSync,viewTransition:d.viewTransition})},[o,r,a,i])}function nC(t,{relative:a}={}){let{basename:i}=x.useContext(pn),o=x.useContext(Dn);it(o,"useFormAction must be used inside a RouteContext");let[r]=o.matches.slice(-1),u={...Sl(t||".",{relative:a})},d=jt();if(t==null){u.search=d.search;let p=new URLSearchParams(u.search),m=p.getAll("index");if(m.some(v=>v==="")){p.delete("index"),m.filter(y=>y).forEach(y=>p.append("index",y));let v=p.toString();u.search=v?`?${v}`:""}}return(!t||t===".")&&r.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:Yn([i,u.pathname])),hl(u)}function aC(t,{relative:a}={}){let i=x.useContext(rb);it(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=yb("useViewTransitionState"),r=Sl(t,{relative:a});if(!i.isTransitioning)return!1;let u=xa(i.currentLocation.pathname,o)||i.currentLocation.pathname,d=xa(i.nextLocation.pathname,o)||i.nextLocation.pathname;return pl(r.pathname,d)!=null||pl(r.pathname,u)!=null}function Dt(){const t=kc();return x.useCallback((a,i)=>{typeof a=="number"?t(a):t(a,i)},[t])}function bb(t){return`/sessions/${encodeURIComponent(t)}`}function Hi(t,a){return a?`/environments/${encodeURIComponent(a)}/workspaces/${encodeURIComponent(t)}`:`/workspaces/${encodeURIComponent(t)}`}function _a(t,a,i,o){const r=encodeURIComponent(t);let u;return i&&o?u=`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(i)}/tasks/${r}`:i?u=`/workspaces/${encodeURIComponent(i)}/tasks/${r}`:u=`/tasks/${r}`,a?`${u}/${a}`:u}function sC(t,a,i){return a&&i?`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(t)}/edit`:a?`/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(t)}/edit`:`/tasks/${encodeURIComponent(t)}/edit`}function Xi(t,a,i){const o=new URLSearchParams;t&&o.set("workspace",t),a&&o.set("parent",a);const r=o.toString();if(t&&i){const u=`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(t)}/tasks/new`;return a?`${u}?parent=${encodeURIComponent(a)}`:u}return r?`/tasks/new?${r}`:"/tasks/new"}function xb(t){return`/sessions/new?${new URLSearchParams({env:t}).toString()}`}const Pi="/environments",iC="/environments/new";function Gi(t){return`/environments/${encodeURIComponent(t)}`}function oC(t){return`/environments/${encodeURIComponent(t)}/edit`}const il="/settings",lC="/settings/credentials",rC="/pair",cC="/chat",Os="/",uC="/tasks",_b="/workspaces/new",Sb="/knowledge";function dC(t,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",o=x.useRef(void 0),[r,u]=x.useState(!1),d=x.useRef(a.onMessage);d.current=a.onMessage;const p=x.useRef(a.onConnect);p.current=a.onConnect;const m=x.useRef(a.onDisconnect);m.current=a.onDisconnect;const g=x.useCallback(v=>{var y;((y=o.current)==null?void 0:y.readyState)===WebSocket.OPEN&&o.current.send(JSON.stringify(v))},[]);return x.useEffect(()=>{let v,y;function b(){v=new WebSocket(i),o.current=v,v.onopen=()=>{u(!0),p.current(g)},v.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const T=ST(S.data);T&&d.current(T)},v.onclose=S=>{var T;if(u(!1),o.current=void 0,(T=m.current)==null||T.call(m),clearTimeout(y),S.code===CT){window.location.href=rC;return}y=setTimeout(b,kT)},v.onerror=()=>{v.close()}}return b(),()=>{clearTimeout(y),v==null||v.close()}},[i,g]),{connected:r,send:g}}const fC=5e3;function hC(t){const[a,i]=x.useState([]),[o,r]=x.useState({}),u=x.useCallback(b=>{switch(b.type){case"environment.added":return!0;case"environment.removed":{const S=b.payload.environmentId;return S&&(i(T=>T.filter(E=>E.id!==S)),r(T=>{const E={...T};return delete E[S],E})),t({type:"list_sessions"}),!0}case"environment.changed":return t({type:"list_environments"}),!0;case"environment.provision_progress":{const S=b.payload;if(typeof S.environmentId!="string"||typeof S.stage!="string"||typeof S.message!="string"||typeof S.progress!="number")return fl("environment.provision_progress","invalid payload"),!0;if(r(T=>({...T,[S.environmentId]:{stage:S.stage,message:S.message,progress:S.progress}})),S.stage==="ready"){const T=S.environmentId;setTimeout(()=>{r(E=>{const N={...E};return delete N[T],N})},fC)}return!0}default:return!1}},[t]),d=x.useCallback(b=>{var S;switch(b.type){case"environments":return i(Kn((S=b.payload)==null?void 0:S.environments,hT,"environments","environments").map(pT)),!0;default:return!1}},[]),p=x.useCallback((b,S,T)=>{t({type:"add_environment",payload:{displayName:b,adapterType:S,adapterConfig:T||{}}})},[t]),m=x.useCallback((b,S)=>{const T={environmentId:b,...S};t({type:"update_environment",payload:T})},[t]),g=x.useCallback(b=>{t({type:"provision_environment",payload:{environmentId:b}})},[t]),v=x.useCallback(b=>{t({type:"stop_environment",payload:{environmentId:b}})},[t]),y=x.useCallback(b=>{t({type:"remove_environment",payload:{environmentId:b}})},[t]);return{environments:a,provisionStatus:o,addEnvironment:p,updateEnvironment:m,provisionEnvironment:g,stopEnvironment:v,removeEnvironment:y,handleMessage:d,handleEvent:u}}const ef=new Set(["pending","running","idle"]),pC=new Set(["completed","failed","interrupted","hibernating","suspended"]),hy=["pending","running","idle"];function mC(t){const[a,i]=x.useState([]),[o,r]=x.useState([]),[u,d]=x.useState(0),[p,m]=x.useState(void 0),[g,v]=x.useState({}),y=x.useCallback(j=>{var D,M,w,$,V;switch(j.type){case"sessions":return i(B=>{var ae;const q=Kn((ae=j.payload)==null?void 0:ae.sessions,ay,"sessions","sessions"),X=new Map(B.map(te=>[te.id,te.status]));return q.map(te=>{const Q=X.get(te.id);return!Q||Q===te.status?te:pC.has(Q)&&ef.has(te.status)?{...te,status:Q}:ef.has(Q)&&ef.has(te.status)&&hy.indexOf(Q)>hy.indexOf(te.status)?{...te,status:Q}:te})}),!0;case"session_event":{if(!sy(j.payload))return fl("session_event","payload is not a valid SessionEvent"),!0;const B=j.payload;let q=0;if(r(X=>{const ae=[...X,B];return ae.length>Di?(q=ae.length-Di,ae.slice(-Di)):ae}),q>0&&d(X=>X+q),B.eventType==="usage")try{const X=JSON.parse(B.content),ae=Number(X.input_tokens)||0,te=Number(X.output_tokens)||0,Q=Number(X.cost_usd)||0;(ae>0||te>0||Q>0)&&i(F=>F.map(ne=>ne.id===B.sessionId?{...ne,inputTokens:(ne.inputTokens??0)+ae,outputTokens:(ne.outputTokens??0)+te,costUsd:(ne.costUsd??0)+Q}:ne))}catch{}if(B.eventType==="status"){const X=TT(B.content);i(ae=>ae.some(Q=>Q.id===B.sessionId)?ae.map(Q=>Q.id===B.sessionId?{...Q,status:X}:Q):[...ae,{id:B.sessionId,environmentId:"",runtime:"",status:X,prompt:"",startedAt:B.timestamp}])}return!0}case"session_events":{const B=Kn((D=j.payload)==null?void 0:D.events,sy,"session_events","events"),q=(M=j.payload)==null?void 0:M.sessionId;if(typeof q!="string")return fl("session_events","missing or non-string sessionId"),!0;if(B.length>0){let X=0;r(ae=>{const te=new Set;for(const ne of ae)ne.sessionId===q&&te.add(`${ne.timestamp}|${ne.eventType}`);const Q=B.filter(ne=>!te.has(`${ne.timestamp}|${ne.eventType}`)),F=[...ae,...Q].sort((ne,I)=>ne.sessionId!==I.sessionId?0:ne.timestamp.localeCompare(I.timestamp));return F.length>Di?(X=F.length-Di,F.slice(-Di)):F}),X>0&&d(ae=>ae+X)}return!0}case"spawned":{const B=(w=j.payload)==null?void 0:w.sessionId;return typeof B=="string"&&B&&m(B),t({type:"list_sessions"}),!0}case"task_sessions":{const B=($=j.payload)==null?void 0:$.taskId;if(typeof B!="string"||!B)return!0;const q=Kn((V=j.payload)==null?void 0:V.sessions,ay,"task_sessions","sessions");return v(X=>({...X,[B]:q})),!0}default:return!1}},[t]),b=x.useCallback((j,D,M,w)=>{t({type:"spawn",payload:{environmentId:j,prompt:D,personaId:M||"",worktreeBasePath:w||""}})},[t]),S=x.useCallback((j,D)=>{t({type:"send_input",payload:{sessionId:j,text:D}})},[t]),T=x.useCallback(j=>{t({type:"kill",payload:{sessionId:j}})},[t]),E=x.useCallback(j=>{t({type:"get_session_events",payload:{sessionId:j}})},[t]),N=x.useCallback(()=>{r([]),d(0)},[]),C=x.useCallback(j=>{t({type:"get_task_sessions",payload:{taskId:j}})},[t]);return{sessions:a,events:o,eventsDropped:u,lastSpawnedId:p,taskSessions:g,spawn:b,sendInput:S,kill:T,loadSessionEvents:E,clearEvents:N,loadTaskSessions:C,handleMessage:y}}const gC=15e3;function vC(t){const[a,i]=x.useState([]),[o,r]=x.useState(!1),u=x.useRef(new Map),d=x.useCallback(()=>{r(u.current.size>0)},[]),p=x.useCallback(S=>{switch(S.type){case"workspace.created":{const T=typeof S.payload.requestId=="string"?S.payload.requestId:"";if(T){const E=u.current.get(T);E&&(clearTimeout(E.timer),u.current.delete(T),d(),E.onSuccess())}return t({type:"list_workspaces"}),!0}case"workspace.archived":case"workspace.updated":return t({type:"list_workspaces"}),!0;default:return!1}},[t,d]),m=x.useCallback(S=>{var T,E,N;switch(S.type){case"workspaces":return i(Kn((T=S.payload)==null?void 0:T.workspaces,mT,"workspaces","workspaces")),!0;case"create_workspace_error":{const C=typeof((E=S.payload)==null?void 0:E.requestId)=="string"?S.payload.requestId:"",j=typeof((N=S.payload)==null?void 0:N.message)=="string"?S.payload.message:"Failed to create workspace";if(r(!1),C){const D=u.current.get(C);D?(clearTimeout(D.timer),u.current.delete(C),d(),D.onError(j)):console.error("Received create_workspace_error for unknown requestId",{requestId:C,errorMessage:j})}else console.error("Received create_workspace_error without requestId",{errorMessage:j});return!0}default:return!1}},[d]),g=x.useCallback(()=>{for(const[,S]of u.current)clearTimeout(S.timer),S.onError("Disconnected");u.current.clear(),d()},[d]),v=x.useCallback((S,T,E,N,C,j,D,M,w)=>{const $={name:S,description:T||"",repoUrl:E||"",environmentId:N||"",defaultPersonaId:C||"",useWorktrees:j??!0,worktreeBasePath:D||""},V=crypto.randomUUID();$.requestId=V;const B=w??(()=>{}),q=setTimeout(()=>{u.current.delete(V)&&(d(),B("Request timed out"))},gC);u.current.set(V,{onSuccess:M??(()=>{}),onError:B,timer:q}),d(),t({type:"create_workspace",payload:$})},[t,d]),y=x.useCallback(S=>{t({type:"archive_workspace",payload:{workspaceId:S}})},[t]),b=x.useCallback((S,T)=>{t({type:"update_workspace",payload:{workspaceId:S,...T}})},[t]);return{workspaces:a,workspaceCreating:o,createWorkspace:v,archiveWorkspace:y,updateWorkspace:b,handleMessage:m,handleEvent:p,onDisconnect:g}}const yC=15e3;function bC(t){const[a,i]=x.useState([]),[o,r]=x.useState(void 0),u=x.useRef(new Map),d=x.useCallback(j=>{const D=j.payload;switch(j.type){case"task.created":{const M=typeof D.requestId=="string"?D.requestId:"";if(M){const $=u.current.get(M);$&&(clearTimeout($.timer),u.current.delete(M),$.onSuccess())}const w=typeof D.workspaceId=="string"?D.workspaceId:"";return w&&t({type:"list_tasks",payload:{workspaceId:w}}),!0}case"task.started":{const M=typeof D.taskId=="string"?D.taskId:"",w=typeof D.sessionId=="string"?D.sessionId:"",$=typeof D.workspaceId=="string"?D.workspaceId:"";return r(V=>M&&V===M?void 0:V),w&&(t({type:"list_sessions"}),M&&i(V=>V.map(B=>B.id===M?{...B,latestSessionId:w}:B))),$?t({type:"list_tasks",payload:{workspaceId:$}}):M&&i(V=>{const B=V.find(q=>q.id===M);return B!=null&&B.workspaceId?t({type:"list_tasks",payload:{workspaceId:B.workspaceId}}):t({type:"list_tasks",payload:{}}),V}),!0}case"task.completed":case"task.deleted":case"task.updated":{const M=typeof D.workspaceId=="string"?D.workspaceId:"",w=typeof D.taskId=="string"?D.taskId:"";return M?t({type:"list_tasks",payload:{workspaceId:M}}):w&&i($=>{const V=$.find(B=>B.id===w);return V!=null&&V.workspaceId?t({type:"list_tasks",payload:{workspaceId:V.workspaceId}}):t({type:"list_tasks",payload:{}}),$}),!0}default:return!1}},[t]),p=x.useCallback(j=>{var D,M,w,$;switch(j.type){case"tasks":{const V=Kn((D=j.payload)==null?void 0:D.tasks,gT,"tasks","tasks"),B=typeof((M=j.payload)==null?void 0:M.workspaceId)=="string"&&j.payload.workspaceId?j.payload.workspaceId:"";return B?(i(q=>[...q.filter(X=>X.workspaceId!==B),...V]),!0):(i(q=>{const X=new Set(V.map(ae=>ae.id));return[...q.filter(ae=>!X.has(ae.id)),...V]}),!0)}case"create_task_error":{const V=typeof((w=j.payload)==null?void 0:w.requestId)=="string"?j.payload.requestId:"",B=typeof(($=j.payload)==null?void 0:$.message)=="string"?j.payload.message:"Failed to create task";if(V){const q=u.current.get(V);q?(clearTimeout(q.timer),u.current.delete(V),q.onError(B)):console.error("[useTasks] create_task_error with unknown requestId:",B)}else console.error("[useTasks] create_task_error:",B);return!0}default:return!1}},[]),m=x.useCallback(()=>{r(void 0);for(const[,j]of u.current)clearTimeout(j.timer),j.onError("Disconnected");u.current.clear()},[]),g=x.useCallback(j=>{t({type:"list_tasks",payload:{workspaceId:j}})},[t]),v=x.useCallback(()=>{t({type:"list_tasks",payload:{}})},[t]),y=x.useCallback((j,D,M,w,$,V,B,q,X)=>{const ae={workspaceId:j,title:D,description:M||"",dependsOn:w||[],parentTaskId:$||"",defaultPersonaId:V||"",canDecompose:B||!1};if(q||X){const te=crypto.randomUUID();ae.requestId=te;const Q=X??(()=>{}),F=setTimeout(()=>{u.current.delete(te)&&Q("Request timed out")},yC);u.current.set(te,{onSuccess:q??(()=>{}),onError:Q,timer:F})}t({type:"create_task",payload:ae})},[t]),b=x.useCallback((j,D,M,w)=>{r(j),t({type:"start_task",payload:{taskId:j,personaId:D||"",environmentId:M||"",notes:w||""}})},[t]),S=x.useCallback(j=>{t({type:"stop_task",payload:{taskId:j}})},[t]),T=x.useCallback(j=>{t({type:"complete_task",payload:{taskId:j}})},[t]),E=x.useCallback(j=>{t({type:"resume_task",payload:{taskId:j}})},[t]),N=x.useCallback((j,D,M,w,$)=>{const V={taskId:j,title:D,description:M,dependsOn:w};$!==void 0&&(V.defaultPersonaId=$),t({type:"update_task",payload:V})},[t]),C=x.useCallback(j=>{t({type:"delete_task",payload:{taskId:j}})},[t]);return{tasks:a,taskStartingId:o,loadTasks:g,loadAllTasks:v,createTask:y,startTask:b,stopTask:S,completeTask:T,resumeTask:E,updateTask:N,deleteTask:C,handleMessage:p,handleEvent:d,onDisconnect:m}}function xC(t){const[a,i]=x.useState([]),o=x.useCallback(p=>{if(p.type==="finding.posted"){const m=typeof p.payload.workspaceId=="string"?p.payload.workspaceId:"";return m&&t({type:"list_findings",payload:{workspaceId:m}}),!0}return!1},[t]),r=x.useCallback(p=>{var m;switch(p.type){case"findings":return i(Kn((m=p.payload)==null?void 0:m.findings,vT,"findings","findings")),!0;default:return!1}},[]),u=x.useCallback(p=>{t({type:"list_findings",payload:{workspaceId:p}})},[t]),d=x.useCallback((p,m,g,v,y)=>{t({type:"post_finding",payload:{workspaceId:p,title:m,content:g,category:v||"general",tags:y||[]}})},[t]);return{findings:a,loadFindings:u,postFinding:d,handleMessage:r,handleEvent:o}}function _C(t){const[a,i]=x.useState([]),o=x.useCallback(m=>m.type==="token.changed"?(t({type:"list_tokens"}),!0):!1,[t]),r=x.useCallback(m=>{var g;switch(m.type){case"tokens":return i(Kn((g=m.payload)==null?void 0:g.tokens,yT,"tokens","tokens")),!0;default:return!1}},[]),u=x.useCallback(()=>{t({type:"list_tokens"})},[t]),d=x.useCallback((m,g,v,y,b)=>{t({type:"set_token",payload:{name:m,value:g,tokenType:v,envVar:y,filePath:b}})},[t]),p=x.useCallback(m=>{t({type:"delete_token",payload:{name:m}})},[t]);return{tokens:a,loadTokens:u,setToken:d,deleteToken:p,handleMessage:r,handleEvent:o}}function SC(t){const[a,i]=x.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),o=x.useCallback(d=>d.type==="credential.providers_changed"?(iy(d.payload)&&i(d.payload),!0):!1,[]),r=x.useCallback(d=>{switch(d.type){case"credential_providers":return iy(d.payload)&&i(d.payload),!0;default:return!1}},[]),u=x.useCallback(d=>{t({type:"set_credential_providers",payload:d})},[t]);return{credentialProviders:a,updateCredentialProviders:u,handleMessage:r,handleEvent:o}}function TC(t,a){const[i,o]=x.useState([]),[r,u]=x.useState(""),[d,p]=x.useState(""),[m,g]=x.useState(!1),v=x.useCallback(S=>{var T,E,N;switch(S.type){case"codespaces_list":{const C=Kn((T=S.payload)==null?void 0:T.codespaces,xT,"codespaces_list","codespaces"),j=typeof((E=S.payload)==null?void 0:E.error)=="string"?S.payload.error:"";return o(C),p(j),!0}case"codespace_created":return g(!1),t({type:"list_codespaces"}),!0;case"codespace_create_error":{g(!1);const C=typeof((N=S.payload)==null?void 0:N.message)=="string"?S.payload.message:"Failed to create codespace";return u(C),!0}default:return!1}},[t]),y=x.useCallback(()=>{t({type:"list_codespaces"})},[t]),b=x.useCallback((S,T)=>{if(!a){u("Not connected to server. Please try again once the connection is restored.");return}g(!0),u("");const E={repo:S};T&&(E.machine=T),t({type:"create_codespace",payload:E})},[t,a]);return{codespaces:i,codespaceError:r,codespaceListError:d,codespaceCreating:m,listCodespaces:y,createCodespace:b,handleMessage:v}}function kC(t){const[a,i]=x.useState([]),o=x.useCallback(m=>{switch(m.type){case"persona.created":case"persona.updated":case"persona.deleted":return t({type:"list_personas"}),!0;default:return!1}},[t]),r=x.useCallback(m=>{var g;switch(m.type){case"personas":{const v=Kn((g=m.payload)==null?void 0:g.personas,_T,"personas","personas");return i(v),!0}default:return!1}},[]),u=x.useCallback((m,g,v,y,b,S,T,E)=>{t({type:"create_persona",payload:{name:m,description:g,systemPrompt:v,runtime:y||"",model:b||"",maxTurns:S||0,type:T||"agent",script:E||""}})},[t]),d=x.useCallback((m,g,v,y,b,S,T,E,N)=>{const C={personaId:m};g!==void 0&&(C.name=g),v!==void 0&&(C.description=v),y!==void 0&&(C.systemPrompt=y),b!==void 0&&(C.runtime=b),S!==void 0&&(C.model=S),T!==void 0&&(C.maxTurns=T),E!==void 0&&(C.type=E),N!==void 0&&(C.script=N),t({type:"update_persona",payload:C})},[t]),p=x.useCallback(m=>{t({type:"delete_persona",payload:{personaId:m}})},[t]);return{personas:a,createPersona:u,updatePersona:d,deletePersona:p,handleMessage:r,handleEvent:o}}function qr(t,a=0){return{id:t.id,label:t.title||t.label||t.id,kind:t.kind,category:t.category,sourceType:t.sourceType,sourceId:t.sourceId,content:t.content,tags:t.tags,workspaceId:t.workspaceId,createdAt:t.createdAt,updatedAt:t.updatedAt,val:a}}function tf(t){return{source:t.fromId,target:t.toId,type:t.type}}const CC=new Set(["knowledge.listRecent.result","knowledge.search.result","knowledge.getNode.result","knowledge.expand.result"]);function EC(t){const[a,i]=x.useState(new Map),[o,r]=x.useState([]),[u,d]=x.useState(void 0),[p,m]=x.useState(void 0),[g,v]=x.useState(!1),[y,b]=x.useState(""),S=x.useCallback(M=>{v(!0),t({type:"knowledge.listRecent",payload:{limit:30,workspaceId:M}})},[t]),T=x.useCallback(M=>{M.trim()&&(b(M),m(void 0),d(void 0),v(!0),t({type:"knowledge.search",payload:{query:M,limit:20}}))},[t]),E=x.useCallback(()=>{b(""),S()},[S]),N=x.useCallback(M=>{m(M),t({type:"knowledge.getNode",payload:{id:M}})},[t]),C=x.useCallback(()=>{m(void 0),d(void 0)},[]),j=x.useCallback(M=>{t({type:"knowledge.expand",payload:{id:M,depth:1}})},[t]),D=x.useCallback(M=>{if(!CC.has(M.type))return!1;const w=M.payload??{};switch(M.type){case"knowledge.listRecent.result":{if(w.error)return v(!1),!0;const $=w.nodes??[],V=w.edges??[],B=new Map,q=[];for(const X of $)B.set(X.id,qr(X));for(const X of V)q.push(tf(X));for(const X of q){const ae=B.get(X.source);ae&&(ae.val+=1);const te=B.get(X.target);te&&(te.val+=1)}return i(B),r(q),v(!1),!0}case"knowledge.search.result":{if(w.error)return v(!1),!0;const $=w.results??[],V=new Map,B=[];for(const q of $){const X=q.node,ae=q.edges??[];V.set(X.id,qr(X,ae.length));for(const te of ae)B.push(tf(te))}return i(V),r(B),v(!1),!0}case"knowledge.getNode.result":{if(w.error)return d(void 0),!0;const $=w.node,V=w.edges??[];return d({node:qr($,V.length),edges:V.map(B=>({fromId:B.fromId,toId:B.toId,type:B.type,metadata:B.metadata}))}),!0}case"knowledge.expand.result":{const $=w.nodes??[],V=w.edges??[];return i(B=>{const q=new Map(B);for(const X of $)q.has(X.id)||q.set(X.id,qr(X));return q}),r(B=>{const q=new Set(B.map(ae=>`${ae.source}:${ae.target}:${ae.type}`)),X=[];for(const ae of V){const te=tf(ae),Q=`${te.source}:${te.target}:${te.type}`;q.has(Q)||X.push(te)}return[...B,...X]}),!0}}return!1},[]);return{graphData:{nodes:[...a.values()],links:o},selectedNode:u,selectedId:p,loading:g,searchQuery:y,search:T,clearSearch:E,selectNode:N,clearSelection:C,expandNode:j,loadRecent:S,handleMessage:D}}function NC(t){const[a,i]=x.useState(""),[o,r]=x.useState(void 0),[u,d]=x.useState({}),{connected:p,send:m}=dC(t,{onMessage:q,onConnect:X,onDisconnect:ae}),g=hC(m),v=mC(m),y=vC(m),b=bC(m),S=xC(m),T=_C(m),E=SC(m),N=TC(m,p),C=kC(m),j=EC(m),D="default_persona_id",M="onboarding_completed",w=x.useCallback(Q=>{i(Q),m({type:"set_setting",payload:{key:D,value:Q}})},[m]),$=x.useCallback(()=>{r(!0),m({type:"set_setting",payload:{key:M,value:"true"}})},[m]),V=x.useCallback((Q,F)=>{m({type:"get_usage",payload:{scope:Q,id:F}})},[m]);function B(Q){const F=Q.payload.key,ne=Q.payload.value;if(Q.type==="setting.changed"){F===D&&i(ne??""),F===M&&r(ne==="true");return}g.handleEvent(Q)||y.handleEvent(Q)||b.handleEvent(Q)||S.handleEvent(Q)||T.handleEvent(Q)||E.handleEvent(Q)||C.handleEvent(Q)}function q(Q){var F,ne,I,Y,oe;if(fT(Q)){B(Q);return}if(Q.type==="usage_stats"){const P=((F=Q.payload)==null?void 0:F.scope)||"",O=((ne=Q.payload)==null?void 0:ne.id)||"";if(P&&O){const ie=`${P}:${O}`;d(be=>{var re,Ke,yt,fe;return{...be,[ie]:{inputTokens:Number((re=Q.payload)==null?void 0:re.inputTokens)||0,outputTokens:Number((Ke=Q.payload)==null?void 0:Ke.outputTokens)||0,costUsd:Number((yt=Q.payload)==null?void 0:yt.costUsd)||0,sessionCount:Number((fe=Q.payload)==null?void 0:fe.sessionCount)||0}}})}return}if(Q.type==="setting"){const P=(I=Q.payload)==null?void 0:I.key,O=(Y=Q.payload)==null?void 0:Y.value;P===D&&i(O??""),P===M&&r(O==="true");return}if(!g.handleMessage(Q)&&!v.handleMessage(Q)&&!y.handleMessage(Q)&&!b.handleMessage(Q)&&!S.handleMessage(Q)&&!T.handleMessage(Q)&&!E.handleMessage(Q)&&!N.handleMessage(Q)&&!C.handleMessage(Q)&&!j.handleMessage(Q)&&Q.type==="error"){console.error("[ws]",(oe=Q.payload)==null?void 0:oe.message);return}}function X(Q){Q({type:"list_environments"}),Q({type:"list_sessions"}),Q({type:"list_workspaces"}),Q({type:"list_tokens"}),Q({type:"get_credential_providers"}),Q({type:"list_personas"}),Q({type:"get_setting",payload:{key:D}}),Q({type:"get_setting",payload:{key:M}}),Q({type:"list_tasks",payload:{}}),Q({type:"subscribe_all"})}function ae(){y.onDisconnect(),b.onDisconnect()}const te=x.useCallback(()=>{m({type:"list_environments"}),m({type:"list_sessions"}),m({type:"list_workspaces"}),m({type:"list_tokens"})},[m]);return{connected:p,send:m,environments:g.environments,sessions:v.sessions,events:v.events,eventsDropped:v.eventsDropped,lastSpawnedId:v.lastSpawnedId,workspaces:y.workspaces,tasks:b.tasks,findings:S.findings,tokens:T.tokens,spawn:v.spawn,sendInput:v.sendInput,kill:v.kill,refresh:te,loadSessionEvents:v.loadSessionEvents,clearEvents:v.clearEvents,createWorkspace:y.createWorkspace,archiveWorkspace:y.archiveWorkspace,updateWorkspace:y.updateWorkspace,loadTasks:b.loadTasks,loadAllTasks:b.loadAllTasks,createTask:b.createTask,startTask:b.startTask,stopTask:b.stopTask,completeTask:b.completeTask,resumeTask:b.resumeTask,updateTask:b.updateTask,deleteTask:b.deleteTask,loadFindings:S.loadFindings,postFinding:S.postFinding,addEnvironment:g.addEnvironment,updateEnvironment:g.updateEnvironment,loadTokens:T.loadTokens,setToken:T.setToken,deleteToken:T.deleteToken,credentialProviders:E.credentialProviders,updateCredentialProviders:E.updateCredentialProviders,provisionStatus:g.provisionStatus,provisionEnvironment:g.provisionEnvironment,stopEnvironment:g.stopEnvironment,removeEnvironment:g.removeEnvironment,codespaces:N.codespaces,codespaceError:N.codespaceError,codespaceListError:N.codespaceListError,codespaceCreating:N.codespaceCreating,listCodespaces:N.listCodespaces,createCodespace:N.createCodespace,workspaceCreating:y.workspaceCreating,taskStartingId:b.taskStartingId,personas:C.personas,createPersona:C.createPersona,updatePersona:C.updatePersona,deletePersona:C.deletePersona,taskSessions:v.taskSessions,loadTaskSessions:v.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:w,onboardingCompleted:o,completeOnboarding:$,usageCache:u,loadUsage:V,knowledge:j}}const dh=x.createContext(void 0);function jC({children:t}){const a=NC();return c.jsx(dh.Provider,{value:a,children:t})}function qe(){const t=x.useContext(dh);if(!t)throw new Error("useGrackle must be used within GrackleProvider");return t}const wC=[{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}],AC=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",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:"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:"failed",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}],DC=[{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T14:00:01Z",content:"running"},{sessionId:"sess-001-prev",eventType:"output",timestamp:"2026-02-26T14:00:05Z",content:"Reading src/middleware/auth.ts to understand the current authentication flow..."},{sessionId:"sess-001-prev",eventType:"error",timestamp:"2026-02-26T15:12:00Z",content:"Context window exceeded before completing implementation"},{sessionId:"sess-001",eventType:"status",timestamp:"2026-02-27T08:15:01Z",content:"running"},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:02Z",content:"Analyzing current authentication middleware in src/middleware/auth.ts..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:04Z",content:`Found 3 files using session-based auth:
38
- - src/middleware/auth.ts
39
- - src/routes/login.ts
40
- - src/routes/protected.ts`},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:07Z",content:"Installing jsonwebtoken and @types/jsonwebtoken..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:12Z",content:`Rewriting auth middleware:
41
- \`\`\`typescript
42
- import jwt from "jsonwebtoken";
43
- import type { Request, Response, NextFunction } from "express";
44
-
45
- const JWT_SECRET = process.env.JWT_SECRET || "change-me";
46
-
47
- export function verifyToken(req: Request, res: Response, next: NextFunction): void {
48
- const header = req.headers.authorization;
49
- if (!header?.startsWith("Bearer ")) {
50
- res.status(401).json({ error: "Missing token" });
51
- return;
52
- }
53
- try {
54
- const decoded = jwt.verify(header.slice(7), JWT_SECRET);
55
- req.user = decoded;
56
- next();
57
- } catch {
58
- res.status(403).json({ error: "Invalid token" });
59
- }
60
- }
61
- \`\`\``},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:18Z",content:"Updated login route to issue JWT tokens with 24h expiry."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:22Z",content:"Running test suite... 14 tests passed, 2 updated, 0 failed."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:30:05Z",content:"Generating pytest tests for POST /api/register endpoint..."},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:32:00Z",content:"Created 8 test cases covering: valid registration, duplicate email, weak password, missing fields, SQL injection, XSS payload, rate limit, and CORS headers."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"}],MC=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",environmentId:"env-local-01",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-01-15T10:00:00Z",updatedAt:"2026-01-15T10:00:00Z"},{id:"proj-beta",name:"Data Pipeline",description:"ETL pipelines for analytics and reporting",repoUrl:"https://github.com/acme/data-pipeline",environmentId:"env-docker-01",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-02-01T14:30:00Z",updatedAt:"2026-02-01T14:30:00Z"},{id:"proj-gamma",name:"Mobile App",description:"React Native cross-platform mobile application",repoUrl:"",environmentId:"env-local-01",status:"archived",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],RC=[{id:"task-001",workspaceId:"proj-alpha",title:"Implement JWT authentication",description:"Replace session-based auth with JWT tokens across all protected routes",status:"working",branch:"feat/jwt-auth",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-001a","task-001b","task-001c"],canDecompose:!0,defaultPersonaId:""},{id:"task-001a",workspaceId:"proj-alpha",title:"Design token schema",description:"Define JWT payload structure, expiry, and refresh token strategy",status:"complete",branch:"feat/jwt-auth/design-token-schema",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:10:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-001b",workspaceId:"proj-alpha",title:"Implement auth middleware",description:"Build Express middleware that verifies JWT Bearer tokens",status:"working",branch:"feat/jwt-auth/implement-auth-middleware",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:15:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-001c",workspaceId:"proj-alpha",title:"Write auth integration tests",description:"End-to-end tests for login flow, token refresh, and protected route access",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-25T10:20:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-002",workspaceId:"proj-alpha",title:"Add rate limiting",description:"Implement token-bucket rate limiting for public API endpoints",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:05:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-003",workspaceId:"proj-alpha",title:"Set up OpenAPI documentation",description:"Generate Swagger docs from route decorators and serve at /api/docs",status:"paused",branch:"feat/openapi-docs",latestSessionId:"sess-002",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-24T16:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-004",workspaceId:"proj-alpha",title:"Database connection pooling",description:"Switch from single connection to a connection pool with health checks",status:"complete",branch:"feat/db-pool",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-23T11:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-005",workspaceId:"proj-alpha",title:"Fix N+1 query in user list",description:"Use a JOIN instead of per-row lookups in GET /api/users",status:"not_started",branch:"fix/user-list-n1",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:5,createdAt:"2026-02-22T09:30:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006",workspaceId:"proj-beta",title:"Add Parquet export support",description:"Allow pipeline outputs to be written as Parquet files for Spark consumption",status:"working",branch:"feat/parquet-export",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-006a","task-006b","task-006c","task-006d"],canDecompose:!0,defaultPersonaId:""},{id:"task-006a",workspaceId:"proj-beta",title:"Define Parquet schema mapping",description:"Map internal column types to Arrow/Parquet type system",status:"complete",branch:"feat/parquet-export/define-parquet-schema-mapping",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:05:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006b",workspaceId:"proj-beta",title:"Implement row-group writer",description:"Write buffered row groups with configurable batch size",status:"complete",branch:"feat/parquet-export/implement-row-group-writer",latestSessionId:"",dependsOn:["task-006a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:10:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006c",workspaceId:"proj-beta",title:"Add compression options",description:"Support Snappy, ZSTD, and GZIP compression for Parquet output",status:"working",branch:"feat/parquet-export/add-compression-options",latestSessionId:"sess-004",dependsOn:["task-006b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T08:15:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006d",workspaceId:"proj-beta",title:"Write Parquet integration tests",description:"Round-trip tests: write Parquet, read back with pyarrow, verify data integrity",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-006c"],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-26T08:20:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-007",workspaceId:"proj-beta",title:"Implement incremental loads",description:"Track watermarks so pipelines only process new/changed rows",status:"working",branch:"feat/incremental",latestSessionId:"sess-004",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:30:00Z",parentTaskId:"",depth:0,childTaskIds:["task-007a","task-007b"],canDecompose:!0,defaultPersonaId:""},{id:"task-007a",workspaceId:"proj-beta",title:"Design watermark storage",description:"Define schema for per-pipeline high-watermark tracking",status:"complete",branch:"feat/incremental/design-watermark-storage",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:35:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-007b",workspaceId:"proj-beta",title:"Implement change detection query",description:"Generate WHERE clauses from watermarks to fetch only changed rows",status:"failed",branch:"feat/incremental/implement-change-detection-query",latestSessionId:"",dependsOn:["task-007a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:40:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-008",workspaceId:"proj-beta",title:"Add pipeline monitoring dashboard",description:"Real-time metrics for pipeline throughput, latency, and error rates",status:"paused",branch:"feat/monitoring",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T09:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""}],py=[{id:"find-001",workspaceId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"architecture",title:"Auth middleware is tightly coupled to Express",content:"The current auth middleware directly references Express Request/Response types. Consider extracting a framework-agnostic token verification layer so we can reuse it in the WebSocket auth path.",tags:["auth","decoupling","middleware"],createdAt:"2026-02-27T08:16:00Z"},{id:"find-002",workspaceId:"proj-alpha",taskId:"task-003",sessionId:"sess-002",category:"api",title:"Missing pagination on GET /api/users",content:"The users endpoint returns all rows without limit/offset. For datasets over 10k rows this will cause timeouts. Recommend cursor-based pagination with a default page size of 50.",tags:["api","pagination","performance"],createdAt:"2026-02-27T07:31:00Z"},{id:"find-003",workspaceId:"proj-alpha",taskId:"task-005",sessionId:"sess-003",category:"bug",title:"Race condition in session cleanup",content:"When two requests hit /api/logout concurrently, the second call throws a 500 because the session row has already been deleted. Needs an idempotent DELETE or a conditional check.",tags:["bug","concurrency","sessions"],createdAt:"2026-02-26T22:50:00Z"},{id:"find-004",workspaceId:"proj-alpha",taskId:"task-004",sessionId:"",category:"decision",title:"Chose pg-pool over knex connection pool",content:"pg-pool gives us direct control over idle timeout, max connections, and health check queries. Knex wraps pg-pool anyway and adds overhead we don't need since we write raw SQL.",tags:["database","decision","postgres"],createdAt:"2026-02-23T11:30:00Z"},{id:"find-005",workspaceId:"proj-alpha",taskId:"",sessionId:"",category:"dependency",title:"jsonwebtoken has 3 high-severity CVEs",content:"The jsonwebtoken package (v8.x) has known vulnerabilities. Consider migrating to jose which is maintained, supports ESM, and covers the same JWS/JWE surface area with zero dependencies.",tags:["security","dependency","jwt"],createdAt:"2026-02-27T08:20:00Z"},{id:"find-006",workspaceId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"pattern",title:"Consistent error response shape",content:"All error responses should follow the shape `{ error: string, code: string, details?: unknown }`. Currently some routes return `{ message: string }` and others return `{ error: string }`.",tags:["api","consistency","error-handling"],createdAt:"2026-02-27T08:17:00Z"},{id:"find-007",workspaceId:"proj-beta",taskId:"task-007",sessionId:"sess-004",category:"architecture",title:"Watermark storage should be pluggable",content:"The incremental load watermarks are currently stored in a local SQLite file. For production multi-worker scenarios, this needs to be backed by a shared store (Redis or Postgres).",tags:["architecture","pipeline","scalability"],createdAt:"2026-02-27T09:05:00Z"}],OC=[{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:""}],BC=[{id:"persona-arch",name:"Software Architect",description:"Designs system architecture, defines interfaces, and decomposes large features into implementable tasks.",systemPrompt:"You are a senior software architect. Focus on clean interfaces, separation of concerns, and scalable patterns. When decomposing work, create concrete subtasks with clear acceptance criteria.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z",type:"agent",script:""},{id:"persona-fe",name:"Frontend Engineer",description:"React specialist — builds UI components, writes CSS, implements routing, and creates Playwright tests.",systemPrompt:"You are a frontend engineer specializing in React, TypeScript, and modern CSS. Follow component composition patterns, use semantic HTML, and write accessible markup.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z",type:"agent",script:""},{id:"persona-reviewer",name:"Code Reviewer",description:"Reviews diffs for correctness, security, and style. Posts findings for issues discovered.",systemPrompt:"You are a meticulous code reviewer. Check for security vulnerabilities, performance issues, and style consistency. Post findings for anything noteworthy.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z",type:"agent",script:""},{id:"persona-tester",name:"QA Engineer",description:"Writes comprehensive test suites — unit tests, integration tests, and E2E Playwright specs.",systemPrompt:"You are a QA engineer focused on test coverage. Write tests that cover happy paths, edge cases, error scenarios, and accessibility. Use Playwright for E2E tests.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z",type:"agent",script:""},{id:"persona-lint",name:"Lint & Format",description:"Scripted persona — runs ESLint and Prettier on changed files, auto-fixes violations, and posts a findings summary.",systemPrompt:"",toolConfig:"{}",runtime:"genaiscript",model:"",maxTurns:1,mcpServers:"[]",createdAt:"2026-02-21T09:00:00Z",updatedAt:"2026-02-21T09:00:00Z",type:"script",script:`const files = env.files.filter(f => /\\.(ts|tsx|js)$/.test(f.filename));
62
- for (const f of files) {
63
- const eslintResult = await host.exec("npx", ["eslint", "--fix", f.filename]);
64
- if (eslintResult.exitCode !== 0) {
65
- env.findings.push({ category: "lint", title: \`Lint issues in \${f.filename}\`, content: eslintResult.stderr });
66
- }
67
- const prettierResult = await host.exec("npx", ["prettier", "--write", f.filename]);
68
- if (prettierResult.exitCode !== 0) {
69
- env.findings.push({ category: "format", title: \`Prettier issues in \${f.filename}\`, content: prettierResult.stderr });
70
- }
71
- }
72
- env.findings.push({ category: "summary", title: "Lint & format pass complete", content: \`Ran ESLint and Prettier on \${files.length} files\` });`}],IC={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",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 Nt(t){return new Date(Date.now()+t).toISOString()}const my=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Nt(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Nt(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Nt(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:Nt(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:Nt(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Nt(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Nt(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Nt(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Nt(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:Nt(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:Nt(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Nt(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:Nt(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Nt(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Nt(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Nt(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Nt(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:Nt(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:Nt(3500),content:"failed"}}]}],gy=400;function LC({children:t}){const[a,i]=x.useState(wC),[o,r]=x.useState(AC),[u,d]=x.useState(DC),[p,m]=x.useState(void 0),[g,v]=x.useState(MC),[y,b]=x.useState(RC),[S,T]=x.useState(py),[E,N]=x.useState(OC),[C,j]=x.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[D,M]=x.useState(BC),[w]=x.useState(IC),[$,V]=x.useState(""),B=x.useRef(0),q=x.useRef(0),X=x.useRef(new Set),ae=x.useRef(new Map),te=x.useRef(y);te.current=y;const Q=x.useRef(new Map),F=x.useRef(new Map),ne=x.useCallback(J=>(B.current+=1,`mock-${J}-${String(B.current).padStart(3,"0")}`),[]),I=x.useCallback(()=>{const J=my[q.current%my.length];return q.current+=1,J},[]),Y=x.useCallback((J,le,ce)=>{const _e=setTimeout(()=>{var xe;X.current.delete(_e),ce&&((xe=ae.current.get(ce))==null||xe.delete(_e)),J()},le);X.current.add(_e),ce&&(ae.current.has(ce)||ae.current.set(ce,new Set),ae.current.get(ce).add(_e))},[]),oe=x.useCallback(J=>{const le=ae.current.get(J);le&&(le.forEach(ce=>{clearTimeout(ce),X.current.delete(ce)}),ae.current.delete(J))},[]),P=x.useCallback((J,le)=>{r(ce=>ce.map(_e=>_e.id===J?{..._e,status:le}:_e))},[]),O=x.useCallback(J=>{d(le=>[...le,J])},[]),ie=x.useCallback((J,le,ce)=>{le.forEach((_e,xe)=>{Y(()=>{const Qe={sessionId:J,..._e.event,timestamp:new Date().toISOString()};O(Qe),_e.event.eventType==="status"&&P(J,_e.event.content),xe===le.length-1&&ce&&ce()},_e.delayMs,J)})},[Y,O,P]),be=x.useCallback((J,le,ce,_e)=>{console.log("[MockGrackle] spawn",{environmentId:J,prompt:le,runtime:_e});const xe=ne("sess"),Qe={id:xe,environmentId:J,runtime:_e||"claude-code",status:"running",prompt:le,startedAt:new Date().toISOString()};r(lt=>[...lt,Qe]),m(xe);const je=I();if(console.log(`[MockGrackle] Playing scenario: ${je.label}`),je.pauseForInput){const lt=je.pauseAfterStep??je.steps.length-1,Ne=je.steps.slice(0,lt+1),tt=Ne.length>0?Ne[Ne.length-1].delayMs:0;ie(xe,Ne),Y(()=>{P(xe,"idle"),O({sessionId:xe,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},tt+gy,xe),je.resumeSteps&&Q.current.set(xe,je.resumeSteps)}else ie(xe,je.steps)},[ne,I,ie,Y,P,O]),re=x.useCallback(J=>{console.log("[MockGrackle] kill",J),oe(J),Q.current.delete(J),P(J,"interrupted"),O({sessionId:J,eventType:"status",timestamp:new Date().toISOString(),content:"interrupted"}),b(le=>le.map(ce=>ce.latestSessionId===J&&ce.status==="working"?{...ce,status:"not_started"}:ce))},[oe,P,O]),Ke=x.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),yt=x.useCallback(J=>{console.log("[MockGrackle] loadSessionEvents",J)},[]),fe=x.useCallback(()=>{console.log("[MockGrackle] clearEvents"),d([])},[]),Mt=x.useCallback((J,le,ce,_e,xe,Qe,je,lt,Ne)=>{console.log("[MockGrackle] createWorkspace",{name:J,description:le});const tt={id:ne("proj"),name:J,description:le||"",repoUrl:ce||"",environmentId:_e||"",status:"active",worktreeBasePath:je||"",useWorktrees:Qe??!0,defaultPersonaId:xe||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(Pe=>[...Pe,tt]),lt&&lt()},[ne]),mn=x.useCallback(J=>{console.log("[MockGrackle] archiveWorkspace",J),v(le=>le.map(ce=>ce.id===J?{...ce,status:"archived"}:ce))},[]),Mn=x.useCallback(J=>{console.log("[MockGrackle] loadTasks",J)},[]),Ln=x.useCallback((J,le,ce,_e,xe,Qe,je,lt,Ne)=>{console.log("[MockGrackle] createTask",{workspaceId:J,title:le,parentTaskId:xe}),b(tt=>{const Gt=tt.filter(gn=>gn.workspaceId===J).reduce((gn,Ca)=>Math.max(gn,Ca.sortOrder),0),tn=xe?tt.find(gn=>gn.id===xe):void 0;if(xe&&!tn)return console.warn("[MockGrackle] Parent task not found:",xe),tt;if(tn&&!tn.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",xe),tt;const Vt=tn?tn.depth+1:0,ka={id:ne("task"),workspaceId:J,title:le,description:ce||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:_e||[],reviewNotes:void 0,sortOrder:Gt+1,createdAt:new Date().toISOString(),parentTaskId:xe||"",depth:Vt,childTaskIds:[],canDecompose:je??!xe,defaultPersonaId:Qe||""};return[...tt,ka]}),lt&&lt()},[ne]),Te=x.useCallback((J,le,ce,_e)=>{var tt;console.log("[MockGrackle] startTask",{taskId:J});const xe=te.current.find(Pe=>Pe.id===J),Qe=(xe==null?void 0:xe.title)??"",je=ne("sess"),lt={id:je,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Qe||J,startedAt:new Date().toISOString()};r(Pe=>[...Pe,lt]),b(Pe=>Pe.map(Gt=>Gt.id===J?{...Gt,status:"working",latestSessionId:je,branch:`mock/${J.slice(0,8)}`}:Gt));const Ne=I();if(console.log(`[MockGrackle] Playing task scenario: ${Ne.label}`),Ne.pauseForInput){const Pe=Ne.pauseAfterStep??Ne.steps.length-1,Gt=Ne.steps.slice(0,Pe+1),tn=Gt.length>0?Gt[Gt.length-1].delayMs:0;if(ie(je,Gt),Y(()=>{P(je,"idle"),O({sessionId:je,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},tn+gy,je),Ne.resumeSteps){const Vt=[...Ne.resumeSteps];Q.current.set(je,Vt);const ka=Vt.reduce((gn,Ca)=>Math.max(gn,Ca.delayMs),0);F.current.set(je,{taskId:J,delayAfterResume:ka+200})}}else{const Pe=Ne.steps.length>0?Ne.steps[Ne.steps.length-1].delayMs:0;ie(je,Ne.steps);const Gt=(tt=Ne.steps[Ne.steps.length-1])==null?void 0:tt.event.content;Y(()=>{Gt==="completed"?b(tn=>tn.map(Vt=>Vt.id===J&&Vt.status==="working"?{...Vt,status:"paused"}:Vt)):Gt==="failed"&&b(tn=>tn.map(Vt=>Vt.id===J&&Vt.status==="working"?{...Vt,status:"failed"}:Vt))},Pe+100,je)}},[ne,I,ie,Y,P,O]),pt=x.useCallback((J,le)=>{console.log("[MockGrackle] sendInput",{sessionId:J,text:le}),O({sessionId:J,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${le}`}),P(J,"running"),O({sessionId:J,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const ce=Q.current.get(J);if(ce)Q.current.delete(J),ie(J,ce);else{const xe=[{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"}}];ie(J,xe)}const _e=F.current.get(J);_e&&(F.current.delete(J),Y(()=>{b(xe=>xe.map(Qe=>Qe.id===_e.taskId&&Qe.status==="working"?{...Qe,status:"paused"}:Qe))},_e.delayAfterResume,J))},[O,P,ie,Y]),Hs=x.useCallback(J=>{console.log("[MockGrackle] completeTask",J),b(le=>le.map(ce=>ce.id===J?{...ce,status:"complete"}:ce))},[]),Un=x.useCallback(J=>{console.log("[MockGrackle] resumeTask",J)},[]),Ps=x.useCallback((J,le,ce,_e,xe)=>{console.log("[MockGrackle] updateTask",{taskId:J,title:le}),b(Qe=>Qe.map(je=>je.id===J?{...je,title:le.trim()||je.title,description:ce,dependsOn:_e,...xe!==void 0?{defaultPersonaId:xe}:{}}:je))},[]),Gs=x.useCallback(J=>{console.log("[MockGrackle] deleteTask",J),b(le=>le.filter(ce=>ce.id!==J))},[]),Nl=x.useCallback(J=>{console.log("[MockGrackle] loadFindings",J),T(py.filter(le=>le.workspaceId===J))},[]),eo=x.useCallback((J,le,ce,_e,xe)=>{console.log("[MockGrackle] postFinding",{workspaceId:J,title:le});const Qe={id:ne("find"),workspaceId:J,taskId:"",sessionId:"",category:_e||"general",title:le,content:ce,tags:xe||[],createdAt:new Date().toISOString()};T(je=>[...je,Qe])},[ne]),$s=x.useCallback((J,le,ce)=>{console.log("[MockGrackle] addEnvironment",{displayName:J,adapterType:le,adapterConfig:ce})},[]),Fs=x.useCallback((J,le)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:J,...le}),i(ce=>ce.map(_e=>_e.id!==J?_e:{..._e,...le.displayName!==void 0?{displayName:le.displayName}:{},...le.adapterConfig!==void 0?{adapterConfig:JSON.stringify(le.adapterConfig)}:{}}))},[]),qs=x.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),jl=x.useCallback((J,le,ce,_e,xe)=>{console.log("[MockGrackle] setToken",{name:J,tokenType:ce}),N(Qe=>[...Qe.filter(lt=>lt.name!==J),{name:J,tokenType:ce,envVar:_e,filePath:xe,expiresAt:""}])},[]),wl=x.useCallback(J=>{console.log("[MockGrackle] deleteToken",J),N(le=>le.filter(ce=>ce.name!==J))},[]),zt=x.useCallback(J=>{console.log("[MockGrackle] updateCredentialProviders",J),j(J)},[]);x.useEffect(()=>()=>{X.current.forEach(clearTimeout),X.current.clear()},[]);const Bc=x.useMemo(()=>({connected:!0,send:()=>{},environments:a,sessions:o,events:u,eventsDropped:0,lastSpawnedId:p,workspaces:g,tasks:y,findings:S,tokens:E,credentialProviders:C,spawn:be,sendInput:pt,kill:re,refresh:Ke,loadSessionEvents:yt,clearEvents:fe,createWorkspace:Mt,archiveWorkspace:mn,updateWorkspace:(J,le)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:J,...le}),v(ce=>ce.map(_e=>_e.id!==J?_e:{..._e,...le.name!==void 0?{name:le.name}:{},...le.description!==void 0?{description:le.description}:{},...le.repoUrl!==void 0?{repoUrl:le.repoUrl}:{},...le.environmentId!==void 0?{environmentId:le.environmentId}:{},...le.worktreeBasePath!==void 0?{worktreeBasePath:le.worktreeBasePath}:{},...le.useWorktrees!==void 0?{useWorktrees:le.useWorktrees}:{},...le.defaultPersonaId!==void 0?{defaultPersonaId:le.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:Mn,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:Ln,startTask:Te,stopTask:J=>{console.log("[MockGrackle] stopTask",{taskId:J}),Hs(J)},completeTask:Hs,resumeTask:Un,updateTask:Ps,deleteTask:Gs,loadFindings:Nl,postFinding:eo,addEnvironment:$s,updateEnvironment:Fs,loadTokens:qs,setToken:jl,deleteToken:wl,updateCredentialProviders:zt,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:D,createPersona:(J,le,ce,_e,xe,Qe,je,lt)=>{console.log("[MockGrackle] createPersona",{name:J});const Ne={id:`mock-persona-${Date.now()}`,name:J,description:le,systemPrompt:ce,toolConfig:"{}",runtime:_e??"claude-code",model:xe||"",maxTurns:Qe||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:je||"agent",script:lt||""};M(tt=>[...tt,Ne])},updatePersona:(J,le,ce,_e,xe,Qe,je,lt,Ne)=>{console.log("[MockGrackle] updatePersona",{personaId:J,name:le}),M(tt=>tt.map(Pe=>Pe.id!==J?Pe:{...Pe,...le!==void 0?{name:le}:{},...ce!==void 0?{description:ce}:{},..._e!==void 0?{systemPrompt:_e}:{},...xe!==void 0?{runtime:xe}:{},...Qe!==void 0?{model:Qe}:{},...je!==void 0?{maxTurns:je}:{},...lt!==void 0?{type:lt}:{},...Ne!==void 0?{script:Ne}:{},updatedAt:new Date().toISOString()}))},deletePersona:J=>{console.log("[MockGrackle] deletePersona",J),M(le=>le.filter(ce=>ce.id!==J))},taskSessions:w,loadTaskSessions:J=>{console.log("[MockGrackle] loadTaskSessions",J)},appDefaultPersonaId:$,setAppDefaultPersonaId:J=>{console.log("[MockGrackle] setAppDefaultPersonaId",J),V(J)},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:(J,le)=>{console.log(`[MockGrackle] loadUsage(${J}, ${le})`)},knowledge:{graphData:{nodes:[],links:[]},selectedNode:void 0,loading:!1,selectedId:void 0,searchQuery:"",search:()=>{},clearSearch:()=>{},selectNode:()=>{},clearSelection:()=>{},expandNode:()=>{},loadRecent:()=>{},handleMessage:()=>!1}}),[a,o,u,p,g,y,S,E,C,D,w,$,be,pt,re,Ke,yt,fe,Mt,mn,Mn,Ln,Te,Hs,Un,Ps,Gs,Nl,eo,$s,Fs,qs,jl,wl,zt]);return c.jsx(dh.Provider,{value:Bc,children:t})}const Tb=x.createContext(void 0),UC=4e3;function zC({children:t}){const[a,i]=x.useState([]),o=x.useRef(0),r=x.useCallback(d=>{i(p=>p.filter(m=>m.id!==d))},[]),u=x.useCallback((d,p="info",m=UC)=>{const g=`toast-${++o.current}`;i(v=>[...v,{id:g,message:d,variant:p,duration:m}])},[]);return c.jsx(Tb.Provider,{value:{toasts:a,showToast:u,dismissToast:r},children:t})}function Us(){const t=x.useContext(Tb);if(!t)throw new Error("useToast must be used within ToastProvider");return t}const Ec=[{id:"grackle",label:"Grackle",description:"The default Grackle theme — iridescent purple on clean dark.",swatches:["#0e1218","#8b5cf6","#60a5fa","#e5e7eb","#34d399"],variantLightId:"grackle-light",variantDarkId:"grackle-dark"},{id:"grackle-light",label:"Grackle Light",description:"Light Grackle variant.",hidden:!0},{id:"grackle-dark",label:"Grackle Dark",description:"Dark Grackle variant.",hidden:!0},{id:"glass",label:"Glassmorphism",description:"Dark frosted-glass aesthetic with backdrop blur effects.",swatches:["#0a0c14","#4ecca3","#70a1ff","#e2e8f0","#a855f7"]},{id:"matrix",label:"Matrix",description:"Phosphor-green CRT terminal with scanlines and glow.",swatches:["#050505","#00ff41","#00bfff","#33ff77","#ffb000"]},{id:"brutalist",label:"Neubrutalism",description:"Thick borders, raw colors, bold type — ugly on purpose.",swatches:["#f5f0e8","#ff5757","#5ce1e6","#1a1a1a","#ffde59"],variantLightId:"brutalist-light",variantDarkId:"brutalist-dark"},{id:"brutalist-light",label:"Neubrutalism Light",description:"Light neubrutalism variant.",hidden:!0},{id:"brutalist-dark",label:"Neubrutalism Dark",description:"Dark neubrutalism variant.",hidden:!0},{id:"monokai",label:"Monokai",description:"Classic warm editor palette — pink, green, and purple.",swatches:["#272822","#f92672","#a6e22e","#f8f8f2","#ae81ff"],variantLightId:"monokai-light",variantDarkId:"monokai-dark"},{id:"monokai-dark",label:"Monokai Dark",description:"Dark Monokai variant.",hidden:!0},{id:"monokai-light",label:"Monokai Light",description:"Light Monokai variant.",hidden:!0},{id:"ubuntu",label:"Ubuntu",description:"Aubergine terminal with the GNOME Tango palette.",swatches:["#300a24","#8ae234","#ef2929","#eeeeec","#fce94f"]},{id:"sandstone",label:"Sandstone",description:"Warm terracotta accent on dark brown, in the style of Claude Code.",swatches:["#1a1815","#C15F3C","#6b8afd","#e8e6e3","#a78bfa"]},{id:"verdigris",label:"Verdigris",description:"Teal accent on charcoal, in the style of ChatGPT.",swatches:["#141414","#00a67e","#3b82f6","#ececec","#ab68ff"]},{id:"primer",label:"Primer",description:"Blue accent on ink-dark grey, in the style of GitHub.",swatches:["#0d1117","#58a6ff","#3fb950","#c9d1d9","#bc8cff"]}],kb=new Set(Ec.map(t=>t.id)),vy="grackle";function Nf(t){return Ec.find(a=>a.id===t)}const jf="grackle-theme",Cb="grackle-prefer-system",Eb="(prefers-color-scheme: dark)";let Jo=[],sc;function nf(){sc=void 0;for(const t of Jo)t()}function wf(){return typeof window>"u"?!1:window.matchMedia(Eb).matches}function ol(){if(typeof localStorage>"u")return vy;try{const t=localStorage.getItem(jf);if(t!==null&&kb.has(t))return t}catch{}return vy}function uc(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(Cb)==="true"}catch{return!1}}function Af(t){return Ec.find(a=>a.variantLightId===t||a.variantDarkId===t)}function Nb(t,a){const i=Nf(t);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?wf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const o=Af(t);if(o!=null&&o.variantLightId&&o.variantDarkId)return wf()?o.variantDarkId:o.variantLightId}return t}function Oi(t,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=Nb(t,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Oi(ol(),uc());function VC(){return sc===void 0&&(sc={themeId:ol(),systemDark:wf(),preferSystem:uc()}),sc}function HC(t){return Jo=[...Jo,t],()=>{Jo=Jo.filter(a=>a!==t)}}function PC(){const t=x.useSyncExternalStore(HC,VC),{themeId:a,preferSystem:i}=t,o=Nb(a,i),r=x.useCallback(d=>{if(kb.has(d)){try{localStorage.setItem(jf,d)}catch{}Oi(d,uc(),!0),nf()}},[]),u=x.useCallback(d=>{try{localStorage.setItem(Cb,d?"true":"false")}catch{}if(d){const p=ol(),m=Nf(p);if(m!=null&&m.hidden){const g=Af(p);if(g)try{localStorage.setItem(jf,g.id)}catch{}}}Oi(ol(),d,!0),nf()},[]);return x.useEffect(()=>{Oi(a,i)},[a,i]),x.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia(Eb),p=()=>{const m=ol(),g=uc();if(g){const v=Nf(m);if(v!=null&&v.variantDarkId&&v.variantLightId&&Oi(m,g),v!=null&&v.hidden){const y=Af(m);y!=null&&y.variantDarkId&&y.variantLightId&&Oi(m,g)}}nf()};return d.addEventListener("change",p),()=>{d.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:o,preferSystem:i,setPreferSystem:u}}const jb=x.createContext(void 0);function GC({children:t}){const a=PC();return c.jsx(jb.Provider,{value:a,children:t})}function wb(){const t=x.useContext(jb);if(!t)throw new Error("useThemeContext must be used within ThemeProvider");return t}const $C="_container_1mq5u_1",FC="_hamburger_1mq5u_33",qC="_brand_1mq5u_49",KC="_brandLogo_1mq5u_68",YC="_info_1mq5u_75",ZC="_connectionLabel_1mq5u_90",XC="_connectionDot_1mq5u_103",QC="_connected_1mq5u_106",WC="_disconnected_1mq5u_110",ga={container:$C,hamburger:FC,brand:qC,brandLogo:KC,info:YC,connectionLabel:ZC,connectionDot:XC,connected:QC,disconnected:WC};function JC({onToggleSidebar:t,sidebarOpen:a}){const{connected:i,environments:o,sessions:r}=qe(),u=Dt(),d=o.length,p=o.filter(g=>g.status==="connected").length,m=r.filter(g=>["running","idle"].includes(g.status)).length;return c.jsxs("div",{className:ga.container,children:[t&&c.jsx("button",{type:"button",className:ga.hamburger,onClick:t,"aria-label":"Toggle sidebar","aria-expanded":a,children:"☰"}),c.jsxs("button",{type:"button",className:ga.brand,onClick:()=>u(Os),title:"Home",children:[c.jsx("img",{src:"/icon-192x192.png",alt:"",className:ga.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),c.jsxs("div",{className:ga.info,children:[c.jsxs("span",{"aria-label":i?"Connected":"Disconnected",children:[c.jsx("span",{className:`${ga.connectionDot} ${i?ga.connected:ga.disconnected}`,"aria-hidden":"true",children:"●"})," ",c.jsx("span",{className:ga.connectionLabel,"aria-hidden":"true",children:i?"Connected":"Disconnected"})]}),c.jsxs("span",{children:[p,"/",d," env",d!==1?"s":""]}),c.jsxs("span",{children:[m," active"]})]})]})}const eE="_nav_13gkc_1",tE="_tab_13gkc_35",nE="_tabIcon_13gkc_68",aE="_tabLabel_13gkc_79",sE="_tabActive_13gkc_84",Zo={nav:eE,tab:tE,tabIcon:nE,tabLabel:aE,tabActive:sE},Cs=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:Os,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:cC,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:uC,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:Pi,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:"🧠",route:Sb,testId:"sidebar-tab-knowledge"},{view:"settings",label:"Settings",icon:"⚙️",route:lC,testId:"sidebar-tab-settings"}];function iE(t){return t===Os||t==="/"?"dashboard":t.startsWith("/chat")||t.startsWith("/sessions")?"chat":t.startsWith("/workspaces")||t.startsWith("/environments")?"environments":t.startsWith(Sb)?"knowledge":t.startsWith(il)?"settings":"tasks"}function oE(){const t=jt(),a=Dt(),i=x.useRef(null),o=iE(t.pathname),r=x.useCallback(d=>{a(d.route)},[a]),u=x.useCallback(d=>{var y,b;const p=(y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),g=m>=0?m:Cs.findIndex(S=>S.view===o);let v=g;if(d.key==="ArrowRight")d.preventDefault(),v=(g+1)%Cs.length;else if(d.key==="ArrowLeft")d.preventDefault(),v=(g-1+Cs.length)%Cs.length;else if(d.key==="Home")d.preventDefault(),v=0;else if(d.key==="End")d.preventDefault(),v=Cs.length-1;else return;a(Cs[v].route),(b=p[v])==null||b.focus()},[o,a]);return c.jsx("nav",{className:Zo.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:u,"data-testid":"sidebar-nav",children:Cs.map(d=>{const p=d.view===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Zo.tab} ${p?Zo.tabActive:""}`,onClick:()=>r(d),"data-testid":d.testId,title:d.label,"aria-label":d.label,children:[c.jsx("span",{className:Zo.tabIcon,"aria-hidden":"true",children:d.icon}),c.jsx("span",{className:Zo.tabLabel,children:d.label})]},d.view)})})}const Ab=x.createContext(void 0),Db=x.createContext(void 0);function lE({children:t}){const[a,i]=x.useState(void 0),o=x.useCallback(r=>{i(r)},[]);return c.jsx(Db.Provider,{value:o,children:c.jsx(Ab.Provider,{value:a,children:t})})}function Mb(){return x.useContext(Ab)}function rE(){const t=x.useContext(Db);if(t===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return t}const cE="_container_pi6ii_1",uE="_content_pi6ii_66",yy={container:cE,content:uE},dE=320,Rb=220,Ob=600,Bb="grackle-sidebar-width";function fE(){try{const t=localStorage.getItem(Bb);if(t!==null){const a=Number(t);if(Number.isFinite(a)&&a>=Rb&&a<=Ob)return a}}catch{}return dE}function hE(t){try{localStorage.setItem(Bb,String(t))}catch{}}function pE(){const[t]=x.useState(fE),a=x.useRef(null),i=Mb();if(x.useEffect(()=>{const o=a.current;if(!o)return;const r=new ResizeObserver(u=>{for(const d of u){const p=d.borderBoxSize[0];if(p){const m=Math.round(p.inlineSize);m>=Rb&&m<=Ob&&hE(m)}}});return r.observe(o),()=>{r.disconnect()}},[]),i!==void 0)return c.jsx("div",{className:yy.container,ref:a,"data-testid":"sidebar",style:{width:t},children:c.jsx("div",{className:yy.content,children:i})})}function Nc(t){const a=rE();x.useLayoutEffect(()=>(a(t),()=>{a(void 0)}),[t,a])}const fh=x.createContext({});function hh(t){const a=x.useRef(null);return a.current===null&&(a.current=t()),a.current}const jc=x.createContext(null),ph=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class mE extends x.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 gE({children:t,isPresent:a}){const i=x.useId(),o=x.useRef(null),r=x.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=x.useContext(ph);return x.useInsertionEffect(()=>{const{width:d,height:p,top:m,left:g}=r.current;if(a||!o.current||!d||!p)return;o.current.dataset.motionPopId=i;const v=document.createElement("style");return u&&(v.nonce=u),document.head.appendChild(v),v.sheet&&v.sheet.insertRule(`
91
- [data-motion-pop-id="${i}"] {
92
- position: absolute !important;
93
- width: ${d}px !important;
94
- height: ${p}px !important;
95
- top: ${m}px !important;
96
- left: ${g}px !important;
97
- }
98
- `),()=>{document.head.removeChild(v)}},[a]),c.jsx(mE,{isPresent:a,childRef:o,sizeRef:r,children:x.cloneElement(t,{ref:o})})}const vE=({children:t,initial:a,isPresent:i,onExitComplete:o,custom:r,presenceAffectsLayout:u,mode:d})=>{const p=hh(yE),m=x.useId(),g=x.useCallback(y=>{p.set(y,!0);for(const b of p.values())if(!b)return;o&&o()},[p,o]),v=x.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:y=>(p.set(y,!1),()=>p.delete(y))}),u?[Math.random(),g]:[i,g]);return x.useMemo(()=>{p.forEach((y,b)=>p.set(b,!1))},[i]),x.useEffect(()=>{!i&&!p.size&&o&&o()},[i]),d==="popLayout"&&(t=c.jsx(gE,{isPresent:i,children:t})),c.jsx(jc.Provider,{value:v,children:t})};function yE(){return new Map}function Ib(t=!0){const a=x.useContext(jc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:o,register:r}=a,u=x.useId();x.useEffect(()=>{t&&r(u)},[t]);const d=x.useCallback(()=>t&&o&&o(u),[u,o,t]);return!i&&o?[!1,d]:[!0]}const Kr=t=>t.key||"";function by(t){const a=[];return x.Children.forEach(t,i=>{x.isValidElement(i)&&a.push(i)}),a}const mh=typeof window<"u",Lb=mh?x.useLayoutEffect:x.useEffect,Qn=({children:t,custom:a,initial:i=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:u="sync",propagate:d=!1})=>{const[p,m]=Ib(d),g=x.useMemo(()=>by(t),[t]),v=d&&!p?[]:g.map(Kr),y=x.useRef(!0),b=x.useRef(g),S=hh(()=>new Map),[T,E]=x.useState(g),[N,C]=x.useState(g);Lb(()=>{y.current=!1,b.current=g;for(let M=0;M<N.length;M++){const w=Kr(N[M]);v.includes(w)?S.delete(w):S.get(w)!==!0&&S.set(w,!1)}},[N,v.length,v.join("-")]);const j=[];if(g!==T){let M=[...g];for(let w=0;w<N.length;w++){const $=N[w],V=Kr($);v.includes(V)||(M.splice(w,0,$),j.push($))}u==="wait"&&j.length&&(M=j),C(by(M)),E(g);return}const{forceRender:D}=x.useContext(fh);return c.jsx(c.Fragment,{children:N.map(M=>{const w=Kr(M),$=d&&!p?!1:g===N||v.includes(w),V=()=>{if(S.has(w))S.set(w,!0);else return;let B=!0;S.forEach(q=>{q||(B=!1)}),B&&(D==null||D(),C(b.current),d&&(m==null||m()),o&&o())};return c.jsx(vE,{isPresent:$,initial:!y.current||i?void 0:!1,custom:$?void 0:a,presenceAffectsLayout:r,mode:u,onExitComplete:$?void 0:V,children:M},w)})})},fn=t=>t;let Ub=fn;const bE={useManualTiming:!1};function xE(t){let a=new Set,i=new Set,o=!1,r=!1;const u=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function p(g){u.has(g)&&(m.schedule(g),t()),g(d)}const m={schedule:(g,v=!1,y=!1)=>{const S=y&&o?a:i;return v&&u.add(g),S.has(g)||S.add(g),g},cancel:g=>{i.delete(g),u.delete(g)},process:g=>{if(d=g,o){r=!0;return}o=!0,[a,i]=[i,a],a.forEach(p),a.clear(),o=!1,r&&(r=!1,m.process(g))}};return m}const Yr=["read","resolveKeyframes","update","preRender","render","postRender"],_E=40;function zb(t,a){let i=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},u=()=>i=!0,d=Yr.reduce((C,j)=>(C[j]=xE(u),C),{}),{read:p,resolveKeyframes:m,update:g,preRender:v,render:y,postRender:b}=d,S=()=>{const C=performance.now();i=!1,r.delta=o?1e3/60:Math.max(Math.min(C-r.timestamp,_E),1),r.timestamp=C,r.isProcessing=!0,p.process(r),m.process(r),g.process(r),v.process(r),y.process(r),b.process(r),r.isProcessing=!1,i&&a&&(o=!1,t(S))},T=()=>{i=!0,o=!0,r.isProcessing||t(S)};return{schedule:Yr.reduce((C,j)=>{const D=d[j];return C[j]=(M,w=!1,$=!1)=>(i||T(),D.schedule(M,w,$)),C},{}),cancel:C=>{for(let j=0;j<Yr.length;j++)d[Yr[j]].cancel(C)},state:r,steps:d}}const{schedule:ot,cancel:ts,state:Ut,steps:af}=zb(typeof requestAnimationFrame<"u"?requestAnimationFrame:fn,!0),Vb=x.createContext({strict:!1}),xy={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},$i={};for(const t in xy)$i[t]={isEnabled:a=>xy[t].some(i=>!!a[i])};function SE(t){for(const a in t)$i[a]={...$i[a],...t[a]}}const TE=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function dc(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||TE.has(t)}let Hb=t=>!dc(t);function kE(t){t&&(Hb=a=>a.startsWith("on")?!dc(a):t(a))}try{kE(require("@emotion/is-prop-valid").default)}catch{}function CE(t,a,i){const o={};for(const r in t)r==="values"&&typeof t.values=="object"||(Hb(r)||i===!0&&dc(r)||!a&&!dc(r)||t.draggable&&r.startsWith("onDrag"))&&(o[r]=t[r]);return o}function EE(t){if(typeof Proxy>"u")return t;const a=new Map,i=(...o)=>t(...o);return new Proxy(i,{get:(o,r)=>r==="create"?t:(a.has(r)||a.set(r,t(r)),a.get(r))})}const wc=x.createContext({});function ml(t){return typeof t=="string"||Array.isArray(t)}function Ac(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const gh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vh=["initial",...gh];function Dc(t){return Ac(t.animate)||vh.some(a=>ml(t[a]))}function Pb(t){return!!(Dc(t)||t.variants)}function NE(t,a){if(Dc(t)){const{initial:i,animate:o}=t;return{initial:i===!1||ml(i)?i:void 0,animate:ml(o)?o:void 0}}return t.inherit!==!1?a:{}}function jE(t){const{initial:a,animate:i}=NE(t,x.useContext(wc));return x.useMemo(()=>({initial:a,animate:i}),[_y(a),_y(i)])}function _y(t){return Array.isArray(t)?t.join(" "):t}const wE=Symbol.for("motionComponentSymbol");function Bi(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function AE(t,a,i){return x.useCallback(o=>{o&&t.onMount&&t.onMount(o),a&&(o?a.mount(o):a.unmount()),i&&(typeof i=="function"?i(o):Bi(i)&&(i.current=o))},[a])}const yh=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),DE="framerAppearId",Gb="data-"+yh(DE),{schedule:bh}=zb(queueMicrotask,!1),$b=x.createContext({});function ME(t,a,i,o,r){var u,d;const{visualElement:p}=x.useContext(wc),m=x.useContext(Vb),g=x.useContext(jc),v=x.useContext(ph).reducedMotion,y=x.useRef(null);o=o||m.renderer,!y.current&&o&&(y.current=o(t,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:v}));const b=y.current,S=x.useContext($b);b&&!b.projection&&r&&(b.type==="html"||b.type==="svg")&&RE(y.current,i,r,S);const T=x.useRef(!1);x.useInsertionEffect(()=>{b&&T.current&&b.update(i,g)});const E=i[Gb],N=x.useRef(!!E&&!(!((u=window.MotionHandoffIsComplete)===null||u===void 0)&&u.call(window,E))&&((d=window.MotionHasOptimisedAnimation)===null||d===void 0?void 0:d.call(window,E)));return Lb(()=>{b&&(T.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),bh.render(b.render),N.current&&b.animationState&&b.animationState.animateChanges())}),x.useEffect(()=>{b&&(!N.current&&b.animationState&&b.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)===null||C===void 0||C.call(window,E)}),N.current=!1))}),b}function RE(t,a,i,o){const{layoutId:r,layout:u,drag:d,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;t.projection=new i(t.latestValues,a["data-framer-portal-id"]?void 0:Fb(t.parent)),t.projection.setOptions({layoutId:r,layout:u,alwaysMeasureLayout:!!d||p&&Bi(p),visualElement:t,animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:m,layoutRoot:g})}function Fb(t){if(t)return t.options.allowProjection!==!1?t.projection:Fb(t.parent)}function OE({preloadedFeatures:t,createVisualElement:a,useRender:i,useVisualState:o,Component:r}){var u,d;t&&SE(t);function p(g,v){let y;const b={...x.useContext(ph),...g,layoutId:BE(g)},{isStatic:S}=b,T=jE(g),E=o(g,S);if(!S&&mh){IE();const N=LE(b);y=N.MeasureLayout,T.visualElement=ME(r,E,b,a,N.ProjectionNode)}return c.jsxs(wc.Provider,{value:T,children:[y&&T.visualElement?c.jsx(y,{visualElement:T.visualElement,...b}):null,i(r,g,AE(E,T.visualElement,v),E,S,T.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(d=(u=r.displayName)!==null&&u!==void 0?u:r.name)!==null&&d!==void 0?d:""})`}`;const m=x.forwardRef(p);return m[wE]=r,m}function BE({layoutId:t}){const a=x.useContext(fh).id;return a&&t!==void 0?a+"-"+t:t}function IE(t,a){x.useContext(Vb).strict}function LE(t){const{drag:a,layout:i}=$i;if(!a&&!i)return{};const o={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(t)||i!=null&&i.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const UE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function xh(t){return typeof t!="string"||t.includes("-")?!1:!!(UE.indexOf(t)>-1||/[A-Z]/u.test(t))}function Sy(t){const a=[{},{}];return t==null||t.values.forEach((i,o)=>{a[0][o]=i.get(),a[1][o]=i.getVelocity()}),a}function _h(t,a,i,o){if(typeof a=="function"){const[r,u]=Sy(o);a=a(i!==void 0?i:t.custom,r,u)}if(typeof a=="string"&&(a=t.variants&&t.variants[a]),typeof a=="function"){const[r,u]=Sy(o);a=a(i!==void 0?i:t.custom,r,u)}return a}const Df=t=>Array.isArray(t),zE=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),VE=t=>Df(t)?t[t.length-1]||0:t,Pt=t=>!!(t&&t.getVelocity);function ic(t){const a=Pt(t)?t.get():t;return zE(a)?a.toValue():a}function HE({scrapeMotionValuesFromProps:t,createRenderState:a,onUpdate:i},o,r,u){const d={latestValues:PE(o,r,u,t),renderState:a()};return i&&(d.onMount=p=>i({props:o,current:p,...d}),d.onUpdate=p=>i(p)),d}const qb=t=>(a,i)=>{const o=x.useContext(wc),r=x.useContext(jc),u=()=>HE(t,a,o,r);return i?u():hh(u)};function PE(t,a,i,o){const r={},u=o(t,{});for(const b in u)r[b]=ic(u[b]);let{initial:d,animate:p}=t;const m=Dc(t),g=Pb(t);a&&g&&!m&&t.inherit!==!1&&(d===void 0&&(d=a.initial),p===void 0&&(p=a.animate));let v=i?i.initial===!1:!1;v=v||d===!1;const y=v?p:d;if(y&&typeof y!="boolean"&&!Ac(y)){const b=Array.isArray(y)?y:[y];for(let S=0;S<b.length;S++){const T=_h(t,b[S]);if(T){const{transitionEnd:E,transition:N,...C}=T;for(const j in C){let D=C[j];if(Array.isArray(D)){const M=v?D.length-1:0;D=D[M]}D!==null&&(r[j]=D)}for(const j in E)r[j]=E[j]}}}return r}const Qi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zs=new Set(Qi),Kb=t=>a=>typeof a=="string"&&a.startsWith(t),Yb=Kb("--"),GE=Kb("var(--"),Sh=t=>GE(t)?$E.test(t.split("/*")[0].trim()):!1,$E=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Zb=(t,a)=>a&&typeof t=="number"?a.transform(t):t,Sa=(t,a,i)=>i>a?a:i<t?t:i,Wi={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},gl={...Wi,transform:t=>Sa(0,1,t)},Zr={...Wi,default:1},Tl=t=>({test:a=>typeof a=="string"&&a.endsWith(t)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${t}`}),Qa=Tl("deg"),Zn=Tl("%"),ve=Tl("px"),FE=Tl("vh"),qE=Tl("vw"),Ty={...Zn,parse:t=>Zn.parse(t)/100,transform:t=>Zn.transform(t*100)},KE={borderWidth:ve,borderTopWidth:ve,borderRightWidth:ve,borderBottomWidth:ve,borderLeftWidth:ve,borderRadius:ve,radius:ve,borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomRightRadius:ve,borderBottomLeftRadius:ve,width:ve,maxWidth:ve,height:ve,maxHeight:ve,top:ve,right:ve,bottom:ve,left:ve,padding:ve,paddingTop:ve,paddingRight:ve,paddingBottom:ve,paddingLeft:ve,margin:ve,marginTop:ve,marginRight:ve,marginBottom:ve,marginLeft:ve,backgroundPositionX:ve,backgroundPositionY:ve},YE={rotate:Qa,rotateX:Qa,rotateY:Qa,rotateZ:Qa,scale:Zr,scaleX:Zr,scaleY:Zr,scaleZ:Zr,skew:Qa,skewX:Qa,skewY:Qa,distance:ve,translateX:ve,translateY:ve,translateZ:ve,x:ve,y:ve,z:ve,perspective:ve,transformPerspective:ve,opacity:gl,originX:Ty,originY:Ty,originZ:ve},ky={...Wi,transform:Math.round},Th={...KE,...YE,zIndex:ky,size:ve,fillOpacity:gl,strokeOpacity:gl,numOctaves:ky},ZE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},XE=Qi.length;function QE(t,a,i){let o="",r=!0;for(let u=0;u<XE;u++){const d=Qi[u],p=t[d];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(d.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const g=Zb(p,Th[d]);if(!m){r=!1;const v=ZE[d]||d;o+=`${v}(${g}) `}i&&(a[d]=g)}}return o=o.trim(),i?o=i(a,r?"":o):r&&(o="none"),o}function kh(t,a,i){const{style:o,vars:r,transformOrigin:u}=t;let d=!1,p=!1;for(const m in a){const g=a[m];if(zs.has(m)){d=!0;continue}else if(Yb(m)){r[m]=g;continue}else{const v=Zb(g,Th[m]);m.startsWith("origin")?(p=!0,u[m]=v):o[m]=v}}if(a.transform||(d||i?o.transform=QE(a,t.transform,i):o.transform&&(o.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:v=0}=u;o.transformOrigin=`${m} ${g} ${v}`}}const WE={offset:"stroke-dashoffset",array:"stroke-dasharray"},JE={offset:"strokeDashoffset",array:"strokeDasharray"};function eN(t,a,i=1,o=0,r=!0){t.pathLength=1;const u=r?WE:JE;t[u.offset]=ve.transform(-o);const d=ve.transform(a),p=ve.transform(i);t[u.array]=`${d} ${p}`}function Cy(t,a,i){return typeof t=="string"?t:ve.transform(a+i*t)}function tN(t,a,i){const o=Cy(a,t.x,t.width),r=Cy(i,t.y,t.height);return`${o} ${r}`}function Ch(t,{attrX:a,attrY:i,attrScale:o,originX:r,originY:u,pathLength:d,pathSpacing:p=1,pathOffset:m=0,...g},v,y){if(kh(t,g,y),v){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:b,style:S,dimensions:T}=t;b.transform&&(T&&(S.transform=b.transform),delete b.transform),T&&(r!==void 0||u!==void 0||S.transform)&&(S.transformOrigin=tN(T,r!==void 0?r:.5,u!==void 0?u:.5)),a!==void 0&&(b.x=a),i!==void 0&&(b.y=i),o!==void 0&&(b.scale=o),d!==void 0&&eN(b,d,p,m,!1)}const Eh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Xb=()=>({...Eh(),attrs:{}}),Nh=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Qb(t,{style:a,vars:i},o,r){Object.assign(t.style,a,r&&r.getProjectionStyles(o));for(const u in i)t.style.setProperty(u,i[u])}const Wb=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 Jb(t,a,i,o){Qb(t,a,void 0,o);for(const r in a.attrs)t.setAttribute(Wb.has(r)?r:yh(r),a.attrs[r])}const fc={};function nN(t){Object.assign(fc,t)}function ex(t,{layout:a,layoutId:i}){return zs.has(t)||t.startsWith("origin")||(a||i!==void 0)&&(!!fc[t]||t==="opacity")}function jh(t,a,i){var o;const{style:r}=t,u={};for(const d in r)(Pt(r[d])||a.style&&Pt(a.style[d])||ex(d,t)||((o=i==null?void 0:i.getValue(d))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(u[d]=r[d]);return u}function tx(t,a,i){const o=jh(t,a,i);for(const r in t)if(Pt(t[r])||Pt(a[r])){const u=Qi.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[u]=t[r]}return o}function aN(t,a){try{a.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}}const Ey=["x","y","width","height","cx","cy","r"],sN={useVisualState:qb({scrapeMotionValuesFromProps:tx,createRenderState:Xb,onUpdate:({props:t,prevProps:a,current:i,renderState:o,latestValues:r})=>{if(!i)return;let u=!!t.drag;if(!u){for(const p in r)if(zs.has(p)){u=!0;break}}if(!u)return;let d=!a;if(a)for(let p=0;p<Ey.length;p++){const m=Ey[p];t[m]!==a[m]&&(d=!0)}d&&ot.read(()=>{aN(i,o),ot.render(()=>{Ch(o,r,Nh(i.tagName),t.transformTemplate),Jb(i,o)})})}})},iN={useVisualState:qb({scrapeMotionValuesFromProps:jh,createRenderState:Eh})};function nx(t,a,i){for(const o in a)!Pt(a[o])&&!ex(o,i)&&(t[o]=a[o])}function oN({transformTemplate:t},a){return x.useMemo(()=>{const i=Eh();return kh(i,a,t),Object.assign({},i.vars,i.style)},[a])}function lN(t,a){const i=t.style||{},o={};return nx(o,i,t),Object.assign(o,oN(t,a)),o}function rN(t,a){const i={},o=lN(t,a);return t.drag&&t.dragListener!==!1&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=o,i}function cN(t,a,i,o){const r=x.useMemo(()=>{const u=Xb();return Ch(u,a,Nh(o),t.transformTemplate),{...u.attrs,style:{...u.style}}},[a]);if(t.style){const u={};nx(u,t.style,t),r.style={...u,...r.style}}return r}function uN(t=!1){return(i,o,r,{latestValues:u},d)=>{const m=(xh(i)?cN:rN)(o,u,d,i),g=CE(o,typeof i=="string",t),v=i!==x.Fragment?{...g,...m,ref:r}:{},{children:y}=o,b=x.useMemo(()=>Pt(y)?y.get():y,[y]);return x.createElement(i,{...v,children:b})}}function dN(t,a){return function(o,{forwardMotionProps:r}={forwardMotionProps:!1}){const d={...xh(o)?sN:iN,preloadedFeatures:t,useRender:uN(r),createVisualElement:a,Component:o};return OE(d)}}function ax(t,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==t.length)return!1;for(let o=0;o<i;o++)if(a[o]!==t[o])return!1;return!0}function Mc(t,a,i){const o=t.getProps();return _h(o,a,i!==void 0?i:o.custom,t)}function wh(t,a){return t?t[a]||t.default||t:void 0}const sx=new Set(["width","height","top","left","right","bottom",...Qi]);let oc;function fN(){oc=void 0}const Xn={now:()=>(oc===void 0&&Xn.set(Ut.isProcessing||bE.useManualTiming?Ut.timestamp:performance.now()),oc),set:t=>{oc=t,queueMicrotask(fN)}};function Ah(t,a){t.indexOf(a)===-1&&t.push(a)}function Dh(t,a){const i=t.indexOf(a);i>-1&&t.splice(i,1)}class Mh{constructor(){this.subscriptions=[]}add(a){return Ah(this.subscriptions,a),()=>Dh(this.subscriptions,a)}notify(a,i,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,o);else for(let u=0;u<r;u++){const d=this.subscriptions[u];d&&d(a,i,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function ix(t,a){return a?t*(1e3/a):0}const Ny=30,hN=t=>!isNaN(parseFloat(t));class pN{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,r=!0)=>{const u=Xn.now();this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=Xn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=hN(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 Mh);const o=this.events[a].add(i);return a==="change"?()=>{o(),ot.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=Xn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>Ny)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Ny);return ix(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 vl(t,a){return new pN(t,a)}function mN(t,a,i){t.hasValue(a)?t.getValue(a).set(i):t.addValue(a,vl(i))}function gN(t,a){const i=Mc(t,a);let{transitionEnd:o={},transition:r={},...u}=i||{};u={...u,...o};for(const d in u){const p=VE(u[d]);mN(t,d,p)}}function vN(t){return!!(Pt(t)&&t.add)}function Mf(t,a){const i=t.getValue("willChange");if(vN(i))return i.add(a)}function ox(t){return t.props[Gb]}function Rh(t){let a;return()=>(a===void 0&&(a=t()),a)}const yN=Rh(()=>window.ScrollTimeline!==void 0);class bN{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}get finished(){return Promise.all(this.animations.map(a=>"finished"in a?a.finished:a))}getAll(a){return this.animations[0][a]}setAll(a,i){for(let o=0;o<this.animations.length;o++)this.animations[o][a]=i}attachTimeline(a,i){const o=this.animations.map(r=>{if(yN()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{o.forEach((r,u)=>{r&&r(),this.animations[u].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let i=0;i<this.animations.length;i++)a=Math.max(a,this.animations[i].duration);return a}runAll(a){this.animations.forEach(i=>i[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class xN extends bN{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const ya=t=>t*1e3,ba=t=>t/1e3;function Oh(t){return typeof t=="function"}function jy(t,a){t.timeline=a,t.onfinish=null}const Bh=t=>Array.isArray(t)&&typeof t[0]=="number",_N={linearEasing:void 0};function SN(t,a){const i=Rh(t);return()=>{var o;return(o=_N[a])!==null&&o!==void 0?o:i()}}const hc=SN(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Fi=(t,a,i)=>{const o=a-t;return o===0?1:(i-t)/o},lx=(t,a,i=10)=>{let o="";const r=Math.max(Math.round(a/i),2);for(let u=0;u<r;u++)o+=t(Fi(0,r-1,u))+", ";return`linear(${o.substring(0,o.length-2)})`};function rx(t){return!!(typeof t=="function"&&hc()||!t||typeof t=="string"&&(t in Rf||hc())||Bh(t)||Array.isArray(t)&&t.every(rx))}const el=([t,a,i,o])=>`cubic-bezier(${t}, ${a}, ${i}, ${o})`,Rf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:el([0,.65,.55,1]),circOut:el([.55,0,1,.45]),backIn:el([.31,.01,.66,-.59]),backOut:el([.33,1.53,.69,.99])};function cx(t,a){if(t)return typeof t=="function"&&hc()?lx(t,a):Bh(t)?el(t):Array.isArray(t)?t.map(i=>cx(i,a)||Rf.easeOut):Rf[t]}const ux=(t,a,i)=>(((1-3*i+3*a)*t+(3*i-6*a))*t+3*a)*t,TN=1e-7,kN=12;function CN(t,a,i,o,r){let u,d,p=0;do d=a+(i-a)/2,u=ux(d,o,r)-t,u>0?i=d:a=d;while(Math.abs(u)>TN&&++p<kN);return d}function kl(t,a,i,o){if(t===a&&i===o)return fn;const r=u=>CN(u,0,1,t,i);return u=>u===0||u===1?u:ux(r(u),a,o)}const dx=t=>a=>a<=.5?t(2*a)/2:(2-t(2*(1-a)))/2,fx=t=>a=>1-t(1-a),hx=kl(.33,1.53,.69,.99),Ih=fx(hx),px=dx(Ih),mx=t=>(t*=2)<1?.5*Ih(t):.5*(2-Math.pow(2,-10*(t-1))),Lh=t=>1-Math.sin(Math.acos(t)),gx=fx(Lh),vx=dx(Lh),yx=t=>/^0[^.\s]+$/u.test(t);function EN(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||yx(t):!0}const ll=t=>Math.round(t*1e5)/1e5,Uh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function NN(t){return t==null}const jN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zh=(t,a)=>i=>!!(typeof i=="string"&&jN.test(i)&&i.startsWith(t)||a&&!NN(i)&&Object.prototype.hasOwnProperty.call(i,a)),bx=(t,a,i)=>o=>{if(typeof o!="string")return o;const[r,u,d,p]=o.match(Uh);return{[t]:parseFloat(r),[a]:parseFloat(u),[i]:parseFloat(d),alpha:p!==void 0?parseFloat(p):1}},wN=t=>Sa(0,255,t),sf={...Wi,transform:t=>Math.round(wN(t))},Ms={test:zh("rgb","red"),parse:bx("red","green","blue"),transform:({red:t,green:a,blue:i,alpha:o=1})=>"rgba("+sf.transform(t)+", "+sf.transform(a)+", "+sf.transform(i)+", "+ll(gl.transform(o))+")"};function AN(t){let a="",i="",o="",r="";return t.length>5?(a=t.substring(1,3),i=t.substring(3,5),o=t.substring(5,7),r=t.substring(7,9)):(a=t.substring(1,2),i=t.substring(2,3),o=t.substring(3,4),r=t.substring(4,5),a+=a,i+=i,o+=o,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const Of={test:zh("#"),parse:AN,transform:Ms.transform},Ii={test:zh("hsl","hue"),parse:bx("hue","saturation","lightness"),transform:({hue:t,saturation:a,lightness:i,alpha:o=1})=>"hsla("+Math.round(t)+", "+Zn.transform(ll(a))+", "+Zn.transform(ll(i))+", "+ll(gl.transform(o))+")"},Ht={test:t=>Ms.test(t)||Of.test(t)||Ii.test(t),parse:t=>Ms.test(t)?Ms.parse(t):Ii.test(t)?Ii.parse(t):Of.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ms.transform(t):Ii.transform(t)},DN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function MN(t){var a,i;return isNaN(t)&&typeof t=="string"&&(((a=t.match(Uh))===null||a===void 0?void 0:a.length)||0)+(((i=t.match(DN))===null||i===void 0?void 0:i.length)||0)>0}const xx="number",_x="color",RN="var",ON="var(",wy="${}",BN=/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 yl(t){const a=t.toString(),i=[],o={color:[],number:[],var:[]},r=[];let u=0;const p=a.replace(BN,m=>(Ht.test(m)?(o.color.push(u),r.push(_x),i.push(Ht.parse(m))):m.startsWith(ON)?(o.var.push(u),r.push(RN),i.push(m)):(o.number.push(u),r.push(xx),i.push(parseFloat(m))),++u,wy)).split(wy);return{values:i,split:p,indexes:o,types:r}}function Sx(t){return yl(t).values}function Tx(t){const{split:a,types:i}=yl(t),o=a.length;return r=>{let u="";for(let d=0;d<o;d++)if(u+=a[d],r[d]!==void 0){const p=i[d];p===xx?u+=ll(r[d]):p===_x?u+=Ht.transform(r[d]):u+=r[d]}return u}}const IN=t=>typeof t=="number"?0:t;function LN(t){const a=Sx(t);return Tx(t)(a.map(IN))}const ns={test:MN,parse:Sx,createTransformer:Tx,getAnimatableNone:LN},UN=new Set(["brightness","contrast","saturate","opacity"]);function zN(t){const[a,i]=t.slice(0,-1).split("(");if(a==="drop-shadow")return t;const[o]=i.match(Uh)||[];if(!o)return t;const r=i.replace(o,"");let u=UN.has(a)?1:0;return o!==i&&(u*=100),a+"("+u+r+")"}const VN=/\b([a-z-]*)\(.*?\)/gu,Bf={...ns,getAnimatableNone:t=>{const a=t.match(VN);return a?a.map(zN).join(" "):t}},HN={...Th,color:Ht,backgroundColor:Ht,outlineColor:Ht,fill:Ht,stroke:Ht,borderColor:Ht,borderTopColor:Ht,borderRightColor:Ht,borderBottomColor:Ht,borderLeftColor:Ht,filter:Bf,WebkitFilter:Bf},Vh=t=>HN[t];function kx(t,a){let i=Vh(t);return i!==Bf&&(i=ns),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const PN=new Set(["auto","none","0"]);function GN(t,a,i){let o=0,r;for(;o<t.length&&!r;){const u=t[o];typeof u=="string"&&!PN.has(u)&&yl(u).values.length&&(r=t[o]),o++}if(r&&i)for(const u of a)t[u]=kx(i,r)}const Ay=t=>t===Wi||t===ve,Dy=(t,a)=>parseFloat(t.split(", ")[a]),My=(t,a)=>(i,{transform:o})=>{if(o==="none"||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/u);if(r)return Dy(r[1],a);{const u=o.match(/^matrix\((.+)\)$/u);return u?Dy(u[1],t):0}},$N=new Set(["x","y","z"]),FN=Qi.filter(t=>!$N.has(t));function qN(t){const a=[];return FN.forEach(i=>{const o=t.getValue(i);o!==void 0&&(a.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),a}const qi={width:({x:t},{paddingLeft:a="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(a)-parseFloat(i),height:({y:t},{paddingTop:a="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(a)-parseFloat(i),top:(t,{top:a})=>parseFloat(a),left:(t,{left:a})=>parseFloat(a),bottom:({y:t},{top:a})=>parseFloat(a)+(t.max-t.min),right:({x:t},{left:a})=>parseFloat(a)+(t.max-t.min),x:My(4,13),y:My(5,14)};qi.translateX=qi.x;qi.translateY=qi.y;const Rs=new Set;let If=!1,Lf=!1;function Cx(){if(Lf){const t=Array.from(Rs).filter(o=>o.needsMeasurement),a=new Set(t.map(o=>o.element)),i=new Map;a.forEach(o=>{const r=qN(o);r.length&&(i.set(o,r),o.render())}),t.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const r=i.get(o);r&&r.forEach(([u,d])=>{var p;(p=o.getValue(u))===null||p===void 0||p.set(d)})}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}Lf=!1,If=!1,Rs.forEach(t=>t.complete()),Rs.clear()}function Ex(){Rs.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Lf=!0)})}function KN(){Ex(),Cx()}class Hh{constructor(a,i,o,r,u,d=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=o,this.motionValue=r,this.element=u,this.isAsync=d}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Rs.add(this),If||(If=!0,ot.read(Ex),ot.resolveKeyframes(Cx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:o,motionValue:r}=this;for(let u=0;u<a.length;u++)if(a[u]===null)if(u===0){const d=r==null?void 0:r.get(),p=a[a.length-1];if(d!==void 0)a[0]=d;else if(o&&i){const m=o.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),r&&d===void 0&&r.set(a[0])}else a[u]=a[u-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Rs.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Rs.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Nx=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),YN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ZN(t){const a=YN.exec(t);if(!a)return[,];const[,i,o,r]=a;return[`--${i??o}`,r]}function jx(t,a,i=1){const[o,r]=ZN(t);if(!o)return;const u=window.getComputedStyle(a).getPropertyValue(o);if(u){const d=u.trim();return Nx(d)?parseFloat(d):d}return Sh(r)?jx(r,a,i+1):r}const wx=t=>a=>a.test(t),XN={test:t=>t==="auto",parse:t=>t},Ax=[Wi,ve,Zn,Qa,qE,FE,XN],Ry=t=>Ax.find(wx(t));class Dx extends Hh{constructor(a,i,o,r,u){super(a,i,o,r,u,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:o}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<a.length;m++){let g=a[m];if(typeof g=="string"&&(g=g.trim(),Sh(g))){const v=jx(g,i.current);v!==void 0&&(a[m]=v),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!sx.has(o)||a.length!==2)return;const[r,u]=a,d=Ry(r),p=Ry(u);if(d!==p)if(Ay(d)&&Ay(p))for(let m=0;m<a.length;m++){const g=a[m];typeof g=="string"&&(a[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,o=[];for(let r=0;r<a.length;r++)EN(a[r])&&o.push(r);o.length&&GN(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=qi[o](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&a.getValue(o,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:o,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const u=i.getValue(o);u&&u.jump(this.measuredOrigin,!1);const d=r.length-1,p=r[d];r[d]=qi[o](i.measureViewportBox(),window.getComputedStyle(i.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([m,g])=>{i.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const Oy=(t,a)=>a==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ns.test(t)||t==="0")&&!t.startsWith("url("));function QN(t){const a=t[0];if(t.length===1)return!0;for(let i=0;i<t.length;i++)if(t[i]!==a)return!0}function WN(t,a,i,o){const r=t[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const u=t[t.length-1],d=Oy(r,a),p=Oy(u,a);return!d||!p?!1:QN(t)||(i==="spring"||Oh(i))&&o}const JN=t=>t!==null;function Rc(t,{repeat:a,repeatType:i="loop"},o){const r=t.filter(JN),u=a&&i!=="loop"&&a%2===1?0:r.length-1;return!u||o===void 0?r[u]:o}const ej=40;class Mx{constructor({autoplay:a=!0,delay:i=0,type:o="keyframes",repeat:r=0,repeatDelay:u=0,repeatType:d="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Xn.now(),this.options={autoplay:a,delay:i,type:o,repeat:r,repeatDelay:u,repeatType:d,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>ej?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&KN(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Xn.now(),this.hasAttemptedResolve=!0;const{name:o,type:r,velocity:u,delay:d,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!WN(a,o,r,u))if(d)this.options.duration=0;else{m&&m(Rc(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const v=this.initPlayback(a,i);v!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...v},this.onPostResolved())}onPostResolved(){}then(a,i){return this.currentFinishedPromise.then(a,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const Uf=2e4;function Rx(t){let a=0;const i=50;let o=t.next(a);for(;!o.done&&a<Uf;)a+=i,o=t.next(a);return a>=Uf?1/0:a}const ut=(t,a,i)=>t+(a-t)*i;function of(t,a,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+(a-t)*6*i:i<1/2?a:i<2/3?t+(a-t)*(2/3-i)*6:t}function tj({hue:t,saturation:a,lightness:i,alpha:o}){t/=360,a/=100,i/=100;let r=0,u=0,d=0;if(!a)r=u=d=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=of(m,p,t+1/3),u=of(m,p,t),d=of(m,p,t-1/3)}return{red:Math.round(r*255),green:Math.round(u*255),blue:Math.round(d*255),alpha:o}}function pc(t,a){return i=>i>0?a:t}const lf=(t,a,i)=>{const o=t*t,r=i*(a*a-o)+o;return r<0?0:Math.sqrt(r)},nj=[Of,Ms,Ii],aj=t=>nj.find(a=>a.test(t));function By(t){const a=aj(t);if(!a)return!1;let i=a.parse(t);return a===Ii&&(i=tj(i)),i}const Iy=(t,a)=>{const i=By(t),o=By(a);if(!i||!o)return pc(t,a);const r={...i};return u=>(r.red=lf(i.red,o.red,u),r.green=lf(i.green,o.green,u),r.blue=lf(i.blue,o.blue,u),r.alpha=ut(i.alpha,o.alpha,u),Ms.transform(r))},sj=(t,a)=>i=>a(t(i)),Cl=(...t)=>t.reduce(sj),zf=new Set(["none","hidden"]);function ij(t,a){return zf.has(t)?i=>i<=0?t:a:i=>i>=1?a:t}function oj(t,a){return i=>ut(t,a,i)}function Ph(t){return typeof t=="number"?oj:typeof t=="string"?Sh(t)?pc:Ht.test(t)?Iy:cj:Array.isArray(t)?Ox:typeof t=="object"?Ht.test(t)?Iy:lj:pc}function Ox(t,a){const i=[...t],o=i.length,r=t.map((u,d)=>Ph(u)(u,a[d]));return u=>{for(let d=0;d<o;d++)i[d]=r[d](u);return i}}function lj(t,a){const i={...t,...a},o={};for(const r in i)t[r]!==void 0&&a[r]!==void 0&&(o[r]=Ph(t[r])(t[r],a[r]));return r=>{for(const u in o)i[u]=o[u](r);return i}}function rj(t,a){var i;const o=[],r={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const d=a.types[u],p=t.indexes[d][r[d]],m=(i=t.values[p])!==null&&i!==void 0?i:0;o[u]=m,r[d]++}return o}const cj=(t,a)=>{const i=ns.createTransformer(a),o=yl(t),r=yl(a);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?zf.has(t)&&!r.values.length||zf.has(a)&&!o.values.length?ij(t,a):Cl(Ox(rj(o,r),r.values),i):pc(t,a)};function Bx(t,a,i){return typeof t=="number"&&typeof a=="number"&&typeof i=="number"?ut(t,a,i):Ph(t)(t,a)}const uj=5;function Ix(t,a,i){const o=Math.max(a-uj,0);return ix(i-t(o),a-o)}const ht={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},rf=.001;function dj({duration:t=ht.duration,bounce:a=ht.bounce,velocity:i=ht.velocity,mass:o=ht.mass}){let r,u,d=1-a;d=Sa(ht.minDamping,ht.maxDamping,d),t=Sa(ht.minDuration,ht.maxDuration,ba(t)),d<1?(r=g=>{const v=g*d,y=v*t,b=v-i,S=Vf(g,d),T=Math.exp(-y);return rf-b/S*T},u=g=>{const y=g*d*t,b=y*i+i,S=Math.pow(d,2)*Math.pow(g,2)*t,T=Math.exp(-y),E=Vf(Math.pow(g,2),d);return(-r(g)+rf>0?-1:1)*((b-S)*T)/E}):(r=g=>{const v=Math.exp(-g*t),y=(g-i)*t+1;return-rf+v*y},u=g=>{const v=Math.exp(-g*t),y=(i-g)*(t*t);return v*y});const p=5/t,m=hj(r,u,p);if(t=ya(t),isNaN(m))return{stiffness:ht.stiffness,damping:ht.damping,duration:t};{const g=Math.pow(m,2)*o;return{stiffness:g,damping:d*2*Math.sqrt(o*g),duration:t}}}const fj=12;function hj(t,a,i){let o=i;for(let r=1;r<fj;r++)o=o-t(o)/a(o);return o}function Vf(t,a){return t*Math.sqrt(1-a*a)}const pj=["duration","bounce"],mj=["stiffness","damping","mass"];function Ly(t,a){return a.some(i=>t[i]!==void 0)}function gj(t){let a={velocity:ht.velocity,stiffness:ht.stiffness,damping:ht.damping,mass:ht.mass,isResolvedFromDuration:!1,...t};if(!Ly(t,mj)&&Ly(t,pj))if(t.visualDuration){const i=t.visualDuration,o=2*Math.PI/(i*1.2),r=o*o,u=2*Sa(.05,1,1-(t.bounce||0))*Math.sqrt(r);a={...a,mass:ht.mass,stiffness:r,damping:u}}else{const i=dj(t);a={...a,...i,mass:ht.mass},a.isResolvedFromDuration=!0}return a}function Lx(t=ht.visualDuration,a=ht.bounce){const i=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:a}:t;let{restSpeed:o,restDelta:r}=i;const u=i.keyframes[0],d=i.keyframes[i.keyframes.length-1],p={done:!1,value:u},{stiffness:m,damping:g,mass:v,duration:y,velocity:b,isResolvedFromDuration:S}=gj({...i,velocity:-ba(i.velocity||0)}),T=b||0,E=g/(2*Math.sqrt(m*v)),N=d-u,C=ba(Math.sqrt(m/v)),j=Math.abs(N)<5;o||(o=j?ht.restSpeed.granular:ht.restSpeed.default),r||(r=j?ht.restDelta.granular:ht.restDelta.default);let D;if(E<1){const w=Vf(C,E);D=$=>{const V=Math.exp(-E*C*$);return d-V*((T+E*C*N)/w*Math.sin(w*$)+N*Math.cos(w*$))}}else if(E===1)D=w=>d-Math.exp(-C*w)*(N+(T+C*N)*w);else{const w=C*Math.sqrt(E*E-1);D=$=>{const V=Math.exp(-E*C*$),B=Math.min(w*$,300);return d-V*((T+E*C*N)*Math.sinh(B)+w*N*Math.cosh(B))/w}}const M={calculatedDuration:S&&y||null,next:w=>{const $=D(w);if(S)p.done=w>=y;else{let V=0;E<1&&(V=w===0?ya(T):Ix(D,w,$));const B=Math.abs(V)<=o,q=Math.abs(d-$)<=r;p.done=B&&q}return p.value=p.done?d:$,p},toString:()=>{const w=Math.min(Rx(M),Uf),$=lx(V=>M.next(w*V).value,w,30);return w+"ms "+$}};return M}function Uy({keyframes:t,velocity:a=0,power:i=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:u=500,modifyTarget:d,min:p,max:m,restDelta:g=.5,restSpeed:v}){const y=t[0],b={done:!1,value:y},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 E=i*a;const N=y+E,C=d===void 0?N:d(N);C!==N&&(E=C-y);const j=B=>-E*Math.exp(-B/o),D=B=>C+j(B),M=B=>{const q=j(B),X=D(B);b.done=Math.abs(q)<=g,b.value=b.done?C:X};let w,$;const V=B=>{S(b.value)&&(w=B,$=Lx({keyframes:[b.value,T(b.value)],velocity:Ix(D,B,b.value),damping:r,stiffness:u,restDelta:g,restSpeed:v}))};return V(0),{calculatedDuration:null,next:B=>{let q=!1;return!$&&w===void 0&&(q=!0,M(B),V(B)),w!==void 0&&B>=w?$.next(B-w):(!q&&M(B),b)}}}const vj=kl(.42,0,1,1),yj=kl(0,0,.58,1),Ux=kl(.42,0,.58,1),bj=t=>Array.isArray(t)&&typeof t[0]!="number",xj={linear:fn,easeIn:vj,easeInOut:Ux,easeOut:yj,circIn:Lh,circInOut:vx,circOut:gx,backIn:Ih,backInOut:px,backOut:hx,anticipate:mx},zy=t=>{if(Bh(t)){Ub(t.length===4);const[a,i,o,r]=t;return kl(a,i,o,r)}else if(typeof t=="string")return xj[t];return t};function _j(t,a,i){const o=[],r=i||Bx,u=t.length-1;for(let d=0;d<u;d++){let p=r(t[d],t[d+1]);if(a){const m=Array.isArray(a)?a[d]||fn:a;p=Cl(m,p)}o.push(p)}return o}function Sj(t,a,{clamp:i=!0,ease:o,mixer:r}={}){const u=t.length;if(Ub(u===a.length),u===1)return()=>a[0];if(u===2&&a[0]===a[1])return()=>a[1];const d=t[0]===t[1];t[0]>t[u-1]&&(t=[...t].reverse(),a=[...a].reverse());const p=_j(a,o,r),m=p.length,g=v=>{if(d&&v<t[0])return a[0];let y=0;if(m>1)for(;y<t.length-2&&!(v<t[y+1]);y++);const b=Fi(t[y],t[y+1],v);return p[y](b)};return i?v=>g(Sa(t[0],t[u-1],v)):g}function Tj(t,a){const i=t[t.length-1];for(let o=1;o<=a;o++){const r=Fi(0,a,o);t.push(ut(i,1,r))}}function kj(t){const a=[0];return Tj(a,t.length-1),a}function Cj(t,a){return t.map(i=>i*a)}function Ej(t,a){return t.map(()=>a||Ux).splice(0,t.length-1)}function mc({duration:t=300,keyframes:a,times:i,ease:o="easeInOut"}){const r=bj(o)?o.map(zy):zy(o),u={done:!1,value:a[0]},d=Cj(i&&i.length===a.length?i:kj(a),t),p=Sj(d,a,{ease:Array.isArray(r)?r:Ej(a,r)});return{calculatedDuration:t,next:m=>(u.value=p(m),u.done=m>=t,u)}}const Nj=t=>{const a=({timestamp:i})=>t(i);return{start:()=>ot.update(a,!0),stop:()=>ts(a),now:()=>Ut.isProcessing?Ut.timestamp:Xn.now()}},jj={decay:Uy,inertia:Uy,tween:mc,keyframes:mc,spring:Lx},wj=t=>t/100;class Gh extends Mx{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:i,motionValue:o,element:r,keyframes:u}=this.options,d=(r==null?void 0:r.KeyframeResolver)||Hh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new d(u,p,i,o,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:o=0,repeatDelay:r=0,repeatType:u,velocity:d=0}=this.options,p=Oh(i)?i:jj[i]||mc;let m,g;p!==mc&&typeof a[0]!="number"&&(m=Cl(wj,Bx(a[0],a[1])),a=[0,100]);const v=p({...this.options,keyframes:a});u==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-d})),v.calculatedDuration===null&&(v.calculatedDuration=Rx(v));const{calculatedDuration:y}=v,b=y+r,S=b*(o+1)-r;return{generator:v,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:y,resolvedDuration:b,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:r,generator:u,mirroredGenerator:d,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:v,resolvedDuration:y}=o;if(this.startTime===null)return u.next(0);const{delay:b,repeat:S,repeatType:T,repeatDelay:E,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-v/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const C=this.currentTime-b*(this.speed>=0?1:-1),j=this.speed>=0?C<0:C>v;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=v);let D=this.currentTime,M=u;if(S){const B=Math.min(this.currentTime,v)/y;let q=Math.floor(B),X=B%1;!X&&B>=1&&(X=1),X===1&&q--,q=Math.min(q,S+1),!!(q%2)&&(T==="reverse"?(X=1-X,E&&(X-=E/y)):T==="mirror"&&(M=d)),D=Sa(0,1,X)*y}const w=j?{done:!1,value:m[0]}:M.next(D);p&&(w.value=p(w.value));let{done:$}=w;!j&&g!==null&&($=this.speed>=0?this.currentTime>=v:this.currentTime<=0);const V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&$);return V&&r!==void 0&&(w.value=Rc(m,this.options,r)),N&&N(w.value),V&&this.finish(),w}get duration(){const{resolved:a}=this;return a?ba(a.calculatedDuration):0}get time(){return ba(this.currentTime)}set time(a){a=ya(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=ba(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=Nj,onPlay:i,startTime:o}=this.options;this.driver||(this.driver=a(u=>this.tick(u))),i&&i();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=o??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const Aj=new Set(["opacity","clipPath","filter","transform"]);function Dj(t,a,i,{delay:o=0,duration:r=300,repeat:u=0,repeatType:d="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const v=cx(p,r);return Array.isArray(v)&&(g.easing=v),t.animate(g,{delay:o,duration:r,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:u+1,direction:d==="reverse"?"alternate":"normal"})}const Mj=Rh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),gc=10,Rj=2e4;function Oj(t){return Oh(t.type)||t.type==="spring"||!rx(t.ease)}function Bj(t,a){const i=new Gh({...a,keyframes:t,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:t[0]};const r=[];let u=0;for(;!o.done&&u<Rj;)o=i.sample(u),r.push(o.value),u+=gc;return{times:void 0,keyframes:r,duration:u-gc,ease:"linear"}}const zx={anticipate:mx,backInOut:px,circInOut:vx};function Ij(t){return t in zx}class Vy extends Mx{constructor(a){super(a);const{name:i,motionValue:o,element:r,keyframes:u}=this.options;this.resolver=new Dx(u,(d,p)=>this.onKeyframesResolved(d,p),i,o,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:o=300,times:r,ease:u,type:d,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof u=="string"&&hc()&&Ij(u)&&(u=zx[u]),Oj(this.options)){const{onComplete:y,onUpdate:b,motionValue:S,element:T,...E}=this.options,N=Bj(a,E);a=N.keyframes,a.length===1&&(a[1]=a[0]),o=N.duration,r=N.times,u=N.ease,d="keyframes"}const v=Dj(p.owner.current,m,a,{...this.options,duration:o,times:r,ease:u});return v.startTime=g??this.calcStartTime(),this.pendingTimeline?(jy(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:y}=this.options;p.set(Rc(a,this.options,i)),y&&y(),this.cancel(),this.resolveFinishedPromise()},{animation:v,duration:o,times:r,type:d,ease:u,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return ba(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return ba(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.currentTime=ya(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 fn;const{animation:o}=i;jy(o,a)}return fn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:i,keyframes:o,duration:r,type:u,ease:d,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:v,onComplete:y,element:b,...S}=this.options,T=new Gh({...S,keyframes:o,duration:r,type:u,ease:d,times:p,isGenerator:!0}),E=ya(this.time);g.setWithVelocity(T.sample(E-gc).value,T.sample(E).value,gc)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:o,repeatDelay:r,repeatType:u,damping:d,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=i.owner.getProps();return Mj()&&o&&Aj.has(o)&&!m&&!g&&!r&&u!=="mirror"&&d!==0&&p!=="inertia"}}const Lj={type:"spring",stiffness:500,damping:25,restSpeed:10},Uj=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),zj={type:"keyframes",duration:.8},Vj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Hj=(t,{keyframes:a})=>a.length>2?zj:zs.has(t)?t.startsWith("scale")?Uj(a[1]):Lj:Vj;function Pj({when:t,delay:a,delayChildren:i,staggerChildren:o,staggerDirection:r,repeat:u,repeatType:d,repeatDelay:p,from:m,elapsed:g,...v}){return!!Object.keys(v).length}const $h=(t,a,i,o={},r,u)=>d=>{const p=wh(o,t)||{},m=p.delay||o.delay||0;let{elapsed:g=0}=o;g=g-ya(m);let v={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-g,onUpdate:b=>{a.set(b),p.onUpdate&&p.onUpdate(b)},onComplete:()=>{d(),p.onComplete&&p.onComplete()},name:t,motionValue:a,element:u?void 0:r};Pj(p)||(v={...v,...Hj(t,v)}),v.duration&&(v.duration=ya(v.duration)),v.repeatDelay&&(v.repeatDelay=ya(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let y=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(v.duration=0,v.delay===0&&(y=!0)),y&&!u&&a.get()!==void 0){const b=Rc(v.keyframes,p);if(b!==void 0)return ot.update(()=>{v.onUpdate(b),v.onComplete()}),new xN([])}return!u&&Vy.supports(v)?new Vy(v):new Gh(v)};function Gj({protectedKeys:t,needsAnimating:a},i){const o=t.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,o}function Vx(t,a,{delay:i=0,transitionOverride:o,type:r}={}){var u;let{transition:d=t.getDefaultTransition(),transitionEnd:p,...m}=a;o&&(d=o);const g=[],v=r&&t.animationState&&t.animationState.getState()[r];for(const y in m){const b=t.getValue(y,(u=t.latestValues[y])!==null&&u!==void 0?u:null),S=m[y];if(S===void 0||v&&Gj(v,y))continue;const T={delay:i,...wh(d||{},y)};let E=!1;if(window.MotionHandoffAnimation){const C=ox(t);if(C){const j=window.MotionHandoffAnimation(C,y,ot);j!==null&&(T.startTime=j,E=!0)}}Mf(t,y),b.start($h(y,b,S,t.shouldReduceMotion&&sx.has(y)?{type:!1}:T,t,E));const N=b.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{ot.update(()=>{p&&gN(t,p)})}),g}function Hf(t,a,i={}){var o;const r=Mc(t,a,i.type==="exit"?(o=t.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:u=t.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(u=i.transitionOverride);const d=r?()=>Promise.all(Vx(t,r,i)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(g=0)=>{const{delayChildren:v=0,staggerChildren:y,staggerDirection:b}=u;return $j(t,a,v+g,y,b,i)}:()=>Promise.resolve(),{when:m}=u;if(m){const[g,v]=m==="beforeChildren"?[d,p]:[p,d];return g().then(()=>v())}else return Promise.all([d(),p(i.delay)])}function $j(t,a,i=0,o=0,r=1,u){const d=[],p=(t.variantChildren.size-1)*o,m=r===1?(g=0)=>g*o:(g=0)=>p-g*o;return Array.from(t.variantChildren).sort(Fj).forEach((g,v)=>{g.notify("AnimationStart",a),d.push(Hf(g,a,{...u,delay:i+m(v)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(d)}function Fj(t,a){return t.sortNodePosition(a)}function qj(t,a,i={}){t.notify("AnimationStart",a);let o;if(Array.isArray(a)){const r=a.map(u=>Hf(t,u,i));o=Promise.all(r)}else if(typeof a=="string")o=Hf(t,a,i);else{const r=typeof a=="function"?Mc(t,a,i.custom):a;o=Promise.all(Vx(t,r,i))}return o.then(()=>{t.notify("AnimationComplete",a)})}const Kj=vh.length;function Hx(t){if(!t)return;if(!t.isControllingVariants){const i=t.parent?Hx(t.parent)||{}:{};return t.props.initial!==void 0&&(i.initial=t.props.initial),i}const a={};for(let i=0;i<Kj;i++){const o=vh[i],r=t.props[o];(ml(r)||r===!1)&&(a[o]=r)}return a}const Yj=[...gh].reverse(),Zj=gh.length;function Xj(t){return a=>Promise.all(a.map(({animation:i,options:o})=>qj(t,i,o)))}function Qj(t){let a=Xj(t),i=Hy(),o=!0;const r=m=>(g,v)=>{var y;const b=Mc(t,v,m==="exit"?(y=t.presenceContext)===null||y===void 0?void 0:y.custom:void 0);if(b){const{transition:S,transitionEnd:T,...E}=b;g={...g,...E,...T}}return g};function u(m){a=m(t)}function d(m){const{props:g}=t,v=Hx(t.parent)||{},y=[],b=new Set;let S={},T=1/0;for(let N=0;N<Zj;N++){const C=Yj[N],j=i[C],D=g[C]!==void 0?g[C]:v[C],M=ml(D),w=C===m?j.isActive:null;w===!1&&(T=N);let $=D===v[C]&&D!==g[C]&&M;if($&&o&&t.manuallyAnimateOnMount&&($=!1),j.protectedKeys={...S},!j.isActive&&w===null||!D&&!j.prevProp||Ac(D)||typeof D=="boolean")continue;const V=Wj(j.prevProp,D);let B=V||C===m&&j.isActive&&!$&&M||N>T&&M,q=!1;const X=Array.isArray(D)?D:[D];let ae=X.reduce(r(C),{});w===!1&&(ae={});const{prevResolvedValues:te={}}=j,Q={...te,...ae},F=Y=>{B=!0,b.has(Y)&&(q=!0,b.delete(Y)),j.needsAnimating[Y]=!0;const oe=t.getValue(Y);oe&&(oe.liveStyle=!1)};for(const Y in Q){const oe=ae[Y],P=te[Y];if(S.hasOwnProperty(Y))continue;let O=!1;Df(oe)&&Df(P)?O=!ax(oe,P):O=oe!==P,O?oe!=null?F(Y):b.add(Y):oe!==void 0&&b.has(Y)?F(Y):j.protectedKeys[Y]=!0}j.prevProp=D,j.prevResolvedValues=ae,j.isActive&&(S={...S,...ae}),o&&t.blockInitialAnimation&&(B=!1),B&&(!($&&V)||q)&&y.push(...X.map(Y=>({animation:Y,options:{type:C}})))}if(b.size){const N={};b.forEach(C=>{const j=t.getBaseTarget(C),D=t.getValue(C);D&&(D.liveStyle=!0),N[C]=j??null}),y.push({animation:N})}let E=!!y.length;return o&&(g.initial===!1||g.initial===g.animate)&&!t.manuallyAnimateOnMount&&(E=!1),o=!1,E?a(y):Promise.resolve()}function p(m,g){var v;if(i[m].isActive===g)return Promise.resolve();(v=t.variantChildren)===null||v===void 0||v.forEach(b=>{var S;return(S=b.animationState)===null||S===void 0?void 0:S.setActive(m,g)}),i[m].isActive=g;const y=d(m);for(const b in i)i[b].protectedKeys={};return y}return{animateChanges:d,setActive:p,setAnimateFunction:u,getState:()=>i,reset:()=>{i=Hy(),o=!0}}}function Wj(t,a){return typeof a=="string"?a!==t:Array.isArray(a)?!ax(a,t):!1}function Es(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hy(){return{animate:Es(!0),whileInView:Es(),whileHover:Es(),whileTap:Es(),whileDrag:Es(),whileFocus:Es(),exit:Es()}}class is{constructor(a){this.isMounted=!1,this.node=a}update(){}}class Jj extends is{constructor(a){super(a),a.animationState||(a.animationState=Qj(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();Ac(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:i}=this.node.prevProps||{};a!==i&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)===null||a===void 0||a.call(this)}}let ew=0;class tw extends is{constructor(){super(...arguments),this.id=ew++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)return;const r=this.node.animationState.setActive("exit",!a);i&&!a&&r.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const nw={animation:{Feature:Jj},exit:{Feature:tw}},In={x:!1,y:!1};function Px(){return In.x||In.y}function aw(t){return t==="x"||t==="y"?In[t]?null:(In[t]=!0,()=>{In[t]=!1}):In.x||In.y?null:(In.x=In.y=!0,()=>{In.x=In.y=!1})}const Fh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function bl(t,a,i,o={passive:!0}){return t.addEventListener(a,i,o),()=>t.removeEventListener(a,i)}function El(t){return{point:{x:t.pageX,y:t.pageY}}}const sw=t=>a=>Fh(a)&&t(a,El(a));function rl(t,a,i,o){return bl(t,a,sw(i),o)}const Py=(t,a)=>Math.abs(t-a);function iw(t,a){const i=Py(t.x,a.x),o=Py(t.y,a.y);return Math.sqrt(i**2+o**2)}class Gx{constructor(a,i,{transformPagePoint:o,contextWindow:r,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=uf(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,S=iw(y.offset,{x:0,y:0})>=3;if(!b&&!S)return;const{point:T}=y,{timestamp:E}=Ut;this.history.push({...T,timestamp:E});const{onStart:N,onMove:C}=this.handlers;b||(N&&N(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,y)},this.handlePointerMove=(y,b)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=cf(b,this.transformPagePoint),ot.update(this.updatePoint,!0)},this.handlePointerUp=(y,b)=>{this.end();const{onEnd:S,onSessionEnd:T,resumeAnimation:E}=this.handlers;if(this.dragSnapToOrigin&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=uf(y.type==="pointercancel"?this.lastMoveEventInfo:cf(b,this.transformPagePoint),this.history);this.startEvent&&S&&S(y,N),T&&T(y,N)},!Fh(a))return;this.dragSnapToOrigin=u,this.handlers=i,this.transformPagePoint=o,this.contextWindow=r||window;const d=El(a),p=cf(d,this.transformPagePoint),{point:m}=p,{timestamp:g}=Ut;this.history=[{...m,timestamp:g}];const{onSessionStart:v}=i;v&&v(a,uf(p,this.history)),this.removeListeners=Cl(rl(this.contextWindow,"pointermove",this.handlePointerMove),rl(this.contextWindow,"pointerup",this.handlePointerUp),rl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),ts(this.updatePoint)}}function cf(t,a){return a?{point:a(t.point)}:t}function Gy(t,a){return{x:t.x-a.x,y:t.y-a.y}}function uf({point:t},a){return{point:t,delta:Gy(t,$x(a)),offset:Gy(t,ow(a)),velocity:lw(a,.1)}}function ow(t){return t[0]}function $x(t){return t[t.length-1]}function lw(t,a){if(t.length<2)return{x:0,y:0};let i=t.length-1,o=null;const r=$x(t);for(;i>=0&&(o=t[i],!(r.timestamp-o.timestamp>ya(a)));)i--;if(!o)return{x:0,y:0};const u=ba(r.timestamp-o.timestamp);if(u===0)return{x:0,y:0};const d={x:(r.x-o.x)/u,y:(r.y-o.y)/u};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}const Fx=1e-4,rw=1-Fx,cw=1+Fx,qx=.01,uw=0-qx,dw=0+qx;function hn(t){return t.max-t.min}function fw(t,a,i){return Math.abs(t-a)<=i}function $y(t,a,i,o=.5){t.origin=o,t.originPoint=ut(a.min,a.max,t.origin),t.scale=hn(i)/hn(a),t.translate=ut(i.min,i.max,t.origin)-t.originPoint,(t.scale>=rw&&t.scale<=cw||isNaN(t.scale))&&(t.scale=1),(t.translate>=uw&&t.translate<=dw||isNaN(t.translate))&&(t.translate=0)}function cl(t,a,i,o){$y(t.x,a.x,i.x,o?o.originX:void 0),$y(t.y,a.y,i.y,o?o.originY:void 0)}function Fy(t,a,i){t.min=i.min+a.min,t.max=t.min+hn(a)}function hw(t,a,i){Fy(t.x,a.x,i.x),Fy(t.y,a.y,i.y)}function qy(t,a,i){t.min=a.min-i.min,t.max=t.min+hn(a)}function ul(t,a,i){qy(t.x,a.x,i.x),qy(t.y,a.y,i.y)}function pw(t,{min:a,max:i},o){return a!==void 0&&t<a?t=o?ut(a,t,o.min):Math.max(t,a):i!==void 0&&t>i&&(t=o?ut(i,t,o.max):Math.min(t,i)),t}function Ky(t,a,i){return{min:a!==void 0?t.min+a:void 0,max:i!==void 0?t.max+i-(t.max-t.min):void 0}}function mw(t,{top:a,left:i,bottom:o,right:r}){return{x:Ky(t.x,i,r),y:Ky(t.y,a,o)}}function Yy(t,a){let i=a.min-t.min,o=a.max-t.max;return a.max-a.min<t.max-t.min&&([i,o]=[o,i]),{min:i,max:o}}function gw(t,a){return{x:Yy(t.x,a.x),y:Yy(t.y,a.y)}}function vw(t,a){let i=.5;const o=hn(t),r=hn(a);return r>o?i=Fi(a.min,a.max-o,t.min):o>r&&(i=Fi(t.min,t.max-r,a.min)),Sa(0,1,i)}function yw(t,a){const i={};return a.min!==void 0&&(i.min=a.min-t.min),a.max!==void 0&&(i.max=a.max-t.min),i}const Pf=.35;function bw(t=Pf){return t===!1?t=0:t===!0&&(t=Pf),{x:Zy(t,"left","right"),y:Zy(t,"top","bottom")}}function Zy(t,a,i){return{min:Xy(t,a),max:Xy(t,i)}}function Xy(t,a){return typeof t=="number"?t:t[a]||0}const Qy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Li=()=>({x:Qy(),y:Qy()}),Wy=()=>({min:0,max:0}),vt=()=>({x:Wy(),y:Wy()});function wn(t){return[t("x"),t("y")]}function Kx({top:t,left:a,right:i,bottom:o}){return{x:{min:a,max:i},y:{min:t,max:o}}}function xw({x:t,y:a}){return{top:a.min,right:t.max,bottom:a.max,left:t.min}}function _w(t,a){if(!a)return t;const i=a({x:t.left,y:t.top}),o=a({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function df(t){return t===void 0||t===1}function Gf({scale:t,scaleX:a,scaleY:i}){return!df(t)||!df(a)||!df(i)}function ws(t){return Gf(t)||Yx(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Yx(t){return Jy(t.x)||Jy(t.y)}function Jy(t){return t&&t!=="0%"}function vc(t,a,i){const o=t-i,r=a*o;return i+r}function e0(t,a,i,o,r){return r!==void 0&&(t=vc(t,r,o)),vc(t,i,o)+a}function $f(t,a=0,i=1,o,r){t.min=e0(t.min,a,i,o,r),t.max=e0(t.max,a,i,o,r)}function Zx(t,{x:a,y:i}){$f(t.x,a.translate,a.scale,a.originPoint),$f(t.y,i.translate,i.scale,i.originPoint)}const t0=.999999999999,n0=1.0000000000001;function Sw(t,a,i,o=!1){const r=i.length;if(!r)return;a.x=a.y=1;let u,d;for(let p=0;p<r;p++){u=i[p],d=u.projectionDelta;const{visualElement:m}=u.options;m&&m.props.style&&m.props.style.display==="contents"||(o&&u.options.layoutScroll&&u.scroll&&u!==u.root&&zi(t,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),d&&(a.x*=d.x.scale,a.y*=d.y.scale,Zx(t,d)),o&&ws(u.latestValues)&&zi(t,u.latestValues))}a.x<n0&&a.x>t0&&(a.x=1),a.y<n0&&a.y>t0&&(a.y=1)}function Ui(t,a){t.min=t.min+a,t.max=t.max+a}function a0(t,a,i,o,r=.5){const u=ut(t.min,t.max,r);$f(t,a,i,u,o)}function zi(t,a){a0(t.x,a.x,a.scaleX,a.scale,a.originX),a0(t.y,a.y,a.scaleY,a.scale,a.originY)}function Xx(t,a){return Kx(_w(t.getBoundingClientRect(),a))}function Tw(t,a,i){const o=Xx(t,i),{scroll:r}=a;return r&&(Ui(o.x,r.offset.x),Ui(o.y,r.offset.y)),o}const Qx=({current:t})=>t?t.ownerDocument.defaultView:null,kw=new WeakMap;class Cw{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=vt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=v=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(El(v).point)},u=(v,y)=>{const{drag:b,dragPropagation:S,onDragStart:T}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=aw(b),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),wn(N=>{let C=this.getAxisMotionValue(N).get()||0;if(Zn.test(C)){const{projection:j}=this.visualElement;if(j&&j.layout){const D=j.layout.layoutBox[N];D&&(C=hn(D)*(parseFloat(C)/100))}}this.originPoint[N]=C}),T&&ot.postRender(()=>T(v,y)),Mf(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},d=(v,y)=>{const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:T,onDrag:E}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:N}=y;if(S&&this.currentDirection===null){this.currentDirection=Ew(N),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",y.point,N),this.updateAxis("y",y.point,N),this.visualElement.render(),E&&E(v,y)},p=(v,y)=>this.stop(v,y),m=()=>wn(v=>{var y;return this.getAnimationState(v)==="paused"&&((y=this.getAxisMotionValue(v).animation)===null||y===void 0?void 0:y.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new Gx(a,{onSessionStart:r,onStart:u,onMove:d,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:Qx(this.visualElement)})}stop(a,i){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:u}=this.getProps();u&&ot.postRender(()=>u(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,o){const{drag:r}=this.getProps();if(!o||!Xr(a,r,this.currentDirection))return;const u=this.getAxisMotionValue(a);let d=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(d=pw(d,this.constraints[a],this.elastic[a])),u.set(d)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:o}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,u=this.constraints;i&&Bi(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=mw(r.layoutBox,i):this.constraints=!1,this.elastic=bw(o),u!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&wn(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=yw(r.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Bi(a))return!1;const o=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const u=Tw(o,r.root,this.visualElement.getTransformPagePoint());let d=gw(r.layout.layoutBox,u);if(i){const p=i(xw(d));this.hasMutatedConstraints=!!p,p&&(d=Kx(p))}return d}startAnimation(a){const{drag:i,dragMomentum:o,dragElastic:r,dragTransition:u,dragSnapToOrigin:d,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=wn(v=>{if(!Xr(v,i,this.currentDirection))return;let y=m&&m[v]||{};d&&(y={min:0,max:0});const b=r?200:1e6,S=r?40:1e7,T={type:"inertia",velocity:o?a[v]:0,bounceStiffness:b,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(v,T)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const o=this.getAxisMotionValue(a);return Mf(this.visualElement,a),o.start($h(a,o,0,i,this.visualElement,!1))}stopAnimation(){wn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){wn(a=>{var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(a){var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(a){const i=`_drag${a.toUpperCase()}`,o=this.visualElement.getProps(),r=o[i];return r||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){wn(i=>{const{drag:o}=this.getProps();if(!Xr(i,o,this.currentDirection))return;const{projection:r}=this.visualElement,u=this.getAxisMotionValue(i);if(r&&r.layout){const{min:d,max:p}=r.layout.layoutBox[i];u.set(a[i]-ut(d,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:o}=this.visualElement;if(!Bi(i)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};wn(d=>{const p=this.getAxisMotionValue(d);if(p&&this.constraints!==!1){const m=p.get();r[d]=vw({min:m,max:m},this.constraints[d])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),wn(d=>{if(!Xr(d,a,null))return;const p=this.getAxisMotionValue(d),{min:m,max:g}=this.constraints[d];p.set(ut(m,g,r[d]))})}addListeners(){if(!this.visualElement.current)return;kw.set(this.visualElement,this);const a=this.visualElement.current,i=rl(a,"pointerdown",m=>{const{drag:g,dragListener:v=!0}=this.getProps();g&&v&&this.start(m)}),o=()=>{const{dragConstraints:m}=this.getProps();Bi(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,u=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),ot.read(o);const d=bl(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(wn(v=>{const y=this.getAxisMotionValue(v);y&&(this.originPoint[v]+=m[v].translate,y.set(y.get()+m[v].translate))}),this.visualElement.render())}));return()=>{d(),i(),u(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:u=!1,dragElastic:d=Pf,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:o,dragPropagation:r,dragConstraints:u,dragElastic:d,dragMomentum:p}}}function Xr(t,a,i){return(a===!0||a===t)&&(i===null||i===t)}function Ew(t,a=10){let i=null;return Math.abs(t.y)>a?i="y":Math.abs(t.x)>a&&(i="x"),i}class Nw extends is{constructor(a){super(a),this.removeGroupControls=fn,this.removeListeners=fn,this.controls=new Cw(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fn}unmount(){this.removeGroupControls(),this.removeListeners()}}const s0=t=>(a,i)=>{t&&ot.postRender(()=>t(a,i))};class jw extends is{constructor(){super(...arguments),this.removePointerDownListener=fn}onPointerDown(a){this.session=new Gx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Qx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:s0(a),onStart:s0(i),onMove:o,onEnd:(u,d)=>{delete this.session,r&&ot.postRender(()=>r(u,d))}}}mount(){this.removePointerDownListener=rl(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const lc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function i0(t,a){return a.max===a.min?0:t/(a.max-a.min)*100}const Xo={correct:(t,a)=>{if(!a.target)return t;if(typeof t=="string")if(ve.test(t))t=parseFloat(t);else return t;const i=i0(t,a.target.x),o=i0(t,a.target.y);return`${i}% ${o}%`}},ww={correct:(t,{treeScale:a,projectionDelta:i})=>{const o=t,r=ns.parse(t);if(r.length>5)return o;const u=ns.createTransformer(t),d=typeof r[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;r[0+d]/=p,r[1+d]/=m;const g=ut(p,m,.5);return typeof r[2+d]=="number"&&(r[2+d]/=g),typeof r[3+d]=="number"&&(r[3+d]/=g),u(r)}};class Aw extends x.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o,layoutId:r}=this.props,{projection:u}=a;nN(Dw),u&&(i.group&&i.group.add(u),o&&o.register&&r&&o.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),lc.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:o,drag:r,isPresent:u}=this.props,d=o.projection;return d&&(d.isPresent=u,r||a.layoutDependency!==i||i===void 0?d.willUpdate():this.safeToRemove(),a.isPresent!==u&&(u?d.promote():d.relegate()||ot.postRender(()=>{const p=d.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),bh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function Wx(t){const[a,i]=Ib(),o=x.useContext(fh);return c.jsx(Aw,{...t,layoutGroup:o,switchLayoutGroup:x.useContext($b),isPresent:a,safeToRemove:i})}const Dw={borderRadius:{...Xo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Xo,borderTopRightRadius:Xo,borderBottomLeftRadius:Xo,borderBottomRightRadius:Xo,boxShadow:ww};function Mw(t,a,i){const o=Pt(t)?t:vl(t);return o.start($h("",o,a,i)),o.animation}function Rw(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Ow=(t,a)=>t.depth-a.depth;class Bw{constructor(){this.children=[],this.isDirty=!1}add(a){Ah(this.children,a),this.isDirty=!0}remove(a){Dh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(Ow),this.isDirty=!1,this.children.forEach(a)}}function Iw(t,a){const i=Xn.now(),o=({timestamp:r})=>{const u=r-i;u>=a&&(ts(o),t(u-a))};return ot.read(o,!0),()=>ts(o)}const Jx=["TopLeft","TopRight","BottomLeft","BottomRight"],Lw=Jx.length,o0=t=>typeof t=="string"?parseFloat(t):t,l0=t=>typeof t=="number"||ve.test(t);function Uw(t,a,i,o,r,u){r?(t.opacity=ut(0,i.opacity!==void 0?i.opacity:1,zw(o)),t.opacityExit=ut(a.opacity!==void 0?a.opacity:1,0,Vw(o))):u&&(t.opacity=ut(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,o));for(let d=0;d<Lw;d++){const p=`border${Jx[d]}Radius`;let m=r0(a,p),g=r0(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||l0(m)===l0(g)?(t[p]=Math.max(ut(o0(m),o0(g),o),0),(Zn.test(g)||Zn.test(m))&&(t[p]+="%")):t[p]=g}(a.rotate||i.rotate)&&(t.rotate=ut(a.rotate||0,i.rotate||0,o))}function r0(t,a){return t[a]!==void 0?t[a]:t.borderRadius}const zw=e_(0,.5,gx),Vw=e_(.5,.95,fn);function e_(t,a,i){return o=>o<t?0:o>a?1:i(Fi(t,a,o))}function c0(t,a){t.min=a.min,t.max=a.max}function Nn(t,a){c0(t.x,a.x),c0(t.y,a.y)}function u0(t,a){t.translate=a.translate,t.scale=a.scale,t.originPoint=a.originPoint,t.origin=a.origin}function d0(t,a,i,o,r){return t-=a,t=vc(t,1/i,o),r!==void 0&&(t=vc(t,1/r,o)),t}function Hw(t,a=0,i=1,o=.5,r,u=t,d=t){if(Zn.test(a)&&(a=parseFloat(a),a=ut(d.min,d.max,a/100)-d.min),typeof a!="number")return;let p=ut(u.min,u.max,o);t===u&&(p-=a),t.min=d0(t.min,a,i,p,r),t.max=d0(t.max,a,i,p,r)}function f0(t,a,[i,o,r],u,d){Hw(t,a[i],a[o],a[r],a.scale,u,d)}const Pw=["x","scaleX","originX"],Gw=["y","scaleY","originY"];function h0(t,a,i,o){f0(t.x,a,Pw,i?i.x:void 0,o?o.x:void 0),f0(t.y,a,Gw,i?i.y:void 0,o?o.y:void 0)}function p0(t){return t.translate===0&&t.scale===1}function t_(t){return p0(t.x)&&p0(t.y)}function m0(t,a){return t.min===a.min&&t.max===a.max}function $w(t,a){return m0(t.x,a.x)&&m0(t.y,a.y)}function g0(t,a){return Math.round(t.min)===Math.round(a.min)&&Math.round(t.max)===Math.round(a.max)}function n_(t,a){return g0(t.x,a.x)&&g0(t.y,a.y)}function v0(t){return hn(t.x)/hn(t.y)}function y0(t,a){return t.translate===a.translate&&t.scale===a.scale&&t.originPoint===a.originPoint}class Fw{constructor(){this.members=[]}add(a){Ah(this.members,a),a.scheduleRender()}remove(a){if(Dh(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(r=>a===r);if(i===0)return!1;let o;for(let r=i;r>=0;r--){const u=this.members[r];if(u.isPresent!==!1){o=u;break}}return o?(this.promote(o),!0):!1}promote(a,i){const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.instance&&o.scheduleRender(),a.scheduleRender(),a.resumeFrom=o,i&&(a.resumeFrom.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:o}=a;i.onExitComplete&&i.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function qw(t,a,i){let o="";const r=t.x.translate/a.x,u=t.y.translate/a.y,d=(i==null?void 0:i.z)||0;if((r||u||d)&&(o=`translate3d(${r}px, ${u}px, ${d}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:v,rotateX:y,rotateY:b,skewX:S,skewY:T}=i;g&&(o=`perspective(${g}px) ${o}`),v&&(o+=`rotate(${v}deg) `),y&&(o+=`rotateX(${y}deg) `),b&&(o+=`rotateY(${b}deg) `),S&&(o+=`skewX(${S}deg) `),T&&(o+=`skewY(${T}deg) `)}const p=t.x.scale*a.x,m=t.y.scale*a.y;return(p!==1||m!==1)&&(o+=`scale(${p}, ${m})`),o||"none"}const As={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},tl=typeof window<"u"&&window.MotionDebug!==void 0,ff=["","X","Y","Z"],Kw={visibility:"hidden"},b0=1e3;let Yw=0;function hf(t,a,i,o){const{latestValues:r}=a;r[t]&&(i[t]=r[t],a.setStaticValue(t,0),o&&(o[t]=0))}function a_(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:a}=t.options;if(!a)return;const i=ox(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:u}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",ot,!(r||u))}const{parent:o}=t;o&&!o.hasCheckedOptimisedAppear&&a_(o)}function s_({attachResizeListener:t,defaultParent:a,measureScroll:i,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(d={},p=a==null?void 0:a()){this.id=Yw++,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,tl&&(As.totalNodes=As.resolvedTargetDeltas=As.recalculatedProjection=0),this.nodes.forEach(Qw),this.nodes.forEach(nA),this.nodes.forEach(aA),this.nodes.forEach(Ww),tl&&window.MotionDebug.record(As)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new Bw)}addEventListener(d,p){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new Mh),this.eventHandlers.get(d).add(p)}notifyListeners(d,...p){const m=this.eventHandlers.get(d);m&&m.notify(...p)}hasListeners(d){return this.eventHandlers.has(d)}mount(d,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Rw(d),this.instance=d;const{layoutId:m,layout:g,visualElement:v}=this.options;if(v&&!v.current&&v.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),t){let y;const b=()=>this.root.updateBlockedByResize=!1;t(d,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=Iw(b,250),lc.hasAnimatedSinceResize&&(lc.hasAnimatedSinceResize=!1,this.nodes.forEach(_0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&v&&(m||g)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:b,hasRelativeTargetChanged:S,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const E=this.options.transition||v.getDefaultTransition()||rA,{onLayoutAnimationStart:N,onLayoutAnimationComplete:C}=v.getProps(),j=!this.targetLayout||!n_(this.targetLayout,T)||S,D=!b&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||D||b&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(y,D);const M={...wh(E,"layout"),onPlay:N,onComplete:C};(v.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M)}else b||_0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ts(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(sA),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&a_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const y=this.path[v];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(x0);return}this.isUpdating||this.nodes.forEach(eA),this.isUpdating=!1,this.nodes.forEach(tA),this.nodes.forEach(Zw),this.nodes.forEach(Xw),this.clearAllSnapshots();const p=Xn.now();Ut.delta=Sa(0,1e3/60,p-Ut.timestamp),Ut.timestamp=p,Ut.isProcessing=!0,af.update.process(Ut),af.preRender.process(Ut),af.render.process(Ut),Ut.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Jw),this.sharedNodes.forEach(iA)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ot.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ot.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const d=this.layout;this.layout=this.measure(!1),this.layoutCorrected=vt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,d?d.layoutBox:void 0)}updateScroll(d="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(p=!1),p){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!r)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!t_(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,v=g!==this.prevTransformTemplateValue;d&&(p||ws(this.latestValues)||v)&&(r(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return d&&(m=this.removeTransform(m)),cA(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:p}=this.options;if(!p)return vt();const m=p.measureViewportBox();if(!(((d=this.scroll)===null||d===void 0?void 0:d.wasRoot)||this.path.some(uA))){const{scroll:v}=this.root;v&&(Ui(m.x,v.offset.x),Ui(m.y,v.offset.y))}return m}removeElementScroll(d){var p;const m=vt();if(Nn(m,d),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const v=this.path[g],{scroll:y,options:b}=v;v!==this.root&&y&&b.layoutScroll&&(y.wasRoot&&Nn(m,d),Ui(m.x,y.offset.x),Ui(m.y,y.offset.y))}return m}applyTransform(d,p=!1){const m=vt();Nn(m,d);for(let g=0;g<this.path.length;g++){const v=this.path[g];!p&&v.options.layoutScroll&&v.scroll&&v!==v.root&&zi(m,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),ws(v.latestValues)&&zi(m,v.latestValues)}return ws(this.latestValues)&&zi(m,this.latestValues),m}removeTransform(d){const p=vt();Nn(p,d);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!ws(g.latestValues))continue;Gf(g.latestValues)&&g.updateSnapshot();const v=vt(),y=g.measurePageBox();Nn(v,y),h0(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,v)}return ws(this.latestValues)&&h0(p,this.latestValues),p}setTargetDelta(d){this.targetDelta=d,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(d){this.options={...this.options,...d,crossfade:d.crossfade!==void 0?d.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ut.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!1){var p;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(d||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:b}=this.options;if(!(!this.layout||!(y||b))){if(this.resolvedRelativeTargetAt=Ut.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vt(),this.relativeTargetOrigin=vt(),ul(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Nn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=vt(),this.targetWithTransforms=vt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hw(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Nn(this.target,this.layout.layoutBox),Zx(this.target,this.targetDelta)):Nn(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=vt(),this.relativeTargetOrigin=vt(),ul(this.relativeTargetOrigin,this.target,S.target),Nn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}tl&&As.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Gf(this.parent.latestValues)||Yx(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var d;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((d=this.parent)===null||d===void 0)&&d.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===Ut.timestamp&&(g=!1),g)return;const{layout:v,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(v||y))return;Nn(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,S=this.treeScale.y;Sw(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=vt());const{target:T}=p;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(u0(this.prevProjectionDelta.x,this.projectionDelta.x),u0(this.prevProjectionDelta.y,this.projectionDelta.y)),cl(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==S||!y0(this.projectionDelta.x,this.prevProjectionDelta.x)||!y0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T)),tl&&As.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),d){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Li(),this.projectionDelta=Li(),this.projectionDeltaWithTransform=Li()}setAnimationOrigin(d,p=!1){const m=this.snapshot,g=m?m.latestValues:{},v={...this.latestValues},y=Li();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const b=vt(),S=m?m.source:void 0,T=this.layout?this.layout.source:void 0,E=S!==T,N=this.getStack(),C=!N||N.members.length<=1,j=!!(E&&!C&&this.options.crossfade===!0&&!this.path.some(lA));this.animationProgress=0;let D;this.mixTargetDelta=M=>{const w=M/1e3;S0(y.x,d.x,w),S0(y.y,d.y,w),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ul(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),oA(this.relativeTarget,this.relativeTargetOrigin,b,w),D&&$w(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=vt()),Nn(D,this.relativeTarget)),E&&(this.animationValues=v,Uw(v,g,this.latestValues,w,j,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ts(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ot.update(()=>{lc.hasAnimatedSinceResize=!0,this.currentAnimation=Mw(0,b0,{...d,onUpdate:p=>{this.mixTargetDelta(p),d.onUpdate&&d.onUpdate(p)},onComplete:()=>{d.onComplete&&d.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(b0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:v}=d;if(!(!p||!m||!g)){if(this!==d&&this.layout&&g&&i_(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||vt();const y=hn(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+y;const b=hn(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+b}Nn(p,m),zi(p,v),cl(this.projectionDeltaWithTransform,this.layoutCorrected,p,v)}}registerSharedNode(d,p){this.sharedNodes.has(d)||this.sharedNodes.set(d,new Fw),this.sharedNodes.get(d).add(p);const g=p.options.initialPromotionConfig;p.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(p):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){var d;const{layoutId:p}=this.options;return p?((d=this.getStack())===null||d===void 0?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:p}=this.options;return p?(d=this.getStack())===null||d===void 0?void 0:d.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),d&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let p=!1;const{latestValues:m}=d;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&hf("z",d,g,this.animationValues);for(let v=0;v<ff.length;v++)hf(`rotate${ff[v]}`,d,g,this.animationValues),hf(`skew${ff[v]}`,d,g,this.animationValues);d.render();for(const v in g)d.setStaticValue(v,g[v]),this.animationValues&&(this.animationValues[v]=g[v]);d.scheduleRender()}getProjectionStyles(d){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Kw;const g={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=ic(d==null?void 0:d.pointerEvents)||"",g.transform=v?v(this.latestValues,""):"none",g;const y=this.getLead();if(!this.projectionDelta||!this.layout||!y.target){const E={};return this.options.layoutId&&(E.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,E.pointerEvents=ic(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!ws(this.latestValues)&&(E.transform=v?v({},""):"none",this.hasProjected=!1),E}const b=y.animationValues||y.latestValues;this.applyTransformsToTarget(),g.transform=qw(this.projectionDeltaWithTransform,this.treeScale,b),v&&(g.transform=v(b,g.transform));const{x:S,y:T}=this.projectionDelta;g.transformOrigin=`${S.origin*100}% ${T.origin*100}% 0`,y.animationValues?g.opacity=y===this?(m=(p=b.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:b.opacityExit:g.opacity=y===this?b.opacity!==void 0?b.opacity:"":b.opacityExit!==void 0?b.opacityExit:0;for(const E in fc){if(b[E]===void 0)continue;const{correct:N,applyTo:C}=fc[E],j=g.transform==="none"?b[E]:N(b[E],y);if(C){const D=C.length;for(let M=0;M<D;M++)g[C[M]]=j}else g[E]=j}return this.options.layoutId&&(g.pointerEvents=y===this?ic(d==null?void 0:d.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>{var p;return(p=d.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(x0),this.root.sharedNodes.clear()}}}function Zw(t){t.updateLayout()}function Xw(t){var a;const i=((a=t.resumeFrom)===null||a===void 0?void 0:a.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:r}=t.layout,{animationType:u}=t.options,d=i.source!==t.layout.source;u==="size"?wn(y=>{const b=d?i.measuredBox[y]:i.layoutBox[y],S=hn(b);b.min=o[y].min,b.max=b.min+S}):i_(u,i.layoutBox,o)&&wn(y=>{const b=d?i.measuredBox[y]:i.layoutBox[y],S=hn(o[y]);b.max=b.min+S,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[y].max=t.relativeTarget[y].min+S)});const p=Li();cl(p,o,i.layoutBox);const m=Li();d?cl(m,t.applyTransform(r,!0),i.measuredBox):cl(m,o,i.layoutBox);const g=!t_(p);let v=!1;if(!t.resumeFrom){const y=t.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:b,layout:S}=y;if(b&&S){const T=vt();ul(T,i.layoutBox,b.layoutBox);const E=vt();ul(E,o,S.layoutBox),n_(T,E)||(v=!0),y.options.layoutRoot&&(t.relativeTarget=E,t.relativeTargetOrigin=T,t.relativeParent=y)}}}t.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:v})}else if(t.isLead()){const{onExitComplete:o}=t.options;o&&o()}t.options.transition=void 0}function Qw(t){tl&&As.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Ww(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Jw(t){t.clearSnapshot()}function x0(t){t.clearMeasurements()}function eA(t){t.isLayoutDirty=!1}function tA(t){const{visualElement:a}=t.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),t.resetTransform()}function _0(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function nA(t){t.resolveTargetDelta()}function aA(t){t.calcProjection()}function sA(t){t.resetSkewAndRotation()}function iA(t){t.removeLeadSnapshot()}function S0(t,a,i){t.translate=ut(a.translate,0,i),t.scale=ut(a.scale,1,i),t.origin=a.origin,t.originPoint=a.originPoint}function T0(t,a,i,o){t.min=ut(a.min,i.min,o),t.max=ut(a.max,i.max,o)}function oA(t,a,i,o){T0(t.x,a.x,i.x,o),T0(t.y,a.y,i.y,o)}function lA(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const rA={duration:.45,ease:[.4,0,.1,1]},k0=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),C0=k0("applewebkit/")&&!k0("chrome/")?Math.round:fn;function E0(t){t.min=C0(t.min),t.max=C0(t.max)}function cA(t){E0(t.x),E0(t.y)}function i_(t,a,i){return t==="position"||t==="preserve-aspect"&&!fw(v0(a),v0(i),.2)}function uA(t){var a;return t!==t.root&&((a=t.scroll)===null||a===void 0?void 0:a.wasRoot)}const dA=s_({attachResizeListener:(t,a)=>bl(t,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pf={current:void 0},o_=s_({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!pf.current){const t=new dA({});t.mount(window),t.setOptions({layoutScroll:!0}),pf.current=t}return pf.current},resetTransform:(t,a)=>{t.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),fA={pan:{Feature:jw},drag:{Feature:Nw,ProjectionNode:o_,MeasureLayout:Wx}};function hA(t,a,i){var o;if(t instanceof Element)return[t];if(typeof t=="string"){let r=document;const u=(o=void 0)!==null&&o!==void 0?o:r.querySelectorAll(t);return u?Array.from(u):[]}return Array.from(t)}function l_(t,a){const i=hA(t),o=new AbortController,r={passive:!0,...a,signal:o.signal};return[i,r,()=>o.abort()]}function N0(t){return a=>{a.pointerType==="touch"||Px()||t(a)}}function pA(t,a,i={}){const[o,r,u]=l_(t,i),d=N0(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const v=N0(y=>{g(y),m.removeEventListener("pointerleave",v)});m.addEventListener("pointerleave",v,r)});return o.forEach(p=>{p.addEventListener("pointerenter",d,r)}),u}function j0(t,a,i){const{props:o}=t;t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,u=o[r];u&&ot.postRender(()=>u(a,El(a)))}class mA extends is{mount(){const{current:a}=this.node;a&&(this.unmount=pA(a,i=>(j0(this.node,i,"Start"),o=>j0(this.node,o,"End"))))}unmount(){}}class gA extends is{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=Cl(bl(this.node.current,"focus",()=>this.onFocus()),bl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const r_=(t,a)=>a?t===a?!0:r_(t,a.parentElement):!1,vA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function yA(t){return vA.has(t.tagName)||t.tabIndex!==-1}const nl=new WeakSet;function w0(t){return a=>{a.key==="Enter"&&t(a)}}function mf(t,a){t.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const bA=(t,a)=>{const i=t.currentTarget;if(!i)return;const o=w0(()=>{if(nl.has(i))return;mf(i,"down");const r=w0(()=>{mf(i,"up")}),u=()=>mf(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",u,a)});i.addEventListener("keydown",o,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),a)};function A0(t){return Fh(t)&&!Px()}function xA(t,a,i={}){const[o,r,u]=l_(t,i),d=p=>{const m=p.currentTarget;if(!A0(p)||nl.has(m))return;nl.add(m);const g=a(p),v=(S,T)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",b),!(!A0(S)||!nl.has(m))&&(nl.delete(m),typeof g=="function"&&g(S,{success:T}))},y=S=>{v(S,i.useGlobalTarget||r_(m,S.target))},b=S=>{v(S,!1)};window.addEventListener("pointerup",y,r),window.addEventListener("pointercancel",b,r)};return o.forEach(p=>{!yA(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",d,r),p.addEventListener("focus",g=>bA(g,r),r)}),u}function D0(t,a,i){const{props:o}=t;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),u=o[r];u&&ot.postRender(()=>u(a,El(a)))}class _A extends is{mount(){const{current:a}=this.node;a&&(this.unmount=xA(a,i=>(D0(this.node,i,"Start"),(o,{success:r})=>D0(this.node,o,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ff=new WeakMap,gf=new WeakMap,SA=t=>{const a=Ff.get(t.target);a&&a(t)},TA=t=>{t.forEach(SA)};function kA({root:t,...a}){const i=t||document;gf.has(i)||gf.set(i,{});const o=gf.get(i),r=JSON.stringify(a);return o[r]||(o[r]=new IntersectionObserver(TA,{root:t,...a})),o[r]}function CA(t,a,i){const o=kA(a);return Ff.set(t,i),o.observe(t),()=>{Ff.delete(t),o.unobserve(t)}}const EA={some:0,all:1};class NA extends is{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:o,amount:r="some",once:u}=a,d={root:i?i.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:EA[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,u&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:v,onViewportLeave:y}=this.node.getProps(),b=g?v:y;b&&b(m)};return CA(this.node.current,d,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(jA(a,i))&&this.startObserver()}unmount(){}}function jA({viewport:t={}},{viewport:a={}}={}){return i=>t[i]!==a[i]}const wA={inView:{Feature:NA},tap:{Feature:_A},focus:{Feature:gA},hover:{Feature:mA}},AA={layout:{ProjectionNode:o_,MeasureLayout:Wx}},yc={current:null},qh={current:!1};function c_(){if(qh.current=!0,!!mh)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),a=()=>yc.current=t.matches;t.addListener(a),a()}else yc.current=!1}const DA=[...Ax,Ht,ns],MA=t=>DA.find(wx(t)),M0=new WeakMap;function RA(t,a,i){for(const o in a){const r=a[o],u=i[o];if(Pt(r))t.addValue(o,r);else if(Pt(u))t.addValue(o,vl(r,{owner:t}));else if(u!==r)if(t.hasValue(o)){const d=t.getValue(o);d.liveStyle===!0?d.jump(r):d.hasAnimated||d.set(r)}else{const d=t.getStaticValue(o);t.addValue(o,vl(d!==void 0?d:r,{owner:t}))}}for(const o in i)a[o]===void 0&&t.removeValue(o);return a}const R0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class OA{scrapeMotionValuesFromProps(a,i,o){return{}}constructor({parent:a,props:i,presenceContext:o,reducedMotionConfig:r,blockInitialAnimation:u,visualState:d},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Hh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const S=Xn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,ot.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:v}=d;this.onUpdate=v,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=g,this.parent=a,this.props=i,this.presenceContext=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!u,this.isControllingVariants=Dc(i),this.isVariantNode=Pb(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:y,...b}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in b){const T=b[S];m[S]!==void 0&&Pt(T)&&T.set(m[S],!1)}}mount(a){this.current=a,M0.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,o)=>this.bindToMotionValue(o,i)),qh.current||c_(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:yc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){M0.delete(this.current),this.projection&&this.projection.unmount(),ts(this.notifyUpdate),ts(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=zs.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&ot.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),u=i.on("renderRequest",this.scheduleRender);let d;window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),u(),d&&d(),i.owner&&i.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in $i){const i=$i[a];if(!i)continue;const{isEnabled:o,Feature:r}=i;if(!this.features[a]&&r&&o(this.props)&&(this.features[a]=new r(this)),this.features[a]){const u=this.features[a];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):vt()}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<R0.length;o++){const r=R0[o];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const u="on"+r,d=a[u];d&&(this.propEventSubscriptions[r]=this.on(r,d))}this.prevMotionValues=RA(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=vl(i===null?void 0:i,{owner:this}),this.addValue(a,o)),o}readValue(a,i){var o;let r=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(o=this.getBaseTargetFromProps(this.props,a))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,a,this.options);return r!=null&&(typeof r=="string"&&(Nx(r)||yx(r))?r=parseFloat(r):!MA(r)&&ns.test(i)&&(r=kx(a,i)),this.setBaseTarget(a,Pt(r)?r.get():r)),Pt(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:o}=this.props;let r;if(typeof o=="string"||typeof o=="object"){const d=_h(this.props,o,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);d&&(r=d[a])}if(o&&r!==void 0)return r;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!Pt(u)?u:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new Mh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class u_ extends OA{constructor(){super(...arguments),this.KeyframeResolver=Dx}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;Pt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function BA(t){return window.getComputedStyle(t)}class IA extends u_{constructor(){super(...arguments),this.type="html",this.renderInstance=Qb}readValueFromInstance(a,i){if(zs.has(i)){const o=Vh(i);return o&&o.default||0}else{const o=BA(a),r=(Yb(i)?o.getPropertyValue(i):o[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Xx(a,i)}build(a,i,o){kh(a,i,o.transformTemplate)}scrapeMotionValuesFromProps(a,i,o){return jh(a,i,o)}}class LA extends u_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=vt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(zs.has(i)){const o=Vh(i);return o&&o.default||0}return i=Wb.has(i)?i:yh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,o){return tx(a,i,o)}build(a,i,o){Ch(a,i,this.isSVGTag,o.transformTemplate)}renderInstance(a,i,o,r){Jb(a,i,o,r)}mount(a){this.isSVGTag=Nh(a.tagName),super.mount(a)}}const UA=(t,a)=>xh(t)?new LA(a):new IA(a,{allowProjection:t!==x.Fragment}),zA=dN({...nw,...wA,...fA,...AA},UA),Ct=EE(zA);function VA(){!qh.current&&c_();const[t]=x.useState(yc.current);return t}var Je;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TEXT=1]="TEXT",t[t.TOOL_USE=2]="TOOL_USE",t[t.TOOL_RESULT=3]="TOOL_RESULT",t[t.ERROR=4]="ERROR",t[t.STATUS=5]="STATUS",t[t.SYSTEM=6]="SYSTEM",t[t.FINDING=7]="FINDING",t[t.SUBTASK_CREATE=8]="SUBTASK_CREATE",t[t.USER_INPUT=9]="USER_INPUT",t[t.SIGNAL=10]="SIGNAL",t[t.USAGE=11]="USAGE"})(Je||(Je={}));var kt;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.NOT_STARTED=1]="NOT_STARTED",t[t.WORKING=3]="WORKING",t[t.PAUSED=4]="PAUSED",t[t.COMPLETE=5]="COMPLETE",t[t.FAILED=6]="FAILED"})(kt||(kt={}));var Wa;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ACTIVE=1]="ACTIVE",t[t.ARCHIVED=2]="ARCHIVED"})(Wa||(Wa={}));var Ja;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OPEN=1]="OPEN",t[t.CLOSED=2]="CLOSED"})(Ja||(Ja={}));var Fn;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OFF=1]="OFF",t[t.SUBSCRIPTION=2]="SUBSCRIPTION",t[t.API_KEY=3]="API_KEY"})(Fn||(Fn={}));var es;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OFF=1]="OFF",t[t.ON=2]="ON"})(es||(es={}));const HA=8,O0="system",Qo="system";Object.assign(Object.create(null),{"":Je.UNSPECIFIED,text:Je.TEXT,tool_use:Je.TOOL_USE,tool_result:Je.TOOL_RESULT,error:Je.ERROR,status:Je.STATUS,system:Je.SYSTEM,finding:Je.FINDING,subtask_create:Je.SUBTASK_CREATE,user_input:Je.USER_INPUT,signal:Je.SIGNAL,usage:Je.USAGE});Je.UNSPECIFIED+"",Je.TEXT+"",Je.TOOL_USE+"",Je.TOOL_RESULT+"",Je.ERROR+"",Je.STATUS+"",Je.SYSTEM+"",Je.FINDING+"",Je.SUBTASK_CREATE+"",Je.USER_INPUT+"",Je.SIGNAL+"",Je.USAGE+"";Object.assign(Object.create(null),{"":kt.UNSPECIFIED,not_started:kt.NOT_STARTED,working:kt.WORKING,paused:kt.PAUSED,complete:kt.COMPLETE,failed:kt.FAILED,pending:kt.NOT_STARTED,assigned:kt.NOT_STARTED,in_progress:kt.WORKING,waiting_input:kt.PAUSED,review:kt.PAUSED,done:kt.COMPLETE});kt.UNSPECIFIED+"",kt.NOT_STARTED+"",kt.WORKING+"",kt.PAUSED+"",kt.COMPLETE+"",kt.FAILED+"";Object.assign(Object.create(null),{"":Wa.UNSPECIFIED,active:Wa.ACTIVE,archived:Wa.ARCHIVED});Wa.UNSPECIFIED+"",Wa.ACTIVE+"",Wa.ARCHIVED+"";Object.assign(Object.create(null),{"":Ja.UNSPECIFIED,open:Ja.OPEN,closed:Ja.CLOSED});Ja.UNSPECIFIED+"",Ja.OPEN+"",Ja.CLOSED+"";Object.assign(Object.create(null),{"":Fn.UNSPECIFIED,off:Fn.OFF,subscription:Fn.SUBSCRIPTION,api_key:Fn.API_KEY});Fn.UNSPECIFIED+"",Fn.OFF+"",Fn.SUBSCRIPTION+"",Fn.API_KEY+"";Object.assign(Object.create(null),{"":es.UNSPECIFIED,off:es.OFF,on:es.ON});es.UNSPECIFIED+"",es.OFF+"",es.ON+"";function Ta(t){return Array.isArray?Array.isArray(t):h_(t)==="[object Array]"}function PA(t){if(typeof t=="string")return t;let a=t+"";return a=="0"&&1/t==-1/0?"-0":a}function GA(t){return t==null?"":PA(t)}function qn(t){return typeof t=="string"}function d_(t){return typeof t=="number"}function $A(t){return t===!0||t===!1||FA(t)&&h_(t)=="[object Boolean]"}function f_(t){return typeof t=="object"}function FA(t){return f_(t)&&t!==null}function dn(t){return t!=null}function vf(t){return!t.trim().length}function h_(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const qA="Incorrect 'index' type",KA=t=>`Invalid value for key ${t}`,YA=t=>`Pattern length exceeds max of ${t}.`,ZA=t=>`Missing ${t} property in key`,XA=t=>`Property 'weight' in key '${t}' must be a positive integer`,B0=Object.prototype.hasOwnProperty;class QA{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(o=>{let r=p_(o);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(o=>{o.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function p_(t){let a=null,i=null,o=null,r=1,u=null;if(qn(t)||Ta(t))o=t,a=I0(t),i=qf(t);else{if(!B0.call(t,"name"))throw new Error(ZA("name"));const d=t.name;if(o=d,B0.call(t,"weight")&&(r=t.weight,r<=0))throw new Error(XA(d));a=I0(d),i=qf(d),u=t.getFn}return{path:a,id:i,weight:r,src:o,getFn:u}}function I0(t){return Ta(t)?t:t.split(".")}function qf(t){return Ta(t)?t.join("."):t}function WA(t,a){let i=[],o=!1;const r=(u,d,p)=>{if(dn(u))if(!d[p])i.push(u);else{let m=d[p];const g=u[m];if(!dn(g))return;if(p===d.length-1&&(qn(g)||d_(g)||$A(g)))i.push(GA(g));else if(Ta(g)){o=!0;for(let v=0,y=g.length;v<y;v+=1)r(g[v],d,p+1)}else d.length&&r(g,d,p+1)}};return r(t,qn(a)?a.split("."):a,0),o?i:i[0]}const JA={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},e2={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,a)=>t.score===a.score?t.idx<a.idx?-1:1:t.score<a.score?-1:1},t2={location:0,threshold:.6,distance:100},n2={useExtendedSearch:!1,getFn:WA,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var ye={...e2,...JA,...t2,...n2};const a2=/[^ ]+/g;function s2(t=1,a=3){const i=new Map,o=Math.pow(10,a);return{get(r){const u=r.match(a2).length;if(i.has(u))return i.get(u);const d=1/Math.pow(u,.5*t),p=parseFloat(Math.round(d*o)/o);return i.set(u,p),p},clear(){i.clear()}}}class Kh{constructor({getFn:a=ye.getFn,fieldNormWeight:i=ye.fieldNormWeight}={}){this.norm=s2(i,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((i,o)=>{this._keysMap[i.id]=o})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,qn(this.docs[0])?this.docs.forEach((a,i)=>{this._addString(a,i)}):this.docs.forEach((a,i)=>{this._addObject(a,i)}),this.norm.clear())}add(a){const i=this.size();qn(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,o=this.size();i<o;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!dn(a)||vf(a))return;let o={v:a,i,n:this.norm.get(a)};this.records.push(o)}_addObject(a,i){let o={i,$:{}};this.keys.forEach((r,u)=>{let d=r.getFn?r.getFn(a):this.getFn(a,r.path);if(dn(d)){if(Ta(d)){let p=[];const m=[{nestedArrIndex:-1,value:d}];for(;m.length;){const{nestedArrIndex:g,value:v}=m.pop();if(dn(v))if(qn(v)&&!vf(v)){let y={v,i:g,n:this.norm.get(v)};p.push(y)}else Ta(v)&&v.forEach((y,b)=>{m.push({nestedArrIndex:b,value:y})})}o.$[u]=p}else if(qn(d)&&!vf(d)){let p={v:d,n:this.norm.get(d)};o.$[u]=p}}}),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function m_(t,a,{getFn:i=ye.getFn,fieldNormWeight:o=ye.fieldNormWeight}={}){const r=new Kh({getFn:i,fieldNormWeight:o});return r.setKeys(t.map(p_)),r.setSources(a),r.create(),r}function i2(t,{getFn:a=ye.getFn,fieldNormWeight:i=ye.fieldNormWeight}={}){const{keys:o,records:r}=t,u=new Kh({getFn:a,fieldNormWeight:i});return u.setKeys(o),u.setIndexRecords(r),u}function Qr(t,{errors:a=0,currentLocation:i=0,expectedLocation:o=0,distance:r=ye.distance,ignoreLocation:u=ye.ignoreLocation}={}){const d=a/t.length;if(u)return d;const p=Math.abs(o-i);return r?d+p/r:p?1:d}function o2(t=[],a=ye.minMatchCharLength){let i=[],o=-1,r=-1,u=0;for(let d=t.length;u<d;u+=1){let p=t[u];p&&o===-1?o=u:!p&&o!==-1&&(r=u-1,r-o+1>=a&&i.push([o,r]),o=-1)}return t[u-1]&&u-o>=a&&i.push([o,u-1]),i}const Ds=32;function l2(t,a,i,{location:o=ye.location,distance:r=ye.distance,threshold:u=ye.threshold,findAllMatches:d=ye.findAllMatches,minMatchCharLength:p=ye.minMatchCharLength,includeMatches:m=ye.includeMatches,ignoreLocation:g=ye.ignoreLocation}={}){if(a.length>Ds)throw new Error(YA(Ds));const v=a.length,y=t.length,b=Math.max(0,Math.min(o,y));let S=u,T=b;const E=p>1||m,N=E?Array(y):[];let C;for(;(C=t.indexOf(a,T))>-1;){let V=Qr(a,{currentLocation:C,expectedLocation:b,distance:r,ignoreLocation:g});if(S=Math.min(V,S),T=C+v,E){let B=0;for(;B<v;)N[C+B]=1,B+=1}}T=-1;let j=[],D=1,M=v+y;const w=1<<v-1;for(let V=0;V<v;V+=1){let B=0,q=M;for(;B<q;)Qr(a,{errors:V,currentLocation:b+q,expectedLocation:b,distance:r,ignoreLocation:g})<=S?B=q:M=q,q=Math.floor((M-B)/2+B);M=q;let X=Math.max(1,b-q+1),ae=d?y:Math.min(b+q,y)+v,te=Array(ae+2);te[ae+1]=(1<<V)-1;for(let F=ae;F>=X;F-=1){let ne=F-1,I=i[t.charAt(ne)];if(E&&(N[ne]=+!!I),te[F]=(te[F+1]<<1|1)&I,V&&(te[F]|=(j[F+1]|j[F])<<1|1|j[F+1]),te[F]&w&&(D=Qr(a,{errors:V,currentLocation:ne,expectedLocation:b,distance:r,ignoreLocation:g}),D<=S)){if(S=D,T=ne,T<=b)break;X=Math.max(1,2*b-T)}}if(Qr(a,{errors:V+1,currentLocation:b,expectedLocation:b,distance:r,ignoreLocation:g})>S)break;j=te}const $={isMatch:T>=0,score:Math.max(.001,D)};if(E){const V=o2(N,p);V.length?m&&($.indices=V):$.isMatch=!1}return $}function r2(t){let a={};for(let i=0,o=t.length;i<o;i+=1){const r=t.charAt(i);a[r]=(a[r]||0)|1<<o-i-1}return a}const bc=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t);class g_{constructor(a,{location:i=ye.location,threshold:o=ye.threshold,distance:r=ye.distance,includeMatches:u=ye.includeMatches,findAllMatches:d=ye.findAllMatches,minMatchCharLength:p=ye.minMatchCharLength,isCaseSensitive:m=ye.isCaseSensitive,ignoreDiacritics:g=ye.ignoreDiacritics,ignoreLocation:v=ye.ignoreLocation}={}){if(this.options={location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:v},a=m?a:a.toLowerCase(),a=g?bc(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const y=(S,T)=>{this.chunks.push({pattern:S,alphabet:r2(S),startIndex:T})},b=this.pattern.length;if(b>Ds){let S=0;const T=b%Ds,E=b-T;for(;S<E;)y(this.pattern.substr(S,Ds),S),S+=Ds;if(T){const N=b-Ds;y(this.pattern.substr(N),N)}}else y(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=o?bc(a):a,this.pattern===a){let E={isMatch:!0,score:0};return r&&(E.indices=[[0,a.length-1]]),E}const{location:u,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:v}=this.options;let y=[],b=0,S=!1;this.chunks.forEach(({pattern:E,alphabet:N,startIndex:C})=>{const{isMatch:j,score:D,indices:M}=l2(a,E,N,{location:u+C,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:v});j&&(S=!0),b+=D,j&&M&&(y=[...y,...M])});let T={isMatch:S,score:S?b/this.chunks.length:1};return S&&r&&(T.indices=y),T}}class os{constructor(a){this.pattern=a}static isMultiMatch(a){return L0(a,this.multiRegex)}static isSingleMatch(a){return L0(a,this.singleRegex)}search(){}}function L0(t,a){const i=t.match(a);return i?i[1]:null}class c2 extends os{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){const i=a===this.pattern;return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class u2 extends os{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const o=a.indexOf(this.pattern)===-1;return{isMatch:o,score:o?0:1,indices:[0,a.length-1]}}}class d2 extends os{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){const i=a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class f2 extends os{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){const i=!a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class h2 extends os{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){const i=a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[a.length-this.pattern.length,a.length-1]}}}class p2 extends os{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){const i=!a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class v_ extends os{constructor(a,{location:i=ye.location,threshold:o=ye.threshold,distance:r=ye.distance,includeMatches:u=ye.includeMatches,findAllMatches:d=ye.findAllMatches,minMatchCharLength:p=ye.minMatchCharLength,isCaseSensitive:m=ye.isCaseSensitive,ignoreDiacritics:g=ye.ignoreDiacritics,ignoreLocation:v=ye.ignoreLocation}={}){super(a),this._bitapSearch=new g_(a,{location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:v})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class y_ extends os{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,o;const r=[],u=this.pattern.length;for(;(o=a.indexOf(this.pattern,i))>-1;)i=o+u,r.push([o,i-1]);const d=!!r.length;return{isMatch:d,score:d?0:1,indices:r}}}const Kf=[c2,y_,d2,f2,p2,h2,u2,v_],U0=Kf.length,m2=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,g2="|";function v2(t,a={}){return t.split(g2).map(i=>{let o=i.trim().split(m2).filter(u=>u&&!!u.trim()),r=[];for(let u=0,d=o.length;u<d;u+=1){const p=o[u];let m=!1,g=-1;for(;!m&&++g<U0;){const v=Kf[g];let y=v.isMultiMatch(p);y&&(r.push(new v(y,a)),m=!0)}if(!m)for(g=-1;++g<U0;){const v=Kf[g];let y=v.isSingleMatch(p);if(y){r.push(new v(y,a));break}}}return r})}const y2=new Set([v_.type,y_.type]);class b2{constructor(a,{isCaseSensitive:i=ye.isCaseSensitive,ignoreDiacritics:o=ye.ignoreDiacritics,includeMatches:r=ye.includeMatches,minMatchCharLength:u=ye.minMatchCharLength,ignoreLocation:d=ye.ignoreLocation,findAllMatches:p=ye.findAllMatches,location:m=ye.location,threshold:g=ye.threshold,distance:v=ye.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r,minMatchCharLength:u,findAllMatches:p,ignoreLocation:d,location:m,threshold:g,distance:v},a=i?a:a.toLowerCase(),a=o?bc(a):a,this.pattern=a,this.query=v2(this.pattern,this.options)}static condition(a,i){return i.useExtendedSearch}searchIn(a){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:o,isCaseSensitive:r,ignoreDiacritics:u}=this.options;a=r?a:a.toLowerCase(),a=u?bc(a):a;let d=0,p=[],m=0;for(let g=0,v=i.length;g<v;g+=1){const y=i[g];p.length=0,d=0;for(let b=0,S=y.length;b<S;b+=1){const T=y[b],{isMatch:E,indices:N,score:C}=T.search(a);if(E){if(d+=1,m+=C,o){const j=T.constructor.type;y2.has(j)?p=[...p,...N]:p.push(N)}}else{m=0,d=0,p.length=0;break}}if(d){let b={isMatch:!0,score:m/d};return o&&(b.indices=p),b}}return{isMatch:!1,score:1}}}const Yf=[];function x2(...t){Yf.push(...t)}function Zf(t,a){for(let i=0,o=Yf.length;i<o;i+=1){let r=Yf[i];if(r.condition(t,a))return new r(t,a)}return new g_(t,a)}const xc={AND:"$and",OR:"$or"},Xf={PATH:"$path",PATTERN:"$val"},Qf=t=>!!(t[xc.AND]||t[xc.OR]),_2=t=>!!t[Xf.PATH],S2=t=>!Ta(t)&&f_(t)&&!Qf(t),z0=t=>({[xc.AND]:Object.keys(t).map(a=>({[a]:t[a]}))});function b_(t,a,{auto:i=!0}={}){const o=r=>{let u=Object.keys(r);const d=_2(r);if(!d&&u.length>1&&!Qf(r))return o(z0(r));if(S2(r)){const m=d?r[Xf.PATH]:u[0],g=d?r[Xf.PATTERN]:r[m];if(!qn(g))throw new Error(KA(m));const v={keyId:qf(m),pattern:g};return i&&(v.searcher=Zf(g,a)),v}let p={children:[],operator:u[0]};return u.forEach(m=>{const g=r[m];Ta(g)&&g.forEach(v=>{p.children.push(o(v))})}),p};return Qf(t)||(t=z0(t)),o(t)}function T2(t,{ignoreFieldNorm:a=ye.ignoreFieldNorm}){t.forEach(i=>{let o=1;i.matches.forEach(({key:r,norm:u,score:d})=>{const p=r?r.weight:null;o*=Math.pow(d===0&&p?Number.EPSILON:d,(p||1)*(a?1:u))}),i.score=o})}function k2(t,a){const i=t.matches;a.matches=[],dn(i)&&i.forEach(o=>{if(!dn(o.indices)||!o.indices.length)return;const{indices:r,value:u}=o;let d={indices:r,value:u};o.key&&(d.key=o.key.src),o.idx>-1&&(d.refIndex=o.idx),a.matches.push(d)})}function C2(t,a){a.score=t.score}function E2(t,a,{includeMatches:i=ye.includeMatches,includeScore:o=ye.includeScore}={}){const r=[];return i&&r.push(k2),o&&r.push(C2),t.map(u=>{const{idx:d}=u,p={item:a[d],refIndex:d};return r.length&&r.forEach(m=>{m(u,p)}),p})}class Ji{constructor(a,i={},o){this.options={...ye,...i},this.options.useExtendedSearch,this._keyStore=new QA(this.options.keys),this.setCollection(a,o)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof Kh))throw new Error(qA);this._myIndex=i||m_(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){dn(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let o=0,r=this._docs.length;o<r;o+=1){const u=this._docs[o];a(u,o)&&(this.removeAt(o),o-=1,r-=1,i.push(u))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:o,includeScore:r,shouldSort:u,sortFn:d,ignoreFieldNorm:p}=this.options;let m=qn(a)?qn(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return T2(m,{ignoreFieldNorm:p}),u&&m.sort(d),d_(i)&&i>-1&&(m=m.slice(0,i)),E2(m,this._docs,{includeMatches:o,includeScore:r})}_searchStringList(a){const i=Zf(a,this.options),{records:o}=this._myIndex,r=[];return o.forEach(({v:u,i:d,n:p})=>{if(!dn(u))return;const{isMatch:m,score:g,indices:v}=i.searchIn(u);m&&r.push({item:u,idx:d,matches:[{score:g,value:u,norm:p,indices:v}]})}),r}_searchLogical(a){const i=b_(a,this.options),o=(p,m,g)=>{if(!p.children){const{keyId:y,searcher:b}=p,S=this._findMatches({key:this._keyStore.get(y),value:this._myIndex.getValueForItemAtKeyId(m,y),searcher:b});return S&&S.length?[{idx:g,item:m,matches:S}]:[]}const v=[];for(let y=0,b=p.children.length;y<b;y+=1){const S=p.children[y],T=o(S,m,g);if(T.length)v.push(...T);else if(p.operator===xc.AND)return[]}return v},r=this._myIndex.records,u={},d=[];return r.forEach(({$:p,i:m})=>{if(dn(p)){let g=o(i,p,m);g.length&&(u[m]||(u[m]={idx:m,item:p,matches:[]},d.push(u[m])),g.forEach(({matches:v})=>{u[m].matches.push(...v)}))}}),d}_searchObjectList(a){const i=Zf(a,this.options),{keys:o,records:r}=this._myIndex,u=[];return r.forEach(({$:d,i:p})=>{if(!dn(d))return;let m=[];o.forEach((g,v)=>{m.push(...this._findMatches({key:g,value:d[v],searcher:i}))}),m.length&&u.push({idx:p,item:d,matches:m})}),u}_findMatches({key:a,value:i,searcher:o}){if(!dn(i))return[];let r=[];if(Ta(i))i.forEach(({v:u,i:d,n:p})=>{if(!dn(u))return;const{isMatch:m,score:g,indices:v}=o.searchIn(u);m&&r.push({score:g,key:a,value:u,idx:d,norm:p,indices:v})});else{const{v:u,n:d}=i,{isMatch:p,score:m,indices:g}=o.searchIn(u);p&&r.push({score:m,key:a,value:u,norm:d,indices:g})}return r}}Ji.version="7.1.0";Ji.createIndex=m_;Ji.parseIndex=i2;Ji.config=ye;Ji.parseQuery=b_;x2(b2);function N2(t,a,i,o){if(!a.trim())return[];const r=.3;return new Ji(t,{keys:i,threshold:r,ignoreLocation:!0,includeScore:!0,includeMatches:!0,minMatchCharLength:2}).search(a).map(m=>({item:m.item,score:m.score??1,matches:(m.matches??[]).map(g=>({key:g.key??"",indices:g.indices}))}))}const Wf={not_started:{color:"var(--text-tertiary)",icon:"○",label:"Not Started"},working:{color:"var(--accent-green)",icon:"●",label:"Working"},paused:{color:"var(--accent-yellow)",icon:"◉",label:"Paused"},complete:{color:"var(--accent-green)",icon:"✓",label:"Complete"},failed:{color:"var(--accent-red)",icon:"✗",label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:"⦸",label:"Blocked"}};function as(t){return t==="blocked"?Wf.blocked:Wf[Yh(t)]}const j2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function w2(t){return j2[Yh(t)]??"statusPending"}const A2=["working","paused","failed","not_started","blocked","complete"],V0=["not_started","working","paused","complete","failed"],D2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Yh(t){return t in Wf&&t!=="blocked"?t:D2[t]??"not_started"}const M2={not_started:"--text-tertiary",working:"--accent-green",paused:"--accent-yellow",complete:"--accent-green",failed:"--accent-red",pending:"--text-tertiary",assigned:"--text-tertiary",in_progress:"--accent-green",review:"--accent-yellow",done:"--accent-green",waiting_input:"--accent-yellow"};function R2(t){if(t.length===0)return[];const a=[...t].sort((o,r)=>o[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let o=1;o<a.length;o++){const r=i[i.length-1],[u,d]=a[o];u<=r[1]+1?r[1]=Math.max(r[1],d):i.push([u,d])}return i}function x_({text:t,indices:a,highlightClass:i}){if(!a||a.length===0)return c.jsx(c.Fragment,{children:t});const o=R2(a),r=[];let u=0;for(const[d,p]of o)d>u&&r.push(c.jsx("span",{children:t.slice(u,d)},`p${u}`)),r.push(c.jsx("mark",{className:i,children:t.slice(d,p+1)},`m${d}`)),u=p+1;return u<t.length&&r.push(c.jsx("span",{children:t.slice(u)},`p${u}`)),c.jsx(c.Fragment,{children:r})}function O2(t){const a=new Map(t.map(o=>[o.id,{...o,children:[]}])),i=[];for(const o of a.values())o.parentTaskId&&a.has(o.parentTaskId)?a.get(o.parentTaskId).children.push(o):i.push(o);for(const o of a.values())o.children.sort((r,u)=>r.sortOrder-u.sortOrder);return i.sort((o,r)=>o.sortOrder-r.sortOrder)}function B2(t,a){const i=new Map;for(const u of t){const p=u.dependsOn.length>0&&u.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":u.status,m=i.get(p);m?m.push(u):i.set(p,[u])}const o=[],r=new Set;for(const u of A2){r.add(u);const d=i.get(u);if(d&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=as(u);o.push({status:u,label:p.label,style:p,tasks:d})}}for(const[u,d]of i)if(!r.has(u)&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=as(u);o.push({status:u,label:p.label,style:p,tasks:d})}return o}const I2="_container_z4i38_1",L2="_header_z4i38_5",U2="_headerActions_z4i38_17",z2="_searchInput_z4i38_23",V2="_searchHighlight_z4i38_56",H2="_groupToggle_z4i38_62",P2="_groupToggleActive_z4i38_89",G2="_addButton_z4i38_93",$2="_taskRow_z4i38_120",F2="_selected_z4i38_140",q2="_expandArrow_z4i38_150",K2="_expanded_z4i38_157",Y2="_leafSpacer_z4i38_161",Z2="_taskStatusIcon_z4i38_166",X2="_taskTitle_z4i38_170",Q2="_workspaceBadge_z4i38_177",W2="_childCountBadge_z4i38_195",J2="_dependencyBadge_z4i38_208",eD="_blockedBadge_z4i38_220",tD="_addChildButton_z4i38_225",nD="_emptyState_z4i38_268",aD="_statusGroupHeader_z4i38_275",sD="_statusGroupIcon_z4i38_294",iD="_statusGroupLabel_z4i38_298",oD="_statusGroupCount_z4i38_303",Oe={container:I2,header:L2,headerActions:U2,searchInput:z2,searchHighlight:V2,groupToggle:H2,groupToggleActive:P2,addButton:G2,taskRow:$2,selected:F2,expandArrow:q2,expanded:K2,leafSpacer:Y2,taskStatusIcon:Z2,taskTitle:X2,workspaceBadge:Q2,childCountBadge:W2,dependencyBadge:J2,blockedBadge:eD,addChildButton:tD,emptyState:nD,statusGroupHeader:aD,statusGroupIcon:sD,statusGroupLabel:iD,statusGroupCount:oD},lD=[{name:"title",weight:2},{name:"description",weight:1}],__=16,rD=16,S_="grackle-task-group-by-status";function H0(){try{return localStorage.getItem(S_)==="true"}catch{return!1}}function cD(t){try{localStorage.setItem(S_,String(t))}catch{}}function uD({group:t,isExpanded:a,onToggle:i,selectedTaskId:o,navigate:r,titleHighlights:u,workspaceNames:d}){return c.jsxs("div",{"data-testid":`status-group-${t.status}`,children:[c.jsxs("div",{className:Oe.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i())},children:[c.jsx("span",{className:`${Oe.expandArrow} ${a?Oe.expanded:""}`,children:"▸"}),c.jsx("span",{className:Oe.statusGroupIcon,style:{color:t.style.color},children:t.style.icon}),c.jsx("span",{className:Oe.statusGroupLabel,children:t.label}),c.jsx("span",{className:Oe.statusGroupCount,children:t.tasks.length})]}),c.jsx(Qn,{children:a&&c.jsx(Ct.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:t.tasks.map(p=>{const m=as(p.status),g=o===p.id,v=p.parentTaskId||!p.workspaceId?void 0:d.get(p.workspaceId);return c.jsxs("div",{onClick:()=>r(_a(p.id)),className:`${Oe.taskRow} ${g?Oe.selected:""}`,style:{"--task-indent":`${__}px`},"data-task-id":p.id,children:[c.jsx("span",{className:Oe.leafSpacer}),c.jsx("span",{className:Oe.taskStatusIcon,style:{color:m.color},children:m.icon}),c.jsx("span",{className:Oe.taskTitle,title:p.title,children:c.jsx(x_,{text:p.title,indices:u.get(p.id),highlightClass:Oe.searchHighlight})}),v&&c.jsx("span",{className:Oe.workspaceBadge,title:v,children:v})]},p.id)})})})]})}function T_({node:t,depth:a,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,taskStatusById:d,titleHighlights:p,workspaceNames:m}){const g=as(t.status),v=t.dependsOn.length>0&&t.dependsOn.some(C=>d.get(C)!=="complete"),y=i.has(t.id),b=t.children.length>0,S=r===t.id,T=__+a*rD,N=a===0&&!t.parentTaskId&&t.workspaceId?m.get(t.workspaceId):void 0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{onClick:()=>u(_a(t.id)),className:`${Oe.taskRow} ${S?Oe.selected:""}`,style:{"--task-indent":`${T}px`},"data-task-id":t.id,children:[b&&c.jsx("span",{className:`${Oe.expandArrow} ${y?Oe.expanded:""}`,role:"button",tabIndex:0,"aria-label":y?"Collapse task":"Expand task",onClick:C=>{C.stopPropagation(),o(t.id)},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),C.stopPropagation(),o(t.id))},children:"▸"}),!b&&c.jsx("span",{className:Oe.leafSpacer}),c.jsx("span",{className:Oe.taskStatusIcon,style:{color:g.color},children:g.icon}),c.jsx("span",{className:Oe.taskTitle,title:t.title,children:c.jsx(x_,{text:t.title,indices:p.get(t.id),highlightClass:Oe.searchHighlight})}),N&&c.jsx("span",{className:Oe.workspaceBadge,title:N,children:N}),b&&c.jsxs("span",{className:Oe.childCountBadge,children:[t.children.filter(C=>C.status==="complete").length,"/",t.children.length]}),t.dependsOn.length>0&&c.jsx("span",{className:`${Oe.dependencyBadge} ${v?Oe.blockedBadge:""}`,title:`Depends on: ${t.dependsOn.join(", ")}`,children:v?"blocked":"dep"}),a<HA&&c.jsx("button",{onClick:C=>{C.stopPropagation(),u(Xi(t.workspaceId,t.id))},title:"Add child task","aria-label":"Add child task",className:Oe.addChildButton,children:"+"})]}),c.jsx(Qn,{children:b&&y&&c.jsx(Ct.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:t.children.map(C=>c.jsx(T_,{node:C,depth:a+1,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,taskStatusById:d,titleHighlights:p,workspaceNames:m},C.id))})})]})}function dD(){const{workspaces:t,tasks:a}=qe(),i=Dt(),[o,r]=x.useState(new Set),[u,d]=x.useState(new Set),[p,m]=x.useState(H0),[g,v]=x.useState(H0),[y,b]=x.useState(new Map),S=Tt("/tasks/:taskId/*"),T=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,E=x.useMemo(()=>new Map(a.map(F=>[F.id,F.status])),[a]),N=x.useMemo(()=>new Map(t.map(F=>[F.id,F.name])),[t]),C=()=>{const F=!p;cD(F),m(F),F&&(v(!0),b(new Map))},j=F=>{b(ne=>{const I=new Map(ne),Y=I.has(F)?I.get(F):g;return I.set(F,!Y),I})},D=F=>y.has(F)?y.get(F):g,M=F=>{r(ne=>{const I=new Set(ne);return I.has(F)?(I.delete(F),d(Y=>new Set(Y).add(F))):(I.add(F),d(Y=>{const oe=new Set(Y);return oe.delete(F),oe})),I})};x.useEffect(()=>{const F=new Set(a.filter(ne=>ne.parentTaskId).map(ne=>ne.parentTaskId));F.size>0&&r(ne=>{const I=new Set(ne);for(const Y of F)u.has(Y)||I.add(Y);return I})},[a,u]);const[w,$]=x.useState(""),{directMatchTaskIds:V,treeMatchTaskIds:B,titleHighlights:q}=x.useMemo(()=>{if(!w.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const F=N2(a,w,lD),ne=new Set(F.map(P=>P.item.id)),I=new Map;for(const P of F){const O=P.matches.find(ie=>ie.key==="title");O&&I.set(P.item.id,O.indices)}const Y=new Set(ne),oe=new Map(a.map(P=>[P.id,P]));for(const P of[...ne]){let O=oe.get(P);for(;O!=null&&O.parentTaskId;)Y.add(O.parentTaskId),O=oe.get(O.parentTaskId)}return{directMatchTaskIds:ne,treeMatchTaskIds:Y,titleHighlights:I}},[w,a]),X=V!==null,ae=X?p?V:B:null,te=ae?a.filter(F=>ae.has(F.id)):a,Q=p?[]:O2(te);return c.jsxs("div",{className:Oe.container,children:[c.jsxs("div",{className:Oe.header,children:[c.jsx("span",{children:"Tasks"}),c.jsxs("div",{className:Oe.headerActions,children:[c.jsx("button",{className:`${Oe.groupToggle} ${p?Oe.groupToggleActive:""}`,onClick:C,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,title:p?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),c.jsx("button",{className:Oe.addButton,onClick:()=>i(Xi()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&c.jsx("input",{type:"text",value:w,onChange:F=>$(F.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Oe.searchInput,"data-testid":"sidebar-search"}),p?B2(te,E).map(F=>c.jsx(uD,{group:F,isExpanded:D(F.status),onToggle:()=>j(F.status),selectedTaskId:T,navigate:i,titleHighlights:q,workspaceNames:N},F.status)):Q.map(F=>c.jsx(T_,{node:F,depth:0,expandedTasks:o,toggleTask:M,selectedTaskId:T,navigate:i,taskStatusById:E,titleHighlights:q,workspaceNames:N},F.id)),te.length===0&&!X&&c.jsx("div",{className:Oe.emptyState,children:"No tasks yet. Click + to create one."}),te.length===0&&X&&c.jsx("div",{className:Oe.emptyState,children:"No matching tasks"})]})}const fD="_nav_14i94_1",hD="_tab_14i94_24",pD="_tabActive_14i94_62",mD="_tabLabel_14i94_75",gD="_statusDot_14i94_81",vD="_pulse_14i94_87",yD="_addButton_14i94_99",bD="_empty_14i94_132",Xa={nav:fD,tab:hD,tabActive:pD,tabLabel:mD,statusDot:gD,pulse:vD,addButton:yD,empty:bD},xD={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function _D(){const{environments:t}=qe(),a=Dt(),i=x.useRef(null),o=Tt("/environments/:environmentId"),r=Tt("/environments/:environmentId/edit"),u=Tt("/environments/:environmentId/workspaces/:workspaceId"),d=Tt("/environments/:environmentId/workspaces/:workspaceId/*"),p=(o==null?void 0:o.params.environmentId)??(r==null?void 0:r.params.environmentId)??(u==null?void 0:u.params.environmentId)??(d==null?void 0:d.params.environmentId),m=p==="new"?void 0:p,g=x.useCallback(b=>{a(Gi(b))},[a]),v=x.useCallback(b=>{var C;const S=(C=i.current)==null?void 0:C.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const T=Array.from(S).findIndex(j=>j===document.activeElement),E=T>=0?T:t.findIndex(j=>j.id===m);let N=E;if(b.key==="ArrowDown")b.preventDefault(),N=(E+1)%S.length;else if(b.key==="ArrowUp")b.preventDefault(),N=(E-1+S.length)%S.length;else if(b.key==="Home")b.preventDefault(),N=0;else if(b.key==="End")b.preventDefault(),N=S.length-1;else return;N<t.length&&a(Gi(t[N].id)),S[N].focus()},[m,t,a]),y=m??(t.length>0?t[0].id:void 0);return c.jsxs("div",{className:Xa.nav,"data-testid":"environment-nav",children:[c.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:v,children:t.map(b=>{const S=b.id===m,T=b.id===y,E=xD[b.status]||"var(--text-tertiary)",N=b.status==="connected";return c.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:T?0:-1,className:`${Xa.tab} ${S?Xa.tabActive:""}`,onClick:()=>g(b.id),"data-testid":"env-nav-item",children:[c.jsx("span",{className:`${Xa.statusDot} ${N?Xa.pulse:""}`,style:{color:E},children:"●"}),c.jsx("span",{className:Xa.tabLabel,title:b.displayName||b.id,children:b.displayName||b.id})]},b.id)})}),c.jsx("button",{type:"button",className:Xa.addButton,onClick:()=>a(iC),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),t.length===0&&c.jsx("div",{className:Xa.empty,children:"No environments yet."})]})}const SD="_nav_1bhou_1",TD="_tab_1bhou_24",kD="_tabIcon_1bhou_62",CD="_tabActive_1bhou_68",Wr={nav:SD,tab:TD,tabIcon:kD,tabActive:CD},va=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function ED(){var d;const t=jt(),a=Dt(),i=x.useRef(null),o=((d=va.find(p=>t.pathname===`${il}/${p.path}`))==null?void 0:d.path)??va[0].path,r=x.useCallback(p=>{a(`${il}/${p}`)},[a]),u=x.useCallback(p=>{var S,T;const m=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(E=>E===document.activeElement),v=g>=0?g:va.findIndex(E=>E.path===o);let y=v;if(p.key==="ArrowDown")p.preventDefault(),y=(v+1)%va.length;else if(p.key==="ArrowUp")p.preventDefault(),y=(v-1+va.length)%va.length;else if(p.key==="Home")p.preventDefault(),y=0;else if(p.key==="End")p.preventDefault(),y=va.length-1;else return;const b=va[y].path;a(`${il}/${b}`),(T=m[y])==null||T.focus()},[o,a]);return c.jsx("nav",{className:Wr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:u,children:va.map(p=>{const m=p.path===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Wr.tab} ${m?Wr.tabActive:""}`,onClick:()=>r(p.path),children:[c.jsx("span",{className:Wr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const ND="_nav_1snmp_1",jD="_searchForm_1snmp_8",wD="_searchInput_1snmp_15",AD="_searchButton_1snmp_33",DD="_clearButton_1snmp_68",MD="_workspaceSelect_1snmp_85",RD="_listHeader_1snmp_99",OD="_nodeList_1snmp_108",BD="_nodeItem_1snmp_116",ID="_indicator_1snmp_129",LD="_label_1snmp_136",UD="_badge_1snmp_145",jn={nav:ND,searchForm:jD,searchInput:wD,searchButton:AD,clearButton:DD,workspaceSelect:MD,listHeader:RD,nodeList:OD,nodeItem:BD,indicator:ID,label:LD,badge:UD};function zD(){const{knowledge:t,workspaces:a}=qe(),[i,o]=x.useState(""),r=x.useCallback(m=>{m.preventDefault(),i.trim()&&t.search(i.trim())},[i,t]),u=x.useCallback(()=>{o(""),t.clearSearch()},[t]),d=x.useCallback(m=>{t.selectNode(m)},[t]),p=x.useCallback(m=>{o(""),t.loadRecent(m||void 0)},[t]);return c.jsxs("div",{className:jn.nav,"data-testid":"knowledge-nav",children:[c.jsxs("form",{className:jn.searchForm,onSubmit:r,children:[c.jsx("input",{className:jn.searchInput,type:"text",placeholder:"Search...",value:i,onChange:m=>{o(m.target.value)},"data-testid":"knowledge-search-input"}),c.jsx("button",{type:"submit",className:jn.searchButton,disabled:t.loading,children:"Go"})]}),t.searchQuery&&c.jsx("button",{type:"button",className:jn.clearButton,onClick:u,children:"Clear search"}),c.jsxs("select",{className:jn.workspaceSelect,onChange:m=>{p(m.target.value)},"data-testid":"knowledge-workspace-filter",children:[c.jsx("option",{value:"",children:"All workspaces"}),a.map(m=>c.jsx("option",{value:m.id,children:m.name},m.id))]}),c.jsxs("div",{className:jn.listHeader,children:["Nodes (",t.graphData.nodes.length,")"]}),c.jsx("ul",{className:jn.nodeList,children:t.graphData.nodes.map(m=>c.jsxs("li",{className:jn.nodeItem,onClick:()=>{d(m.id)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d(m.id))},role:"button",tabIndex:0,children:[c.jsx("span",{className:jn.indicator,style:{backgroundColor:m.kind==="reference"?"#4A9EFF":m.category==="decision"?"#22C55E":m.category==="concept"?"#A855F7":m.category==="snippet"?"#6B7280":"#EAB308"}}),c.jsx("span",{className:jn.label,children:m.label}),c.jsx("span",{className:jn.badge,children:m.kind==="reference"?m.sourceType:m.category})]},m.id))})]})}function VD(){const t=x.useMemo(()=>c.jsx(dD,{}),[]);return Nc(t),c.jsx(Ls,{})}function HD(){const t=x.useMemo(()=>c.jsx(_D,{}),[]);return Nc(t),c.jsx(Ls,{})}function PD(){const t=x.useMemo(()=>c.jsx(ED,{}),[]);return Nc(t),c.jsx(Ls,{})}function GD(){const t=x.useMemo(()=>c.jsx(zD,{}),[]);return Nc(t),c.jsx(Ls,{})}const $D="_bar_tnfsh_1",FD="_btnPrimary_tnfsh_32",qD="_statusText_tnfsh_85",KD="_statusCompleted_tnfsh_90",YD="_statusFailed_tnfsh_94",ZD="_statusBlocked_tnfsh_98",XD="_hintText_tnfsh_103",ct={bar:$D,btnPrimary:FD,statusText:qD,statusCompleted:KD,statusFailed:YD,statusBlocked:ZD,hintText:XD};function QD(){const{sessions:t,tasks:a,environments:i}=qe(),o=Dt(),r=jt(),u=Tt("/sessions/:sessionId"),d=Tt("/tasks/:taskId"),p=Tt("/tasks/:taskId/stream"),m=Tt("/tasks/:taskId/findings"),g=Tt("/tasks/:taskId/edit"),v=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),y=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),b=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),T=Tt("/sessions/new"),E=Tt("/environments/:environmentId/workspaces/:workspaceId"),N=Tt("/tasks/new"),C=Tt("/chat"),j=Tt("/"),D=Tt("/settings/*"),M=u==null?void 0:u.params.sessionId,w=(d==null?void 0:d.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(v==null?void 0:v.params.taskId)??(y==null?void 0:y.params.taskId)??(b==null?void 0:b.params.taskId)??(S==null?void 0:S.params.taskId),$=v??y??b??S,V=($==null?void 0:$.params.environmentId)??(E==null?void 0:E.params.environmentId),B=r.pathname.startsWith("/environments")&&!E&&!$,q=!!C,X=!!T,ae=!!E&&!v&&!y&&!b&&!S,te=!!N;if(!!j&&!X&&!ae&&!te||!!D||(!!g||!!S)||te||B||X)return c.jsx(c.Fragment,{});if(q)return i.find(Y=>Y.adapterType==="local"&&Y.status==="connected")?c.jsx(c.Fragment,{}):c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Add a local environment to start chatting"})});if(ae)return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Select a task or click + to create one"})});if(w){const I=a.find(P=>P.id===w);if(!I)return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Loading..."})});const Y=new Map(a.map(P=>[P.id,P])),oe=I.dependsOn.some(P=>{const O=Y.get(P);return O!==void 0&&O.status!=="complete"});if(I.status==="not_started"){const P=oe?I.dependsOn.map(O=>Y.get(O)).filter(O=>O&&O.status!=="complete").map(O=>O.title):[];return c.jsx("div",{className:ct.bar,children:oe?c.jsxs("span",{className:ct.statusBlocked,children:["Blocked by: ",P.join(", ")]}):c.jsx("span",{className:ct.hintText,children:"Use the buttons above to start or manage this task"})})}if(I.status==="working"||I.status==="paused"){const P=I.latestSessionId||void 0,O=P?t.find(be=>be.id===P):void 0;return O&&!["completed","failed","interrupted","hibernating"].includes(O.status)?c.jsx(c.Fragment,{}):c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Waiting for agent..."})})}if(I.status==="complete")return c.jsxs("div",{className:ct.bar,children:[c.jsx("span",{className:`${ct.statusText} ${ct.statusCompleted}`,children:"Task completed"}),c.jsx("button",{onClick:()=>o(Xi(I.workspaceId,void 0,V)),className:ct.btnPrimary,children:"+ New Task"})]});if(I.status==="failed")return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:`${ct.statusText} ${ct.statusFailed}`,children:"Task failed"})})}if(M){const I=t.find(P=>P.id===M),Y=I!==void 0&&["completed","failed","interrupted","hibernating"].includes(I.status);if(I!==void 0&&!Y)return c.jsx(c.Fragment,{});if(Y)return c.jsxs("div",{className:ct.bar,children:[c.jsxs("span",{className:`${ct.statusText} ${ct.hintText}`,children:["Session ",I.status]}),c.jsx("button",{onClick:()=>o(xb(I.environmentId)),className:ct.btnPrimary,children:"+ New Chat"})]})}return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Loading..."})})}const WD="_toast_da8ll_1",JD="_success_da8ll_18",eM="_icon_da8ll_22",tM="_error_da8ll_25",nM="_warning_da8ll_32",aM="_info_da8ll_38",sM="_message_da8ll_53",iM="_close_da8ll_60",Wo={toast:WD,success:JD,icon:eM,error:tM,warning:nM,info:aM,message:sM,close:iM},oM={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function lM({toast:t,onDismiss:a}){return x.useEffect(()=>{const i=setTimeout(()=>a(t.id),t.duration);return()=>clearTimeout(i)},[t.id,t.duration,a]),c.jsxs(Ct.div,{className:`${Wo.toast} ${Wo[t.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[c.jsx("span",{className:Wo.icon,"aria-hidden":"true",children:oM[t.variant]}),c.jsx("span",{className:Wo.message,children:t.message}),c.jsx("button",{type:"button",className:Wo.close,onClick:()=>a(t.id),"aria-label":"Dismiss notification",children:"×"})]})}const rM="_container_qqse2_1",cM={container:rM};function uM(){const{toasts:t,dismissToast:a}=Us();return c.jsx("div",{className:cM.container,"data-testid":"toast-container",children:c.jsx(Qn,{children:t.map(i=>c.jsx(lM,{toast:i,onDismiss:a},i.id))})})}const dM="_breadcrumbs_17or2_1",fM="_list_17or2_11",hM="_item_17or2_21",pM="_separator_17or2_28",mM="_link_17or2_34",gM="_current_17or2_57",Mi={breadcrumbs:dM,list:fM,item:hM,separator:pM,link:mM,current:gM},vM="›";function Vs({segments:t}){return c.jsx("nav",{className:Mi.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:c.jsx("ol",{className:Mi.list,children:t.map((a,i)=>{const o=i===t.length-1;return c.jsxs("li",{className:Mi.item,children:[i>0&&c.jsx("span",{className:Mi.separator,"aria-hidden":"true",children:vM}),a.url&&!o?c.jsx(ch,{className:Mi.link,to:a.url,title:a.label,children:a.label}):c.jsx("span",{className:Mi.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function Jf(){Jf=function(r,u){return new i(r,void 0,u)};var t=RegExp.prototype,a=new WeakMap;function i(r,u,d){var p=new RegExp(r,u);return a.set(p,d||a.get(r)),_c(p,i.prototype)}function o(r,u){var d=a.get(u);return Object.keys(d).reduce(function(p,m){var g=d[m];if(typeof g=="number")p[m]=r[g];else{for(var v=0;r[g[v]]===void 0&&v+1<g.length;)v++;p[m]=r[g[v]]}return p},Object.create(null))}return(function(r,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(u&&u.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),u&&_c(r,u)})(i,RegExp),i.prototype.exec=function(r){var u=t.exec.call(this,r);if(u){u.groups=o(u,this);var d=u.indices;d&&(d.groups=o(d,this))}return u},i.prototype[Symbol.replace]=function(r,u){if(typeof u=="string"){var d=a.get(this);return t[Symbol.replace].call(this,r,u.replace(/\$<([^>]+)>/g,function(m,g){var v=d[g];return"$"+(Array.isArray(v)?v.join("$"):v)}))}if(typeof u=="function"){var p=this;return t[Symbol.replace].call(this,r,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(o(m,p)),u.apply(this,m)})}return t[Symbol.replace].call(this,r,u)},Jf.apply(this,arguments)}function _c(t,a){return _c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},_c(t,a)}function P0(t,a){(a==null||a>t.length)&&(a=t.length);for(var i=0,o=new Array(a);i<a;i++)o[i]=t[i];return o}function yf(t,a){var i=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=(function(r,u){if(r){if(typeof r=="string")return P0(r,u);var d=Object.prototype.toString.call(r).slice(8,-1);return d==="Object"&&r.constructor&&(d=r.constructor.name),d==="Map"||d==="Set"?Array.from(r):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?P0(r,u):void 0}})(t))||a){i&&(t=i);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
99
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var yM=(function(t){return function(a){return a===void 0&&(a={}),(function(o,r){if(r&&!o.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(t,a.defaultLanguage),function(o){YS(o,"element",i)};function i(o,r,u){var d,p;if(u&&u.tagName==="pre"&&o.tagName==="code"){var m=(o==null||(d=o.data)==null?void 0:d.meta)||(o==null||(p=o.properties)==null?void 0:p.metastring)||"";o.properties.className?typeof o.properties.className=="boolean"?o.properties.className=[]:Array.isArray(o.properties.className)||(o.properties.className=[o.properties.className]):o.properties.className=[];var g,v,y=(function(w){for(var $,V=yf(w.properties.className);!($=V()).done;){var B=$.value;if(B.slice(0,9)==="language-")return B.slice(9).toLowerCase()}return null})(o);if(!y&&a.defaultLanguage&&o.properties.className.push("language-"+(y=a.defaultLanguage)),o.properties.className.push("code-highlight"),y)try{var b,S;S=(b=y)!=null&&b.includes("diff-")?y.split("-")[1]:y,g=t.highlight(Gr(o),S),u.properties.className=(u.properties.className||[]).concat("language-"+S)}catch(w){if(!a.ignoreMissing||!/Unknown language/.test(w.message))throw w;g=o}else g=o;g.children=(v=1,function w($){return $.reduce(function(V,B){if(B.type==="text"){var q=B.value,X=(q.match(/\n/g)||"").length;if(X===0)B.position={start:{line:v,column:1},end:{line:v,column:1}},V.push(B);else for(var ae,te=q.split(`
100
- `),Q=yf(te.entries());!(ae=Q()).done;){var F=ae.value,ne=F[0],I=F[1];V.push({type:"text",value:ne===te.length-1?I:I+`
101
- `,position:{start:{line:v+ne,column:1},end:{line:v+ne,column:1}}})}return v+=X,V}if(Object.prototype.hasOwnProperty.call(B,"children")){var Y=v;return B.children=w(B.children),V.push(B),B.position={start:{line:Y,column:1},end:{line:v,column:1}},V}return V.push(B),V},[])})(g.children),g.position=g.children.length>0?{start:{line:g.children[0].position.start.line,column:0},end:{line:g.children[g.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var T,E=(function(w){var $=/{([\d,-]+)}/,V=w.split(",").map(function(X){return X.trim()}).join();if($.test(V)){var B=$.exec(V)[1],q=XS(B);return function(X){return q.includes(X+1)}}return function(){return!1}})(m),N=(function(w){var $=Jf(/showLineNumbers=(\d+)/i,{lines:1});if($.test(w)){var V=$.exec(w);return Number(V.groups.lines)}return 1})(m),C=(function(w){for(var $=new Array(w),V=0;V<w;V++)$[V]={type:"element",tagName:"span",properties:{className:[]},children:[]};return $})(g.position.end.line),j=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],D=function(){var w,$,V=T.value,B=V[0],q=V[1];q.properties.className=["code-line"];var X=QS(g,function(ae){return ae.position.start.line<=B+1&&ae.position.end.line>=B+1});q.children=X.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(y))&&!j.some(function(ae){return m.toLowerCase().includes(ae)})&&(q.properties.line=[(B+N).toString()],q.properties.className.push("line-number")),E(B)&&q.properties.className.push("highlight-line"),(y==="diff"||(w=y)!=null&&w.includes("diff-"))&&Gr(q).substring(0,1)==="-"?q.properties.className.push("deleted"):(y==="diff"||($=y)!=null&&$.includes("diff-"))&&Gr(q).substring(0,1)==="+"&&q.properties.className.push("inserted")},M=yf(C.entries());!(T=M()).done;)D();C.length>0&&Gr(C[C.length-1]).trim()===""&&C.pop(),o.children=C}}}})(ZS);function k_(t){if(t>=1e6)return`${(t/1e6).toFixed(1)}M`;if(t>=1e3){const a=Number((t/1e3).toFixed(1));return a>=1e3?`${(t/1e6).toFixed(1)}M`:`${a.toFixed(1)}k`}return String(t)}function Ki(t){return t===0?"-":t<.01?`$${t.toFixed(4)}`:`$${t.toFixed(2)}`}const bM="_systemContextEvent_1qbiw_1",xM="_systemContextHeader_1qbiw_7",_M="_systemContextBadge_1qbiw_28",SM="_systemContextToggle_1qbiw_37",TM="_systemContextPre_1qbiw_43",kM="_systemContextEllipsis_1qbiw_54",CM="_systemEvent_1qbiw_58",EM="_systemTimestamp_1qbiw_65",NM="_textEvent_1qbiw_69",jM="_toolUseEvent_1qbiw_155",wM="_toolUseHeader_1qbiw_175",AM="_toolUsePrefix_1qbiw_182",DM="_toolUseName_1qbiw_187",MM="_toolUseArgs_1qbiw_192",RM="_toolResultEvent_1qbiw_203",OM="_toolResultHeader_1qbiw_208",BM="_toolResultIndicatorOk_1qbiw_232",IM="_toolResultIndicatorError_1qbiw_239",LM="_toolResultLabel_1qbiw_246",UM="_toolResultToggle_1qbiw_250",zM="_toolResultCommand_1qbiw_256",VM="_toolResultEllipsis_1qbiw_266",HM="_toolResultPre_1qbiw_270",PM="_errorEvent_1qbiw_291",GM="_statusEvent_1qbiw_299",$M="_userInputEvent_1qbiw_308",FM="_userInputContent_1qbiw_314",qM="_signalEvent_1qbiw_331",KM="_signalBadge_1qbiw_342",YM="_signalContent_1qbiw_351",ZM="_usageEvent_1qbiw_356",XM="_usageBadge_1qbiw_363",QM="_defaultEvent_1qbiw_372",Ie={systemContextEvent:bM,systemContextHeader:xM,systemContextBadge:_M,systemContextToggle:SM,systemContextPre:TM,systemContextEllipsis:kM,systemEvent:CM,systemTimestamp:EM,textEvent:NM,toolUseEvent:jM,toolUseHeader:wM,toolUsePrefix:AM,toolUseName:DM,toolUseArgs:MM,toolResultEvent:RM,toolResultHeader:OM,toolResultIndicatorOk:BM,toolResultIndicatorError:IM,toolResultLabel:LM,toolResultToggle:UM,toolResultCommand:zM,toolResultEllipsis:VM,toolResultPre:HM,errorEvent:PM,statusEvent:GM,userInputEvent:$M,userInputContent:FM,signalEvent:qM,signalBadge:KM,signalContent:YM,usageEvent:ZM,usageBadge:XM,defaultEvent:QM},G0=3;function WM({content:t}){const[a,i]=x.useState(!1),o=t.split(`
102
- `),r=o.length>G0,u=a?t:o.slice(0,G0).join(`
103
- `);return c.jsxs("div",{className:Ie.systemContextEvent,"data-testid":"system-context-event",children:[c.jsxs("button",{type:"button",className:Ie.systemContextHeader,onClick:()=>{i(d=>!d)},"aria-expanded":a,children:[c.jsx("span",{className:Ie.systemContextBadge,children:"SYSTEM PROMPT"}),r&&c.jsx("span",{className:Ie.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),c.jsxs("pre",{className:Ie.systemContextPre,children:[u,!a&&r&&c.jsx("span",{className:Ie.systemContextEllipsis,children:"…"})]})]})}function JM({time:t,content:a}){return c.jsxs("div",{className:Ie.systemEvent,children:[c.jsxs("span",{className:Ie.systemTimestamp,children:["[",t,"]"]})," ",a]})}function eR({content:t}){return c.jsx("div",{className:Ie.textEvent,children:c.jsx(th,{remarkPlugins:[nh],rehypePlugins:[yM],children:t})})}function tR({content:t}){let a="",i=t;try{const o=JSON.parse(t);a=o.tool||"",i=JSON.stringify(o.args,null,2)}catch{}return c.jsxs("div",{className:Ie.toolUseEvent,children:[c.jsxs("div",{className:Ie.toolUseHeader,children:[c.jsx("span",{className:Ie.toolUsePrefix,children:">"}),a?c.jsx("span",{className:Ie.toolUseName,children:a}):null]}),c.jsx("pre",{className:Ie.toolUseArgs,children:i})]})}const $0=5;function nR(t,a){if(a==null)return"";if(typeof a!="object")return String(a);const i=a;if(typeof i.command=="string")return i.command;if(typeof i.file_path=="string")return i.file_path;if(typeof i.pattern=="string"){const o=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${o}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const o=JSON.stringify(a);return o.length>150?`${o.slice(0,150)}…`:o}catch{return""}}function aR({content:t,raw:a,toolUseCtx:i}){const[o,r]=x.useState(!1);let u=!1;if(a)try{u=JSON.parse(a).is_error===!0}catch{}const d=t.split(`
104
- `),p=d.length>$0,m=o?t:d.slice(0,$0).join(`
105
- `),v=((i==null?void 0:i.tool)??"")||(u?"Tool error":"Tool output"),y=i?nR(i.tool,i.args):"",b=c.jsxs(c.Fragment,{children:[c.jsx("span",{className:u?Ie.toolResultIndicatorError:Ie.toolResultIndicatorOk,"aria-label":u?"error":"success","data-testid":u?"tool-result-indicator-error":"tool-result-indicator-ok",children:u?"✗":"✓"}),c.jsx("span",{className:Ie.toolResultLabel,"data-testid":"tool-result-label",children:v}),p&&c.jsx("span",{className:Ie.toolResultToggle,"aria-hidden":"true",children:o?"▾":"▸"})]});return c.jsxs("div",{className:Ie.toolResultEvent,"data-testid":"tool-result",children:[p?c.jsx("button",{className:Ie.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{r(S=>!S)},"aria-expanded":o,children:b}):c.jsx("div",{className:Ie.toolResultHeader,"data-testid":"tool-result-header",children:b}),y&&c.jsx("div",{className:Ie.toolResultCommand,children:y}),c.jsxs("pre",{className:Ie.toolResultPre,"data-testid":"tool-result-content",children:[m,!o&&p&&c.jsx("span",{className:Ie.toolResultEllipsis,children:"…"})]})]})}function sR({content:t}){return c.jsxs("div",{className:Ie.errorEvent,children:["Error: ",t]})}function iR({content:t}){return c.jsxs("div",{className:Ie.statusEvent,children:["--- ",t," ---"]})}function oR({content:t}){return c.jsx("div",{className:Ie.userInputEvent,children:c.jsx("span",{className:Ie.userInputContent,children:t})})}function lR({content:t}){return c.jsxs("div",{className:Ie.signalEvent,"data-testid":"signal-event",children:[c.jsx("span",{className:Ie.signalBadge,children:"SIGNAL"}),c.jsx("span",{className:Ie.signalContent,children:t})]})}function rR({content:t}){let a=t;try{const i=JSON.parse(t),o=Number(i.input_tokens)||0,r=Number(i.output_tokens)||0,u=k_(o+r),d=Ki(Number(i.cost_usd)||0);a=`${u} tokens · ${d}`}catch{}return c.jsx("div",{className:Ie.usageEvent,"data-testid":"usage-event",children:c.jsx("span",{className:Ie.usageBadge,children:a})})}function cR({content:t}){return c.jsx("div",{className:Ie.defaultEvent,children:t})}function uR({event:t,toolUseCtx:a}){const i=new Date(t.timestamp).toLocaleTimeString();switch(t.eventType){case"system":{if(t.raw)try{if(JSON.parse(t.raw).systemContext===!0)return c.jsx(WM,{content:t.content})}catch{}return c.jsx(JM,{time:i,content:t.content})}case"text":case"output":return c.jsx(eR,{content:t.content});case"tool_use":return c.jsx(tR,{content:t.content});case"tool_result":return c.jsx(aR,{content:t.content,raw:t.raw,toolUseCtx:a});case"error":return c.jsx(sR,{content:t.content});case"status":return c.jsx(iR,{content:t.content});case"user_input":return c.jsx(oR,{content:t.content});case"signal":return c.jsx(lR,{content:t.content});case"usage":return c.jsx(rR,{content:t.content});default:return c.jsx(cR,{content:t.content})}}const dR="_overlay_cmicx_1",fR="_dialog_cmicx_11",hR="_title_cmicx_30",pR="_description_cmicx_38",mR="_actions_cmicx_45",gR="_cancelButton_cmicx_52",vR="_confirmButton_cmicx_79",Ns={overlay:dR,dialog:fR,title:hR,description:pR,actions:mR,cancelButton:gR,confirmButton:vR};function Oc({isOpen:t,title:a,description:i,confirmLabel:o="Delete",onConfirm:r,onCancel:u}){const d=x.useId(),p=x.useId();return c.jsx(Qn,{children:t&&c.jsx(Ct.div,{className:Ns.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:u,onKeyDown:m=>{m.key==="Escape"&&u()},role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":i?p:void 0,children:c.jsxs(Ct.div,{className:Ns.dialog,initial:{opacity:0,scale:.93,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.93,y:-10},transition:{duration:.15,ease:[.16,1,.3,1]},onClick:m=>m.stopPropagation(),children:[c.jsx("h3",{id:d,className:Ns.title,children:a}),i&&c.jsx("p",{id:p,className:Ns.description,children:i}),c.jsxs("div",{className:Ns.actions,children:[c.jsx("button",{type:"button",className:Ns.cancelButton,onClick:u,autoFocus:!0,children:"Cancel"}),c.jsx("button",{type:"button",className:Ns.confirmButton,onClick:r,children:o})]})]})})})}const yR="_spinner_1uyt1_1",bR="_spin_1uyt1_1",xR="_sm_1uyt1_14",_R="_md_1uyt1_20",SR="_lg_1uyt1_26",TR="_xl_1uyt1_32",F0={spinner:yR,spin:bR,sm:xR,md:_R,lg:SR,xl:TR};function C_({size:t="md",className:a,label:i="Loading",liveRegion:o=!1}){return c.jsx("span",{className:`${F0.spinner} ${F0[t]} ${a??""}`,role:o?"status":void 0,"aria-label":i,"aria-hidden":o?void 0:!0})}const kR="_splash_1bn1g_1",CR="_logo_1bn1g_11",q0={splash:kR,logo:CR};function E_(){return c.jsxs("div",{className:q0.splash,"data-testid":"splash-screen",children:[c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:q0.logo}),c.jsx(C_,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function ER(t,a){const i=x.useRef(null);x.useEffect(()=>{const o=i.current;if(i.current=t,o===null)return;const r=new Map;for(const d of o)r.set(d.id,d);const u=new Set;for(const d of t){u.add(d.id);const p=r.get(d.id);if(p&&p.status!==d.status&&d.status!=="sleeping"){if(d.status==="connecting"){a("Provisioning environment…","info");continue}d.status==="connected"?a("Environment connected","success"):d.status==="error"?a("Environment provision failed","error"):d.status==="disconnected"&&(p.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const d of o)u.has(d.id)||a("Environment removed","info")},[t,a])}function NR(t,a,i){const o=t.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,r=N_(a),u=a.filter(m=>eh(m,r)).length,d=a.filter(m=>m.status==="paused"||m.status==="failed"||eh(m,r)).length,p=i.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:o,blockedTasks:u,attentionTasks:d,unhealthyEnvironments:p}}function N_(t){const a=new Map;for(const i of t)a.set(i.id,i.status);return a}function eh(t,a){return t.dependsOn.some(i=>a.get(i)!=="complete")}function jR(t,a){var d;const i=new Map;for(const p of a)i.set(p.id,p);const o=N_(t),r=[];for(const p of t){const m=p.workspaceId?((d=i.get(p.workspaceId))==null?void 0:d.name)??"Unknown":"Unknown";p.status==="failed"?r.push({task:p,reason:"failed",workspaceName:m}):eh(p,o)?r.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&r.push({task:p,reason:"paused",workspaceName:m})}const u={failed:0,blocked:1,paused:2};return r.sort((p,m)=>(u[p.reason]??3)-(u[m.reason]??3)),r}function wR(t,a){const i=new Map;for(const o of a)i.set(o.id,o);return t.filter(o=>o.status==="running"||o.status==="idle"||o.status==="waiting").map(o=>{var r;return{session:o,environmentName:((r=i.get(o.environmentId))==null?void 0:r.displayName)??"Unknown"}})}function AR(t,a,i){const o=new Map;for(const r of a){if(!r.workspaceId)continue;let u=o.get(r.workspaceId);u||(u={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},o.set(r.workspaceId,u)),u.totalTasks+=1,r.status==="complete"?u.completedTasks+=1:r.status==="working"?u.workingTasks+=1:r.status==="failed"&&(u.failedTasks+=1)}return t.map(r=>{const u=o.get(r.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:r,totalTasks:u.totalTasks,completedTasks:u.completedTasks,workingTasks:u.workingTasks,failedTasks:u.failedTasks}})}const DR="_dashboard_16pzm_1",MR="_kpiStrip_16pzm_11",RR="_kpiCard_16pzm_23",OR="_kpiValue_16pzm_68",BR="_kpiLabel_16pzm_76",IR="_bodyGrid_16pzm_84",LR="_section_16pzm_96",UR="_sectionHeader_16pzm_109",zR="_sectionIcon_16pzm_118",VR="_sectionTitle_16pzm_123",HR="_sectionCount_16pzm_131",PR="_sectionBody_16pzm_138",GR="_emptyHint_16pzm_143",$R="_sessionRow_16pzm_150",FR="_sessionPrompt_16pzm_177",qR="_sessionEnv_16pzm_186",KR="_sessionRuntime_16pzm_192",YR="_sessionStatus_16pzm_198",ZR="_statusDot_16pzm_207",XR="_attentionRow_16pzm_233",QR="_attentionTitle_16pzm_259",WR="_attentionMeta_16pzm_267",JR="_reasonBadge_16pzm_274",e3="_bottomGrid_16pzm_301",t3="_envRow_16pzm_312",n3="_envName_16pzm_323",a3="_envStatusBadge_16pzm_333",s3="_workspaceRow_16pzm_369",i3="_workspaceTop_16pzm_395",o3="_workspaceName_16pzm_401",l3="_workspaceCounts_16pzm_407",r3="_progressBar_16pzm_415",c3="_progressFill_16pzm_422",me={dashboard:DR,kpiStrip:MR,kpiCard:RR,kpiValue:OR,kpiLabel:BR,bodyGrid:IR,section:LR,sectionHeader:UR,sectionIcon:zR,sectionTitle:VR,sectionCount:HR,sectionBody:PR,emptyHint:GR,sessionRow:$R,sessionPrompt:FR,sessionEnv:qR,sessionRuntime:KR,sessionStatus:YR,statusDot:ZR,attentionRow:XR,attentionTitle:QR,attentionMeta:WR,reasonBadge:JR,bottomGrid:e3,envRow:t3,envName:n3,envStatusBadge:a3,workspaceRow:s3,workspaceTop:i3,workspaceName:o3,workspaceCounts:l3,progressBar:r3,progressFill:c3},u3={hidden:{opacity:0,y:12},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.3,ease:"easeOut"}})},Jr={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:.15+t*.08,duration:.35,ease:"easeOut"}})};function d3(t,a,i,o){const r=[`${t} of ${a} tasks completed`];return i>0&&r.push(`${i} in progress`),o>0&&r.push(`${o} failed`),r.join(", ")}function ec({value:t,label:a,accent:i,index:o,testId:r}){return c.jsxs(Ct.div,{className:me.kpiCard,"data-accent":i,"data-testid":r,variants:u3,initial:"hidden",animate:"visible",custom:o,children:[c.jsx("span",{className:me.kpiValue,children:t}),c.jsx("span",{className:me.kpiLabel,children:a})]})}function f3(){const{workspaces:t,tasks:a,sessions:i,environments:o,loadTasks:r}=qe(),u=Dt(),d=x.useRef(new Set);x.useEffect(()=>{for(const y of t)d.current.has(y.id)||(d.current.add(y.id),r(y.id))},[t,r]);const p=x.useMemo(()=>NR(i,a,o),[i,a,o]),m=x.useMemo(()=>wR(i,o),[i,o]),g=x.useMemo(()=>jR(a,t),[a,t]),v=x.useMemo(()=>AR(t,a),[t,a,o]);return c.jsxs("div",{className:me.dashboard,"data-testid":"dashboard",children:[c.jsxs("div",{className:me.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[c.jsx(ec,{value:p.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),c.jsx(ec,{value:p.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),c.jsx(ec,{value:p.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),c.jsx(ec,{value:p.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),c.jsxs("div",{className:me.bodyGrid,children:[c.jsxs(Ct.div,{className:me.section,variants:Jr,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"●"}),c.jsx("span",{className:me.sectionTitle,children:"Active Sessions"}),c.jsx("span",{className:me.sectionCount,children:m.length})]}),c.jsx("div",{className:me.sectionBody,children:m.length===0?c.jsx("div",{className:me.emptyHint,children:"No active sessions"}):m.map(({session:y,environmentName:b})=>c.jsxs("button",{type:"button",className:me.sessionRow,onClick:()=>u(bb(y.id)),"data-testid":"session-row",children:[c.jsx("span",{className:me.sessionPrompt,title:y.prompt,children:y.prompt||"—"}),c.jsx("span",{className:me.sessionEnv,children:b}),c.jsx("span",{className:me.sessionRuntime,children:y.runtime}),c.jsxs("span",{className:me.sessionStatus,children:[c.jsx("span",{className:me.statusDot,"data-status":y.status}),y.status]})]},y.id))})]}),c.jsxs(Ct.div,{className:me.section,variants:Jr,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"⚑"}),c.jsx("span",{className:me.sectionTitle,children:"Needs Attention"}),c.jsx("span",{className:me.sectionCount,children:g.length})]}),c.jsx("div",{className:me.sectionBody,children:g.length===0?c.jsx("div",{className:me.emptyHint,children:"All clear"}):g.map(({task:y,reason:b,workspaceName:S})=>c.jsxs("button",{type:"button",className:me.attentionRow,onClick:()=>u(_a(y.id)),"data-testid":"attention-row",children:[c.jsxs("div",{className:me.attentionTitle,children:[c.jsx("span",{className:me.reasonBadge,"data-reason":b,children:b}),y.title]}),c.jsx("div",{className:me.attentionMeta,children:c.jsx("span",{children:S})})]},y.id))})]})]}),c.jsxs("div",{className:me.bottomGrid,children:[c.jsxs(Ct.div,{className:me.section,variants:Jr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"◈"}),c.jsx("span",{className:me.sectionTitle,children:"Environment Health"}),c.jsx("span",{className:me.sectionCount,children:o.length})]}),c.jsx("div",{className:me.sectionBody,children:o.length===0?c.jsx("div",{className:me.emptyHint,children:"No environments configured"}):o.map(y=>c.jsxs("div",{className:me.envRow,"data-testid":"dashboard-env-row",children:[c.jsx("span",{className:me.envName,children:y.displayName}),c.jsx("span",{className:me.envStatusBadge,"data-status":y.status,children:y.status})]},y.id))})]}),c.jsxs(Ct.div,{className:me.section,variants:Jr,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"▦"}),c.jsx("span",{className:me.sectionTitle,children:"Workspaces"}),c.jsx("span",{className:me.sectionCount,children:t.length})]}),c.jsx("div",{className:me.sectionBody,children:v.length===0?c.jsx("div",{className:me.emptyHint,children:"No workspaces yet"}):v.map(({workspace:y,totalTasks:b,completedTasks:S,workingTasks:T,failedTasks:E})=>{const N=b>0?Math.round(S/b*100):0;return c.jsxs("button",{type:"button",className:me.workspaceRow,onClick:()=>u(Hi(y.id,y.environmentId)),"data-testid":"workspace-row",children:[c.jsxs("div",{className:me.workspaceTop,children:[c.jsx("span",{className:me.workspaceName,children:y.name}),c.jsxs("span",{className:me.workspaceCounts,"aria-label":d3(S,b,T,E),children:[S,"/",b,T>0&&c.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",T]}),E>0&&c.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",E]})]})]}),b>0&&c.jsx("div",{className:me.progressBar,children:c.jsx("div",{className:me.progressFill,style:{width:`${N}%`}})})]},y.id)})})]})]})]})}const h3="_panelContainer_aei9x_1",p3="_emptyState_aei9x_8",m3="_fadeIn_aei9x_1",g3="_workspaceSummary_aei9x_17",v3="_workspaceSummaryTitle_aei9x_28",y3="_workspaceSummarySubtitle_aei9x_32",b3="_header_aei9x_36",x3="_headerInfo_aei9x_69",_3="_killButton_aei9x_75",S3="_headerTitle_aei9x_104",T3="_headerActions_aei9x_119",k3="_taskStatusBadge_aei9x_126",C3="_taskBranch_aei9x_135",E3="_taskBlockedBadge_aei9x_141",N3="_btnPrimary_aei9x_149",j3="_btnDanger_aei9x_180",w3="_btnGhost_aei9x_219",A3="_rejectInput_aei9x_245",D3="_tabBar_aei9x_275",M3="_tab_aei9x_275",R3="_active_aei9x_301",O3="_eventScroll_aei9x_306",B3="_tabContent_aei9x_312",I3="_noContext_aei9x_317",L3="_overviewContent_aei9x_323",U3="_overviewDashboard_aei9x_332",z3="_overviewHero_aei9x_338",V3="_statusBadge_aei9x_345",H3="_statusPending_aei9x_357",P3="_statusAssigned_aei9x_362",G3="_statusInProgress_aei9x_367",$3="_statusReview_aei9x_372",F3="_statusDone_aei9x_377",q3="_statusFailed_aei9x_382",K3="_statusWaitingInput_aei9x_387",Y3="_overviewBranchPill_aei9x_392",Z3="_branchLink_aei9x_407",X3="_overviewSection_aei9x_418",Q3="_overviewLabel_aei9x_424",W3="_overviewValue_aei9x_431",J3="_overviewMuted_aei9x_436",eO="_overviewMarkdown_aei9x_442",tO="_envRow_aei9x_511",nO="_envDot_aei9x_517",aO="_envDotGreen_aei9x_524",sO="_envDotYellow_aei9x_528",iO="_envDotRed_aei9x_532",oO="_envDotGray_aei9x_536",lO="_depList_aei9x_540",rO="_depItem_aei9x_546",cO="_depBlocked_aei9x_553",uO="_depDone_aei9x_557",dO="_timeline_aei9x_561",fO="_timelineRow_aei9x_567",hO="_timelineKey_aei9x_574",pO="_timelineValue_aei9x_580",mO="_timelineDelta_aei9x_584",gO="_reviewNotes_aei9x_595",vO="_overviewDescription_aei9x_606",yO="_waitingMessage_aei9x_612",bO="_errorMessage_aei9x_616",xO="_eventOverflowWarning_aei9x_620",_O="_attemptSelector_aei9x_634",SO="_attemptLabel_aei9x_650",TO="_attemptButton_aei9x_654",kO="_attemptActive_aei9x_671",CO="_attemptStatus_aei9x_677",EO="_emptyCta_aei9x_683",NO="_ctaTitle_aei9x_695",jO="_ctaDescription_aei9x_701",wO="_ctaButton_aei9x_708",AO="_ctaCreateForm_aei9x_743",DO="_ctaCreateInput_aei9x_749",MO="_ctaCreateOk_aei9x_780",RO="_ctaLink_aei9x_815",OO="_workspaceHeader_aei9x_829",BO="_workspaceName_aei9x_854",IO="_workspaceMeta_aei9x_867",LO="_metaRow_aei9x_875",UO="_metaLabel_aei9x_888",zO="_metaValue_aei9x_903",VO="_archiveButton_aei9x_913",HO="_repoLink_aei9x_943",PO="_metaToggle_aei9x_953",GO="_metaToggleArrow_aei9x_974",$O="_metaToggleArrowOpen_aei9x_979",FO="_progressBarContainer_aei9x_983",qO="_progressBar_aei9x_983",KO="_progressFill_aei9x_999",YO="_progressLabel_aei9x_1006",ZO="_metaTimestamps_aei9x_1013",XO="_metaTimestamp_aei9x_1013",U={panelContainer:h3,emptyState:p3,fadeIn:m3,workspaceSummary:g3,workspaceSummaryTitle:v3,workspaceSummarySubtitle:y3,header:b3,headerInfo:x3,killButton:_3,headerTitle:S3,headerActions:T3,taskStatusBadge:k3,taskBranch:C3,taskBlockedBadge:E3,btnPrimary:N3,btnDanger:j3,btnGhost:w3,rejectInput:A3,tabBar:D3,tab:M3,active:R3,eventScroll:O3,tabContent:B3,noContext:I3,overviewContent:L3,overviewDashboard:U3,overviewHero:z3,statusBadge:V3,statusPending:H3,statusAssigned:P3,statusInProgress:G3,statusReview:$3,statusDone:F3,statusFailed:q3,statusWaitingInput:K3,overviewBranchPill:Y3,branchLink:Z3,overviewSection:X3,overviewLabel:Q3,overviewValue:W3,overviewMuted:J3,overviewMarkdown:eO,envRow:tO,envDot:nO,envDotGreen:aO,envDotYellow:sO,envDotRed:iO,envDotGray:oO,depList:lO,depItem:rO,depBlocked:cO,depDone:uO,timeline:dO,timelineRow:fO,timelineKey:hO,timelineValue:pO,timelineDelta:mO,reviewNotes:gO,overviewDescription:vO,waitingMessage:yO,errorMessage:bO,eventOverflowWarning:xO,attemptSelector:_O,attemptLabel:SO,attemptButton:TO,attemptActive:kO,attemptStatus:CO,emptyCta:EO,ctaTitle:NO,ctaDescription:jO,ctaButton:wO,ctaCreateForm:AO,ctaCreateInput:DO,ctaCreateOk:MO,ctaLink:RO,workspaceHeader:OO,workspaceName:BO,workspaceMeta:IO,metaRow:LO,metaLabel:UO,metaValue:zO,archiveButton:VO,repoLink:HO,metaToggle:PO,metaToggleArrow:GO,metaToggleArrowOpen:$O,progressBarContainer:FO,progressBar:qO,progressFill:KO,progressLabel:YO,metaTimestamps:ZO,metaTimestamp:XO};function QO(){return c.jsx("div",{className:U.emptyState,children:"Select a task or click + to create one"})}function WO(){return c.jsx("div",{className:U.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function JO(){const{workspaces:t,environments:a}=qe(),i=Dt(),o=a.length>0;return t.length>0?c.jsx(f3,{}):c.jsxs("div",{className:U.emptyCta,"data-testid":"welcome-cta",children:[c.jsx("div",{className:U.ctaTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:U.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),c.jsx("button",{className:U.ctaButton,onClick:()=>i(_b),disabled:!o,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!o&&c.jsx("div",{className:U.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const j_=50;function eB(t,a,i,o,r=j_){return o?t<r:a-t-i<r}function tB(t,a){const i=a-t;return i>0?i:0}function nB({scrollRef:t,contentLength:a,isReversed:i}){const[o,r]=x.useState(!0),u=x.useRef(0),d=x.useRef(!1),p=x.useRef(0);x.useEffect(()=>{const g=t.current;if(!g)return;let v=!0;const y=()=>{p.current||(p.current=requestAnimationFrame(()=>{p.current=0;const b=eB(g.scrollTop,g.scrollHeight,g.clientHeight,i,j_);b!==v&&(v=b,r(b))}))};return g.addEventListener("scroll",y,{passive:!0}),()=>{g.removeEventListener("scroll",y),p.current&&(cancelAnimationFrame(p.current),p.current=0)}},[t,i]),x.useLayoutEffect(()=>{const g=t.current;!g||d.current||(d.current=!0,i?g.scrollTop=0:g.scrollTop=g.scrollHeight,r(!0))},[t,i]),x.useLayoutEffect(()=>{const g=t.current;if(g){if(i&&!o){const v=tB(u.current,g.scrollHeight);v>0&&(g.scrollTop+=v)}o&&(i?g.scrollTo({top:0,behavior:"smooth"}):g.scrollTo({top:g.scrollHeight,behavior:"smooth"})),u.current=g.scrollHeight}},[a,o,i,t]);const m=x.useCallback(()=>{const g=t.current;if(!g)return;const v=i?0:g.scrollHeight;g.scrollTo({top:v,behavior:"smooth"}),r(!0)},[t,i]);return{isAtAnchor:o,scrollToAnchor:m}}const aB="_wrapper_p24zt_1",sB="_scrollContainer_p24zt_9",iB="_toolbar_p24zt_15",oB="_directionToggle_p24zt_22",lB="_scrollToAnchor_p24zt_60",rB="_scrollToAnchorBottom_p24zt_84",cB="_scrollToAnchorTop_p24zt_88",js={wrapper:aB,scrollContainer:sB,toolbar:iB,directionToggle:oB,scrollToAnchor:lB,scrollToAnchorBottom:rB,scrollToAnchorTop:cB},w_="grackle-stream-direction";function uB(){try{return localStorage.getItem(w_)==="reversed"}catch{return!1}}function dB({eventsDropped:t}){return t<=0?c.jsx(c.Fragment,{}):c.jsxs("div",{className:U.eventOverflowWarning,role:"alert",children:["⚠"," ",t.toLocaleString()," older event",t===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function Zh({events:t,eventsDropped:a,emptyState:i}){const o=x.useRef(null),[r,u]=x.useState(uB),d=VA(),p=x.useMemo(()=>r?[...t].reverse():t,[t,r]),{isAtAnchor:m,scrollToAnchor:g}=nB({scrollRef:o,contentLength:t.length,isReversed:r}),v=()=>{const S=!r;u(S);try{localStorage.setItem(w_,S?"reversed":"default")}catch{}},y=d?0:.2,b=r?-8:8;return c.jsxs("div",{className:js.wrapper,children:[c.jsx("div",{className:js.toolbar,children:c.jsx("button",{className:js.directionToggle,onClick:v,title:r?"Showing newest first":"Showing oldest first","aria-label":r?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:r?"↓":"↑"})}),c.jsxs("div",{ref:o,className:js.scrollContainer,"data-testid":"event-stream-scroll",children:[t.length===0&&i,c.jsx(dB,{eventsDropped:a}),c.jsx(Qn,{initial:!1,children:p.map((S,T)=>{const E=r?t.length-1-T:T;return c.jsx(Ct.div,{initial:{opacity:0,y:b},animate:{opacity:1,y:0},transition:{duration:y,ease:"easeOut"},children:c.jsx(uR,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${E}`)})})]}),c.jsx(Qn,{children:!m&&c.jsxs(Ct.button,{className:`${js.scrollToAnchor} ${r?js.scrollToAnchorTop:js.scrollToAnchorBottom}`,onClick:g,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.15},"aria-label":"Scroll to latest","data-testid":"scroll-to-anchor",children:[r?"↑":"↓"," New events"]})})]})}const fB="_bar_1xhb4_1",hB="_input_1xhb4_32",pB="_select_1xhb4_67",mB="_btnPrimary_1xhb4_103",gB="_btnDanger_1xhb4_134",vB="_btnGhost_1xhb4_173",yB="_badge_1xhb4_195",bB="_disconnectHint_1xhb4_205",en={bar:fB,input:hB,select:pB,btnPrimary:mB,btnDanger:gB,btnGhost:vB,badge:yB,disconnectHint:bB};function xB(t,a){if(!t)return!1;const i=a.find(o=>o.id===t);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function _B({environmentId:t,onReconnect:a}){return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:en.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),c.jsx("button",{type:"button",onClick:()=>a(t),className:en.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function xl({mode:t,sessionId:a,environmentId:i,taskId:o,showStop:r,showPersonaSelect:u,onSessionKill:d}){const{sendInput:p,spawn:m,startTask:g,personas:v,environments:y,provisionEnvironment:b}=qe(),{showToast:S}=Us(),[T,E]=x.useState(""),[N,C]=x.useState(""),j=xB(i,y),D=M=>{if(M.preventDefault(),!!T.trim())if(t==="send"){if(!a||j)return;p(a,T),E("")}else if(t==="spawn"){if(!i)return;m(i,T,N),S("Session started","success"),E(""),C("")}else{if(!o)return;g(o,void 0,i,T),E("")}};return t==="spawn"?c.jsxs("form",{onSubmit:D,className:en.bar,children:[c.jsx("span",{className:en.badge,children:"new chat"}),c.jsx("input",{type:"text",value:T,onChange:M=>E(M.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:en.input}),u&&c.jsxs("select",{value:N,onChange:M=>C(M.target.value),className:en.select,children:[c.jsx("option",{value:"",children:"(Default)"}),v.map(M=>c.jsx("option",{value:M.id,children:M.name},M.id))]}),c.jsx("button",{type:"submit",disabled:!T.trim()||!i,className:en.btnPrimary,children:"Go"})]}):t==="start"?c.jsxs("form",{onSubmit:D,className:en.bar,children:[c.jsx("input",{type:"text",value:T,onChange:M=>E(M.target.value),placeholder:"Type a message...",autoFocus:!0,className:en.input}),c.jsx("button",{type:"submit",disabled:!T.trim(),className:en.btnPrimary,children:"Send"})]}):c.jsxs("form",{onSubmit:D,className:en.bar,children:[j&&i&&c.jsx(_B,{environmentId:i,onReconnect:b}),c.jsx("input",{type:"text",value:T,onChange:M=>E(M.target.value),placeholder:"Type a message...",autoFocus:!j,disabled:j,className:en.input}),c.jsx("span",{title:j?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!T.trim()||j,className:en.btnPrimary,children:"Send"})}),r&&d&&c.jsx("button",{type:"button",onClick:d,className:en.btnDanger,title:"Stop session",children:"Stop"})]})}function Xh(t){const a=[];for(const i of t){const o=a[a.length-1];i.eventType==="text"&&(o==null?void 0:o.eventType)==="text"?a[a.length-1]={...o,content:o.content+i.content}:a.push(i)}return a}function Qh(t){const a=new Map;for(const u of t)if(u.raw)try{a.set(u,JSON.parse(u.raw))}catch{}const i=new Map;for(const u of t){if(u.eventType!=="tool_use")continue;const d=a.get(u);if(!(!d||typeof d.id!="string"))try{const p=JSON.parse(u.content);i.set(d.id,{tool:p.tool,args:p.args})}catch{}}const o=new Set;return t.map(u=>{if(u.eventType!=="tool_result")return u;const d=a.get(u);if(!d||typeof d.tool_use_id!="string")return u;const p=i.get(d.tool_use_id);return p?(o.add(d.tool_use_id),{...u,toolUseCtx:p}):u}).filter(u=>{if(u.eventType!=="tool_use")return!0;const d=a.get(u);return d&&typeof d.id=="string"?!o.has(d.id):!0})}const SB="_panelContainer_pz4cr_1",TB="_emptyState_pz4cr_8",kB="_emptyTitle_pz4cr_20",CB="_emptyDescription_pz4cr_26",EB="_emptyHint_pz4cr_32",al={panelContainer:SB,emptyState:TB,emptyTitle:kB,emptyDescription:CB,emptyHint:EB};function NB({hasLocalEnvironment:t}){return c.jsxs("div",{className:al.emptyState,"data-testid":"chat-empty-state",children:[c.jsx("div",{className:al.emptyTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:al.emptyDescription,children:t?"Type a message below to start chatting with the System agent. It can help you plan work, create tasks, and coordinate agents.":"Add a local environment in Settings to start chatting."}),!t&&c.jsx("div",{className:al.emptyHint,children:"Go to Settings → Environments to add one."})]})}function jB(){const{tasks:t,sessions:a,events:i,eventsDropped:o,environments:r,loadTaskSessions:u,loadSessionEvents:d,kill:p,taskSessions:m}=qe(),g=x.useRef(void 0),v=t.find(E=>E.id===Qo),y=v!=null&&v.latestSessionId?a.find(E=>E.id===v.latestSessionId)??(m[Qo]??[]).find(E=>E.id===v.latestSessionId):void 0;x.useEffect(()=>{u(Qo)},[u]),x.useEffect(()=>{v!=null&&v.latestSessionId&&u(Qo)},[v==null?void 0:v.latestSessionId,u]),x.useEffect(()=>{y&&y.id!==g.current&&(g.current=y.id,d(y.id))},[y==null?void 0:y.id,d]);const b=x.useMemo(()=>{if(!y)return[];const E=i.filter(N=>N.sessionId===y.id);return Qh(Xh(E))},[i,y==null?void 0:y.id]),S=r.find(E=>E.adapterType==="local"&&E.status==="connected"),T=y!==void 0&&!["completed","failed","interrupted","hibernating","suspended"].includes(y.status);return c.jsxs("div",{className:al.panelContainer,"data-testid":"chat-page",children:[c.jsx(Zh,{events:b,eventsDropped:o,emptyState:c.jsx(NB,{hasLocalEnvironment:!!S})}),S&&T&&c.jsx(xl,{mode:"send",sessionId:y.id,environmentId:y.environmentId,showStop:!0,onSessionKill:()=>p(y.id)}),S&&!T&&c.jsx(xl,{mode:"start",taskId:Qo,environmentId:S.id})]})}function wB(t,a){const i=[];let o=t;const r=new Set;for(;o&&a.has(o)&&!r.has(o);){r.add(o);const u=a.get(o);i.unshift(u),o=u.parentTaskId||void 0}return i}const Bs={label:"Home",url:Os};function AB(t){return t?[Bs,{label:"Settings",url:il},{label:t,url:void 0}]:[Bs,{label:"Settings",url:void 0}]}const A_={label:"Environments",url:Pi};function DB(){return[Bs,{label:"Environments",url:void 0}]}function MB(){return[Bs,{label:"New Chat",url:void 0}]}function RB(t){return[Bs,{label:`Session ${t.slice(0,8)}`,url:void 0}]}function OB(t,a,i,o){const r=i.find(d=>d.id===t),u=o.find(d=>d.id===a);return[Bs,A_,{label:(u==null?void 0:u.displayName)??"Environment",url:Gi(a)},{label:(r==null?void 0:r.name)??"Workspace",url:void 0}]}function BB(t,a,i,o,r){const u=wB(t,r),d=r.get(t),p=d==null?void 0:d.workspaceId,m=p?i.find(S=>S.id===p):void 0,g=a??(m==null?void 0:m.environmentId),v=g?o.find(S=>S.id===g):void 0,y=[Bs];v&&g&&(y.push(A_),y.push({label:v.displayName,url:Gi(g)})),m&&g&&y.push({label:m.name,url:Hi(m.id,g)});for(let S=0;S<u.length-1;S++)y.push({label:u[S].title,url:_a(u[S].id,void 0,p,g)});const b=u[u.length-1];return y.push({label:(b==null?void 0:b.title)??t,url:void 0}),y}function IB(){const t=MB(),[a]=uh(),i=a.get("env")??"";return c.jsxs("div",{className:U.panelContainer,children:[c.jsx(Vs,{segments:t}),c.jsx("div",{className:U.emptyState,children:"Enter a prompt below to start a new session"}),c.jsx(xl,{mode:"spawn",environmentId:i,showPersonaSelect:!0})]})}function LB({sessionId:t,session:a,isActive:i,onKill:o}){return c.jsxs("div",{className:U.header,children:[c.jsxs("span",{children:["Session: ",t.slice(0,8),a&&` | ${a.runtime} | ${a.status}`,a!=null&&a.inputTokens||a!=null&&a.outputTokens||a!=null&&a.costUsd?` | ${k_((a.inputTokens??0)+(a.outputTokens??0))} tokens · ${Ki(a.costUsd??0)}`:""]}),c.jsxs("span",{className:U.headerInfo,children:[a&&c.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&c.jsx("button",{onClick:()=>o(t),title:"Stop session",className:U.killButton,children:"×"})]})]})}function UB({session:t}){const a=t&&["completed","failed","interrupted","suspended"].includes(t.status),i=a?`Session ${t.status} with no events recorded.`:"Waiting for events...";return c.jsx("div",{className:a?U.errorMessage:U.waitingMessage,children:i})}function zB(){const{sessionId:t}=ss(),{events:a,eventsDropped:i,sessions:o,kill:r,loadSessionEvents:u}=qe(),d=x.useRef(void 0),p=RB(t),m=o.find(y=>y.id===t)??void 0,g=x.useMemo(()=>{const y=t?a.filter(b=>b.sessionId===t):[];return Qh(Xh(y))},[a,t]);if(x.useEffect(()=>{t&&t!==d.current&&(d.current=t,u(t))},[t,u]),!t)return c.jsx("div",{className:U.emptyState,children:"No session selected"});const v=(m==null?void 0:m.status)==="running"||(m==null?void 0:m.status)==="idle";return c.jsxs("div",{className:U.panelContainer,children:[c.jsx(Vs,{segments:p}),c.jsx(LB,{sessionId:t,session:m,isActive:v,onKill:r}),c.jsx(Zh,{events:g,eventsDropped:i,emptyState:c.jsx(UB,{session:m})}),v&&c.jsx(xl,{mode:"send",sessionId:t,environmentId:m.environmentId,showStop:!0,onSessionKill:()=>r(t)})]})}const K0=220,Y0=70,VB=40,HB=60,PB="hierarchy",GB="dependency";function $B(t){return x.useMemo(()=>{if(t.length===0)return{nodes:[],edges:[]};const a=new Zv.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:VB,ranksep:HB});const i=new Map(t.map(d=>[d.id,d])),o=new Map;for(const d of t)if(d.parentTaskId&&i.has(d.parentTaskId)){const p=o.get(d.parentTaskId)||[];p.push(d),o.set(d.parentTaskId,p)}for(const d of t)a.setNode(d.id,{width:K0,height:Y0});const r=[];for(const d of t){if(d.parentTaskId&&i.has(d.parentTaskId)){const p=`hierarchy-${d.parentTaskId}-${d.id}`;a.setEdge(d.parentTaskId,d.id,{},p),r.push({id:p,source:d.parentTaskId,target:d.id,type:"smoothstep",data:{edgeType:PB},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of d.dependsOn)if(i.has(p)){const m=`dependency-${p}-${d.id}`;a.setEdge(p,d.id,{},m),r.push({id:m,source:p,target:d.id,type:"smoothstep",data:{edgeType:GB},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Zv.layout(a),{nodes:t.map(d=>{const p=a.node(d.id),m=o.get(d.id)||[];return{id:d.id,type:"task",position:{x:p.x-K0/2,y:p.y-Y0/2},data:{task:d,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:d.dependsOn.length>0}}}),edges:r}},[t])}const FB="_dagContainer_js4w6_1",qB="_taskNode_js4w6_26",KB="_taskNodeBorder_js4w6_54",YB="_taskNodeContent_js4w6_60",ZB="_taskNodeHeader_js4w6_70",XB="_taskNodeIcon_js4w6_77",QB="_taskNodeTitle_js4w6_82",WB="_taskNodeBadges_js4w6_90",JB="_childBadge_js4w6_95",e6="_depBadge_js4w6_107",t6="_handle_js4w6_119",n6="_emptyCta_js4w6_126",a6="_ctaDescription_js4w6_137",s6="_ctaButton_js4w6_144",Ft={dagContainer:FB,taskNode:qB,taskNodeBorder:KB,taskNodeContent:YB,taskNodeHeader:ZB,taskNodeIcon:XB,taskNodeTitle:QB,taskNodeBadges:WB,childBadge:JB,depBadge:e6,handle:t6,emptyCta:n6,ctaDescription:a6,ctaButton:s6};function i6({data:t}){const{task:a,childCount:i,doneChildCount:o,hasDependencies:r}=t,u=as(a.status);return c.jsxs("div",{className:Ft.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[c.jsx(Xv,{type:"target",position:Qv.Top,className:Ft.handle}),c.jsx("div",{className:Ft.taskNodeBorder,style:{backgroundColor:u.color}}),c.jsxs("div",{className:Ft.taskNodeContent,children:[c.jsxs("div",{className:Ft.taskNodeHeader,children:[c.jsx("span",{className:Ft.taskNodeIcon,style:{color:u.color},children:u.icon}),c.jsx("span",{className:Ft.taskNodeTitle,children:a.title})]}),c.jsxs("div",{className:Ft.taskNodeBadges,children:[i>0&&c.jsxs("span",{className:Ft.childBadge,children:[o,"/",i]}),r&&c.jsx("span",{className:Ft.depBadge,children:"dep"})]})]}),c.jsx(Xv,{type:"source",position:Qv.Bottom,className:Ft.handle})]})}const o6=M2,l6={task:i6};function r6({workspaceId:t,environmentId:a}){const{tasks:i}=qe(),o=Dt(),{resolvedThemeId:r}=wb(),u=x.useMemo(()=>i.filter(y=>y.workspaceId===t),[i,t]),{nodes:d,edges:p}=$B(u),m=x.useMemo(()=>{const y=getComputedStyle(document.documentElement),b={};for(const[S,T]of Object.entries(o6))b[S]=y.getPropertyValue(T).trim()||"#6b7a8d";return b},[r]),g=x.useCallback((y,b)=>{o(_a(b.id,void 0,t,a))},[o,t,a]),v=x.useCallback(y=>{const b=y.data;return m[b.task.status]||m.pending},[m]);return u.length===0?c.jsxs("div",{className:Ft.emptyCta,children:[c.jsx("button",{className:Ft.ctaButton,onClick:()=>o(Xi(t,void 0,a)),children:"Create Task"}),c.jsx("div",{className:Ft.ctaDescription,children:"Create tasks to see the dependency graph"})]}):c.jsx("div",{className:Ft.dagContainer,children:c.jsxs(JS,{nodes:d,edges:p,nodeTypes:l6,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[c.jsx(eT,{variant:tT.Dots,gap:24,size:1,color:"var(--text-disabled)"}),c.jsx(nT,{showInteractive:!1}),c.jsx(aT,{nodeColor:v,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function c6({tasks:t,taskStatusById:a,sessionStatusByTaskId:i}){const o=new Map;for(const u of t)if(u.parentTaskId){const d=o.get(u.parentTaskId);d?d.push(u):o.set(u.parentTaskId,[u])}const r=new Map(V0.map(u=>[u,[]]));for(const u of t){const d=Yh(u.status),p=u.dependsOn.length>0&&u.dependsOn.some(T=>a.get(T)!=="complete"),m=o.get(u.id)??[],g=m.length,v=m.filter(T=>T.status==="complete").length;let y;if(d==="paused"&&i){const T=i.get(u.id);T==="idle"?y="Needs input":T==="completed"&&(y="Ready to complete")}const b={task:u,isBlocked:p,childCount:g,doneChildCount:v,pausedSubBadge:y},S=r.get(d);S?S.push(b):r.get("not_started").push(b)}for(const u of r.values())u.sort((d,p)=>d.task.sortOrder-p.task.sortOrder);return V0.map(u=>{const d=as(u);return{status:u,label:d.label,style:d,tasks:r.get(u)??[]}})}const u6="_boardContainer_1c4y1_1",d6="_column_1c4y1_17",f6="_columnHeader_1c4y1_34",h6="_columnIcon_1c4y1_47",p6="_columnLabel_1c4y1_52",m6="_columnCount_1c4y1_57",g6="_cardList_1c4y1_67",v6="_emptyPlaceholder_1c4y1_76",y6="_card_1c4y1_67",b6="_cardHeader_1c4y1_107",x6="_cardStatusIcon_1c4y1_113",_6="_cardTitle_1c4y1_119",S6="_cardBadges_1c4y1_127",T6="_badge_1c4y1_134",k6="_blockedBadge_1c4y1_146",C6="_childBadge_1c4y1_151",E6="_depBadge_1c4y1_155",N6="_parentBadge_1c4y1_159",j6="_pausedSubBadge_1c4y1_166",w6="_personaBadge_1c4y1_170",A6="_envBadge_1c4y1_174",D6="_emptyCta_1c4y1_178",M6="_ctaButton_1c4y1_188",R6="_ctaDescription_1c4y1_204",Ge={boardContainer:u6,column:d6,columnHeader:f6,columnIcon:h6,columnLabel:p6,columnCount:m6,cardList:g6,emptyPlaceholder:v6,card:y6,cardHeader:b6,cardStatusIcon:x6,cardTitle:_6,cardBadges:S6,badge:T6,blockedBadge:k6,childBadge:C6,depBadge:E6,parentBadge:N6,pausedSubBadge:j6,personaBadge:w6,envBadge:A6,emptyCta:D6,ctaButton:M6,ctaDescription:R6};function O6({workspaceId:t,environmentId:a}){const{tasks:i,sessions:o,personas:r,environments:u}=qe(),d=Dt(),p=x.useMemo(()=>i.filter(b=>b.workspaceId===t),[i,t]),m=x.useMemo(()=>new Map(i.map(b=>[b.id,b.status])),[i]),g=x.useMemo(()=>new Map(p.map(b=>[b.id,b])),[p]),v=x.useMemo(()=>{const b=new Map(o.map(j=>[j.id,j])),S=new Map(r.map(j=>[j.id,j])),T=new Map(u.map(j=>[j.id,j])),E=new Map,N=new Map,C=new Map;for(const j of p)if(j.latestSessionId){const D=b.get(j.latestSessionId);if(D){if(E.set(j.id,D.status),D.personaId){const M=S.get(D.personaId);M&&N.set(j.id,M.name)}if(D.environmentId){const M=T.get(D.environmentId);M&&C.set(j.id,M.displayName)}}}return{sessionStatusByTaskId:E,personaNameByTaskId:N,environmentNameByTaskId:C}},[p,o,r,u]),y=x.useMemo(()=>c6({tasks:p,taskStatusById:m,sessionStatusByTaskId:v.sessionStatusByTaskId}),[p,m,v]);return p.length===0?c.jsxs("div",{className:Ge.emptyCta,"data-testid":"board-empty-cta",children:[c.jsx("button",{className:Ge.ctaButton,onClick:()=>d(Xi(t,void 0,a)),children:"Create Task"}),c.jsx("div",{className:Ge.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):c.jsx("div",{className:Ge.boardContainer,"data-testid":"board-container",children:y.map(b=>c.jsxs("section",{className:Ge.column,"data-testid":`board-column-${b.status}`,"aria-label":`${b.label}, ${b.tasks.length} ${b.tasks.length===1?"task":"tasks"}`,children:[c.jsxs("div",{className:Ge.columnHeader,children:[c.jsx("span",{className:Ge.columnIcon,style:{color:b.style.color},children:b.style.icon}),c.jsx("span",{className:Ge.columnLabel,children:b.label}),c.jsx("span",{className:Ge.columnCount,"data-testid":`board-count-${b.status}`,children:b.tasks.length})]}),c.jsx("div",{className:Ge.cardList,children:b.tasks.length===0?c.jsx("div",{className:Ge.emptyPlaceholder,children:"No tasks"}):c.jsx(Qn,{mode:"popLayout",children:b.tasks.map(S=>c.jsx(Ct.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:c.jsx(B6,{boardTask:S,tasksById:g,personaName:v.personaNameByTaskId.get(S.task.id),envName:v.environmentNameByTaskId.get(S.task.id),onClick:()=>d(_a(S.task.id,void 0,t,a))})},S.task.id))})})]},b.status))})}function B6({boardTask:t,tasksById:a,personaName:i,envName:o,onClick:r}){const{task:u,isBlocked:d,childCount:p,doneChildCount:m,pausedSubBadge:g}=t,v=as(u.status),y=u.parentTaskId?a.get(u.parentTaskId):void 0;return c.jsxs("div",{className:Ge.card,tabIndex:0,role:"button","data-testid":`board-card-${u.id}`,onClick:r,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),r())},children:[c.jsxs("div",{className:Ge.cardHeader,children:[c.jsx("span",{className:Ge.cardStatusIcon,style:{color:v.color},children:v.icon}),c.jsx("span",{className:Ge.cardTitle,children:u.title})]}),c.jsxs("div",{className:Ge.cardBadges,children:[y&&c.jsx("span",{className:`${Ge.badge} ${Ge.parentBadge}`,title:y.title,children:y.title}),p>0&&c.jsxs("span",{className:`${Ge.badge} ${Ge.childBadge}`,children:[m,"/",p]}),d&&c.jsx("span",{className:`${Ge.badge} ${Ge.blockedBadge}`,children:"blocked"}),u.dependsOn.length>0&&!d&&c.jsx("span",{className:`${Ge.badge} ${Ge.depBadge}`,children:"dep"}),g&&c.jsx("span",{className:`${Ge.badge} ${Ge.pausedSubBadge}`,children:g}),i&&c.jsx("span",{className:`${Ge.badge} ${Ge.personaBadge}`,children:i}),o&&c.jsx("span",{className:`${Ge.badge} ${Ge.envBadge}`,children:o})]})]})}function Wh(t){const{value:a,onSave:i,validate:o,fieldId:r,activeFieldId:u,onActivate:d,enterToSave:p=!0,trimOnSave:m=!0}=t,[g,v]=x.useState(""),[y,b]=x.useState(""),S=x.useRef(!1),T=u===r,E=x.useCallback(V=>{v(V),b("")},[]),N=x.useCallback(()=>{b("")},[]),C=x.useCallback(()=>{S.current=!1,d==null||d(null),v(""),b("")},[d]),j=x.useCallback(()=>{const V=m?g.trim():g;if(o){const q=o(g);if(q){b(q);return}}const B=m?a.trim():a;if(V===B){C();return}i(V),C()},[g,a,m,o,i,C]),D=x.useCallback(()=>{S.current=!0,d==null||d(r),v(a),b("")},[r,a,d]),M=x.useCallback(V=>{if(S.current){S.current=!1;return}V.relatedTarget instanceof HTMLElement&&V.relatedTarget.dataset.editAction===r||j()},[r,j]),w=x.useCallback(V=>{V.key==="Escape"?C():V.key==="Enter"&&p&&j()},[C,p,j]),$=(()=>{if(!T)return!1;const V=m?a.trim():a;return(m?g.trim():g)!==V})();return x.useEffect(()=>{!T&&(g!==""||y!=="")&&(v(""),b(""))},[T,g,y]),{isEditing:T,draft:g,error:y,isDirty:$,startEdit:D,cancelEdit:C,save:j,setDraft:E,clearError:N,handleBlur:M,handleKeyDown:w,ignoreInitialBlurRef:S}}const I6="_editFieldWrapper_yuzty_1",L6="_editInput_yuzty_10",U6="_editTextarea_yuzty_42",z6="_editSelect_yuzty_78",V6="_editError_yuzty_111",H6="_editInputInvalid_yuzty_118",P6="_editHint_yuzty_123",G6="_unsavedDot_yuzty_132",$6="_metaValueClickable_yuzty_140",F6="_editButton_yuzty_159",q6="_metaPlaceholder_yuzty_175",K6="_worktreeToggle_yuzty_180",ze={editFieldWrapper:I6,editInput:L6,editTextarea:U6,editSelect:z6,editError:V6,editInputInvalid:H6,editHint:P6,unsavedDot:G6,metaValueClickable:$6,editButton:F6,metaPlaceholder:q6,worktreeToggle:K6};function un(t){const{value:a,onSave:i,validate:o,mode:r="edit",fieldId:u="text",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,maxLength:y,ariaLabel:b,"data-testid":S}=t,T=x.useRef(null),E=Wh({value:a,onSave:i,validate:o,fieldId:u,activeFieldId:d,onActivate:p,enterToSave:!0,trimOnSave:!0});if(x.useEffect(()=>{if(E.isEditing){const C=window.setTimeout(()=>{var j;(j=T.current)==null||j.focus()},0);return()=>window.clearTimeout(C)}},[E.isEditing]),r==="create"){const C=D=>{m==null||m(D.target.value)},j=o==null?void 0:o(a);return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("input",{className:`${ze.editInput} ${j?ze.editInputInvalid:""}`,value:a,onChange:C,maxLength:y,placeholder:v,"aria-label":b,"data-testid":S?`${S}-input`:void 0}),j&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:j})]})}if(E.isEditing)return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("input",{ref:T,className:`${ze.editInput} ${E.error?ze.editInputInvalid:""}`,value:E.draft,onChange:C=>E.setDraft(C.target.value),onBlur:E.handleBlur,onKeyDown:E.handleKeyDown,maxLength:y,placeholder:v,"aria-label":b,"data-testid":S?`${S}-input`:void 0}),E.isDirty&&c.jsx("span",{className:ze.unsavedDot,title:"Unsaved changes"}),E.error&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:E.error}),c.jsx("span",{className:ze.editHint,children:"Enter to save · Esc to cancel"})]});const N=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:ze.metaValueClickable,onClick:()=>E.startEdit(),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),E.startEdit())},title:"Click to edit","aria-label":b,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:a?c.jsx("span",{children:a}):c.jsx("span",{className:ze.metaPlaceholder,children:v||"None"}),c.jsx("span",{className:ze.editButton,"aria-hidden":"true",children:"✏️"})]})}function Y6(t){const{value:a,onSave:i,validate:o,mode:r="edit",fieldId:u="textarea",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:y,"data-testid":b}=t,S=x.useRef(null),T=Wh({value:a,onSave:i,validate:o,fieldId:u,activeFieldId:d,onActivate:p,enterToSave:!1,trimOnSave:!1});if(x.useEffect(()=>{if(T.isEditing){const N=window.setTimeout(()=>{var C;(C=S.current)==null||C.focus()},0);return()=>window.clearTimeout(N)}},[T.isEditing]),r==="create"){const N=j=>{m==null||m(j.target.value)},C=o==null?void 0:o(a);return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("textarea",{className:`${ze.editTextarea} ${C?ze.editInputInvalid:""}`,value:a,onChange:N,placeholder:v,"aria-label":y,"data-testid":b?`${b}-input`:void 0}),C&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:C})]})}if(T.isEditing)return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("textarea",{ref:S,className:`${ze.editTextarea} ${T.error?ze.editInputInvalid:""}`,value:T.draft,onChange:N=>T.setDraft(N.target.value),onBlur:T.handleBlur,onKeyDown:T.handleKeyDown,title:y,"aria-label":y,"data-testid":b?`${b}-input`:void 0}),T.isDirty&&c.jsx("span",{className:ze.unsavedDot,title:"Unsaved changes"}),T.error&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:T.error}),c.jsx("span",{className:ze.editHint,children:"Tab to save · Esc to cancel"})]});const E=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:ze.metaValueClickable,onClick:()=>T.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),T.startEdit())},title:"Click to edit","aria-label":y,"data-testid":b?`${b}-button`:void 0,children:[E!==void 0?E:a?c.jsx("span",{children:a}):c.jsx("span",{className:ze.metaPlaceholder,children:v||"None"}),c.jsx("span",{className:ze.editButton,"aria-hidden":"true",children:"✏️"})]})}function D_(t){var D;const{value:a,onSave:i,mode:o="edit",options:r,fieldId:u="select",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:y,"data-testid":b}=t,S=x.useRef(null),T=Wh({value:a,onSave:i,fieldId:u,activeFieldId:d,onActivate:p,enterToSave:!1,trimOnSave:!1});x.useEffect(()=>{if(T.isEditing){const M=window.setTimeout(()=>{var w;(w=S.current)==null||w.focus()},0);return()=>window.clearTimeout(M)}},[T.isEditing]);const E=x.useCallback(M=>{const w=M.target.value;T.ignoreInitialBlurRef.current=!1,w!==a&&i(w),T.cancelEdit()},[a,i,T]),N=x.useCallback(M=>{if(T.ignoreInitialBlurRef.current){T.ignoreInitialBlurRef.current=!1;return}M.relatedTarget instanceof HTMLElement&&M.relatedTarget.dataset.editAction===u||T.cancelEdit()},[u,T]);if(o==="create")return c.jsx("select",{className:ze.editSelect,value:a,onChange:M=>m==null?void 0:m(M.target.value),"aria-label":y,"data-testid":b?`${b}-select`:void 0,children:r.map(M=>c.jsx("option",{value:M.value,children:M.label},M.value))});if(T.isEditing)return c.jsx("select",{ref:S,className:ze.editSelect,value:T.draft,onChange:E,onBlur:N,title:y,"aria-label":y,"data-testid":b?`${b}-select`:void 0,children:r.map(M=>c.jsx("option",{value:M.value,children:M.label},M.value))});const C=g==null?void 0:g(a),j=(D=r.find(M=>M.value===a))==null?void 0:D.label;return c.jsxs("button",{type:"button",className:ze.metaValueClickable,onClick:()=>T.startEdit(),title:"Click to change","aria-label":y,"data-testid":b?`${b}-button`:void 0,children:[C!==void 0?C:j?c.jsx("span",{children:j}):c.jsx("span",{className:ze.metaPlaceholder,children:v||"None"}),c.jsx("span",{className:ze.editButton,"aria-hidden":"true",children:"✏️"})]})}function Z6(t){const{checked:a,onChange:i,label:o,ariaLabel:r,"data-testid":u}=t;return c.jsxs("label",{className:ze.worktreeToggle,"data-testid":u,children:[c.jsx("input",{type:"checkbox",checked:a,onChange:d=>i(d.target.checked),"aria-label":r}),c.jsx("span",{children:o})]})}const X6="_envRow_1e1r5_1",Q6="_envDot_1e1r5_7",W6="_envDotGreen_1e1r5_14",J6="_envDotYellow_1e1r5_18",eI="_envDotRed_1e1r5_22",tI="_envDotGray_1e1r5_26",Vi={envRow:X6,envDot:Q6,envDotGreen:W6,envDotYellow:J6,envDotRed:eI,envDotGray:tI};function nI(t){const a=t.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Vi.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Vi.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Vi.envDotRed:Vi.envDotGray}function aI(t){const{value:a,onSave:i,environments:o,allowNone:r=!1,fieldId:u="environment",activeFieldId:d,onActivate:p,placeholder:m="No environment",ariaLabel:g="Environment","data-testid":v}=t,y=o.find(T=>T.id===a),b=[...r?[{value:"",label:"None"}]:[],...o.map(T=>({value:T.id,label:T.displayName}))],S=()=>{if(y)return c.jsxs("span",{className:Vi.envRow,children:[c.jsx("span",{className:`${Vi.envDot} ${nI(y.status)}`}),y.displayName]})};return c.jsx(D_,{value:a,onSave:i,options:b,fieldId:u,activeFieldId:d,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:g,"data-testid":v})}function Z0(t){if(!t)return"";const a=new Date(t);if(isNaN(a.getTime()))return"";const o=Date.now()-a.getTime();if(o<0)return"just now";const r=Math.floor(o/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const u=Math.floor(r/60);if(u<24)return`${u}h ago`;const d=Math.floor(u/24);return d<30?`${d}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const bf=100;function sI(){const{workspaceId:t,environmentId:a}=ss(),i=Dt(),{tasks:o,environments:r,workspaces:u,personas:d,sessions:p,archiveWorkspace:m,updateWorkspace:g,usageCache:v,loadUsage:y}=qe(),[b,S]=x.useState("tasks"),[T,E]=x.useState(!1),[N,C]=x.useState(null),[j,D]=x.useState(!1),M=x.useRef(void 0),w=u.find(F=>F.id===t),$=a??(w==null?void 0:w.environmentId)??"",V=OB(t,$,u,r);x.useEffect(()=>{const F=M.current;M.current=t,!(F===void 0||F===t)&&N!==null&&C(null)},[t,N]);const B=p.reduce((F,ne)=>F+(ne.costUsd??0),0);x.useEffect(()=>{t&&y("workspace",t)},[t,y,B]);const q=t?v[`workspace:${t}`]:void 0,X=o.filter(F=>F.workspaceId===t),ae=X.filter(F=>F.status==="complete").length,te=X.length,Q=te>0?Math.round(ae/te*100):0;return c.jsxs("div",{className:U.panelContainer,children:[c.jsx(Vs,{segments:V}),c.jsxs("div",{className:U.workspaceHeader,children:[c.jsx("span",{className:U.workspaceName,"data-testid":"workspace-name",children:c.jsx(un,{value:(w==null?void 0:w.name)||"",onSave:F=>{w&&g(w.id,{name:F})},validate:F=>{const ne=F.trim();if(!ne)return"Name is required";if(ne.length>bf)return`Max ${bf} characters`},maxLength:bf,fieldId:"name",activeFieldId:N,onActivate:C,ariaLabel:"Workspace name",renderDisplay:F=>F||t||void 0,"data-testid":"edit-name"})}),c.jsx("button",{className:U.archiveButton,onClick:()=>E(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),c.jsxs("button",{className:U.metaToggle,onClick:()=>D(!j),"aria-expanded":!j,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[c.jsx("span",{className:`${U.metaToggleArrow} ${j?"":U.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!j&&c.jsxs("div",{className:U.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[c.jsxs("div",{className:U.metaRow,children:[c.jsx("span",{className:U.metaLabel,children:"Description"}),c.jsx("div",{className:U.metaValue,children:c.jsx(Y6,{value:(w==null?void 0:w.description)||"",onSave:F=>{w&&g(w.id,{description:F})},fieldId:"description",activeFieldId:N,onActivate:C,renderDisplay:F=>F?c.jsx("span",{className:U.overviewMarkdown,children:c.jsx(th,{remarkPlugins:[nh],children:F})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),c.jsxs("div",{className:U.metaRow,children:[c.jsx("span",{className:U.metaLabel,children:"Repository"}),c.jsx("div",{className:U.metaValue,children:c.jsx(un,{value:(w==null?void 0:w.repoUrl)||"",onSave:F=>{w&&g(w.id,{repoUrl:F})},validate:F=>{const ne=F.trim();if(ne&&!/^https?:\/\/.+/.test(ne))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:N,onActivate:C,renderDisplay:F=>F&&/^https?:\/\//i.test(F)?c.jsx("a",{className:U.repoLink,href:F,target:"_blank",rel:"noopener noreferrer",onClick:ne=>ne.stopPropagation(),children:F}):F?c.jsx("span",{children:F}):void 0,placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),c.jsxs("div",{className:U.metaRow,children:[c.jsx("span",{className:U.metaLabel,children:"Environment"}),c.jsx("div",{className:U.metaValue,children:c.jsx(aI,{value:(w==null?void 0:w.environmentId)||"",onSave:F=>{w&&F&&g(w.id,{environmentId:F})},environments:r,fieldId:"environmentId",activeFieldId:N,onActivate:C,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),c.jsxs("div",{className:U.metaRow,children:[c.jsx("span",{className:U.metaLabel,children:"Persona"}),c.jsx("div",{className:U.metaValue,children:c.jsx(D_,{value:(w==null?void 0:w.defaultPersonaId)||"",onSave:F=>{w&&g(w.id,{defaultPersonaId:F})},options:[{value:"",label:"(Inherit)"},...d.map(F=>({value:F.id,label:F.name}))],fieldId:"defaultPersonaId",activeFieldId:N,onActivate:C,renderDisplay:F=>{const ne=d.find(I=>I.id===F);if(ne)return c.jsx("span",{children:ne.name})},placeholder:(w==null?void 0:w.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),c.jsxs("div",{className:U.metaRow,children:[c.jsx("span",{className:U.metaLabel,children:"Worktrees"}),c.jsx("div",{className:U.metaValue,children:c.jsx(Z6,{checked:(w==null?void 0:w.useWorktrees)??!0,onChange:F=>{w&&g(w.id,{useWorktrees:F})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),c.jsxs("div",{className:U.metaRow,children:[c.jsx("span",{className:U.metaLabel,children:"Working Dir"}),c.jsx("div",{className:U.metaValue,children:c.jsx(un,{value:(w==null?void 0:w.worktreeBasePath)||"",onSave:F=>{w&&g(w.id,{worktreeBasePath:F})},fieldId:"worktreeBasePath",activeFieldId:N,onActivate:C,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-worktree-base-path"})})]}),w&&c.jsxs("div",{className:U.metaTimestamps,children:[c.jsxs("span",{className:U.metaTimestamp,children:["Created ",Z0(w.createdAt)]}),w.updatedAt&&w.updatedAt!==w.createdAt&&c.jsxs("span",{className:U.metaTimestamp,children:["· Updated ",Z0(w.updatedAt)]})]})]}),te>0&&c.jsxs("div",{className:U.progressBarContainer,"data-testid":"progress-bar",children:[c.jsx("div",{className:U.progressBar,children:c.jsx("div",{className:U.progressFill,style:{width:`${Q}%`}})}),c.jsxs("span",{className:U.progressLabel,children:[ae,"/",te]})]}),q&&q.costUsd>0&&c.jsx("div",{className:U.progressBarContainer,children:c.jsxs("span",{className:U.progressLabel,children:["Usage: ",Ki(q.costUsd)," (",q.sessionCount," session",q.sessionCount!==1?"s":"",")"]})}),c.jsxs("div",{className:U.tabBar,role:"tablist","aria-label":"Workspace view",children:[c.jsx("button",{role:"tab","aria-selected":b==="graph",className:`${U.tab} ${b==="graph"?U.active:""}`,onClick:()=>S("graph"),children:"Graph"}),c.jsx("button",{role:"tab","aria-selected":b==="board",className:`${U.tab} ${b==="board"?U.active:""}`,onClick:()=>S("board"),"data-testid":"board-tab",children:"Board"}),c.jsx("button",{role:"tab","aria-selected":b==="tasks",className:`${U.tab} ${b==="tasks"?U.active:""}`,onClick:()=>S("tasks"),children:"Tasks"})]}),b==="tasks"&&te>0&&c.jsxs("div",{className:U.workspaceSummary,children:[c.jsx("span",{className:U.workspaceSummaryTitle,children:`${ae}/${te} tasks complete`}),c.jsx("span",{className:U.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),b==="tasks"&&te===0&&c.jsxs("div",{className:U.emptyCta,children:[c.jsx("button",{className:U.ctaButton,onClick:()=>i(Xi(t,void 0,$)),children:"Create Task"}),c.jsx("div",{className:U.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),b==="board"&&c.jsx(O6,{workspaceId:t,environmentId:$}),b==="graph"&&c.jsx(r6,{workspaceId:t,environmentId:$}),c.jsx(Oc,{isOpen:T,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{w&&(m(w.id),i("/",{replace:!0})),E(!1)},onCancel:()=>E(!1)})]})}const iI="_formContent_ymnez_1",oI="_section_ymnez_13",lI="_label_ymnez_19",rI="_titleInput_ymnez_26",cI="_descriptionTextarea_ymnez_58",uI="_selectField_ymnez_94",dI="_checkboxRow_ymnez_128",fI="_checkboxLabel_ymnez_141",hI="_fieldError_ymnez_146",st={formContent:iI,section:oI,label:lI,titleInput:rI,descriptionTextarea:cI,selectField:uI,checkboxRow:dI,checkboxLabel:fI,fieldError:hI};function pI(t,a){return{name:(t==null?void 0:t.name)??"",description:(t==null?void 0:t.description)??"",repoUrl:(t==null?void 0:t.repoUrl)??"",environmentId:(t==null?void 0:t.environmentId)??a??"",defaultPersonaId:(t==null?void 0:t.defaultPersonaId)??"",useWorktrees:(t==null?void 0:t.useWorktrees)??!0,worktreeBasePath:(t==null?void 0:t.worktreeBasePath)??""}}const mI=100;function gI({values:t,onChange:a,environments:i,personas:o,errors:r,disabled:u,autoFocusName:d}){const p=(m,g)=>{a({...t,[m]:g})};return c.jsxs("div",{className:st.formContent,children:[c.jsxs("div",{className:st.section,children:[c.jsx("label",{className:st.label,htmlFor:"ws-name",children:"Name"}),c.jsx("input",{id:"ws-name",className:st.titleInput,type:"text",value:t.name,onChange:m=>p("name",m.target.value),placeholder:"Workspace name",maxLength:mI,autoFocus:d,disabled:u,"data-testid":"workspace-form-name"}),(r==null?void 0:r.name)&&c.jsx("span",{className:st.fieldError,"data-testid":"workspace-form-error-name",children:r.name})]}),c.jsxs("div",{className:st.section,children:[c.jsx("label",{className:st.label,htmlFor:"ws-description",children:"Description"}),c.jsx("textarea",{id:"ws-description",className:st.descriptionTextarea,value:t.description,onChange:m=>p("description",m.target.value),placeholder:"Optional description (Markdown supported)",disabled:u,"data-testid":"workspace-form-description"})]}),c.jsxs("div",{className:st.section,children:[c.jsx("label",{className:st.label,htmlFor:"ws-repo",children:"Repository URL"}),c.jsx("input",{id:"ws-repo",className:st.titleInput,type:"text",value:t.repoUrl,onChange:m=>p("repoUrl",m.target.value),placeholder:"https://github.com/org/repo",disabled:u,"data-testid":"workspace-form-repo"}),(r==null?void 0:r.repoUrl)&&c.jsx("span",{className:st.fieldError,"data-testid":"workspace-form-error-repoUrl",children:r.repoUrl})]}),c.jsxs("div",{className:st.section,children:[c.jsx("label",{className:st.label,htmlFor:"ws-environment",children:"Environment"}),c.jsxs("select",{id:"ws-environment",className:st.selectField,value:t.environmentId,onChange:m=>p("environmentId",m.target.value),disabled:u,"data-testid":"workspace-form-environment",children:[c.jsx("option",{value:"",children:"Select environment…"}),i.map(m=>c.jsx("option",{value:m.id,children:m.displayName||m.id},m.id))]}),(r==null?void 0:r.environmentId)&&c.jsx("span",{className:st.fieldError,"data-testid":"workspace-form-error-environmentId",children:r.environmentId})]}),c.jsxs("div",{className:st.section,children:[c.jsx("label",{className:st.label,htmlFor:"ws-persona",children:"Default Persona"}),c.jsxs("select",{id:"ws-persona",className:st.selectField,value:t.defaultPersonaId,onChange:m=>p("defaultPersonaId",m.target.value),disabled:u,"data-testid":"workspace-form-persona",children:[c.jsx("option",{value:"",children:"(Inherit)"}),o.map(m=>c.jsx("option",{value:m.id,children:m.name},m.id))]})]}),c.jsx("div",{className:st.section,children:c.jsxs("label",{className:st.checkboxRow,children:[c.jsx("input",{type:"checkbox",checked:t.useWorktrees,onChange:m=>p("useWorktrees",m.target.checked),disabled:u,"data-testid":"workspace-form-worktrees"}),c.jsx("span",{className:st.checkboxLabel,children:"Enable worktree isolation"})]})}),c.jsxs("div",{className:st.section,children:[c.jsx("label",{className:st.label,htmlFor:"ws-workdir",children:"Working Directory"}),c.jsx("input",{id:"ws-workdir",className:st.titleInput,type:"text",value:t.worktreeBasePath,onChange:m=>p("worktreeBasePath",m.target.value),placeholder:"Default (server default)",disabled:u,"data-testid":"workspace-form-workdir"})]})]})}const vI="_container_cddyd_1",yI="_header_cddyd_8",bI="_headerTitle_cddyd_35",xI="_badge_cddyd_44",_I="_headerActions_cddyd_54",SI="_body_cddyd_61",TI="_formContent_cddyd_73",kI="_section_cddyd_85",CI="_label_cddyd_91",EI="_titleInput_cddyd_98",NI="_descriptionTextarea_cddyd_131",jI="_parentContext_cddyd_167",wI="_parentLabel_cddyd_175",AI="_parentName_cddyd_182",DI="_personaSelect_cddyd_186",MI="_depList_cddyd_220",RI="_depItem_cddyd_226",OI="_depItemSelected_cddyd_248",BI="_noDeps_cddyd_252",II="_btnPrimary_cddyd_258",LI="_btnGhost_cddyd_289",Ee={container:vI,header:yI,headerTitle:bI,badge:xI,headerActions:_I,body:SI,formContent:TI,section:kI,label:CI,titleInput:EI,descriptionTextarea:NI,parentContext:jI,parentLabel:wI,parentName:AI,personaSelect:DI,depList:MI,depItem:RI,depItemSelected:OI,noDeps:BI,btnPrimary:II,btnGhost:LI};function UI(t){const a={};return t.name.trim()||(a.name="Name is required"),t.repoUrl.trim()&&!/^https?:\/\/.+/i.test(t.repoUrl.trim())&&(a.repoUrl="Must be a valid http(s) URL"),t.environmentId||(a.environmentId="Environment is required"),Object.keys(a).length>0?a:void 0}const zI=[{label:"Home",url:Os},{label:"New Workspace",url:void 0}];function VI(){const[t]=uh(),a=t.get("environment")??void 0,{environments:i,personas:o,createWorkspace:r,workspaceCreating:u}=qe(),{showToast:d}=Us(),p=Dt(),[m,g]=x.useState(()=>{var N;return pI(void 0,a||((N=i[0])==null?void 0:N.id))}),[v,y]=x.useState(),[b,S]=x.useState();x.useEffect(()=>{a||m.environmentId||i.length===0||g(N=>{var C;return N.environmentId?N:{...N,environmentId:((C=i[0])==null?void 0:C.id)??""}})},[i,a,m.environmentId]);const T=()=>{const N=UI(m);if(N){y(N),S(void 0);return}y(void 0),S(void 0),r(m.name.trim(),m.description,m.repoUrl.trim(),m.environmentId,m.defaultPersonaId,m.useWorktrees,m.worktreeBasePath,()=>{d("Workspace created","success"),p(Os,{replace:!0})},C=>{S(C)})},E=()=>{p(a?Gi(a):Os,{replace:!0})};return c.jsxs("div",{className:Ee.container,children:[c.jsxs("div",{className:Ee.header,children:[c.jsx("div",{className:Ee.headerTitle,children:c.jsx(Vs,{segments:zI})}),c.jsxs("div",{className:Ee.headerActions,children:[c.jsx("button",{className:Ee.btnGhost,onClick:E,disabled:u,"data-testid":"workspace-create-cancel",children:"Cancel"}),c.jsx("button",{className:Ee.btnPrimary,onClick:T,disabled:u||!m.name.trim()||!m.environmentId,"data-testid":"workspace-create-save",children:u?c.jsx(C_,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),c.jsxs("div",{className:Ee.body,children:[c.jsx(gI,{values:m,onChange:N=>{g(N),y(void 0),S(void 0)},environments:i,personas:o,errors:v,disabled:u,autoFocusName:!0}),b&&c.jsx("div",{className:Ee.error,"data-testid":"workspace-create-submit-error",children:b})]})]})}function M_({mode:t,taskId:a,workspaceId:i,parentTaskId:o,environmentId:r}){const{tasks:u,workspaces:d,personas:p,createTask:m,updateTask:g}=qe(),{showToast:v}=Us(),y=Dt(),b=t==="edit",S=b&&a?u.find(fe=>fe.id===a):void 0,T=b?(S==null?void 0:S.workspaceId)??"":i??"",[E,N]=x.useState(T),C=T||E,j=d.find(fe=>fe.id===C),D=r??(j==null?void 0:j.environmentId),M=!b&&!i,w=b?(S==null?void 0:S.parentTaskId)??"":o??"",$=w?u.find(fe=>fe.id===w):void 0,[V,B]=x.useState((S==null?void 0:S.title)??""),[q,X]=x.useState((S==null?void 0:S.description)??""),[ae,te]=x.useState((S==null?void 0:S.dependsOn)??[]),[Q,F]=x.useState((S==null?void 0:S.defaultPersonaId)??""),[ne,I]=x.useState((S==null?void 0:S.canDecompose)??!1),[Y,oe]=x.useState(!1),P=x.useRef(!1);x.useEffect(()=>{b&&S&&!P.current&&(P.current=!0,B(S.title),X(S.description),te(S.dependsOn),F(S.defaultPersonaId),I(S.canDecompose))},[b,S]);const O=u.filter(fe=>fe.workspaceId===C&&(!b||fe.id!==a)&&fe.id!==w),ie=V.trim().length>0&&(!b||S!==void 0)&&C.length>0,be=fe=>{te(Mt=>Mt.includes(fe)?Mt.filter(mn=>mn!==fe):[...Mt,fe])},re=()=>{!ie||Y||b&&S===void 0||(b&&a?(g(a,V.trim(),q,ae,Q),v("Task updated","success"),y(_a(a,void 0,C,D),{replace:!0})):(oe(!0),m(C,V.trim(),q,ae.length>0?ae:void 0,w||void 0,Q,ne,()=>{v("Task created","success"),y(i?Hi(i,D):"/tasks",{replace:!0})},fe=>{v(fe,"error"),oe(!1)})))},Ke=()=>{y(b&&a?_a(a,void 0,C,D):i?Hi(i,D):"/tasks")},yt=b?"edit task":w?"child task":"new task";return c.jsxs("div",{className:Ee.container,children:[c.jsxs("div",{className:Ee.header,children:[c.jsxs("div",{className:Ee.headerTitle,children:[c.jsx("span",{className:Ee.badge,children:yt}),$&&c.jsxs("span",{className:Ee.parentContext,children:[c.jsx("span",{className:Ee.parentLabel,children:"Child of"}),c.jsx("span",{className:Ee.parentName,children:$.title})]})]}),c.jsxs("div",{className:Ee.headerActions,children:[c.jsx("button",{onClick:re,disabled:!ie||Y,className:Ee.btnPrimary,"data-testid":"task-edit-save",children:Y?"Creating…":b?"Save Changes":"Create"}),c.jsx("button",{onClick:Ke,className:Ee.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:Ee.body,children:c.jsxs("div",{className:Ee.formContent,children:[M&&c.jsxs("div",{className:Ee.section,children:[c.jsx("label",{className:Ee.label,htmlFor:"task-edit-workspace",children:"Workspace"}),c.jsxs("select",{id:"task-edit-workspace",value:E,onChange:fe=>N(fe.target.value),className:Ee.personaSelect,"data-testid":"task-edit-workspace",children:[c.jsx("option",{value:"",children:"Select a workspace..."}),d.map(fe=>c.jsx("option",{value:fe.id,children:fe.name},fe.id))]})]}),c.jsxs("div",{className:Ee.section,children:[c.jsx("label",{className:Ee.label,htmlFor:"task-edit-title",children:"Title"}),c.jsx("input",{id:"task-edit-title",type:"text",value:V,onChange:fe=>B(fe.target.value),placeholder:"Task title...",autoFocus:!0,className:Ee.titleInput,"data-testid":"task-edit-title",onKeyDown:fe=>{fe.key==="Enter"&&ie&&re()}})]}),c.jsxs("div",{className:Ee.section,children:[c.jsx("label",{className:Ee.label,htmlFor:"task-edit-description",children:"Description"}),c.jsx("textarea",{id:"task-edit-description",value:q,onChange:fe=>X(fe.target.value),placeholder:"Describe the task... (markdown supported)",className:Ee.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),c.jsxs("div",{className:Ee.section,children:[c.jsx("label",{className:Ee.label,htmlFor:"task-edit-persona",children:"Default Persona"}),c.jsxs("select",{id:"task-edit-persona",value:Q,onChange:fe=>F(fe.target.value),className:Ee.personaSelect,"data-testid":"task-edit-persona",children:[c.jsx("option",{value:"",children:"(Inherit)"}),p.map(fe=>c.jsx("option",{value:fe.id,children:fe.name},fe.id))]})]}),!b&&c.jsx("div",{className:Ee.section,children:c.jsxs("label",{className:Ee.depItem,"data-testid":"task-edit-can-decompose",children:[c.jsx("input",{type:"checkbox",checked:ne,onChange:fe=>I(fe.target.checked)}),"Can spawn subtasks"]})}),c.jsxs("div",{className:Ee.section,children:[c.jsx("div",{className:Ee.label,children:"Dependencies"}),O.length===0?c.jsx("div",{className:Ee.noDeps,children:"No other tasks in this workspace"}):c.jsx("div",{className:Ee.depList,children:O.map(fe=>{const Mt=ae.includes(fe.id);return c.jsxs("label",{className:`${Ee.depItem} ${Mt?Ee.depItemSelected:""}`,"data-testid":`dep-option-${fe.id}`,children:[c.jsx("input",{type:"checkbox",checked:Mt,onChange:()=>be(fe.id)}),fe.title,c.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",fe.status,")"]})]},fe.id)})})]})]})})]})}function X0(){const{workspaceId:t,environmentId:a}=ss(),[i]=uh(),o=t??i.get("workspace")??"",r=i.get("parent")??void 0;return c.jsx(M_,{mode:"new",workspaceId:o,parentTaskId:r,environmentId:a})}function Q0(){const{taskId:t,workspaceId:a,environmentId:i}=ss();return c.jsx(M_,{mode:"edit",taskId:t,workspaceId:a,environmentId:i})}const HI="_container_1pqxm_1",PI="_emptyState_1pqxm_8",GI="_card_1pqxm_14",$I="_cardHeader_1pqxm_34",FI="_categoryBadge_1pqxm_46",qI="_findingTitle_1pqxm_54",KI="_findingDate_1pqxm_60",YI="_findingContent_1pqxm_72",ZI="_tags_1pqxm_78",XI="_tag_1pqxm_78",Gn={container:HI,emptyState:PI,card:GI,cardHeader:$I,categoryBadge:FI,findingTitle:qI,findingDate:KI,findingContent:YI,tags:ZI,tag:XI};function QI(t){const a=new Date(t),i=new Date,o=i.getTime()-a.getTime(),r=Math.floor(o/1e3),u=Math.floor(r/60),d=Math.floor(u/60),p=Math.floor(d/24);if(r<60)return"just now";if(u<60)return`${u}m ago`;if(d<24)return`${d}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const m=a.getFullYear()===i.getFullYear(),g=a.toLocaleString("en-US",{month:"short"}),v=a.getDate();return m?`${g} ${v}`:`${g} ${v} ${a.getFullYear()}`}const W0={architecture:{text:"var(--accent-blue)",bg:"var(--accent-blue-dim)"},api:{text:"var(--accent-green)",bg:"var(--accent-green-dim)"},bug:{text:"var(--accent-red)",bg:"var(--accent-red-dim)"},decision:{text:"var(--accent-yellow)",bg:"var(--accent-yellow-dim)"},dependency:{text:"var(--accent-purple)",bg:"var(--accent-purple-dim)"},pattern:{text:"var(--accent-cyan)",bg:"var(--accent-cyan-dim)"},general:{text:"var(--text-secondary)",bg:"var(--bg-elevated)"}};function WI({workspaceId:t}){const{findings:a}=qe(),i=a.filter(o=>o.workspaceId===t);return i.length===0?c.jsx("div",{className:Gn.emptyState,children:"No findings yet. Agents will post discoveries here."}):c.jsx("div",{className:Gn.container,children:i.map((o,r)=>{const u=W0[o.category]||W0.general;return c.jsxs(Ct.div,{className:Gn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},children:[c.jsxs("div",{className:Gn.cardHeader,children:[c.jsx("span",{className:Gn.categoryBadge,style:{background:u.bg,color:u.text},children:o.category}),c.jsx("span",{className:Gn.findingTitle,children:o.title}),c.jsx("span",{className:Gn.findingDate,title:o.createdAt,children:QI(o.createdAt)})]}),c.jsx("div",{className:Gn.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&c.jsx("div",{className:Gn.tags,children:o.tags.map(d=>c.jsx("span",{className:Gn.tag,style:{color:u.text,textShadow:`0 0 8px ${u.text}`},children:d},d))})]},o.id)})})}function tc(t){if(!t)return"—";const a=new Date(t);return isNaN(a.getTime())?"—":a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function xf(t,a){if(!t||!a)return;const i=new Date(a).getTime()-new Date(t).getTime();if(isNaN(i)||i<0)return;const o=Math.floor(i/6e4),r=Math.floor(i%6e4/1e3);if(o===0)return`${r}s`;const u=Math.floor(o/60),d=o%60;return u===0?`${o}m ${r}s`:`${u}h ${d}m`}function J0(t){const a=t.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?U.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?U.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?U.envDotRed:U.envDotGray}function JI({status:t}){const a=as(t),i=w2(t);return c.jsx("span",{className:`${U.statusBadge} ${U[i]??U.statusPending}`,children:a.label})}function e4({task:t,tasksById:a,environments:i,workspaces:o,taskSessions:r,selectedEnvId:u}){const{loadUsage:d,usageCache:p}=qe(),m=r.reduce((D,M)=>D+(M.costUsd??0),0);x.useEffect(()=>{d("task",t.id),t.childTaskIds.length>0&&d("task_tree",t.id)},[t.id,t.childTaskIds.length,d,m]);const g=`task:${t.id}`,v=g in p?p[g]:void 0,y=`task_tree:${t.id}`,b=t.childTaskIds.length>0&&y in p?p[y]:void 0,S=r.length>0?r[r.length-1]:void 0,T=(S==null?void 0:S.environmentId)??"",E=T?i.find(D=>D.id===T):void 0,N=o.find(D=>D.id===t.workspaceId),C=i.find(D=>D.id===u),j=t.branch&&(N!=null&&N.repoUrl)?`${N.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(t.branch)}`:void 0;return c.jsxs("div",{className:U.overviewDashboard,children:[c.jsxs("div",{className:U.overviewHero,children:[c.jsx(JI,{status:t.status}),t.branch&&c.jsx("span",{className:U.overviewBranchPill,children:j?c.jsxs("a",{href:j,target:"_blank",rel:"noreferrer noopener",className:U.branchLink,children:["🔗"," ",t.branch]}):c.jsxs("span",{children:["🔗"," ",t.branch]})})]}),typeof t.description=="string"&&t.description&&c.jsxs("div",{className:U.overviewSection,children:[c.jsx("div",{className:U.overviewLabel,children:"Description"}),c.jsx("div",{className:U.overviewMarkdown,children:c.jsx(th,{remarkPlugins:[nh],children:t.description})})]}),c.jsxs("div",{className:U.overviewSection,children:[c.jsx("div",{className:U.overviewLabel,children:"Environment"}),T&&E?c.jsxs("div",{className:U.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${U.envDot} ${J0(E.status)}`,title:E.status,"aria-label":`Status: ${E.status}`,role:"img"}),c.jsx("span",{className:U.overviewValue,children:E.displayName})]}):C?c.jsxs("div",{className:U.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${U.envDot} ${J0(C.status)}`,title:C.status,"aria-label":`Status: ${C.status}`,role:"img"}),c.jsx("span",{className:U.overviewValue,children:C.displayName}),c.jsx("span",{className:U.overviewMuted,children:"(workspace default)"})]}):c.jsx("div",{className:U.overviewMuted,children:"Set in workspace settings"})]}),c.jsxs("div",{className:U.overviewSection,children:[c.jsx("div",{className:U.overviewLabel,children:"Dependencies"}),t.dependsOn.length===0?c.jsx("div",{className:U.overviewMuted,children:"None"}):c.jsx("div",{className:U.depList,children:t.dependsOn.map(D=>{const M=a.get(D),w=(M==null?void 0:M.status)==="complete";return c.jsxs("div",{className:`${U.depItem} ${w?U.depDone:U.depBlocked}`,children:[c.jsx("span",{children:w?"✓":"○"}),c.jsx("span",{children:(M==null?void 0:M.title)??D})]},D)})})]}),c.jsxs("div",{className:U.overviewSection,children:[c.jsx("div",{className:U.overviewLabel,children:"Timeline"}),c.jsxs("div",{className:U.timeline,children:[t.createdAt&&c.jsxs("div",{className:U.timelineRow,children:[c.jsx("span",{className:U.timelineKey,children:"Created"}),c.jsx("span",{className:U.timelineValue,children:tc(t.createdAt)})]}),t.assignedAt&&(()=>{const D=xf(t.createdAt,t.assignedAt);return c.jsxs("div",{className:U.timelineRow,children:[c.jsx("span",{className:U.timelineKey,children:"Assigned"}),c.jsx("span",{className:U.timelineValue,children:tc(t.assignedAt)}),D!==void 0&&c.jsx("span",{className:U.timelineDelta,children:D})]})})(),t.startedAt&&(()=>{const D=xf(t.assignedAt??t.createdAt,t.startedAt);return c.jsxs("div",{className:U.timelineRow,children:[c.jsx("span",{className:U.timelineKey,children:"Started"}),c.jsx("span",{className:U.timelineValue,children:tc(t.startedAt)}),D!==void 0&&c.jsx("span",{className:U.timelineDelta,children:D})]})})(),t.completedAt&&(()=>{const D=xf(t.startedAt,t.completedAt);return c.jsxs("div",{className:U.timelineRow,children:[c.jsx("span",{className:U.timelineKey,children:"Completed"}),c.jsx("span",{className:U.timelineValue,children:tc(t.completedAt)}),D!==void 0&&c.jsx("span",{className:U.timelineDelta,children:D})]})})(),!t.createdAt&&!t.assignedAt&&!t.startedAt&&!t.completedAt&&c.jsx("div",{className:U.overviewMuted,children:"No timing data"})]})]}),v&&v.costUsd>0&&c.jsxs("div",{className:U.overviewSection,children:[c.jsx("div",{className:U.overviewLabel,children:"Usage"}),c.jsxs("div",{className:U.timeline,children:[c.jsxs("div",{className:U.timelineRow,children:[c.jsx("span",{className:U.timelineKey,children:"Cost"}),c.jsx("span",{className:U.timelineValue,children:Ki(v.costUsd)}),c.jsxs("span",{className:U.timelineDelta,children:[v.sessionCount," session",v.sessionCount!==1?"s":""]})]}),b&&b.costUsd>v.costUsd&&c.jsxs("div",{className:U.timelineRow,children:[c.jsx("span",{className:U.timelineKey,children:"Total (incl. subtasks)"}),c.jsx("span",{className:U.timelineValue,children:Ki(b.costUsd)}),c.jsxs("span",{className:U.timelineDelta,children:[b.sessionCount," session",b.sessionCount!==1?"s":""]})]})]})]}),t.reviewNotes&&c.jsxs("div",{className:U.overviewSection,children:[c.jsx("div",{className:U.overviewLabel,children:"Review Notes"}),c.jsx("div",{className:U.reviewNotes,children:t.reviewNotes})]})]})}function t4({task:t,sessionId:a,isBlocked:i,onStart:o,onResume:r,onStop:u,onPause:d,onDelete:p,onEdit:m}){if(t.status==="not_started")return i?c.jsxs("div",{className:U.headerActions,children:[c.jsx("button",{onClick:m,className:U.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:U.btnDanger,children:"Delete"})]}):c.jsxs("div",{className:U.headerActions,children:[c.jsx("button",{onClick:o,className:U.btnPrimary,children:"Start"}),c.jsx("button",{onClick:m,className:U.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:U.btnDanger,children:"Delete"})]});if(t.status==="working")return c.jsxs("div",{className:U.headerActions,children:[c.jsx("button",{onClick:u,className:U.btnDanger,children:"Stop"}),c.jsx("button",{onClick:d,disabled:!a,className:U.btnGhost,children:"Pause"})]});if(t.status==="paused")return c.jsxs("div",{className:U.headerActions,children:[c.jsx("button",{onClick:u,className:U.btnPrimary,children:"Stop"}),c.jsx("button",{onClick:r,className:U.btnGhost,children:"Resume"}),c.jsx("button",{onClick:p,className:U.btnDanger,children:"Delete"})]});if(t.status==="complete")return c.jsx("div",{className:U.headerActions,children:c.jsx("button",{onClick:p,className:U.btnDanger,children:"Delete"})});if(t.status==="failed")return c.jsxs("div",{className:U.headerActions,children:[c.jsx("button",{onClick:o,className:U.btnPrimary,children:"Retry"}),c.jsx("button",{onClick:p,className:U.btnDanger,children:"Delete"})]})}function n4({taskSessions:t,selectedSessionId:a,onSelect:i}){if(!(t.length<2))return c.jsxs("div",{className:U.attemptSelector,"data-testid":"attempt-selector",children:[c.jsx("span",{className:U.attemptLabel,children:"Attempts:"}),t.map((o,r)=>{const u=o.id===a,d=o.status==="completed"?"✓":o.status==="failed"?"✗":o.status==="running"||o.status==="idle"?"●":"";return c.jsxs("button",{className:`${U.attemptButton} ${u?U.attemptActive:""}`,onClick:()=>i(o.id),title:`Attempt #${r+1} — ${o.status}`,"aria-label":`Attempt #${r+1}, ${o.status}`,"aria-pressed":u,"data-testid":`attempt-${r+1}`,children:["#",r+1,d&&c.jsx("span",{className:U.attemptStatus,children:d})]},o.id)})]})}function Ri(){const{taskId:t,workspaceId:a,environmentId:i}=ss(),o=jt(),r=Dt(),{events:u,eventsDropped:d,tasks:p,sessions:m,environments:g,loadSessionEvents:v,loadFindings:y,kill:b,startTask:S,stopTask:T,resumeTask:E,deleteTask:N,workspaces:C,taskSessions:j,loadTaskSessions:D}=qe(),M=x.useRef(void 0),w=x.useRef(void 0),$=x.useRef(void 0),V=x.useRef(void 0),B=x.useRef(void 0),q=o.pathname.endsWith("/stream")?"stream":o.pathname.endsWith("/findings")?"findings":"overview",[X,ae]=x.useState(q),[te,Q]=x.useState(!1),[F,ne]=x.useState(void 0),[I,Y]=x.useState(""),oe=x.useRef(q);q!==oe.current&&(oe.current=q,q!==X&&ae(q));const P=p.find(Te=>Te.id===t),O=(P==null?void 0:P.workspaceId)||void 0,ie=C.find(Te=>Te.id===O);x.useEffect(()=>{if(I===""){if(ie!=null&&ie.environmentId)Y(ie.environmentId);else if(g.length>0){const Te=g.find(pt=>pt.status==="connected");Y((Te==null?void 0:Te.id)??g[0].id)}}},[I,ie==null?void 0:ie.environmentId,g]);const be=P?j[P.id]??[]:[];let re;F&&be.some(Te=>Te.id===F)?re=F:re=(P==null?void 0:P.latestSessionId)||void 0;const Ke=()=>{Q(!0)},yt=()=>{if(!P)return;N(P.id),Q(!1);const Te=i??(ie==null?void 0:ie.environmentId);r(P.workspaceId&&Te?Hi(P.workspaceId,Te):"/",{replace:!0})};if((P==null?void 0:P.id)!==w.current&&(w.current=P==null?void 0:P.id,F!==void 0&&ne(void 0),I!==""&&Y("")),x.useEffect(()=>{if(!(P!=null&&P.id))return;const Te=P.id!==V.current,pt=P.latestSessionId!==B.current;(Te||pt)&&(V.current=P.id,B.current=P.latestSessionId,D(P.id))},[P==null?void 0:P.id,P==null?void 0:P.latestSessionId,D]),(P==null?void 0:P.status)!==$.current){const Te=$.current===void 0;$.current=P==null?void 0:P.status;const pt=(P==null?void 0:P.status)==="not_started"?"overview":(P==null?void 0:P.status)==="working"||(P==null?void 0:P.status)==="paused"?"stream":(P==null?void 0:P.status)==="complete"?"findings":void 0;pt&&pt!==X&&!(Te&&q!=="overview")&&ae(pt)}const fe=x.useMemo(()=>new Map(p.map(Te=>[Te.id,Te])),[p]),Mt=x.useMemo(()=>{const Te=re?u.filter(pt=>pt.sessionId===re):[];return Qh(Xh(Te))},[u,re]),mn=P?P.dependsOn.some(Te=>{const pt=fe.get(Te);return pt!==void 0&&pt.status!=="complete"}):!1,Mn=x.useMemo(()=>BB(t,i,C,g,fe),[t,i,C,g,fe]);x.useEffect(()=>{re&&re!==M.current&&(M.current=re,v(re))},[re,v]),x.useEffect(()=>{X==="findings"&&O&&y(O)},[X,O,y]);const Ln=Te=>{ae(Te),r(_a(t,Te==="overview"?void 0:Te,a,i))};return c.jsxs("div",{className:U.panelContainer,children:[c.jsx(Vs,{segments:Mn}),c.jsxs("div",{className:U.header,children:[c.jsxs("span",{className:U.headerTitle,children:[c.jsx("span",{"data-testid":"task-title",children:(P==null?void 0:P.title)||t}),P&&c.jsx("span",{className:U.taskStatusBadge,"data-testid":"task-status",children:P.status}),(P==null?void 0:P.branch)&&c.jsx("span",{className:U.taskBranch,children:P.branch}),mn&&c.jsx("span",{className:U.taskBlockedBadge,children:"blocked"})]}),P&&c.jsx(t4,{task:P,sessionId:re,isBlocked:mn,onStart:()=>S(P.id,void 0,I),onResume:()=>E(P.id),onStop:()=>T(P.id),onPause:()=>re&&b(re),onDelete:Ke,onEdit:()=>r(sC(P.id,a,i))})]}),c.jsxs("div",{className:U.tabBar,role:"tablist","aria-label":"Task view",children:[c.jsx("button",{role:"tab","aria-selected":X==="overview",className:`${U.tab} ${X==="overview"?U.active:""}`,onClick:()=>Ln("overview"),children:"Overview"}),c.jsx("button",{role:"tab","aria-selected":X==="stream",className:`${U.tab} ${X==="stream"?U.active:""}`,onClick:()=>Ln("stream"),children:"Stream"}),c.jsx("button",{role:"tab","aria-selected":X==="findings",className:`${U.tab} ${X==="findings"?U.active:""}`,onClick:()=>Ln("findings"),children:"Findings"})]}),c.jsxs(Qn,{mode:"wait",children:[X==="overview"&&c.jsx(Ct.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:U.overviewContent,"data-testid":"task-overview",children:P?c.jsx(e4,{task:P,tasksById:fe,environments:g,workspaces:C,taskSessions:be,selectedEnvId:I}):c.jsx("div",{className:U.waitingMessage,children:"No additional details"})},"overview"),X==="stream"&&c.jsxs(Ct.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[c.jsx(n4,{taskSessions:be,selectedSessionId:re,onSelect:Te=>ne(Te)}),c.jsx(Zh,{events:Mt,eventsDropped:d,emptyState:!re&&P?c.jsxs("div",{className:U.emptyCta,children:[c.jsx("button",{className:U.ctaButton,onClick:()=>S(P.id,void 0,I),children:"Start Task"}),c.jsx("div",{className:U.ctaDescription,children:"Click to begin agent execution"})]}):re&&Mt.length===0?c.jsx("div",{className:U.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),X==="findings"&&c.jsx(Ct.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:U.tabContent,children:O?c.jsx(WI,{workspaceId:O}):c.jsx("div",{className:U.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!P||P.status!=="working"&&P.status!=="paused")return;const Te=re?m.find(pt=>pt.id===re):void 0;if(!(!Te||["completed","failed","interrupted","hibernating"].includes(Te.status)))return c.jsx(xl,{mode:"send",sessionId:Te.id,environmentId:Te.environmentId})})(),P&&c.jsx(Oc,{isOpen:te,title:"Delete Task?",description:`"${P.title}" will be permanently removed.`,onConfirm:yt,onCancel:()=>Q(!1)})]})}const a4="_container_legrg_1",s4="_header_legrg_8",i4="_headerTitle_legrg_35",o4="_badge_legrg_44",l4="_headerActions_legrg_54",r4="_body_legrg_61",c4="_formContent_legrg_73",u4="_section_legrg_85",d4="_label_legrg_91",f4="_nameInput_legrg_98",h4="_fieldInput_legrg_131",p4="_adapterSelect_legrg_164",m4="_readOnlyValue_legrg_198",g4="_codespaceSection_legrg_204",v4="_codespaceActions_legrg_210",y4="_creatingHint_legrg_216",b4="_errorHint_legrg_222",x4="_btnPrimary_legrg_235",_4="_btnGhost_legrg_266",se={container:a4,header:s4,headerTitle:i4,badge:o4,headerActions:l4,body:r4,formContent:c4,section:u4,label:d4,nameInput:f4,fieldInput:h4,adapterSelect:p4,readOnlyValue:m4,codespaceSection:g4,codespaceActions:v4,creatingHint:y4,errorHint:b4,btnPrimary:x4,btnGhost:_4},rc=1,cc=65535;function _f(t){if(!t.trim())return!0;const a=Number(t);return Number.isInteger(a)&&a>=rc&&a<=cc}function Sf(t){try{const a=JSON.parse(t);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function S4({codespaceName:t,onCodespaceNameChange:a,envName:i,onEnvNameChange:o}){const{codespaces:r,codespaceError:u,codespaceListError:d,codespaceCreating:p,createCodespace:m}=qe(),[g,v]=x.useState("pick"),[y,b]=x.useState(""),[S,T]=x.useState("");return g==="create"?c.jsxs("div",{className:se.codespaceSection,children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Repository"}),c.jsx("input",{type:"text",value:y,onChange:E=>b(E.target.value),placeholder:"owner/repo",className:se.fieldInput,"data-testid":"env-codespace-repo"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Machine Type"}),c.jsx("input",{type:"text",value:S,onChange:E=>T(E.target.value),placeholder:"Machine type (optional)...",className:se.fieldInput,"data-testid":"env-codespace-machine"})]}),c.jsxs("div",{className:se.codespaceActions,children:[c.jsx("button",{onClick:()=>{y.trim()&&(m(y.trim(),S.trim()||void 0),v("pick"),b(""),T(""))},disabled:!y.trim(),className:se.btnPrimary,children:"Create"}),c.jsx("button",{onClick:()=>{v("pick"),b(""),T("")},className:se.btnGhost,children:"Cancel"})]})]}):c.jsx("div",{className:se.codespaceSection,children:c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Codespace"}),!d&&c.jsxs("select",{value:t,onChange:E=>{E.target.value==="__create__"?(v("create"),a("")):(a(E.target.value),E.target.value&&!i.trim()&&o(E.target.value))},disabled:p,className:se.adapterSelect,"data-testid":"env-codespace-select",children:[c.jsx("option",{value:"",children:"Select a codespace..."}),r.map(E=>c.jsxs("option",{value:E.name,children:[E.name," (",E.repository,") — ",E.state]},E.name)),c.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&c.jsx("span",{className:se.creatingHint,children:"Creating codespace..."}),d&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:se.errorHint,children:d}),c.jsx("input",{type:"text",value:t,onChange:E=>a(E.target.value),placeholder:"Or enter codespace name manually...",className:se.fieldInput,"data-testid":"env-codespace-manual"})]}),u&&!d&&c.jsx("span",{className:se.errorHint,children:u})]})})}function R_({mode:t,environmentId:a}){const{environments:i,addEnvironment:o,updateEnvironment:r,listCodespaces:u}=qe(),{showToast:d}=Us(),p=Dt(),m=t==="edit",g=m&&a?i.find(O=>O.id===a):void 0,[v,y]=x.useState(""),[b,S]=x.useState("local"),[T,E]=x.useState(""),[N,C]=x.useState(""),[j,D]=x.useState(""),[M,w]=x.useState(""),[$,V]=x.useState(""),[B,q]=x.useState(""),[X,ae]=x.useState(""),[te,Q]=x.useState(null),F=x.useCallback(()=>{const O={};if(b==="local"){if(T.trim()&&(O.host=T.trim()),N.trim()){const ie=Number(N);Number.isInteger(ie)&&(O.port=ie)}}else if(b==="ssh"){if(O.host=T.trim(),j.trim()&&(O.user=j.trim()),N.trim()){const ie=Number(N);Number.isInteger(ie)&&(O.sshPort=ie)}M.trim()&&(O.identityFile=M.trim())}else b==="docker"?($.trim()&&(O.image=$.trim()),B.trim()&&(O.repo=B.trim())):b==="codespace"&&(O.codespaceName=X.trim());return O},[b,T,N,j,M,$,B,X]),ne=()=>!(!v.trim()||b==="ssh"&&!T.trim()||b==="codespace"&&!X.trim()||(b==="local"||b==="ssh")&&!_f(N)),I=()=>{ne()&&(o(v.trim(),b,F()),d("Environment added successfully","success"),p(Pi,{replace:!0}))},Y=()=>{p(a?Gi(a):Pi)},oe=x.useCallback((O,ie)=>{if(!g||!a)return;const be=Sf(g.adapterConfig),re=ie.trim();re?be[O]=re:delete be[O],r(a,{adapterConfig:be})},[g,a,r]),P=x.useCallback((O,ie)=>{if(!g||!a)return;const be=Sf(g.adapterConfig);if(ie.trim()){const re=Number(ie);Number.isInteger(re)&&re>=rc&&re<=cc&&(be[O]=re)}else delete be[O];r(a,{adapterConfig:be})},[g,a,r]);if(m){if(!g)return c.jsxs("div",{className:se.container,children:[c.jsxs("div",{className:se.header,children:[c.jsx("div",{className:se.headerTitle,children:c.jsx("span",{className:se.badge,children:"edit environment"})}),c.jsx("div",{className:se.headerActions,children:c.jsx("button",{onClick:Y,className:se.btnGhost,children:"Back"})})]}),c.jsx("div",{className:se.body,children:c.jsx("div",{className:se.formContent,children:c.jsx("span",{className:se.readOnlyValue,children:"Environment not found"})})})]});const O=Sf(g.adapterConfig);return c.jsxs("div",{className:se.container,"data-testid":"env-edit-panel",children:[c.jsxs("div",{className:se.header,children:[c.jsx("div",{className:se.headerTitle,children:c.jsx("span",{className:se.badge,children:"edit environment"})}),c.jsx("div",{className:se.headerActions,children:c.jsx("button",{onClick:Y,className:se.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),c.jsx("div",{className:se.body,children:c.jsxs("div",{className:se.formContent,children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Name"}),c.jsx(un,{value:g.displayName,onSave:ie=>{a&&r(a,{displayName:ie})},validate:ie=>ie.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:te,onActivate:Q,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Adapter Type"}),c.jsx("span",{className:se.readOnlyValue,"data-testid":"env-edit-adapter-type",children:g.adapterType})]}),g.adapterType==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Host"}),c.jsx(un,{value:String(O.host??""),onSave:ie=>oe("host",ie),mode:"edit",fieldId:"host",activeFieldId:te,onActivate:Q,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Port"}),c.jsx(un,{value:String(O.port??""),onSave:ie=>P("port",ie),validate:ie=>_f(ie)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:te,onActivate:Q,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),g.adapterType==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Host"}),c.jsx(un,{value:String(O.host??""),onSave:ie=>oe("host",ie),validate:ie=>ie.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:te,onActivate:Q,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"User"}),c.jsx(un,{value:String(O.user??""),onSave:ie=>oe("user",ie),mode:"edit",fieldId:"user",activeFieldId:te,onActivate:Q,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"SSH Port"}),c.jsx(un,{value:String(O.sshPort??""),onSave:ie=>P("sshPort",ie),validate:ie=>_f(ie)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:te,onActivate:Q,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Identity File"}),c.jsx(un,{value:String(O.identityFile??""),onSave:ie=>oe("identityFile",ie),mode:"edit",fieldId:"identityFile",activeFieldId:te,onActivate:Q,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),g.adapterType==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Image"}),c.jsx(un,{value:String(O.image??""),onSave:ie=>oe("image",ie),mode:"edit",fieldId:"image",activeFieldId:te,onActivate:Q,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Repo"}),c.jsx(un,{value:String(O.repo??""),onSave:ie=>oe("repo",ie),mode:"edit",fieldId:"repo",activeFieldId:te,onActivate:Q,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),g.adapterType==="codespace"&&c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Codespace Name"}),c.jsx(un,{value:String(O.codespaceName??""),onSave:ie=>oe("codespaceName",ie),validate:ie=>ie.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:te,onActivate:Q,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return c.jsxs("div",{className:se.container,"data-testid":"env-create-panel",children:[c.jsxs("div",{className:se.header,children:[c.jsx("div",{className:se.headerTitle,children:c.jsx("span",{className:se.badge,children:"new environment"})}),c.jsxs("div",{className:se.headerActions,children:[c.jsx("button",{onClick:I,disabled:!ne(),className:se.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),c.jsx("button",{onClick:Y,className:se.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:se.body,children:c.jsxs("div",{className:se.formContent,children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-name",children:"Name"}),c.jsx("input",{id:"env-create-name",type:"text",value:v,onChange:O=>y(O.target.value),placeholder:"Environment name...",autoFocus:!0,className:se.nameInput,"data-testid":"env-create-name",onKeyDown:O=>{O.key==="Enter"&&ne()&&I()}})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),c.jsxs("select",{id:"env-create-adapter",value:b,onChange:O=>{S(O.target.value),O.target.value==="codespace"&&u()},className:se.adapterSelect,"data-testid":"env-create-adapter",children:[c.jsx("option",{value:"local",children:"local"}),c.jsx("option",{value:"ssh",children:"ssh"}),c.jsx("option",{value:"docker",children:"docker"}),c.jsx("option",{value:"codespace",children:"codespace"})]})]}),b==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:T,onChange:O=>E(O.target.value),placeholder:"Host (optional)...",className:se.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-port",children:"Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:rc,max:cc,value:N,onChange:O=>C(O.target.value),placeholder:"Port (optional)...",className:se.fieldInput,"data-testid":"env-create-port"})]})]}),b==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:T,onChange:O=>E(O.target.value),placeholder:"Host (required)...",className:se.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-user",children:"User"}),c.jsx("input",{id:"env-create-user",type:"text",value:j,onChange:O=>D(O.target.value),placeholder:"User (optional)...",className:se.fieldInput,"data-testid":"env-create-user"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-port",children:"SSH Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:rc,max:cc,value:N,onChange:O=>C(O.target.value),placeholder:"SSH port (optional)...",className:se.fieldInput,"data-testid":"env-create-port"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-identity",children:"Identity File"}),c.jsx("input",{id:"env-create-identity",type:"text",value:M,onChange:O=>w(O.target.value),placeholder:"Identity file (optional)...",className:se.fieldInput,"data-testid":"env-create-identity"})]})]}),b==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-image",children:"Image"}),c.jsx("input",{id:"env-create-image",type:"text",value:$,onChange:O=>V(O.target.value),placeholder:"Image (optional)...",className:se.fieldInput,"data-testid":"env-create-image"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-repo",children:"Repo"}),c.jsx("input",{id:"env-create-repo",type:"text",value:B,onChange:O=>q(O.target.value),placeholder:"Repo (optional)...",className:se.fieldInput,"data-testid":"env-create-repo"})]})]}),b==="codespace"&&c.jsx(S4,{codespaceName:X,onCodespaceNameChange:ae,envName:v,onEnvNameChange:y})]})})]})}function T4(){return c.jsx(R_,{mode:"new"})}function k4(){const{environmentId:t}=ss();return c.jsx(R_,{mode:"edit",environmentId:t})}const C4="_layout_11u79_1",E4="_content_11u79_8",N4="_tabPanel_11u79_14",dl={layout:C4,content:E4,tabPanel:N4};function j4(){const t=DB();return c.jsxs("div",{className:dl.layout,children:[c.jsx(Vs,{segments:t}),c.jsx("div",{className:dl.content,children:c.jsx(Ls,{})})]})}const w4="_container_13sb6_1",A4="_envHeader_13sb6_6",D4="_envTitleRow_13sb6_10",M4="_statusDot_13sb6_16",R4="_envName_13sb6_21",O4="_statusBadge_13sb6_27",B4="_envMeta_13sb6_33",I4="_metaTag_13sb6_39",L4="_actions_13sb6_51",U4="_provisionMessage_13sb6_59",z4="_errorMessage_13sb6_64",V4="_section_13sb6_69",H4="_sectionHeader_13sb6_73",P4="_cardList_13sb6_121",G4="_card_13sb6_121",$4="_cardHeader_13sb6_138",F4="_cardName_13sb6_144",q4="_cardActions_13sb6_149",K4="_cardDescription_13sb6_154",Y4="_cardMeta_13sb6_160",Z4="_repoLink_13sb6_166",X4="_empty_13sb6_174",Q4="_btnPrimary_13sb6_180",W4="_btnOutline_13sb6_214",J4="_btnSmall_13sb6_241",e5="_btnDanger_13sb6_267",Be={container:w4,envHeader:A4,envTitleRow:D4,statusDot:M4,envName:R4,statusBadge:O4,envMeta:B4,metaTag:I4,actions:L4,provisionMessage:U4,errorMessage:z4,section:V4,sectionHeader:H4,cardList:P4,card:G4,cardHeader:$4,cardName:F4,cardActions:q4,cardDescription:K4,cardMeta:Y4,repoLink:Z4,empty:X4,btnPrimary:Q4,btnOutline:W4,btnSmall:J4,btnDanger:e5},t5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function n5(){const{environmentId:t}=ss(),a=Dt(),{environments:i,workspaces:o,sessions:r,provisionStatus:u,provisionEnvironment:d,stopEnvironment:p,removeEnvironment:m,archiveWorkspace:g}=qe(),[v,y]=x.useState(!1),[b,S]=x.useState(void 0),T=i.find(q=>q.id===t);if(!t||!T)return c.jsx($n,{to:Pi,replace:!0});const E=o.filter(q=>q.environmentId===T.id),N=r.filter(q=>q.environmentId===T.id),C=N.reduce((q,X)=>q+(X.costUsd??0),0),j=t5[T.status]||"var(--text-tertiary)",D=T.status==="connected",M=T.status==="connecting",w=T.status==="disconnected"||T.status==="error",$=T.id in u?u[T.id]:void 0,V=()=>{m(T.id),y(!1),a(Pi,{replace:!0})},B=q=>{g(q),S(void 0)};return c.jsxs("div",{className:Be.container,children:[c.jsx(Oc,{isOpen:v,title:"Delete Environment?",description:`"${T.displayName||T.id}" will be permanently removed along with all its data.`,onConfirm:V,onCancel:()=>y(!1)}),c.jsxs("div",{className:Be.envHeader,children:[c.jsxs("div",{className:Be.envTitleRow,children:[c.jsx("span",{className:Be.statusDot,style:{color:j},children:"●"}),c.jsx("h2",{className:Be.envName,children:T.displayName||T.id}),c.jsx("span",{className:Be.statusBadge,style:{color:j},children:T.status})]}),c.jsxs("div",{className:Be.envMeta,children:[c.jsxs("span",{className:Be.metaTag,children:["Adapter: ",T.adapterType]}),N.length>0&&c.jsxs("span",{className:Be.metaTag,children:[N.length," session",N.length!==1?"s":""]}),C>0&&c.jsxs("span",{className:Be.metaTag,children:["Cost: ",Ki(C)]})]})]}),c.jsxs("div",{className:Be.actions,children:[D&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:Be.btnPrimary,onClick:()=>a(xb(T.id)),children:"New Chat"}),c.jsx("button",{className:Be.btnOutline,onClick:()=>p(T.id),children:"Stop"})]}),w&&c.jsx("button",{className:Be.btnPrimary,onClick:()=>d(T.id),children:T.status==="error"?"Retry":"Connect"}),M&&$!==void 0&&c.jsx("span",{className:Be.provisionMessage,children:$.message}),T.status==="error"&&($==null?void 0:$.stage)==="error"&&c.jsx("span",{className:Be.errorMessage,children:$.message}),c.jsx("button",{className:Be.btnOutline,onClick:()=>a(oC(T.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),c.jsx("button",{className:Be.btnDanger,onClick:()=>y(!0),children:"Delete"})]}),c.jsxs("div",{className:Be.section,children:[c.jsxs("div",{className:Be.sectionHeader,children:[c.jsx("h3",{children:"Workspaces"}),c.jsx("button",{className:Be.btnPrimary,onClick:()=>a(`${_b}?environment=${encodeURIComponent(T.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"})]}),E.length===0&&c.jsx("p",{className:Be.empty,children:"No workspaces yet. Create one to get started."}),c.jsx("div",{className:Be.cardList,children:E.map(q=>c.jsx(a5,{workspace:q,confirmArchiveId:b,onOpen:()=>a(Hi(q.id,T.id)),onArchive:()=>S(q.id),onConfirmArchive:()=>B(q.id),onCancelArchive:()=>S(void 0)},q.id))})]})]})}function a5({workspace:t,confirmArchiveId:a,onOpen:i,onArchive:o,onConfirmArchive:r,onCancelArchive:u}){const d=a===t.id,p=t.repoUrl&&/^https?:\/\//.test(t.repoUrl);return c.jsxs("div",{className:Be.card,"data-testid":"workspace-card",children:[c.jsxs("div",{className:Be.cardHeader,children:[c.jsx("strong",{className:Be.cardName,children:t.name}),c.jsxs("div",{className:Be.cardActions,children:[c.jsx("button",{className:Be.btnSmall,onClick:i,children:"Open"}),d?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:Be.btnDanger,onClick:r,children:"Confirm"}),c.jsx("button",{className:Be.btnSmall,onClick:u,children:"Cancel"})]}):c.jsx("button",{className:Be.btnSmall,onClick:o,children:"Archive"})]})]}),t.description&&c.jsx("p",{className:Be.cardDescription,children:t.description}),t.repoUrl&&c.jsx("div",{className:Be.cardMeta,children:p?c.jsx("a",{href:t.repoUrl,target:"_blank",rel:"noopener noreferrer",className:Be.repoLink,children:t.repoUrl}):c.jsx("span",{children:t.repoUrl})})]})}const s5={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function i5(){const a=jt().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=s5[a],o=AB(i);return c.jsxs("div",{className:dl.layout,children:[c.jsx(Vs,{segments:o}),c.jsx("div",{className:dl.content,children:c.jsx("div",{className:dl.tabPanel,children:c.jsx(Ls,{})},a)})]})}const o5="_section_1ingb_14",l5="_sectionTitle_1ingb_26",r5="_sectionDescription_1ingb_35",c5="_tokenList_1ingb_48",u5="_tokenRow_1ingb_55",d5="_tokenBadge_1ingb_68",f5="_tokenName_1ingb_83",h5="_tokenTarget_1ingb_90",p5="_deleteButton_1ingb_99",m5="_addForm_1ingb_113",g5="_formRow_1ingb_119",v5="_input_1ingb_125",y5="_select_1ingb_155",b5="_addButton_1ingb_187",x5="_emptyStateInfo_1ingb_221",_5="_themeOptions_1ingb_229",S5="_themeOption_1ingb_229",T5="_themeOptionSelected_1ingb_254",k5="_themeOptionHeader_1ingb_259",C5="_themeOptionLabel_1ingb_266",E5="_themeOptionDesc_1ingb_273",N5="_variantToggle_1ingb_279",j5="_variantButton_1ingb_286",w5="_variantActive_1ingb_305",A5="_themeSwatches_1ingb_311",D5="_themeSwatch_1ingb_311",M5="_systemToggle_1ingb_325",R5="_systemToggleHint_1ingb_341",O5="_themeActive_1ingb_348",B5="_aboutGrid_1ingb_354",I5="_aboutItem_1ingb_360",L5="_aboutLabel_1ingb_373",U5="_aboutValue_1ingb_379",z5="_aboutDot_1ingb_387",V5="_aboutDotConnected_1ingb_394",H5="_aboutDotDisconnected_1ingb_398",de={section:o5,sectionTitle:l5,sectionDescription:r5,tokenList:c5,tokenRow:u5,tokenBadge:d5,tokenName:f5,tokenTarget:h5,deleteButton:p5,addForm:m5,formRow:g5,input:v5,select:y5,addButton:b5,emptyStateInfo:x5,themeOptions:_5,themeOption:S5,themeOptionSelected:T5,themeOptionHeader:k5,themeOptionLabel:C5,themeOptionDesc:E5,variantToggle:N5,variantButton:j5,variantActive:w5,themeSwatches:A5,themeSwatch:D5,systemToggle:M5,systemToggleHint:R5,themeActive:O5,aboutGrid:B5,aboutItem:I5,aboutLabel:L5,aboutValue:U5,aboutDot:z5,aboutDotConnected:V5,aboutDotDisconnected:H5},P5=[{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 G5(){const{credentialProviders:t,updateCredentialProviders:a}=qe(),i=(o,r)=>{const u={...t};o==="claude"?u.claude=r:u[o]=r,a(u)};return c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Credential Providers"}),c.jsx("p",{className:de.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),c.jsx("div",{className:de.tokenList,children:P5.map(o=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenName,children:o.label}),c.jsx("span",{className:de.tokenTarget,children:o.description}),c.jsx("select",{className:de.select,value:t[o.key],onChange:r=>i(o.key,r.target.value),children:o.options.map(r=>c.jsx("option",{value:r.value,children:r.label},r.value))})]},o.key))})]})}const $5=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function F5(){const{tokens:t,setToken:a,deleteToken:i}=qe(),{showToast:o}=Us(),[r,u]=x.useState(""),[d,p]=x.useState(""),[m,g]=x.useState("env_var"),[v,y]=x.useState(""),[b,S]=x.useState(null),T=C=>{if(C.preventDefault(),!r||!d)return;const j=m==="env_var"?v||r.toUpperCase()+"_TOKEN":"";a(r,d,m,j,m==="file"?v:""),o("Token saved successfully","success"),u(""),p(""),y("")},E=C=>{S(C)},N=()=>{b&&(i(b),o("Token deleted","info")),S(null)};return c.jsxs(c.Fragment,{children:[c.jsx(Oc,{isOpen:b!==null,title:"Delete Token?",description:b?`"${b}" will be permanently removed.`:void 0,onConfirm:N,onCancel:()=>S(null)}),c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Tokens"}),c.jsx("p",{className:de.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),t.length===0?c.jsx("div",{className:de.emptyStateInfo,children:"Add your first API token to enable service integrations."}):c.jsx("div",{className:de.tokenList,children:t.map(C=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenBadge,children:C.tokenType}),c.jsx("span",{className:de.tokenName,children:C.name}),c.jsx("span",{className:de.tokenTarget,children:C.tokenType==="env_var"?C.envVar:C.filePath}),c.jsx("button",{className:de.deleteButton,onClick:()=>E(C.name),title:`Delete ${C.name}`,children:"×"})]},C.name))}),c.jsxs("form",{className:de.addForm,onSubmit:T,children:[c.jsxs("div",{className:de.formRow,children:[c.jsx("input",{className:de.input,type:"text",placeholder:"Token name",value:r,onChange:C=>u(C.target.value)}),c.jsx("input",{className:de.input,type:"password",placeholder:"Value",value:d,onChange:C=>p(C.target.value)})]}),c.jsxs("div",{className:de.formRow,children:[c.jsx("select",{className:de.select,value:m,onChange:C=>g(C.target.value),children:$5.map(C=>c.jsx("option",{value:C.value,children:C.label},C.value))}),c.jsx("input",{className:de.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:v,onChange:C=>y(C.target.value)}),c.jsx("button",{className:de.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function q5(){return c.jsxs(c.Fragment,{children:[c.jsx(G5,{}),c.jsx(F5,{})]})}const K5="_container_xb7ms_1",Y5="_header_xb7ms_7",Z5="_form_xb7ms_19",X5="_formActions_xb7ms_87",Q5="_list_xb7ms_93",W5="_card_xb7ms_99",J5="_active_xb7ms_109",eL="_cardHeader_xb7ms_113",tL="_cardTitle_xb7ms_123",nL="_defaultBadge_xb7ms_129",aL="_cardActions_xb7ms_143",sL="_description_xb7ms_148",iL="_meta_xb7ms_154",oL="_promptDetails_xb7ms_171",lL="_promptText_xb7ms_183",rL="_empty_xb7ms_200",cL="_btnPrimary_xb7ms_206",uL="_btnSecondary_xb7ms_240",dL="_btnSmall_xb7ms_267",fL="_btnDanger_xb7ms_293",hL="_typeToggle_xb7ms_336",pL="_typeBadge_xb7ms_350",mL="_scriptEditor_xb7ms_364",gL="_optional_xb7ms_371",He={container:K5,header:Y5,form:Z5,formActions:X5,list:Q5,card:W5,active:J5,cardHeader:eL,cardTitle:tL,defaultBadge:nL,cardActions:aL,description:sL,meta:iL,promptDetails:oL,promptText:lL,empty:rL,btnPrimary:cL,btnSecondary:uL,btnSmall:dL,btnDanger:fL,typeToggle:hL,typeBadge:pL,scriptEditor:mL,optional:gL};function vL(){const{personas:t,createPersona:a,updatePersona:i,deletePersona:o,appDefaultPersonaId:r,setAppDefaultPersonaId:u}=qe(),[d,p]=x.useState(null),[m,g]=x.useState(!1),[v,y]=x.useState(null),[b,S]=x.useState(""),[T,E]=x.useState(""),[N,C]=x.useState(""),[j,D]=x.useState("claude-code"),[M,w]=x.useState("sonnet"),[$,V]=x.useState(0),[B,q]=x.useState("agent"),[X,ae]=x.useState(""),te=()=>{S(""),E(""),C(""),D("claude-code"),w("sonnet"),V(0),q("agent"),ae("")},Q=()=>{te(),p(null),g(!0)},F=O=>{S(O.name),E(O.description),C(O.systemPrompt);const ie=O.type==="script"?"script":"agent";D(ie==="script"?O.runtime||"genaiscript":O.runtime),w(O.model),V(O.maxTurns),q(ie),ae(O.script||""),p(O),g(!1)},ne=O=>{q(O),O==="script"?D("genaiscript"):j==="genaiscript"&&D("claude-code")},I=O=>{if(O.preventDefault(),!!b.trim()){if(B==="script"){if(!X.trim())return}else if(!N.trim()||!j||!M)return;d?(i(d.id,b,T,N,j,M,$,B,X),p(null)):(a(b,T,N,j,M,$,B,X),g(!1)),te()}},Y=O=>{o(O),y(null),(d==null?void 0:d.id)===O&&(p(null),te())},oe=()=>{p(null),g(!1),te()},P=()=>c.jsxs("form",{onSubmit:I,className:He.form,children:[c.jsx("h3",{children:d?"Edit Persona":"Create Persona"}),c.jsxs("div",{className:He.typeToggle,"data-testid":"persona-type-toggle",children:[c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:B==="agent",onChange:()=>ne("agent")}),"Agent"]}),c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"script",checked:B==="script",onChange:()=>ne("script")}),"Script"]})]}),c.jsxs("label",{children:["Name",c.jsx("input",{type:"text",value:b,onChange:O=>S(O.target.value),placeholder:B==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0})]}),c.jsxs("label",{children:["Description",c.jsx("input",{type:"text",value:T,onChange:O=>E(O.target.value),placeholder:"Brief description..."})]}),c.jsxs("label",{children:["Runtime",c.jsx("select",{value:j,onChange:O=>D(O.target.value),"data-testid":"persona-runtime-select",children:B==="script"?c.jsx("option",{value:"genaiscript",children:"genaiscript"}):c.jsxs(c.Fragment,{children:[c.jsx("option",{value:"claude-code",children:"claude-code"}),c.jsx("option",{value:"codex",children:"codex"}),c.jsx("option",{value:"copilot",children:"copilot"}),c.jsx("option",{value:"goose",children:"goose"}),c.jsx("option",{value:"stub",children:"stub"}),c.jsx("option",{value:"claude-code-acp",children:"claude-code-acp (experimental)"}),c.jsx("option",{value:"codex-acp",children:"codex-acp (experimental)"}),c.jsx("option",{value:"copilot-acp",children:"copilot-acp (experimental)"})]})})]}),B==="agent"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model",c.jsx("input",{type:"text",value:M,onChange:O=>w(O.target.value),placeholder:"e.g. sonnet"})]}),c.jsxs("label",{children:["Max Turns",c.jsx("input",{type:"number",value:$,onChange:O=>V(parseInt(O.target.value,10)||0),min:0})]}),c.jsxs("label",{children:["System Prompt",c.jsx("textarea",{value:N,onChange:O=>C(O.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]})]}),B==="script"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model ",c.jsx("span",{className:He.optional,children:"(optional)"}),c.jsx("input",{type:"text",value:M,onChange:O=>w(O.target.value),placeholder:"e.g. sonnet (leave empty for script-only)"})]}),c.jsxs("label",{children:["System Prompt ",c.jsx("span",{className:He.optional,children:"(optional)"}),c.jsx("textarea",{value:N,onChange:O=>C(O.target.value),placeholder:"Optional context for the script...",rows:4})]}),c.jsxs("label",{children:["Script",c.jsx("textarea",{value:X,onChange:O=>ae(O.target.value),placeholder:`script({ model: "openai:gpt-4o" });
106
-
107
- const grackle = await host.mcpServer({
108
- id: "grackle",
109
- url: env.vars.GRACKLE_MCP_URL,
110
- });
111
-
112
- $\`Summarize the current tasks.\`;`,rows:20,className:He.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),c.jsxs("div",{className:He.formActions,children:[c.jsx("button",{type:"submit",className:He.btnPrimary,children:d?"Save":"Create"}),c.jsx("button",{type:"button",onClick:oe,className:He.btnSecondary,children:"Cancel"})]})]});return c.jsxs("div",{className:He.container,children:[c.jsxs("div",{className:He.header,children:[c.jsx("h2",{children:"Personas"}),c.jsx("button",{onClick:Q,className:He.btnPrimary,children:"+ New Persona"})]}),(m||d)&&P(),t.length===0&&!m?c.jsx("p",{className:He.empty,children:"No personas yet. Create one to get started."}):c.jsx("div",{className:He.list,children:t.map(O=>{const ie=r===O.id,be=O.type==="script";return c.jsxs("div",{className:`${He.card} ${(d==null?void 0:d.id)===O.id?He.active:""}`,"data-testid":`persona-card-${O.id}`,children:[c.jsxs("div",{className:He.cardHeader,children:[c.jsxs("span",{className:He.cardTitle,children:[c.jsx("strong",{children:O.name}),c.jsx("span",{className:He.typeBadge,"data-testid":`persona-type-badge-${O.id}`,children:be?"Script":"Agent"}),ie&&c.jsx("span",{className:He.defaultBadge,"data-testid":`persona-default-badge-${O.id}`,children:"App Default"})]}),c.jsxs("div",{className:He.cardActions,children:[!ie&&c.jsx("button",{onClick:()=>u(O.id),className:He.btnSmall,"data-testid":`persona-set-default-${O.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>F(O),className:He.btnSmall,children:"Edit"}),v===O.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>Y(O.id),className:He.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>y(null),className:He.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>y(O.id),className:He.btnSmall,children:"Delete"})]})]}),O.description&&c.jsx("p",{className:He.description,children:O.description}),c.jsxs("div",{className:He.meta,children:[O.runtime&&c.jsxs("span",{children:["Runtime: ",O.runtime]}),O.model&&c.jsxs("span",{children:["Model: ",O.model]}),O.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",O.maxTurns]})]}),be?c.jsxs("details",{className:He.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:He.promptText,children:O.script})]}):c.jsxs("details",{className:He.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:He.promptText,children:O.systemPrompt})]})]},O.id)})})]})}function yL(){return c.jsx(vL,{})}function bL(){const{themeId:t,resolvedThemeId:a,setTheme:i,preferSystem:o,setPreferSystem:r}=wb();return c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Appearance"}),c.jsx("p",{className:de.sectionDescription,children:"Choose how Grackle looks across the app."}),c.jsx("div",{className:de.themeOptions,children:Ec.filter(u=>!u.hidden).map(u=>{const d=!!(u.variantLightId&&u.variantDarkId),p=d?t===u.id||t===u.variantLightId||t===u.variantDarkId:t===u.id,m=d&&a===u.variantLightId;return c.jsxs("button",{type:"button",className:`${de.themeOption} ${p?de.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(u.id),children:[c.jsxs("span",{className:de.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:de.themeOptionLabel,children:u.label}),c.jsx("span",{className:de.themeOptionDesc,children:u.description})]}),d&&c.jsxs("span",{className:de.variantToggle,children:[c.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${p&&m?de.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),c.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${p&&!m?de.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),u.swatches&&c.jsx("span",{className:de.themeSwatches,children:u.swatches.map((g,v)=>c.jsx("span",{className:de.themeSwatch,style:{background:g}},v))})]},u.id)})}),c.jsxs("label",{className:de.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:o,onChange:u=>r(u.target.checked)}),c.jsx("span",{children:"Match system light/dark preference"})]}),c.jsx("p",{className:de.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),c.jsxs("p",{className:de.themeActive,children:["Active theme: ",c.jsx("strong",{children:a})]})]})}function xL(){return c.jsx(bL,{})}function _L(){const{connected:t,environments:a,sessions:i}=qe(),o=a.filter(d=>d.status==="connected").length,r=a.length,u=i.filter(d=>["running","idle"].includes(d.status)).length;return c.jsxs("section",{className:de.section,"data-testid":"about-panel",children:[c.jsx("h3",{className:de.sectionTitle,children:"About"}),c.jsx("p",{className:de.sectionDescription,children:"Connection status and application information."}),c.jsxs("div",{className:de.aboutGrid,children:[c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Connection"}),c.jsxs("span",{className:de.aboutValue,children:[c.jsx("span",{className:`${de.aboutDot} ${t?de.aboutDotConnected:de.aboutDotDisconnected}`}),t?"Connected":"Disconnected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Environments"}),c.jsxs("span",{className:de.aboutValue,children:[o,"/",r," connected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Active Sessions"}),c.jsx("span",{className:de.aboutValue,children:u})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Version"}),c.jsx("span",{className:de.aboutValue,children:"0.71.1"})]})]})]})}function SL(){return c.jsx(_L,{})}const TL="_wizard_1260s_1",kL="_container_1260s_10",CL="_stepContent_1260s_19",EL="_logoArea_1260s_28",NL="_logoImage_1260s_32",jL="_heading_1260s_41",wL="_tagline_1260s_49",AL="_subtitle_1260s_56",DL="_featureList_1260s_64",ML="_runtimeGrid_1260s_89",RL="_runtimeCard_1260s_101",OL="_runtimeName_1260s_133",BL="_runtimeDescription_1260s_139",IL="_buttonRow_1260s_144",LL="_primaryButton_1260s_151",UL="_ghostButton_1260s_185",zL="_dots_1260s_213",VL="_dot_1260s_213",et={wizard:TL,container:kL,stepContent:CL,logoArea:EL,logoImage:NL,heading:jL,tagline:wL,subtitle:AL,featureList:DL,runtimeGrid:ML,runtimeCard:RL,runtimeName:OL,runtimeDescription:BL,buttonRow:IL,primaryButton:LL,ghostButton:UL,dots:zL,dot:VL};function HL({onNext:t}){return c.jsxs("div",{className:et.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:et.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:et.logoImage})}),c.jsx("h1",{className:et.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:et.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:et.primaryButton,onClick:t,"data-testid":"setup-get-started",children:"Get Started"})]})}function PL({onNext:t,onBack:a}){return c.jsxs("div",{className:et.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:et.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:et.featureList,children:[c.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),c.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),c.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),c.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),c.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),c.jsxs("div",{className:et.buttonRow,children:[c.jsx("button",{type:"button",className:et.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:et.primaryButton,onClick:t,"data-testid":"setup-about-next",children:"Next"})]})]})}const GL=[{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 $L({currentRuntime:t,onFinish:a,onBack:i,finishDisabled:o}){const[r,u]=x.useState(t||"claude-code");return x.useEffect(()=>{t&&u(t)},[t]),c.jsxs("div",{className:et.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:et.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:et.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:et.runtimeGrid,children:GL.map(d=>c.jsxs("button",{type:"button",className:et.runtimeCard,"data-selected":r===d.id,"aria-pressed":r===d.id,"data-testid":`runtime-card-${d.id}`,onClick:()=>u(d.id),children:[c.jsx("span",{className:et.runtimeName,children:d.name}),c.jsx("span",{className:et.runtimeDescription,children:d.description})]},d.id))}),c.jsxs("div",{className:et.buttonRow,children:[c.jsx("button",{type:"button",className:et.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:et.primaryButton,onClick:()=>a(r),disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const FL=3,eb={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function qL(){const{personas:t,updatePersona:a,completeOnboarding:i,onboardingCompleted:o}=qe(),r=Dt(),[u,d]=x.useState(0),p=t.find(g=>g.id==="claude-code"),m=x.useCallback(g=>{if(p&&g!==p.runtime){const y=eb[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,y)}const v=t.find(y=>y.id===O0);if(v&&g!==v.runtime){const y=eb[g]??"sonnet";a(O0,void 0,void 0,void 0,g,y)}i(),r("/",{replace:!0})},[p,t,a,i,r]);return o===!0?c.jsx($n,{to:"/",replace:!0}):c.jsx("div",{className:et.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:et.container,children:[c.jsx(Qn,{mode:"wait",children:c.jsxs(Ct.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&c.jsx(HL,{onNext:()=>d(1)}),u===1&&c.jsx(PL,{onNext:()=>d(2),onBack:()=>d(0)}),u===2&&c.jsx($L,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>d(1),finishDisabled:!p})]},u)}),c.jsx("div",{className:et.dots,children:Array.from({length:FL},(g,v)=>c.jsx("span",{className:et.dot,"data-active":v===u},v))})]})})}const KL="_root_zndgp_1",YL="_body_zndgp_7",ZL="_main_zndgp_19",XL="_sidebarWrapper_zndgp_26",QL="_overlay_zndgp_51",sl={root:KL,body:YL,main:ZL,sidebarWrapper:XL,overlay:QL},WL=x.lazy(()=>dT(()=>import("./KnowledgePage-SAVu8YTP.js"),__vite__mapDeps([0,1,2,3])).then(t=>({default:t.KnowledgePage}))),JL=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function e8(){const t=jt(),i=Mb()!==void 0,[o,r]=x.useState(!1),u=x.useCallback(()=>r(d=>!d),[]);return x.useEffect(()=>{r(!1)},[t.pathname]),x.useEffect(()=>{if(!o)return;const d=p=>{p.key==="Escape"&&r(!1)};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[o]),c.jsxs(c.Fragment,{children:[c.jsx(JC,{onToggleSidebar:i?u:void 0,sidebarOpen:o}),c.jsx(oE,{}),c.jsxs("div",{className:sl.body,children:[i&&c.jsx("div",{className:sl.sidebarWrapper,"data-sidebar-open":o,children:c.jsx(pE,{})}),i&&o&&c.jsx("div",{className:sl.overlay,"data-testid":"drawer-overlay",onClick:()=>r(!1)}),c.jsxs("div",{className:sl.main,children:[c.jsx(Ls,{}),c.jsx(QD,{})]})]}),c.jsx(uM,{})]})}function t8(){const{lastSpawnedId:t,environments:a,connected:i,onboardingCompleted:o}=qe(),{showToast:r}=Us();ER(a,r);const u=Dt(),d=jt();return x.useEffect(()=>{t&&!d.pathname.includes("/tasks/")&&u(bb(t),{replace:!0})},[t,u,d.pathname]),i&&o===!1?c.jsx($n,{to:"/setup",replace:!0}):c.jsx(lE,{children:c.jsx("div",{className:sl.root,children:c.jsx(e8,{})})})}function Tf(){const{workspaceId:t}=ss(),{workspaces:a}=qe(),i=jt(),o=a.find(m=>m.id===t);if(!(o!=null&&o.environmentId))return a.length===0?void 0:c.jsx($n,{to:"/environments",replace:!0});const r=encodeURIComponent(t),u=`/workspaces/${r}`,d=i.pathname.startsWith(u)?i.pathname.slice(u.length):"",p=`/environments/${encodeURIComponent(o.environmentId)}/workspaces/${r}${d}${i.search}${i.hash}`;return c.jsx($n,{to:p,replace:!0})}function n8(){return c.jsxs(Tk,{children:[c.jsx(Se,{path:"setup",element:c.jsx(qL,{})}),c.jsxs(Se,{element:c.jsx(t8,{}),children:[c.jsx(Se,{index:!0,element:c.jsx(JO,{})}),c.jsx(Se,{path:"chat",element:c.jsx(jB,{})}),c.jsx(Se,{path:"sessions/new",element:c.jsx(IB,{})}),c.jsx(Se,{path:"sessions/:sessionId",element:c.jsx(zB,{})}),c.jsx(Se,{element:c.jsx(GD,{}),children:c.jsx(Se,{path:"knowledge",element:c.jsx(x.Suspense,{fallback:c.jsx(E_,{}),children:c.jsx(WL,{})})})}),c.jsxs(Se,{element:c.jsx(VD,{}),children:[c.jsx(Se,{path:"tasks",element:c.jsx(QO,{})}),c.jsx(Se,{path:"tasks/new",element:c.jsx(X0,{})}),c.jsx(Se,{path:"tasks/:taskId",element:c.jsx(Ri,{})}),c.jsx(Se,{path:"tasks/:taskId/stream",element:c.jsx(Ri,{})}),c.jsx(Se,{path:"tasks/:taskId/findings",element:c.jsx(Ri,{})}),c.jsx(Se,{path:"tasks/:taskId/edit",element:c.jsx(Q0,{})})]}),c.jsxs(Se,{element:c.jsx(HD,{}),children:[c.jsx(Se,{path:"workspaces",element:c.jsx($n,{to:"/environments",replace:!0})}),c.jsx(Se,{path:"workspaces/new",element:c.jsx(VI,{})}),c.jsx(Se,{path:"workspaces/:workspaceId",element:c.jsx(Tf,{})}),c.jsx(Se,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Tf,{})}),c.jsx(Se,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:c.jsx(Tf,{})}),c.jsx(Se,{path:"environments/:environmentId/workspaces/:workspaceId",element:c.jsx(sI,{})}),c.jsx(Se,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:c.jsx(X0,{})}),c.jsx(Se,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Ri,{})}),c.jsx(Se,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(Ri,{})}),c.jsx(Se,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(Ri,{})}),c.jsx(Se,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(Q0,{})}),c.jsxs(Se,{path:"environments",element:c.jsx(j4,{}),children:[c.jsx(Se,{index:!0,element:c.jsx(WO,{})}),c.jsx(Se,{path:"new",element:c.jsx(T4,{})}),c.jsx(Se,{path:":environmentId",element:c.jsx(n5,{})}),c.jsx(Se,{path:":environmentId/edit",element:c.jsx(k4,{})})]})]}),c.jsx(Se,{element:c.jsx(PD,{}),children:c.jsxs(Se,{path:"settings",element:c.jsx(i5,{}),children:[c.jsx(Se,{index:!0,element:c.jsx($n,{to:"credentials",replace:!0})}),c.jsx(Se,{path:"environments",element:c.jsx($n,{to:"/environments",replace:!0})}),c.jsx(Se,{path:"credentials",element:c.jsx(q5,{})}),c.jsx(Se,{path:"tokens",element:c.jsx($n,{to:"../credentials",replace:!0})}),c.jsx(Se,{path:"personas",element:c.jsx(yL,{})}),c.jsx(Se,{path:"appearance",element:c.jsx(xL,{})}),c.jsx(Se,{path:"about",element:c.jsx(SL,{})})]})}),c.jsx(Se,{path:"*",element:c.jsx($n,{to:"/",replace:!0})})]})]})}const a8=1e4;function s8(){const{onboardingCompleted:t}=qe(),[a,i]=x.useState(!1);x.useEffect(()=>{if(t!==void 0)return;const r=setTimeout(()=>i(!0),a8);return()=>clearTimeout(r)},[t]);const o=t===void 0&&!a;return c.jsx(Qn,{mode:"wait",children:o?c.jsx(Ct.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(E_,{})},"splash"):c.jsx(Ct.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(Yk,{children:c.jsx(n8,{})})},"app")})}function i8(){const t=JL?LC:jC;return c.jsx(GC,{children:c.jsx(zC,{children:c.jsx(t,{children:c.jsx(s8,{})})})})}rT.createRoot(document.getElementById("root")).render(c.jsx(x.StrictMode,{children:c.jsx(i8,{})}));export{Vs as B,Sb as K,qe as a,bb as s,_a as t,Dt as u};