@grackle-ai/web 0.80.0 → 0.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,119 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-Dw7sBz4g.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/grpc-R-DqusB1.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
2
- import{r as w1,a as y,j as r,v as C1,b as N1,t as Lr,i as E1,f as A1,M as Pf,c as Gf}from"./markdown-gcy1Jmzi.js";import{r as D1,d as Lg,H as Ig,P as zg,i as R1,B as M1,a as O1,C as B1,M as L1}from"./dagview-BA5TtMAQ.js";import{c as I1,a as z1,G as U1,e as V1,w as H1,t as P1,p as Ir,b as G1,C as $f,f as $1,M as q1,R as Po,S as Ug}from"./grpc-R-DqusB1.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 zd={exports:{}},Go={},Ud={exports:{}},Vd={};/**
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 Vg;function K1(){return Vg||(Vg=1,(function(n){function a(O,P){var W=O.length;O.push(P);e:for(;0<W;){var re=W-1>>>1,oe=O[re];if(0<c(oe,P))O[re]=P,O[W]=oe,W=re;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],W=O.pop();if(W!==P){O[0]=W;e:for(var re=0,oe=O.length,Ne=oe>>>1;re<Ne;){var je=2*(re+1)-1,Se=O[je],Le=je+1,ce=O[Le];if(0>c(Se,W))Le<oe&&0>c(ce,Se)?(O[re]=ce,O[Le]=W,re=Le):(O[re]=Se,O[je]=W,re=je);else if(Le<oe&&0>c(ce,W))O[re]=ce,O[Le]=W,re=Le;else break e}}return P}function c(O,P){var W=O.sortIndex-P.sortIndex;return W!==0?W: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,_=!1,T=!1,C=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,N=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),!T)if(i(p)!==null)T=!0,B||(B=!0,ie());else{var P=i(v);P!==null&&ae(E,P.startTime-O)}}var B=!1,U=-1,z=5,K=-1;function te(){return w?!0:!(n.unstable_now()-K<z)}function ne(){if(w=!1,B){var O=n.unstable_now();K=O;var P=!0;try{e:{T=!1,C&&(C=!1,N(U),U=-1),_=!0;var W=x;try{t:{for(R(O),b=i(p);b!==null&&!(b.expirationTime>O&&te());){var re=b.callback;if(typeof re=="function"){b.callback=null,x=b.priorityLevel;var oe=re(b.expirationTime<=O);if(O=n.unstable_now(),typeof oe=="function"){b.callback=oe,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 Ne=i(v);Ne!==null&&ae(E,Ne.startTime-O),P=!1}}break e}finally{b=null,x=W,_=!1}P=void 0}}finally{P?ie():B=!1}}}var ie;if(typeof A=="function")ie=function(){A(ne)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,q=le.port2;le.port1.onmessage=ne,ie=function(){q.postMessage(null)}}else ie=function(){k(ne,0)};function ae(O,P){U=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"):z=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 W=x;x=P;try{return O()}finally{x=W}},n.unstable_requestPaint=function(){w=!0},n.unstable_runWithPriority=function(O,P){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var W=x;x=O;try{return P()}finally{x=W}},n.unstable_scheduleCallback=function(O,P,W){var re=n.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?re+W:re):W=re,O){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=W+oe,O={id:g++,callback:P,priorityLevel:O,startTime:W,expirationTime:oe,sortIndex:-1},W>re?(O.sortIndex=W,a(v,O),i(p)===null&&O===i(v)&&(C?(N(U),U=-1):C=!0,ae(E,W-re))):(O.sortIndex=oe,a(p,O),T||_||(T=!0,B||(B=!0,ie()))),O},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(O){var P=x;return function(){var W=x;x=P;try{return O.apply(this,arguments)}finally{x=W}}}})(Vd)),Vd}var Hg;function Y1(){return Hg||(Hg=1,Ud.exports=K1()),Ud.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 Pg;function F1(){if(Pg)return Go;Pg=1;var n=Y1(),a=w1(),i=D1();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 S=!1,j=u.child;j;){if(j===s){S=!0,s=u,o=h;break}if(j===o){S=!0,o=u,s=h;break}j=j.sibling}if(!S){for(j=h.child;j;){if(j===s){S=!0,s=h,o=u;break}if(j===o){S=!0,o=h,s=u;break}j=j.sibling}if(!S)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"),_=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function ie(e){return e===null||typeof e!="object"?null:(e=ne&&e[ne]||e["@@iterator"],typeof e=="function"?e:null)}var le=Symbol.for("react.client.reference");function q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case k:return"Profiler";case w:return"StrictMode";case E:return"Suspense";case B:return"SuspenseList";case K:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case A:return e.displayName||"Context";case N: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 U:return t=e.displayName||null,t!==null?t:q(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return q(e(t))}catch{}}return null}var ae=Array.isArray,O=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},re=[],oe=-1;function Ne(e){return{current:e}}function je(e){0>oe||(e.current=re[oe],re[oe]=null,oe--)}function Se(e,t){oe++,re[oe]=e.current,e.current=t}var Le=Ne(null),ce=Ne(null),ue=Ne(null),fe=Ne(null);function tt(e,t){switch(Se(ue,t),Se(ce,e),Se(Le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ig(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ig(t),e=og(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}je(Le),Se(Le,e)}function ee(){je(Le),je(ce),je(ue)}function X(e){e.memoizedState!==null&&Se(fe,e);var t=Le.current,s=og(t,e.type);t!==s&&(Se(ce,e),Se(Le,s))}function At(e){ce.current===e&&(je(Le),je(ce)),fe.current===e&&(je(fe),zo._currentValue=W)}var pt,yn;function Ke(e){if(pt===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);pt=t&&t[1]||"",yn=-1<s.stack.indexOf(`
19
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
20
- `+pt+e+yn}var Pn=!1;function Gn(e,t){if(!e||Pn)return"";Pn=!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(),S=h[0],j=h[1];if(S&&j){var D=S.split(`
21
- `),H=j.split(`
22
- `);for(u=o=0;o<D.length&&!D[o].includes("DetermineComponentFrameRoot");)o++;for(;u<H.length&&!H[u].includes("DetermineComponentFrameRoot");)u++;if(o===D.length||u===H.length)for(o=D.length-1,u=H.length-1;1<=o&&0<=u&&D[o]!==H[u];)u--;for(;1<=o&&0<=u;o--,u--)if(D[o]!==H[u]){if(o!==1||u!==1)do if(o--,u--,0>u||D[o]!==H[u]){var Y=`
23
- `+D[o].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=o&&0<=u);break}}}finally{Pn=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Ke(s):""}function Bn(e,t){switch(e.tag){case 26:case 27:case 5:return Ke(e.type);case 16:return Ke("Lazy");case 13:return e.child!==t&&t!==null?Ke("Suspense Fallback"):Ke("Suspense");case 19:return Ke("SuspenseList");case 0:case 15:return Gn(e.type,!1);case 11:return Gn(e.type.render,!1);case 1:return Gn(e.type,!0);case 31:return Ke("Activity");default:return""}}function Na(e){try{var t="",s=null;do t+=Bn(e,s),s=e,e=e.return;while(e);return t}catch(o){return`
24
- Error generating stack: `+o.message+`
25
- `+o.stack}}var $n=Object.prototype.hasOwnProperty,Ea=n.unstable_scheduleCallback,ln=n.unstable_cancelCallback,Ee=n.unstable_shouldYield,Dt=n.unstable_requestPaint,Kt=n.unstable_now,Sl=n.unstable_getCurrentPriorityLevel,_l=n.unstable_ImmediatePriority,F=n.unstable_UserBlockingPriority,se=n.unstable_NormalPriority,me=n.unstable_LowPriority,Te=n.unstable_IdlePriority,be=n.log,nt=n.unstable_setDisableYieldValue,we=null,He=null;function Ie(e){if(typeof be=="function"&&nt(e),He&&typeof He.setStrictMode=="function")try{He.setStrictMode(we,e)}catch{}}var Ye=Math.clz32?Math.clz32:zt,Yt=Math.log,Bt=Math.LN2;function zt(e){return e>>>=0,e===0?32:31-(Yt(e)/Bt|0)|0}var vt=256,Aa=262144,bn=4194304;function Ln(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 Tl(e,t,s){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var j=o&134217727;return j!==0?(o=j&~h,o!==0?u=Ln(o):(S&=j,S!==0?u=Ln(S):s||(s=j&~e,s!==0&&(u=Ln(s))))):(j=o&~h,j!==0?u=Ln(j):S!==0?u=Ln(S):s||(s=o&~e,s!==0&&(u=Ln(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 Xi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function hS(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 Vh(){var e=bn;return bn<<=1,(bn&62914560)===0&&(bn=4194304),e}function wc(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 mS(e,t,s,o,u,h){var S=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var j=e.entanglements,D=e.expirationTimes,H=e.hiddenUpdates;for(s=S&~s;0<s;){var Y=31-Ye(s),Q=1<<Y;j[Y]=0,D[Y]=-1;var G=H[Y];if(G!==null)for(H[Y]=null,Y=0;Y<G.length;Y++){var $=G[Y];$!==null&&($.lane&=-536870913)}s&=~Q}o!==0&&Hh(e,o,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(S&~t))}function Hh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Ye(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|s&261930}function Ph(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-Ye(s),u=1<<o;u&t|e[o]&t&&(e[o]|=t),s&=~u}}function Gh(e,t){var s=t&-t;return s=(s&42)!==0?1:Cc(s),(s&(e.suspendedLanes|t))!==0?0:s}function Cc(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 Nc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function $h(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:Eg(e.type))}function qh(e,t){var s=P.p;try{return P.p=e,t()}finally{P.p=s}}var Da=Math.random().toString(36).slice(2),Ut="__reactFiber$"+Da,Wt="__reactProps$"+Da,qs="__reactContainer$"+Da,Ec="__reactEvents$"+Da,pS="__reactListeners$"+Da,vS="__reactHandles$"+Da,Kh="__reactResources$"+Da,Wi="__reactMarker$"+Da;function Ac(e){delete e[Ut],delete e[Wt],delete e[Ec],delete e[pS],delete e[vS]}function Ks(e){var t=e[Ut];if(t)return t;for(var s=e.parentNode;s;){if(t=s[qs]||s[Ut]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=hg(e);e!==null;){if(s=e[Ut])return s;e=hg(e)}return t}e=s,s=e.parentNode}return null}function Ys(e){if(e=e[Ut]||e[qs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ji(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Fs(e){var t=e[Kh];return t||(t=e[Kh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Lt(e){e[Wi]=!0}var Yh=new Set,Fh={};function ds(e,t){Zs(e,t),Zs(e+"Capture",t)}function Zs(e,t){for(Fh[e]=t,e=0;e<t.length;e++)Yh.add(t[e])}var gS=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]*$"),Zh={},Xh={};function yS(e){return $n.call(Xh,e)?!0:$n.call(Zh,e)?!1:gS.test(e)?Xh[e]=!0:(Zh[e]=!0,!1)}function kl(e,t,s){if(yS(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 jl(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 ta(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 xn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bS(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){s=""+S,h.call(this,S)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(S){s=""+S},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Dc(e){if(!e._valueTracker){var t=Qh(e)?"checked":"value";e._valueTracker=bS(e,t,""+e[t])}}function Wh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=Qh(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function wl(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 xS=/[\n"\\]/g;function Sn(e){return e.replace(xS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Rc(e,t,s,o,u,h,S,j){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),t!=null?S==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xn(t)):e.value!==""+xn(t)&&(e.value=""+xn(t)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),t!=null?Mc(e,S,xn(t)):s!=null?Mc(e,S,xn(s)):o!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+xn(j):e.removeAttribute("name")}function Jh(e,t,s,o,u,h,S,j){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){Dc(e);return}s=s!=null?""+xn(s):"",t=t!=null?""+xn(t):s,j||t===e.value||(e.value=t),e.defaultValue=t}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=j?e.checked:!!o,e.defaultChecked=!!o,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),Dc(e)}function Mc(e,t,s){t==="number"&&wl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Xs(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=""+xn(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 em(e,t,s){if(t!=null&&(t=""+xn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+xn(s):""}function tm(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=xn(t),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o),Dc(e)}function Qs(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var SS=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 nm(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||SS.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function am(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&&nm(e,u,o)}else for(var h in t)t.hasOwnProperty(h)&&nm(e,h,t[h])}function Oc(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 _S=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"]]),TS=/^[\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 Cl(e){return TS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function na(){}var Bc=null;function Lc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ws=null,Js=null;function sm(e){var t=Ys(e);if(t&&(e=t.stateNode)){var s=e[Wt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Rc(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="'+Sn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var u=o[Wt]||null;if(!u)throw Error(l(90));Rc(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&&Wh(o)}break e;case"textarea":em(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Xs(e,!!s.multiple,t,!1)}}}var Ic=!1;function im(e,t,s){if(Ic)return e(t,s);Ic=!0;try{var o=e(t);return o}finally{if(Ic=!1,(Ws!==null||Js!==null)&&(mr(),Ws&&(t=Ws,e=Js,Js=Ws=null,sm(t),e)))for(t=0;t<e.length;t++)sm(e[t])}}function eo(e,t){var s=e.stateNode;if(s===null)return null;var o=s[Wt]||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 aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zc=!1;if(aa)try{var to={};Object.defineProperty(to,"passive",{get:function(){zc=!0}}),window.addEventListener("test",to,to),window.removeEventListener("test",to,to)}catch{zc=!1}var Ra=null,Uc=null,Nl=null;function om(){if(Nl)return Nl;var e,t=Uc,s=t.length,o,u="value"in Ra?Ra.value:Ra.textContent,h=u.length;for(e=0;e<s&&t[e]===u[e];e++);var S=s-e;for(o=1;o<=S&&t[s-o]===u[h-o];o++);return Nl=u.slice(e,1<o?1-o:void 0)}function El(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 Al(){return!0}function lm(){return!1}function Jt(e){function t(s,o,u,h,S){this._reactName=s,this._targetInst=u,this.type=o,this.nativeEvent=h,this.target=S,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(s=e[j],this[j]=s?s(h):h[j]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Al:lm,this.isPropagationStopped=lm,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=Al)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Al)},persist:function(){},isPersistent:Al}),t}var fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dl=Jt(fs),no=b({},fs,{view:0,detail:0}),kS=Jt(no),Vc,Hc,ao,Rl=b({},no,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gc,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!==ao&&(ao&&e.type==="mousemove"?(Vc=e.screenX-ao.screenX,Hc=e.screenY-ao.screenY):Hc=Vc=0,ao=e),Vc)},movementY:function(e){return"movementY"in e?e.movementY:Hc}}),rm=Jt(Rl),jS=b({},Rl,{dataTransfer:0}),wS=Jt(jS),CS=b({},no,{relatedTarget:0}),Pc=Jt(CS),NS=b({},fs,{animationName:0,elapsedTime:0,pseudoElement:0}),ES=Jt(NS),AS=b({},fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),DS=Jt(AS),RS=b({},fs,{data:0}),cm=Jt(RS),MS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},OS={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"},BS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function LS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=BS[e])?!!t[e]:!1}function Gc(){return LS}var IS=b({},no,{key:function(e){if(e.key){var t=MS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=El(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?OS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gc,charCode:function(e){return e.type==="keypress"?El(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?El(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),zS=Jt(IS),US=b({},Rl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),um=Jt(US),VS=b({},no,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gc}),HS=Jt(VS),PS=b({},fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),GS=Jt(PS),$S=b({},Rl,{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}),qS=Jt($S),KS=b({},fs,{newState:0,oldState:0}),YS=Jt(KS),FS=[9,13,27,32],$c=aa&&"CompositionEvent"in window,so=null;aa&&"documentMode"in document&&(so=document.documentMode);var ZS=aa&&"TextEvent"in window&&!so,dm=aa&&(!$c||so&&8<so&&11>=so),fm=" ",hm=!1;function mm(e,t){switch(e){case"keyup":return FS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ei=!1;function XS(e,t){switch(e){case"compositionend":return pm(t);case"keypress":return t.which!==32?null:(hm=!0,fm);case"textInput":return e=t.data,e===fm&&hm?null:e;default:return null}}function QS(e,t){if(ei)return e==="compositionend"||!$c&&mm(e,t)?(e=om(),Nl=Uc=Ra=null,ei=!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 dm&&t.locale!=="ko"?null:t.data;default:return null}}var WS={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 vm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!WS[e.type]:t==="textarea"}function gm(e,t,s,o){Ws?Js?Js.push(o):Js=[o]:Ws=o,t=Sr(t,"onChange"),0<t.length&&(s=new Dl("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var io=null,oo=null;function JS(e){Jv(e,0)}function Ml(e){var t=Ji(e);if(Wh(t))return e}function ym(e,t){if(e==="change")return t}var bm=!1;if(aa){var qc;if(aa){var Kc="oninput"in document;if(!Kc){var xm=document.createElement("div");xm.setAttribute("oninput","return;"),Kc=typeof xm.oninput=="function"}qc=Kc}else qc=!1;bm=qc&&(!document.documentMode||9<document.documentMode)}function Sm(){io&&(io.detachEvent("onpropertychange",_m),oo=io=null)}function _m(e){if(e.propertyName==="value"&&Ml(oo)){var t=[];gm(t,oo,e,Lc(e)),im(JS,t)}}function e_(e,t,s){e==="focusin"?(Sm(),io=t,oo=s,io.attachEvent("onpropertychange",_m)):e==="focusout"&&Sm()}function t_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ml(oo)}function n_(e,t){if(e==="click")return Ml(t)}function a_(e,t){if(e==="input"||e==="change")return Ml(t)}function s_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rn=typeof Object.is=="function"?Object.is:s_;function lo(e,t){if(rn(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(!$n.call(t,u)||!rn(e[u],t[u]))return!1}return!0}function Tm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function km(e,t){var s=Tm(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=Tm(s)}}function jm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=wl(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=wl(e.document)}return t}function Yc(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 i_=aa&&"documentMode"in document&&11>=document.documentMode,ti=null,Fc=null,ro=null,Zc=!1;function Cm(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Zc||ti==null||ti!==wl(o)||(o=ti,"selectionStart"in o&&Yc(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}),ro&&lo(ro,o)||(ro=o,o=Sr(Fc,"onSelect"),0<o.length&&(t=new Dl("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=ti)))}function hs(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var ni={animationend:hs("Animation","AnimationEnd"),animationiteration:hs("Animation","AnimationIteration"),animationstart:hs("Animation","AnimationStart"),transitionrun:hs("Transition","TransitionRun"),transitionstart:hs("Transition","TransitionStart"),transitioncancel:hs("Transition","TransitionCancel"),transitionend:hs("Transition","TransitionEnd")},Xc={},Nm={};aa&&(Nm=document.createElement("div").style,"AnimationEvent"in window||(delete ni.animationend.animation,delete ni.animationiteration.animation,delete ni.animationstart.animation),"TransitionEvent"in window||delete ni.transitionend.transition);function ms(e){if(Xc[e])return Xc[e];if(!ni[e])return e;var t=ni[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Nm)return Xc[e]=t[s];return e}var Em=ms("animationend"),Am=ms("animationiteration"),Dm=ms("animationstart"),o_=ms("transitionrun"),l_=ms("transitionstart"),r_=ms("transitioncancel"),Rm=ms("transitionend"),Mm=new Map,Qc="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(" ");Qc.push("scrollEnd");function In(e,t){Mm.set(e,t),ds(t,[e])}var Ol=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)},_n=[],ai=0,Wc=0;function Bl(){for(var e=ai,t=Wc=ai=0;t<e;){var s=_n[t];_n[t++]=null;var o=_n[t];_n[t++]=null;var u=_n[t];_n[t++]=null;var h=_n[t];if(_n[t++]=null,o!==null&&u!==null){var S=o.pending;S===null?u.next=u:(u.next=S.next,S.next=u),o.pending=u}h!==0&&Om(s,u,h)}}function Ll(e,t,s,o){_n[ai++]=e,_n[ai++]=t,_n[ai++]=s,_n[ai++]=o,Wc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Jc(e,t,s,o){return Ll(e,t,s,o),Il(e)}function ps(e,t){return Ll(e,null,null,t),Il(e)}function Om(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-Ye(s),e=h.hiddenUpdates,o=e[u],o===null?e[u]=[t]:o.push(t),t.lane=s|536870912),h):null}function Il(e){if(50<Do)throw Do=0,rd=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function c_(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 cn(e,t,s,o){return new c_(e,t,s,o)}function eu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sa(e,t){var s=e.alternate;return s===null?(s=cn(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 Bm(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 zl(e,t,s,o,u,h){var S=0;if(o=e,typeof e=="function")eu(e)&&(S=1);else if(typeof e=="string")S=m1(e,s,Le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case K:return e=cn(31,s,t,u),e.elementType=K,e.lanes=h,e;case C:return vs(s.children,u,h,t);case w:S=8,u|=24;break;case k:return e=cn(12,s,t,u|2),e.elementType=k,e.lanes=h,e;case E:return e=cn(13,s,t,u),e.elementType=E,e.lanes=h,e;case B:return e=cn(19,s,t,u),e.elementType=B,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:S=10;break e;case N:S=9;break e;case R:S=11;break e;case U:S=14;break e;case z:S=16,o=null;break e}S=29,s=Error(l(130,e===null?"null":typeof e,"")),o=null}return t=cn(S,s,t,u),t.elementType=e,t.type=o,t.lanes=h,t}function vs(e,t,s,o){return e=cn(7,e,o,t),e.lanes=s,e}function tu(e,t,s){return e=cn(6,e,null,t),e.lanes=s,e}function Lm(e){var t=cn(18,null,null,0);return t.stateNode=e,t}function nu(e,t,s){return t=cn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Im=new WeakMap;function Tn(e,t){if(typeof e=="object"&&e!==null){var s=Im.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Na(t)},Im.set(e,t),t)}return{value:e,source:t,stack:Na(t)}}var ii=[],oi=0,Ul=null,co=0,kn=[],jn=0,Ma=null,qn=1,Kn="";function ia(e,t){ii[oi++]=co,ii[oi++]=Ul,Ul=e,co=t}function zm(e,t,s){kn[jn++]=qn,kn[jn++]=Kn,kn[jn++]=Ma,Ma=e;var o=qn;e=Kn;var u=32-Ye(o)-1;o&=~(1<<u),s+=1;var h=32-Ye(t)+u;if(30<h){var S=u-u%5;h=(o&(1<<S)-1).toString(32),o>>=S,u-=S,qn=1<<32-Ye(t)+u|s<<u|o,Kn=h+e}else qn=1<<h|s<<u|o,Kn=e}function au(e){e.return!==null&&(ia(e,1),zm(e,1,0))}function su(e){for(;e===Ul;)Ul=ii[--oi],ii[oi]=null,co=ii[--oi],ii[oi]=null;for(;e===Ma;)Ma=kn[--jn],kn[jn]=null,Kn=kn[--jn],kn[jn]=null,qn=kn[--jn],kn[jn]=null}function Um(e,t){kn[jn++]=qn,kn[jn++]=Kn,kn[jn++]=Ma,qn=t.id,Kn=t.overflow,Ma=e}var Vt=null,it=null,ze=!1,Oa=null,wn=!1,iu=Error(l(519));function Ba(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw uo(Tn(t,e)),iu}function Vm(e){var t=e.stateNode,s=e.type,o=e.memoizedProps;switch(t[Ut]=e,t[Wt]=o,s){case"dialog":Me("cancel",t),Me("close",t);break;case"iframe":case"object":case"embed":Me("load",t);break;case"video":case"audio":for(s=0;s<Mo.length;s++)Me(Mo[s],t);break;case"source":Me("error",t);break;case"img":case"image":case"link":Me("error",t),Me("load",t);break;case"details":Me("toggle",t);break;case"input":Me("invalid",t),Jh(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Me("invalid",t);break;case"textarea":Me("invalid",t),tm(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||ag(t.textContent,s)?(o.popover!=null&&(Me("beforetoggle",t),Me("toggle",t)),o.onScroll!=null&&Me("scroll",t),o.onScrollEnd!=null&&Me("scrollend",t),o.onClick!=null&&(t.onclick=na),t=!0):t=!1,t||Ba(e,!0)}function Hm(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:wn=!1;return;case 27:case 3:wn=!0;return;default:Vt=Vt.return}}function li(e){if(e!==Vt)return!1;if(!ze)return Hm(e),ze=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Td(e.type,e.memoizedProps)),s=!s),s&&it&&Ba(e),Hm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));it=fg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));it=fg(e)}else t===27?(t=it,Za(e.type)?(e=Nd,Nd=null,it=e):it=t):it=Vt?Nn(e.stateNode.nextSibling):null;return!0}function gs(){it=Vt=null,ze=!1}function ou(){var e=Oa;return e!==null&&(an===null?an=e:an.push.apply(an,e),Oa=null),e}function uo(e){Oa===null?Oa=[e]:Oa.push(e)}var lu=Ne(null),ys=null,oa=null;function La(e,t,s){Se(lu,t._currentValue),t._currentValue=s}function la(e){e._currentValue=lu.current,je(lu)}function ru(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 cu(e,t,s,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var S=u.child;h=h.firstContext;e:for(;h!==null;){var j=h;h=u;for(var D=0;D<t.length;D++)if(j.context===t[D]){h.lanes|=s,j=h.alternate,j!==null&&(j.lanes|=s),ru(h.return,s,e),o||(S=null);break e}h=j.next}}else if(u.tag===18){if(S=u.return,S===null)throw Error(l(341));S.lanes|=s,h=S.alternate,h!==null&&(h.lanes|=s),ru(S,s,e),S=null}else S=u.child;if(S!==null)S.return=u;else for(S=u;S!==null;){if(S===e){S=null;break}if(u=S.sibling,u!==null){u.return=S.return,S=u;break}S=S.return}u=S}}function ri(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 S=u.alternate;if(S===null)throw Error(l(387));if(S=S.memoizedProps,S!==null){var j=u.type;rn(u.pendingProps.value,S.value)||(e!==null?e.push(j):e=[j])}}else if(u===fe.current){if(S=u.alternate,S===null)throw Error(l(387));S.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(zo):e=[zo])}u=u.return}e!==null&&cu(t,e,s,o),t.flags|=262144}function Vl(e){for(e=e.firstContext;e!==null;){if(!rn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bs(e){ys=e,oa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ht(e){return Pm(ys,e)}function Hl(e,t){return ys===null&&bs(e),Pm(e,t)}function Pm(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},oa===null){if(e===null)throw Error(l(308));oa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else oa=oa.next=t;return s}var u_=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()})}},d_=n.unstable_scheduleCallback,f_=n.unstable_NormalPriority,kt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function uu(){return{controller:new u_,data:new Map,refCount:0}}function fo(e){e.refCount--,e.refCount===0&&d_(f_,function(){e.controller.abort()})}var ho=null,du=0,ci=0,ui=null;function h_(e,t){if(ho===null){var s=ho=[];du=0,ci=md(),ui={status:"pending",value:void 0,then:function(o){s.push(o)}}}return du++,t.then(Gm,Gm),t}function Gm(){if(--du===0&&ho!==null){ui!==null&&(ui.status="fulfilled");var e=ho;ho=null,ci=0,ui=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function m_(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 $m=O.S;O.S=function(e,t){Cv=Kt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&h_(e,t),$m!==null&&$m(e,t)};var xs=Ne(null);function fu(){var e=xs.current;return e!==null?e:at.pooledCache}function Pl(e,t){t===null?Se(xs,xs.current):Se(xs,t.pool)}function qm(){var e=fu();return e===null?null:{parent:kt._currentValue,pool:e}}var di=Error(l(460)),hu=Error(l(474)),Gl=Error(l(542)),$l={then:function(){}};function Km(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ym(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(na,na),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zm(e),e;default:if(typeof t.status=="string")t.then(na,na);else{if(e=at,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,Zm(e),e}throw _s=t,di}}function Ss(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(_s=s,di):s}}var _s=null;function Fm(){if(_s===null)throw Error(l(459));var e=_s;return _s=null,e}function Zm(e){if(e===di||e===Gl)throw Error(l(483))}var fi=null,mo=0;function ql(e){var t=mo;return mo+=1,fi===null&&(fi=[]),Ym(fi,e,t)}function po(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Kl(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 Xm(e){function t(L,M){if(e){var V=L.deletions;V===null?(L.deletions=[M],L.flags|=16):V.push(M)}}function s(L,M){if(!e)return null;for(;M!==null;)t(L,M),M=M.sibling;return null}function o(L){for(var M=new Map;L!==null;)L.key!==null?M.set(L.key,L):M.set(L.index,L),L=L.sibling;return M}function u(L,M){return L=sa(L,M),L.index=0,L.sibling=null,L}function h(L,M,V){return L.index=V,e?(V=L.alternate,V!==null?(V=V.index,V<M?(L.flags|=67108866,M):V):(L.flags|=67108866,M)):(L.flags|=1048576,M)}function S(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function j(L,M,V,Z){return M===null||M.tag!==6?(M=tu(V,L.mode,Z),M.return=L,M):(M=u(M,V),M.return=L,M)}function D(L,M,V,Z){var ve=V.type;return ve===C?Y(L,M,V.props.children,Z,V.key):M!==null&&(M.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===z&&Ss(ve)===M.type)?(M=u(M,V.props),po(M,V),M.return=L,M):(M=zl(V.type,V.key,V.props,null,L.mode,Z),po(M,V),M.return=L,M)}function H(L,M,V,Z){return M===null||M.tag!==4||M.stateNode.containerInfo!==V.containerInfo||M.stateNode.implementation!==V.implementation?(M=nu(V,L.mode,Z),M.return=L,M):(M=u(M,V.children||[]),M.return=L,M)}function Y(L,M,V,Z,ve){return M===null||M.tag!==7?(M=vs(V,L.mode,Z,ve),M.return=L,M):(M=u(M,V),M.return=L,M)}function Q(L,M,V){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=tu(""+M,L.mode,V),M.return=L,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case _:return V=zl(M.type,M.key,M.props,null,L.mode,V),po(V,M),V.return=L,V;case T:return M=nu(M,L.mode,V),M.return=L,M;case z:return M=Ss(M),Q(L,M,V)}if(ae(M)||ie(M))return M=vs(M,L.mode,V,null),M.return=L,M;if(typeof M.then=="function")return Q(L,ql(M),V);if(M.$$typeof===A)return Q(L,Hl(L,M),V);Kl(L,M)}return null}function G(L,M,V,Z){var ve=M!==null?M.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return ve!==null?null:j(L,M,""+V,Z);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case _:return V.key===ve?D(L,M,V,Z):null;case T:return V.key===ve?H(L,M,V,Z):null;case z:return V=Ss(V),G(L,M,V,Z)}if(ae(V)||ie(V))return ve!==null?null:Y(L,M,V,Z,null);if(typeof V.then=="function")return G(L,M,ql(V),Z);if(V.$$typeof===A)return G(L,M,Hl(L,V),Z);Kl(L,V)}return null}function $(L,M,V,Z,ve){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return L=L.get(V)||null,j(M,L,""+Z,ve);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:return L=L.get(Z.key===null?V:Z.key)||null,D(M,L,Z,ve);case T:return L=L.get(Z.key===null?V:Z.key)||null,H(M,L,Z,ve);case z:return Z=Ss(Z),$(L,M,V,Z,ve)}if(ae(Z)||ie(Z))return L=L.get(V)||null,Y(M,L,Z,ve,null);if(typeof Z.then=="function")return $(L,M,V,ql(Z),ve);if(Z.$$typeof===A)return $(L,M,V,Hl(M,Z),ve);Kl(M,Z)}return null}function he(L,M,V,Z){for(var ve=null,Ge=null,pe=M,Ae=M=0,Be=null;pe!==null&&Ae<V.length;Ae++){pe.index>Ae?(Be=pe,pe=null):Be=pe.sibling;var $e=G(L,pe,V[Ae],Z);if($e===null){pe===null&&(pe=Be);break}e&&pe&&$e.alternate===null&&t(L,pe),M=h($e,M,Ae),Ge===null?ve=$e:Ge.sibling=$e,Ge=$e,pe=Be}if(Ae===V.length)return s(L,pe),ze&&ia(L,Ae),ve;if(pe===null){for(;Ae<V.length;Ae++)pe=Q(L,V[Ae],Z),pe!==null&&(M=h(pe,M,Ae),Ge===null?ve=pe:Ge.sibling=pe,Ge=pe);return ze&&ia(L,Ae),ve}for(pe=o(pe);Ae<V.length;Ae++)Be=$(pe,L,Ae,V[Ae],Z),Be!==null&&(e&&Be.alternate!==null&&pe.delete(Be.key===null?Ae:Be.key),M=h(Be,M,Ae),Ge===null?ve=Be:Ge.sibling=Be,Ge=Be);return e&&pe.forEach(function(es){return t(L,es)}),ze&&ia(L,Ae),ve}function ye(L,M,V,Z){if(V==null)throw Error(l(151));for(var ve=null,Ge=null,pe=M,Ae=M=0,Be=null,$e=V.next();pe!==null&&!$e.done;Ae++,$e=V.next()){pe.index>Ae?(Be=pe,pe=null):Be=pe.sibling;var es=G(L,pe,$e.value,Z);if(es===null){pe===null&&(pe=Be);break}e&&pe&&es.alternate===null&&t(L,pe),M=h(es,M,Ae),Ge===null?ve=es:Ge.sibling=es,Ge=es,pe=Be}if($e.done)return s(L,pe),ze&&ia(L,Ae),ve;if(pe===null){for(;!$e.done;Ae++,$e=V.next())$e=Q(L,$e.value,Z),$e!==null&&(M=h($e,M,Ae),Ge===null?ve=$e:Ge.sibling=$e,Ge=$e);return ze&&ia(L,Ae),ve}for(pe=o(pe);!$e.done;Ae++,$e=V.next())$e=$(pe,L,Ae,$e.value,Z),$e!==null&&(e&&$e.alternate!==null&&pe.delete($e.key===null?Ae:$e.key),M=h($e,M,Ae),Ge===null?ve=$e:Ge.sibling=$e,Ge=$e);return e&&pe.forEach(function(j1){return t(L,j1)}),ze&&ia(L,Ae),ve}function et(L,M,V,Z){if(typeof V=="object"&&V!==null&&V.type===C&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case _:e:{for(var ve=V.key;M!==null;){if(M.key===ve){if(ve=V.type,ve===C){if(M.tag===7){s(L,M.sibling),Z=u(M,V.props.children),Z.return=L,L=Z;break e}}else if(M.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===z&&Ss(ve)===M.type){s(L,M.sibling),Z=u(M,V.props),po(Z,V),Z.return=L,L=Z;break e}s(L,M);break}else t(L,M);M=M.sibling}V.type===C?(Z=vs(V.props.children,L.mode,Z,V.key),Z.return=L,L=Z):(Z=zl(V.type,V.key,V.props,null,L.mode,Z),po(Z,V),Z.return=L,L=Z)}return S(L);case T:e:{for(ve=V.key;M!==null;){if(M.key===ve)if(M.tag===4&&M.stateNode.containerInfo===V.containerInfo&&M.stateNode.implementation===V.implementation){s(L,M.sibling),Z=u(M,V.children||[]),Z.return=L,L=Z;break e}else{s(L,M);break}else t(L,M);M=M.sibling}Z=nu(V,L.mode,Z),Z.return=L,L=Z}return S(L);case z:return V=Ss(V),et(L,M,V,Z)}if(ae(V))return he(L,M,V,Z);if(ie(V)){if(ve=ie(V),typeof ve!="function")throw Error(l(150));return V=ve.call(V),ye(L,M,V,Z)}if(typeof V.then=="function")return et(L,M,ql(V),Z);if(V.$$typeof===A)return et(L,M,Hl(L,V),Z);Kl(L,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,M!==null&&M.tag===6?(s(L,M.sibling),Z=u(M,V),Z.return=L,L=Z):(s(L,M),Z=tu(V,L.mode,Z),Z.return=L,L=Z),S(L)):s(L,M)}return function(L,M,V,Z){try{mo=0;var ve=et(L,M,V,Z);return fi=null,ve}catch(pe){if(pe===di||pe===Gl)throw pe;var Ge=cn(29,pe,null,L.mode);return Ge.lanes=Z,Ge.return=L,Ge}finally{}}}var Ts=Xm(!0),Qm=Xm(!1),Ia=!1;function mu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pu(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 za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Fe&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,t=Il(e),Om(e,null,s),t}return Ll(e,o,t,s),Il(e)}function vo(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,Ph(e,s)}}function vu(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 S={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?u=h=S:h=h.next=S,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 gu=!1;function go(){if(gu){var e=ui;if(e!==null)throw e}}function yo(e,t,s,o){gu=!1;var u=e.updateQueue;Ia=!1;var h=u.firstBaseUpdate,S=u.lastBaseUpdate,j=u.shared.pending;if(j!==null){u.shared.pending=null;var D=j,H=D.next;D.next=null,S===null?h=H:S.next=H,S=D;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,j=Y.lastBaseUpdate,j!==S&&(j===null?Y.firstBaseUpdate=H:j.next=H,Y.lastBaseUpdate=D))}if(h!==null){var Q=u.baseState;S=0,Y=H=D=null,j=h;do{var G=j.lane&-536870913,$=G!==j.lane;if($?(Oe&G)===G:(o&G)===G){G!==0&&G===ci&&(gu=!0),Y!==null&&(Y=Y.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var he=e,ye=j;G=t;var et=s;switch(ye.tag){case 1:if(he=ye.payload,typeof he=="function"){Q=he.call(et,Q,G);break e}Q=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ye.payload,G=typeof he=="function"?he.call(et,Q,G):he,G==null)break e;Q=b({},Q,G);break e;case 2:Ia=!0}}G=j.callback,G!==null&&(e.flags|=64,$&&(e.flags|=8192),$=u.callbacks,$===null?u.callbacks=[G]:$.push(G))}else $={lane:G,tag:j.tag,payload:j.payload,callback:j.callback,next:null},Y===null?(H=Y=$,D=Q):Y=Y.next=$,S|=G;if(j=j.next,j===null){if(j=u.shared.pending,j===null)break;$=j,j=$.next,$.next=null,u.lastBaseUpdate=$,u.shared.pending=null}}while(!0);Y===null&&(D=Q),u.baseState=D,u.firstBaseUpdate=H,u.lastBaseUpdate=Y,h===null&&(u.shared.lanes=0),$a|=S,e.lanes=S,e.memoizedState=Q}}function Wm(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Jm(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Wm(s[e],t)}var hi=Ne(null),Yl=Ne(0);function ep(e,t){e=va,Se(Yl,e),Se(hi,t),va=e|t.baseLanes}function yu(){Se(Yl,va),Se(hi,hi.current)}function bu(){va=Yl.current,je(hi),je(Yl)}var un=Ne(null),Cn=null;function Va(e){var t=e.alternate;Se(St,St.current&1),Se(un,e),Cn===null&&(t===null||hi.current!==null||t.memoizedState!==null)&&(Cn=e)}function xu(e){Se(St,St.current),Se(un,e),Cn===null&&(Cn=e)}function tp(e){e.tag===22?(Se(St,St.current),Se(un,e),Cn===null&&(Cn=e)):Ha()}function Ha(){Se(St,St.current),Se(un,un.current)}function dn(e){je(un),Cn===e&&(Cn=null),je(St)}var St=Ne(0);function Fl(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||wd(s)||Cd(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 ra=0,Ce=null,We=null,jt=null,Zl=!1,mi=!1,ks=!1,Xl=0,bo=0,pi=null,p_=0;function gt(){throw Error(l(321))}function Su(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!rn(e[s],t[s]))return!1;return!0}function _u(e,t,s,o,u,h){return ra=h,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?zp:Iu,ks=!1,h=s(o,u),ks=!1,mi&&(h=ap(t,s,o,u)),np(e),h}function np(e){O.H=_o;var t=We!==null&&We.next!==null;if(ra=0,jt=We=Ce=null,Zl=!1,bo=0,pi=null,t)throw Error(l(300));e===null||wt||(e=e.dependencies,e!==null&&Vl(e)&&(wt=!0))}function ap(e,t,s,o){Ce=e;var u=0;do{if(mi&&(pi=null),bo=0,mi=!1,25<=u)throw Error(l(301));if(u+=1,jt=We=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=Up,h=t(s,o)}while(mi);return h}function v_(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?xo(t):t,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(Ce.flags|=1024),t}function Tu(){var e=Xl!==0;return Xl=0,e}function ku(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function ju(e){if(Zl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Zl=!1}ra=0,jt=We=Ce=null,mi=!1,bo=Xl=0,pi=null}function Xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?Ce.memoizedState=jt=e:jt=jt.next=e,jt}function _t(){if(We===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=jt===null?Ce.memoizedState:jt.next;if(t!==null)jt=t,We=e;else{if(e===null)throw Ce.alternate===null?Error(l(467)):Error(l(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},jt===null?Ce.memoizedState=jt=e:jt=jt.next=e}return jt}function Ql(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xo(e){var t=bo;return bo+=1,pi===null&&(pi=[]),e=Ym(pi,e,t),t=Ce,(jt===null?t.memoizedState:jt.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?zp:Iu),e}function Wl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xo(e);if(e.$$typeof===A)return Ht(e)}throw Error(l(438,String(e)))}function wu(e){var t=null,s=Ce.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var o=Ce.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=Ql(),Ce.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]=te;return t.index++,s}function ca(e,t){return typeof t=="function"?t(e):t}function Jl(e){var t=_t();return Cu(t,We,e)}function Cu(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 S=u.next;u.next=h.next,h.next=S}t.baseQueue=u=h,o.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var j=S=null,D=null,H=t,Y=!1;do{var Q=H.lane&-536870913;if(Q!==H.lane?(Oe&Q)===Q:(ra&Q)===Q){var G=H.revertLane;if(G===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),Q===ci&&(Y=!0);else if((ra&G)===G){H=H.next,G===ci&&(Y=!0);continue}else Q={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},D===null?(j=D=Q,S=h):D=D.next=Q,Ce.lanes|=G,$a|=G;Q=H.action,ks&&s(h,Q),h=H.hasEagerState?H.eagerState:s(h,Q)}else G={lane:Q,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},D===null?(j=D=G,S=h):D=D.next=G,Ce.lanes|=Q,$a|=Q;H=H.next}while(H!==null&&H!==t);if(D===null?S=h:D.next=j,!rn(h,e.memoizedState)&&(wt=!0,Y&&(s=ui,s!==null)))throw s;e.memoizedState=h,e.baseState=S,e.baseQueue=D,o.lastRenderedState=h}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Nu(e){var t=_t(),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 S=u=u.next;do h=e(h,S.action),S=S.next;while(S!==u);rn(h,t.memoizedState)||(wt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,o]}function sp(e,t,s){var o=Ce,u=_t(),h=ze;if(h){if(s===void 0)throw Error(l(407));s=s()}else s=t();var S=!rn((We||u).memoizedState,s);if(S&&(u.memoizedState=s,wt=!0),u=u.queue,Du(lp.bind(null,o,u,e),[e]),u.getSnapshot!==t||S||jt!==null&&jt.memoizedState.tag&1){if(o.flags|=2048,vi(9,{destroy:void 0},op.bind(null,o,u,s,t),null),at===null)throw Error(l(349));h||(ra&127)!==0||ip(o,t,s)}return s}function ip(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ce.updateQueue,t===null?(t=Ql(),Ce.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function op(e,t,s,o){t.value=s,t.getSnapshot=o,rp(t)&&cp(e)}function lp(e,t,s){return s(function(){rp(t)&&cp(e)})}function rp(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!rn(e,s)}catch{return!0}}function cp(e){var t=ps(e,2);t!==null&&sn(t,e,2)}function Eu(e){var t=Xt();if(typeof e=="function"){var s=e;if(e=s(),ks){Ie(!0);try{s()}finally{Ie(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:e},t}function up(e,t,s,o){return e.baseState=s,Cu(e,We,typeof o=="function"?o:ca)}function g_(e,t,s,o,u){if(nr(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(S){h.listeners.push(S)}};O.T!==null?s(!0):h.isTransition=!1,o(h),s=t.pending,s===null?(h.next=t.pending=h,dp(t,h)):(h.next=s.next,t.pending=s.next=h)}}function dp(e,t){var s=t.action,o=t.payload,u=e.state;if(t.isTransition){var h=O.T,S={};O.T=S;try{var j=s(u,o),D=O.S;D!==null&&D(S,j),fp(e,t,j)}catch(H){Au(e,t,H)}finally{h!==null&&S.types!==null&&(h.types=S.types),O.T=h}}else try{h=s(u,o),fp(e,t,h)}catch(H){Au(e,t,H)}}function fp(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){hp(e,t,o)},function(o){return Au(e,t,o)}):hp(e,t,s)}function hp(e,t,s){t.status="fulfilled",t.value=s,mp(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,dp(e,s)))}function Au(e,t,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=s,mp(t),t=t.next;while(t!==o)}e.action=null}function mp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function pp(e,t){return t}function vp(e,t){if(ze){var s=at.formState;if(s!==null){e:{var o=Ce;if(ze){if(it){t:{for(var u=it,h=wn;u.nodeType!==8;){if(!h){u=null;break t}if(u=Nn(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){it=Nn(u.nextSibling),o=u.data==="F!";break e}}Ba(o)}o=!1}o&&(t=s[0])}}return s=Xt(),s.memoizedState=s.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pp,lastRenderedState:t},s.queue=o,s=Bp.bind(null,Ce,o),o.dispatch=s,o=Eu(!1),h=Lu.bind(null,Ce,!1,o.queue),o=Xt(),u={state:t,dispatch:null,action:e,pending:null},o.queue=u,s=g_.bind(null,Ce,u,h,s),u.dispatch=s,o.memoizedState=e,[t,s,!1]}function gp(e){var t=_t();return yp(t,We,e)}function yp(e,t,s){if(t=Cu(e,t,pp)[0],e=Jl(ca)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=xo(t)}catch(S){throw S===di?Gl:S}else o=t;t=_t();var u=t.queue,h=u.dispatch;return s!==t.memoizedState&&(Ce.flags|=2048,vi(9,{destroy:void 0},y_.bind(null,u,s),null)),[o,h,e]}function y_(e,t){e.action=t}function bp(e){var t=_t(),s=We;if(s!==null)return yp(t,s,e);_t(),t=t.memoizedState,s=_t();var o=s.queue.dispatch;return s.memoizedState=e,[t,o,!1]}function vi(e,t,s,o){return e={tag:e,create:s,deps:o,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=Ql(),Ce.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 xp(){return _t().memoizedState}function er(e,t,s,o){var u=Xt();Ce.flags|=e,u.memoizedState=vi(1|t,{destroy:void 0},s,o===void 0?null:o)}function tr(e,t,s,o){var u=_t();o=o===void 0?null:o;var h=u.memoizedState.inst;We!==null&&o!==null&&Su(o,We.memoizedState.deps)?u.memoizedState=vi(t,h,s,o):(Ce.flags|=e,u.memoizedState=vi(1|t,h,s,o))}function Sp(e,t){er(8390656,8,e,t)}function Du(e,t){tr(2048,8,e,t)}function b_(e){Ce.flags|=4;var t=Ce.updateQueue;if(t===null)t=Ql(),Ce.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function _p(e){var t=_t().memoizedState;return b_({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Tp(e,t){return tr(4,2,e,t)}function kp(e,t){return tr(4,4,e,t)}function jp(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 wp(e,t,s){s=s!=null?s.concat([e]):null,tr(4,4,jp.bind(null,t,e),s)}function Ru(){}function Cp(e,t){var s=_t();t=t===void 0?null:t;var o=s.memoizedState;return t!==null&&Su(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function Np(e,t){var s=_t();t=t===void 0?null:t;var o=s.memoizedState;if(t!==null&&Su(t,o[1]))return o[0];if(o=e(),ks){Ie(!0);try{e()}finally{Ie(!1)}}return s.memoizedState=[o,t],o}function Mu(e,t,s){return s===void 0||(ra&1073741824)!==0&&(Oe&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Ev(),Ce.lanes|=e,$a|=e,s)}function Ep(e,t,s,o){return rn(s,t)?s:hi.current!==null?(e=Mu(e,s,o),rn(e,t)||(wt=!0),e):(ra&42)===0||(ra&1073741824)!==0&&(Oe&261930)===0?(wt=!0,e.memoizedState=s):(e=Ev(),Ce.lanes|=e,$a|=e,t)}function Ap(e,t,s,o,u){var h=P.p;P.p=h!==0&&8>h?h:8;var S=O.T,j={};O.T=j,Lu(e,!1,t,s);try{var D=u(),H=O.S;if(H!==null&&H(j,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var Y=m_(D,o);So(e,t,Y,mn(e))}else So(e,t,o,mn(e))}catch(Q){So(e,t,{then:function(){},status:"rejected",reason:Q},mn())}finally{P.p=h,S!==null&&j.types!==null&&(S.types=j.types),O.T=S}}function x_(){}function Ou(e,t,s,o){if(e.tag!==5)throw Error(l(476));var u=Dp(e).queue;Ap(e,u,t,W,s===null?x_:function(){return Rp(e),s(o)})}function Dp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:W},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Rp(e){var t=Dp(e);t.next===null&&(t=e.alternate.memoizedState),So(e,t.next.queue,{},mn())}function Bu(){return Ht(zo)}function Mp(){return _t().memoizedState}function Op(){return _t().memoizedState}function S_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=mn();e=za(s);var o=Ua(t,e,s);o!==null&&(sn(o,t,s),vo(o,t,s)),t={cache:uu()},e.payload=t;return}t=t.return}}function __(e,t,s){var o=mn();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},nr(e)?Lp(t,s):(s=Jc(e,t,s,o),s!==null&&(sn(s,e,o),Ip(s,t,o)))}function Bp(e,t,s){var o=mn();So(e,t,s,o)}function So(e,t,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(nr(e))Lp(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var S=t.lastRenderedState,j=h(S,s);if(u.hasEagerState=!0,u.eagerState=j,rn(j,S))return Ll(e,t,u,0),at===null&&Bl(),!1}catch{}finally{}if(s=Jc(e,t,u,o),s!==null)return sn(s,e,o),Ip(s,t,o),!0}return!1}function Lu(e,t,s,o){if(o={lane:2,revertLane:md(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},nr(e)){if(t)throw Error(l(479))}else t=Jc(e,s,o,2),t!==null&&sn(t,e,2)}function nr(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function Lp(e,t){mi=Zl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Ip(e,t,s){if((s&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Ph(e,s)}}var _o={readContext:Ht,use:Wl,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};_o.useEffectEvent=gt;var zp={readContext:Ht,use:Wl,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:Sp,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,er(4194308,4,jp.bind(null,t,e),s)},useLayoutEffect:function(e,t){return er(4194308,4,e,t)},useInsertionEffect:function(e,t){er(4,2,e,t)},useMemo:function(e,t){var s=Xt();t=t===void 0?null:t;var o=e();if(ks){Ie(!0);try{e()}finally{Ie(!1)}}return s.memoizedState=[o,t],o},useReducer:function(e,t,s){var o=Xt();if(s!==void 0){var u=s(t);if(ks){Ie(!0);try{s(t)}finally{Ie(!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=__.bind(null,Ce,e),[o.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:function(e){e=Eu(e);var t=e.queue,s=Bp.bind(null,Ce,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Ru,useDeferredValue:function(e,t){var s=Xt();return Mu(s,e,t)},useTransition:function(){var e=Eu(!1);return e=Ap.bind(null,Ce,e.queue,!0,!1),Xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var o=Ce,u=Xt();if(ze){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),at===null)throw Error(l(349));(Oe&127)!==0||ip(o,t,s)}u.memoizedState=s;var h={value:s,getSnapshot:t};return u.queue=h,Sp(lp.bind(null,o,h,e),[e]),o.flags|=2048,vi(9,{destroy:void 0},op.bind(null,o,h,s,t),null),s},useId:function(){var e=Xt(),t=at.identifierPrefix;if(ze){var s=Kn,o=qn;s=(o&~(1<<32-Ye(o)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Xl++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=p_++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Bu,useFormState:vp,useActionState:vp,useOptimistic:function(e){var t=Xt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Lu.bind(null,Ce,!0,s),s.dispatch=t,[e,t]},useMemoCache:wu,useCacheRefresh:function(){return Xt().memoizedState=S_.bind(null,Ce)},useEffectEvent:function(e){var t=Xt(),s={impl:e};return t.memoizedState=s,function(){if((Fe&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},Iu={readContext:Ht,use:Wl,useCallback:Cp,useContext:Ht,useEffect:Du,useImperativeHandle:wp,useInsertionEffect:Tp,useLayoutEffect:kp,useMemo:Np,useReducer:Jl,useRef:xp,useState:function(){return Jl(ca)},useDebugValue:Ru,useDeferredValue:function(e,t){var s=_t();return Ep(s,We.memoizedState,e,t)},useTransition:function(){var e=Jl(ca)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:xo(e),t]},useSyncExternalStore:sp,useId:Mp,useHostTransitionStatus:Bu,useFormState:gp,useActionState:gp,useOptimistic:function(e,t){var s=_t();return up(s,We,e,t)},useMemoCache:wu,useCacheRefresh:Op};Iu.useEffectEvent=_p;var Up={readContext:Ht,use:Wl,useCallback:Cp,useContext:Ht,useEffect:Du,useImperativeHandle:wp,useInsertionEffect:Tp,useLayoutEffect:kp,useMemo:Np,useReducer:Nu,useRef:xp,useState:function(){return Nu(ca)},useDebugValue:Ru,useDeferredValue:function(e,t){var s=_t();return We===null?Mu(s,e,t):Ep(s,We.memoizedState,e,t)},useTransition:function(){var e=Nu(ca)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:xo(e),t]},useSyncExternalStore:sp,useId:Mp,useHostTransitionStatus:Bu,useFormState:bp,useActionState:bp,useOptimistic:function(e,t){var s=_t();return We!==null?up(s,We,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:wu,useCacheRefresh:Op};Up.useEffectEvent=_p;function zu(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 Uu={enqueueSetState:function(e,t,s){e=e._reactInternals;var o=mn(),u=za(o);u.payload=t,s!=null&&(u.callback=s),t=Ua(e,u,o),t!==null&&(sn(t,e,o),vo(t,e,o))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=mn(),u=za(o);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=Ua(e,u,o),t!==null&&(sn(t,e,o),vo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=mn(),o=za(s);o.tag=2,t!=null&&(o.callback=t),t=Ua(e,o,s),t!==null&&(sn(t,e,s),vo(t,e,s))}};function Vp(e,t,s,o,u,h,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,S):t.prototype&&t.prototype.isPureReactComponent?!lo(s,o)||!lo(u,h):!0}function Hp(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&&Uu.enqueueReplaceState(t,t.state,null)}function js(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 Pp(e){Ol(e)}function Gp(e){console.error(e)}function $p(e){Ol(e)}function ar(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function qp(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 Vu(e,t,s){return s=za(s),s.tag=3,s.payload={element:null},s.callback=function(){ar(e,t)},s}function Kp(e){return e=za(e),e.tag=3,e}function Yp(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(){qp(t,s,o)}}var S=s.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){qp(t,s,o),typeof u!="function"&&(qa===null?qa=new Set([this]):qa.add(this));var j=o.stack;this.componentDidCatch(o.value,{componentStack:j!==null?j:""})})}function T_(e,t,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=s.alternate,t!==null&&ri(t,s,u,!0),s=un.current,s!==null){switch(s.tag){case 31:case 13:return Cn===null?pr():s.alternate===null&&yt===0&&(yt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===$l?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([o]):t.add(o),dd(e,o,u)),!1;case 22:return s.flags|=65536,o===$l?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)),dd(e,o,u)),!1}throw Error(l(435,s.tag))}return dd(e,o,u),pr(),!1}if(ze)return t=un.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,o!==iu&&(e=Error(l(422),{cause:o}),uo(Tn(e,s)))):(o!==iu&&(t=Error(l(423),{cause:o}),uo(Tn(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=Tn(o,s),u=Vu(e.stateNode,o,u),vu(e,u),yt!==4&&(yt=2)),!1;var h=Error(l(520),{cause:o});if(h=Tn(h,s),Ao===null?Ao=[h]:Ao.push(h),yt!==4&&(yt=2),t===null)return!0;o=Tn(o,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=Vu(s.stateNode,o,e),vu(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"&&(qa===null||!qa.has(h))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Kp(u),Yp(u,e,s,o),vu(s,u),!1}s=s.return}while(s!==null);return!1}var Hu=Error(l(461)),wt=!1;function Pt(e,t,s,o){t.child=e===null?Qm(t,null,s,o):Ts(t,e.child,s,o)}function Fp(e,t,s,o,u){s=s.render;var h=t.ref;if("ref"in o){var S={};for(var j in o)j!=="ref"&&(S[j]=o[j])}else S=o;return bs(t),o=_u(e,t,s,S,h,u),j=Tu(),e!==null&&!wt?(ku(e,t,u),ua(e,t,u)):(ze&&j&&au(t),t.flags|=1,Pt(e,t,o,u),t.child)}function Zp(e,t,s,o,u){if(e===null){var h=s.type;return typeof h=="function"&&!eu(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,Xp(e,t,h,o,u)):(e=zl(s.type,null,o,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Zu(e,u)){var S=h.memoizedProps;if(s=s.compare,s=s!==null?s:lo,s(S,o)&&e.ref===t.ref)return ua(e,t,u)}return t.flags|=1,e=sa(h,o),e.ref=t.ref,e.return=t,t.child=e}function Xp(e,t,s,o,u){if(e!==null){var h=e.memoizedProps;if(lo(h,o)&&e.ref===t.ref)if(wt=!1,t.pendingProps=o=h,Zu(e,u))(e.flags&131072)!==0&&(wt=!0);else return t.lanes=e.lanes,ua(e,t,u)}return Pu(e,t,s,o,u)}function Qp(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 Wp(e,t,h,s,o)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Pl(t,h!==null?h.cachePool:null),h!==null?ep(t,h):yu(),tp(t);else return o=t.lanes=536870912,Wp(e,t,h!==null?h.baseLanes|s:s,s,o)}else h!==null?(Pl(t,h.cachePool),ep(t,h),Ha(),t.memoizedState=null):(e!==null&&Pl(t,null),yu(),Ha());return Pt(e,t,u,s),t.child}function To(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Wp(e,t,s,o,u){var h=fu();return h=h===null?null:{parent:kt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&Pl(t,null),yu(),tp(t),e!==null&&ri(e,t,o,!0),t.childLanes=u,null}function sr(e,t){return t=or({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Jp(e,t,s){return Ts(t,e.child,null,s),e=sr(t,t.pendingProps),e.flags|=2,dn(t),t.memoizedState=null,e}function k_(e,t,s){var o=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ze){if(o.mode==="hidden")return e=sr(t,o),t.lanes=536870912,To(null,e);if(xu(t),(e=it)?(e=dg(e,wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ma!==null?{id:qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},s=Lm(e),s.return=t,t.child=s,Vt=t,it=null)):e=null,e===null)throw Ba(t);return t.lanes=536870912,null}return sr(t,o)}var h=e.memoizedState;if(h!==null){var S=h.dehydrated;if(xu(t),u)if(t.flags&256)t.flags&=-257,t=Jp(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(wt||ri(e,t,s,!1),u=(s&e.childLanes)!==0,wt||u){if(o=at,o!==null&&(S=Gh(o,s),S!==0&&S!==h.retryLane))throw h.retryLane=S,ps(e,S),sn(o,e,S),Hu;pr(),t=Jp(e,t,s)}else e=h.treeContext,it=Nn(S.nextSibling),Vt=t,ze=!0,Oa=null,wn=!1,e!==null&&Um(t,e),t=sr(t,o),t.flags|=4096;return t}return e=sa(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ir(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 Pu(e,t,s,o,u){return bs(t),s=_u(e,t,s,o,void 0,u),o=Tu(),e!==null&&!wt?(ku(e,t,u),ua(e,t,u)):(ze&&o&&au(t),t.flags|=1,Pt(e,t,s,u),t.child)}function ev(e,t,s,o,u,h){return bs(t),t.updateQueue=null,s=ap(t,o,s,u),np(e),o=Tu(),e!==null&&!wt?(ku(e,t,h),ua(e,t,h)):(ze&&o&&au(t),t.flags|=1,Pt(e,t,s,h),t.child)}function tv(e,t,s,o,u){if(bs(t),t.stateNode===null){var h=si,S=s.contextType;typeof S=="object"&&S!==null&&(h=Ht(S)),h=new s(o,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Uu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=o,h.state=t.memoizedState,h.refs={},mu(t),S=s.contextType,h.context=typeof S=="object"&&S!==null?Ht(S):si,h.state=t.memoizedState,S=s.getDerivedStateFromProps,typeof S=="function"&&(zu(t,s,S,o),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(S=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),S!==h.state&&Uu.enqueueReplaceState(h,h.state,null),yo(t,o,h,u),go(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){h=t.stateNode;var j=t.memoizedProps,D=js(s,j);h.props=D;var H=h.context,Y=s.contextType;S=si,typeof Y=="object"&&Y!==null&&(S=Ht(Y));var Q=s.getDerivedStateFromProps;Y=typeof Q=="function"||typeof h.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,Y||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(j||H!==S)&&Hp(t,h,o,S),Ia=!1;var G=t.memoizedState;h.state=G,yo(t,o,h,u),go(),H=t.memoizedState,j||G!==H||Ia?(typeof Q=="function"&&(zu(t,s,Q,o),H=t.memoizedState),(D=Ia||Vp(t,s,D,o,G,H,S))?(Y||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=H),h.props=o,h.state=H,h.context=S,o=D):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{h=t.stateNode,pu(e,t),S=t.memoizedProps,Y=js(s,S),h.props=Y,Q=t.pendingProps,G=h.context,H=s.contextType,D=si,typeof H=="object"&&H!==null&&(D=Ht(H)),j=s.getDerivedStateFromProps,(H=typeof j=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S!==Q||G!==D)&&Hp(t,h,o,D),Ia=!1,G=t.memoizedState,h.state=G,yo(t,o,h,u),go();var $=t.memoizedState;S!==Q||G!==$||Ia||e!==null&&e.dependencies!==null&&Vl(e.dependencies)?(typeof j=="function"&&(zu(t,s,j,o),$=t.memoizedState),(Y=Ia||Vp(t,s,Y,o,G,$,D)||e!==null&&e.dependencies!==null&&Vl(e.dependencies))?(H||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"||S===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=$),h.props=o,h.state=$,h.context=D,o=Y):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),o=!1)}return h=o,ir(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=Ts(t,e.child,null,u),t.child=Ts(t,null,s,u)):Pt(e,t,s,u),t.memoizedState=h.state,e=t.child):e=ua(e,t,u),e}function nv(e,t,s,o){return gs(),t.flags|=256,Pt(e,t,s,o),t.child}var Gu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $u(e){return{baseLanes:e,cachePool:qm()}}function qu(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=hn),e}function av(e,t,s){var o=t.pendingProps,u=!1,h=(t.flags&128)!==0,S;if((S=h)||(S=e!==null&&e.memoizedState===null?!1:(St.current&2)!==0),S&&(u=!0,t.flags&=-129),S=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(u?Va(t):Ha(),(e=it)?(e=dg(e,wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ma!==null?{id:qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},s=Lm(e),s.return=t,t.child=s,Vt=t,it=null)):e=null,e===null)throw Ba(t);return Cd(e)?t.lanes=32:t.lanes=536870912,null}var j=o.children;return o=o.fallback,u?(Ha(),u=t.mode,j=or({mode:"hidden",children:j},u),o=vs(o,u,s,null),j.return=t,o.return=t,j.sibling=o,t.child=j,o=t.child,o.memoizedState=$u(s),o.childLanes=qu(e,S,s),t.memoizedState=Gu,To(null,o)):(Va(t),Ku(t,j))}var D=e.memoizedState;if(D!==null&&(j=D.dehydrated,j!==null)){if(h)t.flags&256?(Va(t),t.flags&=-257,t=Yu(e,t,s)):t.memoizedState!==null?(Ha(),t.child=e.child,t.flags|=128,t=null):(Ha(),j=o.fallback,u=t.mode,o=or({mode:"visible",children:o.children},u),j=vs(j,u,s,null),j.flags|=2,o.return=t,j.return=t,o.sibling=j,t.child=o,Ts(t,e.child,null,s),o=t.child,o.memoizedState=$u(s),o.childLanes=qu(e,S,s),t.memoizedState=Gu,t=To(null,o));else if(Va(t),Cd(j)){if(S=j.nextSibling&&j.nextSibling.dataset,S)var H=S.dgst;S=H,o=Error(l(419)),o.stack="",o.digest=S,uo({value:o,source:null,stack:null}),t=Yu(e,t,s)}else if(wt||ri(e,t,s,!1),S=(s&e.childLanes)!==0,wt||S){if(S=at,S!==null&&(o=Gh(S,s),o!==0&&o!==D.retryLane))throw D.retryLane=o,ps(e,o),sn(S,e,o),Hu;wd(j)||pr(),t=Yu(e,t,s)}else wd(j)?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,it=Nn(j.nextSibling),Vt=t,ze=!0,Oa=null,wn=!1,e!==null&&Um(t,e),t=Ku(t,o.children),t.flags|=4096);return t}return u?(Ha(),j=o.fallback,u=t.mode,D=e.child,H=D.sibling,o=sa(D,{mode:"hidden",children:o.children}),o.subtreeFlags=D.subtreeFlags&65011712,H!==null?j=sa(H,j):(j=vs(j,u,s,null),j.flags|=2),j.return=t,o.return=t,o.sibling=j,t.child=o,To(null,o),o=t.child,j=e.child.memoizedState,j===null?j=$u(s):(u=j.cachePool,u!==null?(D=kt._currentValue,u=u.parent!==D?{parent:D,pool:D}:u):u=qm(),j={baseLanes:j.baseLanes|s,cachePool:u}),o.memoizedState=j,o.childLanes=qu(e,S,s),t.memoizedState=Gu,To(e.child,o)):(Va(t),s=e.child,e=s.sibling,s=sa(s,{mode:"visible",children:o.children}),s.return=t,s.sibling=null,e!==null&&(S=t.deletions,S===null?(t.deletions=[e],t.flags|=16):S.push(e)),t.child=s,t.memoizedState=null,s)}function Ku(e,t){return t=or({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function or(e,t){return e=cn(22,e,null,t),e.lanes=0,e}function Yu(e,t,s){return Ts(t,e.child,null,s),e=Ku(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sv(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),ru(e.return,t,s)}function Fu(e,t,s,o,u,h){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u,treeForkCount:h}:(S.isBackwards=t,S.rendering=null,S.renderingStartTime=0,S.last=o,S.tail=s,S.tailMode=u,S.treeForkCount=h)}function iv(e,t,s){var o=t.pendingProps,u=o.revealOrder,h=o.tail;o=o.children;var S=St.current,j=(S&2)!==0;if(j?(S=S&1|2,t.flags|=128):S&=1,Se(St,S),Pt(e,t,o,s),o=ze?co:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&sv(e,s,t);else if(e.tag===19)sv(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&&Fl(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),Fu(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&&Fl(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Fu(t,!0,s,null,h,o);break;case"together":Fu(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function ua(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),$a|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(ri(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=sa(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=sa(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Zu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Vl(e)))}function j_(e,t,s){switch(t.tag){case 3:tt(t,t.stateNode.containerInfo),La(t,kt,e.memoizedState.cache),gs();break;case 27:case 5:X(t);break;case 4:tt(t,t.stateNode.containerInfo);break;case 10:La(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,xu(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Va(t),t.flags|=128,null):(s&t.child.childLanes)!==0?av(e,t,s):(Va(t),e=ua(e,t,s),e!==null?e.sibling:null);Va(t);break;case 19:var u=(e.flags&128)!==0;if(o=(s&t.childLanes)!==0,o||(ri(e,t,s,!1),o=(s&t.childLanes)!==0),u){if(o)return iv(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Se(St,St.current),o)break;return null;case 22:return t.lanes=0,Qp(e,t,s,t.pendingProps);case 24:La(t,kt,e.memoizedState.cache)}return ua(e,t,s)}function ov(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)wt=!0;else{if(!Zu(e,s)&&(t.flags&128)===0)return wt=!1,j_(e,t,s);wt=(e.flags&131072)!==0}else wt=!1,ze&&(t.flags&1048576)!==0&&zm(t,co,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=Ss(t.elementType),t.type=e,typeof e=="function")eu(e)?(o=js(e,o),t.tag=1,t=tv(null,t,e,o,s)):(t.tag=0,t=Pu(null,t,e,o,s));else{if(e!=null){var u=e.$$typeof;if(u===R){t.tag=11,t=Fp(null,t,e,o,s);break e}else if(u===U){t.tag=14,t=Zp(null,t,e,o,s);break e}}throw t=q(e)||e,Error(l(306,t,""))}}return t;case 0:return Pu(e,t,t.type,t.pendingProps,s);case 1:return o=t.type,u=js(o,t.pendingProps),tv(e,t,o,u,s);case 3:e:{if(tt(t,t.stateNode.containerInfo),e===null)throw Error(l(387));o=t.pendingProps;var h=t.memoizedState;u=h.element,pu(e,t),yo(t,o,null,s);var S=t.memoizedState;if(o=S.cache,La(t,kt,o),o!==h.cache&&cu(t,[kt],s,!0),go(),o=S.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:S.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=nv(e,t,o,s);break e}else if(o!==u){u=Tn(Error(l(424)),t),uo(u),t=nv(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(it=Nn(e.firstChild),Vt=t,ze=!0,Oa=null,wn=!0,s=Qm(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(gs(),o===u){t=ua(e,t,s);break e}Pt(e,t,o,s)}t=t.child}return t;case 26:return ir(e,t),e===null?(s=gg(t.type,null,t.pendingProps,null))?t.memoizedState=s:ze||(s=t.type,e=t.pendingProps,o=_r(ue.current).createElement(s),o[Ut]=t,o[Wt]=e,Gt(o,s,e),Lt(o),t.stateNode=o):t.memoizedState=gg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return X(t),e===null&&ze&&(o=t.stateNode=mg(t.type,t.pendingProps,ue.current),Vt=t,wn=!0,u=it,Za(t.type)?(Nd=u,it=Nn(o.firstChild)):it=u),Pt(e,t,t.pendingProps.children,s),ir(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((u=o=it)&&(o=t1(o,t.type,t.pendingProps,wn),o!==null?(t.stateNode=o,Vt=t,it=Nn(o.firstChild),wn=!1,u=!0):u=!1),u||Ba(t)),X(t),u=t.type,h=t.pendingProps,S=e!==null?e.memoizedProps:null,o=h.children,Td(u,h)?o=null:S!==null&&Td(u,S)&&(t.flags|=32),t.memoizedState!==null&&(u=_u(e,t,v_,null,null,s),zo._currentValue=u),ir(e,t),Pt(e,t,o,s),t.child;case 6:return e===null&&ze&&((e=s=it)&&(s=n1(s,t.pendingProps,wn),s!==null?(t.stateNode=s,Vt=t,it=null,e=!0):e=!1),e||Ba(t)),null;case 13:return av(e,t,s);case 4:return tt(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Ts(t,null,o,s):Pt(e,t,o,s),t.child;case 11:return Fp(e,t,t.type,t.pendingProps,s);case 7:return Pt(e,t,t.pendingProps,s),t.child;case 8:return Pt(e,t,t.pendingProps.children,s),t.child;case 12:return Pt(e,t,t.pendingProps.children,s),t.child;case 10:return o=t.pendingProps,La(t,t.type,o.value),Pt(e,t,o.children,s),t.child;case 9:return u=t.type._context,o=t.pendingProps.children,bs(t),u=Ht(u),o=o(u),t.flags|=1,Pt(e,t,o,s),t.child;case 14:return Zp(e,t,t.type,t.pendingProps,s);case 15:return Xp(e,t,t.type,t.pendingProps,s);case 19:return iv(e,t,s);case 31:return k_(e,t,s);case 22:return Qp(e,t,s,t.pendingProps);case 24:return bs(t),o=Ht(kt),e===null?(u=fu(),u===null&&(u=at,h=uu(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=s),u=h),t.memoizedState={parent:o,cache:u},mu(t),La(t,kt,u)):((e.lanes&s)!==0&&(pu(e,t),yo(t,null,null,s),go()),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),La(t,kt,o)):(o=h.cache,La(t,kt,o),o!==u.cache&&cu(t,[kt],s,!0))),Pt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function da(e){e.flags|=4}function Xu(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(Mv())e.flags|=8192;else throw _s=$l,hu}else e.flags&=-16777217}function lv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!_g(t))if(Mv())e.flags|=8192;else throw _s=$l,hu}function lr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Vh():536870912,e.lanes|=t,xi|=t)}function ko(e,t){if(!ze)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 ot(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 w_(e,t,s){var o=t.pendingProps;switch(su(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return ot(t),null;case 3:return s=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),la(kt),ee(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(li(t)?da(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ou())),ot(t),null;case 26:var u=t.type,h=t.memoizedState;return e===null?(da(t),h!==null?(ot(t),lv(t,h)):(ot(t),Xu(t,u,null,o,s))):h?h!==e.memoizedState?(da(t),ot(t),lv(t,h)):(ot(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&da(t),ot(t),Xu(t,u,e,o,s)),null;case 27:if(At(t),s=ue.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&da(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return ot(t),null}e=Le.current,li(t)?Vm(t):(e=mg(u,o,s),t.stateNode=e,da(t))}return ot(t),null;case 5:if(At(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&da(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return ot(t),null}if(h=Le.current,li(t))Vm(t);else{var S=_r(ue.current);switch(h){case 1:h=S.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=S.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=S.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=S.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=S.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?S.createElement("select",{is:o.is}):S.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?S.createElement(u,{is:o.is}):S.createElement(u)}}h[Ut]=t,h[Wt]=o;e:for(S=t.child;S!==null;){if(S.tag===5||S.tag===6)h.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===t)break e;for(;S.sibling===null;){if(S.return===null||S.return===t)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}t.stateNode=h;e:switch(Gt(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&&da(t)}}return ot(t),Xu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&da(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(l(166));if(e=ue.current,li(t)){if(e=t.stateNode,s=t.memoizedProps,o=null,u=Vt,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[Ut]=t,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||ag(e.nodeValue,s)),e||Ba(t,!0)}else e=_r(e).createTextNode(o),e[Ut]=t,t.stateNode=e}return ot(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(o=li(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[Ut]=t}else gs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),e=!1}else s=ou(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(dn(t),t):(dn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return ot(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=li(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[Ut]=t}else gs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),u=!1}else u=ou(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(dn(t),t):(dn(t),null)}return dn(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),lr(t,t.updateQueue),ot(t),null);case 4:return ee(),e===null&&yd(t.stateNode.containerInfo),ot(t),null;case 10:return la(t.type),ot(t),null;case 19:if(je(St),o=t.memoizedState,o===null)return ot(t),null;if(u=(t.flags&128)!==0,h=o.rendering,h===null)if(u)ko(o,!1);else{if(yt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Fl(e),h!==null){for(t.flags|=128,ko(o,!1),e=h.updateQueue,t.updateQueue=e,lr(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Bm(s,e),s=s.sibling;return Se(St,St.current&1|2),ze&&ia(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&Kt()>fr&&(t.flags|=128,u=!0,ko(o,!1),t.lanes=4194304)}else{if(!u)if(e=Fl(h),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,lr(t,e),ko(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!ze)return ot(t),null}else 2*Kt()-o.renderingStartTime>fr&&s!==536870912&&(t.flags|=128,u=!0,ko(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=Kt(),e.sibling=null,s=St.current,Se(St,u?s&1|2:s&1),ze&&ia(t,o.treeForkCount),e):(ot(t),null);case 22:case 23:return dn(t),bu(),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&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),s=t.updateQueue,s!==null&&lr(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&&je(xs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),la(kt),ot(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function C_(e,t){switch(su(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return la(kt),ee(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return At(t),null;case 31:if(t.memoizedState!==null){if(dn(t),t.alternate===null)throw Error(l(340));gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(dn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(St),null;case 4:return ee(),null;case 10:return la(t.type),null;case 22:case 23:return dn(t),bu(),e!==null&&je(xs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return la(kt),null;case 25:return null;default:return null}}function rv(e,t){switch(su(t),t.tag){case 3:la(kt),ee();break;case 26:case 27:case 5:At(t);break;case 4:ee();break;case 31:t.memoizedState!==null&&dn(t);break;case 13:dn(t);break;case 19:je(St);break;case 10:la(t.type);break;case 22:case 23:dn(t),bu(),e!==null&&je(xs);break;case 24:la(kt)}}function jo(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=s.inst;o=h(),S.destroy=o}s=s.next}while(s!==u)}}catch(j){Qe(t,t.return,j)}}function Pa(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 S=o.inst,j=S.destroy;if(j!==void 0){S.destroy=void 0,u=t;var D=s,H=j;try{H()}catch(Y){Qe(u,D,Y)}}}o=o.next}while(o!==h)}}catch(Y){Qe(t,t.return,Y)}}function cv(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Jm(t,s)}catch(o){Qe(e,e.return,o)}}}function uv(e,t,s){s.props=js(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){Qe(e,t,o)}}function wo(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){Qe(e,t,u)}}function Yn(e,t){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(u){Qe(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){Qe(e,t,u)}else s.current=null}function dv(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){Qe(e,e.return,u)}}function Qu(e,t,s){try{var o=e.stateNode;Z_(o,e.type,s,t),o[Wt]=t}catch(u){Qe(e,e.return,u)}}function fv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Za(e.type)||e.tag===4}function Wu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fv(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&&Za(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 Ju(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=na));else if(o!==4&&(o===27&&Za(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Ju(e,t,s),e=e.sibling;e!==null;)Ju(e,t,s),e=e.sibling}function rr(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&&Za(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(rr(e,t,s),e=e.sibling;e!==null;)rr(e,t,s),e=e.sibling}function hv(e){var t=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Gt(t,o,s),t[Ut]=e,t[Wt]=s}catch(h){Qe(e,e.return,h)}}var fa=!1,Ct=!1,ed=!1,mv=typeof WeakSet=="function"?WeakSet:Set,It=null;function N_(e,t){if(e=e.containerInfo,Sd=Er,e=wm(e),Yc(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 S=0,j=-1,D=-1,H=0,Y=0,Q=e,G=null;t:for(;;){for(var $;Q!==s||u!==0&&Q.nodeType!==3||(j=S+u),Q!==h||o!==0&&Q.nodeType!==3||(D=S+o),Q.nodeType===3&&(S+=Q.nodeValue.length),($=Q.firstChild)!==null;)G=Q,Q=$;for(;;){if(Q===e)break t;if(G===s&&++H===u&&(j=S),G===h&&++Y===o&&(D=S),($=Q.nextSibling)!==null)break;Q=G,G=Q.parentNode}Q=$}s=j===-1||D===-1?null:{start:j,end:D}}else s=null}s=s||{start:0,end:0}}else s=null;for(_d={focusedElem:e,selectionRange:s},Er=!1,It=t;It!==null;)if(t=It,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,It=e;else for(;It!==null;){switch(t=It,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 he=js(s.type,u);e=o.getSnapshotBeforeUpdate(he,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(ye){Qe(s,s.return,ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)jd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":jd(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,It=e;break}It=t.return}}function pv(e,t,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:ma(e,s),o&4&&jo(5,s);break;case 1:if(ma(e,s),o&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(S){Qe(s,s.return,S)}else{var u=js(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(S){Qe(s,s.return,S)}}o&64&&cv(s),o&512&&wo(s,s.return);break;case 3:if(ma(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{Jm(e,t)}catch(S){Qe(s,s.return,S)}}break;case 27:t===null&&o&4&&hv(s);case 26:case 5:ma(e,s),t===null&&o&4&&dv(s),o&512&&wo(s,s.return);break;case 12:ma(e,s);break;case 31:ma(e,s),o&4&&yv(e,s);break;case 13:ma(e,s),o&4&&bv(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=I_.bind(null,s),a1(e,s))));break;case 22:if(o=s.memoizedState!==null||fa,!o){t=t!==null&&t.memoizedState!==null||Ct,u=fa;var h=Ct;fa=o,(Ct=t)&&!h?pa(e,s,(s.subtreeFlags&8772)!==0):ma(e,s),fa=u,Ct=h}break;case 30:break;default:ma(e,s)}}function vv(e){var t=e.alternate;t!==null&&(e.alternate=null,vv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ac(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 dt=null,en=!1;function ha(e,t,s){for(s=s.child;s!==null;)gv(e,t,s),s=s.sibling}function gv(e,t,s){if(He&&typeof He.onCommitFiberUnmount=="function")try{He.onCommitFiberUnmount(we,s)}catch{}switch(s.tag){case 26:Ct||Yn(s,t),ha(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ct||Yn(s,t);var o=dt,u=en;Za(s.type)&&(dt=s.stateNode,en=!1),ha(e,t,s),Bo(s.stateNode),dt=o,en=u;break;case 5:Ct||Yn(s,t);case 6:if(o=dt,u=en,dt=null,ha(e,t,s),dt=o,en=u,dt!==null)if(en)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(s.stateNode)}catch(h){Qe(s,t,h)}else try{dt.removeChild(s.stateNode)}catch(h){Qe(s,t,h)}break;case 18:dt!==null&&(en?(e=dt,cg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Ni(e)):cg(dt,s.stateNode));break;case 4:o=dt,u=en,dt=s.stateNode.containerInfo,en=!0,ha(e,t,s),dt=o,en=u;break;case 0:case 11:case 14:case 15:Pa(2,s,t),Ct||Pa(4,s,t),ha(e,t,s);break;case 1:Ct||(Yn(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"&&uv(s,t,o)),ha(e,t,s);break;case 21:ha(e,t,s);break;case 22:Ct=(o=Ct)||s.memoizedState!==null,ha(e,t,s),Ct=o;break;default:ha(e,t,s)}}function yv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ni(e)}catch(s){Qe(t,t.return,s)}}}function bv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ni(e)}catch(s){Qe(t,t.return,s)}}function E_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new mv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new mv),t;default:throw Error(l(435,e.tag))}}function cr(e,t){var s=E_(e);t.forEach(function(o){if(!s.has(o)){s.add(o);var u=z_.bind(null,e,o);o.then(u,u)}})}function tn(e,t){var s=t.deletions;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o],h=e,S=t,j=S;e:for(;j!==null;){switch(j.tag){case 27:if(Za(j.type)){dt=j.stateNode,en=!1;break e}break;case 5:dt=j.stateNode,en=!1;break e;case 3:case 4:dt=j.stateNode.containerInfo,en=!0;break e}j=j.return}if(dt===null)throw Error(l(160));gv(h,S,u),dt=null,en=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)xv(t,e),t=t.sibling}var zn=null;function xv(e,t){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:tn(t,e),nn(e),o&4&&(Pa(3,e,e.return),jo(3,e),Pa(5,e,e.return));break;case 1:tn(t,e),nn(e),o&512&&(Ct||s===null||Yn(s,s.return)),o&64&&fa&&(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=zn;if(tn(t,e),nn(e),o&512&&(Ct||s===null||Yn(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[Wi]||h[Ut]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(o),u.head.insertBefore(h,u.querySelector("head > title"))),Gt(h,o,s),h[Ut]=e,Lt(h),o=h;break e;case"link":var S=xg("link","href",u).get(o+(s.href||""));if(S){for(var j=0;j<S.length;j++)if(h=S[j],h.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&h.getAttribute("rel")===(s.rel==null?null:s.rel)&&h.getAttribute("title")===(s.title==null?null:s.title)&&h.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){S.splice(j,1);break t}}h=u.createElement(o),Gt(h,o,s),u.head.appendChild(h);break;case"meta":if(S=xg("meta","content",u).get(o+(s.content||""))){for(j=0;j<S.length;j++)if(h=S[j],h.getAttribute("content")===(s.content==null?null:""+s.content)&&h.getAttribute("name")===(s.name==null?null:s.name)&&h.getAttribute("property")===(s.property==null?null:s.property)&&h.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&h.getAttribute("charset")===(s.charSet==null?null:s.charSet)){S.splice(j,1);break t}}h=u.createElement(o),Gt(h,o,s),u.head.appendChild(h);break;default:throw Error(l(468,o))}h[Ut]=e,Lt(h),o=h}e.stateNode=o}else Sg(u,e.type,e.stateNode);else e.stateNode=bg(u,o,e.memoizedProps);else h!==o?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,o===null?Sg(u,e.type,e.stateNode):bg(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Qu(e,e.memoizedProps,s.memoizedProps)}break;case 27:tn(t,e),nn(e),o&512&&(Ct||s===null||Yn(s,s.return)),s!==null&&o&4&&Qu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(tn(t,e),nn(e),o&512&&(Ct||s===null||Yn(s,s.return)),e.flags&32){u=e.stateNode;try{Qs(u,"")}catch(he){Qe(e,e.return,he)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,Qu(e,u,s!==null?s.memoizedProps:u)),o&1024&&(ed=!0);break;case 6:if(tn(t,e),nn(e),o&4){if(e.stateNode===null)throw Error(l(162));o=e.memoizedProps,s=e.stateNode;try{s.nodeValue=o}catch(he){Qe(e,e.return,he)}}break;case 3:if(jr=null,u=zn,zn=Tr(t.containerInfo),tn(t,e),zn=u,nn(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{Ni(t.containerInfo)}catch(he){Qe(e,e.return,he)}ed&&(ed=!1,Sv(e));break;case 4:o=zn,zn=Tr(e.stateNode.containerInfo),tn(t,e),nn(e),zn=o;break;case 12:tn(t,e),nn(e);break;case 31:tn(t,e),nn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,cr(e,o)));break;case 13:tn(t,e),nn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(dr=Kt()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,cr(e,o)));break;case 22:u=e.memoizedState!==null;var D=s!==null&&s.memoizedState!==null,H=fa,Y=Ct;if(fa=H||u,Ct=Y||D,tn(t,e),Ct=Y,fa=H,nn(e),o&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(s===null||D||fa||Ct||ws(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){D=s=t;try{if(h=D.stateNode,u)S=h.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{j=D.stateNode;var Q=D.memoizedProps.style,G=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;j.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(he){Qe(D,D.return,he)}}}else if(t.tag===6){if(s===null){D=t;try{D.stateNode.nodeValue=u?"":D.memoizedProps}catch(he){Qe(D,D.return,he)}}}else if(t.tag===18){if(s===null){D=t;try{var $=D.stateNode;u?ug($,!0):ug(D.stateNode,!1)}catch(he){Qe(D,D.return,he)}}}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,cr(e,s))));break;case 19:tn(t,e),nn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,cr(e,o)));break;case 30:break;case 21:break;default:tn(t,e),nn(e)}}function nn(e){var t=e.flags;if(t&2){try{for(var s,o=e.return;o!==null;){if(fv(o)){s=o;break}o=o.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var u=s.stateNode,h=Wu(e);rr(e,h,u);break;case 5:var S=s.stateNode;s.flags&32&&(Qs(S,""),s.flags&=-33);var j=Wu(e);rr(e,j,S);break;case 3:case 4:var D=s.stateNode.containerInfo,H=Wu(e);Ju(e,H,D);break;default:throw Error(l(161))}}catch(Y){Qe(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ma(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pv(e,t.alternate,t),t=t.sibling}function ws(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Pa(4,t,t.return),ws(t);break;case 1:Yn(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&uv(t,t.return,s),ws(t);break;case 27:Bo(t.stateNode);case 26:case 5:Yn(t,t.return),ws(t);break;case 22:t.memoizedState===null&&ws(t);break;case 30:ws(t);break;default:ws(t)}e=e.sibling}}function pa(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,u=e,h=t,S=h.flags;switch(h.tag){case 0:case 11:case 15:pa(u,h,s),jo(4,h);break;case 1:if(pa(u,h,s),o=h,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(H){Qe(o,o.return,H)}if(o=h,u=o.updateQueue,u!==null){var j=o.stateNode;try{var D=u.shared.hiddenCallbacks;if(D!==null)for(u.shared.hiddenCallbacks=null,u=0;u<D.length;u++)Wm(D[u],j)}catch(H){Qe(o,o.return,H)}}s&&S&64&&cv(h),wo(h,h.return);break;case 27:hv(h);case 26:case 5:pa(u,h,s),s&&o===null&&S&4&&dv(h),wo(h,h.return);break;case 12:pa(u,h,s);break;case 31:pa(u,h,s),s&&S&4&&yv(u,h);break;case 13:pa(u,h,s),s&&S&4&&bv(u,h);break;case 22:h.memoizedState===null&&pa(u,h,s),wo(h,h.return);break;case 30:break;default:pa(u,h,s)}t=t.sibling}}function td(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&&fo(s))}function nd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fo(e))}function Un(e,t,s,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)_v(e,t,s,o),t=t.sibling}function _v(e,t,s,o){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Un(e,t,s,o),u&2048&&jo(9,t);break;case 1:Un(e,t,s,o);break;case 3:Un(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&&fo(e)));break;case 12:if(u&2048){Un(e,t,s,o),e=t.stateNode;try{var h=t.memoizedProps,S=h.id,j=h.onPostCommit;typeof j=="function"&&j(S,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){Qe(t,t.return,D)}}else Un(e,t,s,o);break;case 31:Un(e,t,s,o);break;case 13:Un(e,t,s,o);break;case 23:break;case 22:h=t.stateNode,S=t.alternate,t.memoizedState!==null?h._visibility&2?Un(e,t,s,o):Co(e,t):h._visibility&2?Un(e,t,s,o):(h._visibility|=2,gi(e,t,s,o,(t.subtreeFlags&10256)!==0||!1)),u&2048&&td(S,t);break;case 24:Un(e,t,s,o),u&2048&&nd(t.alternate,t);break;default:Un(e,t,s,o)}}function gi(e,t,s,o,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,S=t,j=s,D=o,H=S.flags;switch(S.tag){case 0:case 11:case 15:gi(h,S,j,D,u),jo(8,S);break;case 23:break;case 22:var Y=S.stateNode;S.memoizedState!==null?Y._visibility&2?gi(h,S,j,D,u):Co(h,S):(Y._visibility|=2,gi(h,S,j,D,u)),u&&H&2048&&td(S.alternate,S);break;case 24:gi(h,S,j,D,u),u&&H&2048&&nd(S.alternate,S);break;default:gi(h,S,j,D,u)}t=t.sibling}}function Co(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:Co(s,o),u&2048&&td(o.alternate,o);break;case 24:Co(s,o),u&2048&&nd(o.alternate,o);break;default:Co(s,o)}t=t.sibling}}var No=8192;function yi(e,t,s){if(e.subtreeFlags&No)for(e=e.child;e!==null;)Tv(e,t,s),e=e.sibling}function Tv(e,t,s){switch(e.tag){case 26:yi(e,t,s),e.flags&No&&e.memoizedState!==null&&p1(s,zn,e.memoizedState,e.memoizedProps);break;case 5:yi(e,t,s);break;case 3:case 4:var o=zn;zn=Tr(e.stateNode.containerInfo),yi(e,t,s),zn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=No,No=16777216,yi(e,t,s),No=o):yi(e,t,s));break;default:yi(e,t,s)}}function kv(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 Eo(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];It=o,wv(o,e)}kv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jv(e),e=e.sibling}function jv(e){switch(e.tag){case 0:case 11:case 15:Eo(e),e.flags&2048&&Pa(9,e,e.return);break;case 3:Eo(e);break;case 12:Eo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ur(e)):Eo(e);break;default:Eo(e)}}function ur(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];It=o,wv(o,e)}kv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Pa(8,t,t.return),ur(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,ur(t));break;default:ur(t)}e=e.sibling}}function wv(e,t){for(;It!==null;){var s=It;switch(s.tag){case 0:case 11:case 15:Pa(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:fo(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,It=o;else e:for(s=e;It!==null;){o=It;var u=o.sibling,h=o.return;if(vv(o),o===s){It=null;break e}if(u!==null){u.return=h,It=u;break e}It=h}}}var A_={getCacheForType:function(e){var t=Ht(kt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ht(kt).controller.signal}},D_=typeof WeakMap=="function"?WeakMap:Map,Fe=0,at=null,Re=null,Oe=0,Xe=0,fn=null,Ga=!1,bi=!1,ad=!1,va=0,yt=0,$a=0,Cs=0,sd=0,hn=0,xi=0,Ao=null,an=null,id=!1,dr=0,Cv=0,fr=1/0,hr=null,qa=null,Rt=0,Ka=null,Si=null,ga=0,od=0,ld=null,Nv=null,Do=0,rd=null;function mn(){return(Fe&2)!==0&&Oe!==0?Oe&-Oe:O.T!==null?md():$h()}function Ev(){if(hn===0)if((Oe&536870912)===0||ze){var e=Aa;Aa<<=1,(Aa&3932160)===0&&(Aa=262144),hn=e}else hn=536870912;return e=un.current,e!==null&&(e.flags|=32),hn}function sn(e,t,s){(e===at&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)&&(_i(e,0),Ya(e,Oe,hn,!1)),Qi(e,s),((Fe&2)===0||e!==at)&&(e===at&&((Fe&2)===0&&(Cs|=s),yt===4&&Ya(e,Oe,hn,!1)),Fn(e))}function Av(e,t,s){if((Fe&6)!==0)throw Error(l(327));var o=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Xi(e,t),u=o?O_(e,t):ud(e,t,!0),h=o;do{if(u===0){bi&&!o&&Ya(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!R_(s)){u=ud(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){t=S;e:{var j=e;u=Ao;var D=j.current.memoizedState.isDehydrated;if(D&&(_i(j,S).flags|=256),S=ud(j,S,!1),S!==2){if(ad&&!D){j.errorRecoveryDisabledLanes|=h,Cs|=h,u=4;break e}h=an,an=u,h!==null&&(an===null?an=h:an.push.apply(an,h))}u=S}if(h=!1,u!==2)continue}}if(u===1){_i(e,0),Ya(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:Ya(o,t,hn,!Ga);break e;case 2:an=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(u=dr+300-Kt(),10<u)){if(Ya(o,t,hn,!Ga),Tl(o,0,!0)!==0)break e;ga=t,o.timeoutHandle=lg(Dv.bind(null,o,s,an,hr,id,t,hn,Cs,xi,Ga,h,"Throttled",-0,0),u);break e}Dv(o,s,an,hr,id,t,hn,Cs,xi,Ga,h,null,-0,0)}}break}while(!0);Fn(e)}function Dv(e,t,s,o,u,h,S,j,D,H,Y,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:na},Tv(t,h,Q);var he=(h&62914560)===h?dr-Kt():(h&4194048)===h?Cv-Kt():0;if(he=v1(Q,he),he!==null){ga=h,e.cancelPendingCommit=he(Uv.bind(null,e,t,h,s,o,u,S,j,D,Y,Q,null,G,$)),Ya(e,h,S,!H);return}}Uv(e,t,h,s,o,u,S,j,D)}function R_(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(!rn(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 Ya(e,t,s,o){t&=~sd,t&=~Cs,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var u=t;0<u;){var h=31-Ye(u),S=1<<h;o[h]=-1,u&=~S}s!==0&&Hh(e,s,t)}function mr(){return(Fe&6)===0?(Ro(0),!1):!0}function cd(){if(Re!==null){if(Xe===0)var e=Re.return;else e=Re,oa=ys=null,ju(e),fi=null,mo=0,e=Re;for(;e!==null;)rv(e.alternate,e),e=e.return;Re=null}}function _i(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,W_(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ga=0,cd(),at=e,Re=s=sa(e.current,null),Oe=t,Xe=0,fn=null,Ga=!1,bi=Xi(e,t),ad=!1,xi=hn=sd=Cs=$a=yt=0,an=Ao=null,id=!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-Ye(o),h=1<<u;t|=e[u],o&=~h}return va=t,Bl(),s}function Rv(e,t){Ce=null,O.H=_o,t===di||t===Gl?(t=Fm(),Xe=3):t===hu?(t=Fm(),Xe=4):Xe=t===Hu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,fn=t,Re===null&&(yt=1,ar(e,Tn(t,e.current)))}function Mv(){var e=un.current;return e===null?!0:(Oe&4194048)===Oe?Cn===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?e===Cn:!1}function Ov(){var e=O.H;return O.H=_o,e===null?_o:e}function Bv(){var e=O.A;return O.A=A_,e}function pr(){yt=4,Ga||(Oe&4194048)!==Oe&&un.current!==null||(bi=!0),($a&134217727)===0&&(Cs&134217727)===0||at===null||Ya(at,Oe,hn,!1)}function ud(e,t,s){var o=Fe;Fe|=2;var u=Ov(),h=Bv();(at!==e||Oe!==t)&&(hr=null,_i(e,t)),t=!1;var S=yt;e:do try{if(Xe!==0&&Re!==null){var j=Re,D=fn;switch(Xe){case 8:cd(),S=6;break e;case 3:case 2:case 9:case 6:un.current===null&&(t=!0);var H=Xe;if(Xe=0,fn=null,Ti(e,j,D,H),s&&bi){S=0;break e}break;default:H=Xe,Xe=0,fn=null,Ti(e,j,D,H)}}M_(),S=yt;break}catch(Y){Rv(e,Y)}while(!0);return t&&e.shellSuspendCounter++,oa=ys=null,Fe=o,O.H=u,O.A=h,Re===null&&(at=null,Oe=0,Bl()),S}function M_(){for(;Re!==null;)Lv(Re)}function O_(e,t){var s=Fe;Fe|=2;var o=Ov(),u=Bv();at!==e||Oe!==t?(hr=null,fr=Kt()+500,_i(e,t)):bi=Xi(e,t);e:do try{if(Xe!==0&&Re!==null){t=Re;var h=fn;t:switch(Xe){case 1:Xe=0,fn=null,Ti(e,t,h,1);break;case 2:case 9:if(Km(h)){Xe=0,fn=null,Iv(t);break}t=function(){Xe!==2&&Xe!==9||at!==e||(Xe=7),Fn(e)},h.then(t,t);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:Km(h)?(Xe=0,fn=null,Iv(t)):(Xe=0,fn=null,Ti(e,t,h,7));break;case 5:var S=null;switch(Re.tag){case 26:S=Re.memoizedState;case 5:case 27:var j=Re;if(S?_g(S):j.stateNode.complete){Xe=0,fn=null;var D=j.sibling;if(D!==null)Re=D;else{var H=j.return;H!==null?(Re=H,vr(H)):Re=null}break t}}Xe=0,fn=null,Ti(e,t,h,5);break;case 6:Xe=0,fn=null,Ti(e,t,h,6);break;case 8:cd(),yt=6;break e;default:throw Error(l(462))}}B_();break}catch(Y){Rv(e,Y)}while(!0);return oa=ys=null,O.H=o,O.A=u,Fe=s,Re!==null?0:(at=null,Oe=0,Bl(),yt)}function B_(){for(;Re!==null&&!Ee();)Lv(Re)}function Lv(e){var t=ov(e.alternate,e,va);e.memoizedProps=e.pendingProps,t===null?vr(e):Re=t}function Iv(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=ev(s,t,t.pendingProps,t.type,void 0,Oe);break;case 11:t=ev(s,t,t.pendingProps,t.type.render,t.ref,Oe);break;case 5:ju(t);default:rv(s,t),t=Re=Bm(t,va),t=ov(s,t,va)}e.memoizedProps=e.pendingProps,t===null?vr(e):Re=t}function Ti(e,t,s,o){oa=ys=null,ju(t),fi=null,mo=0;var u=t.return;try{if(T_(e,u,t,s,Oe)){yt=1,ar(e,Tn(s,e.current)),Re=null;return}}catch(h){if(u!==null)throw Re=u,h;yt=1,ar(e,Tn(s,e.current)),Re=null;return}t.flags&32768?(ze||o===1?e=!0:bi||(Oe&536870912)!==0?e=!1:(Ga=e=!0,(o===2||o===9||o===3||o===6)&&(o=un.current,o!==null&&o.tag===13&&(o.flags|=16384))),zv(t,e)):vr(t)}function vr(e){var t=e;do{if((t.flags&32768)!==0){zv(t,Ga);return}e=t.return;var s=w_(t.alternate,t,va);if(s!==null){Re=s;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);yt===0&&(yt=5)}function zv(e,t){do{var s=C_(e.alternate,e);if(s!==null){s.flags&=32767,Re=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Re=e;return}Re=e=s}while(e!==null);yt=6,Re=null}function Uv(e,t,s,o,u,h,S,j,D){e.cancelPendingCommit=null;do gr();while(Rt!==0);if((Fe&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(h=t.lanes|t.childLanes,h|=Wc,mS(e,s,h,S,j,D),e===at&&(Re=at=null,Oe=0),Si=t,Ka=e,ga=s,od=h,ld=u,Nv=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,U_(se,function(){return $v(),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,S=Fe,Fe|=4;try{N_(e,t,s)}finally{Fe=S,P.p=u,O.T=o}}Rt=1,Vv(),Hv(),Pv()}}function Vv(){if(Rt===1){Rt=0;var e=Ka,t=Si,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=Fe;Fe|=4;try{xv(t,e);var h=_d,S=wm(e.containerInfo),j=h.focusedElem,D=h.selectionRange;if(S!==j&&j&&j.ownerDocument&&jm(j.ownerDocument.documentElement,j)){if(D!==null&&Yc(j)){var H=D.start,Y=D.end;if(Y===void 0&&(Y=H),"selectionStart"in j)j.selectionStart=H,j.selectionEnd=Math.min(Y,j.value.length);else{var Q=j.ownerDocument||document,G=Q&&Q.defaultView||window;if(G.getSelection){var $=G.getSelection(),he=j.textContent.length,ye=Math.min(D.start,he),et=D.end===void 0?ye:Math.min(D.end,he);!$.extend&&ye>et&&(S=et,et=ye,ye=S);var L=km(j,ye),M=km(j,et);if(L&&M&&($.rangeCount!==1||$.anchorNode!==L.node||$.anchorOffset!==L.offset||$.focusNode!==M.node||$.focusOffset!==M.offset)){var V=Q.createRange();V.setStart(L.node,L.offset),$.removeAllRanges(),ye>et?($.addRange(V),$.extend(M.node,M.offset)):(V.setEnd(M.node,M.offset),$.addRange(V))}}}}for(Q=[],$=j;$=$.parentNode;)$.nodeType===1&&Q.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<Q.length;j++){var Z=Q[j];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Er=!!Sd,_d=Sd=null}finally{Fe=u,P.p=o,O.T=s}}e.current=t,Rt=2}}function Hv(){if(Rt===2){Rt=0;var e=Ka,t=Si,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=Fe;Fe|=4;try{pv(e,t.alternate,t)}finally{Fe=u,P.p=o,O.T=s}}Rt=3}}function Pv(){if(Rt===4||Rt===3){Rt=0,Dt();var e=Ka,t=Si,s=ga,o=Nv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Rt=5:(Rt=0,Si=Ka=null,Gv(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(qa=null),Nc(s),t=t.stateNode,He&&typeof He.onCommitFiberRoot=="function")try{He.onCommitFiberRoot(we,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,S=0;S<o.length;S++){var j=o[S];h(j.value,{componentStack:j.stack})}}finally{O.T=t,P.p=u}}(ga&3)!==0&&gr(),Fn(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===rd?Do++:(Do=0,rd=e):Do=0,Ro(0)}}function Gv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fo(t)))}function gr(){return Vv(),Hv(),Pv(),$v()}function $v(){if(Rt!==5)return!1;var e=Ka,t=od;od=0;var s=Nc(ga),o=O.T,u=P.p;try{P.p=32>s?32:s,O.T=null,s=ld,ld=null;var h=Ka,S=ga;if(Rt=0,Si=Ka=null,ga=0,(Fe&6)!==0)throw Error(l(331));var j=Fe;if(Fe|=4,jv(h.current),_v(h,h.current,S,s),Fe=j,Ro(0,!1),He&&typeof He.onPostCommitFiberRoot=="function")try{He.onPostCommitFiberRoot(we,h)}catch{}return!0}finally{P.p=u,O.T=o,Gv(e,t)}}function qv(e,t,s){t=Tn(s,t),t=Vu(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Qi(e,2),Fn(e))}function Qe(e,t,s){if(e.tag===3)qv(e,e,s);else for(;t!==null;){if(t.tag===3){qv(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(qa===null||!qa.has(o))){e=Tn(s,e),s=Kp(2),o=Ua(t,s,2),o!==null&&(Yp(s,o,t,e),Qi(o,2),Fn(o));break}}t=t.return}}function dd(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new D_;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)||(ad=!0,u.add(s),e=L_.bind(null,e,t,s),t.then(e,e))}function L_(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,at===e&&(Oe&s)===s&&(yt===4||yt===3&&(Oe&62914560)===Oe&&300>Kt()-dr?(Fe&2)===0&&_i(e,0):sd|=s,xi===Oe&&(xi=0)),Fn(e)}function Kv(e,t){t===0&&(t=Vh()),e=ps(e,t),e!==null&&(Qi(e,t),Fn(e))}function I_(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Kv(e,s)}function z_(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),Kv(e,s)}function U_(e,t){return Ea(e,t)}var yr=null,ki=null,fd=!1,br=!1,hd=!1,Fa=0;function Fn(e){e!==ki&&e.next===null&&(ki===null?yr=ki=e:ki=ki.next=e),br=!0,fd||(fd=!0,H_())}function Ro(e,t){if(!hd&&br){hd=!0;do for(var s=!1,o=yr;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var h=0;else{var S=o.suspendedLanes,j=o.pingedLanes;h=(1<<31-Ye(42|e)+1)-1,h&=u&~(S&~j),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,Xv(o,h))}else h=Oe,h=Tl(o,o===at?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Xi(o,h)||(s=!0,Xv(o,h));o=o.next}while(s);hd=!1}}function V_(){Yv()}function Yv(){br=fd=!1;var e=0;Fa!==0&&Q_()&&(e=Fa);for(var t=Kt(),s=null,o=yr;o!==null;){var u=o.next,h=Fv(o,t);h===0?(o.next=null,s===null?yr=u:s.next=u,u===null&&(ki=s)):(s=o,(e!==0||(h&3)!==0)&&(br=!0)),o=u}Rt!==0&&Rt!==5||Ro(e),Fa!==0&&(Fa=0)}function Fv(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var S=31-Ye(h),j=1<<S,D=u[S];D===-1?((j&s)===0||(j&o)!==0)&&(u[S]=hS(j,t)):D<=t&&(e.expiredLanes|=j),h&=~j}if(t=at,s=Oe,s=Tl(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===t&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&ln(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Xi(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(o!==null&&ln(o),Nc(s)){case 2:case 8:s=F;break;case 32:s=se;break;case 268435456:s=Te;break;default:s=se}return o=Zv.bind(null,e),s=Ea(s,o),e.callbackPriority=t,e.callbackNode=s,t}return o!==null&&o!==null&&ln(o),e.callbackPriority=2,e.callbackNode=null,2}function Zv(e,t){if(Rt!==0&&Rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(gr()&&e.callbackNode!==s)return null;var o=Oe;return o=Tl(e,e===at?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Av(e,o,t),Fv(e,Kt()),e.callbackNode!=null&&e.callbackNode===s?Zv.bind(null,e):null)}function Xv(e,t){if(gr())return null;Av(e,t,!0)}function H_(){J_(function(){(Fe&6)!==0?Ea(_l,V_):Yv()})}function md(){if(Fa===0){var e=ci;e===0&&(e=vt,vt<<=1,(vt&261888)===0&&(vt=256)),Fa=e}return Fa}function Qv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Cl(""+e)}function Wv(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 P_(e,t,s,o,u){if(t==="submit"&&s&&s.stateNode===u){var h=Qv((u[Wt]||null).action),S=o.submitter;S&&(t=(t=S[Wt]||null)?Qv(t.formAction):S.getAttribute("formAction"),t!==null&&(h=t,S=null));var j=new Dl("action","action",null,o,u);e.push({event:j,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Fa!==0){var D=S?Wv(u,S):new FormData(u);Ou(s,{pending:!0,data:D,method:u.method,action:h},null,D)}}else typeof h=="function"&&(j.preventDefault(),D=S?Wv(u,S):new FormData(u),Ou(s,{pending:!0,data:D,method:u.method,action:h},h,D))},currentTarget:u}]})}}for(var pd=0;pd<Qc.length;pd++){var vd=Qc[pd],G_=vd.toLowerCase(),$_=vd[0].toUpperCase()+vd.slice(1);In(G_,"on"+$_)}In(Em,"onAnimationEnd"),In(Am,"onAnimationIteration"),In(Dm,"onAnimationStart"),In("dblclick","onDoubleClick"),In("focusin","onFocus"),In("focusout","onBlur"),In(o_,"onTransitionRun"),In(l_,"onTransitionStart"),In(r_,"onTransitionCancel"),In(Rm,"onTransitionEnd"),Zs("onMouseEnter",["mouseout","mouseover"]),Zs("onMouseLeave",["mouseout","mouseover"]),Zs("onPointerEnter",["pointerout","pointerover"]),Zs("onPointerLeave",["pointerout","pointerover"]),ds("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ds("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ds("onBeforeInput",["compositionend","keypress","textInput","paste"]),ds("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ds("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ds("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mo="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(" "),q_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mo));function Jv(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 S=o.length-1;0<=S;S--){var j=o[S],D=j.instance,H=j.currentTarget;if(j=j.listener,D!==h&&u.isPropagationStopped())break e;h=j,u.currentTarget=H;try{h(u)}catch(Y){Ol(Y)}u.currentTarget=null,h=D}else for(S=0;S<o.length;S++){if(j=o[S],D=j.instance,H=j.currentTarget,j=j.listener,D!==h&&u.isPropagationStopped())break e;h=j,u.currentTarget=H;try{h(u)}catch(Y){Ol(Y)}u.currentTarget=null,h=D}}}}function Me(e,t){var s=t[Ec];s===void 0&&(s=t[Ec]=new Set);var o=e+"__bubble";s.has(o)||(eg(t,e,2,!1),s.add(o))}function gd(e,t,s){var o=0;t&&(o|=4),eg(s,e,o,t)}var xr="_reactListening"+Math.random().toString(36).slice(2);function yd(e){if(!e[xr]){e[xr]=!0,Yh.forEach(function(s){s!=="selectionchange"&&(q_.has(s)||gd(s,!1,e),gd(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xr]||(t[xr]=!0,gd("selectionchange",!1,t))}}function eg(e,t,s,o){switch(Eg(t)){case 2:var u=b1;break;case 8:u=x1;break;default:u=Md}s=u.bind(null,t,s,e),u=void 0,!zc||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 bd(e,t,s,o,u){var h=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var S=o.tag;if(S===3||S===4){var j=o.stateNode.containerInfo;if(j===u)break;if(S===4)for(S=o.return;S!==null;){var D=S.tag;if((D===3||D===4)&&S.stateNode.containerInfo===u)return;S=S.return}for(;j!==null;){if(S=Ks(j),S===null)return;if(D=S.tag,D===5||D===6||D===26||D===27){o=h=S;continue e}j=j.parentNode}}o=o.return}im(function(){var H=h,Y=Lc(s),Q=[];e:{var G=Mm.get(e);if(G!==void 0){var $=Dl,he=e;switch(e){case"keypress":if(El(s)===0)break e;case"keydown":case"keyup":$=zS;break;case"focusin":he="focus",$=Pc;break;case"focusout":he="blur",$=Pc;break;case"beforeblur":case"afterblur":$=Pc;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":$=rm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=wS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=HS;break;case Em:case Am:case Dm:$=ES;break;case Rm:$=GS;break;case"scroll":case"scrollend":$=kS;break;case"wheel":$=qS;break;case"copy":case"cut":case"paste":$=DS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=um;break;case"toggle":case"beforetoggle":$=YS}var ye=(t&4)!==0,et=!ye&&(e==="scroll"||e==="scrollend"),L=ye?G!==null?G+"Capture":null:G;ye=[];for(var M=H,V;M!==null;){var Z=M;if(V=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||V===null||L===null||(Z=eo(M,L),Z!=null&&ye.push(Oo(M,Z,V))),et)break;M=M.return}0<ye.length&&(G=new $(G,he,null,s,Y),Q.push({event:G,listeners:ye}))}}if((t&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",$=e==="mouseout"||e==="pointerout",G&&s!==Bc&&(he=s.relatedTarget||s.fromElement)&&(Ks(he)||he[qs]))break e;if(($||G)&&(G=Y.window===Y?Y:(G=Y.ownerDocument)?G.defaultView||G.parentWindow:window,$?(he=s.relatedTarget||s.toElement,$=H,he=he?Ks(he):null,he!==null&&(et=d(he),ye=he.tag,he!==et||ye!==5&&ye!==27&&ye!==6)&&(he=null)):($=null,he=H),$!==he)){if(ye=rm,Z="onMouseLeave",L="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ye=um,Z="onPointerLeave",L="onPointerEnter",M="pointer"),et=$==null?G:Ji($),V=he==null?G:Ji(he),G=new ye(Z,M+"leave",$,s,Y),G.target=et,G.relatedTarget=V,Z=null,Ks(Y)===H&&(ye=new ye(L,M+"enter",he,s,Y),ye.target=V,ye.relatedTarget=et,Z=ye),et=Z,$&&he)t:{for(ye=K_,L=$,M=he,V=0,Z=L;Z;Z=ye(Z))V++;Z=0;for(var ve=M;ve;ve=ye(ve))Z++;for(;0<V-Z;)L=ye(L),V--;for(;0<Z-V;)M=ye(M),Z--;for(;V--;){if(L===M||M!==null&&L===M.alternate){ye=L;break t}L=ye(L),M=ye(M)}ye=null}else ye=null;$!==null&&tg(Q,G,$,ye,!1),he!==null&&et!==null&&tg(Q,et,he,ye,!0)}}e:{if(G=H?Ji(H):window,$=G.nodeName&&G.nodeName.toLowerCase(),$==="select"||$==="input"&&G.type==="file")var Ge=ym;else if(vm(G))if(bm)Ge=a_;else{Ge=t_;var pe=e_}else $=G.nodeName,!$||$.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?H&&Oc(H.elementType)&&(Ge=ym):Ge=n_;if(Ge&&(Ge=Ge(e,H))){gm(Q,Ge,s,Y);break e}pe&&pe(e,G,H),e==="focusout"&&H&&G.type==="number"&&H.memoizedProps.value!=null&&Mc(G,"number",G.value)}switch(pe=H?Ji(H):window,e){case"focusin":(vm(pe)||pe.contentEditable==="true")&&(ti=pe,Fc=H,ro=null);break;case"focusout":ro=Fc=ti=null;break;case"mousedown":Zc=!0;break;case"contextmenu":case"mouseup":case"dragend":Zc=!1,Cm(Q,s,Y);break;case"selectionchange":if(i_)break;case"keydown":case"keyup":Cm(Q,s,Y)}var Ae;if($c)e:{switch(e){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else ei?mm(e,s)&&(Be="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Be="onCompositionStart");Be&&(dm&&s.locale!=="ko"&&(ei||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&ei&&(Ae=om()):(Ra=Y,Uc="value"in Ra?Ra.value:Ra.textContent,ei=!0)),pe=Sr(H,Be),0<pe.length&&(Be=new cm(Be,e,null,s,Y),Q.push({event:Be,listeners:pe}),Ae?Be.data=Ae:(Ae=pm(s),Ae!==null&&(Be.data=Ae)))),(Ae=ZS?XS(e,s):QS(e,s))&&(Be=Sr(H,"onBeforeInput"),0<Be.length&&(pe=new cm("onBeforeInput","beforeinput",null,s,Y),Q.push({event:pe,listeners:Be}),pe.data=Ae)),P_(Q,e,H,s,Y)}Jv(Q,t)})}function Oo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Sr(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=eo(e,s),u!=null&&o.unshift(Oo(e,u,h)),u=eo(e,t),u!=null&&o.push(Oo(e,u,h))),e.tag===3)return o;e=e.return}return[]}function K_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tg(e,t,s,o,u){for(var h=t._reactName,S=[];s!==null&&s!==o;){var j=s,D=j.alternate,H=j.stateNode;if(j=j.tag,D!==null&&D===o)break;j!==5&&j!==26&&j!==27||H===null||(D=H,u?(H=eo(s,h),H!=null&&S.unshift(Oo(s,H,D))):u||(H=eo(s,h),H!=null&&S.push(Oo(s,H,D)))),s=s.return}S.length!==0&&e.push({event:t,listeners:S})}var Y_=/\r\n?/g,F_=/\u0000|\uFFFD/g;function ng(e){return(typeof e=="string"?e:""+e).replace(Y_,`
26
- `).replace(F_,"")}function ag(e,t){return t=ng(t),ng(e)===t}function Je(e,t,s,o,u,h){switch(s){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||Qs(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&Qs(e,""+o);break;case"className":jl(e,"class",o);break;case"tabIndex":jl(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":jl(e,s,o);break;case"style":am(e,o,h);break;case"data":if(t!=="object"){jl(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=Cl(""+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"&&Je(e,t,"name",u.name,u,null),Je(e,t,"formEncType",u.formEncType,u,null),Je(e,t,"formMethod",u.formMethod,u,null),Je(e,t,"formTarget",u.formTarget,u,null)):(Je(e,t,"encType",u.encType,u,null),Je(e,t,"method",u.method,u,null),Je(e,t,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=Cl(""+o),e.setAttribute(s,o);break;case"onClick":o!=null&&(e.onclick=na);break;case"onScroll":o!=null&&Me("scroll",e);break;case"onScrollEnd":o!=null&&Me("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=Cl(""+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":Me("beforetoggle",e),Me("toggle",e),kl(e,"popover",o);break;case"xlinkActuate":ta(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":ta(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":ta(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":ta(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":ta(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":ta(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":ta(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":ta(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":ta(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":kl(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=_S.get(s)||s,kl(e,s,o))}}function xd(e,t,s,o,u,h){switch(s){case"style":am(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"?Qs(e,o):(typeof o=="number"||typeof o=="bigint")&&Qs(e,""+o);break;case"onScroll":o!=null&&Me("scroll",e);break;case"onScrollEnd":o!=null&&Me("scrollend",e);break;case"onClick":o!=null&&(e.onclick=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fh.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[Wt]||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,""):kl(e,s,o)}}}function Gt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",e),Me("load",e);var o=!1,u=!1,h;for(h in s)if(s.hasOwnProperty(h)){var S=s[h];if(S!=null)switch(h){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Je(e,t,h,S,s,null)}}u&&Je(e,t,"srcSet",s.srcSet,s,null),o&&Je(e,t,"src",s.src,s,null);return;case"input":Me("invalid",e);var j=h=S=u=null,D=null,H=null;for(o in s)if(s.hasOwnProperty(o)){var Y=s[o];if(Y!=null)switch(o){case"name":u=Y;break;case"type":S=Y;break;case"checked":D=Y;break;case"defaultChecked":H=Y;break;case"value":h=Y;break;case"defaultValue":j=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(l(137,t));break;default:Je(e,t,o,Y,s,null)}}Jh(e,h,j,D,H,S,u,!1);return;case"select":Me("invalid",e),o=S=h=null;for(u in s)if(s.hasOwnProperty(u)&&(j=s[u],j!=null))switch(u){case"value":h=j;break;case"defaultValue":S=j;break;case"multiple":o=j;default:Je(e,t,u,j,s,null)}t=h,s=S,e.multiple=!!o,t!=null?Xs(e,!!o,t,!1):s!=null&&Xs(e,!!o,s,!0);return;case"textarea":Me("invalid",e),h=u=o=null;for(S in s)if(s.hasOwnProperty(S)&&(j=s[S],j!=null))switch(S){case"value":o=j;break;case"defaultValue":u=j;break;case"children":h=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(l(91));break;default:Je(e,t,S,j,s,null)}tm(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:Je(e,t,D,o,s,null)}return;case"dialog":Me("beforetoggle",e),Me("toggle",e),Me("cancel",e),Me("close",e);break;case"iframe":case"object":Me("load",e);break;case"video":case"audio":for(o=0;o<Mo.length;o++)Me(Mo[o],e);break;case"image":Me("error",e),Me("load",e);break;case"details":Me("toggle",e);break;case"embed":case"source":case"link":Me("error",e),Me("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(H in s)if(s.hasOwnProperty(H)&&(o=s[H],o!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Je(e,t,H,o,s,null)}return;default:if(Oc(t)){for(Y in s)s.hasOwnProperty(Y)&&(o=s[Y],o!==void 0&&xd(e,t,Y,o,s,void 0));return}}for(j in s)s.hasOwnProperty(j)&&(o=s[j],o!=null&&Je(e,t,j,o,s,null))}function Z_(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,S=null,j=null,D=null,H=null,Y=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($)||Je(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":H=$;break;case"defaultChecked":Y=$;break;case"value":S=$;break;case"defaultValue":j=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(l(137,t));break;default:$!==Q&&Je(e,t,G,$,o,Q)}}Rc(e,S,j,D,H,Y,h,u);return;case"select":$=S=j=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)||Je(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":j=h;break;case"multiple":S=h;default:h!==D&&Je(e,t,u,h,o,D)}t=j,s=S,o=$,G!=null?Xs(e,!!s,G,!1):!!o!=!!s&&(t!=null?Xs(e,!!s,t,!0):Xs(e,!!s,s?[]:"",!1));return;case"textarea":$=G=null;for(j in s)if(u=s[j],s.hasOwnProperty(j)&&u!=null&&!o.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Je(e,t,j,null,o,u)}for(S in o)if(u=o[S],h=s[S],o.hasOwnProperty(S)&&(u!=null||h!=null))switch(S){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&&Je(e,t,S,u,o,h)}em(e,G,$);return;case"option":for(var he in s)if(G=s[he],s.hasOwnProperty(he)&&G!=null&&!o.hasOwnProperty(he))switch(he){case"selected":e.selected=!1;break;default:Je(e,t,he,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:Je(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 ye in s)G=s[ye],s.hasOwnProperty(ye)&&G!=null&&!o.hasOwnProperty(ye)&&Je(e,t,ye,null,o,G);for(H in o)if(G=o[H],$=s[H],o.hasOwnProperty(H)&&G!==$&&(G!=null||$!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(l(137,t));break;default:Je(e,t,H,G,o,$)}return;default:if(Oc(t)){for(var et in s)G=s[et],s.hasOwnProperty(et)&&G!==void 0&&!o.hasOwnProperty(et)&&xd(e,t,et,void 0,o,G);for(Y in o)G=o[Y],$=s[Y],!o.hasOwnProperty(Y)||G===$||G===void 0&&$===void 0||xd(e,t,Y,G,o,$);return}}for(var L in s)G=s[L],s.hasOwnProperty(L)&&G!=null&&!o.hasOwnProperty(L)&&Je(e,t,L,null,o,G);for(Q in o)G=o[Q],$=s[Q],!o.hasOwnProperty(Q)||G===$||G==null&&$==null||Je(e,t,Q,G,o,$)}function sg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function X_(){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,S=u.initiatorType,j=u.duration;if(h&&j&&sg(S)){for(S=0,j=u.responseEnd,o+=1;o<s.length;o++){var D=s[o],H=D.startTime;if(H>j)break;var Y=D.transferSize,Q=D.initiatorType;Y&&sg(Q)&&(D=D.responseEnd,S+=Y*(D<j?1:(j-H)/(D-H)))}if(--o,t+=8*(h+S)/(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 Sd=null,_d=null;function _r(e){return e.nodeType===9?e:e.ownerDocument}function ig(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 og(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 Td(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 kd=null;function Q_(){var e=window.event;return e&&e.type==="popstate"?e===kd?!1:(kd=e,!0):(kd=null,!1)}var lg=typeof setTimeout=="function"?setTimeout:void 0,W_=typeof clearTimeout=="function"?clearTimeout:void 0,rg=typeof Promise=="function"?Promise:void 0,J_=typeof queueMicrotask=="function"?queueMicrotask:typeof rg<"u"?function(e){return rg.resolve(null).then(e).catch(e1)}:lg;function e1(e){setTimeout(function(){throw e})}function Za(e){return e==="head"}function cg(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),Ni(t);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Bo(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Bo(s);for(var h=s.firstChild;h;){var S=h.nextSibling,j=h.nodeName;h[Wi]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=S}}else s==="body"&&Bo(e.ownerDocument.body);s=u}while(s);Ni(t)}function ug(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 jd(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":jd(s),Ac(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function t1(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[Wi])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=Nn(e.nextSibling),e===null)break}return null}function n1(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Nn(e.nextSibling),e===null))return null;return e}function dg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Nn(e.nextSibling),e===null))return null;return e}function wd(e){return e.data==="$?"||e.data==="$~"}function Cd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function a1(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 Nn(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 Nd=null;function fg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Nn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function hg(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 mg(e,t,s){switch(t=_r(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 Bo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ac(e)}var En=new Map,pg=new Set;function Tr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ya=P.d;P.d={f:s1,r:i1,D:o1,C:l1,L:r1,m:c1,X:d1,S:u1,M:f1};function s1(){var e=ya.f(),t=mr();return e||t}function i1(e){var t=Ys(e);t!==null&&t.tag===5&&t.type==="form"?Rp(t):ya.r(e)}var ji=typeof document>"u"?null:document;function vg(e,t,s){var o=ji;if(o&&typeof t=="string"&&t){var u=Sn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),pg.has(u)||(pg.add(u),e={rel:e,crossOrigin:s,href:t},o.querySelector(u)===null&&(t=o.createElement("link"),Gt(t,"link",e),Lt(t),o.head.appendChild(t)))}}function o1(e){ya.D(e),vg("dns-prefetch",e,null)}function l1(e,t){ya.C(e,t),vg("preconnect",e,t)}function r1(e,t,s){ya.L(e,t,s);var o=ji;if(o&&e&&t){var u='link[rel="preload"][as="'+Sn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+Sn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+Sn(s.imageSizes)+'"]')):u+='[href="'+Sn(e)+'"]';var h=u;switch(t){case"style":h=wi(e);break;case"script":h=Ci(e)}En.has(h)||(e=b({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),En.set(h,e),o.querySelector(u)!==null||t==="style"&&o.querySelector(Lo(h))||t==="script"&&o.querySelector(Io(h))||(t=o.createElement("link"),Gt(t,"link",e),Lt(t),o.head.appendChild(t)))}}function c1(e,t){ya.m(e,t);var s=ji;if(s&&e){var o=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Sn(o)+'"][href="'+Sn(e)+'"]',h=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ci(e)}if(!En.has(h)&&(e=b({rel:"modulepreload",href:e},t),En.set(h,e),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Io(h)))return}o=s.createElement("link"),Gt(o,"link",e),Lt(o),s.head.appendChild(o)}}}function u1(e,t,s){ya.S(e,t,s);var o=ji;if(o&&e){var u=Fs(o).hoistableStyles,h=wi(e);t=t||"default";var S=u.get(h);if(!S){var j={loading:0,preload:null};if(S=o.querySelector(Lo(h)))j.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},s),(s=En.get(h))&&Ed(e,s);var D=S=o.createElement("link");Lt(D),Gt(D,"link",e),D._p=new Promise(function(H,Y){D.onload=H,D.onerror=Y}),D.addEventListener("load",function(){j.loading|=1}),D.addEventListener("error",function(){j.loading|=2}),j.loading|=4,kr(S,t,o)}S={type:"stylesheet",instance:S,count:1,state:j},u.set(h,S)}}}function d1(e,t){ya.X(e,t);var s=ji;if(s&&e){var o=Fs(s).hoistableScripts,u=Ci(e),h=o.get(u);h||(h=s.querySelector(Io(u)),h||(e=b({src:e,async:!0},t),(t=En.get(u))&&Ad(e,t),h=s.createElement("script"),Lt(h),Gt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function f1(e,t){ya.M(e,t);var s=ji;if(s&&e){var o=Fs(s).hoistableScripts,u=Ci(e),h=o.get(u);h||(h=s.querySelector(Io(u)),h||(e=b({src:e,async:!0,type:"module"},t),(t=En.get(u))&&Ad(e,t),h=s.createElement("script"),Lt(h),Gt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function gg(e,t,s,o){var u=(u=ue.current)?Tr(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=wi(s.href),s=Fs(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=wi(s.href);var h=Fs(u).hoistableStyles,S=h.get(e);if(S||(u=u.ownerDocument||u,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,S),(h=u.querySelector(Lo(e)))&&!h._p&&(S.instance=h,S.state.loading=5),En.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},En.set(e,s),h||h1(u,e,s,S.state))),t&&o===null)throw Error(l(528,""));return S}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=Ci(s),s=Fs(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 wi(e){return'href="'+Sn(e)+'"'}function Lo(e){return'link[rel="stylesheet"]['+e+"]"}function yg(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function h1(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}),Gt(t,"link",s),Lt(t),e.head.appendChild(t))}function Ci(e){return'[src="'+Sn(e)+'"]'}function Io(e){return"script[async]"+e}function bg(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+Sn(s.href)+'"]');if(o)return t.instance=o,Lt(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"),Lt(o),Gt(o,"style",u),kr(o,s.precedence,e),t.instance=o;case"stylesheet":u=wi(s.href);var h=e.querySelector(Lo(u));if(h)return t.state.loading|=4,t.instance=h,Lt(h),h;o=yg(s),(u=En.get(u))&&Ed(o,u),h=(e.ownerDocument||e).createElement("link"),Lt(h);var S=h;return S._p=new Promise(function(j,D){S.onload=j,S.onerror=D}),Gt(h,"link",o),t.state.loading|=4,kr(h,s.precedence,e),t.instance=h;case"script":return h=Ci(s.src),(u=e.querySelector(Io(h)))?(t.instance=u,Lt(u),u):(o=s,(u=En.get(h))&&(o=b({},s),Ad(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),Lt(u),Gt(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,kr(o,s.precedence,e));return t.instance}function kr(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,S=0;S<o.length;S++){var j=o[S];if(j.dataset.precedence===t)h=j;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 Ed(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ad(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var jr=null;function xg(e,t,s){if(jr===null){var o=new Map,u=jr=new Map;u.set(s,o)}else u=jr,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[Wi]||h[Ut]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var S=h.getAttribute(t)||"";S=e+S;var j=o.get(S);j?j.push(h):o.set(S,[h])}}return o}function Sg(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function m1(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 _g(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function p1(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=wi(o.href),h=t.querySelector(Lo(u));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=wr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,Lt(h);return}h=t.ownerDocument||t,o=yg(o),(u=En.get(u))&&Ed(o,u),h=h.createElement("link"),Lt(h);var S=h;S._p=new Promise(function(j,D){S.onload=j,S.onerror=D}),Gt(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=wr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Dd=0;function v1(e,t){return e.stylesheets&&e.count===0&&Nr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var o=setTimeout(function(){if(e.stylesheets&&Nr(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Dd===0&&(Dd=62500*X_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Nr(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Dd?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function wr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Cr=null;function Nr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Cr=new Map,t.forEach(g1,e),Cr=null,wr.call(e))}function g1(e,t){if(!(t.state.loading&4)){var s=Cr.get(e);if(s)var o=s.get(null);else{s=new Map,Cr.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var S=u[h];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(s.set(S.dataset.precedence,S),o=S)}o&&s.set(null,o)}u=t.instance,S=u.getAttribute("data-precedence"),h=s.get(S)||o,h===o&&s.set(null,u),s.set(S,u),this.count++,o=wr.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 zo={$$typeof:A,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function y1(e,t,s,o,u,h,S,j,D){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wc(0),this.hiddenUpdates=wc(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Tg(e,t,s,o,u,h,S,j,D,H,Y,Q){return e=new y1(e,t,s,S,D,H,Y,Q,j),t=1,h===!0&&(t|=24),h=cn(3,null,null,t),e.current=h,h.stateNode=e,t=uu(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:o,isDehydrated:s,cache:t},mu(h),e}function kg(e){return e?(e=si,e):si}function jg(e,t,s,o,u,h){u=kg(u),o.context===null?o.context=u:o.pendingContext=u,o=za(t),o.payload={element:s},h=h===void 0?null:h,h!==null&&(o.callback=h),s=Ua(e,o,t),s!==null&&(sn(s,e,t),vo(s,e,t))}function wg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Rd(e,t){wg(e,t),(e=e.alternate)&&wg(e,t)}function Cg(e){if(e.tag===13||e.tag===31){var t=ps(e,67108864);t!==null&&sn(t,e,67108864),Rd(e,67108864)}}function Ng(e){if(e.tag===13||e.tag===31){var t=mn();t=Cc(t);var s=ps(e,t);s!==null&&sn(s,e,t),Rd(e,t)}}var Er=!0;function b1(e,t,s,o){var u=O.T;O.T=null;var h=P.p;try{P.p=2,Md(e,t,s,o)}finally{P.p=h,O.T=u}}function x1(e,t,s,o){var u=O.T;O.T=null;var h=P.p;try{P.p=8,Md(e,t,s,o)}finally{P.p=h,O.T=u}}function Md(e,t,s,o){if(Er){var u=Od(o);if(u===null)bd(e,t,o,Ar,s),Ag(e,o);else if(_1(u,e,t,s,o))o.stopPropagation();else if(Ag(e,o),t&4&&-1<S1.indexOf(e)){for(;u!==null;){var h=Ys(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var S=Ln(h.pendingLanes);if(S!==0){var j=h;for(j.pendingLanes|=2,j.entangledLanes|=2;S;){var D=1<<31-Ye(S);j.entanglements[1]|=D,S&=~D}Fn(h),(Fe&6)===0&&(fr=Kt()+500,Ro(0))}}break;case 31:case 13:j=ps(h,2),j!==null&&sn(j,h,2),mr(),Rd(h,2)}if(h=Od(o),h===null&&bd(e,t,o,Ar,s),h===u)break;u=h}u!==null&&o.stopPropagation()}else bd(e,t,o,null,s)}}function Od(e){return e=Lc(e),Bd(e)}var Ar=null;function Bd(e){if(Ar=null,e=Ks(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 Ar=e,null}function Eg(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(Sl()){case _l:return 2;case F:return 8;case se:case me:return 32;case Te:return 268435456;default:return 32}default:return 32}}var Ld=!1,Xa=null,Qa=null,Wa=null,Uo=new Map,Vo=new Map,Ja=[],S1="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 Ag(e,t){switch(e){case"focusin":case"focusout":Xa=null;break;case"dragenter":case"dragleave":Qa=null;break;case"mouseover":case"mouseout":Wa=null;break;case"pointerover":case"pointerout":Uo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vo.delete(t.pointerId)}}function Ho(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=Ys(t),t!==null&&Cg(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function _1(e,t,s,o,u){switch(t){case"focusin":return Xa=Ho(Xa,e,t,s,o,u),!0;case"dragenter":return Qa=Ho(Qa,e,t,s,o,u),!0;case"mouseover":return Wa=Ho(Wa,e,t,s,o,u),!0;case"pointerover":var h=u.pointerId;return Uo.set(h,Ho(Uo.get(h)||null,e,t,s,o,u)),!0;case"gotpointercapture":return h=u.pointerId,Vo.set(h,Ho(Vo.get(h)||null,e,t,s,o,u)),!0}return!1}function Dg(e){var t=Ks(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,qh(e.priority,function(){Ng(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,qh(e.priority,function(){Ng(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 Dr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Od(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);Bc=o,s.target.dispatchEvent(o),Bc=null}else return t=Ys(s),t!==null&&Cg(t),e.blockedOn=s,!1;t.shift()}return!0}function Rg(e,t,s){Dr(e)&&s.delete(t)}function T1(){Ld=!1,Xa!==null&&Dr(Xa)&&(Xa=null),Qa!==null&&Dr(Qa)&&(Qa=null),Wa!==null&&Dr(Wa)&&(Wa=null),Uo.forEach(Rg),Vo.forEach(Rg)}function Rr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ld||(Ld=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,T1)))}var Mr=null;function Mg(e){Mr!==e&&(Mr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Mr===e&&(Mr=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(Bd(o||s)===null)continue;break}var h=Ys(s);h!==null&&(e.splice(t,3),t-=3,Ou(h,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function Ni(e){function t(D){return Rr(D,e)}Xa!==null&&Rr(Xa,e),Qa!==null&&Rr(Qa,e),Wa!==null&&Rr(Wa,e),Uo.forEach(t),Vo.forEach(t);for(var s=0;s<Ja.length;s++){var o=Ja[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Ja.length&&(s=Ja[0],s.blockedOn===null);)Dg(s),s.blockedOn===null&&Ja.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],S=u[Wt]||null;if(typeof h=="function")S||Mg(s);else if(S){var j=null;if(h&&h.hasAttribute("formAction")){if(u=h,S=h[Wt]||null)j=S.formAction;else if(Bd(u)!==null)continue}else j=S.action;typeof j=="function"?s[o+1]=j:(s.splice(o,3),o-=3),Mg(s)}}}function Og(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(S){return u=S})},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 Id(e){this._internalRoot=e}Or.prototype.render=Id.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var s=t.current,o=mn();jg(s,o,e,t,null,null)},Or.prototype.unmount=Id.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jg(e.current,2,null,e,null,null),mr(),t[qs]=null}};function Or(e){this._internalRoot=e}Or.prototype.unstable_scheduleHydration=function(e){if(e){var t=$h();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Ja.length&&t!==0&&t<Ja[s].priority;s++);Ja.splice(s,0,e),s===0&&Dg(e)}};var Bg=a.version;if(Bg!=="19.2.4")throw Error(l(527,Bg,"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 k1={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Br=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Br.isDisabled&&Br.supportsFiber)try{we=Br.inject(k1),He=Br}catch{}}return Go.createRoot=function(e,t){if(!c(e))throw Error(l(299));var s=!1,o="",u=Pp,h=Gp,S=$p;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&&(S=t.onRecoverableError)),t=Tg(e,1,!1,null,null,s,o,null,u,h,S,Og),e[qs]=t.current,yd(e),new Id(t)},Go.hydrateRoot=function(e,t,s){if(!c(e))throw Error(l(299));var o=!1,u="",h=Pp,S=Gp,j=$p,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=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.formState!==void 0&&(D=s.formState)),t=Tg(e,1,!0,t,s??null,o,u,D,h,S,j,Og),t.context=kg(null),s=t.current,o=mn(),o=Cc(o),u=za(o),u.callback=null,Ua(s,u,o),s=o,t.current.lanes=s,Qi(t,s),Fn(t),e[qs]=t.current,yd(e),new Or(t)},Go.version="19.2.4",Go}var Gg;function Z1(){if(Gg)return zd.exports;Gg=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(),zd.exports=F1(),zd.exports}var X1=Z1();const Q1="modulepreload",W1=function(n){return"/"+n},$g={},J1=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=W1(v),v in $g)return;$g[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":Q1,g||(x.as="script"),x.crossOrigin="",x.href=v,p&&x.setAttribute("nonce",p),document.head.appendChild(x),g)return new Promise((_,T)=>{x.addEventListener("load",_),x.addEventListener("error",()=>T(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 Ls(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function V0(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function eT(n){return Ls(n)&&typeof n.id=="string"&&typeof n.type=="string"&&typeof n.timestamp=="string"&&Ls(n.payload)}function tT(n){return Ls(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 nT=new Set(["off","subscription","api_key"]),zr=new Set(["off","on"]);function aT(n){return Ls(n)&&nT.has(n.claude)&&zr.has(n.github)&&zr.has(n.copilot)&&zr.has(n.codex)&&zr.has(n.goose)}function sT(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!Ls(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:Ls(a.payload)?a.payload:{}}:{type:a.type,payload:Ls(a.payload)?a.payload:void 0}}function H0(n){switch(n){case"waiting_input":return"idle";case"completed":return"stopped";case"killed":return"stopped";case"failed":return"stopped";case"interrupted":return"stopped";case"terminated":return"stopped";default:return n}}function P0(n){switch(n){case"completed":return"completed";case"killed":return"killed";case"failed":return"interrupted";case"interrupted":return"interrupted";case"terminated":return"terminated";default:return}}const iT=3e3,Ei=5e3,oT=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 qg="popstate";function Kg(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function lT(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 vf("",{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:ll(c)}return cT(a,i,null,n)}function rt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Mn(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function rT(){return Math.random().toString(36).substring(2,10)}function Yg(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 vf(n,a,i=null,l,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Ki(a):a,state:i,key:a&&a.key||l||rT(),unstable_mask:c}}function ll({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 Ki(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 cT(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 w=g(),k=w==null?null:w-v;v=w,p&&p({action:m,location:C.location,delta:k})}function x(w,k){m="PUSH";let N=Kg(w)?w:vf(C.location,w,k);v=g()+1;let A=Yg(N,v),R=C.createHref(N.unstable_mask||N);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 _(w,k){m="REPLACE";let N=Kg(w)?w:vf(C.location,w,k);v=g();let A=Yg(N,v),R=C.createHref(N.unstable_mask||N);f.replaceState(A,"",R),d&&p&&p({action:m,location:C.location,delta:0})}function T(w){return uT(w)}let C={get action(){return m},get location(){return n(c,f)},listen(w){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(qg,b),p=w,()=>{c.removeEventListener(qg,b),p=null}},createHref(w){return a(c,w)},createURL:T,encodeLocation(w){let k=T(w);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:x,replace:_,go(w){return f.go(w)}};return C}function uT(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),rt(i,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:ll(n);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}function G0(n,a,i="/"){return dT(n,a,i,!1)}function dT(n,a,i,l){let c=typeof a=="string"?Ki(a):a,d=ja(c.pathname||"/",i);if(d==null)return null;let f=$0(n);fT(f);let m=null;for(let p=0;m==null&&p<f.length;++p){let v=K0(d);m=ST(f[p],v,l)}return m}function $0(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;rt(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=Xn([l,g.relativePath]),x=i.concat(g);f.children&&f.children.length>0&&(rt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),$0(f.children,a,x,b,p)),!(f.path==null&&!f.index)&&a.push({path:b,score:bT(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 q0(f.path))d(f,m,!0,v)}),a}function q0(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=q0(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 fT(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:xT(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var hT=/^:[\w-]+$/,mT=3,pT=2,vT=1,gT=10,yT=-2,Fg=n=>n==="*";function bT(n,a){let i=n.split("/"),l=i.length;return i.some(Fg)&&(l+=yT),a&&(l+=pT),i.filter(c=>!Fg(c)).reduce((c,d)=>c+(hT.test(d)?mT:d===""?vT:gT),l)}function xT(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 ST(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=rl({path:p.relativePath,caseSensitive:p.caseSensitive,end:v},g),x=p.route;if(!b&&v&&i&&!l[l.length-1].route.index&&(b=rl({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},g)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:Xn([d,b.pathname]),pathnameBase:wT(Xn([d,b.pathnameBase])),route:x}),b.pathnameBase!=="/"&&(d=Xn([d,b.pathnameBase]))}return f}function rl(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,l]=_T(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 T=m[x]||"";f=d.slice(0,d.length-T.length).replace(/(.)\/+$/,"$1")}const _=m[x];return b&&!_?v[g]=void 0:v[g]=(_||"").replace(/%2F/g,"/"),v},{}),pathname:d,pathnameBase:f,pattern:n}}function _T(n,a=!1,i=!0){Mn(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 K0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Mn(!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 ja(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 TT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function kT(n,a="/"){let{pathname:i,search:l="",hash:c=""}=typeof n=="string"?Ki(n):n,d;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?d=Zg(i.substring(1),"/"):d=Zg(i,a)):d=a,{pathname:d,search:CT(l),hash:NT(c)}}function Zg(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 Hd(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 jT(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function qf(n){let a=jT(n);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function mc(n,a,i,l=!1){let c;typeof n=="string"?c=Ki(n):(c={...n},rt(!c.pathname||!c.pathname.includes("?"),Hd("?","pathname","search",c)),rt(!c.pathname||!c.pathname.includes("#"),Hd("#","pathname","hash",c)),rt(!c.search||!c.search.includes("#"),Hd("#","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=kT(c,m),v=f&&f!=="/"&&f.endsWith("/"),g=(d||f===".")&&i.endsWith("/");return!p.pathname.endsWith("/")&&(v||g)&&(p.pathname+="/"),p}var Xn=n=>n.join("/").replace(/\/\/+/g,"/"),wT=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),CT=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,NT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,ET=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 AT(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function DT(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Y0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function F0(n,a){let i=n;if(typeof i!="string"||!TT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,c=!1;if(Y0)try{let d=new URL(window.location.href),f=i.startsWith("//")?new URL(d.protocol+i):new URL(i),m=ja(f.pathname,a);f.origin===d.origin&&m!=null?i=m+f.search+f.hash:c=!0}catch{Mn(!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 Z0=["POST","PUT","PATCH","DELETE"];new Set(Z0);var RT=["GET",...Z0];new Set(RT);var Yi=y.createContext(null);Yi.displayName="DataRouter";var pc=y.createContext(null);pc.displayName="DataRouterState";var MT=y.createContext(!1),X0=y.createContext({isTransitioning:!1});X0.displayName="ViewTransition";var OT=y.createContext(new Map);OT.displayName="Fetchers";var BT=y.createContext(null);BT.displayName="Await";var gn=y.createContext(null);gn.displayName="Navigation";var pl=y.createContext(null);pl.displayName="Location";var On=y.createContext({outlet:null,matches:[],isDataRoute:!1});On.displayName="Route";var Kf=y.createContext(null);Kf.displayName="RouteError";var Q0="REACT_ROUTER_ERROR",LT="REDIRECT",IT="ROUTE_ERROR_RESPONSE";function zT(n){if(n.startsWith(`${Q0}:${LT}:{`))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 UT(n){if(n.startsWith(`${Q0}:${IT}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new ET(a.status,a.statusText,a.data)}catch{}}function VT(n,{relative:a}={}){rt(Hs(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=y.useContext(gn),{hash:c,pathname:d,search:f}=vl(n,{relative:a}),m=d;return i!=="/"&&(m=d==="/"?i:Xn([i,d])),l.createHref({pathname:m,search:f,hash:c})}function Hs(){return y.useContext(pl)!=null}function Ot(){return rt(Hs(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(pl).location}function Nt(n){rt(Hs(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=Ot();return y.useMemo(()=>rl(n,K0(a)),[a,n])}var W0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function J0(n){y.useContext(gn).static||y.useLayoutEffect(n)}function vc(){let{isDataRoute:n}=y.useContext(On);return n?tk():HT()}function HT(){rt(Hs(),"useNavigate() may be used only in the context of a <Router> component.");let n=y.useContext(Yi),{basename:a,navigator:i}=y.useContext(gn),{matches:l}=y.useContext(On),{pathname:c}=Ot(),d=JSON.stringify(qf(l)),f=y.useRef(!1);return J0(()=>{f.current=!0}),y.useCallback((p,v={})=>{if(Mn(f.current,W0),!f.current)return;if(typeof p=="number"){i.go(p);return}let g=mc(p,JSON.parse(d),c,v.relative==="path");n==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:Xn([a,g.pathname])),(v.replace?i.replace:i.push)(g,v.state,v)},[a,i,d,c,n])}var PT=y.createContext(null);function GT(n){let a=y.useContext(On).outlet;return y.useMemo(()=>a&&y.createElement(PT.Provider,{value:n},a),[a,n])}function rs(){let{matches:n}=y.useContext(On),a=n[n.length-1];return a?a.params:{}}function vl(n,{relative:a}={}){let{matches:i}=y.useContext(On),{pathname:l}=Ot(),c=JSON.stringify(qf(i));return y.useMemo(()=>mc(n,JSON.parse(c),l,a==="path"),[n,c,l,a])}function $T(n,a){return eb(n,a)}function eb(n,a,i){var w;rt(Hs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=y.useContext(gn),{matches:c}=y.useContext(On),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||"";nb(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=Ot(),b;if(a){let k=typeof a=="string"?Ki(a):a;rt(p==="/"||((w=k.pathname)==null?void 0:w.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||"/",_=x;if(p!=="/"){let k=p.replace(/^\//,"").split("/");_="/"+x.replace(/^\//,"").split("/").slice(k.length).join("/")}let T=G0(n,{pathname:_});Mn(v||T!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Mn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=ZT(T&&T.map(k=>Object.assign({},k,{params:Object.assign({},f,k.params),pathname:Xn([p,l.encodeLocation?l.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?p:Xn([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(pl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},C):C}function qT(){let n=ek(),a=AT(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 KT=y.createElement(qT,null),tb=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=UT(n.digest);i&&(n=i)}let a=n!==void 0?y.createElement(On.Provider,{value:this.props.routeContext},y.createElement(Kf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?y.createElement(YT,{error:n},a):a}};tb.contextType=MT;var Pd=new WeakMap;function YT({children:n,error:a}){let{basename:i}=y.useContext(gn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=zT(a.digest);if(l){let c=Pd.get(a);if(c)throw c;let d=F0(l.location,i);if(Y0&&!Pd.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 Pd.set(a,f),f}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return n}function FT({routeContext:n,match:a,children:i}){let l=y.useContext(Yi);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),y.createElement(On.Provider,{value:n},i)}function ZT(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);rt(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:_}=l,T=b.route.loader&&!x.hasOwnProperty(b.route.id)&&(!_||_[b.route.id]===void 0);if(b.route.lazy||T){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,_;p(g,{location:l.location,params:((_=(x=l.matches)==null?void 0:x[0])==null?void 0:_.params)??{},unstable_pattern:DT(l.matches),errorInfo:b})}:void 0;return c.reduceRight((g,b,x)=>{let _,T=!1,C=null,w=null;l&&(_=d&&b.route.id?d[b.route.id]:void 0,C=b.route.errorElement||KT,f&&(m<0&&x===0?(nb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,w=null):m===x&&(T=!0,w=b.route.hydrateFallbackElement||null)));let k=a.concat(c.slice(0,x+1)),N=()=>{let A;return _?A=C:T?A=w:b.route.Component?A=y.createElement(b.route.Component,null):b.route.element?A=b.route.element:A=g,y.createElement(FT,{match:b,routeContext:{outlet:g,matches:k,isDataRoute:l!=null},children:A})};return l&&(b.route.ErrorBoundary||b.route.errorElement||x===0)?y.createElement(tb,{location:l.location,revalidation:l.revalidation,component:C,error:_,children:N(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:v}):N()},null)}function Yf(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function XT(n){let a=y.useContext(Yi);return rt(a,Yf(n)),a}function QT(n){let a=y.useContext(pc);return rt(a,Yf(n)),a}function WT(n){let a=y.useContext(On);return rt(a,Yf(n)),a}function Ff(n){let a=WT(n),i=a.matches[a.matches.length-1];return rt(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function JT(){return Ff("useRouteId")}function ek(){var l;let n=y.useContext(Kf),a=QT("useRouteError"),i=Ff("useRouteError");return n!==void 0?n:(l=a.errors)==null?void 0:l[i]}function tk(){let{router:n}=XT("useNavigate"),a=Ff("useNavigate"),i=y.useRef(!1);return J0(()=>{i.current=!0}),y.useCallback(async(c,d={})=>{Mn(i.current,W0),i.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...d}))},[n,a])}var Xg={};function nb(n,a,i){!a&&!Xg[n]&&(Xg[n]=!0,Mn(!1,i))}y.memo(nk);function nk({routes:n,future:a,state:i,isStatic:l,onError:c}){return eb(n,void 0,{state:i,isStatic:l,onError:c})}function Hn({to:n,replace:a,state:i,relative:l}){rt(Hs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(gn);Mn(!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(On),{pathname:f}=Ot(),m=vc(),p=mc(n,qf(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 Ps(n){return GT(n.context)}function ke(n){rt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function ak({basename:n="/",children:a=null,location:i,navigationType:l="POP",navigator:c,static:d=!1,unstable_useTransitions:f}){rt(!Hs(),"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=Ki(i));let{pathname:v="/",search:g="",hash:b="",state:x=null,key:_="default",unstable_mask:T}=i,C=y.useMemo(()=>{let w=ja(v,m);return w==null?null:{location:{pathname:w,search:g,hash:b,state:x,key:_,unstable_mask:T},navigationType:l}},[m,v,g,b,x,_,l,T]);return Mn(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(gn.Provider,{value:p},y.createElement(pl.Provider,{children:a,value:C}))}function sk({children:n,location:a}){return $T(gf(n),a)}function gf(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,gf(l.props.children,d));return}rt(l.type===ke,`[${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>`),rt(!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=gf(l.props.children,d)),i.push(f)}),i}var Zr="get",Xr="application/x-www-form-urlencoded";function gc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function ik(n){return gc(n)&&n.tagName.toLowerCase()==="button"}function ok(n){return gc(n)&&n.tagName.toLowerCase()==="form"}function lk(n){return gc(n)&&n.tagName.toLowerCase()==="input"}function rk(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function ck(n,a){return n.button===0&&(!a||a==="_self")&&!rk(n)}function yf(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 uk(n,a){let i=yf(n);return a&&a.forEach((l,c)=>{i.has(c)||a.getAll(c).forEach(d=>{i.append(c,d)})}),i}var Ur=null;function dk(){if(Ur===null)try{new FormData(document.createElement("form"),0),Ur=!1}catch{Ur=!0}return Ur}var fk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gd(n){return n!=null&&!fk.has(n)?(Mn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xr}"`),null):n}function hk(n,a){let i,l,c,d,f;if(ok(n)){let m=n.getAttribute("action");l=m?ja(m,a):null,i=n.getAttribute("method")||Zr,c=Gd(n.getAttribute("enctype"))||Xr,d=new FormData(n)}else if(ik(n)||lk(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?ja(p,a):null,i=n.getAttribute("formmethod")||m.getAttribute("method")||Zr,c=Gd(n.getAttribute("formenctype"))||Gd(m.getAttribute("enctype"))||Xr,d=new FormData(m,n),!dk()){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(gc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Zr,l=null,c=Xr,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 Zf(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function mk(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&&ja(c.pathname,a)==="/"?c.pathname=`${a.replace(/\/$/,"")}/_root.${l}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${l}`,c}async function pk(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 vk(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 gk(n,a,i){let l=await Promise.all(n.map(async c=>{let d=a.routes[c.route.id];if(d){let f=await pk(d,i);return f.links?f.links():[]}return[]}));return Sk(l.flat(1).filter(vk).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Qg(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 yk(n,a,{includeHydrateFallback:i}={}){return bk(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 bk(n){return[...new Set(n)]}function xk(n){let a={},i=Object.keys(n).sort();for(let l of i)a[l]=n[l];return a}function Sk(n,a){let i=new Set;return new Set(a),n.reduce((l,c)=>{let d=JSON.stringify(xk(c));return i.has(d)||(i.add(d),l.push({key:d,link:c})),l},[])}function ab(){let n=y.useContext(Yi);return Zf(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function _k(){let n=y.useContext(pc);return Zf(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Xf=y.createContext(void 0);Xf.displayName="FrameworkContext";function sb(){let n=y.useContext(Xf);return Zf(n,"You must render this element inside a <HydratedRouter> element"),n}function Tk(n,a){let i=y.useContext(Xf),[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(N=>{f(N.isIntersecting)})},w=new IntersectionObserver(C,{threshold:.5});return x.current&&w.observe(x.current),()=>{w.disconnect()}}},[n]),y.useEffect(()=>{if(l){let C=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(C)}}},[l]);let _=()=>{c(!0)},T=()=>{c(!1),f(!1)};return i?n!=="intent"?[d,x,{}]:[d,x,{onFocus:$o(m,_),onBlur:$o(p,T),onMouseEnter:$o(v,_),onMouseLeave:$o(g,T),onTouchStart:$o(b,_)}]:[!1,x,{}]}function $o(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function kk({page:n,...a}){let{router:i}=ab(),l=y.useMemo(()=>G0(i.routes,n,i.basename),[i.routes,n,i.basename]);return l?y.createElement(wk,{page:n,matches:l,...a}):null}function jk(n){let{manifest:a,routeModules:i}=sb(),[l,c]=y.useState([]);return y.useEffect(()=>{let d=!1;return gk(n,a,i).then(f=>{d||c(f)}),()=>{d=!0}},[n,a,i]),l}function wk({page:n,matches:a,...i}){let l=Ot(),{future:c,manifest:d,routeModules:f}=sb(),{basename:m}=ab(),{loaderData:p,matches:v}=_k(),g=y.useMemo(()=>Qg(n,a,v,d,l,"data"),[n,a,v,d,l]),b=y.useMemo(()=>Qg(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,w=!1;if(a.forEach(N=>{var R;let A=d.routes[N.route.id];!A||!A.hasLoader||(!g.some(E=>E.route.id===N.route.id)&&N.route.id in p&&((R=f[N.route.id])!=null&&R.shouldRevalidate)||A.hasClientLoader?w=!0:C.add(N.route.id))}),C.size===0)return[];let k=mk(n,m,c.unstable_trailingSlashAwareDataRequests,"data");return w&&C.size>0&&k.searchParams.set("_routes",a.filter(N=>C.has(N.route.id)).map(N=>N.route.id).join(",")),[k.pathname+k.search]},[m,c.unstable_trailingSlashAwareDataRequests,p,l,d,g,a,n,f]),_=y.useMemo(()=>yk(b,d),[b,d]),T=jk(b);return y.createElement(y.Fragment,null,x.map(C=>y.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...i})),_.map(C=>y.createElement("link",{key:C,rel:"modulepreload",href:C,...i})),T.map(({key:C,link:w})=>y.createElement("link",{key:C,nonce:i.nonce,...w,crossOrigin:w.crossOrigin??i.crossOrigin})))}function Ck(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var Nk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Nk&&(window.__reactRouterVersion="7.13.2")}catch{}function Ek({basename:n,children:a,unstable_useTransitions:i,window:l}){let c=y.useRef();c.current==null&&(c.current=lT({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(ak,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:d,unstable_useTransitions:i})}var ib=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qf=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:_,...T},C){let{basename:w,navigator:k,unstable_useTransitions:N}=y.useContext(gn),A=typeof g=="string"&&ib.test(g),R=F0(g,w);g=R.to;let E=VT(g,{relative:c}),B=Ot(),U=null;if(m){let ae=mc(m,[],B.unstable_mask?B.unstable_mask.pathname:"/",!0);w!=="/"&&(ae.pathname=ae.pathname==="/"?w:Xn([w,ae.pathname])),U=k.createHref(ae)}let[z,K,te]=Tk(l,T),ne=Mk(g,{replace:f,unstable_mask:m,state:p,target:v,preventScrollReset:b,relative:c,viewTransition:x,unstable_defaultShouldRevalidate:_,unstable_useTransitions:N});function ie(ae){a&&a(ae),ae.defaultPrevented||ne(ae)}let le=!(R.isExternal||d),q=y.createElement("a",{...T,...te,href:(le?U:void 0)||R.absoluteURL||E,onClick:le?ie:a,ref:Ck(C,K),target:v,"data-discover":!A&&i==="render"?"true":void 0});return z&&!A?y.createElement(y.Fragment,null,q,y.createElement(kk,{page:E})):q});Qf.displayName="Link";var Ak=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=vl(f,{relative:v.relative}),x=Ot(),_=y.useContext(pc),{navigator:T,basename:C}=y.useContext(gn),w=_!=null&&zk(b)&&m===!0,k=T.encodeLocation?T.encodeLocation(b).pathname:b.pathname,N=x.pathname,A=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;i||(N=N.toLowerCase(),A=A?A.toLowerCase():null,k=k.toLowerCase()),A&&C&&(A=ja(A,C)||A);const R=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let E=N===k||!c&&N.startsWith(k)&&N.charAt(R)==="/",B=A!=null&&(A===k||!c&&A.startsWith(k)&&A.charAt(k.length)==="/"),U={isActive:E,isPending:B,isTransitioning:w},z=E?a:void 0,K;typeof l=="function"?K=l(U):K=[l,E?"active":null,B?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let te=typeof d=="function"?d(U):d;return y.createElement(Qf,{...v,"aria-current":z,className:K,ref:g,style:te,to:f,viewTransition:m},typeof p=="function"?p(U):p)});Ak.displayName="NavLink";var Dk=y.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:l,replace:c,state:d,method:f=Zr,action:m,onSubmit:p,relative:v,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:x,..._},T)=>{let{unstable_useTransitions:C}=y.useContext(gn),w=Lk(),k=Ik(m,{relative:v}),N=f.toLowerCase()==="get"?"get":"post",A=typeof m=="string"&&ib.test(m),R=E=>{if(p&&p(E),E.defaultPrevented)return;E.preventDefault();let B=E.nativeEvent.submitter,U=(B==null?void 0:B.getAttribute("formmethod"))||f,z=()=>w(B||E.currentTarget,{fetcherKey:a,method:U,navigate:i,replace:c,state:d,relative:v,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:x});C&&i!==!1?y.startTransition(()=>z()):z()};return y.createElement("form",{ref:T,method:N,action:k,onSubmit:l?p:R,..._,"data-discover":!A&&n==="render"?"true":void 0})});Dk.displayName="Form";function Rk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ob(n){let a=y.useContext(Yi);return rt(a,Rk(n)),a}function Mk(n,{target:a,replace:i,unstable_mask:l,state:c,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:p,unstable_useTransitions:v}={}){let g=vc(),b=Ot(),x=vl(n,{relative:f});return y.useCallback(_=>{if(ck(_,a)){_.preventDefault();let T=i!==void 0?i:ll(b)===ll(x),C=()=>g(n,{replace:T,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 Wf(n){Mn(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(yf(n)),i=y.useRef(!1),l=Ot(),c=y.useMemo(()=>uk(l.search,i.current?null:a.current),[l.search]),d=vc(),f=y.useCallback((m,p)=>{const v=yf(typeof m=="function"?m(new URLSearchParams(c)):m);i.current=!0,d("?"+v,p)},[d,c]);return[c,f]}var Ok=0,Bk=()=>`__${String(++Ok)}__`;function Lk(){let{router:n}=ob("useSubmit"),{basename:a}=y.useContext(gn),i=JT(),l=n.fetch,c=n.navigate;return y.useCallback(async(d,f={})=>{let{action:m,method:p,encType:v,formData:g,body:b}=hk(d,a);if(f.navigate===!1){let x=f.fetcherKey||Bk();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 Ik(n,{relative:a}={}){let{basename:i}=y.useContext(gn),l=y.useContext(On);rt(l,"useFormAction must be used inside a RouteContext");let[c]=l.matches.slice(-1),d={...vl(n||".",{relative:a})},f=Ot();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:Xn([i,d.pathname])),ll(d)}function zk(n,{relative:a}={}){let i=y.useContext(X0);rt(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=ob("useViewTransitionState"),c=vl(n,{relative:a});if(!i.isTransitioning)return!1;let d=ja(i.currentLocation.pathname,l)||i.currentLocation.pathname,f=ja(i.nextLocation.pathname,l)||i.nextLocation.pathname;return rl(c.pathname,f)!=null||rl(c.pathname,d)!=null}function xt(){const n=vc();return y.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function lb(n){return`/sessions/${encodeURIComponent(n)}`}function Ui(n,a){return a?`/environments/${encodeURIComponent(a)}/workspaces/${encodeURIComponent(n)}`:`/workspaces/${encodeURIComponent(n)}`}function Jn(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 Gs(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 rb(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const Vi="/environments",Uk="/environments/new";function Hi(n){return`/environments/${encodeURIComponent(n)}`}function Vk(n){return`/environments/${encodeURIComponent(n)}/edit`}const zi="/settings",Hk="/settings/credentials",$d="/settings/personas",Pk="/settings/personas/new";function cb(n){return`/settings/personas/${encodeURIComponent(n)}`}const Gk="/settings/shortcuts",$k="/pair",qk="/chat",zs="/",Kk="/tasks",ub="/workspaces/new",db="/knowledge";function Yk(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=_=>{if(typeof _.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const T=sT(_.data);T&&f.current(T)},g.onclose=_=>{var T;if(d(!1),l.current=void 0,(T=p.current)==null||T.call(p),clearTimeout(b),_.code===oT){window.location.href=$k;return}b=setTimeout(x,iT)},g.onerror=()=>{g.close()}}return x(),()=>{clearTimeout(b),g==null||g.close()}},[i,v]),{connected:c,send:v}}const Fk=new Proxy(globalThis.fetch,{apply(n,a,i){return Reflect.apply(globalThis.fetch,a,i)}}),Zk=I1({baseUrl:"/",fetch:Fk}),_e=z1(U1,Zk);function Xk(n){return{id:n.id,displayName:n.displayName,adapterType:n.adapterType,adapterConfig:n.adapterConfig||"{}",status:n.status,bootstrapped:n.bootstrapped}}function Wg(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 Qk(n){return{sessionId:n.sessionId,eventType:V1(n.type),timestamp:n.timestamp,content:n.content,raw:n.raw||void 0}}function Wk(n){return{id:n.id,name:n.name,description:n.description,repoUrl:n.repoUrl,environmentId:n.environmentId,status:H1(n.status),workingDirectory:n.workingDirectory,useWorktrees:n.useWorktrees,defaultPersonaId:n.defaultPersonaId,createdAt:n.createdAt,updatedAt:n.updatedAt}}function Jg(n){return{id:n.id,workspaceId:n.workspaceId??void 0,title:n.title,description:n.description,status:P1(n.status),branch:n.branch,latestSessionId:n.latestSessionId,dependsOn:[...n.dependsOn],sortOrder:n.sortOrder,createdAt:n.createdAt,startedAt:n.startedAt||void 0,completedAt:n.completedAt||void 0,parentTaskId:n.parentTaskId,depth:n.depth,childTaskIds:[...n.childTaskIds],canDecompose:n.canDecompose,defaultPersonaId:n.defaultPersonaId,workpad:n.workpad}}function Jk(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 ej(n){return{name:n.name,tokenType:n.type,envVar:n.envVar,filePath:n.filePath,expiresAt:n.expiresAt}}function tj(n){return{claude:G1(n.claude),github:Ir(n.github),copilot:Ir(n.copilot),codex:Ir(n.codex),goose:Ir(n.goose)}}function nj(n){return{name:n.name,repository:n.repository,state:n.state,gitStatus:n.gitStatus}}function qd(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 aj(n){return{inputTokens:n.inputTokens,outputTokens:n.outputTokens,costUsd:n.costUsd,sessionCount:n.sessionCount}}function Vr(n,a=0){return{id:n.id,label:n.title||n.label||n.id,kind:n.kind,category:n.category||void 0,sourceType:n.sourceType||void 0,sourceId:n.sourceId||void 0,content:n.content||void 0,tags:n.tags.length>0?[...n.tags]:void 0,workspaceId:n.workspaceId||void 0,createdAt:n.createdAt||void 0,updatedAt:n.updatedAt||void 0,val:a}}function Kd(n){return{source:n.fromId,target:n.toId,type:n.type}}const ey=5e3;function sj(){const[n,a]=y.useState([]),[i,l]=y.useState({}),c=y.useCallback(()=>{_e.listEnvironments({}).then(x=>{a(x.environments.map(Xk))},()=>{})},[]),d=y.useCallback(x=>{switch(x.type){case"environment.added":return!0;case"environment.removed":{const _=x.payload.environmentId;return _&&(a(T=>T.filter(C=>C.id!==_)),l(T=>{const C={...T};return delete C[_],C})),!0}case"environment.changed":return c(),!0;case"environment.provision_progress":{const _=x.payload;if(typeof _.environmentId!="string"||typeof _.stage!="string"||typeof _.message!="string"||typeof _.progress!="number")return V0("environment.provision_progress","invalid payload"),!0;if(l(T=>({...T,[_.environmentId]:{stage:_.stage,message:_.message,progress:_.progress}})),_.stage==="ready"){const T=_.environmentId;setTimeout(()=>{l(C=>{const w={...C};return delete w[T],w})},ey)}return!0}default:return!1}},[c]),f=y.useCallback(x=>{var _;if(x.type==="environments"){const T=Array.isArray((_=x.payload)==null?void 0:_.environments)?x.payload.environments:[];return a(T),!0}return!1},[]),m=y.useCallback((x,_,T)=>{_e.addEnvironment({displayName:x,adapterType:_,adapterConfig:JSON.stringify(T??{})}).catch(()=>{})},[]),p=y.useCallback((x,_)=>{_e.updateEnvironment({id:x,displayName:_.displayName,adapterConfig:_.adapterConfig?JSON.stringify(_.adapterConfig):void 0}).catch(()=>{})},[]),v=y.useCallback((x,_)=>{(async()=>{try{const C=_e.provisionEnvironment({id:x,force:_??!1});for await(const w of C)l(k=>({...k,[x]:{stage:w.stage,message:w.message,progress:w.progress}})),w.stage==="ready"&&setTimeout(()=>{l(k=>{const N={...k};return delete N[x],N})},ey)}catch{l(C=>{const w={...C};return delete w[x],w})}})().catch(()=>{})},[]),g=y.useCallback(x=>{_e.stopEnvironment({id:x}).catch(()=>{})},[]),b=y.useCallback(x=>{_e.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 Yd=new Set(["pending","running","idle"]),ij=new Set(["completed","failed","interrupted","hibernating","suspended"]),ty=["pending","running","idle"];function oj(){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(()=>{_e.listSessions({}).then(A=>{const R=A.sessions.map(Wg);a(E=>{const B=new Map(E.map(U=>[U.id,U]));return R.map(U=>{const z=B.get(U.id),K=z==null?void 0:z.status;return!K||K===U.status?U:ij.has(K)&&Yd.has(U.status)?{...U,status:K,...z.endReason!==void 0?{endReason:z.endReason}:{}}:Yd.has(K)&&Yd.has(U.status)&&ty.indexOf(K)>ty.indexOf(U.status)?{...U,status:K}:U})})},()=>{})},[]),b=y.useCallback(A=>{if(A.type!=="session_event")return!1;if(!tT(A.payload))return V0("session_event","payload is not a valid SessionEvent"),!0;const R=A.payload;let E=0;if(l(B=>{const U=[...B,R];return U.length>Ei?(E=U.length-Ei,U.slice(-Ei)):U}),E>0&&d(B=>B+E),R.eventType==="usage")try{const B=JSON.parse(R.content),U=Number(B.input_tokens)||0,z=Number(B.output_tokens)||0,K=Number(B.cost_usd)||0;(U>0||z>0||K>0)&&a(te=>te.map(ne=>ne.id===R.sessionId?{...ne,inputTokens:(ne.inputTokens??0)+U,outputTokens:(ne.outputTokens??0)+z,costUsd:(ne.costUsd??0)+K}:ne))}catch{}if(R.eventType==="status"){const B=H0(R.content),U=P0(R.content);a(z=>z.some(te=>te.id===R.sessionId)?z.map(te=>te.id===R.sessionId?{...te,status:B,...U!==void 0?{endReason:U}:{}}:te):[...z,{id:R.sessionId,environmentId:"",runtime:"",status:B,prompt:"",startedAt:R.timestamp,...U!==void 0?{endReason:U}:{}}])}return!0},[]),x=y.useCallback(A=>{var R,E,B,U,z;switch(A.type){case"sessions":{const K=Array.isArray((R=A.payload)==null?void 0:R.sessions)?A.payload.sessions:[];return a(K),!0}case"spawned":{const K=(E=A.payload)==null?void 0:E.sessionId;return typeof K=="string"&&K&&m(K),g(),!0}case"session_events":{const K=Array.isArray((B=A.payload)==null?void 0:B.events)?A.payload.events:[];return K.length>0&&l(K),!0}case"task_sessions":{const K=(U=A.payload)==null?void 0:U.taskId;if(typeof K=="string"&&K){const te=Array.isArray((z=A.payload)==null?void 0:z.sessions)?A.payload.sessions:[];v(ne=>({...ne,[K]:te}))}return!0}default:return!1}},[g]),_=y.useCallback((A,R,E,B)=>{_e.spawnAgent({environmentId:A,prompt:R,personaId:E||"",workingDirectory:B||""}).then(U=>{m(U.id),g()},()=>{})},[g]),T=y.useCallback((A,R)=>{_e.sendInput({sessionId:A,text:R}).catch(()=>{})},[]),C=y.useCallback(A=>{_e.killAgent({id:A,graceful:!1}).catch(()=>{})},[]),w=y.useCallback(A=>{_e.getSessionEvents({id:A}).then(R=>{const E=R.events.map(Qk);if(E.length>0){let B=0;l(U=>{const z=new Set;for(const ne of U)ne.sessionId===A&&z.add(`${ne.timestamp}|${ne.eventType}`);const K=E.filter(ne=>!z.has(`${ne.timestamp}|${ne.eventType}`)),te=[...U,...K].sort((ne,ie)=>ne.sessionId!==ie.sessionId?0:ne.timestamp.localeCompare(ie.timestamp));return te.length>Ei?(B=te.length-Ei,te.slice(-Ei)):te}),B>0&&d(U=>U+B)}},()=>{})},[]),k=y.useCallback(()=>{l([]),d(0)},[]),N=y.useCallback(A=>{_e.getTaskSessions({id:A}).then(R=>{const E=R.sessions.map(Wg);v(B=>({...B,[A]:E}))},()=>{})},[]);return{sessions:n,events:i,eventsDropped:c,lastSpawnedId:f,taskSessions:p,loadSessions:g,spawn:_,sendInput:T,kill:C,loadSessionEvents:w,clearEvents:k,loadTaskSessions:N,handleMessage:b,handleLegacyMessage:x}}function lj(){const[n,a]=y.useState([]),[i,l]=y.useState(!1),c=y.useCallback(()=>{_e.listWorkspaces({}).then(g=>{a(g.workspaces.map(Wk))},()=>{})},[]),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,_,T,C,w,k,N)=>{l(!0),_e.createWorkspace({name:g,description:b||"",repoUrl:x||"",environmentId:_||"",defaultPersonaId:T||void 0,useWorktrees:C??!0,workingDirectory:w||void 0}).then(()=>{l(!1),k==null||k()},A=>{l(!1);const R=A instanceof $f?A.message:"Failed to create workspace";N==null||N(R)})},[]),p=y.useCallback(g=>{_e.archiveWorkspace({id:g}).catch(()=>{})},[]),v=y.useCallback((g,b)=>{_e.updateWorkspace({id:g,...b}).catch(()=>{})},[]);return{workspaces:n,workspaceCreating:i,loadWorkspaces:c,createWorkspace:m,archiveWorkspace:p,updateWorkspace:v,handleEvent:d,onDisconnect:f}}function rj(){const[n,a]=y.useState([]),[i,l]=y.useState(void 0),c=y.useCallback(k=>{_e.listTasks({workspaceId:k}).then(N=>{const A=N.tasks.map(Jg);a(R=>[...R.filter(E=>E.workspaceId!==k),...A])},()=>{})},[]),d=y.useCallback(()=>{_e.listTasks({}).then(k=>{const N=k.tasks.map(Jg);a(A=>{const R=new Set(N.map(E=>E.id));return[...A.filter(E=>!R.has(E.id)),...N]})},()=>{})},[]),f=y.useCallback((k,N)=>{k?c(k):N&&a(A=>{const R=A.find(E=>E.id===N);return R!=null&&R.workspaceId?c(R.workspaceId):d(),A})},[c,d]),m=y.useCallback(k=>{const N=k.payload;switch(k.type){case"task.created":{const A=typeof N.workspaceId=="string"?N.workspaceId:"";return A&&c(A),!0}case"task.started":{const A=typeof N.taskId=="string"?N.taskId:"",R=typeof N.sessionId=="string"?N.sessionId:"",E=typeof N.workspaceId=="string"?N.workspaceId:"";return l(B=>A&&B===A?void 0:B),R&&A&&a(B=>B.map(U=>U.id===A?{...U,latestSessionId:R}:U)),f(E,A),!0}case"task.completed":case"task.deleted":case"task.updated":{const A=typeof N.workspaceId=="string"?N.workspaceId:"",R=typeof N.taskId=="string"?N.taskId:"";return f(A,R),!0}default:return!1}},[c,f]),p=y.useCallback(()=>{l(void 0)},[]),v=y.useCallback(k=>{var N,A;if(k.type==="tasks"){const R=Array.isArray((N=k.payload)==null?void 0:N.tasks)?k.payload.tasks:[],E=typeof((A=k.payload)==null?void 0:A.workspaceId)=="string"&&k.payload.workspaceId?k.payload.workspaceId:"";return a(E?B=>[...B.filter(U=>U.workspaceId!==E),...R]:B=>{const U=new Set(R.map(z=>z.id));return[...B.filter(z=>!U.has(z.id)),...R]}),!0}return!1},[]),g=y.useCallback((k,N,A,R,E,B,U,z,K)=>{_e.createTask({workspaceId:k,title:N,description:A||"",dependsOn:R||[],parentTaskId:E||"",defaultPersonaId:B||void 0,canDecompose:U??void 0}).then(()=>{z==null||z()},te=>{const ne=te instanceof $f?te.message:"Failed to create task";K==null||K(ne)})},[]),b=y.useCallback((k,N,A,R)=>{l(k),_e.startTask({taskId:k,personaId:N||"",environmentId:A||"",notes:R||""}).catch(()=>{l(void 0)})},[]),x=y.useCallback(k=>{_e.stopTask({id:k}).catch(()=>{})},[]),_=y.useCallback(k=>{_e.completeTask({id:k}).catch(()=>{})},[]),T=y.useCallback(k=>{_e.resumeTask({id:k}).catch(()=>{})},[]),C=y.useCallback((k,N,A,R,E)=>{_e.updateTask({id:k,title:N,description:A,dependsOn:R,...E!==void 0?{defaultPersonaId:E}:{}}).catch(()=>{})},[]),w=y.useCallback(k=>{_e.deleteTask({id:k}).catch(()=>{})},[]);return{tasks:n,taskStartingId:i,loadTasks:c,loadAllTasks:d,createTask:g,startTask:b,stopTask:x,completeTask:_,resumeTask:T,updateTask:C,deleteTask:w,handleEvent:m,onDisconnect:p,handleLegacyMessage:v}}function cj(){const[n,a]=y.useState([]),i=y.useCallback(d=>{_e.queryFindings({workspaceId:d}).then(f=>{a(f.findings.map(Jk))},()=>{})},[]),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)=>{_e.postFinding({workspaceId:d,title:f,content:m,category:p??"general",tags:v??[]}).catch(()=>{})},[]);return{findings:n,loadFindings:i,postFinding:c,handleEvent:l}}function uj(){const[n,a]=y.useState([]),i=y.useCallback(()=>{_e.listTokens({}).then(f=>{a(f.tokens.map(ej))},()=>{})},[]),l=y.useCallback(f=>f.type==="token.changed"?(i(),!0):!1,[i]),c=y.useCallback((f,m,p,v,g)=>{_e.setToken({name:f,value:m,type:p,envVar:v,filePath:g}).catch(()=>{})},[]),d=y.useCallback(f=>{_e.deleteToken({name:f}).catch(()=>{})},[]);return{tokens:n,loadTokens:i,setToken:c,deleteToken:d,handleEvent:l}}function dj(){const[n,a]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),i=y.useCallback(()=>{_e.getCredentialProviders({}).then(d=>{a(tj(d))},()=>{})},[]),l=y.useCallback(d=>d.type==="credential.providers_changed"?(aT(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)_e.setCredentialProvider({provider:m,value:p}).catch(()=>{})},[]);return{credentialProviders:n,loadCredentials:i,updateCredentialProviders:c,handleEvent:l}}function fj(){const[n,a]=y.useState([]),[i,l]=y.useState(""),[c,d]=y.useState(""),[f,m]=y.useState(!1),p=y.useCallback(()=>{_e.listCodespaces({}).then(g=>{a(g.codespaces.map(nj)),d(g.error)},()=>{})},[]),v=y.useCallback((g,b)=>{m(!0),l(""),_e.createCodespace({repo:g,machine:b??""}).then(()=>{m(!1),p()},x=>{m(!1);const _=x instanceof $f?x.message:"Failed to create codespace";l(_)})},[p]);return{codespaces:n,codespaceError:i,codespaceListError:c,codespaceCreating:f,listCodespaces:p,createCodespace:v}}function hj(){const[n,a]=y.useState([]),i=y.useCallback(()=>{_e.listPersonas({}).then(m=>{a(m.personas.map(qd))},()=>{})},[]),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,_,T)=>_e.createPersona({name:m,description:p,systemPrompt:v,runtime:g||"",model:b||"",maxTurns:x||0,type:_||"agent",script:T||""}).then(C=>{const w=qd(C);return a(k=>[...k.filter(N=>N.id!==w.id),w]),w}),[]),d=y.useCallback((m,p,v,g,b,x,_,T,C)=>{const w={id:m};return p!==void 0&&(w.name=p),v!==void 0&&(w.description=v),g!==void 0&&(w.systemPrompt=g),b!==void 0&&(w.runtime=b),x!==void 0&&(w.model=x),_!==void 0&&(w.maxTurns=_),T!==void 0&&(w.type=T),C!==void 0&&(w.script=C),_e.updatePersona(w).then(k=>{const N=qd(k);return a(A=>A.map(R=>R.id===N.id?N:R)),N})},[]),f=y.useCallback(async m=>{await _e.deletePersona({id:m}),a(p=>p.filter(v=>v.id!==m))},[]);return{personas:n,loadPersonas:i,createPersona:c,updatePersona:d,deletePersona:f,handleEvent:l}}function mj(n){if(n)try{return JSON.parse(n)}catch{return}}function pj(){const[n,a]=y.useState(new Map),[i,l]=y.useState([]),[c,d]=y.useState(void 0),[f,m]=y.useState(void 0),[p,v]=y.useState(!1),[g,b]=y.useState(""),x=y.useRef(""),_=y.useCallback(R=>{const E=R??"";x.current=E,b(""),v(!0),_e.listRecentKnowledgeNodes({limit:30,workspaceId:E}).then(B=>{const U=new Map,z=[];for(const K of B.nodes)U.set(K.id,Vr(K));for(const K of B.edges)z.push(Kd(K));for(const K of z){const te=U.get(K.source);te&&(te.val+=1);const ne=U.get(K.target);ne&&(ne.val+=1)}a(U),l(z),v(!1)},()=>{v(!1)})},[]),T=y.useCallback(R=>{R.trim()&&(b(R),m(void 0),d(void 0),v(!0),_e.searchKnowledge({query:R,limit:20,workspaceId:x.current}).then(E=>{const B=new Map,U=[];for(const z of E.results){z.node&&B.set(z.node.id,Vr(z.node,z.edges.length));for(const K of z.edges)U.push(Kd(K))}a(B),l(U),v(!1)},()=>{v(!1)}))},[]),C=y.useCallback(()=>{_(x.current)},[_]),w=y.useCallback(R=>{m(R),_e.getKnowledgeNode({id:R}).then(E=>{if(!E.node){d(void 0);return}d({node:Vr(E.node,E.edges.length),edges:E.edges.map(B=>({fromId:B.fromId,toId:B.toId,type:B.type,metadata:mj(B.metadataJson)}))})},()=>{d(void 0)})},[]),k=y.useCallback(()=>{m(void 0),d(void 0)},[]),N=y.useCallback(R=>{_e.expandKnowledgeNode({id:R,depth:1}).then(E=>{a(B=>{const U=new Map(B);for(const z of E.nodes)U.has(z.id)||U.set(z.id,Vr(z));return U}),l(B=>{const U=new Set(B.map(K=>`${K.source}:${K.target}:${K.type}`)),z=[];for(const K of E.edges){const te=Kd(K),ne=`${te.source}:${te.target}:${te.type}`;U.has(ne)||z.push(te)}return[...B,...z]})},()=>{})},[]),A=y.useCallback(R=>!1,[]);return{graphData:{nodes:[...n.values()],links:i},selectedNode:c,selectedId:f,loading:p,searchQuery:g,search:T,clearSearch:C,selectNode:w,clearSelection:k,expandNode:N,loadRecent:_,handleEvent:A}}function vj(n){const[a,i]=y.useState(""),[l,c]=y.useState(void 0),[d,f]=y.useState({}),{connected:m,send:p}=Yk(n,{onMessage:K,onConnect:te,onDisconnect:ne}),v=sj(),g=oj(),b=lj(),x=rj(),_=cj(),T=uj(),C=dj(),w=fj(),k=hj(),N=pj(),A="default_persona_id",R="onboarding_completed",E=y.useCallback(async le=>{const q=await _e.setSetting({key:A,value:le});i(q.value)},[]),B=y.useCallback(()=>{c(!0),_e.setSetting({key:R,value:"true"}).catch(()=>{})},[]),U=y.useCallback((le,q)=>{_e.getUsage({scope:le,id:q}).then(ae=>{const O=`${le}:${q}`;f(P=>({...P,[O]:aj(ae)}))},()=>{})},[]);function z(le){const q=le.payload.key,ae=le.payload.value;if(le.type==="setting.changed"){q===A&&i(ae??""),q===R&&c(ae==="true");return}if(v.handleEvent(le)){(le.type==="environment.removed"||le.type==="environment.changed")&&g.loadSessions();return}if(!b.handleEvent(le)){if(x.handleEvent(le)){le.type==="task.started"&&g.loadSessions();return}_.handleEvent(le)||T.handleEvent(le)||C.handleEvent(le)||k.handleEvent(le)||N.handleEvent(le)}}function K(le){var q,ae,O,P;if(eT(le)){z(le);return}if(!g.handleMessage(le)&&!((q=g.handleLegacyMessage)!=null&&q.call(g,le))&&!((ae=v.handleLegacyMessage)!=null&&ae.call(v,le))&&!((O=x.handleLegacyMessage)!=null&&O.call(x,le))&&le.type==="error"){console.error("[ws]",(P=le.payload)==null?void 0:P.message);return}}function te(le){v.loadEnvironments(),g.loadSessions(),b.loadWorkspaces(),T.loadTokens(),C.loadCredentials(),k.loadPersonas(),_e.getSetting({key:A}).then(q=>{i(q.value)},()=>{}),_e.getSetting({key:R}).then(q=>{c(q.value==="true")},()=>{}),x.loadAllTasks(),le({type:"subscribe_all"})}function ne(){b.onDisconnect(),x.onDisconnect()}const ie=y.useCallback(()=>{v.loadEnvironments(),g.loadSessions(),b.loadWorkspaces(),T.loadTokens()},[v.loadEnvironments,g.loadSessions,b.loadWorkspaces,T.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:_.findings,tokens:T.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:_.loadFindings,postFinding:_.postFinding,loadEnvironments:v.loadEnvironments,addEnvironment:v.addEnvironment,updateEnvironment:v.updateEnvironment,loadTokens:T.loadTokens,setToken:T.setToken,deleteToken:T.deleteToken,credentialProviders:C.credentialProviders,updateCredentialProviders:C.updateCredentialProviders,provisionStatus:v.provisionStatus,provisionEnvironment:v.provisionEnvironment,stopEnvironment:v.stopEnvironment,removeEnvironment:v.removeEnvironment,codespaces:w.codespaces,codespaceError:w.codespaceError,codespaceListError:w.codespaceListError,codespaceCreating:w.codespaceCreating,listCodespaces:w.listCodespaces,createCodespace:w.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:B,usageCache:d,loadUsage:U,knowledge:N}}const Jf=y.createContext(void 0);function gj({children:n}){const a=vj();return r.jsx(Jf.Provider,{value:a,children:n})}function ut(){const n=y.useContext(Jf);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const yj=[{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}],bj=[{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}],xj=[{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"}],Sj=[{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"}],_j=[{id:"task-001",workspaceId:"proj-alpha",title:"Implement JWT authentication",description:"Replace session-based auth with JWT tokens across all protected routes",status:"working",branch:"feat/jwt-auth",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-001a","task-001b","task-001c"],canDecompose:!0,defaultPersonaId:"",workpad:""},{id:"task-001a",workspaceId:"proj-alpha",title:"Design token schema",description:"Define JWT payload structure, expiry, and refresh token strategy",status:"complete",branch:"feat/jwt-auth/design-token-schema",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:10:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-001b",workspaceId:"proj-alpha",title:"Implement auth middleware",description:"Build Express middleware that verifies JWT Bearer tokens",status:"working",branch:"feat/jwt-auth/implement-auth-middleware",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:15:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-001c",workspaceId:"proj-alpha",title:"Write auth integration tests",description:"End-to-end tests for login flow, token refresh, and protected route access",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-25T10:20:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-002",workspaceId:"proj-alpha",title:"Add rate limiting",description:"Implement token-bucket rate limiting for public API endpoints",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:05:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-003",workspaceId:"proj-alpha",title:"Set up OpenAPI documentation",description:"Generate Swagger docs from route decorators and serve at /api/docs",status:"paused",branch:"feat/openapi-docs",latestSessionId:"sess-002",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-24T16:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-004",workspaceId:"proj-alpha",title:"Database connection pooling",description:"Switch from single connection to a connection pool with health checks",status:"complete",branch:"feat/db-pool",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-23T11:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-005",workspaceId:"proj-alpha",title:"Fix N+1 query in user list",description:"Use a JOIN instead of per-row lookups in GET /api/users",status:"not_started",branch:"fix/user-list-n1",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:5,createdAt:"2026-02-22T09:30:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-006",workspaceId:"proj-beta",title:"Add Parquet export support",description:"Allow pipeline outputs to be written as Parquet files for Spark consumption",status:"working",branch:"feat/parquet-export",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-006a","task-006b","task-006c","task-006d"],canDecompose:!0,defaultPersonaId:"",workpad:""},{id:"task-006a",workspaceId:"proj-beta",title:"Define Parquet schema mapping",description:"Map internal column types to Arrow/Parquet type system",status:"complete",branch:"feat/parquet-export/define-parquet-schema-mapping",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:05:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-006b",workspaceId:"proj-beta",title:"Implement row-group writer",description:"Write buffered row groups with configurable batch size",status:"complete",branch:"feat/parquet-export/implement-row-group-writer",latestSessionId:"",dependsOn:["task-006a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:10:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-006c",workspaceId:"proj-beta",title:"Add compression options",description:"Support Snappy, ZSTD, and GZIP compression for Parquet output",status:"working",branch:"feat/parquet-export/add-compression-options",latestSessionId:"sess-004",dependsOn:["task-006b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T08:15:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-006d",workspaceId:"proj-beta",title:"Write Parquet integration tests",description:"Round-trip tests: write Parquet, read back with pyarrow, verify data integrity",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-006c"],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-26T08:20:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-007",workspaceId:"proj-beta",title:"Implement incremental loads",description:"Track watermarks so pipelines only process new/changed rows",status:"working",branch:"feat/incremental",latestSessionId:"sess-004",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:30:00Z",parentTaskId:"",depth:0,childTaskIds:["task-007a","task-007b"],canDecompose:!0,defaultPersonaId:"",workpad:""},{id:"task-007a",workspaceId:"proj-beta",title:"Design watermark storage",description:"Define schema for per-pipeline high-watermark tracking",status:"complete",branch:"feat/incremental/design-watermark-storage",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:35:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-007b",workspaceId:"proj-beta",title:"Implement change detection query",description:"Generate WHERE clauses from watermarks to fetch only changed rows",status:"failed",branch:"feat/incremental/implement-change-detection-query",latestSessionId:"",dependsOn:["task-007a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:40:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-008",workspaceId:"proj-beta",title:"Add pipeline monitoring dashboard",description:"Real-time metrics for pipeline throughput, latency, and error rates",status:"paused",branch:"feat/monitoring",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T09:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""}],ny=[{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"}],Tj=[{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:""}],kj=[{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\` });`}],jj={"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 Mt(n){return new Date(Date.now()+n).toISOString()}const ay=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Mt(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Mt(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Mt(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:Mt(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:Mt(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Mt(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Mt(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Mt(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Mt(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:Mt(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:Mt(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Mt(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:Mt(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Mt(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Mt(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Mt(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Mt(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:Mt(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:Mt(3500),content:"failed"}}]}],sy=400;function wj({children:n}){const[a,i]=y.useState(yj),[l,c]=y.useState(bj),[d,f]=y.useState(xj),[m,p]=y.useState(void 0),[v,g]=y.useState(Sj),[b,x]=y.useState(_j),[_,T]=y.useState(ny),[C,w]=y.useState(Tj),[k,N]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[A,R]=y.useState(kj),[E]=y.useState(jj),[B,U]=y.useState(""),z=y.useRef(0),K=y.useRef(0),te=y.useRef(new Set),ne=y.useRef(new Map),ie=y.useRef(b);ie.current=b;const le=y.useRef(new Map),q=y.useRef(new Map),ae=y.useCallback(F=>(z.current+=1,`mock-${F}-${String(z.current).padStart(3,"0")}`),[]),O=y.useCallback(()=>{const F=ay[K.current%ay.length];return K.current+=1,F},[]),P=y.useCallback((F,se,me)=>{const Te=setTimeout(()=>{var be;te.current.delete(Te),me&&((be=ne.current.get(me))==null||be.delete(Te)),F()},se);te.current.add(Te),me&&(ne.current.has(me)||ne.current.set(me,new Set),ne.current.get(me).add(Te))},[]),W=y.useCallback(F=>{const se=ne.current.get(F);se&&(se.forEach(me=>{clearTimeout(me),te.current.delete(me)}),ne.current.delete(F))},[]),re=y.useCallback((F,se,me)=>{c(Te=>Te.map(be=>be.id===F?{...be,status:se,...me!==void 0?{endReason:me}:{}}:be))},[]),oe=y.useCallback(F=>{f(se=>[...se,F])},[]),Ne=y.useCallback((F,se,me)=>{se.forEach((Te,be)=>{P(()=>{const nt={sessionId:F,...Te.event,timestamp:new Date().toISOString()};if(oe(nt),Te.event.eventType==="status"){const we=H0(Te.event.content),He=P0(Te.event.content);re(F,we,He)}be===se.length-1&&me&&me()},Te.delayMs,F)})},[P,oe,re]),je=y.useCallback((F,se,me,Te)=>{console.log("[MockGrackle] spawn",{environmentId:F,prompt:se,runtime:Te});const be=ae("sess"),nt={id:be,environmentId:F,runtime:Te||"claude-code",status:"running",prompt:se,startedAt:new Date().toISOString()};c(He=>[...He,nt]),p(be);const we=O();if(console.log(`[MockGrackle] Playing scenario: ${we.label}`),we.pauseForInput){const He=we.pauseAfterStep??we.steps.length-1,Ie=we.steps.slice(0,He+1),Ye=Ie.length>0?Ie[Ie.length-1].delayMs:0;Ne(be,Ie),P(()=>{re(be,"idle"),oe({sessionId:be,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Ye+sy,be),we.resumeSteps&&le.current.set(be,we.resumeSteps)}else Ne(be,we.steps)},[ae,O,Ne,P,re,oe]),Se=y.useCallback(F=>{console.log("[MockGrackle] kill",F),W(F),le.current.delete(F),re(F,"stopped","killed"),oe({sessionId:F,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),x(se=>se.map(me=>me.latestSessionId===F&&me.status==="working"?{...me,status:"not_started"}:me))},[W,re,oe]),Le=y.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),ce=y.useCallback(F=>{console.log("[MockGrackle] loadSessionEvents",F)},[]),ue=y.useCallback(()=>{console.log("[MockGrackle] clearEvents"),f([])},[]),fe=y.useCallback((F,se,me,Te,be,nt,we,He,Ie)=>{console.log("[MockGrackle] createWorkspace",{name:F,description:se});const Ye={id:ae("proj"),name:F,description:se||"",repoUrl:me||"",environmentId:Te||"",status:"active",workingDirectory:we||"",useWorktrees:nt??!0,defaultPersonaId:be||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(Yt=>[...Yt,Ye]),He&&He()},[ae]),tt=y.useCallback(F=>{console.log("[MockGrackle] archiveWorkspace",F),g(se=>se.map(me=>me.id===F?{...me,status:"archived"}:me))},[]),ee=y.useCallback(F=>{console.log("[MockGrackle] loadTasks",F)},[]),X=y.useCallback((F,se,me,Te,be,nt,we,He,Ie)=>{console.log("[MockGrackle] createTask",{workspaceId:F,title:se,parentTaskId:be}),x(Ye=>{const Bt=Ye.filter(bn=>bn.workspaceId===F).reduce((bn,Ln)=>Math.max(bn,Ln.sortOrder),0),zt=be?Ye.find(bn=>bn.id===be):void 0;if(be&&!zt)return console.warn("[MockGrackle] Parent task not found:",be),Ye;if(zt&&!zt.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",be),Ye;const vt=zt?zt.depth+1:0,Aa={id:ae("task"),workspaceId:F,title:se,description:me||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:Te||[],reviewNotes:void 0,sortOrder:Bt+1,createdAt:new Date().toISOString(),parentTaskId:be||"",depth:vt,childTaskIds:[],canDecompose:we??!be,defaultPersonaId:nt||"",workpad:""};return[...Ye,Aa]}),He&&He()},[ae]),At=y.useCallback((F,se,me,Te)=>{var Ye;console.log("[MockGrackle] startTask",{taskId:F});const be=ie.current.find(Yt=>Yt.id===F),nt=(be==null?void 0:be.title)??"",we=ae("sess"),He={id:we,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:nt||F,startedAt:new Date().toISOString()};c(Yt=>[...Yt,He]),x(Yt=>Yt.map(Bt=>Bt.id===F?{...Bt,status:"working",latestSessionId:we,branch:`mock/${F.slice(0,8)}`}:Bt));const Ie=O();if(console.log(`[MockGrackle] Playing task scenario: ${Ie.label}`),Ie.pauseForInput){const Yt=Ie.pauseAfterStep??Ie.steps.length-1,Bt=Ie.steps.slice(0,Yt+1),zt=Bt.length>0?Bt[Bt.length-1].delayMs:0;if(Ne(we,Bt),P(()=>{re(we,"idle"),oe({sessionId:we,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},zt+sy,we),Ie.resumeSteps){const vt=[...Ie.resumeSteps];le.current.set(we,vt);const Aa=vt.reduce((bn,Ln)=>Math.max(bn,Ln.delayMs),0);q.current.set(we,{taskId:F,delayAfterResume:Aa+200})}}else{const Yt=Ie.steps.length>0?Ie.steps[Ie.steps.length-1].delayMs:0;Ne(we,Ie.steps);const Bt=(Ye=Ie.steps[Ie.steps.length-1])==null?void 0:Ye.event.content;P(()=>{Bt==="completed"?x(zt=>zt.map(vt=>vt.id===F&&vt.status==="working"?{...vt,status:"paused"}:vt)):Bt==="failed"&&x(zt=>zt.map(vt=>vt.id===F&&vt.status==="working"?{...vt,status:"failed"}:vt))},Yt+100,we)}},[ae,O,Ne,P,re,oe]),pt=y.useCallback((F,se)=>{console.log("[MockGrackle] sendInput",{sessionId:F,text:se}),oe({sessionId:F,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${se}`}),re(F,"running"),oe({sessionId:F,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const me=le.current.get(F);if(me)le.current.delete(F),Ne(F,me);else{const be=[{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"}}];Ne(F,be)}const Te=q.current.get(F);Te&&(q.current.delete(F),P(()=>{x(be=>be.map(nt=>nt.id===Te.taskId&&nt.status==="working"?{...nt,status:"paused"}:nt))},Te.delayAfterResume,F))},[oe,re,Ne,P]),yn=y.useCallback(F=>{console.log("[MockGrackle] completeTask",F),x(se=>se.map(me=>me.id===F?{...me,status:"complete"}:me))},[]),Ke=y.useCallback(F=>{console.log("[MockGrackle] resumeTask",F)},[]),Pn=y.useCallback((F,se,me,Te,be)=>{console.log("[MockGrackle] updateTask",{taskId:F,title:se}),x(nt=>nt.map(we=>we.id===F?{...we,title:se.trim()||we.title,description:me,dependsOn:Te,...be!==void 0?{defaultPersonaId:be}:{}}:we))},[]),Gn=y.useCallback(F=>{console.log("[MockGrackle] deleteTask",F),x(se=>se.filter(me=>me.id!==F))},[]),Bn=y.useCallback(F=>{console.log("[MockGrackle] loadFindings",F),T(ny.filter(se=>se.workspaceId===F))},[]),Na=y.useCallback((F,se,me,Te,be)=>{console.log("[MockGrackle] postFinding",{workspaceId:F,title:se});const nt={id:ae("find"),workspaceId:F,taskId:"",sessionId:"",category:Te||"general",title:se,content:me,tags:be||[],createdAt:new Date().toISOString()};T(we=>[...we,nt])},[ae]),$n=y.useCallback(()=>{console.log("[MockGrackle] loadEnvironments")},[]),Ea=y.useCallback((F,se,me)=>{console.log("[MockGrackle] addEnvironment",{displayName:F,adapterType:se,adapterConfig:me})},[]),ln=y.useCallback((F,se)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:F,...se}),i(me=>me.map(Te=>Te.id!==F?Te:{...Te,...se.displayName!==void 0?{displayName:se.displayName}:{},...se.adapterConfig!==void 0?{adapterConfig:JSON.stringify(se.adapterConfig)}:{}}))},[]),Ee=y.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),Dt=y.useCallback((F,se,me,Te,be)=>{console.log("[MockGrackle] setToken",{name:F,tokenType:me}),w(nt=>[...nt.filter(He=>He.name!==F),{name:F,tokenType:me,envVar:Te,filePath:be,expiresAt:""}])},[]),Kt=y.useCallback(F=>{console.log("[MockGrackle] deleteToken",F),w(se=>se.filter(me=>me.name!==F))},[]),Sl=y.useCallback(F=>{console.log("[MockGrackle] updateCredentialProviders",F),N(F)},[]);y.useEffect(()=>()=>{te.current.forEach(clearTimeout),te.current.clear()},[]);const _l=y.useMemo(()=>({connected:!0,send:()=>{},environments:a,sessions:l,events:d,eventsDropped:0,lastSpawnedId:m,workspaces:v,tasks:b,findings:_,tokens:C,credentialProviders:k,spawn:je,sendInput:pt,kill:Se,refresh:Le,loadSessionEvents:ce,clearEvents:ue,loadWorkspaces:()=>{console.log("[MockGrackle] loadWorkspaces")},createWorkspace:fe,archiveWorkspace:tt,updateWorkspace:(F,se)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:F,...se}),g(me=>me.map(Te=>Te.id!==F?Te:{...Te,...se.name!==void 0?{name:se.name}:{},...se.description!==void 0?{description:se.description}:{},...se.repoUrl!==void 0?{repoUrl:se.repoUrl}:{},...se.environmentId!==void 0?{environmentId:se.environmentId}:{},...se.workingDirectory!==void 0?{workingDirectory:se.workingDirectory}:{},...se.useWorktrees!==void 0?{useWorktrees:se.useWorktrees}:{},...se.defaultPersonaId!==void 0?{defaultPersonaId:se.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:ee,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:X,startTask:At,stopTask:F=>{console.log("[MockGrackle] stopTask",{taskId:F}),yn(F)},completeTask:yn,resumeTask:Ke,updateTask:Pn,deleteTask:Gn,loadFindings:Bn,postFinding:Na,loadEnvironments:$n,addEnvironment:Ea,updateEnvironment:ln,loadTokens:Ee,setToken:Dt,deleteToken:Kt,updateCredentialProviders:Sl,provisionStatus:{},provisionEnvironment:(F,se)=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:A,createPersona:async(F,se,me,Te,be,nt,we,He)=>{console.log("[MockGrackle] createPersona",{name:F});const Ie={id:`mock-persona-${Date.now()}`,name:F,description:se,systemPrompt:me,toolConfig:"{}",runtime:Te??"claude-code",model:be||"",maxTurns:nt||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:we||"agent",script:He||""};return R(Ye=>[...Ye,Ie]),Ie},updatePersona:async(F,se,me,Te,be,nt,we,He,Ie)=>{console.log("[MockGrackle] updatePersona",{personaId:F,name:se});const Ye=A.find(zt=>zt.id===F);if(!Ye)throw new Error(`Persona not found: ${F}`);const Yt=new Date().toISOString(),Bt={...Ye,...se!==void 0?{name:se}:{},...me!==void 0?{description:me}:{},...Te!==void 0?{systemPrompt:Te}:{},...be!==void 0?{runtime:be}:{},...nt!==void 0?{model:nt}:{},...we!==void 0?{maxTurns:we}:{},...He!==void 0?{type:He}:{},...Ie!==void 0?{script:Ie}:{},updatedAt:Yt};return R(zt=>zt.map(vt=>vt.id===F?Bt:vt)),Bt},deletePersona:async F=>{console.log("[MockGrackle] deletePersona",F),R(se=>se.filter(me=>me.id!==F))},taskSessions:E,loadTaskSessions:F=>{console.log("[MockGrackle] loadTaskSessions",F)},appDefaultPersonaId:B,setAppDefaultPersonaId:async F=>{console.log("[MockGrackle] setAppDefaultPersonaId",F),U(F)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")},usageCache:{"workspace:proj-alpha":{inputTokens:214500,outputTokens:44850,costUsd:1.12,sessionCount:4},"workspace:proj-beta":{inputTokens:86700,outputTokens:23800,costUsd:.48,sessionCount:3},"task:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1},"task_tree:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task_tree:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1}},loadUsage:(F,se)=>{console.log(`[MockGrackle] loadUsage(${F}, ${se})`)},knowledge:{graphData:{nodes:[],links:[]},selectedNode:void 0,loading:!1,selectedId:void 0,searchQuery:"",search:()=>{},clearSearch:()=>{},selectNode:()=>{},clearSelection:()=>{},expandNode:()=>{},loadRecent:()=>{},handleEvent:()=>!1}}),[a,l,d,m,v,b,_,C,k,A,E,B,je,pt,Se,Le,ce,ue,fe,tt,ee,X,At,yn,Ke,Pn,Gn,Bn,Na,$n,Ea,ln,Ee,Dt,Kt,Sl]);return r.jsx(Jf.Provider,{value:_l,children:n})}const fb=y.createContext(void 0),Cj=4e3;function Nj({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=Cj)=>{const v=`toast-${++l.current}`;i(g=>[...g,{id:v,message:f,variant:m,duration:p}])},[]);return r.jsx(fb.Provider,{value:{toasts:a,showToast:d,dismissToast:c},children:n})}function Ca(){const n=y.useContext(fb);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const yc=[{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"]}],hb=new Set(yc.map(n=>n.id)),iy="grackle";function bf(n){return yc.find(a=>a.id===n)}const xf="grackle-theme",mb="grackle-prefer-system",pb="(prefers-color-scheme: dark)";let Zo=[],Qr;function Fd(){Qr=void 0;for(const n of Zo)n()}function Sf(){return typeof window>"u"?!1:window.matchMedia(pb).matches}function tl(){if(typeof localStorage>"u")return iy;try{const n=localStorage.getItem(xf);if(n!==null&&hb.has(n))return n}catch{}return iy}function ac(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(mb)==="true"}catch{return!1}}function _f(n){return yc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function vb(n,a){const i=bf(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?Sf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const l=_f(n);if(l!=null&&l.variantLightId&&l.variantDarkId)return Sf()?l.variantDarkId:l.variantLightId}return n}function Di(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=vb(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Di(tl(),ac());function Ej(){return Qr===void 0&&(Qr={themeId:tl(),systemDark:Sf(),preferSystem:ac()}),Qr}function Aj(n){return Zo=[...Zo,n],()=>{Zo=Zo.filter(a=>a!==n)}}function Dj(){const n=y.useSyncExternalStore(Aj,Ej),{themeId:a,preferSystem:i}=n,l=vb(a,i),c=y.useCallback(f=>{if(hb.has(f)){try{localStorage.setItem(xf,f)}catch{}Di(f,ac(),!0),Fd()}},[]),d=y.useCallback(f=>{try{localStorage.setItem(mb,f?"true":"false")}catch{}if(f){const m=tl(),p=bf(m);if(p!=null&&p.hidden){const v=_f(m);if(v)try{localStorage.setItem(xf,v.id)}catch{}}}Di(tl(),f,!0),Fd()},[]);return y.useEffect(()=>{Di(a,i)},[a,i]),y.useEffect(()=>{if(typeof window>"u")return;const f=window.matchMedia(pb),m=()=>{const p=tl(),v=ac();if(v){const g=bf(p);if(g!=null&&g.variantDarkId&&g.variantLightId&&Di(p,v),g!=null&&g.hidden){const b=_f(p);b!=null&&b.variantDarkId&&b.variantLightId&&Di(p,v)}}Fd()};return f.addEventListener("change",m),()=>{f.removeEventListener("change",m)}},[]),{themeId:a,setTheme:c,resolvedThemeId:l,preferSystem:i,setPreferSystem:d}}const gb=y.createContext(void 0);function Rj({children:n}){const a=Dj();return r.jsx(gb.Provider,{value:a,children:n})}function yb(){const n=y.useContext(gb);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const Mj="_container_1mq5u_1",Oj="_hamburger_1mq5u_33",Bj="_brand_1mq5u_49",Lj="_brandLogo_1mq5u_68",Ij="_info_1mq5u_75",zj="_connectionLabel_1mq5u_90",Uj="_connectionDot_1mq5u_103",Vj="_connected_1mq5u_106",Hj="_disconnected_1mq5u_110",ba={container:Mj,hamburger:Oj,brand:Bj,brandLogo:Lj,info:Ij,connectionLabel:zj,connectionDot:Uj,connected:Vj,disconnected:Hj};function Pj({connected:n,environments:a,sessions:i,onToggleSidebar:l,sidebarOpen:c}){const d=xt(),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:ba.container,children:[l&&r.jsx("button",{type:"button",className:ba.hamburger,onClick:l,"aria-label":"Toggle sidebar","aria-expanded":c,children:"☰"}),r.jsxs("button",{type:"button",className:ba.brand,onClick:()=>d(zs),title:"Home",children:[r.jsx("img",{src:"/icon-192x192.png",alt:"",className:ba.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),r.jsxs("div",{className:ba.info,children:[r.jsxs("span",{"aria-label":n?"Connected":"Disconnected",children:[r.jsx("span",{className:`${ba.connectionDot} ${n?ba.connected:ba.disconnected}`,"aria-hidden":"true",children:"●"})," ",r.jsx("span",{className:ba.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 Gj="_nav_13gkc_1",$j="_tab_13gkc_35",qj="_tabIcon_13gkc_68",Kj="_tabLabel_13gkc_79",Yj="_tabActive_13gkc_84",qo={nav:Gj,tab:$j,tabIcon:qj,tabLabel:Kj,tabActive:Yj},Ns=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:zs,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:qk,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:Kk,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:Vi,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:"🧠",route:db,testId:"sidebar-tab-knowledge"},{view:"settings",label:"Settings",icon:"⚙️",route:Hk,testId:"sidebar-tab-settings"}];function Fj(n){return n===zs||n==="/"?"dashboard":n.startsWith("/chat")||n.startsWith("/sessions")?"chat":n.startsWith("/workspaces")||n.startsWith("/environments")?"environments":n.startsWith(db)?"knowledge":n.startsWith(zi)?"settings":"tasks"}function Zj(){const n=Ot(),a=xt(),i=y.useRef(null),l=Fj(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(_=>_===document.activeElement),v=p>=0?p:Ns.findIndex(_=>_.view===l);let g=v;if(f.key==="ArrowRight"||f.key==="j"||f.key==="J")f.preventDefault(),g=(v+1)%Ns.length;else if(f.key==="ArrowLeft"||f.key==="k"||f.key==="K")f.preventDefault(),g=(v-1+Ns.length)%Ns.length;else if(f.key==="Home")f.preventDefault(),g=0;else if(f.key==="End")f.preventDefault(),g=Ns.length-1;else return;a(Ns[g].route),(x=m[g])==null||x.focus()},[l,a]);return r.jsx("nav",{className:qo.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:d,"data-testid":"sidebar-nav",children:Ns.map(f=>{const m=f.view===l;return r.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${qo.tab} ${m?qo.tabActive:""}`,onClick:()=>c(f),"data-testid":f.testId,title:f.label,"aria-label":f.label,children:[r.jsx("span",{className:qo.tabIcon,"aria-hidden":"true",children:f.icon}),r.jsx("span",{className:qo.tabLabel,children:f.label})]},f.view)})})}const bb=y.createContext(void 0),xb=y.createContext(void 0);function Xj({children:n}){const[a,i]=y.useState(void 0),l=y.useCallback(c=>{i(c)},[]);return r.jsx(xb.Provider,{value:l,children:r.jsx(bb.Provider,{value:a,children:n})})}function Sb(){return y.useContext(bb)}function Qj(){const n=y.useContext(xb);if(n===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return n}const Wj="_container_pi6ii_1",Jj="_content_pi6ii_66",oy={container:Wj,content:Jj},ew=320,_b=220,Tb=600,kb="grackle-sidebar-width";function tw(){try{const n=localStorage.getItem(kb);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=_b&&a<=Tb)return a}}catch{}return ew}function nw(n){try{localStorage.setItem(kb,String(n))}catch{}}function aw(){const[n]=y.useState(tw),a=y.useRef(null),i=Sb();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>=_b&&p<=Tb&&nw(p)}}});return c.observe(l),()=>{c.disconnect()}},[]),i!==void 0)return r.jsx("div",{className:oy.container,ref:a,"data-testid":"sidebar",style:{width:n},children:r.jsx("div",{className:oy.content,children:i})})}function bc(n){const a=Qj();y.useLayoutEffect(()=>(a(n),()=>{a(void 0)}),[n,a])}const eh=y.createContext({});function th(n){const a=y.useRef(null);return a.current===null&&(a.current=n()),a.current}const xc=y.createContext(null),nh=y.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class sw 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 iw({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(nh);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(sw,{isPresent:a,childRef:l,sizeRef:c,children:y.cloneElement(n,{ref:l})})}const ow=({children:n,initial:a,isPresent:i,onExitComplete:l,custom:c,presenceAffectsLayout:d,mode:f})=>{const m=th(lw),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(iw,{isPresent:i,children:n})),r.jsx(xc.Provider,{value:g,children:n})};function lw(){return new Map}function jb(n=!0){const a=y.useContext(xc);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 Hr=n=>n.key||"";function ly(n){const a=[];return y.Children.forEach(n,i=>{y.isValidElement(i)&&a.push(i)}),a}const ah=typeof window<"u",wb=ah?y.useLayoutEffect:y.useEffect,ea=({children:n,custom:a,initial:i=!0,onExitComplete:l,presenceAffectsLayout:c=!0,mode:d="sync",propagate:f=!1})=>{const[m,p]=jb(f),v=y.useMemo(()=>ly(n),[n]),g=f&&!m?[]:v.map(Hr),b=y.useRef(!0),x=y.useRef(v),_=th(()=>new Map),[T,C]=y.useState(v),[w,k]=y.useState(v);wb(()=>{b.current=!1,x.current=v;for(let R=0;R<w.length;R++){const E=Hr(w[R]);g.includes(E)?_.delete(E):_.get(E)!==!0&&_.set(E,!1)}},[w,g.length,g.join("-")]);const N=[];if(v!==T){let R=[...v];for(let E=0;E<w.length;E++){const B=w[E],U=Hr(B);g.includes(U)||(R.splice(E,0,B),N.push(B))}d==="wait"&&N.length&&(R=N),k(ly(R)),C(v);return}const{forceRender:A}=y.useContext(eh);return r.jsx(r.Fragment,{children:w.map(R=>{const E=Hr(R),B=f&&!m?!1:v===w||g.includes(E),U=()=>{if(_.has(E))_.set(E,!0);else return;let z=!0;_.forEach(K=>{K||(z=!1)}),z&&(A==null||A(),k(x.current),f&&(p==null||p()),l&&l())};return r.jsx(ow,{isPresent:B,initial:!b.current||i?void 0:!1,custom:B?void 0:a,presenceAffectsLayout:c,mode:d,onExitComplete:B?void 0:U,children:R},E)})})},pn=n=>n;let Cb=pn;const rw={useManualTiming:!1};function cw(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 _=b&&l?a:i;return g&&d.add(v),_.has(v)||_.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 Pr=["read","resolveKeyframes","update","preRender","render","postRender"],uw=40;function Nb(n,a){let i=!1,l=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=()=>i=!0,f=Pr.reduce((k,N)=>(k[N]=cw(d),k),{}),{read:m,resolveKeyframes:p,update:v,preRender:g,render:b,postRender:x}=f,_=()=>{const k=performance.now();i=!1,c.delta=l?1e3/60:Math.max(Math.min(k-c.timestamp,uw),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(_))},T=()=>{i=!0,l=!0,c.isProcessing||n(_)};return{schedule:Pr.reduce((k,N)=>{const A=f[N];return k[N]=(R,E=!1,B=!1)=>(i||T(),A.schedule(R,E,B)),k},{}),cancel:k=>{for(let N=0;N<Pr.length;N++)f[Pr[N]].cancel(k)},state:c,steps:f}}const{schedule:ct,cancel:is,state:$t,steps:Zd}=Nb(typeof requestAnimationFrame<"u"?requestAnimationFrame:pn,!0),Eb=y.createContext({strict:!1}),ry={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"]},Pi={};for(const n in ry)Pi[n]={isEnabled:a=>ry[n].some(i=>!!a[i])};function dw(n){for(const a in n)Pi[a]={...Pi[a],...n[a]}}const fw=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 sc(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||fw.has(n)}let Ab=n=>!sc(n);function hw(n){n&&(Ab=a=>a.startsWith("on")?!sc(a):n(a))}try{hw(require("@emotion/is-prop-valid").default)}catch{}function mw(n,a,i){const l={};for(const c in n)c==="values"&&typeof n.values=="object"||(Ab(c)||i===!0&&sc(c)||!a&&!sc(c)||n.draggable&&c.startsWith("onDrag"))&&(l[c]=n[c]);return l}function pw(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 Sc=y.createContext({});function cl(n){return typeof n=="string"||Array.isArray(n)}function _c(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const sh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ih=["initial",...sh];function Tc(n){return _c(n.animate)||ih.some(a=>cl(n[a]))}function Db(n){return!!(Tc(n)||n.variants)}function vw(n,a){if(Tc(n)){const{initial:i,animate:l}=n;return{initial:i===!1||cl(i)?i:void 0,animate:cl(l)?l:void 0}}return n.inherit!==!1?a:{}}function gw(n){const{initial:a,animate:i}=vw(n,y.useContext(Sc));return y.useMemo(()=>({initial:a,animate:i}),[cy(a),cy(i)])}function cy(n){return Array.isArray(n)?n.join(" "):n}const yw=Symbol.for("motionComponentSymbol");function Ri(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function bw(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):Ri(i)&&(i.current=l))},[a])}const oh=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),xw="framerAppearId",Rb="data-"+oh(xw),{schedule:lh}=Nb(queueMicrotask,!1),Mb=y.createContext({});function Sw(n,a,i,l,c){var d,f;const{visualElement:m}=y.useContext(Sc),p=y.useContext(Eb),v=y.useContext(xc),g=y.useContext(nh).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,_=y.useContext(Mb);x&&!x.projection&&c&&(x.type==="html"||x.type==="svg")&&_w(b.current,i,c,_);const T=y.useRef(!1);y.useInsertionEffect(()=>{x&&T.current&&x.update(i,v)});const C=i[Rb],w=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 wb(()=>{x&&(T.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),lh.render(x.render),w.current&&x.animationState&&x.animationState.animateChanges())}),y.useEffect(()=>{x&&(!w.current&&x.animationState&&x.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)===null||k===void 0||k.call(window,C)}),w.current=!1))}),x}function _w(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:Ob(n.parent)),n.projection.setOptions({layoutId:c,layout:d,alwaysMeasureLayout:!!f||m&&Ri(m),visualElement:n,animationType:typeof d=="string"?d:"both",initialPromotionConfig:l,layoutScroll:p,layoutRoot:v})}function Ob(n){if(n)return n.options.allowProjection!==!1?n.projection:Ob(n.parent)}function Tw({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:l,Component:c}){var d,f;n&&dw(n);function m(v,g){let b;const x={...y.useContext(nh),...v,layoutId:kw(v)},{isStatic:_}=x,T=gw(v),C=l(v,_);if(!_&&ah){jw();const w=ww(x);b=w.MeasureLayout,T.visualElement=Sw(c,C,x,a,w.ProjectionNode)}return r.jsxs(Sc.Provider,{value:T,children:[b&&T.visualElement?r.jsx(b,{visualElement:T.visualElement,...x}):null,i(c,v,bw(C,T.visualElement,g),C,_,T.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[yw]=c,p}function kw({layoutId:n}){const a=y.useContext(eh).id;return a&&n!==void 0?a+"-"+n:n}function jw(n,a){y.useContext(Eb).strict}function ww(n){const{drag:a,layout:i}=Pi;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 Cw=["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 rh(n){return typeof n!="string"||n.includes("-")?!1:!!(Cw.indexOf(n)>-1||/[A-Z]/u.test(n))}function uy(n){const a=[{},{}];return n==null||n.values.forEach((i,l)=>{a[0][l]=i.get(),a[1][l]=i.getVelocity()}),a}function ch(n,a,i,l){if(typeof a=="function"){const[c,d]=uy(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]=uy(l);a=a(i!==void 0?i:n.custom,c,d)}return a}const Tf=n=>Array.isArray(n),Nw=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),Ew=n=>Tf(n)?n[n.length-1]||0:n,Zt=n=>!!(n&&n.getVelocity);function Wr(n){const a=Zt(n)?n.get():n;return Nw(a)?a.toValue():a}function Aw({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},l,c,d){const f={latestValues:Dw(l,c,d,n),renderState:a()};return i&&(f.onMount=m=>i({props:l,current:m,...f}),f.onUpdate=m=>i(m)),f}const Bb=n=>(a,i)=>{const l=y.useContext(Sc),c=y.useContext(xc),d=()=>Aw(n,a,l,c);return i?d():th(d)};function Dw(n,a,i,l){const c={},d=l(n,{});for(const x in d)c[x]=Wr(d[x]);let{initial:f,animate:m}=n;const p=Tc(n),v=Db(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"&&!_c(b)){const x=Array.isArray(b)?b:[b];for(let _=0;_<x.length;_++){const T=ch(n,x[_]);if(T){const{transitionEnd:C,transition:w,...k}=T;for(const N in k){let A=k[N];if(Array.isArray(A)){const R=g?A.length-1:0;A=A[R]}A!==null&&(c[N]=A)}for(const N in C)c[N]=C[N]}}}return c}const Fi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$s=new Set(Fi),Lb=n=>a=>typeof a=="string"&&a.startsWith(n),Ib=Lb("--"),Rw=Lb("var(--"),uh=n=>Rw(n)?Mw.test(n.split("/*")[0].trim()):!1,Mw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,zb=(n,a)=>a&&typeof n=="number"?a.transform(n):n,wa=(n,a,i)=>i>a?a:i<n?n:i,Zi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},ul={...Zi,transform:n=>wa(0,1,n)},Gr={...Zi,default:1},gl=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),ss=gl("deg"),Qn=gl("%"),xe=gl("px"),Ow=gl("vh"),Bw=gl("vw"),dy={...Qn,parse:n=>Qn.parse(n)/100,transform:n=>Qn.transform(n*100)},Lw={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,backgroundPositionX:xe,backgroundPositionY:xe},Iw={rotate:ss,rotateX:ss,rotateY:ss,rotateZ:ss,scale:Gr,scaleX:Gr,scaleY:Gr,scaleZ:Gr,skew:ss,skewX:ss,skewY:ss,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:ul,originX:dy,originY:dy,originZ:xe},fy={...Zi,transform:Math.round},dh={...Lw,...Iw,zIndex:fy,size:xe,fillOpacity:ul,strokeOpacity:ul,numOctaves:fy},zw={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Uw=Fi.length;function Vw(n,a,i){let l="",c=!0;for(let d=0;d<Uw;d++){const f=Fi[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=zb(m,dh[f]);if(!p){c=!1;const g=zw[f]||f;l+=`${g}(${v}) `}i&&(a[f]=v)}}return l=l.trim(),i?l=i(a,c?"":l):c&&(l="none"),l}function fh(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($s.has(p)){f=!0;continue}else if(Ib(p)){c[p]=v;continue}else{const g=zb(v,dh[p]);p.startsWith("origin")?(m=!0,d[p]=g):l[p]=g}}if(a.transform||(f||i?l.transform=Vw(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 Hw={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pw={offset:"strokeDashoffset",array:"strokeDasharray"};function Gw(n,a,i=1,l=0,c=!0){n.pathLength=1;const d=c?Hw:Pw;n[d.offset]=xe.transform(-l);const f=xe.transform(a),m=xe.transform(i);n[d.array]=`${f} ${m}`}function hy(n,a,i){return typeof n=="string"?n:xe.transform(a+i*n)}function $w(n,a,i){const l=hy(a,n.x,n.width),c=hy(i,n.y,n.height);return`${l} ${c}`}function hh(n,{attrX:a,attrY:i,attrScale:l,originX:c,originY:d,pathLength:f,pathSpacing:m=1,pathOffset:p=0,...v},g,b){if(fh(n,v,b),g){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:x,style:_,dimensions:T}=n;x.transform&&(T&&(_.transform=x.transform),delete x.transform),T&&(c!==void 0||d!==void 0||_.transform)&&(_.transformOrigin=$w(T,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&&Gw(x,f,m,p,!1)}const mh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Ub=()=>({...mh(),attrs:{}}),ph=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Vb(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 Hb=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 Pb(n,a,i,l){Vb(n,a,void 0,l);for(const c in a.attrs)n.setAttribute(Hb.has(c)?c:oh(c),a.attrs[c])}const ic={};function qw(n){Object.assign(ic,n)}function Gb(n,{layout:a,layoutId:i}){return $s.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!ic[n]||n==="opacity")}function vh(n,a,i){var l;const{style:c}=n,d={};for(const f in c)(Zt(c[f])||a.style&&Zt(a.style[f])||Gb(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 $b(n,a,i){const l=vh(n,a,i);for(const c in n)if(Zt(n[c])||Zt(a[c])){const d=Fi.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;l[d]=n[c]}return l}function Kw(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 my=["x","y","width","height","cx","cy","r"],Yw={useVisualState:Bb({scrapeMotionValuesFromProps:$b,createRenderState:Ub,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($s.has(m)){d=!0;break}}if(!d)return;let f=!a;if(a)for(let m=0;m<my.length;m++){const p=my[m];n[p]!==a[p]&&(f=!0)}f&&ct.read(()=>{Kw(i,l),ct.render(()=>{hh(l,c,ph(i.tagName),n.transformTemplate),Pb(i,l)})})}})},Fw={useVisualState:Bb({scrapeMotionValuesFromProps:vh,createRenderState:mh})};function qb(n,a,i){for(const l in a)!Zt(a[l])&&!Gb(l,i)&&(n[l]=a[l])}function Zw({transformTemplate:n},a){return y.useMemo(()=>{const i=mh();return fh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function Xw(n,a){const i=n.style||{},l={};return qb(l,i,n),Object.assign(l,Zw(n,a)),l}function Qw(n,a){const i={},l=Xw(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 Ww(n,a,i,l){const c=y.useMemo(()=>{const d=Ub();return hh(d,a,ph(l),n.transformTemplate),{...d.attrs,style:{...d.style}}},[a]);if(n.style){const d={};qb(d,n.style,n),c.style={...d,...c.style}}return c}function Jw(n=!1){return(i,l,c,{latestValues:d},f)=>{const p=(rh(i)?Ww:Qw)(l,d,f,i),v=mw(l,typeof i=="string",n),g=i!==y.Fragment?{...v,...p,ref:c}:{},{children:b}=l,x=y.useMemo(()=>Zt(b)?b.get():b,[b]);return y.createElement(i,{...g,children:x})}}function eC(n,a){return function(l,{forwardMotionProps:c}={forwardMotionProps:!1}){const f={...rh(l)?Yw:Fw,preloadedFeatures:n,useRender:Jw(c),createVisualElement:a,Component:l};return Tw(f)}}function Kb(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 kc(n,a,i){const l=n.getProps();return ch(l,a,i!==void 0?i:l.custom,n)}function gh(n,a){return n?n[a]||n.default||n:void 0}const Yb=new Set(["width","height","top","left","right","bottom",...Fi]);let Jr;function tC(){Jr=void 0}const Wn={now:()=>(Jr===void 0&&Wn.set($t.isProcessing||rw.useManualTiming?$t.timestamp:performance.now()),Jr),set:n=>{Jr=n,queueMicrotask(tC)}};function yh(n,a){n.indexOf(a)===-1&&n.push(a)}function bh(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class xh{constructor(){this.subscriptions=[]}add(a){return yh(this.subscriptions,a),()=>bh(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 Fb(n,a){return a?n*(1e3/a):0}const py=30,nC=n=>!isNaN(parseFloat(n));class aC{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(l,c=!0)=>{const d=Wn.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=Wn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=nC(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 xh);const l=this.events[a].add(i);return a==="change"?()=>{l(),ct.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=Wn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>py)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,py);return Fb(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 dl(n,a){return new aC(n,a)}function sC(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,dl(i))}function iC(n,a){const i=kc(n,a);let{transitionEnd:l={},transition:c={},...d}=i||{};d={...d,...l};for(const f in d){const m=Ew(d[f]);sC(n,f,m)}}function oC(n){return!!(Zt(n)&&n.add)}function kf(n,a){const i=n.getValue("willChange");if(oC(i))return i.add(a)}function Zb(n){return n.props[Rb]}function Sh(n){let a;return()=>(a===void 0&&(a=n()),a)}const lC=Sh(()=>window.ScrollTimeline!==void 0);class rC{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(lC()&&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 cC extends rC{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const _a=n=>n*1e3,Ta=n=>n/1e3;function _h(n){return typeof n=="function"}function vy(n,a){n.timeline=a,n.onfinish=null}const Th=n=>Array.isArray(n)&&typeof n[0]=="number",uC={linearEasing:void 0};function dC(n,a){const i=Sh(n);return()=>{var l;return(l=uC[a])!==null&&l!==void 0?l:i()}}const oc=dC(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Gi=(n,a,i)=>{const l=a-n;return l===0?1:(i-n)/l},Xb=(n,a,i=10)=>{let l="";const c=Math.max(Math.round(a/i),2);for(let d=0;d<c;d++)l+=n(Gi(0,c-1,d))+", ";return`linear(${l.substring(0,l.length-2)})`};function Qb(n){return!!(typeof n=="function"&&oc()||!n||typeof n=="string"&&(n in jf||oc())||Th(n)||Array.isArray(n)&&n.every(Qb))}const Xo=([n,a,i,l])=>`cubic-bezier(${n}, ${a}, ${i}, ${l})`,jf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xo([0,.65,.55,1]),circOut:Xo([.55,0,1,.45]),backIn:Xo([.31,.01,.66,-.59]),backOut:Xo([.33,1.53,.69,.99])};function Wb(n,a){if(n)return typeof n=="function"&&oc()?Xb(n,a):Th(n)?Xo(n):Array.isArray(n)?n.map(i=>Wb(i,a)||jf.easeOut):jf[n]}const Jb=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,fC=1e-7,hC=12;function mC(n,a,i,l,c){let d,f,m=0;do f=a+(i-a)/2,d=Jb(f,l,c)-n,d>0?i=f:a=f;while(Math.abs(d)>fC&&++m<hC);return f}function yl(n,a,i,l){if(n===a&&i===l)return pn;const c=d=>mC(d,0,1,n,i);return d=>d===0||d===1?d:Jb(c(d),a,l)}const ex=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,tx=n=>a=>1-n(1-a),nx=yl(.33,1.53,.69,.99),kh=tx(nx),ax=ex(kh),sx=n=>(n*=2)<1?.5*kh(n):.5*(2-Math.pow(2,-10*(n-1))),jh=n=>1-Math.sin(Math.acos(n)),ix=tx(jh),ox=ex(jh),lx=n=>/^0[^.\s]+$/u.test(n);function pC(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||lx(n):!0}const nl=n=>Math.round(n*1e5)/1e5,wh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vC(n){return n==null}const gC=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ch=(n,a)=>i=>!!(typeof i=="string"&&gC.test(i)&&i.startsWith(n)||a&&!vC(i)&&Object.prototype.hasOwnProperty.call(i,a)),rx=(n,a,i)=>l=>{if(typeof l!="string")return l;const[c,d,f,m]=l.match(wh);return{[n]:parseFloat(c),[a]:parseFloat(d),[i]:parseFloat(f),alpha:m!==void 0?parseFloat(m):1}},yC=n=>wa(0,255,n),Xd={...Zi,transform:n=>Math.round(yC(n))},Bs={test:Ch("rgb","red"),parse:rx("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:l=1})=>"rgba("+Xd.transform(n)+", "+Xd.transform(a)+", "+Xd.transform(i)+", "+nl(ul.transform(l))+")"};function bC(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 wf={test:Ch("#"),parse:bC,transform:Bs.transform},Mi={test:Ch("hsl","hue"),parse:rx("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:l=1})=>"hsla("+Math.round(n)+", "+Qn.transform(nl(a))+", "+Qn.transform(nl(i))+", "+nl(ul.transform(l))+")"},Ft={test:n=>Bs.test(n)||wf.test(n)||Mi.test(n),parse:n=>Bs.test(n)?Bs.parse(n):Mi.test(n)?Mi.parse(n):wf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Bs.transform(n):Mi.transform(n)},xC=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function SC(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(wh))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(xC))===null||i===void 0?void 0:i.length)||0)>0}const cx="number",ux="color",_C="var",TC="var(",gy="${}",kC=/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 fl(n){const a=n.toString(),i=[],l={color:[],number:[],var:[]},c=[];let d=0;const m=a.replace(kC,p=>(Ft.test(p)?(l.color.push(d),c.push(ux),i.push(Ft.parse(p))):p.startsWith(TC)?(l.var.push(d),c.push(_C),i.push(p)):(l.number.push(d),c.push(cx),i.push(parseFloat(p))),++d,gy)).split(gy);return{values:i,split:m,indexes:l,types:c}}function dx(n){return fl(n).values}function fx(n){const{split:a,types:i}=fl(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===cx?d+=nl(c[f]):m===ux?d+=Ft.transform(c[f]):d+=c[f]}return d}}const jC=n=>typeof n=="number"?0:n;function wC(n){const a=dx(n);return fx(n)(a.map(jC))}const os={test:SC,parse:dx,createTransformer:fx,getAnimatableNone:wC},CC=new Set(["brightness","contrast","saturate","opacity"]);function NC(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[l]=i.match(wh)||[];if(!l)return n;const c=i.replace(l,"");let d=CC.has(a)?1:0;return l!==i&&(d*=100),a+"("+d+c+")"}const EC=/\b([a-z-]*)\(.*?\)/gu,Cf={...os,getAnimatableNone:n=>{const a=n.match(EC);return a?a.map(NC).join(" "):n}},AC={...dh,color:Ft,backgroundColor:Ft,outlineColor:Ft,fill:Ft,stroke:Ft,borderColor:Ft,borderTopColor:Ft,borderRightColor:Ft,borderBottomColor:Ft,borderLeftColor:Ft,filter:Cf,WebkitFilter:Cf},Nh=n=>AC[n];function hx(n,a){let i=Nh(n);return i!==Cf&&(i=os),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const DC=new Set(["auto","none","0"]);function RC(n,a,i){let l=0,c;for(;l<n.length&&!c;){const d=n[l];typeof d=="string"&&!DC.has(d)&&fl(d).values.length&&(c=n[l]),l++}if(c&&i)for(const d of a)n[d]=hx(i,c)}const yy=n=>n===Zi||n===xe,by=(n,a)=>parseFloat(n.split(", ")[a]),xy=(n,a)=>(i,{transform:l})=>{if(l==="none"||!l)return 0;const c=l.match(/^matrix3d\((.+)\)$/u);if(c)return by(c[1],a);{const d=l.match(/^matrix\((.+)\)$/u);return d?by(d[1],n):0}},MC=new Set(["x","y","z"]),OC=Fi.filter(n=>!MC.has(n));function BC(n){const a=[];return OC.forEach(i=>{const l=n.getValue(i);l!==void 0&&(a.push([i,l.get()]),l.set(i.startsWith("scale")?1:0))}),a}const $i={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:xy(4,13),y:xy(5,14)};$i.translateX=$i.x;$i.translateY=$i.y;const Is=new Set;let Nf=!1,Ef=!1;function mx(){if(Ef){const n=Array.from(Is).filter(l=>l.needsMeasurement),a=new Set(n.map(l=>l.element)),i=new Map;a.forEach(l=>{const c=BC(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)})}Ef=!1,Nf=!1,Is.forEach(n=>n.complete()),Is.clear()}function px(){Is.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Ef=!0)})}function LC(){px(),mx()}class Eh{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?(Is.add(this),Nf||(Nf=!0,ct.read(px),ct.resolveKeyframes(mx))):(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),Is.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Is.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const vx=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),IC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zC(n){const a=IC.exec(n);if(!a)return[,];const[,i,l,c]=a;return[`--${i??l}`,c]}function gx(n,a,i=1){const[l,c]=zC(n);if(!l)return;const d=window.getComputedStyle(a).getPropertyValue(l);if(d){const f=d.trim();return vx(f)?parseFloat(f):f}return uh(c)?gx(c,a,i+1):c}const yx=n=>a=>a.test(n),UC={test:n=>n==="auto",parse:n=>n},bx=[Zi,xe,Qn,ss,Bw,Ow,UC],Sy=n=>bx.find(yx(n));class xx extends Eh{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(),uh(v))){const g=gx(v,i.current);g!==void 0&&(a[p]=g),p===a.length-1&&(this.finalKeyframe=v)}}if(this.resolveNoneKeyframes(),!Yb.has(l)||a.length!==2)return;const[c,d]=a,f=Sy(c),m=Sy(d);if(f!==m)if(yy(f)&&yy(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++)pC(a[c])&&l.push(c);l.length&&RC(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=$i[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]=$i[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 _y=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(os.test(n)||n==="0")&&!n.startsWith("url("));function VC(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 HC(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=_y(c,a),m=_y(d,a);return!f||!m?!1:VC(n)||(i==="spring"||_h(i))&&l}const PC=n=>n!==null;function jc(n,{repeat:a,repeatType:i="loop"},l){const c=n.filter(PC),d=a&&i!=="loop"&&a%2===1?0:c.length-1;return!d||l===void 0?c[d]:l}const GC=40;class Sx{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=Wn.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>GC?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&LC(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Wn.now(),this.hasAttemptedResolve=!0;const{name:l,type:c,velocity:d,delay:f,onComplete:m,onUpdate:p,isGenerator:v}=this.options;if(!v&&!HC(a,l,c,d))if(f)this.options.duration=0;else{p&&p(jc(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 Af=2e4;function _x(n){let a=0;const i=50;let l=n.next(a);for(;!l.done&&a<Af;)a+=i,l=n.next(a);return a>=Af?1/0:a}const mt=(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 $C({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 lc(n,a){return i=>i>0?a:n}const Wd=(n,a,i)=>{const l=n*n,c=i*(a*a-l)+l;return c<0?0:Math.sqrt(c)},qC=[wf,Bs,Mi],KC=n=>qC.find(a=>a.test(n));function Ty(n){const a=KC(n);if(!a)return!1;let i=a.parse(n);return a===Mi&&(i=$C(i)),i}const ky=(n,a)=>{const i=Ty(n),l=Ty(a);if(!i||!l)return lc(n,a);const c={...i};return d=>(c.red=Wd(i.red,l.red,d),c.green=Wd(i.green,l.green,d),c.blue=Wd(i.blue,l.blue,d),c.alpha=mt(i.alpha,l.alpha,d),Bs.transform(c))},YC=(n,a)=>i=>a(n(i)),bl=(...n)=>n.reduce(YC),Df=new Set(["none","hidden"]);function FC(n,a){return Df.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function ZC(n,a){return i=>mt(n,a,i)}function Ah(n){return typeof n=="number"?ZC:typeof n=="string"?uh(n)?lc:Ft.test(n)?ky:WC:Array.isArray(n)?Tx:typeof n=="object"?Ft.test(n)?ky:XC:lc}function Tx(n,a){const i=[...n],l=i.length,c=n.map((d,f)=>Ah(d)(d,a[f]));return d=>{for(let f=0;f<l;f++)i[f]=c[f](d);return i}}function XC(n,a){const i={...n,...a},l={};for(const c in i)n[c]!==void 0&&a[c]!==void 0&&(l[c]=Ah(n[c])(n[c],a[c]));return c=>{for(const d in l)i[d]=l[d](c);return i}}function QC(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 WC=(n,a)=>{const i=os.createTransformer(a),l=fl(n),c=fl(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?Df.has(n)&&!c.values.length||Df.has(a)&&!l.values.length?FC(n,a):bl(Tx(QC(l,c),c.values),i):lc(n,a)};function kx(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?mt(n,a,i):Ah(n)(n,a)}const JC=5;function jx(n,a,i){const l=Math.max(a-JC,0);return Fb(i-n(l),a-l)}const bt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Jd=.001;function eN({duration:n=bt.duration,bounce:a=bt.bounce,velocity:i=bt.velocity,mass:l=bt.mass}){let c,d,f=1-a;f=wa(bt.minDamping,bt.maxDamping,f),n=wa(bt.minDuration,bt.maxDuration,Ta(n)),f<1?(c=v=>{const g=v*f,b=g*n,x=g-i,_=Rf(v,f),T=Math.exp(-b);return Jd-x/_*T},d=v=>{const b=v*f*n,x=b*i+i,_=Math.pow(f,2)*Math.pow(v,2)*n,T=Math.exp(-b),C=Rf(Math.pow(v,2),f);return(-c(v)+Jd>0?-1:1)*((x-_)*T)/C}):(c=v=>{const g=Math.exp(-v*n),b=(v-i)*n+1;return-Jd+g*b},d=v=>{const g=Math.exp(-v*n),b=(i-v)*(n*n);return g*b});const m=5/n,p=nN(c,d,m);if(n=_a(n),isNaN(p))return{stiffness:bt.stiffness,damping:bt.damping,duration:n};{const v=Math.pow(p,2)*l;return{stiffness:v,damping:f*2*Math.sqrt(l*v),duration:n}}}const tN=12;function nN(n,a,i){let l=i;for(let c=1;c<tN;c++)l=l-n(l)/a(l);return l}function Rf(n,a){return n*Math.sqrt(1-a*a)}const aN=["duration","bounce"],sN=["stiffness","damping","mass"];function jy(n,a){return a.some(i=>n[i]!==void 0)}function iN(n){let a={velocity:bt.velocity,stiffness:bt.stiffness,damping:bt.damping,mass:bt.mass,isResolvedFromDuration:!1,...n};if(!jy(n,sN)&&jy(n,aN))if(n.visualDuration){const i=n.visualDuration,l=2*Math.PI/(i*1.2),c=l*l,d=2*wa(.05,1,1-(n.bounce||0))*Math.sqrt(c);a={...a,mass:bt.mass,stiffness:c,damping:d}}else{const i=eN(n);a={...a,...i,mass:bt.mass},a.isResolvedFromDuration=!0}return a}function wx(n=bt.visualDuration,a=bt.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:_}=iN({...i,velocity:-Ta(i.velocity||0)}),T=x||0,C=v/(2*Math.sqrt(p*g)),w=f-d,k=Ta(Math.sqrt(p/g)),N=Math.abs(w)<5;l||(l=N?bt.restSpeed.granular:bt.restSpeed.default),c||(c=N?bt.restDelta.granular:bt.restDelta.default);let A;if(C<1){const E=Rf(k,C);A=B=>{const U=Math.exp(-C*k*B);return f-U*((T+C*k*w)/E*Math.sin(E*B)+w*Math.cos(E*B))}}else if(C===1)A=E=>f-Math.exp(-k*E)*(w+(T+k*w)*E);else{const E=k*Math.sqrt(C*C-1);A=B=>{const U=Math.exp(-C*k*B),z=Math.min(E*B,300);return f-U*((T+C*k*w)*Math.sinh(z)+E*w*Math.cosh(z))/E}}const R={calculatedDuration:_&&b||null,next:E=>{const B=A(E);if(_)m.done=E>=b;else{let U=0;C<1&&(U=E===0?_a(T):jx(A,E,B));const z=Math.abs(U)<=l,K=Math.abs(f-B)<=c;m.done=z&&K}return m.value=m.done?f:B,m},toString:()=>{const E=Math.min(_x(R),Af),B=Xb(U=>R.next(E*U).value,E,30);return E+"ms "+B}};return R}function wy({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},_=z=>m!==void 0&&z<m||p!==void 0&&z>p,T=z=>m===void 0?p:p===void 0||Math.abs(m-z)<Math.abs(p-z)?m:p;let C=i*a;const w=b+C,k=f===void 0?w:f(w);k!==w&&(C=k-b);const N=z=>-C*Math.exp(-z/l),A=z=>k+N(z),R=z=>{const K=N(z),te=A(z);x.done=Math.abs(K)<=v,x.value=x.done?k:te};let E,B;const U=z=>{_(x.value)&&(E=z,B=wx({keyframes:[x.value,T(x.value)],velocity:jx(A,z,x.value),damping:c,stiffness:d,restDelta:v,restSpeed:g}))};return U(0),{calculatedDuration:null,next:z=>{let K=!1;return!B&&E===void 0&&(K=!0,R(z),U(z)),E!==void 0&&z>=E?B.next(z-E):(!K&&R(z),x)}}}const oN=yl(.42,0,1,1),lN=yl(0,0,.58,1),Cx=yl(.42,0,.58,1),rN=n=>Array.isArray(n)&&typeof n[0]!="number",cN={linear:pn,easeIn:oN,easeInOut:Cx,easeOut:lN,circIn:jh,circInOut:ox,circOut:ix,backIn:kh,backInOut:ax,backOut:nx,anticipate:sx},Cy=n=>{if(Th(n)){Cb(n.length===4);const[a,i,l,c]=n;return yl(a,i,l,c)}else if(typeof n=="string")return cN[n];return n};function uN(n,a,i){const l=[],c=i||kx,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]||pn:a;m=bl(p,m)}l.push(m)}return l}function dN(n,a,{clamp:i=!0,ease:l,mixer:c}={}){const d=n.length;if(Cb(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=uN(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=Gi(n[b],n[b+1],g);return m[b](x)};return i?g=>v(wa(n[0],n[d-1],g)):v}function fN(n,a){const i=n[n.length-1];for(let l=1;l<=a;l++){const c=Gi(0,a,l);n.push(mt(i,1,c))}}function hN(n){const a=[0];return fN(a,n.length-1),a}function mN(n,a){return n.map(i=>i*a)}function pN(n,a){return n.map(()=>a||Cx).splice(0,n.length-1)}function rc({duration:n=300,keyframes:a,times:i,ease:l="easeInOut"}){const c=rN(l)?l.map(Cy):Cy(l),d={done:!1,value:a[0]},f=mN(i&&i.length===a.length?i:hN(a),n),m=dN(f,a,{ease:Array.isArray(c)?c:pN(a,c)});return{calculatedDuration:n,next:p=>(d.value=m(p),d.done=p>=n,d)}}const vN=n=>{const a=({timestamp:i})=>n(i);return{start:()=>ct.update(a,!0),stop:()=>is(a),now:()=>$t.isProcessing?$t.timestamp:Wn.now()}},gN={decay:wy,inertia:wy,tween:rc,keyframes:rc,spring:wx},yN=n=>n/100;class Dh extends Sx{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)||Eh,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=_h(i)?i:gN[i]||rc;let p,v;m!==rc&&typeof a[0]!="number"&&(p=bl(yN,kx(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=_x(g));const{calculatedDuration:b}=g,x=b+c,_=x*(l+1)-c;return{generator:g,mirroredGenerator:v,mapPercentToKeyframes:p,calculatedDuration:b,resolvedDuration:x,totalDuration:_}}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:z}=this.options;return{done:!0,value:z[z.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:_,repeatType:T,repeatDelay:C,onUpdate:w}=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),N=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(_){const z=Math.min(this.currentTime,g)/b;let K=Math.floor(z),te=z%1;!te&&z>=1&&(te=1),te===1&&K--,K=Math.min(K,_+1),!!(K%2)&&(T==="reverse"?(te=1-te,C&&(te-=C/b)):T==="mirror"&&(R=f)),A=wa(0,1,te)*b}const E=N?{done:!1,value:p[0]}:R.next(A);m&&(E.value=m(E.value));let{done:B}=E;!N&&v!==null&&(B=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const U=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&B);return U&&c!==void 0&&(E.value=jc(p,this.options,c)),w&&w(E.value),U&&this.finish(),E}get duration(){const{resolved:a}=this;return a?Ta(a.calculatedDuration):0}get time(){return Ta(this.currentTime)}set time(a){a=_a(a),this.currentTime=a,this.holdTime!==null||this.speed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.speed)}get speed(){return this.playbackSpeed}set speed(a){const i=this.playbackSpeed!==a;this.playbackSpeed=a,i&&(this.time=Ta(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=vN,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 bN=new Set(["opacity","clipPath","filter","transform"]);function xN(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=Wb(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 SN=Sh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),cc=10,_N=2e4;function TN(n){return _h(n.type)||n.type==="spring"||!Qb(n.ease)}function kN(n,a){const i=new Dh({...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<_N;)l=i.sample(d),c.push(l.value),d+=cc;return{times:void 0,keyframes:c,duration:d-cc,ease:"linear"}}const Nx={anticipate:sx,backInOut:ax,circInOut:ox};function jN(n){return n in Nx}class Ny extends Sx{constructor(a){super(a);const{name:i,motionValue:l,element:c,keyframes:d}=this.options;this.resolver=new xx(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"&&oc()&&jN(d)&&(d=Nx[d]),TN(this.options)){const{onComplete:b,onUpdate:x,motionValue:_,element:T,...C}=this.options,w=kN(a,C);a=w.keyframes,a.length===1&&(a[1]=a[0]),l=w.duration,c=w.times,d=w.ease,f="keyframes"}const g=xN(m.owner.current,p,a,{...this.options,duration:l,times:c,ease:d});return g.startTime=v??this.calcStartTime(),this.pendingTimeline?(vy(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:b}=this.options;m.set(jc(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 Ta(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return Ta(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.currentTime=_a(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:i}=a;return i.playbackRate}set speed(a){const{resolved:i}=this;if(!i)return;const{animation: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 pn;const{animation:l}=i;vy(l,a)}return pn}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,..._}=this.options,T=new Dh({..._,keyframes:l,duration:c,type:d,ease:f,times:m,isGenerator:!0}),C=_a(this.time);v.setWithVelocity(T.sample(C-cc).value,T.sample(C).value,cc)}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 SN()&&l&&bN.has(l)&&!p&&!v&&!c&&d!=="mirror"&&f!==0&&m!=="inertia"}}const wN={type:"spring",stiffness:500,damping:25,restSpeed:10},CN=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),NN={type:"keyframes",duration:.8},EN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},AN=(n,{keyframes:a})=>a.length>2?NN:$s.has(n)?n.startsWith("scale")?CN(a[1]):wN:EN;function DN({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 Rh=(n,a,i,l={},c,d)=>f=>{const m=gh(l,n)||{},p=m.delay||l.delay||0;let{elapsed:v=0}=l;v=v-_a(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};DN(m)||(g={...g,...AN(n,g)}),g.duration&&(g.duration=_a(g.duration)),g.repeatDelay&&(g.repeatDelay=_a(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=jc(g.keyframes,m);if(x!==void 0)return ct.update(()=>{g.onUpdate(x),g.onComplete()}),new cC([])}return!d&&Ny.supports(g)?new Ny(g):new Dh(g)};function RN({protectedKeys:n,needsAnimating:a},i){const l=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,l}function Ex(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),_=p[b];if(_===void 0||g&&RN(g,b))continue;const T={delay:i,...gh(f||{},b)};let C=!1;if(window.MotionHandoffAnimation){const k=Zb(n);if(k){const N=window.MotionHandoffAnimation(k,b,ct);N!==null&&(T.startTime=N,C=!0)}}kf(n,b),x.start(Rh(b,x,_,n.shouldReduceMotion&&Yb.has(b)?{type:!1}:T,n,C));const w=x.animation;w&&v.push(w)}return m&&Promise.all(v).then(()=>{ct.update(()=>{m&&iC(n,m)})}),v}function Mf(n,a,i={}){var l;const c=kc(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(Ex(n,c,i)):()=>Promise.resolve(),m=n.variantChildren&&n.variantChildren.size?(v=0)=>{const{delayChildren:g=0,staggerChildren:b,staggerDirection:x}=d;return MN(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 MN(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(ON).forEach((v,g)=>{v.notify("AnimationStart",a),f.push(Mf(v,a,{...d,delay:i+p(g)}).then(()=>v.notify("AnimationComplete",a)))}),Promise.all(f)}function ON(n,a){return n.sortNodePosition(a)}function BN(n,a,i={}){n.notify("AnimationStart",a);let l;if(Array.isArray(a)){const c=a.map(d=>Mf(n,d,i));l=Promise.all(c)}else if(typeof a=="string")l=Mf(n,a,i);else{const c=typeof a=="function"?kc(n,a,i.custom):a;l=Promise.all(Ex(n,c,i))}return l.then(()=>{n.notify("AnimationComplete",a)})}const LN=ih.length;function Ax(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?Ax(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<LN;i++){const l=ih[i],c=n.props[l];(cl(c)||c===!1)&&(a[l]=c)}return a}const IN=[...sh].reverse(),zN=sh.length;function UN(n){return a=>Promise.all(a.map(({animation:i,options:l})=>BN(n,i,l)))}function VN(n){let a=UN(n),i=Ey(),l=!0;const c=p=>(v,g)=>{var b;const x=kc(n,g,p==="exit"?(b=n.presenceContext)===null||b===void 0?void 0:b.custom:void 0);if(x){const{transition:_,transitionEnd:T,...C}=x;v={...v,...C,...T}}return v};function d(p){a=p(n)}function f(p){const{props:v}=n,g=Ax(n.parent)||{},b=[],x=new Set;let _={},T=1/0;for(let w=0;w<zN;w++){const k=IN[w],N=i[k],A=v[k]!==void 0?v[k]:g[k],R=cl(A),E=k===p?N.isActive:null;E===!1&&(T=w);let B=A===g[k]&&A!==v[k]&&R;if(B&&l&&n.manuallyAnimateOnMount&&(B=!1),N.protectedKeys={..._},!N.isActive&&E===null||!A&&!N.prevProp||_c(A)||typeof A=="boolean")continue;const U=HN(N.prevProp,A);let z=U||k===p&&N.isActive&&!B&&R||w>T&&R,K=!1;const te=Array.isArray(A)?A:[A];let ne=te.reduce(c(k),{});E===!1&&(ne={});const{prevResolvedValues:ie={}}=N,le={...ie,...ne},q=P=>{z=!0,x.has(P)&&(K=!0,x.delete(P)),N.needsAnimating[P]=!0;const W=n.getValue(P);W&&(W.liveStyle=!1)};for(const P in le){const W=ne[P],re=ie[P];if(_.hasOwnProperty(P))continue;let oe=!1;Tf(W)&&Tf(re)?oe=!Kb(W,re):oe=W!==re,oe?W!=null?q(P):x.add(P):W!==void 0&&x.has(P)?q(P):N.protectedKeys[P]=!0}N.prevProp=A,N.prevResolvedValues=ne,N.isActive&&(_={..._,...ne}),l&&n.blockInitialAnimation&&(z=!1),z&&(!(B&&U)||K)&&b.push(...te.map(P=>({animation:P,options:{type:k}})))}if(x.size){const w={};x.forEach(k=>{const N=n.getBaseTarget(k),A=n.getValue(k);A&&(A.liveStyle=!0),w[k]=N??null}),b.push({animation:w})}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 _;return(_=x.animationState)===null||_===void 0?void 0:_.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=Ey(),l=!0}}}function HN(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!Kb(a,n):!1}function Es(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ey(){return{animate:Es(!0),whileInView:Es(),whileHover:Es(),whileTap:Es(),whileDrag:Es(),whileFocus:Es(),exit:Es()}}class cs{constructor(a){this.isMounted=!1,this.node=a}update(){}}class PN extends cs{constructor(a){super(a),a.animationState||(a.animationState=VN(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();_c(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 GN=0;class $N extends cs{constructor(){super(...arguments),this.id=GN++}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 qN={animation:{Feature:PN},exit:{Feature:$N}},Vn={x:!1,y:!1};function Dx(){return Vn.x||Vn.y}function KN(n){return n==="x"||n==="y"?Vn[n]?null:(Vn[n]=!0,()=>{Vn[n]=!1}):Vn.x||Vn.y?null:(Vn.x=Vn.y=!0,()=>{Vn.x=Vn.y=!1})}const Mh=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function hl(n,a,i,l={passive:!0}){return n.addEventListener(a,i,l),()=>n.removeEventListener(a,i)}function xl(n){return{point:{x:n.pageX,y:n.pageY}}}const YN=n=>a=>Mh(a)&&n(a,xl(a));function al(n,a,i,l){return hl(n,a,YN(i),l)}const Ay=(n,a)=>Math.abs(n-a);function FN(n,a){const i=Ay(n.x,a.x),l=Ay(n.y,a.y);return Math.sqrt(i**2+l**2)}class Rx{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=tf(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,_=FN(b.offset,{x:0,y:0})>=3;if(!x&&!_)return;const{point:T}=b,{timestamp:C}=$t;this.history.push({...T,timestamp:C});const{onStart:w,onMove:k}=this.handlers;x||(w&&w(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=ef(x,this.transformPagePoint),ct.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:_,onSessionEnd:T,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=tf(b.type==="pointercancel"?this.lastMoveEventInfo:ef(x,this.transformPagePoint),this.history);this.startEvent&&_&&_(b,w),T&&T(b,w)},!Mh(a))return;this.dragSnapToOrigin=d,this.handlers=i,this.transformPagePoint=l,this.contextWindow=c||window;const f=xl(a),m=ef(f,this.transformPagePoint),{point:p}=m,{timestamp:v}=$t;this.history=[{...p,timestamp:v}];const{onSessionStart:g}=i;g&&g(a,tf(m,this.history)),this.removeListeners=bl(al(this.contextWindow,"pointermove",this.handlePointerMove),al(this.contextWindow,"pointerup",this.handlePointerUp),al(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),is(this.updatePoint)}}function ef(n,a){return a?{point:a(n.point)}:n}function Dy(n,a){return{x:n.x-a.x,y:n.y-a.y}}function tf({point:n},a){return{point:n,delta:Dy(n,Mx(a)),offset:Dy(n,ZN(a)),velocity:XN(a,.1)}}function ZN(n){return n[0]}function Mx(n){return n[n.length-1]}function XN(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,l=null;const c=Mx(n);for(;i>=0&&(l=n[i],!(c.timestamp-l.timestamp>_a(a)));)i--;if(!l)return{x:0,y:0};const d=Ta(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 Ox=1e-4,QN=1-Ox,WN=1+Ox,Bx=.01,JN=0-Bx,eE=0+Bx;function vn(n){return n.max-n.min}function tE(n,a,i){return Math.abs(n-a)<=i}function Ry(n,a,i,l=.5){n.origin=l,n.originPoint=mt(a.min,a.max,n.origin),n.scale=vn(i)/vn(a),n.translate=mt(i.min,i.max,n.origin)-n.originPoint,(n.scale>=QN&&n.scale<=WN||isNaN(n.scale))&&(n.scale=1),(n.translate>=JN&&n.translate<=eE||isNaN(n.translate))&&(n.translate=0)}function sl(n,a,i,l){Ry(n.x,a.x,i.x,l?l.originX:void 0),Ry(n.y,a.y,i.y,l?l.originY:void 0)}function My(n,a,i){n.min=i.min+a.min,n.max=n.min+vn(a)}function nE(n,a,i){My(n.x,a.x,i.x),My(n.y,a.y,i.y)}function Oy(n,a,i){n.min=a.min-i.min,n.max=n.min+vn(a)}function il(n,a,i){Oy(n.x,a.x,i.x),Oy(n.y,a.y,i.y)}function aE(n,{min:a,max:i},l){return a!==void 0&&n<a?n=l?mt(a,n,l.min):Math.max(n,a):i!==void 0&&n>i&&(n=l?mt(i,n,l.max):Math.min(n,i)),n}function By(n,a,i){return{min:a!==void 0?n.min+a:void 0,max:i!==void 0?n.max+i-(n.max-n.min):void 0}}function sE(n,{top:a,left:i,bottom:l,right:c}){return{x:By(n.x,i,c),y:By(n.y,a,l)}}function Ly(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 iE(n,a){return{x:Ly(n.x,a.x),y:Ly(n.y,a.y)}}function oE(n,a){let i=.5;const l=vn(n),c=vn(a);return c>l?i=Gi(a.min,a.max-l,n.min):l>c&&(i=Gi(n.min,n.max-c,a.min)),wa(0,1,i)}function lE(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 Of=.35;function rE(n=Of){return n===!1?n=0:n===!0&&(n=Of),{x:Iy(n,"left","right"),y:Iy(n,"top","bottom")}}function Iy(n,a,i){return{min:zy(n,a),max:zy(n,i)}}function zy(n,a){return typeof n=="number"?n:n[a]||0}const Uy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Oi=()=>({x:Uy(),y:Uy()}),Vy=()=>({min:0,max:0}),Tt=()=>({x:Vy(),y:Vy()});function Rn(n){return[n("x"),n("y")]}function Lx({top:n,left:a,right:i,bottom:l}){return{x:{min:a,max:i},y:{min:n,max:l}}}function cE({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function uE(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 nf(n){return n===void 0||n===1}function Bf({scale:n,scaleX:a,scaleY:i}){return!nf(n)||!nf(a)||!nf(i)}function Ms(n){return Bf(n)||Ix(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Ix(n){return Hy(n.x)||Hy(n.y)}function Hy(n){return n&&n!=="0%"}function uc(n,a,i){const l=n-i,c=a*l;return i+c}function Py(n,a,i,l,c){return c!==void 0&&(n=uc(n,c,l)),uc(n,i,l)+a}function Lf(n,a=0,i=1,l,c){n.min=Py(n.min,a,i,l,c),n.max=Py(n.max,a,i,l,c)}function zx(n,{x:a,y:i}){Lf(n.x,a.translate,a.scale,a.originPoint),Lf(n.y,i.translate,i.scale,i.originPoint)}const Gy=.999999999999,$y=1.0000000000001;function dE(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&&Li(n,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),f&&(a.x*=f.x.scale,a.y*=f.y.scale,zx(n,f)),l&&Ms(d.latestValues)&&Li(n,d.latestValues))}a.x<$y&&a.x>Gy&&(a.x=1),a.y<$y&&a.y>Gy&&(a.y=1)}function Bi(n,a){n.min=n.min+a,n.max=n.max+a}function qy(n,a,i,l,c=.5){const d=mt(n.min,n.max,c);Lf(n,a,i,d,l)}function Li(n,a){qy(n.x,a.x,a.scaleX,a.scale,a.originX),qy(n.y,a.y,a.scaleY,a.scale,a.originY)}function Ux(n,a){return Lx(uE(n.getBoundingClientRect(),a))}function fE(n,a,i){const l=Ux(n,i),{scroll:c}=a;return c&&(Bi(l.x,c.offset.x),Bi(l.y,c.offset.y)),l}const Vx=({current:n})=>n?n.ownerDocument.defaultView:null,hE=new WeakMap;class mE{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Tt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext: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(xl(g).point)},d=(g,b)=>{const{drag:x,dragPropagation:_,onDragStart:T}=this.getProps();if(x&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=KN(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),Rn(w=>{let k=this.getAxisMotionValue(w).get()||0;if(Qn.test(k)){const{projection:N}=this.visualElement;if(N&&N.layout){const A=N.layout.layoutBox[w];A&&(k=vn(A)*(parseFloat(k)/100))}}this.originPoint[w]=k}),T&&ct.postRender(()=>T(g,b)),kf(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},f=(g,b)=>{const{dragPropagation:x,dragDirectionLock:_,onDirectionLock:T,onDrag:C}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:w}=b;if(_&&this.currentDirection===null){this.currentDirection=pE(w),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",b.point,w),this.updateAxis("y",b.point,w),this.visualElement.render(),C&&C(g,b)},m=(g,b)=>this.stop(g,b),p=()=>Rn(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 Rx(a,{onSessionStart:c,onStart:d,onMove:f,onSessionEnd:m,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:v,contextWindow:Vx(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&&ct.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||!$r(a,c,this.currentDirection))return;const d=this.getAxisMotionValue(a);let f=this.originPoint[a]+l[a];this.constraints&&this.constraints[a]&&(f=aE(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&&Ri(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&c?this.constraints=sE(c.layoutBox,i):this.constraints=!1,this.elastic=rE(l),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&Rn(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=lE(c.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Ri(a))return!1;const l=a.current,{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=fE(l,c.root,this.visualElement.getTransformPagePoint());let f=iE(c.layout.layoutBox,d);if(i){const m=i(cE(f));this.hasMutatedConstraints=!!m,m&&(f=Lx(m))}return f}startAnimation(a){const{drag:i,dragMomentum:l,dragElastic:c,dragTransition:d,dragSnapToOrigin:f,onDragTransitionEnd:m}=this.getProps(),p=this.constraints||{},v=Rn(g=>{if(!$r(g,i,this.currentDirection))return;let b=p&&p[g]||{};f&&(b={min:0,max:0});const x=c?200:1e6,_=c?40:1e7,T={type:"inertia",velocity:l?a[g]:0,bounceStiffness:x,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...d,...b};return this.startAxisValueAnimation(g,T)});return Promise.all(v).then(m)}startAxisValueAnimation(a,i){const l=this.getAxisMotionValue(a);return kf(this.visualElement,a),l.start(Rh(a,l,0,i,this.visualElement,!1))}stopAnimation(){Rn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){Rn(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){Rn(i=>{const{drag:l}=this.getProps();if(!$r(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]-mt(f,m,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:l}=this.visualElement;if(!Ri(i)||!l||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};Rn(f=>{const m=this.getAxisMotionValue(f);if(m&&this.constraints!==!1){const p=m.get();c[f]=oE({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(),Rn(f=>{if(!$r(f,a,null))return;const m=this.getAxisMotionValue(f),{min:p,max:v}=this.constraints[f];m.set(mt(p,v,c[f]))})}addListeners(){if(!this.visualElement.current)return;hE.set(this.visualElement,this);const a=this.visualElement.current,i=al(a,"pointerdown",p=>{const{drag:v,dragListener:g=!0}=this.getProps();v&&g&&this.start(p)}),l=()=>{const{dragConstraints:p}=this.getProps();Ri(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()),ct.read(l);const f=hl(window,"resize",()=>this.scalePositionWithinConstraints()),m=c.addEventListener("didUpdate",(({delta:p,hasLayoutChanged:v})=>{this.isDragging&&v&&(Rn(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=Of,dragMomentum:m=!0}=a;return{...a,drag:i,dragDirectionLock:l,dragPropagation:c,dragConstraints:d,dragElastic:f,dragMomentum:m}}}function $r(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function pE(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class vE extends cs{constructor(a){super(a),this.removeGroupControls=pn,this.removeListeners=pn,this.controls=new mE(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ky=n=>(a,i)=>{n&&ct.postRender(()=>n(a,i))};class gE extends cs{constructor(){super(...arguments),this.removePointerDownListener=pn}onPointerDown(a){this.session=new Rx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Vx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:l,onPanEnd:c}=this.node.getProps();return{onSessionStart:Ky(a),onStart:Ky(i),onMove:l,onEnd:(d,f)=>{delete this.session,c&&ct.postRender(()=>c(d,f))}}}mount(){this.removePointerDownListener=al(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 ec={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Yy(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Ko={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(xe.test(n))n=parseFloat(n);else return n;const i=Yy(n,a.target.x),l=Yy(n,a.target.y);return`${i}% ${l}%`}},yE={correct:(n,{treeScale:a,projectionDelta:i})=>{const l=n,c=os.parse(n);if(c.length>5)return l;const d=os.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=mt(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 bE extends y.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l,layoutId:c}=this.props,{projection:d}=a;qw(xE),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()})),ec.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()||ct.postRender(()=>{const m=f.getStack();(!m||!m.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),lh.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 Hx(n){const[a,i]=jb(),l=y.useContext(eh);return r.jsx(bE,{...n,layoutGroup:l,switchLayoutGroup:y.useContext(Mb),isPresent:a,safeToRemove:i})}const xE={borderRadius:{...Ko,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ko,borderTopRightRadius:Ko,borderBottomLeftRadius:Ko,borderBottomRightRadius:Ko,boxShadow:yE};function SE(n,a,i){const l=Zt(n)?n:dl(n);return l.start(Rh("",l,a,i)),l.animation}function _E(n){return n instanceof SVGElement&&n.tagName!=="svg"}const TE=(n,a)=>n.depth-a.depth;class kE{constructor(){this.children=[],this.isDirty=!1}add(a){yh(this.children,a),this.isDirty=!0}remove(a){bh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(TE),this.isDirty=!1,this.children.forEach(a)}}function jE(n,a){const i=Wn.now(),l=({timestamp:c})=>{const d=c-i;d>=a&&(is(l),n(d-a))};return ct.read(l,!0),()=>is(l)}const Px=["TopLeft","TopRight","BottomLeft","BottomRight"],wE=Px.length,Fy=n=>typeof n=="string"?parseFloat(n):n,Zy=n=>typeof n=="number"||xe.test(n);function CE(n,a,i,l,c,d){c?(n.opacity=mt(0,i.opacity!==void 0?i.opacity:1,NE(l)),n.opacityExit=mt(a.opacity!==void 0?a.opacity:1,0,EE(l))):d&&(n.opacity=mt(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,l));for(let f=0;f<wE;f++){const m=`border${Px[f]}Radius`;let p=Xy(a,m),v=Xy(i,m);if(p===void 0&&v===void 0)continue;p||(p=0),v||(v=0),p===0||v===0||Zy(p)===Zy(v)?(n[m]=Math.max(mt(Fy(p),Fy(v),l),0),(Qn.test(v)||Qn.test(p))&&(n[m]+="%")):n[m]=v}(a.rotate||i.rotate)&&(n.rotate=mt(a.rotate||0,i.rotate||0,l))}function Xy(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const NE=Gx(0,.5,ix),EE=Gx(.5,.95,pn);function Gx(n,a,i){return l=>l<n?0:l>a?1:i(Gi(n,a,l))}function Qy(n,a){n.min=a.min,n.max=a.max}function An(n,a){Qy(n.x,a.x),Qy(n.y,a.y)}function Wy(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function Jy(n,a,i,l,c){return n-=a,n=uc(n,1/i,l),c!==void 0&&(n=uc(n,1/c,l)),n}function AE(n,a=0,i=1,l=.5,c,d=n,f=n){if(Qn.test(a)&&(a=parseFloat(a),a=mt(f.min,f.max,a/100)-f.min),typeof a!="number")return;let m=mt(d.min,d.max,l);n===d&&(m-=a),n.min=Jy(n.min,a,i,m,c),n.max=Jy(n.max,a,i,m,c)}function e0(n,a,[i,l,c],d,f){AE(n,a[i],a[l],a[c],a.scale,d,f)}const DE=["x","scaleX","originX"],RE=["y","scaleY","originY"];function t0(n,a,i,l){e0(n.x,a,DE,i?i.x:void 0,l?l.x:void 0),e0(n.y,a,RE,i?i.y:void 0,l?l.y:void 0)}function n0(n){return n.translate===0&&n.scale===1}function $x(n){return n0(n.x)&&n0(n.y)}function a0(n,a){return n.min===a.min&&n.max===a.max}function ME(n,a){return a0(n.x,a.x)&&a0(n.y,a.y)}function s0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function qx(n,a){return s0(n.x,a.x)&&s0(n.y,a.y)}function i0(n){return vn(n.x)/vn(n.y)}function o0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class OE{constructor(){this.members=[]}add(a){yh(this.members,a),a.scheduleRender()}remove(a){if(bh(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 BE(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:_,skewY:T}=i;v&&(l=`perspective(${v}px) ${l}`),g&&(l+=`rotate(${g}deg) `),b&&(l+=`rotateX(${b}deg) `),x&&(l+=`rotateY(${x}deg) `),_&&(l+=`skewX(${_}deg) `),T&&(l+=`skewY(${T}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 Os={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Qo=typeof window<"u"&&window.MotionDebug!==void 0,af=["","X","Y","Z"],LE={visibility:"hidden"},l0=1e3;let IE=0;function sf(n,a,i,l){const{latestValues:c}=a;c[n]&&(i[n]=c[n],a.setStaticValue(n,0),l&&(l[n]=0))}function Kx(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",ct,!(c||d))}const{parent:l}=n;l&&!l.hasCheckedOptimisedAppear&&Kx(l)}function Yx({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:l,resetTransform:c}){return class{constructor(f={},m=a==null?void 0:a()){this.id=IE++,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,Qo&&(Os.totalNodes=Os.resolvedTargetDeltas=Os.recalculatedProjection=0),this.nodes.forEach(VE),this.nodes.forEach(qE),this.nodes.forEach(KE),this.nodes.forEach(HE),Qo&&window.MotionDebug.record(Os)},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 kE)}addEventListener(f,m){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new xh),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=_E(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=jE(x,250),ec.hasAnimatedSinceResize&&(ec.hasAnimatedSinceResize=!1,this.nodes.forEach(c0))})}p&&this.root.registerSharedNode(p,this),this.options.animate!==!1&&g&&(p||v)&&this.addEventListener("didUpdate",({delta:b,hasLayoutChanged:x,hasRelativeTargetChanged:_,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const C=this.options.transition||g.getDefaultTransition()||QE,{onLayoutAnimationStart:w,onLayoutAnimationComplete:k}=g.getProps(),N=!this.targetLayout||!qx(this.targetLayout,T)||_,A=!x&&_;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||x&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(b,A);const R={...gh(C,"layout"),onPlay:w,onComplete:k};(g.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R)}else x||c0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,is(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(YE),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&&Kx(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(r0);return}this.isUpdating||this.nodes.forEach(GE),this.isUpdating=!1,this.nodes.forEach($E),this.nodes.forEach(zE),this.nodes.forEach(UE),this.clearAllSnapshots();const m=Wn.now();$t.delta=wa(0,1e3/60,m-$t.timestamp),$t.timestamp=m,$t.isProcessing=!0,Zd.update.process($t),Zd.preRender.process($t),Zd.render.process($t),$t.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,lh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(PE),this.sharedNodes.forEach(FE)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ct.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let p=0;p<this.path.length;p++)this.path[p].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Tt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement: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&&!$x(this.projectionDelta),p=this.getTransformTemplate(),v=p?p(this.latestValues,""):void 0,g=v!==this.prevTransformTemplateValue;f&&(m||Ms(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)),WE(p),{animationId:this.root.animationId,measuredBox:m,layoutBox:p,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:m}=this.options;if(!m)return Tt();const p=m.measureViewportBox();if(!(((f=this.scroll)===null||f===void 0?void 0:f.wasRoot)||this.path.some(JE))){const{scroll:g}=this.root;g&&(Bi(p.x,g.offset.x),Bi(p.y,g.offset.y))}return p}removeElementScroll(f){var m;const p=Tt();if(An(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&&An(p,f),Bi(p.x,b.offset.x),Bi(p.y,b.offset.y))}return p}applyTransform(f,m=!1){const p=Tt();An(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&&Li(p,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),Ms(g.latestValues)&&Li(p,g.latestValues)}return Ms(this.latestValues)&&Li(p,this.latestValues),p}removeTransform(f){const m=Tt();An(m,f);for(let p=0;p<this.path.length;p++){const v=this.path[p];if(!v.instance||!Ms(v.latestValues))continue;Bf(v.latestValues)&&v.updateSnapshot();const g=Tt(),b=v.measurePageBox();An(g,b),t0(m,v.latestValues,v.snapshot?v.snapshot.layoutBox:void 0,g)}return Ms(this.latestValues)&&t0(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!==$t.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=$t.timestamp,!this.targetDelta&&!this.relativeTarget){const _=this.getClosestProjectingParent();_&&_.layout&&this.animationProgress!==1?(this.relativeParent=_,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Tt(),this.relativeTargetOrigin=Tt(),il(this.relativeTargetOrigin,this.layout.layoutBox,_.layout.layoutBox),An(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Tt(),this.targetWithTransforms=Tt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),nE(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):An(this.target,this.layout.layoutBox),zx(this.target,this.targetDelta)):An(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const _=this.getClosestProjectingParent();_&&!!_.resumingFrom==!!this.resumingFrom&&!_.options.layoutScroll&&_.target&&this.animationProgress!==1?(this.relativeParent=_,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Tt(),this.relativeTargetOrigin=Tt(),il(this.relativeTargetOrigin,this.target,_.target),An(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Qo&&Os.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Bf(this.parent.latestValues)||Ix(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===$t.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;An(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,_=this.treeScale.y;dE(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=Tt());const{target:T}=m;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Wy(this.prevProjectionDelta.x,this.projectionDelta.x),Wy(this.prevProjectionDelta.y,this.projectionDelta.y)),sl(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==_||!o0(this.projectionDelta.x,this.prevProjectionDelta.x)||!o0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T)),Qo&&Os.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=Oi(),this.projectionDelta=Oi(),this.projectionDeltaWithTransform=Oi()}setAnimationOrigin(f,m=!1){const p=this.snapshot,v=p?p.latestValues:{},g={...this.latestValues},b=Oi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!m;const x=Tt(),_=p?p.source:void 0,T=this.layout?this.layout.source:void 0,C=_!==T,w=this.getStack(),k=!w||w.members.length<=1,N=!!(C&&!k&&this.options.crossfade===!0&&!this.path.some(XE));this.animationProgress=0;let A;this.mixTargetDelta=R=>{const E=R/1e3;u0(b.x,f.x,E),u0(b.y,f.y,E),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(il(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ZE(this.relativeTarget,this.relativeTargetOrigin,x,E),A&&ME(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=Tt()),An(A,this.relativeTarget)),C&&(this.animationValues=g,CE(g,v,this.latestValues,E,N,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&&(is(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ct.update(()=>{ec.hasAnimatedSinceResize=!0,this.currentAnimation=SE(0,l0,{...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(l0),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&&Fx(this.options.animationType,this.layout.layoutBox,v.layoutBox)){p=this.target||Tt();const b=vn(this.layout.layoutBox.x);p.x.min=f.target.x.min,p.x.max=p.x.min+b;const x=vn(this.layout.layoutBox.y);p.y.min=f.target.y.min,p.y.max=p.y.min+x}An(m,p),Li(m,g),sl(this.projectionDeltaWithTransform,this.layoutCorrected,m,g)}}registerSharedNode(f,m){this.sharedNodes.has(f)||this.sharedNodes.set(f,new OE),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&&sf("z",f,v,this.animationValues);for(let g=0;g<af.length;g++)sf(`rotate${af[g]}`,f,v,this.animationValues),sf(`skew${af[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 LE;const v={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,v.opacity="",v.pointerEvents=Wr(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=Wr(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!Ms(this.latestValues)&&(C.transform=g?g({},""):"none",this.hasProjected=!1),C}const x=b.animationValues||b.latestValues;this.applyTransformsToTarget(),v.transform=BE(this.projectionDeltaWithTransform,this.treeScale,x),g&&(v.transform=g(x,v.transform));const{x:_,y:T}=this.projectionDelta;v.transformOrigin=`${_.origin*100}% ${T.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 ic){if(x[C]===void 0)continue;const{correct:w,applyTo:k}=ic[C],N=v.transform==="none"?x[C]:w(x[C],b);if(k){const A=k.length;for(let R=0;R<A;R++)v[k[R]]=N}else v[C]=N}return this.options.layoutId&&(v.pointerEvents=b===this?Wr(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(r0),this.root.sharedNodes.clear()}}}function zE(n){n.updateLayout()}function UE(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"?Rn(b=>{const x=f?i.measuredBox[b]:i.layoutBox[b],_=vn(x);x.min=l[b].min,x.max=x.min+_}):Fx(d,i.layoutBox,l)&&Rn(b=>{const x=f?i.measuredBox[b]:i.layoutBox[b],_=vn(l[b]);x.max=x.min+_,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[b].max=n.relativeTarget[b].min+_)});const m=Oi();sl(m,l,i.layoutBox);const p=Oi();f?sl(p,n.applyTransform(c,!0),i.measuredBox):sl(p,l,i.layoutBox);const v=!$x(m);let g=!1;if(!n.resumeFrom){const b=n.getClosestProjectingParent();if(b&&!b.resumeFrom){const{snapshot:x,layout:_}=b;if(x&&_){const T=Tt();il(T,i.layoutBox,x.layoutBox);const C=Tt();il(C,l,_.layoutBox),qx(T,C)||(g=!0),b.options.layoutRoot&&(n.relativeTarget=C,n.relativeTargetOrigin=T,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 VE(n){Qo&&Os.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 HE(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function PE(n){n.clearSnapshot()}function r0(n){n.clearMeasurements()}function GE(n){n.isLayoutDirty=!1}function $E(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function c0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function qE(n){n.resolveTargetDelta()}function KE(n){n.calcProjection()}function YE(n){n.resetSkewAndRotation()}function FE(n){n.removeLeadSnapshot()}function u0(n,a,i){n.translate=mt(a.translate,0,i),n.scale=mt(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function d0(n,a,i,l){n.min=mt(a.min,i.min,l),n.max=mt(a.max,i.max,l)}function ZE(n,a,i,l){d0(n.x,a.x,i.x,l),d0(n.y,a.y,i.y,l)}function XE(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const QE={duration:.45,ease:[.4,0,.1,1]},f0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),h0=f0("applewebkit/")&&!f0("chrome/")?Math.round:pn;function m0(n){n.min=h0(n.min),n.max=h0(n.max)}function WE(n){m0(n.x),m0(n.y)}function Fx(n,a,i){return n==="position"||n==="preserve-aspect"&&!tE(i0(a),i0(i),.2)}function JE(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const e2=Yx({attachResizeListener:(n,a)=>hl(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),of={current:void 0},Zx=Yx({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!of.current){const n=new e2({});n.mount(window),n.setOptions({layoutScroll:!0}),of.current=n}return of.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),t2={pan:{Feature:gE},drag:{Feature:vE,ProjectionNode:Zx,MeasureLayout:Hx}};function n2(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 Xx(n,a){const i=n2(n),l=new AbortController,c={passive:!0,...a,signal:l.signal};return[i,c,()=>l.abort()]}function p0(n){return a=>{a.pointerType==="touch"||Dx()||n(a)}}function a2(n,a,i={}){const[l,c,d]=Xx(n,i),f=p0(m=>{const{target:p}=m,v=a(m);if(typeof v!="function"||!p)return;const g=p0(b=>{v(b),p.removeEventListener("pointerleave",g)});p.addEventListener("pointerleave",g,c)});return l.forEach(m=>{m.addEventListener("pointerenter",f,c)}),d}function v0(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&&ct.postRender(()=>d(a,xl(a)))}class s2 extends cs{mount(){const{current:a}=this.node;a&&(this.unmount=a2(a,i=>(v0(this.node,i,"Start"),l=>v0(this.node,l,"End"))))}unmount(){}}class i2 extends cs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch{a=!0}!a||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=bl(hl(this.node.current,"focus",()=>this.onFocus()),hl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Qx=(n,a)=>a?n===a?!0:Qx(n,a.parentElement):!1,o2=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function l2(n){return o2.has(n.tagName)||n.tabIndex!==-1}const Wo=new WeakSet;function g0(n){return a=>{a.key==="Enter"&&n(a)}}function lf(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const r2=(n,a)=>{const i=n.currentTarget;if(!i)return;const l=g0(()=>{if(Wo.has(i))return;lf(i,"down");const c=g0(()=>{lf(i,"up")}),d=()=>lf(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 y0(n){return Mh(n)&&!Dx()}function c2(n,a,i={}){const[l,c,d]=Xx(n,i),f=m=>{const p=m.currentTarget;if(!y0(m)||Wo.has(p))return;Wo.add(p);const v=a(m),g=(_,T)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",x),!(!y0(_)||!Wo.has(p))&&(Wo.delete(p),typeof v=="function"&&v(_,{success:T}))},b=_=>{g(_,i.useGlobalTarget||Qx(p,_.target))},x=_=>{g(_,!1)};window.addEventListener("pointerup",b,c),window.addEventListener("pointercancel",x,c)};return l.forEach(m=>{!l2(m)&&m.getAttribute("tabindex")===null&&(m.tabIndex=0),(i.useGlobalTarget?window:m).addEventListener("pointerdown",f,c),m.addEventListener("focus",v=>r2(v,c),c)}),d}function b0(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&&ct.postRender(()=>d(a,xl(a)))}class u2 extends cs{mount(){const{current:a}=this.node;a&&(this.unmount=c2(a,i=>(b0(this.node,i,"Start"),(l,{success:c})=>b0(this.node,l,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const If=new WeakMap,rf=new WeakMap,d2=n=>{const a=If.get(n.target);a&&a(n)},f2=n=>{n.forEach(d2)};function h2({root:n,...a}){const i=n||document;rf.has(i)||rf.set(i,{});const l=rf.get(i),c=JSON.stringify(a);return l[c]||(l[c]=new IntersectionObserver(f2,{root:n,...a})),l[c]}function m2(n,a,i){const l=h2(a);return If.set(n,i),l.observe(n),()=>{If.delete(n),l.unobserve(n)}}const p2={some:0,all:1};class v2 extends cs{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:p2[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 m2(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(g2(a,i))&&this.startObserver()}unmount(){}}function g2({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const y2={inView:{Feature:v2},tap:{Feature:u2},focus:{Feature:i2},hover:{Feature:s2}},b2={layout:{ProjectionNode:Zx,MeasureLayout:Hx}},dc={current:null},Oh={current:!1};function Wx(){if(Oh.current=!0,!!ah)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>dc.current=n.matches;n.addListener(a),a()}else dc.current=!1}const x2=[...bx,Ft,os],S2=n=>x2.find(yx(n)),x0=new WeakMap;function _2(n,a,i){for(const l in a){const c=a[l],d=i[l];if(Zt(c))n.addValue(l,c);else if(Zt(d))n.addValue(l,dl(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,dl(f!==void 0?f:c,{owner:n}))}}for(const l in i)a[l]===void 0&&n.removeValue(l);return a}const S0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class T2{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=Eh,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 _=Wn.now();this.renderScheduledAt<_&&(this.renderScheduledAt=_,ct.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=Tc(i),this.isVariantNode=Db(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:b,...x}=this.scrapeMotionValuesFromProps(i,{},this);for(const _ in x){const T=x[_];p[_]!==void 0&&Zt(T)&&T.set(p[_],!1)}}mount(a){this.current=a,x0.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)),Oh.current||Wx(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:dc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){x0.delete(this.current),this.projection&&this.projection.unmount(),is(this.notifyUpdate),is(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const i=this.features[a];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(a,i){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const l=$s.has(a),c=i.on("change",m=>{this.latestValues[a]=m,this.props.onUpdate&&ct.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 Pi){const i=Pi[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):Tt()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,i){this.latestValues[a]=i}update(a,i){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let l=0;l<S0.length;l++){const c=S0[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=_2(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=dl(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"&&(vx(c)||lx(c))?c=parseFloat(c):!S2(c)&&os.test(i)&&(c=hx(a,i)),this.setBaseTarget(a,Zt(c)?c.get():c)),Zt(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=ch(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&&!Zt(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 xh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class Jx extends T2{constructor(){super(...arguments),this.KeyframeResolver=xx}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;Zt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function k2(n){return window.getComputedStyle(n)}class j2 extends Jx{constructor(){super(...arguments),this.type="html",this.renderInstance=Vb}readValueFromInstance(a,i){if($s.has(i)){const l=Nh(i);return l&&l.default||0}else{const l=k2(a),c=(Ib(i)?l.getPropertyValue(i):l[i])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Ux(a,i)}build(a,i,l){fh(a,i,l.transformTemplate)}scrapeMotionValuesFromProps(a,i,l){return vh(a,i,l)}}class w2 extends Jx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Tt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if($s.has(i)){const l=Nh(i);return l&&l.default||0}return i=Hb.has(i)?i:oh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,l){return $b(a,i,l)}build(a,i,l){hh(a,i,this.isSVGTag,l.transformTemplate)}renderInstance(a,i,l,c){Pb(a,i,l,c)}mount(a){this.isSVGTag=ph(a.tagName),super.mount(a)}}const C2=(n,a)=>rh(n)?new w2(a):new j2(a,{allowProjection:n!==y.Fragment}),N2=eC({...qN,...y2,...t2,...b2},C2),Et=pw(N2);function E2(){!Oh.current&&Wx();const[n]=y.useState(dc.current);return n}const zf={not_started:{color:"var(--text-tertiary)",icon:"○",label:"Not Started"},working:{color:"var(--accent-green)",icon:"●",label:"Working"},paused:{color:"var(--accent-yellow)",icon:"◉",label:"Paused"},complete:{color:"var(--accent-green)",icon:"✓",label:"Complete"},failed:{color:"var(--accent-red)",icon:"✗",label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:"⦸",label:"Blocked"}};function ls(n){return n==="blocked"?zf.blocked:zf[Bh(n)]}const A2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function D2(n){return A2[Bh(n)]??"statusPending"}const R2=["working","paused","failed","not_started","blocked","complete"],_0=["not_started","working","paused","complete","failed"],M2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Bh(n){return n in zf&&n!=="blocked"?n:M2[n]??"not_started"}const O2={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 B2(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 eS({text:n,indices:a,highlightClass:i}){if(!a||a.length===0)return r.jsx(r.Fragment,{children:n});const l=B2(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 L2(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 I2(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 R2){c.add(d);const f=i.get(d);if(f&&f.length>0){f.sort((p,v)=>p.sortOrder-v.sortOrder);const m=ls(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=ls(d);l.push({status:d,label:m.label,style:m,tasks:f})}return l}const z2="_container_z4i38_1",U2="_header_z4i38_5",V2="_headerActions_z4i38_17",H2="_searchInput_z4i38_23",P2="_searchHighlight_z4i38_56",G2="_groupToggle_z4i38_62",$2="_groupToggleActive_z4i38_89",q2="_addButton_z4i38_93",K2="_taskRow_z4i38_120",Y2="_selected_z4i38_140",F2="_expandArrow_z4i38_150",Z2="_expanded_z4i38_157",X2="_leafSpacer_z4i38_161",Q2="_taskStatusIcon_z4i38_166",W2="_taskTitle_z4i38_170",J2="_workspaceBadge_z4i38_177",eA="_childCountBadge_z4i38_195",tA="_dependencyBadge_z4i38_208",nA="_blockedBadge_z4i38_220",aA="_addChildButton_z4i38_225",sA="_emptyState_z4i38_268",iA="_statusGroupHeader_z4i38_275",oA="_statusGroupIcon_z4i38_294",lA="_statusGroupLabel_z4i38_298",rA="_statusGroupCount_z4i38_303",Ve={container:z2,header:U2,headerActions:V2,searchInput:H2,searchHighlight:P2,groupToggle:G2,groupToggleActive:$2,addButton:q2,taskRow:K2,selected:Y2,expandArrow:F2,expanded:Z2,leafSpacer:X2,taskStatusIcon:Q2,taskTitle:W2,workspaceBadge:J2,childCountBadge:eA,dependencyBadge:tA,blockedBadge:nA,addChildButton:aA,emptyState:sA,statusGroupHeader:iA,statusGroupIcon:oA,statusGroupLabel:lA,statusGroupCount:rA},cA=[{name:"title",weight:2},{name:"description",weight:1}],tS=16,uA=16,nS="grackle-task-group-by-status";function T0(){try{return localStorage.getItem(nS)==="true"}catch{return!1}}function dA(n){try{localStorage.setItem(nS,String(n))}catch{}}function fA({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:Ve.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:`${Ve.expandArrow} ${a?Ve.expanded:""}`,children:"▸"}),r.jsx("span",{className:Ve.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),r.jsx("span",{className:Ve.statusGroupLabel,children:n.label}),r.jsx("span",{className:Ve.statusGroupCount,children:n.tasks.length})]}),r.jsx(ea,{children:a&&r.jsx(Et.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:n.tasks.map(m=>{const p=ls(m.status),v=l===m.id,g=m.parentTaskId||!m.workspaceId?void 0:f.get(m.workspaceId);return r.jsxs("div",{onClick:()=>c(Jn(m.id)),className:`${Ve.taskRow} ${v?Ve.selected:""}`,style:{"--task-indent":`${tS}px`},"data-task-id":m.id,children:[r.jsx("span",{className:Ve.leafSpacer}),r.jsx("span",{className:Ve.taskStatusIcon,style:{color:p.color},children:p.icon}),r.jsx("span",{className:Ve.taskTitle,title:m.title,children:r.jsx(eS,{text:m.title,indices:d.get(m.id),highlightClass:Ve.searchHighlight})}),g&&r.jsx("span",{className:Ve.workspaceBadge,title:g,children:g})]},m.id)})})})]})}function aS({node:n,depth:a,expandedTasks:i,toggleTask:l,selectedTaskId:c,navigate:d,taskStatusById:f,titleHighlights:m,workspaceNames:p}){const v=ls(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,_=c===n.id,T=tS+a*uA,w=a===0&&!n.parentTaskId&&n.workspaceId?p.get(n.workspaceId):void 0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{onClick:()=>d(Jn(n.id)),className:`${Ve.taskRow} ${_?Ve.selected:""}`,style:{"--task-indent":`${T}px`},"data-task-id":n.id,children:[x&&r.jsx("span",{className:`${Ve.expandArrow} ${b?Ve.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:Ve.leafSpacer}),r.jsx("span",{className:Ve.taskStatusIcon,style:{color:v.color},children:v.icon}),r.jsx("span",{className:Ve.taskTitle,title:n.title,children:r.jsx(eS,{text:n.title,indices:m.get(n.id),highlightClass:Ve.searchHighlight})}),w&&r.jsx("span",{className:Ve.workspaceBadge,title:w,children:w}),x&&r.jsxs("span",{className:Ve.childCountBadge,children:[n.children.filter(k=>k.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&r.jsx("span",{className:`${Ve.dependencyBadge} ${g?Ve.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:g?"blocked":"dep"}),a<q1&&r.jsx("button",{onClick:k=>{k.stopPropagation(),d(Gs(n.workspaceId,n.id))},title:"Add child task","aria-label":"Add child task",className:Ve.addChildButton,children:"+"})]}),r.jsx(ea,{children:x&&b&&r.jsx(Et.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:n.children.map(k=>r.jsx(aS,{node:k,depth:a+1,expandedTasks:i,toggleTask:l,selectedTaskId:c,navigate:d,taskStatusById:f,titleHighlights:m,workspaceNames:p},k.id))})})]})}function hA({workspaces:n,tasks:a}){const i=xt(),[l,c]=y.useState(new Set),[d,f]=y.useState(new Set),[m,p]=y.useState(T0),[v,g]=y.useState(T0),[b,x]=y.useState(new Map),_=Nt("/tasks/:taskId/*"),T=(_==null?void 0:_.params.taskId)!=="new"?_==null?void 0:_.params.taskId:void 0,C=y.useMemo(()=>new Map(a.map(q=>[q.id,q.status])),[a]),w=y.useMemo(()=>new Map(n.map(q=>[q.id,q.name])),[n]),k=()=>{const q=!m;dA(q),p(q),q&&(g(!0),x(new Map))},N=q=>{x(ae=>{const O=new Map(ae),P=O.has(q)?O.get(q):v;return O.set(q,!P),O})},A=q=>b.has(q)?b.get(q):v,R=q=>{c(ae=>{const O=new Set(ae);return O.has(q)?(O.delete(q),f(P=>new Set(P).add(q))):(O.add(q),f(P=>{const W=new Set(P);return W.delete(q),W})),O})};y.useEffect(()=>{const q=new Set(a.filter(ae=>ae.parentTaskId).map(ae=>ae.parentTaskId));q.size>0&&c(ae=>{const O=new Set(ae);for(const P of q)d.has(P)||O.add(P);return O})},[a,d]);const[E,B]=y.useState(""),{directMatchTaskIds:U,treeMatchTaskIds:z,titleHighlights:K}=y.useMemo(()=>{if(!E.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const q=$1(a,E,cA),ae=new Set(q.map(re=>re.item.id)),O=new Map;for(const re of q){const oe=re.matches.find(Ne=>Ne.key==="title");oe&&O.set(re.item.id,oe.indices)}const P=new Set(ae),W=new Map(a.map(re=>[re.id,re]));for(const re of[...ae]){let oe=W.get(re);for(;oe!=null&&oe.parentTaskId;)P.add(oe.parentTaskId),oe=W.get(oe.parentTaskId)}return{directMatchTaskIds:ae,treeMatchTaskIds:P,titleHighlights:O}},[E,a]),te=U!==null,ne=te?m?U:z:null,ie=ne?a.filter(q=>ne.has(q.id)):a,le=m?[]:L2(ie);return r.jsxs("div",{className:Ve.container,children:[r.jsxs("div",{className:Ve.header,children:[r.jsx("span",{children:"Tasks"}),r.jsxs("div",{className:Ve.headerActions,children:[r.jsx("button",{className:`${Ve.groupToggle} ${m?Ve.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:Ve.addButton,onClick:()=>i(Gs()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&r.jsx("input",{type:"text",value:E,onChange:q=>B(q.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Ve.searchInput,"data-testid":"sidebar-search"}),m?I2(ie,C).map(q=>r.jsx(fA,{group:q,isExpanded:A(q.status),onToggle:()=>N(q.status),selectedTaskId:T,navigate:i,titleHighlights:K,workspaceNames:w},q.status)):le.map(q=>r.jsx(aS,{node:q,depth:0,expandedTasks:l,toggleTask:R,selectedTaskId:T,navigate:i,taskStatusById:C,titleHighlights:K,workspaceNames:w},q.id)),ie.length===0&&!te&&r.jsx("div",{className:Ve.emptyState,children:"No tasks yet. Click + to create one."}),ie.length===0&&te&&r.jsx("div",{className:Ve.emptyState,children:"No matching tasks"})]})}const mA="_nav_14i94_1",pA="_tab_14i94_24",vA="_tabActive_14i94_62",gA="_tabLabel_14i94_75",yA="_statusDot_14i94_81",bA="_pulse_14i94_87",xA="_addButton_14i94_99",SA="_empty_14i94_132",ts={nav:mA,tab:pA,tabActive:vA,tabLabel:gA,statusDot:yA,pulse:bA,addButton:xA,empty:SA},_A={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function TA({environments:n}){const a=xt(),i=y.useRef(null),l=Nt("/environments/:environmentId"),c=Nt("/environments/:environmentId/edit"),d=Nt("/environments/:environmentId/workspaces/:workspaceId"),f=Nt("/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(Hi(x))},[a]),g=y.useCallback(x=>{var k;const _=(k=i.current)==null?void 0:k.querySelectorAll('[role="tab"]');if(!_||_.length===0)return;const T=Array.from(_).findIndex(N=>N===document.activeElement),C=T>=0?T:n.findIndex(N=>N.id===p);let w=C;if(x.key==="ArrowDown"||x.key==="j"||x.key==="J")x.preventDefault(),w=(C+1)%_.length;else if(x.key==="ArrowUp"||x.key==="k"||x.key==="K")x.preventDefault(),w=(C-1+_.length)%_.length;else if(x.key==="Home")x.preventDefault(),w=0;else if(x.key==="End")x.preventDefault(),w=_.length-1;else return;w<n.length&&a(Hi(n[w].id)),_[w].focus()},[p,n,a]),b=p??(n.length>0?n[0].id:void 0);return r.jsxs("div",{className:ts.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 _=x.id===p,T=x.id===b,C=_A[x.status]||"var(--text-tertiary)",w=x.status==="connected";return r.jsxs("button",{role:"tab",type:"button","aria-selected":_,tabIndex:T?0:-1,className:`${ts.tab} ${_?ts.tabActive:""}`,onClick:()=>v(x.id),"data-testid":"env-nav-item",children:[r.jsx("span",{className:`${ts.statusDot} ${w?ts.pulse:""}`,style:{color:C},children:"●"}),r.jsx("span",{className:ts.tabLabel,title:x.displayName||x.id,children:x.displayName||x.id})]},x.id)})}),r.jsx("button",{type:"button",className:ts.addButton,onClick:()=>a(Uk),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),n.length===0&&r.jsx("div",{className:ts.empty,children:"No environments yet."})]})}const kA="_nav_1bhou_1",jA="_tab_1bhou_24",wA="_tabIcon_1bhou_62",CA="_tabActive_1bhou_68",qr={nav:kA,tab:jA,tabIcon:wA,tabActive:CA},xa=[{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 NA(){var f;const n=Ot(),a=xt(),i=y.useRef(null),l=((f=xa.find(m=>{const p=`${zi}/${m.path}`;return n.pathname===p||n.pathname.startsWith(`${p}/`)}))==null?void 0:f.path)??xa[0].path,c=y.useCallback(m=>{a(`${zi}/${m}`)},[a]),d=y.useCallback(m=>{var _,T;const p=(_=i.current)==null?void 0:_.querySelectorAll('[role="tab"]');if(!p)return;const v=Array.from(p).findIndex(C=>C===document.activeElement),g=v>=0?v:xa.findIndex(C=>C.path===l);let b=g;if(m.key==="ArrowDown"||m.key==="j"||m.key==="J")m.preventDefault(),b=(g+1)%xa.length;else if(m.key==="ArrowUp"||m.key==="k"||m.key==="K")m.preventDefault(),b=(g-1+xa.length)%xa.length;else if(m.key==="Home")m.preventDefault(),b=0;else if(m.key==="End")m.preventDefault(),b=xa.length-1;else return;const x=xa[b].path;a(`${zi}/${x}`),(T=p[b])==null||T.focus()},[l,a]);return r.jsx("nav",{className:qr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:d,children:xa.map(m=>{const p=m.path===l;return r.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${qr.tab} ${p?qr.tabActive:""}`,onClick:()=>c(m.path),children:[r.jsx("span",{className:qr.tabIcon,"aria-hidden":"true",children:m.icon}),m.label]},m.path)})})}const EA="_nav_1snmp_1",AA="_searchForm_1snmp_8",DA="_searchInput_1snmp_15",RA="_searchButton_1snmp_33",MA="_clearButton_1snmp_68",OA="_workspaceSelect_1snmp_85",BA="_listHeader_1snmp_99",LA="_nodeList_1snmp_108",IA="_nodeItem_1snmp_116",zA="_indicator_1snmp_129",UA="_label_1snmp_136",VA="_badge_1snmp_145",Dn={nav:EA,searchForm:AA,searchInput:DA,searchButton:RA,clearButton:MA,workspaceSelect:OA,listHeader:BA,nodeList:LA,nodeItem:IA,indicator:zA,label:UA,badge:VA};function HA({nodes:n,workspaces:a,loading:i,searchQuery:l,onSearch:c,onClearSearch:d,onSelectNode:f,onWorkspaceChange:m}){const[p,v]=y.useState(""),g=y.useCallback(T=>{T.preventDefault(),p.trim()&&c(p.trim())},[p,c]),b=y.useCallback(()=>{v(""),d()},[d]),x=y.useCallback(T=>{f(T)},[f]),_=y.useCallback(T=>{v(""),m(T)},[m]);return r.jsxs("div",{className:Dn.nav,"data-testid":"knowledge-nav",children:[r.jsxs("form",{className:Dn.searchForm,onSubmit:g,children:[r.jsx("input",{className:Dn.searchInput,type:"text",placeholder:"Search...",value:p,onChange:T=>{v(T.target.value)},"data-testid":"knowledge-search-input"}),r.jsx("button",{type:"submit",className:Dn.searchButton,disabled:i,children:"Go"})]}),l&&r.jsx("button",{type:"button",className:Dn.clearButton,onClick:b,children:"Clear search"}),r.jsxs("select",{className:Dn.workspaceSelect,onChange:T=>{_(T.target.value)},"data-testid":"knowledge-workspace-filter",children:[r.jsx("option",{value:"",children:"All workspaces"}),a.map(T=>r.jsx("option",{value:T.id,children:T.name},T.id))]}),r.jsxs("div",{className:Dn.listHeader,children:["Nodes (",n.length,")"]}),r.jsx("ul",{className:Dn.nodeList,children:n.map(T=>r.jsxs("li",{className:Dn.nodeItem,onClick:()=>{x(T.id)},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),x(T.id))},role:"button",tabIndex:0,children:[r.jsx("span",{className:Dn.indicator,style:{backgroundColor:T.kind==="reference"?"#4A9EFF":T.category==="decision"?"#22C55E":T.category==="concept"?"#A855F7":T.category==="snippet"?"#6B7280":"#EAB308"}}),r.jsx("span",{className:Dn.label,children:T.label}),r.jsx("span",{className:Dn.badge,children:T.kind==="reference"?T.sourceType:T.category})]},T.id))})]})}function PA(){const{workspaces:n,tasks:a}=ut(),i=y.useMemo(()=>r.jsx(hA,{workspaces:n,tasks:a}),[n,a]);return bc(i),r.jsx(Ps,{})}function GA(){const{environments:n}=ut(),a=y.useMemo(()=>r.jsx(TA,{environments:n}),[n]);return bc(a),r.jsx(Ps,{})}function $A(){const n=y.useMemo(()=>r.jsx(NA,{}),[]);return bc(n),r.jsx(Ps,{})}function qA(){const{knowledge:n,workspaces:a}=ut(),i=y.useCallback(m=>{n.search(m)},[n]),l=y.useCallback(()=>{n.clearSearch()},[n]),c=y.useCallback(m=>{n.selectNode(m)},[n]),d=y.useCallback(m=>{n.loadRecent(m||void 0)},[n]),f=y.useMemo(()=>r.jsx(HA,{nodes:n.graphData.nodes,workspaces:a,loading:n.loading,searchQuery:n.searchQuery,onSearch:i,onClearSearch:l,onSelectNode:c,onWorkspaceChange:d}),[n,a,i,l,c,d]);return bc(f),r.jsx(Ps,{})}const KA="_bar_tnfsh_1",YA="_btnPrimary_tnfsh_32",FA="_statusText_tnfsh_85",ZA="_statusCompleted_tnfsh_90",XA="_statusFailed_tnfsh_94",QA="_statusBlocked_tnfsh_98",WA="_hintText_tnfsh_103",ft={bar:KA,btnPrimary:YA,statusText:FA,statusCompleted:ZA,statusFailed:XA,statusBlocked:QA,hintText:WA};function JA({sessions:n,tasks:a,environments:i}){const l=xt(),c=Ot(),d=Nt("/sessions/:sessionId"),f=Nt("/tasks/:taskId"),m=Nt("/tasks/:taskId/stream"),p=Nt("/tasks/:taskId/findings"),v=Nt("/tasks/:taskId/edit"),g=Nt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),b=Nt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),x=Nt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),_=Nt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),T=Nt("/sessions/new"),C=Nt("/environments/:environmentId/workspaces/:workspaceId"),w=Nt("/tasks/new"),k=Nt("/chat"),N=Nt("/"),A=Nt("/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)??(_==null?void 0:_.params.taskId),B=g??b??x??_,U=(B==null?void 0:B.params.environmentId)??(C==null?void 0:C.params.environmentId),z=c.pathname.startsWith("/environments")&&!C&&!B,K=!!k,te=!!T,ne=!!C&&!g&&!b&&!x&&!_,ie=!!w;if(!!N&&!te&&!ne&&!ie||!!A||(!!v||!!_)||ie||z||te)return r.jsx(r.Fragment,{});if(K)return i.find(P=>P.adapterType==="local"&&P.status==="connected")?r.jsx(r.Fragment,{}):r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Add a local environment to start chatting"})});if(ne)return r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Select a task or click + to create one"})});if(E){const O=a.find(re=>re.id===E);if(!O)return r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Loading..."})});const P=new Map(a.map(re=>[re.id,re])),W=O.dependsOn.some(re=>{const oe=P.get(re);return oe!==void 0&&oe.status!=="complete"});if(O.status==="not_started"){const re=W?O.dependsOn.map(oe=>P.get(oe)).filter(oe=>oe&&oe.status!=="complete").map(oe=>oe.title):[];return r.jsx("div",{className:ft.bar,children:W?r.jsxs("span",{className:ft.statusBlocked,children:["Blocked by: ",re.join(", ")]}):r.jsx("span",{className:ft.hintText,children:"Use the buttons above to start or manage this task"})})}if(O.status==="working"||O.status==="paused"){const re=O.latestSessionId||void 0,oe=re?n.find(je=>je.id===re):void 0;return oe&&oe.status!=="stopped"?r.jsx(r.Fragment,{}):r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Waiting for agent..."})})}if(O.status==="complete")return r.jsxs("div",{className:ft.bar,children:[r.jsx("span",{className:`${ft.statusText} ${ft.statusCompleted}`,children:"Task completed"}),r.jsx("button",{onClick:()=>l(Gs(O.workspaceId,void 0,U)),className:ft.btnPrimary,children:"+ New Task"})]});if(O.status==="failed")return r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:`${ft.statusText} ${ft.statusFailed}`,children:"Task failed"})})}if(R){const O=n.find(re=>re.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:ft.bar,children:[r.jsxs("span",{className:`${ft.statusText} ${ft.hintText}`,children:["Session ",O.endReason||O.status]}),r.jsx("button",{onClick:()=>l(rb(O.environmentId)),className:ft.btnPrimary,children:"+ New Chat"})]})}return r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Loading..."})})}const eD="_toast_da8ll_1",tD="_success_da8ll_18",nD="_icon_da8ll_22",aD="_error_da8ll_25",sD="_warning_da8ll_32",iD="_info_da8ll_38",oD="_message_da8ll_53",lD="_close_da8ll_60",Yo={toast:eD,success:tD,icon:nD,error:aD,warning:sD,info:iD,message:oD,close:lD},rD={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function cD({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(Et.div,{className:`${Yo.toast} ${Yo[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:Yo.icon,"aria-hidden":"true",children:rD[n.variant]}),r.jsx("span",{className:Yo.message,children:n.message}),r.jsx("button",{type:"button",className:Yo.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const uD="_container_qqse2_1",dD={container:uD};function fD(){const{toasts:n,dismissToast:a}=Ca();return r.jsx("div",{className:dD.container,"data-testid":"toast-container",children:r.jsx(ea,{children:n.map(i=>r.jsx(cD,{toast:i,onDismiss:a},i.id))})})}const hD="_callout_1jaue_1",mD="_success_1jaue_11",pD="_icon_1jaue_15",vD="_error_1jaue_18",gD="_warning_1jaue_25",yD="_info_1jaue_32",bD="_content_1jaue_48",xD="_close_1jaue_53",Fo={callout:hD,success:mD,icon:pD,error:vD,warning:gD,info:yD,content:bD,close:xD},SD={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function _D({variant:n="info",children:a,dismissible:i=!1,className:l}){const[c,d]=y.useState(!1);return r.jsx(r.Fragment,{children:!c&&r.jsxs("div",{className:[Fo.callout,Fo[n],l].filter(Boolean).join(" "),role:n==="error"||n==="warning"?"alert":"status",children:[r.jsx("span",{className:Fo.icon,"aria-hidden":"true",children:SD[n]}),r.jsx("span",{className:Fo.content,children:a}),i&&r.jsx("button",{type:"button",className:Fo.close,onClick:()=>d(!0),"aria-label":"Dismiss",children:"×"})]})})}const TD="_breadcrumbs_17or2_1",kD="_list_17or2_11",jD="_item_17or2_21",wD="_separator_17or2_28",CD="_link_17or2_34",ND="_current_17or2_57",Ai={breadcrumbs:TD,list:kD,item:jD,separator:wD,link:CD,current:ND},ED="›";function us({segments:n}){return r.jsx("nav",{className:Ai.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:r.jsx("ol",{className:Ai.list,children:n.map((a,i)=>{const l=i===n.length-1;return r.jsxs("li",{className:Ai.item,children:[i>0&&r.jsx("span",{className:Ai.separator,"aria-hidden":"true",children:ED}),a.url&&!l?r.jsx(Qf,{className:Ai.link,to:a.url,title:a.label,children:a.label}):r.jsx("span",{className:Ai.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}const AD="_btn_dwk2o_1",DD="_sm_dwk2o_22",RD="_md_dwk2o_28",MD="_lg_dwk2o_34",OD="_primary_dwk2o_40",BD="_danger_dwk2o_55",LD="_outline_dwk2o_70",ID="_ghost_dwk2o_80",cf={btn:AD,sm:DD,md:RD,lg:MD,primary:OD,danger:BD,outline:LD,ghost:ID},Sa=y.forwardRef(function({variant:a="primary",size:i="md",className:l,children:c,...d},f){const m=[cf.btn,cf[a],cf[i],l].filter(Boolean).join(" ");return r.jsx("button",{ref:f,className:m,...d,children:c})});function Uf(){Uf=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)),fc(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&&fc(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)},Uf.apply(this,arguments)}function fc(n,a){return fc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},fc(n,a)}function k0(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 uf(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 k0(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)?k0(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 zD=(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){C1(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 B,U=uf(E.properties.className);!(B=U()).done;){var z=B.value;if(z.slice(0,9)==="language-")return z.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,_;_=(x=b)!=null&&x.includes("diff-")?b.split("-")[1]:b,v=n.highlight(Lr(l),_),d.properties.className=(d.properties.className||[]).concat("language-"+_)}catch(E){if(!a.ignoreMissing||!/Unknown language/.test(E.message))throw E;v=l}else v=l;v.children=(g=1,function E(B){return B.reduce(function(U,z){if(z.type==="text"){var K=z.value,te=(K.match(/\n/g)||"").length;if(te===0)z.position={start:{line:g,column:1},end:{line:g,column:1}},U.push(z);else for(var ne,ie=K.split(`
100
- `),le=uf(ie.entries());!(ne=le()).done;){var q=ne.value,ae=q[0],O=q[1];U.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+=te,U}if(Object.prototype.hasOwnProperty.call(z,"children")){var P=g;return z.children=E(z.children),U.push(z),z.position={start:{line:P,column:1},end:{line:g,column:1}},U}return U.push(z),U},[])})(v.children),v.position=v.children.length>0?{start:{line:v.children[0].position.start.line,column:0},end:{line:v.children[v.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var T,C=(function(E){var B=/{([\d,-]+)}/,U=E.split(",").map(function(te){return te.trim()}).join();if(B.test(U)){var z=B.exec(U)[1],K=E1(z);return function(te){return K.includes(te+1)}}return function(){return!1}})(p),w=(function(E){var B=Uf(/showLineNumbers=(\d+)/i,{lines:1});if(B.test(E)){var U=B.exec(E);return Number(U.groups.lines)}return 1})(p),k=(function(E){for(var B=new Array(E),U=0;U<E;U++)B[U]={type:"element",tagName:"span",properties:{className:[]},children:[]};return B})(v.position.end.line),N=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],A=function(){var E,B,U=T.value,z=U[0],K=U[1];K.properties.className=["code-line"];var te=A1(v,function(ne){return ne.position.start.line<=z+1&&ne.position.end.line>=z+1});K.children=te.children,(p.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(b))&&!N.some(function(ne){return p.toLowerCase().includes(ne)})&&(K.properties.line=[(z+w).toString()],K.properties.className.push("line-number")),C(z)&&K.properties.className.push("highlight-line"),(b==="diff"||(E=b)!=null&&E.includes("diff-"))&&Lr(K).substring(0,1)==="-"?K.properties.className.push("deleted"):(b==="diff"||(B=b)!=null&&B.includes("diff-"))&&Lr(K).substring(0,1)==="+"&&K.properties.className.push("inserted")},R=uf(k.entries());!(T=R()).done;)A();k.length>0&&Lr(k[k.length-1]).trim()===""&&k.pop(),l.children=k}}}})(N1);function sS(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 qi(n){return n===0?"-":n<.01?`$${n.toFixed(4)}`:`$${n.toFixed(2)}`}const UD="_systemContextEvent_1qbiw_1",VD="_systemContextHeader_1qbiw_7",HD="_systemContextBadge_1qbiw_28",PD="_systemContextToggle_1qbiw_37",GD="_systemContextPre_1qbiw_43",$D="_systemContextEllipsis_1qbiw_54",qD="_systemEvent_1qbiw_58",KD="_systemTimestamp_1qbiw_65",YD="_textEvent_1qbiw_69",FD="_toolUseEvent_1qbiw_155",ZD="_toolUseHeader_1qbiw_175",XD="_toolUsePrefix_1qbiw_182",QD="_toolUseName_1qbiw_187",WD="_toolUseArgs_1qbiw_192",JD="_toolResultEvent_1qbiw_203",eR="_toolResultHeader_1qbiw_208",tR="_toolResultIndicatorOk_1qbiw_232",nR="_toolResultIndicatorError_1qbiw_239",aR="_toolResultLabel_1qbiw_246",sR="_toolResultToggle_1qbiw_250",iR="_toolResultCommand_1qbiw_256",oR="_toolResultEllipsis_1qbiw_266",lR="_toolResultPre_1qbiw_270",rR="_errorEvent_1qbiw_291",cR="_statusEvent_1qbiw_299",uR="_userInputEvent_1qbiw_308",dR="_userInputContent_1qbiw_314",fR="_signalEvent_1qbiw_331",hR="_signalBadge_1qbiw_342",mR="_signalContent_1qbiw_351",pR="_usageEvent_1qbiw_356",vR="_usageBadge_1qbiw_363",gR="_defaultEvent_1qbiw_372",Pe={systemContextEvent:UD,systemContextHeader:VD,systemContextBadge:HD,systemContextToggle:PD,systemContextPre:GD,systemContextEllipsis:$D,systemEvent:qD,systemTimestamp:KD,textEvent:YD,toolUseEvent:FD,toolUseHeader:ZD,toolUsePrefix:XD,toolUseName:QD,toolUseArgs:WD,toolResultEvent:JD,toolResultHeader:eR,toolResultIndicatorOk:tR,toolResultIndicatorError:nR,toolResultLabel:aR,toolResultToggle:sR,toolResultCommand:iR,toolResultEllipsis:oR,toolResultPre:lR,errorEvent:rR,statusEvent:cR,userInputEvent:uR,userInputContent:dR,signalEvent:fR,signalBadge:hR,signalContent:mR,usageEvent:pR,usageBadge:vR,defaultEvent:gR},j0=3;function yR({content:n}){const[a,i]=y.useState(!1),l=n.split(`
102
- `),c=l.length>j0,d=a?n:l.slice(0,j0).join(`
103
- `);return r.jsxs("div",{className:Pe.systemContextEvent,"data-testid":"system-context-event",children:[r.jsxs("button",{type:"button",className:Pe.systemContextHeader,onClick:()=>{i(f=>!f)},"aria-expanded":a,children:[r.jsx("span",{className:Pe.systemContextBadge,children:"SYSTEM PROMPT"}),c&&r.jsx("span",{className:Pe.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),r.jsxs("pre",{className:Pe.systemContextPre,children:[d,!a&&c&&r.jsx("span",{className:Pe.systemContextEllipsis,children:"…"})]})]})}function bR({time:n,content:a}){return r.jsxs("div",{className:Pe.systemEvent,children:[r.jsxs("span",{className:Pe.systemTimestamp,children:["[",n,"]"]})," ",a]})}function xR({content:n}){return r.jsx("div",{className:Pe.textEvent,children:r.jsx(Pf,{remarkPlugins:[Gf],rehypePlugins:[zD],children:n})})}function SR({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:Pe.toolUseEvent,children:[r.jsxs("div",{className:Pe.toolUseHeader,children:[r.jsx("span",{className:Pe.toolUsePrefix,children:">"}),a?r.jsx("span",{className:Pe.toolUseName,children:a}):null]}),r.jsx("pre",{className:Pe.toolUseArgs,children:i})]})}const w0=5;function _R(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 TR({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>w0,p=l?n:f.slice(0,w0).join(`
105
- `),g=((i==null?void 0:i.tool)??"")||(d?"Tool error":"Tool output"),b=i?_R(i.tool,i.args):"",x=r.jsxs(r.Fragment,{children:[r.jsx("span",{className:d?Pe.toolResultIndicatorError:Pe.toolResultIndicatorOk,"aria-label":d?"error":"success","data-testid":d?"tool-result-indicator-error":"tool-result-indicator-ok",children:d?"✗":"✓"}),r.jsx("span",{className:Pe.toolResultLabel,"data-testid":"tool-result-label",children:g}),m&&r.jsx("span",{className:Pe.toolResultToggle,"aria-hidden":"true",children:l?"▾":"▸"})]});return r.jsxs("div",{className:Pe.toolResultEvent,"data-testid":"tool-result",children:[m?r.jsx("button",{className:Pe.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{c(_=>!_)},"aria-expanded":l,children:x}):r.jsx("div",{className:Pe.toolResultHeader,"data-testid":"tool-result-header",children:x}),b&&r.jsx("div",{className:Pe.toolResultCommand,children:b}),r.jsxs("pre",{className:Pe.toolResultPre,"data-testid":"tool-result-content",children:[p,!l&&m&&r.jsx("span",{className:Pe.toolResultEllipsis,children:"…"})]})]})}function kR({content:n}){return r.jsxs("div",{className:Pe.errorEvent,children:["Error: ",n]})}function jR({content:n}){return r.jsxs("div",{className:Pe.statusEvent,children:["--- ",n," ---"]})}function wR({content:n}){return r.jsx("div",{className:Pe.userInputEvent,children:r.jsx("span",{className:Pe.userInputContent,children:n})})}function CR({content:n}){return r.jsxs("div",{className:Pe.signalEvent,"data-testid":"signal-event",children:[r.jsx("span",{className:Pe.signalBadge,children:"SIGNAL"}),r.jsx("span",{className:Pe.signalContent,children:n})]})}function NR({content:n}){let a=n;try{const i=JSON.parse(n),l=Number(i.input_tokens)||0,c=Number(i.output_tokens)||0,d=sS(l+c),f=qi(Number(i.cost_usd)||0);a=`${d} tokens · ${f}`}catch{}return r.jsx("div",{className:Pe.usageEvent,"data-testid":"usage-event",children:r.jsx("span",{className:Pe.usageBadge,children:a})})}function ER({content:n}){return r.jsx("div",{className:Pe.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(yR,{content:n.content})}catch{}return r.jsx(bR,{time:i,content:n.content})}case"text":case"output":return r.jsx(xR,{content:n.content});case"tool_use":return r.jsx(SR,{content:n.content});case"tool_result":return r.jsx(TR,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return r.jsx(kR,{content:n.content});case"status":return r.jsx(jR,{content:n.content});case"user_input":return r.jsx(wR,{content:n.content});case"signal":return r.jsx(CR,{content:n.content});case"usage":return r.jsx(NR,{content:n.content});default:return r.jsx(ER,{content:n.content})}}const DR="_overlay_cmicx_1",RR="_dialog_cmicx_11",MR="_title_cmicx_30",OR="_description_cmicx_38",BR="_actions_cmicx_45",LR="_cancelButton_cmicx_52",IR="_confirmButton_cmicx_79",As={overlay:DR,dialog:RR,title:MR,description:OR,actions:BR,cancelButton:LR,confirmButton:IR};function Us({isOpen:n,title:a,description:i,confirmLabel:l="Delete",onConfirm:c,onCancel:d}){const f=y.useId(),m=y.useId();return r.jsx(ea,{children:n&&r.jsx(Et.div,{className:As.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(Et.div,{className:As.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:As.title,children:a}),i&&r.jsx("p",{id:m,className:As.description,children:i}),r.jsxs("div",{className:As.actions,children:[r.jsx("button",{type:"button",className:As.cancelButton,onClick:d,autoFocus:!0,children:"Cancel"}),r.jsx("button",{type:"button",className:As.confirmButton,onClick:c,children:l})]})]})})})}const zR="_spinner_1uyt1_1",UR="_spin_1uyt1_1",VR="_sm_1uyt1_14",HR="_md_1uyt1_20",PR="_lg_1uyt1_26",GR="_xl_1uyt1_32",C0={spinner:zR,spin:UR,sm:VR,md:HR,lg:PR,xl:GR};function iS({size:n="md",className:a,label:i="Loading",liveRegion:l=!1}){return r.jsx("span",{className:`${C0.spinner} ${C0[n]} ${a??""}`,role:l?"status":void 0,"aria-label":i,"aria-hidden":l?void 0:!0})}const $R="_splash_1bn1g_1",qR="_logo_1bn1g_11",N0={splash:$R,logo:qR};function oS(){return r.jsxs("div",{className:N0.splash,"data-testid":"splash-screen",children:[r.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:N0.logo}),r.jsx(iS,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function KR(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 YR={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 FR(n){return YR[n]}function ZR(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=FR(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 XR(n,a){const i=y.useRef(void 0);y.useEffect(()=>{const l=i.current;i.current=n;const c=ZR(l,n);for(const d of c)a(d.message,d.variant)},[n,a])}function QR(n,a,i){const l=n.filter(p=>p.status==="running"||p.status==="idle"||p.status==="waiting").length,c=lS(a),d=a.filter(p=>Vf(p,c)).length,f=a.filter(p=>p.status==="paused"||p.status==="failed"||Vf(p,c)).length,m=i.filter(p=>p.status==="disconnected"||p.status==="error").length;return{activeSessions:l,blockedTasks:d,attentionTasks:f,unhealthyEnvironments:m}}function lS(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function Vf(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function WR(n,a){var f;const i=new Map;for(const m of a)i.set(m.id,m);const l=lS(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}):Vf(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 JR(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 eM(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 tM="_dashboard_16pzm_1",nM="_kpiStrip_16pzm_11",aM="_kpiCard_16pzm_23",sM="_kpiValue_16pzm_68",iM="_kpiLabel_16pzm_76",oM="_bodyGrid_16pzm_84",lM="_section_16pzm_96",rM="_sectionHeader_16pzm_109",cM="_sectionIcon_16pzm_118",uM="_sectionTitle_16pzm_123",dM="_sectionCount_16pzm_131",fM="_sectionBody_16pzm_138",hM="_emptyHint_16pzm_143",mM="_sessionRow_16pzm_150",pM="_sessionPrompt_16pzm_177",vM="_sessionEnv_16pzm_186",gM="_sessionRuntime_16pzm_192",yM="_sessionStatus_16pzm_198",bM="_statusDot_16pzm_207",xM="_attentionRow_16pzm_233",SM="_attentionTitle_16pzm_259",_M="_attentionMeta_16pzm_267",TM="_reasonBadge_16pzm_274",kM="_bottomGrid_16pzm_301",jM="_envRow_16pzm_312",wM="_envName_16pzm_323",CM="_envStatusBadge_16pzm_333",NM="_workspaceRow_16pzm_369",EM="_workspaceTop_16pzm_395",AM="_workspaceName_16pzm_401",DM="_workspaceCounts_16pzm_407",RM="_progressBar_16pzm_415",MM="_progressFill_16pzm_422",ge={dashboard:tM,kpiStrip:nM,kpiCard:aM,kpiValue:sM,kpiLabel:iM,bodyGrid:oM,section:lM,sectionHeader:rM,sectionIcon:cM,sectionTitle:uM,sectionCount:dM,sectionBody:fM,emptyHint:hM,sessionRow:mM,sessionPrompt:pM,sessionEnv:vM,sessionRuntime:gM,sessionStatus:yM,statusDot:bM,attentionRow:xM,attentionTitle:SM,attentionMeta:_M,reasonBadge:TM,bottomGrid:kM,envRow:jM,envName:wM,envStatusBadge:CM,workspaceRow:NM,workspaceTop:EM,workspaceName:AM,workspaceCounts:DM,progressBar:RM,progressFill:MM},OM={hidden:{opacity:0,y:12},visible:n=>({opacity:1,y:0,transition:{delay:n*.06,duration:.3,ease:"easeOut"}})},Kr={hidden:{opacity:0,y:16},visible:n=>({opacity:1,y:0,transition:{delay:.15+n*.08,duration:.35,ease:"easeOut"}})};function BM(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 Yr({value:n,label:a,accent:i,index:l,testId:c}){return r.jsxs(Et.div,{className:ge.kpiCard,"data-accent":i,"data-testid":c,variants:OM,initial:"hidden",animate:"visible",custom:l,children:[r.jsx("span",{className:ge.kpiValue,children:n}),r.jsx("span",{className:ge.kpiLabel,children:a})]})}function LM(){const{workspaces:n,tasks:a,sessions:i,environments:l,loadTasks:c}=ut(),d=xt(),f=y.useRef(new Set);y.useEffect(()=>{for(const b of n)f.current.has(b.id)||(f.current.add(b.id),c(b.id))},[n,c]);const m=y.useMemo(()=>QR(i,a,l),[i,a,l]),p=y.useMemo(()=>JR(i,l),[i,l]),v=y.useMemo(()=>WR(a,n),[a,n]),g=y.useMemo(()=>eM(n,a),[n,a,l]);return r.jsxs("div",{className:ge.dashboard,"data-testid":"dashboard",children:[r.jsxs("div",{className:ge.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[r.jsx(Yr,{value:m.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),r.jsx(Yr,{value:m.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),r.jsx(Yr,{value:m.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),r.jsx(Yr,{value:m.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),r.jsxs("div",{className:ge.bodyGrid,children:[r.jsxs(Et.div,{className:ge.section,variants:Kr,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[r.jsxs("div",{className:ge.sectionHeader,children:[r.jsx("span",{className:ge.sectionIcon,"aria-hidden":"true",children:"●"}),r.jsx("span",{className:ge.sectionTitle,children:"Active Sessions"}),r.jsx("span",{className:ge.sectionCount,children:p.length})]}),r.jsx("div",{className:ge.sectionBody,children:p.length===0?r.jsx("div",{className:ge.emptyHint,children:"No active sessions"}):p.map(({session:b,environmentName:x})=>r.jsxs("button",{type:"button",className:ge.sessionRow,onClick:()=>d(lb(b.id)),"data-testid":"session-row",children:[r.jsx("span",{className:ge.sessionPrompt,title:b.prompt,children:b.prompt||"—"}),r.jsx("span",{className:ge.sessionEnv,children:x}),r.jsx("span",{className:ge.sessionRuntime,children:b.runtime}),r.jsxs("span",{className:ge.sessionStatus,children:[r.jsx("span",{className:ge.statusDot,"data-status":b.status}),b.status]})]},b.id))})]}),r.jsxs(Et.div,{className:ge.section,variants:Kr,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[r.jsxs("div",{className:ge.sectionHeader,children:[r.jsx("span",{className:ge.sectionIcon,"aria-hidden":"true",children:"⚑"}),r.jsx("span",{className:ge.sectionTitle,children:"Needs Attention"}),r.jsx("span",{className:ge.sectionCount,children:v.length})]}),r.jsx("div",{className:ge.sectionBody,children:v.length===0?r.jsx("div",{className:ge.emptyHint,children:"All clear"}):v.map(({task:b,reason:x,workspaceName:_})=>r.jsxs("button",{type:"button",className:ge.attentionRow,onClick:()=>d(Jn(b.id)),"data-testid":"attention-row",children:[r.jsxs("div",{className:ge.attentionTitle,children:[r.jsx("span",{className:ge.reasonBadge,"data-reason":x,children:x}),b.title]}),r.jsx("div",{className:ge.attentionMeta,children:r.jsx("span",{children:_})})]},b.id))})]})]}),r.jsxs("div",{className:ge.bottomGrid,children:[r.jsxs(Et.div,{className:ge.section,variants:Kr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[r.jsxs("div",{className:ge.sectionHeader,children:[r.jsx("span",{className:ge.sectionIcon,"aria-hidden":"true",children:"◈"}),r.jsx("span",{className:ge.sectionTitle,children:"Environment Health"}),r.jsx("span",{className:ge.sectionCount,children:l.length})]}),r.jsx("div",{className:ge.sectionBody,children:l.length===0?r.jsx("div",{className:ge.emptyHint,children:"No environments configured"}):l.map(b=>r.jsxs("div",{className:ge.envRow,"data-testid":"dashboard-env-row",children:[r.jsx("span",{className:ge.envName,children:b.displayName}),r.jsx("span",{className:ge.envStatusBadge,"data-status":b.status,children:b.status})]},b.id))})]}),r.jsxs(Et.div,{className:ge.section,variants:Kr,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[r.jsxs("div",{className:ge.sectionHeader,children:[r.jsx("span",{className:ge.sectionIcon,"aria-hidden":"true",children:"▦"}),r.jsx("span",{className:ge.sectionTitle,children:"Workspaces"}),r.jsx("span",{className:ge.sectionCount,children:n.length})]}),r.jsx("div",{className:ge.sectionBody,children:g.length===0?r.jsx("div",{className:ge.emptyHint,children:"No workspaces yet"}):g.map(({workspace:b,totalTasks:x,completedTasks:_,workingTasks:T,failedTasks:C})=>{const w=x>0?Math.round(_/x*100):0;return r.jsxs("button",{type:"button",className:ge.workspaceRow,onClick:()=>d(Ui(b.id,b.environmentId)),"data-testid":"workspace-row",children:[r.jsxs("div",{className:ge.workspaceTop,children:[r.jsx("span",{className:ge.workspaceName,children:b.name}),r.jsxs("span",{className:ge.workspaceCounts,"aria-label":BM(_,x,T,C),children:[_,"/",x,T>0&&r.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",T]}),C>0&&r.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",C]})]})]}),x>0&&r.jsx("div",{className:ge.progressBar,children:r.jsx("div",{className:ge.progressFill,style:{width:`${w}%`}})})]},b.id)})})]})]})]})}const IM="_panelContainer_aei9x_1",zM="_emptyState_aei9x_8",UM="_fadeIn_aei9x_1",VM="_workspaceSummary_aei9x_17",HM="_workspaceSummaryTitle_aei9x_28",PM="_workspaceSummarySubtitle_aei9x_32",GM="_header_aei9x_36",$M="_headerInfo_aei9x_69",qM="_killButton_aei9x_75",KM="_headerTitle_aei9x_104",YM="_headerActions_aei9x_119",FM="_taskStatusBadge_aei9x_126",ZM="_taskBranch_aei9x_135",XM="_taskBlockedBadge_aei9x_141",QM="_btnPrimary_aei9x_149",WM="_btnDanger_aei9x_180",JM="_btnGhost_aei9x_219",e3="_rejectInput_aei9x_245",t3="_tabBar_aei9x_275",n3="_tab_aei9x_275",a3="_active_aei9x_301",s3="_eventScroll_aei9x_306",i3="_tabContent_aei9x_312",o3="_noContext_aei9x_317",l3="_overviewContent_aei9x_323",r3="_overviewDashboard_aei9x_332",c3="_overviewHero_aei9x_338",u3="_statusBadge_aei9x_345",d3="_statusPending_aei9x_357",f3="_statusAssigned_aei9x_362",h3="_statusInProgress_aei9x_367",m3="_statusReview_aei9x_372",p3="_statusDone_aei9x_377",v3="_statusFailed_aei9x_382",g3="_statusWaitingInput_aei9x_387",y3="_overviewBranchPill_aei9x_392",b3="_branchLink_aei9x_407",x3="_overviewSection_aei9x_418",S3="_overviewLabel_aei9x_424",_3="_overviewValue_aei9x_431",T3="_overviewMuted_aei9x_436",k3="_overviewMarkdown_aei9x_442",j3="_envRow_aei9x_511",w3="_envDot_aei9x_517",C3="_envDotGreen_aei9x_524",N3="_envDotYellow_aei9x_528",E3="_envDotRed_aei9x_532",A3="_envDotGray_aei9x_536",D3="_depList_aei9x_540",R3="_depItem_aei9x_546",M3="_depBlocked_aei9x_553",O3="_depDone_aei9x_557",B3="_timeline_aei9x_561",L3="_timelineRow_aei9x_567",I3="_timelineKey_aei9x_574",z3="_timelineValue_aei9x_580",U3="_timelineDelta_aei9x_584",V3="_reviewNotes_aei9x_595",H3="_overviewDescription_aei9x_606",P3="_waitingMessage_aei9x_612",G3="_errorMessage_aei9x_616",$3="_eventOverflowWarning_aei9x_620",q3="_attemptSelector_aei9x_634",K3="_attemptLabel_aei9x_650",Y3="_attemptButton_aei9x_654",F3="_attemptActive_aei9x_671",Z3="_attemptStatus_aei9x_677",X3="_emptyCta_aei9x_683",Q3="_ctaTitle_aei9x_695",W3="_ctaDescription_aei9x_701",J3="_ctaButton_aei9x_708",eO="_ctaCreateForm_aei9x_743",tO="_ctaCreateInput_aei9x_749",nO="_ctaCreateOk_aei9x_780",aO="_ctaLink_aei9x_815",sO="_workspaceHeader_aei9x_829",iO="_workspaceName_aei9x_854",oO="_workspaceMeta_aei9x_867",lO="_metaRow_aei9x_875",rO="_metaLabel_aei9x_888",cO="_metaValue_aei9x_903",uO="_archiveButton_aei9x_913",dO="_repoLink_aei9x_943",fO="_metaToggle_aei9x_953",hO="_metaToggleArrow_aei9x_974",mO="_metaToggleArrowOpen_aei9x_979",pO="_progressBarContainer_aei9x_983",vO="_progressBar_aei9x_983",gO="_progressFill_aei9x_999",yO="_progressLabel_aei9x_1006",bO="_metaTimestamps_aei9x_1013",xO="_metaTimestamp_aei9x_1013",I={panelContainer:IM,emptyState:zM,fadeIn:UM,workspaceSummary:VM,workspaceSummaryTitle:HM,workspaceSummarySubtitle:PM,header:GM,headerInfo:$M,killButton:qM,headerTitle:KM,headerActions:YM,taskStatusBadge:FM,taskBranch:ZM,taskBlockedBadge:XM,btnPrimary:QM,btnDanger:WM,btnGhost:JM,rejectInput:e3,tabBar:t3,tab:n3,active:a3,eventScroll:s3,tabContent:i3,noContext:o3,overviewContent:l3,overviewDashboard:r3,overviewHero:c3,statusBadge:u3,statusPending:d3,statusAssigned:f3,statusInProgress:h3,statusReview:m3,statusDone:p3,statusFailed:v3,statusWaitingInput:g3,overviewBranchPill:y3,branchLink:b3,overviewSection:x3,overviewLabel:S3,overviewValue:_3,overviewMuted:T3,overviewMarkdown:k3,envRow:j3,envDot:w3,envDotGreen:C3,envDotYellow:N3,envDotRed:E3,envDotGray:A3,depList:D3,depItem:R3,depBlocked:M3,depDone:O3,timeline:B3,timelineRow:L3,timelineKey:I3,timelineValue:z3,timelineDelta:U3,reviewNotes:V3,overviewDescription:H3,waitingMessage:P3,errorMessage:G3,eventOverflowWarning:$3,attemptSelector:q3,attemptLabel:K3,attemptButton:Y3,attemptActive:F3,attemptStatus:Z3,emptyCta:X3,ctaTitle:Q3,ctaDescription:W3,ctaButton:J3,ctaCreateForm:eO,ctaCreateInput:tO,ctaCreateOk:nO,ctaLink:aO,workspaceHeader:sO,workspaceName:iO,workspaceMeta:oO,metaRow:lO,metaLabel:rO,metaValue:cO,archiveButton:uO,repoLink:dO,metaToggle:fO,metaToggleArrow:hO,metaToggleArrowOpen:mO,progressBarContainer:pO,progressBar:vO,progressFill:gO,progressLabel:yO,metaTimestamps:bO,metaTimestamp:xO};function SO(){return r.jsx("div",{className:I.emptyState,children:"Select a task or click + to create one"})}function _O(){return r.jsx("div",{className:I.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function TO(){const{workspaces:n,environments:a}=ut(),i=xt(),l=a.length>0;return n.length>0?r.jsx(LM,{}):r.jsxs("div",{className:I.emptyCta,"data-testid":"welcome-cta",children:[r.jsx("div",{className:I.ctaTitle,children:"Welcome to Grackle"}),r.jsx("div",{className:I.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r.jsx("button",{className:I.ctaButton,onClick:()=>i(ub),disabled:!l,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!l&&r.jsx("div",{className:I.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const rS=50;function kO(n,a,i,l,c=rS){return l?n<c:a-n-i<c}function jO(n,a){const i=a-n;return i>0?i:0}function wO({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=kO(v.scrollTop,v.scrollHeight,v.clientHeight,i,rS);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=jO(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 CO="_wrapper_p24zt_1",NO="_scrollContainer_p24zt_9",EO="_toolbar_p24zt_15",AO="_directionToggle_p24zt_22",DO="_scrollToAnchor_p24zt_60",RO="_scrollToAnchorBottom_p24zt_84",MO="_scrollToAnchorTop_p24zt_88",Ds={wrapper:CO,scrollContainer:NO,toolbar:EO,directionToggle:AO,scrollToAnchor:DO,scrollToAnchorBottom:RO,scrollToAnchorTop:MO},cS="grackle-stream-direction";function OO(){try{return localStorage.getItem(cS)==="reversed"}catch{return!1}}function BO({eventsDropped:n}){return n<=0?r.jsx(r.Fragment,{}):r.jsxs("div",{className:I.eventOverflowWarning,role:"alert",children:["⚠"," ",n.toLocaleString()," older event",n===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function Lh({events:n,eventsDropped:a,emptyState:i}){const l=y.useRef(null),[c,d]=y.useState(OO),f=E2(),m=y.useMemo(()=>c?[...n].reverse():n,[n,c]),{isAtAnchor:p,scrollToAnchor:v}=wO({scrollRef:l,contentLength:n.length,isReversed:c}),g=()=>{const _=!c;d(_);try{localStorage.setItem(cS,_?"reversed":"default")}catch{}},b=f?0:.2,x=c?-8:8;return r.jsxs("div",{className:Ds.wrapper,children:[r.jsx("div",{className:Ds.toolbar,children:r.jsx("button",{className:Ds.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:Ds.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,r.jsx(BO,{eventsDropped:a}),r.jsx(ea,{initial:!1,children:m.map((_,T)=>{const C=c?n.length-1-T:T;return r.jsx(Et.div,{initial:{opacity:0,y:x},animate:{opacity:1,y:0},transition:{duration:b,ease:"easeOut"},children:r.jsx(AR,{event:_,toolUseCtx:_.toolUseCtx})},`${_.sessionId}-${_.timestamp}-${C}`)})})]}),r.jsx(ea,{children:!p&&r.jsxs(Et.button,{className:`${Ds.scrollToAnchor} ${c?Ds.scrollToAnchorTop:Ds.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 LO="_bar_1xhb4_1",IO="_input_1xhb4_32",zO="_select_1xhb4_67",UO="_btnPrimary_1xhb4_103",VO="_btnDanger_1xhb4_134",HO="_btnGhost_1xhb4_173",PO="_badge_1xhb4_195",GO="_disconnectHint_1xhb4_205",on={bar:LO,input:IO,select:zO,btnPrimary:UO,btnDanger:VO,btnGhost:HO,badge:PO,disconnectHint:GO};function $O(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 qO({environmentId:n,onReconnect:a}){return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:on.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),r.jsx("button",{type:"button",onClick:()=>a(n),className:on.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function ml({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:_}=Ca(),[T,C]=y.useState(""),[w,k]=y.useState(""),N=$O(i,p),A=R=>{if(R.preventDefault(),!!T.trim())if(n==="send"){if(!a||N)return;v(a,T),C("")}else if(n==="spawn"){if(!i)return;g(i,T,w),_("Session started","success"),C(""),k("")}else{if(!l)return;b(l,void 0,i,T),C("")}};return n==="spawn"?r.jsxs("form",{onSubmit:A,className:on.bar,children:[r.jsx("span",{className:on.badge,children:"new chat"}),r.jsx("input",{type:"text",value:T,onChange:R=>C(R.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:on.input}),d&&r.jsxs("select",{value:w,onChange:R=>k(R.target.value),className:on.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:!T.trim()||!i,className:on.btnPrimary,children:"Go"})]}):n==="start"?r.jsxs("form",{onSubmit:A,className:on.bar,children:[r.jsx("input",{type:"text",value:T,onChange:R=>C(R.target.value),placeholder:"Type a message...",autoFocus:!0,className:on.input}),r.jsx("button",{type:"submit",disabled:!T.trim(),className:on.btnPrimary,children:"Send"})]}):r.jsxs("form",{onSubmit:A,className:on.bar,children:[N&&i&&r.jsx(qO,{environmentId:i,onReconnect:x}),r.jsx("input",{type:"text",value:T,onChange:R=>C(R.target.value),placeholder:"Type a message...",autoFocus:!N,disabled:N,className:on.input}),r.jsx("span",{title:N?"Environment is unavailable — reconnect first":void 0,children:r.jsx("button",{type:"submit",disabled:!T.trim()||N,className:on.btnPrimary,children:"Send"})}),c&&f&&r.jsx("button",{type:"button",onClick:f,className:on.btnDanger,title:"Stop session",children:"Stop"})]})}function Ih(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 zh(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 KO="_panelContainer_pz4cr_1",YO="_emptyState_pz4cr_8",FO="_emptyTitle_pz4cr_20",ZO="_emptyDescription_pz4cr_26",XO="_emptyHint_pz4cr_32",Jo={panelContainer:KO,emptyState:YO,emptyTitle:FO,emptyDescription:ZO,emptyHint:XO};function QO({hasLocalEnvironment:n}){return r.jsxs("div",{className:Jo.emptyState,"data-testid":"chat-empty-state",children:[r.jsx("div",{className:Jo.emptyTitle,children:"Welcome to Grackle"}),r.jsx("div",{className:Jo.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:Jo.emptyHint,children:"Go to Settings → Environments to add one."})]})}function WO(){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:_}=ut(),T=y.useRef(void 0),[C,w]=y.useState(),k=n.find(z=>z.id===Po),N=k!=null&&k.latestSessionId?a.find(z=>z.id===k.latestSessionId)??(p[Po]??[]).find(z=>z.id===k.latestSessionId):void 0;y.useEffect(()=>{d(Po)},[d]),y.useEffect(()=>{k!=null&&k.latestSessionId&&d(Po)},[k==null?void 0:k.latestSessionId,d]),y.useEffect(()=>{N&&N.id!==T.current&&(T.current=N.id,f(N.id))},[N==null?void 0:N.id,f]);const A=y.useMemo(()=>{if(!N)return[];const z=i.filter(K=>K.sessionId===N.id);return zh(Ih(z))},[i,N==null?void 0:N.id]),R=c.find(z=>z.adapterType==="local"&&z.status==="connected"),E=N!==void 0&&N.status!=="stopped"&&N.status!=="suspended",B=(N==null?void 0:N.status)==="idle";y.useEffect(()=>{C&&N&&B&&(v(N.id,C),w(void 0))},[C,B,N==null?void 0:N.id,v]);const U=y.useCallback((z,K,te,ne)=>{ne&&w(ne),b(z,K,te)},[b]);return r.jsxs("div",{className:Jo.panelContainer,"data-testid":"chat-page",children:[r.jsx(Lh,{events:A,eventsDropped:l,emptyState:r.jsx(QO,{hasLocalEnvironment:!!R})}),R&&E&&r.jsx(ml,{mode:"send",sessionId:N.id,environmentId:N.environmentId,showStop:!0,onSessionKill:()=>m(N.id),personas:x,environments:c,onSendInput:v,onSpawn:g,onStartTask:b,onProvisionEnvironment:_}),R&&!E&&r.jsx(ml,{mode:"start",taskId:Po,environmentId:R.id,personas:x,environments:c,onSendInput:v,onSpawn:g,onStartTask:U,onProvisionEnvironment:_})]})}function JO(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 Vs={label:"Home",url:zs};function e6(n){return n?[Vs,{label:"Settings",url:zi},{label:n,url:void 0}]:[Vs,{label:"Settings",url:void 0}]}const uS={label:"Environments",url:Vi};function t6(){return[Vs,{label:"Environments",url:void 0}]}function n6(){return[Vs,{label:"New Chat",url:void 0}]}function a6(n){return[Vs,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function s6(n,a,i,l){const c=i.find(f=>f.id===n),d=l.find(f=>f.id===a);return[Vs,uS,{label:(d==null?void 0:d.displayName)??"Environment",url:Hi(a)},{label:(c==null?void 0:c.name)??"Workspace",url:void 0}]}function i6(n,a,i,l,c){const d=JO(n,c),f=c.get(n),m=f==null?void 0:f.workspaceId,p=m?i.find(_=>_.id===m):void 0,v=a??(p==null?void 0:p.environmentId),g=v?l.find(_=>_.id===v):void 0,b=[Vs];g&&v&&(b.push(uS),b.push({label:g.displayName,url:Hi(v)})),p&&v&&b.push({label:p.name,url:Ui(p.id,v)});for(let _=0;_<d.length-1;_++)b.push({label:d[_].title,url:Jn(d[_].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 o6(){const n=n6(),[a]=Wf(),i=a.get("env")??"",{sendInput:l,spawn:c,startTask:d,personas:f,environments:m,provisionEnvironment:p}=ut();return r.jsxs("div",{className:I.panelContainer,children:[r.jsx(us,{segments:n}),r.jsx("div",{className:I.emptyState,children:"Enter a prompt below to start a new session"}),r.jsx(ml,{mode:"spawn",environmentId:i,showPersonaSelect:!0,personas:f,environments:m,onSendInput:l,onSpawn:c,onStartTask:d,onProvisionEnvironment:p})]})}function l6({sessionId:n,session:a,isActive:i,onKill:l}){return r.jsxs("div",{className:I.header,children:[r.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.endReason||a.status}`,a!=null&&a.inputTokens||a!=null&&a.outputTokens||a!=null&&a.costUsd?` | ${sS((a.inputTokens??0)+(a.outputTokens??0))} tokens · ${qi(a.costUsd??0)}`:""]}),r.jsxs("span",{className:I.headerInfo,children:[a&&r.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&r.jsx("button",{onClick:()=>l(n),title:"Stop session",className:I.killButton,children:"×"})]})]})}function r6({session:n}){const a=n&&(n.status==="stopped"||n.status==="suspended"),i=a?`Session ${n.endReason||n.status} with no events recorded.`:"Waiting for events...";return r.jsx("div",{className:a?I.errorMessage:I.waitingMessage,children:i})}function c6(){const{sessionId:n}=rs(),{events:a,eventsDropped:i,sessions:l,kill:c,loadSessionEvents:d,sendInput:f,spawn:m,startTask:p,personas:v,environments:g,provisionEnvironment:b}=ut(),x=y.useRef(void 0),_=a6(n),T=l.find(k=>k.id===n)??void 0,C=y.useMemo(()=>{const k=n?a.filter(N=>N.sessionId===n):[];return zh(Ih(k))},[a,n]);if(y.useEffect(()=>{n&&n!==x.current&&(x.current=n,d(n))},[n,d]),!n)return r.jsx("div",{className:I.emptyState,children:"No session selected"});const w=(T==null?void 0:T.status)==="running"||(T==null?void 0:T.status)==="idle";return r.jsxs("div",{className:I.panelContainer,children:[r.jsx(us,{segments:_}),r.jsx(l6,{sessionId:n,session:T,isActive:w,onKill:c}),r.jsx(Lh,{events:C,eventsDropped:i,emptyState:r.jsx(r6,{session:T})}),w&&r.jsx(ml,{mode:"send",sessionId:n,environmentId:T.environmentId,showStop:!0,onSessionKill:()=>c(n),personas:v,environments:g,onSendInput:f,onSpawn:m,onStartTask:p,onProvisionEnvironment:b})]})}function u6(n){if(!n)return!1;const a=n.tagName;return!!(a==="INPUT"||a==="TEXTAREA"||a==="SELECT"||n.isContentEditable)}function ka(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&&u6(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 E0=220,A0=70,d6=40,f6=60,h6="hierarchy",m6="dependency";function p6(n){return y.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new Lg.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:d6,ranksep:f6});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:E0,height:A0});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:h6},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:m6},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Lg.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-E0/2,y:m.y-A0/2},data:{task:f,childCount:p.length,doneChildCount:p.filter(v=>v.status==="complete").length,hasDependencies:f.dependsOn.length>0}}}),edges:c}},[n])}const v6="_dagContainer_js4w6_1",g6="_taskNode_js4w6_26",y6="_taskNodeBorder_js4w6_54",b6="_taskNodeContent_js4w6_60",x6="_taskNodeHeader_js4w6_70",S6="_taskNodeIcon_js4w6_77",_6="_taskNodeTitle_js4w6_82",T6="_taskNodeBadges_js4w6_90",k6="_childBadge_js4w6_95",j6="_depBadge_js4w6_107",w6="_handle_js4w6_119",C6="_emptyCta_js4w6_126",N6="_ctaDescription_js4w6_137",E6="_ctaButton_js4w6_144",Qt={dagContainer:v6,taskNode:g6,taskNodeBorder:y6,taskNodeContent:b6,taskNodeHeader:x6,taskNodeIcon:S6,taskNodeTitle:_6,taskNodeBadges:T6,childBadge:k6,depBadge:j6,handle:w6,emptyCta:C6,ctaDescription:N6,ctaButton:E6};function A6({data:n}){const{task:a,childCount:i,doneChildCount:l,hasDependencies:c}=n,d=ls(a.status);return r.jsxs("div",{className:Qt.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[r.jsx(Ig,{type:"target",position:zg.Top,className:Qt.handle}),r.jsx("div",{className:Qt.taskNodeBorder,style:{backgroundColor:d.color}}),r.jsxs("div",{className:Qt.taskNodeContent,children:[r.jsxs("div",{className:Qt.taskNodeHeader,children:[r.jsx("span",{className:Qt.taskNodeIcon,style:{color:d.color},children:d.icon}),r.jsx("span",{className:Qt.taskNodeTitle,children:a.title})]}),r.jsxs("div",{className:Qt.taskNodeBadges,children:[i>0&&r.jsxs("span",{className:Qt.childBadge,children:[l,"/",i]}),c&&r.jsx("span",{className:Qt.depBadge,children:"dep"})]})]}),r.jsx(Ig,{type:"source",position:zg.Bottom,className:Qt.handle})]})}const D6=O2,R6={task:A6};function M6({workspaceId:n,environmentId:a,tasks:i}){const l=xt(),{resolvedThemeId:c}=yb(),d=y.useMemo(()=>i.filter(b=>b.workspaceId===n),[i,n]),{nodes:f,edges:m}=p6(d),p=y.useMemo(()=>{const b=getComputedStyle(document.documentElement),x={};for(const[_,T]of Object.entries(D6))x[_]=b.getPropertyValue(T).trim()||"#6b7a8d";return x},[c]),v=y.useCallback((b,x)=>{l(Jn(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:Qt.emptyCta,children:[r.jsx("button",{className:Qt.ctaButton,onClick:()=>l(Gs(n,void 0,a)),children:"Create Task"}),r.jsx("div",{className:Qt.ctaDescription,children:"Create tasks to see the dependency graph"})]}):r.jsx("div",{className:Qt.dagContainer,children:r.jsxs(R1,{nodes:f,edges:m,nodeTypes:R6,onNodeClick:v,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[r.jsx(M1,{variant:O1.Dots,gap:24,size:1,color:"var(--text-disabled)"}),r.jsx(B1,{showInteractive:!1}),r.jsx(L1,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function O6({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(_0.map(d=>[d,[]]));for(const d of n){const f=Bh(d.status),m=d.dependsOn.length>0&&d.dependsOn.some(T=>a.get(T)!=="complete"),p=l.get(d.id)??[],v=p.length,g=p.filter(T=>T.status==="complete").length;let b;if(f==="paused"&&i){const T=i.get(d.id);T==="idle"?b="Needs input":T==="completed"&&(b="Ready to complete")}const x={task:d,isBlocked:m,childCount:v,doneChildCount:g,pausedSubBadge:b},_=c.get(f);_?_.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 _0.map(d=>{const f=ls(d);return{status:d,label:f.label,style:f,tasks:c.get(d)??[]}})}const B6="_boardContainer_1c4y1_1",L6="_column_1c4y1_17",I6="_columnHeader_1c4y1_34",z6="_columnIcon_1c4y1_47",U6="_columnLabel_1c4y1_52",V6="_columnCount_1c4y1_57",H6="_cardList_1c4y1_67",P6="_emptyPlaceholder_1c4y1_76",G6="_card_1c4y1_67",$6="_cardHeader_1c4y1_107",q6="_cardStatusIcon_1c4y1_113",K6="_cardTitle_1c4y1_119",Y6="_cardBadges_1c4y1_127",F6="_badge_1c4y1_134",Z6="_blockedBadge_1c4y1_146",X6="_childBadge_1c4y1_151",Q6="_depBadge_1c4y1_155",W6="_parentBadge_1c4y1_159",J6="_pausedSubBadge_1c4y1_166",e4="_personaBadge_1c4y1_170",t4="_envBadge_1c4y1_174",n4="_emptyCta_1c4y1_178",a4="_ctaButton_1c4y1_188",s4="_ctaDescription_1c4y1_204",Ze={boardContainer:B6,column:L6,columnHeader:I6,columnIcon:z6,columnLabel:U6,columnCount:V6,cardList:H6,emptyPlaceholder:P6,card:G6,cardHeader:$6,cardStatusIcon:q6,cardTitle:K6,cardBadges:Y6,badge:F6,blockedBadge:Z6,childBadge:X6,depBadge:Q6,parentBadge:W6,pausedSubBadge:J6,personaBadge:e4,envBadge:t4,emptyCta:n4,ctaButton:a4,ctaDescription:s4};function i4({workspaceId:n,environmentId:a,tasks:i,sessions:l,personas:c,environments:d}){const f=xt(),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(N=>[N.id,N])),_=new Map(c.map(N=>[N.id,N])),T=new Map(d.map(N=>[N.id,N])),C=new Map,w=new Map,k=new Map;for(const N of m)if(N.latestSessionId){const A=x.get(N.latestSessionId);if(A){if(C.set(N.id,A.endReason||A.status),A.personaId){const R=_.get(A.personaId);R&&w.set(N.id,R.name)}if(A.environmentId){const R=T.get(A.environmentId);R&&k.set(N.id,R.displayName)}}}return{sessionStatusByTaskId:C,personaNameByTaskId:w,environmentNameByTaskId:k}},[m,l,c,d]),b=y.useMemo(()=>O6({tasks:m,taskStatusById:p,sessionStatusByTaskId:g.sessionStatusByTaskId}),[m,p,g]);return m.length===0?r.jsxs("div",{className:Ze.emptyCta,"data-testid":"board-empty-cta",children:[r.jsx("button",{className:Ze.ctaButton,onClick:()=>f(Gs(n,void 0,a)),children:"Create Task"}),r.jsx("div",{className:Ze.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):r.jsx("div",{className:Ze.boardContainer,"data-testid":"board-container",children:b.map(x=>r.jsxs("section",{className:Ze.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:Ze.columnHeader,children:[r.jsx("span",{className:Ze.columnIcon,style:{color:x.style.color},children:x.style.icon}),r.jsx("span",{className:Ze.columnLabel,children:x.label}),r.jsx("span",{className:Ze.columnCount,"data-testid":`board-count-${x.status}`,children:x.tasks.length})]}),r.jsx("div",{className:Ze.cardList,children:x.tasks.length===0?r.jsx("div",{className:Ze.emptyPlaceholder,children:"No tasks"}):r.jsx(ea,{mode:"popLayout",children:x.tasks.map(_=>r.jsx(Et.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:r.jsx(o4,{boardTask:_,tasksById:v,personaName:g.personaNameByTaskId.get(_.task.id),envName:g.environmentNameByTaskId.get(_.task.id),onClick:()=>f(Jn(_.task.id,void 0,n,a))})},_.task.id))})})]},x.status))})}function o4({boardTask:n,tasksById:a,personaName:i,envName:l,onClick:c}){const{task:d,isBlocked:f,childCount:m,doneChildCount:p,pausedSubBadge:v}=n,g=ls(d.status),b=d.parentTaskId?a.get(d.parentTaskId):void 0;return r.jsxs("div",{className:Ze.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:Ze.cardHeader,children:[r.jsx("span",{className:Ze.cardStatusIcon,style:{color:g.color},children:g.icon}),r.jsx("span",{className:Ze.cardTitle,children:d.title})]}),r.jsxs("div",{className:Ze.cardBadges,children:[b&&r.jsx("span",{className:`${Ze.badge} ${Ze.parentBadge}`,title:b.title,children:b.title}),m>0&&r.jsxs("span",{className:`${Ze.badge} ${Ze.childBadge}`,children:[p,"/",m]}),f&&r.jsx("span",{className:`${Ze.badge} ${Ze.blockedBadge}`,children:"blocked"}),d.dependsOn.length>0&&!f&&r.jsx("span",{className:`${Ze.badge} ${Ze.depBadge}`,children:"dep"}),v&&r.jsx("span",{className:`${Ze.badge} ${Ze.pausedSubBadge}`,children:v}),i&&r.jsx("span",{className:`${Ze.badge} ${Ze.personaBadge}`,children:i}),l&&r.jsx("span",{className:`${Ze.badge} ${Ze.envBadge}`,children:l})]})]})}function Uh(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(""),_=y.useRef(!1),T=d===c,C=y.useCallback(U=>{g(U),x("")},[]),w=y.useCallback(()=>{x("")},[]),k=y.useCallback(()=>{_.current=!1,f==null||f(null),g(""),x("")},[f]),N=y.useCallback(()=>{const U=p?v.trim():v;if(l){const K=l(v);if(K){x(K);return}}const z=p?a.trim():a;if(U===z){k();return}i(U),k()},[v,a,p,l,i,k]),A=y.useCallback(()=>{_.current=!0,f==null||f(c),g(a),x("")},[c,a,f]),R=y.useCallback(U=>{if(_.current){_.current=!1;return}U.relatedTarget instanceof HTMLElement&&U.relatedTarget.dataset.editAction===c||N()},[c,N]),E=y.useCallback(U=>{U.key==="Escape"?k():U.key==="Enter"&&m&&N()},[k,m,N]),B=(()=>{if(!T)return!1;const U=p?a.trim():a;return(p?v.trim():v)!==U})();return y.useEffect(()=>{!T&&(v!==""||b!=="")&&(g(""),x(""))},[T,v,b]),{isEditing:T,draft:v,error:b,isDirty:B,startEdit:A,cancelEdit:k,save:N,setDraft:C,clearError:w,handleBlur:R,handleKeyDown:E,ignoreInitialBlurRef:_}}const l4="_editFieldWrapper_yuzty_1",r4="_editInput_yuzty_10",c4="_editTextarea_yuzty_42",u4="_editSelect_yuzty_78",d4="_editError_yuzty_111",f4="_editInputInvalid_yuzty_118",h4="_editHint_yuzty_123",m4="_unsavedDot_yuzty_132",p4="_metaValueClickable_yuzty_140",v4="_editButton_yuzty_159",g4="_metaPlaceholder_yuzty_175",y4="_worktreeToggle_yuzty_180",qe={editFieldWrapper:l4,editInput:r4,editTextarea:c4,editSelect:u4,editError:d4,editInputInvalid:f4,editHint:h4,unsavedDot:m4,metaValueClickable:p4,editButton:v4,metaPlaceholder:g4,worktreeToggle:y4};function qt(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":_}=n,T=y.useRef(null),C=Uh({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 N;(N=T.current)==null||N.focus()},0);return()=>window.clearTimeout(k)}},[C.isEditing]),c==="create"){const k=A=>{p==null||p(A.target.value)},N=l==null?void 0:l(a);return r.jsxs("div",{className:qe.editFieldWrapper,children:[r.jsx("input",{className:`${qe.editInput} ${N?qe.editInputInvalid:""}`,value:a,onChange:k,maxLength:b,placeholder:g,"aria-label":x,"data-testid":_?`${_}-input`:void 0}),N&&r.jsx("span",{className:qe.editError,"data-testid":"edit-error",children:N})]})}if(C.isEditing)return r.jsxs("div",{className:qe.editFieldWrapper,children:[r.jsx("input",{ref:T,className:`${qe.editInput} ${C.error?qe.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":_?`${_}-input`:void 0}),C.isDirty&&r.jsx("span",{className:qe.unsavedDot,title:"Unsaved changes"}),C.error&&r.jsx("span",{className:qe.editError,"data-testid":"edit-error",children:C.error}),r.jsx("span",{className:qe.editHint,children:"Enter to save · Esc to cancel"})]});const w=v==null?void 0:v(a);return r.jsxs("span",{role:"button",tabIndex:0,className:qe.metaValueClickable,onClick:()=>C.startEdit(),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),C.startEdit())},title:"Click to edit","aria-label":x,"data-testid":_?`${_}-button`:void 0,children:[w!==void 0?w:a?r.jsx("span",{children:a}):r.jsx("span",{className:qe.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:qe.editButton,"aria-hidden":"true",children:"✏️"})]})}function Hf(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,_=y.useRef(null),T=Uh({value:a,onSave:i,validate:l,fieldId:d,activeFieldId:f,onActivate:m,enterToSave:!1,trimOnSave:!1});if(y.useEffect(()=>{if(T.isEditing){const w=window.setTimeout(()=>{var k;(k=_.current)==null||k.focus()},0);return()=>window.clearTimeout(w)}},[T.isEditing]),c==="create"){const w=N=>{p==null||p(N.target.value)},k=l==null?void 0:l(a);return r.jsxs("div",{className:qe.editFieldWrapper,children:[r.jsx("textarea",{className:`${qe.editTextarea} ${k?qe.editInputInvalid:""}`,value:a,onChange:w,placeholder:g,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),k&&r.jsx("span",{className:qe.editError,"data-testid":"edit-error",children:k})]})}if(T.isEditing)return r.jsxs("div",{className:qe.editFieldWrapper,children:[r.jsx("textarea",{ref:_,className:`${qe.editTextarea} ${T.error?qe.editInputInvalid:""}`,value:T.draft,onChange:w=>T.setDraft(w.target.value),onBlur:T.handleBlur,onKeyDown:T.handleKeyDown,title:b,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),T.isDirty&&r.jsx("span",{className:qe.unsavedDot,title:"Unsaved changes"}),T.error&&r.jsx("span",{className:qe.editError,"data-testid":"edit-error",children:T.error}),r.jsx("span",{className:qe.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:qe.metaValueClickable,onClick:()=>T.startEdit(),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),T.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:qe.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:qe.editButton,"aria-hidden":"true",children:"✏️"})]})}function hc(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,_=y.useRef(null),T=Uh({value:a,onSave:i,fieldId:d,activeFieldId:f,onActivate:m,enterToSave:!1,trimOnSave:!1});y.useEffect(()=>{if(T.isEditing){const R=window.setTimeout(()=>{var E;(E=_.current)==null||E.focus()},0);return()=>window.clearTimeout(R)}},[T.isEditing]);const C=y.useCallback(R=>{const E=R.target.value;T.ignoreInitialBlurRef.current=!1,E!==a&&i(E),T.cancelEdit()},[a,i,T]),w=y.useCallback(R=>{if(T.ignoreInitialBlurRef.current){T.ignoreInitialBlurRef.current=!1;return}R.relatedTarget instanceof HTMLElement&&R.relatedTarget.dataset.editAction===d||T.cancelEdit()},[d,T]);if(l==="create")return r.jsx("select",{className:qe.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(T.isEditing)return r.jsx("select",{ref:_,className:qe.editSelect,value:T.draft,onChange:C,onBlur:w,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),N=(A=c.find(R=>R.value===a))==null?void 0:A.label;return r.jsxs("button",{type:"button",className:qe.metaValueClickable,onClick:()=>T.startEdit(),title:"Click to change","aria-label":b,"data-testid":x?`${x}-button`:void 0,children:[k!==void 0?k:N?r.jsx("span",{children:N}):r.jsx("span",{className:qe.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:qe.editButton,"aria-hidden":"true",children:"✏️"})]})}function b4(n){const{checked:a,onChange:i,label:l,ariaLabel:c,"data-testid":d}=n;return r.jsxs("label",{className:qe.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 x4="_envRow_1e1r5_1",S4="_envDot_1e1r5_7",_4="_envDotGreen_1e1r5_14",T4="_envDotYellow_1e1r5_18",k4="_envDotRed_1e1r5_22",j4="_envDotGray_1e1r5_26",Ii={envRow:x4,envDot:S4,envDotGreen:_4,envDotYellow:T4,envDotRed:k4,envDotGray:j4};function w4(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Ii.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Ii.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Ii.envDotRed:Ii.envDotGray}function C4(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(T=>T.id===a),x=[...c?[{value:"",label:"None"}]:[],...l.map(T=>({value:T.id,label:T.displayName}))],_=()=>{if(b)return r.jsxs("span",{className:Ii.envRow,children:[r.jsx("span",{className:`${Ii.envDot} ${w4(b.status)}`}),b.displayName]})};return r.jsx(hc,{value:a,onSave:i,options:x,fieldId:d,activeFieldId:f,onActivate:m,renderDisplay:_,placeholder:p,ariaLabel:v,"data-testid":g})}function D0(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 df=100;function N4(n){try{const a=new URL(n);return a.protocol!=="http:"&&a.protocol!=="https:"?void 0:a.toString()}catch{return}}function E4(){const{workspaceId:n,environmentId:a}=rs(),i=xt(),{tasks:l,environments:c,workspaces:d,personas:f,sessions:m,archiveWorkspace:p,updateWorkspace:v,usageCache:g,loadUsage:b}=ut(),[x,_]=y.useState("tasks"),[T,C]=y.useState(!1),[w,k]=y.useState(null),[N,A]=y.useState(!1),R=y.useRef(void 0),E=d.find(q=>q.id===n),B=a??(E==null?void 0:E.environmentId)??"",U=s6(n,B,d,c);ka({key:"1"},()=>_("graph")),ka({key:"2"},()=>_("board")),ka({key:"3"},()=>_("tasks")),y.useEffect(()=>{const q=R.current;R.current=n,!(q===void 0||q===n)&&w!==null&&k(null)},[n,w]);const z=m.reduce((q,ae)=>q+(ae.costUsd??0),0);y.useEffect(()=>{n&&b("workspace",n)},[n,b,z]);const K=n?g[`workspace:${n}`]:void 0,te=l.filter(q=>q.workspaceId===n),ne=te.filter(q=>q.status==="complete").length,ie=te.length,le=ie>0?Math.round(ne/ie*100):0;return r.jsxs("div",{className:I.panelContainer,children:[r.jsx(us,{segments:U}),r.jsxs("div",{className:I.workspaceHeader,children:[r.jsx("span",{className:I.workspaceName,"data-testid":"workspace-name",children:r.jsx(qt,{value:(E==null?void 0:E.name)||"",onSave:q=>{E&&v(E.id,{name:q})},validate:q=>{const ae=q.trim();if(!ae)return"Name is required";if(ae.length>df)return`Max ${df} characters`},maxLength:df,fieldId:"name",activeFieldId:w,onActivate:k,ariaLabel:"Workspace name",renderDisplay:q=>q||n||void 0,"data-testid":"edit-name"})}),r.jsx("button",{className:I.archiveButton,onClick:()=>C(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),r.jsxs("button",{className:I.metaToggle,onClick:()=>A(!N),"aria-expanded":!N,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[r.jsx("span",{className:`${I.metaToggleArrow} ${N?"":I.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!N&&r.jsxs("div",{className:I.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Description"}),r.jsx("div",{className:I.metaValue,children:r.jsx(Hf,{value:(E==null?void 0:E.description)||"",onSave:q=>{E&&v(E.id,{description:q})},fieldId:"description",activeFieldId:w,onActivate:k,renderDisplay:q=>q?r.jsx("span",{className:I.overviewMarkdown,children:r.jsx(Pf,{remarkPlugins:[Gf],children:q})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Repository"}),r.jsx("div",{className:I.metaValue,children:r.jsx(qt,{value:(E==null?void 0:E.repoUrl)||"",onSave:q=>{E&&v(E.id,{repoUrl:q})},validate:q=>{const ae=q.trim();if(ae&&!/^https?:\/\/.+/.test(ae))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:w,onActivate:k,renderDisplay:q=>{const ae=N4(q);return ae?r.jsx("a",{className:I.repoLink,href:ae,target:"_blank",rel:"noopener noreferrer",onClick:O=>O.stopPropagation(),children:q}):q?r.jsx("span",{children:q}):void 0},placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Environment"}),r.jsx("div",{className:I.metaValue,children:r.jsx(C4,{value:(E==null?void 0:E.environmentId)||"",onSave:q=>{E&&q&&v(E.id,{environmentId:q})},environments:c,fieldId:"environmentId",activeFieldId:w,onActivate:k,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Persona"}),r.jsx("div",{className:I.metaValue,children:r.jsx(hc,{value:(E==null?void 0:E.defaultPersonaId)||"",onSave:q=>{E&&v(E.id,{defaultPersonaId:q})},options:[{value:"",label:"(Inherit)"},...f.map(q=>({value:q.id,label:q.name}))],fieldId:"defaultPersonaId",activeFieldId:w,onActivate:k,renderDisplay:q=>{const ae=f.find(O=>O.id===q);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:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Worktrees"}),r.jsx("div",{className:I.metaValue,children:r.jsx(b4,{checked:(E==null?void 0:E.useWorktrees)??!0,onChange:q=>{E&&v(E.id,{useWorktrees:q})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Working Dir"}),r.jsx("div",{className:I.metaValue,children:r.jsx(qt,{value:(E==null?void 0:E.workingDirectory)||"",onSave:q=>{E&&v(E.id,{workingDirectory:q})},fieldId:"workingDirectory",activeFieldId:w,onActivate:k,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-working-directory"})})]}),E&&r.jsxs("div",{className:I.metaTimestamps,children:[r.jsxs("span",{className:I.metaTimestamp,children:["Created ",D0(E.createdAt)]}),E.updatedAt&&E.updatedAt!==E.createdAt&&r.jsxs("span",{className:I.metaTimestamp,children:["· Updated ",D0(E.updatedAt)]})]})]}),ie>0&&r.jsxs("div",{className:I.progressBarContainer,"data-testid":"progress-bar",children:[r.jsx("div",{className:I.progressBar,children:r.jsx("div",{className:I.progressFill,style:{width:`${le}%`}})}),r.jsxs("span",{className:I.progressLabel,children:[ne,"/",ie]})]}),K&&K.costUsd>0&&r.jsx("div",{className:I.progressBarContainer,children:r.jsxs("span",{className:I.progressLabel,children:["Usage: ",qi(K.costUsd)," (",K.sessionCount," session",K.sessionCount!==1?"s":"",")"]})}),r.jsxs("div",{className:I.tabBar,role:"tablist","aria-label":"Workspace view",children:[r.jsx("button",{role:"tab","aria-selected":x==="graph",className:`${I.tab} ${x==="graph"?I.active:""}`,onClick:()=>_("graph"),children:"Graph"}),r.jsx("button",{role:"tab","aria-selected":x==="board",className:`${I.tab} ${x==="board"?I.active:""}`,onClick:()=>_("board"),"data-testid":"board-tab",children:"Board"}),r.jsx("button",{role:"tab","aria-selected":x==="tasks",className:`${I.tab} ${x==="tasks"?I.active:""}`,onClick:()=>_("tasks"),children:"Tasks"})]}),x==="tasks"&&ie>0&&r.jsxs("div",{className:I.workspaceSummary,children:[r.jsx("span",{className:I.workspaceSummaryTitle,children:`${ne}/${ie} tasks complete`}),r.jsx("span",{className:I.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),x==="tasks"&&ie===0&&r.jsxs("div",{className:I.emptyCta,children:[r.jsx("button",{className:I.ctaButton,onClick:()=>i(Gs(n,void 0,B)),children:"Create Task"}),r.jsx("div",{className:I.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),x==="board"&&r.jsx(i4,{workspaceId:n,environmentId:B,tasks:l,sessions:m,personas:f,environments:c}),x==="graph"&&r.jsx(M6,{workspaceId:n,environmentId:B,tasks:l}),r.jsx(Us,{isOpen:T,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",D4="_section_ymnez_13",R4="_label_ymnez_19",M4="_titleInput_ymnez_26",O4="_descriptionTextarea_ymnez_58",B4="_selectField_ymnez_94",L4="_checkboxRow_ymnez_128",I4="_checkboxLabel_ymnez_141",z4="_fieldError_ymnez_146",lt={formContent:A4,section:D4,label:R4,titleInput:M4,descriptionTextarea:O4,selectField:B4,checkboxRow:L4,checkboxLabel:I4,fieldError:z4};function U4(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 V4=100;function H4({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:lt.formContent,children:[r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-name",children:"Name"}),r.jsx("input",{id:"ws-name",className:lt.titleInput,type:"text",value:n.name,onChange:p=>m("name",p.target.value),placeholder:"Workspace name",maxLength:V4,autoFocus:f,disabled:d,"data-testid":"workspace-form-name"}),(c==null?void 0:c.name)&&r.jsx("span",{className:lt.fieldError,"data-testid":"workspace-form-error-name",children:c.name})]}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-description",children:"Description"}),r.jsx("textarea",{id:"ws-description",className:lt.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:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-repo",children:"Repository URL"}),r.jsx("input",{id:"ws-repo",className:lt.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:lt.fieldError,"data-testid":"workspace-form-error-repoUrl",children:c.repoUrl})]}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-environment",children:"Environment"}),r.jsxs("select",{id:"ws-environment",className:lt.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:lt.fieldError,"data-testid":"workspace-form-error-environmentId",children:c.environmentId})]}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-persona",children:"Default Persona"}),r.jsxs("select",{id:"ws-persona",className:lt.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:lt.section,children:r.jsxs("label",{className:lt.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:lt.checkboxLabel,children:"Enable worktree isolation"})]})}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-workdir",children:"Working Directory"}),r.jsx("input",{id:"ws-workdir",className:lt.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",G4="_header_cddyd_8",$4="_headerTitle_cddyd_35",q4="_badge_cddyd_44",K4="_headerActions_cddyd_54",Y4="_body_cddyd_61",F4="_formContent_cddyd_73",Z4="_section_cddyd_85",X4="_label_cddyd_91",Q4="_titleInput_cddyd_98",W4="_descriptionTextarea_cddyd_131",J4="_parentContext_cddyd_167",eB="_parentLabel_cddyd_175",tB="_parentName_cddyd_182",nB="_personaSelect_cddyd_186",aB="_depList_cddyd_220",sB="_depItem_cddyd_226",iB="_depItemSelected_cddyd_248",oB="_noDeps_cddyd_252",lB="_btnPrimary_cddyd_258",rB="_btnGhost_cddyd_289",De={container:P4,header:G4,headerTitle:$4,badge:q4,headerActions:K4,body:Y4,formContent:F4,section:Z4,label:X4,titleInput:Q4,descriptionTextarea:W4,parentContext:J4,parentLabel:eB,parentName:tB,personaSelect:nB,depList:aB,depItem:sB,depItemSelected:iB,noDeps:oB,btnPrimary:lB,btnGhost:rB};function cB(n){const a={};return n.name.trim()||(a.name="Name is required"),n.repoUrl.trim()&&!/^https?:\/\/.+/i.test(n.repoUrl.trim())&&(a.repoUrl="Must be a valid http(s) URL"),n.environmentId||(a.environmentId="Environment is required"),Object.keys(a).length>0?a:void 0}const uB=[{label:"Home",url:zs},{label:"New Workspace",url:void 0}];function dB(){const[n]=Wf(),a=n.get("environment")??void 0,{environments:i,personas:l,createWorkspace:c,workspaceCreating:d}=ut(),{showToast:f}=Ca(),m=xt(),[p,v]=y.useState(()=>{var w;return U4(void 0,a||((w=i[0])==null?void 0:w.id))}),[g,b]=y.useState(),[x,_]=y.useState();y.useEffect(()=>{a||p.environmentId||i.length===0||v(w=>{var k;return w.environmentId?w:{...w,environmentId:((k=i[0])==null?void 0:k.id)??""}})},[i,a,p.environmentId]);const T=()=>{const w=cB(p);if(w){b(w),_(void 0);return}b(void 0),_(void 0),c(p.name.trim(),p.description,p.repoUrl.trim(),p.environmentId,p.defaultPersonaId,p.useWorktrees,p.workingDirectory,()=>{f("Workspace created","success"),m(zs,{replace:!0})},k=>{_(k)})},C=()=>{m(a?Hi(a):zs,{replace:!0})};return r.jsxs("div",{className:De.container,children:[r.jsxs("div",{className:De.header,children:[r.jsx("div",{className:De.headerTitle,children:r.jsx(us,{segments:uB})}),r.jsxs("div",{className:De.headerActions,children:[r.jsx("button",{className:De.btnGhost,onClick:C,disabled:d,"data-testid":"workspace-create-cancel",children:"Cancel"}),r.jsx("button",{className:De.btnPrimary,onClick:T,disabled:d||!p.name.trim()||!p.environmentId,"data-testid":"workspace-create-save",children:d?r.jsx(iS,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),r.jsxs("div",{className:De.body,children:[r.jsx(H4,{values:p,onChange:w=>{v(w),b(void 0),_(void 0)},environments:i,personas:l,errors:g,disabled:d,autoFocusName:!0}),x&&r.jsx("div",{className:De.error,"data-testid":"workspace-create-submit-error",children:x})]})]})}function dS({mode:n,taskId:a,workspaceId:i,parentTaskId:l,environmentId:c,tasks:d,workspaces:f,personas:m,onCreateTask:p,onUpdateTask:v,onEditDone:g}){const{showToast:b}=Ca(),x=xt(),_=n==="edit",T=_&&a?d.find(fe=>fe.id===a):void 0,C=_?(T==null?void 0:T.workspaceId)??"":i??"",[w,k]=y.useState(C),N=C||w,A=f.find(fe=>fe.id===N),R=c??(A==null?void 0:A.environmentId),E=!_&&!i,B=_?(T==null?void 0:T.parentTaskId)??"":l??"",U=B?d.find(fe=>fe.id===B):void 0,[z,K]=y.useState((T==null?void 0:T.title)??""),[te,ne]=y.useState((T==null?void 0:T.description)??""),[ie,le]=y.useState((T==null?void 0:T.dependsOn)??[]),[q,ae]=y.useState((T==null?void 0:T.defaultPersonaId)??""),[O,P]=y.useState((T==null?void 0:T.canDecompose)??!1),[W,re]=y.useState(!1),oe=y.useRef(!1);y.useEffect(()=>{_&&T&&!oe.current&&(oe.current=!0,K(T.title),ne(T.description),le(T.dependsOn),ae(T.defaultPersonaId),P(T.canDecompose))},[_,T]);const Ne=d.filter(fe=>fe.workspaceId===N&&(!_||fe.id!==a)&&fe.id!==B),je=z.trim().length>0&&(!_||T!==void 0)&&N.length>0,Se=fe=>{le(tt=>tt.includes(fe)?tt.filter(ee=>ee!==fe):[...tt,fe])},Le=()=>{!je||W||_&&T===void 0||(_&&a?(v(a,z.trim(),te,ie,q),b("Task updated","success"),g?g():x(Jn(a,void 0,N,R),{replace:!0})):(re(!0),p(N,z.trim(),te,ie.length>0?ie:void 0,B||void 0,q,O,()=>{b("Task created","success"),x(i?Ui(i,R):"/tasks",{replace:!0})},fe=>{b(fe,"error"),re(!1)})))},ce=()=>{if(g){g();return}x(_&&a?Jn(a,void 0,N,R):i?Ui(i,R):"/tasks")},ue=_?"edit task":B?"child task":"new task";return r.jsxs("div",{className:De.container,children:[r.jsxs("div",{className:De.header,children:[r.jsxs("div",{className:De.headerTitle,children:[r.jsx("span",{className:De.badge,children:ue}),U&&r.jsxs("span",{className:De.parentContext,children:[r.jsx("span",{className:De.parentLabel,children:"Child of"}),r.jsx("span",{className:De.parentName,children:U.title})]})]}),r.jsxs("div",{className:De.headerActions,children:[r.jsx("button",{onClick:Le,disabled:!je||W,className:De.btnPrimary,"data-testid":"task-edit-save",children:W?"Creating…":_?"Save Changes":"Create"}),r.jsx("button",{onClick:ce,className:De.btnGhost,children:"Cancel"})]})]}),r.jsx("div",{className:De.body,children:r.jsxs("div",{className:De.formContent,children:[E&&r.jsxs("div",{className:De.section,children:[r.jsx("label",{className:De.label,htmlFor:"task-edit-workspace",children:"Workspace"}),r.jsxs("select",{id:"task-edit-workspace",value:w,onChange:fe=>k(fe.target.value),className:De.personaSelect,"data-testid":"task-edit-workspace",children:[r.jsx("option",{value:"",children:"Select a workspace..."}),f.map(fe=>r.jsx("option",{value:fe.id,children:fe.name},fe.id))]})]}),r.jsxs("div",{className:De.section,children:[r.jsx("label",{className:De.label,htmlFor:"task-edit-title",children:"Title"}),r.jsx("input",{id:"task-edit-title",type:"text",value:z,onChange:fe=>K(fe.target.value),placeholder:"Task title...",autoFocus:!0,className:De.titleInput,"data-testid":"task-edit-title",onKeyDown:fe=>{fe.key==="Enter"&&je&&Le()}})]}),r.jsxs("div",{className:De.section,children:[r.jsx("label",{className:De.label,htmlFor:"task-edit-description",children:"Description"}),r.jsx("textarea",{id:"task-edit-description",value:te,onChange:fe=>ne(fe.target.value),placeholder:"Describe the task... (markdown supported)",className:De.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),r.jsxs("div",{className:De.section,children:[r.jsx("label",{className:De.label,htmlFor:"task-edit-persona",children:"Default Persona"}),r.jsxs("select",{id:"task-edit-persona",value:q,onChange:fe=>ae(fe.target.value),className:De.personaSelect,"data-testid":"task-edit-persona",children:[r.jsx("option",{value:"",children:"(Inherit)"}),m.map(fe=>r.jsx("option",{value:fe.id,children:fe.name},fe.id))]})]}),!_&&r.jsx("div",{className:De.section,children:r.jsxs("label",{className:De.depItem,"data-testid":"task-edit-can-decompose",children:[r.jsx("input",{type:"checkbox",checked:O,onChange:fe=>P(fe.target.checked)}),"Can spawn subtasks"]})}),r.jsxs("div",{className:De.section,children:[r.jsx("div",{className:De.label,children:"Dependencies"}),Ne.length===0?r.jsx("div",{className:De.noDeps,children:"No other tasks in this workspace"}):r.jsx("div",{className:De.depList,children:Ne.map(fe=>{const tt=ie.includes(fe.id);return r.jsxs("label",{className:`${De.depItem} ${tt?De.depItemSelected:""}`,"data-testid":`dep-option-${fe.id}`,children:[r.jsx("input",{type:"checkbox",checked:tt,onChange:()=>Se(fe.id)}),fe.title,r.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",fe.status,")"]})]},fe.id)})})]})]})})]})}function R0(){const{workspaceId:n,environmentId:a}=rs(),[i]=Wf(),l=n??i.get("workspace")??"",c=i.get("parent")??void 0,{tasks:d,workspaces:f,personas:m,createTask:p,updateTask:v}=ut();return r.jsx(dS,{mode:"new",workspaceId:l,parentTaskId:c,environmentId:a,tasks:d,workspaces:f,personas:m,onCreateTask:p,onUpdateTask:v})}const fB="_container_1pqxm_1",hB="_emptyState_1pqxm_8",mB="_card_1pqxm_14",pB="_cardHeader_1pqxm_34",vB="_categoryBadge_1pqxm_46",gB="_findingTitle_1pqxm_54",yB="_findingDate_1pqxm_60",bB="_findingContent_1pqxm_72",xB="_tags_1pqxm_78",SB="_tag_1pqxm_78",Zn={container:fB,emptyState:hB,card:mB,cardHeader:pB,categoryBadge:vB,findingTitle:gB,findingDate:yB,findingContent:bB,tags:xB,tag:SB};function _B(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 M0={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 TB({findings:n}){return n.length===0?r.jsx("div",{className:Zn.emptyState,children:"No findings yet. Agents will post discoveries here."}):r.jsx("div",{className:Zn.container,children:n.map((a,i)=>{const l=M0[a.category]||M0.general;return r.jsxs(Et.div,{className:Zn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:i*.05,duration:.2},children:[r.jsxs("div",{className:Zn.cardHeader,children:[r.jsx("span",{className:Zn.categoryBadge,style:{background:l.bg,color:l.text},children:a.category}),r.jsx("span",{className:Zn.findingTitle,children:a.title}),r.jsx("span",{className:Zn.findingDate,title:a.createdAt,children:_B(a.createdAt)})]}),r.jsx("div",{className:Zn.findingContent,children:a.content.length>300?a.content.slice(0,300)+"...":a.content}),a.tags.length>0&&r.jsx("div",{className:Zn.tags,children:a.tags.map(c=>r.jsx("span",{className:Zn.tag,style:{color:l.text,textShadow:`0 0 8px ${l.text}`},children:c},c))})]},a.id)})})}const kB="_workpadSection_y8nj9_1",jB="_workpadLabel_y8nj9_9",wB="_workpadStatus_y8nj9_17",CB="_workpadSummary_y8nj9_23",NB="_workpadExtra_y8nj9_29",ns={workpadSection:kB,workpadLabel:jB,workpadStatus:wB,workpadSummary:CB,workpadExtra:NB};function EB({workpad:n}){if(!n)return;let a;try{const i=JSON.parse(n);if(i==null||typeof i!="object"||Array.isArray(i))return;a=i}catch{return r.jsxs("div",{className:ns.workpadSection,"data-testid":"workpad-panel",children:[r.jsx("div",{className:ns.workpadLabel,children:"Workpad"}),r.jsx("div",{className:ns.workpadExtra,children:n})]})}if(!(!a.status&&!a.summary&&!a.extra))return r.jsxs("div",{className:ns.workpadSection,"data-testid":"workpad-panel",children:[r.jsx("div",{className:ns.workpadLabel,children:"Workpad"}),a.status&&r.jsx("div",{className:ns.workpadStatus,"data-testid":"workpad-status",children:a.status}),a.summary&&r.jsx("div",{className:ns.workpadSummary,"data-testid":"workpad-summary",children:a.summary}),a.extra&&Object.keys(a.extra).length>0&&r.jsx("div",{className:ns.workpadExtra,"data-testid":"workpad-extra",children:JSON.stringify(a.extra,null,2)})]})}function Fr(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 ff(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 O0(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?I.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?I.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?I.envDotRed:I.envDotGray}function AB({status:n}){const a=ls(n),i=D2(n);return r.jsx("span",{className:`${I.statusBadge} ${I[i]??I.statusPending}`,children:a.label})}function DB({task:n,tasksById:a,environments:i,workspaces:l,taskSessions:c,selectedEnvId:d}){const{loadUsage:f,usageCache:m}=ut(),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,_=c.length>0?c[c.length-1]:void 0,T=(_==null?void 0:_.environmentId)??"",C=T?i.find(A=>A.id===T):void 0,w=l.find(A=>A.id===n.workspaceId),k=i.find(A=>A.id===d),N=n.branch&&(w!=null&&w.repoUrl)?`${w.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return r.jsxs("div",{className:I.overviewDashboard,children:[r.jsxs("div",{className:I.overviewHero,children:[r.jsx(AB,{status:n.status}),n.branch&&r.jsx("span",{className:I.overviewBranchPill,children:N?r.jsxs("a",{href:N,target:"_blank",rel:"noreferrer noopener",className:I.branchLink,children:["🔗"," ",n.branch]}):r.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Description"}),r.jsx("div",{className:I.overviewMarkdown,children:r.jsx(Pf,{remarkPlugins:[Gf],children:n.description})})]}),n.workpad&&r.jsx(EB,{workpad:n.workpad}),r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Environment"}),T&&C?r.jsxs("div",{className:I.envRow,"data-testid":"task-overview-environment",children:[r.jsx("span",{className:`${I.envDot} ${O0(C.status)}`,title:C.status,"aria-label":`Status: ${C.status}`,role:"img"}),r.jsx("span",{className:I.overviewValue,children:C.displayName})]}):k?r.jsxs("div",{className:I.envRow,"data-testid":"task-overview-environment",children:[r.jsx("span",{className:`${I.envDot} ${O0(k.status)}`,title:k.status,"aria-label":`Status: ${k.status}`,role:"img"}),r.jsx("span",{className:I.overviewValue,children:k.displayName}),r.jsx("span",{className:I.overviewMuted,children:"(workspace default)"})]}):r.jsx("div",{className:I.overviewMuted,children:"Set in workspace settings"})]}),r.jsxs("div",{className:I.overviewSection,"data-testid":"task-overview-dependencies",children:[r.jsx("div",{className:I.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?r.jsx("div",{className:I.overviewMuted,children:"None"}):r.jsx("div",{className:I.depList,children:n.dependsOn.map(A=>{const R=a.get(A),E=(R==null?void 0:R.status)==="complete";return r.jsxs("div",{className:`${I.depItem} ${E?I.depDone:I.depBlocked}`,children:[r.jsx("span",{children:E?"✓":"○"}),r.jsx("span",{children:(R==null?void 0:R.title)??A})]},A)})})]}),r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Timeline"}),r.jsxs("div",{className:I.timeline,children:[n.createdAt&&r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Created"}),r.jsx("span",{className:I.timelineValue,children:Fr(n.createdAt)})]}),n.assignedAt&&(()=>{const A=ff(n.createdAt,n.assignedAt);return r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Assigned"}),r.jsx("span",{className:I.timelineValue,children:Fr(n.assignedAt)}),A!==void 0&&r.jsx("span",{className:I.timelineDelta,children:A})]})})(),n.startedAt&&(()=>{const A=ff(n.assignedAt??n.createdAt,n.startedAt);return r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Started"}),r.jsx("span",{className:I.timelineValue,children:Fr(n.startedAt)}),A!==void 0&&r.jsx("span",{className:I.timelineDelta,children:A})]})})(),n.completedAt&&(()=>{const A=ff(n.startedAt,n.completedAt);return r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Completed"}),r.jsx("span",{className:I.timelineValue,children:Fr(n.completedAt)}),A!==void 0&&r.jsx("span",{className:I.timelineDelta,children:A})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&r.jsx("div",{className:I.overviewMuted,children:"No timing data"})]})]}),g&&g.costUsd>0&&r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Usage"}),r.jsxs("div",{className:I.timeline,children:[r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Cost"}),r.jsx("span",{className:I.timelineValue,children:qi(g.costUsd)}),r.jsxs("span",{className:I.timelineDelta,children:[g.sessionCount," session",g.sessionCount!==1?"s":""]})]}),x&&x.costUsd>g.costUsd&&r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Total (incl. subtasks)"}),r.jsx("span",{className:I.timelineValue,children:qi(x.costUsd)}),r.jsxs("span",{className:I.timelineDelta,children:[x.sessionCount," session",x.sessionCount!==1?"s":""]})]})]})]}),n.reviewNotes&&r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Review Notes"}),r.jsx("div",{className:I.reviewNotes,children:n.reviewNotes})]})]})}function RB({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:I.headerActions,children:[r.jsx("button",{onClick:p,className:I.btnGhost,children:"Edit"}),r.jsx("button",{onClick:m,className:I.btnDanger,children:"Delete"})]}):r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{"data-testid":"task-header-start",onClick:l,className:I.btnPrimary,children:"Start"}),r.jsx("button",{onClick:p,className:I.btnGhost,children:"Edit"}),r.jsx("button",{onClick:m,className:I.btnDanger,children:"Delete"})]});if(n.status==="working")return r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{onClick:d,className:I.btnDanger,children:"Stop"}),r.jsx("button",{onClick:f,disabled:!a,className:I.btnGhost,children:"Pause"})]});if(n.status==="paused")return r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{onClick:d,className:I.btnPrimary,children:"Stop"}),r.jsx("button",{onClick:c,className:I.btnGhost,children:"Resume"}),r.jsx("button",{onClick:m,className:I.btnDanger,children:"Delete"})]});if(n.status==="complete")return r.jsx("div",{className:I.headerActions,children:r.jsx("button",{onClick:m,className:I.btnDanger,children:"Delete"})});if(n.status==="failed")return r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{onClick:l,className:I.btnPrimary,children:"Retry"}),r.jsx("button",{onClick:m,className:I.btnDanger,children:"Delete"})]})}function MB({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return r.jsxs("div",{className:I.attemptSelector,"data-testid":"attempt-selector",children:[r.jsx("span",{className:I.attemptLabel,children:"Attempts:"}),n.map((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:`${I.attemptButton} ${d?I.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:I.attemptStatus,children:f})]},l.id)})]})}function as(){const{taskId:n,workspaceId:a,environmentId:i}=rs(),l=Ot(),c=xt(),{events:d,eventsDropped:f,tasks:m,sessions:p,environments:v,findings:g,loadSessionEvents:b,loadFindings:x,kill:_,startTask:T,stopTask:C,resumeTask:w,deleteTask:k,createTask:N,updateTask:A,workspaces:R,taskSessions:E,loadTaskSessions:B,sendInput:U,spawn:z,personas:K,provisionEnvironment:te}=ut(),ne=y.useRef(void 0),ie=y.useRef(void 0),le=y.useRef(void 0),q=y.useRef(void 0),ae=y.useRef(void 0),O=l.pathname.endsWith("/stream")?"stream":l.pathname.endsWith("/findings")?"findings":"overview",P=l.pathname.endsWith("/edit"),[W,re]=y.useState(O),[oe,Ne]=y.useState(!1),[je,Se]=y.useState(void 0),[Le,ce]=y.useState(""),[ue,fe]=y.useState(P),tt=y.useRef(O),ee=y.useRef(P),X=m.find(Ee=>Ee.id===n),At=(X==null?void 0:X.workspaceId)||void 0,pt=R.find(Ee=>Ee.id===At);y.useEffect(()=>{O!==tt.current&&(tt.current=O,O!==W&&re(O))},[O,W]),y.useEffect(()=>{P!==ee.current&&(ee.current=P,P!==ue&&fe(P))},[P,ue]),y.useEffect(()=>{if(Le===""){if(pt!=null&&pt.environmentId)ce(pt.environmentId);else if(v.length>0){const Ee=v.find(Dt=>Dt.status==="connected");ce((Ee==null?void 0:Ee.id)??v[0].id)}}},[Le,pt==null?void 0:pt.environmentId,v]);const yn=X?E[X.id]??[]:[];let Ke;je&&yn.some(Ee=>Ee.id===je)?Ke=je:Ke=(X==null?void 0:X.latestSessionId)||void 0;const Pn=()=>{Ne(!0)},Gn=()=>{if(!X)return;k(X.id),Ne(!1);const Ee=i??(pt==null?void 0:pt.environmentId);c(X.workspaceId&&Ee?Ui(X.workspaceId,Ee):"/",{replace:!0})};y.useEffect(()=>{(X==null?void 0:X.id)!==ie.current&&(ie.current=X==null?void 0:X.id,Se(void 0),ce(""),fe(P))},[X==null?void 0:X.id,P]),y.useEffect(()=>{if(!(X!=null&&X.id))return;const Ee=X.id!==q.current,Dt=X.latestSessionId!==ae.current;(Ee||Dt)&&(q.current=X.id,ae.current=X.latestSessionId,B(X.id))},[X==null?void 0:X.id,X==null?void 0:X.latestSessionId,B]),y.useEffect(()=>{if((X==null?void 0:X.status)!==le.current){const Ee=le.current===void 0;le.current=X==null?void 0:X.status;const Dt=(X==null?void 0:X.status)==="not_started"?"overview":(X==null?void 0:X.status)==="working"||(X==null?void 0:X.status)==="paused"?"stream":(X==null?void 0:X.status)==="complete"?"findings":void 0;Dt&&Dt!==W&&!(Ee&&O!=="overview")&&re(Dt)}},[X==null?void 0:X.status,W,O]);const Bn=y.useMemo(()=>new Map(m.map(Ee=>[Ee.id,Ee])),[m]),Na=y.useMemo(()=>{const Ee=Ke?d.filter(Dt=>Dt.sessionId===Ke):[];return zh(Ih(Ee))},[d,Ke]),$n=X?X.dependsOn.some(Ee=>{const Dt=Bn.get(Ee);return Dt!==void 0&&Dt.status!=="complete"}):!1,Ea=y.useMemo(()=>i6(n,i,R,v,Bn),[n,i,R,v,Bn]);y.useEffect(()=>{Ke&&Ke!==ne.current&&(ne.current=Ke,b(Ke))},[Ke,b]),y.useEffect(()=>{W==="findings"&&At&&x(At)},[W,At,x]);const ln=Ee=>{re(Ee),c(Jn(n,Ee==="overview"?void 0:Ee,a,i))};return ka({key:"1"},()=>ln("overview")),ka({key:"2"},()=>ln("stream")),ka({key:"3"},()=>ln("findings")),r.jsxs("div",{className:I.panelContainer,children:[r.jsx(us,{segments:Ea}),r.jsxs("div",{className:I.header,children:[r.jsxs("span",{className:I.headerTitle,children:[r.jsx("span",{"data-testid":"task-title",children:(X==null?void 0:X.title)||n}),X&&r.jsx("span",{className:I.taskStatusBadge,"data-testid":"task-status",children:X.status}),(X==null?void 0:X.branch)&&r.jsx("span",{className:I.taskBranch,children:X.branch}),$n&&r.jsx("span",{className:I.taskBlockedBadge,children:"blocked"})]}),X&&r.jsx(RB,{task:X,sessionId:Ke,isBlocked:$n,onStart:()=>T(X.id,void 0,Le),onResume:()=>w(X.id),onStop:()=>C(X.id),onPause:()=>Ke&&_(Ke),onDelete:Pn,onEdit:()=>fe(!0)})]}),r.jsxs("div",{className:I.tabBar,role:"tablist","aria-label":"Task view",children:[r.jsx("button",{role:"tab","aria-selected":W==="overview",className:`${I.tab} ${W==="overview"?I.active:""}`,onClick:()=>ln("overview"),children:"Overview"}),r.jsx("button",{role:"tab","aria-selected":W==="stream",className:`${I.tab} ${W==="stream"?I.active:""}`,onClick:()=>ln("stream"),children:"Stream"}),r.jsx("button",{role:"tab","aria-selected":W==="findings",className:`${I.tab} ${W==="findings"?I.active:""}`,onClick:()=>ln("findings"),children:"Findings"})]}),r.jsxs(ea,{mode:"wait",children:[W==="overview"&&r.jsx(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:I.overviewContent,"data-testid":"task-overview",children:ue&&X?r.jsx(dS,{mode:"edit",taskId:X.id,workspaceId:At,environmentId:i,tasks:m,workspaces:R,personas:K,onCreateTask:N,onUpdateTask:A,onEditDone:()=>{P?c(Jn(X.id,void 0,a,i),{replace:!0}):fe(!1)}}):X?r.jsx(DB,{task:X,tasksById:Bn,environments:v,workspaces:R,taskSessions:yn,selectedEnvId:Le}):r.jsx("div",{className:I.waitingMessage,children:"No additional details"})},"overview"),W==="stream"&&r.jsxs(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[r.jsx(MB,{taskSessions:yn,selectedSessionId:Ke,onSelect:Ee=>Se(Ee)}),r.jsx(Lh,{events:Na,eventsDropped:f,emptyState:!Ke&&X?$n?r.jsx("div",{className:I.emptyCta,"data-testid":"stream-blocked-message",children:r.jsx("div",{className:I.ctaDescription,children:"This task is blocked by incomplete dependencies"})}):r.jsxs("div",{className:I.emptyCta,children:[r.jsx("button",{"data-testid":"stream-start-cta",className:I.ctaButton,onClick:()=>T(X.id,void 0,Le),children:"Start Task"}),r.jsx("div",{className:I.ctaDescription,children:"Click to begin agent execution"})]}):Ke&&Na.length===0?r.jsx("div",{className:I.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),W==="findings"&&r.jsx(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:I.tabContent,children:At?r.jsx(TB,{findings:g.filter(Ee=>Ee.workspaceId===At)}):r.jsx("div",{className:I.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!X||X.status!=="working"&&X.status!=="paused")return;const Ee=Ke?p.find(Dt=>Dt.id===Ke):void 0;if(!(!Ee||Ee.status==="stopped"))return r.jsx(ml,{mode:"send",sessionId:Ee.id,environmentId:Ee.environmentId,personas:K,environments:v,onSendInput:U,onSpawn:z,onStartTask:T,onProvisionEnvironment:te})})(),X&&r.jsx(Us,{isOpen:oe,title:"Delete Task?",description:`"${X.title}" will be permanently removed.`,onConfirm:Gn,onCancel:()=>Ne(!1)})]})}const OB="_container_legrg_1",BB="_header_legrg_8",LB="_headerTitle_legrg_35",IB="_badge_legrg_44",zB="_headerActions_legrg_54",UB="_body_legrg_61",VB="_formContent_legrg_73",HB="_section_legrg_85",PB="_label_legrg_91",GB="_nameInput_legrg_98",$B="_fieldInput_legrg_131",qB="_adapterSelect_legrg_164",KB="_readOnlyValue_legrg_198",YB="_codespaceSection_legrg_204",FB="_codespaceActions_legrg_210",ZB="_creatingHint_legrg_216",XB="_errorHint_legrg_222",QB="_btnPrimary_legrg_235",WB="_btnGhost_legrg_266",J={container:OB,header:BB,headerTitle:LB,badge:IB,headerActions:zB,body:UB,formContent:VB,section:HB,label:PB,nameInput:GB,fieldInput:$B,adapterSelect:qB,readOnlyValue:KB,codespaceSection:YB,codespaceActions:FB,creatingHint:ZB,errorHint:XB,btnPrimary:QB,btnGhost:WB},tc=1,nc=65535;function hf(n){if(!n.trim())return!0;const a=Number(n);return Number.isInteger(a)&&a>=tc&&a<=nc}function mf(n){try{const a=JSON.parse(n);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function JB({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(""),[_,T]=y.useState("");return v==="create"?r.jsxs("div",{className:J.codespaceSection,children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Repository"}),r.jsx("input",{type:"text",value:b,onChange:C=>x(C.target.value),placeholder:"owner/repo",className:J.fieldInput,"data-testid":"env-codespace-repo"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Machine Type"}),r.jsx("input",{type:"text",value:_,onChange:C=>T(C.target.value),placeholder:"Machine type (optional)...",className:J.fieldInput,"data-testid":"env-codespace-machine"})]}),r.jsxs("div",{className:J.codespaceActions,children:[r.jsx("button",{onClick:()=>{b.trim()&&(p(b.trim(),_.trim()||void 0),g("pick"),x(""),T(""))},disabled:!b.trim(),className:J.btnPrimary,children:"Create"}),r.jsx("button",{onClick:()=>{g("pick"),x(""),T("")},className:J.btnGhost,children:"Cancel"})]})]}):r.jsx("div",{className:J.codespaceSection,children:r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.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:J.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:J.creatingHint,children:"Creating codespace..."}),f&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:J.errorHint,children:f}),r.jsx("input",{type:"text",value:n,onChange:C=>a(C.target.value),placeholder:"Or enter codespace name manually...",className:J.fieldInput,"data-testid":"env-codespace-manual"})]}),d&&!f&&r.jsx("span",{className:J.errorHint,children:d})]})})}function fS({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}=Ca(),x=xt(),_=n==="edit",T=_&&a?i.find(ce=>ce.id===a):void 0,[C,w]=y.useState(""),[k,N]=y.useState("local"),[A,R]=y.useState(""),[E,B]=y.useState(""),[U,z]=y.useState(""),[K,te]=y.useState(""),[ne,ie]=y.useState(""),[le,q]=y.useState(""),[ae,O]=y.useState(""),[P,W]=y.useState(null),re=y.useCallback(()=>{const ce={};if(k==="local"){if(A.trim()&&(ce.host=A.trim()),E.trim()){const ue=Number(E);Number.isInteger(ue)&&(ce.port=ue)}}else if(k==="ssh"){if(ce.host=A.trim(),U.trim()&&(ce.user=U.trim()),E.trim()){const ue=Number(E);Number.isInteger(ue)&&(ce.sshPort=ue)}K.trim()&&(ce.identityFile=K.trim())}else k==="docker"?(ne.trim()&&(ce.image=ne.trim()),le.trim()&&(ce.repo=le.trim())):k==="codespace"&&(ce.codespaceName=ae.trim());return ce},[k,A,E,U,K,ne,le,ae]),oe=()=>!(!C.trim()||k==="ssh"&&!A.trim()||k==="codespace"&&!ae.trim()||(k==="local"||k==="ssh")&&!hf(E)),Ne=()=>{oe()&&(l(C.trim(),k,re()),b("Environment added successfully","success"),x(Vi,{replace:!0}))},je=()=>{x(a?Hi(a):Vi)},Se=y.useCallback((ce,ue)=>{if(!T||!a)return;const fe=mf(T.adapterConfig),tt=ue.trim();tt?fe[ce]=tt:delete fe[ce],c(a,{adapterConfig:fe})},[T,a,c]),Le=y.useCallback((ce,ue)=>{if(!T||!a)return;const fe=mf(T.adapterConfig);if(ue.trim()){const tt=Number(ue);Number.isInteger(tt)&&tt>=tc&&tt<=nc&&(fe[ce]=tt)}else delete fe[ce];c(a,{adapterConfig:fe})},[T,a,c]);if(_){if(!T)return r.jsxs("div",{className:J.container,children:[r.jsxs("div",{className:J.header,children:[r.jsx("div",{className:J.headerTitle,children:r.jsx("span",{className:J.badge,children:"edit environment"})}),r.jsx("div",{className:J.headerActions,children:r.jsx("button",{onClick:je,className:J.btnGhost,children:"Back"})})]}),r.jsx("div",{className:J.body,children:r.jsx("div",{className:J.formContent,children:r.jsx("span",{className:J.readOnlyValue,children:"Environment not found"})})})]});const ce=mf(T.adapterConfig);return r.jsxs("div",{className:J.container,"data-testid":"env-edit-panel",children:[r.jsxs("div",{className:J.header,children:[r.jsx("div",{className:J.headerTitle,children:r.jsx("span",{className:J.badge,children:"edit environment"})}),r.jsx("div",{className:J.headerActions,children:r.jsx("button",{onClick:je,className:J.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),r.jsx("div",{className:J.body,children:r.jsxs("div",{className:J.formContent,children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Name"}),r.jsx(qt,{value:T.displayName,onSave:ue=>{a&&c(a,{displayName:ue})},validate:ue=>ue.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:P,onActivate:W,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Adapter Type"}),r.jsx("span",{className:J.readOnlyValue,"data-testid":"env-edit-adapter-type",children:T.adapterType})]}),T.adapterType==="local"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Host"}),r.jsx(qt,{value:String(ce.host??""),onSave:ue=>Se("host",ue),mode:"edit",fieldId:"host",activeFieldId:P,onActivate:W,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Port"}),r.jsx(qt,{value:String(ce.port??""),onSave:ue=>Le("port",ue),validate:ue=>hf(ue)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:P,onActivate:W,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),T.adapterType==="ssh"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Host"}),r.jsx(qt,{value:String(ce.host??""),onSave:ue=>Se("host",ue),validate:ue=>ue.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:P,onActivate:W,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"User"}),r.jsx(qt,{value:String(ce.user??""),onSave:ue=>Se("user",ue),mode:"edit",fieldId:"user",activeFieldId:P,onActivate:W,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"SSH Port"}),r.jsx(qt,{value:String(ce.sshPort??""),onSave:ue=>Le("sshPort",ue),validate:ue=>hf(ue)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:P,onActivate:W,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Identity File"}),r.jsx(qt,{value:String(ce.identityFile??""),onSave:ue=>Se("identityFile",ue),mode:"edit",fieldId:"identityFile",activeFieldId:P,onActivate:W,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),T.adapterType==="docker"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Image"}),r.jsx(qt,{value:String(ce.image??""),onSave:ue=>Se("image",ue),mode:"edit",fieldId:"image",activeFieldId:P,onActivate:W,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Repo"}),r.jsx(qt,{value:String(ce.repo??""),onSave:ue=>Se("repo",ue),mode:"edit",fieldId:"repo",activeFieldId:P,onActivate:W,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),T.adapterType==="codespace"&&r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Codespace Name"}),r.jsx(qt,{value:String(ce.codespaceName??""),onSave:ue=>Se("codespaceName",ue),validate:ue=>ue.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:P,onActivate:W,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return r.jsxs("div",{className:J.container,"data-testid":"env-create-panel",children:[r.jsxs("div",{className:J.header,children:[r.jsx("div",{className:J.headerTitle,children:r.jsx("span",{className:J.badge,children:"new environment"})}),r.jsxs("div",{className:J.headerActions,children:[r.jsx("button",{onClick:Ne,disabled:!oe(),className:J.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),r.jsx("button",{onClick:je,className:J.btnGhost,children:"Cancel"})]})]}),r.jsx("div",{className:J.body,children:r.jsxs("div",{className:J.formContent,children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-name",children:"Name"}),r.jsx("input",{id:"env-create-name",type:"text",value:C,onChange:ce=>w(ce.target.value),placeholder:"Environment name...",autoFocus:!0,className:J.nameInput,"data-testid":"env-create-name",onKeyDown:ce=>{ce.key==="Enter"&&oe()&&Ne()}})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),r.jsxs("select",{id:"env-create-adapter",value:k,onChange:ce=>{N(ce.target.value),ce.target.value==="codespace"&&d()},className:J.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:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-host",children:"Host"}),r.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:ce=>R(ce.target.value),placeholder:"Host (optional)...",className:J.fieldInput,"data-testid":"env-create-host"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-port",children:"Port"}),r.jsx("input",{id:"env-create-port",type:"number",min:tc,max:nc,value:E,onChange:ce=>B(ce.target.value),placeholder:"Port (optional)...",className:J.fieldInput,"data-testid":"env-create-port"})]})]}),k==="ssh"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-host",children:"Host"}),r.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:ce=>R(ce.target.value),placeholder:"Host (required)...",className:J.fieldInput,"data-testid":"env-create-host"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-user",children:"User"}),r.jsx("input",{id:"env-create-user",type:"text",value:U,onChange:ce=>z(ce.target.value),placeholder:"User (optional)...",className:J.fieldInput,"data-testid":"env-create-user"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-port",children:"SSH Port"}),r.jsx("input",{id:"env-create-port",type:"number",min:tc,max:nc,value:E,onChange:ce=>B(ce.target.value),placeholder:"SSH port (optional)...",className:J.fieldInput,"data-testid":"env-create-port"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-identity",children:"Identity File"}),r.jsx("input",{id:"env-create-identity",type:"text",value:K,onChange:ce=>te(ce.target.value),placeholder:"Identity file (optional)...",className:J.fieldInput,"data-testid":"env-create-identity"})]})]}),k==="docker"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-image",children:"Image"}),r.jsx("input",{id:"env-create-image",type:"text",value:ne,onChange:ce=>ie(ce.target.value),placeholder:"Image (optional)...",className:J.fieldInput,"data-testid":"env-create-image"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-repo",children:"Repo"}),r.jsx("input",{id:"env-create-repo",type:"text",value:le,onChange:ce=>q(ce.target.value),placeholder:"Repo (optional)...",className:J.fieldInput,"data-testid":"env-create-repo"})]})]}),k==="codespace"&&r.jsx(JB,{codespaceName:ae,onCodespaceNameChange:O,envName:C,onEnvNameChange:w,codespaces:f,codespaceError:m,codespaceListError:p,codespaceCreating:v,onCreateCodespace:g})]})})]})}function e5(){const{environments:n,addEnvironment:a,updateEnvironment:i,listCodespaces:l,codespaces:c,codespaceError:d,codespaceListError:f,codespaceCreating:m,createCodespace:p}=ut();return r.jsx(fS,{mode:"new",environments:n,onAddEnvironment:a,onUpdateEnvironment:i,onListCodespaces:l,codespaces:c,codespaceError:d,codespaceListError:f,codespaceCreating:m,onCreateCodespace:p})}function t5(){const{environmentId:n}=rs(),{environments:a,addEnvironment:i,updateEnvironment:l,listCodespaces:c,codespaces:d,codespaceError:f,codespaceListError:m,codespaceCreating:p,createCodespace:v}=ut();return r.jsx(fS,{mode:"edit",environmentId:n,environments:a,onAddEnvironment:i,onUpdateEnvironment:l,onListCodespaces:c,codespaces:d,codespaceError:f,codespaceListError:m,codespaceCreating:p,onCreateCodespace:v})}const n5="_layout_11u79_1",a5="_content_11u79_8",s5="_tabPanel_11u79_14",ol={layout:n5,content:a5,tabPanel:s5};function i5(){const n=t6();return r.jsxs("div",{className:ol.layout,children:[r.jsx(us,{segments:n}),r.jsx("div",{className:ol.content,children:r.jsx(Ps,{})})]})}const o5="_container_13sb6_1",l5="_envHeader_13sb6_6",r5="_envTitleRow_13sb6_10",c5="_statusDot_13sb6_16",u5="_envName_13sb6_21",d5="_statusBadge_13sb6_27",f5="_envMeta_13sb6_33",h5="_metaTag_13sb6_39",m5="_actions_13sb6_51",p5="_provisionMessage_13sb6_59",v5="_errorMessage_13sb6_64",g5="_section_13sb6_69",y5="_sectionHeader_13sb6_73",b5="_cardList_13sb6_121",x5="_card_13sb6_121",S5="_cardHeader_13sb6_138",_5="_cardName_13sb6_144",T5="_cardActions_13sb6_149",k5="_cardDescription_13sb6_154",j5="_cardMeta_13sb6_160",w5="_repoLink_13sb6_166",C5="_empty_13sb6_174",N5="_btnPrimary_13sb6_180",E5="_btnOutline_13sb6_214",A5="_btnSmall_13sb6_241",D5="_btnDanger_13sb6_267",Ue={container:o5,envHeader:l5,envTitleRow:r5,statusDot:c5,envName:u5,statusBadge:d5,envMeta:f5,metaTag:h5,actions:m5,provisionMessage:p5,errorMessage:v5,section:g5,sectionHeader:y5,cardList:b5,card:x5,cardHeader:S5,cardName:_5,cardActions:T5,cardDescription:k5,cardMeta:j5,repoLink:w5,empty:C5,btnPrimary:N5,btnOutline:E5,btnSmall:A5,btnDanger:D5},R5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function M5(){const{environmentId:n}=rs(),a=xt(),{environments:i,workspaces:l,sessions:c,provisionStatus:d,provisionEnvironment:f,stopEnvironment:m,removeEnvironment:p,archiveWorkspace:v}=ut(),[g,b]=y.useState(!1),[x,_]=y.useState(!1),[T,C]=y.useState(void 0),w=i.find(ie=>ie.id===n);if(!n||!w)return r.jsx(Hn,{to:Vi,replace:!0});const k=l.filter(ie=>ie.environmentId===w.id),N=c.filter(ie=>ie.environmentId===w.id),A=N.reduce((ie,le)=>ie+(le.costUsd??0),0),R=R5[w.status]||"var(--text-tertiary)",E=w.status==="connected",B=w.status==="connecting",U=w.status==="disconnected"||w.status==="error",z=w.id in d?d[w.id]:void 0,K=()=>{p(w.id),b(!1),a(Vi,{replace:!0})},te=()=>{_(!1),f(w.id,!0)},ne=ie=>{v(ie),C(void 0)};return r.jsxs("div",{className:Ue.container,children:[r.jsx(Us,{isOpen:g,title:"Delete Environment?",description:`"${w.displayName||w.id}" will be permanently removed along with all its data.`,onConfirm:K,onCancel:()=>b(!1)}),r.jsx(Us,{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:te,onCancel:()=>_(!1)}),r.jsxs("div",{className:Ue.envHeader,children:[r.jsxs("div",{className:Ue.envTitleRow,children:[r.jsx("span",{className:Ue.statusDot,style:{color:R},children:"●"}),r.jsx("h2",{className:Ue.envName,children:w.displayName||w.id}),r.jsx("span",{className:Ue.statusBadge,style:{color:R},children:w.status})]}),r.jsxs("div",{className:Ue.envMeta,children:[r.jsxs("span",{className:Ue.metaTag,children:["Adapter: ",w.adapterType]}),N.length>0&&r.jsxs("span",{className:Ue.metaTag,children:[N.length," session",N.length!==1?"s":""]}),A>0&&r.jsxs("span",{className:Ue.metaTag,children:["Cost: ",qi(A)]})]})]}),r.jsxs("div",{className:Ue.actions,children:[E&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:Ue.btnPrimary,onClick:()=>a(rb(w.id)),children:"New Chat"}),r.jsx("button",{className:Ue.btnOutline,onClick:()=>m(w.id),children:"Stop"}),r.jsx("button",{className:Ue.btnOutline,onClick:()=>_(!0),disabled:z!==void 0,"data-testid":"env-reprovision-btn",children:"Reprovision"})]}),U&&r.jsx("button",{className:Ue.btnPrimary,onClick:()=>f(w.id),children:w.status==="error"?"Retry":"Connect"}),B&&z!==void 0&&r.jsx("span",{className:Ue.provisionMessage,children:z.message}),w.status==="error"&&(z==null?void 0:z.stage)==="error"&&r.jsx("span",{className:Ue.errorMessage,children:z.message}),r.jsx("button",{className:Ue.btnOutline,onClick:()=>a(Vk(w.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),r.jsx("button",{className:Ue.btnDanger,onClick:()=>b(!0),children:"Delete"})]}),r.jsxs("div",{className:Ue.section,children:[r.jsxs("div",{className:Ue.sectionHeader,children:[r.jsx("h3",{children:"Workspaces"}),r.jsx("button",{className:Ue.btnPrimary,onClick:()=>a(`${ub}?environment=${encodeURIComponent(w.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"})]}),k.length===0&&r.jsx("p",{className:Ue.empty,children:"No workspaces yet. Create one to get started."}),r.jsx("div",{className:Ue.cardList,children:k.map(ie=>r.jsx(O5,{workspace:ie,confirmArchiveId:T,onOpen:()=>a(Ui(ie.id,w.id)),onArchive:()=>C(ie.id),onConfirmArchive:()=>ne(ie.id),onCancelArchive:()=>C(void 0)},ie.id))})]})]})}function O5({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:Ue.card,"data-testid":"workspace-card",children:[r.jsxs("div",{className:Ue.cardHeader,children:[r.jsx("strong",{className:Ue.cardName,children:n.name}),r.jsxs("div",{className:Ue.cardActions,children:[r.jsx("button",{className:Ue.btnSmall,onClick:i,children:"Open"}),f?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:Ue.btnDanger,onClick:c,children:"Confirm"}),r.jsx("button",{className:Ue.btnSmall,onClick:d,children:"Cancel"})]}):r.jsx("button",{className:Ue.btnSmall,onClick:l,children:"Archive"})]})]}),n.description&&r.jsx("p",{className:Ue.cardDescription,children:n.description}),n.repoUrl&&r.jsx("div",{className:Ue.cardMeta,children:m?r.jsx("a",{href:n.repoUrl,target:"_blank",rel:"noopener noreferrer",className:Ue.repoLink,children:n.repoUrl}):r.jsx("span",{children:n.repoUrl})})]})}const B5={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About",shortcuts:"Shortcuts"};function L5(){const a=Ot().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=B5[a],l=e6(i);return r.jsxs("div",{className:ol.layout,children:[r.jsx(us,{segments:l}),r.jsx("div",{className:ol.content,children:r.jsx("div",{className:ol.tabPanel,children:r.jsx(Ps,{})},a)})]})}const I5="_section_1ingb_14",z5="_sectionTitle_1ingb_26",U5="_sectionDescription_1ingb_35",V5="_tokenList_1ingb_48",H5="_tokenRow_1ingb_55",P5="_tokenBadge_1ingb_68",G5="_tokenName_1ingb_83",$5="_tokenTarget_1ingb_90",q5="_deleteButton_1ingb_99",K5="_addForm_1ingb_113",Y5="_formRow_1ingb_119",F5="_input_1ingb_125",Z5="_select_1ingb_155",X5="_addButton_1ingb_187",Q5="_emptyStateInfo_1ingb_221",W5="_themeOptions_1ingb_229",J5="_themeOption_1ingb_229",eL="_themeOptionSelected_1ingb_254",tL="_themeOptionHeader_1ingb_259",nL="_themeOptionLabel_1ingb_266",aL="_themeOptionDesc_1ingb_273",sL="_variantToggle_1ingb_279",iL="_variantButton_1ingb_286",oL="_variantActive_1ingb_305",lL="_themeSwatches_1ingb_311",rL="_themeSwatch_1ingb_311",cL="_systemToggle_1ingb_325",uL="_systemToggleHint_1ingb_341",dL="_themeActive_1ingb_348",fL="_aboutGrid_1ingb_354",hL="_aboutItem_1ingb_360",mL="_aboutLabel_1ingb_373",pL="_aboutValue_1ingb_379",vL="_aboutDot_1ingb_387",gL="_aboutDotConnected_1ingb_394",yL="_aboutDotDisconnected_1ingb_398",de={section:I5,sectionTitle:z5,sectionDescription:U5,tokenList:V5,tokenRow:H5,tokenBadge:P5,tokenName:G5,tokenTarget:$5,deleteButton:q5,addForm:K5,formRow:Y5,input:F5,select:Z5,addButton:X5,emptyStateInfo:Q5,themeOptions:W5,themeOption:J5,themeOptionSelected:eL,themeOptionHeader:tL,themeOptionLabel:nL,themeOptionDesc:aL,variantToggle:sL,variantButton:iL,variantActive:oL,themeSwatches:lL,themeSwatch:rL,systemToggle:cL,systemToggleHint:uL,themeActive:dL,aboutGrid:fL,aboutItem:hL,aboutLabel:mL,aboutValue:pL,aboutDot:vL,aboutDotConnected:gL,aboutDotDisconnected:yL},bL=[{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 xL({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:de.section,children:[r.jsx("h3",{className:de.sectionTitle,children:"Credential Providers"}),r.jsx("p",{className:de.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),r.jsx("div",{className:de.tokenList,children:bL.map(l=>r.jsxs("div",{className:de.tokenRow,children:[r.jsx("span",{className:de.tokenName,children:l.label}),r.jsx("span",{className:de.tokenTarget,children:l.description}),r.jsx("select",{className:de.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 SL=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function _L({tokens:n,onSetToken:a,onDeleteToken:i}){const{showToast:l}=Ca(),[c,d]=y.useState(""),[f,m]=y.useState(""),[p,v]=y.useState("env_var"),[g,b]=y.useState(""),[x,_]=y.useState(null),T=k=>{if(k.preventDefault(),!c||!f)return;const N=p==="env_var"?g||c.toUpperCase()+"_TOKEN":"";a(c,f,p,N,p==="file"?g:""),l("Token saved successfully","success"),d(""),m(""),b("")},C=k=>{_(k)},w=()=>{x&&(i(x),l("Token deleted","info")),_(null)};return r.jsxs(r.Fragment,{children:[r.jsx(Us,{isOpen:x!==null,title:"Delete Token?",description:x?`"${x}" will be permanently removed.`:void 0,onConfirm:w,onCancel:()=>_(null)}),r.jsxs("section",{className:de.section,children:[r.jsx("h3",{className:de.sectionTitle,children:"Tokens"}),r.jsx("p",{className:de.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?r.jsx("div",{className:de.emptyStateInfo,children:"Add your first API token to enable service integrations."}):r.jsx("div",{className:de.tokenList,children:n.map(k=>r.jsxs("div",{className:de.tokenRow,children:[r.jsx("span",{className:de.tokenBadge,children:k.tokenType}),r.jsx("span",{className:de.tokenName,children:k.name}),r.jsx("span",{className:de.tokenTarget,children:k.tokenType==="env_var"?k.envVar:k.filePath}),r.jsx("button",{className:de.deleteButton,onClick:()=>C(k.name),title:`Delete ${k.name}`,children:"×"})]},k.name))}),r.jsxs("form",{className:de.addForm,onSubmit:T,children:[r.jsxs("div",{className:de.formRow,children:[r.jsx("input",{className:de.input,type:"text",placeholder:"Token name",value:c,onChange:k=>d(k.target.value)}),r.jsx("input",{className:de.input,type:"password",placeholder:"Value",value:f,onChange:k=>m(k.target.value)})]}),r.jsxs("div",{className:de.formRow,children:[r.jsx("select",{className:de.select,value:p,onChange:k=>v(k.target.value),children:SL.map(k=>r.jsx("option",{value:k.value,children:k.label},k.value))}),r.jsx("input",{className:de.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:de.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function TL(){const{tokens:n,setToken:a,deleteToken:i,credentialProviders:l,updateCredentialProviders:c}=ut();return r.jsxs(r.Fragment,{children:[r.jsx(xL,{credentialProviders:l,onUpdateCredentialProviders:c}),r.jsx(_L,{tokens:n,onSetToken:a,onDeleteToken:i})]})}const kL="_container_10efq_1",jL="_header_10efq_7",wL="_form_10efq_19",CL="_formActions_10efq_87",NL="_editableSection_10efq_94",EL="_list_10efq_105",AL="_card_10efq_111",DL="_cardHeader_10efq_125",RL="_cardTitle_10efq_135",ML="_defaultBadge_10efq_141",OL="_cardActions_10efq_155",BL="_description_10efq_160",LL="_meta_10efq_166",IL="_empty_10efq_212",zL="_typeToggle_10efq_348",UL="_typeBadge_10efq_362",VL="_scriptEditor_10efq_376",HL="_optional_10efq_383",ht={container:kL,header:jL,form:wL,formActions:CL,editableSection:NL,list:EL,card:AL,cardHeader:DL,cardTitle:RL,defaultBadge:ML,cardActions:OL,description:BL,meta:LL,empty:IL,typeToggle:zL,typeBadge:UL,scriptEditor:VL,optional:HL};function PL({personas:n,appDefaultPersonaId:a,onDeletePersona:i,onSetAppDefaultPersonaId:l,onNavigateToNew:c,onNavigateToPersona:d}){const[f,m]=y.useState(null),p=f?n.find(g=>g.id===f):void 0,v=async g=>{await i(g),m(null)};return r.jsxs("div",{className:ht.container,children:[r.jsxs("div",{className:ht.header,children:[r.jsx("h2",{children:"Personas"}),r.jsx(Sa,{variant:"primary",size:"md",onClick:c,"data-testid":"persona-new-button",children:"+ New Persona"})]}),n.length===0?r.jsx("p",{className:ht.empty,children:"No personas yet. Create one to get started."}):r.jsx("div",{className:ht.list,children:n.map(g=>{const b=a===g.id,x=g.type==="script";return r.jsxs("div",{className:ht.card,"data-testid":`persona-card-${g.id}`,onClick:()=>d(g.id),role:"button",tabIndex:0,onKeyDown:_=>{_.currentTarget===_.target&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),d(g.id))},children:[r.jsxs("div",{className:ht.cardHeader,children:[r.jsxs("span",{className:ht.cardTitle,children:[r.jsx("strong",{children:g.name}),r.jsx("span",{className:ht.typeBadge,"data-testid":`persona-type-badge-${g.id}`,children:x?"Script":"Agent"}),b&&r.jsx("span",{className:ht.defaultBadge,"data-testid":`persona-default-badge-${g.id}`,children:"App Default"})]}),r.jsxs("div",{className:ht.cardActions,onClick:_=>_.stopPropagation(),children:[!b&&r.jsx(Sa,{variant:"ghost",size:"sm",onClick:()=>{l(g.id).catch(()=>{})},"data-testid":`persona-set-default-${g.id}`,title:"Set as app default persona",children:"Set Default"}),r.jsx(Sa,{variant:"ghost",size:"sm",onClick:()=>d(g.id),children:"Edit"}),r.jsx(Sa,{variant:"ghost",size:"sm",onClick:()=>m(g.id),"data-testid":`persona-delete-${g.id}`,children:"Delete"})]})]}),g.description&&r.jsx("p",{className:ht.description,children:g.description}),r.jsxs("div",{className:ht.meta,children:[g.runtime&&r.jsxs("span",{children:["Runtime: ",g.runtime]}),g.model&&r.jsxs("span",{children:["Model: ",g.model]}),g.maxTurns>0&&r.jsxs("span",{children:["Max turns: ",g.maxTurns]})]})]},g.id)})}),r.jsx(Us,{isOpen:f!==null,title:"Delete Persona?",description:`"${(p==null?void 0:p.name)??""}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:()=>{f&&v(f).catch(()=>{})},onCancel:()=>m(null)})]})}function GL(){const{personas:n,deletePersona:a,appDefaultPersonaId:i,setAppDefaultPersonaId:l}=ut(),{showToast:c}=Ca(),d=xt();return r.jsx(PL,{personas:n,appDefaultPersonaId:i,onDeletePersona:async f=>{try{await a(f)}catch(m){throw console.error("Failed to delete persona",{personaId:f,error:m}),c("Failed to delete persona","error"),m}},onSetAppDefaultPersonaId:async f=>{try{await l(f)}catch(m){console.error("Failed to set app default persona ID",{personaId:f,error:m}),c("Failed to set app default persona","error")}},onNavigateToNew:()=>d(Pk),onNavigateToPersona:f=>d(cb(f))})}const B0=[{value:"claude-code",label:"claude-code"},{value:"codex",label:"codex"},{value:"copilot",label:"copilot"},{value:"goose",label:"goose"},{value:"stub",label:"stub"},{value:"claude-code-acp",label:"claude-code-acp (experimental)"},{value:"codex-acp",label:"codex-acp (experimental)"},{value:"copilot-acp",label:"copilot-acp (experimental)"}],L0=[{value:"genaiscript",label:"genaiscript"}],$L="0";function I0(){const{personaId:n}=rs(),a=xt(),{showToast:i}=Ca(),{personas:l,createPersona:c,updatePersona:d,deletePersona:f,appDefaultPersonaId:m,setAppDefaultPersonaId:p}=ut(),v=n===void 0,g=v?void 0:l.find(x=>x.id===n);if(!v&&l.length>0&&!g)return r.jsx(Hn,{to:$d,replace:!0});const b=[{label:"Settings",url:zi},{label:"Personas",url:$d},{label:v?"New Persona":(g==null?void 0:g.name)??"Persona",url:void 0}];return r.jsxs("div",{className:ht.container,children:[r.jsx(us,{segments:b}),r.jsx(qL,{existing:g,isNew:v,appDefaultPersonaId:m,onCreatePersona:c,onUpdatePersona:d,onDeletePersona:f,onSetAppDefaultPersonaId:p,onDone:()=>{a($d)},showToast:i})]})}function qL({existing:n,isNew:a,appDefaultPersonaId:i,onCreatePersona:l,onUpdatePersona:c,onDeletePersona:d,onSetAppDefaultPersonaId:f,onDone:m,showToast:p}){const v=xt(),[g,b]=y.useState((n==null?void 0:n.name)??""),[x,_]=y.useState((n==null?void 0:n.description)??""),[T,C]=y.useState((n==null?void 0:n.systemPrompt)??""),[w,k]=y.useState((n==null?void 0:n.runtime)??"claude-code"),[N,A]=y.useState((n==null?void 0:n.model)??"sonnet"),[R,E]=y.useState((n==null?void 0:n.maxTurns)??0),[B,U]=y.useState((n==null?void 0:n.type)==="script"?"script":"agent"),[z,K]=y.useState((n==null?void 0:n.script)??""),[te,ne]=y.useState(!1),[ie,le]=y.useState(null),[q,ae]=y.useState(!!a);y.useEffect(()=>{if(!a&&n&&!q){ae(!0),b(n.name),_(n.description),C(n.systemPrompt);const ee=n.type==="script"?"script":"agent";k(ee==="script"?n.runtime||"genaiscript":n.runtime),A(n.model),E(n.maxTurns),U(ee),K(n.script||"")}},[a,n,q]);const O=ee=>{U(ee),ee==="script"?k("genaiscript"):w==="genaiscript"&&k("claude-code")},P=!a&&n===void 0,W=g.trim().length>0&&!P&&T.trim().length>0&&(B==="script"?z.trim().length>0:!!w&&!!N),re=a&&W,oe=!a&&i===(n==null?void 0:n.id),Ne=!a&&n&&!oe&&B==="agent"&&!!w&&!!N,je=(ee,X)=>{if(!ee.trim())return`${X} is required`},Se=ee=>{if(ee.preventDefault(),!(P||!W)){if(n){c(n.id,g,x,T,w,N,R,B,z).then(()=>{p("Persona updated","success"),m()},()=>{p("Failed to save persona","error")});return}l(g,x,T,w,N,R,B,z).then(X=>{p("Persona created","success"),v(cb(X.id),{replace:!0})},()=>{p("Failed to save persona","error")})}},Le=()=>{n&&d(n.id).then(()=>{p("Persona deleted","success"),m()},()=>{p("Failed to delete persona","error")})},ce=async(ee,X,At,pt)=>ee().then(()=>{X(),p(At,"success")},()=>{p(pt,"error")}),ue=(ee,X)=>{if(!n)return;const At=ee==="type"?String(X):B,pt=ee==="runtime"?String(X):ee==="type"?String(X)==="script"?"genaiscript":w==="genaiscript"?"claude-code":w:w,yn=ee==="model"?String(X):N,Ke=ee==="maxTurns"?Number(X):R,Pn=ee==="systemPrompt"?String(X):T,Gn=ee==="script"?String(X):z;ce(()=>c(n.id,ee==="name"?String(X):g,ee==="description"?String(X):x,Pn,pt,yn,Ke,At,Gn),()=>{if(ee==="type"){const Bn=String(X)==="script"?"script":"agent";U(Bn),k(pt)}ee==="runtime"&&k(String(X)),ee==="name"&&b(String(X)),ee==="description"&&_(String(X)),ee==="systemPrompt"&&C(String(X)),ee==="model"&&A(String(X)),ee==="maxTurns"&&E(Number(X)),ee==="script"&&K(String(X))},"Persona updated","Failed to update persona").catch(()=>{})},fe=ee=>{Se(ee)},tt=()=>{n&&f(n.id).then(()=>{p("Set as app default","success")},()=>{p("Failed to set app default","error")})};return r.jsxs(r.Fragment,{children:[P?r.jsxs("div",{className:ht.form,children:[r.jsx("h3",{children:"Edit Persona"}),r.jsx("p",{children:"Loading persona..."})]}):a?r.jsxs("form",{onSubmit:fe,className:ht.form,children:[r.jsx("h3",{children:"Create Persona"}),r.jsxs("div",{className:ht.typeToggle,"data-testid":"persona-type-toggle",children:[r.jsxs("label",{children:[r.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:B==="agent",onChange:()=>O("agent")}),"Agent"]}),r.jsxs("label",{children:[r.jsx("input",{type:"radio",name:"personaType",value:"script",checked:B==="script",onChange:()=>O("script")}),"Script"]})]}),r.jsxs("label",{children:["Name",r.jsx("input",{type:"text",value:g,onChange:ee=>b(ee.target.value),placeholder:B==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0,"data-testid":"persona-detail-name"})]}),r.jsxs("label",{children:["Description",r.jsx("input",{type:"text",value:x,onChange:ee=>_(ee.target.value),placeholder:"Brief description...","data-testid":"persona-detail-description"})]}),r.jsxs("label",{children:["Runtime",r.jsx("select",{value:w,onChange:ee=>k(ee.target.value),"data-testid":"persona-runtime-select",children:(B==="script"?L0:B0).map(ee=>r.jsx("option",{value:ee.value,children:ee.label},ee.value))})]}),B==="agent"&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{children:["Model",r.jsx("input",{type:"text",value:N,onChange:ee=>A(ee.target.value),placeholder:"e.g. sonnet","data-testid":"persona-detail-model"})]}),r.jsxs("label",{children:["Max Turns",r.jsx("input",{type:"number",value:R,onChange:ee=>E(parseInt(ee.target.value,10)||0),min:0,"data-testid":"persona-detail-max-turns"})]}),r.jsxs("label",{children:["System Prompt",r.jsx("textarea",{value:T,onChange:ee=>C(ee.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0,"data-testid":"persona-detail-prompt"})]})]}),B==="script"&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{children:["Model ",r.jsx("span",{className:ht.optional,children:"(optional)"}),r.jsx("input",{type:"text",value:N,onChange:ee=>A(ee.target.value),placeholder:"e.g. sonnet (leave empty for script-only)","data-testid":"persona-detail-model"})]}),r.jsxs("label",{children:["System Prompt",r.jsx("textarea",{value:T,onChange:ee=>C(ee.target.value),placeholder:"Context for the script...",rows:4,required:!0,"data-testid":"persona-detail-prompt"})]}),r.jsxs("label",{children:["Script",r.jsx("textarea",{value:z,onChange:ee=>K(ee.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:ht.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),r.jsxs("div",{className:ht.formActions,children:[r.jsx(Sa,{type:"submit",variant:"primary",size:"md",disabled:!re,"data-testid":"persona-detail-save",children:"Create"}),r.jsx(Sa,{type:"button",variant:"outline",size:"md",onClick:m,"data-testid":"persona-detail-cancel",children:"Cancel"})]})]}):n?r.jsxs("div",{className:ht.form,children:[r.jsx("h3",{children:"Edit Persona"}),r.jsxs("div",{className:ht.formActions,children:[r.jsx(Sa,{type:"button",variant:"outline",size:"md",onClick:m,"data-testid":"persona-detail-cancel",children:"Back to Personas"}),Ne&&r.jsx(Sa,{type:"button",variant:"ghost",size:"md",onClick:tt,"data-testid":"persona-detail-set-default",children:"Set as App Default"}),oe&&r.jsx("span",{className:ht.defaultBadge,children:"App Default"}),r.jsx(Sa,{type:"button",variant:"danger",size:"md",onClick:()=>ne(!0),"data-testid":"persona-detail-delete",children:"Delete"})]}),r.jsxs("div",{className:ht.editableSection,children:[r.jsxs("label",{children:["Name",r.jsx(qt,{value:g,onSave:ee=>{ue("name",ee)},validate:ee=>je(ee,"Name"),fieldId:"persona-name",activeFieldId:ie,onActivate:le,ariaLabel:"Persona name","data-testid":"persona-detail-name"})]}),r.jsxs("label",{children:["Description",r.jsx(qt,{value:x,onSave:ee=>{ue("description",ee)},fieldId:"persona-description",activeFieldId:ie,onActivate:le,placeholder:"Brief description...",ariaLabel:"Persona description","data-testid":"persona-detail-description"})]}),r.jsxs("label",{children:["Type",r.jsx(hc,{value:B,onSave:ee=>{ue("type",ee)},options:[{value:"agent",label:"Agent"},{value:"script",label:"Script"}],fieldId:"persona-type",activeFieldId:ie,onActivate:le,ariaLabel:"Persona type","data-testid":"persona-type-toggle"})]}),r.jsxs("label",{children:["Runtime",r.jsx(hc,{value:w,onSave:ee=>{ue("runtime",ee)},options:B==="script"?L0:B0,fieldId:"persona-runtime",activeFieldId:ie,onActivate:le,ariaLabel:"Persona runtime","data-testid":"persona-runtime"})]}),r.jsxs("label",{children:["Model",B==="script"?" (optional)":"",r.jsx(qt,{value:N,onSave:ee=>{ue("model",ee)},validate:B==="agent"?ee=>je(ee,"Model"):void 0,fieldId:"persona-model",activeFieldId:ie,onActivate:le,placeholder:B==="script"?"e.g. sonnet (leave empty for script-only)":"e.g. sonnet",ariaLabel:"Persona model","data-testid":"persona-detail-model"})]}),r.jsxs("label",{children:["Max Turns",r.jsx(qt,{value:String(R),onSave:ee=>{ue("maxTurns",parseInt(ee,10)||0)},validate:ee=>/^\d+$/.test(ee.trim())?void 0:"Max Turns must be a non-negative integer",fieldId:"persona-max-turns",activeFieldId:ie,onActivate:le,placeholder:$L,ariaLabel:"Persona max turns","data-testid":"persona-detail-max-turns"})]}),r.jsxs("label",{children:["System Prompt",r.jsx(Hf,{value:T,onSave:ee=>{ue("systemPrompt",ee)},validate:ee=>je(ee,"System Prompt"),fieldId:"persona-system-prompt",activeFieldId:ie,onActivate:le,placeholder:B==="script"?"Context for the script...":"You are a senior frontend engineer...",ariaLabel:"Persona system prompt","data-testid":"persona-detail-prompt"})]}),B==="script"&&r.jsxs("label",{children:["Script",r.jsx(Hf,{value:z,onSave:ee=>{ue("script",ee)},validate:ee=>je(ee,"Script"),fieldId:"persona-script",activeFieldId:ie,onActivate:le,placeholder:`script({ model: "openai:gpt-4o" });
113
-
114
- const grackle = await host.mcpServer({
115
- id: "grackle",
116
- url: env.vars.GRACKLE_MCP_URL,
117
- });
118
-
119
- $\`Summarize the current tasks.\`;`,ariaLabel:"Persona script","data-testid":"persona-script-editor"})]})]}),!Ne&&!oe&&r.jsx("p",{style:{fontSize:"var(--font-size-xs)",color:"var(--text-tertiary)",marginTop:"var(--space-xs)"},children:"Only agent personas with a runtime and model can be set as app default."})]}):null,r.jsx(Us,{isOpen:te,title:"Delete Persona?",description:`"${n==null?void 0:n.name}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:Le,onCancel:()=>ne(!1)})]})}function KL(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:l,setPreferSystem:c}=yb();return r.jsxs("section",{className:de.section,children:[r.jsx("h3",{className:de.sectionTitle,children:"Appearance"}),r.jsx("p",{className:de.sectionDescription,children:"Choose how Grackle looks across the app."}),r.jsx("div",{className:de.themeOptions,children:yc.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:`${de.themeOption} ${m?de.themeOptionSelected:""}`,"aria-pressed":m,onClick:()=>i(d.id),children:[r.jsxs("span",{className:de.themeOptionHeader,children:[r.jsxs("span",{children:[r.jsx("span",{className:de.themeOptionLabel,children:d.label}),r.jsx("span",{className:de.themeOptionDesc,children:d.description})]}),f&&r.jsxs("span",{className:de.variantToggle,children:[r.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${m&&p?de.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:`${de.variantButton} ${m&&!p?de.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:de.themeSwatches,children:d.swatches.map((v,g)=>r.jsx("span",{className:de.themeSwatch,style:{background:v}},g))})]},d.id)})}),r.jsxs("label",{className:de.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:de.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),r.jsxs("p",{className:de.themeActive,children:["Active theme: ",r.jsx("strong",{children:a})]})]})}function YL(){return r.jsx(KL,{})}function FL({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:de.section,"data-testid":"about-panel",children:[r.jsx("h3",{className:de.sectionTitle,children:"About"}),r.jsx("p",{className:de.sectionDescription,children:"Connection status and application information."}),r.jsxs("div",{className:de.aboutGrid,children:[r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Connection"}),r.jsxs("span",{className:de.aboutValue,children:[r.jsx("span",{className:`${de.aboutDot} ${n?de.aboutDotConnected:de.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Environments"}),r.jsxs("span",{className:de.aboutValue,children:[l,"/",c," connected"]})]}),r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Active Sessions"}),r.jsx("span",{className:de.aboutValue,children:d})]}),r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Version"}),r.jsx("span",{className:de.aboutValue,children:"0.79.1"})]})]})]})}function ZL({currentVersion:n,latestVersion:a,updateAvailable:i,isDocker:l}){if(!i)return r.jsx(r.Fragment,{});const c=l?"docker pull ghcr.io/nick-pape/grackle:latest && docker restart grackle":`npm install -g @grackle-ai/cli@${a}`;return r.jsx("div",{"data-testid":"update-banner",children:r.jsxs(_D,{variant:"info",dismissible:!0,children:[r.jsxs("strong",{children:["Grackle v",a]})," is available (you have v",n,")."," ","Run: ",r.jsx("code",{children:c})]})})}function XL(){const[n,a]=y.useState(void 0);return y.useEffect(()=>{let i=!1;return _e.getVersionStatus({}).then(l=>{i||a({currentVersion:l.currentVersion,latestVersion:l.latestVersion,updateAvailable:l.updateAvailable,isDocker:l.isDocker})},()=>{}),()=>{i=!0}},[]),n}function QL(){const{connected:n,environments:a,sessions:i}=ut(),l=XL();return r.jsxs(r.Fragment,{children:[l&&r.jsx(ZL,{currentVersion:l.currentVersion,latestVersion:l.latestVersion,updateAvailable:l.updateAvailable,isDocker:l.isDocker}),r.jsx(FL,{connected:n,environments:a,sessions:i})]})}const WL="_group_1iprv_1",JL="_groupTitle_1iprv_8",eI="_shortcutList_1iprv_17",tI="_shortcutRow_1iprv_23",nI="_keys_1iprv_36",aI="_kbd_1iprv_43",sI="_description_1iprv_60",Rs={group:WL,groupTitle:JL,shortcutList:eI,shortcutRow:tI,keys:nI,kbd:aI,description:sI},iI=[{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 oI(){return r.jsxs("section",{className:de.section,"data-testid":"keyboard-shortcuts-panel",children:[r.jsx("h3",{className:de.sectionTitle,children:"Keyboard Shortcuts"}),r.jsx("p",{className:de.sectionDescription,children:"Keyboard shortcuts for navigating and interacting with Grackle. Global shortcuts are suppressed while typing in text fields."}),iI.map(n=>r.jsxs("div",{className:Rs.group,children:[r.jsx("h4",{className:Rs.groupTitle,children:n.title}),r.jsx("div",{className:Rs.shortcutList,children:n.shortcuts.map(a=>r.jsxs("div",{className:Rs.shortcutRow,children:[r.jsx("span",{className:Rs.keys,children:a.keys.map(i=>r.jsx("kbd",{className:Rs.kbd,children:i},i))}),r.jsx("span",{className:Rs.description,children:a.description})]},a.description))})]},n.title))]})}function lI(){return r.jsx(oI,{})}const z0=Gs();function rI(){const n=xt();return ka({key:"?"},()=>{n(Gk)}),ka({key:"n"},()=>{n(z0)}),ka({key:"N"},()=>{n(z0)}),r.jsx(r.Fragment,{})}const cI="_wizard_1260s_1",uI="_container_1260s_10",dI="_stepContent_1260s_19",fI="_logoArea_1260s_28",hI="_logoImage_1260s_32",mI="_heading_1260s_41",pI="_tagline_1260s_49",vI="_subtitle_1260s_56",gI="_featureList_1260s_64",yI="_runtimeGrid_1260s_89",bI="_runtimeCard_1260s_101",xI="_runtimeName_1260s_133",SI="_runtimeDescription_1260s_139",_I="_buttonRow_1260s_144",TI="_primaryButton_1260s_151",kI="_ghostButton_1260s_185",jI="_dots_1260s_213",wI="_dot_1260s_213",st={wizard:cI,container:uI,stepContent:dI,logoArea:fI,logoImage:hI,heading:mI,tagline:pI,subtitle:vI,featureList:gI,runtimeGrid:yI,runtimeCard:bI,runtimeName:xI,runtimeDescription:SI,buttonRow:_I,primaryButton:TI,ghostButton:kI,dots:jI,dot:wI};function CI({onNext:n}){return r.jsxs("div",{className:st.stepContent,"data-testid":"setup-welcome",children:[r.jsx("div",{className:st.logoArea,children:r.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:st.logoImage})}),r.jsx("h1",{className:st.heading,children:"Welcome to Grackle"}),r.jsx("p",{className:st.tagline,children:"Multi-agent orchestration for software teams"}),r.jsx("button",{type:"button",className:st.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function NI({onNext:n,onBack:a}){return r.jsxs("div",{className:st.stepContent,"data-testid":"setup-about",children:[r.jsx("h2",{className:st.heading,children:"What is Grackle?"}),r.jsxs("ul",{className:st.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:st.buttonRow,children:[r.jsx("button",{type:"button",className:st.ghostButton,onClick:a,children:"Back"}),r.jsx("button",{type:"button",className:st.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const EI=[{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 AI({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:st.stepContent,"data-testid":"setup-runtime",children:[r.jsx("h2",{className:st.heading,children:"Choose Your Runtime"}),r.jsx("p",{className:st.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),r.jsx("div",{className:st.runtimeGrid,children:EI.map(f=>r.jsxs("button",{type:"button",className:st.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:st.runtimeName,children:f.name}),r.jsx("span",{className:st.runtimeDescription,children:f.description})]},f.id))}),r.jsxs("div",{className:st.buttonRow,children:[r.jsx("button",{type:"button",className:st.ghostButton,onClick:i,children:"Back"}),r.jsx("button",{type:"button",className:st.primaryButton,onClick:()=>a(c),disabled:l,"data-testid":"setup-finish",children:"Finish"})]})]})}const DI=3,U0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function RI(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:l}=ut(),c=xt(),[d,f]=y.useState(0),m=n.find(v=>v.id==="claude-code"),p=y.useCallback(v=>{if(m&&v!==m.runtime){const b=U0[v]??"sonnet";a(m.id,void 0,void 0,void 0,v,b).catch(()=>{})}const g=n.find(b=>b.id===Ug);if(g&&v!==g.runtime){const b=U0[v]??"sonnet";a(Ug,void 0,void 0,void 0,v,b).catch(()=>{})}i(),c("/",{replace:!0})},[m,n,a,i,c]);return l===!0?r.jsx(Hn,{to:"/",replace:!0}):r.jsx("div",{className:st.wizard,"data-testid":"setup-wizard",children:r.jsxs("div",{className:st.container,children:[r.jsx(ea,{mode:"wait",children:r.jsxs(Et.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(CI,{onNext:()=>f(1)}),d===1&&r.jsx(NI,{onNext:()=>f(2),onBack:()=>f(0)}),d===2&&r.jsx(AI,{currentRuntime:(m==null?void 0:m.runtime)??"claude-code",onFinish:p,onBack:()=>f(1),finishDisabled:!m})]},d)}),r.jsx("div",{className:st.dots,children:Array.from({length:DI},(v,g)=>r.jsx("span",{className:st.dot,"data-active":g===d},g))})]})})}const MI="_root_zndgp_1",OI="_body_zndgp_7",BI="_main_zndgp_19",LI="_sidebarWrapper_zndgp_26",II="_overlay_zndgp_51",el={root:MI,body:OI,main:BI,sidebarWrapper:LI,overlay:II},zI=y.lazy(()=>J1(()=>import("./KnowledgePage-Dw7sBz4g.js"),__vite__mapDeps([0,1,2,3,4])).then(n=>({default:n.KnowledgePage}))),UI=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function VI(){const{connected:n,environments:a,sessions:i,tasks:l}=ut(),c=Ot(),f=Sb()!==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(Pj,{connected:n,environments:a,sessions:i,onToggleSidebar:f?v:void 0,sidebarOpen:m}),r.jsx(Zj,{}),r.jsxs("div",{className:el.body,children:[f&&r.jsx("div",{className:el.sidebarWrapper,"data-sidebar-open":m,children:r.jsx(aw,{})}),f&&m&&r.jsx("div",{className:el.overlay,"data-testid":"drawer-overlay",onClick:()=>p(!1)}),r.jsxs("div",{className:el.main,children:[r.jsx(Ps,{}),r.jsx(JA,{sessions:i,tasks:l,environments:a})]})]}),r.jsx(fD,{}),r.jsx(rI,{})]})}function HI(){const{lastSpawnedId:n,environments:a,tasks:i,connected:l,onboardingCompleted:c}=ut(),{showToast:d}=Ca();KR(a,d),XR(i,d);const f=xt(),m=Ot();return y.useEffect(()=>{n&&!m.pathname.includes("/tasks/")&&f(lb(n),{replace:!0})},[n,f,m.pathname]),l&&c===!1?r.jsx(Hn,{to:"/setup",replace:!0}):r.jsx(Xj,{children:r.jsx("div",{className:el.root,children:r.jsx(VI,{})})})}function pf(){const{workspaceId:n}=rs(),{workspaces:a}=ut(),i=Ot(),l=a.find(p=>p.id===n);if(!(l!=null&&l.environmentId))return a.length===0?void 0:r.jsx(Hn,{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(Hn,{to:m,replace:!0})}function PI(){return r.jsxs(sk,{children:[r.jsx(ke,{path:"setup",element:r.jsx(RI,{})}),r.jsxs(ke,{element:r.jsx(HI,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(TO,{})}),r.jsx(ke,{path:"chat",element:r.jsx(WO,{})}),r.jsx(ke,{path:"sessions/new",element:r.jsx(o6,{})}),r.jsx(ke,{path:"sessions/:sessionId",element:r.jsx(c6,{})}),r.jsx(ke,{element:r.jsx(qA,{}),children:r.jsx(ke,{path:"knowledge",element:r.jsx(y.Suspense,{fallback:r.jsx(oS,{}),children:r.jsx(zI,{})})})}),r.jsxs(ke,{element:r.jsx(PA,{}),children:[r.jsx(ke,{path:"tasks",element:r.jsx(SO,{})}),r.jsx(ke,{path:"tasks/new",element:r.jsx(R0,{})}),r.jsx(ke,{path:"tasks/:taskId",element:r.jsx(as,{})}),r.jsx(ke,{path:"tasks/:taskId/edit",element:r.jsx(as,{})}),r.jsx(ke,{path:"tasks/:taskId/stream",element:r.jsx(as,{})}),r.jsx(ke,{path:"tasks/:taskId/findings",element:r.jsx(as,{})})]}),r.jsxs(ke,{element:r.jsx(GA,{}),children:[r.jsx(ke,{path:"workspaces",element:r.jsx(Hn,{to:"/environments",replace:!0})}),r.jsx(ke,{path:"workspaces/new",element:r.jsx(dB,{})}),r.jsx(ke,{path:"workspaces/:workspaceId",element:r.jsx(pf,{})}),r.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId",element:r.jsx(pf,{})}),r.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:r.jsx(pf,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId",element:r.jsx(E4,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:r.jsx(R0,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:r.jsx(as,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:r.jsx(as,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:r.jsx(as,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:r.jsx(as,{})}),r.jsxs(ke,{path:"environments",element:r.jsx(i5,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(_O,{})}),r.jsx(ke,{path:"new",element:r.jsx(e5,{})}),r.jsx(ke,{path:":environmentId",element:r.jsx(M5,{})}),r.jsx(ke,{path:":environmentId/edit",element:r.jsx(t5,{})})]})]}),r.jsx(ke,{element:r.jsx($A,{}),children:r.jsxs(ke,{path:"settings",element:r.jsx(L5,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(Hn,{to:"credentials",replace:!0})}),r.jsx(ke,{path:"environments",element:r.jsx(Hn,{to:"/environments",replace:!0})}),r.jsx(ke,{path:"credentials",element:r.jsx(TL,{})}),r.jsx(ke,{path:"tokens",element:r.jsx(Hn,{to:"../credentials",replace:!0})}),r.jsx(ke,{path:"personas",element:r.jsx(GL,{})}),r.jsx(ke,{path:"personas/new",element:r.jsx(I0,{})}),r.jsx(ke,{path:"personas/:personaId",element:r.jsx(I0,{})}),r.jsx(ke,{path:"appearance",element:r.jsx(YL,{})}),r.jsx(ke,{path:"shortcuts",element:r.jsx(lI,{})}),r.jsx(ke,{path:"about",element:r.jsx(QL,{})})]})}),r.jsx(ke,{path:"*",element:r.jsx(Hn,{to:"/",replace:!0})})]})]})}const GI=1e4;function $I(){const{onboardingCompleted:n}=ut(),[a,i]=y.useState(!1);y.useEffect(()=>{if(n!==void 0)return;const c=setTimeout(()=>i(!0),GI);return()=>clearTimeout(c)},[n]);const l=n===void 0&&!a;return r.jsx(ea,{mode:"wait",children:l?r.jsx(Et.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:r.jsx(oS,{})},"splash"):r.jsx(Et.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:r.jsx(Ek,{children:r.jsx(PI,{})})},"app")})}function qI(){const n=UI?wj:gj;return r.jsx(Rj,{children:r.jsx(Nj,{children:r.jsx(n,{children:r.jsx($I,{})})})})}X1.createRoot(document.getElementById("root")).render(r.jsx(y.StrictMode,{children:r.jsx(qI,{})}));export{us as B,db as K,ut as a,lb as s,Jn as t,xt as u};