@grackle-ai/web 0.75.12 → 0.76.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.
@@ -0,0 +1,112 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-EtkEDnqG.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/grpc-B1TrVI0Z.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
2
+ import{r as v1,a as y,j as r,v as g1,b as y1,t as Mr,i as b1,f as x1,M as Of,c as Bf}from"./markdown-gcy1Jmzi.js";import{r as _1,d as wg,H as Eg,P as Ag,i as S1,B as T1,a as k1,C as j1,M as N1}from"./dagview-BA5TtMAQ.js";import{c as C1,a as w1,G as E1,e as A1,w as D1,t as R1,p as Or,b as M1,C as Lf,f as O1,M as B1,R as Lo,S as Dg}from"./grpc-B1TrVI0Z.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(c){if(c.ep)return;c.ep=!0;const d=i(c);fetch(c.href,d)}})();var Od={exports:{}},Io={},Bd={exports:{}},Ld={};/**
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 Rg;function L1(){return Rg||(Rg=1,(function(n){function a(O,P){var se=O.length;O.push(P);e:for(;0<se;){var le=se-1>>>1,q=O[le];if(0<c(q,P))O[le]=P,O[se]=q,se=le;else break e}}function i(O){return O.length===0?null:O[0]}function l(O){if(O.length===0)return null;var P=O[0],se=O.pop();if(se!==P){O[0]=se;e:for(var le=0,q=O.length,be=q>>>1;le<be;){var Ce=2*(le+1)-1,xe=O[Ce],J=Ce+1,re=O[J];if(0>c(xe,se))J<q&&0>c(re,xe)?(O[le]=re,O[J]=se,le=J):(O[le]=xe,O[Ce]=se,le=Ce);else if(J<q&&0>c(re,se))O[le]=re,O[J]=se,le=J;else break e}}return P}function c(O,P){var se=O.sortIndex-P.sortIndex;return se!==0?se:O.id-P.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var p=[],v=[],g=1,b=null,x=3,S=!1,j=!1,C=!1,N=!1,k=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(O){for(var P=i(v);P!==null;){if(P.callback===null)l(v);else if(P.startTime<=O)l(v),P.sortIndex=P.expirationTime,a(p,P);else break;P=i(v)}}function E(O){if(C=!1,R(O),!j)if(i(p)!==null)j=!0,H||(H=!0,ie());else{var P=i(v);P!==null&&ae(E,P.startTime-O)}}var H=!1,z=-1,I=5,Y=-1;function ee(){return N?!0:!(n.unstable_now()-Y<I)}function te(){if(N=!1,H){var O=n.unstable_now();Y=O;var P=!0;try{e:{j=!1,C&&(C=!1,w(z),z=-1),S=!0;var se=x;try{t:{for(R(O),b=i(p);b!==null&&!(b.expirationTime>O&&ee());){var le=b.callback;if(typeof le=="function"){b.callback=null,x=b.priorityLevel;var q=le(b.expirationTime<=O);if(O=n.unstable_now(),typeof q=="function"){b.callback=q,R(O),P=!0;break t}b===i(p)&&l(p),R(O)}else l(p);b=i(p)}if(b!==null)P=!0;else{var be=i(v);be!==null&&ae(E,be.startTime-O),P=!1}}break e}finally{b=null,x=se,S=!1}P=void 0}}finally{P?ie():H=!1}}}var ie;if(typeof A=="function")ie=function(){A(te)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,K=ce.port2;ce.port1.onmessage=te,ie=function(){K.postMessage(null)}}else ie=function(){k(te,0)};function ae(O,P){z=k(function(){O(n.unstable_now())},P)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<O?Math.floor(1e3/O):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(O){switch(x){case 1:case 2:case 3:var P=3;break;default:P=x}var se=x;x=P;try{return O()}finally{x=se}},n.unstable_requestPaint=function(){N=!0},n.unstable_runWithPriority=function(O,P){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var se=x;x=O;try{return P()}finally{x=se}},n.unstable_scheduleCallback=function(O,P,se){var le=n.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?le+se:le):se=le,O){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=se+q,O={id:g++,callback:P,priorityLevel:O,startTime:se,expirationTime:q,sortIndex:-1},se>le?(O.sortIndex=se,a(v,O),i(p)===null&&O===i(v)&&(C?(w(z),z=-1):C=!0,ae(E,se-le))):(O.sortIndex=q,a(p,O),j||S||(j=!0,H||(H=!0,ie()))),O},n.unstable_shouldYield=ee,n.unstable_wrapCallback=function(O){var P=x;return function(){var se=x;x=P;try{return O.apply(this,arguments)}finally{x=se}}}})(Ld)),Ld}var Mg;function I1(){return Mg||(Mg=1,Bd.exports=L1()),Bd.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 Og;function z1(){if(Og)return Io;Og=1;var n=I1(),a=v1(),i=_1();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(d(e)!==e)throw Error(l(188))}function v(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(l(188));return t!==e?null:e}for(var s=e,o=t;;){var u=s.return;if(u===null)break;var h=u.alternate;if(h===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===s)return p(u),e;if(h===o)return p(u),t;h=h.sibling}throw Error(l(188))}if(s.return!==o.return)s=u,o=h;else{for(var _=!1,T=u.child;T;){if(T===s){_=!0,s=u,o=h;break}if(T===o){_=!0,o=u,s=h;break}T=T.sibling}if(!_){for(T=h.child;T;){if(T===s){_=!0,s=h,o=u;break}if(T===o){_=!0,o=h,s=u;break}T=T.sibling}if(!_)throw Error(l(189))}}if(s.alternate!==o)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function ie(e){return e===null||typeof e!="object"?null:(e=te&&e[te]||e["@@iterator"],typeof e=="function"?e:null)}var ce=Symbol.for("react.client.reference");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case k:return"Profiler";case N:return"StrictMode";case E:return"Suspense";case H:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case j:return"Portal";case A:return e.displayName||"Context";case w:return(e._context.displayName||"Context")+".Consumer";case R:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case I:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}var ae=Array.isArray,O=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},le=[],q=-1;function be(e){return{current:e}}function Ce(e){0>q||(e.current=le[q],le[q]=null,q--)}function xe(e,t){q++,le[q]=e.current,e.current=t}var J=be(null),re=be(null),W=be(null),tt=be(null);function Re(e,t){switch(xe(W,t),xe(re,e),xe(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Qv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Qv(t),e=Wv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ce(J),xe(J,e)}function Dn(){Ce(J),Ce(re),Ce(W)}function _a(e){e.memoizedState!==null&&xe(tt,e);var t=J.current,s=Wv(t,e.type);t!==s&&(xe(re,e),xe(J,s))}function hn(e){re.current===e&&(Ce(J),Ce(re)),tt.current===e&&(Ce(tt),Ro._currentValue=se)}var Fn,In;function mn(e){if(Fn===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Fn=t&&t[1]||"",In=-1<s.stack.indexOf(`
19
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
20
+ `+Fn+e+In}var Jt=!1;function ke(e,t){if(!e||Jt)return"";Jt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch($){var G=$}Reflect.construct(e,[],Q)}else{try{Q.call()}catch($){G=$}e.call(Q.prototype)}}else{try{throw Error()}catch($){G=$}(Q=e())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch($){if($&&G&&typeof $.stack=="string")return[$.stack,G.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),_=h[0],T=h[1];if(_&&T){var D=_.split(`
21
+ `),V=T.split(`
22
+ `);for(u=o=0;o<D.length&&!D[o].includes("DetermineComponentFrameRoot");)o++;for(;u<V.length&&!V[u].includes("DetermineComponentFrameRoot");)u++;if(o===D.length||u===V.length)for(o=D.length-1,u=V.length-1;1<=o&&0<=u&&D[o]!==V[u];)u--;for(;1<=o&&0<=u;o--,u--)if(D[o]!==V[u]){if(o!==1||u!==1)do if(o--,u--,0>u||D[o]!==V[u]){var F=`
23
+ `+D[o].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),F}while(1<=o&&0<=u);break}}}finally{Jt=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?mn(s):""}function kt(e,t){switch(e.tag){case 26:case 27:case 5:return mn(e.type);case 16:return mn("Lazy");case 13:return e.child!==t&&t!==null?mn("Suspense Fallback"):mn("Suspense");case 19:return mn("SuspenseList");case 0:case 15:return ke(e.type,!1);case 11:return ke(e.type.render,!1);case 1:return ke(e.type,!0);case 31:return mn("Activity");default:return""}}function Pi(e){try{var t="",s=null;do t+=kt(e,s),s=e,e=e.return;while(e);return t}catch(o){return`
24
+ Error generating stack: `+o.message+`
25
+ `+o.stack}}var Bs=Object.prototype.hasOwnProperty,Ls=n.unstable_scheduleCallback,Is=n.unstable_cancelCallback,vl=n.unstable_shouldYield,gl=n.unstable_requestPaint,Ut=n.unstable_now,yl=n.unstable_getCurrentPriorityLevel,bl=n.unstable_ImmediatePriority,Z=n.unstable_UserBlockingPriority,oe=n.unstable_NormalPriority,fe=n.unstable_LowPriority,_e=n.unstable_IdlePriority,ge=n.log,Je=n.unstable_setDisableYieldValue,Se=null,ze=null;function Ue(e){if(typeof ge=="function"&&Je(e),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(Se,e)}catch{}}var Ke=Math.clz32?Math.clz32:en,At=Math.log,Gt=Math.LN2;function en(e){return e>>>=0,e===0?32:31-(At(e)/Gt|0)|0}var jt=256,Sa=262144,pn=4194304;function Rn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function xl(e,t,s){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var T=o&134217727;return T!==0?(o=T&~h,o!==0?u=Rn(o):(_&=T,_!==0?u=Rn(_):s||(s=T&~e,s!==0&&(u=Rn(s))))):(T=o&~h,T!==0?u=Rn(T):_!==0?u=Rn(_):s||(s=o&~e,s!==0&&(u=Rn(s)))),u===0?0:t!==0&&t!==u&&(t&h)===0&&(h=u&-u,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:u}function $i(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function a_(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rh(){var e=pn;return pn<<=1,(pn&62914560)===0&&(pn=4194304),e}function Sc(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function qi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function s_(e,t,s,o,u,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 T=e.entanglements,D=e.expirationTimes,V=e.hiddenUpdates;for(s=_&~s;0<s;){var F=31-Ke(s),Q=1<<F;T[F]=0,D[F]=-1;var G=V[F];if(G!==null)for(V[F]=null,F=0;F<G.length;F++){var $=G[F];$!==null&&($.lane&=-536870913)}s&=~Q}o!==0&&Mh(e,o,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~t))}function Mh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Ke(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|s&261930}function Oh(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-Ke(s),u=1<<o;u&t|e[o]&t&&(e[o]|=t),s&=~u}}function Bh(e,t){var s=t&-t;return s=(s&42)!==0?1:Tc(s),(s&(e.suspendedLanes|t))!==0?0:s}function Tc(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 kc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Lh(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:_g(e.type))}function Ih(e,t){var s=P.p;try{return P.p=e,t()}finally{P.p=s}}var Ta=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Ta,qt="__reactProps$"+Ta,zs="__reactContainer$"+Ta,jc="__reactEvents$"+Ta,i_="__reactListeners$"+Ta,o_="__reactHandles$"+Ta,zh="__reactResources$"+Ta,Ki="__reactMarker$"+Ta;function Nc(e){delete e[Mt],delete e[qt],delete e[jc],delete e[i_],delete e[o_]}function Us(e){var t=e[Mt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[zs]||s[Mt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=ig(e);e!==null;){if(s=e[Mt])return s;e=ig(e)}return t}e=s,s=e.parentNode}return null}function Vs(e){if(e=e[Mt]||e[zs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Yi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Hs(e){var t=e[zh];return t||(t=e[zh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Dt(e){e[Ki]=!0}var Uh=new Set,Vh={};function es(e,t){Gs(e,t),Gs(e+"Capture",t)}function Gs(e,t){for(Vh[e]=t,e=0;e<t.length;e++)Uh.add(t[e])}var l_=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]*$"),Hh={},Gh={};function r_(e){return Bs.call(Gh,e)?!0:Bs.call(Hh,e)?!1:l_.test(e)?Gh[e]=!0:(Hh[e]=!0,!1)}function _l(e,t,s){if(r_(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Sl(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function Zn(e,t,s,o){if(o===null)e.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+o)}}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 Ph(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function c_(e,t,s){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,h=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(_){s=""+_,h.call(this,_)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cc(e){if(!e._valueTracker){var t=Ph(e)?"checked":"value";e._valueTracker=c_(e,t,""+e[t])}}function $h(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=Ph(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function Tl(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 u_=/[\n"\\]/g;function gn(e){return e.replace(u_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function wc(e,t,s,o,u,h,_,T){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),t!=null?_==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+vn(t)):e.value!==""+vn(t)&&(e.value=""+vn(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?Ec(e,_,vn(t)):s!=null?Ec(e,_,vn(s)):o!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+vn(T):e.removeAttribute("name")}function qh(e,t,s,o,u,h,_,T){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){Cc(e);return}s=s!=null?""+vn(s):"",t=t!=null?""+vn(t):s,T||t===e.value||(e.value=t),e.defaultValue=t}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=T?e.checked:!!o,e.defaultChecked=!!o,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Cc(e)}function Ec(e,t,s){t==="number"&&Tl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ps(e,t,s,o){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&o&&(e[s].defaultSelected=!0)}else{for(s=""+vn(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Kh(e,t,s){if(t!=null&&(t=""+vn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+vn(s):""}function Yh(e,t,s,o){if(t==null){if(o!=null){if(s!=null)throw Error(l(92));if(ae(o)){if(1<o.length)throw Error(l(93));o=o[0]}s=o}s==null&&(s=""),t=s}s=vn(t),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o),Cc(e)}function $s(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var d_=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 Fh(e,t,s){var o=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,s):typeof s!="number"||s===0||d_.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Zh(e,t,s){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var u in t)o=t[u],t.hasOwnProperty(u)&&s[u]!==o&&Fh(e,u,o)}else for(var h in t)t.hasOwnProperty(h)&&Fh(e,h,t[h])}function Ac(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var f_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),h_=/^[\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 kl(e){return h_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xn(){}var Dc=null;function Rc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qs=null,Ks=null;function Xh(e){var t=Vs(e);if(t&&(e=t.stateNode)){var s=e[qt]||null;e:switch(e=t.stateNode,t.type){case"input":if(wc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+gn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var u=o[qt]||null;if(!u)throw Error(l(90));wc(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)o=s[t],o.form===e.form&&$h(o)}break e;case"textarea":Kh(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Ps(e,!!s.multiple,t,!1)}}}var Mc=!1;function Qh(e,t,s){if(Mc)return e(t,s);Mc=!0;try{var o=e(t);return o}finally{if(Mc=!1,(qs!==null||Ks!==null)&&(dr(),qs&&(t=qs,e=Ks,Ks=qs=null,Xh(t),e)))for(t=0;t<e.length;t++)Xh(e[t])}}function Fi(e,t){var s=e.stateNode;if(s===null)return null;var o=s[qt]||null;if(o===null)return null;s=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,t,typeof s));return s}var Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oc=!1;if(Qn)try{var Zi={};Object.defineProperty(Zi,"passive",{get:function(){Oc=!0}}),window.addEventListener("test",Zi,Zi),window.removeEventListener("test",Zi,Zi)}catch{Oc=!1}var ka=null,Bc=null,jl=null;function Wh(){if(jl)return jl;var e,t=Bc,s=t.length,o,u="value"in ka?ka.value:ka.textContent,h=u.length;for(e=0;e<s&&t[e]===u[e];e++);var _=s-e;for(o=1;o<=_&&t[s-o]===u[h-o];o++);return jl=u.slice(e,1<o?1-o:void 0)}function Nl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Cl(){return!0}function Jh(){return!1}function Kt(e){function t(s,o,u,h,_){this._reactName=s,this._targetInst=u,this.type=o,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(s=e[T],this[T]=s?s(h):h[T]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Cl:Jh,this.isPropagationStopped=Jh,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Cl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Cl)},persist:function(){},isPersistent:Cl}),t}var ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wl=Kt(ts),Xi=b({},ts,{view:0,detail:0}),m_=Kt(Xi),Lc,Ic,Qi,El=b({},Xi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uc,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!==Qi&&(Qi&&e.type==="mousemove"?(Lc=e.screenX-Qi.screenX,Ic=e.screenY-Qi.screenY):Ic=Lc=0,Qi=e),Lc)},movementY:function(e){return"movementY"in e?e.movementY:Ic}}),em=Kt(El),p_=b({},El,{dataTransfer:0}),v_=Kt(p_),g_=b({},Xi,{relatedTarget:0}),zc=Kt(g_),y_=b({},ts,{animationName:0,elapsedTime:0,pseudoElement:0}),b_=Kt(y_),x_=b({},ts,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),__=Kt(x_),S_=b({},ts,{data:0}),tm=Kt(S_),T_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},k_={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"},j_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function N_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=j_[e])?!!t[e]:!1}function Uc(){return N_}var C_=b({},Xi,{key:function(e){if(e.key){var t=T_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Nl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?k_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uc,charCode:function(e){return e.type==="keypress"?Nl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Nl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),w_=Kt(C_),E_=b({},El,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nm=Kt(E_),A_=b({},Xi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uc}),D_=Kt(A_),R_=b({},ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),M_=Kt(R_),O_=b({},El,{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}),B_=Kt(O_),L_=b({},ts,{newState:0,oldState:0}),I_=Kt(L_),z_=[9,13,27,32],Vc=Qn&&"CompositionEvent"in window,Wi=null;Qn&&"documentMode"in document&&(Wi=document.documentMode);var U_=Qn&&"TextEvent"in window&&!Wi,am=Qn&&(!Vc||Wi&&8<Wi&&11>=Wi),sm=" ",im=!1;function om(e,t){switch(e){case"keyup":return z_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ys=!1;function V_(e,t){switch(e){case"compositionend":return lm(t);case"keypress":return t.which!==32?null:(im=!0,sm);case"textInput":return e=t.data,e===sm&&im?null:e;default:return null}}function H_(e,t){if(Ys)return e==="compositionend"||!Vc&&om(e,t)?(e=Wh(),jl=Bc=ka=null,Ys=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return am&&t.locale!=="ko"?null:t.data;default:return null}}var G_={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 rm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!G_[e.type]:t==="textarea"}function cm(e,t,s,o){qs?Ks?Ks.push(o):Ks=[o]:qs=o,t=yr(t,"onChange"),0<t.length&&(s=new wl("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var Ji=null,eo=null;function P_(e){qv(e,0)}function Al(e){var t=Yi(e);if($h(t))return e}function um(e,t){if(e==="change")return t}var dm=!1;if(Qn){var Hc;if(Qn){var Gc="oninput"in document;if(!Gc){var fm=document.createElement("div");fm.setAttribute("oninput","return;"),Gc=typeof fm.oninput=="function"}Hc=Gc}else Hc=!1;dm=Hc&&(!document.documentMode||9<document.documentMode)}function hm(){Ji&&(Ji.detachEvent("onpropertychange",mm),eo=Ji=null)}function mm(e){if(e.propertyName==="value"&&Al(eo)){var t=[];cm(t,eo,e,Rc(e)),Qh(P_,t)}}function $_(e,t,s){e==="focusin"?(hm(),Ji=t,eo=s,Ji.attachEvent("onpropertychange",mm)):e==="focusout"&&hm()}function q_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Al(eo)}function K_(e,t){if(e==="click")return Al(t)}function Y_(e,t){if(e==="input"||e==="change")return Al(t)}function F_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tn=typeof Object.is=="function"?Object.is:F_;function to(e,t){if(tn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var u=s[o];if(!Bs.call(t,u)||!tn(e[u],t[u]))return!1}return!0}function pm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vm(e,t){var s=pm(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=t&&o>=t)return{node:s,offset:t-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=pm(s)}}function gm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ym(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Tl(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Tl(e.document)}return t}function Pc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Z_=Qn&&"documentMode"in document&&11>=document.documentMode,Fs=null,$c=null,no=null,qc=!1;function bm(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;qc||Fs==null||Fs!==Tl(o)||(o=Fs,"selectionStart"in o&&Pc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),no&&to(no,o)||(no=o,o=yr($c,"onSelect"),0<o.length&&(t=new wl("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=Fs)))}function ns(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Zs={animationend:ns("Animation","AnimationEnd"),animationiteration:ns("Animation","AnimationIteration"),animationstart:ns("Animation","AnimationStart"),transitionrun:ns("Transition","TransitionRun"),transitionstart:ns("Transition","TransitionStart"),transitioncancel:ns("Transition","TransitionCancel"),transitionend:ns("Transition","TransitionEnd")},Kc={},xm={};Qn&&(xm=document.createElement("div").style,"AnimationEvent"in window||(delete Zs.animationend.animation,delete Zs.animationiteration.animation,delete Zs.animationstart.animation),"TransitionEvent"in window||delete Zs.transitionend.transition);function as(e){if(Kc[e])return Kc[e];if(!Zs[e])return e;var t=Zs[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in xm)return Kc[e]=t[s];return e}var _m=as("animationend"),Sm=as("animationiteration"),Tm=as("animationstart"),X_=as("transitionrun"),Q_=as("transitionstart"),W_=as("transitioncancel"),km=as("transitionend"),jm=new Map,Yc="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(" ");Yc.push("scrollEnd");function Mn(e,t){jm.set(e,t),es(t,[e])}var Dl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},yn=[],Xs=0,Fc=0;function Rl(){for(var e=Xs,t=Fc=Xs=0;t<e;){var s=yn[t];yn[t++]=null;var o=yn[t];yn[t++]=null;var u=yn[t];yn[t++]=null;var h=yn[t];if(yn[t++]=null,o!==null&&u!==null){var _=o.pending;_===null?u.next=u:(u.next=_.next,_.next=u),o.pending=u}h!==0&&Nm(s,u,h)}}function Ml(e,t,s,o){yn[Xs++]=e,yn[Xs++]=t,yn[Xs++]=s,yn[Xs++]=o,Fc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Zc(e,t,s,o){return Ml(e,t,s,o),Ol(e)}function ss(e,t){return Ml(e,null,null,t),Ol(e)}function Nm(e,t,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var u=!1,h=e.return;h!==null;)h.childLanes|=s,o=h.alternate,o!==null&&(o.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&t!==null&&(u=31-Ke(s),e=h.hiddenUpdates,o=e[u],o===null?e[u]=[t]:o.push(t),t.lane=s|536870912),h):null}function Ol(e){if(50<jo)throw jo=0,sd=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qs={};function J_(e,t,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(e,t,s,o){return new J_(e,t,s,o)}function Xc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wn(e,t){var s=e.alternate;return s===null?(s=nn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Cm(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Bl(e,t,s,o,u,h){var _=0;if(o=e,typeof e=="function")Xc(e)&&(_=1);else if(typeof e=="string")_=s1(e,s,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=nn(31,s,t,u),e.elementType=Y,e.lanes=h,e;case C:return is(s.children,u,h,t);case N:_=8,u|=24;break;case k:return e=nn(12,s,t,u|2),e.elementType=k,e.lanes=h,e;case E:return e=nn(13,s,t,u),e.elementType=E,e.lanes=h,e;case H:return e=nn(19,s,t,u),e.elementType=H,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:_=10;break e;case w:_=9;break e;case R:_=11;break e;case z:_=14;break e;case I:_=16,o=null;break e}_=29,s=Error(l(130,e===null?"null":typeof e,"")),o=null}return t=nn(_,s,t,u),t.elementType=e,t.type=o,t.lanes=h,t}function is(e,t,s,o){return e=nn(7,e,o,t),e.lanes=s,e}function Qc(e,t,s){return e=nn(6,e,null,t),e.lanes=s,e}function wm(e){var t=nn(18,null,null,0);return t.stateNode=e,t}function Wc(e,t,s){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Em=new WeakMap;function bn(e,t){if(typeof e=="object"&&e!==null){var s=Em.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Pi(t)},Em.set(e,t),t)}return{value:e,source:t,stack:Pi(t)}}var Ws=[],Js=0,Ll=null,ao=0,xn=[],_n=0,ja=null,zn=1,Un="";function Jn(e,t){Ws[Js++]=ao,Ws[Js++]=Ll,Ll=e,ao=t}function Am(e,t,s){xn[_n++]=zn,xn[_n++]=Un,xn[_n++]=ja,ja=e;var o=zn;e=Un;var u=32-Ke(o)-1;o&=~(1<<u),s+=1;var h=32-Ke(t)+u;if(30<h){var _=u-u%5;h=(o&(1<<_)-1).toString(32),o>>=_,u-=_,zn=1<<32-Ke(t)+u|s<<u|o,Un=h+e}else zn=1<<h|s<<u|o,Un=e}function Jc(e){e.return!==null&&(Jn(e,1),Am(e,1,0))}function eu(e){for(;e===Ll;)Ll=Ws[--Js],Ws[Js]=null,ao=Ws[--Js],Ws[Js]=null;for(;e===ja;)ja=xn[--_n],xn[_n]=null,Un=xn[--_n],xn[_n]=null,zn=xn[--_n],xn[_n]=null}function Dm(e,t){xn[_n++]=zn,xn[_n++]=Un,xn[_n++]=ja,zn=t.id,Un=t.overflow,ja=e}var Ot=null,at=null,Be=!1,Na=null,Sn=!1,tu=Error(l(519));function Ca(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw so(bn(t,e)),tu}function Rm(e){var t=e.stateNode,s=e.type,o=e.memoizedProps;switch(t[Mt]=e,t[qt]=o,s){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(s=0;s<Co.length;s++)De(Co[s],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),qh(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),Yh(t,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||o.suppressHydrationWarning===!0||Zv(t.textContent,s)?(o.popover!=null&&(De("beforetoggle",t),De("toggle",t)),o.onScroll!=null&&De("scroll",t),o.onScrollEnd!=null&&De("scrollend",t),o.onClick!=null&&(t.onclick=Xn),t=!0):t=!1,t||Ca(e,!0)}function Mm(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:Sn=!1;return;case 27:case 3:Sn=!0;return;default:Ot=Ot.return}}function ei(e){if(e!==Ot)return!1;if(!Be)return Mm(e),Be=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||bd(e.type,e.memoizedProps)),s=!s),s&&at&&Ca(e),Mm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));at=sg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));at=sg(e)}else t===27?(t=at,Ha(e.type)?(e=kd,kd=null,at=e):at=t):at=Ot?kn(e.stateNode.nextSibling):null;return!0}function os(){at=Ot=null,Be=!1}function nu(){var e=Na;return e!==null&&(Xt===null?Xt=e:Xt.push.apply(Xt,e),Na=null),e}function so(e){Na===null?Na=[e]:Na.push(e)}var au=be(null),ls=null,ea=null;function wa(e,t,s){xe(au,t._currentValue),t._currentValue=s}function ta(e){e._currentValue=au.current,Ce(au)}function su(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function iu(e,t,s,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var _=u.child;h=h.firstContext;e:for(;h!==null;){var T=h;h=u;for(var D=0;D<t.length;D++)if(T.context===t[D]){h.lanes|=s,T=h.alternate,T!==null&&(T.lanes|=s),su(h.return,s,e),o||(_=null);break e}h=T.next}}else if(u.tag===18){if(_=u.return,_===null)throw Error(l(341));_.lanes|=s,h=_.alternate,h!==null&&(h.lanes|=s),su(_,s,e),_=null}else _=u.child;if(_!==null)_.return=u;else for(_=u;_!==null;){if(_===e){_=null;break}if(u=_.sibling,u!==null){u.return=_.return,_=u;break}_=_.return}u=_}}function ti(e,t,s,o){e=null;for(var u=t,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var _=u.alternate;if(_===null)throw Error(l(387));if(_=_.memoizedProps,_!==null){var T=u.type;tn(u.pendingProps.value,_.value)||(e!==null?e.push(T):e=[T])}}else if(u===tt.current){if(_=u.alternate,_===null)throw Error(l(387));_.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Ro):e=[Ro])}u=u.return}e!==null&&iu(t,e,s,o),t.flags|=262144}function Il(e){for(e=e.firstContext;e!==null;){if(!tn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function rs(e){ls=e,ea=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Bt(e){return Om(ls,e)}function zl(e,t){return ls===null&&rs(e),Om(e,t)}function Om(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},ea===null){if(e===null)throw Error(l(308));ea=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ea=ea.next=t;return s}var eS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},tS=n.unstable_scheduleCallback,nS=n.unstable_NormalPriority,yt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ou(){return{controller:new eS,data:new Map,refCount:0}}function io(e){e.refCount--,e.refCount===0&&tS(nS,function(){e.controller.abort()})}var oo=null,lu=0,ni=0,ai=null;function aS(e,t){if(oo===null){var s=oo=[];lu=0,ni=ud(),ai={status:"pending",value:void 0,then:function(o){s.push(o)}}}return lu++,t.then(Bm,Bm),t}function Bm(){if(--lu===0&&oo!==null){ai!==null&&(ai.status="fulfilled");var e=oo;oo=null,ni=0,ai=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function sS(e,t){var s=[],o={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(o.status="rejected",o.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),o}var Lm=O.S;O.S=function(e,t){bv=Ut(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&aS(e,t),Lm!==null&&Lm(e,t)};var cs=be(null);function ru(){var e=cs.current;return e!==null?e:et.pooledCache}function Ul(e,t){t===null?xe(cs,cs.current):xe(cs,t.pool)}function Im(){var e=ru();return e===null?null:{parent:yt._currentValue,pool:e}}var si=Error(l(460)),cu=Error(l(474)),Vl=Error(l(542)),Hl={then:function(){}};function zm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Um(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Xn,Xn),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hm(e),e;default:if(typeof t.status=="string")t.then(Xn,Xn);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=o}},function(o){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hm(e),e}throw ds=t,si}}function us(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ds=s,si):s}}var ds=null;function Vm(){if(ds===null)throw Error(l(459));var e=ds;return ds=null,e}function Hm(e){if(e===si||e===Vl)throw Error(l(483))}var ii=null,lo=0;function Gl(e){var t=lo;return lo+=1,ii===null&&(ii=[]),Um(ii,e,t)}function ro(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Pl(e,t){throw t.$$typeof===x?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Gm(e){function t(B,M){if(e){var U=B.deletions;U===null?(B.deletions=[M],B.flags|=16):U.push(M)}}function s(B,M){if(!e)return null;for(;M!==null;)t(B,M),M=M.sibling;return null}function o(B){for(var M=new Map;B!==null;)B.key!==null?M.set(B.key,B):M.set(B.index,B),B=B.sibling;return M}function u(B,M){return B=Wn(B,M),B.index=0,B.sibling=null,B}function h(B,M,U){return B.index=U,e?(U=B.alternate,U!==null?(U=U.index,U<M?(B.flags|=67108866,M):U):(B.flags|=67108866,M)):(B.flags|=1048576,M)}function _(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function T(B,M,U,X){return M===null||M.tag!==6?(M=Qc(U,B.mode,X),M.return=B,M):(M=u(M,U),M.return=B,M)}function D(B,M,U,X){var me=U.type;return me===C?F(B,M,U.props.children,X,U.key):M!==null&&(M.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===I&&us(me)===M.type)?(M=u(M,U.props),ro(M,U),M.return=B,M):(M=Bl(U.type,U.key,U.props,null,B.mode,X),ro(M,U),M.return=B,M)}function V(B,M,U,X){return M===null||M.tag!==4||M.stateNode.containerInfo!==U.containerInfo||M.stateNode.implementation!==U.implementation?(M=Wc(U,B.mode,X),M.return=B,M):(M=u(M,U.children||[]),M.return=B,M)}function F(B,M,U,X,me){return M===null||M.tag!==7?(M=is(U,B.mode,X,me),M.return=B,M):(M=u(M,U),M.return=B,M)}function Q(B,M,U){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=Qc(""+M,B.mode,U),M.return=B,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case S:return U=Bl(M.type,M.key,M.props,null,B.mode,U),ro(U,M),U.return=B,U;case j:return M=Wc(M,B.mode,U),M.return=B,M;case I:return M=us(M),Q(B,M,U)}if(ae(M)||ie(M))return M=is(M,B.mode,U,null),M.return=B,M;if(typeof M.then=="function")return Q(B,Gl(M),U);if(M.$$typeof===A)return Q(B,zl(B,M),U);Pl(B,M)}return null}function G(B,M,U,X){var me=M!==null?M.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return me!==null?null:T(B,M,""+U,X);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return U.key===me?D(B,M,U,X):null;case j:return U.key===me?V(B,M,U,X):null;case I:return U=us(U),G(B,M,U,X)}if(ae(U)||ie(U))return me!==null?null:F(B,M,U,X,null);if(typeof U.then=="function")return G(B,M,Gl(U),X);if(U.$$typeof===A)return G(B,M,zl(B,U),X);Pl(B,U)}return null}function $(B,M,U,X,me){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return B=B.get(U)||null,T(M,B,""+X,me);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case S:return B=B.get(X.key===null?U:X.key)||null,D(M,B,X,me);case j:return B=B.get(X.key===null?U:X.key)||null,V(M,B,X,me);case I:return X=us(X),$(B,M,U,X,me)}if(ae(X)||ie(X))return B=B.get(U)||null,F(M,B,X,me,null);if(typeof X.then=="function")return $(B,M,U,Gl(X),me);if(X.$$typeof===A)return $(B,M,U,zl(M,X),me);Pl(M,X)}return null}function de(B,M,U,X){for(var me=null,He=null,he=M,we=M=0,Oe=null;he!==null&&we<U.length;we++){he.index>we?(Oe=he,he=null):Oe=he.sibling;var Ge=G(B,he,U[we],X);if(Ge===null){he===null&&(he=Oe);break}e&&he&&Ge.alternate===null&&t(B,he),M=h(Ge,M,we),He===null?me=Ge:He.sibling=Ge,He=Ge,he=Oe}if(we===U.length)return s(B,he),Be&&Jn(B,we),me;if(he===null){for(;we<U.length;we++)he=Q(B,U[we],X),he!==null&&(M=h(he,M,we),He===null?me=he:He.sibling=he,He=he);return Be&&Jn(B,we),me}for(he=o(he);we<U.length;we++)Oe=$(he,B,we,U[we],X),Oe!==null&&(e&&Oe.alternate!==null&&he.delete(Oe.key===null?we:Oe.key),M=h(Oe,M,we),He===null?me=Oe:He.sibling=Oe,He=Oe);return e&&he.forEach(function(Ka){return t(B,Ka)}),Be&&Jn(B,we),me}function ve(B,M,U,X){if(U==null)throw Error(l(151));for(var me=null,He=null,he=M,we=M=0,Oe=null,Ge=U.next();he!==null&&!Ge.done;we++,Ge=U.next()){he.index>we?(Oe=he,he=null):Oe=he.sibling;var Ka=G(B,he,Ge.value,X);if(Ka===null){he===null&&(he=Oe);break}e&&he&&Ka.alternate===null&&t(B,he),M=h(Ka,M,we),He===null?me=Ka:He.sibling=Ka,He=Ka,he=Oe}if(Ge.done)return s(B,he),Be&&Jn(B,we),me;if(he===null){for(;!Ge.done;we++,Ge=U.next())Ge=Q(B,Ge.value,X),Ge!==null&&(M=h(Ge,M,we),He===null?me=Ge:He.sibling=Ge,He=Ge);return Be&&Jn(B,we),me}for(he=o(he);!Ge.done;we++,Ge=U.next())Ge=$(he,B,we,Ge.value,X),Ge!==null&&(e&&Ge.alternate!==null&&he.delete(Ge.key===null?we:Ge.key),M=h(Ge,M,we),He===null?me=Ge:He.sibling=Ge,He=Ge);return e&&he.forEach(function(p1){return t(B,p1)}),Be&&Jn(B,we),me}function We(B,M,U,X){if(typeof U=="object"&&U!==null&&U.type===C&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case S:e:{for(var me=U.key;M!==null;){if(M.key===me){if(me=U.type,me===C){if(M.tag===7){s(B,M.sibling),X=u(M,U.props.children),X.return=B,B=X;break e}}else if(M.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===I&&us(me)===M.type){s(B,M.sibling),X=u(M,U.props),ro(X,U),X.return=B,B=X;break e}s(B,M);break}else t(B,M);M=M.sibling}U.type===C?(X=is(U.props.children,B.mode,X,U.key),X.return=B,B=X):(X=Bl(U.type,U.key,U.props,null,B.mode,X),ro(X,U),X.return=B,B=X)}return _(B);case j:e:{for(me=U.key;M!==null;){if(M.key===me)if(M.tag===4&&M.stateNode.containerInfo===U.containerInfo&&M.stateNode.implementation===U.implementation){s(B,M.sibling),X=u(M,U.children||[]),X.return=B,B=X;break e}else{s(B,M);break}else t(B,M);M=M.sibling}X=Wc(U,B.mode,X),X.return=B,B=X}return _(B);case I:return U=us(U),We(B,M,U,X)}if(ae(U))return de(B,M,U,X);if(ie(U)){if(me=ie(U),typeof me!="function")throw Error(l(150));return U=me.call(U),ve(B,M,U,X)}if(typeof U.then=="function")return We(B,M,Gl(U),X);if(U.$$typeof===A)return We(B,M,zl(B,U),X);Pl(B,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,M!==null&&M.tag===6?(s(B,M.sibling),X=u(M,U),X.return=B,B=X):(s(B,M),X=Qc(U,B.mode,X),X.return=B,B=X),_(B)):s(B,M)}return function(B,M,U,X){try{lo=0;var me=We(B,M,U,X);return ii=null,me}catch(he){if(he===si||he===Vl)throw he;var He=nn(29,he,null,B.mode);return He.lanes=X,He.return=B,He}finally{}}}var fs=Gm(!0),Pm=Gm(!1),Ea=!1;function uu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function du(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Aa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Da(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,($e&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,t=Ol(e),Nm(e,null,s),t}return Ml(e,o,t,s),Ol(e)}function co(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Oh(e,s)}}function fu(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=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?u=h=_:h=h.next=_,s=s.next}while(s!==null);h===null?u=h=t:h=h.next=t}else u=h=t;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var hu=!1;function uo(){if(hu){var e=ai;if(e!==null)throw e}}function fo(e,t,s,o){hu=!1;var u=e.updateQueue;Ea=!1;var h=u.firstBaseUpdate,_=u.lastBaseUpdate,T=u.shared.pending;if(T!==null){u.shared.pending=null;var D=T,V=D.next;D.next=null,_===null?h=V:_.next=V,_=D;var F=e.alternate;F!==null&&(F=F.updateQueue,T=F.lastBaseUpdate,T!==_&&(T===null?F.firstBaseUpdate=V:T.next=V,F.lastBaseUpdate=D))}if(h!==null){var Q=u.baseState;_=0,F=V=D=null,T=h;do{var G=T.lane&-536870913,$=G!==T.lane;if($?(Me&G)===G:(o&G)===G){G!==0&&G===ni&&(hu=!0),F!==null&&(F=F.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var de=e,ve=T;G=t;var We=s;switch(ve.tag){case 1:if(de=ve.payload,typeof de=="function"){Q=de.call(We,Q,G);break e}Q=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=ve.payload,G=typeof de=="function"?de.call(We,Q,G):de,G==null)break e;Q=b({},Q,G);break e;case 2:Ea=!0}}G=T.callback,G!==null&&(e.flags|=64,$&&(e.flags|=8192),$=u.callbacks,$===null?u.callbacks=[G]:$.push(G))}else $={lane:G,tag:T.tag,payload:T.payload,callback:T.callback,next:null},F===null?(V=F=$,D=Q):F=F.next=$,_|=G;if(T=T.next,T===null){if(T=u.shared.pending,T===null)break;$=T,T=$.next,$.next=null,u.lastBaseUpdate=$,u.shared.pending=null}}while(!0);F===null&&(D=Q),u.baseState=D,u.firstBaseUpdate=V,u.lastBaseUpdate=F,h===null&&(u.shared.lanes=0),La|=_,e.lanes=_,e.memoizedState=Q}}function $m(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function qm(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)$m(s[e],t)}var oi=be(null),$l=be(0);function Km(e,t){e=ua,xe($l,e),xe(oi,t),ua=e|t.baseLanes}function mu(){xe($l,ua),xe(oi,oi.current)}function pu(){ua=$l.current,Ce(oi),Ce($l)}var an=be(null),Tn=null;function Ra(e){var t=e.alternate;xe(pt,pt.current&1),xe(an,e),Tn===null&&(t===null||oi.current!==null||t.memoizedState!==null)&&(Tn=e)}function vu(e){xe(pt,pt.current),xe(an,e),Tn===null&&(Tn=e)}function Ym(e){e.tag===22?(xe(pt,pt.current),xe(an,e),Tn===null&&(Tn=e)):Ma()}function Ma(){xe(pt,pt.current),xe(an,an.current)}function sn(e){Ce(an),Tn===e&&(Tn=null),Ce(pt)}var pt=be(0);function ql(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Sd(s)||Td(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var na=0,Ne=null,Xe=null,bt=null,Kl=!1,li=!1,hs=!1,Yl=0,ho=0,ri=null,iS=0;function ft(){throw Error(l(321))}function gu(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!tn(e[s],t[s]))return!1;return!0}function yu(e,t,s,o,u,h){return na=h,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Ap:Mu,hs=!1,h=s(o,u),hs=!1,li&&(h=Zm(t,s,o,u)),Fm(e),h}function Fm(e){O.H=vo;var t=Xe!==null&&Xe.next!==null;if(na=0,bt=Xe=Ne=null,Kl=!1,ho=0,ri=null,t)throw Error(l(300));e===null||xt||(e=e.dependencies,e!==null&&Il(e)&&(xt=!0))}function Zm(e,t,s,o){Ne=e;var u=0;do{if(li&&(ri=null),ho=0,li=!1,25<=u)throw Error(l(301));if(u+=1,bt=Xe=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}O.H=Dp,h=t(s,o)}while(li);return h}function oS(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?mo(t):t,e=e.useState()[0],(Xe!==null?Xe.memoizedState:null)!==e&&(Ne.flags|=1024),t}function bu(){var e=Yl!==0;return Yl=0,e}function xu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function _u(e){if(Kl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Kl=!1}na=0,bt=Xe=Ne=null,li=!1,ho=Yl=0,ri=null}function Pt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Ne.memoizedState=bt=e:bt=bt.next=e,bt}function vt(){if(Xe===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=bt===null?Ne.memoizedState:bt.next;if(t!==null)bt=t,Xe=e;else{if(e===null)throw Ne.alternate===null?Error(l(467)):Error(l(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},bt===null?Ne.memoizedState=bt=e:bt=bt.next=e}return bt}function Fl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function mo(e){var t=ho;return ho+=1,ri===null&&(ri=[]),e=Um(ri,e,t),t=Ne,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Ap:Mu),e}function Zl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return mo(e);if(e.$$typeof===A)return Bt(e)}throw Error(l(438,String(e)))}function Su(e){var t=null,s=Ne.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var o=Ne.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Fl(),Ne.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),o=0;o<e;o++)s[o]=ee;return t.index++,s}function aa(e,t){return typeof t=="function"?t(e):t}function Xl(e){var t=vt();return Tu(t,Xe,e)}function Tu(e,t,s){var o=e.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=s;var u=e.baseQueue,h=o.pending;if(h!==null){if(u!==null){var _=u.next;u.next=h.next,h.next=_}t.baseQueue=u=h,o.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var T=_=null,D=null,V=t,F=!1;do{var Q=V.lane&-536870913;if(Q!==V.lane?(Me&Q)===Q:(na&Q)===Q){var G=V.revertLane;if(G===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),Q===ni&&(F=!0);else if((na&G)===G){V=V.next,G===ni&&(F=!0);continue}else Q={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(T=D=Q,_=h):D=D.next=Q,Ne.lanes|=G,La|=G;Q=V.action,hs&&s(h,Q),h=V.hasEagerState?V.eagerState:s(h,Q)}else G={lane:Q,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(T=D=G,_=h):D=D.next=G,Ne.lanes|=Q,La|=Q;V=V.next}while(V!==null&&V!==t);if(D===null?_=h:D.next=T,!tn(h,e.memoizedState)&&(xt=!0,F&&(s=ai,s!==null)))throw s;e.memoizedState=h,e.baseState=_,e.baseQueue=D,o.lastRenderedState=h}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function ku(e){var t=vt(),s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var o=s.dispatch,u=s.pending,h=t.memoizedState;if(u!==null){s.pending=null;var _=u=u.next;do h=e(h,_.action),_=_.next;while(_!==u);tn(h,t.memoizedState)||(xt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,o]}function Xm(e,t,s){var o=Ne,u=vt(),h=Be;if(h){if(s===void 0)throw Error(l(407));s=s()}else s=t();var _=!tn((Xe||u).memoizedState,s);if(_&&(u.memoizedState=s,xt=!0),u=u.queue,Cu(Jm.bind(null,o,u,e),[e]),u.getSnapshot!==t||_||bt!==null&&bt.memoizedState.tag&1){if(o.flags|=2048,ci(9,{destroy:void 0},Wm.bind(null,o,u,s,t),null),et===null)throw Error(l(349));h||(na&127)!==0||Qm(o,t,s)}return s}function Qm(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ne.updateQueue,t===null?(t=Fl(),Ne.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Wm(e,t,s,o){t.value=s,t.getSnapshot=o,ep(t)&&tp(e)}function Jm(e,t,s){return s(function(){ep(t)&&tp(e)})}function ep(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!tn(e,s)}catch{return!0}}function tp(e){var t=ss(e,2);t!==null&&Qt(t,e,2)}function ju(e){var t=Pt();if(typeof e=="function"){var s=e;if(e=s(),hs){Ue(!0);try{s()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:e},t}function np(e,t,s,o){return e.baseState=s,Tu(e,Xe,typeof o=="function"?o:aa)}function lS(e,t,s,o,u){if(Jl(e))throw Error(l(485));if(e=t.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){h.listeners.push(_)}};O.T!==null?s(!0):h.isTransition=!1,o(h),s=t.pending,s===null?(h.next=t.pending=h,ap(t,h)):(h.next=s.next,t.pending=s.next=h)}}function ap(e,t){var s=t.action,o=t.payload,u=e.state;if(t.isTransition){var h=O.T,_={};O.T=_;try{var T=s(u,o),D=O.S;D!==null&&D(_,T),sp(e,t,T)}catch(V){Nu(e,t,V)}finally{h!==null&&_.types!==null&&(h.types=_.types),O.T=h}}else try{h=s(u,o),sp(e,t,h)}catch(V){Nu(e,t,V)}}function sp(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){ip(e,t,o)},function(o){return Nu(e,t,o)}):ip(e,t,s)}function ip(e,t,s){t.status="fulfilled",t.value=s,op(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,ap(e,s)))}function Nu(e,t,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=s,op(t),t=t.next;while(t!==o)}e.action=null}function op(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function lp(e,t){return t}function rp(e,t){if(Be){var s=et.formState;if(s!==null){e:{var o=Ne;if(Be){if(at){t:{for(var u=at,h=Sn;u.nodeType!==8;){if(!h){u=null;break t}if(u=kn(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){at=kn(u.nextSibling),o=u.data==="F!";break e}}Ca(o)}o=!1}o&&(t=s[0])}}return s=Pt(),s.memoizedState=s.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lp,lastRenderedState:t},s.queue=o,s=Cp.bind(null,Ne,o),o.dispatch=s,o=ju(!1),h=Ru.bind(null,Ne,!1,o.queue),o=Pt(),u={state:t,dispatch:null,action:e,pending:null},o.queue=u,s=lS.bind(null,Ne,u,h,s),u.dispatch=s,o.memoizedState=e,[t,s,!1]}function cp(e){var t=vt();return up(t,Xe,e)}function up(e,t,s){if(t=Tu(e,t,lp)[0],e=Xl(aa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=mo(t)}catch(_){throw _===si?Vl:_}else o=t;t=vt();var u=t.queue,h=u.dispatch;return s!==t.memoizedState&&(Ne.flags|=2048,ci(9,{destroy:void 0},rS.bind(null,u,s),null)),[o,h,e]}function rS(e,t){e.action=t}function dp(e){var t=vt(),s=Xe;if(s!==null)return up(t,s,e);vt(),t=t.memoizedState,s=vt();var o=s.queue.dispatch;return s.memoizedState=e,[t,o,!1]}function ci(e,t,s,o){return e={tag:e,create:s,deps:o,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=Fl(),Ne.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,t.lastEffect=e),e}function fp(){return vt().memoizedState}function Ql(e,t,s,o){var u=Pt();Ne.flags|=e,u.memoizedState=ci(1|t,{destroy:void 0},s,o===void 0?null:o)}function Wl(e,t,s,o){var u=vt();o=o===void 0?null:o;var h=u.memoizedState.inst;Xe!==null&&o!==null&&gu(o,Xe.memoizedState.deps)?u.memoizedState=ci(t,h,s,o):(Ne.flags|=e,u.memoizedState=ci(1|t,h,s,o))}function hp(e,t){Ql(8390656,8,e,t)}function Cu(e,t){Wl(2048,8,e,t)}function cS(e){Ne.flags|=4;var t=Ne.updateQueue;if(t===null)t=Fl(),Ne.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function mp(e){var t=vt().memoizedState;return cS({ref:t,nextImpl:e}),function(){if(($e&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function pp(e,t){return Wl(4,2,e,t)}function vp(e,t){return Wl(4,4,e,t)}function gp(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function yp(e,t,s){s=s!=null?s.concat([e]):null,Wl(4,4,gp.bind(null,t,e),s)}function wu(){}function bp(e,t){var s=vt();t=t===void 0?null:t;var o=s.memoizedState;return t!==null&&gu(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function xp(e,t){var s=vt();t=t===void 0?null:t;var o=s.memoizedState;if(t!==null&&gu(t,o[1]))return o[0];if(o=e(),hs){Ue(!0);try{e()}finally{Ue(!1)}}return s.memoizedState=[o,t],o}function Eu(e,t,s){return s===void 0||(na&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=_v(),Ne.lanes|=e,La|=e,s)}function _p(e,t,s,o){return tn(s,t)?s:oi.current!==null?(e=Eu(e,s,o),tn(e,t)||(xt=!0),e):(na&42)===0||(na&1073741824)!==0&&(Me&261930)===0?(xt=!0,e.memoizedState=s):(e=_v(),Ne.lanes|=e,La|=e,t)}function Sp(e,t,s,o,u){var h=P.p;P.p=h!==0&&8>h?h:8;var _=O.T,T={};O.T=T,Ru(e,!1,t,s);try{var D=u(),V=O.S;if(V!==null&&V(T,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var F=sS(D,o);po(e,t,F,rn(e))}else po(e,t,o,rn(e))}catch(Q){po(e,t,{then:function(){},status:"rejected",reason:Q},rn())}finally{P.p=h,_!==null&&T.types!==null&&(_.types=T.types),O.T=_}}function uS(){}function Au(e,t,s,o){if(e.tag!==5)throw Error(l(476));var u=Tp(e).queue;Sp(e,u,t,se,s===null?uS:function(){return kp(e),s(o)})}function Tp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:se},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function kp(e){var t=Tp(e);t.next===null&&(t=e.alternate.memoizedState),po(e,t.next.queue,{},rn())}function Du(){return Bt(Ro)}function jp(){return vt().memoizedState}function Np(){return vt().memoizedState}function dS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=rn();e=Aa(s);var o=Da(t,e,s);o!==null&&(Qt(o,t,s),co(o,t,s)),t={cache:ou()},e.payload=t;return}t=t.return}}function fS(e,t,s){var o=rn();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Jl(e)?wp(t,s):(s=Zc(e,t,s,o),s!==null&&(Qt(s,e,o),Ep(s,t,o)))}function Cp(e,t,s){var o=rn();po(e,t,s,o)}function po(e,t,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Jl(e))wp(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var _=t.lastRenderedState,T=h(_,s);if(u.hasEagerState=!0,u.eagerState=T,tn(T,_))return Ml(e,t,u,0),et===null&&Rl(),!1}catch{}finally{}if(s=Zc(e,t,u,o),s!==null)return Qt(s,e,o),Ep(s,t,o),!0}return!1}function Ru(e,t,s,o){if(o={lane:2,revertLane:ud(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Jl(e)){if(t)throw Error(l(479))}else t=Zc(e,s,o,2),t!==null&&Qt(t,e,2)}function Jl(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function wp(e,t){li=Kl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Ep(e,t,s){if((s&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Oh(e,s)}}var vo={readContext:Bt,use:Zl,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};vo.useEffectEvent=ft;var Ap={readContext:Bt,use:Zl,useCallback:function(e,t){return Pt().memoizedState=[e,t===void 0?null:t],e},useContext:Bt,useEffect:hp,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Ql(4194308,4,gp.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Ql(4194308,4,e,t)},useInsertionEffect:function(e,t){Ql(4,2,e,t)},useMemo:function(e,t){var s=Pt();t=t===void 0?null:t;var o=e();if(hs){Ue(!0);try{e()}finally{Ue(!1)}}return s.memoizedState=[o,t],o},useReducer:function(e,t,s){var o=Pt();if(s!==void 0){var u=s(t);if(hs){Ue(!0);try{s(t)}finally{Ue(!1)}}}else u=t;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=fS.bind(null,Ne,e),[o.memoizedState,e]},useRef:function(e){var t=Pt();return e={current:e},t.memoizedState=e},useState:function(e){e=ju(e);var t=e.queue,s=Cp.bind(null,Ne,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:wu,useDeferredValue:function(e,t){var s=Pt();return Eu(s,e,t)},useTransition:function(){var e=ju(!1);return e=Sp.bind(null,Ne,e.queue,!0,!1),Pt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var o=Ne,u=Pt();if(Be){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),et===null)throw Error(l(349));(Me&127)!==0||Qm(o,t,s)}u.memoizedState=s;var h={value:s,getSnapshot:t};return u.queue=h,hp(Jm.bind(null,o,h,e),[e]),o.flags|=2048,ci(9,{destroy:void 0},Wm.bind(null,o,h,s,t),null),s},useId:function(){var e=Pt(),t=et.identifierPrefix;if(Be){var s=Un,o=zn;s=(o&~(1<<32-Ke(o)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Yl++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=iS++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Du,useFormState:rp,useActionState:rp,useOptimistic:function(e){var t=Pt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Ru.bind(null,Ne,!0,s),s.dispatch=t,[e,t]},useMemoCache:Su,useCacheRefresh:function(){return Pt().memoizedState=dS.bind(null,Ne)},useEffectEvent:function(e){var t=Pt(),s={impl:e};return t.memoizedState=s,function(){if(($e&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},Mu={readContext:Bt,use:Zl,useCallback:bp,useContext:Bt,useEffect:Cu,useImperativeHandle:yp,useInsertionEffect:pp,useLayoutEffect:vp,useMemo:xp,useReducer:Xl,useRef:fp,useState:function(){return Xl(aa)},useDebugValue:wu,useDeferredValue:function(e,t){var s=vt();return _p(s,Xe.memoizedState,e,t)},useTransition:function(){var e=Xl(aa)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:mo(e),t]},useSyncExternalStore:Xm,useId:jp,useHostTransitionStatus:Du,useFormState:cp,useActionState:cp,useOptimistic:function(e,t){var s=vt();return np(s,Xe,e,t)},useMemoCache:Su,useCacheRefresh:Np};Mu.useEffectEvent=mp;var Dp={readContext:Bt,use:Zl,useCallback:bp,useContext:Bt,useEffect:Cu,useImperativeHandle:yp,useInsertionEffect:pp,useLayoutEffect:vp,useMemo:xp,useReducer:ku,useRef:fp,useState:function(){return ku(aa)},useDebugValue:wu,useDeferredValue:function(e,t){var s=vt();return Xe===null?Eu(s,e,t):_p(s,Xe.memoizedState,e,t)},useTransition:function(){var e=ku(aa)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:mo(e),t]},useSyncExternalStore:Xm,useId:jp,useHostTransitionStatus:Du,useFormState:dp,useActionState:dp,useOptimistic:function(e,t){var s=vt();return Xe!==null?np(s,Xe,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Su,useCacheRefresh:Np};Dp.useEffectEvent=mp;function Ou(e,t,s,o){t=e.memoizedState,s=s(o,t),s=s==null?t:b({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Bu={enqueueSetState:function(e,t,s){e=e._reactInternals;var o=rn(),u=Aa(o);u.payload=t,s!=null&&(u.callback=s),t=Da(e,u,o),t!==null&&(Qt(t,e,o),co(t,e,o))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=rn(),u=Aa(o);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=Da(e,u,o),t!==null&&(Qt(t,e,o),co(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=rn(),o=Aa(s);o.tag=2,t!=null&&(o.callback=t),t=Da(e,o,s),t!==null&&(Qt(t,e,s),co(t,e,s))}};function Rp(e,t,s,o,u,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,_):t.prototype&&t.prototype.isPureReactComponent?!to(s,o)||!to(u,h):!0}function Mp(e,t,s,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,o),t.state!==e&&Bu.enqueueReplaceState(t,t.state,null)}function ms(e,t){var s=t;if("ref"in t){s={};for(var o in t)o!=="ref"&&(s[o]=t[o])}if(e=e.defaultProps){s===t&&(s=b({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function Op(e){Dl(e)}function Bp(e){console.error(e)}function Lp(e){Dl(e)}function er(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function Ip(e,t,s){try{var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Lu(e,t,s){return s=Aa(s),s.tag=3,s.payload={element:null},s.callback=function(){er(e,t)},s}function zp(e){return e=Aa(e),e.tag=3,e}function Up(e,t,s,o){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var h=o.value;e.payload=function(){return u(h)},e.callback=function(){Ip(t,s,o)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){Ip(t,s,o),typeof u!="function"&&(Ia===null?Ia=new Set([this]):Ia.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})})}function hS(e,t,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=s.alternate,t!==null&&ti(t,s,u,!0),s=an.current,s!==null){switch(s.tag){case 31:case 13:return Tn===null?fr():s.alternate===null&&ht===0&&(ht=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===Hl?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([o]):t.add(o),ld(e,o,u)),!1;case 22:return s.flags|=65536,o===Hl?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([o]):s.add(o)),ld(e,o,u)),!1}throw Error(l(435,s.tag))}return ld(e,o,u),fr(),!1}if(Be)return t=an.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,o!==tu&&(e=Error(l(422),{cause:o}),so(bn(e,s)))):(o!==tu&&(t=Error(l(423),{cause:o}),so(bn(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=bn(o,s),u=Lu(e.stateNode,o,u),fu(e,u),ht!==4&&(ht=2)),!1;var h=Error(l(520),{cause:o});if(h=bn(h,s),ko===null?ko=[h]:ko.push(h),ht!==4&&(ht=2),t===null)return!0;o=bn(o,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=Lu(s.stateNode,o,e),fu(s,e),!1;case 1:if(t=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Ia===null||!Ia.has(h))))return s.flags|=65536,u&=-u,s.lanes|=u,u=zp(u),Up(u,e,s,o),fu(s,u),!1}s=s.return}while(s!==null);return!1}var Iu=Error(l(461)),xt=!1;function Lt(e,t,s,o){t.child=e===null?Pm(t,null,s,o):fs(t,e.child,s,o)}function Vp(e,t,s,o,u){s=s.render;var h=t.ref;if("ref"in o){var _={};for(var T in o)T!=="ref"&&(_[T]=o[T])}else _=o;return rs(t),o=yu(e,t,s,_,h,u),T=bu(),e!==null&&!xt?(xu(e,t,u),sa(e,t,u)):(Be&&T&&Jc(t),t.flags|=1,Lt(e,t,o,u),t.child)}function Hp(e,t,s,o,u){if(e===null){var h=s.type;return typeof h=="function"&&!Xc(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,Gp(e,t,h,o,u)):(e=Bl(s.type,null,o,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!qu(e,u)){var _=h.memoizedProps;if(s=s.compare,s=s!==null?s:to,s(_,o)&&e.ref===t.ref)return sa(e,t,u)}return t.flags|=1,e=Wn(h,o),e.ref=t.ref,e.return=t,t.child=e}function Gp(e,t,s,o,u){if(e!==null){var h=e.memoizedProps;if(to(h,o)&&e.ref===t.ref)if(xt=!1,t.pendingProps=o=h,qu(e,u))(e.flags&131072)!==0&&(xt=!0);else return t.lanes=e.lanes,sa(e,t,u)}return zu(e,t,s,o,u)}function Pp(e,t,s,o){var u=o.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(o=t.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~h}else o=0,t.child=null;return $p(e,t,h,s,o)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ul(t,h!==null?h.cachePool:null),h!==null?Km(t,h):mu(),Ym(t);else return o=t.lanes=536870912,$p(e,t,h!==null?h.baseLanes|s:s,s,o)}else h!==null?(Ul(t,h.cachePool),Km(t,h),Ma(),t.memoizedState=null):(e!==null&&Ul(t,null),mu(),Ma());return Lt(e,t,u,s),t.child}function go(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $p(e,t,s,o,u){var h=ru();return h=h===null?null:{parent:yt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&Ul(t,null),mu(),Ym(t),e!==null&&ti(e,t,o,!0),t.childLanes=u,null}function tr(e,t){return t=ar({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function qp(e,t,s){return fs(t,e.child,null,s),e=tr(t,t.pendingProps),e.flags|=2,sn(t),t.memoizedState=null,e}function mS(e,t,s){var o=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Be){if(o.mode==="hidden")return e=tr(t,o),t.lanes=536870912,go(null,e);if(vu(t),(e=at)?(e=ag(e,Sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ja!==null?{id:zn,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},s=wm(e),s.return=t,t.child=s,Ot=t,at=null)):e=null,e===null)throw Ca(t);return t.lanes=536870912,null}return tr(t,o)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(vu(t),u)if(t.flags&256)t.flags&=-257,t=qp(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(xt||ti(e,t,s,!1),u=(s&e.childLanes)!==0,xt||u){if(o=et,o!==null&&(_=Bh(o,s),_!==0&&_!==h.retryLane))throw h.retryLane=_,ss(e,_),Qt(o,e,_),Iu;fr(),t=qp(e,t,s)}else e=h.treeContext,at=kn(_.nextSibling),Ot=t,Be=!0,Na=null,Sn=!1,e!==null&&Dm(t,e),t=tr(t,o),t.flags|=4096;return t}return e=Wn(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function nr(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(l(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function zu(e,t,s,o,u){return rs(t),s=yu(e,t,s,o,void 0,u),o=bu(),e!==null&&!xt?(xu(e,t,u),sa(e,t,u)):(Be&&o&&Jc(t),t.flags|=1,Lt(e,t,s,u),t.child)}function Kp(e,t,s,o,u,h){return rs(t),t.updateQueue=null,s=Zm(t,o,s,u),Fm(e),o=bu(),e!==null&&!xt?(xu(e,t,h),sa(e,t,h)):(Be&&o&&Jc(t),t.flags|=1,Lt(e,t,s,h),t.child)}function Yp(e,t,s,o,u){if(rs(t),t.stateNode===null){var h=Qs,_=s.contextType;typeof _=="object"&&_!==null&&(h=Bt(_)),h=new s(o,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Bu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=o,h.state=t.memoizedState,h.refs={},uu(t),_=s.contextType,h.context=typeof _=="object"&&_!==null?Bt(_):Qs,h.state=t.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Ou(t,s,_,o),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(_=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),_!==h.state&&Bu.enqueueReplaceState(h,h.state,null),fo(t,o,h,u),uo(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){h=t.stateNode;var T=t.memoizedProps,D=ms(s,T);h.props=D;var V=h.context,F=s.contextType;_=Qs,typeof F=="object"&&F!==null&&(_=Bt(F));var Q=s.getDerivedStateFromProps;F=typeof Q=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,F||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||V!==_)&&Mp(t,h,o,_),Ea=!1;var G=t.memoizedState;h.state=G,fo(t,o,h,u),uo(),V=t.memoizedState,T||G!==V||Ea?(typeof Q=="function"&&(Ou(t,s,Q,o),V=t.memoizedState),(D=Ea||Rp(t,s,D,o,G,V,_))?(F||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=V),h.props=o,h.state=V,h.context=_,o=D):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{h=t.stateNode,du(e,t),_=t.memoizedProps,F=ms(s,_),h.props=F,Q=t.pendingProps,G=h.context,V=s.contextType,D=Qs,typeof V=="object"&&V!==null&&(D=Bt(V)),T=s.getDerivedStateFromProps,(V=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==Q||G!==D)&&Mp(t,h,o,D),Ea=!1,G=t.memoizedState,h.state=G,fo(t,o,h,u),uo();var $=t.memoizedState;_!==Q||G!==$||Ea||e!==null&&e.dependencies!==null&&Il(e.dependencies)?(typeof T=="function"&&(Ou(t,s,T,o),$=t.memoizedState),(F=Ea||Rp(t,s,F,o,G,$,D)||e!==null&&e.dependencies!==null&&Il(e.dependencies))?(V||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,$,D),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,$,D)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=$),h.props=o,h.state=$,h.context=D,o=F):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),o=!1)}return h=o,nr(e,t),o=(t.flags&128)!==0,h||o?(h=t.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&o?(t.child=fs(t,e.child,null,u),t.child=fs(t,null,s,u)):Lt(e,t,s,u),t.memoizedState=h.state,e=t.child):e=sa(e,t,u),e}function Fp(e,t,s,o){return os(),t.flags|=256,Lt(e,t,s,o),t.child}var Uu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vu(e){return{baseLanes:e,cachePool:Im()}}function Hu(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=ln),e}function Zp(e,t,s){var o=t.pendingProps,u=!1,h=(t.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),_&&(u=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(u?Ra(t):Ma(),(e=at)?(e=ag(e,Sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ja!==null?{id:zn,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},s=wm(e),s.return=t,t.child=s,Ot=t,at=null)):e=null,e===null)throw Ca(t);return Td(e)?t.lanes=32:t.lanes=536870912,null}var T=o.children;return o=o.fallback,u?(Ma(),u=t.mode,T=ar({mode:"hidden",children:T},u),o=is(o,u,s,null),T.return=t,o.return=t,T.sibling=o,t.child=T,o=t.child,o.memoizedState=Vu(s),o.childLanes=Hu(e,_,s),t.memoizedState=Uu,go(null,o)):(Ra(t),Gu(t,T))}var D=e.memoizedState;if(D!==null&&(T=D.dehydrated,T!==null)){if(h)t.flags&256?(Ra(t),t.flags&=-257,t=Pu(e,t,s)):t.memoizedState!==null?(Ma(),t.child=e.child,t.flags|=128,t=null):(Ma(),T=o.fallback,u=t.mode,o=ar({mode:"visible",children:o.children},u),T=is(T,u,s,null),T.flags|=2,o.return=t,T.return=t,o.sibling=T,t.child=o,fs(t,e.child,null,s),o=t.child,o.memoizedState=Vu(s),o.childLanes=Hu(e,_,s),t.memoizedState=Uu,t=go(null,o));else if(Ra(t),Td(T)){if(_=T.nextSibling&&T.nextSibling.dataset,_)var V=_.dgst;_=V,o=Error(l(419)),o.stack="",o.digest=_,so({value:o,source:null,stack:null}),t=Pu(e,t,s)}else if(xt||ti(e,t,s,!1),_=(s&e.childLanes)!==0,xt||_){if(_=et,_!==null&&(o=Bh(_,s),o!==0&&o!==D.retryLane))throw D.retryLane=o,ss(e,o),Qt(_,e,o),Iu;Sd(T)||fr(),t=Pu(e,t,s)}else Sd(T)?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,at=kn(T.nextSibling),Ot=t,Be=!0,Na=null,Sn=!1,e!==null&&Dm(t,e),t=Gu(t,o.children),t.flags|=4096);return t}return u?(Ma(),T=o.fallback,u=t.mode,D=e.child,V=D.sibling,o=Wn(D,{mode:"hidden",children:o.children}),o.subtreeFlags=D.subtreeFlags&65011712,V!==null?T=Wn(V,T):(T=is(T,u,s,null),T.flags|=2),T.return=t,o.return=t,o.sibling=T,t.child=o,go(null,o),o=t.child,T=e.child.memoizedState,T===null?T=Vu(s):(u=T.cachePool,u!==null?(D=yt._currentValue,u=u.parent!==D?{parent:D,pool:D}:u):u=Im(),T={baseLanes:T.baseLanes|s,cachePool:u}),o.memoizedState=T,o.childLanes=Hu(e,_,s),t.memoizedState=Uu,go(e.child,o)):(Ra(t),s=e.child,e=s.sibling,s=Wn(s,{mode:"visible",children:o.children}),s.return=t,s.sibling=null,e!==null&&(_=t.deletions,_===null?(t.deletions=[e],t.flags|=16):_.push(e)),t.child=s,t.memoizedState=null,s)}function Gu(e,t){return t=ar({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ar(e,t){return e=nn(22,e,null,t),e.lanes=0,e}function Pu(e,t,s){return fs(t,e.child,null,s),e=Gu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xp(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),su(e.return,t,s)}function $u(e,t,s,o,u,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u,treeForkCount:h}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=o,_.tail=s,_.tailMode=u,_.treeForkCount=h)}function Qp(e,t,s){var o=t.pendingProps,u=o.revealOrder,h=o.tail;o=o.children;var _=pt.current,T=(_&2)!==0;if(T?(_=_&1|2,t.flags|=128):_&=1,xe(pt,_),Lt(e,t,o,s),o=Be?ao:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xp(e,s,t);else if(e.tag===19)Xp(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(s=t.child,u=null;s!==null;)e=s.alternate,e!==null&&ql(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),$u(t,!1,u,s,h,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&ql(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}$u(t,!0,s,null,h,o);break;case"together":$u(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function sa(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),La|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(ti(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,s=Wn(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Wn(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function qu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Il(e)))}function pS(e,t,s){switch(t.tag){case 3:Re(t,t.stateNode.containerInfo),wa(t,yt,e.memoizedState.cache),os();break;case 27:case 5:_a(t);break;case 4:Re(t,t.stateNode.containerInfo);break;case 10:wa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,vu(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Ra(t),t.flags|=128,null):(s&t.child.childLanes)!==0?Zp(e,t,s):(Ra(t),e=sa(e,t,s),e!==null?e.sibling:null);Ra(t);break;case 19:var u=(e.flags&128)!==0;if(o=(s&t.childLanes)!==0,o||(ti(e,t,s,!1),o=(s&t.childLanes)!==0),u){if(o)return Qp(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),xe(pt,pt.current),o)break;return null;case 22:return t.lanes=0,Pp(e,t,s,t.pendingProps);case 24:wa(t,yt,e.memoizedState.cache)}return sa(e,t,s)}function Wp(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)xt=!0;else{if(!qu(e,s)&&(t.flags&128)===0)return xt=!1,pS(e,t,s);xt=(e.flags&131072)!==0}else xt=!1,Be&&(t.flags&1048576)!==0&&Am(t,ao,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=us(t.elementType),t.type=e,typeof e=="function")Xc(e)?(o=ms(e,o),t.tag=1,t=Yp(null,t,e,o,s)):(t.tag=0,t=zu(null,t,e,o,s));else{if(e!=null){var u=e.$$typeof;if(u===R){t.tag=11,t=Vp(null,t,e,o,s);break e}else if(u===z){t.tag=14,t=Hp(null,t,e,o,s);break e}}throw t=K(e)||e,Error(l(306,t,""))}}return t;case 0:return zu(e,t,t.type,t.pendingProps,s);case 1:return o=t.type,u=ms(o,t.pendingProps),Yp(e,t,o,u,s);case 3:e:{if(Re(t,t.stateNode.containerInfo),e===null)throw Error(l(387));o=t.pendingProps;var h=t.memoizedState;u=h.element,du(e,t),fo(t,o,null,s);var _=t.memoizedState;if(o=_.cache,wa(t,yt,o),o!==h.cache&&iu(t,[yt],s,!0),uo(),o=_.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=Fp(e,t,o,s);break e}else if(o!==u){u=bn(Error(l(424)),t),so(u),t=Fp(e,t,o,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(at=kn(e.firstChild),Ot=t,Be=!0,Na=null,Sn=!0,s=Pm(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(os(),o===u){t=sa(e,t,s);break e}Lt(e,t,o,s)}t=t.child}return t;case 26:return nr(e,t),e===null?(s=cg(t.type,null,t.pendingProps,null))?t.memoizedState=s:Be||(s=t.type,e=t.pendingProps,o=br(W.current).createElement(s),o[Mt]=t,o[qt]=e,It(o,s,e),Dt(o),t.stateNode=o):t.memoizedState=cg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _a(t),e===null&&Be&&(o=t.stateNode=og(t.type,t.pendingProps,W.current),Ot=t,Sn=!0,u=at,Ha(t.type)?(kd=u,at=kn(o.firstChild)):at=u),Lt(e,t,t.pendingProps.children,s),nr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((u=o=at)&&(o=qS(o,t.type,t.pendingProps,Sn),o!==null?(t.stateNode=o,Ot=t,at=kn(o.firstChild),Sn=!1,u=!0):u=!1),u||Ca(t)),_a(t),u=t.type,h=t.pendingProps,_=e!==null?e.memoizedProps:null,o=h.children,bd(u,h)?o=null:_!==null&&bd(u,_)&&(t.flags|=32),t.memoizedState!==null&&(u=yu(e,t,oS,null,null,s),Ro._currentValue=u),nr(e,t),Lt(e,t,o,s),t.child;case 6:return e===null&&Be&&((e=s=at)&&(s=KS(s,t.pendingProps,Sn),s!==null?(t.stateNode=s,Ot=t,at=null,e=!0):e=!1),e||Ca(t)),null;case 13:return Zp(e,t,s);case 4:return Re(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=fs(t,null,o,s):Lt(e,t,o,s),t.child;case 11:return Vp(e,t,t.type,t.pendingProps,s);case 7:return Lt(e,t,t.pendingProps,s),t.child;case 8:return Lt(e,t,t.pendingProps.children,s),t.child;case 12:return Lt(e,t,t.pendingProps.children,s),t.child;case 10:return o=t.pendingProps,wa(t,t.type,o.value),Lt(e,t,o.children,s),t.child;case 9:return u=t.type._context,o=t.pendingProps.children,rs(t),u=Bt(u),o=o(u),t.flags|=1,Lt(e,t,o,s),t.child;case 14:return Hp(e,t,t.type,t.pendingProps,s);case 15:return Gp(e,t,t.type,t.pendingProps,s);case 19:return Qp(e,t,s);case 31:return mS(e,t,s);case 22:return Pp(e,t,s,t.pendingProps);case 24:return rs(t),o=Bt(yt),e===null?(u=ru(),u===null&&(u=et,h=ou(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=s),u=h),t.memoizedState={parent:o,cache:u},uu(t),wa(t,yt,u)):((e.lanes&s)!==0&&(du(e,t),fo(t,null,null,s),uo()),u=e.memoizedState,h=t.memoizedState,u.parent!==o?(u={parent:o,cache:o},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),wa(t,yt,o)):(o=h.cache,wa(t,yt,o),o!==u.cache&&iu(t,[yt],s,!0))),Lt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function ia(e){e.flags|=4}function Ku(e,t,s,o,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(jv())e.flags|=8192;else throw ds=Hl,cu}else e.flags&=-16777217}function Jp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!mg(t))if(jv())e.flags|=8192;else throw ds=Hl,cu}function sr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Rh():536870912,e.lanes|=t,hi|=t)}function yo(e,t){if(!Be)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function st(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function vS(e,t,s){var o=t.pendingProps;switch(eu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return st(t),null;case 3:return s=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),ta(yt),Dn(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ei(t)?ia(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,nu())),st(t),null;case 26:var u=t.type,h=t.memoizedState;return e===null?(ia(t),h!==null?(st(t),Jp(t,h)):(st(t),Ku(t,u,null,o,s))):h?h!==e.memoizedState?(ia(t),st(t),Jp(t,h)):(st(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&ia(t),st(t),Ku(t,u,e,o,s)),null;case 27:if(hn(t),s=W.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&ia(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return st(t),null}e=J.current,ei(t)?Rm(t):(e=og(u,o,s),t.stateNode=e,ia(t))}return st(t),null;case 5:if(hn(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&ia(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return st(t),null}if(h=J.current,ei(t))Rm(t);else{var _=br(W.current);switch(h){case 1:h=_.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=_.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=_.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?_.createElement("select",{is:o.is}):_.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?_.createElement(u,{is:o.is}):_.createElement(u)}}h[Mt]=t,h[qt]=o;e:for(_=t.child;_!==null;){if(_.tag===5||_.tag===6)h.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===t)break e;for(;_.sibling===null;){if(_.return===null||_.return===t)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}t.stateNode=h;e:switch(It(h,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ia(t)}}return st(t),Ku(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&ia(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(l(166));if(e=W.current,ei(t)){if(e=t.stateNode,s=t.memoizedProps,o=null,u=Ot,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||Zv(e.nodeValue,s)),e||Ca(t,!0)}else e=br(e).createTextNode(o),e[Mt]=t,t.stateNode=e}return st(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(o=ei(t),s!==null){if(e===null){if(!o)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[Mt]=t}else os(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),e=!1}else s=nu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(sn(t),t):(sn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return st(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ei(t),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(l(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(l(317));u[Mt]=t}else os(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),u=!1}else u=nu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(sn(t),t):(sn(t),null)}return sn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=o!==null,e=e!==null&&e.memoizedState!==null,s&&(o=t.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),sr(t,t.updateQueue),st(t),null);case 4:return Dn(),e===null&&md(t.stateNode.containerInfo),st(t),null;case 10:return ta(t.type),st(t),null;case 19:if(Ce(pt),o=t.memoizedState,o===null)return st(t),null;if(u=(t.flags&128)!==0,h=o.rendering,h===null)if(u)yo(o,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=ql(e),h!==null){for(t.flags|=128,yo(o,!1),e=h.updateQueue,t.updateQueue=e,sr(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Cm(s,e),s=s.sibling;return xe(pt,pt.current&1|2),Be&&Jn(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&Ut()>cr&&(t.flags|=128,u=!0,yo(o,!1),t.lanes=4194304)}else{if(!u)if(e=ql(h),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,sr(t,e),yo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Be)return st(t),null}else 2*Ut()-o.renderingStartTime>cr&&s!==536870912&&(t.flags|=128,u=!0,yo(o,!1),t.lanes=4194304);o.isBackwards?(h.sibling=t.child,t.child=h):(e=o.last,e!==null?e.sibling=h:t.child=h,o.last=h)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ut(),e.sibling=null,s=pt.current,xe(pt,u?s&1|2:s&1),Be&&Jn(t,o.treeForkCount),e):(st(t),null);case 22:case 23:return sn(t),pu(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(s&536870912)!==0&&(t.flags&128)===0&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),s=t.updateQueue,s!==null&&sr(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==s&&(t.flags|=2048),e!==null&&Ce(cs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ta(yt),st(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function gS(e,t){switch(eu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ta(yt),Dn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return hn(t),null;case 31:if(t.memoizedState!==null){if(sn(t),t.alternate===null)throw Error(l(340));os()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(sn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));os()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(pt),null;case 4:return Dn(),null;case 10:return ta(t.type),null;case 22:case 23:return sn(t),pu(),e!==null&&Ce(cs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ta(yt),null;case 25:return null;default:return null}}function ev(e,t){switch(eu(t),t.tag){case 3:ta(yt),Dn();break;case 26:case 27:case 5:hn(t);break;case 4:Dn();break;case 31:t.memoizedState!==null&&sn(t);break;case 13:sn(t);break;case 19:Ce(pt);break;case 10:ta(t.type);break;case 22:case 23:sn(t),pu(),e!==null&&Ce(cs);break;case 24:ta(yt)}}function bo(e,t){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var u=o.next;s=u;do{if((s.tag&e)===e){o=void 0;var h=s.create,_=s.inst;o=h(),_.destroy=o}s=s.next}while(s!==u)}}catch(T){Ze(t,t.return,T)}}function Oa(e,t,s){try{var o=t.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&e)===e){var _=o.inst,T=_.destroy;if(T!==void 0){_.destroy=void 0,u=t;var D=s,V=T;try{V()}catch(F){Ze(u,D,F)}}}o=o.next}while(o!==h)}}catch(F){Ze(t,t.return,F)}}function tv(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{qm(t,s)}catch(o){Ze(e,e.return,o)}}}function nv(e,t,s){s.props=ms(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){Ze(e,t,o)}}function xo(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof s=="function"?e.refCleanup=s(o):s.current=o}}catch(u){Ze(e,t,u)}}function Vn(e,t){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(u){Ze(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){Ze(e,t,u)}else s.current=null}function av(e){var t=e.type,s=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(u){Ze(e,e.return,u)}}function Yu(e,t,s){try{var o=e.stateNode;US(o,e.type,s,t),o[qt]=t}catch(u){Ze(e,e.return,u)}}function sv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ha(e.type)||e.tag===4}function Fu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ha(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 Zu(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Xn));else if(o!==4&&(o===27&&Ha(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Zu(e,t,s),e=e.sibling;e!==null;)Zu(e,t,s),e=e.sibling}function ir(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(o!==4&&(o===27&&Ha(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(ir(e,t,s),e=e.sibling;e!==null;)ir(e,t,s),e=e.sibling}function iv(e){var t=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);It(t,o,s),t[Mt]=e,t[qt]=s}catch(h){Ze(e,e.return,h)}}var oa=!1,_t=!1,Xu=!1,ov=typeof WeakSet=="function"?WeakSet:Set,Rt=null;function yS(e,t){if(e=e.containerInfo,gd=Nr,e=ym(e),Pc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var u=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var _=0,T=-1,D=-1,V=0,F=0,Q=e,G=null;t:for(;;){for(var $;Q!==s||u!==0&&Q.nodeType!==3||(T=_+u),Q!==h||o!==0&&Q.nodeType!==3||(D=_+o),Q.nodeType===3&&(_+=Q.nodeValue.length),($=Q.firstChild)!==null;)G=Q,Q=$;for(;;){if(Q===e)break t;if(G===s&&++V===u&&(T=_),G===h&&++F===o&&(D=_),($=Q.nextSibling)!==null)break;Q=G,G=Q.parentNode}Q=$}s=T===-1||D===-1?null:{start:T,end:D}}else s=null}s=s||{start:0,end:0}}else s=null;for(yd={focusedElem:e,selectionRange:s},Nr=!1,Rt=t;Rt!==null;)if(t=Rt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Rt=e;else for(;Rt!==null;){switch(t=Rt,h=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)u=e[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=t,u=h.memoizedProps,h=h.memoizedState,o=s.stateNode;try{var de=ms(s.type,u);e=o.getSnapshotBeforeUpdate(de,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(ve){Ze(s,s.return,ve)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)_d(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_d(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(l(163))}if(e=t.sibling,e!==null){e.return=t.return,Rt=e;break}Rt=t.return}}function lv(e,t,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:ra(e,s),o&4&&bo(5,s);break;case 1:if(ra(e,s),o&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(_){Ze(s,s.return,_)}else{var u=ms(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){Ze(s,s.return,_)}}o&64&&tv(s),o&512&&xo(s,s.return);break;case 3:if(ra(e,s),o&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{qm(e,t)}catch(_){Ze(s,s.return,_)}}break;case 27:t===null&&o&4&&iv(s);case 26:case 5:ra(e,s),t===null&&o&4&&av(s),o&512&&xo(s,s.return);break;case 12:ra(e,s);break;case 31:ra(e,s),o&4&&uv(e,s);break;case 13:ra(e,s),o&4&&dv(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=CS.bind(null,s),YS(e,s))));break;case 22:if(o=s.memoizedState!==null||oa,!o){t=t!==null&&t.memoizedState!==null||_t,u=oa;var h=_t;oa=o,(_t=t)&&!h?ca(e,s,(s.subtreeFlags&8772)!==0):ra(e,s),oa=u,_t=h}break;case 30:break;default:ra(e,s)}}function rv(e){var t=e.alternate;t!==null&&(e.alternate=null,rv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nc(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ct=null,Yt=!1;function la(e,t,s){for(s=s.child;s!==null;)cv(e,t,s),s=s.sibling}function cv(e,t,s){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(Se,s)}catch{}switch(s.tag){case 26:_t||Vn(s,t),la(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:_t||Vn(s,t);var o=ct,u=Yt;Ha(s.type)&&(ct=s.stateNode,Yt=!1),la(e,t,s),Eo(s.stateNode),ct=o,Yt=u;break;case 5:_t||Vn(s,t);case 6:if(o=ct,u=Yt,ct=null,la(e,t,s),ct=o,Yt=u,ct!==null)if(Yt)try{(ct.nodeType===9?ct.body:ct.nodeName==="HTML"?ct.ownerDocument.body:ct).removeChild(s.stateNode)}catch(h){Ze(s,t,h)}else try{ct.removeChild(s.stateNode)}catch(h){Ze(s,t,h)}break;case 18:ct!==null&&(Yt?(e=ct,tg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),_i(e)):tg(ct,s.stateNode));break;case 4:o=ct,u=Yt,ct=s.stateNode.containerInfo,Yt=!0,la(e,t,s),ct=o,Yt=u;break;case 0:case 11:case 14:case 15:Oa(2,s,t),_t||Oa(4,s,t),la(e,t,s);break;case 1:_t||(Vn(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"&&nv(s,t,o)),la(e,t,s);break;case 21:la(e,t,s);break;case 22:_t=(o=_t)||s.memoizedState!==null,la(e,t,s),_t=o;break;default:la(e,t,s)}}function uv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{_i(e)}catch(s){Ze(t,t.return,s)}}}function dv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{_i(e)}catch(s){Ze(t,t.return,s)}}function bS(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ov),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ov),t;default:throw Error(l(435,e.tag))}}function or(e,t){var s=bS(e);t.forEach(function(o){if(!s.has(o)){s.add(o);var u=wS.bind(null,e,o);o.then(u,u)}})}function Ft(e,t){var s=t.deletions;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o],h=e,_=t,T=_;e:for(;T!==null;){switch(T.tag){case 27:if(Ha(T.type)){ct=T.stateNode,Yt=!1;break e}break;case 5:ct=T.stateNode,Yt=!1;break e;case 3:case 4:ct=T.stateNode.containerInfo,Yt=!0;break e}T=T.return}if(ct===null)throw Error(l(160));cv(h,_,u),ct=null,Yt=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fv(t,e),t=t.sibling}var On=null;function fv(e,t){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ft(t,e),Zt(e),o&4&&(Oa(3,e,e.return),bo(3,e),Oa(5,e,e.return));break;case 1:Ft(t,e),Zt(e),o&512&&(_t||s===null||Vn(s,s.return)),o&64&&oa&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var u=On;if(Ft(t,e),Zt(e),o&512&&(_t||s===null||Vn(s,s.return)),o&4){var h=s!==null?s.memoizedState:null;if(o=e.memoizedState,s===null)if(o===null)if(e.stateNode===null){e:{o=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":h=u.getElementsByTagName("title")[0],(!h||h[Ki]||h[Mt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(o),u.head.insertBefore(h,u.querySelector("head > title"))),It(h,o,s),h[Mt]=e,Dt(h),o=h;break e;case"link":var _=fg("link","href",u).get(o+(s.href||""));if(_){for(var T=0;T<_.length;T++)if(h=_[T],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(T,1);break t}}h=u.createElement(o),It(h,o,s),u.head.appendChild(h);break;case"meta":if(_=fg("meta","content",u).get(o+(s.content||""))){for(T=0;T<_.length;T++)if(h=_[T],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(T,1);break t}}h=u.createElement(o),It(h,o,s),u.head.appendChild(h);break;default:throw Error(l(468,o))}h[Mt]=e,Dt(h),o=h}e.stateNode=o}else hg(u,e.type,e.stateNode);else e.stateNode=dg(u,o,e.memoizedProps);else h!==o?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,o===null?hg(u,e.type,e.stateNode):dg(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Yu(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ft(t,e),Zt(e),o&512&&(_t||s===null||Vn(s,s.return)),s!==null&&o&4&&Yu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ft(t,e),Zt(e),o&512&&(_t||s===null||Vn(s,s.return)),e.flags&32){u=e.stateNode;try{$s(u,"")}catch(de){Ze(e,e.return,de)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,Yu(e,u,s!==null?s.memoizedProps:u)),o&1024&&(Xu=!0);break;case 6:if(Ft(t,e),Zt(e),o&4){if(e.stateNode===null)throw Error(l(162));o=e.memoizedProps,s=e.stateNode;try{s.nodeValue=o}catch(de){Ze(e,e.return,de)}}break;case 3:if(Sr=null,u=On,On=xr(t.containerInfo),Ft(t,e),On=u,Zt(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{_i(t.containerInfo)}catch(de){Ze(e,e.return,de)}Xu&&(Xu=!1,hv(e));break;case 4:o=On,On=xr(e.stateNode.containerInfo),Ft(t,e),Zt(e),On=o;break;case 12:Ft(t,e),Zt(e);break;case 31:Ft(t,e),Zt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,or(e,o)));break;case 13:Ft(t,e),Zt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(rr=Ut()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,or(e,o)));break;case 22:u=e.memoizedState!==null;var D=s!==null&&s.memoizedState!==null,V=oa,F=_t;if(oa=V||u,_t=F||D,Ft(t,e),_t=F,oa=V,Zt(e),o&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(s===null||D||oa||_t||ps(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){D=s=t;try{if(h=D.stateNode,u)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{T=D.stateNode;var Q=D.memoizedProps.style,G=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;T.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(de){Ze(D,D.return,de)}}}else if(t.tag===6){if(s===null){D=t;try{D.stateNode.nodeValue=u?"":D.memoizedProps}catch(de){Ze(D,D.return,de)}}}else if(t.tag===18){if(s===null){D=t;try{var $=D.stateNode;u?ng($,!0):ng(D.stateNode,!1)}catch(de){Ze(D,D.return,de)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,or(e,s))));break;case 19:Ft(t,e),Zt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,or(e,o)));break;case 30:break;case 21:break;default:Ft(t,e),Zt(e)}}function Zt(e){var t=e.flags;if(t&2){try{for(var s,o=e.return;o!==null;){if(sv(o)){s=o;break}o=o.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var u=s.stateNode,h=Fu(e);ir(e,h,u);break;case 5:var _=s.stateNode;s.flags&32&&($s(_,""),s.flags&=-33);var T=Fu(e);ir(e,T,_);break;case 3:case 4:var D=s.stateNode.containerInfo,V=Fu(e);Zu(e,V,D);break;default:throw Error(l(161))}}catch(F){Ze(e,e.return,F)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ra(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)lv(e,t.alternate,t),t=t.sibling}function ps(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Oa(4,t,t.return),ps(t);break;case 1:Vn(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&nv(t,t.return,s),ps(t);break;case 27:Eo(t.stateNode);case 26:case 5:Vn(t,t.return),ps(t);break;case 22:t.memoizedState===null&&ps(t);break;case 30:ps(t);break;default:ps(t)}e=e.sibling}}function ca(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,u=e,h=t,_=h.flags;switch(h.tag){case 0:case 11:case 15:ca(u,h,s),bo(4,h);break;case 1:if(ca(u,h,s),o=h,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(V){Ze(o,o.return,V)}if(o=h,u=o.updateQueue,u!==null){var T=o.stateNode;try{var D=u.shared.hiddenCallbacks;if(D!==null)for(u.shared.hiddenCallbacks=null,u=0;u<D.length;u++)$m(D[u],T)}catch(V){Ze(o,o.return,V)}}s&&_&64&&tv(h),xo(h,h.return);break;case 27:iv(h);case 26:case 5:ca(u,h,s),s&&o===null&&_&4&&av(h),xo(h,h.return);break;case 12:ca(u,h,s);break;case 31:ca(u,h,s),s&&_&4&&uv(u,h);break;case 13:ca(u,h,s),s&&_&4&&dv(u,h);break;case 22:h.memoizedState===null&&ca(u,h,s),xo(h,h.return);break;case 30:break;default:ca(u,h,s)}t=t.sibling}}function Qu(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&io(s))}function Wu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&io(e))}function Bn(e,t,s,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)mv(e,t,s,o),t=t.sibling}function mv(e,t,s,o){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Bn(e,t,s,o),u&2048&&bo(9,t);break;case 1:Bn(e,t,s,o);break;case 3:Bn(e,t,s,o),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&io(e)));break;case 12:if(u&2048){Bn(e,t,s,o),e=t.stateNode;try{var h=t.memoizedProps,_=h.id,T=h.onPostCommit;typeof T=="function"&&T(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){Ze(t,t.return,D)}}else Bn(e,t,s,o);break;case 31:Bn(e,t,s,o);break;case 13:Bn(e,t,s,o);break;case 23:break;case 22:h=t.stateNode,_=t.alternate,t.memoizedState!==null?h._visibility&2?Bn(e,t,s,o):_o(e,t):h._visibility&2?Bn(e,t,s,o):(h._visibility|=2,ui(e,t,s,o,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Qu(_,t);break;case 24:Bn(e,t,s,o),u&2048&&Wu(t.alternate,t);break;default:Bn(e,t,s,o)}}function ui(e,t,s,o,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,_=t,T=s,D=o,V=_.flags;switch(_.tag){case 0:case 11:case 15:ui(h,_,T,D,u),bo(8,_);break;case 23:break;case 22:var F=_.stateNode;_.memoizedState!==null?F._visibility&2?ui(h,_,T,D,u):_o(h,_):(F._visibility|=2,ui(h,_,T,D,u)),u&&V&2048&&Qu(_.alternate,_);break;case 24:ui(h,_,T,D,u),u&&V&2048&&Wu(_.alternate,_);break;default:ui(h,_,T,D,u)}t=t.sibling}}function _o(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,o=t,u=o.flags;switch(o.tag){case 22:_o(s,o),u&2048&&Qu(o.alternate,o);break;case 24:_o(s,o),u&2048&&Wu(o.alternate,o);break;default:_o(s,o)}t=t.sibling}}var So=8192;function di(e,t,s){if(e.subtreeFlags&So)for(e=e.child;e!==null;)pv(e,t,s),e=e.sibling}function pv(e,t,s){switch(e.tag){case 26:di(e,t,s),e.flags&So&&e.memoizedState!==null&&i1(s,On,e.memoizedState,e.memoizedProps);break;case 5:di(e,t,s);break;case 3:case 4:var o=On;On=xr(e.stateNode.containerInfo),di(e,t,s),On=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=So,So=16777216,di(e,t,s),So=o):di(e,t,s));break;default:di(e,t,s)}}function vv(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function To(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];Rt=o,yv(o,e)}vv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)gv(e),e=e.sibling}function gv(e){switch(e.tag){case 0:case 11:case 15:To(e),e.flags&2048&&Oa(9,e,e.return);break;case 3:To(e);break;case 12:To(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,lr(e)):To(e);break;default:To(e)}}function lr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];Rt=o,yv(o,e)}vv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Oa(8,t,t.return),lr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,lr(t));break;default:lr(t)}e=e.sibling}}function yv(e,t){for(;Rt!==null;){var s=Rt;switch(s.tag){case 0:case 11:case 15:Oa(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:io(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Rt=o;else e:for(s=e;Rt!==null;){o=Rt;var u=o.sibling,h=o.return;if(rv(o),o===s){Rt=null;break e}if(u!==null){u.return=h,Rt=u;break e}Rt=h}}}var xS={getCacheForType:function(e){var t=Bt(yt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Bt(yt).controller.signal}},_S=typeof WeakMap=="function"?WeakMap:Map,$e=0,et=null,Ae=null,Me=0,Fe=0,on=null,Ba=!1,fi=!1,Ju=!1,ua=0,ht=0,La=0,vs=0,ed=0,ln=0,hi=0,ko=null,Xt=null,td=!1,rr=0,bv=0,cr=1/0,ur=null,Ia=null,Nt=0,za=null,mi=null,da=0,nd=0,ad=null,xv=null,jo=0,sd=null;function rn(){return($e&2)!==0&&Me!==0?Me&-Me:O.T!==null?ud():Lh()}function _v(){if(ln===0)if((Me&536870912)===0||Be){var e=Sa;Sa<<=1,(Sa&3932160)===0&&(Sa=262144),ln=e}else ln=536870912;return e=an.current,e!==null&&(e.flags|=32),ln}function Qt(e,t,s){(e===et&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)&&(pi(e,0),Ua(e,Me,ln,!1)),qi(e,s),(($e&2)===0||e!==et)&&(e===et&&(($e&2)===0&&(vs|=s),ht===4&&Ua(e,Me,ln,!1)),Hn(e))}function Sv(e,t,s){if(($e&6)!==0)throw Error(l(327));var o=!s&&(t&127)===0&&(t&e.expiredLanes)===0||$i(e,t),u=o?kS(e,t):od(e,t,!0),h=o;do{if(u===0){fi&&!o&&Ua(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!SS(s)){u=od(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){t=_;e:{var T=e;u=ko;var D=T.current.memoizedState.isDehydrated;if(D&&(pi(T,_).flags|=256),_=od(T,_,!1),_!==2){if(Ju&&!D){T.errorRecoveryDisabledLanes|=h,vs|=h,u=4;break e}h=Xt,Xt=u,h!==null&&(Xt===null?Xt=h:Xt.push.apply(Xt,h))}u=_}if(h=!1,u!==2)continue}}if(u===1){pi(e,0),Ua(e,t,0,!0);break}e:{switch(o=e,h=u,h){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Ua(o,t,ln,!Ba);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(u=rr+300-Ut(),10<u)){if(Ua(o,t,ln,!Ba),xl(o,0,!0)!==0)break e;da=t,o.timeoutHandle=Jv(Tv.bind(null,o,s,Xt,ur,td,t,ln,vs,hi,Ba,h,"Throttled",-0,0),u);break e}Tv(o,s,Xt,ur,td,t,ln,vs,hi,Ba,h,null,-0,0)}}break}while(!0);Hn(e)}function Tv(e,t,s,o,u,h,_,T,D,V,F,Q,G,$){if(e.timeoutHandle=-1,Q=t.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xn},pv(t,h,Q);var de=(h&62914560)===h?rr-Ut():(h&4194048)===h?bv-Ut():0;if(de=o1(Q,de),de!==null){da=h,e.cancelPendingCommit=de(Dv.bind(null,e,t,h,s,o,u,_,T,D,F,Q,null,G,$)),Ua(e,h,_,!V);return}}Dv(e,t,h,s,o,u,_,T,D)}function SS(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var u=s[o],h=u.getSnapshot;u=u.value;try{if(!tn(h(),u))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ua(e,t,s,o){t&=~ed,t&=~vs,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var u=t;0<u;){var h=31-Ke(u),_=1<<h;o[h]=-1,u&=~_}s!==0&&Mh(e,s,t)}function dr(){return($e&6)===0?(No(0),!1):!0}function id(){if(Ae!==null){if(Fe===0)var e=Ae.return;else e=Ae,ea=ls=null,_u(e),ii=null,lo=0,e=Ae;for(;e!==null;)ev(e.alternate,e),e=e.return;Ae=null}}function pi(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,GS(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),da=0,id(),et=e,Ae=s=Wn(e.current,null),Me=t,Fe=0,on=null,Ba=!1,fi=$i(e,t),Ju=!1,hi=ln=ed=vs=La=ht=0,Xt=ko=null,td=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var u=31-Ke(o),h=1<<u;t|=e[u],o&=~h}return ua=t,Rl(),s}function kv(e,t){Ne=null,O.H=vo,t===si||t===Vl?(t=Vm(),Fe=3):t===cu?(t=Vm(),Fe=4):Fe=t===Iu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,on=t,Ae===null&&(ht=1,er(e,bn(t,e.current)))}function jv(){var e=an.current;return e===null?!0:(Me&4194048)===Me?Tn===null:(Me&62914560)===Me||(Me&536870912)!==0?e===Tn:!1}function Nv(){var e=O.H;return O.H=vo,e===null?vo:e}function Cv(){var e=O.A;return O.A=xS,e}function fr(){ht=4,Ba||(Me&4194048)!==Me&&an.current!==null||(fi=!0),(La&134217727)===0&&(vs&134217727)===0||et===null||Ua(et,Me,ln,!1)}function od(e,t,s){var o=$e;$e|=2;var u=Nv(),h=Cv();(et!==e||Me!==t)&&(ur=null,pi(e,t)),t=!1;var _=ht;e:do try{if(Fe!==0&&Ae!==null){var T=Ae,D=on;switch(Fe){case 8:id(),_=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(t=!0);var V=Fe;if(Fe=0,on=null,vi(e,T,D,V),s&&fi){_=0;break e}break;default:V=Fe,Fe=0,on=null,vi(e,T,D,V)}}TS(),_=ht;break}catch(F){kv(e,F)}while(!0);return t&&e.shellSuspendCounter++,ea=ls=null,$e=o,O.H=u,O.A=h,Ae===null&&(et=null,Me=0,Rl()),_}function TS(){for(;Ae!==null;)wv(Ae)}function kS(e,t){var s=$e;$e|=2;var o=Nv(),u=Cv();et!==e||Me!==t?(ur=null,cr=Ut()+500,pi(e,t)):fi=$i(e,t);e:do try{if(Fe!==0&&Ae!==null){t=Ae;var h=on;t:switch(Fe){case 1:Fe=0,on=null,vi(e,t,h,1);break;case 2:case 9:if(zm(h)){Fe=0,on=null,Ev(t);break}t=function(){Fe!==2&&Fe!==9||et!==e||(Fe=7),Hn(e)},h.then(t,t);break e;case 3:Fe=7;break e;case 4:Fe=5;break e;case 7:zm(h)?(Fe=0,on=null,Ev(t)):(Fe=0,on=null,vi(e,t,h,7));break;case 5:var _=null;switch(Ae.tag){case 26:_=Ae.memoizedState;case 5:case 27:var T=Ae;if(_?mg(_):T.stateNode.complete){Fe=0,on=null;var D=T.sibling;if(D!==null)Ae=D;else{var V=T.return;V!==null?(Ae=V,hr(V)):Ae=null}break t}}Fe=0,on=null,vi(e,t,h,5);break;case 6:Fe=0,on=null,vi(e,t,h,6);break;case 8:id(),ht=6;break e;default:throw Error(l(462))}}jS();break}catch(F){kv(e,F)}while(!0);return ea=ls=null,O.H=o,O.A=u,$e=s,Ae!==null?0:(et=null,Me=0,Rl(),ht)}function jS(){for(;Ae!==null&&!vl();)wv(Ae)}function wv(e){var t=Wp(e.alternate,e,ua);e.memoizedProps=e.pendingProps,t===null?hr(e):Ae=t}function Ev(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Kp(s,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=Kp(s,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:_u(t);default:ev(s,t),t=Ae=Cm(t,ua),t=Wp(s,t,ua)}e.memoizedProps=e.pendingProps,t===null?hr(e):Ae=t}function vi(e,t,s,o){ea=ls=null,_u(t),ii=null,lo=0;var u=t.return;try{if(hS(e,u,t,s,Me)){ht=1,er(e,bn(s,e.current)),Ae=null;return}}catch(h){if(u!==null)throw Ae=u,h;ht=1,er(e,bn(s,e.current)),Ae=null;return}t.flags&32768?(Be||o===1?e=!0:fi||(Me&536870912)!==0?e=!1:(Ba=e=!0,(o===2||o===9||o===3||o===6)&&(o=an.current,o!==null&&o.tag===13&&(o.flags|=16384))),Av(t,e)):hr(t)}function hr(e){var t=e;do{if((t.flags&32768)!==0){Av(t,Ba);return}e=t.return;var s=vS(t.alternate,t,ua);if(s!==null){Ae=s;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);ht===0&&(ht=5)}function Av(e,t){do{var s=gS(e.alternate,e);if(s!==null){s.flags&=32767,Ae=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=s}while(e!==null);ht=6,Ae=null}function Dv(e,t,s,o,u,h,_,T,D){e.cancelPendingCommit=null;do mr();while(Nt!==0);if(($e&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(h=t.lanes|t.childLanes,h|=Fc,s_(e,s,h,_,T,D),e===et&&(Ae=et=null,Me=0),mi=t,za=e,da=s,nd=h,ad=u,xv=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ES(oe,function(){return Lv(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=O.T,O.T=null,u=P.p,P.p=2,_=$e,$e|=4;try{yS(e,t,s)}finally{$e=_,P.p=u,O.T=o}}Nt=1,Rv(),Mv(),Ov()}}function Rv(){if(Nt===1){Nt=0;var e=za,t=mi,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=O.T,O.T=null;var o=P.p;P.p=2;var u=$e;$e|=4;try{fv(t,e);var h=yd,_=ym(e.containerInfo),T=h.focusedElem,D=h.selectionRange;if(_!==T&&T&&T.ownerDocument&&gm(T.ownerDocument.documentElement,T)){if(D!==null&&Pc(T)){var V=D.start,F=D.end;if(F===void 0&&(F=V),"selectionStart"in T)T.selectionStart=V,T.selectionEnd=Math.min(F,T.value.length);else{var Q=T.ownerDocument||document,G=Q&&Q.defaultView||window;if(G.getSelection){var $=G.getSelection(),de=T.textContent.length,ve=Math.min(D.start,de),We=D.end===void 0?ve:Math.min(D.end,de);!$.extend&&ve>We&&(_=We,We=ve,ve=_);var B=vm(T,ve),M=vm(T,We);if(B&&M&&($.rangeCount!==1||$.anchorNode!==B.node||$.anchorOffset!==B.offset||$.focusNode!==M.node||$.focusOffset!==M.offset)){var U=Q.createRange();U.setStart(B.node,B.offset),$.removeAllRanges(),ve>We?($.addRange(U),$.extend(M.node,M.offset)):(U.setEnd(M.node,M.offset),$.addRange(U))}}}}for(Q=[],$=T;$=$.parentNode;)$.nodeType===1&&Q.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<Q.length;T++){var X=Q[T];X.element.scrollLeft=X.left,X.element.scrollTop=X.top}}Nr=!!gd,yd=gd=null}finally{$e=u,P.p=o,O.T=s}}e.current=t,Nt=2}}function Mv(){if(Nt===2){Nt=0;var e=za,t=mi,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=O.T,O.T=null;var o=P.p;P.p=2;var u=$e;$e|=4;try{lv(e,t.alternate,t)}finally{$e=u,P.p=o,O.T=s}}Nt=3}}function Ov(){if(Nt===4||Nt===3){Nt=0,gl();var e=za,t=mi,s=da,o=xv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nt=5:(Nt=0,mi=za=null,Bv(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Ia=null),kc(s),t=t.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(Se,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=O.T,u=P.p,P.p=2,O.T=null;try{for(var h=e.onRecoverableError,_=0;_<o.length;_++){var T=o[_];h(T.value,{componentStack:T.stack})}}finally{O.T=t,P.p=u}}(da&3)!==0&&mr(),Hn(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===sd?jo++:(jo=0,sd=e):jo=0,No(0)}}function Bv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,io(t)))}function mr(){return Rv(),Mv(),Ov(),Lv()}function Lv(){if(Nt!==5)return!1;var e=za,t=nd;nd=0;var s=kc(da),o=O.T,u=P.p;try{P.p=32>s?32:s,O.T=null,s=ad,ad=null;var h=za,_=da;if(Nt=0,mi=za=null,da=0,($e&6)!==0)throw Error(l(331));var T=$e;if($e|=4,gv(h.current),mv(h,h.current,_,s),$e=T,No(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(Se,h)}catch{}return!0}finally{P.p=u,O.T=o,Bv(e,t)}}function Iv(e,t,s){t=bn(s,t),t=Lu(e.stateNode,t,2),e=Da(e,t,2),e!==null&&(qi(e,2),Hn(e))}function Ze(e,t,s){if(e.tag===3)Iv(e,e,s);else for(;t!==null;){if(t.tag===3){Iv(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ia===null||!Ia.has(o))){e=bn(s,e),s=zp(2),o=Da(t,s,2),o!==null&&(Up(s,o,t,e),qi(o,2),Hn(o));break}}t=t.return}}function ld(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new _S;var u=new Set;o.set(t,u)}else u=o.get(t),u===void 0&&(u=new Set,o.set(t,u));u.has(s)||(Ju=!0,u.add(s),e=NS.bind(null,e,t,s),t.then(e,e))}function NS(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,et===e&&(Me&s)===s&&(ht===4||ht===3&&(Me&62914560)===Me&&300>Ut()-rr?($e&2)===0&&pi(e,0):ed|=s,hi===Me&&(hi=0)),Hn(e)}function zv(e,t){t===0&&(t=Rh()),e=ss(e,t),e!==null&&(qi(e,t),Hn(e))}function CS(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),zv(e,s)}function wS(e,t){var s=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(t),zv(e,s)}function ES(e,t){return Ls(e,t)}var pr=null,gi=null,rd=!1,vr=!1,cd=!1,Va=0;function Hn(e){e!==gi&&e.next===null&&(gi===null?pr=gi=e:gi=gi.next=e),vr=!0,rd||(rd=!0,DS())}function No(e,t){if(!cd&&vr){cd=!0;do for(var s=!1,o=pr;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var h=0;else{var _=o.suspendedLanes,T=o.pingedLanes;h=(1<<31-Ke(42|e)+1)-1,h&=u&~(_&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,Gv(o,h))}else h=Me,h=xl(o,o===et?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||$i(o,h)||(s=!0,Gv(o,h));o=o.next}while(s);cd=!1}}function AS(){Uv()}function Uv(){vr=rd=!1;var e=0;Va!==0&&HS()&&(e=Va);for(var t=Ut(),s=null,o=pr;o!==null;){var u=o.next,h=Vv(o,t);h===0?(o.next=null,s===null?pr=u:s.next=u,u===null&&(gi=s)):(s=o,(e!==0||(h&3)!==0)&&(vr=!0)),o=u}Nt!==0&&Nt!==5||No(e),Va!==0&&(Va=0)}function Vv(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-Ke(h),T=1<<_,D=u[_];D===-1?((T&s)===0||(T&o)!==0)&&(u[_]=a_(T,t)):D<=t&&(e.expiredLanes|=T),h&=~T}if(t=et,s=Me,s=xl(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===t&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Is(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||$i(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(o!==null&&Is(o),kc(s)){case 2:case 8:s=Z;break;case 32:s=oe;break;case 268435456:s=_e;break;default:s=oe}return o=Hv.bind(null,e),s=Ls(s,o),e.callbackPriority=t,e.callbackNode=s,t}return o!==null&&o!==null&&Is(o),e.callbackPriority=2,e.callbackNode=null,2}function Hv(e,t){if(Nt!==0&&Nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(mr()&&e.callbackNode!==s)return null;var o=Me;return o=xl(e,e===et?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Sv(e,o,t),Vv(e,Ut()),e.callbackNode!=null&&e.callbackNode===s?Hv.bind(null,e):null)}function Gv(e,t){if(mr())return null;Sv(e,t,!0)}function DS(){PS(function(){($e&6)!==0?Ls(bl,AS):Uv()})}function ud(){if(Va===0){var e=ni;e===0&&(e=jt,jt<<=1,(jt&261888)===0&&(jt=256)),Va=e}return Va}function Pv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:kl(""+e)}function $v(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function RS(e,t,s,o,u){if(t==="submit"&&s&&s.stateNode===u){var h=Pv((u[qt]||null).action),_=o.submitter;_&&(t=(t=_[qt]||null)?Pv(t.formAction):_.getAttribute("formAction"),t!==null&&(h=t,_=null));var T=new wl("action","action",null,o,u);e.push({event:T,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Va!==0){var D=_?$v(u,_):new FormData(u);Au(s,{pending:!0,data:D,method:u.method,action:h},null,D)}}else typeof h=="function"&&(T.preventDefault(),D=_?$v(u,_):new FormData(u),Au(s,{pending:!0,data:D,method:u.method,action:h},h,D))},currentTarget:u}]})}}for(var dd=0;dd<Yc.length;dd++){var fd=Yc[dd],MS=fd.toLowerCase(),OS=fd[0].toUpperCase()+fd.slice(1);Mn(MS,"on"+OS)}Mn(_m,"onAnimationEnd"),Mn(Sm,"onAnimationIteration"),Mn(Tm,"onAnimationStart"),Mn("dblclick","onDoubleClick"),Mn("focusin","onFocus"),Mn("focusout","onBlur"),Mn(X_,"onTransitionRun"),Mn(Q_,"onTransitionStart"),Mn(W_,"onTransitionCancel"),Mn(km,"onTransitionEnd"),Gs("onMouseEnter",["mouseout","mouseover"]),Gs("onMouseLeave",["mouseout","mouseover"]),Gs("onPointerEnter",["pointerout","pointerover"]),Gs("onPointerLeave",["pointerout","pointerover"]),es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),es("onBeforeInput",["compositionend","keypress","textInput","paste"]),es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Co="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),BS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Co));function qv(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],u=o.event;o=o.listeners;e:{var h=void 0;if(t)for(var _=o.length-1;0<=_;_--){var T=o[_],D=T.instance,V=T.currentTarget;if(T=T.listener,D!==h&&u.isPropagationStopped())break e;h=T,u.currentTarget=V;try{h(u)}catch(F){Dl(F)}u.currentTarget=null,h=D}else for(_=0;_<o.length;_++){if(T=o[_],D=T.instance,V=T.currentTarget,T=T.listener,D!==h&&u.isPropagationStopped())break e;h=T,u.currentTarget=V;try{h(u)}catch(F){Dl(F)}u.currentTarget=null,h=D}}}}function De(e,t){var s=t[jc];s===void 0&&(s=t[jc]=new Set);var o=e+"__bubble";s.has(o)||(Kv(t,e,2,!1),s.add(o))}function hd(e,t,s){var o=0;t&&(o|=4),Kv(s,e,o,t)}var gr="_reactListening"+Math.random().toString(36).slice(2);function md(e){if(!e[gr]){e[gr]=!0,Uh.forEach(function(s){s!=="selectionchange"&&(BS.has(s)||hd(s,!1,e),hd(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[gr]||(t[gr]=!0,hd("selectionchange",!1,t))}}function Kv(e,t,s,o){switch(_g(t)){case 2:var u=c1;break;case 8:u=u1;break;default:u=Ed}s=u.bind(null,t,s,e),u=void 0,!Oc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function pd(e,t,s,o,u){var h=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var _=o.tag;if(_===3||_===4){var T=o.stateNode.containerInfo;if(T===u)break;if(_===4)for(_=o.return;_!==null;){var D=_.tag;if((D===3||D===4)&&_.stateNode.containerInfo===u)return;_=_.return}for(;T!==null;){if(_=Us(T),_===null)return;if(D=_.tag,D===5||D===6||D===26||D===27){o=h=_;continue e}T=T.parentNode}}o=o.return}Qh(function(){var V=h,F=Rc(s),Q=[];e:{var G=jm.get(e);if(G!==void 0){var $=wl,de=e;switch(e){case"keypress":if(Nl(s)===0)break e;case"keydown":case"keyup":$=w_;break;case"focusin":de="focus",$=zc;break;case"focusout":de="blur",$=zc;break;case"beforeblur":case"afterblur":$=zc;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":$=em;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=v_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=D_;break;case _m:case Sm:case Tm:$=b_;break;case km:$=M_;break;case"scroll":case"scrollend":$=m_;break;case"wheel":$=B_;break;case"copy":case"cut":case"paste":$=__;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=nm;break;case"toggle":case"beforetoggle":$=I_}var ve=(t&4)!==0,We=!ve&&(e==="scroll"||e==="scrollend"),B=ve?G!==null?G+"Capture":null:G;ve=[];for(var M=V,U;M!==null;){var X=M;if(U=X.stateNode,X=X.tag,X!==5&&X!==26&&X!==27||U===null||B===null||(X=Fi(M,B),X!=null&&ve.push(wo(M,X,U))),We)break;M=M.return}0<ve.length&&(G=new $(G,de,null,s,F),Q.push({event:G,listeners:ve}))}}if((t&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",$=e==="mouseout"||e==="pointerout",G&&s!==Dc&&(de=s.relatedTarget||s.fromElement)&&(Us(de)||de[zs]))break e;if(($||G)&&(G=F.window===F?F:(G=F.ownerDocument)?G.defaultView||G.parentWindow:window,$?(de=s.relatedTarget||s.toElement,$=V,de=de?Us(de):null,de!==null&&(We=d(de),ve=de.tag,de!==We||ve!==5&&ve!==27&&ve!==6)&&(de=null)):($=null,de=V),$!==de)){if(ve=em,X="onMouseLeave",B="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ve=nm,X="onPointerLeave",B="onPointerEnter",M="pointer"),We=$==null?G:Yi($),U=de==null?G:Yi(de),G=new ve(X,M+"leave",$,s,F),G.target=We,G.relatedTarget=U,X=null,Us(F)===V&&(ve=new ve(B,M+"enter",de,s,F),ve.target=U,ve.relatedTarget=We,X=ve),We=X,$&&de)t:{for(ve=LS,B=$,M=de,U=0,X=B;X;X=ve(X))U++;X=0;for(var me=M;me;me=ve(me))X++;for(;0<U-X;)B=ve(B),U--;for(;0<X-U;)M=ve(M),X--;for(;U--;){if(B===M||M!==null&&B===M.alternate){ve=B;break t}B=ve(B),M=ve(M)}ve=null}else ve=null;$!==null&&Yv(Q,G,$,ve,!1),de!==null&&We!==null&&Yv(Q,We,de,ve,!0)}}e:{if(G=V?Yi(V):window,$=G.nodeName&&G.nodeName.toLowerCase(),$==="select"||$==="input"&&G.type==="file")var He=um;else if(rm(G))if(dm)He=Y_;else{He=q_;var he=$_}else $=G.nodeName,!$||$.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?V&&Ac(V.elementType)&&(He=um):He=K_;if(He&&(He=He(e,V))){cm(Q,He,s,F);break e}he&&he(e,G,V),e==="focusout"&&V&&G.type==="number"&&V.memoizedProps.value!=null&&Ec(G,"number",G.value)}switch(he=V?Yi(V):window,e){case"focusin":(rm(he)||he.contentEditable==="true")&&(Fs=he,$c=V,no=null);break;case"focusout":no=$c=Fs=null;break;case"mousedown":qc=!0;break;case"contextmenu":case"mouseup":case"dragend":qc=!1,bm(Q,s,F);break;case"selectionchange":if(Z_)break;case"keydown":case"keyup":bm(Q,s,F)}var we;if(Vc)e:{switch(e){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else Ys?om(e,s)&&(Oe="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Oe="onCompositionStart");Oe&&(am&&s.locale!=="ko"&&(Ys||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&Ys&&(we=Wh()):(ka=F,Bc="value"in ka?ka.value:ka.textContent,Ys=!0)),he=yr(V,Oe),0<he.length&&(Oe=new tm(Oe,e,null,s,F),Q.push({event:Oe,listeners:he}),we?Oe.data=we:(we=lm(s),we!==null&&(Oe.data=we)))),(we=U_?V_(e,s):H_(e,s))&&(Oe=yr(V,"onBeforeInput"),0<Oe.length&&(he=new tm("onBeforeInput","beforeinput",null,s,F),Q.push({event:he,listeners:Oe}),he.data=we)),RS(Q,e,V,s,F)}qv(Q,t)})}function wo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function yr(e,t){for(var s=t+"Capture",o=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=Fi(e,s),u!=null&&o.unshift(wo(e,u,h)),u=Fi(e,t),u!=null&&o.push(wo(e,u,h))),e.tag===3)return o;e=e.return}return[]}function LS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yv(e,t,s,o,u){for(var h=t._reactName,_=[];s!==null&&s!==o;){var T=s,D=T.alternate,V=T.stateNode;if(T=T.tag,D!==null&&D===o)break;T!==5&&T!==26&&T!==27||V===null||(D=V,u?(V=Fi(s,h),V!=null&&_.unshift(wo(s,V,D))):u||(V=Fi(s,h),V!=null&&_.push(wo(s,V,D)))),s=s.return}_.length!==0&&e.push({event:t,listeners:_})}var IS=/\r\n?/g,zS=/\u0000|\uFFFD/g;function Fv(e){return(typeof e=="string"?e:""+e).replace(IS,`
26
+ `).replace(zS,"")}function Zv(e,t){return t=Fv(t),Fv(e)===t}function Qe(e,t,s,o,u,h){switch(s){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||$s(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&$s(e,""+o);break;case"className":Sl(e,"class",o);break;case"tabIndex":Sl(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Sl(e,s,o);break;case"style":Zh(e,o,h);break;case"data":if(t!=="object"){Sl(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=kl(""+o),e.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(s==="formAction"?(t!=="input"&&Qe(e,t,"name",u.name,u,null),Qe(e,t,"formEncType",u.formEncType,u,null),Qe(e,t,"formMethod",u.formMethod,u,null),Qe(e,t,"formTarget",u.formTarget,u,null)):(Qe(e,t,"encType",u.encType,u,null),Qe(e,t,"method",u.method,u,null),Qe(e,t,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=kl(""+o),e.setAttribute(s,o);break;case"onClick":o!=null&&(e.onclick=Xn);break;case"onScroll":o!=null&&De("scroll",e);break;case"onScrollEnd":o!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}s=kl(""+o),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":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""+o):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":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":o===!0?e.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,o):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(s,o):e.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(s):e.setAttribute(s,o);break;case"popover":De("beforetoggle",e),De("toggle",e),_l(e,"popover",o);break;case"xlinkActuate":Zn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Zn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Zn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Zn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Zn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Zn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":_l(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=f_.get(s)||s,_l(e,s,o))}}function vd(e,t,s,o,u,h){switch(s){case"style":Zh(e,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"children":typeof o=="string"?$s(e,o):(typeof o=="number"||typeof o=="bigint")&&$s(e,""+o);break;case"onScroll":o!=null&&De("scroll",e);break;case"onScrollEnd":o!=null&&De("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Xn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vh.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),t=s.slice(2,u?s.length-7:void 0),h=e[qt]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(t,h,u),typeof o=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,o,u);break e}s in e?e[s]=o:o===!0?e.setAttribute(s,""):_l(e,s,o)}}}function It(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var o=!1,u=!1,h;for(h in s)if(s.hasOwnProperty(h)){var _=s[h];if(_!=null)switch(h){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Qe(e,t,h,_,s,null)}}u&&Qe(e,t,"srcSet",s.srcSet,s,null),o&&Qe(e,t,"src",s.src,s,null);return;case"input":De("invalid",e);var T=h=_=u=null,D=null,V=null;for(o in s)if(s.hasOwnProperty(o)){var F=s[o];if(F!=null)switch(o){case"name":u=F;break;case"type":_=F;break;case"checked":D=F;break;case"defaultChecked":V=F;break;case"value":h=F;break;case"defaultValue":T=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(137,t));break;default:Qe(e,t,o,F,s,null)}}qh(e,h,T,D,V,_,u,!1);return;case"select":De("invalid",e),o=_=h=null;for(u in s)if(s.hasOwnProperty(u)&&(T=s[u],T!=null))switch(u){case"value":h=T;break;case"defaultValue":_=T;break;case"multiple":o=T;default:Qe(e,t,u,T,s,null)}t=h,s=_,e.multiple=!!o,t!=null?Ps(e,!!o,t,!1):s!=null&&Ps(e,!!o,s,!0);return;case"textarea":De("invalid",e),h=u=o=null;for(_ in s)if(s.hasOwnProperty(_)&&(T=s[_],T!=null))switch(_){case"value":o=T;break;case"defaultValue":u=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(l(91));break;default:Qe(e,t,_,T,s,null)}Yh(e,o,u,h);return;case"option":for(D in s)if(s.hasOwnProperty(D)&&(o=s[D],o!=null))switch(D){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Qe(e,t,D,o,s,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(o=0;o<Co.length;o++)De(Co[o],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in s)if(s.hasOwnProperty(V)&&(o=s[V],o!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Qe(e,t,V,o,s,null)}return;default:if(Ac(t)){for(F in s)s.hasOwnProperty(F)&&(o=s[F],o!==void 0&&vd(e,t,F,o,s,void 0));return}}for(T in s)s.hasOwnProperty(T)&&(o=s[T],o!=null&&Qe(e,t,T,o,s,null))}function US(e,t,s,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,_=null,T=null,D=null,V=null,F=null;for($ in s){var Q=s[$];if(s.hasOwnProperty($)&&Q!=null)switch($){case"checked":break;case"value":break;case"defaultValue":D=Q;default:o.hasOwnProperty($)||Qe(e,t,$,null,o,Q)}}for(var G in o){var $=o[G];if(Q=s[G],o.hasOwnProperty(G)&&($!=null||Q!=null))switch(G){case"type":h=$;break;case"name":u=$;break;case"checked":V=$;break;case"defaultChecked":F=$;break;case"value":_=$;break;case"defaultValue":T=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(l(137,t));break;default:$!==Q&&Qe(e,t,G,$,o,Q)}}wc(e,_,T,D,V,F,h,u);return;case"select":$=_=T=G=null;for(h in s)if(D=s[h],s.hasOwnProperty(h)&&D!=null)switch(h){case"value":break;case"multiple":$=D;default:o.hasOwnProperty(h)||Qe(e,t,h,null,o,D)}for(u in o)if(h=o[u],D=s[u],o.hasOwnProperty(u)&&(h!=null||D!=null))switch(u){case"value":G=h;break;case"defaultValue":T=h;break;case"multiple":_=h;default:h!==D&&Qe(e,t,u,h,o,D)}t=T,s=_,o=$,G!=null?Ps(e,!!s,G,!1):!!o!=!!s&&(t!=null?Ps(e,!!s,t,!0):Ps(e,!!s,s?[]:"",!1));return;case"textarea":$=G=null;for(T in s)if(u=s[T],s.hasOwnProperty(T)&&u!=null&&!o.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Qe(e,t,T,null,o,u)}for(_ in o)if(u=o[_],h=s[_],o.hasOwnProperty(_)&&(u!=null||h!=null))switch(_){case"value":G=u;break;case"defaultValue":$=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(l(91));break;default:u!==h&&Qe(e,t,_,u,o,h)}Kh(e,G,$);return;case"option":for(var de in s)if(G=s[de],s.hasOwnProperty(de)&&G!=null&&!o.hasOwnProperty(de))switch(de){case"selected":e.selected=!1;break;default:Qe(e,t,de,null,o,G)}for(D in o)if(G=o[D],$=s[D],o.hasOwnProperty(D)&&G!==$&&(G!=null||$!=null))switch(D){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:Qe(e,t,D,G,o,$)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in s)G=s[ve],s.hasOwnProperty(ve)&&G!=null&&!o.hasOwnProperty(ve)&&Qe(e,t,ve,null,o,G);for(V in o)if(G=o[V],$=s[V],o.hasOwnProperty(V)&&G!==$&&(G!=null||$!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(l(137,t));break;default:Qe(e,t,V,G,o,$)}return;default:if(Ac(t)){for(var We in s)G=s[We],s.hasOwnProperty(We)&&G!==void 0&&!o.hasOwnProperty(We)&&vd(e,t,We,void 0,o,G);for(F in o)G=o[F],$=s[F],!o.hasOwnProperty(F)||G===$||G===void 0&&$===void 0||vd(e,t,F,G,o,$);return}}for(var B in s)G=s[B],s.hasOwnProperty(B)&&G!=null&&!o.hasOwnProperty(B)&&Qe(e,t,B,null,o,G);for(Q in o)G=o[Q],$=s[Q],!o.hasOwnProperty(Q)||G===$||G==null&&$==null||Qe(e,t,Q,G,o,$)}function Xv(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,t=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var u=s[o],h=u.transferSize,_=u.initiatorType,T=u.duration;if(h&&T&&Xv(_)){for(_=0,T=u.responseEnd,o+=1;o<s.length;o++){var D=s[o],V=D.startTime;if(V>T)break;var F=D.transferSize,Q=D.initiatorType;F&&Xv(Q)&&(D=D.responseEnd,_+=F*(D<T?1:(T-V)/(D-V)))}if(--o,t+=8*(h+_)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var gd=null,yd=null;function br(e){return e.nodeType===9?e:e.ownerDocument}function Qv(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 Wv(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function bd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var xd=null;function HS(){var e=window.event;return e&&e.type==="popstate"?e===xd?!1:(xd=e,!0):(xd=null,!1)}var Jv=typeof setTimeout=="function"?setTimeout:void 0,GS=typeof clearTimeout=="function"?clearTimeout:void 0,eg=typeof Promise=="function"?Promise:void 0,PS=typeof queueMicrotask=="function"?queueMicrotask:typeof eg<"u"?function(e){return eg.resolve(null).then(e).catch($S)}:Jv;function $S(e){setTimeout(function(){throw e})}function Ha(e){return e==="head"}function tg(e,t){var s=t,o=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(o===0){e.removeChild(u),_i(t);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Eo(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Eo(s);for(var h=s.firstChild;h;){var _=h.nextSibling,T=h.nodeName;h[Ki]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=_}}else s==="body"&&Eo(e.ownerDocument.body);s=u}while(s);_i(t)}function ng(e,t){var s=e;e=0;do{var o=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=o}while(s)}function _d(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":_d(s),Nc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function qS(e,t,s,o){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Ki])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=kn(e.nextSibling),e===null)break}return null}function KS(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=kn(e.nextSibling),e===null))return null;return e}function ag(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=kn(e.nextSibling),e===null))return null;return e}function Sd(e){return e.data==="$?"||e.data==="$~"}function Td(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function YS(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var o=function(){t(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function kn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var kd=null;function sg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return kn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function ig(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function og(e,t,s){switch(t=br(s),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Eo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nc(e)}var jn=new Map,lg=new Set;function xr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fa=P.d;P.d={f:FS,r:ZS,D:XS,C:QS,L:WS,m:JS,X:t1,S:e1,M:n1};function FS(){var e=fa.f(),t=dr();return e||t}function ZS(e){var t=Vs(e);t!==null&&t.tag===5&&t.type==="form"?kp(t):fa.r(e)}var yi=typeof document>"u"?null:document;function rg(e,t,s){var o=yi;if(o&&typeof t=="string"&&t){var u=gn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),lg.has(u)||(lg.add(u),e={rel:e,crossOrigin:s,href:t},o.querySelector(u)===null&&(t=o.createElement("link"),It(t,"link",e),Dt(t),o.head.appendChild(t)))}}function XS(e){fa.D(e),rg("dns-prefetch",e,null)}function QS(e,t){fa.C(e,t),rg("preconnect",e,t)}function WS(e,t,s){fa.L(e,t,s);var o=yi;if(o&&e&&t){var u='link[rel="preload"][as="'+gn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+gn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+gn(s.imageSizes)+'"]')):u+='[href="'+gn(e)+'"]';var h=u;switch(t){case"style":h=bi(e);break;case"script":h=xi(e)}jn.has(h)||(e=b({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),jn.set(h,e),o.querySelector(u)!==null||t==="style"&&o.querySelector(Ao(h))||t==="script"&&o.querySelector(Do(h))||(t=o.createElement("link"),It(t,"link",e),Dt(t),o.head.appendChild(t)))}}function JS(e,t){fa.m(e,t);var s=yi;if(s&&e){var o=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+gn(o)+'"][href="'+gn(e)+'"]',h=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=xi(e)}if(!jn.has(h)&&(e=b({rel:"modulepreload",href:e},t),jn.set(h,e),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Do(h)))return}o=s.createElement("link"),It(o,"link",e),Dt(o),s.head.appendChild(o)}}}function e1(e,t,s){fa.S(e,t,s);var o=yi;if(o&&e){var u=Hs(o).hoistableStyles,h=bi(e);t=t||"default";var _=u.get(h);if(!_){var T={loading:0,preload:null};if(_=o.querySelector(Ao(h)))T.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},s),(s=jn.get(h))&&jd(e,s);var D=_=o.createElement("link");Dt(D),It(D,"link",e),D._p=new Promise(function(V,F){D.onload=V,D.onerror=F}),D.addEventListener("load",function(){T.loading|=1}),D.addEventListener("error",function(){T.loading|=2}),T.loading|=4,_r(_,t,o)}_={type:"stylesheet",instance:_,count:1,state:T},u.set(h,_)}}}function t1(e,t){fa.X(e,t);var s=yi;if(s&&e){var o=Hs(s).hoistableScripts,u=xi(e),h=o.get(u);h||(h=s.querySelector(Do(u)),h||(e=b({src:e,async:!0},t),(t=jn.get(u))&&Nd(e,t),h=s.createElement("script"),Dt(h),It(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function n1(e,t){fa.M(e,t);var s=yi;if(s&&e){var o=Hs(s).hoistableScripts,u=xi(e),h=o.get(u);h||(h=s.querySelector(Do(u)),h||(e=b({src:e,async:!0,type:"module"},t),(t=jn.get(u))&&Nd(e,t),h=s.createElement("script"),Dt(h),It(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function cg(e,t,s,o){var u=(u=W.current)?xr(u):null;if(!u)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=bi(s.href),s=Hs(u).hoistableStyles,o=s.get(t),o||(o={type:"style",instance:null,count:0,state:null},s.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=bi(s.href);var h=Hs(u).hoistableStyles,_=h.get(e);if(_||(u=u.ownerDocument||u,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,_),(h=u.querySelector(Ao(e)))&&!h._p&&(_.instance=h,_.state.loading=5),jn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},jn.set(e,s),h||a1(u,e,s,_.state))),t&&o===null)throw Error(l(528,""));return _}if(t&&o!==null)throw Error(l(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=xi(s),s=Hs(u).hoistableScripts,o=s.get(t),o||(o={type:"script",instance:null,count:0,state:null},s.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function bi(e){return'href="'+gn(e)+'"'}function Ao(e){return'link[rel="stylesheet"]['+e+"]"}function ug(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function a1(e,t,s,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),It(t,"link",s),Dt(t),e.head.appendChild(t))}function xi(e){return'[src="'+gn(e)+'"]'}function Do(e){return"script[async]"+e}function dg(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+gn(s.href)+'"]');if(o)return t.instance=o,Dt(o),o;var u=b({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),Dt(o),It(o,"style",u),_r(o,s.precedence,e),t.instance=o;case"stylesheet":u=bi(s.href);var h=e.querySelector(Ao(u));if(h)return t.state.loading|=4,t.instance=h,Dt(h),h;o=ug(s),(u=jn.get(u))&&jd(o,u),h=(e.ownerDocument||e).createElement("link"),Dt(h);var _=h;return _._p=new Promise(function(T,D){_.onload=T,_.onerror=D}),It(h,"link",o),t.state.loading|=4,_r(h,s.precedence,e),t.instance=h;case"script":return h=xi(s.src),(u=e.querySelector(Do(h)))?(t.instance=u,Dt(u),u):(o=s,(u=jn.get(h))&&(o=b({},s),Nd(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),Dt(u),It(u,"link",o),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,_r(o,s.precedence,e));return t.instance}function _r(e,t,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,h=u,_=0;_<o.length;_++){var T=o[_];if(T.dataset.precedence===t)h=T;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function jd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Nd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Sr=null;function fg(e,t,s){if(Sr===null){var o=new Map,u=Sr=new Map;u.set(s,o)}else u=Sr,o=u.get(s),o||(o=new Map,u.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var h=s[u];if(!(h[Ki]||h[Mt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(t)||"";_=e+_;var T=o.get(_);T?T.push(h):o.set(_,[h])}}return o}function hg(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function s1(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function mg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function i1(e,t,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=bi(o.href),h=t.querySelector(Ao(u));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Tr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,Dt(h);return}h=t.ownerDocument||t,o=ug(o),(u=jn.get(u))&&jd(o,u),h=h.createElement("link"),Dt(h);var _=h;_._p=new Promise(function(T,D){_.onload=T,_.onerror=D}),It(h,"link",o),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Tr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Cd=0;function o1(e,t){return e.stylesheets&&e.count===0&&jr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var o=setTimeout(function(){if(e.stylesheets&&jr(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Cd===0&&(Cd=62500*VS());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&jr(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Cd?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function Tr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var kr=null;function jr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,kr=new Map,t.forEach(l1,e),kr=null,Tr.call(e))}function l1(e,t){if(!(t.state.loading&4)){var s=kr.get(e);if(s)var o=s.get(null);else{s=new Map,kr.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var _=u[h];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),o=_)}o&&s.set(null,o)}u=t.instance,_=u.getAttribute("data-precedence"),h=s.get(_)||o,h===o&&s.set(null,u),s.set(_,u),this.count++,o=Tr.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Ro={$$typeof:A,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function r1(e,t,s,o,u,h,_,T,D){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Sc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sc(0),this.hiddenUpdates=Sc(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function pg(e,t,s,o,u,h,_,T,D,V,F,Q){return e=new r1(e,t,s,_,D,V,F,Q,T),t=1,h===!0&&(t|=24),h=nn(3,null,null,t),e.current=h,h.stateNode=e,t=ou(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:o,isDehydrated:s,cache:t},uu(h),e}function vg(e){return e?(e=Qs,e):Qs}function gg(e,t,s,o,u,h){u=vg(u),o.context===null?o.context=u:o.pendingContext=u,o=Aa(t),o.payload={element:s},h=h===void 0?null:h,h!==null&&(o.callback=h),s=Da(e,o,t),s!==null&&(Qt(s,e,t),co(s,e,t))}function yg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function wd(e,t){yg(e,t),(e=e.alternate)&&yg(e,t)}function bg(e){if(e.tag===13||e.tag===31){var t=ss(e,67108864);t!==null&&Qt(t,e,67108864),wd(e,67108864)}}function xg(e){if(e.tag===13||e.tag===31){var t=rn();t=Tc(t);var s=ss(e,t);s!==null&&Qt(s,e,t),wd(e,t)}}var Nr=!0;function c1(e,t,s,o){var u=O.T;O.T=null;var h=P.p;try{P.p=2,Ed(e,t,s,o)}finally{P.p=h,O.T=u}}function u1(e,t,s,o){var u=O.T;O.T=null;var h=P.p;try{P.p=8,Ed(e,t,s,o)}finally{P.p=h,O.T=u}}function Ed(e,t,s,o){if(Nr){var u=Ad(o);if(u===null)pd(e,t,o,Cr,s),Sg(e,o);else if(f1(u,e,t,s,o))o.stopPropagation();else if(Sg(e,o),t&4&&-1<d1.indexOf(e)){for(;u!==null;){var h=Vs(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=Rn(h.pendingLanes);if(_!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;_;){var D=1<<31-Ke(_);T.entanglements[1]|=D,_&=~D}Hn(h),($e&6)===0&&(cr=Ut()+500,No(0))}}break;case 31:case 13:T=ss(h,2),T!==null&&Qt(T,h,2),dr(),wd(h,2)}if(h=Ad(o),h===null&&pd(e,t,o,Cr,s),h===u)break;u=h}u!==null&&o.stopPropagation()}else pd(e,t,o,null,s)}}function Ad(e){return e=Rc(e),Dd(e)}var Cr=null;function Dd(e){if(Cr=null,e=Us(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=f(t),e!==null)return e;e=null}else if(s===31){if(e=m(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Cr=e,null}function _g(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(yl()){case bl:return 2;case Z:return 8;case oe:case fe:return 32;case _e:return 268435456;default:return 32}default:return 32}}var Rd=!1,Ga=null,Pa=null,$a=null,Mo=new Map,Oo=new Map,qa=[],d1="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 Sg(e,t){switch(e){case"focusin":case"focusout":Ga=null;break;case"dragenter":case"dragleave":Pa=null;break;case"mouseover":case"mouseout":$a=null;break;case"pointerover":case"pointerout":Mo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oo.delete(t.pointerId)}}function Bo(e,t,s,o,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:o,nativeEvent:h,targetContainers:[u]},t!==null&&(t=Vs(t),t!==null&&bg(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function f1(e,t,s,o,u){switch(t){case"focusin":return Ga=Bo(Ga,e,t,s,o,u),!0;case"dragenter":return Pa=Bo(Pa,e,t,s,o,u),!0;case"mouseover":return $a=Bo($a,e,t,s,o,u),!0;case"pointerover":var h=u.pointerId;return Mo.set(h,Bo(Mo.get(h)||null,e,t,s,o,u)),!0;case"gotpointercapture":return h=u.pointerId,Oo.set(h,Bo(Oo.get(h)||null,e,t,s,o,u)),!0}return!1}function Tg(e){var t=Us(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=f(s),t!==null){e.blockedOn=t,Ih(e.priority,function(){xg(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,Ih(e.priority,function(){xg(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Ad(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);Dc=o,s.target.dispatchEvent(o),Dc=null}else return t=Vs(s),t!==null&&bg(t),e.blockedOn=s,!1;t.shift()}return!0}function kg(e,t,s){wr(e)&&s.delete(t)}function h1(){Rd=!1,Ga!==null&&wr(Ga)&&(Ga=null),Pa!==null&&wr(Pa)&&(Pa=null),$a!==null&&wr($a)&&($a=null),Mo.forEach(kg),Oo.forEach(kg)}function Er(e,t){e.blockedOn===t&&(e.blockedOn=null,Rd||(Rd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,h1)))}var Ar=null;function jg(e){Ar!==e&&(Ar=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ar===e&&(Ar=null);for(var t=0;t<e.length;t+=3){var s=e[t],o=e[t+1],u=e[t+2];if(typeof o!="function"){if(Dd(o||s)===null)continue;break}var h=Vs(s);h!==null&&(e.splice(t,3),t-=3,Au(h,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function _i(e){function t(D){return Er(D,e)}Ga!==null&&Er(Ga,e),Pa!==null&&Er(Pa,e),$a!==null&&Er($a,e),Mo.forEach(t),Oo.forEach(t);for(var s=0;s<qa.length;s++){var o=qa[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<qa.length&&(s=qa[0],s.blockedOn===null);)Tg(s),s.blockedOn===null&&qa.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var u=s[o],h=s[o+1],_=u[qt]||null;if(typeof h=="function")_||jg(s);else if(_){var T=null;if(h&&h.hasAttribute("formAction")){if(u=h,_=h[qt]||null)T=_.formAction;else if(Dd(u)!==null)continue}else T=_.action;typeof T=="function"?s[o+1]=T:(s.splice(o,3),o-=3),jg(s)}}}function Ng(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(_){return u=_})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),o||setTimeout(s,20)}function s(){if(!o&&!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 o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Md(e){this._internalRoot=e}Dr.prototype.render=Md.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var s=t.current,o=rn();gg(s,o,e,t,null,null)},Dr.prototype.unmount=Md.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gg(e.current,2,null,e,null,null),dr(),t[zs]=null}};function Dr(e){this._internalRoot=e}Dr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Lh();e={blockedOn:null,target:e,priority:t};for(var s=0;s<qa.length&&t!==0&&t<qa[s].priority;s++);qa.splice(s,0,e),s===0&&Tg(e)}};var Cg=a.version;if(Cg!=="19.2.4")throw Error(l(527,Cg,"19.2.4"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=v(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var m1={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rr.isDisabled&&Rr.supportsFiber)try{Se=Rr.inject(m1),ze=Rr}catch{}}return Io.createRoot=function(e,t){if(!c(e))throw Error(l(299));var s=!1,o="",u=Op,h=Bp,_=Lp;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(_=t.onRecoverableError)),t=pg(e,1,!1,null,null,s,o,null,u,h,_,Ng),e[zs]=t.current,md(e),new Md(t)},Io.hydrateRoot=function(e,t,s){if(!c(e))throw Error(l(299));var o=!1,u="",h=Op,_=Bp,T=Lp,D=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(T=s.onRecoverableError),s.formState!==void 0&&(D=s.formState)),t=pg(e,1,!0,t,s??null,o,u,D,h,_,T,Ng),t.context=vg(null),s=t.current,o=rn(),o=Tc(o),u=Aa(o),u.callback=null,Da(s,u,o),s=o,t.current.lanes=s,qi(t,s),Hn(t),e[zs]=t.current,md(e),new Dr(t)},Io.version="19.2.4",Io}var Bg;function U1(){if(Bg)return Od.exports;Bg=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Od.exports=z1(),Od.exports}var V1=U1();const H1="modulepreload",G1=function(n){return"/"+n},Lg={},P1=function(a,i,l){let c=Promise.resolve();if(i&&i.length>0){let f=function(v){return Promise.all(v.map(g=>Promise.resolve(g).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));c=f(i.map(v=>{if(v=G1(v),v in Lg)return;Lg[v]=!0;const g=v.endsWith(".css"),b=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${b}`))return;const x=document.createElement("link");if(x.rel=g?"stylesheet":H1,g||(x.as="script"),x.crossOrigin="",x.href=v,p&&x.setAttribute("nonce",p),document.head.appendChild(x),g)return new Promise((S,j)=>{x.addEventListener("load",S),x.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${v}`)))})}))}function d(f){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=f,window.dispatchEvent(m),!m.defaultPrevented)throw f}return c.then(f=>{for(const m of f||[])m.status==="rejected"&&d(m.reason);return a().catch(d)})};function js(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function A0(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function $1(n){return js(n)&&typeof n.id=="string"&&typeof n.type=="string"&&typeof n.timestamp=="string"&&js(n.payload)}function q1(n){return js(n)&&typeof n.sessionId=="string"&&typeof n.eventType=="string"&&typeof n.timestamp=="string"&&typeof n.content=="string"&&(n.raw===void 0||typeof n.raw=="string")}const K1=new Set(["off","subscription","api_key"]),Br=new Set(["off","on"]);function Y1(n){return js(n)&&K1.has(n.claude)&&Br.has(n.github)&&Br.has(n.copilot)&&Br.has(n.codex)&&Br.has(n.goose)}function F1(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!js(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:js(a.payload)?a.payload:{}}:{type:a.type,payload:js(a.payload)?a.payload:void 0}}function D0(n){switch(n){case"waiting_input":return"idle";case"completed":return"stopped";case"killed":return"stopped";case"failed":return"stopped";case"interrupted":return"stopped";default:return n}}function R0(n){switch(n){case"completed":return"completed";case"killed":return"killed";case"failed":return"interrupted";case"interrupted":return"interrupted";default:return}}const Z1=3e3,Si=5e3,X1=4001;/**
27
+ * react-router v7.13.2
28
+ *
29
+ * Copyright (c) Remix Software Inc.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE.md file in the root directory of this source tree.
33
+ *
34
+ * @license MIT
35
+ */var Ig="popstate";function zg(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function Q1(n={}){function a(l,c){var v;let d=(v=c.state)==null?void 0:v.masked,{pathname:f,search:m,hash:p}=d||l.location;return cf("",{pathname:f,search:m,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default",d?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,c){return typeof c=="string"?c:tl(c)}return J1(a,i,null,n)}function ot(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function En(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function W1(){return Math.random().toString(36).substring(2,10)}function Ug(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function cf(n,a,i=null,l,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Ui(a):a,state:i,key:a&&a.key||l||W1(),unstable_mask:c}}function tl({pathname:n="/",search:a="",hash:i=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(n+=i.charAt(0)==="#"?i:"#"+i),n}function Ui(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let l=n.indexOf("?");l>=0&&(a.search=n.substring(l),n=n.substring(0,l)),n&&(a.pathname=n)}return a}function J1(n,a,i,l={}){let{window:c=document.defaultView,v5Compat:d=!1}=l,f=c.history,m="POP",p=null,v=g();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function g(){return(f.state||{idx:null}).idx}function b(){m="POP";let N=g(),k=N==null?null:N-v;v=N,p&&p({action:m,location:C.location,delta:k})}function x(N,k){m="PUSH";let w=zg(N)?N:cf(C.location,N,k);v=g()+1;let A=Ug(w,v),R=C.createHref(w.unstable_mask||w);try{f.pushState(A,"",R)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;c.location.assign(R)}d&&p&&p({action:m,location:C.location,delta:1})}function S(N,k){m="REPLACE";let w=zg(N)?N:cf(C.location,N,k);v=g();let A=Ug(w,v),R=C.createHref(w.unstable_mask||w);f.replaceState(A,"",R),d&&p&&p({action:m,location:C.location,delta:0})}function j(N){return eT(N)}let C={get action(){return m},get location(){return n(c,f)},listen(N){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(Ig,b),p=N,()=>{c.removeEventListener(Ig,b),p=null}},createHref(N){return a(c,N)},createURL:j,encodeLocation(N){let k=j(N);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:x,replace:S,go(N){return f.go(N)}};return C}function eT(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),ot(i,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:tl(n);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}function M0(n,a,i="/"){return tT(n,a,i,!1)}function tT(n,a,i,l){let c=typeof a=="string"?Ui(a):a,d=ya(c.pathname||"/",i);if(d==null)return null;let f=O0(n);nT(f);let m=null;for(let p=0;m==null&&p<f.length;++p){let v=L0(d);m=dT(f[p],v,l)}return m}function O0(n,a=[],i=[],l="",c=!1){let d=(f,m,p=c,v)=>{let g={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(l)&&p)return;ot(g.relativePath.startsWith(l),`Absolute route path "${g.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(l.length)}let b=$n([l,g.relativePath]),x=i.concat(g);f.children&&f.children.length>0&&(ot(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),O0(f.children,a,x,b,p)),!(f.path==null&&!f.index)&&a.push({path:b,score:cT(b,f.index),routesMeta:x})};return n.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))d(f,m);else for(let v of B0(f.path))d(f,m,!0,v)}),a}function B0(n){let a=n.split("/");if(a.length===0)return[];let[i,...l]=a,c=i.endsWith("?"),d=i.replace(/\?$/,"");if(l.length===0)return c?[d,""]:[d];let f=B0(l.join("/")),m=[];return m.push(...f.map(p=>p===""?d:[d,p].join("/"))),c&&m.push(...f),m.map(p=>n.startsWith("/")&&p===""?"/":p)}function nT(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:uT(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var aT=/^:[\w-]+$/,sT=3,iT=2,oT=1,lT=10,rT=-2,Vg=n=>n==="*";function cT(n,a){let i=n.split("/"),l=i.length;return i.some(Vg)&&(l+=rT),a&&(l+=iT),i.filter(c=>!Vg(c)).reduce((c,d)=>c+(aT.test(d)?sT:d===""?oT:lT),l)}function uT(n,a){return n.length===a.length&&n.slice(0,-1).every((l,c)=>l===a[c])?n[n.length-1]-a[a.length-1]:0}function dT(n,a,i=!1){let{routesMeta:l}=n,c={},d="/",f=[];for(let m=0;m<l.length;++m){let p=l[m],v=m===l.length-1,g=d==="/"?a:a.slice(d.length)||"/",b=nl({path:p.relativePath,caseSensitive:p.caseSensitive,end:v},g),x=p.route;if(!b&&v&&i&&!l[l.length-1].route.index&&(b=nl({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},g)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:$n([d,b.pathname]),pathnameBase:vT($n([d,b.pathnameBase])),route:x}),b.pathnameBase!=="/"&&(d=$n([d,b.pathnameBase]))}return f}function nl(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,l]=fT(n.path,n.caseSensitive,n.end),c=a.match(i);if(!c)return null;let d=c[0],f=d.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:l.reduce((v,{paramName:g,isOptional:b},x)=>{if(g==="*"){let j=m[x]||"";f=d.slice(0,d.length-j.length).replace(/(.)\/+$/,"$1")}const S=m[x];return b&&!S?v[g]=void 0:v[g]=(S||"").replace(/%2F/g,"/"),v},{}),pathname:d,pathnameBase:f,pattern:n}}function fT(n,a=!1,i=!0){En(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let l=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,p,v,g)=>{if(l.push({paramName:m,isOptional:p!=null}),p){let b=g.charAt(v+f.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(l.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),l]}function L0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return En(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function ya(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=n.charAt(i);return l&&l!=="/"?null:n.slice(i)||"/"}var hT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function mT(n,a="/"){let{pathname:i,search:l="",hash:c=""}=typeof n=="string"?Ui(n):n,d;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?d=Hg(i.substring(1),"/"):d=Hg(i,a)):d=a,{pathname:d,search:gT(l),hash:yT(c)}}function Hg(n,a){let i=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(c=>{c===".."?i.length>1&&i.pop():c!=="."&&i.push(c)}),i.length>1?i.join("/"):"/"}function Id(n,a,i,l){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. 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 pT(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function If(n){let a=pT(n);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function uc(n,a,i,l=!1){let c;typeof n=="string"?c=Ui(n):(c={...n},ot(!c.pathname||!c.pathname.includes("?"),Id("?","pathname","search",c)),ot(!c.pathname||!c.pathname.includes("#"),Id("#","pathname","hash",c)),ot(!c.search||!c.search.includes("#"),Id("#","search","hash",c)));let d=n===""||c.pathname==="",f=d?"/":c.pathname,m;if(f==null)m=i;else{let b=a.length-1;if(!l&&f.startsWith("..")){let x=f.split("/");for(;x[0]==="..";)x.shift(),b-=1;c.pathname=x.join("/")}m=b>=0?a[b]:"/"}let p=mT(c,m),v=f&&f!=="/"&&f.endsWith("/"),g=(d||f===".")&&i.endsWith("/");return!p.pathname.endsWith("/")&&(v||g)&&(p.pathname+="/"),p}var $n=n=>n.join("/").replace(/\/\/+/g,"/"),vT=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),gT=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,yT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,bT=class{constructor(n,a,i,l=!1){this.status=n,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function xT(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function _T(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var I0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function z0(n,a){let i=n;if(typeof i!="string"||!hT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,c=!1;if(I0)try{let d=new URL(window.location.href),f=i.startsWith("//")?new URL(d.protocol+i):new URL(i),m=ya(f.pathname,a);f.origin===d.origin&&m!=null?i=m+f.search+f.hash:c=!0}catch{En(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:c,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var U0=["POST","PUT","PATCH","DELETE"];new Set(U0);var ST=["GET",...U0];new Set(ST);var Vi=y.createContext(null);Vi.displayName="DataRouter";var dc=y.createContext(null);dc.displayName="DataRouterState";var TT=y.createContext(!1),V0=y.createContext({isTransitioning:!1});V0.displayName="ViewTransition";var kT=y.createContext(new Map);kT.displayName="Fetchers";var jT=y.createContext(null);jT.displayName="Await";var fn=y.createContext(null);fn.displayName="Navigation";var ul=y.createContext(null);ul.displayName="Location";var An=y.createContext({outlet:null,matches:[],isDataRoute:!1});An.displayName="Route";var zf=y.createContext(null);zf.displayName="RouteError";var H0="REACT_ROUTER_ERROR",NT="REDIRECT",CT="ROUTE_ERROR_RESPONSE";function wT(n){if(n.startsWith(`${H0}:${NT}:{`))try{let a=JSON.parse(n.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function ET(n){if(n.startsWith(`${H0}:${CT}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new bT(a.status,a.statusText,a.data)}catch{}}function AT(n,{relative:a}={}){ot(Es(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=y.useContext(fn),{hash:c,pathname:d,search:f}=dl(n,{relative:a}),m=d;return i!=="/"&&(m=d==="/"?i:$n([i,d])),l.createHref({pathname:m,search:f,hash:c})}function Es(){return y.useContext(ul)!=null}function wt(){return ot(Es(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(ul).location}function St(n){ot(Es(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=wt();return y.useMemo(()=>nl(n,L0(a)),[a,n])}var G0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function P0(n){y.useContext(fn).static||y.useLayoutEffect(n)}function fc(){let{isDataRoute:n}=y.useContext(An);return n?qT():DT()}function DT(){ot(Es(),"useNavigate() may be used only in the context of a <Router> component.");let n=y.useContext(Vi),{basename:a,navigator:i}=y.useContext(fn),{matches:l}=y.useContext(An),{pathname:c}=wt(),d=JSON.stringify(If(l)),f=y.useRef(!1);return P0(()=>{f.current=!0}),y.useCallback((p,v={})=>{if(En(f.current,G0),!f.current)return;if(typeof p=="number"){i.go(p);return}let g=uc(p,JSON.parse(d),c,v.relative==="path");n==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:$n([a,g.pathname])),(v.replace?i.replace:i.push)(g,v.state,v)},[a,i,d,c,n])}var RT=y.createContext(null);function MT(n){let a=y.useContext(An).outlet;return y.useMemo(()=>a&&y.createElement(RT.Provider,{value:n},a),[a,n])}function Wa(){let{matches:n}=y.useContext(An),a=n[n.length-1];return a?a.params:{}}function dl(n,{relative:a}={}){let{matches:i}=y.useContext(An),{pathname:l}=wt(),c=JSON.stringify(If(i));return y.useMemo(()=>uc(n,JSON.parse(c),l,a==="path"),[n,c,l,a])}function OT(n,a){return $0(n,a)}function $0(n,a,i){var N;ot(Es(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=y.useContext(fn),{matches:c}=y.useContext(An),d=c[c.length-1],f=d?d.params:{},m=d?d.pathname:"/",p=d?d.pathnameBase:"/",v=d&&d.route;{let k=v&&v.path||"";K0(m,!v||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
36
+
37
+ Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let g=wt(),b;if(a){let k=typeof a=="string"?Ui(a):a;ot(p==="/"||((N=k.pathname)==null?void 0:N.startsWith(p)),`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 "${p}" but pathname "${k.pathname}" was given in the \`location\` prop.`),b=k}else b=g;let x=b.pathname||"/",S=x;if(p!=="/"){let k=p.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(k.length).join("/")}let j=M0(n,{pathname:S});En(v||j!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),En(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=UT(j&&j.map(k=>Object.assign({},k,{params:Object.assign({},f,k.params),pathname:$n([p,l.encodeLocation?l.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?p:$n([p,l.encodeLocation?l.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),c,i);return a&&C?y.createElement(ul.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},C):C}function BT(){let n=$T(),a=xT(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,l="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:l},d={padding:"2px 4px",backgroundColor:l},f=null;return console.error("Error handled by React Router default ErrorBoundary:",n),f=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:d},"ErrorBoundary")," or"," ",y.createElement("code",{style:d},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},a),i?y.createElement("pre",{style:c},i):null,f)}var LT=y.createElement(BT,null),q0=class extends y.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const i=ET(n.digest);i&&(n=i)}let a=n!==void 0?y.createElement(An.Provider,{value:this.props.routeContext},y.createElement(zf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?y.createElement(IT,{error:n},a):a}};q0.contextType=TT;var zd=new WeakMap;function IT({children:n,error:a}){let{basename:i}=y.useContext(fn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=wT(a.digest);if(l){let c=zd.get(a);if(c)throw c;let d=z0(l.location,i);if(I0&&!zd.get(a))if(d.isExternal||l.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:l.replace}));throw zd.set(a,f),f}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return n}function zT({routeContext:n,match:a,children:i}){let l=y.useContext(Vi);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),y.createElement(An.Provider,{value:n},i)}function UT(n,a=[],i){let l=i==null?void 0:i.state;if(n==null){if(!l)return null;if(l.errors)n=l.matches;else if(a.length===0&&!l.initialized&&l.matches.length>0)n=l.matches;else return null}let c=n,d=l==null?void 0:l.errors;if(d!=null){let g=c.findIndex(b=>b.route.id&&(d==null?void 0:d[b.route.id])!==void 0);ot(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,g+1))}let f=!1,m=-1;if(i&&l){f=l.renderFallback;for(let g=0;g<c.length;g++){let b=c[g];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(m=g),b.route.id){let{loaderData:x,errors:S}=l,j=b.route.loader&&!x.hasOwnProperty(b.route.id)&&(!S||S[b.route.id]===void 0);if(b.route.lazy||j){i.isStatic&&(f=!0),m>=0?c=c.slice(0,m+1):c=[c[0]];break}}}}let p=i==null?void 0:i.onError,v=l&&p?(g,b)=>{var x,S;p(g,{location:l.location,params:((S=(x=l.matches)==null?void 0:x[0])==null?void 0:S.params)??{},unstable_pattern:_T(l.matches),errorInfo:b})}:void 0;return c.reduceRight((g,b,x)=>{let S,j=!1,C=null,N=null;l&&(S=d&&b.route.id?d[b.route.id]:void 0,C=b.route.errorElement||LT,f&&(m<0&&x===0?(K0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,N=null):m===x&&(j=!0,N=b.route.hydrateFallbackElement||null)));let k=a.concat(c.slice(0,x+1)),w=()=>{let A;return S?A=C:j?A=N:b.route.Component?A=y.createElement(b.route.Component,null):b.route.element?A=b.route.element:A=g,y.createElement(zT,{match:b,routeContext:{outlet:g,matches:k,isDataRoute:l!=null},children:A})};return l&&(b.route.ErrorBoundary||b.route.errorElement||x===0)?y.createElement(q0,{location:l.location,revalidation:l.revalidation,component:C,error:S,children:w(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:v}):w()},null)}function Uf(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function VT(n){let a=y.useContext(Vi);return ot(a,Uf(n)),a}function HT(n){let a=y.useContext(dc);return ot(a,Uf(n)),a}function GT(n){let a=y.useContext(An);return ot(a,Uf(n)),a}function Vf(n){let a=GT(n),i=a.matches[a.matches.length-1];return ot(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function PT(){return Vf("useRouteId")}function $T(){var l;let n=y.useContext(zf),a=HT("useRouteError"),i=Vf("useRouteError");return n!==void 0?n:(l=a.errors)==null?void 0:l[i]}function qT(){let{router:n}=VT("useNavigate"),a=Vf("useNavigate"),i=y.useRef(!1);return P0(()=>{i.current=!0}),y.useCallback(async(c,d={})=>{En(i.current,G0),i.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...d}))},[n,a])}var Gg={};function K0(n,a,i){!a&&!Gg[n]&&(Gg[n]=!0,En(!1,i))}y.memo(KT);function KT({routes:n,future:a,state:i,isStatic:l,onError:c}){return $0(n,void 0,{state:i,isStatic:l,onError:c})}function Pn({to:n,replace:a,state:i,relative:l}){ot(Es(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(fn);En(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=y.useContext(An),{pathname:f}=wt(),m=fc(),p=uc(n,If(d),f,l==="path"),v=JSON.stringify(p);return y.useEffect(()=>{m(JSON.parse(v),{replace:a,state:i,relative:l})},[m,v,l,a,i]),null}function As(n){return MT(n.context)}function Te(n){ot(!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 YT({basename:n="/",children:a=null,location:i,navigationType:l="POP",navigator:c,static:d=!1,unstable_useTransitions:f}){ot(!Es(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=n.replace(/^\/*/,"/"),p=y.useMemo(()=>({basename:m,navigator:c,static:d,unstable_useTransitions:f,future:{}}),[m,c,d,f]);typeof i=="string"&&(i=Ui(i));let{pathname:v="/",search:g="",hash:b="",state:x=null,key:S="default",unstable_mask:j}=i,C=y.useMemo(()=>{let N=ya(v,m);return N==null?null:{location:{pathname:N,search:g,hash:b,state:x,key:S,unstable_mask:j},navigationType:l}},[m,v,g,b,x,S,l,j]);return En(C!=null,`<Router basename="${m}"> is not able to match the URL "${v}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:y.createElement(fn.Provider,{value:p},y.createElement(ul.Provider,{children:a,value:C}))}function FT({children:n,location:a}){return OT(uf(n),a)}function uf(n,a=[]){let i=[];return y.Children.forEach(n,(l,c)=>{if(!y.isValidElement(l))return;let d=[...a,c];if(l.type===y.Fragment){i.push.apply(i,uf(l.props.children,d));return}ot(l.type===Te,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ot(!l.props.index||!l.props.children,"An index route cannot have child routes.");let f={id:l.props.id||d.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=uf(l.props.children,d)),i.push(f)}),i}var Kr="get",Yr="application/x-www-form-urlencoded";function hc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function ZT(n){return hc(n)&&n.tagName.toLowerCase()==="button"}function XT(n){return hc(n)&&n.tagName.toLowerCase()==="form"}function QT(n){return hc(n)&&n.tagName.toLowerCase()==="input"}function WT(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function JT(n,a){return n.button===0&&(!a||a==="_self")&&!WT(n)}function df(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let l=n[i];return a.concat(Array.isArray(l)?l.map(c=>[i,c]):[[i,l]])},[]))}function ek(n,a){let i=df(n);return a&&a.forEach((l,c)=>{i.has(c)||a.getAll(c).forEach(d=>{i.append(c,d)})}),i}var Lr=null;function tk(){if(Lr===null)try{new FormData(document.createElement("form"),0),Lr=!1}catch{Lr=!0}return Lr}var nk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ud(n){return n!=null&&!nk.has(n)?(En(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yr}"`),null):n}function ak(n,a){let i,l,c,d,f;if(XT(n)){let m=n.getAttribute("action");l=m?ya(m,a):null,i=n.getAttribute("method")||Kr,c=Ud(n.getAttribute("enctype"))||Yr,d=new FormData(n)}else if(ZT(n)||QT(n)&&(n.type==="submit"||n.type==="image")){let m=n.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=n.getAttribute("formaction")||m.getAttribute("action");if(l=p?ya(p,a):null,i=n.getAttribute("formmethod")||m.getAttribute("method")||Kr,c=Ud(n.getAttribute("formenctype"))||Ud(m.getAttribute("enctype"))||Yr,d=new FormData(m,n),!tk()){let{name:v,type:g,value:b}=n;if(g==="image"){let x=v?`${v}.`:"";d.append(`${x}x`,"0"),d.append(`${x}y`,"0")}else v&&d.append(v,b)}}else{if(hc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Kr,l=null,c=Yr,f=n}return d&&c==="text/plain"&&(f=d,d=void 0),{action:l,method:i.toLowerCase(),encType:c,formData:d,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Hf(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function sk(n,a,i,l){let c=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${l}`:c.pathname=`${c.pathname}.${l}`:c.pathname==="/"?c.pathname=`_root.${l}`:a&&ya(c.pathname,a)==="/"?c.pathname=`${a.replace(/\/$/,"")}/_root.${l}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${l}`,c}async function ik(n,a){if(n.id in a)return a[n.id];try{let i=await import(n.module);return a[n.id]=i,i}catch(i){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ok(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function lk(n,a,i){let l=await Promise.all(n.map(async c=>{let d=a.routes[c.route.id];if(d){let f=await ik(d,i);return f.links?f.links():[]}return[]}));return dk(l.flat(1).filter(ok).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Pg(n,a,i,l,c,d){let f=(p,v)=>i[v]?p.route.id!==i[v].route.id:!0,m=(p,v)=>{var g;return i[v].pathname!==p.pathname||((g=i[v].route.path)==null?void 0:g.endsWith("*"))&&i[v].params["*"]!==p.params["*"]};return d==="assets"?a.filter((p,v)=>f(p,v)||m(p,v)):d==="data"?a.filter((p,v)=>{var b;let g=l.routes[p.route.id];if(!g||!g.hasLoader)return!1;if(f(p,v)||m(p,v))return!0;if(p.route.shouldRevalidate){let x=p.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((b=i[0])==null?void 0:b.params)||{},nextUrl:new URL(n,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function rk(n,a,{includeHydrateFallback:i}={}){return ck(n.map(l=>{let c=a.routes[l.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),i&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}function ck(n){return[...new Set(n)]}function uk(n){let a={},i=Object.keys(n).sort();for(let l of i)a[l]=n[l];return a}function dk(n,a){let i=new Set;return new Set(a),n.reduce((l,c)=>{let d=JSON.stringify(uk(c));return i.has(d)||(i.add(d),l.push({key:d,link:c})),l},[])}function Y0(){let n=y.useContext(Vi);return Hf(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function fk(){let n=y.useContext(dc);return Hf(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Gf=y.createContext(void 0);Gf.displayName="FrameworkContext";function F0(){let n=y.useContext(Gf);return Hf(n,"You must render this element inside a <HydratedRouter> element"),n}function hk(n,a){let i=y.useContext(Gf),[l,c]=y.useState(!1),[d,f]=y.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:v,onMouseLeave:g,onTouchStart:b}=a,x=y.useRef(null);y.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let C=k=>{k.forEach(w=>{f(w.isIntersecting)})},N=new IntersectionObserver(C,{threshold:.5});return x.current&&N.observe(x.current),()=>{N.disconnect()}}},[n]),y.useEffect(()=>{if(l){let C=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(C)}}},[l]);let S=()=>{c(!0)},j=()=>{c(!1),f(!1)};return i?n!=="intent"?[d,x,{}]:[d,x,{onFocus:zo(m,S),onBlur:zo(p,j),onMouseEnter:zo(v,S),onMouseLeave:zo(g,j),onTouchStart:zo(b,S)}]:[!1,x,{}]}function zo(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function mk({page:n,...a}){let{router:i}=Y0(),l=y.useMemo(()=>M0(i.routes,n,i.basename),[i.routes,n,i.basename]);return l?y.createElement(vk,{page:n,matches:l,...a}):null}function pk(n){let{manifest:a,routeModules:i}=F0(),[l,c]=y.useState([]);return y.useEffect(()=>{let d=!1;return lk(n,a,i).then(f=>{d||c(f)}),()=>{d=!0}},[n,a,i]),l}function vk({page:n,matches:a,...i}){let l=wt(),{future:c,manifest:d,routeModules:f}=F0(),{basename:m}=Y0(),{loaderData:p,matches:v}=fk(),g=y.useMemo(()=>Pg(n,a,v,d,l,"data"),[n,a,v,d,l]),b=y.useMemo(()=>Pg(n,a,v,d,l,"assets"),[n,a,v,d,l]),x=y.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let C=new Set,N=!1;if(a.forEach(w=>{var R;let A=d.routes[w.route.id];!A||!A.hasLoader||(!g.some(E=>E.route.id===w.route.id)&&w.route.id in p&&((R=f[w.route.id])!=null&&R.shouldRevalidate)||A.hasClientLoader?N=!0:C.add(w.route.id))}),C.size===0)return[];let k=sk(n,m,c.unstable_trailingSlashAwareDataRequests,"data");return N&&C.size>0&&k.searchParams.set("_routes",a.filter(w=>C.has(w.route.id)).map(w=>w.route.id).join(",")),[k.pathname+k.search]},[m,c.unstable_trailingSlashAwareDataRequests,p,l,d,g,a,n,f]),S=y.useMemo(()=>rk(b,d),[b,d]),j=pk(b);return y.createElement(y.Fragment,null,x.map(C=>y.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...i})),S.map(C=>y.createElement("link",{key:C,rel:"modulepreload",href:C,...i})),j.map(({key:C,link:N})=>y.createElement("link",{key:C,nonce:i.nonce,...N,crossOrigin:N.crossOrigin??i.crossOrigin})))}function gk(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var yk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{yk&&(window.__reactRouterVersion="7.13.2")}catch{}function bk({basename:n,children:a,unstable_useTransitions:i,window:l}){let c=y.useRef();c.current==null&&(c.current=Q1({window:l,v5Compat:!0}));let d=c.current,[f,m]=y.useState({action:d.action,location:d.location}),p=y.useCallback(v=>{i===!1?m(v):y.startTransition(()=>m(v))},[i]);return y.useLayoutEffect(()=>d.listen(p),[d,p]),y.createElement(YT,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:d,unstable_useTransitions:i})}var Z0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pf=y.forwardRef(function({onClick:a,discover:i="render",prefetch:l="none",relative:c,reloadDocument:d,replace:f,unstable_mask:m,state:p,target:v,to:g,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:S,...j},C){let{basename:N,navigator:k,unstable_useTransitions:w}=y.useContext(fn),A=typeof g=="string"&&Z0.test(g),R=z0(g,N);g=R.to;let E=AT(g,{relative:c}),H=wt(),z=null;if(m){let ae=uc(m,[],H.unstable_mask?H.unstable_mask.pathname:"/",!0);N!=="/"&&(ae.pathname=ae.pathname==="/"?N:$n([N,ae.pathname])),z=k.createHref(ae)}let[I,Y,ee]=hk(l,j),te=Tk(g,{replace:f,unstable_mask:m,state:p,target:v,preventScrollReset:b,relative:c,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:w});function ie(ae){a&&a(ae),ae.defaultPrevented||te(ae)}let ce=!(R.isExternal||d),K=y.createElement("a",{...j,...ee,href:(ce?z:void 0)||R.absoluteURL||E,onClick:ce?ie:a,ref:gk(C,Y),target:v,"data-discover":!A&&i==="render"?"true":void 0});return I&&!A?y.createElement(y.Fragment,null,K,y.createElement(mk,{page:E})):K});Pf.displayName="Link";var xk=y.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:l="",end:c=!1,style:d,to:f,viewTransition:m,children:p,...v},g){let b=dl(f,{relative:v.relative}),x=wt(),S=y.useContext(dc),{navigator:j,basename:C}=y.useContext(fn),N=S!=null&&wk(b)&&m===!0,k=j.encodeLocation?j.encodeLocation(b).pathname:b.pathname,w=x.pathname,A=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(w=w.toLowerCase(),A=A?A.toLowerCase():null,k=k.toLowerCase()),A&&C&&(A=ya(A,C)||A);const R=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let E=w===k||!c&&w.startsWith(k)&&w.charAt(R)==="/",H=A!=null&&(A===k||!c&&A.startsWith(k)&&A.charAt(k.length)==="/"),z={isActive:E,isPending:H,isTransitioning:N},I=E?a:void 0,Y;typeof l=="function"?Y=l(z):Y=[l,E?"active":null,H?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let ee=typeof d=="function"?d(z):d;return y.createElement(Pf,{...v,"aria-current":I,className:Y,ref:g,style:ee,to:f,viewTransition:m},typeof p=="function"?p(z):p)});xk.displayName="NavLink";var _k=y.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:l,replace:c,state:d,method:f=Kr,action:m,onSubmit:p,relative:v,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:x,...S},j)=>{let{unstable_useTransitions:C}=y.useContext(fn),N=Nk(),k=Ck(m,{relative:v}),w=f.toLowerCase()==="get"?"get":"post",A=typeof m=="string"&&Z0.test(m),R=E=>{if(p&&p(E),E.defaultPrevented)return;E.preventDefault();let H=E.nativeEvent.submitter,z=(H==null?void 0:H.getAttribute("formmethod"))||f,I=()=>N(H||E.currentTarget,{fetcherKey:a,method:z,navigate:i,replace:c,state:d,relative:v,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:x});C&&i!==!1?y.startTransition(()=>I()):I()};return y.createElement("form",{ref:j,method:w,action:k,onSubmit:l?p:R,...S,"data-discover":!A&&n==="render"?"true":void 0})});_k.displayName="Form";function Sk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function X0(n){let a=y.useContext(Vi);return ot(a,Sk(n)),a}function Tk(n,{target:a,replace:i,unstable_mask:l,state:c,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:p,unstable_useTransitions:v}={}){let g=fc(),b=wt(),x=dl(n,{relative:f});return y.useCallback(S=>{if(JT(S,a)){S.preventDefault();let j=i!==void 0?i:tl(b)===tl(x),C=()=>g(n,{replace:j,unstable_mask:l,state:c,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:p});v?y.startTransition(()=>C()):C()}},[b,g,x,i,l,c,a,n,d,f,m,p,v])}function $f(n){En(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=y.useRef(df(n)),i=y.useRef(!1),l=wt(),c=y.useMemo(()=>ek(l.search,i.current?null:a.current),[l.search]),d=fc(),f=y.useCallback((m,p)=>{const v=df(typeof m=="function"?m(new URLSearchParams(c)):m);i.current=!0,d("?"+v,p)},[d,c]);return[c,f]}var kk=0,jk=()=>`__${String(++kk)}__`;function Nk(){let{router:n}=X0("useSubmit"),{basename:a}=y.useContext(fn),i=PT(),l=n.fetch,c=n.navigate;return y.useCallback(async(d,f={})=>{let{action:m,method:p,encType:v,formData:g,body:b}=ak(d,a);if(f.navigate===!1){let x=f.fetcherKey||jk();await l(x,i,f.action||m,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:b,formMethod:f.method||p,formEncType:f.encType||v,flushSync:f.flushSync})}else await c(f.action||m,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:b,formMethod:f.method||p,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:i,flushSync:f.flushSync,viewTransition:f.viewTransition})},[l,c,a,i])}function Ck(n,{relative:a}={}){let{basename:i}=y.useContext(fn),l=y.useContext(An);ot(l,"useFormAction must be used inside a RouteContext");let[c]=l.matches.slice(-1),d={...dl(n||".",{relative:a})},f=wt();if(n==null){d.search=f.search;let m=new URLSearchParams(d.search),p=m.getAll("index");if(p.some(g=>g==="")){m.delete("index"),p.filter(b=>b).forEach(b=>m.append("index",b));let g=m.toString();d.search=g?`?${g}`:""}}return(!n||n===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(d.pathname=d.pathname==="/"?i:$n([i,d.pathname])),tl(d)}function wk(n,{relative:a}={}){let i=y.useContext(V0);ot(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=X0("useViewTransitionState"),c=dl(n,{relative:a});if(!i.isTransitioning)return!1;let d=ya(i.currentLocation.pathname,l)||i.currentLocation.pathname,f=ya(i.nextLocation.pathname,l)||i.nextLocation.pathname;return nl(c.pathname,f)!=null||nl(c.pathname,d)!=null}function Et(){const n=fc();return y.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function Q0(n){return`/sessions/${encodeURIComponent(n)}`}function Ri(n,a){return a?`/environments/${encodeURIComponent(a)}/workspaces/${encodeURIComponent(n)}`:`/workspaces/${encodeURIComponent(n)}`}function ba(n,a,i,l){const c=encodeURIComponent(n);let d;return i&&l?d=`/environments/${encodeURIComponent(l)}/workspaces/${encodeURIComponent(i)}/tasks/${c}`:i?d=`/workspaces/${encodeURIComponent(i)}/tasks/${c}`:d=`/tasks/${c}`,a?`${d}/${a}`:d}function Ek(n,a,i){return a&&i?`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(n)}/edit`:a?`/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(n)}/edit`:`/tasks/${encodeURIComponent(n)}/edit`}function Ds(n,a,i){const l=new URLSearchParams;n&&l.set("workspace",n),a&&l.set("parent",a);const c=l.toString();if(n&&i){const d=`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(n)}/tasks/new`;return a?`${d}?parent=${encodeURIComponent(a)}`:d}return c?`/tasks/new?${c}`:"/tasks/new"}function W0(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const Mi="/environments",Ak="/environments/new";function Oi(n){return`/environments/${encodeURIComponent(n)}`}function Dk(n){return`/environments/${encodeURIComponent(n)}/edit`}const Fo="/settings",Rk="/settings/credentials",Mk="/settings/shortcuts",Ok="/pair",Bk="/chat",Cs="/",Lk="/tasks",J0="/workspaces/new",eb="/knowledge";function Ik(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",l=y.useRef(void 0),[c,d]=y.useState(!1),f=y.useRef(a.onMessage);f.current=a.onMessage;const m=y.useRef(a.onConnect);m.current=a.onConnect;const p=y.useRef(a.onDisconnect);p.current=a.onDisconnect;const v=y.useCallback(g=>{var b;((b=l.current)==null?void 0:b.readyState)===WebSocket.OPEN&&l.current.send(JSON.stringify(g))},[]);return y.useEffect(()=>{let g,b;function x(){g=new WebSocket(i),l.current=g,g.onopen=()=>{d(!0),m.current(v)},g.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const j=F1(S.data);j&&f.current(j)},g.onclose=S=>{var j;if(d(!1),l.current=void 0,(j=p.current)==null||j.call(p),clearTimeout(b),S.code===X1){window.location.href=Ok;return}b=setTimeout(x,Z1)},g.onerror=()=>{g.close()}}return x(),()=>{clearTimeout(b),g==null||g.close()}},[i,v]),{connected:c,send:v}}const zk=new Proxy(globalThis.fetch,{apply(n,a,i){return Reflect.apply(globalThis.fetch,a,i)}}),Uk=C1({baseUrl:"/",fetch:zk}),je=w1(E1,Uk);function Vk(n){return{id:n.id,displayName:n.displayName,adapterType:n.adapterType,adapterConfig:n.adapterConfig||"{}",status:n.status,bootstrapped:n.bootstrapped}}function $g(n){return{id:n.id,environmentId:n.environmentId,runtime:n.runtime,status:n.status,prompt:n.prompt,startedAt:n.startedAt,endedAt:n.endedAt||void 0,error:n.error||void 0,endReason:n.endReason||void 0,personaId:n.personaId||void 0,inputTokens:n.inputTokens,outputTokens:n.outputTokens,costUsd:n.costUsd}}function Hk(n){return{sessionId:n.sessionId,eventType:A1(n.type),timestamp:n.timestamp,content:n.content,raw:n.raw||void 0}}function Gk(n){return{id:n.id,name:n.name,description:n.description,repoUrl:n.repoUrl,environmentId:n.environmentId,status:D1(n.status),workingDirectory:n.workingDirectory,useWorktrees:n.useWorktrees,defaultPersonaId:n.defaultPersonaId,createdAt:n.createdAt,updatedAt:n.updatedAt}}function qg(n){return{id:n.id,workspaceId:n.workspaceId??void 0,title:n.title,description:n.description,status:R1(n.status),branch:n.branch,latestSessionId:n.latestSessionId,dependsOn:[...n.dependsOn],sortOrder:n.sortOrder,createdAt:n.createdAt,startedAt:n.startedAt||void 0,completedAt:n.completedAt||void 0,parentTaskId:n.parentTaskId,depth:n.depth,childTaskIds:[...n.childTaskIds],canDecompose:n.canDecompose,defaultPersonaId:n.defaultPersonaId}}function Pk(n){return{id:n.id,workspaceId:n.workspaceId,taskId:n.taskId,sessionId:n.sessionId,category:n.category,title:n.title,content:n.content,tags:[...n.tags],createdAt:n.createdAt}}function $k(n){return{name:n.name,tokenType:n.type,envVar:n.envVar,filePath:n.filePath,expiresAt:n.expiresAt}}function qk(n){return{claude:M1(n.claude),github:Or(n.github),copilot:Or(n.copilot),codex:Or(n.codex),goose:Or(n.goose)}}function Kk(n){return{name:n.name,repository:n.repository,state:n.state,gitStatus:n.gitStatus}}function Yk(n){return{id:n.id,name:n.name,description:n.description,systemPrompt:n.systemPrompt,toolConfig:n.toolConfig?JSON.stringify({allowedTools:[...n.toolConfig.allowedTools],disallowedTools:[...n.toolConfig.disallowedTools]}):"{}",runtime:n.runtime,model:n.model,maxTurns:n.maxTurns,mcpServers:JSON.stringify(n.mcpServers.map(a=>({name:a.name,command:a.command,args:[...a.args],tools:[...a.tools]}))),createdAt:n.createdAt,updatedAt:n.updatedAt,type:n.type||"agent",script:n.script}}function Fk(n){return{inputTokens:n.inputTokens,outputTokens:n.outputTokens,costUsd:n.costUsd,sessionCount:n.sessionCount}}const Kg=5e3;function Zk(){const[n,a]=y.useState([]),[i,l]=y.useState({}),c=y.useCallback(()=>{je.listEnvironments({}).then(x=>{a(x.environments.map(Vk))},()=>{})},[]),d=y.useCallback(x=>{switch(x.type){case"environment.added":return!0;case"environment.removed":{const S=x.payload.environmentId;return S&&(a(j=>j.filter(C=>C.id!==S)),l(j=>{const C={...j};return delete C[S],C})),!0}case"environment.changed":return c(),!0;case"environment.provision_progress":{const S=x.payload;if(typeof S.environmentId!="string"||typeof S.stage!="string"||typeof S.message!="string"||typeof S.progress!="number")return A0("environment.provision_progress","invalid payload"),!0;if(l(j=>({...j,[S.environmentId]:{stage:S.stage,message:S.message,progress:S.progress}})),S.stage==="ready"){const j=S.environmentId;setTimeout(()=>{l(C=>{const N={...C};return delete N[j],N})},Kg)}return!0}default:return!1}},[c]),f=y.useCallback(x=>{var S;if(x.type==="environments"){const j=Array.isArray((S=x.payload)==null?void 0:S.environments)?x.payload.environments:[];return a(j),!0}return!1},[]),m=y.useCallback((x,S,j)=>{je.addEnvironment({displayName:x,adapterType:S,adapterConfig:JSON.stringify(j??{})}).catch(()=>{})},[]),p=y.useCallback((x,S)=>{je.updateEnvironment({id:x,displayName:S.displayName,adapterConfig:S.adapterConfig?JSON.stringify(S.adapterConfig):void 0}).catch(()=>{})},[]),v=y.useCallback((x,S)=>{(async()=>{try{const C=je.provisionEnvironment({id:x,force:S??!1});for await(const N of C)l(k=>({...k,[x]:{stage:N.stage,message:N.message,progress:N.progress}})),N.stage==="ready"&&setTimeout(()=>{l(k=>{const w={...k};return delete w[x],w})},Kg)}catch{l(C=>{const N={...C};return delete N[x],N})}})().catch(()=>{})},[]),g=y.useCallback(x=>{je.stopEnvironment({id:x}).catch(()=>{})},[]),b=y.useCallback(x=>{je.removeEnvironment({id:x}).catch(()=>{})},[]);return{environments:n,provisionStatus:i,loadEnvironments:c,addEnvironment:m,updateEnvironment:p,provisionEnvironment:v,stopEnvironment:g,removeEnvironment:b,handleEvent:d,handleLegacyMessage:f}}const Vd=new Set(["pending","running","idle"]),Xk=new Set(["completed","failed","interrupted","hibernating","suspended"]),Yg=["pending","running","idle"];function Qk(){const[n,a]=y.useState([]),[i,l]=y.useState([]),[c,d]=y.useState(0),[f,m]=y.useState(void 0),[p,v]=y.useState({}),g=y.useCallback(()=>{je.listSessions({}).then(A=>{const R=A.sessions.map($g);a(E=>{const H=new Map(E.map(z=>[z.id,z]));return R.map(z=>{const I=H.get(z.id),Y=I==null?void 0:I.status;return!Y||Y===z.status?z:Xk.has(Y)&&Vd.has(z.status)?{...z,status:Y,...I.endReason!==void 0?{endReason:I.endReason}:{}}:Vd.has(Y)&&Vd.has(z.status)&&Yg.indexOf(Y)>Yg.indexOf(z.status)?{...z,status:Y}:z})})},()=>{})},[]),b=y.useCallback(A=>{if(A.type!=="session_event")return!1;if(!q1(A.payload))return A0("session_event","payload is not a valid SessionEvent"),!0;const R=A.payload;let E=0;if(l(H=>{const z=[...H,R];return z.length>Si?(E=z.length-Si,z.slice(-Si)):z}),E>0&&d(H=>H+E),R.eventType==="usage")try{const H=JSON.parse(R.content),z=Number(H.input_tokens)||0,I=Number(H.output_tokens)||0,Y=Number(H.cost_usd)||0;(z>0||I>0||Y>0)&&a(ee=>ee.map(te=>te.id===R.sessionId?{...te,inputTokens:(te.inputTokens??0)+z,outputTokens:(te.outputTokens??0)+I,costUsd:(te.costUsd??0)+Y}:te))}catch{}if(R.eventType==="status"){const H=D0(R.content),z=R0(R.content);a(I=>I.some(ee=>ee.id===R.sessionId)?I.map(ee=>ee.id===R.sessionId?{...ee,status:H,...z!==void 0?{endReason:z}:{}}:ee):[...I,{id:R.sessionId,environmentId:"",runtime:"",status:H,prompt:"",startedAt:R.timestamp,...z!==void 0?{endReason:z}:{}}])}return!0},[]),x=y.useCallback(A=>{var R,E,H,z,I;switch(A.type){case"sessions":{const Y=Array.isArray((R=A.payload)==null?void 0:R.sessions)?A.payload.sessions:[];return a(Y),!0}case"spawned":{const Y=(E=A.payload)==null?void 0:E.sessionId;return typeof Y=="string"&&Y&&m(Y),g(),!0}case"session_events":{const Y=Array.isArray((H=A.payload)==null?void 0:H.events)?A.payload.events:[];return Y.length>0&&l(Y),!0}case"task_sessions":{const Y=(z=A.payload)==null?void 0:z.taskId;if(typeof Y=="string"&&Y){const ee=Array.isArray((I=A.payload)==null?void 0:I.sessions)?A.payload.sessions:[];v(te=>({...te,[Y]:ee}))}return!0}default:return!1}},[g]),S=y.useCallback((A,R,E,H)=>{je.spawnAgent({environmentId:A,prompt:R,personaId:E||"",workingDirectory:H||""}).then(z=>{m(z.id),g()},()=>{})},[g]),j=y.useCallback((A,R)=>{je.sendInput({sessionId:A,text:R}).catch(()=>{})},[]),C=y.useCallback(A=>{je.killAgent({id:A}).catch(()=>{})},[]),N=y.useCallback(A=>{je.getSessionEvents({id:A}).then(R=>{const E=R.events.map(Hk);if(E.length>0){let H=0;l(z=>{const I=new Set;for(const te of z)te.sessionId===A&&I.add(`${te.timestamp}|${te.eventType}`);const Y=E.filter(te=>!I.has(`${te.timestamp}|${te.eventType}`)),ee=[...z,...Y].sort((te,ie)=>te.sessionId!==ie.sessionId?0:te.timestamp.localeCompare(ie.timestamp));return ee.length>Si?(H=ee.length-Si,ee.slice(-Si)):ee}),H>0&&d(z=>z+H)}},()=>{})},[]),k=y.useCallback(()=>{l([]),d(0)},[]),w=y.useCallback(A=>{je.getTaskSessions({id:A}).then(R=>{const E=R.sessions.map($g);v(H=>({...H,[A]:E}))},()=>{})},[]);return{sessions:n,events:i,eventsDropped:c,lastSpawnedId:f,taskSessions:p,loadSessions:g,spawn:S,sendInput:j,kill:C,loadSessionEvents:N,clearEvents:k,loadTaskSessions:w,handleMessage:b,handleLegacyMessage:x}}function Wk(){const[n,a]=y.useState([]),[i,l]=y.useState(!1),c=y.useCallback(()=>{je.listWorkspaces({}).then(g=>{a(g.workspaces.map(Gk))},()=>{})},[]),d=y.useCallback(g=>{switch(g.type){case"workspace.created":return l(!1),c(),!0;case"workspace.archived":case"workspace.updated":return c(),!0;default:return!1}},[c]),f=y.useCallback(()=>{l(!1)},[]),m=y.useCallback((g,b,x,S,j,C,N,k,w)=>{l(!0),je.createWorkspace({name:g,description:b||"",repoUrl:x||"",environmentId:S||"",defaultPersonaId:j||void 0,useWorktrees:C??!0,workingDirectory:N||void 0}).then(()=>{l(!1),k==null||k()},A=>{l(!1);const R=A instanceof Lf?A.message:"Failed to create workspace";w==null||w(R)})},[]),p=y.useCallback(g=>{je.archiveWorkspace({id:g}).catch(()=>{})},[]),v=y.useCallback((g,b)=>{je.updateWorkspace({id:g,...b}).catch(()=>{})},[]);return{workspaces:n,workspaceCreating:i,loadWorkspaces:c,createWorkspace:m,archiveWorkspace:p,updateWorkspace:v,handleEvent:d,onDisconnect:f}}function Jk(){const[n,a]=y.useState([]),[i,l]=y.useState(void 0),c=y.useCallback(k=>{je.listTasks({workspaceId:k}).then(w=>{const A=w.tasks.map(qg);a(R=>[...R.filter(E=>E.workspaceId!==k),...A])},()=>{})},[]),d=y.useCallback(()=>{je.listTasks({}).then(k=>{const w=k.tasks.map(qg);a(A=>{const R=new Set(w.map(E=>E.id));return[...A.filter(E=>!R.has(E.id)),...w]})},()=>{})},[]),f=y.useCallback((k,w)=>{k?c(k):w&&a(A=>{const R=A.find(E=>E.id===w);return R!=null&&R.workspaceId?c(R.workspaceId):d(),A})},[c,d]),m=y.useCallback(k=>{const w=k.payload;switch(k.type){case"task.created":{const A=typeof w.workspaceId=="string"?w.workspaceId:"";return A&&c(A),!0}case"task.started":{const A=typeof w.taskId=="string"?w.taskId:"",R=typeof w.sessionId=="string"?w.sessionId:"",E=typeof w.workspaceId=="string"?w.workspaceId:"";return l(H=>A&&H===A?void 0:H),R&&A&&a(H=>H.map(z=>z.id===A?{...z,latestSessionId:R}:z)),f(E,A),!0}case"task.completed":case"task.deleted":case"task.updated":{const A=typeof w.workspaceId=="string"?w.workspaceId:"",R=typeof w.taskId=="string"?w.taskId:"";return f(A,R),!0}default:return!1}},[c,f]),p=y.useCallback(()=>{l(void 0)},[]),v=y.useCallback(k=>{var w,A;if(k.type==="tasks"){const R=Array.isArray((w=k.payload)==null?void 0:w.tasks)?k.payload.tasks:[],E=typeof((A=k.payload)==null?void 0:A.workspaceId)=="string"&&k.payload.workspaceId?k.payload.workspaceId:"";return a(E?H=>[...H.filter(z=>z.workspaceId!==E),...R]:H=>{const z=new Set(R.map(I=>I.id));return[...H.filter(I=>!z.has(I.id)),...R]}),!0}return!1},[]),g=y.useCallback((k,w,A,R,E,H,z,I,Y)=>{je.createTask({workspaceId:k,title:w,description:A||"",dependsOn:R||[],parentTaskId:E||"",defaultPersonaId:H||void 0,canDecompose:z??void 0}).then(()=>{I==null||I()},ee=>{const te=ee instanceof Lf?ee.message:"Failed to create task";Y==null||Y(te)})},[]),b=y.useCallback((k,w,A,R)=>{l(k),je.startTask({taskId:k,personaId:w||"",environmentId:A||"",notes:R||""}).catch(()=>{l(void 0)})},[]),x=y.useCallback(k=>{je.stopTask({id:k}).catch(()=>{})},[]),S=y.useCallback(k=>{je.completeTask({id:k}).catch(()=>{})},[]),j=y.useCallback(k=>{je.resumeTask({id:k}).catch(()=>{})},[]),C=y.useCallback((k,w,A,R,E)=>{je.updateTask({id:k,title:w,description:A,dependsOn:R,...E!==void 0?{defaultPersonaId:E}:{}}).catch(()=>{})},[]),N=y.useCallback(k=>{je.deleteTask({id:k}).catch(()=>{})},[]);return{tasks:n,taskStartingId:i,loadTasks:c,loadAllTasks:d,createTask:g,startTask:b,stopTask:x,completeTask:S,resumeTask:j,updateTask:C,deleteTask:N,handleEvent:m,onDisconnect:p,handleLegacyMessage:v}}function ej(){const[n,a]=y.useState([]),i=y.useCallback(d=>{je.queryFindings({workspaceId:d}).then(f=>{a(f.findings.map(Pk))},()=>{})},[]),l=y.useCallback(d=>{if(d.type==="finding.posted"){const f=typeof d.payload.workspaceId=="string"?d.payload.workspaceId:"";return f&&i(f),!0}return!1},[i]),c=y.useCallback((d,f,m,p,v)=>{je.postFinding({workspaceId:d,title:f,content:m,category:p??"general",tags:v??[]}).catch(()=>{})},[]);return{findings:n,loadFindings:i,postFinding:c,handleEvent:l}}function tj(){const[n,a]=y.useState([]),i=y.useCallback(()=>{je.listTokens({}).then(f=>{a(f.tokens.map($k))},()=>{})},[]),l=y.useCallback(f=>f.type==="token.changed"?(i(),!0):!1,[i]),c=y.useCallback((f,m,p,v,g)=>{je.setToken({name:f,value:m,type:p,envVar:v,filePath:g}).catch(()=>{})},[]),d=y.useCallback(f=>{je.deleteToken({name:f}).catch(()=>{})},[]);return{tokens:n,loadTokens:i,setToken:c,deleteToken:d,handleEvent:l}}function nj(){const[n,a]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),i=y.useCallback(()=>{je.getCredentialProviders({}).then(d=>{a(qk(d))},()=>{})},[]),l=y.useCallback(d=>d.type==="credential.providers_changed"?(Y1(d.payload)&&a(d.payload),!0):!1,[]),c=y.useCallback(d=>{const f=[{provider:"claude",value:d.claude},{provider:"github",value:d.github},{provider:"copilot",value:d.copilot},{provider:"codex",value:d.codex},{provider:"goose",value:d.goose}];for(const{provider:m,value:p}of f)je.setCredentialProvider({provider:m,value:p}).catch(()=>{})},[]);return{credentialProviders:n,loadCredentials:i,updateCredentialProviders:c,handleEvent:l}}function aj(){const[n,a]=y.useState([]),[i,l]=y.useState(""),[c,d]=y.useState(""),[f,m]=y.useState(!1),p=y.useCallback(()=>{je.listCodespaces({}).then(g=>{a(g.codespaces.map(Kk)),d(g.error)},()=>{})},[]),v=y.useCallback((g,b)=>{m(!0),l(""),je.createCodespace({repo:g,machine:b??""}).then(()=>{m(!1),p()},x=>{m(!1);const S=x instanceof Lf?x.message:"Failed to create codespace";l(S)})},[p]);return{codespaces:n,codespaceError:i,codespaceListError:c,codespaceCreating:f,listCodespaces:p,createCodespace:v}}function sj(){const[n,a]=y.useState([]),i=y.useCallback(()=>{je.listPersonas({}).then(m=>{a(m.personas.map(Yk))},()=>{})},[]),l=y.useCallback(m=>{switch(m.type){case"persona.created":case"persona.updated":case"persona.deleted":return i(),!0;default:return!1}},[i]),c=y.useCallback((m,p,v,g,b,x,S,j)=>{je.createPersona({name:m,description:p,systemPrompt:v,runtime:g||"",model:b||"",maxTurns:x||0,type:S||"agent",script:j||""}).catch(()=>{})},[]),d=y.useCallback((m,p,v,g,b,x,S,j,C)=>{const N={id:m};p!==void 0&&(N.name=p),v!==void 0&&(N.description=v),g!==void 0&&(N.systemPrompt=g),b!==void 0&&(N.runtime=b),x!==void 0&&(N.model=x),S!==void 0&&(N.maxTurns=S),j!==void 0&&(N.type=j),C!==void 0&&(N.script=C),je.updatePersona(N).catch(()=>{})},[]),f=y.useCallback(m=>{je.deletePersona({id:m}).catch(()=>{})},[]);return{personas:n,loadPersonas:i,createPersona:c,updatePersona:d,deletePersona:f,handleEvent:l}}function Ir(n,a=0){return{id:n.id,label:n.title||n.label||n.id,kind:n.kind,category:n.category,sourceType:n.sourceType,sourceId:n.sourceId,content:n.content,tags:n.tags,workspaceId:n.workspaceId,createdAt:n.createdAt,updatedAt:n.updatedAt,val:a}}function Hd(n){return{source:n.fromId,target:n.toId,type:n.type}}const ij=new Set(["knowledge.listRecent.result","knowledge.search.result","knowledge.getNode.result","knowledge.expand.result"]);function oj(n){const[a,i]=y.useState(new Map),[l,c]=y.useState([]),[d,f]=y.useState(void 0),[m,p]=y.useState(void 0),[v,g]=y.useState(!1),[b,x]=y.useState(""),S=y.useCallback(R=>{g(!0),n({type:"knowledge.listRecent",payload:{limit:30,workspaceId:R}})},[n]),j=y.useCallback(R=>{R.trim()&&(x(R),p(void 0),f(void 0),g(!0),n({type:"knowledge.search",payload:{query:R,limit:20}}))},[n]),C=y.useCallback(()=>{x(""),S()},[S]),N=y.useCallback(R=>{p(R),n({type:"knowledge.getNode",payload:{id:R}})},[n]),k=y.useCallback(()=>{p(void 0),f(void 0)},[]),w=y.useCallback(R=>{n({type:"knowledge.expand",payload:{id:R,depth:1}})},[n]),A=y.useCallback(R=>{if(!ij.has(R.type))return!1;const E=R.payload??{};switch(R.type){case"knowledge.listRecent.result":{if(E.error)return g(!1),!0;const H=E.nodes??[],z=E.edges??[],I=new Map,Y=[];for(const ee of H)I.set(ee.id,Ir(ee));for(const ee of z)Y.push(Hd(ee));for(const ee of Y){const te=I.get(ee.source);te&&(te.val+=1);const ie=I.get(ee.target);ie&&(ie.val+=1)}return i(I),c(Y),g(!1),!0}case"knowledge.search.result":{if(E.error)return g(!1),!0;const H=E.results??[],z=new Map,I=[];for(const Y of H){const ee=Y.node,te=Y.edges??[];z.set(ee.id,Ir(ee,te.length));for(const ie of te)I.push(Hd(ie))}return i(z),c(I),g(!1),!0}case"knowledge.getNode.result":{if(E.error)return f(void 0),!0;const H=E.node,z=E.edges??[];return f({node:Ir(H,z.length),edges:z.map(I=>({fromId:I.fromId,toId:I.toId,type:I.type,metadata:I.metadata}))}),!0}case"knowledge.expand.result":{const H=E.nodes??[],z=E.edges??[];return i(I=>{const Y=new Map(I);for(const ee of H)Y.has(ee.id)||Y.set(ee.id,Ir(ee));return Y}),c(I=>{const Y=new Set(I.map(te=>`${te.source}:${te.target}:${te.type}`)),ee=[];for(const te of z){const ie=Hd(te),ce=`${ie.source}:${ie.target}:${ie.type}`;Y.has(ce)||ee.push(ie)}return[...I,...ee]}),!0}}return!1},[]);return{graphData:{nodes:[...a.values()],links:l},selectedNode:d,selectedId:m,loading:v,searchQuery:b,search:j,clearSearch:C,selectNode:N,clearSelection:k,expandNode:w,loadRecent:S,handleMessage:A}}function lj(n){const[a,i]=y.useState(""),[l,c]=y.useState(void 0),[d,f]=y.useState({}),{connected:m,send:p}=Ik(n,{onMessage:Y,onConnect:ee,onDisconnect:te}),v=Zk(),g=Qk(),b=Wk(),x=Jk(),S=ej(),j=tj(),C=nj(),N=aj(),k=sj(),w=oj(p),A="default_persona_id",R="onboarding_completed",E=y.useCallback(ce=>{i(ce),je.setSetting({key:A,value:ce}).catch(()=>{})},[]),H=y.useCallback(()=>{c(!0),je.setSetting({key:R,value:"true"}).catch(()=>{})},[]),z=y.useCallback((ce,K)=>{je.getUsage({scope:ce,id:K}).then(ae=>{const O=`${ce}:${K}`;f(P=>({...P,[O]:Fk(ae)}))},()=>{})},[]);function I(ce){const K=ce.payload.key,ae=ce.payload.value;if(ce.type==="setting.changed"){K===A&&i(ae??""),K===R&&c(ae==="true");return}if(v.handleEvent(ce)){(ce.type==="environment.removed"||ce.type==="environment.changed")&&g.loadSessions();return}if(!b.handleEvent(ce)){if(x.handleEvent(ce)){ce.type==="task.started"&&g.loadSessions();return}S.handleEvent(ce)||j.handleEvent(ce)||C.handleEvent(ce)||k.handleEvent(ce)}}function Y(ce){var K,ae,O,P;if($1(ce)){I(ce);return}if(!g.handleMessage(ce)&&!w.handleMessage(ce)&&!((K=g.handleLegacyMessage)!=null&&K.call(g,ce))&&!((ae=v.handleLegacyMessage)!=null&&ae.call(v,ce))&&!((O=x.handleLegacyMessage)!=null&&O.call(x,ce))&&ce.type==="error"){console.error("[ws]",(P=ce.payload)==null?void 0:P.message);return}}function ee(ce){v.loadEnvironments(),g.loadSessions(),b.loadWorkspaces(),j.loadTokens(),C.loadCredentials(),k.loadPersonas(),je.getSetting({key:A}).then(K=>{i(K.value)},()=>{}),je.getSetting({key:R}).then(K=>{c(K.value==="true")},()=>{}),x.loadAllTasks(),ce({type:"subscribe_all"})}function te(){b.onDisconnect(),x.onDisconnect()}const ie=y.useCallback(()=>{v.loadEnvironments(),g.loadSessions(),b.loadWorkspaces(),j.loadTokens()},[v.loadEnvironments,g.loadSessions,b.loadWorkspaces,j.loadTokens]);return{connected:m,send:p,environments:v.environments,sessions:g.sessions,events:g.events,eventsDropped:g.eventsDropped,lastSpawnedId:g.lastSpawnedId,workspaces:b.workspaces,tasks:x.tasks,findings:S.findings,tokens:j.tokens,spawn:g.spawn,sendInput:g.sendInput,kill:g.kill,refresh:ie,loadSessionEvents:g.loadSessionEvents,clearEvents:g.clearEvents,loadWorkspaces:b.loadWorkspaces,createWorkspace:b.createWorkspace,archiveWorkspace:b.archiveWorkspace,updateWorkspace:b.updateWorkspace,loadTasks:x.loadTasks,loadAllTasks:x.loadAllTasks,createTask:x.createTask,startTask:x.startTask,stopTask:x.stopTask,completeTask:x.completeTask,resumeTask:x.resumeTask,updateTask:x.updateTask,deleteTask:x.deleteTask,loadFindings:S.loadFindings,postFinding:S.postFinding,loadEnvironments:v.loadEnvironments,addEnvironment:v.addEnvironment,updateEnvironment:v.updateEnvironment,loadTokens:j.loadTokens,setToken:j.setToken,deleteToken:j.deleteToken,credentialProviders:C.credentialProviders,updateCredentialProviders:C.updateCredentialProviders,provisionStatus:v.provisionStatus,provisionEnvironment:v.provisionEnvironment,stopEnvironment:v.stopEnvironment,removeEnvironment:v.removeEnvironment,codespaces:N.codespaces,codespaceError:N.codespaceError,codespaceListError:N.codespaceListError,codespaceCreating:N.codespaceCreating,listCodespaces:N.listCodespaces,createCodespace:N.createCodespace,workspaceCreating:b.workspaceCreating,taskStartingId:x.taskStartingId,personas:k.personas,createPersona:k.createPersona,updatePersona:k.updatePersona,deletePersona:k.deletePersona,taskSessions:g.taskSessions,loadTaskSessions:g.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:E,onboardingCompleted:l,completeOnboarding:H,usageCache:d,loadUsage:z,knowledge:w}}const qf=y.createContext(void 0);function rj({children:n}){const a=lj();return r.jsx(qf.Provider,{value:a,children:n})}function rt(){const n=y.useContext(qf);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const cj=[{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}],uj=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation",inputTokens:84200,outputTokens:12750,costUsd:.41},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z",inputTokens:42600,outputTokens:8100,costUsd:.22},{id:"sess-002",environmentId:"env-docker-01",runtime:"claude-code",status:"stopped",endReason:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z",endedAt:"2026-02-27T07:33:00Z",inputTokens:31400,outputTokens:9800,costUsd:.18},{id:"sess-003",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z",endedAt:"2026-02-26T23:10:00Z",inputTokens:56300,outputTokens:14200,costUsd:.31},{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z",inputTokens:18900,outputTokens:4500,costUsd:.1},{id:"sess-005",environmentId:"env-cs-01",runtime:"claude-code",status:"suspended",prompt:"Refactor database connection pooling for multi-tenant isolation",startedAt:"2026-02-27T06:00:00Z",inputTokens:67800,outputTokens:19300,costUsd:.38}],dj=[{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"}],fj=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",environmentId:"env-local-01",status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-01-15T10:00:00Z",updatedAt:"2026-01-15T10:00:00Z"},{id:"proj-beta",name:"Data Pipeline",description:"ETL pipelines for analytics and reporting",repoUrl:"https://github.com/acme/data-pipeline",environmentId:"env-docker-01",status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-02-01T14:30:00Z",updatedAt:"2026-02-01T14:30:00Z"},{id:"proj-gamma",name:"Mobile App",description:"React Native cross-platform mobile application",repoUrl:"",environmentId:"env-local-01",status:"archived",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],hj=[{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:""}],Fg=[{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"}],mj=[{name:"anthropic",tokenType:"env_var",envVar:"ANTHROPIC_API_KEY",filePath:"",expiresAt:""},{name:"github",tokenType:"env_var",envVar:"GITHUB_TOKEN",filePath:"",expiresAt:"2026-12-31T23:59:59Z"},{name:"gcp-service-account",tokenType:"file",envVar:"",filePath:"/home/user/.config/gcloud/credentials.json",expiresAt:""}],pj=[{id:"persona-arch",name:"Software Architect",description:"Designs system architecture, defines interfaces, and decomposes large features into implementable tasks.",systemPrompt:"You are a senior software architect. Focus on clean interfaces, separation of concerns, and scalable patterns. When decomposing work, create concrete subtasks with clear acceptance criteria.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z",type:"agent",script:""},{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\` });`}],vj={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z"},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Implement auth middleware",startedAt:"2026-02-27T08:15:00Z"}],"task-006c":[{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Add compression options",startedAt:"2026-02-27T09:00:00Z"}]};function Ct(n){return new Date(Date.now()+n).toISOString()}const Zg=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ct(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Ct(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Ct(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:Ct(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:Ct(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Ct(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ct(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Ct(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Ct(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:Ct(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:Ct(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Ct(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:Ct(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Ct(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ct(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Ct(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Ct(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:Ct(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:Ct(3500),content:"failed"}}]}],Xg=400;function gj({children:n}){const[a,i]=y.useState(cj),[l,c]=y.useState(uj),[d,f]=y.useState(dj),[m,p]=y.useState(void 0),[v,g]=y.useState(fj),[b,x]=y.useState(hj),[S,j]=y.useState(Fg),[C,N]=y.useState(mj),[k,w]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[A,R]=y.useState(pj),[E]=y.useState(vj),[H,z]=y.useState(""),I=y.useRef(0),Y=y.useRef(0),ee=y.useRef(new Set),te=y.useRef(new Map),ie=y.useRef(b);ie.current=b;const ce=y.useRef(new Map),K=y.useRef(new Map),ae=y.useCallback(Z=>(I.current+=1,`mock-${Z}-${String(I.current).padStart(3,"0")}`),[]),O=y.useCallback(()=>{const Z=Zg[Y.current%Zg.length];return Y.current+=1,Z},[]),P=y.useCallback((Z,oe,fe)=>{const _e=setTimeout(()=>{var ge;ee.current.delete(_e),fe&&((ge=te.current.get(fe))==null||ge.delete(_e)),Z()},oe);ee.current.add(_e),fe&&(te.current.has(fe)||te.current.set(fe,new Set),te.current.get(fe).add(_e))},[]),se=y.useCallback(Z=>{const oe=te.current.get(Z);oe&&(oe.forEach(fe=>{clearTimeout(fe),ee.current.delete(fe)}),te.current.delete(Z))},[]),le=y.useCallback((Z,oe,fe)=>{c(_e=>_e.map(ge=>ge.id===Z?{...ge,status:oe,...fe!==void 0?{endReason:fe}:{}}:ge))},[]),q=y.useCallback(Z=>{f(oe=>[...oe,Z])},[]),be=y.useCallback((Z,oe,fe)=>{oe.forEach((_e,ge)=>{P(()=>{const Je={sessionId:Z,..._e.event,timestamp:new Date().toISOString()};if(q(Je),_e.event.eventType==="status"){const Se=D0(_e.event.content),ze=R0(_e.event.content);le(Z,Se,ze)}ge===oe.length-1&&fe&&fe()},_e.delayMs,Z)})},[P,q,le]),Ce=y.useCallback((Z,oe,fe,_e)=>{console.log("[MockGrackle] spawn",{environmentId:Z,prompt:oe,runtime:_e});const ge=ae("sess"),Je={id:ge,environmentId:Z,runtime:_e||"claude-code",status:"running",prompt:oe,startedAt:new Date().toISOString()};c(ze=>[...ze,Je]),p(ge);const Se=O();if(console.log(`[MockGrackle] Playing scenario: ${Se.label}`),Se.pauseForInput){const ze=Se.pauseAfterStep??Se.steps.length-1,Ue=Se.steps.slice(0,ze+1),Ke=Ue.length>0?Ue[Ue.length-1].delayMs:0;be(ge,Ue),P(()=>{le(ge,"idle"),q({sessionId:ge,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Ke+Xg,ge),Se.resumeSteps&&ce.current.set(ge,Se.resumeSteps)}else be(ge,Se.steps)},[ae,O,be,P,le,q]),xe=y.useCallback(Z=>{console.log("[MockGrackle] kill",Z),se(Z),ce.current.delete(Z),le(Z,"stopped","killed"),q({sessionId:Z,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),x(oe=>oe.map(fe=>fe.latestSessionId===Z&&fe.status==="working"?{...fe,status:"not_started"}:fe))},[se,le,q]),J=y.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),re=y.useCallback(Z=>{console.log("[MockGrackle] loadSessionEvents",Z)},[]),W=y.useCallback(()=>{console.log("[MockGrackle] clearEvents"),f([])},[]),tt=y.useCallback((Z,oe,fe,_e,ge,Je,Se,ze,Ue)=>{console.log("[MockGrackle] createWorkspace",{name:Z,description:oe});const Ke={id:ae("proj"),name:Z,description:oe||"",repoUrl:fe||"",environmentId:_e||"",status:"active",workingDirectory:Se||"",useWorktrees:Je??!0,defaultPersonaId:ge||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(At=>[...At,Ke]),ze&&ze()},[ae]),Re=y.useCallback(Z=>{console.log("[MockGrackle] archiveWorkspace",Z),g(oe=>oe.map(fe=>fe.id===Z?{...fe,status:"archived"}:fe))},[]),Dn=y.useCallback(Z=>{console.log("[MockGrackle] loadTasks",Z)},[]),_a=y.useCallback((Z,oe,fe,_e,ge,Je,Se,ze,Ue)=>{console.log("[MockGrackle] createTask",{workspaceId:Z,title:oe,parentTaskId:ge}),x(Ke=>{const Gt=Ke.filter(pn=>pn.workspaceId===Z).reduce((pn,Rn)=>Math.max(pn,Rn.sortOrder),0),en=ge?Ke.find(pn=>pn.id===ge):void 0;if(ge&&!en)return console.warn("[MockGrackle] Parent task not found:",ge),Ke;if(en&&!en.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",ge),Ke;const jt=en?en.depth+1:0,Sa={id:ae("task"),workspaceId:Z,title:oe,description:fe||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:_e||[],reviewNotes:void 0,sortOrder:Gt+1,createdAt:new Date().toISOString(),parentTaskId:ge||"",depth:jt,childTaskIds:[],canDecompose:Se??!ge,defaultPersonaId:Je||""};return[...Ke,Sa]}),ze&&ze()},[ae]),hn=y.useCallback((Z,oe,fe,_e)=>{var Ke;console.log("[MockGrackle] startTask",{taskId:Z});const ge=ie.current.find(At=>At.id===Z),Je=(ge==null?void 0:ge.title)??"",Se=ae("sess"),ze={id:Se,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Je||Z,startedAt:new Date().toISOString()};c(At=>[...At,ze]),x(At=>At.map(Gt=>Gt.id===Z?{...Gt,status:"working",latestSessionId:Se,branch:`mock/${Z.slice(0,8)}`}:Gt));const Ue=O();if(console.log(`[MockGrackle] Playing task scenario: ${Ue.label}`),Ue.pauseForInput){const At=Ue.pauseAfterStep??Ue.steps.length-1,Gt=Ue.steps.slice(0,At+1),en=Gt.length>0?Gt[Gt.length-1].delayMs:0;if(be(Se,Gt),P(()=>{le(Se,"idle"),q({sessionId:Se,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},en+Xg,Se),Ue.resumeSteps){const jt=[...Ue.resumeSteps];ce.current.set(Se,jt);const Sa=jt.reduce((pn,Rn)=>Math.max(pn,Rn.delayMs),0);K.current.set(Se,{taskId:Z,delayAfterResume:Sa+200})}}else{const At=Ue.steps.length>0?Ue.steps[Ue.steps.length-1].delayMs:0;be(Se,Ue.steps);const Gt=(Ke=Ue.steps[Ue.steps.length-1])==null?void 0:Ke.event.content;P(()=>{Gt==="completed"?x(en=>en.map(jt=>jt.id===Z&&jt.status==="working"?{...jt,status:"paused"}:jt)):Gt==="failed"&&x(en=>en.map(jt=>jt.id===Z&&jt.status==="working"?{...jt,status:"failed"}:jt))},At+100,Se)}},[ae,O,be,P,le,q]),Fn=y.useCallback((Z,oe)=>{console.log("[MockGrackle] sendInput",{sessionId:Z,text:oe}),q({sessionId:Z,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${oe}`}),le(Z,"running"),q({sessionId:Z,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const fe=ce.current.get(Z);if(fe)ce.current.delete(Z),be(Z,fe);else{const ge=[{delayMs:500,event:{eventType:"output",timestamp:new Date().toISOString(),content:"I received your input, continuing..."}},{delayMs:1500,event:{eventType:"status",timestamp:new Date().toISOString(),content:"completed"}}];be(Z,ge)}const _e=K.current.get(Z);_e&&(K.current.delete(Z),P(()=>{x(ge=>ge.map(Je=>Je.id===_e.taskId&&Je.status==="working"?{...Je,status:"paused"}:Je))},_e.delayAfterResume,Z))},[q,le,be,P]),In=y.useCallback(Z=>{console.log("[MockGrackle] completeTask",Z),x(oe=>oe.map(fe=>fe.id===Z?{...fe,status:"complete"}:fe))},[]),mn=y.useCallback(Z=>{console.log("[MockGrackle] resumeTask",Z)},[]),Jt=y.useCallback((Z,oe,fe,_e,ge)=>{console.log("[MockGrackle] updateTask",{taskId:Z,title:oe}),x(Je=>Je.map(Se=>Se.id===Z?{...Se,title:oe.trim()||Se.title,description:fe,dependsOn:_e,...ge!==void 0?{defaultPersonaId:ge}:{}}:Se))},[]),ke=y.useCallback(Z=>{console.log("[MockGrackle] deleteTask",Z),x(oe=>oe.filter(fe=>fe.id!==Z))},[]),kt=y.useCallback(Z=>{console.log("[MockGrackle] loadFindings",Z),j(Fg.filter(oe=>oe.workspaceId===Z))},[]),Pi=y.useCallback((Z,oe,fe,_e,ge)=>{console.log("[MockGrackle] postFinding",{workspaceId:Z,title:oe});const Je={id:ae("find"),workspaceId:Z,taskId:"",sessionId:"",category:_e||"general",title:oe,content:fe,tags:ge||[],createdAt:new Date().toISOString()};j(Se=>[...Se,Je])},[ae]),Bs=y.useCallback(()=>{console.log("[MockGrackle] loadEnvironments")},[]),Ls=y.useCallback((Z,oe,fe)=>{console.log("[MockGrackle] addEnvironment",{displayName:Z,adapterType:oe,adapterConfig:fe})},[]),Is=y.useCallback((Z,oe)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:Z,...oe}),i(fe=>fe.map(_e=>_e.id!==Z?_e:{..._e,...oe.displayName!==void 0?{displayName:oe.displayName}:{},...oe.adapterConfig!==void 0?{adapterConfig:JSON.stringify(oe.adapterConfig)}:{}}))},[]),vl=y.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),gl=y.useCallback((Z,oe,fe,_e,ge)=>{console.log("[MockGrackle] setToken",{name:Z,tokenType:fe}),N(Je=>[...Je.filter(ze=>ze.name!==Z),{name:Z,tokenType:fe,envVar:_e,filePath:ge,expiresAt:""}])},[]),Ut=y.useCallback(Z=>{console.log("[MockGrackle] deleteToken",Z),N(oe=>oe.filter(fe=>fe.name!==Z))},[]),yl=y.useCallback(Z=>{console.log("[MockGrackle] updateCredentialProviders",Z),w(Z)},[]);y.useEffect(()=>()=>{ee.current.forEach(clearTimeout),ee.current.clear()},[]);const bl=y.useMemo(()=>({connected:!0,send:()=>{},environments:a,sessions:l,events:d,eventsDropped:0,lastSpawnedId:m,workspaces:v,tasks:b,findings:S,tokens:C,credentialProviders:k,spawn:Ce,sendInput:Fn,kill:xe,refresh:J,loadSessionEvents:re,clearEvents:W,loadWorkspaces:()=>{console.log("[MockGrackle] loadWorkspaces")},createWorkspace:tt,archiveWorkspace:Re,updateWorkspace:(Z,oe)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:Z,...oe}),g(fe=>fe.map(_e=>_e.id!==Z?_e:{..._e,...oe.name!==void 0?{name:oe.name}:{},...oe.description!==void 0?{description:oe.description}:{},...oe.repoUrl!==void 0?{repoUrl:oe.repoUrl}:{},...oe.environmentId!==void 0?{environmentId:oe.environmentId}:{},...oe.workingDirectory!==void 0?{workingDirectory:oe.workingDirectory}:{},...oe.useWorktrees!==void 0?{useWorktrees:oe.useWorktrees}:{},...oe.defaultPersonaId!==void 0?{defaultPersonaId:oe.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:Dn,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:_a,startTask:hn,stopTask:Z=>{console.log("[MockGrackle] stopTask",{taskId:Z}),In(Z)},completeTask:In,resumeTask:mn,updateTask:Jt,deleteTask:ke,loadFindings:kt,postFinding:Pi,loadEnvironments:Bs,addEnvironment:Ls,updateEnvironment:Is,loadTokens:vl,setToken:gl,deleteToken:Ut,updateCredentialProviders:yl,provisionStatus:{},provisionEnvironment:(Z,oe)=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:A,createPersona:(Z,oe,fe,_e,ge,Je,Se,ze)=>{console.log("[MockGrackle] createPersona",{name:Z});const Ue={id:`mock-persona-${Date.now()}`,name:Z,description:oe,systemPrompt:fe,toolConfig:"{}",runtime:_e??"claude-code",model:ge||"",maxTurns:Je||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Se||"agent",script:ze||""};R(Ke=>[...Ke,Ue])},updatePersona:(Z,oe,fe,_e,ge,Je,Se,ze,Ue)=>{console.log("[MockGrackle] updatePersona",{personaId:Z,name:oe}),R(Ke=>Ke.map(At=>At.id!==Z?At:{...At,...oe!==void 0?{name:oe}:{},...fe!==void 0?{description:fe}:{},..._e!==void 0?{systemPrompt:_e}:{},...ge!==void 0?{runtime:ge}:{},...Je!==void 0?{model:Je}:{},...Se!==void 0?{maxTurns:Se}:{},...ze!==void 0?{type:ze}:{},...Ue!==void 0?{script:Ue}:{},updatedAt:new Date().toISOString()}))},deletePersona:Z=>{console.log("[MockGrackle] deletePersona",Z),R(oe=>oe.filter(fe=>fe.id!==Z))},taskSessions:E,loadTaskSessions:Z=>{console.log("[MockGrackle] loadTaskSessions",Z)},appDefaultPersonaId:H,setAppDefaultPersonaId:Z=>{console.log("[MockGrackle] setAppDefaultPersonaId",Z),z(Z)},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:(Z,oe)=>{console.log(`[MockGrackle] loadUsage(${Z}, ${oe})`)},knowledge:{graphData:{nodes:[],links:[]},selectedNode:void 0,loading:!1,selectedId:void 0,searchQuery:"",search:()=>{},clearSearch:()=>{},selectNode:()=>{},clearSelection:()=>{},expandNode:()=>{},loadRecent:()=>{},handleMessage:()=>!1}}),[a,l,d,m,v,b,S,C,k,A,E,H,Ce,Fn,xe,J,re,W,tt,Re,Dn,_a,hn,In,mn,Jt,ke,kt,Pi,Bs,Ls,Is,vl,gl,Ut,yl]);return r.jsx(qf.Provider,{value:bl,children:n})}const tb=y.createContext(void 0),yj=4e3;function bj({children:n}){const[a,i]=y.useState([]),l=y.useRef(0),c=y.useCallback(f=>{i(m=>m.filter(p=>p.id!==f))},[]),d=y.useCallback((f,m="info",p=yj)=>{const v=`toast-${++l.current}`;i(g=>[...g,{id:v,message:f,variant:m,duration:p}])},[]);return r.jsx(tb.Provider,{value:{toasts:a,showToast:d,dismissToast:c},children:n})}function Rs(){const n=y.useContext(tb);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const mc=[{id:"grackle",label:"Grackle",description:"The default Grackle theme — iridescent purple on clean dark.",swatches:["#0e1218","#8b5cf6","#60a5fa","#e5e7eb","#34d399"],variantLightId:"grackle-light",variantDarkId:"grackle-dark"},{id:"grackle-light",label:"Grackle Light",description:"Light Grackle variant.",hidden:!0},{id:"grackle-dark",label:"Grackle Dark",description:"Dark Grackle variant.",hidden:!0},{id:"glass",label:"Glassmorphism",description:"Dark frosted-glass aesthetic with backdrop blur effects.",swatches:["#0a0c14","#4ecca3","#70a1ff","#e2e8f0","#a855f7"]},{id:"matrix",label:"Matrix",description:"Phosphor-green CRT terminal with scanlines and glow.",swatches:["#050505","#00ff41","#00bfff","#33ff77","#ffb000"]},{id:"brutalist",label:"Neubrutalism",description:"Thick borders, raw colors, bold type — ugly on purpose.",swatches:["#f5f0e8","#ff5757","#5ce1e6","#1a1a1a","#ffde59"],variantLightId:"brutalist-light",variantDarkId:"brutalist-dark"},{id:"brutalist-light",label:"Neubrutalism Light",description:"Light neubrutalism variant.",hidden:!0},{id:"brutalist-dark",label:"Neubrutalism Dark",description:"Dark neubrutalism variant.",hidden:!0},{id:"monokai",label:"Monokai",description:"Classic warm editor palette — pink, green, and purple.",swatches:["#272822","#f92672","#a6e22e","#f8f8f2","#ae81ff"],variantLightId:"monokai-light",variantDarkId:"monokai-dark"},{id:"monokai-dark",label:"Monokai Dark",description:"Dark Monokai variant.",hidden:!0},{id:"monokai-light",label:"Monokai Light",description:"Light Monokai variant.",hidden:!0},{id:"ubuntu",label:"Ubuntu",description:"Aubergine terminal with the GNOME Tango palette.",swatches:["#300a24","#8ae234","#ef2929","#eeeeec","#fce94f"]},{id:"sandstone",label:"Sandstone",description:"Warm terracotta accent on dark brown, in the style of Claude Code.",swatches:["#1a1815","#C15F3C","#6b8afd","#e8e6e3","#a78bfa"]},{id:"verdigris",label:"Verdigris",description:"Teal accent on charcoal, in the style of ChatGPT.",swatches:["#141414","#00a67e","#3b82f6","#ececec","#ab68ff"]},{id:"primer",label:"Primer",description:"Blue accent on ink-dark grey, in the style of GitHub.",swatches:["#0d1117","#58a6ff","#3fb950","#c9d1d9","#bc8cff"]}],nb=new Set(mc.map(n=>n.id)),Qg="grackle";function ff(n){return mc.find(a=>a.id===n)}const hf="grackle-theme",ab="grackle-prefer-system",sb="(prefers-color-scheme: dark)";let Go=[],Fr;function Gd(){Fr=void 0;for(const n of Go)n()}function mf(){return typeof window>"u"?!1:window.matchMedia(sb).matches}function Zo(){if(typeof localStorage>"u")return Qg;try{const n=localStorage.getItem(hf);if(n!==null&&nb.has(n))return n}catch{}return Qg}function ec(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(ab)==="true"}catch{return!1}}function pf(n){return mc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function ib(n,a){const i=ff(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?mf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const l=pf(n);if(l!=null&&l.variantLightId&&l.variantDarkId)return mf()?l.variantDarkId:l.variantLightId}return n}function ji(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=ib(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&ji(Zo(),ec());function xj(){return Fr===void 0&&(Fr={themeId:Zo(),systemDark:mf(),preferSystem:ec()}),Fr}function _j(n){return Go=[...Go,n],()=>{Go=Go.filter(a=>a!==n)}}function Sj(){const n=y.useSyncExternalStore(_j,xj),{themeId:a,preferSystem:i}=n,l=ib(a,i),c=y.useCallback(f=>{if(nb.has(f)){try{localStorage.setItem(hf,f)}catch{}ji(f,ec(),!0),Gd()}},[]),d=y.useCallback(f=>{try{localStorage.setItem(ab,f?"true":"false")}catch{}if(f){const m=Zo(),p=ff(m);if(p!=null&&p.hidden){const v=pf(m);if(v)try{localStorage.setItem(hf,v.id)}catch{}}}ji(Zo(),f,!0),Gd()},[]);return y.useEffect(()=>{ji(a,i)},[a,i]),y.useEffect(()=>{if(typeof window>"u")return;const f=window.matchMedia(sb),m=()=>{const p=Zo(),v=ec();if(v){const g=ff(p);if(g!=null&&g.variantDarkId&&g.variantLightId&&ji(p,v),g!=null&&g.hidden){const b=pf(p);b!=null&&b.variantDarkId&&b.variantLightId&&ji(p,v)}}Gd()};return f.addEventListener("change",m),()=>{f.removeEventListener("change",m)}},[]),{themeId:a,setTheme:c,resolvedThemeId:l,preferSystem:i,setPreferSystem:d}}const ob=y.createContext(void 0);function Tj({children:n}){const a=Sj();return r.jsx(ob.Provider,{value:a,children:n})}function lb(){const n=y.useContext(ob);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const kj="_container_1mq5u_1",jj="_hamburger_1mq5u_33",Nj="_brand_1mq5u_49",Cj="_brandLogo_1mq5u_68",wj="_info_1mq5u_75",Ej="_connectionLabel_1mq5u_90",Aj="_connectionDot_1mq5u_103",Dj="_connected_1mq5u_106",Rj="_disconnected_1mq5u_110",ha={container:kj,hamburger:jj,brand:Nj,brandLogo:Cj,info:wj,connectionLabel:Ej,connectionDot:Aj,connected:Dj,disconnected:Rj};function Mj({connected:n,environments:a,sessions:i,onToggleSidebar:l,sidebarOpen:c}){const d=Et(),f=a.length,m=a.filter(v=>v.status==="connected").length,p=i.filter(v=>["running","idle"].includes(v.status)).length;return r.jsxs("div",{className:ha.container,children:[l&&r.jsx("button",{type:"button",className:ha.hamburger,onClick:l,"aria-label":"Toggle sidebar","aria-expanded":c,children:"☰"}),r.jsxs("button",{type:"button",className:ha.brand,onClick:()=>d(Cs),title:"Home",children:[r.jsx("img",{src:"/icon-192x192.png",alt:"",className:ha.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),r.jsxs("div",{className:ha.info,children:[r.jsxs("span",{"aria-label":n?"Connected":"Disconnected",children:[r.jsx("span",{className:`${ha.connectionDot} ${n?ha.connected:ha.disconnected}`,"aria-hidden":"true",children:"●"})," ",r.jsx("span",{className:ha.connectionLabel,"aria-hidden":"true",children:n?"Connected":"Disconnected"})]}),r.jsxs("span",{children:[m,"/",f," env",f!==1?"s":""]}),r.jsxs("span",{children:[p," active"]})]})]})}const Oj="_nav_13gkc_1",Bj="_tab_13gkc_35",Lj="_tabIcon_13gkc_68",Ij="_tabLabel_13gkc_79",zj="_tabActive_13gkc_84",Uo={nav:Oj,tab:Bj,tabIcon:Lj,tabLabel:Ij,tabActive:zj},gs=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:Cs,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:Bk,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:Lk,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:Mi,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:"🧠",route:eb,testId:"sidebar-tab-knowledge"},{view:"settings",label:"Settings",icon:"⚙️",route:Rk,testId:"sidebar-tab-settings"}];function Uj(n){return n===Cs||n==="/"?"dashboard":n.startsWith("/chat")||n.startsWith("/sessions")?"chat":n.startsWith("/workspaces")||n.startsWith("/environments")?"environments":n.startsWith(eb)?"knowledge":n.startsWith(Fo)?"settings":"tasks"}function Vj(){const n=wt(),a=Et(),i=y.useRef(null),l=Uj(n.pathname),c=y.useCallback(f=>{a(f.route)},[a]),d=y.useCallback(f=>{var b,x;const m=(b=i.current)==null?void 0:b.querySelectorAll('[role="tab"]');if(!m)return;const p=Array.from(m).findIndex(S=>S===document.activeElement),v=p>=0?p:gs.findIndex(S=>S.view===l);let g=v;if(f.key==="ArrowRight"||f.key==="j"||f.key==="J")f.preventDefault(),g=(v+1)%gs.length;else if(f.key==="ArrowLeft"||f.key==="k"||f.key==="K")f.preventDefault(),g=(v-1+gs.length)%gs.length;else if(f.key==="Home")f.preventDefault(),g=0;else if(f.key==="End")f.preventDefault(),g=gs.length-1;else return;a(gs[g].route),(x=m[g])==null||x.focus()},[l,a]);return r.jsx("nav",{className:Uo.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:d,"data-testid":"sidebar-nav",children:gs.map(f=>{const m=f.view===l;return r.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Uo.tab} ${m?Uo.tabActive:""}`,onClick:()=>c(f),"data-testid":f.testId,title:f.label,"aria-label":f.label,children:[r.jsx("span",{className:Uo.tabIcon,"aria-hidden":"true",children:f.icon}),r.jsx("span",{className:Uo.tabLabel,children:f.label})]},f.view)})})}const rb=y.createContext(void 0),cb=y.createContext(void 0);function Hj({children:n}){const[a,i]=y.useState(void 0),l=y.useCallback(c=>{i(c)},[]);return r.jsx(cb.Provider,{value:l,children:r.jsx(rb.Provider,{value:a,children:n})})}function ub(){return y.useContext(rb)}function Gj(){const n=y.useContext(cb);if(n===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return n}const Pj="_container_pi6ii_1",$j="_content_pi6ii_66",Wg={container:Pj,content:$j},qj=320,db=220,fb=600,hb="grackle-sidebar-width";function Kj(){try{const n=localStorage.getItem(hb);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=db&&a<=fb)return a}}catch{}return qj}function Yj(n){try{localStorage.setItem(hb,String(n))}catch{}}function Fj(){const[n]=y.useState(Kj),a=y.useRef(null),i=ub();if(y.useEffect(()=>{const l=a.current;if(!l)return;const c=new ResizeObserver(d=>{for(const f of d){const m=f.borderBoxSize[0];if(m){const p=Math.round(m.inlineSize);p>=db&&p<=fb&&Yj(p)}}});return c.observe(l),()=>{c.disconnect()}},[]),i!==void 0)return r.jsx("div",{className:Wg.container,ref:a,"data-testid":"sidebar",style:{width:n},children:r.jsx("div",{className:Wg.content,children:i})})}function pc(n){const a=Gj();y.useLayoutEffect(()=>(a(n),()=>{a(void 0)}),[n,a])}const Kf=y.createContext({});function Yf(n){const a=y.useRef(null);return a.current===null&&(a.current=n()),a.current}const vc=y.createContext(null),Ff=y.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class Zj extends y.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const l=this.props.sizeRef.current;l.height=i.offsetHeight||0,l.width=i.offsetWidth||0,l.top=i.offsetTop,l.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Xj({children:n,isPresent:a}){const i=y.useId(),l=y.useRef(null),c=y.useRef({width:0,height:0,top:0,left:0}),{nonce:d}=y.useContext(Ff);return y.useInsertionEffect(()=>{const{width:f,height:m,top:p,left:v}=c.current;if(a||!l.current||!f||!m)return;l.current.dataset.motionPopId=i;const g=document.createElement("style");return d&&(g.nonce=d),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(`
91
+ [data-motion-pop-id="${i}"] {
92
+ position: absolute !important;
93
+ width: ${f}px !important;
94
+ height: ${m}px !important;
95
+ top: ${p}px !important;
96
+ left: ${v}px !important;
97
+ }
98
+ `),()=>{document.head.removeChild(g)}},[a]),r.jsx(Zj,{isPresent:a,childRef:l,sizeRef:c,children:y.cloneElement(n,{ref:l})})}const Qj=({children:n,initial:a,isPresent:i,onExitComplete:l,custom:c,presenceAffectsLayout:d,mode:f})=>{const m=Yf(Wj),p=y.useId(),v=y.useCallback(b=>{m.set(b,!0);for(const x of m.values())if(!x)return;l&&l()},[m,l]),g=y.useMemo(()=>({id:p,initial:a,isPresent:i,custom:c,onExitComplete:v,register:b=>(m.set(b,!1),()=>m.delete(b))}),d?[Math.random(),v]:[i,v]);return y.useMemo(()=>{m.forEach((b,x)=>m.set(x,!1))},[i]),y.useEffect(()=>{!i&&!m.size&&l&&l()},[i]),f==="popLayout"&&(n=r.jsx(Xj,{isPresent:i,children:n})),r.jsx(vc.Provider,{value:g,children:n})};function Wj(){return new Map}function mb(n=!0){const a=y.useContext(vc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:l,register:c}=a,d=y.useId();y.useEffect(()=>{n&&c(d)},[n]);const f=y.useCallback(()=>n&&l&&l(d),[d,l,n]);return!i&&l?[!1,f]:[!0]}const zr=n=>n.key||"";function Jg(n){const a=[];return y.Children.forEach(n,i=>{y.isValidElement(i)&&a.push(i)}),a}const Zf=typeof window<"u",pb=Zf?y.useLayoutEffect:y.useEffect,Yn=({children:n,custom:a,initial:i=!0,onExitComplete:l,presenceAffectsLayout:c=!0,mode:d="sync",propagate:f=!1})=>{const[m,p]=mb(f),v=y.useMemo(()=>Jg(n),[n]),g=f&&!m?[]:v.map(zr),b=y.useRef(!0),x=y.useRef(v),S=Yf(()=>new Map),[j,C]=y.useState(v),[N,k]=y.useState(v);pb(()=>{b.current=!1,x.current=v;for(let R=0;R<N.length;R++){const E=zr(N[R]);g.includes(E)?S.delete(E):S.get(E)!==!0&&S.set(E,!1)}},[N,g.length,g.join("-")]);const w=[];if(v!==j){let R=[...v];for(let E=0;E<N.length;E++){const H=N[E],z=zr(H);g.includes(z)||(R.splice(E,0,H),w.push(H))}d==="wait"&&w.length&&(R=w),k(Jg(R)),C(v);return}const{forceRender:A}=y.useContext(Kf);return r.jsx(r.Fragment,{children:N.map(R=>{const E=zr(R),H=f&&!m?!1:v===N||g.includes(E),z=()=>{if(S.has(E))S.set(E,!0);else return;let I=!0;S.forEach(Y=>{Y||(I=!1)}),I&&(A==null||A(),k(x.current),f&&(p==null||p()),l&&l())};return r.jsx(Qj,{isPresent:H,initial:!b.current||i?void 0:!1,custom:H?void 0:a,presenceAffectsLayout:c,mode:d,onExitComplete:H?void 0:z,children:R},E)})})},un=n=>n;let vb=un;const Jj={useManualTiming:!1};function eN(n){let a=new Set,i=new Set,l=!1,c=!1;const d=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function m(v){d.has(v)&&(p.schedule(v),n()),v(f)}const p={schedule:(v,g=!1,b=!1)=>{const S=b&&l?a:i;return g&&d.add(v),S.has(v)||S.add(v),v},cancel:v=>{i.delete(v),d.delete(v)},process:v=>{if(f=v,l){c=!0;return}l=!0,[a,i]=[i,a],a.forEach(m),a.clear(),l=!1,c&&(c=!1,p.process(v))}};return p}const Ur=["read","resolveKeyframes","update","preRender","render","postRender"],tN=40;function gb(n,a){let i=!1,l=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=()=>i=!0,f=Ur.reduce((k,w)=>(k[w]=eN(d),k),{}),{read:m,resolveKeyframes:p,update:v,preRender:g,render:b,postRender:x}=f,S=()=>{const k=performance.now();i=!1,c.delta=l?1e3/60:Math.max(Math.min(k-c.timestamp,tN),1),c.timestamp=k,c.isProcessing=!0,m.process(c),p.process(c),v.process(c),g.process(c),b.process(c),x.process(c),c.isProcessing=!1,i&&a&&(l=!1,n(S))},j=()=>{i=!0,l=!0,c.isProcessing||n(S)};return{schedule:Ur.reduce((k,w)=>{const A=f[w];return k[w]=(R,E=!1,H=!1)=>(i||j(),A.schedule(R,E,H)),k},{}),cancel:k=>{for(let w=0;w<Ur.length;w++)f[Ur[w]].cancel(k)},state:c,steps:f}}const{schedule:lt,cancel:Za,state:zt,steps:Pd}=gb(typeof requestAnimationFrame<"u"?requestAnimationFrame:un,!0),yb=y.createContext({strict:!1}),ey={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"]},Bi={};for(const n in ey)Bi[n]={isEnabled:a=>ey[n].some(i=>!!a[i])};function nN(n){for(const a in n)Bi[a]={...Bi[a],...n[a]}}const aN=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function tc(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||aN.has(n)}let bb=n=>!tc(n);function sN(n){n&&(bb=a=>a.startsWith("on")?!tc(a):n(a))}try{sN(require("@emotion/is-prop-valid").default)}catch{}function iN(n,a,i){const l={};for(const c in n)c==="values"&&typeof n.values=="object"||(bb(c)||i===!0&&tc(c)||!a&&!tc(c)||n.draggable&&c.startsWith("onDrag"))&&(l[c]=n[c]);return l}function oN(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...l)=>n(...l);return new Proxy(i,{get:(l,c)=>c==="create"?n:(a.has(c)||a.set(c,n(c)),a.get(c))})}const gc=y.createContext({});function al(n){return typeof n=="string"||Array.isArray(n)}function yc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const Xf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Qf=["initial",...Xf];function bc(n){return yc(n.animate)||Qf.some(a=>al(n[a]))}function xb(n){return!!(bc(n)||n.variants)}function lN(n,a){if(bc(n)){const{initial:i,animate:l}=n;return{initial:i===!1||al(i)?i:void 0,animate:al(l)?l:void 0}}return n.inherit!==!1?a:{}}function rN(n){const{initial:a,animate:i}=lN(n,y.useContext(gc));return y.useMemo(()=>({initial:a,animate:i}),[ty(a),ty(i)])}function ty(n){return Array.isArray(n)?n.join(" "):n}const cN=Symbol.for("motionComponentSymbol");function Ni(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function uN(n,a,i){return y.useCallback(l=>{l&&n.onMount&&n.onMount(l),a&&(l?a.mount(l):a.unmount()),i&&(typeof i=="function"?i(l):Ni(i)&&(i.current=l))},[a])}const Wf=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),dN="framerAppearId",_b="data-"+Wf(dN),{schedule:Jf}=gb(queueMicrotask,!1),Sb=y.createContext({});function fN(n,a,i,l,c){var d,f;const{visualElement:m}=y.useContext(gc),p=y.useContext(yb),v=y.useContext(vc),g=y.useContext(Ff).reducedMotion,b=y.useRef(null);l=l||p.renderer,!b.current&&l&&(b.current=l(n,{visualState:a,parent:m,props:i,presenceContext:v,blockInitialAnimation:v?v.initial===!1:!1,reducedMotionConfig:g}));const x=b.current,S=y.useContext(Sb);x&&!x.projection&&c&&(x.type==="html"||x.type==="svg")&&hN(b.current,i,c,S);const j=y.useRef(!1);y.useInsertionEffect(()=>{x&&j.current&&x.update(i,v)});const C=i[_b],N=y.useRef(!!C&&!(!((d=window.MotionHandoffIsComplete)===null||d===void 0)&&d.call(window,C))&&((f=window.MotionHasOptimisedAnimation)===null||f===void 0?void 0:f.call(window,C)));return pb(()=>{x&&(j.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),Jf.render(x.render),N.current&&x.animationState&&x.animationState.animateChanges())}),y.useEffect(()=>{x&&(!N.current&&x.animationState&&x.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)===null||k===void 0||k.call(window,C)}),N.current=!1))}),x}function hN(n,a,i,l){const{layoutId:c,layout:d,drag:f,dragConstraints:m,layoutScroll:p,layoutRoot:v}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:Tb(n.parent)),n.projection.setOptions({layoutId:c,layout:d,alwaysMeasureLayout:!!f||m&&Ni(m),visualElement:n,animationType:typeof d=="string"?d:"both",initialPromotionConfig:l,layoutScroll:p,layoutRoot:v})}function Tb(n){if(n)return n.options.allowProjection!==!1?n.projection:Tb(n.parent)}function mN({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:l,Component:c}){var d,f;n&&nN(n);function m(v,g){let b;const x={...y.useContext(Ff),...v,layoutId:pN(v)},{isStatic:S}=x,j=rN(v),C=l(v,S);if(!S&&Zf){vN();const N=gN(x);b=N.MeasureLayout,j.visualElement=fN(c,C,x,a,N.ProjectionNode)}return r.jsxs(gc.Provider,{value:j,children:[b&&j.visualElement?r.jsx(b,{visualElement:j.visualElement,...x}):null,i(c,v,uN(C,j.visualElement,g),C,S,j.visualElement)]})}m.displayName=`motion.${typeof c=="string"?c:`create(${(f=(d=c.displayName)!==null&&d!==void 0?d:c.name)!==null&&f!==void 0?f:""})`}`;const p=y.forwardRef(m);return p[cN]=c,p}function pN({layoutId:n}){const a=y.useContext(Kf).id;return a&&n!==void 0?a+"-"+n:n}function vN(n,a){y.useContext(yb).strict}function gN(n){const{drag:a,layout:i}=Bi;if(!a&&!i)return{};const l={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(n)||i!=null&&i.isEnabled(n)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}const yN=["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 eh(n){return typeof n!="string"||n.includes("-")?!1:!!(yN.indexOf(n)>-1||/[A-Z]/u.test(n))}function ny(n){const a=[{},{}];return n==null||n.values.forEach((i,l)=>{a[0][l]=i.get(),a[1][l]=i.getVelocity()}),a}function th(n,a,i,l){if(typeof a=="function"){const[c,d]=ny(l);a=a(i!==void 0?i:n.custom,c,d)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[c,d]=ny(l);a=a(i!==void 0?i:n.custom,c,d)}return a}const vf=n=>Array.isArray(n),bN=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),xN=n=>vf(n)?n[n.length-1]||0:n,Ht=n=>!!(n&&n.getVelocity);function Zr(n){const a=Ht(n)?n.get():n;return bN(a)?a.toValue():a}function _N({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},l,c,d){const f={latestValues:SN(l,c,d,n),renderState:a()};return i&&(f.onMount=m=>i({props:l,current:m,...f}),f.onUpdate=m=>i(m)),f}const kb=n=>(a,i)=>{const l=y.useContext(gc),c=y.useContext(vc),d=()=>_N(n,a,l,c);return i?d():Yf(d)};function SN(n,a,i,l){const c={},d=l(n,{});for(const x in d)c[x]=Zr(d[x]);let{initial:f,animate:m}=n;const p=bc(n),v=xb(n);a&&v&&!p&&n.inherit!==!1&&(f===void 0&&(f=a.initial),m===void 0&&(m=a.animate));let g=i?i.initial===!1:!1;g=g||f===!1;const b=g?m:f;if(b&&typeof b!="boolean"&&!yc(b)){const x=Array.isArray(b)?b:[b];for(let S=0;S<x.length;S++){const j=th(n,x[S]);if(j){const{transitionEnd:C,transition:N,...k}=j;for(const w in k){let A=k[w];if(Array.isArray(A)){const R=g?A.length-1:0;A=A[R]}A!==null&&(c[w]=A)}for(const w in C)c[w]=C[w]}}}return c}const Hi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ms=new Set(Hi),jb=n=>a=>typeof a=="string"&&a.startsWith(n),Nb=jb("--"),TN=jb("var(--"),nh=n=>TN(n)?kN.test(n.split("/*")[0].trim()):!1,kN=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Cb=(n,a)=>a&&typeof n=="number"?a.transform(n):n,xa=(n,a,i)=>i>a?a:i<n?n:i,Gi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},sl={...Gi,transform:n=>xa(0,1,n)},Vr={...Gi,default:1},fl=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),Fa=fl("deg"),qn=fl("%"),ye=fl("px"),jN=fl("vh"),NN=fl("vw"),ay={...qn,parse:n=>qn.parse(n)/100,transform:n=>qn.transform(n*100)},CN={borderWidth:ye,borderTopWidth:ye,borderRightWidth:ye,borderBottomWidth:ye,borderLeftWidth:ye,borderRadius:ye,radius:ye,borderTopLeftRadius:ye,borderTopRightRadius:ye,borderBottomRightRadius:ye,borderBottomLeftRadius:ye,width:ye,maxWidth:ye,height:ye,maxHeight:ye,top:ye,right:ye,bottom:ye,left:ye,padding:ye,paddingTop:ye,paddingRight:ye,paddingBottom:ye,paddingLeft:ye,margin:ye,marginTop:ye,marginRight:ye,marginBottom:ye,marginLeft:ye,backgroundPositionX:ye,backgroundPositionY:ye},wN={rotate:Fa,rotateX:Fa,rotateY:Fa,rotateZ:Fa,scale:Vr,scaleX:Vr,scaleY:Vr,scaleZ:Vr,skew:Fa,skewX:Fa,skewY:Fa,distance:ye,translateX:ye,translateY:ye,translateZ:ye,x:ye,y:ye,z:ye,perspective:ye,transformPerspective:ye,opacity:sl,originX:ay,originY:ay,originZ:ye},sy={...Gi,transform:Math.round},ah={...CN,...wN,zIndex:sy,size:ye,fillOpacity:sl,strokeOpacity:sl,numOctaves:sy},EN={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},AN=Hi.length;function DN(n,a,i){let l="",c=!0;for(let d=0;d<AN;d++){const f=Hi[d],m=n[f];if(m===void 0)continue;let p=!0;if(typeof m=="number"?p=m===(f.startsWith("scale")?1:0):p=parseFloat(m)===0,!p||i){const v=Cb(m,ah[f]);if(!p){c=!1;const g=EN[f]||f;l+=`${g}(${v}) `}i&&(a[f]=v)}}return l=l.trim(),i?l=i(a,c?"":l):c&&(l="none"),l}function sh(n,a,i){const{style:l,vars:c,transformOrigin:d}=n;let f=!1,m=!1;for(const p in a){const v=a[p];if(Ms.has(p)){f=!0;continue}else if(Nb(p)){c[p]=v;continue}else{const g=Cb(v,ah[p]);p.startsWith("origin")?(m=!0,d[p]=g):l[p]=g}}if(a.transform||(f||i?l.transform=DN(a,n.transform,i):l.transform&&(l.transform="none")),m){const{originX:p="50%",originY:v="50%",originZ:g=0}=d;l.transformOrigin=`${p} ${v} ${g}`}}const RN={offset:"stroke-dashoffset",array:"stroke-dasharray"},MN={offset:"strokeDashoffset",array:"strokeDasharray"};function ON(n,a,i=1,l=0,c=!0){n.pathLength=1;const d=c?RN:MN;n[d.offset]=ye.transform(-l);const f=ye.transform(a),m=ye.transform(i);n[d.array]=`${f} ${m}`}function iy(n,a,i){return typeof n=="string"?n:ye.transform(a+i*n)}function BN(n,a,i){const l=iy(a,n.x,n.width),c=iy(i,n.y,n.height);return`${l} ${c}`}function ih(n,{attrX:a,attrY:i,attrScale:l,originX:c,originY:d,pathLength:f,pathSpacing:m=1,pathOffset:p=0,...v},g,b){if(sh(n,v,b),g){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:x,style:S,dimensions:j}=n;x.transform&&(j&&(S.transform=x.transform),delete x.transform),j&&(c!==void 0||d!==void 0||S.transform)&&(S.transformOrigin=BN(j,c!==void 0?c:.5,d!==void 0?d:.5)),a!==void 0&&(x.x=a),i!==void 0&&(x.y=i),l!==void 0&&(x.scale=l),f!==void 0&&ON(x,f,m,p,!1)}const oh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),wb=()=>({...oh(),attrs:{}}),lh=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Eb(n,{style:a,vars:i},l,c){Object.assign(n.style,a,c&&c.getProjectionStyles(l));for(const d in i)n.style.setProperty(d,i[d])}const Ab=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 Db(n,a,i,l){Eb(n,a,void 0,l);for(const c in a.attrs)n.setAttribute(Ab.has(c)?c:Wf(c),a.attrs[c])}const nc={};function LN(n){Object.assign(nc,n)}function Rb(n,{layout:a,layoutId:i}){return Ms.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!nc[n]||n==="opacity")}function rh(n,a,i){var l;const{style:c}=n,d={};for(const f in c)(Ht(c[f])||a.style&&Ht(a.style[f])||Rb(f,n)||((l=i==null?void 0:i.getValue(f))===null||l===void 0?void 0:l.liveStyle)!==void 0)&&(d[f]=c[f]);return d}function Mb(n,a,i){const l=rh(n,a,i);for(const c in n)if(Ht(n[c])||Ht(a[c])){const d=Hi.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;l[d]=n[c]}return l}function IN(n,a){try{a.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}}const oy=["x","y","width","height","cx","cy","r"],zN={useVisualState:kb({scrapeMotionValuesFromProps:Mb,createRenderState:wb,onUpdate:({props:n,prevProps:a,current:i,renderState:l,latestValues:c})=>{if(!i)return;let d=!!n.drag;if(!d){for(const m in c)if(Ms.has(m)){d=!0;break}}if(!d)return;let f=!a;if(a)for(let m=0;m<oy.length;m++){const p=oy[m];n[p]!==a[p]&&(f=!0)}f&&lt.read(()=>{IN(i,l),lt.render(()=>{ih(l,c,lh(i.tagName),n.transformTemplate),Db(i,l)})})}})},UN={useVisualState:kb({scrapeMotionValuesFromProps:rh,createRenderState:oh})};function Ob(n,a,i){for(const l in a)!Ht(a[l])&&!Rb(l,i)&&(n[l]=a[l])}function VN({transformTemplate:n},a){return y.useMemo(()=>{const i=oh();return sh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function HN(n,a){const i=n.style||{},l={};return Ob(l,i,n),Object.assign(l,VN(n,a)),l}function GN(n,a){const i={},l=HN(n,a);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,l.userSelect=l.WebkitUserSelect=l.WebkitTouchCallout="none",l.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=l,i}function PN(n,a,i,l){const c=y.useMemo(()=>{const d=wb();return ih(d,a,lh(l),n.transformTemplate),{...d.attrs,style:{...d.style}}},[a]);if(n.style){const d={};Ob(d,n.style,n),c.style={...d,...c.style}}return c}function $N(n=!1){return(i,l,c,{latestValues:d},f)=>{const p=(eh(i)?PN:GN)(l,d,f,i),v=iN(l,typeof i=="string",n),g=i!==y.Fragment?{...v,...p,ref:c}:{},{children:b}=l,x=y.useMemo(()=>Ht(b)?b.get():b,[b]);return y.createElement(i,{...g,children:x})}}function qN(n,a){return function(l,{forwardMotionProps:c}={forwardMotionProps:!1}){const f={...eh(l)?zN:UN,preloadedFeatures:n,useRender:$N(c),createVisualElement:a,Component:l};return mN(f)}}function Bb(n,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==n.length)return!1;for(let l=0;l<i;l++)if(a[l]!==n[l])return!1;return!0}function xc(n,a,i){const l=n.getProps();return th(l,a,i!==void 0?i:l.custom,n)}function ch(n,a){return n?n[a]||n.default||n:void 0}const Lb=new Set(["width","height","top","left","right","bottom",...Hi]);let Xr;function KN(){Xr=void 0}const Kn={now:()=>(Xr===void 0&&Kn.set(zt.isProcessing||Jj.useManualTiming?zt.timestamp:performance.now()),Xr),set:n=>{Xr=n,queueMicrotask(KN)}};function uh(n,a){n.indexOf(a)===-1&&n.push(a)}function dh(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class fh{constructor(){this.subscriptions=[]}add(a){return uh(this.subscriptions,a),()=>dh(this.subscriptions,a)}notify(a,i,l){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](a,i,l);else for(let d=0;d<c;d++){const f=this.subscriptions[d];f&&f(a,i,l)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ib(n,a){return a?n*(1e3/a):0}const ly=30,YN=n=>!isNaN(parseFloat(n));class FN{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(l,c=!0)=>{const d=Kn.now();this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(l),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),c&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=Kn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=YN(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 fh);const l=this.events[a].add(i);return a==="change"?()=>{l(),lt.read(()=>{this.events.change.getSize()||this.stop()})}:l}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,l){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-l}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=Kn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>ly)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,ly);return Ib(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 il(n,a){return new FN(n,a)}function ZN(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,il(i))}function XN(n,a){const i=xc(n,a);let{transitionEnd:l={},transition:c={},...d}=i||{};d={...d,...l};for(const f in d){const m=xN(d[f]);ZN(n,f,m)}}function QN(n){return!!(Ht(n)&&n.add)}function gf(n,a){const i=n.getValue("willChange");if(QN(i))return i.add(a)}function zb(n){return n.props[_b]}function hh(n){let a;return()=>(a===void 0&&(a=n()),a)}const WN=hh(()=>window.ScrollTimeline!==void 0);class JN{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 l=0;l<this.animations.length;l++)this.animations[l][a]=i}attachTimeline(a,i){const l=this.animations.map(c=>{if(WN()&&c.attachTimeline)return c.attachTimeline(a);if(typeof i=="function")return i(c)});return()=>{l.forEach((c,d)=>{c&&c(),this.animations[d].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 eC extends JN{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const pa=n=>n*1e3,va=n=>n/1e3;function mh(n){return typeof n=="function"}function ry(n,a){n.timeline=a,n.onfinish=null}const ph=n=>Array.isArray(n)&&typeof n[0]=="number",tC={linearEasing:void 0};function nC(n,a){const i=hh(n);return()=>{var l;return(l=tC[a])!==null&&l!==void 0?l:i()}}const ac=nC(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Li=(n,a,i)=>{const l=a-n;return l===0?1:(i-n)/l},Ub=(n,a,i=10)=>{let l="";const c=Math.max(Math.round(a/i),2);for(let d=0;d<c;d++)l+=n(Li(0,c-1,d))+", ";return`linear(${l.substring(0,l.length-2)})`};function Vb(n){return!!(typeof n=="function"&&ac()||!n||typeof n=="string"&&(n in yf||ac())||ph(n)||Array.isArray(n)&&n.every(Vb))}const Po=([n,a,i,l])=>`cubic-bezier(${n}, ${a}, ${i}, ${l})`,yf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Po([0,.65,.55,1]),circOut:Po([.55,0,1,.45]),backIn:Po([.31,.01,.66,-.59]),backOut:Po([.33,1.53,.69,.99])};function Hb(n,a){if(n)return typeof n=="function"&&ac()?Ub(n,a):ph(n)?Po(n):Array.isArray(n)?n.map(i=>Hb(i,a)||yf.easeOut):yf[n]}const Gb=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,aC=1e-7,sC=12;function iC(n,a,i,l,c){let d,f,m=0;do f=a+(i-a)/2,d=Gb(f,l,c)-n,d>0?i=f:a=f;while(Math.abs(d)>aC&&++m<sC);return f}function hl(n,a,i,l){if(n===a&&i===l)return un;const c=d=>iC(d,0,1,n,i);return d=>d===0||d===1?d:Gb(c(d),a,l)}const Pb=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,$b=n=>a=>1-n(1-a),qb=hl(.33,1.53,.69,.99),vh=$b(qb),Kb=Pb(vh),Yb=n=>(n*=2)<1?.5*vh(n):.5*(2-Math.pow(2,-10*(n-1))),gh=n=>1-Math.sin(Math.acos(n)),Fb=$b(gh),Zb=Pb(gh),Xb=n=>/^0[^.\s]+$/u.test(n);function oC(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||Xb(n):!0}const Xo=n=>Math.round(n*1e5)/1e5,yh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function lC(n){return n==null}const rC=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,bh=(n,a)=>i=>!!(typeof i=="string"&&rC.test(i)&&i.startsWith(n)||a&&!lC(i)&&Object.prototype.hasOwnProperty.call(i,a)),Qb=(n,a,i)=>l=>{if(typeof l!="string")return l;const[c,d,f,m]=l.match(yh);return{[n]:parseFloat(c),[a]:parseFloat(d),[i]:parseFloat(f),alpha:m!==void 0?parseFloat(m):1}},cC=n=>xa(0,255,n),$d={...Gi,transform:n=>Math.round(cC(n))},ks={test:bh("rgb","red"),parse:Qb("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:l=1})=>"rgba("+$d.transform(n)+", "+$d.transform(a)+", "+$d.transform(i)+", "+Xo(sl.transform(l))+")"};function uC(n){let a="",i="",l="",c="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),l=n.substring(5,7),c=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),l=n.substring(3,4),c=n.substring(4,5),a+=a,i+=i,l+=l,c+=c),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(l,16),alpha:c?parseInt(c,16)/255:1}}const bf={test:bh("#"),parse:uC,transform:ks.transform},Ci={test:bh("hsl","hue"),parse:Qb("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:l=1})=>"hsla("+Math.round(n)+", "+qn.transform(Xo(a))+", "+qn.transform(Xo(i))+", "+Xo(sl.transform(l))+")"},Vt={test:n=>ks.test(n)||bf.test(n)||Ci.test(n),parse:n=>ks.test(n)?ks.parse(n):Ci.test(n)?Ci.parse(n):bf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?ks.transform(n):Ci.transform(n)},dC=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function fC(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(yh))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(dC))===null||i===void 0?void 0:i.length)||0)>0}const Wb="number",Jb="color",hC="var",mC="var(",cy="${}",pC=/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 ol(n){const a=n.toString(),i=[],l={color:[],number:[],var:[]},c=[];let d=0;const m=a.replace(pC,p=>(Vt.test(p)?(l.color.push(d),c.push(Jb),i.push(Vt.parse(p))):p.startsWith(mC)?(l.var.push(d),c.push(hC),i.push(p)):(l.number.push(d),c.push(Wb),i.push(parseFloat(p))),++d,cy)).split(cy);return{values:i,split:m,indexes:l,types:c}}function ex(n){return ol(n).values}function tx(n){const{split:a,types:i}=ol(n),l=a.length;return c=>{let d="";for(let f=0;f<l;f++)if(d+=a[f],c[f]!==void 0){const m=i[f];m===Wb?d+=Xo(c[f]):m===Jb?d+=Vt.transform(c[f]):d+=c[f]}return d}}const vC=n=>typeof n=="number"?0:n;function gC(n){const a=ex(n);return tx(n)(a.map(vC))}const Xa={test:fC,parse:ex,createTransformer:tx,getAnimatableNone:gC},yC=new Set(["brightness","contrast","saturate","opacity"]);function bC(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[l]=i.match(yh)||[];if(!l)return n;const c=i.replace(l,"");let d=yC.has(a)?1:0;return l!==i&&(d*=100),a+"("+d+c+")"}const xC=/\b([a-z-]*)\(.*?\)/gu,xf={...Xa,getAnimatableNone:n=>{const a=n.match(xC);return a?a.map(bC).join(" "):n}},_C={...ah,color:Vt,backgroundColor:Vt,outlineColor:Vt,fill:Vt,stroke:Vt,borderColor:Vt,borderTopColor:Vt,borderRightColor:Vt,borderBottomColor:Vt,borderLeftColor:Vt,filter:xf,WebkitFilter:xf},xh=n=>_C[n];function nx(n,a){let i=xh(n);return i!==xf&&(i=Xa),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const SC=new Set(["auto","none","0"]);function TC(n,a,i){let l=0,c;for(;l<n.length&&!c;){const d=n[l];typeof d=="string"&&!SC.has(d)&&ol(d).values.length&&(c=n[l]),l++}if(c&&i)for(const d of a)n[d]=nx(i,c)}const uy=n=>n===Gi||n===ye,dy=(n,a)=>parseFloat(n.split(", ")[a]),fy=(n,a)=>(i,{transform:l})=>{if(l==="none"||!l)return 0;const c=l.match(/^matrix3d\((.+)\)$/u);if(c)return dy(c[1],a);{const d=l.match(/^matrix\((.+)\)$/u);return d?dy(d[1],n):0}},kC=new Set(["x","y","z"]),jC=Hi.filter(n=>!kC.has(n));function NC(n){const a=[];return jC.forEach(i=>{const l=n.getValue(i);l!==void 0&&(a.push([i,l.get()]),l.set(i.startsWith("scale")?1:0))}),a}const Ii={width:({x:n},{paddingLeft:a="0",paddingRight:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),height:({y:n},{paddingTop:a="0",paddingBottom:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),top:(n,{top:a})=>parseFloat(a),left:(n,{left:a})=>parseFloat(a),bottom:({y:n},{top:a})=>parseFloat(a)+(n.max-n.min),right:({x:n},{left:a})=>parseFloat(a)+(n.max-n.min),x:fy(4,13),y:fy(5,14)};Ii.translateX=Ii.x;Ii.translateY=Ii.y;const Ns=new Set;let _f=!1,Sf=!1;function ax(){if(Sf){const n=Array.from(Ns).filter(l=>l.needsMeasurement),a=new Set(n.map(l=>l.element)),i=new Map;a.forEach(l=>{const c=NC(l);c.length&&(i.set(l,c),l.render())}),n.forEach(l=>l.measureInitialState()),a.forEach(l=>{l.render();const c=i.get(l);c&&c.forEach(([d,f])=>{var m;(m=l.getValue(d))===null||m===void 0||m.set(f)})}),n.forEach(l=>l.measureEndState()),n.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}Sf=!1,_f=!1,Ns.forEach(n=>n.complete()),Ns.clear()}function sx(){Ns.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Sf=!0)})}function CC(){sx(),ax()}class _h{constructor(a,i,l,c,d,f=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=l,this.motionValue=c,this.element=d,this.isAsync=f}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ns.add(this),_f||(_f=!0,lt.read(sx),lt.resolveKeyframes(ax))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:l,motionValue:c}=this;for(let d=0;d<a.length;d++)if(a[d]===null)if(d===0){const f=c==null?void 0:c.get(),m=a[a.length-1];if(f!==void 0)a[0]=f;else if(l&&i){const p=l.readValue(i,m);p!=null&&(a[0]=p)}a[0]===void 0&&(a[0]=m),c&&f===void 0&&c.set(a[0])}else a[d]=a[d-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ns.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ns.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ix=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),wC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function EC(n){const a=wC.exec(n);if(!a)return[,];const[,i,l,c]=a;return[`--${i??l}`,c]}function ox(n,a,i=1){const[l,c]=EC(n);if(!l)return;const d=window.getComputedStyle(a).getPropertyValue(l);if(d){const f=d.trim();return ix(f)?parseFloat(f):f}return nh(c)?ox(c,a,i+1):c}const lx=n=>a=>a.test(n),AC={test:n=>n==="auto",parse:n=>n},rx=[Gi,ye,qn,Fa,NN,jN,AC],hy=n=>rx.find(lx(n));class cx extends _h{constructor(a,i,l,c,d){super(a,i,l,c,d,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:l}=this;if(!i||!i.current)return;super.readKeyframes();for(let p=0;p<a.length;p++){let v=a[p];if(typeof v=="string"&&(v=v.trim(),nh(v))){const g=ox(v,i.current);g!==void 0&&(a[p]=g),p===a.length-1&&(this.finalKeyframe=v)}}if(this.resolveNoneKeyframes(),!Lb.has(l)||a.length!==2)return;const[c,d]=a,f=hy(c),m=hy(d);if(f!==m)if(uy(f)&&uy(m))for(let p=0;p<a.length;p++){const v=a[p];typeof v=="string"&&(a[p]=parseFloat(v))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,l=[];for(let c=0;c<a.length;c++)oC(a[c])&&l.push(c);l.length&&TC(a,l,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:l}=this;if(!a||!a.current)return;l==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ii[l](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const c=i[i.length-1];c!==void 0&&a.getValue(l,c).jump(c,!1)}measureEndState(){var a;const{element:i,name:l,unresolvedKeyframes:c}=this;if(!i||!i.current)return;const d=i.getValue(l);d&&d.jump(this.measuredOrigin,!1);const f=c.length-1,m=c[f];c[f]=Ii[l](i.measureViewportBox(),window.getComputedStyle(i.current)),m!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=m),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([p,v])=>{i.getValue(p).set(v)}),this.resolveNoneKeyframes()}}const my=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(Xa.test(n)||n==="0")&&!n.startsWith("url("));function DC(n){const a=n[0];if(n.length===1)return!0;for(let i=0;i<n.length;i++)if(n[i]!==a)return!0}function RC(n,a,i,l){const c=n[0];if(c===null)return!1;if(a==="display"||a==="visibility")return!0;const d=n[n.length-1],f=my(c,a),m=my(d,a);return!f||!m?!1:DC(n)||(i==="spring"||mh(i))&&l}const MC=n=>n!==null;function _c(n,{repeat:a,repeatType:i="loop"},l){const c=n.filter(MC),d=a&&i!=="loop"&&a%2===1?0:c.length-1;return!d||l===void 0?c[d]:l}const OC=40;class ux{constructor({autoplay:a=!0,delay:i=0,type:l="keyframes",repeat:c=0,repeatDelay:d=0,repeatType:f="loop",...m}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Kn.now(),this.options={autoplay:a,delay:i,type:l,repeat:c,repeatDelay:d,repeatType:f,...m},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>OC?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&CC(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Kn.now(),this.hasAttemptedResolve=!0;const{name:l,type:c,velocity:d,delay:f,onComplete:m,onUpdate:p,isGenerator:v}=this.options;if(!v&&!RC(a,l,c,d))if(f)this.options.duration=0;else{p&&p(_c(a,this.options,i)),m&&m(),this.resolveFinishedPromise();return}const g=this.initPlayback(a,i);g!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...g},this.onPostResolved())}onPostResolved(){}then(a,i){return this.currentFinishedPromise.then(a,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const Tf=2e4;function dx(n){let a=0;const i=50;let l=n.next(a);for(;!l.done&&a<Tf;)a+=i,l=n.next(a);return a>=Tf?1/0:a}const dt=(n,a,i)=>n+(a-n)*i;function qd(n,a,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?n+(a-n)*6*i:i<1/2?a:i<2/3?n+(a-n)*(2/3-i)*6:n}function BC({hue:n,saturation:a,lightness:i,alpha:l}){n/=360,a/=100,i/=100;let c=0,d=0,f=0;if(!a)c=d=f=i;else{const m=i<.5?i*(1+a):i+a-i*a,p=2*i-m;c=qd(p,m,n+1/3),d=qd(p,m,n),f=qd(p,m,n-1/3)}return{red:Math.round(c*255),green:Math.round(d*255),blue:Math.round(f*255),alpha:l}}function sc(n,a){return i=>i>0?a:n}const Kd=(n,a,i)=>{const l=n*n,c=i*(a*a-l)+l;return c<0?0:Math.sqrt(c)},LC=[bf,ks,Ci],IC=n=>LC.find(a=>a.test(n));function py(n){const a=IC(n);if(!a)return!1;let i=a.parse(n);return a===Ci&&(i=BC(i)),i}const vy=(n,a)=>{const i=py(n),l=py(a);if(!i||!l)return sc(n,a);const c={...i};return d=>(c.red=Kd(i.red,l.red,d),c.green=Kd(i.green,l.green,d),c.blue=Kd(i.blue,l.blue,d),c.alpha=dt(i.alpha,l.alpha,d),ks.transform(c))},zC=(n,a)=>i=>a(n(i)),ml=(...n)=>n.reduce(zC),kf=new Set(["none","hidden"]);function UC(n,a){return kf.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function VC(n,a){return i=>dt(n,a,i)}function Sh(n){return typeof n=="number"?VC:typeof n=="string"?nh(n)?sc:Vt.test(n)?vy:PC:Array.isArray(n)?fx:typeof n=="object"?Vt.test(n)?vy:HC:sc}function fx(n,a){const i=[...n],l=i.length,c=n.map((d,f)=>Sh(d)(d,a[f]));return d=>{for(let f=0;f<l;f++)i[f]=c[f](d);return i}}function HC(n,a){const i={...n,...a},l={};for(const c in i)n[c]!==void 0&&a[c]!==void 0&&(l[c]=Sh(n[c])(n[c],a[c]));return c=>{for(const d in l)i[d]=l[d](c);return i}}function GC(n,a){var i;const l=[],c={color:0,var:0,number:0};for(let d=0;d<a.values.length;d++){const f=a.types[d],m=n.indexes[f][c[f]],p=(i=n.values[m])!==null&&i!==void 0?i:0;l[d]=p,c[f]++}return l}const PC=(n,a)=>{const i=Xa.createTransformer(a),l=ol(n),c=ol(a);return l.indexes.var.length===c.indexes.var.length&&l.indexes.color.length===c.indexes.color.length&&l.indexes.number.length>=c.indexes.number.length?kf.has(n)&&!c.values.length||kf.has(a)&&!l.values.length?UC(n,a):ml(fx(GC(l,c),c.values),i):sc(n,a)};function hx(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?dt(n,a,i):Sh(n)(n,a)}const $C=5;function mx(n,a,i){const l=Math.max(a-$C,0);return Ib(i-n(l),a-l)}const mt={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},Yd=.001;function qC({duration:n=mt.duration,bounce:a=mt.bounce,velocity:i=mt.velocity,mass:l=mt.mass}){let c,d,f=1-a;f=xa(mt.minDamping,mt.maxDamping,f),n=xa(mt.minDuration,mt.maxDuration,va(n)),f<1?(c=v=>{const g=v*f,b=g*n,x=g-i,S=jf(v,f),j=Math.exp(-b);return Yd-x/S*j},d=v=>{const b=v*f*n,x=b*i+i,S=Math.pow(f,2)*Math.pow(v,2)*n,j=Math.exp(-b),C=jf(Math.pow(v,2),f);return(-c(v)+Yd>0?-1:1)*((x-S)*j)/C}):(c=v=>{const g=Math.exp(-v*n),b=(v-i)*n+1;return-Yd+g*b},d=v=>{const g=Math.exp(-v*n),b=(i-v)*(n*n);return g*b});const m=5/n,p=YC(c,d,m);if(n=pa(n),isNaN(p))return{stiffness:mt.stiffness,damping:mt.damping,duration:n};{const v=Math.pow(p,2)*l;return{stiffness:v,damping:f*2*Math.sqrt(l*v),duration:n}}}const KC=12;function YC(n,a,i){let l=i;for(let c=1;c<KC;c++)l=l-n(l)/a(l);return l}function jf(n,a){return n*Math.sqrt(1-a*a)}const FC=["duration","bounce"],ZC=["stiffness","damping","mass"];function gy(n,a){return a.some(i=>n[i]!==void 0)}function XC(n){let a={velocity:mt.velocity,stiffness:mt.stiffness,damping:mt.damping,mass:mt.mass,isResolvedFromDuration:!1,...n};if(!gy(n,ZC)&&gy(n,FC))if(n.visualDuration){const i=n.visualDuration,l=2*Math.PI/(i*1.2),c=l*l,d=2*xa(.05,1,1-(n.bounce||0))*Math.sqrt(c);a={...a,mass:mt.mass,stiffness:c,damping:d}}else{const i=qC(n);a={...a,...i,mass:mt.mass},a.isResolvedFromDuration=!0}return a}function px(n=mt.visualDuration,a=mt.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:l,restDelta:c}=i;const d=i.keyframes[0],f=i.keyframes[i.keyframes.length-1],m={done:!1,value:d},{stiffness:p,damping:v,mass:g,duration:b,velocity:x,isResolvedFromDuration:S}=XC({...i,velocity:-va(i.velocity||0)}),j=x||0,C=v/(2*Math.sqrt(p*g)),N=f-d,k=va(Math.sqrt(p/g)),w=Math.abs(N)<5;l||(l=w?mt.restSpeed.granular:mt.restSpeed.default),c||(c=w?mt.restDelta.granular:mt.restDelta.default);let A;if(C<1){const E=jf(k,C);A=H=>{const z=Math.exp(-C*k*H);return f-z*((j+C*k*N)/E*Math.sin(E*H)+N*Math.cos(E*H))}}else if(C===1)A=E=>f-Math.exp(-k*E)*(N+(j+k*N)*E);else{const E=k*Math.sqrt(C*C-1);A=H=>{const z=Math.exp(-C*k*H),I=Math.min(E*H,300);return f-z*((j+C*k*N)*Math.sinh(I)+E*N*Math.cosh(I))/E}}const R={calculatedDuration:S&&b||null,next:E=>{const H=A(E);if(S)m.done=E>=b;else{let z=0;C<1&&(z=E===0?pa(j):mx(A,E,H));const I=Math.abs(z)<=l,Y=Math.abs(f-H)<=c;m.done=I&&Y}return m.value=m.done?f:H,m},toString:()=>{const E=Math.min(dx(R),Tf),H=Ub(z=>R.next(E*z).value,E,30);return E+"ms "+H}};return R}function yy({keyframes:n,velocity:a=0,power:i=.8,timeConstant:l=325,bounceDamping:c=10,bounceStiffness:d=500,modifyTarget:f,min:m,max:p,restDelta:v=.5,restSpeed:g}){const b=n[0],x={done:!1,value:b},S=I=>m!==void 0&&I<m||p!==void 0&&I>p,j=I=>m===void 0?p:p===void 0||Math.abs(m-I)<Math.abs(p-I)?m:p;let C=i*a;const N=b+C,k=f===void 0?N:f(N);k!==N&&(C=k-b);const w=I=>-C*Math.exp(-I/l),A=I=>k+w(I),R=I=>{const Y=w(I),ee=A(I);x.done=Math.abs(Y)<=v,x.value=x.done?k:ee};let E,H;const z=I=>{S(x.value)&&(E=I,H=px({keyframes:[x.value,j(x.value)],velocity:mx(A,I,x.value),damping:c,stiffness:d,restDelta:v,restSpeed:g}))};return z(0),{calculatedDuration:null,next:I=>{let Y=!1;return!H&&E===void 0&&(Y=!0,R(I),z(I)),E!==void 0&&I>=E?H.next(I-E):(!Y&&R(I),x)}}}const QC=hl(.42,0,1,1),WC=hl(0,0,.58,1),vx=hl(.42,0,.58,1),JC=n=>Array.isArray(n)&&typeof n[0]!="number",ew={linear:un,easeIn:QC,easeInOut:vx,easeOut:WC,circIn:gh,circInOut:Zb,circOut:Fb,backIn:vh,backInOut:Kb,backOut:qb,anticipate:Yb},by=n=>{if(ph(n)){vb(n.length===4);const[a,i,l,c]=n;return hl(a,i,l,c)}else if(typeof n=="string")return ew[n];return n};function tw(n,a,i){const l=[],c=i||hx,d=n.length-1;for(let f=0;f<d;f++){let m=c(n[f],n[f+1]);if(a){const p=Array.isArray(a)?a[f]||un:a;m=ml(p,m)}l.push(m)}return l}function nw(n,a,{clamp:i=!0,ease:l,mixer:c}={}){const d=n.length;if(vb(d===a.length),d===1)return()=>a[0];if(d===2&&a[0]===a[1])return()=>a[1];const f=n[0]===n[1];n[0]>n[d-1]&&(n=[...n].reverse(),a=[...a].reverse());const m=tw(a,l,c),p=m.length,v=g=>{if(f&&g<n[0])return a[0];let b=0;if(p>1)for(;b<n.length-2&&!(g<n[b+1]);b++);const x=Li(n[b],n[b+1],g);return m[b](x)};return i?g=>v(xa(n[0],n[d-1],g)):v}function aw(n,a){const i=n[n.length-1];for(let l=1;l<=a;l++){const c=Li(0,a,l);n.push(dt(i,1,c))}}function sw(n){const a=[0];return aw(a,n.length-1),a}function iw(n,a){return n.map(i=>i*a)}function ow(n,a){return n.map(()=>a||vx).splice(0,n.length-1)}function ic({duration:n=300,keyframes:a,times:i,ease:l="easeInOut"}){const c=JC(l)?l.map(by):by(l),d={done:!1,value:a[0]},f=iw(i&&i.length===a.length?i:sw(a),n),m=nw(f,a,{ease:Array.isArray(c)?c:ow(a,c)});return{calculatedDuration:n,next:p=>(d.value=m(p),d.done=p>=n,d)}}const lw=n=>{const a=({timestamp:i})=>n(i);return{start:()=>lt.update(a,!0),stop:()=>Za(a),now:()=>zt.isProcessing?zt.timestamp:Kn.now()}},rw={decay:yy,inertia:yy,tween:ic,keyframes:ic,spring:px},cw=n=>n/100;class Th extends ux{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:p}=this.options;p&&p()};const{name:i,motionValue:l,element:c,keyframes:d}=this.options,f=(c==null?void 0:c.KeyframeResolver)||_h,m=(p,v)=>this.onKeyframesResolved(p,v);this.resolver=new f(d,m,i,l,c),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:l=0,repeatDelay:c=0,repeatType:d,velocity:f=0}=this.options,m=mh(i)?i:rw[i]||ic;let p,v;m!==ic&&typeof a[0]!="number"&&(p=ml(cw,hx(a[0],a[1])),a=[0,100]);const g=m({...this.options,keyframes:a});d==="mirror"&&(v=m({...this.options,keyframes:[...a].reverse(),velocity:-f})),g.calculatedDuration===null&&(g.calculatedDuration=dx(g));const{calculatedDuration:b}=g,x=b+c,S=x*(l+1)-c;return{generator:g,mirroredGenerator:v,mapPercentToKeyframes:p,calculatedDuration:b,resolvedDuration:x,totalDuration:S}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,i=!1){const{resolved:l}=this;if(!l){const{keyframes:I}=this.options;return{done:!0,value:I[I.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:f,mapPercentToKeyframes:m,keyframes:p,calculatedDuration:v,totalDuration:g,resolvedDuration:b}=l;if(this.startTime===null)return d.next(0);const{delay:x,repeat:S,repeatType:j,repeatDelay:C,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-g/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const k=this.currentTime-x*(this.speed>=0?1:-1),w=this.speed>=0?k<0:k>g;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=g);let A=this.currentTime,R=d;if(S){const I=Math.min(this.currentTime,g)/b;let Y=Math.floor(I),ee=I%1;!ee&&I>=1&&(ee=1),ee===1&&Y--,Y=Math.min(Y,S+1),!!(Y%2)&&(j==="reverse"?(ee=1-ee,C&&(ee-=C/b)):j==="mirror"&&(R=f)),A=xa(0,1,ee)*b}const E=w?{done:!1,value:p[0]}:R.next(A);m&&(E.value=m(E.value));let{done:H}=E;!w&&v!==null&&(H=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&H);return z&&c!==void 0&&(E.value=_c(p,this.options,c)),N&&N(E.value),z&&this.finish(),E}get duration(){const{resolved:a}=this;return a?va(a.calculatedDuration):0}get time(){return va(this.currentTime)}set time(a){a=pa(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=va(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=lw,onPlay:i,startTime:l}=this.options;this.driver||(this.driver=a(d=>this.tick(d))),i&&i();const c=this.driver.now();this.holdTime!==null?this.startTime=c-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=c):this.startTime=l??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 uw=new Set(["opacity","clipPath","filter","transform"]);function dw(n,a,i,{delay:l=0,duration:c=300,repeat:d=0,repeatType:f="loop",ease:m="easeInOut",times:p}={}){const v={[a]:i};p&&(v.offset=p);const g=Hb(m,c);return Array.isArray(g)&&(v.easing=g),n.animate(v,{delay:l,duration:c,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:d+1,direction:f==="reverse"?"alternate":"normal"})}const fw=hh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),oc=10,hw=2e4;function mw(n){return mh(n.type)||n.type==="spring"||!Vb(n.ease)}function pw(n,a){const i=new Th({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let l={done:!1,value:n[0]};const c=[];let d=0;for(;!l.done&&d<hw;)l=i.sample(d),c.push(l.value),d+=oc;return{times:void 0,keyframes:c,duration:d-oc,ease:"linear"}}const gx={anticipate:Yb,backInOut:Kb,circInOut:Zb};function vw(n){return n in gx}class xy extends ux{constructor(a){super(a);const{name:i,motionValue:l,element:c,keyframes:d}=this.options;this.resolver=new cx(d,(f,m)=>this.onKeyframesResolved(f,m),i,l,c),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:l=300,times:c,ease:d,type:f,motionValue:m,name:p,startTime:v}=this.options;if(!m.owner||!m.owner.current)return!1;if(typeof d=="string"&&ac()&&vw(d)&&(d=gx[d]),mw(this.options)){const{onComplete:b,onUpdate:x,motionValue:S,element:j,...C}=this.options,N=pw(a,C);a=N.keyframes,a.length===1&&(a[1]=a[0]),l=N.duration,c=N.times,d=N.ease,f="keyframes"}const g=dw(m.owner.current,p,a,{...this.options,duration:l,times:c,ease:d});return g.startTime=v??this.calcStartTime(),this.pendingTimeline?(ry(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:b}=this.options;m.set(_c(a,this.options,i)),b&&b(),this.cancel(),this.resolveFinishedPromise()},{animation:g,duration:l,times:c,type:f,ease:d,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return va(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return va(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.currentTime=pa(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:l}=i;l.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 un;const{animation:l}=i;ry(l,a)}return un}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:l,duration:c,type:d,ease:f,times:m}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:v,onUpdate:g,onComplete:b,element:x,...S}=this.options,j=new Th({...S,keyframes:l,duration:c,type:d,ease:f,times:m,isGenerator:!0}),C=pa(this.time);v.setWithVelocity(j.sample(C-oc).value,j.sample(C).value,oc)}const{onStop:p}=this.options;p&&p(),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:l,repeatDelay:c,repeatType:d,damping:f,type:m}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:p,transformTemplate:v}=i.owner.getProps();return fw()&&l&&uw.has(l)&&!p&&!v&&!c&&d!=="mirror"&&f!==0&&m!=="inertia"}}const gw={type:"spring",stiffness:500,damping:25,restSpeed:10},yw=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),bw={type:"keyframes",duration:.8},xw={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},_w=(n,{keyframes:a})=>a.length>2?bw:Ms.has(n)?n.startsWith("scale")?yw(a[1]):gw:xw;function Sw({when:n,delay:a,delayChildren:i,staggerChildren:l,staggerDirection:c,repeat:d,repeatType:f,repeatDelay:m,from:p,elapsed:v,...g}){return!!Object.keys(g).length}const kh=(n,a,i,l={},c,d)=>f=>{const m=ch(l,n)||{},p=m.delay||l.delay||0;let{elapsed:v=0}=l;v=v-pa(p);let g={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...m,delay:-v,onUpdate:x=>{a.set(x),m.onUpdate&&m.onUpdate(x)},onComplete:()=>{f(),m.onComplete&&m.onComplete()},name:n,motionValue:a,element:d?void 0:c};Sw(m)||(g={...g,..._w(n,g)}),g.duration&&(g.duration=pa(g.duration)),g.repeatDelay&&(g.repeatDelay=pa(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let b=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(g.duration=0,g.delay===0&&(b=!0)),b&&!d&&a.get()!==void 0){const x=_c(g.keyframes,m);if(x!==void 0)return lt.update(()=>{g.onUpdate(x),g.onComplete()}),new eC([])}return!d&&xy.supports(g)?new xy(g):new Th(g)};function Tw({protectedKeys:n,needsAnimating:a},i){const l=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,l}function yx(n,a,{delay:i=0,transitionOverride:l,type:c}={}){var d;let{transition:f=n.getDefaultTransition(),transitionEnd:m,...p}=a;l&&(f=l);const v=[],g=c&&n.animationState&&n.animationState.getState()[c];for(const b in p){const x=n.getValue(b,(d=n.latestValues[b])!==null&&d!==void 0?d:null),S=p[b];if(S===void 0||g&&Tw(g,b))continue;const j={delay:i,...ch(f||{},b)};let C=!1;if(window.MotionHandoffAnimation){const k=zb(n);if(k){const w=window.MotionHandoffAnimation(k,b,lt);w!==null&&(j.startTime=w,C=!0)}}gf(n,b),x.start(kh(b,x,S,n.shouldReduceMotion&&Lb.has(b)?{type:!1}:j,n,C));const N=x.animation;N&&v.push(N)}return m&&Promise.all(v).then(()=>{lt.update(()=>{m&&XN(n,m)})}),v}function Nf(n,a,i={}){var l;const c=xc(n,a,i.type==="exit"?(l=n.presenceContext)===null||l===void 0?void 0:l.custom:void 0);let{transition:d=n.getDefaultTransition()||{}}=c||{};i.transitionOverride&&(d=i.transitionOverride);const f=c?()=>Promise.all(yx(n,c,i)):()=>Promise.resolve(),m=n.variantChildren&&n.variantChildren.size?(v=0)=>{const{delayChildren:g=0,staggerChildren:b,staggerDirection:x}=d;return kw(n,a,g+v,b,x,i)}:()=>Promise.resolve(),{when:p}=d;if(p){const[v,g]=p==="beforeChildren"?[f,m]:[m,f];return v().then(()=>g())}else return Promise.all([f(),m(i.delay)])}function kw(n,a,i=0,l=0,c=1,d){const f=[],m=(n.variantChildren.size-1)*l,p=c===1?(v=0)=>v*l:(v=0)=>m-v*l;return Array.from(n.variantChildren).sort(jw).forEach((v,g)=>{v.notify("AnimationStart",a),f.push(Nf(v,a,{...d,delay:i+p(g)}).then(()=>v.notify("AnimationComplete",a)))}),Promise.all(f)}function jw(n,a){return n.sortNodePosition(a)}function Nw(n,a,i={}){n.notify("AnimationStart",a);let l;if(Array.isArray(a)){const c=a.map(d=>Nf(n,d,i));l=Promise.all(c)}else if(typeof a=="string")l=Nf(n,a,i);else{const c=typeof a=="function"?xc(n,a,i.custom):a;l=Promise.all(yx(n,c,i))}return l.then(()=>{n.notify("AnimationComplete",a)})}const Cw=Qf.length;function bx(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?bx(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<Cw;i++){const l=Qf[i],c=n.props[l];(al(c)||c===!1)&&(a[l]=c)}return a}const ww=[...Xf].reverse(),Ew=Xf.length;function Aw(n){return a=>Promise.all(a.map(({animation:i,options:l})=>Nw(n,i,l)))}function Dw(n){let a=Aw(n),i=_y(),l=!0;const c=p=>(v,g)=>{var b;const x=xc(n,g,p==="exit"?(b=n.presenceContext)===null||b===void 0?void 0:b.custom:void 0);if(x){const{transition:S,transitionEnd:j,...C}=x;v={...v,...C,...j}}return v};function d(p){a=p(n)}function f(p){const{props:v}=n,g=bx(n.parent)||{},b=[],x=new Set;let S={},j=1/0;for(let N=0;N<Ew;N++){const k=ww[N],w=i[k],A=v[k]!==void 0?v[k]:g[k],R=al(A),E=k===p?w.isActive:null;E===!1&&(j=N);let H=A===g[k]&&A!==v[k]&&R;if(H&&l&&n.manuallyAnimateOnMount&&(H=!1),w.protectedKeys={...S},!w.isActive&&E===null||!A&&!w.prevProp||yc(A)||typeof A=="boolean")continue;const z=Rw(w.prevProp,A);let I=z||k===p&&w.isActive&&!H&&R||N>j&&R,Y=!1;const ee=Array.isArray(A)?A:[A];let te=ee.reduce(c(k),{});E===!1&&(te={});const{prevResolvedValues:ie={}}=w,ce={...ie,...te},K=P=>{I=!0,x.has(P)&&(Y=!0,x.delete(P)),w.needsAnimating[P]=!0;const se=n.getValue(P);se&&(se.liveStyle=!1)};for(const P in ce){const se=te[P],le=ie[P];if(S.hasOwnProperty(P))continue;let q=!1;vf(se)&&vf(le)?q=!Bb(se,le):q=se!==le,q?se!=null?K(P):x.add(P):se!==void 0&&x.has(P)?K(P):w.protectedKeys[P]=!0}w.prevProp=A,w.prevResolvedValues=te,w.isActive&&(S={...S,...te}),l&&n.blockInitialAnimation&&(I=!1),I&&(!(H&&z)||Y)&&b.push(...ee.map(P=>({animation:P,options:{type:k}})))}if(x.size){const N={};x.forEach(k=>{const w=n.getBaseTarget(k),A=n.getValue(k);A&&(A.liveStyle=!0),N[k]=w??null}),b.push({animation:N})}let C=!!b.length;return l&&(v.initial===!1||v.initial===v.animate)&&!n.manuallyAnimateOnMount&&(C=!1),l=!1,C?a(b):Promise.resolve()}function m(p,v){var g;if(i[p].isActive===v)return Promise.resolve();(g=n.variantChildren)===null||g===void 0||g.forEach(x=>{var S;return(S=x.animationState)===null||S===void 0?void 0:S.setActive(p,v)}),i[p].isActive=v;const b=f(p);for(const x in i)i[x].protectedKeys={};return b}return{animateChanges:f,setActive:m,setAnimateFunction:d,getState:()=>i,reset:()=>{i=_y(),l=!0}}}function Rw(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!Bb(a,n):!1}function ys(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _y(){return{animate:ys(!0),whileInView:ys(),whileHover:ys(),whileTap:ys(),whileDrag:ys(),whileFocus:ys(),exit:ys()}}class Ja{constructor(a){this.isMounted=!1,this.node=a}update(){}}class Mw extends Ja{constructor(a){super(a),a.animationState||(a.animationState=Dw(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();yc(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 Ow=0;class Bw extends Ja{constructor(){super(...arguments),this.id=Ow++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:l}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===l)return;const c=this.node.animationState.setActive("exit",!a);i&&!a&&c.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const Lw={animation:{Feature:Mw},exit:{Feature:Bw}},Ln={x:!1,y:!1};function xx(){return Ln.x||Ln.y}function Iw(n){return n==="x"||n==="y"?Ln[n]?null:(Ln[n]=!0,()=>{Ln[n]=!1}):Ln.x||Ln.y?null:(Ln.x=Ln.y=!0,()=>{Ln.x=Ln.y=!1})}const jh=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function ll(n,a,i,l={passive:!0}){return n.addEventListener(a,i,l),()=>n.removeEventListener(a,i)}function pl(n){return{point:{x:n.pageX,y:n.pageY}}}const zw=n=>a=>jh(a)&&n(a,pl(a));function Qo(n,a,i,l){return ll(n,a,zw(i),l)}const Sy=(n,a)=>Math.abs(n-a);function Uw(n,a){const i=Sy(n.x,a.x),l=Sy(n.y,a.y);return Math.sqrt(i**2+l**2)}class _x{constructor(a,i,{transformPagePoint:l,contextWindow:c,dragSnapToOrigin:d=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Zd(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,S=Uw(b.offset,{x:0,y:0})>=3;if(!x&&!S)return;const{point:j}=b,{timestamp:C}=zt;this.history.push({...j,timestamp:C});const{onStart:N,onMove:k}=this.handlers;x||(N&&N(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=Fd(x,this.transformPagePoint),lt.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:S,onSessionEnd:j,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=Zd(b.type==="pointercancel"?this.lastMoveEventInfo:Fd(x,this.transformPagePoint),this.history);this.startEvent&&S&&S(b,N),j&&j(b,N)},!jh(a))return;this.dragSnapToOrigin=d,this.handlers=i,this.transformPagePoint=l,this.contextWindow=c||window;const f=pl(a),m=Fd(f,this.transformPagePoint),{point:p}=m,{timestamp:v}=zt;this.history=[{...p,timestamp:v}];const{onSessionStart:g}=i;g&&g(a,Zd(m,this.history)),this.removeListeners=ml(Qo(this.contextWindow,"pointermove",this.handlePointerMove),Qo(this.contextWindow,"pointerup",this.handlePointerUp),Qo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),Za(this.updatePoint)}}function Fd(n,a){return a?{point:a(n.point)}:n}function Ty(n,a){return{x:n.x-a.x,y:n.y-a.y}}function Zd({point:n},a){return{point:n,delta:Ty(n,Sx(a)),offset:Ty(n,Vw(a)),velocity:Hw(a,.1)}}function Vw(n){return n[0]}function Sx(n){return n[n.length-1]}function Hw(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,l=null;const c=Sx(n);for(;i>=0&&(l=n[i],!(c.timestamp-l.timestamp>pa(a)));)i--;if(!l)return{x:0,y:0};const d=va(c.timestamp-l.timestamp);if(d===0)return{x:0,y:0};const f={x:(c.x-l.x)/d,y:(c.y-l.y)/d};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}const Tx=1e-4,Gw=1-Tx,Pw=1+Tx,kx=.01,$w=0-kx,qw=0+kx;function dn(n){return n.max-n.min}function Kw(n,a,i){return Math.abs(n-a)<=i}function ky(n,a,i,l=.5){n.origin=l,n.originPoint=dt(a.min,a.max,n.origin),n.scale=dn(i)/dn(a),n.translate=dt(i.min,i.max,n.origin)-n.originPoint,(n.scale>=Gw&&n.scale<=Pw||isNaN(n.scale))&&(n.scale=1),(n.translate>=$w&&n.translate<=qw||isNaN(n.translate))&&(n.translate=0)}function Wo(n,a,i,l){ky(n.x,a.x,i.x,l?l.originX:void 0),ky(n.y,a.y,i.y,l?l.originY:void 0)}function jy(n,a,i){n.min=i.min+a.min,n.max=n.min+dn(a)}function Yw(n,a,i){jy(n.x,a.x,i.x),jy(n.y,a.y,i.y)}function Ny(n,a,i){n.min=a.min-i.min,n.max=n.min+dn(a)}function Jo(n,a,i){Ny(n.x,a.x,i.x),Ny(n.y,a.y,i.y)}function Fw(n,{min:a,max:i},l){return a!==void 0&&n<a?n=l?dt(a,n,l.min):Math.max(n,a):i!==void 0&&n>i&&(n=l?dt(i,n,l.max):Math.min(n,i)),n}function Cy(n,a,i){return{min:a!==void 0?n.min+a:void 0,max:i!==void 0?n.max+i-(n.max-n.min):void 0}}function Zw(n,{top:a,left:i,bottom:l,right:c}){return{x:Cy(n.x,i,c),y:Cy(n.y,a,l)}}function wy(n,a){let i=a.min-n.min,l=a.max-n.max;return a.max-a.min<n.max-n.min&&([i,l]=[l,i]),{min:i,max:l}}function Xw(n,a){return{x:wy(n.x,a.x),y:wy(n.y,a.y)}}function Qw(n,a){let i=.5;const l=dn(n),c=dn(a);return c>l?i=Li(a.min,a.max-l,n.min):l>c&&(i=Li(n.min,n.max-c,a.min)),xa(0,1,i)}function Ww(n,a){const i={};return a.min!==void 0&&(i.min=a.min-n.min),a.max!==void 0&&(i.max=a.max-n.min),i}const Cf=.35;function Jw(n=Cf){return n===!1?n=0:n===!0&&(n=Cf),{x:Ey(n,"left","right"),y:Ey(n,"top","bottom")}}function Ey(n,a,i){return{min:Ay(n,a),max:Ay(n,i)}}function Ay(n,a){return typeof n=="number"?n:n[a]||0}const Dy=()=>({translate:0,scale:1,origin:0,originPoint:0}),wi=()=>({x:Dy(),y:Dy()}),Ry=()=>({min:0,max:0}),gt=()=>({x:Ry(),y:Ry()});function wn(n){return[n("x"),n("y")]}function jx({top:n,left:a,right:i,bottom:l}){return{x:{min:a,max:i},y:{min:n,max:l}}}function eE({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function tE(n,a){if(!a)return n;const i=a({x:n.left,y:n.top}),l=a({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:l.y,right:l.x}}function Xd(n){return n===void 0||n===1}function wf({scale:n,scaleX:a,scaleY:i}){return!Xd(n)||!Xd(a)||!Xd(i)}function Ss(n){return wf(n)||Nx(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Nx(n){return My(n.x)||My(n.y)}function My(n){return n&&n!=="0%"}function lc(n,a,i){const l=n-i,c=a*l;return i+c}function Oy(n,a,i,l,c){return c!==void 0&&(n=lc(n,c,l)),lc(n,i,l)+a}function Ef(n,a=0,i=1,l,c){n.min=Oy(n.min,a,i,l,c),n.max=Oy(n.max,a,i,l,c)}function Cx(n,{x:a,y:i}){Ef(n.x,a.translate,a.scale,a.originPoint),Ef(n.y,i.translate,i.scale,i.originPoint)}const By=.999999999999,Ly=1.0000000000001;function nE(n,a,i,l=!1){const c=i.length;if(!c)return;a.x=a.y=1;let d,f;for(let m=0;m<c;m++){d=i[m],f=d.projectionDelta;const{visualElement:p}=d.options;p&&p.props.style&&p.props.style.display==="contents"||(l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Ai(n,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),f&&(a.x*=f.x.scale,a.y*=f.y.scale,Cx(n,f)),l&&Ss(d.latestValues)&&Ai(n,d.latestValues))}a.x<Ly&&a.x>By&&(a.x=1),a.y<Ly&&a.y>By&&(a.y=1)}function Ei(n,a){n.min=n.min+a,n.max=n.max+a}function Iy(n,a,i,l,c=.5){const d=dt(n.min,n.max,c);Ef(n,a,i,d,l)}function Ai(n,a){Iy(n.x,a.x,a.scaleX,a.scale,a.originX),Iy(n.y,a.y,a.scaleY,a.scale,a.originY)}function wx(n,a){return jx(tE(n.getBoundingClientRect(),a))}function aE(n,a,i){const l=wx(n,i),{scroll:c}=a;return c&&(Ei(l.x,c.offset.x),Ei(l.y,c.offset.y)),l}const Ex=({current:n})=>n?n.ownerDocument.defaultView:null,sE=new WeakMap;class iE{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=gt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const c=g=>{const{dragSnapToOrigin:b}=this.getProps();b?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(pl(g).point)},d=(g,b)=>{const{drag:x,dragPropagation:S,onDragStart:j}=this.getProps();if(x&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Iw(x),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),wn(N=>{let k=this.getAxisMotionValue(N).get()||0;if(qn.test(k)){const{projection:w}=this.visualElement;if(w&&w.layout){const A=w.layout.layoutBox[N];A&&(k=dn(A)*(parseFloat(k)/100))}}this.originPoint[N]=k}),j&&lt.postRender(()=>j(g,b)),gf(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},f=(g,b)=>{const{dragPropagation:x,dragDirectionLock:S,onDirectionLock:j,onDrag:C}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:N}=b;if(S&&this.currentDirection===null){this.currentDirection=oE(N),this.currentDirection!==null&&j&&j(this.currentDirection);return}this.updateAxis("x",b.point,N),this.updateAxis("y",b.point,N),this.visualElement.render(),C&&C(g,b)},m=(g,b)=>this.stop(g,b),p=()=>wn(g=>{var b;return this.getAnimationState(g)==="paused"&&((b=this.getAxisMotionValue(g).animation)===null||b===void 0?void 0:b.play())}),{dragSnapToOrigin:v}=this.getProps();this.panSession=new _x(a,{onSessionStart:c,onStart:d,onMove:f,onSessionEnd:m,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:v,contextWindow:Ex(this.visualElement)})}stop(a,i){const l=this.isDragging;if(this.cancel(),!l)return;const{velocity:c}=i;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&lt.postRender(()=>d(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:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,l){const{drag:c}=this.getProps();if(!l||!Hr(a,c,this.currentDirection))return;const d=this.getAxisMotionValue(a);let f=this.originPoint[a]+l[a];this.constraints&&this.constraints[a]&&(f=Fw(f,this.constraints[a],this.elastic[a])),d.set(f)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:l}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,d=this.constraints;i&&Ni(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&c?this.constraints=Zw(c.layoutBox,i):this.constraints=!1,this.elastic=Jw(l),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&wn(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=Ww(c.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Ni(a))return!1;const l=a.current,{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=aE(l,c.root,this.visualElement.getTransformPagePoint());let f=Xw(c.layout.layoutBox,d);if(i){const m=i(eE(f));this.hasMutatedConstraints=!!m,m&&(f=jx(m))}return f}startAnimation(a){const{drag:i,dragMomentum:l,dragElastic:c,dragTransition:d,dragSnapToOrigin:f,onDragTransitionEnd:m}=this.getProps(),p=this.constraints||{},v=wn(g=>{if(!Hr(g,i,this.currentDirection))return;let b=p&&p[g]||{};f&&(b={min:0,max:0});const x=c?200:1e6,S=c?40:1e7,j={type:"inertia",velocity:l?a[g]:0,bounceStiffness:x,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...d,...b};return this.startAxisValueAnimation(g,j)});return Promise.all(v).then(m)}startAxisValueAnimation(a,i){const l=this.getAxisMotionValue(a);return gf(this.visualElement,a),l.start(kh(a,l,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()}`,l=this.visualElement.getProps(),c=l[i];return c||this.visualElement.getValue(a,(l.initial?l.initial[a]:void 0)||0)}snapToCursor(a){wn(i=>{const{drag:l}=this.getProps();if(!Hr(i,l,this.currentDirection))return;const{projection:c}=this.visualElement,d=this.getAxisMotionValue(i);if(c&&c.layout){const{min:f,max:m}=c.layout.layoutBox[i];d.set(a[i]-dt(f,m,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:l}=this.visualElement;if(!Ni(i)||!l||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};wn(f=>{const m=this.getAxisMotionValue(f);if(m&&this.constraints!==!1){const p=m.get();c[f]=Qw({min:p,max:p},this.constraints[f])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.resolveConstraints(),wn(f=>{if(!Hr(f,a,null))return;const m=this.getAxisMotionValue(f),{min:p,max:v}=this.constraints[f];m.set(dt(p,v,c[f]))})}addListeners(){if(!this.visualElement.current)return;sE.set(this.visualElement,this);const a=this.visualElement.current,i=Qo(a,"pointerdown",p=>{const{drag:v,dragListener:g=!0}=this.getProps();v&&g&&this.start(p)}),l=()=>{const{dragConstraints:p}=this.getProps();Ni(p)&&p.current&&(this.constraints=this.resolveRefConstraints())},{projection:c}=this.visualElement,d=c.addEventListener("measure",l);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),lt.read(l);const f=ll(window,"resize",()=>this.scalePositionWithinConstraints()),m=c.addEventListener("didUpdate",(({delta:p,hasLayoutChanged:v})=>{this.isDragging&&v&&(wn(g=>{const b=this.getAxisMotionValue(g);b&&(this.originPoint[g]+=p[g].translate,b.set(b.get()+p[g].translate))}),this.visualElement.render())}));return()=>{f(),i(),d(),m&&m()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:l=!1,dragPropagation:c=!1,dragConstraints:d=!1,dragElastic:f=Cf,dragMomentum:m=!0}=a;return{...a,drag:i,dragDirectionLock:l,dragPropagation:c,dragConstraints:d,dragElastic:f,dragMomentum:m}}}function Hr(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function oE(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class lE extends Ja{constructor(a){super(a),this.removeGroupControls=un,this.removeListeners=un,this.controls=new iE(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||un}unmount(){this.removeGroupControls(),this.removeListeners()}}const zy=n=>(a,i)=>{n&&lt.postRender(()=>n(a,i))};class rE extends Ja{constructor(){super(...arguments),this.removePointerDownListener=un}onPointerDown(a){this.session=new _x(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ex(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:l,onPanEnd:c}=this.node.getProps();return{onSessionStart:zy(a),onStart:zy(i),onMove:l,onEnd:(d,f)=>{delete this.session,c&&lt.postRender(()=>c(d,f))}}}mount(){this.removePointerDownListener=Qo(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 Qr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Uy(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Vo={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(ye.test(n))n=parseFloat(n);else return n;const i=Uy(n,a.target.x),l=Uy(n,a.target.y);return`${i}% ${l}%`}},cE={correct:(n,{treeScale:a,projectionDelta:i})=>{const l=n,c=Xa.parse(n);if(c.length>5)return l;const d=Xa.createTransformer(n),f=typeof c[0]!="number"?1:0,m=i.x.scale*a.x,p=i.y.scale*a.y;c[0+f]/=m,c[1+f]/=p;const v=dt(m,p,.5);return typeof c[2+f]=="number"&&(c[2+f]/=v),typeof c[3+f]=="number"&&(c[3+f]/=v),d(c)}};class uE extends y.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l,layoutId:c}=this.props,{projection:d}=a;LN(dE),d&&(i.group&&i.group.add(d),l&&l.register&&c&&l.register(d),d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,onExitComplete:()=>this.safeToRemove()})),Qr.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:l,drag:c,isPresent:d}=this.props,f=l.projection;return f&&(f.isPresent=d,c||a.layoutDependency!==i||i===void 0?f.willUpdate():this.safeToRemove(),a.isPresent!==d&&(d?f.promote():f.relegate()||lt.postRender(()=>{const m=f.getStack();(!m||!m.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),Jf.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l}=this.props,{projection:c}=a;c&&(c.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(c),l&&l.deregister&&l.deregister(c))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function Ax(n){const[a,i]=mb(),l=y.useContext(Kf);return r.jsx(uE,{...n,layoutGroup:l,switchLayoutGroup:y.useContext(Sb),isPresent:a,safeToRemove:i})}const dE={borderRadius:{...Vo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vo,borderTopRightRadius:Vo,borderBottomLeftRadius:Vo,borderBottomRightRadius:Vo,boxShadow:cE};function fE(n,a,i){const l=Ht(n)?n:il(n);return l.start(kh("",l,a,i)),l.animation}function hE(n){return n instanceof SVGElement&&n.tagName!=="svg"}const mE=(n,a)=>n.depth-a.depth;class pE{constructor(){this.children=[],this.isDirty=!1}add(a){uh(this.children,a),this.isDirty=!0}remove(a){dh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(mE),this.isDirty=!1,this.children.forEach(a)}}function vE(n,a){const i=Kn.now(),l=({timestamp:c})=>{const d=c-i;d>=a&&(Za(l),n(d-a))};return lt.read(l,!0),()=>Za(l)}const Dx=["TopLeft","TopRight","BottomLeft","BottomRight"],gE=Dx.length,Vy=n=>typeof n=="string"?parseFloat(n):n,Hy=n=>typeof n=="number"||ye.test(n);function yE(n,a,i,l,c,d){c?(n.opacity=dt(0,i.opacity!==void 0?i.opacity:1,bE(l)),n.opacityExit=dt(a.opacity!==void 0?a.opacity:1,0,xE(l))):d&&(n.opacity=dt(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,l));for(let f=0;f<gE;f++){const m=`border${Dx[f]}Radius`;let p=Gy(a,m),v=Gy(i,m);if(p===void 0&&v===void 0)continue;p||(p=0),v||(v=0),p===0||v===0||Hy(p)===Hy(v)?(n[m]=Math.max(dt(Vy(p),Vy(v),l),0),(qn.test(v)||qn.test(p))&&(n[m]+="%")):n[m]=v}(a.rotate||i.rotate)&&(n.rotate=dt(a.rotate||0,i.rotate||0,l))}function Gy(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const bE=Rx(0,.5,Fb),xE=Rx(.5,.95,un);function Rx(n,a,i){return l=>l<n?0:l>a?1:i(Li(n,a,l))}function Py(n,a){n.min=a.min,n.max=a.max}function Nn(n,a){Py(n.x,a.x),Py(n.y,a.y)}function $y(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function qy(n,a,i,l,c){return n-=a,n=lc(n,1/i,l),c!==void 0&&(n=lc(n,1/c,l)),n}function _E(n,a=0,i=1,l=.5,c,d=n,f=n){if(qn.test(a)&&(a=parseFloat(a),a=dt(f.min,f.max,a/100)-f.min),typeof a!="number")return;let m=dt(d.min,d.max,l);n===d&&(m-=a),n.min=qy(n.min,a,i,m,c),n.max=qy(n.max,a,i,m,c)}function Ky(n,a,[i,l,c],d,f){_E(n,a[i],a[l],a[c],a.scale,d,f)}const SE=["x","scaleX","originX"],TE=["y","scaleY","originY"];function Yy(n,a,i,l){Ky(n.x,a,SE,i?i.x:void 0,l?l.x:void 0),Ky(n.y,a,TE,i?i.y:void 0,l?l.y:void 0)}function Fy(n){return n.translate===0&&n.scale===1}function Mx(n){return Fy(n.x)&&Fy(n.y)}function Zy(n,a){return n.min===a.min&&n.max===a.max}function kE(n,a){return Zy(n.x,a.x)&&Zy(n.y,a.y)}function Xy(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function Ox(n,a){return Xy(n.x,a.x)&&Xy(n.y,a.y)}function Qy(n){return dn(n.x)/dn(n.y)}function Wy(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class jE{constructor(){this.members=[]}add(a){uh(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(c=>a===c);if(i===0)return!1;let l;for(let c=i;c>=0;c--){const d=this.members[c];if(d.isPresent!==!1){l=d;break}}return l?(this.promote(l),!0):!1}promote(a,i){const l=this.lead;if(a!==l&&(this.prevLead=l,this.lead=a,a.show(),l)){l.instance&&l.scheduleRender(),a.scheduleRender(),a.resumeFrom=l,i&&(a.resumeFrom.preserveOpacity=!0),l.snapshot&&(a.snapshot=l.snapshot,a.snapshot.latestValues=l.animationValues||l.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:c}=a.options;c===!1&&l.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:l}=a;i.onExitComplete&&i.onExitComplete(),l&&l.options.onExitComplete&&l.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function NE(n,a,i){let l="";const c=n.x.translate/a.x,d=n.y.translate/a.y,f=(i==null?void 0:i.z)||0;if((c||d||f)&&(l=`translate3d(${c}px, ${d}px, ${f}px) `),(a.x!==1||a.y!==1)&&(l+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:v,rotate:g,rotateX:b,rotateY:x,skewX:S,skewY:j}=i;v&&(l=`perspective(${v}px) ${l}`),g&&(l+=`rotate(${g}deg) `),b&&(l+=`rotateX(${b}deg) `),x&&(l+=`rotateY(${x}deg) `),S&&(l+=`skewX(${S}deg) `),j&&(l+=`skewY(${j}deg) `)}const m=n.x.scale*a.x,p=n.y.scale*a.y;return(m!==1||p!==1)&&(l+=`scale(${m}, ${p})`),l||"none"}const Ts={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},$o=typeof window<"u"&&window.MotionDebug!==void 0,Qd=["","X","Y","Z"],CE={visibility:"hidden"},Jy=1e3;let wE=0;function Wd(n,a,i,l){const{latestValues:c}=a;c[n]&&(i[n]=c[n],a.setStaticValue(n,0),l&&(l[n]=0))}function Bx(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=zb(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:c,layoutId:d}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",lt,!(c||d))}const{parent:l}=n;l&&!l.hasCheckedOptimisedAppear&&Bx(l)}function Lx({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:l,resetTransform:c}){return class{constructor(f={},m=a==null?void 0:a()){this.id=wE++,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,$o&&(Ts.totalNodes=Ts.resolvedTargetDeltas=Ts.recalculatedProjection=0),this.nodes.forEach(DE),this.nodes.forEach(LE),this.nodes.forEach(IE),this.nodes.forEach(RE),$o&&window.MotionDebug.record(Ts)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,this.root=m?m.root||m:this,this.path=m?[...m.path,m]:[],this.parent=m,this.depth=m?m.depth+1:0;for(let p=0;p<this.path.length;p++)this.path[p].shouldResetTransform=!0;this.root===this&&(this.nodes=new pE)}addEventListener(f,m){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new fh),this.eventHandlers.get(f).add(m)}notifyListeners(f,...m){const p=this.eventHandlers.get(f);p&&p.notify(...m)}hasListeners(f){return this.eventHandlers.has(f)}mount(f,m=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=hE(f),this.instance=f;const{layoutId:p,layout:v,visualElement:g}=this.options;if(g&&!g.current&&g.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),m&&(v||p)&&(this.isLayoutDirty=!0),n){let b;const x=()=>this.root.updateBlockedByResize=!1;n(f,()=>{this.root.updateBlockedByResize=!0,b&&b(),b=vE(x,250),Qr.hasAnimatedSinceResize&&(Qr.hasAnimatedSinceResize=!1,this.nodes.forEach(t0))})}p&&this.root.registerSharedNode(p,this),this.options.animate!==!1&&g&&(p||v)&&this.addEventListener("didUpdate",({delta:b,hasLayoutChanged:x,hasRelativeTargetChanged:S,layout:j})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const C=this.options.transition||g.getDefaultTransition()||GE,{onLayoutAnimationStart:N,onLayoutAnimationComplete:k}=g.getProps(),w=!this.targetLayout||!Ox(this.targetLayout,j)||S,A=!x&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||x&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(b,A);const R={...ch(C,"layout"),onPlay:N,onComplete:k};(g.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R)}else x||t0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=j})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Za(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(zE),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Bx(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const b=this.path[g];b.shouldResetTransform=!0,b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}const{layoutId:m,layout:p}=this.options;if(m===void 0&&!p)return;const v=this.getTransformTemplate();this.prevTransformTemplateValue=v?v(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(e0);return}this.isUpdating||this.nodes.forEach(OE),this.isUpdating=!1,this.nodes.forEach(BE),this.nodes.forEach(EE),this.nodes.forEach(AE),this.clearAllSnapshots();const m=Kn.now();zt.delta=xa(0,1e3/60,m-zt.timestamp),zt.timestamp=m,zt.isProcessing=!0,Pd.update.process(zt),Pd.preRender.process(zt),Pd.render.process(zt),zt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Jf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ME),this.sharedNodes.forEach(UE)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,lt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){lt.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 p=0;p<this.path.length;p++)this.path[p].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutCorrected=gt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:m}=this.options;m&&m.notify("LayoutMeasure",this.layout.layoutBox,f?f.layoutBox:void 0)}updateScroll(f="measure"){let m=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(m=!1),m){const p=l(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:p,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:p}}}resetTransform(){if(!c)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,m=this.projectionDelta&&!Mx(this.projectionDelta),p=this.getTransformTemplate(),v=p?p(this.latestValues,""):void 0,g=v!==this.prevTransformTemplateValue;f&&(m||Ss(this.latestValues)||g)&&(c(this.instance,v),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const m=this.measurePageBox();let p=this.removeElementScroll(m);return f&&(p=this.removeTransform(p)),PE(p),{animationId:this.root.animationId,measuredBox:m,layoutBox:p,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:m}=this.options;if(!m)return gt();const p=m.measureViewportBox();if(!(((f=this.scroll)===null||f===void 0?void 0:f.wasRoot)||this.path.some($E))){const{scroll:g}=this.root;g&&(Ei(p.x,g.offset.x),Ei(p.y,g.offset.y))}return p}removeElementScroll(f){var m;const p=gt();if(Nn(p,f),!((m=this.scroll)===null||m===void 0)&&m.wasRoot)return p;for(let v=0;v<this.path.length;v++){const g=this.path[v],{scroll:b,options:x}=g;g!==this.root&&b&&x.layoutScroll&&(b.wasRoot&&Nn(p,f),Ei(p.x,b.offset.x),Ei(p.y,b.offset.y))}return p}applyTransform(f,m=!1){const p=gt();Nn(p,f);for(let v=0;v<this.path.length;v++){const g=this.path[v];!m&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Ai(p,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),Ss(g.latestValues)&&Ai(p,g.latestValues)}return Ss(this.latestValues)&&Ai(p,this.latestValues),p}removeTransform(f){const m=gt();Nn(m,f);for(let p=0;p<this.path.length;p++){const v=this.path[p];if(!v.instance||!Ss(v.latestValues))continue;wf(v.latestValues)&&v.updateSnapshot();const g=gt(),b=v.measurePageBox();Nn(g,b),Yy(m,v.latestValues,v.snapshot?v.snapshot.layoutBox:void 0,g)}return Ss(this.latestValues)&&Yy(m,this.latestValues),m}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==zt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){var m;const p=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=p.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=p.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=p.isSharedProjectionDirty);const v=!!this.resumingFrom||this!==p;if(!(f||v&&this.isSharedProjectionDirty||this.isProjectionDirty||!((m=this.parent)===null||m===void 0)&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:b,layoutId:x}=this.options;if(!(!this.layout||!(b||x))){if(this.resolvedRelativeTargetAt=zt.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=gt(),this.relativeTargetOrigin=gt(),Jo(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=gt(),this.targetWithTransforms=gt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Yw(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Nn(this.target,this.layout.layoutBox),Cx(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=gt(),this.relativeTargetOrigin=gt(),Jo(this.relativeTargetOrigin,this.target,S.target),Nn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}$o&&Ts.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||wf(this.parent.latestValues)||Nx(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var f;const m=this.getLead(),p=!!this.resumingFrom||this!==m;let v=!0;if((this.isProjectionDirty||!((f=this.parent)===null||f===void 0)&&f.isProjectionDirty)&&(v=!1),p&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(v=!1),this.resolvedRelativeTargetAt===zt.timestamp&&(v=!1),v)return;const{layout:g,layoutId:b}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(g||b))return;Nn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,S=this.treeScale.y;nE(this.layoutCorrected,this.treeScale,this.path,p),m.layout&&!m.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(m.target=m.layout.layoutBox,m.targetWithTransforms=gt());const{target:j}=m;if(!j){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():($y(this.prevProjectionDelta.x,this.projectionDelta.x),$y(this.prevProjectionDelta.y,this.projectionDelta.y)),Wo(this.projectionDelta,this.layoutCorrected,j,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==S||!Wy(this.projectionDelta.x,this.prevProjectionDelta.x)||!Wy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",j)),$o&&Ts.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){var m;if((m=this.options.visualElement)===null||m===void 0||m.scheduleRender(),f){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=wi(),this.projectionDelta=wi(),this.projectionDeltaWithTransform=wi()}setAnimationOrigin(f,m=!1){const p=this.snapshot,v=p?p.latestValues:{},g={...this.latestValues},b=wi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!m;const x=gt(),S=p?p.source:void 0,j=this.layout?this.layout.source:void 0,C=S!==j,N=this.getStack(),k=!N||N.members.length<=1,w=!!(C&&!k&&this.options.crossfade===!0&&!this.path.some(HE));this.animationProgress=0;let A;this.mixTargetDelta=R=>{const E=R/1e3;n0(b.x,f.x,E),n0(b.y,f.y,E),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Jo(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),VE(this.relativeTarget,this.relativeTargetOrigin,x,E),A&&kE(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=gt()),Nn(A,this.relativeTarget)),C&&(this.animationValues=g,yE(g,v,this.latestValues,E,w,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Za(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=lt.update(()=>{Qr.hasAnimatedSinceResize=!0,this.currentAnimation=fE(0,Jy,{...f,onUpdate:m=>{this.mixTargetDelta(m),f.onUpdate&&f.onUpdate(m)},onComplete:()=>{f.onComplete&&f.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Jy),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:m,target:p,layout:v,latestValues:g}=f;if(!(!m||!p||!v)){if(this!==f&&this.layout&&v&&Ix(this.options.animationType,this.layout.layoutBox,v.layoutBox)){p=this.target||gt();const b=dn(this.layout.layoutBox.x);p.x.min=f.target.x.min,p.x.max=p.x.min+b;const x=dn(this.layout.layoutBox.y);p.y.min=f.target.y.min,p.y.max=p.y.min+x}Nn(m,p),Ai(m,g),Wo(this.projectionDeltaWithTransform,this.layoutCorrected,m,g)}}registerSharedNode(f,m){this.sharedNodes.has(f)||this.sharedNodes.set(f,new jE),this.sharedNodes.get(f).add(m);const v=m.options.initialPromotionConfig;m.promote({transition:v?v.transition:void 0,preserveFollowOpacity:v&&v.shouldPreserveFollowOpacity?v.shouldPreserveFollowOpacity(m):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){var f;const{layoutId:m}=this.options;return m?((f=this.getStack())===null||f===void 0?void 0:f.lead)||this:this}getPrevLead(){var f;const{layoutId:m}=this.options;return m?(f=this.getStack())===null||f===void 0?void 0:f.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:m,preserveFollowOpacity:p}={}){const v=this.getStack();v&&v.promote(this,p),f&&(this.projectionDelta=void 0,this.needsReset=!0),m&&this.setOptions({transition:m})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let m=!1;const{latestValues:p}=f;if((p.z||p.rotate||p.rotateX||p.rotateY||p.rotateZ||p.skewX||p.skewY)&&(m=!0),!m)return;const v={};p.z&&Wd("z",f,v,this.animationValues);for(let g=0;g<Qd.length;g++)Wd(`rotate${Qd[g]}`,f,v,this.animationValues),Wd(`skew${Qd[g]}`,f,v,this.animationValues);f.render();for(const g in v)f.setStaticValue(g,v[g]),this.animationValues&&(this.animationValues[g]=v[g]);f.scheduleRender()}getProjectionStyles(f){var m,p;if(!this.instance||this.isSVG)return;if(!this.isVisible)return CE;const v={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,v.opacity="",v.pointerEvents=Zr(f==null?void 0:f.pointerEvents)||"",v.transform=g?g(this.latestValues,""):"none",v;const b=this.getLead();if(!this.projectionDelta||!this.layout||!b.target){const C={};return this.options.layoutId&&(C.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,C.pointerEvents=Zr(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!Ss(this.latestValues)&&(C.transform=g?g({},""):"none",this.hasProjected=!1),C}const x=b.animationValues||b.latestValues;this.applyTransformsToTarget(),v.transform=NE(this.projectionDeltaWithTransform,this.treeScale,x),g&&(v.transform=g(x,v.transform));const{x:S,y:j}=this.projectionDelta;v.transformOrigin=`${S.origin*100}% ${j.origin*100}% 0`,b.animationValues?v.opacity=b===this?(p=(m=x.opacity)!==null&&m!==void 0?m:this.latestValues.opacity)!==null&&p!==void 0?p:1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:v.opacity=b===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const C in nc){if(x[C]===void 0)continue;const{correct:N,applyTo:k}=nc[C],w=v.transform==="none"?x[C]:N(x[C],b);if(k){const A=k.length;for(let R=0;R<A;R++)v[k[R]]=w}else v[C]=w}return this.options.layoutId&&(v.pointerEvents=b===this?Zr(f==null?void 0:f.pointerEvents)||"":"none"),v}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>{var m;return(m=f.currentAnimation)===null||m===void 0?void 0:m.stop()}),this.root.nodes.forEach(e0),this.root.sharedNodes.clear()}}}function EE(n){n.updateLayout()}function AE(n){var a;const i=((a=n.resumeFrom)===null||a===void 0?void 0:a.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&i&&n.hasListeners("didUpdate")){const{layoutBox:l,measuredBox:c}=n.layout,{animationType:d}=n.options,f=i.source!==n.layout.source;d==="size"?wn(b=>{const x=f?i.measuredBox[b]:i.layoutBox[b],S=dn(x);x.min=l[b].min,x.max=x.min+S}):Ix(d,i.layoutBox,l)&&wn(b=>{const x=f?i.measuredBox[b]:i.layoutBox[b],S=dn(l[b]);x.max=x.min+S,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[b].max=n.relativeTarget[b].min+S)});const m=wi();Wo(m,l,i.layoutBox);const p=wi();f?Wo(p,n.applyTransform(c,!0),i.measuredBox):Wo(p,l,i.layoutBox);const v=!Mx(m);let g=!1;if(!n.resumeFrom){const b=n.getClosestProjectingParent();if(b&&!b.resumeFrom){const{snapshot:x,layout:S}=b;if(x&&S){const j=gt();Jo(j,i.layoutBox,x.layoutBox);const C=gt();Jo(C,l,S.layoutBox),Ox(j,C)||(g=!0),b.options.layoutRoot&&(n.relativeTarget=C,n.relativeTargetOrigin=j,n.relativeParent=b)}}}n.notifyListeners("didUpdate",{layout:l,snapshot:i,delta:p,layoutDelta:m,hasLayoutChanged:v,hasRelativeTargetChanged:g})}else if(n.isLead()){const{onExitComplete:l}=n.options;l&&l()}n.options.transition=void 0}function DE(n){$o&&Ts.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function RE(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function ME(n){n.clearSnapshot()}function e0(n){n.clearMeasurements()}function OE(n){n.isLayoutDirty=!1}function BE(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function t0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function LE(n){n.resolveTargetDelta()}function IE(n){n.calcProjection()}function zE(n){n.resetSkewAndRotation()}function UE(n){n.removeLeadSnapshot()}function n0(n,a,i){n.translate=dt(a.translate,0,i),n.scale=dt(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function a0(n,a,i,l){n.min=dt(a.min,i.min,l),n.max=dt(a.max,i.max,l)}function VE(n,a,i,l){a0(n.x,a.x,i.x,l),a0(n.y,a.y,i.y,l)}function HE(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const GE={duration:.45,ease:[.4,0,.1,1]},s0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),i0=s0("applewebkit/")&&!s0("chrome/")?Math.round:un;function o0(n){n.min=i0(n.min),n.max=i0(n.max)}function PE(n){o0(n.x),o0(n.y)}function Ix(n,a,i){return n==="position"||n==="preserve-aspect"&&!Kw(Qy(a),Qy(i),.2)}function $E(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const qE=Lx({attachResizeListener:(n,a)=>ll(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Jd={current:void 0},zx=Lx({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!Jd.current){const n=new qE({});n.mount(window),n.setOptions({layoutScroll:!0}),Jd.current=n}return Jd.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),KE={pan:{Feature:rE},drag:{Feature:lE,ProjectionNode:zx,MeasureLayout:Ax}};function YE(n,a,i){var l;if(n instanceof Element)return[n];if(typeof n=="string"){let c=document;const d=(l=void 0)!==null&&l!==void 0?l:c.querySelectorAll(n);return d?Array.from(d):[]}return Array.from(n)}function Ux(n,a){const i=YE(n),l=new AbortController,c={passive:!0,...a,signal:l.signal};return[i,c,()=>l.abort()]}function l0(n){return a=>{a.pointerType==="touch"||xx()||n(a)}}function FE(n,a,i={}){const[l,c,d]=Ux(n,i),f=l0(m=>{const{target:p}=m,v=a(m);if(typeof v!="function"||!p)return;const g=l0(b=>{v(b),p.removeEventListener("pointerleave",g)});p.addEventListener("pointerleave",g,c)});return l.forEach(m=>{m.addEventListener("pointerenter",f,c)}),d}function r0(n,a,i){const{props:l}=n;n.animationState&&l.whileHover&&n.animationState.setActive("whileHover",i==="Start");const c="onHover"+i,d=l[c];d&&lt.postRender(()=>d(a,pl(a)))}class ZE extends Ja{mount(){const{current:a}=this.node;a&&(this.unmount=FE(a,i=>(r0(this.node,i,"Start"),l=>r0(this.node,l,"End"))))}unmount(){}}class XE extends Ja{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=ml(ll(this.node.current,"focus",()=>this.onFocus()),ll(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Vx=(n,a)=>a?n===a?!0:Vx(n,a.parentElement):!1,QE=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function WE(n){return QE.has(n.tagName)||n.tabIndex!==-1}const qo=new WeakSet;function c0(n){return a=>{a.key==="Enter"&&n(a)}}function ef(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const JE=(n,a)=>{const i=n.currentTarget;if(!i)return;const l=c0(()=>{if(qo.has(i))return;ef(i,"down");const c=c0(()=>{ef(i,"up")}),d=()=>ef(i,"cancel");i.addEventListener("keyup",c,a),i.addEventListener("blur",d,a)});i.addEventListener("keydown",l,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",l),a)};function u0(n){return jh(n)&&!xx()}function e2(n,a,i={}){const[l,c,d]=Ux(n,i),f=m=>{const p=m.currentTarget;if(!u0(m)||qo.has(p))return;qo.add(p);const v=a(m),g=(S,j)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",x),!(!u0(S)||!qo.has(p))&&(qo.delete(p),typeof v=="function"&&v(S,{success:j}))},b=S=>{g(S,i.useGlobalTarget||Vx(p,S.target))},x=S=>{g(S,!1)};window.addEventListener("pointerup",b,c),window.addEventListener("pointercancel",x,c)};return l.forEach(m=>{!WE(m)&&m.getAttribute("tabindex")===null&&(m.tabIndex=0),(i.useGlobalTarget?window:m).addEventListener("pointerdown",f,c),m.addEventListener("focus",v=>JE(v,c),c)}),d}function d0(n,a,i){const{props:l}=n;n.animationState&&l.whileTap&&n.animationState.setActive("whileTap",i==="Start");const c="onTap"+(i==="End"?"":i),d=l[c];d&&lt.postRender(()=>d(a,pl(a)))}class t2 extends Ja{mount(){const{current:a}=this.node;a&&(this.unmount=e2(a,i=>(d0(this.node,i,"Start"),(l,{success:c})=>d0(this.node,l,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Af=new WeakMap,tf=new WeakMap,n2=n=>{const a=Af.get(n.target);a&&a(n)},a2=n=>{n.forEach(n2)};function s2({root:n,...a}){const i=n||document;tf.has(i)||tf.set(i,{});const l=tf.get(i),c=JSON.stringify(a);return l[c]||(l[c]=new IntersectionObserver(a2,{root:n,...a})),l[c]}function i2(n,a,i){const l=s2(a);return Af.set(n,i),l.observe(n),()=>{Af.delete(n),l.unobserve(n)}}const o2={some:0,all:1};class l2 extends Ja{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:l,amount:c="some",once:d}=a,f={root:i?i.current:void 0,rootMargin:l,threshold:typeof c=="number"?c:o2[c]},m=p=>{const{isIntersecting:v}=p;if(this.isInView===v||(this.isInView=v,d&&!v&&this.hasEnteredView))return;v&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",v);const{onViewportEnter:g,onViewportLeave:b}=this.node.getProps(),x=v?g:b;x&&x(p)};return i2(this.node.current,f,m)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(r2(a,i))&&this.startObserver()}unmount(){}}function r2({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const c2={inView:{Feature:l2},tap:{Feature:t2},focus:{Feature:XE},hover:{Feature:ZE}},u2={layout:{ProjectionNode:zx,MeasureLayout:Ax}},rc={current:null},Nh={current:!1};function Hx(){if(Nh.current=!0,!!Zf)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>rc.current=n.matches;n.addListener(a),a()}else rc.current=!1}const d2=[...rx,Vt,Xa],f2=n=>d2.find(lx(n)),f0=new WeakMap;function h2(n,a,i){for(const l in a){const c=a[l],d=i[l];if(Ht(c))n.addValue(l,c);else if(Ht(d))n.addValue(l,il(c,{owner:n}));else if(d!==c)if(n.hasValue(l)){const f=n.getValue(l);f.liveStyle===!0?f.jump(c):f.hasAnimated||f.set(c)}else{const f=n.getStaticValue(l);n.addValue(l,il(f!==void 0?f:c,{owner:n}))}}for(const l in i)a[l]===void 0&&n.removeValue(l);return a}const h0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class m2{scrapeMotionValuesFromProps(a,i,l){return{}}constructor({parent:a,props:i,presenceContext:l,reducedMotionConfig:c,blockInitialAnimation:d,visualState:f},m={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=_h,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=Kn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,lt.render(this.render,!1,!0))};const{latestValues:p,renderState:v,onUpdate:g}=f;this.onUpdate=g,this.latestValues=p,this.baseTarget={...p},this.initialValues=i.initial?{...p}:{},this.renderState=v,this.parent=a,this.props=i,this.presenceContext=l,this.depth=a?a.depth+1:0,this.reducedMotionConfig=c,this.options=m,this.blockInitialAnimation=!!d,this.isControllingVariants=bc(i),this.isVariantNode=xb(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:b,...x}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in x){const j=x[S];p[S]!==void 0&&Ht(j)&&j.set(p[S],!1)}}mount(a){this.current=a,f0.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,l)=>this.bindToMotionValue(l,i)),Nh.current||Hx(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:rc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){f0.delete(this.current),this.projection&&this.projection.unmount(),Za(this.notifyUpdate),Za(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 l=Ms.has(a),c=i.on("change",m=>{this.latestValues[a]=m,this.props.onUpdate&&lt.preRender(this.notifyUpdate),l&&this.projection&&(this.projection.isTransformDirty=!0)}),d=i.on("renderRequest",this.scheduleRender);let f;window.MotionCheckAppearSync&&(f=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{c(),d(),f&&f(),i.owner&&i.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in Bi){const i=Bi[a];if(!i)continue;const{isEnabled:l,Feature:c}=i;if(!this.features[a]&&c&&l(this.props)&&(this.features[a]=new c(this)),this.features[a]){const d=this.features[a];d.isMounted?d.update():(d.mount(),d.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):gt()}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 l=0;l<h0.length;l++){const c=h0[l];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);const d="on"+c,f=a[d];f&&(this.propEventSubscriptions[c]=this.on(c,f))}this.prevMotionValues=h2(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 l=this.values.get(a);i!==l&&(l&&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 l=this.values.get(a);return l===void 0&&i!==void 0&&(l=il(i===null?void 0:i,{owner:this}),this.addValue(a,l)),l}readValue(a,i){var l;let c=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(l=this.getBaseTargetFromProps(this.props,a))!==null&&l!==void 0?l:this.readValueFromInstance(this.current,a,this.options);return c!=null&&(typeof c=="string"&&(ix(c)||Xb(c))?c=parseFloat(c):!f2(c)&&Xa.test(i)&&(c=nx(a,i)),this.setBaseTarget(a,Ht(c)?c.get():c)),Ht(c)?c.get():c}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:l}=this.props;let c;if(typeof l=="string"||typeof l=="object"){const f=th(this.props,l,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);f&&(c=f[a])}if(l&&c!==void 0)return c;const d=this.getBaseTargetFromProps(this.props,a);return d!==void 0&&!Ht(d)?d:this.initialValues[a]!==void 0&&c===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new fh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class Gx extends m2{constructor(){super(...arguments),this.KeyframeResolver=cx}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:l}){delete i[a],delete l[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Ht(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function p2(n){return window.getComputedStyle(n)}class v2 extends Gx{constructor(){super(...arguments),this.type="html",this.renderInstance=Eb}readValueFromInstance(a,i){if(Ms.has(i)){const l=xh(i);return l&&l.default||0}else{const l=p2(a),c=(Nb(i)?l.getPropertyValue(i):l[i])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(a,{transformPagePoint:i}){return wx(a,i)}build(a,i,l){sh(a,i,l.transformTemplate)}scrapeMotionValuesFromProps(a,i,l){return rh(a,i,l)}}class g2 extends Gx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Ms.has(i)){const l=xh(i);return l&&l.default||0}return i=Ab.has(i)?i:Wf(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,l){return Mb(a,i,l)}build(a,i,l){ih(a,i,this.isSVGTag,l.transformTemplate)}renderInstance(a,i,l,c){Db(a,i,l,c)}mount(a){this.isSVGTag=lh(a.tagName),super.mount(a)}}const y2=(n,a)=>eh(n)?new g2(a):new v2(a,{allowProjection:n!==y.Fragment}),b2=qN({...Lw,...c2,...KE,...u2},y2),Tt=oN(b2);function x2(){!Nh.current&&Hx();const[n]=y.useState(rc.current);return n}const Df={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 Qa(n){return n==="blocked"?Df.blocked:Df[Ch(n)]}const _2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function S2(n){return _2[Ch(n)]??"statusPending"}const T2=["working","paused","failed","not_started","blocked","complete"],m0=["not_started","working","paused","complete","failed"],k2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Ch(n){return n in Df&&n!=="blocked"?n:k2[n]??"not_started"}const j2={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 N2(n){if(n.length===0)return[];const a=[...n].sort((l,c)=>l[0]-c[0]),i=[[a[0][0],a[0][1]]];for(let l=1;l<a.length;l++){const c=i[i.length-1],[d,f]=a[l];d<=c[1]+1?c[1]=Math.max(c[1],f):i.push([d,f])}return i}function Px({text:n,indices:a,highlightClass:i}){if(!a||a.length===0)return r.jsx(r.Fragment,{children:n});const l=N2(a),c=[];let d=0;for(const[f,m]of l)f>d&&c.push(r.jsx("span",{children:n.slice(d,f)},`p${d}`)),c.push(r.jsx("mark",{className:i,children:n.slice(f,m+1)},`m${f}`)),d=m+1;return d<n.length&&c.push(r.jsx("span",{children:n.slice(d)},`p${d}`)),r.jsx(r.Fragment,{children:c})}function C2(n){const a=new Map(n.map(l=>[l.id,{...l,children:[]}])),i=[];for(const l of a.values())l.parentTaskId&&a.has(l.parentTaskId)?a.get(l.parentTaskId).children.push(l):i.push(l);for(const l of a.values())l.children.sort((c,d)=>c.sortOrder-d.sortOrder);return i.sort((l,c)=>l.sortOrder-c.sortOrder)}function w2(n,a){const i=new Map;for(const d of n){const m=d.dependsOn.length>0&&d.dependsOn.some(v=>a.get(v)!=="complete")?"blocked":d.status,p=i.get(m);p?p.push(d):i.set(m,[d])}const l=[],c=new Set;for(const d of T2){c.add(d);const f=i.get(d);if(f&&f.length>0){f.sort((p,v)=>p.sortOrder-v.sortOrder);const m=Qa(d);l.push({status:d,label:m.label,style:m,tasks:f})}}for(const[d,f]of i)if(!c.has(d)&&f.length>0){f.sort((p,v)=>p.sortOrder-v.sortOrder);const m=Qa(d);l.push({status:d,label:m.label,style:m,tasks:f})}return l}const E2="_container_z4i38_1",A2="_header_z4i38_5",D2="_headerActions_z4i38_17",R2="_searchInput_z4i38_23",M2="_searchHighlight_z4i38_56",O2="_groupToggle_z4i38_62",B2="_groupToggleActive_z4i38_89",L2="_addButton_z4i38_93",I2="_taskRow_z4i38_120",z2="_selected_z4i38_140",U2="_expandArrow_z4i38_150",V2="_expanded_z4i38_157",H2="_leafSpacer_z4i38_161",G2="_taskStatusIcon_z4i38_166",P2="_taskTitle_z4i38_170",$2="_workspaceBadge_z4i38_177",q2="_childCountBadge_z4i38_195",K2="_dependencyBadge_z4i38_208",Y2="_blockedBadge_z4i38_220",F2="_addChildButton_z4i38_225",Z2="_emptyState_z4i38_268",X2="_statusGroupHeader_z4i38_275",Q2="_statusGroupIcon_z4i38_294",W2="_statusGroupLabel_z4i38_298",J2="_statusGroupCount_z4i38_303",Ie={container:E2,header:A2,headerActions:D2,searchInput:R2,searchHighlight:M2,groupToggle:O2,groupToggleActive:B2,addButton:L2,taskRow:I2,selected:z2,expandArrow:U2,expanded:V2,leafSpacer:H2,taskStatusIcon:G2,taskTitle:P2,workspaceBadge:$2,childCountBadge:q2,dependencyBadge:K2,blockedBadge:Y2,addChildButton:F2,emptyState:Z2,statusGroupHeader:X2,statusGroupIcon:Q2,statusGroupLabel:W2,statusGroupCount:J2},eA=[{name:"title",weight:2},{name:"description",weight:1}],$x=16,tA=16,qx="grackle-task-group-by-status";function p0(){try{return localStorage.getItem(qx)==="true"}catch{return!1}}function nA(n){try{localStorage.setItem(qx,String(n))}catch{}}function aA({group:n,isExpanded:a,onToggle:i,selectedTaskId:l,navigate:c,titleHighlights:d,workspaceNames:f}){return r.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[r.jsxs("div",{className:Ie.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),i())},children:[r.jsx("span",{className:`${Ie.expandArrow} ${a?Ie.expanded:""}`,children:"▸"}),r.jsx("span",{className:Ie.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),r.jsx("span",{className:Ie.statusGroupLabel,children:n.label}),r.jsx("span",{className:Ie.statusGroupCount,children:n.tasks.length})]}),r.jsx(Yn,{children:a&&r.jsx(Tt.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:n.tasks.map(m=>{const p=Qa(m.status),v=l===m.id,g=m.parentTaskId||!m.workspaceId?void 0:f.get(m.workspaceId);return r.jsxs("div",{onClick:()=>c(ba(m.id)),className:`${Ie.taskRow} ${v?Ie.selected:""}`,style:{"--task-indent":`${$x}px`},"data-task-id":m.id,children:[r.jsx("span",{className:Ie.leafSpacer}),r.jsx("span",{className:Ie.taskStatusIcon,style:{color:p.color},children:p.icon}),r.jsx("span",{className:Ie.taskTitle,title:m.title,children:r.jsx(Px,{text:m.title,indices:d.get(m.id),highlightClass:Ie.searchHighlight})}),g&&r.jsx("span",{className:Ie.workspaceBadge,title:g,children:g})]},m.id)})})})]})}function Kx({node:n,depth:a,expandedTasks:i,toggleTask:l,selectedTaskId:c,navigate:d,taskStatusById:f,titleHighlights:m,workspaceNames:p}){const v=Qa(n.status),g=n.dependsOn.length>0&&n.dependsOn.some(k=>f.get(k)!=="complete"),b=i.has(n.id),x=n.children.length>0,S=c===n.id,j=$x+a*tA,N=a===0&&!n.parentTaskId&&n.workspaceId?p.get(n.workspaceId):void 0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{onClick:()=>d(ba(n.id)),className:`${Ie.taskRow} ${S?Ie.selected:""}`,style:{"--task-indent":`${j}px`},"data-task-id":n.id,children:[x&&r.jsx("span",{className:`${Ie.expandArrow} ${b?Ie.expanded:""}`,role:"button",tabIndex:0,"aria-label":b?"Collapse task":"Expand task",onClick:k=>{k.stopPropagation(),l(n.id)},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),l(n.id))},children:"▸"}),!x&&r.jsx("span",{className:Ie.leafSpacer}),r.jsx("span",{className:Ie.taskStatusIcon,style:{color:v.color},children:v.icon}),r.jsx("span",{className:Ie.taskTitle,title:n.title,children:r.jsx(Px,{text:n.title,indices:m.get(n.id),highlightClass:Ie.searchHighlight})}),N&&r.jsx("span",{className:Ie.workspaceBadge,title:N,children:N}),x&&r.jsxs("span",{className:Ie.childCountBadge,children:[n.children.filter(k=>k.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&r.jsx("span",{className:`${Ie.dependencyBadge} ${g?Ie.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:g?"blocked":"dep"}),a<B1&&r.jsx("button",{onClick:k=>{k.stopPropagation(),d(Ds(n.workspaceId,n.id))},title:"Add child task","aria-label":"Add child task",className:Ie.addChildButton,children:"+"})]}),r.jsx(Yn,{children:x&&b&&r.jsx(Tt.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:n.children.map(k=>r.jsx(Kx,{node:k,depth:a+1,expandedTasks:i,toggleTask:l,selectedTaskId:c,navigate:d,taskStatusById:f,titleHighlights:m,workspaceNames:p},k.id))})})]})}function sA({workspaces:n,tasks:a}){const i=Et(),[l,c]=y.useState(new Set),[d,f]=y.useState(new Set),[m,p]=y.useState(p0),[v,g]=y.useState(p0),[b,x]=y.useState(new Map),S=St("/tasks/:taskId/*"),j=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,C=y.useMemo(()=>new Map(a.map(K=>[K.id,K.status])),[a]),N=y.useMemo(()=>new Map(n.map(K=>[K.id,K.name])),[n]),k=()=>{const K=!m;nA(K),p(K),K&&(g(!0),x(new Map))},w=K=>{x(ae=>{const O=new Map(ae),P=O.has(K)?O.get(K):v;return O.set(K,!P),O})},A=K=>b.has(K)?b.get(K):v,R=K=>{c(ae=>{const O=new Set(ae);return O.has(K)?(O.delete(K),f(P=>new Set(P).add(K))):(O.add(K),f(P=>{const se=new Set(P);return se.delete(K),se})),O})};y.useEffect(()=>{const K=new Set(a.filter(ae=>ae.parentTaskId).map(ae=>ae.parentTaskId));K.size>0&&c(ae=>{const O=new Set(ae);for(const P of K)d.has(P)||O.add(P);return O})},[a,d]);const[E,H]=y.useState(""),{directMatchTaskIds:z,treeMatchTaskIds:I,titleHighlights:Y}=y.useMemo(()=>{if(!E.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const K=O1(a,E,eA),ae=new Set(K.map(le=>le.item.id)),O=new Map;for(const le of K){const q=le.matches.find(be=>be.key==="title");q&&O.set(le.item.id,q.indices)}const P=new Set(ae),se=new Map(a.map(le=>[le.id,le]));for(const le of[...ae]){let q=se.get(le);for(;q!=null&&q.parentTaskId;)P.add(q.parentTaskId),q=se.get(q.parentTaskId)}return{directMatchTaskIds:ae,treeMatchTaskIds:P,titleHighlights:O}},[E,a]),ee=z!==null,te=ee?m?z:I:null,ie=te?a.filter(K=>te.has(K.id)):a,ce=m?[]:C2(ie);return r.jsxs("div",{className:Ie.container,children:[r.jsxs("div",{className:Ie.header,children:[r.jsx("span",{children:"Tasks"}),r.jsxs("div",{className:Ie.headerActions,children:[r.jsx("button",{className:`${Ie.groupToggle} ${m?Ie.groupToggleActive:""}`,onClick:k,"aria-label":m?"Switch to tree view":"Group tasks by status","aria-pressed":m,title:m?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),r.jsx("button",{className:Ie.addButton,onClick:()=>i(Ds()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&r.jsx("input",{type:"text",value:E,onChange:K=>H(K.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Ie.searchInput,"data-testid":"sidebar-search"}),m?w2(ie,C).map(K=>r.jsx(aA,{group:K,isExpanded:A(K.status),onToggle:()=>w(K.status),selectedTaskId:j,navigate:i,titleHighlights:Y,workspaceNames:N},K.status)):ce.map(K=>r.jsx(Kx,{node:K,depth:0,expandedTasks:l,toggleTask:R,selectedTaskId:j,navigate:i,taskStatusById:C,titleHighlights:Y,workspaceNames:N},K.id)),ie.length===0&&!ee&&r.jsx("div",{className:Ie.emptyState,children:"No tasks yet. Click + to create one."}),ie.length===0&&ee&&r.jsx("div",{className:Ie.emptyState,children:"No matching tasks"})]})}const iA="_nav_14i94_1",oA="_tab_14i94_24",lA="_tabActive_14i94_62",rA="_tabLabel_14i94_75",cA="_statusDot_14i94_81",uA="_pulse_14i94_87",dA="_addButton_14i94_99",fA="_empty_14i94_132",Ya={nav:iA,tab:oA,tabActive:lA,tabLabel:rA,statusDot:cA,pulse:uA,addButton:dA,empty:fA},hA={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function mA({environments:n}){const a=Et(),i=y.useRef(null),l=St("/environments/:environmentId"),c=St("/environments/:environmentId/edit"),d=St("/environments/:environmentId/workspaces/:workspaceId"),f=St("/environments/:environmentId/workspaces/:workspaceId/*"),m=(l==null?void 0:l.params.environmentId)??(c==null?void 0:c.params.environmentId)??(d==null?void 0:d.params.environmentId)??(f==null?void 0:f.params.environmentId),p=m==="new"?void 0:m,v=y.useCallback(x=>{a(Oi(x))},[a]),g=y.useCallback(x=>{var k;const S=(k=i.current)==null?void 0:k.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const j=Array.from(S).findIndex(w=>w===document.activeElement),C=j>=0?j:n.findIndex(w=>w.id===p);let N=C;if(x.key==="ArrowDown"||x.key==="j"||x.key==="J")x.preventDefault(),N=(C+1)%S.length;else if(x.key==="ArrowUp"||x.key==="k"||x.key==="K")x.preventDefault(),N=(C-1+S.length)%S.length;else if(x.key==="Home")x.preventDefault(),N=0;else if(x.key==="End")x.preventDefault(),N=S.length-1;else return;N<n.length&&a(Oi(n[N].id)),S[N].focus()},[p,n,a]),b=p??(n.length>0?n[0].id:void 0);return r.jsxs("div",{className:Ya.nav,"data-testid":"environment-nav",children:[r.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:g,children:n.map(x=>{const S=x.id===p,j=x.id===b,C=hA[x.status]||"var(--text-tertiary)",N=x.status==="connected";return r.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:j?0:-1,className:`${Ya.tab} ${S?Ya.tabActive:""}`,onClick:()=>v(x.id),"data-testid":"env-nav-item",children:[r.jsx("span",{className:`${Ya.statusDot} ${N?Ya.pulse:""}`,style:{color:C},children:"●"}),r.jsx("span",{className:Ya.tabLabel,title:x.displayName||x.id,children:x.displayName||x.id})]},x.id)})}),r.jsx("button",{type:"button",className:Ya.addButton,onClick:()=>a(Ak),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),n.length===0&&r.jsx("div",{className:Ya.empty,children:"No environments yet."})]})}const pA="_nav_1bhou_1",vA="_tab_1bhou_24",gA="_tabIcon_1bhou_62",yA="_tabActive_1bhou_68",Gr={nav:pA,tab:vA,tabIcon:gA,tabActive:yA},ma=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"shortcuts",label:"Shortcuts",icon:"⌨️"},{path:"about",label:"About",icon:"ℹ️"}];function bA(){var f;const n=wt(),a=Et(),i=y.useRef(null),l=((f=ma.find(m=>n.pathname===`${Fo}/${m.path}`))==null?void 0:f.path)??ma[0].path,c=y.useCallback(m=>{a(`${Fo}/${m}`)},[a]),d=y.useCallback(m=>{var S,j;const p=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!p)return;const v=Array.from(p).findIndex(C=>C===document.activeElement),g=v>=0?v:ma.findIndex(C=>C.path===l);let b=g;if(m.key==="ArrowDown"||m.key==="j"||m.key==="J")m.preventDefault(),b=(g+1)%ma.length;else if(m.key==="ArrowUp"||m.key==="k"||m.key==="K")m.preventDefault(),b=(g-1+ma.length)%ma.length;else if(m.key==="Home")m.preventDefault(),b=0;else if(m.key==="End")m.preventDefault(),b=ma.length-1;else return;const x=ma[b].path;a(`${Fo}/${x}`),(j=p[b])==null||j.focus()},[l,a]);return r.jsx("nav",{className:Gr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:d,children:ma.map(m=>{const p=m.path===l;return r.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Gr.tab} ${p?Gr.tabActive:""}`,onClick:()=>c(m.path),children:[r.jsx("span",{className:Gr.tabIcon,"aria-hidden":"true",children:m.icon}),m.label]},m.path)})})}const xA="_nav_1snmp_1",_A="_searchForm_1snmp_8",SA="_searchInput_1snmp_15",TA="_searchButton_1snmp_33",kA="_clearButton_1snmp_68",jA="_workspaceSelect_1snmp_85",NA="_listHeader_1snmp_99",CA="_nodeList_1snmp_108",wA="_nodeItem_1snmp_116",EA="_indicator_1snmp_129",AA="_label_1snmp_136",DA="_badge_1snmp_145",Cn={nav:xA,searchForm:_A,searchInput:SA,searchButton:TA,clearButton:kA,workspaceSelect:jA,listHeader:NA,nodeList:CA,nodeItem:wA,indicator:EA,label:AA,badge:DA};function RA(){const{knowledge:n,workspaces:a}=rt(),[i,l]=y.useState(""),c=y.useCallback(p=>{p.preventDefault(),i.trim()&&n.search(i.trim())},[i,n]),d=y.useCallback(()=>{l(""),n.clearSearch()},[n]),f=y.useCallback(p=>{n.selectNode(p)},[n]),m=y.useCallback(p=>{l(""),n.loadRecent(p||void 0)},[n]);return r.jsxs("div",{className:Cn.nav,"data-testid":"knowledge-nav",children:[r.jsxs("form",{className:Cn.searchForm,onSubmit:c,children:[r.jsx("input",{className:Cn.searchInput,type:"text",placeholder:"Search...",value:i,onChange:p=>{l(p.target.value)},"data-testid":"knowledge-search-input"}),r.jsx("button",{type:"submit",className:Cn.searchButton,disabled:n.loading,children:"Go"})]}),n.searchQuery&&r.jsx("button",{type:"button",className:Cn.clearButton,onClick:d,children:"Clear search"}),r.jsxs("select",{className:Cn.workspaceSelect,onChange:p=>{m(p.target.value)},"data-testid":"knowledge-workspace-filter",children:[r.jsx("option",{value:"",children:"All workspaces"}),a.map(p=>r.jsx("option",{value:p.id,children:p.name},p.id))]}),r.jsxs("div",{className:Cn.listHeader,children:["Nodes (",n.graphData.nodes.length,")"]}),r.jsx("ul",{className:Cn.nodeList,children:n.graphData.nodes.map(p=>r.jsxs("li",{className:Cn.nodeItem,onClick:()=>{f(p.id)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),f(p.id))},role:"button",tabIndex:0,children:[r.jsx("span",{className:Cn.indicator,style:{backgroundColor:p.kind==="reference"?"#4A9EFF":p.category==="decision"?"#22C55E":p.category==="concept"?"#A855F7":p.category==="snippet"?"#6B7280":"#EAB308"}}),r.jsx("span",{className:Cn.label,children:p.label}),r.jsx("span",{className:Cn.badge,children:p.kind==="reference"?p.sourceType:p.category})]},p.id))})]})}function MA(){const{workspaces:n,tasks:a}=rt(),i=y.useMemo(()=>r.jsx(sA,{workspaces:n,tasks:a}),[n,a]);return pc(i),r.jsx(As,{})}function OA(){const{environments:n}=rt(),a=y.useMemo(()=>r.jsx(mA,{environments:n}),[n]);return pc(a),r.jsx(As,{})}function BA(){const n=y.useMemo(()=>r.jsx(bA,{}),[]);return pc(n),r.jsx(As,{})}function LA(){const n=y.useMemo(()=>r.jsx(RA,{}),[]);return pc(n),r.jsx(As,{})}const IA="_bar_tnfsh_1",zA="_btnPrimary_tnfsh_32",UA="_statusText_tnfsh_85",VA="_statusCompleted_tnfsh_90",HA="_statusFailed_tnfsh_94",GA="_statusBlocked_tnfsh_98",PA="_hintText_tnfsh_103",ut={bar:IA,btnPrimary:zA,statusText:UA,statusCompleted:VA,statusFailed:HA,statusBlocked:GA,hintText:PA};function $A({sessions:n,tasks:a,environments:i}){const l=Et(),c=wt(),d=St("/sessions/:sessionId"),f=St("/tasks/:taskId"),m=St("/tasks/:taskId/stream"),p=St("/tasks/:taskId/findings"),v=St("/tasks/:taskId/edit"),g=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),b=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),x=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),j=St("/sessions/new"),C=St("/environments/:environmentId/workspaces/:workspaceId"),N=St("/tasks/new"),k=St("/chat"),w=St("/"),A=St("/settings/*"),R=d==null?void 0:d.params.sessionId,E=(f==null?void 0:f.params.taskId)??(m==null?void 0:m.params.taskId)??(p==null?void 0:p.params.taskId)??(g==null?void 0:g.params.taskId)??(b==null?void 0:b.params.taskId)??(x==null?void 0:x.params.taskId)??(S==null?void 0:S.params.taskId),H=g??b??x??S,z=(H==null?void 0:H.params.environmentId)??(C==null?void 0:C.params.environmentId),I=c.pathname.startsWith("/environments")&&!C&&!H,Y=!!k,ee=!!j,te=!!C&&!g&&!b&&!x&&!S,ie=!!N;if(!!w&&!ee&&!te&&!ie||!!A||(!!v||!!S)||ie||I||ee)return r.jsx(r.Fragment,{});if(Y)return i.find(P=>P.adapterType==="local"&&P.status==="connected")?r.jsx(r.Fragment,{}):r.jsx("div",{className:ut.bar,children:r.jsx("span",{className:ut.hintText,children:"Add a local environment to start chatting"})});if(te)return r.jsx("div",{className:ut.bar,children:r.jsx("span",{className:ut.hintText,children:"Select a task or click + to create one"})});if(E){const O=a.find(le=>le.id===E);if(!O)return r.jsx("div",{className:ut.bar,children:r.jsx("span",{className:ut.hintText,children:"Loading..."})});const P=new Map(a.map(le=>[le.id,le])),se=O.dependsOn.some(le=>{const q=P.get(le);return q!==void 0&&q.status!=="complete"});if(O.status==="not_started"){const le=se?O.dependsOn.map(q=>P.get(q)).filter(q=>q&&q.status!=="complete").map(q=>q.title):[];return r.jsx("div",{className:ut.bar,children:se?r.jsxs("span",{className:ut.statusBlocked,children:["Blocked by: ",le.join(", ")]}):r.jsx("span",{className:ut.hintText,children:"Use the buttons above to start or manage this task"})})}if(O.status==="working"||O.status==="paused"){const le=O.latestSessionId||void 0,q=le?n.find(Ce=>Ce.id===le):void 0;return q&&q.status!=="stopped"?r.jsx(r.Fragment,{}):r.jsx("div",{className:ut.bar,children:r.jsx("span",{className:ut.hintText,children:"Waiting for agent..."})})}if(O.status==="complete")return r.jsxs("div",{className:ut.bar,children:[r.jsx("span",{className:`${ut.statusText} ${ut.statusCompleted}`,children:"Task completed"}),r.jsx("button",{onClick:()=>l(Ds(O.workspaceId,void 0,z)),className:ut.btnPrimary,children:"+ New Task"})]});if(O.status==="failed")return r.jsx("div",{className:ut.bar,children:r.jsx("span",{className:`${ut.statusText} ${ut.statusFailed}`,children:"Task failed"})})}if(R){const O=n.find(le=>le.id===R),P=(O==null?void 0:O.status)==="stopped";if(O!==void 0&&!P)return r.jsx(r.Fragment,{});if(P)return r.jsxs("div",{className:ut.bar,children:[r.jsxs("span",{className:`${ut.statusText} ${ut.hintText}`,children:["Session ",O.endReason||O.status]}),r.jsx("button",{onClick:()=>l(W0(O.environmentId)),className:ut.btnPrimary,children:"+ New Chat"})]})}return r.jsx("div",{className:ut.bar,children:r.jsx("span",{className:ut.hintText,children:"Loading..."})})}const qA="_toast_da8ll_1",KA="_success_da8ll_18",YA="_icon_da8ll_22",FA="_error_da8ll_25",ZA="_warning_da8ll_32",XA="_info_da8ll_38",QA="_message_da8ll_53",WA="_close_da8ll_60",Ho={toast:qA,success:KA,icon:YA,error:FA,warning:ZA,info:XA,message:QA,close:WA},JA={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function eD({toast:n,onDismiss:a}){return y.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),r.jsxs(Tt.div,{className:`${Ho.toast} ${Ho[n.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[r.jsx("span",{className:Ho.icon,"aria-hidden":"true",children:JA[n.variant]}),r.jsx("span",{className:Ho.message,children:n.message}),r.jsx("button",{type:"button",className:Ho.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const tD="_container_qqse2_1",nD={container:tD};function aD(){const{toasts:n,dismissToast:a}=Rs();return r.jsx("div",{className:nD.container,"data-testid":"toast-container",children:r.jsx(Yn,{children:n.map(i=>r.jsx(eD,{toast:i,onDismiss:a},i.id))})})}const sD="_breadcrumbs_17or2_1",iD="_list_17or2_11",oD="_item_17or2_21",lD="_separator_17or2_28",rD="_link_17or2_34",cD="_current_17or2_57",Ti={breadcrumbs:sD,list:iD,item:oD,separator:lD,link:rD,current:cD},uD="›";function Os({segments:n}){return r.jsx("nav",{className:Ti.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:r.jsx("ol",{className:Ti.list,children:n.map((a,i)=>{const l=i===n.length-1;return r.jsxs("li",{className:Ti.item,children:[i>0&&r.jsx("span",{className:Ti.separator,"aria-hidden":"true",children:uD}),a.url&&!l?r.jsx(Pf,{className:Ti.link,to:a.url,title:a.label,children:a.label}):r.jsx("span",{className:Ti.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function Rf(){Rf=function(c,d){return new i(c,void 0,d)};var n=RegExp.prototype,a=new WeakMap;function i(c,d,f){var m=new RegExp(c,d);return a.set(m,f||a.get(c)),cc(m,i.prototype)}function l(c,d){var f=a.get(d);return Object.keys(f).reduce(function(m,p){var v=f[p];if(typeof v=="number")m[p]=c[v];else{for(var g=0;c[v[g]]===void 0&&g+1<v.length;)g++;m[p]=c[v[g]]}return m},Object.create(null))}return(function(c,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(d&&d.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),d&&cc(c,d)})(i,RegExp),i.prototype.exec=function(c){var d=n.exec.call(this,c);if(d){d.groups=l(d,this);var f=d.indices;f&&(f.groups=l(f,this))}return d},i.prototype[Symbol.replace]=function(c,d){if(typeof d=="string"){var f=a.get(this);return n[Symbol.replace].call(this,c,d.replace(/\$<([^>]+)>/g,function(p,v){var g=f[v];return"$"+(Array.isArray(g)?g.join("$"):g)}))}if(typeof d=="function"){var m=this;return n[Symbol.replace].call(this,c,function(){var p=arguments;return typeof p[p.length-1]!="object"&&(p=[].slice.call(p)).push(l(p,m)),d.apply(this,p)})}return n[Symbol.replace].call(this,c,d)},Rf.apply(this,arguments)}function cc(n,a){return cc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},cc(n,a)}function v0(n,a){(a==null||a>n.length)&&(a=n.length);for(var i=0,l=new Array(a);i<a;i++)l[i]=n[i];return l}function nf(n,a){var i=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i)return(i=i.call(n)).next.bind(i);if(Array.isArray(n)||(i=(function(c,d){if(c){if(typeof c=="string")return v0(c,d);var f=Object.prototype.toString.call(c).slice(8,-1);return f==="Object"&&c.constructor&&(f=c.constructor.name),f==="Map"||f==="Set"?Array.from(c):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?v0(c,d):void 0}})(n))||a){i&&(n=i);var l=0;return function(){return l>=n.length?{done:!0}:{done:!1,value:n[l++]}}}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 dD=(function(n){return function(a){return a===void 0&&(a={}),(function(l,c){if(c&&!l.registered(c))throw new Error('The default language "'+c+'" is not registered with refractor.')})(n,a.defaultLanguage),function(l){g1(l,"element",i)};function i(l,c,d){var f,m;if(d&&d.tagName==="pre"&&l.tagName==="code"){var p=(l==null||(f=l.data)==null?void 0:f.meta)||(l==null||(m=l.properties)==null?void 0:m.metastring)||"";l.properties.className?typeof l.properties.className=="boolean"?l.properties.className=[]:Array.isArray(l.properties.className)||(l.properties.className=[l.properties.className]):l.properties.className=[];var v,g,b=(function(E){for(var H,z=nf(E.properties.className);!(H=z()).done;){var I=H.value;if(I.slice(0,9)==="language-")return I.slice(9).toLowerCase()}return null})(l);if(!b&&a.defaultLanguage&&l.properties.className.push("language-"+(b=a.defaultLanguage)),l.properties.className.push("code-highlight"),b)try{var x,S;S=(x=b)!=null&&x.includes("diff-")?b.split("-")[1]:b,v=n.highlight(Mr(l),S),d.properties.className=(d.properties.className||[]).concat("language-"+S)}catch(E){if(!a.ignoreMissing||!/Unknown language/.test(E.message))throw E;v=l}else v=l;v.children=(g=1,function E(H){return H.reduce(function(z,I){if(I.type==="text"){var Y=I.value,ee=(Y.match(/\n/g)||"").length;if(ee===0)I.position={start:{line:g,column:1},end:{line:g,column:1}},z.push(I);else for(var te,ie=Y.split(`
100
+ `),ce=nf(ie.entries());!(te=ce()).done;){var K=te.value,ae=K[0],O=K[1];z.push({type:"text",value:ae===ie.length-1?O:O+`
101
+ `,position:{start:{line:g+ae,column:1},end:{line:g+ae,column:1}}})}return g+=ee,z}if(Object.prototype.hasOwnProperty.call(I,"children")){var P=g;return I.children=E(I.children),z.push(I),I.position={start:{line:P,column:1},end:{line:g,column:1}},z}return z.push(I),z},[])})(v.children),v.position=v.children.length>0?{start:{line:v.children[0].position.start.line,column:0},end:{line:v.children[v.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var j,C=(function(E){var H=/{([\d,-]+)}/,z=E.split(",").map(function(ee){return ee.trim()}).join();if(H.test(z)){var I=H.exec(z)[1],Y=b1(I);return function(ee){return Y.includes(ee+1)}}return function(){return!1}})(p),N=(function(E){var H=Rf(/showLineNumbers=(\d+)/i,{lines:1});if(H.test(E)){var z=H.exec(E);return Number(z.groups.lines)}return 1})(p),k=(function(E){for(var H=new Array(E),z=0;z<E;z++)H[z]={type:"element",tagName:"span",properties:{className:[]},children:[]};return H})(v.position.end.line),w=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],A=function(){var E,H,z=j.value,I=z[0],Y=z[1];Y.properties.className=["code-line"];var ee=x1(v,function(te){return te.position.start.line<=I+1&&te.position.end.line>=I+1});Y.children=ee.children,(p.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(b))&&!w.some(function(te){return p.toLowerCase().includes(te)})&&(Y.properties.line=[(I+N).toString()],Y.properties.className.push("line-number")),C(I)&&Y.properties.className.push("highlight-line"),(b==="diff"||(E=b)!=null&&E.includes("diff-"))&&Mr(Y).substring(0,1)==="-"?Y.properties.className.push("deleted"):(b==="diff"||(H=b)!=null&&H.includes("diff-"))&&Mr(Y).substring(0,1)==="+"&&Y.properties.className.push("inserted")},R=nf(k.entries());!(j=R()).done;)A();k.length>0&&Mr(k[k.length-1]).trim()===""&&k.pop(),l.children=k}}}})(y1);function Yx(n){if(n>=1e6)return`${(n/1e6).toFixed(1)}M`;if(n>=1e3){const a=Number((n/1e3).toFixed(1));return a>=1e3?`${(n/1e6).toFixed(1)}M`:`${a.toFixed(1)}k`}return String(n)}function zi(n){return n===0?"-":n<.01?`$${n.toFixed(4)}`:`$${n.toFixed(2)}`}const fD="_systemContextEvent_1qbiw_1",hD="_systemContextHeader_1qbiw_7",mD="_systemContextBadge_1qbiw_28",pD="_systemContextToggle_1qbiw_37",vD="_systemContextPre_1qbiw_43",gD="_systemContextEllipsis_1qbiw_54",yD="_systemEvent_1qbiw_58",bD="_systemTimestamp_1qbiw_65",xD="_textEvent_1qbiw_69",_D="_toolUseEvent_1qbiw_155",SD="_toolUseHeader_1qbiw_175",TD="_toolUsePrefix_1qbiw_182",kD="_toolUseName_1qbiw_187",jD="_toolUseArgs_1qbiw_192",ND="_toolResultEvent_1qbiw_203",CD="_toolResultHeader_1qbiw_208",wD="_toolResultIndicatorOk_1qbiw_232",ED="_toolResultIndicatorError_1qbiw_239",AD="_toolResultLabel_1qbiw_246",DD="_toolResultToggle_1qbiw_250",RD="_toolResultCommand_1qbiw_256",MD="_toolResultEllipsis_1qbiw_266",OD="_toolResultPre_1qbiw_270",BD="_errorEvent_1qbiw_291",LD="_statusEvent_1qbiw_299",ID="_userInputEvent_1qbiw_308",zD="_userInputContent_1qbiw_314",UD="_signalEvent_1qbiw_331",VD="_signalBadge_1qbiw_342",HD="_signalContent_1qbiw_351",GD="_usageEvent_1qbiw_356",PD="_usageBadge_1qbiw_363",$D="_defaultEvent_1qbiw_372",Ve={systemContextEvent:fD,systemContextHeader:hD,systemContextBadge:mD,systemContextToggle:pD,systemContextPre:vD,systemContextEllipsis:gD,systemEvent:yD,systemTimestamp:bD,textEvent:xD,toolUseEvent:_D,toolUseHeader:SD,toolUsePrefix:TD,toolUseName:kD,toolUseArgs:jD,toolResultEvent:ND,toolResultHeader:CD,toolResultIndicatorOk:wD,toolResultIndicatorError:ED,toolResultLabel:AD,toolResultToggle:DD,toolResultCommand:RD,toolResultEllipsis:MD,toolResultPre:OD,errorEvent:BD,statusEvent:LD,userInputEvent:ID,userInputContent:zD,signalEvent:UD,signalBadge:VD,signalContent:HD,usageEvent:GD,usageBadge:PD,defaultEvent:$D},g0=3;function qD({content:n}){const[a,i]=y.useState(!1),l=n.split(`
102
+ `),c=l.length>g0,d=a?n:l.slice(0,g0).join(`
103
+ `);return r.jsxs("div",{className:Ve.systemContextEvent,"data-testid":"system-context-event",children:[r.jsxs("button",{type:"button",className:Ve.systemContextHeader,onClick:()=>{i(f=>!f)},"aria-expanded":a,children:[r.jsx("span",{className:Ve.systemContextBadge,children:"SYSTEM PROMPT"}),c&&r.jsx("span",{className:Ve.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),r.jsxs("pre",{className:Ve.systemContextPre,children:[d,!a&&c&&r.jsx("span",{className:Ve.systemContextEllipsis,children:"…"})]})]})}function KD({time:n,content:a}){return r.jsxs("div",{className:Ve.systemEvent,children:[r.jsxs("span",{className:Ve.systemTimestamp,children:["[",n,"]"]})," ",a]})}function YD({content:n}){return r.jsx("div",{className:Ve.textEvent,children:r.jsx(Of,{remarkPlugins:[Bf],rehypePlugins:[dD],children:n})})}function FD({content:n}){let a="",i=n;try{const l=JSON.parse(n);a=l.tool||"",i=JSON.stringify(l.args,null,2)}catch{}return r.jsxs("div",{className:Ve.toolUseEvent,children:[r.jsxs("div",{className:Ve.toolUseHeader,children:[r.jsx("span",{className:Ve.toolUsePrefix,children:">"}),a?r.jsx("span",{className:Ve.toolUseName,children:a}):null]}),r.jsx("pre",{className:Ve.toolUseArgs,children:i})]})}const y0=5;function ZD(n,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 l=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${l}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const l=JSON.stringify(a);return l.length>150?`${l.slice(0,150)}…`:l}catch{return""}}function XD({content:n,raw:a,toolUseCtx:i}){const[l,c]=y.useState(!1);let d=!1;if(a)try{d=JSON.parse(a).is_error===!0}catch{}const f=n.split(`
104
+ `),m=f.length>y0,p=l?n:f.slice(0,y0).join(`
105
+ `),g=((i==null?void 0:i.tool)??"")||(d?"Tool error":"Tool output"),b=i?ZD(i.tool,i.args):"",x=r.jsxs(r.Fragment,{children:[r.jsx("span",{className:d?Ve.toolResultIndicatorError:Ve.toolResultIndicatorOk,"aria-label":d?"error":"success","data-testid":d?"tool-result-indicator-error":"tool-result-indicator-ok",children:d?"✗":"✓"}),r.jsx("span",{className:Ve.toolResultLabel,"data-testid":"tool-result-label",children:g}),m&&r.jsx("span",{className:Ve.toolResultToggle,"aria-hidden":"true",children:l?"▾":"▸"})]});return r.jsxs("div",{className:Ve.toolResultEvent,"data-testid":"tool-result",children:[m?r.jsx("button",{className:Ve.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{c(S=>!S)},"aria-expanded":l,children:x}):r.jsx("div",{className:Ve.toolResultHeader,"data-testid":"tool-result-header",children:x}),b&&r.jsx("div",{className:Ve.toolResultCommand,children:b}),r.jsxs("pre",{className:Ve.toolResultPre,"data-testid":"tool-result-content",children:[p,!l&&m&&r.jsx("span",{className:Ve.toolResultEllipsis,children:"…"})]})]})}function QD({content:n}){return r.jsxs("div",{className:Ve.errorEvent,children:["Error: ",n]})}function WD({content:n}){return r.jsxs("div",{className:Ve.statusEvent,children:["--- ",n," ---"]})}function JD({content:n}){return r.jsx("div",{className:Ve.userInputEvent,children:r.jsx("span",{className:Ve.userInputContent,children:n})})}function eR({content:n}){return r.jsxs("div",{className:Ve.signalEvent,"data-testid":"signal-event",children:[r.jsx("span",{className:Ve.signalBadge,children:"SIGNAL"}),r.jsx("span",{className:Ve.signalContent,children:n})]})}function tR({content:n}){let a=n;try{const i=JSON.parse(n),l=Number(i.input_tokens)||0,c=Number(i.output_tokens)||0,d=Yx(l+c),f=zi(Number(i.cost_usd)||0);a=`${d} tokens · ${f}`}catch{}return r.jsx("div",{className:Ve.usageEvent,"data-testid":"usage-event",children:r.jsx("span",{className:Ve.usageBadge,children:a})})}function nR({content:n}){return r.jsx("div",{className:Ve.defaultEvent,children:n})}function aR({event:n,toolUseCtx:a}){const i=new Date(n.timestamp).toLocaleTimeString();switch(n.eventType){case"system":{if(n.raw)try{if(JSON.parse(n.raw).systemContext===!0)return r.jsx(qD,{content:n.content})}catch{}return r.jsx(KD,{time:i,content:n.content})}case"text":case"output":return r.jsx(YD,{content:n.content});case"tool_use":return r.jsx(FD,{content:n.content});case"tool_result":return r.jsx(XD,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return r.jsx(QD,{content:n.content});case"status":return r.jsx(WD,{content:n.content});case"user_input":return r.jsx(JD,{content:n.content});case"signal":return r.jsx(eR,{content:n.content});case"usage":return r.jsx(tR,{content:n.content});default:return r.jsx(nR,{content:n.content})}}const sR="_overlay_cmicx_1",iR="_dialog_cmicx_11",oR="_title_cmicx_30",lR="_description_cmicx_38",rR="_actions_cmicx_45",cR="_cancelButton_cmicx_52",uR="_confirmButton_cmicx_79",bs={overlay:sR,dialog:iR,title:oR,description:lR,actions:rR,cancelButton:cR,confirmButton:uR};function rl({isOpen:n,title:a,description:i,confirmLabel:l="Delete",onConfirm:c,onCancel:d}){const f=y.useId(),m=y.useId();return r.jsx(Yn,{children:n&&r.jsx(Tt.div,{className:bs.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:d,onKeyDown:p=>{p.key==="Escape"&&d()},role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-describedby":i?m:void 0,children:r.jsxs(Tt.div,{className:bs.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:p=>p.stopPropagation(),children:[r.jsx("h3",{id:f,className:bs.title,children:a}),i&&r.jsx("p",{id:m,className:bs.description,children:i}),r.jsxs("div",{className:bs.actions,children:[r.jsx("button",{type:"button",className:bs.cancelButton,onClick:d,autoFocus:!0,children:"Cancel"}),r.jsx("button",{type:"button",className:bs.confirmButton,onClick:c,children:l})]})]})})})}const dR="_spinner_1uyt1_1",fR="_spin_1uyt1_1",hR="_sm_1uyt1_14",mR="_md_1uyt1_20",pR="_lg_1uyt1_26",vR="_xl_1uyt1_32",b0={spinner:dR,spin:fR,sm:hR,md:mR,lg:pR,xl:vR};function Fx({size:n="md",className:a,label:i="Loading",liveRegion:l=!1}){return r.jsx("span",{className:`${b0.spinner} ${b0[n]} ${a??""}`,role:l?"status":void 0,"aria-label":i,"aria-hidden":l?void 0:!0})}const gR="_splash_1bn1g_1",yR="_logo_1bn1g_11",x0={splash:gR,logo:yR};function Zx(){return r.jsxs("div",{className:x0.splash,"data-testid":"splash-screen",children:[r.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:x0.logo}),r.jsx(Fx,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function bR(n,a){const i=y.useRef(null);y.useEffect(()=>{const l=i.current;if(i.current=n,l===null)return;const c=new Map;for(const f of l)c.set(f.id,f);const d=new Set;for(const f of n){d.add(f.id);const m=c.get(f.id);if(m&&m.status!==f.status&&f.status!=="sleeping"){if(f.status==="connecting"){a("Provisioning environment…","info");continue}f.status==="connected"?a("Environment connected","success"):f.status==="error"?a("Environment provision failed","error"):f.status==="disconnected"&&(m.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const f of l)d.has(f.id)||a("Environment removed","info")},[n,a])}const xR={working:{message:"Task is now running",variant:"info"},paused:{message:"Task paused",variant:"warning"},complete:{message:"Task complete",variant:"success"},failed:{message:"Task failed to complete",variant:"error"}};function _R(n){return xR[n]}function SR(n,a){if(n===void 0)return[];const i=[],l=new Map;for(const d of n)l.set(d.id,d);const c=new Set;for(const d of a){c.add(d.id);const f=l.get(d.id);if(!f||f.status===d.status)continue;const m=_R(d.status);m&&i.push(m)}for(const d of n)c.has(d.id)||i.push({message:"Task deleted",variant:"info"});return i}function TR(n,a){const i=y.useRef(void 0);y.useEffect(()=>{const l=i.current;i.current=n;const c=SR(l,n);for(const d of c)a(d.message,d.variant)},[n,a])}function kR(n,a,i){const l=n.filter(p=>p.status==="running"||p.status==="idle"||p.status==="waiting").length,c=Xx(a),d=a.filter(p=>Mf(p,c)).length,f=a.filter(p=>p.status==="paused"||p.status==="failed"||Mf(p,c)).length,m=i.filter(p=>p.status==="disconnected"||p.status==="error").length;return{activeSessions:l,blockedTasks:d,attentionTasks:f,unhealthyEnvironments:m}}function Xx(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function Mf(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function jR(n,a){var f;const i=new Map;for(const m of a)i.set(m.id,m);const l=Xx(n),c=[];for(const m of n){const p=m.workspaceId?((f=i.get(m.workspaceId))==null?void 0:f.name)??"Unknown":"Unknown";m.status==="failed"?c.push({task:m,reason:"failed",workspaceName:p}):Mf(m,l)?c.push({task:m,reason:"blocked",workspaceName:p}):m.status==="paused"&&c.push({task:m,reason:"paused",workspaceName:p})}const d={failed:0,blocked:1,paused:2};return c.sort((m,p)=>(d[m.reason]??3)-(d[p.reason]??3)),c}function NR(n,a){const i=new Map;for(const l of a)i.set(l.id,l);return n.filter(l=>l.status==="running"||l.status==="idle"||l.status==="waiting").map(l=>{var c;return{session:l,environmentName:((c=i.get(l.environmentId))==null?void 0:c.displayName)??"Unknown"}})}function CR(n,a,i){const l=new Map;for(const c of a){if(!c.workspaceId)continue;let d=l.get(c.workspaceId);d||(d={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},l.set(c.workspaceId,d)),d.totalTasks+=1,c.status==="complete"?d.completedTasks+=1:c.status==="working"?d.workingTasks+=1:c.status==="failed"&&(d.failedTasks+=1)}return n.map(c=>{const d=l.get(c.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:c,totalTasks:d.totalTasks,completedTasks:d.completedTasks,workingTasks:d.workingTasks,failedTasks:d.failedTasks}})}const wR="_dashboard_16pzm_1",ER="_kpiStrip_16pzm_11",AR="_kpiCard_16pzm_23",DR="_kpiValue_16pzm_68",RR="_kpiLabel_16pzm_76",MR="_bodyGrid_16pzm_84",OR="_section_16pzm_96",BR="_sectionHeader_16pzm_109",LR="_sectionIcon_16pzm_118",IR="_sectionTitle_16pzm_123",zR="_sectionCount_16pzm_131",UR="_sectionBody_16pzm_138",VR="_emptyHint_16pzm_143",HR="_sessionRow_16pzm_150",GR="_sessionPrompt_16pzm_177",PR="_sessionEnv_16pzm_186",$R="_sessionRuntime_16pzm_192",qR="_sessionStatus_16pzm_198",KR="_statusDot_16pzm_207",YR="_attentionRow_16pzm_233",FR="_attentionTitle_16pzm_259",ZR="_attentionMeta_16pzm_267",XR="_reasonBadge_16pzm_274",QR="_bottomGrid_16pzm_301",WR="_envRow_16pzm_312",JR="_envName_16pzm_323",eM="_envStatusBadge_16pzm_333",tM="_workspaceRow_16pzm_369",nM="_workspaceTop_16pzm_395",aM="_workspaceName_16pzm_401",sM="_workspaceCounts_16pzm_407",iM="_progressBar_16pzm_415",oM="_progressFill_16pzm_422",pe={dashboard:wR,kpiStrip:ER,kpiCard:AR,kpiValue:DR,kpiLabel:RR,bodyGrid:MR,section:OR,sectionHeader:BR,sectionIcon:LR,sectionTitle:IR,sectionCount:zR,sectionBody:UR,emptyHint:VR,sessionRow:HR,sessionPrompt:GR,sessionEnv:PR,sessionRuntime:$R,sessionStatus:qR,statusDot:KR,attentionRow:YR,attentionTitle:FR,attentionMeta:ZR,reasonBadge:XR,bottomGrid:QR,envRow:WR,envName:JR,envStatusBadge:eM,workspaceRow:tM,workspaceTop:nM,workspaceName:aM,workspaceCounts:sM,progressBar:iM,progressFill:oM},lM={hidden:{opacity:0,y:12},visible:n=>({opacity:1,y:0,transition:{delay:n*.06,duration:.3,ease:"easeOut"}})},Pr={hidden:{opacity:0,y:16},visible:n=>({opacity:1,y:0,transition:{delay:.15+n*.08,duration:.35,ease:"easeOut"}})};function rM(n,a,i,l){const c=[`${n} of ${a} tasks completed`];return i>0&&c.push(`${i} in progress`),l>0&&c.push(`${l} failed`),c.join(", ")}function $r({value:n,label:a,accent:i,index:l,testId:c}){return r.jsxs(Tt.div,{className:pe.kpiCard,"data-accent":i,"data-testid":c,variants:lM,initial:"hidden",animate:"visible",custom:l,children:[r.jsx("span",{className:pe.kpiValue,children:n}),r.jsx("span",{className:pe.kpiLabel,children:a})]})}function cM(){const{workspaces:n,tasks:a,sessions:i,environments:l,loadTasks:c}=rt(),d=Et(),f=y.useRef(new Set);y.useEffect(()=>{for(const b of n)f.current.has(b.id)||(f.current.add(b.id),c(b.id))},[n,c]);const m=y.useMemo(()=>kR(i,a,l),[i,a,l]),p=y.useMemo(()=>NR(i,l),[i,l]),v=y.useMemo(()=>jR(a,n),[a,n]),g=y.useMemo(()=>CR(n,a),[n,a,l]);return r.jsxs("div",{className:pe.dashboard,"data-testid":"dashboard",children:[r.jsxs("div",{className:pe.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[r.jsx($r,{value:m.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),r.jsx($r,{value:m.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),r.jsx($r,{value:m.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),r.jsx($r,{value:m.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),r.jsxs("div",{className:pe.bodyGrid,children:[r.jsxs(Tt.div,{className:pe.section,variants:Pr,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[r.jsxs("div",{className:pe.sectionHeader,children:[r.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"●"}),r.jsx("span",{className:pe.sectionTitle,children:"Active Sessions"}),r.jsx("span",{className:pe.sectionCount,children:p.length})]}),r.jsx("div",{className:pe.sectionBody,children:p.length===0?r.jsx("div",{className:pe.emptyHint,children:"No active sessions"}):p.map(({session:b,environmentName:x})=>r.jsxs("button",{type:"button",className:pe.sessionRow,onClick:()=>d(Q0(b.id)),"data-testid":"session-row",children:[r.jsx("span",{className:pe.sessionPrompt,title:b.prompt,children:b.prompt||"—"}),r.jsx("span",{className:pe.sessionEnv,children:x}),r.jsx("span",{className:pe.sessionRuntime,children:b.runtime}),r.jsxs("span",{className:pe.sessionStatus,children:[r.jsx("span",{className:pe.statusDot,"data-status":b.status}),b.status]})]},b.id))})]}),r.jsxs(Tt.div,{className:pe.section,variants:Pr,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[r.jsxs("div",{className:pe.sectionHeader,children:[r.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"⚑"}),r.jsx("span",{className:pe.sectionTitle,children:"Needs Attention"}),r.jsx("span",{className:pe.sectionCount,children:v.length})]}),r.jsx("div",{className:pe.sectionBody,children:v.length===0?r.jsx("div",{className:pe.emptyHint,children:"All clear"}):v.map(({task:b,reason:x,workspaceName:S})=>r.jsxs("button",{type:"button",className:pe.attentionRow,onClick:()=>d(ba(b.id)),"data-testid":"attention-row",children:[r.jsxs("div",{className:pe.attentionTitle,children:[r.jsx("span",{className:pe.reasonBadge,"data-reason":x,children:x}),b.title]}),r.jsx("div",{className:pe.attentionMeta,children:r.jsx("span",{children:S})})]},b.id))})]})]}),r.jsxs("div",{className:pe.bottomGrid,children:[r.jsxs(Tt.div,{className:pe.section,variants:Pr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[r.jsxs("div",{className:pe.sectionHeader,children:[r.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"◈"}),r.jsx("span",{className:pe.sectionTitle,children:"Environment Health"}),r.jsx("span",{className:pe.sectionCount,children:l.length})]}),r.jsx("div",{className:pe.sectionBody,children:l.length===0?r.jsx("div",{className:pe.emptyHint,children:"No environments configured"}):l.map(b=>r.jsxs("div",{className:pe.envRow,"data-testid":"dashboard-env-row",children:[r.jsx("span",{className:pe.envName,children:b.displayName}),r.jsx("span",{className:pe.envStatusBadge,"data-status":b.status,children:b.status})]},b.id))})]}),r.jsxs(Tt.div,{className:pe.section,variants:Pr,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[r.jsxs("div",{className:pe.sectionHeader,children:[r.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"▦"}),r.jsx("span",{className:pe.sectionTitle,children:"Workspaces"}),r.jsx("span",{className:pe.sectionCount,children:n.length})]}),r.jsx("div",{className:pe.sectionBody,children:g.length===0?r.jsx("div",{className:pe.emptyHint,children:"No workspaces yet"}):g.map(({workspace:b,totalTasks:x,completedTasks:S,workingTasks:j,failedTasks:C})=>{const N=x>0?Math.round(S/x*100):0;return r.jsxs("button",{type:"button",className:pe.workspaceRow,onClick:()=>d(Ri(b.id,b.environmentId)),"data-testid":"workspace-row",children:[r.jsxs("div",{className:pe.workspaceTop,children:[r.jsx("span",{className:pe.workspaceName,children:b.name}),r.jsxs("span",{className:pe.workspaceCounts,"aria-label":rM(S,x,j,C),children:[S,"/",x,j>0&&r.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",j]}),C>0&&r.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",C]})]})]}),x>0&&r.jsx("div",{className:pe.progressBar,children:r.jsx("div",{className:pe.progressFill,style:{width:`${N}%`}})})]},b.id)})})]})]})]})}const uM="_panelContainer_aei9x_1",dM="_emptyState_aei9x_8",fM="_fadeIn_aei9x_1",hM="_workspaceSummary_aei9x_17",mM="_workspaceSummaryTitle_aei9x_28",pM="_workspaceSummarySubtitle_aei9x_32",vM="_header_aei9x_36",gM="_headerInfo_aei9x_69",yM="_killButton_aei9x_75",bM="_headerTitle_aei9x_104",xM="_headerActions_aei9x_119",_M="_taskStatusBadge_aei9x_126",SM="_taskBranch_aei9x_135",TM="_taskBlockedBadge_aei9x_141",kM="_btnPrimary_aei9x_149",jM="_btnDanger_aei9x_180",NM="_btnGhost_aei9x_219",CM="_rejectInput_aei9x_245",wM="_tabBar_aei9x_275",EM="_tab_aei9x_275",AM="_active_aei9x_301",DM="_eventScroll_aei9x_306",RM="_tabContent_aei9x_312",MM="_noContext_aei9x_317",OM="_overviewContent_aei9x_323",BM="_overviewDashboard_aei9x_332",LM="_overviewHero_aei9x_338",IM="_statusBadge_aei9x_345",zM="_statusPending_aei9x_357",UM="_statusAssigned_aei9x_362",VM="_statusInProgress_aei9x_367",HM="_statusReview_aei9x_372",GM="_statusDone_aei9x_377",PM="_statusFailed_aei9x_382",$M="_statusWaitingInput_aei9x_387",qM="_overviewBranchPill_aei9x_392",KM="_branchLink_aei9x_407",YM="_overviewSection_aei9x_418",FM="_overviewLabel_aei9x_424",ZM="_overviewValue_aei9x_431",XM="_overviewMuted_aei9x_436",QM="_overviewMarkdown_aei9x_442",WM="_envRow_aei9x_511",JM="_envDot_aei9x_517",e3="_envDotGreen_aei9x_524",t3="_envDotYellow_aei9x_528",n3="_envDotRed_aei9x_532",a3="_envDotGray_aei9x_536",s3="_depList_aei9x_540",i3="_depItem_aei9x_546",o3="_depBlocked_aei9x_553",l3="_depDone_aei9x_557",r3="_timeline_aei9x_561",c3="_timelineRow_aei9x_567",u3="_timelineKey_aei9x_574",d3="_timelineValue_aei9x_580",f3="_timelineDelta_aei9x_584",h3="_reviewNotes_aei9x_595",m3="_overviewDescription_aei9x_606",p3="_waitingMessage_aei9x_612",v3="_errorMessage_aei9x_616",g3="_eventOverflowWarning_aei9x_620",y3="_attemptSelector_aei9x_634",b3="_attemptLabel_aei9x_650",x3="_attemptButton_aei9x_654",_3="_attemptActive_aei9x_671",S3="_attemptStatus_aei9x_677",T3="_emptyCta_aei9x_683",k3="_ctaTitle_aei9x_695",j3="_ctaDescription_aei9x_701",N3="_ctaButton_aei9x_708",C3="_ctaCreateForm_aei9x_743",w3="_ctaCreateInput_aei9x_749",E3="_ctaCreateOk_aei9x_780",A3="_ctaLink_aei9x_815",D3="_workspaceHeader_aei9x_829",R3="_workspaceName_aei9x_854",M3="_workspaceMeta_aei9x_867",O3="_metaRow_aei9x_875",B3="_metaLabel_aei9x_888",L3="_metaValue_aei9x_903",I3="_archiveButton_aei9x_913",z3="_repoLink_aei9x_943",U3="_metaToggle_aei9x_953",V3="_metaToggleArrow_aei9x_974",H3="_metaToggleArrowOpen_aei9x_979",G3="_progressBarContainer_aei9x_983",P3="_progressBar_aei9x_983",$3="_progressFill_aei9x_999",q3="_progressLabel_aei9x_1006",K3="_metaTimestamps_aei9x_1013",Y3="_metaTimestamp_aei9x_1013",L={panelContainer:uM,emptyState:dM,fadeIn:fM,workspaceSummary:hM,workspaceSummaryTitle:mM,workspaceSummarySubtitle:pM,header:vM,headerInfo:gM,killButton:yM,headerTitle:bM,headerActions:xM,taskStatusBadge:_M,taskBranch:SM,taskBlockedBadge:TM,btnPrimary:kM,btnDanger:jM,btnGhost:NM,rejectInput:CM,tabBar:wM,tab:EM,active:AM,eventScroll:DM,tabContent:RM,noContext:MM,overviewContent:OM,overviewDashboard:BM,overviewHero:LM,statusBadge:IM,statusPending:zM,statusAssigned:UM,statusInProgress:VM,statusReview:HM,statusDone:GM,statusFailed:PM,statusWaitingInput:$M,overviewBranchPill:qM,branchLink:KM,overviewSection:YM,overviewLabel:FM,overviewValue:ZM,overviewMuted:XM,overviewMarkdown:QM,envRow:WM,envDot:JM,envDotGreen:e3,envDotYellow:t3,envDotRed:n3,envDotGray:a3,depList:s3,depItem:i3,depBlocked:o3,depDone:l3,timeline:r3,timelineRow:c3,timelineKey:u3,timelineValue:d3,timelineDelta:f3,reviewNotes:h3,overviewDescription:m3,waitingMessage:p3,errorMessage:v3,eventOverflowWarning:g3,attemptSelector:y3,attemptLabel:b3,attemptButton:x3,attemptActive:_3,attemptStatus:S3,emptyCta:T3,ctaTitle:k3,ctaDescription:j3,ctaButton:N3,ctaCreateForm:C3,ctaCreateInput:w3,ctaCreateOk:E3,ctaLink:A3,workspaceHeader:D3,workspaceName:R3,workspaceMeta:M3,metaRow:O3,metaLabel:B3,metaValue:L3,archiveButton:I3,repoLink:z3,metaToggle:U3,metaToggleArrow:V3,metaToggleArrowOpen:H3,progressBarContainer:G3,progressBar:P3,progressFill:$3,progressLabel:q3,metaTimestamps:K3,metaTimestamp:Y3};function F3(){return r.jsx("div",{className:L.emptyState,children:"Select a task or click + to create one"})}function Z3(){return r.jsx("div",{className:L.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function X3(){const{workspaces:n,environments:a}=rt(),i=Et(),l=a.length>0;return n.length>0?r.jsx(cM,{}):r.jsxs("div",{className:L.emptyCta,"data-testid":"welcome-cta",children:[r.jsx("div",{className:L.ctaTitle,children:"Welcome to Grackle"}),r.jsx("div",{className:L.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r.jsx("button",{className:L.ctaButton,onClick:()=>i(J0),disabled:!l,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!l&&r.jsx("div",{className:L.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const Qx=50;function Q3(n,a,i,l,c=Qx){return l?n<c:a-n-i<c}function W3(n,a){const i=a-n;return i>0?i:0}function J3({scrollRef:n,contentLength:a,isReversed:i}){const[l,c]=y.useState(!0),d=y.useRef(0),f=y.useRef(!1),m=y.useRef(0);y.useEffect(()=>{const v=n.current;if(!v)return;let g=!0;const b=()=>{m.current||(m.current=requestAnimationFrame(()=>{m.current=0;const x=Q3(v.scrollTop,v.scrollHeight,v.clientHeight,i,Qx);x!==g&&(g=x,c(x))}))};return v.addEventListener("scroll",b,{passive:!0}),()=>{v.removeEventListener("scroll",b),m.current&&(cancelAnimationFrame(m.current),m.current=0)}},[n,i]),y.useLayoutEffect(()=>{const v=n.current;!v||f.current||(f.current=!0,i?v.scrollTop=0:v.scrollTop=v.scrollHeight,c(!0))},[n,i]),y.useLayoutEffect(()=>{const v=n.current;if(v){if(i&&!l){const g=W3(d.current,v.scrollHeight);g>0&&(v.scrollTop+=g)}l&&(i?v.scrollTo({top:0,behavior:"smooth"}):v.scrollTo({top:v.scrollHeight,behavior:"smooth"})),d.current=v.scrollHeight}},[a,l,i,n]);const p=y.useCallback(()=>{const v=n.current;if(!v)return;const g=i?0:v.scrollHeight;v.scrollTo({top:g,behavior:"smooth"}),c(!0)},[n,i]);return{isAtAnchor:l,scrollToAnchor:p}}const e6="_wrapper_p24zt_1",t6="_scrollContainer_p24zt_9",n6="_toolbar_p24zt_15",a6="_directionToggle_p24zt_22",s6="_scrollToAnchor_p24zt_60",i6="_scrollToAnchorBottom_p24zt_84",o6="_scrollToAnchorTop_p24zt_88",xs={wrapper:e6,scrollContainer:t6,toolbar:n6,directionToggle:a6,scrollToAnchor:s6,scrollToAnchorBottom:i6,scrollToAnchorTop:o6},Wx="grackle-stream-direction";function l6(){try{return localStorage.getItem(Wx)==="reversed"}catch{return!1}}function r6({eventsDropped:n}){return n<=0?r.jsx(r.Fragment,{}):r.jsxs("div",{className:L.eventOverflowWarning,role:"alert",children:["⚠"," ",n.toLocaleString()," older event",n===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function wh({events:n,eventsDropped:a,emptyState:i}){const l=y.useRef(null),[c,d]=y.useState(l6),f=x2(),m=y.useMemo(()=>c?[...n].reverse():n,[n,c]),{isAtAnchor:p,scrollToAnchor:v}=J3({scrollRef:l,contentLength:n.length,isReversed:c}),g=()=>{const S=!c;d(S);try{localStorage.setItem(Wx,S?"reversed":"default")}catch{}},b=f?0:.2,x=c?-8:8;return r.jsxs("div",{className:xs.wrapper,children:[r.jsx("div",{className:xs.toolbar,children:r.jsx("button",{className:xs.directionToggle,onClick:g,title:c?"Showing newest first":"Showing oldest first","aria-label":c?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:c?"↓":"↑"})}),r.jsxs("div",{ref:l,className:xs.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,r.jsx(r6,{eventsDropped:a}),r.jsx(Yn,{initial:!1,children:m.map((S,j)=>{const C=c?n.length-1-j:j;return r.jsx(Tt.div,{initial:{opacity:0,y:x},animate:{opacity:1,y:0},transition:{duration:b,ease:"easeOut"},children:r.jsx(aR,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${C}`)})})]}),r.jsx(Yn,{children:!p&&r.jsxs(Tt.button,{className:`${xs.scrollToAnchor} ${c?xs.scrollToAnchorTop:xs.scrollToAnchorBottom}`,onClick:v,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.15},"aria-label":"Scroll to latest","data-testid":"scroll-to-anchor",children:[c?"↑":"↓"," New events"]})})]})}const c6="_bar_1xhb4_1",u6="_input_1xhb4_32",d6="_select_1xhb4_67",f6="_btnPrimary_1xhb4_103",h6="_btnDanger_1xhb4_134",m6="_btnGhost_1xhb4_173",p6="_badge_1xhb4_195",v6="_disconnectHint_1xhb4_205",Wt={bar:c6,input:u6,select:d6,btnPrimary:f6,btnDanger:h6,btnGhost:m6,badge:p6,disconnectHint:v6};function g6(n,a){if(!n)return!1;const i=a.find(l=>l.id===n);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function y6({environmentId:n,onReconnect:a}){return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:Wt.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),r.jsx("button",{type:"button",onClick:()=>a(n),className:Wt.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function cl({mode:n,sessionId:a,environmentId:i,taskId:l,showStop:c,showPersonaSelect:d,onSessionKill:f,personas:m,environments:p,onSendInput:v,onSpawn:g,onStartTask:b,onProvisionEnvironment:x}){const{showToast:S}=Rs(),[j,C]=y.useState(""),[N,k]=y.useState(""),w=g6(i,p),A=R=>{if(R.preventDefault(),!!j.trim())if(n==="send"){if(!a||w)return;v(a,j),C("")}else if(n==="spawn"){if(!i)return;g(i,j,N),S("Session started","success"),C(""),k("")}else{if(!l)return;b(l,void 0,i,j),C("")}};return n==="spawn"?r.jsxs("form",{onSubmit:A,className:Wt.bar,children:[r.jsx("span",{className:Wt.badge,children:"new chat"}),r.jsx("input",{type:"text",value:j,onChange:R=>C(R.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:Wt.input}),d&&r.jsxs("select",{value:N,onChange:R=>k(R.target.value),className:Wt.select,children:[r.jsx("option",{value:"",children:"(Default)"}),m.map(R=>r.jsx("option",{value:R.id,children:R.name},R.id))]}),r.jsx("button",{type:"submit",disabled:!j.trim()||!i,className:Wt.btnPrimary,children:"Go"})]}):n==="start"?r.jsxs("form",{onSubmit:A,className:Wt.bar,children:[r.jsx("input",{type:"text",value:j,onChange:R=>C(R.target.value),placeholder:"Type a message...",autoFocus:!0,className:Wt.input}),r.jsx("button",{type:"submit",disabled:!j.trim(),className:Wt.btnPrimary,children:"Send"})]}):r.jsxs("form",{onSubmit:A,className:Wt.bar,children:[w&&i&&r.jsx(y6,{environmentId:i,onReconnect:x}),r.jsx("input",{type:"text",value:j,onChange:R=>C(R.target.value),placeholder:"Type a message...",autoFocus:!w,disabled:w,className:Wt.input}),r.jsx("span",{title:w?"Environment is unavailable — reconnect first":void 0,children:r.jsx("button",{type:"submit",disabled:!j.trim()||w,className:Wt.btnPrimary,children:"Send"})}),c&&f&&r.jsx("button",{type:"button",onClick:f,className:Wt.btnDanger,title:"Stop session",children:"Stop"})]})}function Eh(n){const a=[];for(const i of n){const l=a[a.length-1];i.eventType==="text"&&(l==null?void 0:l.eventType)==="text"?a[a.length-1]={...l,content:l.content+i.content}:a.push(i)}return a}function Ah(n){const a=new Map;for(const d of n)if(d.raw)try{a.set(d,JSON.parse(d.raw))}catch{}const i=new Map;for(const d of n){if(d.eventType!=="tool_use")continue;const f=a.get(d);if(!(!f||typeof f.id!="string"))try{const m=JSON.parse(d.content);i.set(f.id,{tool:m.tool,args:m.args})}catch{}}const l=new Set;return n.map(d=>{if(d.eventType!=="tool_result")return d;const f=a.get(d);if(!f||typeof f.tool_use_id!="string")return d;const m=i.get(f.tool_use_id);return m?(l.add(f.tool_use_id),{...d,toolUseCtx:m}):d}).filter(d=>{if(d.eventType!=="tool_use")return!0;const f=a.get(d);return f&&typeof f.id=="string"?!l.has(f.id):!0})}const b6="_panelContainer_pz4cr_1",x6="_emptyState_pz4cr_8",_6="_emptyTitle_pz4cr_20",S6="_emptyDescription_pz4cr_26",T6="_emptyHint_pz4cr_32",Ko={panelContainer:b6,emptyState:x6,emptyTitle:_6,emptyDescription:S6,emptyHint:T6};function k6({hasLocalEnvironment:n}){return r.jsxs("div",{className:Ko.emptyState,"data-testid":"chat-empty-state",children:[r.jsx("div",{className:Ko.emptyTitle,children:"Welcome to Grackle"}),r.jsx("div",{className:Ko.emptyDescription,children:n?"Type a message below to start chatting with the System agent. It can help you plan work, create tasks, and coordinate agents.":"Add a local environment in Settings to start chatting."}),!n&&r.jsx("div",{className:Ko.emptyHint,children:"Go to Settings → Environments to add one."})]})}function j6(){const{tasks:n,sessions:a,events:i,eventsDropped:l,environments:c,loadTaskSessions:d,loadSessionEvents:f,kill:m,taskSessions:p,sendInput:v,spawn:g,startTask:b,personas:x,provisionEnvironment:S}=rt(),j=y.useRef(void 0),[C,N]=y.useState(),k=n.find(I=>I.id===Lo),w=k!=null&&k.latestSessionId?a.find(I=>I.id===k.latestSessionId)??(p[Lo]??[]).find(I=>I.id===k.latestSessionId):void 0;y.useEffect(()=>{d(Lo)},[d]),y.useEffect(()=>{k!=null&&k.latestSessionId&&d(Lo)},[k==null?void 0:k.latestSessionId,d]),y.useEffect(()=>{w&&w.id!==j.current&&(j.current=w.id,f(w.id))},[w==null?void 0:w.id,f]);const A=y.useMemo(()=>{if(!w)return[];const I=i.filter(Y=>Y.sessionId===w.id);return Ah(Eh(I))},[i,w==null?void 0:w.id]),R=c.find(I=>I.adapterType==="local"&&I.status==="connected"),E=w!==void 0&&w.status!=="stopped"&&w.status!=="suspended",H=(w==null?void 0:w.status)==="idle";y.useEffect(()=>{C&&w&&H&&(v(w.id,C),N(void 0))},[C,H,w==null?void 0:w.id,v]);const z=y.useCallback((I,Y,ee,te)=>{te&&N(te),b(I,Y,ee)},[b]);return r.jsxs("div",{className:Ko.panelContainer,"data-testid":"chat-page",children:[r.jsx(wh,{events:A,eventsDropped:l,emptyState:r.jsx(k6,{hasLocalEnvironment:!!R})}),R&&E&&r.jsx(cl,{mode:"send",sessionId:w.id,environmentId:w.environmentId,showStop:!0,onSessionKill:()=>m(w.id),personas:x,environments:c,onSendInput:v,onSpawn:g,onStartTask:b,onProvisionEnvironment:S}),R&&!E&&r.jsx(cl,{mode:"start",taskId:Lo,environmentId:R.id,personas:x,environments:c,onSendInput:v,onSpawn:g,onStartTask:z,onProvisionEnvironment:S})]})}function N6(n,a){const i=[];let l=n;const c=new Set;for(;l&&a.has(l)&&!c.has(l);){c.add(l);const d=a.get(l);i.unshift(d),l=d.parentTaskId||void 0}return i}const ws={label:"Home",url:Cs};function C6(n){return n?[ws,{label:"Settings",url:Fo},{label:n,url:void 0}]:[ws,{label:"Settings",url:void 0}]}const Jx={label:"Environments",url:Mi};function w6(){return[ws,{label:"Environments",url:void 0}]}function E6(){return[ws,{label:"New Chat",url:void 0}]}function A6(n){return[ws,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function D6(n,a,i,l){const c=i.find(f=>f.id===n),d=l.find(f=>f.id===a);return[ws,Jx,{label:(d==null?void 0:d.displayName)??"Environment",url:Oi(a)},{label:(c==null?void 0:c.name)??"Workspace",url:void 0}]}function R6(n,a,i,l,c){const d=N6(n,c),f=c.get(n),m=f==null?void 0:f.workspaceId,p=m?i.find(S=>S.id===m):void 0,v=a??(p==null?void 0:p.environmentId),g=v?l.find(S=>S.id===v):void 0,b=[ws];g&&v&&(b.push(Jx),b.push({label:g.displayName,url:Oi(v)})),p&&v&&b.push({label:p.name,url:Ri(p.id,v)});for(let S=0;S<d.length-1;S++)b.push({label:d[S].title,url:ba(d[S].id,void 0,m,v)});const x=d[d.length-1];return b.push({label:(x==null?void 0:x.title)??n,url:void 0}),b}function M6(){const n=E6(),[a]=$f(),i=a.get("env")??"",{sendInput:l,spawn:c,startTask:d,personas:f,environments:m,provisionEnvironment:p}=rt();return r.jsxs("div",{className:L.panelContainer,children:[r.jsx(Os,{segments:n}),r.jsx("div",{className:L.emptyState,children:"Enter a prompt below to start a new session"}),r.jsx(cl,{mode:"spawn",environmentId:i,showPersonaSelect:!0,personas:f,environments:m,onSendInput:l,onSpawn:c,onStartTask:d,onProvisionEnvironment:p})]})}function O6({sessionId:n,session:a,isActive:i,onKill:l}){return r.jsxs("div",{className:L.header,children:[r.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.endReason||a.status}`,a!=null&&a.inputTokens||a!=null&&a.outputTokens||a!=null&&a.costUsd?` | ${Yx((a.inputTokens??0)+(a.outputTokens??0))} tokens · ${zi(a.costUsd??0)}`:""]}),r.jsxs("span",{className:L.headerInfo,children:[a&&r.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&r.jsx("button",{onClick:()=>l(n),title:"Stop session",className:L.killButton,children:"×"})]})]})}function B6({session:n}){const a=n&&(n.status==="stopped"||n.status==="suspended"),i=a?`Session ${n.endReason||n.status} with no events recorded.`:"Waiting for events...";return r.jsx("div",{className:a?L.errorMessage:L.waitingMessage,children:i})}function L6(){const{sessionId:n}=Wa(),{events:a,eventsDropped:i,sessions:l,kill:c,loadSessionEvents:d,sendInput:f,spawn:m,startTask:p,personas:v,environments:g,provisionEnvironment:b}=rt(),x=y.useRef(void 0),S=A6(n),j=l.find(k=>k.id===n)??void 0,C=y.useMemo(()=>{const k=n?a.filter(w=>w.sessionId===n):[];return Ah(Eh(k))},[a,n]);if(y.useEffect(()=>{n&&n!==x.current&&(x.current=n,d(n))},[n,d]),!n)return r.jsx("div",{className:L.emptyState,children:"No session selected"});const N=(j==null?void 0:j.status)==="running"||(j==null?void 0:j.status)==="idle";return r.jsxs("div",{className:L.panelContainer,children:[r.jsx(Os,{segments:S}),r.jsx(O6,{sessionId:n,session:j,isActive:N,onKill:c}),r.jsx(wh,{events:C,eventsDropped:i,emptyState:r.jsx(B6,{session:j})}),N&&r.jsx(cl,{mode:"send",sessionId:n,environmentId:j.environmentId,showStop:!0,onSessionKill:()=>c(n),personas:v,environments:g,onSendInput:f,onSpawn:m,onStartTask:p,onProvisionEnvironment:b})]})}function I6(n){if(!n)return!1;const a=n.tagName;return!!(a==="INPUT"||a==="TEXTAREA"||a==="SELECT"||n.isContentEditable)}function ga(n,a){const i=y.useRef(a);i.current=a;const{key:l,ctrl:c=!1,shift:d=!1,suppressInInputs:f=!0,enabled:m=!0}=n;y.useEffect(()=>{if(!m)return;const p=v=>{if(f&&I6(document.activeElement??void 0))return;const g=v.ctrlKey||v.metaKey;c===g&&(d&&!v.shiftKey||v.key===l&&i.current())};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}},[l,c,d,f,m])}const _0=220,S0=70,z6=40,U6=60,V6="hierarchy",H6="dependency";function G6(n){return y.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new wg.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:z6,ranksep:U6});const i=new Map(n.map(f=>[f.id,f])),l=new Map;for(const f of n)if(f.parentTaskId&&i.has(f.parentTaskId)){const m=l.get(f.parentTaskId)||[];m.push(f),l.set(f.parentTaskId,m)}for(const f of n)a.setNode(f.id,{width:_0,height:S0});const c=[];for(const f of n){if(f.parentTaskId&&i.has(f.parentTaskId)){const m=`hierarchy-${f.parentTaskId}-${f.id}`;a.setEdge(f.parentTaskId,f.id,{},m),c.push({id:m,source:f.parentTaskId,target:f.id,type:"smoothstep",data:{edgeType:V6},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const m of f.dependsOn)if(i.has(m)){const p=`dependency-${m}-${f.id}`;a.setEdge(m,f.id,{},p),c.push({id:p,source:m,target:f.id,type:"smoothstep",data:{edgeType:H6},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return wg.layout(a),{nodes:n.map(f=>{const m=a.node(f.id),p=l.get(f.id)||[];return{id:f.id,type:"task",position:{x:m.x-_0/2,y:m.y-S0/2},data:{task:f,childCount:p.length,doneChildCount:p.filter(v=>v.status==="complete").length,hasDependencies:f.dependsOn.length>0}}}),edges:c}},[n])}const P6="_dagContainer_js4w6_1",$6="_taskNode_js4w6_26",q6="_taskNodeBorder_js4w6_54",K6="_taskNodeContent_js4w6_60",Y6="_taskNodeHeader_js4w6_70",F6="_taskNodeIcon_js4w6_77",Z6="_taskNodeTitle_js4w6_82",X6="_taskNodeBadges_js4w6_90",Q6="_childBadge_js4w6_95",W6="_depBadge_js4w6_107",J6="_handle_js4w6_119",eO="_emptyCta_js4w6_126",tO="_ctaDescription_js4w6_137",nO="_ctaButton_js4w6_144",$t={dagContainer:P6,taskNode:$6,taskNodeBorder:q6,taskNodeContent:K6,taskNodeHeader:Y6,taskNodeIcon:F6,taskNodeTitle:Z6,taskNodeBadges:X6,childBadge:Q6,depBadge:W6,handle:J6,emptyCta:eO,ctaDescription:tO,ctaButton:nO};function aO({data:n}){const{task:a,childCount:i,doneChildCount:l,hasDependencies:c}=n,d=Qa(a.status);return r.jsxs("div",{className:$t.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[r.jsx(Eg,{type:"target",position:Ag.Top,className:$t.handle}),r.jsx("div",{className:$t.taskNodeBorder,style:{backgroundColor:d.color}}),r.jsxs("div",{className:$t.taskNodeContent,children:[r.jsxs("div",{className:$t.taskNodeHeader,children:[r.jsx("span",{className:$t.taskNodeIcon,style:{color:d.color},children:d.icon}),r.jsx("span",{className:$t.taskNodeTitle,children:a.title})]}),r.jsxs("div",{className:$t.taskNodeBadges,children:[i>0&&r.jsxs("span",{className:$t.childBadge,children:[l,"/",i]}),c&&r.jsx("span",{className:$t.depBadge,children:"dep"})]})]}),r.jsx(Eg,{type:"source",position:Ag.Bottom,className:$t.handle})]})}const sO=j2,iO={task:aO};function oO({workspaceId:n,environmentId:a,tasks:i}){const l=Et(),{resolvedThemeId:c}=lb(),d=y.useMemo(()=>i.filter(b=>b.workspaceId===n),[i,n]),{nodes:f,edges:m}=G6(d),p=y.useMemo(()=>{const b=getComputedStyle(document.documentElement),x={};for(const[S,j]of Object.entries(sO))x[S]=b.getPropertyValue(j).trim()||"#6b7a8d";return x},[c]),v=y.useCallback((b,x)=>{l(ba(x.id,void 0,n,a))},[l,n,a]),g=y.useCallback(b=>{const x=b.data;return p[x.task.status]||p.pending},[p]);return d.length===0?r.jsxs("div",{className:$t.emptyCta,children:[r.jsx("button",{className:$t.ctaButton,onClick:()=>l(Ds(n,void 0,a)),children:"Create Task"}),r.jsx("div",{className:$t.ctaDescription,children:"Create tasks to see the dependency graph"})]}):r.jsx("div",{className:$t.dagContainer,children:r.jsxs(S1,{nodes:f,edges:m,nodeTypes:iO,onNodeClick:v,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[r.jsx(T1,{variant:k1.Dots,gap:24,size:1,color:"var(--text-disabled)"}),r.jsx(j1,{showInteractive:!1}),r.jsx(N1,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function lO({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const l=new Map;for(const d of n)if(d.parentTaskId){const f=l.get(d.parentTaskId);f?f.push(d):l.set(d.parentTaskId,[d])}const c=new Map(m0.map(d=>[d,[]]));for(const d of n){const f=Ch(d.status),m=d.dependsOn.length>0&&d.dependsOn.some(j=>a.get(j)!=="complete"),p=l.get(d.id)??[],v=p.length,g=p.filter(j=>j.status==="complete").length;let b;if(f==="paused"&&i){const j=i.get(d.id);j==="idle"?b="Needs input":j==="completed"&&(b="Ready to complete")}const x={task:d,isBlocked:m,childCount:v,doneChildCount:g,pausedSubBadge:b},S=c.get(f);S?S.push(x):c.get("not_started").push(x)}for(const d of c.values())d.sort((f,m)=>f.task.sortOrder-m.task.sortOrder);return m0.map(d=>{const f=Qa(d);return{status:d,label:f.label,style:f,tasks:c.get(d)??[]}})}const rO="_boardContainer_1c4y1_1",cO="_column_1c4y1_17",uO="_columnHeader_1c4y1_34",dO="_columnIcon_1c4y1_47",fO="_columnLabel_1c4y1_52",hO="_columnCount_1c4y1_57",mO="_cardList_1c4y1_67",pO="_emptyPlaceholder_1c4y1_76",vO="_card_1c4y1_67",gO="_cardHeader_1c4y1_107",yO="_cardStatusIcon_1c4y1_113",bO="_cardTitle_1c4y1_119",xO="_cardBadges_1c4y1_127",_O="_badge_1c4y1_134",SO="_blockedBadge_1c4y1_146",TO="_childBadge_1c4y1_151",kO="_depBadge_1c4y1_155",jO="_parentBadge_1c4y1_159",NO="_pausedSubBadge_1c4y1_166",CO="_personaBadge_1c4y1_170",wO="_envBadge_1c4y1_174",EO="_emptyCta_1c4y1_178",AO="_ctaButton_1c4y1_188",DO="_ctaDescription_1c4y1_204",Ye={boardContainer:rO,column:cO,columnHeader:uO,columnIcon:dO,columnLabel:fO,columnCount:hO,cardList:mO,emptyPlaceholder:pO,card:vO,cardHeader:gO,cardStatusIcon:yO,cardTitle:bO,cardBadges:xO,badge:_O,blockedBadge:SO,childBadge:TO,depBadge:kO,parentBadge:jO,pausedSubBadge:NO,personaBadge:CO,envBadge:wO,emptyCta:EO,ctaButton:AO,ctaDescription:DO};function RO({workspaceId:n,environmentId:a,tasks:i,sessions:l,personas:c,environments:d}){const f=Et(),m=y.useMemo(()=>i.filter(x=>x.workspaceId===n),[i,n]),p=y.useMemo(()=>new Map(i.map(x=>[x.id,x.status])),[i]),v=y.useMemo(()=>new Map(m.map(x=>[x.id,x])),[m]),g=y.useMemo(()=>{const x=new Map(l.map(w=>[w.id,w])),S=new Map(c.map(w=>[w.id,w])),j=new Map(d.map(w=>[w.id,w])),C=new Map,N=new Map,k=new Map;for(const w of m)if(w.latestSessionId){const A=x.get(w.latestSessionId);if(A){if(C.set(w.id,A.endReason||A.status),A.personaId){const R=S.get(A.personaId);R&&N.set(w.id,R.name)}if(A.environmentId){const R=j.get(A.environmentId);R&&k.set(w.id,R.displayName)}}}return{sessionStatusByTaskId:C,personaNameByTaskId:N,environmentNameByTaskId:k}},[m,l,c,d]),b=y.useMemo(()=>lO({tasks:m,taskStatusById:p,sessionStatusByTaskId:g.sessionStatusByTaskId}),[m,p,g]);return m.length===0?r.jsxs("div",{className:Ye.emptyCta,"data-testid":"board-empty-cta",children:[r.jsx("button",{className:Ye.ctaButton,onClick:()=>f(Ds(n,void 0,a)),children:"Create Task"}),r.jsx("div",{className:Ye.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):r.jsx("div",{className:Ye.boardContainer,"data-testid":"board-container",children:b.map(x=>r.jsxs("section",{className:Ye.column,"data-testid":`board-column-${x.status}`,"aria-label":`${x.label}, ${x.tasks.length} ${x.tasks.length===1?"task":"tasks"}`,children:[r.jsxs("div",{className:Ye.columnHeader,children:[r.jsx("span",{className:Ye.columnIcon,style:{color:x.style.color},children:x.style.icon}),r.jsx("span",{className:Ye.columnLabel,children:x.label}),r.jsx("span",{className:Ye.columnCount,"data-testid":`board-count-${x.status}`,children:x.tasks.length})]}),r.jsx("div",{className:Ye.cardList,children:x.tasks.length===0?r.jsx("div",{className:Ye.emptyPlaceholder,children:"No tasks"}):r.jsx(Yn,{mode:"popLayout",children:x.tasks.map(S=>r.jsx(Tt.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:r.jsx(MO,{boardTask:S,tasksById:v,personaName:g.personaNameByTaskId.get(S.task.id),envName:g.environmentNameByTaskId.get(S.task.id),onClick:()=>f(ba(S.task.id,void 0,n,a))})},S.task.id))})})]},x.status))})}function MO({boardTask:n,tasksById:a,personaName:i,envName:l,onClick:c}){const{task:d,isBlocked:f,childCount:m,doneChildCount:p,pausedSubBadge:v}=n,g=Qa(d.status),b=d.parentTaskId?a.get(d.parentTaskId):void 0;return r.jsxs("div",{className:Ye.card,tabIndex:0,role:"button","data-testid":`board-card-${d.id}`,onClick:c,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),c())},children:[r.jsxs("div",{className:Ye.cardHeader,children:[r.jsx("span",{className:Ye.cardStatusIcon,style:{color:g.color},children:g.icon}),r.jsx("span",{className:Ye.cardTitle,children:d.title})]}),r.jsxs("div",{className:Ye.cardBadges,children:[b&&r.jsx("span",{className:`${Ye.badge} ${Ye.parentBadge}`,title:b.title,children:b.title}),m>0&&r.jsxs("span",{className:`${Ye.badge} ${Ye.childBadge}`,children:[p,"/",m]}),f&&r.jsx("span",{className:`${Ye.badge} ${Ye.blockedBadge}`,children:"blocked"}),d.dependsOn.length>0&&!f&&r.jsx("span",{className:`${Ye.badge} ${Ye.depBadge}`,children:"dep"}),v&&r.jsx("span",{className:`${Ye.badge} ${Ye.pausedSubBadge}`,children:v}),i&&r.jsx("span",{className:`${Ye.badge} ${Ye.personaBadge}`,children:i}),l&&r.jsx("span",{className:`${Ye.badge} ${Ye.envBadge}`,children:l})]})]})}function Dh(n){const{value:a,onSave:i,validate:l,fieldId:c,activeFieldId:d,onActivate:f,enterToSave:m=!0,trimOnSave:p=!0}=n,[v,g]=y.useState(""),[b,x]=y.useState(""),S=y.useRef(!1),j=d===c,C=y.useCallback(z=>{g(z),x("")},[]),N=y.useCallback(()=>{x("")},[]),k=y.useCallback(()=>{S.current=!1,f==null||f(null),g(""),x("")},[f]),w=y.useCallback(()=>{const z=p?v.trim():v;if(l){const Y=l(v);if(Y){x(Y);return}}const I=p?a.trim():a;if(z===I){k();return}i(z),k()},[v,a,p,l,i,k]),A=y.useCallback(()=>{S.current=!0,f==null||f(c),g(a),x("")},[c,a,f]),R=y.useCallback(z=>{if(S.current){S.current=!1;return}z.relatedTarget instanceof HTMLElement&&z.relatedTarget.dataset.editAction===c||w()},[c,w]),E=y.useCallback(z=>{z.key==="Escape"?k():z.key==="Enter"&&m&&w()},[k,m,w]),H=(()=>{if(!j)return!1;const z=p?a.trim():a;return(p?v.trim():v)!==z})();return y.useEffect(()=>{!j&&(v!==""||b!=="")&&(g(""),x(""))},[j,v,b]),{isEditing:j,draft:v,error:b,isDirty:H,startEdit:A,cancelEdit:k,save:w,setDraft:C,clearError:N,handleBlur:R,handleKeyDown:E,ignoreInitialBlurRef:S}}const OO="_editFieldWrapper_yuzty_1",BO="_editInput_yuzty_10",LO="_editTextarea_yuzty_42",IO="_editSelect_yuzty_78",zO="_editError_yuzty_111",UO="_editInputInvalid_yuzty_118",VO="_editHint_yuzty_123",HO="_unsavedDot_yuzty_132",GO="_metaValueClickable_yuzty_140",PO="_editButton_yuzty_159",$O="_metaPlaceholder_yuzty_175",qO="_worktreeToggle_yuzty_180",Pe={editFieldWrapper:OO,editInput:BO,editTextarea:LO,editSelect:IO,editError:zO,editInputInvalid:UO,editHint:VO,unsavedDot:HO,metaValueClickable:GO,editButton:PO,metaPlaceholder:$O,worktreeToggle:qO};function cn(n){const{value:a,onSave:i,validate:l,mode:c="edit",fieldId:d="text",activeFieldId:f,onActivate:m,onChange:p,renderDisplay:v,placeholder:g,maxLength:b,ariaLabel:x,"data-testid":S}=n,j=y.useRef(null),C=Dh({value:a,onSave:i,validate:l,fieldId:d,activeFieldId:f,onActivate:m,enterToSave:!0,trimOnSave:!0});if(y.useEffect(()=>{if(C.isEditing){const k=window.setTimeout(()=>{var w;(w=j.current)==null||w.focus()},0);return()=>window.clearTimeout(k)}},[C.isEditing]),c==="create"){const k=A=>{p==null||p(A.target.value)},w=l==null?void 0:l(a);return r.jsxs("div",{className:Pe.editFieldWrapper,children:[r.jsx("input",{className:`${Pe.editInput} ${w?Pe.editInputInvalid:""}`,value:a,onChange:k,maxLength:b,placeholder:g,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),w&&r.jsx("span",{className:Pe.editError,"data-testid":"edit-error",children:w})]})}if(C.isEditing)return r.jsxs("div",{className:Pe.editFieldWrapper,children:[r.jsx("input",{ref:j,className:`${Pe.editInput} ${C.error?Pe.editInputInvalid:""}`,value:C.draft,onChange:k=>C.setDraft(k.target.value),onBlur:C.handleBlur,onKeyDown:C.handleKeyDown,maxLength:b,placeholder:g,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),C.isDirty&&r.jsx("span",{className:Pe.unsavedDot,title:"Unsaved changes"}),C.error&&r.jsx("span",{className:Pe.editError,"data-testid":"edit-error",children:C.error}),r.jsx("span",{className:Pe.editHint,children:"Enter to save · Esc to cancel"})]});const N=v==null?void 0:v(a);return r.jsxs("span",{role:"button",tabIndex:0,className:Pe.metaValueClickable,onClick:()=>C.startEdit(),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),C.startEdit())},title:"Click to edit","aria-label":x,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:a?r.jsx("span",{children:a}):r.jsx("span",{className:Pe.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:Pe.editButton,"aria-hidden":"true",children:"✏️"})]})}function KO(n){const{value:a,onSave:i,validate:l,mode:c="edit",fieldId:d="textarea",activeFieldId:f,onActivate:m,onChange:p,renderDisplay:v,placeholder:g,ariaLabel:b,"data-testid":x}=n,S=y.useRef(null),j=Dh({value:a,onSave:i,validate:l,fieldId:d,activeFieldId:f,onActivate:m,enterToSave:!1,trimOnSave:!1});if(y.useEffect(()=>{if(j.isEditing){const N=window.setTimeout(()=>{var k;(k=S.current)==null||k.focus()},0);return()=>window.clearTimeout(N)}},[j.isEditing]),c==="create"){const N=w=>{p==null||p(w.target.value)},k=l==null?void 0:l(a);return r.jsxs("div",{className:Pe.editFieldWrapper,children:[r.jsx("textarea",{className:`${Pe.editTextarea} ${k?Pe.editInputInvalid:""}`,value:a,onChange:N,placeholder:g,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),k&&r.jsx("span",{className:Pe.editError,"data-testid":"edit-error",children:k})]})}if(j.isEditing)return r.jsxs("div",{className:Pe.editFieldWrapper,children:[r.jsx("textarea",{ref:S,className:`${Pe.editTextarea} ${j.error?Pe.editInputInvalid:""}`,value:j.draft,onChange:N=>j.setDraft(N.target.value),onBlur:j.handleBlur,onKeyDown:j.handleKeyDown,title:b,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),j.isDirty&&r.jsx("span",{className:Pe.unsavedDot,title:"Unsaved changes"}),j.error&&r.jsx("span",{className:Pe.editError,"data-testid":"edit-error",children:j.error}),r.jsx("span",{className:Pe.editHint,children:"Tab to save · Esc to cancel"})]});const C=v==null?void 0:v(a);return r.jsxs("span",{role:"button",tabIndex:0,className:Pe.metaValueClickable,onClick:()=>j.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),j.startEdit())},title:"Click to edit","aria-label":b,"data-testid":x?`${x}-button`:void 0,children:[C!==void 0?C:a?r.jsx("span",{children:a}):r.jsx("span",{className:Pe.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:Pe.editButton,"aria-hidden":"true",children:"✏️"})]})}function e_(n){var A;const{value:a,onSave:i,mode:l="edit",options:c,fieldId:d="select",activeFieldId:f,onActivate:m,onChange:p,renderDisplay:v,placeholder:g,ariaLabel:b,"data-testid":x}=n,S=y.useRef(null),j=Dh({value:a,onSave:i,fieldId:d,activeFieldId:f,onActivate:m,enterToSave:!1,trimOnSave:!1});y.useEffect(()=>{if(j.isEditing){const R=window.setTimeout(()=>{var E;(E=S.current)==null||E.focus()},0);return()=>window.clearTimeout(R)}},[j.isEditing]);const C=y.useCallback(R=>{const E=R.target.value;j.ignoreInitialBlurRef.current=!1,E!==a&&i(E),j.cancelEdit()},[a,i,j]),N=y.useCallback(R=>{if(j.ignoreInitialBlurRef.current){j.ignoreInitialBlurRef.current=!1;return}R.relatedTarget instanceof HTMLElement&&R.relatedTarget.dataset.editAction===d||j.cancelEdit()},[d,j]);if(l==="create")return r.jsx("select",{className:Pe.editSelect,value:a,onChange:R=>p==null?void 0:p(R.target.value),"aria-label":b,"data-testid":x?`${x}-select`:void 0,children:c.map(R=>r.jsx("option",{value:R.value,children:R.label},R.value))});if(j.isEditing)return r.jsx("select",{ref:S,className:Pe.editSelect,value:j.draft,onChange:C,onBlur:N,title:b,"aria-label":b,"data-testid":x?`${x}-select`:void 0,children:c.map(R=>r.jsx("option",{value:R.value,children:R.label},R.value))});const k=v==null?void 0:v(a),w=(A=c.find(R=>R.value===a))==null?void 0:A.label;return r.jsxs("button",{type:"button",className:Pe.metaValueClickable,onClick:()=>j.startEdit(),title:"Click to change","aria-label":b,"data-testid":x?`${x}-button`:void 0,children:[k!==void 0?k:w?r.jsx("span",{children:w}):r.jsx("span",{className:Pe.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:Pe.editButton,"aria-hidden":"true",children:"✏️"})]})}function YO(n){const{checked:a,onChange:i,label:l,ariaLabel:c,"data-testid":d}=n;return r.jsxs("label",{className:Pe.worktreeToggle,"data-testid":d,children:[r.jsx("input",{type:"checkbox",checked:a,onChange:f=>i(f.target.checked),"aria-label":c}),r.jsx("span",{children:l})]})}const FO="_envRow_1e1r5_1",ZO="_envDot_1e1r5_7",XO="_envDotGreen_1e1r5_14",QO="_envDotYellow_1e1r5_18",WO="_envDotRed_1e1r5_22",JO="_envDotGray_1e1r5_26",Di={envRow:FO,envDot:ZO,envDotGreen:XO,envDotYellow:QO,envDotRed:WO,envDotGray:JO};function e4(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Di.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Di.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Di.envDotRed:Di.envDotGray}function t4(n){const{value:a,onSave:i,environments:l,allowNone:c=!1,fieldId:d="environment",activeFieldId:f,onActivate:m,placeholder:p="No environment",ariaLabel:v="Environment","data-testid":g}=n,b=l.find(j=>j.id===a),x=[...c?[{value:"",label:"None"}]:[],...l.map(j=>({value:j.id,label:j.displayName}))],S=()=>{if(b)return r.jsxs("span",{className:Di.envRow,children:[r.jsx("span",{className:`${Di.envDot} ${e4(b.status)}`}),b.displayName]})};return r.jsx(e_,{value:a,onSave:i,options:x,fieldId:d,activeFieldId:f,onActivate:m,renderDisplay:S,placeholder:p,ariaLabel:v,"data-testid":g})}function T0(n){if(!n)return"";const a=new Date(n);if(isNaN(a.getTime()))return"";const l=Date.now()-a.getTime();if(l<0)return"just now";const c=Math.floor(l/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const d=Math.floor(c/60);if(d<24)return`${d}h ago`;const f=Math.floor(d/24);return f<30?`${f}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const af=100;function n4(){const{workspaceId:n,environmentId:a}=Wa(),i=Et(),{tasks:l,environments:c,workspaces:d,personas:f,sessions:m,archiveWorkspace:p,updateWorkspace:v,usageCache:g,loadUsage:b}=rt(),[x,S]=y.useState("tasks"),[j,C]=y.useState(!1),[N,k]=y.useState(null),[w,A]=y.useState(!1),R=y.useRef(void 0),E=d.find(K=>K.id===n),H=a??(E==null?void 0:E.environmentId)??"",z=D6(n,H,d,c);ga({key:"1"},()=>S("graph")),ga({key:"2"},()=>S("board")),ga({key:"3"},()=>S("tasks")),y.useEffect(()=>{const K=R.current;R.current=n,!(K===void 0||K===n)&&N!==null&&k(null)},[n,N]);const I=m.reduce((K,ae)=>K+(ae.costUsd??0),0);y.useEffect(()=>{n&&b("workspace",n)},[n,b,I]);const Y=n?g[`workspace:${n}`]:void 0,ee=l.filter(K=>K.workspaceId===n),te=ee.filter(K=>K.status==="complete").length,ie=ee.length,ce=ie>0?Math.round(te/ie*100):0;return r.jsxs("div",{className:L.panelContainer,children:[r.jsx(Os,{segments:z}),r.jsxs("div",{className:L.workspaceHeader,children:[r.jsx("span",{className:L.workspaceName,"data-testid":"workspace-name",children:r.jsx(cn,{value:(E==null?void 0:E.name)||"",onSave:K=>{E&&v(E.id,{name:K})},validate:K=>{const ae=K.trim();if(!ae)return"Name is required";if(ae.length>af)return`Max ${af} characters`},maxLength:af,fieldId:"name",activeFieldId:N,onActivate:k,ariaLabel:"Workspace name",renderDisplay:K=>K||n||void 0,"data-testid":"edit-name"})}),r.jsx("button",{className:L.archiveButton,onClick:()=>C(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),r.jsxs("button",{className:L.metaToggle,onClick:()=>A(!w),"aria-expanded":!w,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[r.jsx("span",{className:`${L.metaToggleArrow} ${w?"":L.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!w&&r.jsxs("div",{className:L.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Description"}),r.jsx("div",{className:L.metaValue,children:r.jsx(KO,{value:(E==null?void 0:E.description)||"",onSave:K=>{E&&v(E.id,{description:K})},fieldId:"description",activeFieldId:N,onActivate:k,renderDisplay:K=>K?r.jsx("span",{className:L.overviewMarkdown,children:r.jsx(Of,{remarkPlugins:[Bf],children:K})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Repository"}),r.jsx("div",{className:L.metaValue,children:r.jsx(cn,{value:(E==null?void 0:E.repoUrl)||"",onSave:K=>{E&&v(E.id,{repoUrl:K})},validate:K=>{const ae=K.trim();if(ae&&!/^https?:\/\/.+/.test(ae))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:N,onActivate:k,renderDisplay:K=>K&&/^https?:\/\//i.test(K)?r.jsx("a",{className:L.repoLink,href:K,target:"_blank",rel:"noopener noreferrer",onClick:ae=>ae.stopPropagation(),children:K}):K?r.jsx("span",{children:K}):void 0,placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Environment"}),r.jsx("div",{className:L.metaValue,children:r.jsx(t4,{value:(E==null?void 0:E.environmentId)||"",onSave:K=>{E&&K&&v(E.id,{environmentId:K})},environments:c,fieldId:"environmentId",activeFieldId:N,onActivate:k,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Persona"}),r.jsx("div",{className:L.metaValue,children:r.jsx(e_,{value:(E==null?void 0:E.defaultPersonaId)||"",onSave:K=>{E&&v(E.id,{defaultPersonaId:K})},options:[{value:"",label:"(Inherit)"},...f.map(K=>({value:K.id,label:K.name}))],fieldId:"defaultPersonaId",activeFieldId:N,onActivate:k,renderDisplay:K=>{const ae=f.find(O=>O.id===K);if(ae)return r.jsx("span",{children:ae.name})},placeholder:(E==null?void 0:E.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Worktrees"}),r.jsx("div",{className:L.metaValue,children:r.jsx(YO,{checked:(E==null?void 0:E.useWorktrees)??!0,onChange:K=>{E&&v(E.id,{useWorktrees:K})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Working Dir"}),r.jsx("div",{className:L.metaValue,children:r.jsx(cn,{value:(E==null?void 0:E.workingDirectory)||"",onSave:K=>{E&&v(E.id,{workingDirectory:K})},fieldId:"workingDirectory",activeFieldId:N,onActivate:k,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-working-directory"})})]}),E&&r.jsxs("div",{className:L.metaTimestamps,children:[r.jsxs("span",{className:L.metaTimestamp,children:["Created ",T0(E.createdAt)]}),E.updatedAt&&E.updatedAt!==E.createdAt&&r.jsxs("span",{className:L.metaTimestamp,children:["· Updated ",T0(E.updatedAt)]})]})]}),ie>0&&r.jsxs("div",{className:L.progressBarContainer,"data-testid":"progress-bar",children:[r.jsx("div",{className:L.progressBar,children:r.jsx("div",{className:L.progressFill,style:{width:`${ce}%`}})}),r.jsxs("span",{className:L.progressLabel,children:[te,"/",ie]})]}),Y&&Y.costUsd>0&&r.jsx("div",{className:L.progressBarContainer,children:r.jsxs("span",{className:L.progressLabel,children:["Usage: ",zi(Y.costUsd)," (",Y.sessionCount," session",Y.sessionCount!==1?"s":"",")"]})}),r.jsxs("div",{className:L.tabBar,role:"tablist","aria-label":"Workspace view",children:[r.jsx("button",{role:"tab","aria-selected":x==="graph",className:`${L.tab} ${x==="graph"?L.active:""}`,onClick:()=>S("graph"),children:"Graph"}),r.jsx("button",{role:"tab","aria-selected":x==="board",className:`${L.tab} ${x==="board"?L.active:""}`,onClick:()=>S("board"),"data-testid":"board-tab",children:"Board"}),r.jsx("button",{role:"tab","aria-selected":x==="tasks",className:`${L.tab} ${x==="tasks"?L.active:""}`,onClick:()=>S("tasks"),children:"Tasks"})]}),x==="tasks"&&ie>0&&r.jsxs("div",{className:L.workspaceSummary,children:[r.jsx("span",{className:L.workspaceSummaryTitle,children:`${te}/${ie} tasks complete`}),r.jsx("span",{className:L.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),x==="tasks"&&ie===0&&r.jsxs("div",{className:L.emptyCta,children:[r.jsx("button",{className:L.ctaButton,onClick:()=>i(Ds(n,void 0,H)),children:"Create Task"}),r.jsx("div",{className:L.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),x==="board"&&r.jsx(RO,{workspaceId:n,environmentId:H,tasks:l,sessions:m,personas:f,environments:c}),x==="graph"&&r.jsx(oO,{workspaceId:n,environmentId:H,tasks:l}),r.jsx(rl,{isOpen:j,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{E&&(p(E.id),i("/",{replace:!0})),C(!1)},onCancel:()=>C(!1)})]})}const a4="_formContent_ymnez_1",s4="_section_ymnez_13",i4="_label_ymnez_19",o4="_titleInput_ymnez_26",l4="_descriptionTextarea_ymnez_58",r4="_selectField_ymnez_94",c4="_checkboxRow_ymnez_128",u4="_checkboxLabel_ymnez_141",d4="_fieldError_ymnez_146",it={formContent:a4,section:s4,label:i4,titleInput:o4,descriptionTextarea:l4,selectField:r4,checkboxRow:c4,checkboxLabel:u4,fieldError:d4};function f4(n,a){return{name:(n==null?void 0:n.name)??"",description:(n==null?void 0:n.description)??"",repoUrl:(n==null?void 0:n.repoUrl)??"",environmentId:(n==null?void 0:n.environmentId)??a??"",defaultPersonaId:(n==null?void 0:n.defaultPersonaId)??"",useWorktrees:(n==null?void 0:n.useWorktrees)??!0,workingDirectory:(n==null?void 0:n.workingDirectory)??""}}const h4=100;function m4({values:n,onChange:a,environments:i,personas:l,errors:c,disabled:d,autoFocusName:f}){const m=(p,v)=>{a({...n,[p]:v})};return r.jsxs("div",{className:it.formContent,children:[r.jsxs("div",{className:it.section,children:[r.jsx("label",{className:it.label,htmlFor:"ws-name",children:"Name"}),r.jsx("input",{id:"ws-name",className:it.titleInput,type:"text",value:n.name,onChange:p=>m("name",p.target.value),placeholder:"Workspace name",maxLength:h4,autoFocus:f,disabled:d,"data-testid":"workspace-form-name"}),(c==null?void 0:c.name)&&r.jsx("span",{className:it.fieldError,"data-testid":"workspace-form-error-name",children:c.name})]}),r.jsxs("div",{className:it.section,children:[r.jsx("label",{className:it.label,htmlFor:"ws-description",children:"Description"}),r.jsx("textarea",{id:"ws-description",className:it.descriptionTextarea,value:n.description,onChange:p=>m("description",p.target.value),placeholder:"Optional description (Markdown supported)",disabled:d,"data-testid":"workspace-form-description"})]}),r.jsxs("div",{className:it.section,children:[r.jsx("label",{className:it.label,htmlFor:"ws-repo",children:"Repository URL"}),r.jsx("input",{id:"ws-repo",className:it.titleInput,type:"text",value:n.repoUrl,onChange:p=>m("repoUrl",p.target.value),placeholder:"https://github.com/org/repo",disabled:d,"data-testid":"workspace-form-repo"}),(c==null?void 0:c.repoUrl)&&r.jsx("span",{className:it.fieldError,"data-testid":"workspace-form-error-repoUrl",children:c.repoUrl})]}),r.jsxs("div",{className:it.section,children:[r.jsx("label",{className:it.label,htmlFor:"ws-environment",children:"Environment"}),r.jsxs("select",{id:"ws-environment",className:it.selectField,value:n.environmentId,onChange:p=>m("environmentId",p.target.value),disabled:d,"data-testid":"workspace-form-environment",children:[r.jsx("option",{value:"",children:"Select environment…"}),i.map(p=>r.jsx("option",{value:p.id,children:p.displayName||p.id},p.id))]}),(c==null?void 0:c.environmentId)&&r.jsx("span",{className:it.fieldError,"data-testid":"workspace-form-error-environmentId",children:c.environmentId})]}),r.jsxs("div",{className:it.section,children:[r.jsx("label",{className:it.label,htmlFor:"ws-persona",children:"Default Persona"}),r.jsxs("select",{id:"ws-persona",className:it.selectField,value:n.defaultPersonaId,onChange:p=>m("defaultPersonaId",p.target.value),disabled:d,"data-testid":"workspace-form-persona",children:[r.jsx("option",{value:"",children:"(Inherit)"}),l.map(p=>r.jsx("option",{value:p.id,children:p.name},p.id))]})]}),r.jsx("div",{className:it.section,children:r.jsxs("label",{className:it.checkboxRow,children:[r.jsx("input",{type:"checkbox",checked:n.useWorktrees,onChange:p=>m("useWorktrees",p.target.checked),disabled:d,"data-testid":"workspace-form-worktrees"}),r.jsx("span",{className:it.checkboxLabel,children:"Enable worktree isolation"})]})}),r.jsxs("div",{className:it.section,children:[r.jsx("label",{className:it.label,htmlFor:"ws-workdir",children:"Working Directory"}),r.jsx("input",{id:"ws-workdir",className:it.titleInput,type:"text",value:n.workingDirectory,onChange:p=>m("workingDirectory",p.target.value),placeholder:"Default (server default)",disabled:d,"data-testid":"workspace-form-workdir"})]})]})}const p4="_container_cddyd_1",v4="_header_cddyd_8",g4="_headerTitle_cddyd_35",y4="_badge_cddyd_44",b4="_headerActions_cddyd_54",x4="_body_cddyd_61",_4="_formContent_cddyd_73",S4="_section_cddyd_85",T4="_label_cddyd_91",k4="_titleInput_cddyd_98",j4="_descriptionTextarea_cddyd_131",N4="_parentContext_cddyd_167",C4="_parentLabel_cddyd_175",w4="_parentName_cddyd_182",E4="_personaSelect_cddyd_186",A4="_depList_cddyd_220",D4="_depItem_cddyd_226",R4="_depItemSelected_cddyd_248",M4="_noDeps_cddyd_252",O4="_btnPrimary_cddyd_258",B4="_btnGhost_cddyd_289",Ee={container:p4,header:v4,headerTitle:g4,badge:y4,headerActions:b4,body:x4,formContent:_4,section:S4,label:T4,titleInput:k4,descriptionTextarea:j4,parentContext:N4,parentLabel:C4,parentName:w4,personaSelect:E4,depList:A4,depItem:D4,depItemSelected:R4,noDeps:M4,btnPrimary:O4,btnGhost:B4};function L4(n){const a={};return n.name.trim()||(a.name="Name is required"),n.repoUrl.trim()&&!/^https?:\/\/.+/i.test(n.repoUrl.trim())&&(a.repoUrl="Must be a valid http(s) URL"),n.environmentId||(a.environmentId="Environment is required"),Object.keys(a).length>0?a:void 0}const I4=[{label:"Home",url:Cs},{label:"New Workspace",url:void 0}];function z4(){const[n]=$f(),a=n.get("environment")??void 0,{environments:i,personas:l,createWorkspace:c,workspaceCreating:d}=rt(),{showToast:f}=Rs(),m=Et(),[p,v]=y.useState(()=>{var N;return f4(void 0,a||((N=i[0])==null?void 0:N.id))}),[g,b]=y.useState(),[x,S]=y.useState();y.useEffect(()=>{a||p.environmentId||i.length===0||v(N=>{var k;return N.environmentId?N:{...N,environmentId:((k=i[0])==null?void 0:k.id)??""}})},[i,a,p.environmentId]);const j=()=>{const N=L4(p);if(N){b(N),S(void 0);return}b(void 0),S(void 0),c(p.name.trim(),p.description,p.repoUrl.trim(),p.environmentId,p.defaultPersonaId,p.useWorktrees,p.workingDirectory,()=>{f("Workspace created","success"),m(Cs,{replace:!0})},k=>{S(k)})},C=()=>{m(a?Oi(a):Cs,{replace:!0})};return r.jsxs("div",{className:Ee.container,children:[r.jsxs("div",{className:Ee.header,children:[r.jsx("div",{className:Ee.headerTitle,children:r.jsx(Os,{segments:I4})}),r.jsxs("div",{className:Ee.headerActions,children:[r.jsx("button",{className:Ee.btnGhost,onClick:C,disabled:d,"data-testid":"workspace-create-cancel",children:"Cancel"}),r.jsx("button",{className:Ee.btnPrimary,onClick:j,disabled:d||!p.name.trim()||!p.environmentId,"data-testid":"workspace-create-save",children:d?r.jsx(Fx,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),r.jsxs("div",{className:Ee.body,children:[r.jsx(m4,{values:p,onChange:N=>{v(N),b(void 0),S(void 0)},environments:i,personas:l,errors:g,disabled:d,autoFocusName:!0}),x&&r.jsx("div",{className:Ee.error,"data-testid":"workspace-create-submit-error",children:x})]})]})}function t_({mode:n,taskId:a,workspaceId:i,parentTaskId:l,environmentId:c,tasks:d,workspaces:f,personas:m,onCreateTask:p,onUpdateTask:v}){const{showToast:g}=Rs(),b=Et(),x=n==="edit",S=x&&a?d.find(W=>W.id===a):void 0,j=x?(S==null?void 0:S.workspaceId)??"":i??"",[C,N]=y.useState(j),k=j||C,w=f.find(W=>W.id===k),A=c??(w==null?void 0:w.environmentId),R=!x&&!i,E=x?(S==null?void 0:S.parentTaskId)??"":l??"",H=E?d.find(W=>W.id===E):void 0,[z,I]=y.useState((S==null?void 0:S.title)??""),[Y,ee]=y.useState((S==null?void 0:S.description)??""),[te,ie]=y.useState((S==null?void 0:S.dependsOn)??[]),[ce,K]=y.useState((S==null?void 0:S.defaultPersonaId)??""),[ae,O]=y.useState((S==null?void 0:S.canDecompose)??!1),[P,se]=y.useState(!1),le=y.useRef(!1);y.useEffect(()=>{x&&S&&!le.current&&(le.current=!0,I(S.title),ee(S.description),ie(S.dependsOn),K(S.defaultPersonaId),O(S.canDecompose))},[x,S]);const q=d.filter(W=>W.workspaceId===k&&(!x||W.id!==a)&&W.id!==E),be=z.trim().length>0&&(!x||S!==void 0)&&k.length>0,Ce=W=>{ie(tt=>tt.includes(W)?tt.filter(Re=>Re!==W):[...tt,W])},xe=()=>{!be||P||x&&S===void 0||(x&&a?(v(a,z.trim(),Y,te,ce),g("Task updated","success"),b(ba(a,void 0,k,A),{replace:!0})):(se(!0),p(k,z.trim(),Y,te.length>0?te:void 0,E||void 0,ce,ae,()=>{g("Task created","success"),b(i?Ri(i,A):"/tasks",{replace:!0})},W=>{g(W,"error"),se(!1)})))},J=()=>{b(x&&a?ba(a,void 0,k,A):i?Ri(i,A):"/tasks")},re=x?"edit task":E?"child task":"new task";return r.jsxs("div",{className:Ee.container,children:[r.jsxs("div",{className:Ee.header,children:[r.jsxs("div",{className:Ee.headerTitle,children:[r.jsx("span",{className:Ee.badge,children:re}),H&&r.jsxs("span",{className:Ee.parentContext,children:[r.jsx("span",{className:Ee.parentLabel,children:"Child of"}),r.jsx("span",{className:Ee.parentName,children:H.title})]})]}),r.jsxs("div",{className:Ee.headerActions,children:[r.jsx("button",{onClick:xe,disabled:!be||P,className:Ee.btnPrimary,"data-testid":"task-edit-save",children:P?"Creating…":x?"Save Changes":"Create"}),r.jsx("button",{onClick:J,className:Ee.btnGhost,children:"Cancel"})]})]}),r.jsx("div",{className:Ee.body,children:r.jsxs("div",{className:Ee.formContent,children:[R&&r.jsxs("div",{className:Ee.section,children:[r.jsx("label",{className:Ee.label,htmlFor:"task-edit-workspace",children:"Workspace"}),r.jsxs("select",{id:"task-edit-workspace",value:C,onChange:W=>N(W.target.value),className:Ee.personaSelect,"data-testid":"task-edit-workspace",children:[r.jsx("option",{value:"",children:"Select a workspace..."}),f.map(W=>r.jsx("option",{value:W.id,children:W.name},W.id))]})]}),r.jsxs("div",{className:Ee.section,children:[r.jsx("label",{className:Ee.label,htmlFor:"task-edit-title",children:"Title"}),r.jsx("input",{id:"task-edit-title",type:"text",value:z,onChange:W=>I(W.target.value),placeholder:"Task title...",autoFocus:!0,className:Ee.titleInput,"data-testid":"task-edit-title",onKeyDown:W=>{W.key==="Enter"&&be&&xe()}})]}),r.jsxs("div",{className:Ee.section,children:[r.jsx("label",{className:Ee.label,htmlFor:"task-edit-description",children:"Description"}),r.jsx("textarea",{id:"task-edit-description",value:Y,onChange:W=>ee(W.target.value),placeholder:"Describe the task... (markdown supported)",className:Ee.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),r.jsxs("div",{className:Ee.section,children:[r.jsx("label",{className:Ee.label,htmlFor:"task-edit-persona",children:"Default Persona"}),r.jsxs("select",{id:"task-edit-persona",value:ce,onChange:W=>K(W.target.value),className:Ee.personaSelect,"data-testid":"task-edit-persona",children:[r.jsx("option",{value:"",children:"(Inherit)"}),m.map(W=>r.jsx("option",{value:W.id,children:W.name},W.id))]})]}),!x&&r.jsx("div",{className:Ee.section,children:r.jsxs("label",{className:Ee.depItem,"data-testid":"task-edit-can-decompose",children:[r.jsx("input",{type:"checkbox",checked:ae,onChange:W=>O(W.target.checked)}),"Can spawn subtasks"]})}),r.jsxs("div",{className:Ee.section,children:[r.jsx("div",{className:Ee.label,children:"Dependencies"}),q.length===0?r.jsx("div",{className:Ee.noDeps,children:"No other tasks in this workspace"}):r.jsx("div",{className:Ee.depList,children:q.map(W=>{const tt=te.includes(W.id);return r.jsxs("label",{className:`${Ee.depItem} ${tt?Ee.depItemSelected:""}`,"data-testid":`dep-option-${W.id}`,children:[r.jsx("input",{type:"checkbox",checked:tt,onChange:()=>Ce(W.id)}),W.title,r.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",W.status,")"]})]},W.id)})})]})]})})]})}function k0(){const{workspaceId:n,environmentId:a}=Wa(),[i]=$f(),l=n??i.get("workspace")??"",c=i.get("parent")??void 0,{tasks:d,workspaces:f,personas:m,createTask:p,updateTask:v}=rt();return r.jsx(t_,{mode:"new",workspaceId:l,parentTaskId:c,environmentId:a,tasks:d,workspaces:f,personas:m,onCreateTask:p,onUpdateTask:v})}function j0(){const{taskId:n,workspaceId:a,environmentId:i}=Wa(),{tasks:l,workspaces:c,personas:d,createTask:f,updateTask:m}=rt();return r.jsx(t_,{mode:"edit",taskId:n,workspaceId:a,environmentId:i,tasks:l,workspaces:c,personas:d,onCreateTask:f,onUpdateTask:m})}const U4="_container_1pqxm_1",V4="_emptyState_1pqxm_8",H4="_card_1pqxm_14",G4="_cardHeader_1pqxm_34",P4="_categoryBadge_1pqxm_46",$4="_findingTitle_1pqxm_54",q4="_findingDate_1pqxm_60",K4="_findingContent_1pqxm_72",Y4="_tags_1pqxm_78",F4="_tag_1pqxm_78",Gn={container:U4,emptyState:V4,card:H4,cardHeader:G4,categoryBadge:P4,findingTitle:$4,findingDate:q4,findingContent:K4,tags:Y4,tag:F4};function Z4(n){const a=new Date(n),i=new Date,l=i.getTime()-a.getTime(),c=Math.floor(l/1e3),d=Math.floor(c/60),f=Math.floor(d/60),m=Math.floor(f/24);if(c<60)return"just now";if(d<60)return`${d}m ago`;if(f<24)return`${f}h ago`;if(m===1)return"yesterday";if(m<7)return`${m} days ago`;const p=a.getFullYear()===i.getFullYear(),v=a.toLocaleString("en-US",{month:"short"}),g=a.getDate();return p?`${v} ${g}`:`${v} ${g} ${a.getFullYear()}`}const N0={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 X4({findings:n}){return n.length===0?r.jsx("div",{className:Gn.emptyState,children:"No findings yet. Agents will post discoveries here."}):r.jsx("div",{className:Gn.container,children:n.map((a,i)=>{const l=N0[a.category]||N0.general;return r.jsxs(Tt.div,{className:Gn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:i*.05,duration:.2},children:[r.jsxs("div",{className:Gn.cardHeader,children:[r.jsx("span",{className:Gn.categoryBadge,style:{background:l.bg,color:l.text},children:a.category}),r.jsx("span",{className:Gn.findingTitle,children:a.title}),r.jsx("span",{className:Gn.findingDate,title:a.createdAt,children:Z4(a.createdAt)})]}),r.jsx("div",{className:Gn.findingContent,children:a.content.length>300?a.content.slice(0,300)+"...":a.content}),a.tags.length>0&&r.jsx("div",{className:Gn.tags,children:a.tags.map(c=>r.jsx("span",{className:Gn.tag,style:{color:l.text,textShadow:`0 0 8px ${l.text}`},children:c},c))})]},a.id)})})}function qr(n){if(!n)return"—";const a=new Date(n);return isNaN(a.getTime())?"—":a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function sf(n,a){if(!n||!a)return;const i=new Date(a).getTime()-new Date(n).getTime();if(isNaN(i)||i<0)return;const l=Math.floor(i/6e4),c=Math.floor(i%6e4/1e3);if(l===0)return`${c}s`;const d=Math.floor(l/60),f=l%60;return d===0?`${l}m ${c}s`:`${d}h ${f}m`}function C0(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?L.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?L.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?L.envDotRed:L.envDotGray}function Q4({status:n}){const a=Qa(n),i=S2(n);return r.jsx("span",{className:`${L.statusBadge} ${L[i]??L.statusPending}`,children:a.label})}function W4({task:n,tasksById:a,environments:i,workspaces:l,taskSessions:c,selectedEnvId:d}){const{loadUsage:f,usageCache:m}=rt(),p=c.reduce((A,R)=>A+(R.costUsd??0),0);y.useEffect(()=>{f("task",n.id),n.childTaskIds.length>0&&f("task_tree",n.id)},[n.id,n.childTaskIds.length,f,p]);const v=`task:${n.id}`,g=v in m?m[v]:void 0,b=`task_tree:${n.id}`,x=n.childTaskIds.length>0&&b in m?m[b]:void 0,S=c.length>0?c[c.length-1]:void 0,j=(S==null?void 0:S.environmentId)??"",C=j?i.find(A=>A.id===j):void 0,N=l.find(A=>A.id===n.workspaceId),k=i.find(A=>A.id===d),w=n.branch&&(N!=null&&N.repoUrl)?`${N.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return r.jsxs("div",{className:L.overviewDashboard,children:[r.jsxs("div",{className:L.overviewHero,children:[r.jsx(Q4,{status:n.status}),n.branch&&r.jsx("span",{className:L.overviewBranchPill,children:w?r.jsxs("a",{href:w,target:"_blank",rel:"noreferrer noopener",className:L.branchLink,children:["🔗"," ",n.branch]}):r.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Description"}),r.jsx("div",{className:L.overviewMarkdown,children:r.jsx(Of,{remarkPlugins:[Bf],children:n.description})})]}),r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Environment"}),j&&C?r.jsxs("div",{className:L.envRow,"data-testid":"task-overview-environment",children:[r.jsx("span",{className:`${L.envDot} ${C0(C.status)}`,title:C.status,"aria-label":`Status: ${C.status}`,role:"img"}),r.jsx("span",{className:L.overviewValue,children:C.displayName})]}):k?r.jsxs("div",{className:L.envRow,"data-testid":"task-overview-environment",children:[r.jsx("span",{className:`${L.envDot} ${C0(k.status)}`,title:k.status,"aria-label":`Status: ${k.status}`,role:"img"}),r.jsx("span",{className:L.overviewValue,children:k.displayName}),r.jsx("span",{className:L.overviewMuted,children:"(workspace default)"})]}):r.jsx("div",{className:L.overviewMuted,children:"Set in workspace settings"})]}),r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?r.jsx("div",{className:L.overviewMuted,children:"None"}):r.jsx("div",{className:L.depList,children:n.dependsOn.map(A=>{const R=a.get(A),E=(R==null?void 0:R.status)==="complete";return r.jsxs("div",{className:`${L.depItem} ${E?L.depDone:L.depBlocked}`,children:[r.jsx("span",{children:E?"✓":"○"}),r.jsx("span",{children:(R==null?void 0:R.title)??A})]},A)})})]}),r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Timeline"}),r.jsxs("div",{className:L.timeline,children:[n.createdAt&&r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Created"}),r.jsx("span",{className:L.timelineValue,children:qr(n.createdAt)})]}),n.assignedAt&&(()=>{const A=sf(n.createdAt,n.assignedAt);return r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Assigned"}),r.jsx("span",{className:L.timelineValue,children:qr(n.assignedAt)}),A!==void 0&&r.jsx("span",{className:L.timelineDelta,children:A})]})})(),n.startedAt&&(()=>{const A=sf(n.assignedAt??n.createdAt,n.startedAt);return r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Started"}),r.jsx("span",{className:L.timelineValue,children:qr(n.startedAt)}),A!==void 0&&r.jsx("span",{className:L.timelineDelta,children:A})]})})(),n.completedAt&&(()=>{const A=sf(n.startedAt,n.completedAt);return r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Completed"}),r.jsx("span",{className:L.timelineValue,children:qr(n.completedAt)}),A!==void 0&&r.jsx("span",{className:L.timelineDelta,children:A})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&r.jsx("div",{className:L.overviewMuted,children:"No timing data"})]})]}),g&&g.costUsd>0&&r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Usage"}),r.jsxs("div",{className:L.timeline,children:[r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Cost"}),r.jsx("span",{className:L.timelineValue,children:zi(g.costUsd)}),r.jsxs("span",{className:L.timelineDelta,children:[g.sessionCount," session",g.sessionCount!==1?"s":""]})]}),x&&x.costUsd>g.costUsd&&r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Total (incl. subtasks)"}),r.jsx("span",{className:L.timelineValue,children:zi(x.costUsd)}),r.jsxs("span",{className:L.timelineDelta,children:[x.sessionCount," session",x.sessionCount!==1?"s":""]})]})]})]}),n.reviewNotes&&r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Review Notes"}),r.jsx("div",{className:L.reviewNotes,children:n.reviewNotes})]})]})}function J4({task:n,sessionId:a,isBlocked:i,onStart:l,onResume:c,onStop:d,onPause:f,onDelete:m,onEdit:p}){if(n.status==="not_started")return i?r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:p,className:L.btnGhost,children:"Edit"}),r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})]}):r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:l,className:L.btnPrimary,children:"Start"}),r.jsx("button",{onClick:p,className:L.btnGhost,children:"Edit"}),r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})]});if(n.status==="working")return r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:d,className:L.btnDanger,children:"Stop"}),r.jsx("button",{onClick:f,disabled:!a,className:L.btnGhost,children:"Pause"})]});if(n.status==="paused")return r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:d,className:L.btnPrimary,children:"Stop"}),r.jsx("button",{onClick:c,className:L.btnGhost,children:"Resume"}),r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})]});if(n.status==="complete")return r.jsx("div",{className:L.headerActions,children:r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})});if(n.status==="failed")return r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:l,className:L.btnPrimary,children:"Retry"}),r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})]})}function eB({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return r.jsxs("div",{className:L.attemptSelector,"data-testid":"attempt-selector",children:[r.jsx("span",{className:L.attemptLabel,children:"Attempts:"}),n.map((l,c)=>{const d=l.id===a,f=l.status==="stopped"&&l.endReason==="completed"?"✓":l.status==="stopped"?"✗":l.status==="running"||l.status==="idle"?"●":"";return r.jsxs("button",{className:`${L.attemptButton} ${d?L.attemptActive:""}`,onClick:()=>i(l.id),title:`Attempt #${c+1} — ${l.status}`,"aria-label":`Attempt #${c+1}, ${l.status}`,"aria-pressed":d,"data-testid":`attempt-${c+1}`,children:["#",c+1,f&&r.jsx("span",{className:L.attemptStatus,children:f})]},l.id)})]})}function ki(){const{taskId:n,workspaceId:a,environmentId:i}=Wa(),l=wt(),c=Et(),{events:d,eventsDropped:f,tasks:m,sessions:p,environments:v,findings:g,loadSessionEvents:b,loadFindings:x,kill:S,startTask:j,stopTask:C,resumeTask:N,deleteTask:k,workspaces:w,taskSessions:A,loadTaskSessions:R,sendInput:E,spawn:H,personas:z,provisionEnvironment:I}=rt(),Y=y.useRef(void 0),ee=y.useRef(void 0),te=y.useRef(void 0),ie=y.useRef(void 0),ce=y.useRef(void 0),K=l.pathname.endsWith("/stream")?"stream":l.pathname.endsWith("/findings")?"findings":"overview",[ae,O]=y.useState(K),[P,se]=y.useState(!1),[le,q]=y.useState(void 0),[be,Ce]=y.useState(""),xe=y.useRef(K);K!==xe.current&&(xe.current=K,K!==ae&&O(K));const J=m.find(ke=>ke.id===n),re=(J==null?void 0:J.workspaceId)||void 0,W=w.find(ke=>ke.id===re);y.useEffect(()=>{if(be===""){if(W!=null&&W.environmentId)Ce(W.environmentId);else if(v.length>0){const ke=v.find(kt=>kt.status==="connected");Ce((ke==null?void 0:ke.id)??v[0].id)}}},[be,W==null?void 0:W.environmentId,v]);const tt=J?A[J.id]??[]:[];let Re;le&&tt.some(ke=>ke.id===le)?Re=le:Re=(J==null?void 0:J.latestSessionId)||void 0;const Dn=()=>{se(!0)},_a=()=>{if(!J)return;k(J.id),se(!1);const ke=i??(W==null?void 0:W.environmentId);c(J.workspaceId&&ke?Ri(J.workspaceId,ke):"/",{replace:!0})};if((J==null?void 0:J.id)!==ee.current&&(ee.current=J==null?void 0:J.id,le!==void 0&&q(void 0),be!==""&&Ce("")),y.useEffect(()=>{if(!(J!=null&&J.id))return;const ke=J.id!==ie.current,kt=J.latestSessionId!==ce.current;(ke||kt)&&(ie.current=J.id,ce.current=J.latestSessionId,R(J.id))},[J==null?void 0:J.id,J==null?void 0:J.latestSessionId,R]),(J==null?void 0:J.status)!==te.current){const ke=te.current===void 0;te.current=J==null?void 0:J.status;const kt=(J==null?void 0:J.status)==="not_started"?"overview":(J==null?void 0:J.status)==="working"||(J==null?void 0:J.status)==="paused"?"stream":(J==null?void 0:J.status)==="complete"?"findings":void 0;kt&&kt!==ae&&!(ke&&K!=="overview")&&O(kt)}const hn=y.useMemo(()=>new Map(m.map(ke=>[ke.id,ke])),[m]),Fn=y.useMemo(()=>{const ke=Re?d.filter(kt=>kt.sessionId===Re):[];return Ah(Eh(ke))},[d,Re]),In=J?J.dependsOn.some(ke=>{const kt=hn.get(ke);return kt!==void 0&&kt.status!=="complete"}):!1,mn=y.useMemo(()=>R6(n,i,w,v,hn),[n,i,w,v,hn]);y.useEffect(()=>{Re&&Re!==Y.current&&(Y.current=Re,b(Re))},[Re,b]),y.useEffect(()=>{ae==="findings"&&re&&x(re)},[ae,re,x]);const Jt=ke=>{O(ke),c(ba(n,ke==="overview"?void 0:ke,a,i))};return ga({key:"1"},()=>Jt("overview")),ga({key:"2"},()=>Jt("stream")),ga({key:"3"},()=>Jt("findings")),r.jsxs("div",{className:L.panelContainer,children:[r.jsx(Os,{segments:mn}),r.jsxs("div",{className:L.header,children:[r.jsxs("span",{className:L.headerTitle,children:[r.jsx("span",{"data-testid":"task-title",children:(J==null?void 0:J.title)||n}),J&&r.jsx("span",{className:L.taskStatusBadge,"data-testid":"task-status",children:J.status}),(J==null?void 0:J.branch)&&r.jsx("span",{className:L.taskBranch,children:J.branch}),In&&r.jsx("span",{className:L.taskBlockedBadge,children:"blocked"})]}),J&&r.jsx(J4,{task:J,sessionId:Re,isBlocked:In,onStart:()=>j(J.id,void 0,be),onResume:()=>N(J.id),onStop:()=>C(J.id),onPause:()=>Re&&S(Re),onDelete:Dn,onEdit:()=>c(Ek(J.id,a,i))})]}),r.jsxs("div",{className:L.tabBar,role:"tablist","aria-label":"Task view",children:[r.jsx("button",{role:"tab","aria-selected":ae==="overview",className:`${L.tab} ${ae==="overview"?L.active:""}`,onClick:()=>Jt("overview"),children:"Overview"}),r.jsx("button",{role:"tab","aria-selected":ae==="stream",className:`${L.tab} ${ae==="stream"?L.active:""}`,onClick:()=>Jt("stream"),children:"Stream"}),r.jsx("button",{role:"tab","aria-selected":ae==="findings",className:`${L.tab} ${ae==="findings"?L.active:""}`,onClick:()=>Jt("findings"),children:"Findings"})]}),r.jsxs(Yn,{mode:"wait",children:[ae==="overview"&&r.jsx(Tt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:L.overviewContent,"data-testid":"task-overview",children:J?r.jsx(W4,{task:J,tasksById:hn,environments:v,workspaces:w,taskSessions:tt,selectedEnvId:be}):r.jsx("div",{className:L.waitingMessage,children:"No additional details"})},"overview"),ae==="stream"&&r.jsxs(Tt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[r.jsx(eB,{taskSessions:tt,selectedSessionId:Re,onSelect:ke=>q(ke)}),r.jsx(wh,{events:Fn,eventsDropped:f,emptyState:!Re&&J?In?r.jsx("div",{className:L.emptyCta,"data-testid":"stream-blocked-message",children:r.jsx("div",{className:L.ctaDescription,children:"This task is blocked by incomplete dependencies"})}):r.jsxs("div",{className:L.emptyCta,children:[r.jsx("button",{"data-testid":"stream-start-cta",className:L.ctaButton,onClick:()=>j(J.id,void 0,be),children:"Start Task"}),r.jsx("div",{className:L.ctaDescription,children:"Click to begin agent execution"})]}):Re&&Fn.length===0?r.jsx("div",{className:L.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),ae==="findings"&&r.jsx(Tt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:L.tabContent,children:re?r.jsx(X4,{findings:g.filter(ke=>ke.workspaceId===re)}):r.jsx("div",{className:L.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!J||J.status!=="working"&&J.status!=="paused")return;const ke=Re?p.find(kt=>kt.id===Re):void 0;if(!(!ke||ke.status==="stopped"))return r.jsx(cl,{mode:"send",sessionId:ke.id,environmentId:ke.environmentId,personas:z,environments:v,onSendInput:E,onSpawn:H,onStartTask:j,onProvisionEnvironment:I})})(),J&&r.jsx(rl,{isOpen:P,title:"Delete Task?",description:`"${J.title}" will be permanently removed.`,onConfirm:_a,onCancel:()=>se(!1)})]})}const tB="_container_legrg_1",nB="_header_legrg_8",aB="_headerTitle_legrg_35",sB="_badge_legrg_44",iB="_headerActions_legrg_54",oB="_body_legrg_61",lB="_formContent_legrg_73",rB="_section_legrg_85",cB="_label_legrg_91",uB="_nameInput_legrg_98",dB="_fieldInput_legrg_131",fB="_adapterSelect_legrg_164",hB="_readOnlyValue_legrg_198",mB="_codespaceSection_legrg_204",pB="_codespaceActions_legrg_210",vB="_creatingHint_legrg_216",gB="_errorHint_legrg_222",yB="_btnPrimary_legrg_235",bB="_btnGhost_legrg_266",ne={container:tB,header:nB,headerTitle:aB,badge:sB,headerActions:iB,body:oB,formContent:lB,section:rB,label:cB,nameInput:uB,fieldInput:dB,adapterSelect:fB,readOnlyValue:hB,codespaceSection:mB,codespaceActions:pB,creatingHint:vB,errorHint:gB,btnPrimary:yB,btnGhost:bB},Wr=1,Jr=65535;function of(n){if(!n.trim())return!0;const a=Number(n);return Number.isInteger(a)&&a>=Wr&&a<=Jr}function lf(n){try{const a=JSON.parse(n);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function xB({codespaceName:n,onCodespaceNameChange:a,envName:i,onEnvNameChange:l,codespaces:c,codespaceError:d,codespaceListError:f,codespaceCreating:m,onCreateCodespace:p}){const[v,g]=y.useState("pick"),[b,x]=y.useState(""),[S,j]=y.useState("");return v==="create"?r.jsxs("div",{className:ne.codespaceSection,children:[r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"Repository"}),r.jsx("input",{type:"text",value:b,onChange:C=>x(C.target.value),placeholder:"owner/repo",className:ne.fieldInput,"data-testid":"env-codespace-repo"})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"Machine Type"}),r.jsx("input",{type:"text",value:S,onChange:C=>j(C.target.value),placeholder:"Machine type (optional)...",className:ne.fieldInput,"data-testid":"env-codespace-machine"})]}),r.jsxs("div",{className:ne.codespaceActions,children:[r.jsx("button",{onClick:()=>{b.trim()&&(p(b.trim(),S.trim()||void 0),g("pick"),x(""),j(""))},disabled:!b.trim(),className:ne.btnPrimary,children:"Create"}),r.jsx("button",{onClick:()=>{g("pick"),x(""),j("")},className:ne.btnGhost,children:"Cancel"})]})]}):r.jsx("div",{className:ne.codespaceSection,children:r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"Codespace"}),!f&&r.jsxs("select",{value:n,onChange:C=>{C.target.value==="__create__"?(g("create"),a("")):(a(C.target.value),C.target.value&&!i.trim()&&l(C.target.value))},disabled:m,className:ne.adapterSelect,"data-testid":"env-codespace-select",children:[r.jsx("option",{value:"",children:"Select a codespace..."}),c.map(C=>r.jsxs("option",{value:C.name,children:[C.name," (",C.repository,") — ",C.state]},C.name)),r.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),m&&r.jsx("span",{className:ne.creatingHint,children:"Creating codespace..."}),f&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:ne.errorHint,children:f}),r.jsx("input",{type:"text",value:n,onChange:C=>a(C.target.value),placeholder:"Or enter codespace name manually...",className:ne.fieldInput,"data-testid":"env-codespace-manual"})]}),d&&!f&&r.jsx("span",{className:ne.errorHint,children:d})]})})}function n_({mode:n,environmentId:a,environments:i,onAddEnvironment:l,onUpdateEnvironment:c,onListCodespaces:d,codespaces:f,codespaceError:m,codespaceListError:p,codespaceCreating:v,onCreateCodespace:g}){const{showToast:b}=Rs(),x=Et(),S=n==="edit",j=S&&a?i.find(re=>re.id===a):void 0,[C,N]=y.useState(""),[k,w]=y.useState("local"),[A,R]=y.useState(""),[E,H]=y.useState(""),[z,I]=y.useState(""),[Y,ee]=y.useState(""),[te,ie]=y.useState(""),[ce,K]=y.useState(""),[ae,O]=y.useState(""),[P,se]=y.useState(null),le=y.useCallback(()=>{const re={};if(k==="local"){if(A.trim()&&(re.host=A.trim()),E.trim()){const W=Number(E);Number.isInteger(W)&&(re.port=W)}}else if(k==="ssh"){if(re.host=A.trim(),z.trim()&&(re.user=z.trim()),E.trim()){const W=Number(E);Number.isInteger(W)&&(re.sshPort=W)}Y.trim()&&(re.identityFile=Y.trim())}else k==="docker"?(te.trim()&&(re.image=te.trim()),ce.trim()&&(re.repo=ce.trim())):k==="codespace"&&(re.codespaceName=ae.trim());return re},[k,A,E,z,Y,te,ce,ae]),q=()=>!(!C.trim()||k==="ssh"&&!A.trim()||k==="codespace"&&!ae.trim()||(k==="local"||k==="ssh")&&!of(E)),be=()=>{q()&&(l(C.trim(),k,le()),b("Environment added successfully","success"),x(Mi,{replace:!0}))},Ce=()=>{x(a?Oi(a):Mi)},xe=y.useCallback((re,W)=>{if(!j||!a)return;const tt=lf(j.adapterConfig),Re=W.trim();Re?tt[re]=Re:delete tt[re],c(a,{adapterConfig:tt})},[j,a,c]),J=y.useCallback((re,W)=>{if(!j||!a)return;const tt=lf(j.adapterConfig);if(W.trim()){const Re=Number(W);Number.isInteger(Re)&&Re>=Wr&&Re<=Jr&&(tt[re]=Re)}else delete tt[re];c(a,{adapterConfig:tt})},[j,a,c]);if(S){if(!j)return r.jsxs("div",{className:ne.container,children:[r.jsxs("div",{className:ne.header,children:[r.jsx("div",{className:ne.headerTitle,children:r.jsx("span",{className:ne.badge,children:"edit environment"})}),r.jsx("div",{className:ne.headerActions,children:r.jsx("button",{onClick:Ce,className:ne.btnGhost,children:"Back"})})]}),r.jsx("div",{className:ne.body,children:r.jsx("div",{className:ne.formContent,children:r.jsx("span",{className:ne.readOnlyValue,children:"Environment not found"})})})]});const re=lf(j.adapterConfig);return r.jsxs("div",{className:ne.container,"data-testid":"env-edit-panel",children:[r.jsxs("div",{className:ne.header,children:[r.jsx("div",{className:ne.headerTitle,children:r.jsx("span",{className:ne.badge,children:"edit environment"})}),r.jsx("div",{className:ne.headerActions,children:r.jsx("button",{onClick:Ce,className:ne.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),r.jsx("div",{className:ne.body,children:r.jsxs("div",{className:ne.formContent,children:[r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"Name"}),r.jsx(cn,{value:j.displayName,onSave:W=>{a&&c(a,{displayName:W})},validate:W=>W.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:P,onActivate:se,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"Adapter Type"}),r.jsx("span",{className:ne.readOnlyValue,"data-testid":"env-edit-adapter-type",children:j.adapterType})]}),j.adapterType==="local"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"Host"}),r.jsx(cn,{value:String(re.host??""),onSave:W=>xe("host",W),mode:"edit",fieldId:"host",activeFieldId:P,onActivate:se,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"Port"}),r.jsx(cn,{value:String(re.port??""),onSave:W=>J("port",W),validate:W=>of(W)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:P,onActivate:se,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),j.adapterType==="ssh"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"Host"}),r.jsx(cn,{value:String(re.host??""),onSave:W=>xe("host",W),validate:W=>W.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:P,onActivate:se,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"User"}),r.jsx(cn,{value:String(re.user??""),onSave:W=>xe("user",W),mode:"edit",fieldId:"user",activeFieldId:P,onActivate:se,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"SSH Port"}),r.jsx(cn,{value:String(re.sshPort??""),onSave:W=>J("sshPort",W),validate:W=>of(W)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:P,onActivate:se,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"Identity File"}),r.jsx(cn,{value:String(re.identityFile??""),onSave:W=>xe("identityFile",W),mode:"edit",fieldId:"identityFile",activeFieldId:P,onActivate:se,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),j.adapterType==="docker"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"Image"}),r.jsx(cn,{value:String(re.image??""),onSave:W=>xe("image",W),mode:"edit",fieldId:"image",activeFieldId:P,onActivate:se,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"Repo"}),r.jsx(cn,{value:String(re.repo??""),onSave:W=>xe("repo",W),mode:"edit",fieldId:"repo",activeFieldId:P,onActivate:se,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),j.adapterType==="codespace"&&r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,children:"Codespace Name"}),r.jsx(cn,{value:String(re.codespaceName??""),onSave:W=>xe("codespaceName",W),validate:W=>W.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:P,onActivate:se,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return r.jsxs("div",{className:ne.container,"data-testid":"env-create-panel",children:[r.jsxs("div",{className:ne.header,children:[r.jsx("div",{className:ne.headerTitle,children:r.jsx("span",{className:ne.badge,children:"new environment"})}),r.jsxs("div",{className:ne.headerActions,children:[r.jsx("button",{onClick:be,disabled:!q(),className:ne.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),r.jsx("button",{onClick:Ce,className:ne.btnGhost,children:"Cancel"})]})]}),r.jsx("div",{className:ne.body,children:r.jsxs("div",{className:ne.formContent,children:[r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,htmlFor:"env-create-name",children:"Name"}),r.jsx("input",{id:"env-create-name",type:"text",value:C,onChange:re=>N(re.target.value),placeholder:"Environment name...",autoFocus:!0,className:ne.nameInput,"data-testid":"env-create-name",onKeyDown:re=>{re.key==="Enter"&&q()&&be()}})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),r.jsxs("select",{id:"env-create-adapter",value:k,onChange:re=>{w(re.target.value),re.target.value==="codespace"&&d()},className:ne.adapterSelect,"data-testid":"env-create-adapter",children:[r.jsx("option",{value:"local",children:"local"}),r.jsx("option",{value:"ssh",children:"ssh"}),r.jsx("option",{value:"docker",children:"docker"}),r.jsx("option",{value:"codespace",children:"codespace"})]})]}),k==="local"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,htmlFor:"env-create-host",children:"Host"}),r.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:re=>R(re.target.value),placeholder:"Host (optional)...",className:ne.fieldInput,"data-testid":"env-create-host"})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,htmlFor:"env-create-port",children:"Port"}),r.jsx("input",{id:"env-create-port",type:"number",min:Wr,max:Jr,value:E,onChange:re=>H(re.target.value),placeholder:"Port (optional)...",className:ne.fieldInput,"data-testid":"env-create-port"})]})]}),k==="ssh"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,htmlFor:"env-create-host",children:"Host"}),r.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:re=>R(re.target.value),placeholder:"Host (required)...",className:ne.fieldInput,"data-testid":"env-create-host"})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,htmlFor:"env-create-user",children:"User"}),r.jsx("input",{id:"env-create-user",type:"text",value:z,onChange:re=>I(re.target.value),placeholder:"User (optional)...",className:ne.fieldInput,"data-testid":"env-create-user"})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,htmlFor:"env-create-port",children:"SSH Port"}),r.jsx("input",{id:"env-create-port",type:"number",min:Wr,max:Jr,value:E,onChange:re=>H(re.target.value),placeholder:"SSH port (optional)...",className:ne.fieldInput,"data-testid":"env-create-port"})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,htmlFor:"env-create-identity",children:"Identity File"}),r.jsx("input",{id:"env-create-identity",type:"text",value:Y,onChange:re=>ee(re.target.value),placeholder:"Identity file (optional)...",className:ne.fieldInput,"data-testid":"env-create-identity"})]})]}),k==="docker"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,htmlFor:"env-create-image",children:"Image"}),r.jsx("input",{id:"env-create-image",type:"text",value:te,onChange:re=>ie(re.target.value),placeholder:"Image (optional)...",className:ne.fieldInput,"data-testid":"env-create-image"})]}),r.jsxs("div",{className:ne.section,children:[r.jsx("label",{className:ne.label,htmlFor:"env-create-repo",children:"Repo"}),r.jsx("input",{id:"env-create-repo",type:"text",value:ce,onChange:re=>K(re.target.value),placeholder:"Repo (optional)...",className:ne.fieldInput,"data-testid":"env-create-repo"})]})]}),k==="codespace"&&r.jsx(xB,{codespaceName:ae,onCodespaceNameChange:O,envName:C,onEnvNameChange:N,codespaces:f,codespaceError:m,codespaceListError:p,codespaceCreating:v,onCreateCodespace:g})]})})]})}function _B(){const{environments:n,addEnvironment:a,updateEnvironment:i,listCodespaces:l,codespaces:c,codespaceError:d,codespaceListError:f,codespaceCreating:m,createCodespace:p}=rt();return r.jsx(n_,{mode:"new",environments:n,onAddEnvironment:a,onUpdateEnvironment:i,onListCodespaces:l,codespaces:c,codespaceError:d,codespaceListError:f,codespaceCreating:m,onCreateCodespace:p})}function SB(){const{environmentId:n}=Wa(),{environments:a,addEnvironment:i,updateEnvironment:l,listCodespaces:c,codespaces:d,codespaceError:f,codespaceListError:m,codespaceCreating:p,createCodespace:v}=rt();return r.jsx(n_,{mode:"edit",environmentId:n,environments:a,onAddEnvironment:i,onUpdateEnvironment:l,onListCodespaces:c,codespaces:d,codespaceError:f,codespaceListError:m,codespaceCreating:p,onCreateCodespace:v})}const TB="_layout_11u79_1",kB="_content_11u79_8",jB="_tabPanel_11u79_14",el={layout:TB,content:kB,tabPanel:jB};function NB(){const n=w6();return r.jsxs("div",{className:el.layout,children:[r.jsx(Os,{segments:n}),r.jsx("div",{className:el.content,children:r.jsx(As,{})})]})}const CB="_container_13sb6_1",wB="_envHeader_13sb6_6",EB="_envTitleRow_13sb6_10",AB="_statusDot_13sb6_16",DB="_envName_13sb6_21",RB="_statusBadge_13sb6_27",MB="_envMeta_13sb6_33",OB="_metaTag_13sb6_39",BB="_actions_13sb6_51",LB="_provisionMessage_13sb6_59",IB="_errorMessage_13sb6_64",zB="_section_13sb6_69",UB="_sectionHeader_13sb6_73",VB="_cardList_13sb6_121",HB="_card_13sb6_121",GB="_cardHeader_13sb6_138",PB="_cardName_13sb6_144",$B="_cardActions_13sb6_149",qB="_cardDescription_13sb6_154",KB="_cardMeta_13sb6_160",YB="_repoLink_13sb6_166",FB="_empty_13sb6_174",ZB="_btnPrimary_13sb6_180",XB="_btnOutline_13sb6_214",QB="_btnSmall_13sb6_241",WB="_btnDanger_13sb6_267",Le={container:CB,envHeader:wB,envTitleRow:EB,statusDot:AB,envName:DB,statusBadge:RB,envMeta:MB,metaTag:OB,actions:BB,provisionMessage:LB,errorMessage:IB,section:zB,sectionHeader:UB,cardList:VB,card:HB,cardHeader:GB,cardName:PB,cardActions:$B,cardDescription:qB,cardMeta:KB,repoLink:YB,empty:FB,btnPrimary:ZB,btnOutline:XB,btnSmall:QB,btnDanger:WB},JB={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function e5(){const{environmentId:n}=Wa(),a=Et(),{environments:i,workspaces:l,sessions:c,provisionStatus:d,provisionEnvironment:f,stopEnvironment:m,removeEnvironment:p,archiveWorkspace:v}=rt(),[g,b]=y.useState(!1),[x,S]=y.useState(!1),[j,C]=y.useState(void 0),N=i.find(ie=>ie.id===n);if(!n||!N)return r.jsx(Pn,{to:Mi,replace:!0});const k=l.filter(ie=>ie.environmentId===N.id),w=c.filter(ie=>ie.environmentId===N.id),A=w.reduce((ie,ce)=>ie+(ce.costUsd??0),0),R=JB[N.status]||"var(--text-tertiary)",E=N.status==="connected",H=N.status==="connecting",z=N.status==="disconnected"||N.status==="error",I=N.id in d?d[N.id]:void 0,Y=()=>{p(N.id),b(!1),a(Mi,{replace:!0})},ee=()=>{S(!1),f(N.id,!0)},te=ie=>{v(ie),C(void 0)};return r.jsxs("div",{className:Le.container,children:[r.jsx(rl,{isOpen:g,title:"Delete Environment?",description:`"${N.displayName||N.id}" will be permanently removed along with all its data.`,onConfirm:Y,onCancel:()=>b(!1)}),r.jsx(rl,{isOpen:x,title:"Reprovision Environment?",description:"This will kill any active session and force a fresh provision cycle. The environment will be temporarily disconnected.",confirmLabel:"Reprovision",onConfirm:ee,onCancel:()=>S(!1)}),r.jsxs("div",{className:Le.envHeader,children:[r.jsxs("div",{className:Le.envTitleRow,children:[r.jsx("span",{className:Le.statusDot,style:{color:R},children:"●"}),r.jsx("h2",{className:Le.envName,children:N.displayName||N.id}),r.jsx("span",{className:Le.statusBadge,style:{color:R},children:N.status})]}),r.jsxs("div",{className:Le.envMeta,children:[r.jsxs("span",{className:Le.metaTag,children:["Adapter: ",N.adapterType]}),w.length>0&&r.jsxs("span",{className:Le.metaTag,children:[w.length," session",w.length!==1?"s":""]}),A>0&&r.jsxs("span",{className:Le.metaTag,children:["Cost: ",zi(A)]})]})]}),r.jsxs("div",{className:Le.actions,children:[E&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:Le.btnPrimary,onClick:()=>a(W0(N.id)),children:"New Chat"}),r.jsx("button",{className:Le.btnOutline,onClick:()=>m(N.id),children:"Stop"}),r.jsx("button",{className:Le.btnOutline,onClick:()=>S(!0),disabled:I!==void 0,"data-testid":"env-reprovision-btn",children:"Reprovision"})]}),z&&r.jsx("button",{className:Le.btnPrimary,onClick:()=>f(N.id),children:N.status==="error"?"Retry":"Connect"}),H&&I!==void 0&&r.jsx("span",{className:Le.provisionMessage,children:I.message}),N.status==="error"&&(I==null?void 0:I.stage)==="error"&&r.jsx("span",{className:Le.errorMessage,children:I.message}),r.jsx("button",{className:Le.btnOutline,onClick:()=>a(Dk(N.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),r.jsx("button",{className:Le.btnDanger,onClick:()=>b(!0),children:"Delete"})]}),r.jsxs("div",{className:Le.section,children:[r.jsxs("div",{className:Le.sectionHeader,children:[r.jsx("h3",{children:"Workspaces"}),r.jsx("button",{className:Le.btnPrimary,onClick:()=>a(`${J0}?environment=${encodeURIComponent(N.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"})]}),k.length===0&&r.jsx("p",{className:Le.empty,children:"No workspaces yet. Create one to get started."}),r.jsx("div",{className:Le.cardList,children:k.map(ie=>r.jsx(t5,{workspace:ie,confirmArchiveId:j,onOpen:()=>a(Ri(ie.id,N.id)),onArchive:()=>C(ie.id),onConfirmArchive:()=>te(ie.id),onCancelArchive:()=>C(void 0)},ie.id))})]})]})}function t5({workspace:n,confirmArchiveId:a,onOpen:i,onArchive:l,onConfirmArchive:c,onCancelArchive:d}){const f=a===n.id,m=n.repoUrl&&/^https?:\/\//.test(n.repoUrl);return r.jsxs("div",{className:Le.card,"data-testid":"workspace-card",children:[r.jsxs("div",{className:Le.cardHeader,children:[r.jsx("strong",{className:Le.cardName,children:n.name}),r.jsxs("div",{className:Le.cardActions,children:[r.jsx("button",{className:Le.btnSmall,onClick:i,children:"Open"}),f?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:Le.btnDanger,onClick:c,children:"Confirm"}),r.jsx("button",{className:Le.btnSmall,onClick:d,children:"Cancel"})]}):r.jsx("button",{className:Le.btnSmall,onClick:l,children:"Archive"})]})]}),n.description&&r.jsx("p",{className:Le.cardDescription,children:n.description}),n.repoUrl&&r.jsx("div",{className:Le.cardMeta,children:m?r.jsx("a",{href:n.repoUrl,target:"_blank",rel:"noopener noreferrer",className:Le.repoLink,children:n.repoUrl}):r.jsx("span",{children:n.repoUrl})})]})}const n5={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About",shortcuts:"Shortcuts"};function a5(){const a=wt().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=n5[a],l=C6(i);return r.jsxs("div",{className:el.layout,children:[r.jsx(Os,{segments:l}),r.jsx("div",{className:el.content,children:r.jsx("div",{className:el.tabPanel,children:r.jsx(As,{})},a)})]})}const s5="_section_1ingb_14",i5="_sectionTitle_1ingb_26",o5="_sectionDescription_1ingb_35",l5="_tokenList_1ingb_48",r5="_tokenRow_1ingb_55",c5="_tokenBadge_1ingb_68",u5="_tokenName_1ingb_83",d5="_tokenTarget_1ingb_90",f5="_deleteButton_1ingb_99",h5="_addForm_1ingb_113",m5="_formRow_1ingb_119",p5="_input_1ingb_125",v5="_select_1ingb_155",g5="_addButton_1ingb_187",y5="_emptyStateInfo_1ingb_221",b5="_themeOptions_1ingb_229",x5="_themeOption_1ingb_229",_5="_themeOptionSelected_1ingb_254",S5="_themeOptionHeader_1ingb_259",T5="_themeOptionLabel_1ingb_266",k5="_themeOptionDesc_1ingb_273",j5="_variantToggle_1ingb_279",N5="_variantButton_1ingb_286",C5="_variantActive_1ingb_305",w5="_themeSwatches_1ingb_311",E5="_themeSwatch_1ingb_311",A5="_systemToggle_1ingb_325",D5="_systemToggleHint_1ingb_341",R5="_themeActive_1ingb_348",M5="_aboutGrid_1ingb_354",O5="_aboutItem_1ingb_360",B5="_aboutLabel_1ingb_373",L5="_aboutValue_1ingb_379",I5="_aboutDot_1ingb_387",z5="_aboutDotConnected_1ingb_394",U5="_aboutDotDisconnected_1ingb_398",ue={section:s5,sectionTitle:i5,sectionDescription:o5,tokenList:l5,tokenRow:r5,tokenBadge:c5,tokenName:u5,tokenTarget:d5,deleteButton:f5,addForm:h5,formRow:m5,input:p5,select:v5,addButton:g5,emptyStateInfo:y5,themeOptions:b5,themeOption:x5,themeOptionSelected:_5,themeOptionHeader:S5,themeOptionLabel:T5,themeOptionDesc:k5,variantToggle:j5,variantButton:N5,variantActive:C5,themeSwatches:w5,themeSwatch:E5,systemToggle:A5,systemToggleHint:D5,themeActive:R5,aboutGrid:M5,aboutItem:O5,aboutLabel:B5,aboutValue:L5,aboutDot:I5,aboutDotConnected:z5,aboutDotDisconnected:U5},V5=[{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 H5({credentialProviders:n,onUpdateCredentialProviders:a}){const i=(l,c)=>{const d={...n};l==="claude"?d.claude=c:d[l]=c,a(d)};return r.jsxs("section",{className:ue.section,children:[r.jsx("h3",{className:ue.sectionTitle,children:"Credential Providers"}),r.jsx("p",{className:ue.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),r.jsx("div",{className:ue.tokenList,children:V5.map(l=>r.jsxs("div",{className:ue.tokenRow,children:[r.jsx("span",{className:ue.tokenName,children:l.label}),r.jsx("span",{className:ue.tokenTarget,children:l.description}),r.jsx("select",{className:ue.select,value:n[l.key],onChange:c=>i(l.key,c.target.value),children:l.options.map(c=>r.jsx("option",{value:c.value,children:c.label},c.value))})]},l.key))})]})}const G5=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function P5({tokens:n,onSetToken:a,onDeleteToken:i}){const{showToast:l}=Rs(),[c,d]=y.useState(""),[f,m]=y.useState(""),[p,v]=y.useState("env_var"),[g,b]=y.useState(""),[x,S]=y.useState(null),j=k=>{if(k.preventDefault(),!c||!f)return;const w=p==="env_var"?g||c.toUpperCase()+"_TOKEN":"";a(c,f,p,w,p==="file"?g:""),l("Token saved successfully","success"),d(""),m(""),b("")},C=k=>{S(k)},N=()=>{x&&(i(x),l("Token deleted","info")),S(null)};return r.jsxs(r.Fragment,{children:[r.jsx(rl,{isOpen:x!==null,title:"Delete Token?",description:x?`"${x}" will be permanently removed.`:void 0,onConfirm:N,onCancel:()=>S(null)}),r.jsxs("section",{className:ue.section,children:[r.jsx("h3",{className:ue.sectionTitle,children:"Tokens"}),r.jsx("p",{className:ue.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?r.jsx("div",{className:ue.emptyStateInfo,children:"Add your first API token to enable service integrations."}):r.jsx("div",{className:ue.tokenList,children:n.map(k=>r.jsxs("div",{className:ue.tokenRow,children:[r.jsx("span",{className:ue.tokenBadge,children:k.tokenType}),r.jsx("span",{className:ue.tokenName,children:k.name}),r.jsx("span",{className:ue.tokenTarget,children:k.tokenType==="env_var"?k.envVar:k.filePath}),r.jsx("button",{className:ue.deleteButton,onClick:()=>C(k.name),title:`Delete ${k.name}`,children:"×"})]},k.name))}),r.jsxs("form",{className:ue.addForm,onSubmit:j,children:[r.jsxs("div",{className:ue.formRow,children:[r.jsx("input",{className:ue.input,type:"text",placeholder:"Token name",value:c,onChange:k=>d(k.target.value)}),r.jsx("input",{className:ue.input,type:"password",placeholder:"Value",value:f,onChange:k=>m(k.target.value)})]}),r.jsxs("div",{className:ue.formRow,children:[r.jsx("select",{className:ue.select,value:p,onChange:k=>v(k.target.value),children:G5.map(k=>r.jsx("option",{value:k.value,children:k.label},k.value))}),r.jsx("input",{className:ue.input,type:"text",placeholder:p==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:g,onChange:k=>b(k.target.value)}),r.jsx("button",{className:ue.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function $5(){const{tokens:n,setToken:a,deleteToken:i,credentialProviders:l,updateCredentialProviders:c}=rt();return r.jsxs(r.Fragment,{children:[r.jsx(H5,{credentialProviders:l,onUpdateCredentialProviders:c}),r.jsx(P5,{tokens:n,onSetToken:a,onDeleteToken:i})]})}const q5="_container_xb7ms_1",K5="_header_xb7ms_7",Y5="_form_xb7ms_19",F5="_formActions_xb7ms_87",Z5="_list_xb7ms_93",X5="_card_xb7ms_99",Q5="_active_xb7ms_109",W5="_cardHeader_xb7ms_113",J5="_cardTitle_xb7ms_123",eL="_defaultBadge_xb7ms_129",tL="_cardActions_xb7ms_143",nL="_description_xb7ms_148",aL="_meta_xb7ms_154",sL="_promptDetails_xb7ms_171",iL="_promptText_xb7ms_183",oL="_empty_xb7ms_200",lL="_btnPrimary_xb7ms_206",rL="_btnSecondary_xb7ms_240",cL="_btnSmall_xb7ms_267",uL="_btnDanger_xb7ms_293",dL="_typeToggle_xb7ms_336",fL="_typeBadge_xb7ms_350",hL="_scriptEditor_xb7ms_364",mL="_optional_xb7ms_371",qe={container:q5,header:K5,form:Y5,formActions:F5,list:Z5,card:X5,active:Q5,cardHeader:W5,cardTitle:J5,defaultBadge:eL,cardActions:tL,description:nL,meta:aL,promptDetails:sL,promptText:iL,empty:oL,btnPrimary:lL,btnSecondary:rL,btnSmall:cL,btnDanger:uL,typeToggle:dL,typeBadge:fL,scriptEditor:hL,optional:mL};function pL({personas:n,appDefaultPersonaId:a,onCreatePersona:i,onUpdatePersona:l,onDeletePersona:c,onSetAppDefaultPersonaId:d}){const[f,m]=y.useState(null),[p,v]=y.useState(!1),[g,b]=y.useState(null),[x,S]=y.useState(""),[j,C]=y.useState(""),[N,k]=y.useState(""),[w,A]=y.useState("claude-code"),[R,E]=y.useState("sonnet"),[H,z]=y.useState(0),[I,Y]=y.useState("agent"),[ee,te]=y.useState(""),ie=()=>{S(""),C(""),k(""),A("claude-code"),E("sonnet"),z(0),Y("agent"),te("")},ce=()=>{ie(),m(null),v(!0)},K=q=>{S(q.name),C(q.description),k(q.systemPrompt);const be=q.type==="script"?"script":"agent";A(be==="script"?q.runtime||"genaiscript":q.runtime),E(q.model),z(q.maxTurns),Y(be),te(q.script||""),m(q),v(!1)},ae=q=>{Y(q),q==="script"?A("genaiscript"):w==="genaiscript"&&A("claude-code")},O=q=>{if(q.preventDefault(),!!x.trim()){if(I==="script"){if(!ee.trim())return}else if(!N.trim()||!w||!R)return;f?(l(f.id,x,j,N,w,R,H,I,ee),m(null)):(i(x,j,N,w,R,H,I,ee),v(!1)),ie()}},P=q=>{c(q),b(null),(f==null?void 0:f.id)===q&&(m(null),ie())},se=()=>{m(null),v(!1),ie()},le=()=>r.jsxs("form",{onSubmit:O,className:qe.form,children:[r.jsx("h3",{children:f?"Edit Persona":"Create Persona"}),r.jsxs("div",{className:qe.typeToggle,"data-testid":"persona-type-toggle",children:[r.jsxs("label",{children:[r.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:I==="agent",onChange:()=>ae("agent")}),"Agent"]}),r.jsxs("label",{children:[r.jsx("input",{type:"radio",name:"personaType",value:"script",checked:I==="script",onChange:()=>ae("script")}),"Script"]})]}),r.jsxs("label",{children:["Name",r.jsx("input",{type:"text",value:x,onChange:q=>S(q.target.value),placeholder:I==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0})]}),r.jsxs("label",{children:["Description",r.jsx("input",{type:"text",value:j,onChange:q=>C(q.target.value),placeholder:"Brief description..."})]}),r.jsxs("label",{children:["Runtime",r.jsx("select",{value:w,onChange:q=>A(q.target.value),"data-testid":"persona-runtime-select",children:I==="script"?r.jsx("option",{value:"genaiscript",children:"genaiscript"}):r.jsxs(r.Fragment,{children:[r.jsx("option",{value:"claude-code",children:"claude-code"}),r.jsx("option",{value:"codex",children:"codex"}),r.jsx("option",{value:"copilot",children:"copilot"}),r.jsx("option",{value:"goose",children:"goose"}),r.jsx("option",{value:"stub",children:"stub"}),r.jsx("option",{value:"claude-code-acp",children:"claude-code-acp (experimental)"}),r.jsx("option",{value:"codex-acp",children:"codex-acp (experimental)"}),r.jsx("option",{value:"copilot-acp",children:"copilot-acp (experimental)"})]})})]}),I==="agent"&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{children:["Model",r.jsx("input",{type:"text",value:R,onChange:q=>E(q.target.value),placeholder:"e.g. sonnet"})]}),r.jsxs("label",{children:["Max Turns",r.jsx("input",{type:"number",value:H,onChange:q=>z(parseInt(q.target.value,10)||0),min:0})]}),r.jsxs("label",{children:["System Prompt",r.jsx("textarea",{value:N,onChange:q=>k(q.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]})]}),I==="script"&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{children:["Model ",r.jsx("span",{className:qe.optional,children:"(optional)"}),r.jsx("input",{type:"text",value:R,onChange:q=>E(q.target.value),placeholder:"e.g. sonnet (leave empty for script-only)"})]}),r.jsxs("label",{children:["System Prompt ",r.jsx("span",{className:qe.optional,children:"(optional)"}),r.jsx("textarea",{value:N,onChange:q=>k(q.target.value),placeholder:"Optional context for the script...",rows:4})]}),r.jsxs("label",{children:["Script",r.jsx("textarea",{value:ee,onChange:q=>te(q.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:qe.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),r.jsxs("div",{className:qe.formActions,children:[r.jsx("button",{type:"submit",className:qe.btnPrimary,children:f?"Save":"Create"}),r.jsx("button",{type:"button",onClick:se,className:qe.btnSecondary,children:"Cancel"})]})]});return r.jsxs("div",{className:qe.container,children:[r.jsxs("div",{className:qe.header,children:[r.jsx("h2",{children:"Personas"}),r.jsx("button",{onClick:ce,className:qe.btnPrimary,children:"+ New Persona"})]}),(p||f)&&le(),n.length===0&&!p?r.jsx("p",{className:qe.empty,children:"No personas yet. Create one to get started."}):r.jsx("div",{className:qe.list,children:n.map(q=>{const be=a===q.id,Ce=q.type==="script";return r.jsxs("div",{className:`${qe.card} ${(f==null?void 0:f.id)===q.id?qe.active:""}`,"data-testid":`persona-card-${q.id}`,children:[r.jsxs("div",{className:qe.cardHeader,children:[r.jsxs("span",{className:qe.cardTitle,children:[r.jsx("strong",{children:q.name}),r.jsx("span",{className:qe.typeBadge,"data-testid":`persona-type-badge-${q.id}`,children:Ce?"Script":"Agent"}),be&&r.jsx("span",{className:qe.defaultBadge,"data-testid":`persona-default-badge-${q.id}`,children:"App Default"})]}),r.jsxs("div",{className:qe.cardActions,children:[!be&&r.jsx("button",{onClick:()=>d(q.id),className:qe.btnSmall,"data-testid":`persona-set-default-${q.id}`,title:"Set as app default persona",children:"Set Default"}),r.jsx("button",{onClick:()=>K(q),className:qe.btnSmall,children:"Edit"}),g===q.id?r.jsxs(r.Fragment,{children:[r.jsx("button",{onClick:()=>P(q.id),className:qe.btnDanger,children:"Confirm"}),r.jsx("button",{onClick:()=>b(null),className:qe.btnSmall,children:"Cancel"})]}):r.jsx("button",{onClick:()=>b(q.id),className:qe.btnSmall,children:"Delete"})]})]}),q.description&&r.jsx("p",{className:qe.description,children:q.description}),r.jsxs("div",{className:qe.meta,children:[q.runtime&&r.jsxs("span",{children:["Runtime: ",q.runtime]}),q.model&&r.jsxs("span",{children:["Model: ",q.model]}),q.maxTurns>0&&r.jsxs("span",{children:["Max turns: ",q.maxTurns]})]}),Ce?r.jsxs("details",{className:qe.promptDetails,children:[r.jsx("summary",{children:"Script"}),r.jsx("pre",{className:qe.promptText,children:q.script})]}):r.jsxs("details",{className:qe.promptDetails,children:[r.jsx("summary",{children:"System Prompt"}),r.jsx("pre",{className:qe.promptText,children:q.systemPrompt})]})]},q.id)})})]})}function vL(){const{personas:n,createPersona:a,updatePersona:i,deletePersona:l,appDefaultPersonaId:c,setAppDefaultPersonaId:d}=rt();return r.jsx(pL,{personas:n,appDefaultPersonaId:c,onCreatePersona:a,onUpdatePersona:i,onDeletePersona:l,onSetAppDefaultPersonaId:d})}function gL(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:l,setPreferSystem:c}=lb();return r.jsxs("section",{className:ue.section,children:[r.jsx("h3",{className:ue.sectionTitle,children:"Appearance"}),r.jsx("p",{className:ue.sectionDescription,children:"Choose how Grackle looks across the app."}),r.jsx("div",{className:ue.themeOptions,children:mc.filter(d=>!d.hidden).map(d=>{const f=!!(d.variantLightId&&d.variantDarkId),m=f?n===d.id||n===d.variantLightId||n===d.variantDarkId:n===d.id,p=f&&a===d.variantLightId;return r.jsxs("button",{type:"button",className:`${ue.themeOption} ${m?ue.themeOptionSelected:""}`,"aria-pressed":m,onClick:()=>i(d.id),children:[r.jsxs("span",{className:ue.themeOptionHeader,children:[r.jsxs("span",{children:[r.jsx("span",{className:ue.themeOptionLabel,children:d.label}),r.jsx("span",{className:ue.themeOptionDesc,children:d.description})]}),f&&r.jsxs("span",{className:ue.variantToggle,children:[r.jsx("span",{role:"button",tabIndex:0,className:`${ue.variantButton} ${m&&p?ue.variantActive:""}`,onClick:v=>{v.stopPropagation(),c(!1),i(d.variantLightId)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),c(!1),i(d.variantLightId))},"aria-label":"Light variant","aria-pressed":m&&p,children:"☼"}),r.jsx("span",{role:"button",tabIndex:0,className:`${ue.variantButton} ${m&&!p?ue.variantActive:""}`,onClick:v=>{v.stopPropagation(),c(!1),i(d.variantDarkId)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),c(!1),i(d.variantDarkId))},"aria-label":"Dark variant","aria-pressed":m&&!p,children:"☾"})]})]}),d.swatches&&r.jsx("span",{className:ue.themeSwatches,children:d.swatches.map((v,g)=>r.jsx("span",{className:ue.themeSwatch,style:{background:v}},g))})]},d.id)})}),r.jsxs("label",{className:ue.systemToggle,children:[r.jsx("input",{type:"checkbox",checked:l,onChange:d=>c(d.target.checked)}),r.jsx("span",{children:"Match system light/dark preference"})]}),r.jsx("p",{className:ue.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),r.jsxs("p",{className:ue.themeActive,children:["Active theme: ",r.jsx("strong",{children:a})]})]})}function yL(){return r.jsx(gL,{})}function bL({connected:n,environments:a,sessions:i}){const l=a.filter(f=>f.status==="connected").length,c=a.length,d=i.filter(f=>["running","idle"].includes(f.status)).length;return r.jsxs("section",{className:ue.section,"data-testid":"about-panel",children:[r.jsx("h3",{className:ue.sectionTitle,children:"About"}),r.jsx("p",{className:ue.sectionDescription,children:"Connection status and application information."}),r.jsxs("div",{className:ue.aboutGrid,children:[r.jsxs("div",{className:ue.aboutItem,children:[r.jsx("span",{className:ue.aboutLabel,children:"Connection"}),r.jsxs("span",{className:ue.aboutValue,children:[r.jsx("span",{className:`${ue.aboutDot} ${n?ue.aboutDotConnected:ue.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),r.jsxs("div",{className:ue.aboutItem,children:[r.jsx("span",{className:ue.aboutLabel,children:"Environments"}),r.jsxs("span",{className:ue.aboutValue,children:[l,"/",c," connected"]})]}),r.jsxs("div",{className:ue.aboutItem,children:[r.jsx("span",{className:ue.aboutLabel,children:"Active Sessions"}),r.jsx("span",{className:ue.aboutValue,children:d})]}),r.jsxs("div",{className:ue.aboutItem,children:[r.jsx("span",{className:ue.aboutLabel,children:"Version"}),r.jsx("span",{className:ue.aboutValue,children:"0.75.13"})]})]})]})}function xL(){const{connected:n,environments:a,sessions:i}=rt();return r.jsx(bL,{connected:n,environments:a,sessions:i})}const _L="_group_1iprv_1",SL="_groupTitle_1iprv_8",TL="_shortcutList_1iprv_17",kL="_shortcutRow_1iprv_23",jL="_keys_1iprv_36",NL="_kbd_1iprv_43",CL="_description_1iprv_60",_s={group:_L,groupTitle:SL,shortcutList:TL,shortcutRow:kL,keys:jL,kbd:NL,description:CL},wL=[{title:"Global",shortcuts:[{keys:["?"],description:"Open keyboard shortcuts reference"},{keys:["N"],description:"Create a new task"},{keys:["Escape"],description:"Close dialog or cancel editing"}]},{title:"Task Page",shortcuts:[{keys:["1"],description:"Switch to Overview tab"},{keys:["2"],description:"Switch to Stream tab"},{keys:["3"],description:"Switch to Findings tab"}]},{title:"Workspace Page",shortcuts:[{keys:["1"],description:"Switch to Graph view"},{keys:["2"],description:"Switch to Board view"},{keys:["3"],description:"Switch to Tasks view"}]},{title:"Navigation Lists",shortcuts:[{keys:["←"],description:"Previous tab (horizontal nav)"},{keys:["→"],description:"Next tab (horizontal nav)"},{keys:["↑"],description:"Previous item (vertical nav)"},{keys:["↓"],description:"Next item (vertical nav)"},{keys:["J"],description:"Next item (alias for arrow down/right)"},{keys:["K"],description:"Previous item (alias for arrow up/left)"},{keys:["Home"],description:"Jump to first item"},{keys:["End"],description:"Jump to last item"}]},{title:"Editing",shortcuts:[{keys:["Enter"],description:"Activate / save inline edit"},{keys:["Space"],description:"Activate button or start editing"},{keys:["Escape"],description:"Cancel edit and discard changes"}]},{title:"Chat",shortcuts:[{keys:["Enter"],description:"Send message (when input is focused)"}]}];function EL(){return r.jsxs("section",{className:ue.section,"data-testid":"keyboard-shortcuts-panel",children:[r.jsx("h3",{className:ue.sectionTitle,children:"Keyboard Shortcuts"}),r.jsx("p",{className:ue.sectionDescription,children:"Keyboard shortcuts for navigating and interacting with Grackle. Global shortcuts are suppressed while typing in text fields."}),wL.map(n=>r.jsxs("div",{className:_s.group,children:[r.jsx("h4",{className:_s.groupTitle,children:n.title}),r.jsx("div",{className:_s.shortcutList,children:n.shortcuts.map(a=>r.jsxs("div",{className:_s.shortcutRow,children:[r.jsx("span",{className:_s.keys,children:a.keys.map(i=>r.jsx("kbd",{className:_s.kbd,children:i},i))}),r.jsx("span",{className:_s.description,children:a.description})]},a.description))})]},n.title))]})}function AL(){return r.jsx(EL,{})}const w0=Ds();function DL(){const n=Et();return ga({key:"?"},()=>{n(Mk)}),ga({key:"n"},()=>{n(w0)}),ga({key:"N"},()=>{n(w0)}),r.jsx(r.Fragment,{})}const RL="_wizard_1260s_1",ML="_container_1260s_10",OL="_stepContent_1260s_19",BL="_logoArea_1260s_28",LL="_logoImage_1260s_32",IL="_heading_1260s_41",zL="_tagline_1260s_49",UL="_subtitle_1260s_56",VL="_featureList_1260s_64",HL="_runtimeGrid_1260s_89",GL="_runtimeCard_1260s_101",PL="_runtimeName_1260s_133",$L="_runtimeDescription_1260s_139",qL="_buttonRow_1260s_144",KL="_primaryButton_1260s_151",YL="_ghostButton_1260s_185",FL="_dots_1260s_213",ZL="_dot_1260s_213",nt={wizard:RL,container:ML,stepContent:OL,logoArea:BL,logoImage:LL,heading:IL,tagline:zL,subtitle:UL,featureList:VL,runtimeGrid:HL,runtimeCard:GL,runtimeName:PL,runtimeDescription:$L,buttonRow:qL,primaryButton:KL,ghostButton:YL,dots:FL,dot:ZL};function XL({onNext:n}){return r.jsxs("div",{className:nt.stepContent,"data-testid":"setup-welcome",children:[r.jsx("div",{className:nt.logoArea,children:r.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:nt.logoImage})}),r.jsx("h1",{className:nt.heading,children:"Welcome to Grackle"}),r.jsx("p",{className:nt.tagline,children:"Multi-agent orchestration for software teams"}),r.jsx("button",{type:"button",className:nt.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function QL({onNext:n,onBack:a}){return r.jsxs("div",{className:nt.stepContent,"data-testid":"setup-about",children:[r.jsx("h2",{className:nt.heading,children:"What is Grackle?"}),r.jsxs("ul",{className:nt.featureList,children:[r.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),r.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),r.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),r.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),r.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),r.jsxs("div",{className:nt.buttonRow,children:[r.jsx("button",{type:"button",className:nt.ghostButton,onClick:a,children:"Back"}),r.jsx("button",{type:"button",className:nt.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const WL=[{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 JL({currentRuntime:n,onFinish:a,onBack:i,finishDisabled:l}){const[c,d]=y.useState(n||"claude-code");return y.useEffect(()=>{n&&d(n)},[n]),r.jsxs("div",{className:nt.stepContent,"data-testid":"setup-runtime",children:[r.jsx("h2",{className:nt.heading,children:"Choose Your Runtime"}),r.jsx("p",{className:nt.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),r.jsx("div",{className:nt.runtimeGrid,children:WL.map(f=>r.jsxs("button",{type:"button",className:nt.runtimeCard,"data-selected":c===f.id,"aria-pressed":c===f.id,"data-testid":`runtime-card-${f.id}`,onClick:()=>d(f.id),children:[r.jsx("span",{className:nt.runtimeName,children:f.name}),r.jsx("span",{className:nt.runtimeDescription,children:f.description})]},f.id))}),r.jsxs("div",{className:nt.buttonRow,children:[r.jsx("button",{type:"button",className:nt.ghostButton,onClick:i,children:"Back"}),r.jsx("button",{type:"button",className:nt.primaryButton,onClick:()=>a(c),disabled:l,"data-testid":"setup-finish",children:"Finish"})]})]})}const eI=3,E0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function tI(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:l}=rt(),c=Et(),[d,f]=y.useState(0),m=n.find(v=>v.id==="claude-code"),p=y.useCallback(v=>{if(m&&v!==m.runtime){const b=E0[v]??"sonnet";a(m.id,void 0,void 0,void 0,v,b)}const g=n.find(b=>b.id===Dg);if(g&&v!==g.runtime){const b=E0[v]??"sonnet";a(Dg,void 0,void 0,void 0,v,b)}i(),c("/",{replace:!0})},[m,n,a,i,c]);return l===!0?r.jsx(Pn,{to:"/",replace:!0}):r.jsx("div",{className:nt.wizard,"data-testid":"setup-wizard",children:r.jsxs("div",{className:nt.container,children:[r.jsx(Yn,{mode:"wait",children:r.jsxs(Tt.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[d===0&&r.jsx(XL,{onNext:()=>f(1)}),d===1&&r.jsx(QL,{onNext:()=>f(2),onBack:()=>f(0)}),d===2&&r.jsx(JL,{currentRuntime:(m==null?void 0:m.runtime)??"claude-code",onFinish:p,onBack:()=>f(1),finishDisabled:!m})]},d)}),r.jsx("div",{className:nt.dots,children:Array.from({length:eI},(v,g)=>r.jsx("span",{className:nt.dot,"data-active":g===d},g))})]})})}const nI="_root_zndgp_1",aI="_body_zndgp_7",sI="_main_zndgp_19",iI="_sidebarWrapper_zndgp_26",oI="_overlay_zndgp_51",Yo={root:nI,body:aI,main:sI,sidebarWrapper:iI,overlay:oI},lI=y.lazy(()=>P1(()=>import("./KnowledgePage-EtkEDnqG.js"),__vite__mapDeps([0,1,2,3,4])).then(n=>({default:n.KnowledgePage}))),rI=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function cI(){const{connected:n,environments:a,sessions:i,tasks:l}=rt(),c=wt(),f=ub()!==void 0,[m,p]=y.useState(!1),v=y.useCallback(()=>p(g=>!g),[]);return y.useEffect(()=>{p(!1)},[c.pathname]),y.useEffect(()=>{if(!m)return;const g=b=>{b.key==="Escape"&&p(!1)};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[m]),r.jsxs(r.Fragment,{children:[r.jsx(Mj,{connected:n,environments:a,sessions:i,onToggleSidebar:f?v:void 0,sidebarOpen:m}),r.jsx(Vj,{}),r.jsxs("div",{className:Yo.body,children:[f&&r.jsx("div",{className:Yo.sidebarWrapper,"data-sidebar-open":m,children:r.jsx(Fj,{})}),f&&m&&r.jsx("div",{className:Yo.overlay,"data-testid":"drawer-overlay",onClick:()=>p(!1)}),r.jsxs("div",{className:Yo.main,children:[r.jsx(As,{}),r.jsx($A,{sessions:i,tasks:l,environments:a})]})]}),r.jsx(aD,{}),r.jsx(DL,{})]})}function uI(){const{lastSpawnedId:n,environments:a,tasks:i,connected:l,onboardingCompleted:c}=rt(),{showToast:d}=Rs();bR(a,d),TR(i,d);const f=Et(),m=wt();return y.useEffect(()=>{n&&!m.pathname.includes("/tasks/")&&f(Q0(n),{replace:!0})},[n,f,m.pathname]),l&&c===!1?r.jsx(Pn,{to:"/setup",replace:!0}):r.jsx(Hj,{children:r.jsx("div",{className:Yo.root,children:r.jsx(cI,{})})})}function rf(){const{workspaceId:n}=Wa(),{workspaces:a}=rt(),i=wt(),l=a.find(p=>p.id===n);if(!(l!=null&&l.environmentId))return a.length===0?void 0:r.jsx(Pn,{to:"/environments",replace:!0});const c=encodeURIComponent(n),d=`/workspaces/${c}`,f=i.pathname.startsWith(d)?i.pathname.slice(d.length):"",m=`/environments/${encodeURIComponent(l.environmentId)}/workspaces/${c}${f}${i.search}${i.hash}`;return r.jsx(Pn,{to:m,replace:!0})}function dI(){return r.jsxs(FT,{children:[r.jsx(Te,{path:"setup",element:r.jsx(tI,{})}),r.jsxs(Te,{element:r.jsx(uI,{}),children:[r.jsx(Te,{index:!0,element:r.jsx(X3,{})}),r.jsx(Te,{path:"chat",element:r.jsx(j6,{})}),r.jsx(Te,{path:"sessions/new",element:r.jsx(M6,{})}),r.jsx(Te,{path:"sessions/:sessionId",element:r.jsx(L6,{})}),r.jsx(Te,{element:r.jsx(LA,{}),children:r.jsx(Te,{path:"knowledge",element:r.jsx(y.Suspense,{fallback:r.jsx(Zx,{}),children:r.jsx(lI,{})})})}),r.jsxs(Te,{element:r.jsx(MA,{}),children:[r.jsx(Te,{path:"tasks",element:r.jsx(F3,{})}),r.jsx(Te,{path:"tasks/new",element:r.jsx(k0,{})}),r.jsx(Te,{path:"tasks/:taskId",element:r.jsx(ki,{})}),r.jsx(Te,{path:"tasks/:taskId/stream",element:r.jsx(ki,{})}),r.jsx(Te,{path:"tasks/:taskId/findings",element:r.jsx(ki,{})}),r.jsx(Te,{path:"tasks/:taskId/edit",element:r.jsx(j0,{})})]}),r.jsxs(Te,{element:r.jsx(OA,{}),children:[r.jsx(Te,{path:"workspaces",element:r.jsx(Pn,{to:"/environments",replace:!0})}),r.jsx(Te,{path:"workspaces/new",element:r.jsx(z4,{})}),r.jsx(Te,{path:"workspaces/:workspaceId",element:r.jsx(rf,{})}),r.jsx(Te,{path:"workspaces/:workspaceId/tasks/:taskId",element:r.jsx(rf,{})}),r.jsx(Te,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:r.jsx(rf,{})}),r.jsx(Te,{path:"environments/:environmentId/workspaces/:workspaceId",element:r.jsx(n4,{})}),r.jsx(Te,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:r.jsx(k0,{})}),r.jsx(Te,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:r.jsx(ki,{})}),r.jsx(Te,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:r.jsx(ki,{})}),r.jsx(Te,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:r.jsx(ki,{})}),r.jsx(Te,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:r.jsx(j0,{})}),r.jsxs(Te,{path:"environments",element:r.jsx(NB,{}),children:[r.jsx(Te,{index:!0,element:r.jsx(Z3,{})}),r.jsx(Te,{path:"new",element:r.jsx(_B,{})}),r.jsx(Te,{path:":environmentId",element:r.jsx(e5,{})}),r.jsx(Te,{path:":environmentId/edit",element:r.jsx(SB,{})})]})]}),r.jsx(Te,{element:r.jsx(BA,{}),children:r.jsxs(Te,{path:"settings",element:r.jsx(a5,{}),children:[r.jsx(Te,{index:!0,element:r.jsx(Pn,{to:"credentials",replace:!0})}),r.jsx(Te,{path:"environments",element:r.jsx(Pn,{to:"/environments",replace:!0})}),r.jsx(Te,{path:"credentials",element:r.jsx($5,{})}),r.jsx(Te,{path:"tokens",element:r.jsx(Pn,{to:"../credentials",replace:!0})}),r.jsx(Te,{path:"personas",element:r.jsx(vL,{})}),r.jsx(Te,{path:"appearance",element:r.jsx(yL,{})}),r.jsx(Te,{path:"shortcuts",element:r.jsx(AL,{})}),r.jsx(Te,{path:"about",element:r.jsx(xL,{})})]})}),r.jsx(Te,{path:"*",element:r.jsx(Pn,{to:"/",replace:!0})})]})]})}const fI=1e4;function hI(){const{onboardingCompleted:n}=rt(),[a,i]=y.useState(!1);y.useEffect(()=>{if(n!==void 0)return;const c=setTimeout(()=>i(!0),fI);return()=>clearTimeout(c)},[n]);const l=n===void 0&&!a;return r.jsx(Yn,{mode:"wait",children:l?r.jsx(Tt.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:r.jsx(Zx,{})},"splash"):r.jsx(Tt.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:r.jsx(bk,{children:r.jsx(dI,{})})},"app")})}function mI(){const n=rI?gj:rj;return r.jsx(Tj,{children:r.jsx(bj,{children:r.jsx(n,{children:r.jsx(hI,{})})})})}V1.createRoot(document.getElementById("root")).render(r.jsx(y.StrictMode,{children:r.jsx(mI,{})}));export{Os as B,eb as K,rt as a,Q0 as s,ba as t,Et as u};