@grackle-ai/web 0.70.5 → 0.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/KnowledgePage-DMqJ4jlP.css +1 -0
- package/dist/assets/KnowledgePage-DWFdajx3.js +1 -0
- package/dist/assets/{dagview-EHk2VaeR.js → dagview-BA5TtMAQ.js} +1 -1
- package/dist/assets/index-Bxv7jTE6.css +1 -0
- package/dist/assets/index-Hh6iEU1L.js +112 -0
- package/dist/index.html +3 -3
- package/package.json +10 -2
- package/dist/assets/index-Be6lL6p0.js +0 -111
- package/dist/assets/index-BtTig1d5.css +0 -1
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import{r as IS,a as x,j as c,v as LS,b as US,t as zr,i as zS,f as VS,M as Zf,c as Xf}from"./markdown-gcy1Jmzi.js";import{r as HS,d as $v,H as Fv,P as qv,i as GS,B as PS,a as $S,C as FS,M as qS}from"./dagview-EHk2VaeR.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))l(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(r){if(r.ep)return;r.ep=!0;const u=i(r);fetch(r.href,u)}})();var Pd={exports:{}},Go={},$d={exports:{}},Fd={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* scheduler.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Yv;function YS(){return Yv||(Yv=1,(function(n){function a(B,H){var ae=B.length;B.push(H);e:for(;0<ae;){var G=ae-1>>>1,O=B[G];if(0<r(O,H))B[G]=H,B[ae]=O,ae=G;else break e}}function i(B){return B.length===0?null:B[0]}function l(B){if(B.length===0)return null;var H=B[0],ae=B.pop();if(ae!==H){B[0]=ae;e:for(var G=0,O=B.length,se=O>>>1;G<se;){var ye=2*(G+1)-1,re=B[ye],Fe=ye+1,vt=B[Fe];if(0>r(re,ae))Fe<O&&0>r(vt,re)?(B[G]=vt,B[Fe]=ae,G=Fe):(B[G]=re,B[ye]=ae,G=ye);else if(Fe<O&&0>r(vt,ae))B[G]=vt,B[Fe]=ae,G=Fe;else break e}}return H}function r(B,H){var ae=B.sortIndex-H.sortIndex;return ae!==0?ae:B.id-H.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var m=[],g=[],y=1,v=null,b=3,S=!1,k=!1,C=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function M(B){for(var H=i(g);H!==null;){if(H.callback===null)l(g);else if(H.startTime<=B)l(g),H.sortIndex=H.expirationTime,a(m,H);else break;H=i(g)}}function j(B){if(C=!1,M(B),!k)if(i(m)!==null)k=!0,K||(K=!0,$());else{var H=i(g);H!==null&&te(j,H.startTime-B)}}var K=!1,q=-1,U=5,W=-1;function ee(){return N?!0:!(n.unstable_now()-W<U)}function ie(){if(N=!1,K){var B=n.unstable_now();W=B;var H=!0;try{e:{k=!1,C&&(C=!1,A(q),q=-1),S=!0;var ae=b;try{t:{for(M(B),v=i(m);v!==null&&!(v.expirationTime>B&&ee());){var G=v.callback;if(typeof G=="function"){v.callback=null,b=v.priorityLevel;var O=G(v.expirationTime<=B);if(B=n.unstable_now(),typeof O=="function"){v.callback=O,M(B),H=!0;break t}v===i(m)&&l(m),M(B)}else l(m);v=i(m)}if(v!==null)H=!0;else{var se=i(g);se!==null&&te(j,se.startTime-B),H=!1}}break e}finally{v=null,b=ae,S=!1}H=void 0}}finally{H?$():K=!1}}}var $;if(typeof D=="function")$=function(){D(ie)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,F=le.port2;le.port1.onmessage=ie,$=function(){F.postMessage(null)}}else $=function(){E(ie,0)};function te(B,H){q=E(function(){B(n.unstable_now())},H)}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(B){B.callback=null},n.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<B?Math.floor(1e3/B):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(B){switch(b){case 1:case 2:case 3:var H=3;break;default:H=b}var ae=b;b=H;try{return B()}finally{b=ae}},n.unstable_requestPaint=function(){N=!0},n.unstable_runWithPriority=function(B,H){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var ae=b;b=B;try{return H()}finally{b=ae}},n.unstable_scheduleCallback=function(B,H,ae){var G=n.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?G+ae:G):ae=G,B){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=ae+O,B={id:y++,callback:H,priorityLevel:B,startTime:ae,expirationTime:O,sortIndex:-1},ae>G?(B.sortIndex=ae,a(g,B),i(m)===null&&B===i(g)&&(C?(A(q),q=-1):C=!0,te(j,ae-G))):(B.sortIndex=O,a(m,B),k||S||(k=!0,K||(K=!0,$()))),B},n.unstable_shouldYield=ee,n.unstable_wrapCallback=function(B){var H=b;return function(){var ae=b;b=H;try{return B.apply(this,arguments)}finally{b=ae}}}})(Fd)),Fd}var Kv;function KS(){return Kv||(Kv=1,$d.exports=YS()),$d.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-dom-client.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Zv;function ZS(){if(Zv)return Go;Zv=1;var n=KS(),a=IS(),i=HS();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 r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(u(e)!==e)throw Error(l(188))}function g(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(l(188));return t!==e?null:e}for(var s=e,o=t;;){var d=s.return;if(d===null)break;var h=d.alternate;if(h===null){if(o=d.return,o!==null){s=o;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===s)return m(d),e;if(h===o)return m(d),t;h=h.sibling}throw Error(l(188))}if(s.return!==o.return)s=d,o=h;else{for(var _=!1,T=d.child;T;){if(T===s){_=!0,s=d,o=h;break}if(T===o){_=!0,o=d,s=h;break}T=T.sibling}if(!_){for(T=h.child;T;){if(T===s){_=!0,s=h,o=d;break}if(T===o){_=!0,o=h,s=d;break}T=T.sibling}if(!_)throw Error(l(189))}}if(s.alternate!==o)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),D=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=ie&&e[ie]||e["@@iterator"],typeof e=="function"?e:null)}var le=Symbol.for("react.client.reference");function F(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 E:return"Profiler";case N:return"StrictMode";case j:return"Suspense";case K:return"SuspenseList";case W:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case D:return e.displayName||"Context";case A:return(e._context.displayName||"Context")+".Consumer";case M:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q:return t=e.displayName||null,t!==null?t:F(e.type)||"Memo";case U:t=e._payload,e=e._init;try{return F(e(t))}catch{}}return null}var te=Array.isArray,B=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},G=[],O=-1;function se(e){return{current:e}}function ye(e){0>O||(e.current=G[O],G[O]=null,O--)}function re(e,t){O++,G[O]=e.current,e.current=t}var Fe=se(null),vt=se(null),he=se(null),jt=se(null);function pn(e,t){switch(re(he,t),re(vt,e),re(Fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?hv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=hv(t),e=pv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ye(Fe),re(Fe,e)}function jn(){ye(Fe),ye(vt),ye(he)}function Bn(e){e.memoizedState!==null&&re(jt,e);var t=Fe.current,s=pv(t,e.type);t!==s&&(re(vt,e),re(Fe,s))}function Se(e){vt.current===e&&(ye(Fe),ye(vt)),jt.current===e&&(ye(jt),Uo._currentValue=ae)}var ft,Bs;function In(e){if(ft===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);ft=t&&t[1]||"",Bs=-1<s.stack.indexOf(`
|
|
18
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
-
`+ft+e+Bs}var Is=!1;function Ls(e,t){if(!e||Is)return"";Is=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(Y){var P=Y}Reflect.construct(e,[],J)}else{try{J.call()}catch(Y){P=Y}e.call(J.prototype)}}else{try{throw Error()}catch(Y){P=Y}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(Y){if(Y&&P&&typeof Y.stack=="string")return[Y.stack,P.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),_=h[0],T=h[1];if(_&&T){var w=_.split(`
|
|
20
|
-
`),V=T.split(`
|
|
21
|
-
`);for(d=o=0;o<w.length&&!w[o].includes("DetermineComponentFrameRoot");)o++;for(;d<V.length&&!V[d].includes("DetermineComponentFrameRoot");)d++;if(o===w.length||d===V.length)for(o=w.length-1,d=V.length-1;1<=o&&0<=d&&w[o]!==V[d];)d--;for(;1<=o&&0<=d;o--,d--)if(w[o]!==V[d]){if(o!==1||d!==1)do if(o--,d--,0>d||w[o]!==V[d]){var Z=`
|
|
22
|
-
`+w[o].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=o&&0<=d);break}}}finally{Is=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?In(s):""}function Tl(e,t){switch(e.tag){case 26:case 27:case 5:return In(e.type);case 16:return In("Lazy");case 13:return e.child!==t&&t!==null?In("Suspense Fallback"):In("Suspense");case 19:return In("SuspenseList");case 0:case 15:return Ls(e.type,!1);case 11:return Ls(e.type.render,!1);case 1:return Ls(e.type,!0);case 31:return In("Activity");default:return""}}function Zi(e){try{var t="",s=null;do t+=Tl(e,s),s=e,e=e.return;while(e);return t}catch(o){return`
|
|
23
|
-
Error generating stack: `+o.message+`
|
|
24
|
-
`+o.stack}}var Us=Object.prototype.hasOwnProperty,zs=n.unstable_scheduleCallback,Vs=n.unstable_cancelCallback,kl=n.unstable_shouldYield,Cl=n.unstable_requestPaint,Lt=n.unstable_now,jc=n.unstable_getCurrentPriorityLevel,Q=n.unstable_ImmediatePriority,oe=n.unstable_UserBlockingPriority,ce=n.unstable_NormalPriority,_e=n.unstable_LowPriority,xe=n.unstable_IdlePriority,Xe=n.log,Ce=n.unstable_setDisableYieldValue,ht=null,Ee=null;function lt(e){if(typeof Xe=="function"&&Ce(e),Ee&&typeof Ee.setStrictMode=="function")try{Ee.setStrictMode(ht,e)}catch{}}var qe=Math.clz32?Math.clz32:Ut,Gt=Math.log,en=Math.LN2;function Ut(e){return e>>>=0,e===0?32:31-(Gt(e)/en|0)|0}var Sa=256,mn=262144,Ta=4194304;function is(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 El(e,t,s){var o=e.pendingLanes;if(o===0)return 0;var d=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var T=o&134217727;return T!==0?(o=T&~h,o!==0?d=is(o):(_&=T,_!==0?d=is(_):s||(s=T&~e,s!==0&&(d=is(s))))):(T=o&~h,T!==0?d=is(T):_!==0?d=is(_):s||(s=o&~e,s!==0&&(d=is(s)))),d===0?0:t!==0&&t!==d&&(t&h)===0&&(h=d&-d,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:d}function Xi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function T1(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 Kh(){var e=Ta;return Ta<<=1,(Ta&62914560)===0&&(Ta=4194304),e}function Dc(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 k1(e,t,s,o,d,h){var _=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var T=e.entanglements,w=e.expirationTimes,V=e.hiddenUpdates;for(s=_&~s;0<s;){var Z=31-qe(s),J=1<<Z;T[Z]=0,w[Z]=-1;var P=V[Z];if(P!==null)for(V[Z]=null,Z=0;Z<P.length;Z++){var Y=P[Z];Y!==null&&(Y.lane&=-536870913)}s&=~J}o!==0&&Zh(e,o,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~t))}function Zh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-qe(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|s&261930}function Xh(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-qe(s),d=1<<o;d&t|e[o]&t&&(e[o]|=t),s&=~d}}function Qh(e,t){var s=t&-t;return s=(s&42)!==0?1:Mc(s),(s&(e.suspendedLanes|t))!==0?0:s}function Mc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Rc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Wh(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Lv(e.type))}function Jh(e,t){var s=H.p;try{return H.p=e,t()}finally{H.p=s}}var ka=Math.random().toString(36).slice(2),Dt="__reactFiber$"+ka,qt="__reactProps$"+ka,Hs="__reactContainer$"+ka,Oc="__reactEvents$"+ka,C1="__reactListeners$"+ka,E1="__reactHandles$"+ka,ep="__reactResources$"+ka,Wi="__reactMarker$"+ka;function Bc(e){delete e[Dt],delete e[qt],delete e[Oc],delete e[C1],delete e[E1]}function Gs(e){var t=e[Dt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Hs]||s[Dt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=_v(e);e!==null;){if(s=e[Dt])return s;e=_v(e)}return t}e=s,s=e.parentNode}return null}function Ps(e){if(e=e[Dt]||e[Hs]){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 $s(e){var t=e[ep];return t||(t=e[ep]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function At(e){e[Wi]=!0}var tp=new Set,np={};function os(e,t){Fs(e,t),Fs(e+"Capture",t)}function Fs(e,t){for(np[e]=t,e=0;e<t.length;e++)tp.add(t[e])}var N1=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]*$"),ap={},sp={};function A1(e){return Us.call(sp,e)?!0:Us.call(ap,e)?!1:N1.test(e)?sp[e]=!0:(ap[e]=!0,!1)}function Nl(e,t,s){if(A1(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 Al(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 Xn(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 gn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ip(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function w1(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 d=o.get,h=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(_){s=""+_,h.call(this,_)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ic(e){if(!e._valueTracker){var t=ip(e)?"checked":"value";e._valueTracker=w1(e,t,""+e[t])}}function op(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=ip(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 j1=/[\n"\\]/g;function vn(e){return e.replace(j1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Lc(e,t,s,o,d,h,_,T){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),t!=null?_==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+gn(t)):e.value!==""+gn(t)&&(e.value=""+gn(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?Uc(e,_,gn(t)):s!=null?Uc(e,_,gn(s)):o!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+gn(T):e.removeAttribute("name")}function lp(e,t,s,o,d,h,_,T){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){Ic(e);return}s=s!=null?""+gn(s):"",t=t!=null?""+gn(t):s,T||t===e.value||(e.value=t),e.defaultValue=t}o=o??d,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=T?e.checked:!!o,e.defaultChecked=!!o,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Ic(e)}function Uc(e,t,s){t==="number"&&wl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function qs(e,t,s,o){if(e=e.options,t){t={};for(var d=0;d<s.length;d++)t["$"+s[d]]=!0;for(s=0;s<e.length;s++)d=t.hasOwnProperty("$"+e[s].value),e[s].selected!==d&&(e[s].selected=d),d&&o&&(e[s].defaultSelected=!0)}else{for(s=""+gn(s),t=null,d=0;d<e.length;d++){if(e[d].value===s){e[d].selected=!0,o&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function rp(e,t,s){if(t!=null&&(t=""+gn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+gn(s):""}function cp(e,t,s,o){if(t==null){if(o!=null){if(s!=null)throw Error(l(92));if(te(o)){if(1<o.length)throw Error(l(93));o=o[0]}s=o}s==null&&(s=""),t=s}s=gn(t),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o),Ic(e)}function Ys(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var D1=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 up(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||D1.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function dp(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 d in t)o=t[d],t.hasOwnProperty(d)&&s[d]!==o&&up(e,d,o)}else for(var h in t)t.hasOwnProperty(h)&&up(e,h,t[h])}function zc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var M1=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"]]),R1=/^[\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 jl(e){return R1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Qn(){}var Vc=null;function Hc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ks=null,Zs=null;function fp(e){var t=Ps(e);if(t&&(e=t.stateNode)){var s=e[qt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Lc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+vn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var d=o[qt]||null;if(!d)throw Error(l(90));Lc(o,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<s.length;t++)o=s[t],o.form===e.form&&op(o)}break e;case"textarea":rp(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&qs(e,!!s.multiple,t,!1)}}}var Gc=!1;function hp(e,t,s){if(Gc)return e(t,s);Gc=!0;try{var o=e(t);return o}finally{if(Gc=!1,(Ks!==null||Zs!==null)&&(vr(),Ks&&(t=Ks,e=Zs,Zs=Ks=null,fp(t),e)))for(t=0;t<e.length;t++)fp(e[t])}}function eo(e,t){var s=e.stateNode;if(s===null)return null;var o=s[qt]||null;if(o===null)return null;s=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,t,typeof s));return s}var Wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pc=!1;if(Wn)try{var to={};Object.defineProperty(to,"passive",{get:function(){Pc=!0}}),window.addEventListener("test",to,to),window.removeEventListener("test",to,to)}catch{Pc=!1}var Ca=null,$c=null,Dl=null;function pp(){if(Dl)return Dl;var e,t=$c,s=t.length,o,d="value"in Ca?Ca.value:Ca.textContent,h=d.length;for(e=0;e<s&&t[e]===d[e];e++);var _=s-e;for(o=1;o<=_&&t[s-o]===d[h-o];o++);return Dl=d.slice(e,1<o?1-o:void 0)}function Ml(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 Rl(){return!0}function mp(){return!1}function Yt(e){function t(s,o,d,h,_){this._reactName=s,this._targetInst=d,this.type=o,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(s=e[T],this[T]=s?s(h):h[T]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Rl:mp,this.isPropagationStopped=mp,this}return v(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=Rl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Rl)},persist:function(){},isPersistent:Rl}),t}var ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ol=Yt(ls),no=v({},ls,{view:0,detail:0}),O1=Yt(no),Fc,qc,ao,Bl=v({},no,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kc,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"?(Fc=e.screenX-ao.screenX,qc=e.screenY-ao.screenY):qc=Fc=0,ao=e),Fc)},movementY:function(e){return"movementY"in e?e.movementY:qc}}),gp=Yt(Bl),B1=v({},Bl,{dataTransfer:0}),I1=Yt(B1),L1=v({},no,{relatedTarget:0}),Yc=Yt(L1),U1=v({},ls,{animationName:0,elapsedTime:0,pseudoElement:0}),z1=Yt(U1),V1=v({},ls,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),H1=Yt(V1),G1=v({},ls,{data:0}),vp=Yt(G1),P1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$1={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"},F1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function q1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=F1[e])?!!t[e]:!1}function Kc(){return q1}var Y1=v({},no,{key:function(e){if(e.key){var t=P1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ml(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kc,charCode:function(e){return e.type==="keypress"?Ml(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ml(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),K1=Yt(Y1),Z1=v({},Bl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yp=Yt(Z1),X1=v({},no,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kc}),Q1=Yt(X1),W1=v({},ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),J1=Yt(W1),e_=v({},Bl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),t_=Yt(e_),n_=v({},ls,{newState:0,oldState:0}),a_=Yt(n_),s_=[9,13,27,32],Zc=Wn&&"CompositionEvent"in window,so=null;Wn&&"documentMode"in document&&(so=document.documentMode);var i_=Wn&&"TextEvent"in window&&!so,bp=Wn&&(!Zc||so&&8<so&&11>=so),xp=" ",_p=!1;function Sp(e,t){switch(e){case"keyup":return s_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xs=!1;function o_(e,t){switch(e){case"compositionend":return Tp(t);case"keypress":return t.which!==32?null:(_p=!0,xp);case"textInput":return e=t.data,e===xp&&_p?null:e;default:return null}}function l_(e,t){if(Xs)return e==="compositionend"||!Zc&&Sp(e,t)?(e=pp(),Dl=$c=Ca=null,Xs=!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 bp&&t.locale!=="ko"?null:t.data;default:return null}}var r_={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 kp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!r_[e.type]:t==="textarea"}function Cp(e,t,s,o){Ks?Zs?Zs.push(o):Zs=[o]:Ks=o,t=kr(t,"onChange"),0<t.length&&(s=new Ol("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var io=null,oo=null;function c_(e){lv(e,0)}function Il(e){var t=Ji(e);if(op(t))return e}function Ep(e,t){if(e==="change")return t}var Np=!1;if(Wn){var Xc;if(Wn){var Qc="oninput"in document;if(!Qc){var Ap=document.createElement("div");Ap.setAttribute("oninput","return;"),Qc=typeof Ap.oninput=="function"}Xc=Qc}else Xc=!1;Np=Xc&&(!document.documentMode||9<document.documentMode)}function wp(){io&&(io.detachEvent("onpropertychange",jp),oo=io=null)}function jp(e){if(e.propertyName==="value"&&Il(oo)){var t=[];Cp(t,oo,e,Hc(e)),hp(c_,t)}}function u_(e,t,s){e==="focusin"?(wp(),io=t,oo=s,io.attachEvent("onpropertychange",jp)):e==="focusout"&&wp()}function d_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Il(oo)}function f_(e,t){if(e==="click")return Il(t)}function h_(e,t){if(e==="input"||e==="change")return Il(t)}function p_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tn=typeof Object.is=="function"?Object.is:p_;function lo(e,t){if(tn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var d=s[o];if(!Us.call(t,d)||!tn(e[d],t[d]))return!1}return!0}function Dp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mp(e,t){var s=Dp(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=Dp(s)}}function Rp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Op(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 Wc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var m_=Wn&&"documentMode"in document&&11>=document.documentMode,Qs=null,Jc=null,ro=null,eu=!1;function Bp(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;eu||Qs==null||Qs!==wl(o)||(o=Qs,"selectionStart"in o&&Wc(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=kr(Jc,"onSelect"),0<o.length&&(t=new Ol("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=Qs)))}function rs(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Ws={animationend:rs("Animation","AnimationEnd"),animationiteration:rs("Animation","AnimationIteration"),animationstart:rs("Animation","AnimationStart"),transitionrun:rs("Transition","TransitionRun"),transitionstart:rs("Transition","TransitionStart"),transitioncancel:rs("Transition","TransitionCancel"),transitionend:rs("Transition","TransitionEnd")},tu={},Ip={};Wn&&(Ip=document.createElement("div").style,"AnimationEvent"in window||(delete Ws.animationend.animation,delete Ws.animationiteration.animation,delete Ws.animationstart.animation),"TransitionEvent"in window||delete Ws.transitionend.transition);function cs(e){if(tu[e])return tu[e];if(!Ws[e])return e;var t=Ws[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Ip)return tu[e]=t[s];return e}var Lp=cs("animationend"),Up=cs("animationiteration"),zp=cs("animationstart"),g_=cs("transitionrun"),v_=cs("transitionstart"),y_=cs("transitioncancel"),Vp=cs("transitionend"),Hp=new Map,nu="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(" ");nu.push("scrollEnd");function Dn(e,t){Hp.set(e,t),os(t,[e])}var Ll=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},yn=[],Js=0,au=0;function Ul(){for(var e=Js,t=au=Js=0;t<e;){var s=yn[t];yn[t++]=null;var o=yn[t];yn[t++]=null;var d=yn[t];yn[t++]=null;var h=yn[t];if(yn[t++]=null,o!==null&&d!==null){var _=o.pending;_===null?d.next=d:(d.next=_.next,_.next=d),o.pending=d}h!==0&&Gp(s,d,h)}}function zl(e,t,s,o){yn[Js++]=e,yn[Js++]=t,yn[Js++]=s,yn[Js++]=o,au|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function su(e,t,s,o){return zl(e,t,s,o),Vl(e)}function us(e,t){return zl(e,null,null,t),Vl(e)}function Gp(e,t,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var d=!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||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&t!==null&&(d=31-qe(s),e=h.hiddenUpdates,o=e[d],o===null?e[d]=[t]:o.push(t),t.lane=s|536870912),h):null}function Vl(e){if(50<Do)throw Do=0,hd=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ei={};function b_(e,t,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(e,t,s,o){return new b_(e,t,s,o)}function iu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jn(e,t){var s=e.alternate;return s===null?(s=nn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Pp(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Hl(e,t,s,o,d,h){var _=0;if(o=e,typeof e=="function")iu(e)&&(_=1);else if(typeof e=="string")_=kS(e,s,Fe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case W:return e=nn(31,s,t,d),e.elementType=W,e.lanes=h,e;case C:return ds(s.children,d,h,t);case N:_=8,d|=24;break;case E:return e=nn(12,s,t,d|2),e.elementType=E,e.lanes=h,e;case j:return e=nn(13,s,t,d),e.elementType=j,e.lanes=h,e;case K:return e=nn(19,s,t,d),e.elementType=K,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:_=10;break e;case A:_=9;break e;case M:_=11;break e;case q:_=14;break e;case U:_=16,o=null;break e}_=29,s=Error(l(130,e===null?"null":typeof e,"")),o=null}return t=nn(_,s,t,d),t.elementType=e,t.type=o,t.lanes=h,t}function ds(e,t,s,o){return e=nn(7,e,o,t),e.lanes=s,e}function ou(e,t,s){return e=nn(6,e,null,t),e.lanes=s,e}function $p(e){var t=nn(18,null,null,0);return t.stateNode=e,t}function lu(e,t,s){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fp=new WeakMap;function bn(e,t){if(typeof e=="object"&&e!==null){var s=Fp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Zi(t)},Fp.set(e,t),t)}return{value:e,source:t,stack:Zi(t)}}var ti=[],ni=0,Gl=null,co=0,xn=[],_n=0,Ea=null,Ln=1,Un="";function ea(e,t){ti[ni++]=co,ti[ni++]=Gl,Gl=e,co=t}function qp(e,t,s){xn[_n++]=Ln,xn[_n++]=Un,xn[_n++]=Ea,Ea=e;var o=Ln;e=Un;var d=32-qe(o)-1;o&=~(1<<d),s+=1;var h=32-qe(t)+d;if(30<h){var _=d-d%5;h=(o&(1<<_)-1).toString(32),o>>=_,d-=_,Ln=1<<32-qe(t)+d|s<<d|o,Un=h+e}else Ln=1<<h|s<<d|o,Un=e}function ru(e){e.return!==null&&(ea(e,1),qp(e,1,0))}function cu(e){for(;e===Gl;)Gl=ti[--ni],ti[ni]=null,co=ti[--ni],ti[ni]=null;for(;e===Ea;)Ea=xn[--_n],xn[_n]=null,Un=xn[--_n],xn[_n]=null,Ln=xn[--_n],xn[_n]=null}function Yp(e,t){xn[_n++]=Ln,xn[_n++]=Un,xn[_n++]=Ea,Ln=t.id,Un=t.overflow,Ea=e}var Mt=null,tt=null,Re=!1,Na=null,Sn=!1,uu=Error(l(519));function Aa(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw uo(bn(t,e)),uu}function Kp(e){var t=e.stateNode,s=e.type,o=e.memoizedProps;switch(t[Dt]=e,t[qt]=o,s){case"dialog":we("cancel",t),we("close",t);break;case"iframe":case"object":case"embed":we("load",t);break;case"video":case"audio":for(s=0;s<Ro.length;s++)we(Ro[s],t);break;case"source":we("error",t);break;case"img":case"image":case"link":we("error",t),we("load",t);break;case"details":we("toggle",t);break;case"input":we("invalid",t),lp(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":we("invalid",t);break;case"textarea":we("invalid",t),cp(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||dv(t.textContent,s)?(o.popover!=null&&(we("beforetoggle",t),we("toggle",t)),o.onScroll!=null&&we("scroll",t),o.onScrollEnd!=null&&we("scrollend",t),o.onClick!=null&&(t.onclick=Qn),t=!0):t=!1,t||Aa(e,!0)}function Zp(e){for(Mt=e.return;Mt;)switch(Mt.tag){case 5:case 31:case 13:Sn=!1;return;case 27:case 3:Sn=!0;return;default:Mt=Mt.return}}function ai(e){if(e!==Mt)return!1;if(!Re)return Zp(e),Re=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Ad(e.type,e.memoizedProps)),s=!s),s&&tt&&Aa(e),Zp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));tt=xv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));tt=xv(e)}else t===27?(t=tt,Ga(e.type)?(e=Rd,Rd=null,tt=e):tt=t):tt=Mt?kn(e.stateNode.nextSibling):null;return!0}function fs(){tt=Mt=null,Re=!1}function du(){var e=Na;return e!==null&&(Qt===null?Qt=e:Qt.push.apply(Qt,e),Na=null),e}function uo(e){Na===null?Na=[e]:Na.push(e)}var fu=se(null),hs=null,ta=null;function wa(e,t,s){re(fu,t._currentValue),t._currentValue=s}function na(e){e._currentValue=fu.current,ye(fu)}function hu(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 pu(e,t,s,o){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var _=d.child;h=h.firstContext;e:for(;h!==null;){var T=h;h=d;for(var w=0;w<t.length;w++)if(T.context===t[w]){h.lanes|=s,T=h.alternate,T!==null&&(T.lanes|=s),hu(h.return,s,e),o||(_=null);break e}h=T.next}}else if(d.tag===18){if(_=d.return,_===null)throw Error(l(341));_.lanes|=s,h=_.alternate,h!==null&&(h.lanes|=s),hu(_,s,e),_=null}else _=d.child;if(_!==null)_.return=d;else for(_=d;_!==null;){if(_===e){_=null;break}if(d=_.sibling,d!==null){d.return=_.return,_=d;break}_=_.return}d=_}}function si(e,t,s,o){e=null;for(var d=t,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var _=d.alternate;if(_===null)throw Error(l(387));if(_=_.memoizedProps,_!==null){var T=d.type;tn(d.pendingProps.value,_.value)||(e!==null?e.push(T):e=[T])}}else if(d===jt.current){if(_=d.alternate,_===null)throw Error(l(387));_.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Uo):e=[Uo])}d=d.return}e!==null&&pu(t,e,s,o),t.flags|=262144}function Pl(e){for(e=e.firstContext;e!==null;){if(!tn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ps(e){hs=e,ta=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Rt(e){return Xp(hs,e)}function $l(e,t){return hs===null&&ps(e),Xp(e,t)}function Xp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},ta===null){if(e===null)throw Error(l(308));ta=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ta=ta.next=t;return s}var x_=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()})}},__=n.unstable_scheduleCallback,S_=n.unstable_NormalPriority,yt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mu(){return{controller:new x_,data:new Map,refCount:0}}function fo(e){e.refCount--,e.refCount===0&&__(S_,function(){e.controller.abort()})}var ho=null,gu=0,ii=0,oi=null;function T_(e,t){if(ho===null){var s=ho=[];gu=0,ii=bd(),oi={status:"pending",value:void 0,then:function(o){s.push(o)}}}return gu++,t.then(Qp,Qp),t}function Qp(){if(--gu===0&&ho!==null){oi!==null&&(oi.status="fulfilled");var e=ho;ho=null,ii=0,oi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function k_(e,t){var s=[],o={status:"pending",value:null,reason:null,then:function(d){s.push(d)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var d=0;d<s.length;d++)(0,s[d])(t)},function(d){for(o.status="rejected",o.reason=d,d=0;d<s.length;d++)(0,s[d])(void 0)}),o}var Wp=B.S;B.S=function(e,t){Bg=Lt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&T_(e,t),Wp!==null&&Wp(e,t)};var ms=se(null);function vu(){var e=ms.current;return e!==null?e:Qe.pooledCache}function Fl(e,t){t===null?re(ms,ms.current):re(ms,t.pool)}function Jp(){var e=vu();return e===null?null:{parent:yt._currentValue,pool:e}}var li=Error(l(460)),yu=Error(l(474)),ql=Error(l(542)),Yl={then:function(){}};function em(e){return e=e.status,e==="fulfilled"||e==="rejected"}function tm(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Qn,Qn),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,am(e),e;default:if(typeof t.status=="string")t.then(Qn,Qn);else{if(e=Qe,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=o}},function(o){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,am(e),e}throw vs=t,li}}function gs(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(vs=s,li):s}}var vs=null;function nm(){if(vs===null)throw Error(l(459));var e=vs;return vs=null,e}function am(e){if(e===li||e===ql)throw Error(l(483))}var ri=null,po=0;function Kl(e){var t=po;return po+=1,ri===null&&(ri=[]),tm(ri,e,t)}function mo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Zl(e,t){throw t.$$typeof===b?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function sm(e){function t(L,R){if(e){var z=L.deletions;z===null?(L.deletions=[R],L.flags|=16):z.push(R)}}function s(L,R){if(!e)return null;for(;R!==null;)t(L,R),R=R.sibling;return null}function o(L){for(var R=new Map;L!==null;)L.key!==null?R.set(L.key,L):R.set(L.index,L),L=L.sibling;return R}function d(L,R){return L=Jn(L,R),L.index=0,L.sibling=null,L}function h(L,R,z){return L.index=z,e?(z=L.alternate,z!==null?(z=z.index,z<R?(L.flags|=67108866,R):z):(L.flags|=67108866,R)):(L.flags|=1048576,R)}function _(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function T(L,R,z,X){return R===null||R.tag!==6?(R=ou(z,L.mode,X),R.return=L,R):(R=d(R,z),R.return=L,R)}function w(L,R,z,X){var pe=z.type;return pe===C?Z(L,R,z.props.children,X,z.key):R!==null&&(R.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===U&&gs(pe)===R.type)?(R=d(R,z.props),mo(R,z),R.return=L,R):(R=Hl(z.type,z.key,z.props,null,L.mode,X),mo(R,z),R.return=L,R)}function V(L,R,z,X){return R===null||R.tag!==4||R.stateNode.containerInfo!==z.containerInfo||R.stateNode.implementation!==z.implementation?(R=lu(z,L.mode,X),R.return=L,R):(R=d(R,z.children||[]),R.return=L,R)}function Z(L,R,z,X,pe){return R===null||R.tag!==7?(R=ds(z,L.mode,X,pe),R.return=L,R):(R=d(R,z),R.return=L,R)}function J(L,R,z){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=ou(""+R,L.mode,z),R.return=L,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case S:return z=Hl(R.type,R.key,R.props,null,L.mode,z),mo(z,R),z.return=L,z;case k:return R=lu(R,L.mode,z),R.return=L,R;case U:return R=gs(R),J(L,R,z)}if(te(R)||$(R))return R=ds(R,L.mode,z,null),R.return=L,R;if(typeof R.then=="function")return J(L,Kl(R),z);if(R.$$typeof===D)return J(L,$l(L,R),z);Zl(L,R)}return null}function P(L,R,z,X){var pe=R!==null?R.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return pe!==null?null:T(L,R,""+z,X);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case S:return z.key===pe?w(L,R,z,X):null;case k:return z.key===pe?V(L,R,z,X):null;case U:return z=gs(z),P(L,R,z,X)}if(te(z)||$(z))return pe!==null?null:Z(L,R,z,X,null);if(typeof z.then=="function")return P(L,R,Kl(z),X);if(z.$$typeof===D)return P(L,R,$l(L,z),X);Zl(L,z)}return null}function Y(L,R,z,X,pe){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return L=L.get(z)||null,T(R,L,""+X,pe);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case S:return L=L.get(X.key===null?z:X.key)||null,w(R,L,X,pe);case k:return L=L.get(X.key===null?z:X.key)||null,V(R,L,X,pe);case U:return X=gs(X),Y(L,R,z,X,pe)}if(te(X)||$(X))return L=L.get(z)||null,Z(R,L,X,pe,null);if(typeof X.then=="function")return Y(L,R,z,Kl(X),pe);if(X.$$typeof===D)return Y(L,R,z,$l(R,X),pe);Zl(R,X)}return null}function ue(L,R,z,X){for(var pe=null,Ie=null,fe=R,ke=R=0,Me=null;fe!==null&&ke<z.length;ke++){fe.index>ke?(Me=fe,fe=null):Me=fe.sibling;var Le=P(L,fe,z[ke],X);if(Le===null){fe===null&&(fe=Me);break}e&&fe&&Le.alternate===null&&t(L,fe),R=h(Le,R,ke),Ie===null?pe=Le:Ie.sibling=Le,Ie=Le,fe=Me}if(ke===z.length)return s(L,fe),Re&&ea(L,ke),pe;if(fe===null){for(;ke<z.length;ke++)fe=J(L,z[ke],X),fe!==null&&(R=h(fe,R,ke),Ie===null?pe=fe:Ie.sibling=fe,Ie=fe);return Re&&ea(L,ke),pe}for(fe=o(fe);ke<z.length;ke++)Me=Y(fe,L,ke,z[ke],X),Me!==null&&(e&&Me.alternate!==null&&fe.delete(Me.key===null?ke:Me.key),R=h(Me,R,ke),Ie===null?pe=Me:Ie.sibling=Me,Ie=Me);return e&&fe.forEach(function(Ya){return t(L,Ya)}),Re&&ea(L,ke),pe}function ge(L,R,z,X){if(z==null)throw Error(l(151));for(var pe=null,Ie=null,fe=R,ke=R=0,Me=null,Le=z.next();fe!==null&&!Le.done;ke++,Le=z.next()){fe.index>ke?(Me=fe,fe=null):Me=fe.sibling;var Ya=P(L,fe,Le.value,X);if(Ya===null){fe===null&&(fe=Me);break}e&&fe&&Ya.alternate===null&&t(L,fe),R=h(Ya,R,ke),Ie===null?pe=Ya:Ie.sibling=Ya,Ie=Ya,fe=Me}if(Le.done)return s(L,fe),Re&&ea(L,ke),pe;if(fe===null){for(;!Le.done;ke++,Le=z.next())Le=J(L,Le.value,X),Le!==null&&(R=h(Le,R,ke),Ie===null?pe=Le:Ie.sibling=Le,Ie=Le);return Re&&ea(L,ke),pe}for(fe=o(fe);!Le.done;ke++,Le=z.next())Le=Y(fe,L,ke,Le.value,X),Le!==null&&(e&&Le.alternate!==null&&fe.delete(Le.key===null?ke:Le.key),R=h(Le,R,ke),Ie===null?pe=Le:Ie.sibling=Le,Ie=Le);return e&&fe.forEach(function(BS){return t(L,BS)}),Re&&ea(L,ke),pe}function Ze(L,R,z,X){if(typeof z=="object"&&z!==null&&z.type===C&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case S:e:{for(var pe=z.key;R!==null;){if(R.key===pe){if(pe=z.type,pe===C){if(R.tag===7){s(L,R.sibling),X=d(R,z.props.children),X.return=L,L=X;break e}}else if(R.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===U&&gs(pe)===R.type){s(L,R.sibling),X=d(R,z.props),mo(X,z),X.return=L,L=X;break e}s(L,R);break}else t(L,R);R=R.sibling}z.type===C?(X=ds(z.props.children,L.mode,X,z.key),X.return=L,L=X):(X=Hl(z.type,z.key,z.props,null,L.mode,X),mo(X,z),X.return=L,L=X)}return _(L);case k:e:{for(pe=z.key;R!==null;){if(R.key===pe)if(R.tag===4&&R.stateNode.containerInfo===z.containerInfo&&R.stateNode.implementation===z.implementation){s(L,R.sibling),X=d(R,z.children||[]),X.return=L,L=X;break e}else{s(L,R);break}else t(L,R);R=R.sibling}X=lu(z,L.mode,X),X.return=L,L=X}return _(L);case U:return z=gs(z),Ze(L,R,z,X)}if(te(z))return ue(L,R,z,X);if($(z)){if(pe=$(z),typeof pe!="function")throw Error(l(150));return z=pe.call(z),ge(L,R,z,X)}if(typeof z.then=="function")return Ze(L,R,Kl(z),X);if(z.$$typeof===D)return Ze(L,R,$l(L,z),X);Zl(L,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,R!==null&&R.tag===6?(s(L,R.sibling),X=d(R,z),X.return=L,L=X):(s(L,R),X=ou(z,L.mode,X),X.return=L,L=X),_(L)):s(L,R)}return function(L,R,z,X){try{po=0;var pe=Ze(L,R,z,X);return ri=null,pe}catch(fe){if(fe===li||fe===ql)throw fe;var Ie=nn(29,fe,null,L.mode);return Ie.lanes=X,Ie.return=L,Ie}finally{}}}var ys=sm(!0),im=sm(!1),ja=!1;function bu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xu(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 Da(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ma(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ve&2)!==0){var d=o.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),o.pending=t,t=Vl(e),Gp(e,null,s),t}return zl(e,o,t,s),Vl(e)}function go(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,Xh(e,s)}}function _u(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var d=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?d=h=_:h=h.next=_,s=s.next}while(s!==null);h===null?d=h=t:h=h.next=t}else d=h=t;s={baseState:o.baseState,firstBaseUpdate:d,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 Su=!1;function vo(){if(Su){var e=oi;if(e!==null)throw e}}function yo(e,t,s,o){Su=!1;var d=e.updateQueue;ja=!1;var h=d.firstBaseUpdate,_=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var w=T,V=w.next;w.next=null,_===null?h=V:_.next=V,_=w;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,T=Z.lastBaseUpdate,T!==_&&(T===null?Z.firstBaseUpdate=V:T.next=V,Z.lastBaseUpdate=w))}if(h!==null){var J=d.baseState;_=0,Z=V=w=null,T=h;do{var P=T.lane&-536870913,Y=P!==T.lane;if(Y?(De&P)===P:(o&P)===P){P!==0&&P===ii&&(Su=!0),Z!==null&&(Z=Z.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ue=e,ge=T;P=t;var Ze=s;switch(ge.tag){case 1:if(ue=ge.payload,typeof ue=="function"){J=ue.call(Ze,J,P);break e}J=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ge.payload,P=typeof ue=="function"?ue.call(Ze,J,P):ue,P==null)break e;J=v({},J,P);break e;case 2:ja=!0}}P=T.callback,P!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=d.callbacks,Y===null?d.callbacks=[P]:Y.push(P))}else Y={lane:P,tag:T.tag,payload:T.payload,callback:T.callback,next:null},Z===null?(V=Z=Y,w=J):Z=Z.next=Y,_|=P;if(T=T.next,T===null){if(T=d.shared.pending,T===null)break;Y=T,T=Y.next,Y.next=null,d.lastBaseUpdate=Y,d.shared.pending=null}}while(!0);Z===null&&(w=J),d.baseState=w,d.firstBaseUpdate=V,d.lastBaseUpdate=Z,h===null&&(d.shared.lanes=0),La|=_,e.lanes=_,e.memoizedState=J}}function om(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function lm(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)om(s[e],t)}var ci=se(null),Xl=se(0);function rm(e,t){e=da,re(Xl,e),re(ci,t),da=e|t.baseLanes}function Tu(){re(Xl,da),re(ci,ci.current)}function ku(){da=Xl.current,ye(ci),ye(Xl)}var an=se(null),Tn=null;function Ra(e){var t=e.alternate;re(pt,pt.current&1),re(an,e),Tn===null&&(t===null||ci.current!==null||t.memoizedState!==null)&&(Tn=e)}function Cu(e){re(pt,pt.current),re(an,e),Tn===null&&(Tn=e)}function cm(e){e.tag===22?(re(pt,pt.current),re(an,e),Tn===null&&(Tn=e)):Oa()}function Oa(){re(pt,pt.current),re(an,an.current)}function sn(e){ye(an),Tn===e&&(Tn=null),ye(pt)}var pt=se(0);function Ql(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Dd(s)||Md(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 aa=0,Te=null,Ye=null,bt=null,Wl=!1,ui=!1,bs=!1,Jl=0,bo=0,di=null,C_=0;function ct(){throw Error(l(321))}function Eu(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!tn(e[s],t[s]))return!1;return!0}function Nu(e,t,s,o,d,h){return aa=h,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?qm:Gu,bs=!1,h=s(o,d),bs=!1,ui&&(h=dm(t,s,o,d)),um(e),h}function um(e){B.H=So;var t=Ye!==null&&Ye.next!==null;if(aa=0,bt=Ye=Te=null,Wl=!1,bo=0,di=null,t)throw Error(l(300));e===null||xt||(e=e.dependencies,e!==null&&Pl(e)&&(xt=!0))}function dm(e,t,s,o){Te=e;var d=0;do{if(ui&&(di=null),bo=0,ui=!1,25<=d)throw Error(l(301));if(d+=1,bt=Ye=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}B.H=Ym,h=t(s,o)}while(ui);return h}function E_(){var e=B.H,t=e.useState()[0];return t=typeof t.then=="function"?xo(t):t,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(Te.flags|=1024),t}function Au(){var e=Jl!==0;return Jl=0,e}function wu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function ju(e){if(Wl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wl=!1}aa=0,bt=Ye=Te=null,ui=!1,bo=Jl=0,di=null}function Pt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Te.memoizedState=bt=e:bt=bt.next=e,bt}function mt(){if(Ye===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=bt===null?Te.memoizedState:bt.next;if(t!==null)bt=t,Ye=e;else{if(e===null)throw Te.alternate===null?Error(l(467)):Error(l(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},bt===null?Te.memoizedState=bt=e:bt=bt.next=e}return bt}function er(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xo(e){var t=bo;return bo+=1,di===null&&(di=[]),e=tm(di,e,t),t=Te,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?qm:Gu),e}function tr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xo(e);if(e.$$typeof===D)return Rt(e)}throw Error(l(438,String(e)))}function Du(e){var t=null,s=Te.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var o=Te.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=er(),Te.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),o=0;o<e;o++)s[o]=ee;return t.index++,s}function sa(e,t){return typeof t=="function"?t(e):t}function nr(e){var t=mt();return Mu(t,Ye,e)}function Mu(e,t,s){var o=e.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=s;var d=e.baseQueue,h=o.pending;if(h!==null){if(d!==null){var _=d.next;d.next=h.next,h.next=_}t.baseQueue=d=h,o.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{t=d.next;var T=_=null,w=null,V=t,Z=!1;do{var J=V.lane&-536870913;if(J!==V.lane?(De&J)===J:(aa&J)===J){var P=V.revertLane;if(P===0)w!==null&&(w=w.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),J===ii&&(Z=!0);else if((aa&P)===P){V=V.next,P===ii&&(Z=!0);continue}else J={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},w===null?(T=w=J,_=h):w=w.next=J,Te.lanes|=P,La|=P;J=V.action,bs&&s(h,J),h=V.hasEagerState?V.eagerState:s(h,J)}else P={lane:J,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},w===null?(T=w=P,_=h):w=w.next=P,Te.lanes|=J,La|=J;V=V.next}while(V!==null&&V!==t);if(w===null?_=h:w.next=T,!tn(h,e.memoizedState)&&(xt=!0,Z&&(s=oi,s!==null)))throw s;e.memoizedState=h,e.baseState=_,e.baseQueue=w,o.lastRenderedState=h}return d===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Ru(e){var t=mt(),s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var o=s.dispatch,d=s.pending,h=t.memoizedState;if(d!==null){s.pending=null;var _=d=d.next;do h=e(h,_.action),_=_.next;while(_!==d);tn(h,t.memoizedState)||(xt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,o]}function fm(e,t,s){var o=Te,d=mt(),h=Re;if(h){if(s===void 0)throw Error(l(407));s=s()}else s=t();var _=!tn((Ye||d).memoizedState,s);if(_&&(d.memoizedState=s,xt=!0),d=d.queue,Iu(mm.bind(null,o,d,e),[e]),d.getSnapshot!==t||_||bt!==null&&bt.memoizedState.tag&1){if(o.flags|=2048,fi(9,{destroy:void 0},pm.bind(null,o,d,s,t),null),Qe===null)throw Error(l(349));h||(aa&127)!==0||hm(o,t,s)}return s}function hm(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Te.updateQueue,t===null?(t=er(),Te.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function pm(e,t,s,o){t.value=s,t.getSnapshot=o,gm(t)&&vm(e)}function mm(e,t,s){return s(function(){gm(t)&&vm(e)})}function gm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!tn(e,s)}catch{return!0}}function vm(e){var t=us(e,2);t!==null&&Wt(t,e,2)}function Ou(e){var t=Pt();if(typeof e=="function"){var s=e;if(e=s(),bs){lt(!0);try{s()}finally{lt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:e},t}function ym(e,t,s,o){return e.baseState=s,Mu(e,Ye,typeof o=="function"?o:sa)}function N_(e,t,s,o,d){if(ir(e))throw Error(l(485));if(e=t.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){h.listeners.push(_)}};B.T!==null?s(!0):h.isTransition=!1,o(h),s=t.pending,s===null?(h.next=t.pending=h,bm(t,h)):(h.next=s.next,t.pending=s.next=h)}}function bm(e,t){var s=t.action,o=t.payload,d=e.state;if(t.isTransition){var h=B.T,_={};B.T=_;try{var T=s(d,o),w=B.S;w!==null&&w(_,T),xm(e,t,T)}catch(V){Bu(e,t,V)}finally{h!==null&&_.types!==null&&(h.types=_.types),B.T=h}}else try{h=s(d,o),xm(e,t,h)}catch(V){Bu(e,t,V)}}function xm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){_m(e,t,o)},function(o){return Bu(e,t,o)}):_m(e,t,s)}function _m(e,t,s){t.status="fulfilled",t.value=s,Sm(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,bm(e,s)))}function Bu(e,t,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=s,Sm(t),t=t.next;while(t!==o)}e.action=null}function Sm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Tm(e,t){return t}function km(e,t){if(Re){var s=Qe.formState;if(s!==null){e:{var o=Te;if(Re){if(tt){t:{for(var d=tt,h=Sn;d.nodeType!==8;){if(!h){d=null;break t}if(d=kn(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){tt=kn(d.nextSibling),o=d.data==="F!";break e}}Aa(o)}o=!1}o&&(t=s[0])}}return s=Pt(),s.memoizedState=s.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tm,lastRenderedState:t},s.queue=o,s=Pm.bind(null,Te,o),o.dispatch=s,o=Ou(!1),h=Hu.bind(null,Te,!1,o.queue),o=Pt(),d={state:t,dispatch:null,action:e,pending:null},o.queue=d,s=N_.bind(null,Te,d,h,s),d.dispatch=s,o.memoizedState=e,[t,s,!1]}function Cm(e){var t=mt();return Em(t,Ye,e)}function Em(e,t,s){if(t=Mu(e,t,Tm)[0],e=nr(sa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=xo(t)}catch(_){throw _===li?ql:_}else o=t;t=mt();var d=t.queue,h=d.dispatch;return s!==t.memoizedState&&(Te.flags|=2048,fi(9,{destroy:void 0},A_.bind(null,d,s),null)),[o,h,e]}function A_(e,t){e.action=t}function Nm(e){var t=mt(),s=Ye;if(s!==null)return Em(t,s,e);mt(),t=t.memoizedState,s=mt();var o=s.queue.dispatch;return s.memoizedState=e,[t,o,!1]}function fi(e,t,s,o){return e={tag:e,create:s,deps:o,inst:t,next:null},t=Te.updateQueue,t===null&&(t=er(),Te.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 Am(){return mt().memoizedState}function ar(e,t,s,o){var d=Pt();Te.flags|=e,d.memoizedState=fi(1|t,{destroy:void 0},s,o===void 0?null:o)}function sr(e,t,s,o){var d=mt();o=o===void 0?null:o;var h=d.memoizedState.inst;Ye!==null&&o!==null&&Eu(o,Ye.memoizedState.deps)?d.memoizedState=fi(t,h,s,o):(Te.flags|=e,d.memoizedState=fi(1|t,h,s,o))}function wm(e,t){ar(8390656,8,e,t)}function Iu(e,t){sr(2048,8,e,t)}function w_(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=er(),Te.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function jm(e){var t=mt().memoizedState;return w_({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Dm(e,t){return sr(4,2,e,t)}function Mm(e,t){return sr(4,4,e,t)}function Rm(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 Om(e,t,s){s=s!=null?s.concat([e]):null,sr(4,4,Rm.bind(null,t,e),s)}function Lu(){}function Bm(e,t){var s=mt();t=t===void 0?null:t;var o=s.memoizedState;return t!==null&&Eu(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function Im(e,t){var s=mt();t=t===void 0?null:t;var o=s.memoizedState;if(t!==null&&Eu(t,o[1]))return o[0];if(o=e(),bs){lt(!0);try{e()}finally{lt(!1)}}return s.memoizedState=[o,t],o}function Uu(e,t,s){return s===void 0||(aa&1073741824)!==0&&(De&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Lg(),Te.lanes|=e,La|=e,s)}function Lm(e,t,s,o){return tn(s,t)?s:ci.current!==null?(e=Uu(e,s,o),tn(e,t)||(xt=!0),e):(aa&42)===0||(aa&1073741824)!==0&&(De&261930)===0?(xt=!0,e.memoizedState=s):(e=Lg(),Te.lanes|=e,La|=e,t)}function Um(e,t,s,o,d){var h=H.p;H.p=h!==0&&8>h?h:8;var _=B.T,T={};B.T=T,Hu(e,!1,t,s);try{var w=d(),V=B.S;if(V!==null&&V(T,w),w!==null&&typeof w=="object"&&typeof w.then=="function"){var Z=k_(w,o);_o(e,t,Z,rn(e))}else _o(e,t,o,rn(e))}catch(J){_o(e,t,{then:function(){},status:"rejected",reason:J},rn())}finally{H.p=h,_!==null&&T.types!==null&&(_.types=T.types),B.T=_}}function j_(){}function zu(e,t,s,o){if(e.tag!==5)throw Error(l(476));var d=zm(e).queue;Um(e,d,t,ae,s===null?j_:function(){return Vm(e),s(o)})}function zm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:ae},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Vm(e){var t=zm(e);t.next===null&&(t=e.alternate.memoizedState),_o(e,t.next.queue,{},rn())}function Vu(){return Rt(Uo)}function Hm(){return mt().memoizedState}function Gm(){return mt().memoizedState}function D_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=rn();e=Da(s);var o=Ma(t,e,s);o!==null&&(Wt(o,t,s),go(o,t,s)),t={cache:mu()},e.payload=t;return}t=t.return}}function M_(e,t,s){var o=rn();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},ir(e)?$m(t,s):(s=su(e,t,s,o),s!==null&&(Wt(s,e,o),Fm(s,t,o)))}function Pm(e,t,s){var o=rn();_o(e,t,s,o)}function _o(e,t,s,o){var d={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(ir(e))$m(t,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var _=t.lastRenderedState,T=h(_,s);if(d.hasEagerState=!0,d.eagerState=T,tn(T,_))return zl(e,t,d,0),Qe===null&&Ul(),!1}catch{}finally{}if(s=su(e,t,d,o),s!==null)return Wt(s,e,o),Fm(s,t,o),!0}return!1}function Hu(e,t,s,o){if(o={lane:2,revertLane:bd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ir(e)){if(t)throw Error(l(479))}else t=su(e,s,o,2),t!==null&&Wt(t,e,2)}function ir(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function $m(e,t){ui=Wl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Fm(e,t,s){if((s&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Xh(e,s)}}var So={readContext:Rt,use:tr,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};So.useEffectEvent=ct;var qm={readContext:Rt,use:tr,useCallback:function(e,t){return Pt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:wm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,ar(4194308,4,Rm.bind(null,t,e),s)},useLayoutEffect:function(e,t){return ar(4194308,4,e,t)},useInsertionEffect:function(e,t){ar(4,2,e,t)},useMemo:function(e,t){var s=Pt();t=t===void 0?null:t;var o=e();if(bs){lt(!0);try{e()}finally{lt(!1)}}return s.memoizedState=[o,t],o},useReducer:function(e,t,s){var o=Pt();if(s!==void 0){var d=s(t);if(bs){lt(!0);try{s(t)}finally{lt(!1)}}}else d=t;return o.memoizedState=o.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},o.queue=e,e=e.dispatch=M_.bind(null,Te,e),[o.memoizedState,e]},useRef:function(e){var t=Pt();return e={current:e},t.memoizedState=e},useState:function(e){e=Ou(e);var t=e.queue,s=Pm.bind(null,Te,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Lu,useDeferredValue:function(e,t){var s=Pt();return Uu(s,e,t)},useTransition:function(){var e=Ou(!1);return e=Um.bind(null,Te,e.queue,!0,!1),Pt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var o=Te,d=Pt();if(Re){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),Qe===null)throw Error(l(349));(De&127)!==0||hm(o,t,s)}d.memoizedState=s;var h={value:s,getSnapshot:t};return d.queue=h,wm(mm.bind(null,o,h,e),[e]),o.flags|=2048,fi(9,{destroy:void 0},pm.bind(null,o,h,s,t),null),s},useId:function(){var e=Pt(),t=Qe.identifierPrefix;if(Re){var s=Un,o=Ln;s=(o&~(1<<32-qe(o)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Jl++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=C_++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Vu,useFormState:km,useActionState:km,useOptimistic:function(e){var t=Pt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Hu.bind(null,Te,!0,s),s.dispatch=t,[e,t]},useMemoCache:Du,useCacheRefresh:function(){return Pt().memoizedState=D_.bind(null,Te)},useEffectEvent:function(e){var t=Pt(),s={impl:e};return t.memoizedState=s,function(){if((Ve&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},Gu={readContext:Rt,use:tr,useCallback:Bm,useContext:Rt,useEffect:Iu,useImperativeHandle:Om,useInsertionEffect:Dm,useLayoutEffect:Mm,useMemo:Im,useReducer:nr,useRef:Am,useState:function(){return nr(sa)},useDebugValue:Lu,useDeferredValue:function(e,t){var s=mt();return Lm(s,Ye.memoizedState,e,t)},useTransition:function(){var e=nr(sa)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:xo(e),t]},useSyncExternalStore:fm,useId:Hm,useHostTransitionStatus:Vu,useFormState:Cm,useActionState:Cm,useOptimistic:function(e,t){var s=mt();return ym(s,Ye,e,t)},useMemoCache:Du,useCacheRefresh:Gm};Gu.useEffectEvent=jm;var Ym={readContext:Rt,use:tr,useCallback:Bm,useContext:Rt,useEffect:Iu,useImperativeHandle:Om,useInsertionEffect:Dm,useLayoutEffect:Mm,useMemo:Im,useReducer:Ru,useRef:Am,useState:function(){return Ru(sa)},useDebugValue:Lu,useDeferredValue:function(e,t){var s=mt();return Ye===null?Uu(s,e,t):Lm(s,Ye.memoizedState,e,t)},useTransition:function(){var e=Ru(sa)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:xo(e),t]},useSyncExternalStore:fm,useId:Hm,useHostTransitionStatus:Vu,useFormState:Nm,useActionState:Nm,useOptimistic:function(e,t){var s=mt();return Ye!==null?ym(s,Ye,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Du,useCacheRefresh:Gm};Ym.useEffectEvent=jm;function Pu(e,t,s,o){t=e.memoizedState,s=s(o,t),s=s==null?t:v({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var $u={enqueueSetState:function(e,t,s){e=e._reactInternals;var o=rn(),d=Da(o);d.payload=t,s!=null&&(d.callback=s),t=Ma(e,d,o),t!==null&&(Wt(t,e,o),go(t,e,o))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=rn(),d=Da(o);d.tag=1,d.payload=t,s!=null&&(d.callback=s),t=Ma(e,d,o),t!==null&&(Wt(t,e,o),go(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=rn(),o=Da(s);o.tag=2,t!=null&&(o.callback=t),t=Ma(e,o,s),t!==null&&(Wt(t,e,s),go(t,e,s))}};function Km(e,t,s,o,d,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,_):t.prototype&&t.prototype.isPureReactComponent?!lo(s,o)||!lo(d,h):!0}function Zm(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&&$u.enqueueReplaceState(t,t.state,null)}function xs(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=v({},s));for(var d in e)s[d]===void 0&&(s[d]=e[d])}return s}function Xm(e){Ll(e)}function Qm(e){console.error(e)}function Wm(e){Ll(e)}function or(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function Jm(e,t,s){try{var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Fu(e,t,s){return s=Da(s),s.tag=3,s.payload={element:null},s.callback=function(){or(e,t)},s}function eg(e){return e=Da(e),e.tag=3,e}function tg(e,t,s,o){var d=s.type.getDerivedStateFromError;if(typeof d=="function"){var h=o.value;e.payload=function(){return d(h)},e.callback=function(){Jm(t,s,o)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){Jm(t,s,o),typeof d!="function"&&(Ua===null?Ua=new Set([this]):Ua.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})})}function R_(e,t,s,o,d){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=s.alternate,t!==null&&si(t,s,d,!0),s=an.current,s!==null){switch(s.tag){case 31:case 13:return Tn===null?yr():s.alternate===null&&ut===0&&(ut=3),s.flags&=-257,s.flags|=65536,s.lanes=d,o===Yl?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([o]):t.add(o),gd(e,o,d)),!1;case 22:return s.flags|=65536,o===Yl?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)),gd(e,o,d)),!1}throw Error(l(435,s.tag))}return gd(e,o,d),yr(),!1}if(Re)return t=an.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,o!==uu&&(e=Error(l(422),{cause:o}),uo(bn(e,s)))):(o!==uu&&(t=Error(l(423),{cause:o}),uo(bn(t,s))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,o=bn(o,s),d=Fu(e.stateNode,o,d),_u(e,d),ut!==4&&(ut=2)),!1;var h=Error(l(520),{cause:o});if(h=bn(h,s),jo===null?jo=[h]:jo.push(h),ut!==4&&(ut=2),t===null)return!0;o=bn(o,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=d&-d,s.lanes|=e,e=Fu(s.stateNode,o,e),_u(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"&&(Ua===null||!Ua.has(h))))return s.flags|=65536,d&=-d,s.lanes|=d,d=eg(d),tg(d,e,s,o),_u(s,d),!1}s=s.return}while(s!==null);return!1}var qu=Error(l(461)),xt=!1;function Ot(e,t,s,o){t.child=e===null?im(t,null,s,o):ys(t,e.child,s,o)}function ng(e,t,s,o,d){s=s.render;var h=t.ref;if("ref"in o){var _={};for(var T in o)T!=="ref"&&(_[T]=o[T])}else _=o;return ps(t),o=Nu(e,t,s,_,h,d),T=Au(),e!==null&&!xt?(wu(e,t,d),ia(e,t,d)):(Re&&T&&ru(t),t.flags|=1,Ot(e,t,o,d),t.child)}function ag(e,t,s,o,d){if(e===null){var h=s.type;return typeof h=="function"&&!iu(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,sg(e,t,h,o,d)):(e=Hl(s.type,null,o,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!ed(e,d)){var _=h.memoizedProps;if(s=s.compare,s=s!==null?s:lo,s(_,o)&&e.ref===t.ref)return ia(e,t,d)}return t.flags|=1,e=Jn(h,o),e.ref=t.ref,e.return=t,t.child=e}function sg(e,t,s,o,d){if(e!==null){var h=e.memoizedProps;if(lo(h,o)&&e.ref===t.ref)if(xt=!1,t.pendingProps=o=h,ed(e,d))(e.flags&131072)!==0&&(xt=!0);else return t.lanes=e.lanes,ia(e,t,d)}return Yu(e,t,s,o,d)}function ig(e,t,s,o){var d=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,d=0;o!==null;)d=d|o.lanes|o.childLanes,o=o.sibling;o=d&~h}else o=0,t.child=null;return og(e,t,h,s,o)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fl(t,h!==null?h.cachePool:null),h!==null?rm(t,h):Tu(),cm(t);else return o=t.lanes=536870912,og(e,t,h!==null?h.baseLanes|s:s,s,o)}else h!==null?(Fl(t,h.cachePool),rm(t,h),Oa(),t.memoizedState=null):(e!==null&&Fl(t,null),Tu(),Oa());return Ot(e,t,d,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 og(e,t,s,o,d){var h=vu();return h=h===null?null:{parent:yt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&Fl(t,null),Tu(),cm(t),e!==null&&si(e,t,o,!0),t.childLanes=d,null}function lr(e,t){return t=cr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lg(e,t,s){return ys(t,e.child,null,s),e=lr(t,t.pendingProps),e.flags|=2,sn(t),t.memoizedState=null,e}function O_(e,t,s){var o=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Re){if(o.mode==="hidden")return e=lr(t,o),t.lanes=536870912,To(null,e);if(Cu(t),(e=tt)?(e=bv(e,Sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ea!==null?{id:Ln,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},s=$p(e),s.return=t,t.child=s,Mt=t,tt=null)):e=null,e===null)throw Aa(t);return t.lanes=536870912,null}return lr(t,o)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(Cu(t),d)if(t.flags&256)t.flags&=-257,t=lg(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(xt||si(e,t,s,!1),d=(s&e.childLanes)!==0,xt||d){if(o=Qe,o!==null&&(_=Qh(o,s),_!==0&&_!==h.retryLane))throw h.retryLane=_,us(e,_),Wt(o,e,_),qu;yr(),t=lg(e,t,s)}else e=h.treeContext,tt=kn(_.nextSibling),Mt=t,Re=!0,Na=null,Sn=!1,e!==null&&Yp(t,e),t=lr(t,o),t.flags|=4096;return t}return e=Jn(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function rr(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(l(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Yu(e,t,s,o,d){return ps(t),s=Nu(e,t,s,o,void 0,d),o=Au(),e!==null&&!xt?(wu(e,t,d),ia(e,t,d)):(Re&&o&&ru(t),t.flags|=1,Ot(e,t,s,d),t.child)}function rg(e,t,s,o,d,h){return ps(t),t.updateQueue=null,s=dm(t,o,s,d),um(e),o=Au(),e!==null&&!xt?(wu(e,t,h),ia(e,t,h)):(Re&&o&&ru(t),t.flags|=1,Ot(e,t,s,h),t.child)}function cg(e,t,s,o,d){if(ps(t),t.stateNode===null){var h=ei,_=s.contextType;typeof _=="object"&&_!==null&&(h=Rt(_)),h=new s(o,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=$u,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=o,h.state=t.memoizedState,h.refs={},bu(t),_=s.contextType,h.context=typeof _=="object"&&_!==null?Rt(_):ei,h.state=t.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Pu(t,s,_,o),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(_=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),_!==h.state&&$u.enqueueReplaceState(h,h.state,null),yo(t,o,h,d),vo(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){h=t.stateNode;var T=t.memoizedProps,w=xs(s,T);h.props=w;var V=h.context,Z=s.contextType;_=ei,typeof Z=="object"&&Z!==null&&(_=Rt(Z));var J=s.getDerivedStateFromProps;Z=typeof J=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,Z||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||V!==_)&&Zm(t,h,o,_),ja=!1;var P=t.memoizedState;h.state=P,yo(t,o,h,d),vo(),V=t.memoizedState,T||P!==V||ja?(typeof J=="function"&&(Pu(t,s,J,o),V=t.memoizedState),(w=ja||Km(t,s,w,o,P,V,_))?(Z||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=V),h.props=o,h.state=V,h.context=_,o=w):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{h=t.stateNode,xu(e,t),_=t.memoizedProps,Z=xs(s,_),h.props=Z,J=t.pendingProps,P=h.context,V=s.contextType,w=ei,typeof V=="object"&&V!==null&&(w=Rt(V)),T=s.getDerivedStateFromProps,(V=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==J||P!==w)&&Zm(t,h,o,w),ja=!1,P=t.memoizedState,h.state=P,yo(t,o,h,d),vo();var Y=t.memoizedState;_!==J||P!==Y||ja||e!==null&&e.dependencies!==null&&Pl(e.dependencies)?(typeof T=="function"&&(Pu(t,s,T,o),Y=t.memoizedState),(Z=ja||Km(t,s,Z,o,P,Y,w)||e!==null&&e.dependencies!==null&&Pl(e.dependencies))?(V||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,Y,w),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,Y,w)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=Y),h.props=o,h.state=Y,h.context=w,o=Z):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),o=!1)}return h=o,rr(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=ys(t,e.child,null,d),t.child=ys(t,null,s,d)):Ot(e,t,s,d),t.memoizedState=h.state,e=t.child):e=ia(e,t,d),e}function ug(e,t,s,o){return fs(),t.flags|=256,Ot(e,t,s,o),t.child}var Ku={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zu(e){return{baseLanes:e,cachePool:Jp()}}function Xu(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=ln),e}function dg(e,t,s){var o=t.pendingProps,d=!1,h=(t.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),_&&(d=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(Re){if(d?Ra(t):Oa(),(e=tt)?(e=bv(e,Sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ea!==null?{id:Ln,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},s=$p(e),s.return=t,t.child=s,Mt=t,tt=null)):e=null,e===null)throw Aa(t);return Md(e)?t.lanes=32:t.lanes=536870912,null}var T=o.children;return o=o.fallback,d?(Oa(),d=t.mode,T=cr({mode:"hidden",children:T},d),o=ds(o,d,s,null),T.return=t,o.return=t,T.sibling=o,t.child=T,o=t.child,o.memoizedState=Zu(s),o.childLanes=Xu(e,_,s),t.memoizedState=Ku,To(null,o)):(Ra(t),Qu(t,T))}var w=e.memoizedState;if(w!==null&&(T=w.dehydrated,T!==null)){if(h)t.flags&256?(Ra(t),t.flags&=-257,t=Wu(e,t,s)):t.memoizedState!==null?(Oa(),t.child=e.child,t.flags|=128,t=null):(Oa(),T=o.fallback,d=t.mode,o=cr({mode:"visible",children:o.children},d),T=ds(T,d,s,null),T.flags|=2,o.return=t,T.return=t,o.sibling=T,t.child=o,ys(t,e.child,null,s),o=t.child,o.memoizedState=Zu(s),o.childLanes=Xu(e,_,s),t.memoizedState=Ku,t=To(null,o));else if(Ra(t),Md(T)){if(_=T.nextSibling&&T.nextSibling.dataset,_)var V=_.dgst;_=V,o=Error(l(419)),o.stack="",o.digest=_,uo({value:o,source:null,stack:null}),t=Wu(e,t,s)}else if(xt||si(e,t,s,!1),_=(s&e.childLanes)!==0,xt||_){if(_=Qe,_!==null&&(o=Qh(_,s),o!==0&&o!==w.retryLane))throw w.retryLane=o,us(e,o),Wt(_,e,o),qu;Dd(T)||yr(),t=Wu(e,t,s)}else Dd(T)?(t.flags|=192,t.child=e.child,t=null):(e=w.treeContext,tt=kn(T.nextSibling),Mt=t,Re=!0,Na=null,Sn=!1,e!==null&&Yp(t,e),t=Qu(t,o.children),t.flags|=4096);return t}return d?(Oa(),T=o.fallback,d=t.mode,w=e.child,V=w.sibling,o=Jn(w,{mode:"hidden",children:o.children}),o.subtreeFlags=w.subtreeFlags&65011712,V!==null?T=Jn(V,T):(T=ds(T,d,s,null),T.flags|=2),T.return=t,o.return=t,o.sibling=T,t.child=o,To(null,o),o=t.child,T=e.child.memoizedState,T===null?T=Zu(s):(d=T.cachePool,d!==null?(w=yt._currentValue,d=d.parent!==w?{parent:w,pool:w}:d):d=Jp(),T={baseLanes:T.baseLanes|s,cachePool:d}),o.memoizedState=T,o.childLanes=Xu(e,_,s),t.memoizedState=Ku,To(e.child,o)):(Ra(t),s=e.child,e=s.sibling,s=Jn(s,{mode:"visible",children:o.children}),s.return=t,s.sibling=null,e!==null&&(_=t.deletions,_===null?(t.deletions=[e],t.flags|=16):_.push(e)),t.child=s,t.memoizedState=null,s)}function Qu(e,t){return t=cr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function cr(e,t){return e=nn(22,e,null,t),e.lanes=0,e}function Wu(e,t,s){return ys(t,e.child,null,s),e=Qu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function fg(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),hu(e.return,t,s)}function Ju(e,t,s,o,d,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:d,treeForkCount:h}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=o,_.tail=s,_.tailMode=d,_.treeForkCount=h)}function hg(e,t,s){var o=t.pendingProps,d=o.revealOrder,h=o.tail;o=o.children;var _=pt.current,T=(_&2)!==0;if(T?(_=_&1|2,t.flags|=128):_&=1,re(pt,_),Ot(e,t,o,s),o=Re?co:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fg(e,s,t);else if(e.tag===19)fg(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(s=t.child,d=null;s!==null;)e=s.alternate,e!==null&&Ql(e)===null&&(d=s),s=s.sibling;s=d,s===null?(d=t.child,t.child=null):(d=s.sibling,s.sibling=null),Ju(t,!1,d,s,h,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Ql(e)===null){t.child=d;break}e=d.sibling,d.sibling=s,s=d,d=e}Ju(t,!0,s,null,h,o);break;case"together":Ju(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function ia(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),La|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(si(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=Jn(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Jn(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function ed(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Pl(e)))}function B_(e,t,s){switch(t.tag){case 3:pn(t,t.stateNode.containerInfo),wa(t,yt,e.memoizedState.cache),fs();break;case 27:case 5:Bn(t);break;case 4:pn(t,t.stateNode.containerInfo);break;case 10:wa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Cu(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Ra(t),t.flags|=128,null):(s&t.child.childLanes)!==0?dg(e,t,s):(Ra(t),e=ia(e,t,s),e!==null?e.sibling:null);Ra(t);break;case 19:var d=(e.flags&128)!==0;if(o=(s&t.childLanes)!==0,o||(si(e,t,s,!1),o=(s&t.childLanes)!==0),d){if(o)return hg(e,t,s);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),re(pt,pt.current),o)break;return null;case 22:return t.lanes=0,ig(e,t,s,t.pendingProps);case 24:wa(t,yt,e.memoizedState.cache)}return ia(e,t,s)}function pg(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)xt=!0;else{if(!ed(e,s)&&(t.flags&128)===0)return xt=!1,B_(e,t,s);xt=(e.flags&131072)!==0}else xt=!1,Re&&(t.flags&1048576)!==0&&qp(t,co,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=gs(t.elementType),t.type=e,typeof e=="function")iu(e)?(o=xs(e,o),t.tag=1,t=cg(null,t,e,o,s)):(t.tag=0,t=Yu(null,t,e,o,s));else{if(e!=null){var d=e.$$typeof;if(d===M){t.tag=11,t=ng(null,t,e,o,s);break e}else if(d===q){t.tag=14,t=ag(null,t,e,o,s);break e}}throw t=F(e)||e,Error(l(306,t,""))}}return t;case 0:return Yu(e,t,t.type,t.pendingProps,s);case 1:return o=t.type,d=xs(o,t.pendingProps),cg(e,t,o,d,s);case 3:e:{if(pn(t,t.stateNode.containerInfo),e===null)throw Error(l(387));o=t.pendingProps;var h=t.memoizedState;d=h.element,xu(e,t),yo(t,o,null,s);var _=t.memoizedState;if(o=_.cache,wa(t,yt,o),o!==h.cache&&pu(t,[yt],s,!0),vo(),o=_.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=ug(e,t,o,s);break e}else if(o!==d){d=bn(Error(l(424)),t),uo(d),t=ug(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(tt=kn(e.firstChild),Mt=t,Re=!0,Na=null,Sn=!0,s=im(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(fs(),o===d){t=ia(e,t,s);break e}Ot(e,t,o,s)}t=t.child}return t;case 26:return rr(e,t),e===null?(s=Cv(t.type,null,t.pendingProps,null))?t.memoizedState=s:Re||(s=t.type,e=t.pendingProps,o=Cr(he.current).createElement(s),o[Dt]=t,o[qt]=e,Bt(o,s,e),At(o),t.stateNode=o):t.memoizedState=Cv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Bn(t),e===null&&Re&&(o=t.stateNode=Sv(t.type,t.pendingProps,he.current),Mt=t,Sn=!0,d=tt,Ga(t.type)?(Rd=d,tt=kn(o.firstChild)):tt=d),Ot(e,t,t.pendingProps.children,s),rr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Re&&((d=o=tt)&&(o=dS(o,t.type,t.pendingProps,Sn),o!==null?(t.stateNode=o,Mt=t,tt=kn(o.firstChild),Sn=!1,d=!0):d=!1),d||Aa(t)),Bn(t),d=t.type,h=t.pendingProps,_=e!==null?e.memoizedProps:null,o=h.children,Ad(d,h)?o=null:_!==null&&Ad(d,_)&&(t.flags|=32),t.memoizedState!==null&&(d=Nu(e,t,E_,null,null,s),Uo._currentValue=d),rr(e,t),Ot(e,t,o,s),t.child;case 6:return e===null&&Re&&((e=s=tt)&&(s=fS(s,t.pendingProps,Sn),s!==null?(t.stateNode=s,Mt=t,tt=null,e=!0):e=!1),e||Aa(t)),null;case 13:return dg(e,t,s);case 4:return pn(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=ys(t,null,o,s):Ot(e,t,o,s),t.child;case 11:return ng(e,t,t.type,t.pendingProps,s);case 7:return Ot(e,t,t.pendingProps,s),t.child;case 8:return Ot(e,t,t.pendingProps.children,s),t.child;case 12:return Ot(e,t,t.pendingProps.children,s),t.child;case 10:return o=t.pendingProps,wa(t,t.type,o.value),Ot(e,t,o.children,s),t.child;case 9:return d=t.type._context,o=t.pendingProps.children,ps(t),d=Rt(d),o=o(d),t.flags|=1,Ot(e,t,o,s),t.child;case 14:return ag(e,t,t.type,t.pendingProps,s);case 15:return sg(e,t,t.type,t.pendingProps,s);case 19:return hg(e,t,s);case 31:return O_(e,t,s);case 22:return ig(e,t,s,t.pendingProps);case 24:return ps(t),o=Rt(yt),e===null?(d=vu(),d===null&&(d=Qe,h=mu(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=s),d=h),t.memoizedState={parent:o,cache:d},bu(t),wa(t,yt,d)):((e.lanes&s)!==0&&(xu(e,t),yo(t,null,null,s),vo()),d=e.memoizedState,h=t.memoizedState,d.parent!==o?(d={parent:o,cache:o},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),wa(t,yt,o)):(o=h.cache,wa(t,yt,o),o!==d.cache&&pu(t,[yt],s,!0))),Ot(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function oa(e){e.flags|=4}function td(e,t,s,o,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Hg())e.flags|=8192;else throw vs=Yl,yu}else e.flags&=-16777217}function mg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!jv(t))if(Hg())e.flags|=8192;else throw vs=Yl,yu}function ur(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Kh():536870912,e.lanes|=t,gi|=t)}function ko(e,t){if(!Re)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 nt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var d=e.child;d!==null;)s|=d.lanes|d.childLanes,o|=d.subtreeFlags&65011712,o|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)s|=d.lanes|d.childLanes,o|=d.subtreeFlags,o|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function I_(e,t,s){var o=t.pendingProps;switch(cu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nt(t),null;case 1:return nt(t),null;case 3:return s=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),na(yt),jn(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ai(t)?oa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,du())),nt(t),null;case 26:var d=t.type,h=t.memoizedState;return e===null?(oa(t),h!==null?(nt(t),mg(t,h)):(nt(t),td(t,d,null,o,s))):h?h!==e.memoizedState?(oa(t),nt(t),mg(t,h)):(nt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&oa(t),nt(t),td(t,d,e,o,s)),null;case 27:if(Se(t),s=he.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&oa(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return nt(t),null}e=Fe.current,ai(t)?Kp(t):(e=Sv(d,o,s),t.stateNode=e,oa(t))}return nt(t),null;case 5:if(Se(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&oa(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return nt(t),null}if(h=Fe.current,ai(t))Kp(t);else{var _=Cr(he.current);switch(h){case 1:h=_.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=_.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=_.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=_.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=_.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?_.createElement("select",{is:o.is}):_.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?_.createElement(d,{is:o.is}):_.createElement(d)}}h[Dt]=t,h[qt]=o;e:for(_=t.child;_!==null;){if(_.tag===5||_.tag===6)h.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===t)break e;for(;_.sibling===null;){if(_.return===null||_.return===t)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}t.stateNode=h;e:switch(Bt(h,d,o),d){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&oa(t)}}return nt(t),td(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&oa(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(l(166));if(e=he.current,ai(t)){if(e=t.stateNode,s=t.memoizedProps,o=null,d=Mt,d!==null)switch(d.tag){case 27:case 5:o=d.memoizedProps}e[Dt]=t,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||dv(e.nodeValue,s)),e||Aa(t,!0)}else e=Cr(e).createTextNode(o),e[Dt]=t,t.stateNode=e}return nt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(o=ai(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[Dt]=t}else fs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;nt(t),e=!1}else s=du(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(sn(t),t):(sn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return nt(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=ai(t),o!==null&&o.dehydrated!==null){if(e===null){if(!d)throw Error(l(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(l(317));d[Dt]=t}else fs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;nt(t),d=!1}else d=du(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(sn(t),t):(sn(t),null)}return sn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=o!==null,e=e!==null&&e.memoizedState!==null,s&&(o=t.child,d=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(d=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==d&&(o.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),ur(t,t.updateQueue),nt(t),null);case 4:return jn(),e===null&&Td(t.stateNode.containerInfo),nt(t),null;case 10:return na(t.type),nt(t),null;case 19:if(ye(pt),o=t.memoizedState,o===null)return nt(t),null;if(d=(t.flags&128)!==0,h=o.rendering,h===null)if(d)ko(o,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Ql(e),h!==null){for(t.flags|=128,ko(o,!1),e=h.updateQueue,t.updateQueue=e,ur(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Pp(s,e),s=s.sibling;return re(pt,pt.current&1|2),Re&&ea(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&Lt()>mr&&(t.flags|=128,d=!0,ko(o,!1),t.lanes=4194304)}else{if(!d)if(e=Ql(h),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,ur(t,e),ko(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Re)return nt(t),null}else 2*Lt()-o.renderingStartTime>mr&&s!==536870912&&(t.flags|=128,d=!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=Lt(),e.sibling=null,s=pt.current,re(pt,d?s&1|2:s&1),Re&&ea(t,o.treeForkCount),e):(nt(t),null);case 22:case 23:return sn(t),ku(),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&&(nt(t),t.subtreeFlags&6&&(t.flags|=8192)):nt(t),s=t.updateQueue,s!==null&&ur(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==s&&(t.flags|=2048),e!==null&&ye(ms),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),na(yt),nt(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function L_(e,t){switch(cu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return na(yt),jn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(sn(t),t.alternate===null)throw Error(l(340));fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(sn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ye(pt),null;case 4:return jn(),null;case 10:return na(t.type),null;case 22:case 23:return sn(t),ku(),e!==null&&ye(ms),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return na(yt),null;case 25:return null;default:return null}}function gg(e,t){switch(cu(t),t.tag){case 3:na(yt),jn();break;case 26:case 27:case 5:Se(t);break;case 4:jn();break;case 31:t.memoizedState!==null&&sn(t);break;case 13:sn(t);break;case 19:ye(pt);break;case 10:na(t.type);break;case 22:case 23:sn(t),ku(),e!==null&&ye(ms);break;case 24:na(yt)}}function Co(e,t){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var d=o.next;s=d;do{if((s.tag&e)===e){o=void 0;var h=s.create,_=s.inst;o=h(),_.destroy=o}s=s.next}while(s!==d)}}catch(T){$e(t,t.return,T)}}function Ba(e,t,s){try{var o=t.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var h=d.next;o=h;do{if((o.tag&e)===e){var _=o.inst,T=_.destroy;if(T!==void 0){_.destroy=void 0,d=t;var w=s,V=T;try{V()}catch(Z){$e(d,w,Z)}}}o=o.next}while(o!==h)}}catch(Z){$e(t,t.return,Z)}}function vg(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{lm(t,s)}catch(o){$e(e,e.return,o)}}}function yg(e,t,s){s.props=xs(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){$e(e,t,o)}}function Eo(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(d){$e(e,t,d)}}function zn(e,t){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(d){$e(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(d){$e(e,t,d)}else s.current=null}function bg(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(d){$e(e,e.return,d)}}function nd(e,t,s){try{var o=e.stateNode;iS(o,e.type,s,t),o[qt]=t}catch(d){$e(e,e.return,d)}}function xg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ga(e.type)||e.tag===4}function ad(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xg(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&&Ga(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 sd(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=Qn));else if(o!==4&&(o===27&&Ga(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(sd(e,t,s),e=e.sibling;e!==null;)sd(e,t,s),e=e.sibling}function dr(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&&Ga(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(dr(e,t,s),e=e.sibling;e!==null;)dr(e,t,s),e=e.sibling}function _g(e){var t=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);Bt(t,o,s),t[Dt]=e,t[qt]=s}catch(h){$e(e,e.return,h)}}var la=!1,_t=!1,id=!1,Sg=typeof WeakSet=="function"?WeakSet:Set,wt=null;function U_(e,t){if(e=e.containerInfo,Ed=Mr,e=Op(e),Wc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var d=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var _=0,T=-1,w=-1,V=0,Z=0,J=e,P=null;t:for(;;){for(var Y;J!==s||d!==0&&J.nodeType!==3||(T=_+d),J!==h||o!==0&&J.nodeType!==3||(w=_+o),J.nodeType===3&&(_+=J.nodeValue.length),(Y=J.firstChild)!==null;)P=J,J=Y;for(;;){if(J===e)break t;if(P===s&&++V===d&&(T=_),P===h&&++Z===o&&(w=_),(Y=J.nextSibling)!==null)break;J=P,P=J.parentNode}J=Y}s=T===-1||w===-1?null:{start:T,end:w}}else s=null}s=s||{start:0,end:0}}else s=null;for(Nd={focusedElem:e,selectionRange:s},Mr=!1,wt=t;wt!==null;)if(t=wt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,wt=e;else for(;wt!==null;){switch(t=wt,h=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)d=e[s],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=t,d=h.memoizedProps,h=h.memoizedState,o=s.stateNode;try{var ue=xs(s.type,d);e=o.getSnapshotBeforeUpdate(ue,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(ge){$e(s,s.return,ge)}}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,wt=e;break}wt=t.return}}function Tg(e,t,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:ca(e,s),o&4&&Co(5,s);break;case 1:if(ca(e,s),o&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(_){$e(s,s.return,_)}else{var d=xs(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){$e(s,s.return,_)}}o&64&&vg(s),o&512&&Eo(s,s.return);break;case 3:if(ca(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{lm(e,t)}catch(_){$e(s,s.return,_)}}break;case 27:t===null&&o&4&&_g(s);case 26:case 5:ca(e,s),t===null&&o&4&&bg(s),o&512&&Eo(s,s.return);break;case 12:ca(e,s);break;case 31:ca(e,s),o&4&&Eg(e,s);break;case 13:ca(e,s),o&4&&Ng(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Y_.bind(null,s),hS(e,s))));break;case 22:if(o=s.memoizedState!==null||la,!o){t=t!==null&&t.memoizedState!==null||_t,d=la;var h=_t;la=o,(_t=t)&&!h?ua(e,s,(s.subtreeFlags&8772)!==0):ca(e,s),la=d,_t=h}break;case 30:break;default:ca(e,s)}}function kg(e){var t=e.alternate;t!==null&&(e.alternate=null,kg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Bc(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 it=null,Kt=!1;function ra(e,t,s){for(s=s.child;s!==null;)Cg(e,t,s),s=s.sibling}function Cg(e,t,s){if(Ee&&typeof Ee.onCommitFiberUnmount=="function")try{Ee.onCommitFiberUnmount(ht,s)}catch{}switch(s.tag){case 26:_t||zn(s,t),ra(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:_t||zn(s,t);var o=it,d=Kt;Ga(s.type)&&(it=s.stateNode,Kt=!1),ra(e,t,s),Bo(s.stateNode),it=o,Kt=d;break;case 5:_t||zn(s,t);case 6:if(o=it,d=Kt,it=null,ra(e,t,s),it=o,Kt=d,it!==null)if(Kt)try{(it.nodeType===9?it.body:it.nodeName==="HTML"?it.ownerDocument.body:it).removeChild(s.stateNode)}catch(h){$e(s,t,h)}else try{it.removeChild(s.stateNode)}catch(h){$e(s,t,h)}break;case 18:it!==null&&(Kt?(e=it,vv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),ki(e)):vv(it,s.stateNode));break;case 4:o=it,d=Kt,it=s.stateNode.containerInfo,Kt=!0,ra(e,t,s),it=o,Kt=d;break;case 0:case 11:case 14:case 15:Ba(2,s,t),_t||Ba(4,s,t),ra(e,t,s);break;case 1:_t||(zn(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"&&yg(s,t,o)),ra(e,t,s);break;case 21:ra(e,t,s);break;case 22:_t=(o=_t)||s.memoizedState!==null,ra(e,t,s),_t=o;break;default:ra(e,t,s)}}function Eg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ki(e)}catch(s){$e(t,t.return,s)}}}function Ng(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ki(e)}catch(s){$e(t,t.return,s)}}function z_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sg),t;default:throw Error(l(435,e.tag))}}function fr(e,t){var s=z_(e);t.forEach(function(o){if(!s.has(o)){s.add(o);var d=K_.bind(null,e,o);o.then(d,d)}})}function Zt(e,t){var s=t.deletions;if(s!==null)for(var o=0;o<s.length;o++){var d=s[o],h=e,_=t,T=_;e:for(;T!==null;){switch(T.tag){case 27:if(Ga(T.type)){it=T.stateNode,Kt=!1;break e}break;case 5:it=T.stateNode,Kt=!1;break e;case 3:case 4:it=T.stateNode.containerInfo,Kt=!0;break e}T=T.return}if(it===null)throw Error(l(160));Cg(h,_,d),it=null,Kt=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ag(t,e),t=t.sibling}var Mn=null;function Ag(e,t){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Zt(t,e),Xt(e),o&4&&(Ba(3,e,e.return),Co(3,e),Ba(5,e,e.return));break;case 1:Zt(t,e),Xt(e),o&512&&(_t||s===null||zn(s,s.return)),o&64&&la&&(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 d=Mn;if(Zt(t,e),Xt(e),o&512&&(_t||s===null||zn(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,d=d.ownerDocument||d;t:switch(o){case"title":h=d.getElementsByTagName("title")[0],(!h||h[Wi]||h[Dt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(o),d.head.insertBefore(h,d.querySelector("head > title"))),Bt(h,o,s),h[Dt]=e,At(h),o=h;break e;case"link":var _=Av("link","href",d).get(o+(s.href||""));if(_){for(var T=0;T<_.length;T++)if(h=_[T],h.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&h.getAttribute("rel")===(s.rel==null?null:s.rel)&&h.getAttribute("title")===(s.title==null?null:s.title)&&h.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(T,1);break t}}h=d.createElement(o),Bt(h,o,s),d.head.appendChild(h);break;case"meta":if(_=Av("meta","content",d).get(o+(s.content||""))){for(T=0;T<_.length;T++)if(h=_[T],h.getAttribute("content")===(s.content==null?null:""+s.content)&&h.getAttribute("name")===(s.name==null?null:s.name)&&h.getAttribute("property")===(s.property==null?null:s.property)&&h.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&h.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(T,1);break t}}h=d.createElement(o),Bt(h,o,s),d.head.appendChild(h);break;default:throw Error(l(468,o))}h[Dt]=e,At(h),o=h}e.stateNode=o}else wv(d,e.type,e.stateNode);else e.stateNode=Nv(d,o,e.memoizedProps);else h!==o?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,o===null?wv(d,e.type,e.stateNode):Nv(d,o,e.memoizedProps)):o===null&&e.stateNode!==null&&nd(e,e.memoizedProps,s.memoizedProps)}break;case 27:Zt(t,e),Xt(e),o&512&&(_t||s===null||zn(s,s.return)),s!==null&&o&4&&nd(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Zt(t,e),Xt(e),o&512&&(_t||s===null||zn(s,s.return)),e.flags&32){d=e.stateNode;try{Ys(d,"")}catch(ue){$e(e,e.return,ue)}}o&4&&e.stateNode!=null&&(d=e.memoizedProps,nd(e,d,s!==null?s.memoizedProps:d)),o&1024&&(id=!0);break;case 6:if(Zt(t,e),Xt(e),o&4){if(e.stateNode===null)throw Error(l(162));o=e.memoizedProps,s=e.stateNode;try{s.nodeValue=o}catch(ue){$e(e,e.return,ue)}}break;case 3:if(Ar=null,d=Mn,Mn=Er(t.containerInfo),Zt(t,e),Mn=d,Xt(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{ki(t.containerInfo)}catch(ue){$e(e,e.return,ue)}id&&(id=!1,wg(e));break;case 4:o=Mn,Mn=Er(e.stateNode.containerInfo),Zt(t,e),Xt(e),Mn=o;break;case 12:Zt(t,e),Xt(e);break;case 31:Zt(t,e),Xt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,fr(e,o)));break;case 13:Zt(t,e),Xt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(pr=Lt()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,fr(e,o)));break;case 22:d=e.memoizedState!==null;var w=s!==null&&s.memoizedState!==null,V=la,Z=_t;if(la=V||d,_t=Z||w,Zt(t,e),_t=Z,la=V,Xt(e),o&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(s===null||w||la||_t||_s(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){w=s=t;try{if(h=w.stateNode,d)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{T=w.stateNode;var J=w.memoizedProps.style,P=J!=null&&J.hasOwnProperty("display")?J.display:null;T.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(ue){$e(w,w.return,ue)}}}else if(t.tag===6){if(s===null){w=t;try{w.stateNode.nodeValue=d?"":w.memoizedProps}catch(ue){$e(w,w.return,ue)}}}else if(t.tag===18){if(s===null){w=t;try{var Y=w.stateNode;d?yv(Y,!0):yv(w.stateNode,!1)}catch(ue){$e(w,w.return,ue)}}}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,fr(e,s))));break;case 19:Zt(t,e),Xt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,fr(e,o)));break;case 30:break;case 21:break;default:Zt(t,e),Xt(e)}}function Xt(e){var t=e.flags;if(t&2){try{for(var s,o=e.return;o!==null;){if(xg(o)){s=o;break}o=o.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var d=s.stateNode,h=ad(e);dr(e,h,d);break;case 5:var _=s.stateNode;s.flags&32&&(Ys(_,""),s.flags&=-33);var T=ad(e);dr(e,T,_);break;case 3:case 4:var w=s.stateNode.containerInfo,V=ad(e);sd(e,V,w);break;default:throw Error(l(161))}}catch(Z){$e(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ca(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Tg(e,t.alternate,t),t=t.sibling}function _s(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ba(4,t,t.return),_s(t);break;case 1:zn(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&yg(t,t.return,s),_s(t);break;case 27:Bo(t.stateNode);case 26:case 5:zn(t,t.return),_s(t);break;case 22:t.memoizedState===null&&_s(t);break;case 30:_s(t);break;default:_s(t)}e=e.sibling}}function ua(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,d=e,h=t,_=h.flags;switch(h.tag){case 0:case 11:case 15:ua(d,h,s),Co(4,h);break;case 1:if(ua(d,h,s),o=h,d=o.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(V){$e(o,o.return,V)}if(o=h,d=o.updateQueue,d!==null){var T=o.stateNode;try{var w=d.shared.hiddenCallbacks;if(w!==null)for(d.shared.hiddenCallbacks=null,d=0;d<w.length;d++)om(w[d],T)}catch(V){$e(o,o.return,V)}}s&&_&64&&vg(h),Eo(h,h.return);break;case 27:_g(h);case 26:case 5:ua(d,h,s),s&&o===null&&_&4&&bg(h),Eo(h,h.return);break;case 12:ua(d,h,s);break;case 31:ua(d,h,s),s&&_&4&&Eg(d,h);break;case 13:ua(d,h,s),s&&_&4&&Ng(d,h);break;case 22:h.memoizedState===null&&ua(d,h,s),Eo(h,h.return);break;case 30:break;default:ua(d,h,s)}t=t.sibling}}function od(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 ld(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 Rn(e,t,s,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jg(e,t,s,o),t=t.sibling}function jg(e,t,s,o){var d=t.flags;switch(t.tag){case 0:case 11:case 15:Rn(e,t,s,o),d&2048&&Co(9,t);break;case 1:Rn(e,t,s,o);break;case 3:Rn(e,t,s,o),d&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(d&2048){Rn(e,t,s,o),e=t.stateNode;try{var h=t.memoizedProps,_=h.id,T=h.onPostCommit;typeof T=="function"&&T(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(w){$e(t,t.return,w)}}else Rn(e,t,s,o);break;case 31:Rn(e,t,s,o);break;case 13:Rn(e,t,s,o);break;case 23:break;case 22:h=t.stateNode,_=t.alternate,t.memoizedState!==null?h._visibility&2?Rn(e,t,s,o):No(e,t):h._visibility&2?Rn(e,t,s,o):(h._visibility|=2,hi(e,t,s,o,(t.subtreeFlags&10256)!==0||!1)),d&2048&&od(_,t);break;case 24:Rn(e,t,s,o),d&2048&&ld(t.alternate,t);break;default:Rn(e,t,s,o)}}function hi(e,t,s,o,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,_=t,T=s,w=o,V=_.flags;switch(_.tag){case 0:case 11:case 15:hi(h,_,T,w,d),Co(8,_);break;case 23:break;case 22:var Z=_.stateNode;_.memoizedState!==null?Z._visibility&2?hi(h,_,T,w,d):No(h,_):(Z._visibility|=2,hi(h,_,T,w,d)),d&&V&2048&&od(_.alternate,_);break;case 24:hi(h,_,T,w,d),d&&V&2048&&ld(_.alternate,_);break;default:hi(h,_,T,w,d)}t=t.sibling}}function No(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,o=t,d=o.flags;switch(o.tag){case 22:No(s,o),d&2048&&od(o.alternate,o);break;case 24:No(s,o),d&2048&&ld(o.alternate,o);break;default:No(s,o)}t=t.sibling}}var Ao=8192;function pi(e,t,s){if(e.subtreeFlags&Ao)for(e=e.child;e!==null;)Dg(e,t,s),e=e.sibling}function Dg(e,t,s){switch(e.tag){case 26:pi(e,t,s),e.flags&Ao&&e.memoizedState!==null&&CS(s,Mn,e.memoizedState,e.memoizedProps);break;case 5:pi(e,t,s);break;case 3:case 4:var o=Mn;Mn=Er(e.stateNode.containerInfo),pi(e,t,s),Mn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=Ao,Ao=16777216,pi(e,t,s),Ao=o):pi(e,t,s));break;default:pi(e,t,s)}}function Mg(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 wo(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];wt=o,Og(o,e)}Mg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rg(e),e=e.sibling}function Rg(e){switch(e.tag){case 0:case 11:case 15:wo(e),e.flags&2048&&Ba(9,e,e.return);break;case 3:wo(e);break;case 12:wo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,hr(e)):wo(e);break;default:wo(e)}}function hr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];wt=o,Og(o,e)}Mg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ba(8,t,t.return),hr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,hr(t));break;default:hr(t)}e=e.sibling}}function Og(e,t){for(;wt!==null;){var s=wt;switch(s.tag){case 0:case 11:case 15:Ba(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,wt=o;else e:for(s=e;wt!==null;){o=wt;var d=o.sibling,h=o.return;if(kg(o),o===s){wt=null;break e}if(d!==null){d.return=h,wt=d;break e}wt=h}}}var V_={getCacheForType:function(e){var t=Rt(yt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Rt(yt).controller.signal}},H_=typeof WeakMap=="function"?WeakMap:Map,Ve=0,Qe=null,Ae=null,De=0,Pe=0,on=null,Ia=!1,mi=!1,rd=!1,da=0,ut=0,La=0,Ss=0,cd=0,ln=0,gi=0,jo=null,Qt=null,ud=!1,pr=0,Bg=0,mr=1/0,gr=null,Ua=null,Ct=0,za=null,vi=null,fa=0,dd=0,fd=null,Ig=null,Do=0,hd=null;function rn(){return(Ve&2)!==0&&De!==0?De&-De:B.T!==null?bd():Wh()}function Lg(){if(ln===0)if((De&536870912)===0||Re){var e=mn;mn<<=1,(mn&3932160)===0&&(mn=262144),ln=e}else ln=536870912;return e=an.current,e!==null&&(e.flags|=32),ln}function Wt(e,t,s){(e===Qe&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(yi(e,0),Va(e,De,ln,!1)),Qi(e,s),((Ve&2)===0||e!==Qe)&&(e===Qe&&((Ve&2)===0&&(Ss|=s),ut===4&&Va(e,De,ln,!1)),Vn(e))}function Ug(e,t,s){if((Ve&6)!==0)throw Error(l(327));var o=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Xi(e,t),d=o?$_(e,t):md(e,t,!0),h=o;do{if(d===0){mi&&!o&&Va(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!G_(s)){d=md(e,t,!1),h=!1;continue}if(d===2){if(h=t,e.errorRecoveryDisabledLanes&h)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){t=_;e:{var T=e;d=jo;var w=T.current.memoizedState.isDehydrated;if(w&&(yi(T,_).flags|=256),_=md(T,_,!1),_!==2){if(rd&&!w){T.errorRecoveryDisabledLanes|=h,Ss|=h,d=4;break e}h=Qt,Qt=d,h!==null&&(Qt===null?Qt=h:Qt.push.apply(Qt,h))}d=_}if(h=!1,d!==2)continue}}if(d===1){yi(e,0),Va(e,t,0,!0);break}e:{switch(o=e,h=d,h){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Va(o,t,ln,!Ia);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(d=pr+300-Lt(),10<d)){if(Va(o,t,ln,!Ia),El(o,0,!0)!==0)break e;fa=t,o.timeoutHandle=mv(zg.bind(null,o,s,Qt,gr,ud,t,ln,Ss,gi,Ia,h,"Throttled",-0,0),d);break e}zg(o,s,Qt,gr,ud,t,ln,Ss,gi,Ia,h,null,-0,0)}}break}while(!0);Vn(e)}function zg(e,t,s,o,d,h,_,T,w,V,Z,J,P,Y){if(e.timeoutHandle=-1,J=t.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qn},Dg(t,h,J);var ue=(h&62914560)===h?pr-Lt():(h&4194048)===h?Bg-Lt():0;if(ue=ES(J,ue),ue!==null){fa=h,e.cancelPendingCommit=ue(Yg.bind(null,e,t,h,s,o,d,_,T,w,Z,J,null,P,Y)),Va(e,h,_,!V);return}}Yg(e,t,h,s,o,d,_,T,w)}function G_(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 d=s[o],h=d.getSnapshot;d=d.value;try{if(!tn(h(),d))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Va(e,t,s,o){t&=~cd,t&=~Ss,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var d=t;0<d;){var h=31-qe(d),_=1<<h;o[h]=-1,d&=~_}s!==0&&Zh(e,s,t)}function vr(){return(Ve&6)===0?(Mo(0),!1):!0}function pd(){if(Ae!==null){if(Pe===0)var e=Ae.return;else e=Ae,ta=hs=null,ju(e),ri=null,po=0,e=Ae;for(;e!==null;)gg(e.alternate,e),e=e.return;Ae=null}}function yi(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,rS(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),fa=0,pd(),Qe=e,Ae=s=Jn(e.current,null),De=t,Pe=0,on=null,Ia=!1,mi=Xi(e,t),rd=!1,gi=ln=cd=Ss=La=ut=0,Qt=jo=null,ud=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var d=31-qe(o),h=1<<d;t|=e[d],o&=~h}return da=t,Ul(),s}function Vg(e,t){Te=null,B.H=So,t===li||t===ql?(t=nm(),Pe=3):t===yu?(t=nm(),Pe=4):Pe=t===qu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,on=t,Ae===null&&(ut=1,or(e,bn(t,e.current)))}function Hg(){var e=an.current;return e===null?!0:(De&4194048)===De?Tn===null:(De&62914560)===De||(De&536870912)!==0?e===Tn:!1}function Gg(){var e=B.H;return B.H=So,e===null?So:e}function Pg(){var e=B.A;return B.A=V_,e}function yr(){ut=4,Ia||(De&4194048)!==De&&an.current!==null||(mi=!0),(La&134217727)===0&&(Ss&134217727)===0||Qe===null||Va(Qe,De,ln,!1)}function md(e,t,s){var o=Ve;Ve|=2;var d=Gg(),h=Pg();(Qe!==e||De!==t)&&(gr=null,yi(e,t)),t=!1;var _=ut;e:do try{if(Pe!==0&&Ae!==null){var T=Ae,w=on;switch(Pe){case 8:pd(),_=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(t=!0);var V=Pe;if(Pe=0,on=null,bi(e,T,w,V),s&&mi){_=0;break e}break;default:V=Pe,Pe=0,on=null,bi(e,T,w,V)}}P_(),_=ut;break}catch(Z){Vg(e,Z)}while(!0);return t&&e.shellSuspendCounter++,ta=hs=null,Ve=o,B.H=d,B.A=h,Ae===null&&(Qe=null,De=0,Ul()),_}function P_(){for(;Ae!==null;)$g(Ae)}function $_(e,t){var s=Ve;Ve|=2;var o=Gg(),d=Pg();Qe!==e||De!==t?(gr=null,mr=Lt()+500,yi(e,t)):mi=Xi(e,t);e:do try{if(Pe!==0&&Ae!==null){t=Ae;var h=on;t:switch(Pe){case 1:Pe=0,on=null,bi(e,t,h,1);break;case 2:case 9:if(em(h)){Pe=0,on=null,Fg(t);break}t=function(){Pe!==2&&Pe!==9||Qe!==e||(Pe=7),Vn(e)},h.then(t,t);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:em(h)?(Pe=0,on=null,Fg(t)):(Pe=0,on=null,bi(e,t,h,7));break;case 5:var _=null;switch(Ae.tag){case 26:_=Ae.memoizedState;case 5:case 27:var T=Ae;if(_?jv(_):T.stateNode.complete){Pe=0,on=null;var w=T.sibling;if(w!==null)Ae=w;else{var V=T.return;V!==null?(Ae=V,br(V)):Ae=null}break t}}Pe=0,on=null,bi(e,t,h,5);break;case 6:Pe=0,on=null,bi(e,t,h,6);break;case 8:pd(),ut=6;break e;default:throw Error(l(462))}}F_();break}catch(Z){Vg(e,Z)}while(!0);return ta=hs=null,B.H=o,B.A=d,Ve=s,Ae!==null?0:(Qe=null,De=0,Ul(),ut)}function F_(){for(;Ae!==null&&!kl();)$g(Ae)}function $g(e){var t=pg(e.alternate,e,da);e.memoizedProps=e.pendingProps,t===null?br(e):Ae=t}function Fg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=rg(s,t,t.pendingProps,t.type,void 0,De);break;case 11:t=rg(s,t,t.pendingProps,t.type.render,t.ref,De);break;case 5:ju(t);default:gg(s,t),t=Ae=Pp(t,da),t=pg(s,t,da)}e.memoizedProps=e.pendingProps,t===null?br(e):Ae=t}function bi(e,t,s,o){ta=hs=null,ju(t),ri=null,po=0;var d=t.return;try{if(R_(e,d,t,s,De)){ut=1,or(e,bn(s,e.current)),Ae=null;return}}catch(h){if(d!==null)throw Ae=d,h;ut=1,or(e,bn(s,e.current)),Ae=null;return}t.flags&32768?(Re||o===1?e=!0:mi||(De&536870912)!==0?e=!1:(Ia=e=!0,(o===2||o===9||o===3||o===6)&&(o=an.current,o!==null&&o.tag===13&&(o.flags|=16384))),qg(t,e)):br(t)}function br(e){var t=e;do{if((t.flags&32768)!==0){qg(t,Ia);return}e=t.return;var s=I_(t.alternate,t,da);if(s!==null){Ae=s;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);ut===0&&(ut=5)}function qg(e,t){do{var s=L_(e.alternate,e);if(s!==null){s.flags&=32767,Ae=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=s}while(e!==null);ut=6,Ae=null}function Yg(e,t,s,o,d,h,_,T,w){e.cancelPendingCommit=null;do xr();while(Ct!==0);if((Ve&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(h=t.lanes|t.childLanes,h|=au,k1(e,s,h,_,T,w),e===Qe&&(Ae=Qe=null,De=0),vi=t,za=e,fa=s,dd=h,fd=d,Ig=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Z_(ce,function(){return Wg(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=B.T,B.T=null,d=H.p,H.p=2,_=Ve,Ve|=4;try{U_(e,t,s)}finally{Ve=_,H.p=d,B.T=o}}Ct=1,Kg(),Zg(),Xg()}}function Kg(){if(Ct===1){Ct=0;var e=za,t=vi,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=B.T,B.T=null;var o=H.p;H.p=2;var d=Ve;Ve|=4;try{Ag(t,e);var h=Nd,_=Op(e.containerInfo),T=h.focusedElem,w=h.selectionRange;if(_!==T&&T&&T.ownerDocument&&Rp(T.ownerDocument.documentElement,T)){if(w!==null&&Wc(T)){var V=w.start,Z=w.end;if(Z===void 0&&(Z=V),"selectionStart"in T)T.selectionStart=V,T.selectionEnd=Math.min(Z,T.value.length);else{var J=T.ownerDocument||document,P=J&&J.defaultView||window;if(P.getSelection){var Y=P.getSelection(),ue=T.textContent.length,ge=Math.min(w.start,ue),Ze=w.end===void 0?ge:Math.min(w.end,ue);!Y.extend&&ge>Ze&&(_=Ze,Ze=ge,ge=_);var L=Mp(T,ge),R=Mp(T,Ze);if(L&&R&&(Y.rangeCount!==1||Y.anchorNode!==L.node||Y.anchorOffset!==L.offset||Y.focusNode!==R.node||Y.focusOffset!==R.offset)){var z=J.createRange();z.setStart(L.node,L.offset),Y.removeAllRanges(),ge>Ze?(Y.addRange(z),Y.extend(R.node,R.offset)):(z.setEnd(R.node,R.offset),Y.addRange(z))}}}}for(J=[],Y=T;Y=Y.parentNode;)Y.nodeType===1&&J.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<J.length;T++){var X=J[T];X.element.scrollLeft=X.left,X.element.scrollTop=X.top}}Mr=!!Ed,Nd=Ed=null}finally{Ve=d,H.p=o,B.T=s}}e.current=t,Ct=2}}function Zg(){if(Ct===2){Ct=0;var e=za,t=vi,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=B.T,B.T=null;var o=H.p;H.p=2;var d=Ve;Ve|=4;try{Tg(e,t.alternate,t)}finally{Ve=d,H.p=o,B.T=s}}Ct=3}}function Xg(){if(Ct===4||Ct===3){Ct=0,Cl();var e=za,t=vi,s=fa,o=Ig;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ct=5:(Ct=0,vi=za=null,Qg(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Ua=null),Rc(s),t=t.stateNode,Ee&&typeof Ee.onCommitFiberRoot=="function")try{Ee.onCommitFiberRoot(ht,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=B.T,d=H.p,H.p=2,B.T=null;try{for(var h=e.onRecoverableError,_=0;_<o.length;_++){var T=o[_];h(T.value,{componentStack:T.stack})}}finally{B.T=t,H.p=d}}(fa&3)!==0&&xr(),Vn(e),d=e.pendingLanes,(s&261930)!==0&&(d&42)!==0?e===hd?Do++:(Do=0,hd=e):Do=0,Mo(0)}}function Qg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fo(t)))}function xr(){return Kg(),Zg(),Xg(),Wg()}function Wg(){if(Ct!==5)return!1;var e=za,t=dd;dd=0;var s=Rc(fa),o=B.T,d=H.p;try{H.p=32>s?32:s,B.T=null,s=fd,fd=null;var h=za,_=fa;if(Ct=0,vi=za=null,fa=0,(Ve&6)!==0)throw Error(l(331));var T=Ve;if(Ve|=4,Rg(h.current),jg(h,h.current,_,s),Ve=T,Mo(0,!1),Ee&&typeof Ee.onPostCommitFiberRoot=="function")try{Ee.onPostCommitFiberRoot(ht,h)}catch{}return!0}finally{H.p=d,B.T=o,Qg(e,t)}}function Jg(e,t,s){t=bn(s,t),t=Fu(e.stateNode,t,2),e=Ma(e,t,2),e!==null&&(Qi(e,2),Vn(e))}function $e(e,t,s){if(e.tag===3)Jg(e,e,s);else for(;t!==null;){if(t.tag===3){Jg(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ua===null||!Ua.has(o))){e=bn(s,e),s=eg(2),o=Ma(t,s,2),o!==null&&(tg(s,o,t,e),Qi(o,2),Vn(o));break}}t=t.return}}function gd(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new H_;var d=new Set;o.set(t,d)}else d=o.get(t),d===void 0&&(d=new Set,o.set(t,d));d.has(s)||(rd=!0,d.add(s),e=q_.bind(null,e,t,s),t.then(e,e))}function q_(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Qe===e&&(De&s)===s&&(ut===4||ut===3&&(De&62914560)===De&&300>Lt()-pr?(Ve&2)===0&&yi(e,0):cd|=s,gi===De&&(gi=0)),Vn(e)}function ev(e,t){t===0&&(t=Kh()),e=us(e,t),e!==null&&(Qi(e,t),Vn(e))}function Y_(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),ev(e,s)}function K_(e,t){var s=0;switch(e.tag){case 31:case 13:var o=e.stateNode,d=e.memoizedState;d!==null&&(s=d.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),ev(e,s)}function Z_(e,t){return zs(e,t)}var _r=null,xi=null,vd=!1,Sr=!1,yd=!1,Ha=0;function Vn(e){e!==xi&&e.next===null&&(xi===null?_r=xi=e:xi=xi.next=e),Sr=!0,vd||(vd=!0,Q_())}function Mo(e,t){if(!yd&&Sr){yd=!0;do for(var s=!1,o=_r;o!==null;){if(e!==0){var d=o.pendingLanes;if(d===0)var h=0;else{var _=o.suspendedLanes,T=o.pingedLanes;h=(1<<31-qe(42|e)+1)-1,h&=d&~(_&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,sv(o,h))}else h=De,h=El(o,o===Qe?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Xi(o,h)||(s=!0,sv(o,h));o=o.next}while(s);yd=!1}}function X_(){tv()}function tv(){Sr=vd=!1;var e=0;Ha!==0&&lS()&&(e=Ha);for(var t=Lt(),s=null,o=_r;o!==null;){var d=o.next,h=nv(o,t);h===0?(o.next=null,s===null?_r=d:s.next=d,d===null&&(xi=s)):(s=o,(e!==0||(h&3)!==0)&&(Sr=!0)),o=d}Ct!==0&&Ct!==5||Mo(e),Ha!==0&&(Ha=0)}function nv(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-qe(h),T=1<<_,w=d[_];w===-1?((T&s)===0||(T&o)!==0)&&(d[_]=T1(T,t)):w<=t&&(e.expiredLanes|=T),h&=~T}if(t=Qe,s=De,s=El(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===t&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Vs(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&&Vs(o),Rc(s)){case 2:case 8:s=oe;break;case 32:s=ce;break;case 268435456:s=xe;break;default:s=ce}return o=av.bind(null,e),s=zs(s,o),e.callbackPriority=t,e.callbackNode=s,t}return o!==null&&o!==null&&Vs(o),e.callbackPriority=2,e.callbackNode=null,2}function av(e,t){if(Ct!==0&&Ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(xr()&&e.callbackNode!==s)return null;var o=De;return o=El(e,e===Qe?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Ug(e,o,t),nv(e,Lt()),e.callbackNode!=null&&e.callbackNode===s?av.bind(null,e):null)}function sv(e,t){if(xr())return null;Ug(e,t,!0)}function Q_(){cS(function(){(Ve&6)!==0?zs(Q,X_):tv()})}function bd(){if(Ha===0){var e=ii;e===0&&(e=Sa,Sa<<=1,(Sa&261888)===0&&(Sa=256)),Ha=e}return Ha}function iv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:jl(""+e)}function ov(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 W_(e,t,s,o,d){if(t==="submit"&&s&&s.stateNode===d){var h=iv((d[qt]||null).action),_=o.submitter;_&&(t=(t=_[qt]||null)?iv(t.formAction):_.getAttribute("formAction"),t!==null&&(h=t,_=null));var T=new Ol("action","action",null,o,d);e.push({event:T,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Ha!==0){var w=_?ov(d,_):new FormData(d);zu(s,{pending:!0,data:w,method:d.method,action:h},null,w)}}else typeof h=="function"&&(T.preventDefault(),w=_?ov(d,_):new FormData(d),zu(s,{pending:!0,data:w,method:d.method,action:h},h,w))},currentTarget:d}]})}}for(var xd=0;xd<nu.length;xd++){var _d=nu[xd],J_=_d.toLowerCase(),eS=_d[0].toUpperCase()+_d.slice(1);Dn(J_,"on"+eS)}Dn(Lp,"onAnimationEnd"),Dn(Up,"onAnimationIteration"),Dn(zp,"onAnimationStart"),Dn("dblclick","onDoubleClick"),Dn("focusin","onFocus"),Dn("focusout","onBlur"),Dn(g_,"onTransitionRun"),Dn(v_,"onTransitionStart"),Dn(y_,"onTransitionCancel"),Dn(Vp,"onTransitionEnd"),Fs("onMouseEnter",["mouseout","mouseover"]),Fs("onMouseLeave",["mouseout","mouseover"]),Fs("onPointerEnter",["pointerout","pointerover"]),Fs("onPointerLeave",["pointerout","pointerover"]),os("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),os("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),os("onBeforeInput",["compositionend","keypress","textInput","paste"]),os("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),os("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),os("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ro="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(" "),tS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ro));function lv(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],d=o.event;o=o.listeners;e:{var h=void 0;if(t)for(var _=o.length-1;0<=_;_--){var T=o[_],w=T.instance,V=T.currentTarget;if(T=T.listener,w!==h&&d.isPropagationStopped())break e;h=T,d.currentTarget=V;try{h(d)}catch(Z){Ll(Z)}d.currentTarget=null,h=w}else for(_=0;_<o.length;_++){if(T=o[_],w=T.instance,V=T.currentTarget,T=T.listener,w!==h&&d.isPropagationStopped())break e;h=T,d.currentTarget=V;try{h(d)}catch(Z){Ll(Z)}d.currentTarget=null,h=w}}}}function we(e,t){var s=t[Oc];s===void 0&&(s=t[Oc]=new Set);var o=e+"__bubble";s.has(o)||(rv(t,e,2,!1),s.add(o))}function Sd(e,t,s){var o=0;t&&(o|=4),rv(s,e,o,t)}var Tr="_reactListening"+Math.random().toString(36).slice(2);function Td(e){if(!e[Tr]){e[Tr]=!0,tp.forEach(function(s){s!=="selectionchange"&&(tS.has(s)||Sd(s,!1,e),Sd(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tr]||(t[Tr]=!0,Sd("selectionchange",!1,t))}}function rv(e,t,s,o){switch(Lv(t)){case 2:var d=wS;break;case 8:d=jS;break;default:d=Ud}s=d.bind(null,t,s,e),d=void 0,!Pc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),o?d!==void 0?e.addEventListener(t,s,{capture:!0,passive:d}):e.addEventListener(t,s,!0):d!==void 0?e.addEventListener(t,s,{passive:d}):e.addEventListener(t,s,!1)}function kd(e,t,s,o,d){var h=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var _=o.tag;if(_===3||_===4){var T=o.stateNode.containerInfo;if(T===d)break;if(_===4)for(_=o.return;_!==null;){var w=_.tag;if((w===3||w===4)&&_.stateNode.containerInfo===d)return;_=_.return}for(;T!==null;){if(_=Gs(T),_===null)return;if(w=_.tag,w===5||w===6||w===26||w===27){o=h=_;continue e}T=T.parentNode}}o=o.return}hp(function(){var V=h,Z=Hc(s),J=[];e:{var P=Hp.get(e);if(P!==void 0){var Y=Ol,ue=e;switch(e){case"keypress":if(Ml(s)===0)break e;case"keydown":case"keyup":Y=K1;break;case"focusin":ue="focus",Y=Yc;break;case"focusout":ue="blur",Y=Yc;break;case"beforeblur":case"afterblur":Y=Yc;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":Y=gp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=I1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Q1;break;case Lp:case Up:case zp:Y=z1;break;case Vp:Y=J1;break;case"scroll":case"scrollend":Y=O1;break;case"wheel":Y=t_;break;case"copy":case"cut":case"paste":Y=H1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=yp;break;case"toggle":case"beforetoggle":Y=a_}var ge=(t&4)!==0,Ze=!ge&&(e==="scroll"||e==="scrollend"),L=ge?P!==null?P+"Capture":null:P;ge=[];for(var R=V,z;R!==null;){var X=R;if(z=X.stateNode,X=X.tag,X!==5&&X!==26&&X!==27||z===null||L===null||(X=eo(R,L),X!=null&&ge.push(Oo(R,X,z))),Ze)break;R=R.return}0<ge.length&&(P=new Y(P,ue,null,s,Z),J.push({event:P,listeners:ge}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",Y=e==="mouseout"||e==="pointerout",P&&s!==Vc&&(ue=s.relatedTarget||s.fromElement)&&(Gs(ue)||ue[Hs]))break e;if((Y||P)&&(P=Z.window===Z?Z:(P=Z.ownerDocument)?P.defaultView||P.parentWindow:window,Y?(ue=s.relatedTarget||s.toElement,Y=V,ue=ue?Gs(ue):null,ue!==null&&(Ze=u(ue),ge=ue.tag,ue!==Ze||ge!==5&&ge!==27&&ge!==6)&&(ue=null)):(Y=null,ue=V),Y!==ue)){if(ge=gp,X="onMouseLeave",L="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(ge=yp,X="onPointerLeave",L="onPointerEnter",R="pointer"),Ze=Y==null?P:Ji(Y),z=ue==null?P:Ji(ue),P=new ge(X,R+"leave",Y,s,Z),P.target=Ze,P.relatedTarget=z,X=null,Gs(Z)===V&&(ge=new ge(L,R+"enter",ue,s,Z),ge.target=z,ge.relatedTarget=Ze,X=ge),Ze=X,Y&&ue)t:{for(ge=nS,L=Y,R=ue,z=0,X=L;X;X=ge(X))z++;X=0;for(var pe=R;pe;pe=ge(pe))X++;for(;0<z-X;)L=ge(L),z--;for(;0<X-z;)R=ge(R),X--;for(;z--;){if(L===R||R!==null&&L===R.alternate){ge=L;break t}L=ge(L),R=ge(R)}ge=null}else ge=null;Y!==null&&cv(J,P,Y,ge,!1),ue!==null&&Ze!==null&&cv(J,Ze,ue,ge,!0)}}e:{if(P=V?Ji(V):window,Y=P.nodeName&&P.nodeName.toLowerCase(),Y==="select"||Y==="input"&&P.type==="file")var Ie=Ep;else if(kp(P))if(Np)Ie=h_;else{Ie=d_;var fe=u_}else Y=P.nodeName,!Y||Y.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?V&&zc(V.elementType)&&(Ie=Ep):Ie=f_;if(Ie&&(Ie=Ie(e,V))){Cp(J,Ie,s,Z);break e}fe&&fe(e,P,V),e==="focusout"&&V&&P.type==="number"&&V.memoizedProps.value!=null&&Uc(P,"number",P.value)}switch(fe=V?Ji(V):window,e){case"focusin":(kp(fe)||fe.contentEditable==="true")&&(Qs=fe,Jc=V,ro=null);break;case"focusout":ro=Jc=Qs=null;break;case"mousedown":eu=!0;break;case"contextmenu":case"mouseup":case"dragend":eu=!1,Bp(J,s,Z);break;case"selectionchange":if(m_)break;case"keydown":case"keyup":Bp(J,s,Z)}var ke;if(Zc)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Xs?Sp(e,s)&&(Me="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Me="onCompositionStart");Me&&(bp&&s.locale!=="ko"&&(Xs||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Xs&&(ke=pp()):(Ca=Z,$c="value"in Ca?Ca.value:Ca.textContent,Xs=!0)),fe=kr(V,Me),0<fe.length&&(Me=new vp(Me,e,null,s,Z),J.push({event:Me,listeners:fe}),ke?Me.data=ke:(ke=Tp(s),ke!==null&&(Me.data=ke)))),(ke=i_?o_(e,s):l_(e,s))&&(Me=kr(V,"onBeforeInput"),0<Me.length&&(fe=new vp("onBeforeInput","beforeinput",null,s,Z),J.push({event:fe,listeners:Me}),fe.data=ke)),W_(J,e,V,s,Z)}lv(J,t)})}function Oo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function kr(e,t){for(var s=t+"Capture",o=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=eo(e,s),d!=null&&o.unshift(Oo(e,d,h)),d=eo(e,t),d!=null&&o.push(Oo(e,d,h))),e.tag===3)return o;e=e.return}return[]}function nS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function cv(e,t,s,o,d){for(var h=t._reactName,_=[];s!==null&&s!==o;){var T=s,w=T.alternate,V=T.stateNode;if(T=T.tag,w!==null&&w===o)break;T!==5&&T!==26&&T!==27||V===null||(w=V,d?(V=eo(s,h),V!=null&&_.unshift(Oo(s,V,w))):d||(V=eo(s,h),V!=null&&_.push(Oo(s,V,w)))),s=s.return}_.length!==0&&e.push({event:t,listeners:_})}var aS=/\r\n?/g,sS=/\u0000|\uFFFD/g;function uv(e){return(typeof e=="string"?e:""+e).replace(aS,`
|
|
25
|
-
`).replace(sS,"")}function dv(e,t){return t=uv(t),uv(e)===t}function Ke(e,t,s,o,d,h){switch(s){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||Ys(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&Ys(e,""+o);break;case"className":Al(e,"class",o);break;case"tabIndex":Al(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Al(e,s,o);break;case"style":dp(e,o,h);break;case"data":if(t!=="object"){Al(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=jl(""+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"&&Ke(e,t,"name",d.name,d,null),Ke(e,t,"formEncType",d.formEncType,d,null),Ke(e,t,"formMethod",d.formMethod,d,null),Ke(e,t,"formTarget",d.formTarget,d,null)):(Ke(e,t,"encType",d.encType,d,null),Ke(e,t,"method",d.method,d,null),Ke(e,t,"target",d.target,d,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=jl(""+o),e.setAttribute(s,o);break;case"onClick":o!=null&&(e.onclick=Qn);break;case"onScroll":o!=null&&we("scroll",e);break;case"onScrollEnd":o!=null&&we("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(d.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=jl(""+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":we("beforetoggle",e),we("toggle",e),Nl(e,"popover",o);break;case"xlinkActuate":Xn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Xn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Xn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Xn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Xn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Xn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Xn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Xn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Xn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Nl(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=M1.get(s)||s,Nl(e,s,o))}}function Cd(e,t,s,o,d,h){switch(s){case"style":dp(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(d.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"children":typeof o=="string"?Ys(e,o):(typeof o=="number"||typeof o=="bigint")&&Ys(e,""+o);break;case"onScroll":o!=null&&we("scroll",e);break;case"onScrollEnd":o!=null&&we("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Qn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!np.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(d=s.endsWith("Capture"),t=s.slice(2,d?s.length-7:void 0),h=e[qt]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(t,h,d),typeof o=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,o,d);break e}s in e?e[s]=o:o===!0?e.setAttribute(s,""):Nl(e,s,o)}}}function Bt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":we("error",e),we("load",e);var o=!1,d=!1,h;for(h in s)if(s.hasOwnProperty(h)){var _=s[h];if(_!=null)switch(h){case"src":o=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Ke(e,t,h,_,s,null)}}d&&Ke(e,t,"srcSet",s.srcSet,s,null),o&&Ke(e,t,"src",s.src,s,null);return;case"input":we("invalid",e);var T=h=_=d=null,w=null,V=null;for(o in s)if(s.hasOwnProperty(o)){var Z=s[o];if(Z!=null)switch(o){case"name":d=Z;break;case"type":_=Z;break;case"checked":w=Z;break;case"defaultChecked":V=Z;break;case"value":h=Z;break;case"defaultValue":T=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(l(137,t));break;default:Ke(e,t,o,Z,s,null)}}lp(e,h,T,w,V,_,d,!1);return;case"select":we("invalid",e),o=_=h=null;for(d in s)if(s.hasOwnProperty(d)&&(T=s[d],T!=null))switch(d){case"value":h=T;break;case"defaultValue":_=T;break;case"multiple":o=T;default:Ke(e,t,d,T,s,null)}t=h,s=_,e.multiple=!!o,t!=null?qs(e,!!o,t,!1):s!=null&&qs(e,!!o,s,!0);return;case"textarea":we("invalid",e),h=d=o=null;for(_ in s)if(s.hasOwnProperty(_)&&(T=s[_],T!=null))switch(_){case"value":o=T;break;case"defaultValue":d=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(l(91));break;default:Ke(e,t,_,T,s,null)}cp(e,o,d,h);return;case"option":for(w in s)if(s.hasOwnProperty(w)&&(o=s[w],o!=null))switch(w){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Ke(e,t,w,o,s,null)}return;case"dialog":we("beforetoggle",e),we("toggle",e),we("cancel",e),we("close",e);break;case"iframe":case"object":we("load",e);break;case"video":case"audio":for(o=0;o<Ro.length;o++)we(Ro[o],e);break;case"image":we("error",e),we("load",e);break;case"details":we("toggle",e);break;case"embed":case"source":case"link":we("error",e),we("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in s)if(s.hasOwnProperty(V)&&(o=s[V],o!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Ke(e,t,V,o,s,null)}return;default:if(zc(t)){for(Z in s)s.hasOwnProperty(Z)&&(o=s[Z],o!==void 0&&Cd(e,t,Z,o,s,void 0));return}}for(T in s)s.hasOwnProperty(T)&&(o=s[T],o!=null&&Ke(e,t,T,o,s,null))}function iS(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 d=null,h=null,_=null,T=null,w=null,V=null,Z=null;for(Y in s){var J=s[Y];if(s.hasOwnProperty(Y)&&J!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":w=J;default:o.hasOwnProperty(Y)||Ke(e,t,Y,null,o,J)}}for(var P in o){var Y=o[P];if(J=s[P],o.hasOwnProperty(P)&&(Y!=null||J!=null))switch(P){case"type":h=Y;break;case"name":d=Y;break;case"checked":V=Y;break;case"defaultChecked":Z=Y;break;case"value":_=Y;break;case"defaultValue":T=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(l(137,t));break;default:Y!==J&&Ke(e,t,P,Y,o,J)}}Lc(e,_,T,w,V,Z,h,d);return;case"select":Y=_=T=P=null;for(h in s)if(w=s[h],s.hasOwnProperty(h)&&w!=null)switch(h){case"value":break;case"multiple":Y=w;default:o.hasOwnProperty(h)||Ke(e,t,h,null,o,w)}for(d in o)if(h=o[d],w=s[d],o.hasOwnProperty(d)&&(h!=null||w!=null))switch(d){case"value":P=h;break;case"defaultValue":T=h;break;case"multiple":_=h;default:h!==w&&Ke(e,t,d,h,o,w)}t=T,s=_,o=Y,P!=null?qs(e,!!s,P,!1):!!o!=!!s&&(t!=null?qs(e,!!s,t,!0):qs(e,!!s,s?[]:"",!1));return;case"textarea":Y=P=null;for(T in s)if(d=s[T],s.hasOwnProperty(T)&&d!=null&&!o.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Ke(e,t,T,null,o,d)}for(_ in o)if(d=o[_],h=s[_],o.hasOwnProperty(_)&&(d!=null||h!=null))switch(_){case"value":P=d;break;case"defaultValue":Y=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(l(91));break;default:d!==h&&Ke(e,t,_,d,o,h)}rp(e,P,Y);return;case"option":for(var ue in s)if(P=s[ue],s.hasOwnProperty(ue)&&P!=null&&!o.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:Ke(e,t,ue,null,o,P)}for(w in o)if(P=o[w],Y=s[w],o.hasOwnProperty(w)&&P!==Y&&(P!=null||Y!=null))switch(w){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:Ke(e,t,w,P,o,Y)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ge in s)P=s[ge],s.hasOwnProperty(ge)&&P!=null&&!o.hasOwnProperty(ge)&&Ke(e,t,ge,null,o,P);for(V in o)if(P=o[V],Y=s[V],o.hasOwnProperty(V)&&P!==Y&&(P!=null||Y!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(l(137,t));break;default:Ke(e,t,V,P,o,Y)}return;default:if(zc(t)){for(var Ze in s)P=s[Ze],s.hasOwnProperty(Ze)&&P!==void 0&&!o.hasOwnProperty(Ze)&&Cd(e,t,Ze,void 0,o,P);for(Z in o)P=o[Z],Y=s[Z],!o.hasOwnProperty(Z)||P===Y||P===void 0&&Y===void 0||Cd(e,t,Z,P,o,Y);return}}for(var L in s)P=s[L],s.hasOwnProperty(L)&&P!=null&&!o.hasOwnProperty(L)&&Ke(e,t,L,null,o,P);for(J in o)P=o[J],Y=s[J],!o.hasOwnProperty(J)||P===Y||P==null&&Y==null||Ke(e,t,J,P,o,Y)}function fv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function oS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var d=s[o],h=d.transferSize,_=d.initiatorType,T=d.duration;if(h&&T&&fv(_)){for(_=0,T=d.responseEnd,o+=1;o<s.length;o++){var w=s[o],V=w.startTime;if(V>T)break;var Z=w.transferSize,J=w.initiatorType;Z&&fv(J)&&(w=w.responseEnd,_+=Z*(w<T?1:(T-V)/(w-V)))}if(--o,t+=8*(h+_)/(d.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ed=null,Nd=null;function Cr(e){return e.nodeType===9?e:e.ownerDocument}function hv(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 pv(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 Ad(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 wd=null;function lS(){var e=window.event;return e&&e.type==="popstate"?e===wd?!1:(wd=e,!0):(wd=null,!1)}var mv=typeof setTimeout=="function"?setTimeout:void 0,rS=typeof clearTimeout=="function"?clearTimeout:void 0,gv=typeof Promise=="function"?Promise:void 0,cS=typeof queueMicrotask=="function"?queueMicrotask:typeof gv<"u"?function(e){return gv.resolve(null).then(e).catch(uS)}:mv;function uS(e){setTimeout(function(){throw e})}function Ga(e){return e==="head"}function vv(e,t){var s=t,o=0;do{var d=s.nextSibling;if(e.removeChild(s),d&&d.nodeType===8)if(s=d.data,s==="/$"||s==="/&"){if(o===0){e.removeChild(d),ki(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 _=h.nextSibling,T=h.nodeName;h[Wi]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=_}}else s==="body"&&Bo(e.ownerDocument.body);s=d}while(s);ki(t)}function yv(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),Bc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function dS(e,t,s,o){for(;e.nodeType===1;){var d=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!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=kn(e.nextSibling),e===null)break}return null}function fS(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=kn(e.nextSibling),e===null))return null;return e}function bv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=kn(e.nextSibling),e===null))return null;return e}function Dd(e){return e.data==="$?"||e.data==="$~"}function Md(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function hS(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var o=function(){t(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function kn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Rd=null;function xv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return kn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function _v(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 Sv(e,t,s){switch(t=Cr(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]);Bc(e)}var Cn=new Map,Tv=new Set;function Er(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ha=H.d;H.d={f:pS,r:mS,D:gS,C:vS,L:yS,m:bS,X:_S,S:xS,M:SS};function pS(){var e=ha.f(),t=vr();return e||t}function mS(e){var t=Ps(e);t!==null&&t.tag===5&&t.type==="form"?Vm(t):ha.r(e)}var _i=typeof document>"u"?null:document;function kv(e,t,s){var o=_i;if(o&&typeof t=="string"&&t){var d=vn(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof s=="string"&&(d+='[crossorigin="'+s+'"]'),Tv.has(d)||(Tv.add(d),e={rel:e,crossOrigin:s,href:t},o.querySelector(d)===null&&(t=o.createElement("link"),Bt(t,"link",e),At(t),o.head.appendChild(t)))}}function gS(e){ha.D(e),kv("dns-prefetch",e,null)}function vS(e,t){ha.C(e,t),kv("preconnect",e,t)}function yS(e,t,s){ha.L(e,t,s);var o=_i;if(o&&e&&t){var d='link[rel="preload"][as="'+vn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(d+='[imagesrcset="'+vn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(d+='[imagesizes="'+vn(s.imageSizes)+'"]')):d+='[href="'+vn(e)+'"]';var h=d;switch(t){case"style":h=Si(e);break;case"script":h=Ti(e)}Cn.has(h)||(e=v({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Cn.set(h,e),o.querySelector(d)!==null||t==="style"&&o.querySelector(Io(h))||t==="script"&&o.querySelector(Lo(h))||(t=o.createElement("link"),Bt(t,"link",e),At(t),o.head.appendChild(t)))}}function bS(e,t){ha.m(e,t);var s=_i;if(s&&e){var o=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+vn(o)+'"][href="'+vn(e)+'"]',h=d;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ti(e)}if(!Cn.has(h)&&(e=v({rel:"modulepreload",href:e},t),Cn.set(h,e),s.querySelector(d)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Lo(h)))return}o=s.createElement("link"),Bt(o,"link",e),At(o),s.head.appendChild(o)}}}function xS(e,t,s){ha.S(e,t,s);var o=_i;if(o&&e){var d=$s(o).hoistableStyles,h=Si(e);t=t||"default";var _=d.get(h);if(!_){var T={loading:0,preload:null};if(_=o.querySelector(Io(h)))T.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Cn.get(h))&&Od(e,s);var w=_=o.createElement("link");At(w),Bt(w,"link",e),w._p=new Promise(function(V,Z){w.onload=V,w.onerror=Z}),w.addEventListener("load",function(){T.loading|=1}),w.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Nr(_,t,o)}_={type:"stylesheet",instance:_,count:1,state:T},d.set(h,_)}}}function _S(e,t){ha.X(e,t);var s=_i;if(s&&e){var o=$s(s).hoistableScripts,d=Ti(e),h=o.get(d);h||(h=s.querySelector(Lo(d)),h||(e=v({src:e,async:!0},t),(t=Cn.get(d))&&Bd(e,t),h=s.createElement("script"),At(h),Bt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(d,h))}}function SS(e,t){ha.M(e,t);var s=_i;if(s&&e){var o=$s(s).hoistableScripts,d=Ti(e),h=o.get(d);h||(h=s.querySelector(Lo(d)),h||(e=v({src:e,async:!0,type:"module"},t),(t=Cn.get(d))&&Bd(e,t),h=s.createElement("script"),At(h),Bt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(d,h))}}function Cv(e,t,s,o){var d=(d=he.current)?Er(d):null;if(!d)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Si(s.href),s=$s(d).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=Si(s.href);var h=$s(d).hoistableStyles,_=h.get(e);if(_||(d=d.ownerDocument||d,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,_),(h=d.querySelector(Io(e)))&&!h._p&&(_.instance=h,_.state.loading=5),Cn.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},Cn.set(e,s),h||TS(d,e,s,_.state))),t&&o===null)throw Error(l(528,""));return _}if(t&&o!==null)throw Error(l(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ti(s),s=$s(d).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 Si(e){return'href="'+vn(e)+'"'}function Io(e){return'link[rel="stylesheet"]['+e+"]"}function Ev(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function TS(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}),Bt(t,"link",s),At(t),e.head.appendChild(t))}function Ti(e){return'[src="'+vn(e)+'"]'}function Lo(e){return"script[async]"+e}function Nv(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+vn(s.href)+'"]');if(o)return t.instance=o,At(o),o;var d=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),At(o),Bt(o,"style",d),Nr(o,s.precedence,e),t.instance=o;case"stylesheet":d=Si(s.href);var h=e.querySelector(Io(d));if(h)return t.state.loading|=4,t.instance=h,At(h),h;o=Ev(s),(d=Cn.get(d))&&Od(o,d),h=(e.ownerDocument||e).createElement("link"),At(h);var _=h;return _._p=new Promise(function(T,w){_.onload=T,_.onerror=w}),Bt(h,"link",o),t.state.loading|=4,Nr(h,s.precedence,e),t.instance=h;case"script":return h=Ti(s.src),(d=e.querySelector(Lo(h)))?(t.instance=d,At(d),d):(o=s,(d=Cn.get(h))&&(o=v({},s),Bd(o,d)),e=e.ownerDocument||e,d=e.createElement("script"),At(d),Bt(d,"link",o),e.head.appendChild(d),t.instance=d);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,Nr(o,s.precedence,e));return t.instance}function Nr(e,t,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=o.length?o[o.length-1]:null,h=d,_=0;_<o.length;_++){var T=o[_];if(T.dataset.precedence===t)h=T;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Od(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Bd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ar=null;function Av(e,t,s){if(Ar===null){var o=new Map,d=Ar=new Map;d.set(s,o)}else d=Ar,o=d.get(s),o||(o=new Map,d.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),d=0;d<s.length;d++){var h=s[d];if(!(h[Wi]||h[Dt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(t)||"";_=e+_;var T=o.get(_);T?T.push(h):o.set(_,[h])}}return o}function wv(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function kS(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 jv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function CS(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 d=Si(o.href),h=t.querySelector(Io(d));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,At(h);return}h=t.ownerDocument||t,o=Ev(o),(d=Cn.get(d))&&Od(o,d),h=h.createElement("link"),At(h);var _=h;_._p=new Promise(function(T,w){_.onload=T,_.onerror=w}),Bt(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 Id=0;function ES(e,t){return e.stylesheets&&e.count===0&&Dr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var o=setTimeout(function(){if(e.stylesheets&&Dr(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Id===0&&(Id=62500*oS());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Dr(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Id?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(d)}}:null}function wr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var jr=null;function Dr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,jr=new Map,t.forEach(NS,e),jr=null,wr.call(e))}function NS(e,t){if(!(t.state.loading&4)){var s=jr.get(e);if(s)var o=s.get(null);else{s=new Map,jr.set(e,s);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var _=d[h];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),o=_)}o&&s.set(null,o)}d=t.instance,_=d.getAttribute("data-precedence"),h=s.get(_)||o,h===o&&s.set(null,d),s.set(_,d),this.count++,o=wr.bind(this),d.addEventListener("load",o),d.addEventListener("error",o),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Uo={$$typeof:D,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function AS(e,t,s,o,d,h,_,T,w){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=Dc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dc(0),this.hiddenUpdates=Dc(null),this.identifierPrefix=o,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function Dv(e,t,s,o,d,h,_,T,w,V,Z,J){return e=new AS(e,t,s,_,w,V,Z,J,T),t=1,h===!0&&(t|=24),h=nn(3,null,null,t),e.current=h,h.stateNode=e,t=mu(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:o,isDehydrated:s,cache:t},bu(h),e}function Mv(e){return e?(e=ei,e):ei}function Rv(e,t,s,o,d,h){d=Mv(d),o.context===null?o.context=d:o.pendingContext=d,o=Da(t),o.payload={element:s},h=h===void 0?null:h,h!==null&&(o.callback=h),s=Ma(e,o,t),s!==null&&(Wt(s,e,t),go(s,e,t))}function Ov(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Ld(e,t){Ov(e,t),(e=e.alternate)&&Ov(e,t)}function Bv(e){if(e.tag===13||e.tag===31){var t=us(e,67108864);t!==null&&Wt(t,e,67108864),Ld(e,67108864)}}function Iv(e){if(e.tag===13||e.tag===31){var t=rn();t=Mc(t);var s=us(e,t);s!==null&&Wt(s,e,t),Ld(e,t)}}var Mr=!0;function wS(e,t,s,o){var d=B.T;B.T=null;var h=H.p;try{H.p=2,Ud(e,t,s,o)}finally{H.p=h,B.T=d}}function jS(e,t,s,o){var d=B.T;B.T=null;var h=H.p;try{H.p=8,Ud(e,t,s,o)}finally{H.p=h,B.T=d}}function Ud(e,t,s,o){if(Mr){var d=zd(o);if(d===null)kd(e,t,o,Rr,s),Uv(e,o);else if(MS(d,e,t,s,o))o.stopPropagation();else if(Uv(e,o),t&4&&-1<DS.indexOf(e)){for(;d!==null;){var h=Ps(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=is(h.pendingLanes);if(_!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;_;){var w=1<<31-qe(_);T.entanglements[1]|=w,_&=~w}Vn(h),(Ve&6)===0&&(mr=Lt()+500,Mo(0))}}break;case 31:case 13:T=us(h,2),T!==null&&Wt(T,h,2),vr(),Ld(h,2)}if(h=zd(o),h===null&&kd(e,t,o,Rr,s),h===d)break;d=h}d!==null&&o.stopPropagation()}else kd(e,t,o,null,s)}}function zd(e){return e=Hc(e),Vd(e)}var Rr=null;function Vd(e){if(Rr=null,e=Gs(e),e!==null){var t=u(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=f(t),e!==null)return e;e=null}else if(s===31){if(e=p(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Rr=e,null}function Lv(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(jc()){case Q:return 2;case oe:return 8;case ce:case _e:return 32;case xe:return 268435456;default:return 32}default:return 32}}var Hd=!1,Pa=null,$a=null,Fa=null,zo=new Map,Vo=new Map,qa=[],DS="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 Uv(e,t){switch(e){case"focusin":case"focusout":Pa=null;break;case"dragenter":case"dragleave":$a=null;break;case"mouseover":case"mouseout":Fa=null;break;case"pointerover":case"pointerout":zo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vo.delete(t.pointerId)}}function Ho(e,t,s,o,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:o,nativeEvent:h,targetContainers:[d]},t!==null&&(t=Ps(t),t!==null&&Bv(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function MS(e,t,s,o,d){switch(t){case"focusin":return Pa=Ho(Pa,e,t,s,o,d),!0;case"dragenter":return $a=Ho($a,e,t,s,o,d),!0;case"mouseover":return Fa=Ho(Fa,e,t,s,o,d),!0;case"pointerover":var h=d.pointerId;return zo.set(h,Ho(zo.get(h)||null,e,t,s,o,d)),!0;case"gotpointercapture":return h=d.pointerId,Vo.set(h,Ho(Vo.get(h)||null,e,t,s,o,d)),!0}return!1}function zv(e){var t=Gs(e.target);if(t!==null){var s=u(t);if(s!==null){if(t=s.tag,t===13){if(t=f(s),t!==null){e.blockedOn=t,Jh(e.priority,function(){Iv(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,Jh(e.priority,function(){Iv(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Or(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=zd(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);Vc=o,s.target.dispatchEvent(o),Vc=null}else return t=Ps(s),t!==null&&Bv(t),e.blockedOn=s,!1;t.shift()}return!0}function Vv(e,t,s){Or(e)&&s.delete(t)}function RS(){Hd=!1,Pa!==null&&Or(Pa)&&(Pa=null),$a!==null&&Or($a)&&($a=null),Fa!==null&&Or(Fa)&&(Fa=null),zo.forEach(Vv),Vo.forEach(Vv)}function Br(e,t){e.blockedOn===t&&(e.blockedOn=null,Hd||(Hd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,RS)))}var Ir=null;function Hv(e){Ir!==e&&(Ir=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ir===e&&(Ir=null);for(var t=0;t<e.length;t+=3){var s=e[t],o=e[t+1],d=e[t+2];if(typeof o!="function"){if(Vd(o||s)===null)continue;break}var h=Ps(s);h!==null&&(e.splice(t,3),t-=3,zu(h,{pending:!0,data:d,method:s.method,action:o},o,d))}}))}function ki(e){function t(w){return Br(w,e)}Pa!==null&&Br(Pa,e),$a!==null&&Br($a,e),Fa!==null&&Br(Fa,e),zo.forEach(t),Vo.forEach(t);for(var s=0;s<qa.length;s++){var o=qa[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<qa.length&&(s=qa[0],s.blockedOn===null);)zv(s),s.blockedOn===null&&qa.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var d=s[o],h=s[o+1],_=d[qt]||null;if(typeof h=="function")_||Hv(s);else if(_){var T=null;if(h&&h.hasAttribute("formAction")){if(d=h,_=h[qt]||null)T=_.formAction;else if(Vd(d)!==null)continue}else T=_.action;typeof T=="function"?s[o+1]=T:(s.splice(o,3),o-=3),Hv(s)}}}function Gv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(_){return d=_})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),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,d=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),d!==null&&(d(),d=null)}}}function Gd(e){this._internalRoot=e}Lr.prototype.render=Gd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var s=t.current,o=rn();Rv(s,o,e,t,null,null)},Lr.prototype.unmount=Gd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Rv(e.current,2,null,e,null,null),vr(),t[Hs]=null}};function Lr(e){this._internalRoot=e}Lr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Wh();e={blockedOn:null,target:e,priority:t};for(var s=0;s<qa.length&&t!==0&&t<qa[s].priority;s++);qa.splice(s,0,e),s===0&&zv(e)}};var Pv=a.version;if(Pv!=="19.2.4")throw Error(l(527,Pv,"19.2.4"));H.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=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var OS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ur=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ur.isDisabled&&Ur.supportsFiber)try{ht=Ur.inject(OS),Ee=Ur}catch{}}return Go.createRoot=function(e,t){if(!r(e))throw Error(l(299));var s=!1,o="",d=Xm,h=Qm,_=Wm;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(_=t.onRecoverableError)),t=Dv(e,1,!1,null,null,s,o,null,d,h,_,Gv),e[Hs]=t.current,Td(e),new Gd(t)},Go.hydrateRoot=function(e,t,s){if(!r(e))throw Error(l(299));var o=!1,d="",h=Xm,_=Qm,T=Wm,w=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(T=s.onRecoverableError),s.formState!==void 0&&(w=s.formState)),t=Dv(e,1,!0,t,s??null,o,d,w,h,_,T,Gv),t.context=Mv(null),s=t.current,o=rn(),o=Mc(o),d=Da(o),d.callback=null,Ma(s,d,o),s=o,t.current.lanes=s,Qi(t,s),Vn(t),e[Hs]=t.current,Td(e),new Lr(t)},Go.version="19.2.4",Go}var Xv;function XS(){if(Xv)return Pd.exports;Xv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Pd.exports=ZS(),Pd.exports}var QS=XS();function Ft(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function ll(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function WS(n){return Ft(n)&&typeof n.id=="string"&&typeof n.type=="string"&&typeof n.timestamp=="string"&&Ft(n.payload)}function JS(n){return Ft(n)&&typeof n.id=="string"&&typeof n.displayName=="string"&&typeof n.adapterType=="string"&&typeof n.status=="string"&&typeof n.bootstrapped=="boolean"&&(typeof n.adapterConfig=="string"||n.adapterConfig===void 0)}function eT(n){return{...n,adapterConfig:n.adapterConfig??"{}"}}function Qv(n){return Ft(n)&&typeof n.id=="string"&&typeof n.environmentId=="string"&&typeof n.runtime=="string"&&typeof n.status=="string"&&typeof n.prompt=="string"&&typeof n.startedAt=="string"&&(n.endedAt===void 0||typeof n.endedAt=="string")&&(n.error===void 0||typeof n.error=="string")}function Wv(n){return Ft(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")}function tT(n){return Ft(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.repoUrl=="string"&&typeof n.environmentId=="string"&&typeof n.status=="string"&&typeof n.worktreeBasePath=="string"&&typeof n.useWorktrees=="boolean"&&(n.defaultPersonaId===void 0||typeof n.defaultPersonaId=="string")&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"}function nT(n){return Ft(n)&&typeof n.id=="string"&&(typeof n.workspaceId=="string"||n.workspaceId===void 0)&&typeof n.title=="string"&&typeof n.status=="string"&&typeof n.branch=="string"&&typeof n.sortOrder=="number"&&typeof n.depth=="number"&&(n.defaultPersonaId===void 0||typeof n.defaultPersonaId=="string")&&Array.isArray(n.dependsOn)&&Array.isArray(n.childTaskIds)}function aT(n){return Ft(n)&&typeof n.id=="string"&&typeof n.workspaceId=="string"&&typeof n.taskId=="string"&&typeof n.sessionId=="string"&&typeof n.category=="string"&&typeof n.title=="string"&&typeof n.content=="string"&&Array.isArray(n.tags)&&typeof n.createdAt=="string"}function sT(n){return Ft(n)&&typeof n.name=="string"&&typeof n.tokenType=="string"&&typeof n.envVar=="string"&&typeof n.filePath=="string"&&typeof n.expiresAt=="string"}const iT=new Set(["off","subscription","api_key"]),Vr=new Set(["off","on"]);function Jv(n){return Ft(n)&&iT.has(n.claude)&&Vr.has(n.github)&&Vr.has(n.copilot)&&Vr.has(n.codex)&&Vr.has(n.goose)}function oT(n){return Ft(n)&&typeof n.name=="string"&&typeof n.repository=="string"&&typeof n.state=="string"&&typeof n.gitStatus=="string"}function lT(n){return Ft(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.systemPrompt=="string"&&typeof n.toolConfig=="string"&&typeof n.runtime=="string"&&typeof n.model=="string"&&typeof n.maxTurns=="number"&&typeof n.mcpServers=="string"&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"&&typeof n.type=="string"&&typeof n.script=="string"}function Fn(n,a,i,l){return Array.isArray(n)?n.filter((r,u)=>a(r)?!0:(ll(i,`item at index ${u} in "${l}" has unexpected shape`),!1)):(ll(i,`expected "${l}" to be an array, got ${typeof n}`),[])}function rT(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!Ft(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:Ft(a.payload)?a.payload:{}}:{type:a.type,payload:Ft(a.payload)?a.payload:void 0}}function cT(n){switch(n){case"waiting_input":return"idle";case"killed":return"interrupted";default:return n}}const uT=3e3,Ci=5e3,dT=4001;/**
|
|
26
|
-
* react-router v7.13.1
|
|
27
|
-
*
|
|
28
|
-
* Copyright (c) Remix Software Inc.
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the MIT license found in the
|
|
31
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
32
|
-
*
|
|
33
|
-
* @license MIT
|
|
34
|
-
*/var ey="popstate";function ty(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function fT(n={}){function a(l,r){var g;let u=(g=r.state)==null?void 0:g.masked,{pathname:f,search:p,hash:m}=u||l.location;return yf("",{pathname:f,search:p,hash:m},r.state&&r.state.usr||null,r.state&&r.state.key||"default",u?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,r){return typeof r=="string"?r:rl(r)}return pT(a,i,null,n)}function at(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function An(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function hT(){return Math.random().toString(36).substring(2,10)}function ny(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 yf(n,a,i=null,l,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Hi(a):a,state:i,key:a&&a.key||l||hT(),unstable_mask:r}}function rl({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 Hi(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 pT(n,a,i,l={}){let{window:r=document.defaultView,v5Compat:u=!1}=l,f=r.history,p="POP",m=null,g=y();g==null&&(g=0,f.replaceState({...f.state,idx:g},""));function y(){return(f.state||{idx:null}).idx}function v(){p="POP";let N=y(),E=N==null?null:N-g;g=N,m&&m({action:p,location:C.location,delta:E})}function b(N,E){p="PUSH";let A=ty(N)?N:yf(C.location,N,E);g=y()+1;let D=ny(A,g),M=C.createHref(A.unstable_mask||A);try{f.pushState(D,"",M)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;r.location.assign(M)}u&&m&&m({action:p,location:C.location,delta:1})}function S(N,E){p="REPLACE";let A=ty(N)?N:yf(C.location,N,E);g=y();let D=ny(A,g),M=C.createHref(A.unstable_mask||A);f.replaceState(D,"",M),u&&m&&m({action:p,location:C.location,delta:0})}function k(N){return mT(N)}let C={get action(){return p},get location(){return n(r,f)},listen(N){if(m)throw new Error("A history only accepts one active listener");return r.addEventListener(ey,v),m=N,()=>{r.removeEventListener(ey,v),m=null}},createHref(N){return a(r,N)},createURL:k,encodeLocation(N){let E=k(N);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:b,replace:S,go(N){return f.go(N)}};return C}function mT(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),at(i,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:rl(n);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}function Z0(n,a,i="/"){return gT(n,a,i,!1)}function gT(n,a,i,l){let r=typeof a=="string"?Hi(a):a,u=ya(r.pathname||"/",i);if(u==null)return null;let f=X0(n);vT(f);let p=null;for(let m=0;p==null&&m<f.length;++m){let g=W0(u);p=ET(f[m],g,l)}return p}function X0(n,a=[],i=[],l="",r=!1){let u=(f,p,m=r,g)=>{let y={relativePath:g===void 0?f.path||"":g,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(l)&&m)return;at(y.relativePath.startsWith(l),`Absolute route path "${y.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(l.length)}let v=qn([l,y.relativePath]),b=i.concat(y);f.children&&f.children.length>0&&(at(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),X0(f.children,a,b,v,m)),!(f.path==null&&!f.index)&&a.push({path:v,score:kT(v,f.index),routesMeta:b})};return n.forEach((f,p)=>{var m;if(f.path===""||!((m=f.path)!=null&&m.includes("?")))u(f,p);else for(let g of Q0(f.path))u(f,p,!0,g)}),a}function Q0(n){let a=n.split("/");if(a.length===0)return[];let[i,...l]=a,r=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return r?[u,""]:[u];let f=Q0(l.join("/")),p=[];return p.push(...f.map(m=>m===""?u:[u,m].join("/"))),r&&p.push(...f),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function vT(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:CT(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var yT=/^:[\w-]+$/,bT=3,xT=2,_T=1,ST=10,TT=-2,ay=n=>n==="*";function kT(n,a){let i=n.split("/"),l=i.length;return i.some(ay)&&(l+=TT),a&&(l+=xT),i.filter(r=>!ay(r)).reduce((r,u)=>r+(yT.test(u)?bT:u===""?_T:ST),l)}function CT(n,a){return n.length===a.length&&n.slice(0,-1).every((l,r)=>l===a[r])?n[n.length-1]-a[a.length-1]:0}function ET(n,a,i=!1){let{routesMeta:l}=n,r={},u="/",f=[];for(let p=0;p<l.length;++p){let m=l[p],g=p===l.length-1,y=u==="/"?a:a.slice(u.length)||"/",v=cl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},y),b=m.route;if(!v&&g&&i&&!l[l.length-1].route.index&&(v=cl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!v)return null;Object.assign(r,v.params),f.push({params:r,pathname:qn([u,v.pathname]),pathnameBase:DT(qn([u,v.pathnameBase])),route:b}),v.pathnameBase!=="/"&&(u=qn([u,v.pathnameBase]))}return f}function cl(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,l]=NT(n.path,n.caseSensitive,n.end),r=a.match(i);if(!r)return null;let u=r[0],f=u.replace(/(.)\/+$/,"$1"),p=r.slice(1);return{params:l.reduce((g,{paramName:y,isOptional:v},b)=>{if(y==="*"){let k=p[b]||"";f=u.slice(0,u.length-k.length).replace(/(.)\/+$/,"$1")}const S=p[b];return v&&!S?g[y]=void 0:g[y]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:n}}function NT(n,a=!1,i=!0){An(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=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,m,g,y)=>{if(l.push({paramName:p,isOptional:m!=null}),m){let v=y.charAt(g+f.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(l.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,a?void 0:"i"),l]}function W0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return An(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function ya(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=n.charAt(i);return l&&l!=="/"?null:n.slice(i)||"/"}var AT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function wT(n,a="/"){let{pathname:i,search:l="",hash:r=""}=typeof n=="string"?Hi(n):n,u;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?u=sy(i.substring(1),"/"):u=sy(i,a)):u=a,{pathname:u,search:MT(l),hash:RT(r)}}function sy(n,a){let i=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?i.length>1&&i.pop():r!=="."&&i.push(r)}),i.length>1?i.join("/"):"/"}function qd(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 vc(n,a,i,l=!1){let r;typeof n=="string"?r=Hi(n):(r={...n},at(!r.pathname||!r.pathname.includes("?"),qd("?","pathname","search",r)),at(!r.pathname||!r.pathname.includes("#"),qd("#","pathname","hash",r)),at(!r.search||!r.search.includes("#"),qd("#","search","hash",r)));let u=n===""||r.pathname==="",f=u?"/":r.pathname,p;if(f==null)p=i;else{let v=a.length-1;if(!l&&f.startsWith("..")){let b=f.split("/");for(;b[0]==="..";)b.shift(),v-=1;r.pathname=b.join("/")}p=v>=0?a[v]:"/"}let m=wT(r,p),g=f&&f!=="/"&&f.endsWith("/"),y=(u||f===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(g||y)&&(m.pathname+="/"),m}var qn=n=>n.join("/").replace(/\/\/+/g,"/"),DT=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),MT=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,RT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,OT=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 BT(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function IT(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var J0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function eb(n,a){let i=n;if(typeof i!="string"||!AT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,r=!1;if(J0)try{let u=new URL(window.location.href),f=i.startsWith("//")?new URL(u.protocol+i):new URL(i),p=ya(f.pathname,a);f.origin===u.origin&&p!=null?i=p+f.search+f.hash:r=!0}catch{An(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:r,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var tb=["POST","PUT","PATCH","DELETE"];new Set(tb);var LT=["GET",...tb];new Set(LT);var Gi=x.createContext(null);Gi.displayName="DataRouter";var yc=x.createContext(null);yc.displayName="DataRouterState";var UT=x.createContext(!1),nb=x.createContext({isTransitioning:!1});nb.displayName="ViewTransition";var zT=x.createContext(new Map);zT.displayName="Fetchers";var VT=x.createContext(null);VT.displayName="Await";var hn=x.createContext(null);hn.displayName="Navigation";var vl=x.createContext(null);vl.displayName="Location";var wn=x.createContext({outlet:null,matches:[],isDataRoute:!1});wn.displayName="Route";var Wf=x.createContext(null);Wf.displayName="RouteError";var ab="REACT_ROUTER_ERROR",HT="REDIRECT",GT="ROUTE_ERROR_RESPONSE";function PT(n){if(n.startsWith(`${ab}:${HT}:{`))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 $T(n){if(n.startsWith(`${ab}:${GT}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new OT(a.status,a.statusText,a.data)}catch{}}function FT(n,{relative:a}={}){at(Rs(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=x.useContext(hn),{hash:r,pathname:u,search:f}=yl(n,{relative:a}),p=u;return i!=="/"&&(p=u==="/"?i:qn([i,u])),l.createHref({pathname:p,search:f,hash:r})}function Rs(){return x.useContext(vl)!=null}function Nt(){return at(Rs(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(vl).location}function St(n){at(Rs(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=Nt();return x.useMemo(()=>cl(n,W0(a)),[a,n])}var sb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ib(n){x.useContext(hn).static||x.useLayoutEffect(n)}function bc(){let{isDataRoute:n}=x.useContext(wn);return n?ok():qT()}function qT(){at(Rs(),"useNavigate() may be used only in the context of a <Router> component.");let n=x.useContext(Gi),{basename:a,navigator:i}=x.useContext(hn),{matches:l}=x.useContext(wn),{pathname:r}=Nt(),u=JSON.stringify(Qf(l)),f=x.useRef(!1);return ib(()=>{f.current=!0}),x.useCallback((m,g={})=>{if(An(f.current,sb),!f.current)return;if(typeof m=="number"){i.go(m);return}let y=vc(m,JSON.parse(u),r,g.relative==="path");n==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:qn([a,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[a,i,u,r,n])}var YT=x.createContext(null);function KT(n){let a=x.useContext(wn).outlet;return x.useMemo(()=>a&&x.createElement(YT.Provider,{value:n},a),[a,n])}function ns(){let{matches:n}=x.useContext(wn),a=n[n.length-1];return a?a.params:{}}function yl(n,{relative:a}={}){let{matches:i}=x.useContext(wn),{pathname:l}=Nt(),r=JSON.stringify(Qf(i));return x.useMemo(()=>vc(n,JSON.parse(r),l,a==="path"),[n,r,l,a])}function ZT(n,a){return ob(n,a)}function ob(n,a,i){var N;at(Rs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=x.useContext(hn),{matches:r}=x.useContext(wn),u=r[r.length-1],f=u?u.params:{},p=u?u.pathname:"/",m=u?u.pathnameBase:"/",g=u&&u.route;{let E=g&&g.path||"";rb(p,!g||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${E}">) 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.
|
|
35
|
-
|
|
36
|
-
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=Nt(),v;if(a){let E=typeof a=="string"?Hi(a):a;at(m==="/"||((N=E.pathname)==null?void 0:N.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=y;let b=v.pathname||"/",S=b;if(m!=="/"){let E=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=Z0(n,{pathname:S});An(g||k!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),An(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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=ek(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},f,E.params),pathname:qn([m,l.encodeLocation?l.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:qn([m,l.encodeLocation?l.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),r,i);return a&&C?x.createElement(vl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},C):C}function XT(){let n=ik(),a=BT(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)",r={padding:"0.5rem",backgroundColor:l},u={padding:"2px 4px",backgroundColor:l},f=null;return console.error("Error handled by React Router default ErrorBoundary:",n),f=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:u},"ErrorBoundary")," or"," ",x.createElement("code",{style:u},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},a),i?x.createElement("pre",{style:r},i):null,f)}var QT=x.createElement(XT,null),lb=class extends x.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=$T(n.digest);i&&(n=i)}let a=n!==void 0?x.createElement(wn.Provider,{value:this.props.routeContext},x.createElement(Wf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?x.createElement(WT,{error:n},a):a}};lb.contextType=UT;var Yd=new WeakMap;function WT({children:n,error:a}){let{basename:i}=x.useContext(hn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=PT(a.digest);if(l){let r=Yd.get(a);if(r)throw r;let u=eb(l.location,i);if(J0&&!Yd.get(a))if(u.isExternal||l.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:l.replace}));throw Yd.set(a,f),f}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return n}function JT({routeContext:n,match:a,children:i}){let l=x.useContext(Gi);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),x.createElement(wn.Provider,{value:n},i)}function ek(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 r=n,u=l==null?void 0:l.errors;if(u!=null){let y=r.findIndex(v=>v.route.id&&(u==null?void 0:u[v.route.id])!==void 0);at(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),r=r.slice(0,Math.min(r.length,y+1))}let f=!1,p=-1;if(i&&l){f=l.renderFallback;for(let y=0;y<r.length;y++){let v=r[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(p=y),v.route.id){let{loaderData:b,errors:S}=l,k=v.route.loader&&!b.hasOwnProperty(v.route.id)&&(!S||S[v.route.id]===void 0);if(v.route.lazy||k){i.isStatic&&(f=!0),p>=0?r=r.slice(0,p+1):r=[r[0]];break}}}}let m=i==null?void 0:i.onError,g=l&&m?(y,v)=>{var b,S;m(y,{location:l.location,params:((S=(b=l.matches)==null?void 0:b[0])==null?void 0:S.params)??{},unstable_pattern:IT(l.matches),errorInfo:v})}:void 0;return r.reduceRight((y,v,b)=>{let S,k=!1,C=null,N=null;l&&(S=u&&v.route.id?u[v.route.id]:void 0,C=v.route.errorElement||QT,f&&(p<0&&b===0?(rb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,N=null):p===b&&(k=!0,N=v.route.hydrateFallbackElement||null)));let E=a.concat(r.slice(0,b+1)),A=()=>{let D;return S?D=C:k?D=N:v.route.Component?D=x.createElement(v.route.Component,null):v.route.element?D=v.route.element:D=y,x.createElement(JT,{match:v,routeContext:{outlet:y,matches:E,isDataRoute:l!=null},children:D})};return l&&(v.route.ErrorBoundary||v.route.errorElement||b===0)?x.createElement(lb,{location:l.location,revalidation:l.revalidation,component:C,error:S,children:A(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:g}):A()},null)}function Jf(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tk(n){let a=x.useContext(Gi);return at(a,Jf(n)),a}function nk(n){let a=x.useContext(yc);return at(a,Jf(n)),a}function ak(n){let a=x.useContext(wn);return at(a,Jf(n)),a}function eh(n){let a=ak(n),i=a.matches[a.matches.length-1];return at(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function sk(){return eh("useRouteId")}function ik(){var l;let n=x.useContext(Wf),a=nk("useRouteError"),i=eh("useRouteError");return n!==void 0?n:(l=a.errors)==null?void 0:l[i]}function ok(){let{router:n}=tk("useNavigate"),a=eh("useNavigate"),i=x.useRef(!1);return ib(()=>{i.current=!0}),x.useCallback(async(r,u={})=>{An(i.current,sb),i.current&&(typeof r=="number"?await n.navigate(r):await n.navigate(r,{fromRouteId:a,...u}))},[n,a])}var iy={};function rb(n,a,i){!a&&!iy[n]&&(iy[n]=!0,An(!1,i))}x.memo(lk);function lk({routes:n,future:a,state:i,isStatic:l,onError:r}){return ob(n,void 0,{state:i,isStatic:l,onError:r})}function Gn({to:n,replace:a,state:i,relative:l}){at(Rs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=x.useContext(hn);An(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=x.useContext(wn),{pathname:f}=Nt(),p=bc(),m=vc(n,Qf(u),f,l==="path"),g=JSON.stringify(m);return x.useEffect(()=>{p(JSON.parse(g),{replace:a,state:i,relative:l})},[p,g,l,a,i]),null}function th(n){return KT(n.context)}function je(n){at(!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 rk({basename:n="/",children:a=null,location:i,navigationType:l="POP",navigator:r,static:u=!1,unstable_useTransitions:f}){at(!Rs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:p,navigator:r,static:u,unstable_useTransitions:f,future:{}}),[p,r,u,f]);typeof i=="string"&&(i=Hi(i));let{pathname:g="/",search:y="",hash:v="",state:b=null,key:S="default",unstable_mask:k}=i,C=x.useMemo(()=>{let N=ya(g,p);return N==null?null:{location:{pathname:N,search:y,hash:v,state:b,key:S,unstable_mask:k},navigationType:l}},[p,g,y,v,b,S,l,k]);return An(C!=null,`<Router basename="${p}"> is not able to match the URL "${g}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:x.createElement(hn.Provider,{value:m},x.createElement(vl.Provider,{children:a,value:C}))}function ck({children:n,location:a}){return ZT(bf(n),a)}function bf(n,a=[]){let i=[];return x.Children.forEach(n,(l,r)=>{if(!x.isValidElement(l))return;let u=[...a,r];if(l.type===x.Fragment){i.push.apply(i,bf(l.props.children,u));return}at(l.type===je,`[${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>`),at(!l.props.index||!l.props.children,"An index route cannot have child routes.");let f={id:l.props.id||u.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=bf(l.props.children,u)),i.push(f)}),i}var Qr="get",Wr="application/x-www-form-urlencoded";function xc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function uk(n){return xc(n)&&n.tagName.toLowerCase()==="button"}function dk(n){return xc(n)&&n.tagName.toLowerCase()==="form"}function fk(n){return xc(n)&&n.tagName.toLowerCase()==="input"}function hk(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function pk(n,a){return n.button===0&&(!a||a==="_self")&&!hk(n)}function xf(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(r=>[i,r]):[[i,l]])},[]))}function mk(n,a){let i=xf(n);return a&&a.forEach((l,r)=>{i.has(r)||a.getAll(r).forEach(u=>{i.append(r,u)})}),i}var Hr=null;function gk(){if(Hr===null)try{new FormData(document.createElement("form"),0),Hr=!1}catch{Hr=!0}return Hr}var vk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Kd(n){return n!=null&&!vk.has(n)?(An(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Wr}"`),null):n}function yk(n,a){let i,l,r,u,f;if(dk(n)){let p=n.getAttribute("action");l=p?ya(p,a):null,i=n.getAttribute("method")||Qr,r=Kd(n.getAttribute("enctype"))||Wr,u=new FormData(n)}else if(uk(n)||fk(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=n.getAttribute("formaction")||p.getAttribute("action");if(l=m?ya(m,a):null,i=n.getAttribute("formmethod")||p.getAttribute("method")||Qr,r=Kd(n.getAttribute("formenctype"))||Kd(p.getAttribute("enctype"))||Wr,u=new FormData(p,n),!gk()){let{name:g,type:y,value:v}=n;if(y==="image"){let b=g?`${g}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else g&&u.append(g,v)}}else{if(xc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Qr,l=null,r=Wr,f=n}return u&&r==="text/plain"&&(f=u,u=void 0),{action:l,method:i.toLowerCase(),encType:r,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function nh(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function bk(n,a,i,l){let r=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${l}`:r.pathname=`${r.pathname}.${l}`:r.pathname==="/"?r.pathname=`_root.${l}`:a&&ya(r.pathname,a)==="/"?r.pathname=`${a.replace(/\/$/,"")}/_root.${l}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${l}`,r}async function xk(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 _k(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 Sk(n,a,i){let l=await Promise.all(n.map(async r=>{let u=a.routes[r.route.id];if(u){let f=await xk(u,i);return f.links?f.links():[]}return[]}));return Ek(l.flat(1).filter(_k).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function oy(n,a,i,l,r,u){let f=(m,g)=>i[g]?m.route.id!==i[g].route.id:!0,p=(m,g)=>{var y;return i[g].pathname!==m.pathname||((y=i[g].route.path)==null?void 0:y.endsWith("*"))&&i[g].params["*"]!==m.params["*"]};return u==="assets"?a.filter((m,g)=>f(m,g)||p(m,g)):u==="data"?a.filter((m,g)=>{var v;let y=l.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(f(m,g)||p(m,g))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((v=i[0])==null?void 0:v.params)||{},nextUrl:new URL(n,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function Tk(n,a,{includeHydrateFallback:i}={}){return kk(n.map(l=>{let r=a.routes[l.route.id];if(!r)return[];let u=[r.module];return r.clientActionModule&&(u=u.concat(r.clientActionModule)),r.clientLoaderModule&&(u=u.concat(r.clientLoaderModule)),i&&r.hydrateFallbackModule&&(u=u.concat(r.hydrateFallbackModule)),r.imports&&(u=u.concat(r.imports)),u}).flat(1))}function kk(n){return[...new Set(n)]}function Ck(n){let a={},i=Object.keys(n).sort();for(let l of i)a[l]=n[l];return a}function Ek(n,a){let i=new Set;return new Set(a),n.reduce((l,r)=>{let u=JSON.stringify(Ck(r));return i.has(u)||(i.add(u),l.push({key:u,link:r})),l},[])}function cb(){let n=x.useContext(Gi);return nh(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Nk(){let n=x.useContext(yc);return nh(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var ah=x.createContext(void 0);ah.displayName="FrameworkContext";function ub(){let n=x.useContext(ah);return nh(n,"You must render this element inside a <HydratedRouter> element"),n}function Ak(n,a){let i=x.useContext(ah),[l,r]=x.useState(!1),[u,f]=x.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:y,onTouchStart:v}=a,b=x.useRef(null);x.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let C=E=>{E.forEach(A=>{f(A.isIntersecting)})},N=new IntersectionObserver(C,{threshold:.5});return b.current&&N.observe(b.current),()=>{N.disconnect()}}},[n]),x.useEffect(()=>{if(l){let C=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(C)}}},[l]);let S=()=>{r(!0)},k=()=>{r(!1),f(!1)};return i?n!=="intent"?[u,b,{}]:[u,b,{onFocus:Po(p,S),onBlur:Po(m,k),onMouseEnter:Po(g,S),onMouseLeave:Po(y,k),onTouchStart:Po(v,S)}]:[!1,b,{}]}function Po(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function wk({page:n,...a}){let{router:i}=cb(),l=x.useMemo(()=>Z0(i.routes,n,i.basename),[i.routes,n,i.basename]);return l?x.createElement(Dk,{page:n,matches:l,...a}):null}function jk(n){let{manifest:a,routeModules:i}=ub(),[l,r]=x.useState([]);return x.useEffect(()=>{let u=!1;return Sk(n,a,i).then(f=>{u||r(f)}),()=>{u=!0}},[n,a,i]),l}function Dk({page:n,matches:a,...i}){let l=Nt(),{future:r,manifest:u,routeModules:f}=ub(),{basename:p}=cb(),{loaderData:m,matches:g}=Nk(),y=x.useMemo(()=>oy(n,a,g,u,l,"data"),[n,a,g,u,l]),v=x.useMemo(()=>oy(n,a,g,u,l,"assets"),[n,a,g,u,l]),b=x.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let C=new Set,N=!1;if(a.forEach(A=>{var M;let D=u.routes[A.route.id];!D||!D.hasLoader||(!y.some(j=>j.route.id===A.route.id)&&A.route.id in m&&((M=f[A.route.id])!=null&&M.shouldRevalidate)||D.hasClientLoader?N=!0:C.add(A.route.id))}),C.size===0)return[];let E=bk(n,p,r.unstable_trailingSlashAwareDataRequests,"data");return N&&C.size>0&&E.searchParams.set("_routes",a.filter(A=>C.has(A.route.id)).map(A=>A.route.id).join(",")),[E.pathname+E.search]},[p,r.unstable_trailingSlashAwareDataRequests,m,l,u,y,a,n,f]),S=x.useMemo(()=>Tk(v,u),[v,u]),k=jk(v);return x.createElement(x.Fragment,null,b.map(C=>x.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...i})),S.map(C=>x.createElement("link",{key:C,rel:"modulepreload",href:C,...i})),k.map(({key:C,link:N})=>x.createElement("link",{key:C,nonce:i.nonce,...N,crossOrigin:N.crossOrigin??i.crossOrigin})))}function Mk(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var Rk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Rk&&(window.__reactRouterVersion="7.13.1")}catch{}function Ok({basename:n,children:a,unstable_useTransitions:i,window:l}){let r=x.useRef();r.current==null&&(r.current=fT({window:l,v5Compat:!0}));let u=r.current,[f,p]=x.useState({action:u.action,location:u.location}),m=x.useCallback(g=>{i===!1?p(g):x.startTransition(()=>p(g))},[i]);return x.useLayoutEffect(()=>u.listen(m),[u,m]),x.createElement(rk,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:u,unstable_useTransitions:i})}var db=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sh=x.forwardRef(function({onClick:a,discover:i="render",prefetch:l="none",relative:r,reloadDocument:u,replace:f,unstable_mask:p,state:m,target:g,to:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:S,...k},C){let{basename:N,navigator:E,unstable_useTransitions:A}=x.useContext(hn),D=typeof y=="string"&&db.test(y),M=eb(y,N);y=M.to;let j=FT(y,{relative:r}),K=Nt(),q=null;if(p){let te=vc(p,[],K.unstable_mask?K.unstable_mask.pathname:"/",!0);N!=="/"&&(te.pathname=te.pathname==="/"?N:qn([N,te.pathname])),q=E.createHref(te)}let[U,W,ee]=Ak(l,k),ie=Uk(y,{replace:f,unstable_mask:p,state:m,target:g,preventScrollReset:v,relative:r,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:A});function $(te){a&&a(te),te.defaultPrevented||ie(te)}let le=!(M.isExternal||u),F=x.createElement("a",{...k,...ee,href:(le?q:void 0)||M.absoluteURL||j,onClick:le?$:a,ref:Mk(C,W),target:g,"data-discover":!D&&i==="render"?"true":void 0});return U&&!D?x.createElement(x.Fragment,null,F,x.createElement(wk,{page:j})):F});sh.displayName="Link";var Bk=x.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:l="",end:r=!1,style:u,to:f,viewTransition:p,children:m,...g},y){let v=yl(f,{relative:g.relative}),b=Nt(),S=x.useContext(yc),{navigator:k,basename:C}=x.useContext(hn),N=S!=null&&Pk(v)&&p===!0,E=k.encodeLocation?k.encodeLocation(v).pathname:v.pathname,A=b.pathname,D=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(A=A.toLowerCase(),D=D?D.toLowerCase():null,E=E.toLowerCase()),D&&C&&(D=ya(D,C)||D);const M=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let j=A===E||!r&&A.startsWith(E)&&A.charAt(M)==="/",K=D!=null&&(D===E||!r&&D.startsWith(E)&&D.charAt(E.length)==="/"),q={isActive:j,isPending:K,isTransitioning:N},U=j?a:void 0,W;typeof l=="function"?W=l(q):W=[l,j?"active":null,K?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let ee=typeof u=="function"?u(q):u;return x.createElement(sh,{...g,"aria-current":U,className:W,ref:y,style:ee,to:f,viewTransition:p},typeof m=="function"?m(q):m)});Bk.displayName="NavLink";var Ik=x.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:l,replace:r,state:u,method:f=Qr,action:p,onSubmit:m,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:b,...S},k)=>{let{unstable_useTransitions:C}=x.useContext(hn),N=Hk(),E=Gk(p,{relative:g}),A=f.toLowerCase()==="get"?"get":"post",D=typeof p=="string"&&db.test(p),M=j=>{if(m&&m(j),j.defaultPrevented)return;j.preventDefault();let K=j.nativeEvent.submitter,q=(K==null?void 0:K.getAttribute("formmethod"))||f,U=()=>N(K||j.currentTarget,{fetcherKey:a,method:q,navigate:i,replace:r,state:u,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:b});C&&i!==!1?x.startTransition(()=>U()):U()};return x.createElement("form",{ref:k,method:A,action:E,onSubmit:l?m:M,...S,"data-discover":!D&&n==="render"?"true":void 0})});Ik.displayName="Form";function Lk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fb(n){let a=x.useContext(Gi);return at(a,Lk(n)),a}function Uk(n,{target:a,replace:i,unstable_mask:l,state:r,preventScrollReset:u,relative:f,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let y=bc(),v=Nt(),b=yl(n,{relative:f});return x.useCallback(S=>{if(pk(S,a)){S.preventDefault();let k=i!==void 0?i:rl(v)===rl(b),C=()=>y(n,{replace:k,unstable_mask:l,state:r,preventScrollReset:u,relative:f,viewTransition:p,unstable_defaultShouldRevalidate:m});g?x.startTransition(()=>C()):C()}},[v,y,b,i,l,r,a,n,u,f,p,m,g])}function hb(n){An(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=x.useRef(xf(n)),i=x.useRef(!1),l=Nt(),r=x.useMemo(()=>mk(l.search,i.current?null:a.current),[l.search]),u=bc(),f=x.useCallback((p,m)=>{const g=xf(typeof p=="function"?p(new URLSearchParams(r)):p);i.current=!0,u("?"+g,m)},[u,r]);return[r,f]}var zk=0,Vk=()=>`__${String(++zk)}__`;function Hk(){let{router:n}=fb("useSubmit"),{basename:a}=x.useContext(hn),i=sk(),l=n.fetch,r=n.navigate;return x.useCallback(async(u,f={})=>{let{action:p,method:m,encType:g,formData:y,body:v}=yk(u,a);if(f.navigate===!1){let b=f.fetcherKey||Vk();await l(b,i,f.action||p,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:y,body:v,formMethod:f.method||m,formEncType:f.encType||g,flushSync:f.flushSync})}else await r(f.action||p,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:y,body:v,formMethod:f.method||m,formEncType:f.encType||g,replace:f.replace,state:f.state,fromRouteId:i,flushSync:f.flushSync,viewTransition:f.viewTransition})},[l,r,a,i])}function Gk(n,{relative:a}={}){let{basename:i}=x.useContext(hn),l=x.useContext(wn);at(l,"useFormAction must be used inside a RouteContext");let[r]=l.matches.slice(-1),u={...yl(n||".",{relative:a})},f=Nt();if(n==null){u.search=f.search;let p=new URLSearchParams(u.search),m=p.getAll("index");if(m.some(y=>y==="")){p.delete("index"),m.filter(v=>v).forEach(v=>p.append("index",v));let y=p.toString();u.search=y?`?${y}`:""}}return(!n||n===".")&&r.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:qn([i,u.pathname])),rl(u)}function Pk(n,{relative:a}={}){let i=x.useContext(nb);at(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=fb("useViewTransitionState"),r=yl(n,{relative:a});if(!i.isTransitioning)return!1;let u=ya(i.currentLocation.pathname,l)||i.currentLocation.pathname,f=ya(i.nextLocation.pathname,l)||i.nextLocation.pathname;return cl(r.pathname,f)!=null||cl(r.pathname,u)!=null}function Ht(){const n=bc();return x.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function pb(n){return`/sessions/${encodeURIComponent(n)}`}function Bi(n,a){return a?`/environments/${encodeURIComponent(a)}/workspaces/${encodeURIComponent(n)}`:`/workspaces/${encodeURIComponent(n)}`}function ba(n,a,i,l){const r=encodeURIComponent(n);let u;return i&&l?u=`/environments/${encodeURIComponent(l)}/workspaces/${encodeURIComponent(i)}/tasks/${r}`:i?u=`/workspaces/${encodeURIComponent(i)}/tasks/${r}`:u=`/tasks/${r}`,a?`${u}/${a}`:u}function $k(n,a,i){return a&&i?`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(n)}/edit`:a?`/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(n)}/edit`:`/tasks/${encodeURIComponent(n)}/edit`}function Pi(n,a,i){const l=new URLSearchParams;n&&l.set("workspace",n),a&&l.set("parent",a);const r=l.toString();if(n&&i){const u=`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(n)}/tasks/new`;return a?`${u}?parent=${encodeURIComponent(a)}`:u}return r?`/tasks/new?${r}`:"/tasks/new"}function mb(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const Ii="/environments",Fk="/environments/new";function ul(n){return`/environments/${encodeURIComponent(n)}`}function qk(n){return`/environments/${encodeURIComponent(n)}/edit`}const el="/settings",Yk="/settings/credentials",Kk="/pair",Zk="/chat",_c="/",Xk="/tasks";function Qk(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",l=x.useRef(void 0),[r,u]=x.useState(!1),f=x.useRef(a.onMessage);f.current=a.onMessage;const p=x.useRef(a.onConnect);p.current=a.onConnect;const m=x.useRef(a.onDisconnect);m.current=a.onDisconnect;const g=x.useCallback(y=>{var v;((v=l.current)==null?void 0:v.readyState)===WebSocket.OPEN&&l.current.send(JSON.stringify(y))},[]);return x.useEffect(()=>{let y,v;function b(){y=new WebSocket(i),l.current=y,y.onopen=()=>{u(!0),p.current(g)},y.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const k=rT(S.data);k&&f.current(k)},y.onclose=S=>{var k;if(u(!1),l.current=void 0,(k=m.current)==null||k.call(m),clearTimeout(v),S.code===dT){window.location.href=Kk;return}v=setTimeout(b,uT)},y.onerror=()=>{y.close()}}return b(),()=>{clearTimeout(v),y==null||y.close()}},[i,g]),{connected:r,send:g}}const Wk=5e3;function Jk(n){const[a,i]=x.useState([]),[l,r]=x.useState({}),u=x.useCallback(b=>{switch(b.type){case"environment.added":return!0;case"environment.removed":{const S=b.payload.environmentId;return S&&(i(k=>k.filter(C=>C.id!==S)),r(k=>{const C={...k};return delete C[S],C})),n({type:"list_sessions"}),!0}case"environment.changed":return n({type:"list_environments"}),!0;case"environment.provision_progress":{const S=b.payload;if(typeof S.environmentId!="string"||typeof S.stage!="string"||typeof S.message!="string"||typeof S.progress!="number")return ll("environment.provision_progress","invalid payload"),!0;if(r(k=>({...k,[S.environmentId]:{stage:S.stage,message:S.message,progress:S.progress}})),S.stage==="ready"){const k=S.environmentId;setTimeout(()=>{r(C=>{const N={...C};return delete N[k],N})},Wk)}return!0}default:return!1}},[n]),f=x.useCallback(b=>{var S;switch(b.type){case"environments":return i(Fn((S=b.payload)==null?void 0:S.environments,JS,"environments","environments").map(eT)),!0;default:return!1}},[]),p=x.useCallback((b,S,k)=>{n({type:"add_environment",payload:{displayName:b,adapterType:S,adapterConfig:k||{}}})},[n]),m=x.useCallback((b,S)=>{const k={environmentId:b,...S};n({type:"update_environment",payload:k})},[n]),g=x.useCallback(b=>{n({type:"provision_environment",payload:{environmentId:b}})},[n]),y=x.useCallback(b=>{n({type:"stop_environment",payload:{environmentId:b}})},[n]),v=x.useCallback(b=>{n({type:"remove_environment",payload:{environmentId:b}})},[n]);return{environments:a,provisionStatus:l,addEnvironment:p,updateEnvironment:m,provisionEnvironment:g,stopEnvironment:y,removeEnvironment:v,handleMessage:f,handleEvent:u}}const Zd=new Set(["pending","running","idle"]),eC=new Set(["completed","failed","interrupted","hibernating","suspended"]),ly=["pending","running","idle"];function tC(n){const[a,i]=x.useState([]),[l,r]=x.useState([]),[u,f]=x.useState(0),[p,m]=x.useState(void 0),[g,y]=x.useState({}),v=x.useCallback(A=>{var D,M,j,K,q;switch(A.type){case"sessions":return i(U=>{var ie;const W=Fn((ie=A.payload)==null?void 0:ie.sessions,Qv,"sessions","sessions"),ee=new Map(U.map($=>[$.id,$.status]));return W.map($=>{const le=ee.get($.id);return!le||le===$.status?$:eC.has(le)&&Zd.has($.status)?{...$,status:le}:Zd.has(le)&&Zd.has($.status)&&ly.indexOf(le)>ly.indexOf($.status)?{...$,status:le}:$})}),!0;case"session_event":{if(!Wv(A.payload))return ll("session_event","payload is not a valid SessionEvent"),!0;const U=A.payload;let W=0;if(r(ee=>{const ie=[...ee,U];return ie.length>Ci?(W=ie.length-Ci,ie.slice(-Ci)):ie}),W>0&&f(ee=>ee+W),U.eventType==="usage")try{const ee=JSON.parse(U.content),ie=Number(ee.input_tokens)||0,$=Number(ee.output_tokens)||0,le=Number(ee.cost_usd)||0;(ie>0||$>0||le>0)&&i(F=>F.map(te=>te.id===U.sessionId?{...te,inputTokens:(te.inputTokens??0)+ie,outputTokens:(te.outputTokens??0)+$,costUsd:(te.costUsd??0)+le}:te))}catch{}if(U.eventType==="status"){const ee=cT(U.content);i(ie=>ie.some(le=>le.id===U.sessionId)?ie.map(le=>le.id===U.sessionId?{...le,status:ee}:le):[...ie,{id:U.sessionId,environmentId:"",runtime:"",status:ee,prompt:"",startedAt:U.timestamp}])}return!0}case"session_events":{const U=Fn((D=A.payload)==null?void 0:D.events,Wv,"session_events","events"),W=(M=A.payload)==null?void 0:M.sessionId;if(typeof W!="string")return ll("session_events","missing or non-string sessionId"),!0;if(U.length>0){let ee=0;r(ie=>{const $=new Set;for(const te of ie)te.sessionId===W&&$.add(`${te.timestamp}|${te.eventType}`);const le=U.filter(te=>!$.has(`${te.timestamp}|${te.eventType}`)),F=[...ie,...le].sort((te,B)=>te.sessionId!==B.sessionId?0:te.timestamp.localeCompare(B.timestamp));return F.length>Ci?(ee=F.length-Ci,F.slice(-Ci)):F}),ee>0&&f(ie=>ie+ee)}return!0}case"spawned":{const U=(j=A.payload)==null?void 0:j.sessionId;return typeof U=="string"&&U&&m(U),n({type:"list_sessions"}),!0}case"task_sessions":{const U=(K=A.payload)==null?void 0:K.taskId;if(typeof U!="string"||!U)return!0;const W=Fn((q=A.payload)==null?void 0:q.sessions,Qv,"task_sessions","sessions");return y(ee=>({...ee,[U]:W})),!0}default:return!1}},[n]),b=x.useCallback((A,D,M,j)=>{n({type:"spawn",payload:{environmentId:A,prompt:D,personaId:M||"",worktreeBasePath:j||""}})},[n]),S=x.useCallback((A,D)=>{n({type:"send_input",payload:{sessionId:A,text:D}})},[n]),k=x.useCallback(A=>{n({type:"kill",payload:{sessionId:A}})},[n]),C=x.useCallback(A=>{n({type:"get_session_events",payload:{sessionId:A}})},[n]),N=x.useCallback(()=>{r([]),f(0)},[]),E=x.useCallback(A=>{n({type:"get_task_sessions",payload:{taskId:A}})},[n]);return{sessions:a,events:l,eventsDropped:u,lastSpawnedId:p,taskSessions:g,spawn:b,sendInput:S,kill:k,loadSessionEvents:C,clearEvents:N,loadTaskSessions:E,handleMessage:v}}function nC(n){const[a,i]=x.useState([]),[l,r]=x.useState(!1),u=x.useCallback(v=>{switch(v.type){case"workspace.created":return r(!1),n({type:"list_workspaces"}),!0;case"workspace.archived":case"workspace.updated":return n({type:"list_workspaces"}),!0;default:return!1}},[n]),f=x.useCallback(v=>{var b;switch(v.type){case"workspaces":return i(Fn((b=v.payload)==null?void 0:b.workspaces,tT,"workspaces","workspaces")),!0;default:return!1}},[]),p=x.useCallback(()=>{r(!1)},[]),m=x.useCallback((v,b,S,k,C)=>{r(!0),n({type:"create_workspace",payload:{name:v,description:b||"",repoUrl:S||"",environmentId:k||"",defaultPersonaId:C||""}})},[n]),g=x.useCallback(v=>{n({type:"archive_workspace",payload:{workspaceId:v}})},[n]),y=x.useCallback((v,b)=>{n({type:"update_workspace",payload:{workspaceId:v,...b}})},[n]);return{workspaces:a,workspaceCreating:l,createWorkspace:m,archiveWorkspace:g,updateWorkspace:y,handleMessage:f,handleEvent:u,onDisconnect:p}}const aC=15e3;function sC(n){const[a,i]=x.useState([]),[l,r]=x.useState(void 0),u=x.useRef(new Map),f=x.useCallback(A=>{const D=A.payload;switch(A.type){case"task.created":{const M=typeof D.requestId=="string"?D.requestId:"";if(M){const K=u.current.get(M);K&&(clearTimeout(K.timer),u.current.delete(M),K.onSuccess())}const j=typeof D.workspaceId=="string"?D.workspaceId:"";return j&&n({type:"list_tasks",payload:{workspaceId:j}}),!0}case"task.started":{const M=typeof D.taskId=="string"?D.taskId:"",j=typeof D.sessionId=="string"?D.sessionId:"",K=typeof D.workspaceId=="string"?D.workspaceId:"";return r(q=>M&&q===M?void 0:q),j&&(n({type:"list_sessions"}),M&&i(q=>q.map(U=>U.id===M?{...U,latestSessionId:j}:U))),K?n({type:"list_tasks",payload:{workspaceId:K}}):M&&i(q=>{const U=q.find(W=>W.id===M);return U!=null&&U.workspaceId?n({type:"list_tasks",payload:{workspaceId:U.workspaceId}}):n({type:"list_tasks",payload:{}}),q}),!0}case"task.completed":case"task.deleted":case"task.updated":{const M=typeof D.workspaceId=="string"?D.workspaceId:"",j=typeof D.taskId=="string"?D.taskId:"";return M?n({type:"list_tasks",payload:{workspaceId:M}}):j&&i(K=>{const q=K.find(U=>U.id===j);return q!=null&&q.workspaceId?n({type:"list_tasks",payload:{workspaceId:q.workspaceId}}):n({type:"list_tasks",payload:{}}),K}),!0}default:return!1}},[n]),p=x.useCallback(A=>{var D,M,j,K;switch(A.type){case"tasks":{const q=Fn((D=A.payload)==null?void 0:D.tasks,nT,"tasks","tasks"),U=typeof((M=A.payload)==null?void 0:M.workspaceId)=="string"&&A.payload.workspaceId?A.payload.workspaceId:"";return U?(i(W=>[...W.filter(ee=>ee.workspaceId!==U),...q]),!0):(i(W=>{const ee=new Set(q.map(ie=>ie.id));return[...W.filter(ie=>!ee.has(ie.id)),...q]}),!0)}case"create_task_error":{const q=typeof((j=A.payload)==null?void 0:j.requestId)=="string"?A.payload.requestId:"",U=typeof((K=A.payload)==null?void 0:K.message)=="string"?A.payload.message:"Failed to create task";if(q){const W=u.current.get(q);W?(clearTimeout(W.timer),u.current.delete(q),W.onError(U)):console.error("[useTasks] create_task_error with unknown requestId:",U)}else console.error("[useTasks] create_task_error:",U);return!0}default:return!1}},[]),m=x.useCallback(()=>{r(void 0);for(const[,A]of u.current)clearTimeout(A.timer),A.onError("Disconnected");u.current.clear()},[]),g=x.useCallback(A=>{n({type:"list_tasks",payload:{workspaceId:A}})},[n]),y=x.useCallback(()=>{n({type:"list_tasks",payload:{}})},[n]),v=x.useCallback((A,D,M,j,K,q,U,W,ee)=>{const ie={workspaceId:A,title:D,description:M||"",dependsOn:j||[],parentTaskId:K||"",defaultPersonaId:q||"",canDecompose:U||!1};if(W||ee){const $=crypto.randomUUID();ie.requestId=$;const le=ee??(()=>{}),F=setTimeout(()=>{u.current.delete($)&&le("Request timed out")},aC);u.current.set($,{onSuccess:W??(()=>{}),onError:le,timer:F})}n({type:"create_task",payload:ie})},[n]),b=x.useCallback((A,D,M,j)=>{r(A),n({type:"start_task",payload:{taskId:A,personaId:D||"",environmentId:M||"",notes:j||""}})},[n]),S=x.useCallback(A=>{n({type:"stop_task",payload:{taskId:A}})},[n]),k=x.useCallback(A=>{n({type:"complete_task",payload:{taskId:A}})},[n]),C=x.useCallback(A=>{n({type:"resume_task",payload:{taskId:A}})},[n]),N=x.useCallback((A,D,M,j,K)=>{const q={taskId:A,title:D,description:M,dependsOn:j};K!==void 0&&(q.defaultPersonaId=K),n({type:"update_task",payload:q})},[n]),E=x.useCallback(A=>{n({type:"delete_task",payload:{taskId:A}})},[n]);return{tasks:a,taskStartingId:l,loadTasks:g,loadAllTasks:y,createTask:v,startTask:b,stopTask:S,completeTask:k,resumeTask:C,updateTask:N,deleteTask:E,handleMessage:p,handleEvent:f,onDisconnect:m}}function iC(n){const[a,i]=x.useState([]),l=x.useCallback(p=>{if(p.type==="finding.posted"){const m=typeof p.payload.workspaceId=="string"?p.payload.workspaceId:"";return m&&n({type:"list_findings",payload:{workspaceId:m}}),!0}return!1},[n]),r=x.useCallback(p=>{var m;switch(p.type){case"findings":return i(Fn((m=p.payload)==null?void 0:m.findings,aT,"findings","findings")),!0;default:return!1}},[]),u=x.useCallback(p=>{n({type:"list_findings",payload:{workspaceId:p}})},[n]),f=x.useCallback((p,m,g,y,v)=>{n({type:"post_finding",payload:{workspaceId:p,title:m,content:g,category:y||"general",tags:v||[]}})},[n]);return{findings:a,loadFindings:u,postFinding:f,handleMessage:r,handleEvent:l}}function oC(n){const[a,i]=x.useState([]),l=x.useCallback(m=>m.type==="token.changed"?(n({type:"list_tokens"}),!0):!1,[n]),r=x.useCallback(m=>{var g;switch(m.type){case"tokens":return i(Fn((g=m.payload)==null?void 0:g.tokens,sT,"tokens","tokens")),!0;default:return!1}},[]),u=x.useCallback(()=>{n({type:"list_tokens"})},[n]),f=x.useCallback((m,g,y,v,b)=>{n({type:"set_token",payload:{name:m,value:g,tokenType:y,envVar:v,filePath:b}})},[n]),p=x.useCallback(m=>{n({type:"delete_token",payload:{name:m}})},[n]);return{tokens:a,loadTokens:u,setToken:f,deleteToken:p,handleMessage:r,handleEvent:l}}function lC(n){const[a,i]=x.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),l=x.useCallback(f=>f.type==="credential.providers_changed"?(Jv(f.payload)&&i(f.payload),!0):!1,[]),r=x.useCallback(f=>{switch(f.type){case"credential_providers":return Jv(f.payload)&&i(f.payload),!0;default:return!1}},[]),u=x.useCallback(f=>{n({type:"set_credential_providers",payload:f})},[n]);return{credentialProviders:a,updateCredentialProviders:u,handleMessage:r,handleEvent:l}}function rC(n,a){const[i,l]=x.useState([]),[r,u]=x.useState(""),[f,p]=x.useState(""),[m,g]=x.useState(!1),y=x.useCallback(S=>{var k,C,N;switch(S.type){case"codespaces_list":{const E=Fn((k=S.payload)==null?void 0:k.codespaces,oT,"codespaces_list","codespaces"),A=typeof((C=S.payload)==null?void 0:C.error)=="string"?S.payload.error:"";return l(E),p(A),!0}case"codespace_created":return g(!1),n({type:"list_codespaces"}),!0;case"codespace_create_error":{g(!1);const E=typeof((N=S.payload)==null?void 0:N.message)=="string"?S.payload.message:"Failed to create codespace";return u(E),!0}default:return!1}},[n]),v=x.useCallback(()=>{n({type:"list_codespaces"})},[n]),b=x.useCallback((S,k)=>{if(!a){u("Not connected to server. Please try again once the connection is restored.");return}g(!0),u("");const C={repo:S};k&&(C.machine=k),n({type:"create_codespace",payload:C})},[n,a]);return{codespaces:i,codespaceError:r,codespaceListError:f,codespaceCreating:m,listCodespaces:v,createCodespace:b,handleMessage:y}}function cC(n){const[a,i]=x.useState([]),l=x.useCallback(m=>{switch(m.type){case"persona.created":case"persona.updated":case"persona.deleted":return n({type:"list_personas"}),!0;default:return!1}},[n]),r=x.useCallback(m=>{var g;switch(m.type){case"personas":{const y=Fn((g=m.payload)==null?void 0:g.personas,lT,"personas","personas");return i(y),!0}default:return!1}},[]),u=x.useCallback((m,g,y,v,b,S,k,C)=>{n({type:"create_persona",payload:{name:m,description:g,systemPrompt:y,runtime:v||"",model:b||"",maxTurns:S||0,type:k||"agent",script:C||""}})},[n]),f=x.useCallback((m,g,y,v,b,S,k,C,N)=>{const E={personaId:m};g!==void 0&&(E.name=g),y!==void 0&&(E.description=y),v!==void 0&&(E.systemPrompt=v),b!==void 0&&(E.runtime=b),S!==void 0&&(E.model=S),k!==void 0&&(E.maxTurns=k),C!==void 0&&(E.type=C),N!==void 0&&(E.script=N),n({type:"update_persona",payload:E})},[n]),p=x.useCallback(m=>{n({type:"delete_persona",payload:{personaId:m}})},[n]);return{personas:a,createPersona:u,updatePersona:f,deletePersona:p,handleMessage:r,handleEvent:l}}function uC(n){const[a,i]=x.useState(""),[l,r]=x.useState(void 0),[u,f]=x.useState({}),{connected:p,send:m}=Qk(n,{onMessage:U,onConnect:W,onDisconnect:ee}),g=Jk(m),y=tC(m),v=nC(m),b=sC(m),S=iC(m),k=oC(m),C=lC(m),N=rC(m,p),E=cC(m),A="default_persona_id",D="onboarding_completed",M=x.useCallback($=>{i($),m({type:"set_setting",payload:{key:A,value:$}})},[m]),j=x.useCallback(()=>{r(!0),m({type:"set_setting",payload:{key:D,value:"true"}})},[m]),K=x.useCallback(($,le)=>{m({type:"get_usage",payload:{scope:$,id:le}})},[m]);function q($){const le=$.payload.key,F=$.payload.value;if($.type==="setting.changed"){le===A&&i(F??""),le===D&&r(F==="true");return}g.handleEvent($)||v.handleEvent($)||b.handleEvent($)||S.handleEvent($)||k.handleEvent($)||C.handleEvent($)||E.handleEvent($)}function U($){var le,F,te,B,H;if(WS($)){q($);return}if($.type==="usage_stats"){const ae=((le=$.payload)==null?void 0:le.scope)||"",G=((F=$.payload)==null?void 0:F.id)||"";if(ae&&G){const O=`${ae}:${G}`;f(se=>{var ye,re,Fe,vt;return{...se,[O]:{inputTokens:Number((ye=$.payload)==null?void 0:ye.inputTokens)||0,outputTokens:Number((re=$.payload)==null?void 0:re.outputTokens)||0,costUsd:Number((Fe=$.payload)==null?void 0:Fe.costUsd)||0,sessionCount:Number((vt=$.payload)==null?void 0:vt.sessionCount)||0}}})}return}if($.type==="setting"){const ae=(te=$.payload)==null?void 0:te.key,G=(B=$.payload)==null?void 0:B.value;ae===A&&i(G??""),ae===D&&r(G==="true");return}if(!g.handleMessage($)&&!y.handleMessage($)&&!v.handleMessage($)&&!b.handleMessage($)&&!S.handleMessage($)&&!k.handleMessage($)&&!C.handleMessage($)&&!N.handleMessage($)&&!E.handleMessage($)&&$.type==="error"){console.error("[ws]",(H=$.payload)==null?void 0:H.message);return}}function W($){$({type:"list_environments"}),$({type:"list_sessions"}),$({type:"list_workspaces"}),$({type:"list_tokens"}),$({type:"get_credential_providers"}),$({type:"list_personas"}),$({type:"get_setting",payload:{key:A}}),$({type:"get_setting",payload:{key:D}}),$({type:"list_tasks",payload:{}}),$({type:"subscribe_all"})}function ee(){v.onDisconnect(),b.onDisconnect()}const ie=x.useCallback(()=>{m({type:"list_environments"}),m({type:"list_sessions"}),m({type:"list_workspaces"}),m({type:"list_tokens"})},[m]);return{connected:p,environments:g.environments,sessions:y.sessions,events:y.events,eventsDropped:y.eventsDropped,lastSpawnedId:y.lastSpawnedId,workspaces:v.workspaces,tasks:b.tasks,findings:S.findings,tokens:k.tokens,spawn:y.spawn,sendInput:y.sendInput,kill:y.kill,refresh:ie,loadSessionEvents:y.loadSessionEvents,clearEvents:y.clearEvents,createWorkspace:v.createWorkspace,archiveWorkspace:v.archiveWorkspace,updateWorkspace:v.updateWorkspace,loadTasks:b.loadTasks,loadAllTasks:b.loadAllTasks,createTask:b.createTask,startTask:b.startTask,stopTask:b.stopTask,completeTask:b.completeTask,resumeTask:b.resumeTask,updateTask:b.updateTask,deleteTask:b.deleteTask,loadFindings:S.loadFindings,postFinding:S.postFinding,addEnvironment:g.addEnvironment,updateEnvironment:g.updateEnvironment,loadTokens:k.loadTokens,setToken:k.setToken,deleteToken:k.deleteToken,credentialProviders:C.credentialProviders,updateCredentialProviders:C.updateCredentialProviders,provisionStatus:g.provisionStatus,provisionEnvironment:g.provisionEnvironment,stopEnvironment:g.stopEnvironment,removeEnvironment:g.removeEnvironment,codespaces:N.codespaces,codespaceError:N.codespaceError,codespaceListError:N.codespaceListError,codespaceCreating:N.codespaceCreating,listCodespaces:N.listCodespaces,createCodespace:N.createCodespace,workspaceCreating:v.workspaceCreating,taskStartingId:b.taskStartingId,personas:E.personas,createPersona:E.createPersona,updatePersona:E.updatePersona,deletePersona:E.deletePersona,taskSessions:y.taskSessions,loadTaskSessions:y.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:M,onboardingCompleted:l,completeOnboarding:j,usageCache:u,loadUsage:K}}const ih=x.createContext(void 0);function dC({children:n}){const a=uC();return c.jsx(ih.Provider,{value:a,children:n})}function We(){const n=x.useContext(ih);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const fC=[{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}],hC=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation",inputTokens:84200,outputTokens:12750,costUsd:.41},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z",inputTokens:42600,outputTokens:8100,costUsd:.22},{id:"sess-002",environmentId:"env-docker-01",runtime:"claude-code",status:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z",endedAt:"2026-02-27T07:33:00Z",inputTokens:31400,outputTokens:9800,costUsd:.18},{id:"sess-003",environmentId:"env-local-01",runtime:"claude-code",status:"failed",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z",endedAt:"2026-02-26T23:10:00Z",inputTokens:56300,outputTokens:14200,costUsd:.31},{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z",inputTokens:18900,outputTokens:4500,costUsd:.1},{id:"sess-005",environmentId:"env-cs-01",runtime:"claude-code",status:"suspended",prompt:"Refactor database connection pooling for multi-tenant isolation",startedAt:"2026-02-27T06:00:00Z",inputTokens:67800,outputTokens:19300,costUsd:.38}],pC=[{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:
|
|
37
|
-
- src/middleware/auth.ts
|
|
38
|
-
- src/routes/login.ts
|
|
39
|
-
- 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:
|
|
40
|
-
\`\`\`typescript
|
|
41
|
-
import jwt from "jsonwebtoken";
|
|
42
|
-
import type { Request, Response, NextFunction } from "express";
|
|
43
|
-
|
|
44
|
-
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
45
|
-
|
|
46
|
-
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
47
|
-
const header = req.headers.authorization;
|
|
48
|
-
if (!header?.startsWith("Bearer ")) {
|
|
49
|
-
res.status(401).json({ error: "Missing token" });
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
try {
|
|
53
|
-
const decoded = jwt.verify(header.slice(7), JWT_SECRET);
|
|
54
|
-
req.user = decoded;
|
|
55
|
-
next();
|
|
56
|
-
} catch {
|
|
57
|
-
res.status(403).json({ error: "Invalid token" });
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
\`\`\``},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:18Z",content:"Updated login route to issue JWT tokens with 24h expiry."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:22Z",content:"Running test suite... 14 tests passed, 2 updated, 0 failed."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:30:05Z",content:"Generating pytest tests for POST /api/register endpoint..."},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:32:00Z",content:"Created 8 test cases covering: valid registration, duplicate email, weak password, missing fields, SQL injection, XSS payload, rate limit, and CORS headers."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"}],mC=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",environmentId:"env-local-01",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-01-15T10:00:00Z",updatedAt:"2026-01-15T10:00:00Z"},{id:"proj-beta",name:"Data Pipeline",description:"ETL pipelines for analytics and reporting",repoUrl:"https://github.com/acme/data-pipeline",environmentId:"env-docker-01",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-02-01T14:30:00Z",updatedAt:"2026-02-01T14:30:00Z"},{id:"proj-gamma",name:"Mobile App",description:"React Native cross-platform mobile application",repoUrl:"",environmentId:"env-local-01",status:"archived",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],gC=[{id:"task-001",workspaceId:"proj-alpha",title:"Implement JWT authentication",description:"Replace session-based auth with JWT tokens across all protected routes",status:"working",branch:"feat/jwt-auth",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-001a","task-001b","task-001c"],canDecompose:!0,defaultPersonaId:""},{id:"task-001a",workspaceId:"proj-alpha",title:"Design token schema",description:"Define JWT payload structure, expiry, and refresh token strategy",status:"complete",branch:"feat/jwt-auth/design-token-schema",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:10:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-001b",workspaceId:"proj-alpha",title:"Implement auth middleware",description:"Build Express middleware that verifies JWT Bearer tokens",status:"working",branch:"feat/jwt-auth/implement-auth-middleware",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:15:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-001c",workspaceId:"proj-alpha",title:"Write auth integration tests",description:"End-to-end tests for login flow, token refresh, and protected route access",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-25T10:20:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-002",workspaceId:"proj-alpha",title:"Add rate limiting",description:"Implement token-bucket rate limiting for public API endpoints",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:05:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-003",workspaceId:"proj-alpha",title:"Set up OpenAPI documentation",description:"Generate Swagger docs from route decorators and serve at /api/docs",status:"paused",branch:"feat/openapi-docs",latestSessionId:"sess-002",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-24T16:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-004",workspaceId:"proj-alpha",title:"Database connection pooling",description:"Switch from single connection to a connection pool with health checks",status:"complete",branch:"feat/db-pool",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-23T11:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-005",workspaceId:"proj-alpha",title:"Fix N+1 query in user list",description:"Use a JOIN instead of per-row lookups in GET /api/users",status:"not_started",branch:"fix/user-list-n1",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:5,createdAt:"2026-02-22T09:30:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006",workspaceId:"proj-beta",title:"Add Parquet export support",description:"Allow pipeline outputs to be written as Parquet files for Spark consumption",status:"working",branch:"feat/parquet-export",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-006a","task-006b","task-006c","task-006d"],canDecompose:!0,defaultPersonaId:""},{id:"task-006a",workspaceId:"proj-beta",title:"Define Parquet schema mapping",description:"Map internal column types to Arrow/Parquet type system",status:"complete",branch:"feat/parquet-export/define-parquet-schema-mapping",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:05:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006b",workspaceId:"proj-beta",title:"Implement row-group writer",description:"Write buffered row groups with configurable batch size",status:"complete",branch:"feat/parquet-export/implement-row-group-writer",latestSessionId:"",dependsOn:["task-006a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:10:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006c",workspaceId:"proj-beta",title:"Add compression options",description:"Support Snappy, ZSTD, and GZIP compression for Parquet output",status:"working",branch:"feat/parquet-export/add-compression-options",latestSessionId:"sess-004",dependsOn:["task-006b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T08:15:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006d",workspaceId:"proj-beta",title:"Write Parquet integration tests",description:"Round-trip tests: write Parquet, read back with pyarrow, verify data integrity",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-006c"],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-26T08:20:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-007",workspaceId:"proj-beta",title:"Implement incremental loads",description:"Track watermarks so pipelines only process new/changed rows",status:"working",branch:"feat/incremental",latestSessionId:"sess-004",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:30:00Z",parentTaskId:"",depth:0,childTaskIds:["task-007a","task-007b"],canDecompose:!0,defaultPersonaId:""},{id:"task-007a",workspaceId:"proj-beta",title:"Design watermark storage",description:"Define schema for per-pipeline high-watermark tracking",status:"complete",branch:"feat/incremental/design-watermark-storage",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:35:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-007b",workspaceId:"proj-beta",title:"Implement change detection query",description:"Generate WHERE clauses from watermarks to fetch only changed rows",status:"failed",branch:"feat/incremental/implement-change-detection-query",latestSessionId:"",dependsOn:["task-007a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:40:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-008",workspaceId:"proj-beta",title:"Add pipeline monitoring dashboard",description:"Real-time metrics for pipeline throughput, latency, and error rates",status:"paused",branch:"feat/monitoring",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T09:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""}],ry=[{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"}],vC=[{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:""}],yC=[{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));
|
|
61
|
-
for (const f of files) {
|
|
62
|
-
const eslintResult = await host.exec("npx", ["eslint", "--fix", f.filename]);
|
|
63
|
-
if (eslintResult.exitCode !== 0) {
|
|
64
|
-
env.findings.push({ category: "lint", title: \`Lint issues in \${f.filename}\`, content: eslintResult.stderr });
|
|
65
|
-
}
|
|
66
|
-
const prettierResult = await host.exec("npx", ["prettier", "--write", f.filename]);
|
|
67
|
-
if (prettierResult.exitCode !== 0) {
|
|
68
|
-
env.findings.push({ category: "format", title: \`Prettier issues in \${f.filename}\`, content: prettierResult.stderr });
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
env.findings.push({ category: "summary", title: "Lint & format pass complete", content: \`Ran ESLint and Prettier on \${files.length} files\` });`}],bC={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z"},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Implement auth middleware",startedAt:"2026-02-27T08:15:00Z"}],"task-006c":[{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Add compression options",startedAt:"2026-02-27T09:00:00Z"}]};function Et(n){return new Date(Date.now()+n).toISOString()}const cy=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Et(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Et(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Et(1600),content:`Found 5 endpoints that need refactoring:
|
|
72
|
-
- GET /api/users
|
|
73
|
-
- POST /api/users
|
|
74
|
-
- GET /api/users/:id
|
|
75
|
-
- PUT /api/users/:id
|
|
76
|
-
- DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:Et(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:Et(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Et(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Et(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Et(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Et(1400),content:`Found tables to modify:
|
|
77
|
-
- users (add column: last_login_at)
|
|
78
|
-
- sessions (add index on expires_at)
|
|
79
|
-
- audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:Et(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
|
|
80
|
-
The table has 50,000+ rows — this may lock the table briefly.
|
|
81
|
-
|
|
82
|
-
Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:Et(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Et(1e3),content:`Migration 001_add_last_login.sql applied successfully.
|
|
83
|
-
Migration 002_sessions_index.sql applied successfully.
|
|
84
|
-
Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:Et(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Et(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Et(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Et(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Et(1800),content:`Writing test cases:
|
|
85
|
-
- should calculate monthly total
|
|
86
|
-
- should apply discount codes
|
|
87
|
-
- should handle currency conversion
|
|
88
|
-
- should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:Et(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
|
|
89
|
-
The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:Et(3500),content:"failed"}}]}],uy=400;function xC({children:n}){const[a,i]=x.useState(fC),[l,r]=x.useState(hC),[u,f]=x.useState(pC),[p,m]=x.useState(void 0),[g,y]=x.useState(mC),[v,b]=x.useState(gC),[S,k]=x.useState(ry),[C,N]=x.useState(vC),[E,A]=x.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[D,M]=x.useState(yC),[j]=x.useState(bC),[K,q]=x.useState(""),U=x.useRef(0),W=x.useRef(0),ee=x.useRef(new Set),ie=x.useRef(new Map),$=x.useRef(v);$.current=v;const le=x.useRef(new Map),F=x.useRef(new Map),te=x.useCallback(Q=>(U.current+=1,`mock-${Q}-${String(U.current).padStart(3,"0")}`),[]),B=x.useCallback(()=>{const Q=cy[W.current%cy.length];return W.current+=1,Q},[]),H=x.useCallback((Q,oe,ce)=>{const _e=setTimeout(()=>{var xe;ee.current.delete(_e),ce&&((xe=ie.current.get(ce))==null||xe.delete(_e)),Q()},oe);ee.current.add(_e),ce&&(ie.current.has(ce)||ie.current.set(ce,new Set),ie.current.get(ce).add(_e))},[]),ae=x.useCallback(Q=>{const oe=ie.current.get(Q);oe&&(oe.forEach(ce=>{clearTimeout(ce),ee.current.delete(ce)}),ie.current.delete(Q))},[]),G=x.useCallback((Q,oe)=>{r(ce=>ce.map(_e=>_e.id===Q?{..._e,status:oe}:_e))},[]),O=x.useCallback(Q=>{f(oe=>[...oe,Q])},[]),se=x.useCallback((Q,oe,ce)=>{oe.forEach((_e,xe)=>{H(()=>{const Xe={sessionId:Q,..._e.event,timestamp:new Date().toISOString()};O(Xe),_e.event.eventType==="status"&&G(Q,_e.event.content),xe===oe.length-1&&ce&&ce()},_e.delayMs,Q)})},[H,O,G]),ye=x.useCallback((Q,oe,ce,_e)=>{console.log("[MockGrackle] spawn",{environmentId:Q,prompt:oe,runtime:_e});const xe=te("sess"),Xe={id:xe,environmentId:Q,runtime:_e||"claude-code",status:"running",prompt:oe,startedAt:new Date().toISOString()};r(ht=>[...ht,Xe]),m(xe);const Ce=B();if(console.log(`[MockGrackle] Playing scenario: ${Ce.label}`),Ce.pauseForInput){const ht=Ce.pauseAfterStep??Ce.steps.length-1,Ee=Ce.steps.slice(0,ht+1),lt=Ee.length>0?Ee[Ee.length-1].delayMs:0;se(xe,Ee),H(()=>{G(xe,"idle"),O({sessionId:xe,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},lt+uy,xe),Ce.resumeSteps&&le.current.set(xe,Ce.resumeSteps)}else se(xe,Ce.steps)},[te,B,se,H,G,O]),re=x.useCallback(Q=>{console.log("[MockGrackle] kill",Q),ae(Q),le.current.delete(Q),G(Q,"interrupted"),O({sessionId:Q,eventType:"status",timestamp:new Date().toISOString(),content:"interrupted"}),b(oe=>oe.map(ce=>ce.latestSessionId===Q&&ce.status==="working"?{...ce,status:"not_started"}:ce))},[ae,G,O]),Fe=x.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),vt=x.useCallback(Q=>{console.log("[MockGrackle] loadSessionEvents",Q)},[]),he=x.useCallback(()=>{console.log("[MockGrackle] clearEvents"),f([])},[]),jt=x.useCallback((Q,oe,ce,_e,xe)=>{console.log("[MockGrackle] createWorkspace",{name:Q,description:oe});const Xe={id:te("proj"),name:Q,description:oe||"",repoUrl:ce||"",environmentId:_e||"",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:xe||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};y(Ce=>[...Ce,Xe])},[te]),pn=x.useCallback(Q=>{console.log("[MockGrackle] archiveWorkspace",Q),y(oe=>oe.map(ce=>ce.id===Q?{...ce,status:"archived"}:ce))},[]),jn=x.useCallback(Q=>{console.log("[MockGrackle] loadTasks",Q)},[]),Bn=x.useCallback((Q,oe,ce,_e,xe,Xe,Ce,ht,Ee)=>{console.log("[MockGrackle] createTask",{workspaceId:Q,title:oe,parentTaskId:xe}),b(lt=>{const Gt=lt.filter(mn=>mn.workspaceId===Q).reduce((mn,Ta)=>Math.max(mn,Ta.sortOrder),0),en=xe?lt.find(mn=>mn.id===xe):void 0;if(xe&&!en)return console.warn("[MockGrackle] Parent task not found:",xe),lt;if(en&&!en.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",xe),lt;const Ut=en?en.depth+1:0,Sa={id:te("task"),workspaceId:Q,title:oe,description:ce||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:_e||[],reviewNotes:void 0,sortOrder:Gt+1,createdAt:new Date().toISOString(),parentTaskId:xe||"",depth:Ut,childTaskIds:[],canDecompose:Ce??!xe,defaultPersonaId:Xe||""};return[...lt,Sa]}),ht&&ht()},[te]),Se=x.useCallback((Q,oe,ce,_e)=>{var lt;console.log("[MockGrackle] startTask",{taskId:Q});const xe=$.current.find(qe=>qe.id===Q),Xe=(xe==null?void 0:xe.title)??"",Ce=te("sess"),ht={id:Ce,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Xe||Q,startedAt:new Date().toISOString()};r(qe=>[...qe,ht]),b(qe=>qe.map(Gt=>Gt.id===Q?{...Gt,status:"working",latestSessionId:Ce,branch:`mock/${Q.slice(0,8)}`}:Gt));const Ee=B();if(console.log(`[MockGrackle] Playing task scenario: ${Ee.label}`),Ee.pauseForInput){const qe=Ee.pauseAfterStep??Ee.steps.length-1,Gt=Ee.steps.slice(0,qe+1),en=Gt.length>0?Gt[Gt.length-1].delayMs:0;if(se(Ce,Gt),H(()=>{G(Ce,"idle"),O({sessionId:Ce,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},en+uy,Ce),Ee.resumeSteps){const Ut=[...Ee.resumeSteps];le.current.set(Ce,Ut);const Sa=Ut.reduce((mn,Ta)=>Math.max(mn,Ta.delayMs),0);F.current.set(Ce,{taskId:Q,delayAfterResume:Sa+200})}}else{const qe=Ee.steps.length>0?Ee.steps[Ee.steps.length-1].delayMs:0;se(Ce,Ee.steps);const Gt=(lt=Ee.steps[Ee.steps.length-1])==null?void 0:lt.event.content;H(()=>{Gt==="completed"?b(en=>en.map(Ut=>Ut.id===Q&&Ut.status==="working"?{...Ut,status:"paused"}:Ut)):Gt==="failed"&&b(en=>en.map(Ut=>Ut.id===Q&&Ut.status==="working"?{...Ut,status:"failed"}:Ut))},qe+100,Ce)}},[te,B,se,H,G,O]),ft=x.useCallback((Q,oe)=>{console.log("[MockGrackle] sendInput",{sessionId:Q,text:oe}),O({sessionId:Q,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${oe}`}),G(Q,"running"),O({sessionId:Q,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const ce=le.current.get(Q);if(ce)le.current.delete(Q),se(Q,ce);else{const xe=[{delayMs:500,event:{eventType:"output",timestamp:new Date().toISOString(),content:"I received your input, continuing..."}},{delayMs:1500,event:{eventType:"status",timestamp:new Date().toISOString(),content:"completed"}}];se(Q,xe)}const _e=F.current.get(Q);_e&&(F.current.delete(Q),H(()=>{b(xe=>xe.map(Xe=>Xe.id===_e.taskId&&Xe.status==="working"?{...Xe,status:"paused"}:Xe))},_e.delayAfterResume,Q))},[O,G,se,H]),Bs=x.useCallback(Q=>{console.log("[MockGrackle] completeTask",Q),b(oe=>oe.map(ce=>ce.id===Q?{...ce,status:"complete"}:ce))},[]),In=x.useCallback(Q=>{console.log("[MockGrackle] resumeTask",Q)},[]),Is=x.useCallback((Q,oe,ce,_e,xe)=>{console.log("[MockGrackle] updateTask",{taskId:Q,title:oe}),b(Xe=>Xe.map(Ce=>Ce.id===Q?{...Ce,title:oe.trim()||Ce.title,description:ce,dependsOn:_e,...xe!==void 0?{defaultPersonaId:xe}:{}}:Ce))},[]),Ls=x.useCallback(Q=>{console.log("[MockGrackle] deleteTask",Q),b(oe=>oe.filter(ce=>ce.id!==Q))},[]),Tl=x.useCallback(Q=>{console.log("[MockGrackle] loadFindings",Q),k(ry.filter(oe=>oe.workspaceId===Q))},[]),Zi=x.useCallback((Q,oe,ce,_e,xe)=>{console.log("[MockGrackle] postFinding",{workspaceId:Q,title:oe});const Xe={id:te("find"),workspaceId:Q,taskId:"",sessionId:"",category:_e||"general",title:oe,content:ce,tags:xe||[],createdAt:new Date().toISOString()};k(Ce=>[...Ce,Xe])},[te]),Us=x.useCallback((Q,oe,ce)=>{console.log("[MockGrackle] addEnvironment",{displayName:Q,adapterType:oe,adapterConfig:ce})},[]),zs=x.useCallback((Q,oe)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:Q,...oe}),i(ce=>ce.map(_e=>_e.id!==Q?_e:{..._e,...oe.displayName!==void 0?{displayName:oe.displayName}:{},...oe.adapterConfig!==void 0?{adapterConfig:JSON.stringify(oe.adapterConfig)}:{}}))},[]),Vs=x.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),kl=x.useCallback((Q,oe,ce,_e,xe)=>{console.log("[MockGrackle] setToken",{name:Q,tokenType:ce}),N(Xe=>[...Xe.filter(ht=>ht.name!==Q),{name:Q,tokenType:ce,envVar:_e,filePath:xe,expiresAt:""}])},[]),Cl=x.useCallback(Q=>{console.log("[MockGrackle] deleteToken",Q),N(oe=>oe.filter(ce=>ce.name!==Q))},[]),Lt=x.useCallback(Q=>{console.log("[MockGrackle] updateCredentialProviders",Q),A(Q)},[]);x.useEffect(()=>()=>{ee.current.forEach(clearTimeout),ee.current.clear()},[]);const jc=x.useMemo(()=>({connected:!0,environments:a,sessions:l,events:u,eventsDropped:0,lastSpawnedId:p,workspaces:g,tasks:v,findings:S,tokens:C,credentialProviders:E,spawn:ye,sendInput:ft,kill:re,refresh:Fe,loadSessionEvents:vt,clearEvents:he,createWorkspace:jt,archiveWorkspace:pn,updateWorkspace:(Q,oe)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:Q,...oe}),y(ce=>ce.map(_e=>_e.id!==Q?_e:{..._e,...oe.name!==void 0?{name:oe.name}:{},...oe.description!==void 0?{description:oe.description}:{},...oe.repoUrl!==void 0?{repoUrl:oe.repoUrl}:{},...oe.environmentId!==void 0?{environmentId:oe.environmentId}:{},...oe.worktreeBasePath!==void 0?{worktreeBasePath:oe.worktreeBasePath}:{},...oe.useWorktrees!==void 0?{useWorktrees:oe.useWorktrees}:{},...oe.defaultPersonaId!==void 0?{defaultPersonaId:oe.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:jn,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:Bn,startTask:Se,stopTask:Q=>{console.log("[MockGrackle] stopTask",{taskId:Q}),Bs(Q)},completeTask:Bs,resumeTask:In,updateTask:Is,deleteTask:Ls,loadFindings:Tl,postFinding:Zi,addEnvironment:Us,updateEnvironment:zs,loadTokens:Vs,setToken:kl,deleteToken:Cl,updateCredentialProviders:Lt,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:D,createPersona:(Q,oe,ce,_e,xe,Xe,Ce,ht)=>{console.log("[MockGrackle] createPersona",{name:Q});const Ee={id:`mock-persona-${Date.now()}`,name:Q,description:oe,systemPrompt:ce,toolConfig:"{}",runtime:_e??"claude-code",model:xe||"",maxTurns:Xe||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Ce||"agent",script:ht||""};M(lt=>[...lt,Ee])},updatePersona:(Q,oe,ce,_e,xe,Xe,Ce,ht,Ee)=>{console.log("[MockGrackle] updatePersona",{personaId:Q,name:oe}),M(lt=>lt.map(qe=>qe.id!==Q?qe:{...qe,...oe!==void 0?{name:oe}:{},...ce!==void 0?{description:ce}:{},..._e!==void 0?{systemPrompt:_e}:{},...xe!==void 0?{runtime:xe}:{},...Xe!==void 0?{model:Xe}:{},...Ce!==void 0?{maxTurns:Ce}:{},...ht!==void 0?{type:ht}:{},...Ee!==void 0?{script:Ee}:{},updatedAt:new Date().toISOString()}))},deletePersona:Q=>{console.log("[MockGrackle] deletePersona",Q),M(oe=>oe.filter(ce=>ce.id!==Q))},taskSessions:j,loadTaskSessions:Q=>{console.log("[MockGrackle] loadTaskSessions",Q)},appDefaultPersonaId:K,setAppDefaultPersonaId:Q=>{console.log("[MockGrackle] setAppDefaultPersonaId",Q),q(Q)},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:(Q,oe)=>{console.log(`[MockGrackle] loadUsage(${Q}, ${oe})`)}}),[a,l,u,p,g,v,S,C,E,D,j,K,ye,ft,re,Fe,vt,he,jt,pn,jn,Bn,Se,Bs,In,Is,Ls,Tl,Zi,Us,zs,Vs,kl,Cl,Lt]);return c.jsx(ih.Provider,{value:jc,children:n})}const gb=x.createContext(void 0),_C=4e3;function SC({children:n}){const[a,i]=x.useState([]),l=x.useRef(0),r=x.useCallback(f=>{i(p=>p.filter(m=>m.id!==f))},[]),u=x.useCallback((f,p="info",m=_C)=>{const g=`toast-${++l.current}`;i(y=>[...y,{id:g,message:f,variant:p,duration:m}])},[]);return c.jsx(gb.Provider,{value:{toasts:a,showToast:u,dismissToast:r},children:n})}function $i(){const n=x.useContext(gb);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const Sc=[{id:"grackle",label:"Grackle",description:"The default Grackle theme — iridescent purple on clean dark.",swatches:["#0e1218","#8b5cf6","#60a5fa","#e5e7eb","#34d399"],variantLightId:"grackle-light",variantDarkId:"grackle-dark"},{id:"grackle-light",label:"Grackle Light",description:"Light Grackle variant.",hidden:!0},{id:"grackle-dark",label:"Grackle Dark",description:"Dark Grackle variant.",hidden:!0},{id:"glass",label:"Glassmorphism",description:"Dark frosted-glass aesthetic with backdrop blur effects.",swatches:["#0a0c14","#4ecca3","#70a1ff","#e2e8f0","#a855f7"]},{id:"matrix",label:"Matrix",description:"Phosphor-green CRT terminal with scanlines and glow.",swatches:["#050505","#00ff41","#00bfff","#33ff77","#ffb000"]},{id:"brutalist",label:"Neubrutalism",description:"Thick borders, raw colors, bold type — ugly on purpose.",swatches:["#f5f0e8","#ff5757","#5ce1e6","#1a1a1a","#ffde59"],variantLightId:"brutalist-light",variantDarkId:"brutalist-dark"},{id:"brutalist-light",label:"Neubrutalism Light",description:"Light neubrutalism variant.",hidden:!0},{id:"brutalist-dark",label:"Neubrutalism Dark",description:"Dark neubrutalism variant.",hidden:!0},{id:"monokai",label:"Monokai",description:"Classic warm editor palette — pink, green, and purple.",swatches:["#272822","#f92672","#a6e22e","#f8f8f2","#ae81ff"],variantLightId:"monokai-light",variantDarkId:"monokai-dark"},{id:"monokai-dark",label:"Monokai Dark",description:"Dark Monokai variant.",hidden:!0},{id:"monokai-light",label:"Monokai Light",description:"Light Monokai variant.",hidden:!0},{id:"ubuntu",label:"Ubuntu",description:"Aubergine terminal with the GNOME Tango palette.",swatches:["#300a24","#8ae234","#ef2929","#eeeeec","#fce94f"]},{id:"sandstone",label:"Sandstone",description:"Warm terracotta accent on dark brown, in the style of Claude Code.",swatches:["#1a1815","#C15F3C","#6b8afd","#e8e6e3","#a78bfa"]},{id:"verdigris",label:"Verdigris",description:"Teal accent on charcoal, in the style of ChatGPT.",swatches:["#141414","#00a67e","#3b82f6","#ececec","#ab68ff"]},{id:"primer",label:"Primer",description:"Blue accent on ink-dark grey, in the style of GitHub.",swatches:["#0d1117","#58a6ff","#3fb950","#c9d1d9","#bc8cff"]}],vb=new Set(Sc.map(n=>n.id)),dy="grackle";function _f(n){return Sc.find(a=>a.id===n)}const Sf="grackle-theme",yb="grackle-prefer-system",bb="(prefers-color-scheme: dark)";let Zo=[],Jr;function Xd(){Jr=void 0;for(const n of Zo)n()}function Tf(){return typeof window>"u"?!1:window.matchMedia(bb).matches}function tl(){if(typeof localStorage>"u")return dy;try{const n=localStorage.getItem(Sf);if(n!==null&&vb.has(n))return n}catch{}return dy}function ic(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(yb)==="true"}catch{return!1}}function kf(n){return Sc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function xb(n,a){const i=_f(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?Tf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const l=kf(n);if(l!=null&&l.variantLightId&&l.variantDarkId)return Tf()?l.variantDarkId:l.variantLightId}return n}function Ai(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=xb(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Ai(tl(),ic());function TC(){return Jr===void 0&&(Jr={themeId:tl(),systemDark:Tf(),preferSystem:ic()}),Jr}function kC(n){return Zo=[...Zo,n],()=>{Zo=Zo.filter(a=>a!==n)}}function CC(){const n=x.useSyncExternalStore(kC,TC),{themeId:a,preferSystem:i}=n,l=xb(a,i),r=x.useCallback(f=>{if(vb.has(f)){try{localStorage.setItem(Sf,f)}catch{}Ai(f,ic(),!0),Xd()}},[]),u=x.useCallback(f=>{try{localStorage.setItem(yb,f?"true":"false")}catch{}if(f){const p=tl(),m=_f(p);if(m!=null&&m.hidden){const g=kf(p);if(g)try{localStorage.setItem(Sf,g.id)}catch{}}}Ai(tl(),f,!0),Xd()},[]);return x.useEffect(()=>{Ai(a,i)},[a,i]),x.useEffect(()=>{if(typeof window>"u")return;const f=window.matchMedia(bb),p=()=>{const m=tl(),g=ic();if(g){const y=_f(m);if(y!=null&&y.variantDarkId&&y.variantLightId&&Ai(m,g),y!=null&&y.hidden){const v=kf(m);v!=null&&v.variantDarkId&&v.variantLightId&&Ai(m,g)}}Xd()};return f.addEventListener("change",p),()=>{f.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:l,preferSystem:i,setPreferSystem:u}}const _b=x.createContext(void 0);function EC({children:n}){const a=CC();return c.jsx(_b.Provider,{value:a,children:n})}function Sb(){const n=x.useContext(_b);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const NC="_container_1mq5u_1",AC="_hamburger_1mq5u_33",wC="_brand_1mq5u_49",jC="_brandLogo_1mq5u_68",DC="_info_1mq5u_75",MC="_connectionLabel_1mq5u_90",RC="_connectionDot_1mq5u_103",OC="_connected_1mq5u_106",BC="_disconnected_1mq5u_110",pa={container:NC,hamburger:AC,brand:wC,brandLogo:jC,info:DC,connectionLabel:MC,connectionDot:RC,connected:OC,disconnected:BC};function IC({onToggleSidebar:n,sidebarOpen:a}){const{connected:i,environments:l,sessions:r}=We(),u=Ht(),f=l.length,p=l.filter(g=>g.status==="connected").length,m=r.filter(g=>["running","idle"].includes(g.status)).length;return c.jsxs("div",{className:pa.container,children:[n&&c.jsx("button",{type:"button",className:pa.hamburger,onClick:n,"aria-label":"Toggle sidebar","aria-expanded":a,children:"☰"}),c.jsxs("button",{type:"button",className:pa.brand,onClick:()=>u(_c),title:"Home",children:[c.jsx("img",{src:"/icon-192x192.png",alt:"",className:pa.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),c.jsxs("div",{className:pa.info,children:[c.jsxs("span",{"aria-label":i?"Connected":"Disconnected",children:[c.jsx("span",{className:`${pa.connectionDot} ${i?pa.connected:pa.disconnected}`,"aria-hidden":"true",children:"●"})," ",c.jsx("span",{className:pa.connectionLabel,"aria-hidden":"true",children:i?"Connected":"Disconnected"})]}),c.jsxs("span",{children:[p,"/",f," env",f!==1?"s":""]}),c.jsxs("span",{children:[m," active"]})]})]})}const LC="_nav_13gkc_1",UC="_tab_13gkc_35",zC="_tabIcon_13gkc_68",VC="_tabLabel_13gkc_79",HC="_tabActive_13gkc_84",$o={nav:LC,tab:UC,tabIcon:zC,tabLabel:VC,tabActive:HC},Ts=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:_c,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:Zk,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:Xk,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:Ii,testId:"sidebar-tab-environments"},{view:"settings",label:"Settings",icon:"⚙️",route:Yk,testId:"sidebar-tab-settings"}];function Tb(n){return n===_c||n==="/"?"dashboard":n.startsWith("/chat")||n.startsWith("/sessions")?"chat":n.startsWith("/workspaces")||n.startsWith("/environments")?"environments":n.startsWith(el)?"settings":"tasks"}function GC(){const n=Nt(),a=Ht(),i=x.useRef(null),l=Tb(n.pathname),r=x.useCallback(f=>{a(f.route)},[a]),u=x.useCallback(f=>{var v,b;const p=(v=i.current)==null?void 0:v.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),g=m>=0?m:Ts.findIndex(S=>S.view===l);let y=g;if(f.key==="ArrowRight")f.preventDefault(),y=(g+1)%Ts.length;else if(f.key==="ArrowLeft")f.preventDefault(),y=(g-1+Ts.length)%Ts.length;else if(f.key==="Home")f.preventDefault(),y=0;else if(f.key==="End")f.preventDefault(),y=Ts.length-1;else return;a(Ts[y].route),(b=p[y])==null||b.focus()},[l,a]);return c.jsx("nav",{className:$o.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:u,"data-testid":"sidebar-nav",children:Ts.map(f=>{const p=f.view===l;return c.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${$o.tab} ${p?$o.tabActive:""}`,onClick:()=>r(f),"data-testid":f.testId,title:f.label,"aria-label":f.label,children:[c.jsx("span",{className:$o.tabIcon,"aria-hidden":"true",children:f.icon}),c.jsx("span",{className:$o.tabLabel,children:f.label})]},f.view)})})}const oh=x.createContext({});function lh(n){const a=x.useRef(null);return a.current===null&&(a.current=n()),a.current}const Tc=x.createContext(null),rh=x.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class PC extends x.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 $C({children:n,isPresent:a}){const i=x.useId(),l=x.useRef(null),r=x.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=x.useContext(rh);return x.useInsertionEffect(()=>{const{width:f,height:p,top:m,left:g}=r.current;if(a||!l.current||!f||!p)return;l.current.dataset.motionPopId=i;const y=document.createElement("style");return u&&(y.nonce=u),document.head.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
90
|
-
[data-motion-pop-id="${i}"] {
|
|
91
|
-
position: absolute !important;
|
|
92
|
-
width: ${f}px !important;
|
|
93
|
-
height: ${p}px !important;
|
|
94
|
-
top: ${m}px !important;
|
|
95
|
-
left: ${g}px !important;
|
|
96
|
-
}
|
|
97
|
-
`),()=>{document.head.removeChild(y)}},[a]),c.jsx(PC,{isPresent:a,childRef:l,sizeRef:r,children:x.cloneElement(n,{ref:l})})}const FC=({children:n,initial:a,isPresent:i,onExitComplete:l,custom:r,presenceAffectsLayout:u,mode:f})=>{const p=lh(qC),m=x.useId(),g=x.useCallback(v=>{p.set(v,!0);for(const b of p.values())if(!b)return;l&&l()},[p,l]),y=x.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:v=>(p.set(v,!1),()=>p.delete(v))}),u?[Math.random(),g]:[i,g]);return x.useMemo(()=>{p.forEach((v,b)=>p.set(b,!1))},[i]),x.useEffect(()=>{!i&&!p.size&&l&&l()},[i]),f==="popLayout"&&(n=c.jsx($C,{isPresent:i,children:n})),c.jsx(Tc.Provider,{value:y,children:n})};function qC(){return new Map}function kb(n=!0){const a=x.useContext(Tc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:l,register:r}=a,u=x.useId();x.useEffect(()=>{n&&r(u)},[n]);const f=x.useCallback(()=>n&&l&&l(u),[u,l,n]);return!i&&l?[!1,f]:[!0]}const Gr=n=>n.key||"";function fy(n){const a=[];return x.Children.forEach(n,i=>{x.isValidElement(i)&&a.push(i)}),a}const ch=typeof window<"u",Cb=ch?x.useLayoutEffect:x.useEffect,Zn=({children:n,custom:a,initial:i=!0,onExitComplete:l,presenceAffectsLayout:r=!0,mode:u="sync",propagate:f=!1})=>{const[p,m]=kb(f),g=x.useMemo(()=>fy(n),[n]),y=f&&!p?[]:g.map(Gr),v=x.useRef(!0),b=x.useRef(g),S=lh(()=>new Map),[k,C]=x.useState(g),[N,E]=x.useState(g);Cb(()=>{v.current=!1,b.current=g;for(let M=0;M<N.length;M++){const j=Gr(N[M]);y.includes(j)?S.delete(j):S.get(j)!==!0&&S.set(j,!1)}},[N,y.length,y.join("-")]);const A=[];if(g!==k){let M=[...g];for(let j=0;j<N.length;j++){const K=N[j],q=Gr(K);y.includes(q)||(M.splice(j,0,K),A.push(K))}u==="wait"&&A.length&&(M=A),E(fy(M)),C(g);return}const{forceRender:D}=x.useContext(oh);return c.jsx(c.Fragment,{children:N.map(M=>{const j=Gr(M),K=f&&!p?!1:g===N||y.includes(j),q=()=>{if(S.has(j))S.set(j,!0);else return;let U=!0;S.forEach(W=>{W||(U=!1)}),U&&(D==null||D(),E(b.current),f&&(m==null||m()),l&&l())};return c.jsx(FC,{isPresent:K,initial:!v.current||i?void 0:!1,custom:K?void 0:a,presenceAffectsLayout:r,mode:u,onExitComplete:K?void 0:q,children:M},j)})})},dn=n=>n;let Eb=dn;const YC={useManualTiming:!1};function KC(n){let a=new Set,i=new Set,l=!1,r=!1;const u=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function p(g){u.has(g)&&(m.schedule(g),n()),g(f)}const m={schedule:(g,y=!1,v=!1)=>{const S=v&&l?a:i;return y&&u.add(g),S.has(g)||S.add(g),g},cancel:g=>{i.delete(g),u.delete(g)},process:g=>{if(f=g,l){r=!0;return}l=!0,[a,i]=[i,a],a.forEach(p),a.clear(),l=!1,r&&(r=!1,m.process(g))}};return m}const Pr=["read","resolveKeyframes","update","preRender","render","postRender"],ZC=40;function Nb(n,a){let i=!1,l=!0;const r={delta:0,timestamp:0,isProcessing:!1},u=()=>i=!0,f=Pr.reduce((E,A)=>(E[A]=KC(u),E),{}),{read:p,resolveKeyframes:m,update:g,preRender:y,render:v,postRender:b}=f,S=()=>{const E=performance.now();i=!1,r.delta=l?1e3/60:Math.max(Math.min(E-r.timestamp,ZC),1),r.timestamp=E,r.isProcessing=!0,p.process(r),m.process(r),g.process(r),y.process(r),v.process(r),b.process(r),r.isProcessing=!1,i&&a&&(l=!1,n(S))},k=()=>{i=!0,l=!0,r.isProcessing||n(S)};return{schedule:Pr.reduce((E,A)=>{const D=f[A];return E[A]=(M,j=!1,K=!1)=>(i||k(),D.schedule(M,j,K)),E},{}),cancel:E=>{for(let A=0;A<Pr.length;A++)f[Pr[A]].cancel(E)},state:r,steps:f}}const{schedule:st,cancel:Ja,state:It,steps:Qd}=Nb(typeof requestAnimationFrame<"u"?requestAnimationFrame:dn,!0),Ab=x.createContext({strict:!1}),hy={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"]},Li={};for(const n in hy)Li[n]={isEnabled:a=>hy[n].some(i=>!!a[i])};function XC(n){for(const a in n)Li[a]={...Li[a],...n[a]}}const QC=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 oc(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||QC.has(n)}let wb=n=>!oc(n);function WC(n){n&&(wb=a=>a.startsWith("on")?!oc(a):n(a))}try{WC(require("@emotion/is-prop-valid").default)}catch{}function JC(n,a,i){const l={};for(const r in n)r==="values"&&typeof n.values=="object"||(wb(r)||i===!0&&oc(r)||!a&&!oc(r)||n.draggable&&r.startsWith("onDrag"))&&(l[r]=n[r]);return l}function eE(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...l)=>n(...l);return new Proxy(i,{get:(l,r)=>r==="create"?n:(a.has(r)||a.set(r,n(r)),a.get(r))})}const kc=x.createContext({});function dl(n){return typeof n=="string"||Array.isArray(n)}function Cc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const uh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dh=["initial",...uh];function Ec(n){return Cc(n.animate)||dh.some(a=>dl(n[a]))}function jb(n){return!!(Ec(n)||n.variants)}function tE(n,a){if(Ec(n)){const{initial:i,animate:l}=n;return{initial:i===!1||dl(i)?i:void 0,animate:dl(l)?l:void 0}}return n.inherit!==!1?a:{}}function nE(n){const{initial:a,animate:i}=tE(n,x.useContext(kc));return x.useMemo(()=>({initial:a,animate:i}),[py(a),py(i)])}function py(n){return Array.isArray(n)?n.join(" "):n}const aE=Symbol.for("motionComponentSymbol");function wi(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function sE(n,a,i){return x.useCallback(l=>{l&&n.onMount&&n.onMount(l),a&&(l?a.mount(l):a.unmount()),i&&(typeof i=="function"?i(l):wi(i)&&(i.current=l))},[a])}const fh=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),iE="framerAppearId",Db="data-"+fh(iE),{schedule:hh}=Nb(queueMicrotask,!1),Mb=x.createContext({});function oE(n,a,i,l,r){var u,f;const{visualElement:p}=x.useContext(kc),m=x.useContext(Ab),g=x.useContext(Tc),y=x.useContext(rh).reducedMotion,v=x.useRef(null);l=l||m.renderer,!v.current&&l&&(v.current=l(n,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:y}));const b=v.current,S=x.useContext(Mb);b&&!b.projection&&r&&(b.type==="html"||b.type==="svg")&&lE(v.current,i,r,S);const k=x.useRef(!1);x.useInsertionEffect(()=>{b&&k.current&&b.update(i,g)});const C=i[Db],N=x.useRef(!!C&&!(!((u=window.MotionHandoffIsComplete)===null||u===void 0)&&u.call(window,C))&&((f=window.MotionHasOptimisedAnimation)===null||f===void 0?void 0:f.call(window,C)));return Cb(()=>{b&&(k.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),hh.render(b.render),N.current&&b.animationState&&b.animationState.animateChanges())}),x.useEffect(()=>{b&&(!N.current&&b.animationState&&b.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)===null||E===void 0||E.call(window,C)}),N.current=!1))}),b}function lE(n,a,i,l){const{layoutId:r,layout:u,drag:f,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:Rb(n.parent)),n.projection.setOptions({layoutId:r,layout:u,alwaysMeasureLayout:!!f||p&&wi(p),visualElement:n,animationType:typeof u=="string"?u:"both",initialPromotionConfig:l,layoutScroll:m,layoutRoot:g})}function Rb(n){if(n)return n.options.allowProjection!==!1?n.projection:Rb(n.parent)}function rE({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:l,Component:r}){var u,f;n&&XC(n);function p(g,y){let v;const b={...x.useContext(rh),...g,layoutId:cE(g)},{isStatic:S}=b,k=nE(g),C=l(g,S);if(!S&&ch){uE();const N=dE(b);v=N.MeasureLayout,k.visualElement=oE(r,C,b,a,N.ProjectionNode)}return c.jsxs(kc.Provider,{value:k,children:[v&&k.visualElement?c.jsx(v,{visualElement:k.visualElement,...b}):null,i(r,g,sE(C,k.visualElement,y),C,S,k.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(f=(u=r.displayName)!==null&&u!==void 0?u:r.name)!==null&&f!==void 0?f:""})`}`;const m=x.forwardRef(p);return m[aE]=r,m}function cE({layoutId:n}){const a=x.useContext(oh).id;return a&&n!==void 0?a+"-"+n:n}function uE(n,a){x.useContext(Ab).strict}function dE(n){const{drag:a,layout:i}=Li;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 fE=["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 ph(n){return typeof n!="string"||n.includes("-")?!1:!!(fE.indexOf(n)>-1||/[A-Z]/u.test(n))}function my(n){const a=[{},{}];return n==null||n.values.forEach((i,l)=>{a[0][l]=i.get(),a[1][l]=i.getVelocity()}),a}function mh(n,a,i,l){if(typeof a=="function"){const[r,u]=my(l);a=a(i!==void 0?i:n.custom,r,u)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[r,u]=my(l);a=a(i!==void 0?i:n.custom,r,u)}return a}const Cf=n=>Array.isArray(n),hE=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),pE=n=>Cf(n)?n[n.length-1]||0:n,Vt=n=>!!(n&&n.getVelocity);function ec(n){const a=Vt(n)?n.get():n;return hE(a)?a.toValue():a}function mE({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},l,r,u){const f={latestValues:gE(l,r,u,n),renderState:a()};return i&&(f.onMount=p=>i({props:l,current:p,...f}),f.onUpdate=p=>i(p)),f}const Ob=n=>(a,i)=>{const l=x.useContext(kc),r=x.useContext(Tc),u=()=>mE(n,a,l,r);return i?u():lh(u)};function gE(n,a,i,l){const r={},u=l(n,{});for(const b in u)r[b]=ec(u[b]);let{initial:f,animate:p}=n;const m=Ec(n),g=jb(n);a&&g&&!m&&n.inherit!==!1&&(f===void 0&&(f=a.initial),p===void 0&&(p=a.animate));let y=i?i.initial===!1:!1;y=y||f===!1;const v=y?p:f;if(v&&typeof v!="boolean"&&!Cc(v)){const b=Array.isArray(v)?v:[v];for(let S=0;S<b.length;S++){const k=mh(n,b[S]);if(k){const{transitionEnd:C,transition:N,...E}=k;for(const A in E){let D=E[A];if(Array.isArray(D)){const M=y?D.length-1:0;D=D[M]}D!==null&&(r[A]=D)}for(const A in C)r[A]=C[A]}}}return r}const Fi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Os=new Set(Fi),Bb=n=>a=>typeof a=="string"&&a.startsWith(n),Ib=Bb("--"),vE=Bb("var(--"),gh=n=>vE(n)?yE.test(n.split("/*")[0].trim()):!1,yE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Lb=(n,a)=>a&&typeof n=="number"?a.transform(n):n,xa=(n,a,i)=>i>a?a:i<n?n:i,qi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},fl={...qi,transform:n=>xa(0,1,n)},$r={...qi,default:1},bl=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),Za=bl("deg"),Yn=bl("%"),ve=bl("px"),bE=bl("vh"),xE=bl("vw"),gy={...Yn,parse:n=>Yn.parse(n)/100,transform:n=>Yn.transform(n*100)},_E={borderWidth:ve,borderTopWidth:ve,borderRightWidth:ve,borderBottomWidth:ve,borderLeftWidth:ve,borderRadius:ve,radius:ve,borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomRightRadius:ve,borderBottomLeftRadius:ve,width:ve,maxWidth:ve,height:ve,maxHeight:ve,top:ve,right:ve,bottom:ve,left:ve,padding:ve,paddingTop:ve,paddingRight:ve,paddingBottom:ve,paddingLeft:ve,margin:ve,marginTop:ve,marginRight:ve,marginBottom:ve,marginLeft:ve,backgroundPositionX:ve,backgroundPositionY:ve},SE={rotate:Za,rotateX:Za,rotateY:Za,rotateZ:Za,scale:$r,scaleX:$r,scaleY:$r,scaleZ:$r,skew:Za,skewX:Za,skewY:Za,distance:ve,translateX:ve,translateY:ve,translateZ:ve,x:ve,y:ve,z:ve,perspective:ve,transformPerspective:ve,opacity:fl,originX:gy,originY:gy,originZ:ve},vy={...qi,transform:Math.round},vh={..._E,...SE,zIndex:vy,size:ve,fillOpacity:fl,strokeOpacity:fl,numOctaves:vy},TE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},kE=Fi.length;function CE(n,a,i){let l="",r=!0;for(let u=0;u<kE;u++){const f=Fi[u],p=n[f];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(f.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const g=Lb(p,vh[f]);if(!m){r=!1;const y=TE[f]||f;l+=`${y}(${g}) `}i&&(a[f]=g)}}return l=l.trim(),i?l=i(a,r?"":l):r&&(l="none"),l}function yh(n,a,i){const{style:l,vars:r,transformOrigin:u}=n;let f=!1,p=!1;for(const m in a){const g=a[m];if(Os.has(m)){f=!0;continue}else if(Ib(m)){r[m]=g;continue}else{const y=Lb(g,vh[m]);m.startsWith("origin")?(p=!0,u[m]=y):l[m]=y}}if(a.transform||(f||i?l.transform=CE(a,n.transform,i):l.transform&&(l.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:y=0}=u;l.transformOrigin=`${m} ${g} ${y}`}}const EE={offset:"stroke-dashoffset",array:"stroke-dasharray"},NE={offset:"strokeDashoffset",array:"strokeDasharray"};function AE(n,a,i=1,l=0,r=!0){n.pathLength=1;const u=r?EE:NE;n[u.offset]=ve.transform(-l);const f=ve.transform(a),p=ve.transform(i);n[u.array]=`${f} ${p}`}function yy(n,a,i){return typeof n=="string"?n:ve.transform(a+i*n)}function wE(n,a,i){const l=yy(a,n.x,n.width),r=yy(i,n.y,n.height);return`${l} ${r}`}function bh(n,{attrX:a,attrY:i,attrScale:l,originX:r,originY:u,pathLength:f,pathSpacing:p=1,pathOffset:m=0,...g},y,v){if(yh(n,g,v),y){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:b,style:S,dimensions:k}=n;b.transform&&(k&&(S.transform=b.transform),delete b.transform),k&&(r!==void 0||u!==void 0||S.transform)&&(S.transformOrigin=wE(k,r!==void 0?r:.5,u!==void 0?u:.5)),a!==void 0&&(b.x=a),i!==void 0&&(b.y=i),l!==void 0&&(b.scale=l),f!==void 0&&AE(b,f,p,m,!1)}const xh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Ub=()=>({...xh(),attrs:{}}),_h=n=>typeof n=="string"&&n.toLowerCase()==="svg";function zb(n,{style:a,vars:i},l,r){Object.assign(n.style,a,r&&r.getProjectionStyles(l));for(const u in i)n.style.setProperty(u,i[u])}const Vb=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 Hb(n,a,i,l){zb(n,a,void 0,l);for(const r in a.attrs)n.setAttribute(Vb.has(r)?r:fh(r),a.attrs[r])}const lc={};function jE(n){Object.assign(lc,n)}function Gb(n,{layout:a,layoutId:i}){return Os.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!lc[n]||n==="opacity")}function Sh(n,a,i){var l;const{style:r}=n,u={};for(const f in r)(Vt(r[f])||a.style&&Vt(a.style[f])||Gb(f,n)||((l=i==null?void 0:i.getValue(f))===null||l===void 0?void 0:l.liveStyle)!==void 0)&&(u[f]=r[f]);return u}function Pb(n,a,i){const l=Sh(n,a,i);for(const r in n)if(Vt(n[r])||Vt(a[r])){const u=Fi.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;l[u]=n[r]}return l}function DE(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 by=["x","y","width","height","cx","cy","r"],ME={useVisualState:Ob({scrapeMotionValuesFromProps:Pb,createRenderState:Ub,onUpdate:({props:n,prevProps:a,current:i,renderState:l,latestValues:r})=>{if(!i)return;let u=!!n.drag;if(!u){for(const p in r)if(Os.has(p)){u=!0;break}}if(!u)return;let f=!a;if(a)for(let p=0;p<by.length;p++){const m=by[p];n[m]!==a[m]&&(f=!0)}f&&st.read(()=>{DE(i,l),st.render(()=>{bh(l,r,_h(i.tagName),n.transformTemplate),Hb(i,l)})})}})},RE={useVisualState:Ob({scrapeMotionValuesFromProps:Sh,createRenderState:xh})};function $b(n,a,i){for(const l in a)!Vt(a[l])&&!Gb(l,i)&&(n[l]=a[l])}function OE({transformTemplate:n},a){return x.useMemo(()=>{const i=xh();return yh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function BE(n,a){const i=n.style||{},l={};return $b(l,i,n),Object.assign(l,OE(n,a)),l}function IE(n,a){const i={},l=BE(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 LE(n,a,i,l){const r=x.useMemo(()=>{const u=Ub();return bh(u,a,_h(l),n.transformTemplate),{...u.attrs,style:{...u.style}}},[a]);if(n.style){const u={};$b(u,n.style,n),r.style={...u,...r.style}}return r}function UE(n=!1){return(i,l,r,{latestValues:u},f)=>{const m=(ph(i)?LE:IE)(l,u,f,i),g=JC(l,typeof i=="string",n),y=i!==x.Fragment?{...g,...m,ref:r}:{},{children:v}=l,b=x.useMemo(()=>Vt(v)?v.get():v,[v]);return x.createElement(i,{...y,children:b})}}function zE(n,a){return function(l,{forwardMotionProps:r}={forwardMotionProps:!1}){const f={...ph(l)?ME:RE,preloadedFeatures:n,useRender:UE(r),createVisualElement:a,Component:l};return rE(f)}}function Fb(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 Nc(n,a,i){const l=n.getProps();return mh(l,a,i!==void 0?i:l.custom,n)}function Th(n,a){return n?n[a]||n.default||n:void 0}const qb=new Set(["width","height","top","left","right","bottom",...Fi]);let tc;function VE(){tc=void 0}const Kn={now:()=>(tc===void 0&&Kn.set(It.isProcessing||YC.useManualTiming?It.timestamp:performance.now()),tc),set:n=>{tc=n,queueMicrotask(VE)}};function kh(n,a){n.indexOf(a)===-1&&n.push(a)}function Ch(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class Eh{constructor(){this.subscriptions=[]}add(a){return kh(this.subscriptions,a),()=>Ch(this.subscriptions,a)}notify(a,i,l){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,l);else for(let u=0;u<r;u++){const f=this.subscriptions[u];f&&f(a,i,l)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Yb(n,a){return a?n*(1e3/a):0}const xy=30,HE=n=>!isNaN(parseFloat(n));class GE{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(l,r=!0)=>{const u=Kn.now();this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(l),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=Kn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=HE(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 Eh);const l=this.events[a].add(i);return a==="change"?()=>{l(),st.read(()=>{this.events.change.getSize()||this.stop()})}:l}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,i){this.passiveEffect=a,this.stopPassiveEffect=i}set(a,i=!0){!i||!this.passiveEffect?this.updateAndNotify(a,i):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,i,l){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-l}jump(a,i=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=Kn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>xy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,xy);return Yb(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 hl(n,a){return new GE(n,a)}function PE(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,hl(i))}function $E(n,a){const i=Nc(n,a);let{transitionEnd:l={},transition:r={},...u}=i||{};u={...u,...l};for(const f in u){const p=pE(u[f]);PE(n,f,p)}}function FE(n){return!!(Vt(n)&&n.add)}function Ef(n,a){const i=n.getValue("willChange");if(FE(i))return i.add(a)}function Kb(n){return n.props[Db]}function Nh(n){let a;return()=>(a===void 0&&(a=n()),a)}const qE=Nh(()=>window.ScrollTimeline!==void 0);class YE{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(r=>{if(qE()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{l.forEach((r,u)=>{r&&r(),this.animations[u].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let i=0;i<this.animations.length;i++)a=Math.max(a,this.animations[i].duration);return a}runAll(a){this.animations.forEach(i=>i[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class KE extends YE{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const ga=n=>n*1e3,va=n=>n/1e3;function Ah(n){return typeof n=="function"}function _y(n,a){n.timeline=a,n.onfinish=null}const wh=n=>Array.isArray(n)&&typeof n[0]=="number",ZE={linearEasing:void 0};function XE(n,a){const i=Nh(n);return()=>{var l;return(l=ZE[a])!==null&&l!==void 0?l:i()}}const rc=XE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ui=(n,a,i)=>{const l=a-n;return l===0?1:(i-n)/l},Zb=(n,a,i=10)=>{let l="";const r=Math.max(Math.round(a/i),2);for(let u=0;u<r;u++)l+=n(Ui(0,r-1,u))+", ";return`linear(${l.substring(0,l.length-2)})`};function Xb(n){return!!(typeof n=="function"&&rc()||!n||typeof n=="string"&&(n in Nf||rc())||wh(n)||Array.isArray(n)&&n.every(Xb))}const Xo=([n,a,i,l])=>`cubic-bezier(${n}, ${a}, ${i}, ${l})`,Nf={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 Qb(n,a){if(n)return typeof n=="function"&&rc()?Zb(n,a):wh(n)?Xo(n):Array.isArray(n)?n.map(i=>Qb(i,a)||Nf.easeOut):Nf[n]}const Wb=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,QE=1e-7,WE=12;function JE(n,a,i,l,r){let u,f,p=0;do f=a+(i-a)/2,u=Wb(f,l,r)-n,u>0?i=f:a=f;while(Math.abs(u)>QE&&++p<WE);return f}function xl(n,a,i,l){if(n===a&&i===l)return dn;const r=u=>JE(u,0,1,n,i);return u=>u===0||u===1?u:Wb(r(u),a,l)}const Jb=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,ex=n=>a=>1-n(1-a),tx=xl(.33,1.53,.69,.99),jh=ex(tx),nx=Jb(jh),ax=n=>(n*=2)<1?.5*jh(n):.5*(2-Math.pow(2,-10*(n-1))),Dh=n=>1-Math.sin(Math.acos(n)),sx=ex(Dh),ix=Jb(Dh),ox=n=>/^0[^.\s]+$/u.test(n);function eN(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||ox(n):!0}const nl=n=>Math.round(n*1e5)/1e5,Mh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function tN(n){return n==null}const nN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Rh=(n,a)=>i=>!!(typeof i=="string"&&nN.test(i)&&i.startsWith(n)||a&&!tN(i)&&Object.prototype.hasOwnProperty.call(i,a)),lx=(n,a,i)=>l=>{if(typeof l!="string")return l;const[r,u,f,p]=l.match(Mh);return{[n]:parseFloat(r),[a]:parseFloat(u),[i]:parseFloat(f),alpha:p!==void 0?parseFloat(p):1}},aN=n=>xa(0,255,n),Wd={...qi,transform:n=>Math.round(aN(n))},js={test:Rh("rgb","red"),parse:lx("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:l=1})=>"rgba("+Wd.transform(n)+", "+Wd.transform(a)+", "+Wd.transform(i)+", "+nl(fl.transform(l))+")"};function sN(n){let a="",i="",l="",r="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),l=n.substring(5,7),r=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),l=n.substring(3,4),r=n.substring(4,5),a+=a,i+=i,l+=l,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(l,16),alpha:r?parseInt(r,16)/255:1}}const Af={test:Rh("#"),parse:sN,transform:js.transform},ji={test:Rh("hsl","hue"),parse:lx("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:l=1})=>"hsla("+Math.round(n)+", "+Yn.transform(nl(a))+", "+Yn.transform(nl(i))+", "+nl(fl.transform(l))+")"},zt={test:n=>js.test(n)||Af.test(n)||ji.test(n),parse:n=>js.test(n)?js.parse(n):ji.test(n)?ji.parse(n):Af.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?js.transform(n):ji.transform(n)},iN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function oN(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(Mh))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(iN))===null||i===void 0?void 0:i.length)||0)>0}const rx="number",cx="color",lN="var",rN="var(",Sy="${}",cN=/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 pl(n){const a=n.toString(),i=[],l={color:[],number:[],var:[]},r=[];let u=0;const p=a.replace(cN,m=>(zt.test(m)?(l.color.push(u),r.push(cx),i.push(zt.parse(m))):m.startsWith(rN)?(l.var.push(u),r.push(lN),i.push(m)):(l.number.push(u),r.push(rx),i.push(parseFloat(m))),++u,Sy)).split(Sy);return{values:i,split:p,indexes:l,types:r}}function ux(n){return pl(n).values}function dx(n){const{split:a,types:i}=pl(n),l=a.length;return r=>{let u="";for(let f=0;f<l;f++)if(u+=a[f],r[f]!==void 0){const p=i[f];p===rx?u+=nl(r[f]):p===cx?u+=zt.transform(r[f]):u+=r[f]}return u}}const uN=n=>typeof n=="number"?0:n;function dN(n){const a=ux(n);return dx(n)(a.map(uN))}const es={test:oN,parse:ux,createTransformer:dx,getAnimatableNone:dN},fN=new Set(["brightness","contrast","saturate","opacity"]);function hN(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[l]=i.match(Mh)||[];if(!l)return n;const r=i.replace(l,"");let u=fN.has(a)?1:0;return l!==i&&(u*=100),a+"("+u+r+")"}const pN=/\b([a-z-]*)\(.*?\)/gu,wf={...es,getAnimatableNone:n=>{const a=n.match(pN);return a?a.map(hN).join(" "):n}},mN={...vh,color:zt,backgroundColor:zt,outlineColor:zt,fill:zt,stroke:zt,borderColor:zt,borderTopColor:zt,borderRightColor:zt,borderBottomColor:zt,borderLeftColor:zt,filter:wf,WebkitFilter:wf},Oh=n=>mN[n];function fx(n,a){let i=Oh(n);return i!==wf&&(i=es),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const gN=new Set(["auto","none","0"]);function vN(n,a,i){let l=0,r;for(;l<n.length&&!r;){const u=n[l];typeof u=="string"&&!gN.has(u)&&pl(u).values.length&&(r=n[l]),l++}if(r&&i)for(const u of a)n[u]=fx(i,r)}const Ty=n=>n===qi||n===ve,ky=(n,a)=>parseFloat(n.split(", ")[a]),Cy=(n,a)=>(i,{transform:l})=>{if(l==="none"||!l)return 0;const r=l.match(/^matrix3d\((.+)\)$/u);if(r)return ky(r[1],a);{const u=l.match(/^matrix\((.+)\)$/u);return u?ky(u[1],n):0}},yN=new Set(["x","y","z"]),bN=Fi.filter(n=>!yN.has(n));function xN(n){const a=[];return bN.forEach(i=>{const l=n.getValue(i);l!==void 0&&(a.push([i,l.get()]),l.set(i.startsWith("scale")?1:0))}),a}const zi={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:Cy(4,13),y:Cy(5,14)};zi.translateX=zi.x;zi.translateY=zi.y;const Ds=new Set;let jf=!1,Df=!1;function hx(){if(Df){const n=Array.from(Ds).filter(l=>l.needsMeasurement),a=new Set(n.map(l=>l.element)),i=new Map;a.forEach(l=>{const r=xN(l);r.length&&(i.set(l,r),l.render())}),n.forEach(l=>l.measureInitialState()),a.forEach(l=>{l.render();const r=i.get(l);r&&r.forEach(([u,f])=>{var p;(p=l.getValue(u))===null||p===void 0||p.set(f)})}),n.forEach(l=>l.measureEndState()),n.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}Df=!1,jf=!1,Ds.forEach(n=>n.complete()),Ds.clear()}function px(){Ds.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Df=!0)})}function _N(){px(),hx()}class Bh{constructor(a,i,l,r,u,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=r,this.element=u,this.isAsync=f}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ds.add(this),jf||(jf=!0,st.read(px),st.resolveKeyframes(hx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:l,motionValue:r}=this;for(let u=0;u<a.length;u++)if(a[u]===null)if(u===0){const f=r==null?void 0:r.get(),p=a[a.length-1];if(f!==void 0)a[0]=f;else if(l&&i){const m=l.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),r&&f===void 0&&r.set(a[0])}else a[u]=a[u-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ds.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ds.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const mx=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),SN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function TN(n){const a=SN.exec(n);if(!a)return[,];const[,i,l,r]=a;return[`--${i??l}`,r]}function gx(n,a,i=1){const[l,r]=TN(n);if(!l)return;const u=window.getComputedStyle(a).getPropertyValue(l);if(u){const f=u.trim();return mx(f)?parseFloat(f):f}return gh(r)?gx(r,a,i+1):r}const vx=n=>a=>a.test(n),kN={test:n=>n==="auto",parse:n=>n},yx=[qi,ve,Yn,Za,xE,bE,kN],Ey=n=>yx.find(vx(n));class bx extends Bh{constructor(a,i,l,r,u){super(a,i,l,r,u,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:l}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<a.length;m++){let g=a[m];if(typeof g=="string"&&(g=g.trim(),gh(g))){const y=gx(g,i.current);y!==void 0&&(a[m]=y),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!qb.has(l)||a.length!==2)return;const[r,u]=a,f=Ey(r),p=Ey(u);if(f!==p)if(Ty(f)&&Ty(p))for(let m=0;m<a.length;m++){const g=a[m];typeof g=="string"&&(a[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,l=[];for(let r=0;r<a.length;r++)eN(a[r])&&l.push(r);l.length&&vN(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=zi[l](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&a.getValue(l,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:l,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const u=i.getValue(l);u&&u.jump(this.measuredOrigin,!1);const f=r.length-1,p=r[f];r[f]=zi[l](i.measureViewportBox(),window.getComputedStyle(i.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([m,g])=>{i.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const Ny=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(es.test(n)||n==="0")&&!n.startsWith("url("));function CN(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 EN(n,a,i,l){const r=n[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const u=n[n.length-1],f=Ny(r,a),p=Ny(u,a);return!f||!p?!1:CN(n)||(i==="spring"||Ah(i))&&l}const NN=n=>n!==null;function Ac(n,{repeat:a,repeatType:i="loop"},l){const r=n.filter(NN),u=a&&i!=="loop"&&a%2===1?0:r.length-1;return!u||l===void 0?r[u]:l}const AN=40;class xx{constructor({autoplay:a=!0,delay:i=0,type:l="keyframes",repeat:r=0,repeatDelay:u=0,repeatType:f="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Kn.now(),this.options={autoplay:a,delay:i,type:l,repeat:r,repeatDelay:u,repeatType:f,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>AN?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&_N(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Kn.now(),this.hasAttemptedResolve=!0;const{name:l,type:r,velocity:u,delay:f,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!EN(a,l,r,u))if(f)this.options.duration=0;else{m&&m(Ac(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const y=this.initPlayback(a,i);y!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...y},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 Mf=2e4;function _x(n){let a=0;const i=50;let l=n.next(a);for(;!l.done&&a<Mf;)a+=i,l=n.next(a);return a>=Mf?1/0:a}const rt=(n,a,i)=>n+(a-n)*i;function Jd(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 wN({hue:n,saturation:a,lightness:i,alpha:l}){n/=360,a/=100,i/=100;let r=0,u=0,f=0;if(!a)r=u=f=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=Jd(m,p,n+1/3),u=Jd(m,p,n),f=Jd(m,p,n-1/3)}return{red:Math.round(r*255),green:Math.round(u*255),blue:Math.round(f*255),alpha:l}}function cc(n,a){return i=>i>0?a:n}const ef=(n,a,i)=>{const l=n*n,r=i*(a*a-l)+l;return r<0?0:Math.sqrt(r)},jN=[Af,js,ji],DN=n=>jN.find(a=>a.test(n));function Ay(n){const a=DN(n);if(!a)return!1;let i=a.parse(n);return a===ji&&(i=wN(i)),i}const wy=(n,a)=>{const i=Ay(n),l=Ay(a);if(!i||!l)return cc(n,a);const r={...i};return u=>(r.red=ef(i.red,l.red,u),r.green=ef(i.green,l.green,u),r.blue=ef(i.blue,l.blue,u),r.alpha=rt(i.alpha,l.alpha,u),js.transform(r))},MN=(n,a)=>i=>a(n(i)),_l=(...n)=>n.reduce(MN),Rf=new Set(["none","hidden"]);function RN(n,a){return Rf.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function ON(n,a){return i=>rt(n,a,i)}function Ih(n){return typeof n=="number"?ON:typeof n=="string"?gh(n)?cc:zt.test(n)?wy:LN:Array.isArray(n)?Sx:typeof n=="object"?zt.test(n)?wy:BN:cc}function Sx(n,a){const i=[...n],l=i.length,r=n.map((u,f)=>Ih(u)(u,a[f]));return u=>{for(let f=0;f<l;f++)i[f]=r[f](u);return i}}function BN(n,a){const i={...n,...a},l={};for(const r in i)n[r]!==void 0&&a[r]!==void 0&&(l[r]=Ih(n[r])(n[r],a[r]));return r=>{for(const u in l)i[u]=l[u](r);return i}}function IN(n,a){var i;const l=[],r={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const f=a.types[u],p=n.indexes[f][r[f]],m=(i=n.values[p])!==null&&i!==void 0?i:0;l[u]=m,r[f]++}return l}const LN=(n,a)=>{const i=es.createTransformer(a),l=pl(n),r=pl(a);return l.indexes.var.length===r.indexes.var.length&&l.indexes.color.length===r.indexes.color.length&&l.indexes.number.length>=r.indexes.number.length?Rf.has(n)&&!r.values.length||Rf.has(a)&&!l.values.length?RN(n,a):_l(Sx(IN(l,r),r.values),i):cc(n,a)};function Tx(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?rt(n,a,i):Ih(n)(n,a)}const UN=5;function kx(n,a,i){const l=Math.max(a-UN,0);return Yb(i-n(l),a-l)}const dt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},tf=.001;function zN({duration:n=dt.duration,bounce:a=dt.bounce,velocity:i=dt.velocity,mass:l=dt.mass}){let r,u,f=1-a;f=xa(dt.minDamping,dt.maxDamping,f),n=xa(dt.minDuration,dt.maxDuration,va(n)),f<1?(r=g=>{const y=g*f,v=y*n,b=y-i,S=Of(g,f),k=Math.exp(-v);return tf-b/S*k},u=g=>{const v=g*f*n,b=v*i+i,S=Math.pow(f,2)*Math.pow(g,2)*n,k=Math.exp(-v),C=Of(Math.pow(g,2),f);return(-r(g)+tf>0?-1:1)*((b-S)*k)/C}):(r=g=>{const y=Math.exp(-g*n),v=(g-i)*n+1;return-tf+y*v},u=g=>{const y=Math.exp(-g*n),v=(i-g)*(n*n);return y*v});const p=5/n,m=HN(r,u,p);if(n=ga(n),isNaN(m))return{stiffness:dt.stiffness,damping:dt.damping,duration:n};{const g=Math.pow(m,2)*l;return{stiffness:g,damping:f*2*Math.sqrt(l*g),duration:n}}}const VN=12;function HN(n,a,i){let l=i;for(let r=1;r<VN;r++)l=l-n(l)/a(l);return l}function Of(n,a){return n*Math.sqrt(1-a*a)}const GN=["duration","bounce"],PN=["stiffness","damping","mass"];function jy(n,a){return a.some(i=>n[i]!==void 0)}function $N(n){let a={velocity:dt.velocity,stiffness:dt.stiffness,damping:dt.damping,mass:dt.mass,isResolvedFromDuration:!1,...n};if(!jy(n,PN)&&jy(n,GN))if(n.visualDuration){const i=n.visualDuration,l=2*Math.PI/(i*1.2),r=l*l,u=2*xa(.05,1,1-(n.bounce||0))*Math.sqrt(r);a={...a,mass:dt.mass,stiffness:r,damping:u}}else{const i=zN(n);a={...a,...i,mass:dt.mass},a.isResolvedFromDuration=!0}return a}function Cx(n=dt.visualDuration,a=dt.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:l,restDelta:r}=i;const u=i.keyframes[0],f=i.keyframes[i.keyframes.length-1],p={done:!1,value:u},{stiffness:m,damping:g,mass:y,duration:v,velocity:b,isResolvedFromDuration:S}=$N({...i,velocity:-va(i.velocity||0)}),k=b||0,C=g/(2*Math.sqrt(m*y)),N=f-u,E=va(Math.sqrt(m/y)),A=Math.abs(N)<5;l||(l=A?dt.restSpeed.granular:dt.restSpeed.default),r||(r=A?dt.restDelta.granular:dt.restDelta.default);let D;if(C<1){const j=Of(E,C);D=K=>{const q=Math.exp(-C*E*K);return f-q*((k+C*E*N)/j*Math.sin(j*K)+N*Math.cos(j*K))}}else if(C===1)D=j=>f-Math.exp(-E*j)*(N+(k+E*N)*j);else{const j=E*Math.sqrt(C*C-1);D=K=>{const q=Math.exp(-C*E*K),U=Math.min(j*K,300);return f-q*((k+C*E*N)*Math.sinh(U)+j*N*Math.cosh(U))/j}}const M={calculatedDuration:S&&v||null,next:j=>{const K=D(j);if(S)p.done=j>=v;else{let q=0;C<1&&(q=j===0?ga(k):kx(D,j,K));const U=Math.abs(q)<=l,W=Math.abs(f-K)<=r;p.done=U&&W}return p.value=p.done?f:K,p},toString:()=>{const j=Math.min(_x(M),Mf),K=Zb(q=>M.next(j*q).value,j,30);return j+"ms "+K}};return M}function Dy({keyframes:n,velocity:a=0,power:i=.8,timeConstant:l=325,bounceDamping:r=10,bounceStiffness:u=500,modifyTarget:f,min:p,max:m,restDelta:g=.5,restSpeed:y}){const v=n[0],b={done:!1,value:v},S=U=>p!==void 0&&U<p||m!==void 0&&U>m,k=U=>p===void 0?m:m===void 0||Math.abs(p-U)<Math.abs(m-U)?p:m;let C=i*a;const N=v+C,E=f===void 0?N:f(N);E!==N&&(C=E-v);const A=U=>-C*Math.exp(-U/l),D=U=>E+A(U),M=U=>{const W=A(U),ee=D(U);b.done=Math.abs(W)<=g,b.value=b.done?E:ee};let j,K;const q=U=>{S(b.value)&&(j=U,K=Cx({keyframes:[b.value,k(b.value)],velocity:kx(D,U,b.value),damping:r,stiffness:u,restDelta:g,restSpeed:y}))};return q(0),{calculatedDuration:null,next:U=>{let W=!1;return!K&&j===void 0&&(W=!0,M(U),q(U)),j!==void 0&&U>=j?K.next(U-j):(!W&&M(U),b)}}}const FN=xl(.42,0,1,1),qN=xl(0,0,.58,1),Ex=xl(.42,0,.58,1),YN=n=>Array.isArray(n)&&typeof n[0]!="number",KN={linear:dn,easeIn:FN,easeInOut:Ex,easeOut:qN,circIn:Dh,circInOut:ix,circOut:sx,backIn:jh,backInOut:nx,backOut:tx,anticipate:ax},My=n=>{if(wh(n)){Eb(n.length===4);const[a,i,l,r]=n;return xl(a,i,l,r)}else if(typeof n=="string")return KN[n];return n};function ZN(n,a,i){const l=[],r=i||Tx,u=n.length-1;for(let f=0;f<u;f++){let p=r(n[f],n[f+1]);if(a){const m=Array.isArray(a)?a[f]||dn:a;p=_l(m,p)}l.push(p)}return l}function XN(n,a,{clamp:i=!0,ease:l,mixer:r}={}){const u=n.length;if(Eb(u===a.length),u===1)return()=>a[0];if(u===2&&a[0]===a[1])return()=>a[1];const f=n[0]===n[1];n[0]>n[u-1]&&(n=[...n].reverse(),a=[...a].reverse());const p=ZN(a,l,r),m=p.length,g=y=>{if(f&&y<n[0])return a[0];let v=0;if(m>1)for(;v<n.length-2&&!(y<n[v+1]);v++);const b=Ui(n[v],n[v+1],y);return p[v](b)};return i?y=>g(xa(n[0],n[u-1],y)):g}function QN(n,a){const i=n[n.length-1];for(let l=1;l<=a;l++){const r=Ui(0,a,l);n.push(rt(i,1,r))}}function WN(n){const a=[0];return QN(a,n.length-1),a}function JN(n,a){return n.map(i=>i*a)}function eA(n,a){return n.map(()=>a||Ex).splice(0,n.length-1)}function uc({duration:n=300,keyframes:a,times:i,ease:l="easeInOut"}){const r=YN(l)?l.map(My):My(l),u={done:!1,value:a[0]},f=JN(i&&i.length===a.length?i:WN(a),n),p=XN(f,a,{ease:Array.isArray(r)?r:eA(a,r)});return{calculatedDuration:n,next:m=>(u.value=p(m),u.done=m>=n,u)}}const tA=n=>{const a=({timestamp:i})=>n(i);return{start:()=>st.update(a,!0),stop:()=>Ja(a),now:()=>It.isProcessing?It.timestamp:Kn.now()}},nA={decay:Dy,inertia:Dy,tween:uc,keyframes:uc,spring:Cx},aA=n=>n/100;class Lh extends xx{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:i,motionValue:l,element:r,keyframes:u}=this.options,f=(r==null?void 0:r.KeyframeResolver)||Bh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new f(u,p,i,l,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:l=0,repeatDelay:r=0,repeatType:u,velocity:f=0}=this.options,p=Ah(i)?i:nA[i]||uc;let m,g;p!==uc&&typeof a[0]!="number"&&(m=_l(aA,Tx(a[0],a[1])),a=[0,100]);const y=p({...this.options,keyframes:a});u==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-f})),y.calculatedDuration===null&&(y.calculatedDuration=_x(y));const{calculatedDuration:v}=y,b=v+r,S=b*(l+1)-r;return{generator:y,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:v,resolvedDuration:b,totalDuration:S}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,i=!1){const{resolved:l}=this;if(!l){const{keyframes:U}=this.options;return{done:!0,value:U[U.length-1]}}const{finalKeyframe:r,generator:u,mirroredGenerator:f,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:y,resolvedDuration:v}=l;if(this.startTime===null)return u.next(0);const{delay:b,repeat:S,repeatType:k,repeatDelay:C,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-y/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 E=this.currentTime-b*(this.speed>=0?1:-1),A=this.speed>=0?E<0:E>y;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=y);let D=this.currentTime,M=u;if(S){const U=Math.min(this.currentTime,y)/v;let W=Math.floor(U),ee=U%1;!ee&&U>=1&&(ee=1),ee===1&&W--,W=Math.min(W,S+1),!!(W%2)&&(k==="reverse"?(ee=1-ee,C&&(ee-=C/v)):k==="mirror"&&(M=f)),D=xa(0,1,ee)*v}const j=A?{done:!1,value:m[0]}:M.next(D);p&&(j.value=p(j.value));let{done:K}=j;!A&&g!==null&&(K=this.speed>=0?this.currentTime>=y:this.currentTime<=0);const q=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&K);return q&&r!==void 0&&(j.value=Ac(m,this.options,r)),N&&N(j.value),q&&this.finish(),j}get duration(){const{resolved:a}=this;return a?va(a.calculatedDuration):0}get time(){return va(this.currentTime)}set time(a){a=ga(a),this.currentTime=a,this.holdTime!==null||this.speed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.speed)}get speed(){return this.playbackSpeed}set speed(a){const i=this.playbackSpeed!==a;this.playbackSpeed=a,i&&(this.time=va(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=tA,onPlay:i,startTime:l}=this.options;this.driver||(this.driver=a(u=>this.tick(u))),i&&i();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=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 sA=new Set(["opacity","clipPath","filter","transform"]);function iA(n,a,i,{delay:l=0,duration:r=300,repeat:u=0,repeatType:f="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const y=Qb(p,r);return Array.isArray(y)&&(g.easing=y),n.animate(g,{delay:l,duration:r,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:u+1,direction:f==="reverse"?"alternate":"normal"})}const oA=Nh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),dc=10,lA=2e4;function rA(n){return Ah(n.type)||n.type==="spring"||!Xb(n.ease)}function cA(n,a){const i=new Lh({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let l={done:!1,value:n[0]};const r=[];let u=0;for(;!l.done&&u<lA;)l=i.sample(u),r.push(l.value),u+=dc;return{times:void 0,keyframes:r,duration:u-dc,ease:"linear"}}const Nx={anticipate:ax,backInOut:nx,circInOut:ix};function uA(n){return n in Nx}class Ry extends xx{constructor(a){super(a);const{name:i,motionValue:l,element:r,keyframes:u}=this.options;this.resolver=new bx(u,(f,p)=>this.onKeyframesResolved(f,p),i,l,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:l=300,times:r,ease:u,type:f,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof u=="string"&&rc()&&uA(u)&&(u=Nx[u]),rA(this.options)){const{onComplete:v,onUpdate:b,motionValue:S,element:k,...C}=this.options,N=cA(a,C);a=N.keyframes,a.length===1&&(a[1]=a[0]),l=N.duration,r=N.times,u=N.ease,f="keyframes"}const y=iA(p.owner.current,m,a,{...this.options,duration:l,times:r,ease:u});return y.startTime=g??this.calcStartTime(),this.pendingTimeline?(_y(y,this.pendingTimeline),this.pendingTimeline=void 0):y.onfinish=()=>{const{onComplete:v}=this.options;p.set(Ac(a,this.options,i)),v&&v(),this.cancel(),this.resolveFinishedPromise()},{animation:y,duration:l,times:r,type:f,ease:u,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return va(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return va(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.currentTime=ga(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 dn;const{animation:l}=i;_y(l,a)}return dn}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:r,type:u,ease:f,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:y,onComplete:v,element:b,...S}=this.options,k=new Lh({...S,keyframes:l,duration:r,type:u,ease:f,times:p,isGenerator:!0}),C=ga(this.time);g.setWithVelocity(k.sample(C-dc).value,k.sample(C).value,dc)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:l,repeatDelay:r,repeatType:u,damping:f,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=i.owner.getProps();return oA()&&l&&sA.has(l)&&!m&&!g&&!r&&u!=="mirror"&&f!==0&&p!=="inertia"}}const dA={type:"spring",stiffness:500,damping:25,restSpeed:10},fA=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),hA={type:"keyframes",duration:.8},pA={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mA=(n,{keyframes:a})=>a.length>2?hA:Os.has(n)?n.startsWith("scale")?fA(a[1]):dA:pA;function gA({when:n,delay:a,delayChildren:i,staggerChildren:l,staggerDirection:r,repeat:u,repeatType:f,repeatDelay:p,from:m,elapsed:g,...y}){return!!Object.keys(y).length}const Uh=(n,a,i,l={},r,u)=>f=>{const p=Th(l,n)||{},m=p.delay||l.delay||0;let{elapsed:g=0}=l;g=g-ga(m);let y={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-g,onUpdate:b=>{a.set(b),p.onUpdate&&p.onUpdate(b)},onComplete:()=>{f(),p.onComplete&&p.onComplete()},name:n,motionValue:a,element:u?void 0:r};gA(p)||(y={...y,...mA(n,y)}),y.duration&&(y.duration=ga(y.duration)),y.repeatDelay&&(y.repeatDelay=ga(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let v=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(y.duration=0,y.delay===0&&(v=!0)),v&&!u&&a.get()!==void 0){const b=Ac(y.keyframes,p);if(b!==void 0)return st.update(()=>{y.onUpdate(b),y.onComplete()}),new KE([])}return!u&&Ry.supports(y)?new Ry(y):new Lh(y)};function vA({protectedKeys:n,needsAnimating:a},i){const l=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,l}function Ax(n,a,{delay:i=0,transitionOverride:l,type:r}={}){var u;let{transition:f=n.getDefaultTransition(),transitionEnd:p,...m}=a;l&&(f=l);const g=[],y=r&&n.animationState&&n.animationState.getState()[r];for(const v in m){const b=n.getValue(v,(u=n.latestValues[v])!==null&&u!==void 0?u:null),S=m[v];if(S===void 0||y&&vA(y,v))continue;const k={delay:i,...Th(f||{},v)};let C=!1;if(window.MotionHandoffAnimation){const E=Kb(n);if(E){const A=window.MotionHandoffAnimation(E,v,st);A!==null&&(k.startTime=A,C=!0)}}Ef(n,v),b.start(Uh(v,b,S,n.shouldReduceMotion&&qb.has(v)?{type:!1}:k,n,C));const N=b.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{st.update(()=>{p&&$E(n,p)})}),g}function Bf(n,a,i={}){var l;const r=Nc(n,a,i.type==="exit"?(l=n.presenceContext)===null||l===void 0?void 0:l.custom:void 0);let{transition:u=n.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(u=i.transitionOverride);const f=r?()=>Promise.all(Ax(n,r,i)):()=>Promise.resolve(),p=n.variantChildren&&n.variantChildren.size?(g=0)=>{const{delayChildren:y=0,staggerChildren:v,staggerDirection:b}=u;return yA(n,a,y+g,v,b,i)}:()=>Promise.resolve(),{when:m}=u;if(m){const[g,y]=m==="beforeChildren"?[f,p]:[p,f];return g().then(()=>y())}else return Promise.all([f(),p(i.delay)])}function yA(n,a,i=0,l=0,r=1,u){const f=[],p=(n.variantChildren.size-1)*l,m=r===1?(g=0)=>g*l:(g=0)=>p-g*l;return Array.from(n.variantChildren).sort(bA).forEach((g,y)=>{g.notify("AnimationStart",a),f.push(Bf(g,a,{...u,delay:i+m(y)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(f)}function bA(n,a){return n.sortNodePosition(a)}function xA(n,a,i={}){n.notify("AnimationStart",a);let l;if(Array.isArray(a)){const r=a.map(u=>Bf(n,u,i));l=Promise.all(r)}else if(typeof a=="string")l=Bf(n,a,i);else{const r=typeof a=="function"?Nc(n,a,i.custom):a;l=Promise.all(Ax(n,r,i))}return l.then(()=>{n.notify("AnimationComplete",a)})}const _A=dh.length;function wx(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?wx(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<_A;i++){const l=dh[i],r=n.props[l];(dl(r)||r===!1)&&(a[l]=r)}return a}const SA=[...uh].reverse(),TA=uh.length;function kA(n){return a=>Promise.all(a.map(({animation:i,options:l})=>xA(n,i,l)))}function CA(n){let a=kA(n),i=Oy(),l=!0;const r=m=>(g,y)=>{var v;const b=Nc(n,y,m==="exit"?(v=n.presenceContext)===null||v===void 0?void 0:v.custom:void 0);if(b){const{transition:S,transitionEnd:k,...C}=b;g={...g,...C,...k}}return g};function u(m){a=m(n)}function f(m){const{props:g}=n,y=wx(n.parent)||{},v=[],b=new Set;let S={},k=1/0;for(let N=0;N<TA;N++){const E=SA[N],A=i[E],D=g[E]!==void 0?g[E]:y[E],M=dl(D),j=E===m?A.isActive:null;j===!1&&(k=N);let K=D===y[E]&&D!==g[E]&&M;if(K&&l&&n.manuallyAnimateOnMount&&(K=!1),A.protectedKeys={...S},!A.isActive&&j===null||!D&&!A.prevProp||Cc(D)||typeof D=="boolean")continue;const q=EA(A.prevProp,D);let U=q||E===m&&A.isActive&&!K&&M||N>k&&M,W=!1;const ee=Array.isArray(D)?D:[D];let ie=ee.reduce(r(E),{});j===!1&&(ie={});const{prevResolvedValues:$={}}=A,le={...$,...ie},F=H=>{U=!0,b.has(H)&&(W=!0,b.delete(H)),A.needsAnimating[H]=!0;const ae=n.getValue(H);ae&&(ae.liveStyle=!1)};for(const H in le){const ae=ie[H],G=$[H];if(S.hasOwnProperty(H))continue;let O=!1;Cf(ae)&&Cf(G)?O=!Fb(ae,G):O=ae!==G,O?ae!=null?F(H):b.add(H):ae!==void 0&&b.has(H)?F(H):A.protectedKeys[H]=!0}A.prevProp=D,A.prevResolvedValues=ie,A.isActive&&(S={...S,...ie}),l&&n.blockInitialAnimation&&(U=!1),U&&(!(K&&q)||W)&&v.push(...ee.map(H=>({animation:H,options:{type:E}})))}if(b.size){const N={};b.forEach(E=>{const A=n.getBaseTarget(E),D=n.getValue(E);D&&(D.liveStyle=!0),N[E]=A??null}),v.push({animation:N})}let C=!!v.length;return l&&(g.initial===!1||g.initial===g.animate)&&!n.manuallyAnimateOnMount&&(C=!1),l=!1,C?a(v):Promise.resolve()}function p(m,g){var y;if(i[m].isActive===g)return Promise.resolve();(y=n.variantChildren)===null||y===void 0||y.forEach(b=>{var S;return(S=b.animationState)===null||S===void 0?void 0:S.setActive(m,g)}),i[m].isActive=g;const v=f(m);for(const b in i)i[b].protectedKeys={};return v}return{animateChanges:f,setActive:p,setAnimateFunction:u,getState:()=>i,reset:()=>{i=Oy(),l=!0}}}function EA(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!Fb(a,n):!1}function ks(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Oy(){return{animate:ks(!0),whileInView:ks(),whileHover:ks(),whileTap:ks(),whileDrag:ks(),whileFocus:ks(),exit:ks()}}class as{constructor(a){this.isMounted=!1,this.node=a}update(){}}class NA extends as{constructor(a){super(a),a.animationState||(a.animationState=CA(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();Cc(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 AA=0;class wA extends as{constructor(){super(...arguments),this.id=AA++}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 r=this.node.animationState.setActive("exit",!a);i&&!a&&r.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const jA={animation:{Feature:NA},exit:{Feature:wA}},On={x:!1,y:!1};function jx(){return On.x||On.y}function DA(n){return n==="x"||n==="y"?On[n]?null:(On[n]=!0,()=>{On[n]=!1}):On.x||On.y?null:(On.x=On.y=!0,()=>{On.x=On.y=!1})}const zh=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function ml(n,a,i,l={passive:!0}){return n.addEventListener(a,i,l),()=>n.removeEventListener(a,i)}function Sl(n){return{point:{x:n.pageX,y:n.pageY}}}const MA=n=>a=>zh(a)&&n(a,Sl(a));function al(n,a,i,l){return ml(n,a,MA(i),l)}const By=(n,a)=>Math.abs(n-a);function RA(n,a){const i=By(n.x,a.x),l=By(n.y,a.y);return Math.sqrt(i**2+l**2)}class Dx{constructor(a,i,{transformPagePoint:l,contextWindow:r,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=af(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,S=RA(v.offset,{x:0,y:0})>=3;if(!b&&!S)return;const{point:k}=v,{timestamp:C}=It;this.history.push({...k,timestamp:C});const{onStart:N,onMove:E}=this.handlers;b||(N&&N(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,v)},this.handlePointerMove=(v,b)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=nf(b,this.transformPagePoint),st.update(this.updatePoint,!0)},this.handlePointerUp=(v,b)=>{this.end();const{onEnd:S,onSessionEnd:k,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=af(v.type==="pointercancel"?this.lastMoveEventInfo:nf(b,this.transformPagePoint),this.history);this.startEvent&&S&&S(v,N),k&&k(v,N)},!zh(a))return;this.dragSnapToOrigin=u,this.handlers=i,this.transformPagePoint=l,this.contextWindow=r||window;const f=Sl(a),p=nf(f,this.transformPagePoint),{point:m}=p,{timestamp:g}=It;this.history=[{...m,timestamp:g}];const{onSessionStart:y}=i;y&&y(a,af(p,this.history)),this.removeListeners=_l(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(),Ja(this.updatePoint)}}function nf(n,a){return a?{point:a(n.point)}:n}function Iy(n,a){return{x:n.x-a.x,y:n.y-a.y}}function af({point:n},a){return{point:n,delta:Iy(n,Mx(a)),offset:Iy(n,OA(a)),velocity:BA(a,.1)}}function OA(n){return n[0]}function Mx(n){return n[n.length-1]}function BA(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,l=null;const r=Mx(n);for(;i>=0&&(l=n[i],!(r.timestamp-l.timestamp>ga(a)));)i--;if(!l)return{x:0,y:0};const u=va(r.timestamp-l.timestamp);if(u===0)return{x:0,y:0};const f={x:(r.x-l.x)/u,y:(r.y-l.y)/u};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}const Rx=1e-4,IA=1-Rx,LA=1+Rx,Ox=.01,UA=0-Ox,zA=0+Ox;function fn(n){return n.max-n.min}function VA(n,a,i){return Math.abs(n-a)<=i}function Ly(n,a,i,l=.5){n.origin=l,n.originPoint=rt(a.min,a.max,n.origin),n.scale=fn(i)/fn(a),n.translate=rt(i.min,i.max,n.origin)-n.originPoint,(n.scale>=IA&&n.scale<=LA||isNaN(n.scale))&&(n.scale=1),(n.translate>=UA&&n.translate<=zA||isNaN(n.translate))&&(n.translate=0)}function sl(n,a,i,l){Ly(n.x,a.x,i.x,l?l.originX:void 0),Ly(n.y,a.y,i.y,l?l.originY:void 0)}function Uy(n,a,i){n.min=i.min+a.min,n.max=n.min+fn(a)}function HA(n,a,i){Uy(n.x,a.x,i.x),Uy(n.y,a.y,i.y)}function zy(n,a,i){n.min=a.min-i.min,n.max=n.min+fn(a)}function il(n,a,i){zy(n.x,a.x,i.x),zy(n.y,a.y,i.y)}function GA(n,{min:a,max:i},l){return a!==void 0&&n<a?n=l?rt(a,n,l.min):Math.max(n,a):i!==void 0&&n>i&&(n=l?rt(i,n,l.max):Math.min(n,i)),n}function Vy(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 PA(n,{top:a,left:i,bottom:l,right:r}){return{x:Vy(n.x,i,r),y:Vy(n.y,a,l)}}function Hy(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 $A(n,a){return{x:Hy(n.x,a.x),y:Hy(n.y,a.y)}}function FA(n,a){let i=.5;const l=fn(n),r=fn(a);return r>l?i=Ui(a.min,a.max-l,n.min):l>r&&(i=Ui(n.min,n.max-r,a.min)),xa(0,1,i)}function qA(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 If=.35;function YA(n=If){return n===!1?n=0:n===!0&&(n=If),{x:Gy(n,"left","right"),y:Gy(n,"top","bottom")}}function Gy(n,a,i){return{min:Py(n,a),max:Py(n,i)}}function Py(n,a){return typeof n=="number"?n:n[a]||0}const $y=()=>({translate:0,scale:1,origin:0,originPoint:0}),Di=()=>({x:$y(),y:$y()}),Fy=()=>({min:0,max:0}),gt=()=>({x:Fy(),y:Fy()});function Nn(n){return[n("x"),n("y")]}function Bx({top:n,left:a,right:i,bottom:l}){return{x:{min:a,max:i},y:{min:n,max:l}}}function KA({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function ZA(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 sf(n){return n===void 0||n===1}function Lf({scale:n,scaleX:a,scaleY:i}){return!sf(n)||!sf(a)||!sf(i)}function Ns(n){return Lf(n)||Ix(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Ix(n){return qy(n.x)||qy(n.y)}function qy(n){return n&&n!=="0%"}function fc(n,a,i){const l=n-i,r=a*l;return i+r}function Yy(n,a,i,l,r){return r!==void 0&&(n=fc(n,r,l)),fc(n,i,l)+a}function Uf(n,a=0,i=1,l,r){n.min=Yy(n.min,a,i,l,r),n.max=Yy(n.max,a,i,l,r)}function Lx(n,{x:a,y:i}){Uf(n.x,a.translate,a.scale,a.originPoint),Uf(n.y,i.translate,i.scale,i.originPoint)}const Ky=.999999999999,Zy=1.0000000000001;function XA(n,a,i,l=!1){const r=i.length;if(!r)return;a.x=a.y=1;let u,f;for(let p=0;p<r;p++){u=i[p],f=u.projectionDelta;const{visualElement:m}=u.options;m&&m.props.style&&m.props.style.display==="contents"||(l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ri(n,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),f&&(a.x*=f.x.scale,a.y*=f.y.scale,Lx(n,f)),l&&Ns(u.latestValues)&&Ri(n,u.latestValues))}a.x<Zy&&a.x>Ky&&(a.x=1),a.y<Zy&&a.y>Ky&&(a.y=1)}function Mi(n,a){n.min=n.min+a,n.max=n.max+a}function Xy(n,a,i,l,r=.5){const u=rt(n.min,n.max,r);Uf(n,a,i,u,l)}function Ri(n,a){Xy(n.x,a.x,a.scaleX,a.scale,a.originX),Xy(n.y,a.y,a.scaleY,a.scale,a.originY)}function Ux(n,a){return Bx(ZA(n.getBoundingClientRect(),a))}function QA(n,a,i){const l=Ux(n,i),{scroll:r}=a;return r&&(Mi(l.x,r.offset.x),Mi(l.y,r.offset.y)),l}const zx=({current:n})=>n?n.ownerDocument.defaultView:null,WA=new WeakMap;class JA{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=gt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const r=y=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(Sl(y).point)},u=(y,v)=>{const{drag:b,dragPropagation:S,onDragStart:k}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=DA(b),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nn(N=>{let E=this.getAxisMotionValue(N).get()||0;if(Yn.test(E)){const{projection:A}=this.visualElement;if(A&&A.layout){const D=A.layout.layoutBox[N];D&&(E=fn(D)*(parseFloat(E)/100))}}this.originPoint[N]=E}),k&&st.postRender(()=>k(y,v)),Ef(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},f=(y,v)=>{const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:k,onDrag:C}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:N}=v;if(S&&this.currentDirection===null){this.currentDirection=ew(N),this.currentDirection!==null&&k&&k(this.currentDirection);return}this.updateAxis("x",v.point,N),this.updateAxis("y",v.point,N),this.visualElement.render(),C&&C(y,v)},p=(y,v)=>this.stop(y,v),m=()=>Nn(y=>{var v;return this.getAnimationState(y)==="paused"&&((v=this.getAxisMotionValue(y).animation)===null||v===void 0?void 0:v.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new Dx(a,{onSessionStart:r,onStart:u,onMove:f,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:zx(this.visualElement)})}stop(a,i){const l=this.isDragging;if(this.cancel(),!l)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:u}=this.getProps();u&&st.postRender(()=>u(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,l){const{drag:r}=this.getProps();if(!l||!Fr(a,r,this.currentDirection))return;const u=this.getAxisMotionValue(a);let f=this.originPoint[a]+l[a];this.constraints&&this.constraints[a]&&(f=GA(f,this.constraints[a],this.elastic[a])),u.set(f)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:l}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,u=this.constraints;i&&wi(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=PA(r.layoutBox,i):this.constraints=!1,this.elastic=YA(l),u!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Nn(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=qA(r.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!wi(a))return!1;const l=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const u=QA(l,r.root,this.visualElement.getTransformPagePoint());let f=$A(r.layout.layoutBox,u);if(i){const p=i(KA(f));this.hasMutatedConstraints=!!p,p&&(f=Bx(p))}return f}startAnimation(a){const{drag:i,dragMomentum:l,dragElastic:r,dragTransition:u,dragSnapToOrigin:f,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=Nn(y=>{if(!Fr(y,i,this.currentDirection))return;let v=m&&m[y]||{};f&&(v={min:0,max:0});const b=r?200:1e6,S=r?40:1e7,k={type:"inertia",velocity:l?a[y]:0,bounceStiffness:b,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...v};return this.startAxisValueAnimation(y,k)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const l=this.getAxisMotionValue(a);return Ef(this.visualElement,a),l.start(Uh(a,l,0,i,this.visualElement,!1))}stopAnimation(){Nn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){Nn(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(),r=l[i];return r||this.visualElement.getValue(a,(l.initial?l.initial[a]:void 0)||0)}snapToCursor(a){Nn(i=>{const{drag:l}=this.getProps();if(!Fr(i,l,this.currentDirection))return;const{projection:r}=this.visualElement,u=this.getAxisMotionValue(i);if(r&&r.layout){const{min:f,max:p}=r.layout.layoutBox[i];u.set(a[i]-rt(f,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:l}=this.visualElement;if(!wi(i)||!l||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Nn(f=>{const p=this.getAxisMotionValue(f);if(p&&this.constraints!==!1){const m=p.get();r[f]=FA({min:m,max:m},this.constraints[f])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.resolveConstraints(),Nn(f=>{if(!Fr(f,a,null))return;const p=this.getAxisMotionValue(f),{min:m,max:g}=this.constraints[f];p.set(rt(m,g,r[f]))})}addListeners(){if(!this.visualElement.current)return;WA.set(this.visualElement,this);const a=this.visualElement.current,i=al(a,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps();g&&y&&this.start(m)}),l=()=>{const{dragConstraints:m}=this.getProps();wi(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,u=r.addEventListener("measure",l);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),st.read(l);const f=ml(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(Nn(y=>{const v=this.getAxisMotionValue(y);v&&(this.originPoint[y]+=m[y].translate,v.set(v.get()+m[y].translate))}),this.visualElement.render())}));return()=>{f(),i(),u(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:l=!1,dragPropagation:r=!1,dragConstraints:u=!1,dragElastic:f=If,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:l,dragPropagation:r,dragConstraints:u,dragElastic:f,dragMomentum:p}}}function Fr(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function ew(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class tw extends as{constructor(a){super(a),this.removeGroupControls=dn,this.removeListeners=dn,this.controls=new JA(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||dn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Qy=n=>(a,i)=>{n&&st.postRender(()=>n(a,i))};class nw extends as{constructor(){super(...arguments),this.removePointerDownListener=dn}onPointerDown(a){this.session=new Dx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:zx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:l,onPanEnd:r}=this.node.getProps();return{onSessionStart:Qy(a),onStart:Qy(i),onMove:l,onEnd:(u,f)=>{delete this.session,r&&st.postRender(()=>r(u,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 nc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Wy(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Fo={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(ve.test(n))n=parseFloat(n);else return n;const i=Wy(n,a.target.x),l=Wy(n,a.target.y);return`${i}% ${l}%`}},aw={correct:(n,{treeScale:a,projectionDelta:i})=>{const l=n,r=es.parse(n);if(r.length>5)return l;const u=es.createTransformer(n),f=typeof r[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;r[0+f]/=p,r[1+f]/=m;const g=rt(p,m,.5);return typeof r[2+f]=="number"&&(r[2+f]/=g),typeof r[3+f]=="number"&&(r[3+f]/=g),u(r)}};class sw extends x.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l,layoutId:r}=this.props,{projection:u}=a;jE(iw),u&&(i.group&&i.group.add(u),l&&l.register&&r&&l.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),nc.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:l,drag:r,isPresent:u}=this.props,f=l.projection;return f&&(f.isPresent=u,r||a.layoutDependency!==i||i===void 0?f.willUpdate():this.safeToRemove(),a.isPresent!==u&&(u?f.promote():f.relegate()||st.postRender(()=>{const p=f.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),hh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),l&&l.deregister&&l.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function Vx(n){const[a,i]=kb(),l=x.useContext(oh);return c.jsx(sw,{...n,layoutGroup:l,switchLayoutGroup:x.useContext(Mb),isPresent:a,safeToRemove:i})}const iw={borderRadius:{...Fo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fo,borderTopRightRadius:Fo,borderBottomLeftRadius:Fo,borderBottomRightRadius:Fo,boxShadow:aw};function ow(n,a,i){const l=Vt(n)?n:hl(n);return l.start(Uh("",l,a,i)),l.animation}function lw(n){return n instanceof SVGElement&&n.tagName!=="svg"}const rw=(n,a)=>n.depth-a.depth;class cw{constructor(){this.children=[],this.isDirty=!1}add(a){kh(this.children,a),this.isDirty=!0}remove(a){Ch(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(rw),this.isDirty=!1,this.children.forEach(a)}}function uw(n,a){const i=Kn.now(),l=({timestamp:r})=>{const u=r-i;u>=a&&(Ja(l),n(u-a))};return st.read(l,!0),()=>Ja(l)}const Hx=["TopLeft","TopRight","BottomLeft","BottomRight"],dw=Hx.length,Jy=n=>typeof n=="string"?parseFloat(n):n,e0=n=>typeof n=="number"||ve.test(n);function fw(n,a,i,l,r,u){r?(n.opacity=rt(0,i.opacity!==void 0?i.opacity:1,hw(l)),n.opacityExit=rt(a.opacity!==void 0?a.opacity:1,0,pw(l))):u&&(n.opacity=rt(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,l));for(let f=0;f<dw;f++){const p=`border${Hx[f]}Radius`;let m=t0(a,p),g=t0(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||e0(m)===e0(g)?(n[p]=Math.max(rt(Jy(m),Jy(g),l),0),(Yn.test(g)||Yn.test(m))&&(n[p]+="%")):n[p]=g}(a.rotate||i.rotate)&&(n.rotate=rt(a.rotate||0,i.rotate||0,l))}function t0(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const hw=Gx(0,.5,sx),pw=Gx(.5,.95,dn);function Gx(n,a,i){return l=>l<n?0:l>a?1:i(Ui(n,a,l))}function n0(n,a){n.min=a.min,n.max=a.max}function En(n,a){n0(n.x,a.x),n0(n.y,a.y)}function a0(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function s0(n,a,i,l,r){return n-=a,n=fc(n,1/i,l),r!==void 0&&(n=fc(n,1/r,l)),n}function mw(n,a=0,i=1,l=.5,r,u=n,f=n){if(Yn.test(a)&&(a=parseFloat(a),a=rt(f.min,f.max,a/100)-f.min),typeof a!="number")return;let p=rt(u.min,u.max,l);n===u&&(p-=a),n.min=s0(n.min,a,i,p,r),n.max=s0(n.max,a,i,p,r)}function i0(n,a,[i,l,r],u,f){mw(n,a[i],a[l],a[r],a.scale,u,f)}const gw=["x","scaleX","originX"],vw=["y","scaleY","originY"];function o0(n,a,i,l){i0(n.x,a,gw,i?i.x:void 0,l?l.x:void 0),i0(n.y,a,vw,i?i.y:void 0,l?l.y:void 0)}function l0(n){return n.translate===0&&n.scale===1}function Px(n){return l0(n.x)&&l0(n.y)}function r0(n,a){return n.min===a.min&&n.max===a.max}function yw(n,a){return r0(n.x,a.x)&&r0(n.y,a.y)}function c0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function $x(n,a){return c0(n.x,a.x)&&c0(n.y,a.y)}function u0(n){return fn(n.x)/fn(n.y)}function d0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class bw{constructor(){this.members=[]}add(a){kh(this.members,a),a.scheduleRender()}remove(a){if(Ch(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(r=>a===r);if(i===0)return!1;let l;for(let r=i;r>=0;r--){const u=this.members[r];if(u.isPresent!==!1){l=u;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:r}=a.options;r===!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 xw(n,a,i){let l="";const r=n.x.translate/a.x,u=n.y.translate/a.y,f=(i==null?void 0:i.z)||0;if((r||u||f)&&(l=`translate3d(${r}px, ${u}px, ${f}px) `),(a.x!==1||a.y!==1)&&(l+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:y,rotateX:v,rotateY:b,skewX:S,skewY:k}=i;g&&(l=`perspective(${g}px) ${l}`),y&&(l+=`rotate(${y}deg) `),v&&(l+=`rotateX(${v}deg) `),b&&(l+=`rotateY(${b}deg) `),S&&(l+=`skewX(${S}deg) `),k&&(l+=`skewY(${k}deg) `)}const p=n.x.scale*a.x,m=n.y.scale*a.y;return(p!==1||m!==1)&&(l+=`scale(${p}, ${m})`),l||"none"}const As={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Qo=typeof window<"u"&&window.MotionDebug!==void 0,of=["","X","Y","Z"],_w={visibility:"hidden"},f0=1e3;let Sw=0;function lf(n,a,i,l){const{latestValues:r}=a;r[n]&&(i[n]=r[n],a.setStaticValue(n,0),l&&(l[n]=0))}function Fx(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=Kb(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:u}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",st,!(r||u))}const{parent:l}=n;l&&!l.hasCheckedOptimisedAppear&&Fx(l)}function qx({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:l,resetTransform:r}){return class{constructor(f={},p=a==null?void 0:a()){this.id=Sw++,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&&(As.totalNodes=As.resolvedTargetDeltas=As.recalculatedProjection=0),this.nodes.forEach(Cw),this.nodes.forEach(jw),this.nodes.forEach(Dw),this.nodes.forEach(Ew),Qo&&window.MotionDebug.record(As)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new cw)}addEventListener(f,p){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new Eh),this.eventHandlers.get(f).add(p)}notifyListeners(f,...p){const m=this.eventHandlers.get(f);m&&m.notify(...p)}hasListeners(f){return this.eventHandlers.has(f)}mount(f,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=lw(f),this.instance=f;const{layoutId:m,layout:g,visualElement:y}=this.options;if(y&&!y.current&&y.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),n){let v;const b=()=>this.root.updateBlockedByResize=!1;n(f,()=>{this.root.updateBlockedByResize=!0,v&&v(),v=uw(b,250),nc.hasAnimatedSinceResize&&(nc.hasAnimatedSinceResize=!1,this.nodes.forEach(p0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&y&&(m||g)&&this.addEventListener("didUpdate",({delta:v,hasLayoutChanged:b,hasRelativeTargetChanged:S,layout:k})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const C=this.options.transition||y.getDefaultTransition()||Iw,{onLayoutAnimationStart:N,onLayoutAnimationComplete:E}=y.getProps(),A=!this.targetLayout||!$x(this.targetLayout,k)||S,D=!b&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||D||b&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(v,D);const M={...Th(C,"layout"),onPlay:N,onComplete:E};(y.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M)}else b||p0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=k})}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,Ja(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(Mw),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&&Fx(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const v=this.path[y];v.shouldResetTransform=!0,v.updateScroll("snapshot"),v.options.layoutRoot&&v.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(h0);return}this.isUpdating||this.nodes.forEach(Aw),this.isUpdating=!1,this.nodes.forEach(ww),this.nodes.forEach(Tw),this.nodes.forEach(kw),this.clearAllSnapshots();const p=Kn.now();It.delta=xa(0,1e3/60,p-It.timestamp),It.timestamp=p,It.isProcessing=!0,Qd.update.process(It),Qd.preRender.process(It),Qd.render.process(It),It.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Nw),this.sharedNodes.forEach(Rw)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,st.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){st.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutCorrected=gt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,f?f.layoutBox:void 0)}updateScroll(f="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(p=!1),p){const m=l(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!r)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!Px(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,y=g!==this.prevTransformTemplateValue;f&&(p||Ns(this.latestValues)||y)&&(r(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return f&&(m=this.removeTransform(m)),Lw(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:p}=this.options;if(!p)return gt();const m=p.measureViewportBox();if(!(((f=this.scroll)===null||f===void 0?void 0:f.wasRoot)||this.path.some(Uw))){const{scroll:y}=this.root;y&&(Mi(m.x,y.offset.x),Mi(m.y,y.offset.y))}return m}removeElementScroll(f){var p;const m=gt();if(En(m,f),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const y=this.path[g],{scroll:v,options:b}=y;y!==this.root&&v&&b.layoutScroll&&(v.wasRoot&&En(m,f),Mi(m.x,v.offset.x),Mi(m.y,v.offset.y))}return m}applyTransform(f,p=!1){const m=gt();En(m,f);for(let g=0;g<this.path.length;g++){const y=this.path[g];!p&&y.options.layoutScroll&&y.scroll&&y!==y.root&&Ri(m,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),Ns(y.latestValues)&&Ri(m,y.latestValues)}return Ns(this.latestValues)&&Ri(m,this.latestValues),m}removeTransform(f){const p=gt();En(p,f);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!Ns(g.latestValues))continue;Lf(g.latestValues)&&g.updateSnapshot();const y=gt(),v=g.measurePageBox();En(y,v),o0(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,y)}return Ns(this.latestValues)&&o0(p,this.latestValues),p}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==It.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){var p;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(f||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:v,layoutId:b}=this.options;if(!(!this.layout||!(v||b))){if(this.resolvedRelativeTargetAt=It.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=gt(),this.relativeTargetOrigin=gt(),il(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),En(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=gt(),this.targetWithTransforms=gt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),HA(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):En(this.target,this.layout.layoutBox),Lx(this.target,this.targetDelta)):En(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const S=this.getClosestProjectingParent();S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=gt(),this.relativeTargetOrigin=gt(),il(this.relativeTargetOrigin,this.target,S.target),En(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Qo&&As.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Lf(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 p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((f=this.parent)===null||f===void 0)&&f.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===It.timestamp&&(g=!1),g)return;const{layout:y,layoutId:v}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(y||v))return;En(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,S=this.treeScale.y;XA(this.layoutCorrected,this.treeScale,this.path,m),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=gt());const{target:k}=p;if(!k){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(a0(this.prevProjectionDelta.x,this.projectionDelta.x),a0(this.prevProjectionDelta.y,this.projectionDelta.y)),sl(this.projectionDelta,this.layoutCorrected,k,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==S||!d0(this.projectionDelta.x,this.prevProjectionDelta.x)||!d0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",k)),Qo&&As.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),f){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Di(),this.projectionDelta=Di(),this.projectionDeltaWithTransform=Di()}setAnimationOrigin(f,p=!1){const m=this.snapshot,g=m?m.latestValues:{},y={...this.latestValues},v=Di();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const b=gt(),S=m?m.source:void 0,k=this.layout?this.layout.source:void 0,C=S!==k,N=this.getStack(),E=!N||N.members.length<=1,A=!!(C&&!E&&this.options.crossfade===!0&&!this.path.some(Bw));this.animationProgress=0;let D;this.mixTargetDelta=M=>{const j=M/1e3;m0(v.x,f.x,j),m0(v.y,f.y,j),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(il(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ow(this.relativeTarget,this.relativeTargetOrigin,b,j),D&&yw(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=gt()),En(D,this.relativeTarget)),C&&(this.animationValues=y,fw(y,g,this.latestValues,j,A,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},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&&(Ja(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=st.update(()=>{nc.hasAnimatedSinceResize=!0,this.currentAnimation=ow(0,f0,{...f,onUpdate:p=>{this.mixTargetDelta(p),f.onUpdate&&f.onUpdate(p)},onComplete:()=>{f.onComplete&&f.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(f0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:y}=f;if(!(!p||!m||!g)){if(this!==f&&this.layout&&g&&Yx(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||gt();const v=fn(this.layout.layoutBox.x);m.x.min=f.target.x.min,m.x.max=m.x.min+v;const b=fn(this.layout.layoutBox.y);m.y.min=f.target.y.min,m.y.max=m.y.min+b}En(p,m),Ri(p,y),sl(this.projectionDeltaWithTransform,this.layoutCorrected,p,y)}}registerSharedNode(f,p){this.sharedNodes.has(f)||this.sharedNodes.set(f,new bw),this.sharedNodes.get(f).add(p);const g=p.options.initialPromotionConfig;p.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(p):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){var f;const{layoutId:p}=this.options;return p?((f=this.getStack())===null||f===void 0?void 0:f.lead)||this:this}getPrevLead(){var f;const{layoutId:p}=this.options;return p?(f=this.getStack())===null||f===void 0?void 0:f.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),f&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let p=!1;const{latestValues:m}=f;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&lf("z",f,g,this.animationValues);for(let y=0;y<of.length;y++)lf(`rotate${of[y]}`,f,g,this.animationValues),lf(`skew${of[y]}`,f,g,this.animationValues);f.render();for(const y in g)f.setStaticValue(y,g[y]),this.animationValues&&(this.animationValues[y]=g[y]);f.scheduleRender()}getProjectionStyles(f){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return _w;const g={visibility:""},y=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=ec(f==null?void 0:f.pointerEvents)||"",g.transform=y?y(this.latestValues,""):"none",g;const v=this.getLead();if(!this.projectionDelta||!this.layout||!v.target){const C={};return this.options.layoutId&&(C.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,C.pointerEvents=ec(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!Ns(this.latestValues)&&(C.transform=y?y({},""):"none",this.hasProjected=!1),C}const b=v.animationValues||v.latestValues;this.applyTransformsToTarget(),g.transform=xw(this.projectionDeltaWithTransform,this.treeScale,b),y&&(g.transform=y(b,g.transform));const{x:S,y:k}=this.projectionDelta;g.transformOrigin=`${S.origin*100}% ${k.origin*100}% 0`,v.animationValues?g.opacity=v===this?(m=(p=b.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:b.opacityExit:g.opacity=v===this?b.opacity!==void 0?b.opacity:"":b.opacityExit!==void 0?b.opacityExit:0;for(const C in lc){if(b[C]===void 0)continue;const{correct:N,applyTo:E}=lc[C],A=g.transform==="none"?b[C]:N(b[C],v);if(E){const D=E.length;for(let M=0;M<D;M++)g[E[M]]=A}else g[C]=A}return this.options.layoutId&&(g.pointerEvents=v===this?ec(f==null?void 0:f.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>{var p;return(p=f.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(h0),this.root.sharedNodes.clear()}}}function Tw(n){n.updateLayout()}function kw(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:r}=n.layout,{animationType:u}=n.options,f=i.source!==n.layout.source;u==="size"?Nn(v=>{const b=f?i.measuredBox[v]:i.layoutBox[v],S=fn(b);b.min=l[v].min,b.max=b.min+S}):Yx(u,i.layoutBox,l)&&Nn(v=>{const b=f?i.measuredBox[v]:i.layoutBox[v],S=fn(l[v]);b.max=b.min+S,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[v].max=n.relativeTarget[v].min+S)});const p=Di();sl(p,l,i.layoutBox);const m=Di();f?sl(m,n.applyTransform(r,!0),i.measuredBox):sl(m,l,i.layoutBox);const g=!Px(p);let y=!1;if(!n.resumeFrom){const v=n.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:b,layout:S}=v;if(b&&S){const k=gt();il(k,i.layoutBox,b.layoutBox);const C=gt();il(C,l,S.layoutBox),$x(k,C)||(y=!0),v.options.layoutRoot&&(n.relativeTarget=C,n.relativeTargetOrigin=k,n.relativeParent=v)}}}n.notifyListeners("didUpdate",{layout:l,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:y})}else if(n.isLead()){const{onExitComplete:l}=n.options;l&&l()}n.options.transition=void 0}function Cw(n){Qo&&As.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 Ew(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function Nw(n){n.clearSnapshot()}function h0(n){n.clearMeasurements()}function Aw(n){n.isLayoutDirty=!1}function ww(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function p0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function jw(n){n.resolveTargetDelta()}function Dw(n){n.calcProjection()}function Mw(n){n.resetSkewAndRotation()}function Rw(n){n.removeLeadSnapshot()}function m0(n,a,i){n.translate=rt(a.translate,0,i),n.scale=rt(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function g0(n,a,i,l){n.min=rt(a.min,i.min,l),n.max=rt(a.max,i.max,l)}function Ow(n,a,i,l){g0(n.x,a.x,i.x,l),g0(n.y,a.y,i.y,l)}function Bw(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const Iw={duration:.45,ease:[.4,0,.1,1]},v0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),y0=v0("applewebkit/")&&!v0("chrome/")?Math.round:dn;function b0(n){n.min=y0(n.min),n.max=y0(n.max)}function Lw(n){b0(n.x),b0(n.y)}function Yx(n,a,i){return n==="position"||n==="preserve-aspect"&&!VA(u0(a),u0(i),.2)}function Uw(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const zw=qx({attachResizeListener:(n,a)=>ml(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rf={current:void 0},Kx=qx({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!rf.current){const n=new zw({});n.mount(window),n.setOptions({layoutScroll:!0}),rf.current=n}return rf.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),Vw={pan:{Feature:nw},drag:{Feature:tw,ProjectionNode:Kx,MeasureLayout:Vx}};function Hw(n,a,i){var l;if(n instanceof Element)return[n];if(typeof n=="string"){let r=document;const u=(l=void 0)!==null&&l!==void 0?l:r.querySelectorAll(n);return u?Array.from(u):[]}return Array.from(n)}function Zx(n,a){const i=Hw(n),l=new AbortController,r={passive:!0,...a,signal:l.signal};return[i,r,()=>l.abort()]}function x0(n){return a=>{a.pointerType==="touch"||jx()||n(a)}}function Gw(n,a,i={}){const[l,r,u]=Zx(n,i),f=x0(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const y=x0(v=>{g(v),m.removeEventListener("pointerleave",y)});m.addEventListener("pointerleave",y,r)});return l.forEach(p=>{p.addEventListener("pointerenter",f,r)}),u}function _0(n,a,i){const{props:l}=n;n.animationState&&l.whileHover&&n.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,u=l[r];u&&st.postRender(()=>u(a,Sl(a)))}class Pw extends as{mount(){const{current:a}=this.node;a&&(this.unmount=Gw(a,i=>(_0(this.node,i,"Start"),l=>_0(this.node,l,"End"))))}unmount(){}}class $w extends as{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=_l(ml(this.node.current,"focus",()=>this.onFocus()),ml(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Xx=(n,a)=>a?n===a?!0:Xx(n,a.parentElement):!1,Fw=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function qw(n){return Fw.has(n.tagName)||n.tabIndex!==-1}const Wo=new WeakSet;function S0(n){return a=>{a.key==="Enter"&&n(a)}}function cf(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const Yw=(n,a)=>{const i=n.currentTarget;if(!i)return;const l=S0(()=>{if(Wo.has(i))return;cf(i,"down");const r=S0(()=>{cf(i,"up")}),u=()=>cf(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",u,a)});i.addEventListener("keydown",l,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",l),a)};function T0(n){return zh(n)&&!jx()}function Kw(n,a,i={}){const[l,r,u]=Zx(n,i),f=p=>{const m=p.currentTarget;if(!T0(p)||Wo.has(m))return;Wo.add(m);const g=a(p),y=(S,k)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",b),!(!T0(S)||!Wo.has(m))&&(Wo.delete(m),typeof g=="function"&&g(S,{success:k}))},v=S=>{y(S,i.useGlobalTarget||Xx(m,S.target))},b=S=>{y(S,!1)};window.addEventListener("pointerup",v,r),window.addEventListener("pointercancel",b,r)};return l.forEach(p=>{!qw(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",f,r),p.addEventListener("focus",g=>Yw(g,r),r)}),u}function k0(n,a,i){const{props:l}=n;n.animationState&&l.whileTap&&n.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),u=l[r];u&&st.postRender(()=>u(a,Sl(a)))}class Zw extends as{mount(){const{current:a}=this.node;a&&(this.unmount=Kw(a,i=>(k0(this.node,i,"Start"),(l,{success:r})=>k0(this.node,l,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const zf=new WeakMap,uf=new WeakMap,Xw=n=>{const a=zf.get(n.target);a&&a(n)},Qw=n=>{n.forEach(Xw)};function Ww({root:n,...a}){const i=n||document;uf.has(i)||uf.set(i,{});const l=uf.get(i),r=JSON.stringify(a);return l[r]||(l[r]=new IntersectionObserver(Qw,{root:n,...a})),l[r]}function Jw(n,a,i){const l=Ww(a);return zf.set(n,i),l.observe(n),()=>{zf.delete(n),l.unobserve(n)}}const ej={some:0,all:1};class tj extends as{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:l,amount:r="some",once:u}=a,f={root:i?i.current:void 0,rootMargin:l,threshold:typeof r=="number"?r:ej[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,u&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:y,onViewportLeave:v}=this.node.getProps(),b=g?y:v;b&&b(m)};return Jw(this.node.current,f,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(nj(a,i))&&this.startObserver()}unmount(){}}function nj({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const aj={inView:{Feature:tj},tap:{Feature:Zw},focus:{Feature:$w},hover:{Feature:Pw}},sj={layout:{ProjectionNode:Kx,MeasureLayout:Vx}},hc={current:null},Vh={current:!1};function Qx(){if(Vh.current=!0,!!ch)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>hc.current=n.matches;n.addListener(a),a()}else hc.current=!1}const ij=[...yx,zt,es],oj=n=>ij.find(vx(n)),C0=new WeakMap;function lj(n,a,i){for(const l in a){const r=a[l],u=i[l];if(Vt(r))n.addValue(l,r);else if(Vt(u))n.addValue(l,hl(r,{owner:n}));else if(u!==r)if(n.hasValue(l)){const f=n.getValue(l);f.liveStyle===!0?f.jump(r):f.hasAnimated||f.set(r)}else{const f=n.getStaticValue(l);n.addValue(l,hl(f!==void 0?f:r,{owner:n}))}}for(const l in i)a[l]===void 0&&n.removeValue(l);return a}const E0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class rj{scrapeMotionValuesFromProps(a,i,l){return{}}constructor({parent:a,props:i,presenceContext:l,reducedMotionConfig:r,blockInitialAnimation:u,visualState:f},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Bh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const S=Kn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,st.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:y}=f;this.onUpdate=y,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=g,this.parent=a,this.props=i,this.presenceContext=l,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!u,this.isControllingVariants=Ec(i),this.isVariantNode=jb(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:v,...b}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in b){const k=b[S];m[S]!==void 0&&Vt(k)&&k.set(m[S],!1)}}mount(a){this.current=a,C0.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)),Vh.current||Qx(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:hc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){C0.delete(this.current),this.projection&&this.projection.unmount(),Ja(this.notifyUpdate),Ja(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=Os.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&st.preRender(this.notifyUpdate),l&&this.projection&&(this.projection.isTransformDirty=!0)}),u=i.on("renderRequest",this.scheduleRender);let f;window.MotionCheckAppearSync&&(f=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),u(),f&&f(),i.owner&&i.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in Li){const i=Li[a];if(!i)continue;const{isEnabled:l,Feature:r}=i;if(!this.features[a]&&r&&l(this.props)&&(this.features[a]=new r(this)),this.features[a]){const u=this.features[a];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):gt()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,i){this.latestValues[a]=i}update(a,i){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let l=0;l<E0.length;l++){const r=E0[l];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const u="on"+r,f=a[u];f&&(this.propEventSubscriptions[r]=this.on(r,f))}this.prevMotionValues=lj(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=hl(i===null?void 0:i,{owner:this}),this.addValue(a,l)),l}readValue(a,i){var l;let r=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 r!=null&&(typeof r=="string"&&(mx(r)||ox(r))?r=parseFloat(r):!oj(r)&&es.test(i)&&(r=fx(a,i)),this.setBaseTarget(a,Vt(r)?r.get():r)),Vt(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:l}=this.props;let r;if(typeof l=="string"||typeof l=="object"){const f=mh(this.props,l,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);f&&(r=f[a])}if(l&&r!==void 0)return r;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!Vt(u)?u:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new Eh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class Wx extends rj{constructor(){super(...arguments),this.KeyframeResolver=bx}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;Vt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function cj(n){return window.getComputedStyle(n)}class uj extends Wx{constructor(){super(...arguments),this.type="html",this.renderInstance=zb}readValueFromInstance(a,i){if(Os.has(i)){const l=Oh(i);return l&&l.default||0}else{const l=cj(a),r=(Ib(i)?l.getPropertyValue(i):l[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Ux(a,i)}build(a,i,l){yh(a,i,l.transformTemplate)}scrapeMotionValuesFromProps(a,i,l){return Sh(a,i,l)}}class dj extends Wx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Os.has(i)){const l=Oh(i);return l&&l.default||0}return i=Vb.has(i)?i:fh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,l){return Pb(a,i,l)}build(a,i,l){bh(a,i,this.isSVGTag,l.transformTemplate)}renderInstance(a,i,l,r){Hb(a,i,l,r)}mount(a){this.isSVGTag=_h(a.tagName),super.mount(a)}}const fj=(n,a)=>ph(n)?new dj(a):new uj(a,{allowProjection:n!==x.Fragment}),hj=zE({...jA,...aj,...Vw,...sj},fj),kt=eE(hj);function pj(){!Vh.current&&Qx();const[n]=x.useState(hc.current);return n}var Je;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.TEXT=1]="TEXT",n[n.TOOL_USE=2]="TOOL_USE",n[n.TOOL_RESULT=3]="TOOL_RESULT",n[n.ERROR=4]="ERROR",n[n.STATUS=5]="STATUS",n[n.SYSTEM=6]="SYSTEM",n[n.FINDING=7]="FINDING",n[n.SUBTASK_CREATE=8]="SUBTASK_CREATE",n[n.USER_INPUT=9]="USER_INPUT",n[n.SIGNAL=10]="SIGNAL",n[n.USAGE=11]="USAGE"})(Je||(Je={}));var Tt;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.NOT_STARTED=1]="NOT_STARTED",n[n.WORKING=3]="WORKING",n[n.PAUSED=4]="PAUSED",n[n.COMPLETE=5]="COMPLETE",n[n.FAILED=6]="FAILED"})(Tt||(Tt={}));var Xa;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.ACTIVE=1]="ACTIVE",n[n.ARCHIVED=2]="ARCHIVED"})(Xa||(Xa={}));var Qa;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OPEN=1]="OPEN",n[n.CLOSED=2]="CLOSED"})(Qa||(Qa={}));var Pn;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.SUBSCRIPTION=2]="SUBSCRIPTION",n[n.API_KEY=3]="API_KEY"})(Pn||(Pn={}));var Wa;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.ON=2]="ON"})(Wa||(Wa={}));const mj=8,N0="system",qo="system";Object.assign(Object.create(null),{"":Je.UNSPECIFIED,text:Je.TEXT,tool_use:Je.TOOL_USE,tool_result:Je.TOOL_RESULT,error:Je.ERROR,status:Je.STATUS,system:Je.SYSTEM,finding:Je.FINDING,subtask_create:Je.SUBTASK_CREATE,user_input:Je.USER_INPUT,signal:Je.SIGNAL,usage:Je.USAGE});Je.UNSPECIFIED+"",Je.TEXT+"",Je.TOOL_USE+"",Je.TOOL_RESULT+"",Je.ERROR+"",Je.STATUS+"",Je.SYSTEM+"",Je.FINDING+"",Je.SUBTASK_CREATE+"",Je.USER_INPUT+"",Je.SIGNAL+"",Je.USAGE+"";Object.assign(Object.create(null),{"":Tt.UNSPECIFIED,not_started:Tt.NOT_STARTED,working:Tt.WORKING,paused:Tt.PAUSED,complete:Tt.COMPLETE,failed:Tt.FAILED,pending:Tt.NOT_STARTED,assigned:Tt.NOT_STARTED,in_progress:Tt.WORKING,waiting_input:Tt.PAUSED,review:Tt.PAUSED,done:Tt.COMPLETE});Tt.UNSPECIFIED+"",Tt.NOT_STARTED+"",Tt.WORKING+"",Tt.PAUSED+"",Tt.COMPLETE+"",Tt.FAILED+"";Object.assign(Object.create(null),{"":Xa.UNSPECIFIED,active:Xa.ACTIVE,archived:Xa.ARCHIVED});Xa.UNSPECIFIED+"",Xa.ACTIVE+"",Xa.ARCHIVED+"";Object.assign(Object.create(null),{"":Qa.UNSPECIFIED,open:Qa.OPEN,closed:Qa.CLOSED});Qa.UNSPECIFIED+"",Qa.OPEN+"",Qa.CLOSED+"";Object.assign(Object.create(null),{"":Pn.UNSPECIFIED,off:Pn.OFF,subscription:Pn.SUBSCRIPTION,api_key:Pn.API_KEY});Pn.UNSPECIFIED+"",Pn.OFF+"",Pn.SUBSCRIPTION+"",Pn.API_KEY+"";Object.assign(Object.create(null),{"":Wa.UNSPECIFIED,off:Wa.OFF,on:Wa.ON});Wa.UNSPECIFIED+"",Wa.OFF+"",Wa.ON+"";function _a(n){return Array.isArray?Array.isArray(n):t1(n)==="[object Array]"}function gj(n){if(typeof n=="string")return n;let a=n+"";return a=="0"&&1/n==-1/0?"-0":a}function vj(n){return n==null?"":gj(n)}function $n(n){return typeof n=="string"}function Jx(n){return typeof n=="number"}function yj(n){return n===!0||n===!1||bj(n)&&t1(n)=="[object Boolean]"}function e1(n){return typeof n=="object"}function bj(n){return e1(n)&&n!==null}function un(n){return n!=null}function df(n){return!n.trim().length}function t1(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const xj="Incorrect 'index' type",_j=n=>`Invalid value for key ${n}`,Sj=n=>`Pattern length exceeds max of ${n}.`,Tj=n=>`Missing ${n} property in key`,kj=n=>`Property 'weight' in key '${n}' must be a positive integer`,A0=Object.prototype.hasOwnProperty;class Cj{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(l=>{let r=n1(l);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(l=>{l.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function n1(n){let a=null,i=null,l=null,r=1,u=null;if($n(n)||_a(n))l=n,a=w0(n),i=Vf(n);else{if(!A0.call(n,"name"))throw new Error(Tj("name"));const f=n.name;if(l=f,A0.call(n,"weight")&&(r=n.weight,r<=0))throw new Error(kj(f));a=w0(f),i=Vf(f),u=n.getFn}return{path:a,id:i,weight:r,src:l,getFn:u}}function w0(n){return _a(n)?n:n.split(".")}function Vf(n){return _a(n)?n.join("."):n}function Ej(n,a){let i=[],l=!1;const r=(u,f,p)=>{if(un(u))if(!f[p])i.push(u);else{let m=f[p];const g=u[m];if(!un(g))return;if(p===f.length-1&&($n(g)||Jx(g)||yj(g)))i.push(vj(g));else if(_a(g)){l=!0;for(let y=0,v=g.length;y<v;y+=1)r(g[y],f,p+1)}else f.length&&r(g,f,p+1)}};return r(n,$n(a)?a.split("."):a,0),l?i:i[0]}const Nj={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Aj={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(n,a)=>n.score===a.score?n.idx<a.idx?-1:1:n.score<a.score?-1:1},wj={location:0,threshold:.6,distance:100},jj={useExtendedSearch:!1,getFn:Ej,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var be={...Aj,...Nj,...wj,...jj};const Dj=/[^ ]+/g;function Mj(n=1,a=3){const i=new Map,l=Math.pow(10,a);return{get(r){const u=r.match(Dj).length;if(i.has(u))return i.get(u);const f=1/Math.pow(u,.5*n),p=parseFloat(Math.round(f*l)/l);return i.set(u,p),p},clear(){i.clear()}}}class Hh{constructor({getFn:a=be.getFn,fieldNormWeight:i=be.fieldNormWeight}={}){this.norm=Mj(i,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((i,l)=>{this._keysMap[i.id]=l})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,$n(this.docs[0])?this.docs.forEach((a,i)=>{this._addString(a,i)}):this.docs.forEach((a,i)=>{this._addObject(a,i)}),this.norm.clear())}add(a){const i=this.size();$n(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,l=this.size();i<l;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!un(a)||df(a))return;let l={v:a,i,n:this.norm.get(a)};this.records.push(l)}_addObject(a,i){let l={i,$:{}};this.keys.forEach((r,u)=>{let f=r.getFn?r.getFn(a):this.getFn(a,r.path);if(un(f)){if(_a(f)){let p=[];const m=[{nestedArrIndex:-1,value:f}];for(;m.length;){const{nestedArrIndex:g,value:y}=m.pop();if(un(y))if($n(y)&&!df(y)){let v={v:y,i:g,n:this.norm.get(y)};p.push(v)}else _a(y)&&y.forEach((v,b)=>{m.push({nestedArrIndex:b,value:v})})}l.$[u]=p}else if($n(f)&&!df(f)){let p={v:f,n:this.norm.get(f)};l.$[u]=p}}}),this.records.push(l)}toJSON(){return{keys:this.keys,records:this.records}}}function a1(n,a,{getFn:i=be.getFn,fieldNormWeight:l=be.fieldNormWeight}={}){const r=new Hh({getFn:i,fieldNormWeight:l});return r.setKeys(n.map(n1)),r.setSources(a),r.create(),r}function Rj(n,{getFn:a=be.getFn,fieldNormWeight:i=be.fieldNormWeight}={}){const{keys:l,records:r}=n,u=new Hh({getFn:a,fieldNormWeight:i});return u.setKeys(l),u.setIndexRecords(r),u}function qr(n,{errors:a=0,currentLocation:i=0,expectedLocation:l=0,distance:r=be.distance,ignoreLocation:u=be.ignoreLocation}={}){const f=a/n.length;if(u)return f;const p=Math.abs(l-i);return r?f+p/r:p?1:f}function Oj(n=[],a=be.minMatchCharLength){let i=[],l=-1,r=-1,u=0;for(let f=n.length;u<f;u+=1){let p=n[u];p&&l===-1?l=u:!p&&l!==-1&&(r=u-1,r-l+1>=a&&i.push([l,r]),l=-1)}return n[u-1]&&u-l>=a&&i.push([l,u-1]),i}const ws=32;function Bj(n,a,i,{location:l=be.location,distance:r=be.distance,threshold:u=be.threshold,findAllMatches:f=be.findAllMatches,minMatchCharLength:p=be.minMatchCharLength,includeMatches:m=be.includeMatches,ignoreLocation:g=be.ignoreLocation}={}){if(a.length>ws)throw new Error(Sj(ws));const y=a.length,v=n.length,b=Math.max(0,Math.min(l,v));let S=u,k=b;const C=p>1||m,N=C?Array(v):[];let E;for(;(E=n.indexOf(a,k))>-1;){let q=qr(a,{currentLocation:E,expectedLocation:b,distance:r,ignoreLocation:g});if(S=Math.min(q,S),k=E+y,C){let U=0;for(;U<y;)N[E+U]=1,U+=1}}k=-1;let A=[],D=1,M=y+v;const j=1<<y-1;for(let q=0;q<y;q+=1){let U=0,W=M;for(;U<W;)qr(a,{errors:q,currentLocation:b+W,expectedLocation:b,distance:r,ignoreLocation:g})<=S?U=W:M=W,W=Math.floor((M-U)/2+U);M=W;let ee=Math.max(1,b-W+1),ie=f?v:Math.min(b+W,v)+y,$=Array(ie+2);$[ie+1]=(1<<q)-1;for(let F=ie;F>=ee;F-=1){let te=F-1,B=i[n.charAt(te)];if(C&&(N[te]=+!!B),$[F]=($[F+1]<<1|1)&B,q&&($[F]|=(A[F+1]|A[F])<<1|1|A[F+1]),$[F]&j&&(D=qr(a,{errors:q,currentLocation:te,expectedLocation:b,distance:r,ignoreLocation:g}),D<=S)){if(S=D,k=te,k<=b)break;ee=Math.max(1,2*b-k)}}if(qr(a,{errors:q+1,currentLocation:b,expectedLocation:b,distance:r,ignoreLocation:g})>S)break;A=$}const K={isMatch:k>=0,score:Math.max(.001,D)};if(C){const q=Oj(N,p);q.length?m&&(K.indices=q):K.isMatch=!1}return K}function Ij(n){let a={};for(let i=0,l=n.length;i<l;i+=1){const r=n.charAt(i);a[r]=(a[r]||0)|1<<l-i-1}return a}const pc=String.prototype.normalize?(n=>n.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(n=>n);class s1{constructor(a,{location:i=be.location,threshold:l=be.threshold,distance:r=be.distance,includeMatches:u=be.includeMatches,findAllMatches:f=be.findAllMatches,minMatchCharLength:p=be.minMatchCharLength,isCaseSensitive:m=be.isCaseSensitive,ignoreDiacritics:g=be.ignoreDiacritics,ignoreLocation:y=be.ignoreLocation}={}){if(this.options={location:i,threshold:l,distance:r,includeMatches:u,findAllMatches:f,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y},a=m?a:a.toLowerCase(),a=g?pc(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const v=(S,k)=>{this.chunks.push({pattern:S,alphabet:Ij(S),startIndex:k})},b=this.pattern.length;if(b>ws){let S=0;const k=b%ws,C=b-k;for(;S<C;)v(this.pattern.substr(S,ws),S),S+=ws;if(k){const N=b-ws;v(this.pattern.substr(N),N)}}else v(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:l,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=l?pc(a):a,this.pattern===a){let C={isMatch:!0,score:0};return r&&(C.indices=[[0,a.length-1]]),C}const{location:u,distance:f,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:y}=this.options;let v=[],b=0,S=!1;this.chunks.forEach(({pattern:C,alphabet:N,startIndex:E})=>{const{isMatch:A,score:D,indices:M}=Bj(a,C,N,{location:u+E,distance:f,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:y});A&&(S=!0),b+=D,A&&M&&(v=[...v,...M])});let k={isMatch:S,score:S?b/this.chunks.length:1};return S&&r&&(k.indices=v),k}}class ss{constructor(a){this.pattern=a}static isMultiMatch(a){return j0(a,this.multiRegex)}static isSingleMatch(a){return j0(a,this.singleRegex)}search(){}}function j0(n,a){const i=n.match(a);return i?i[1]:null}class Lj extends ss{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){const i=a===this.pattern;return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class Uj extends ss{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const l=a.indexOf(this.pattern)===-1;return{isMatch:l,score:l?0:1,indices:[0,a.length-1]}}}class zj extends ss{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){const i=a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class Vj extends ss{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){const i=!a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class Hj extends ss{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){const i=a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[a.length-this.pattern.length,a.length-1]}}}class Gj extends ss{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){const i=!a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class i1 extends ss{constructor(a,{location:i=be.location,threshold:l=be.threshold,distance:r=be.distance,includeMatches:u=be.includeMatches,findAllMatches:f=be.findAllMatches,minMatchCharLength:p=be.minMatchCharLength,isCaseSensitive:m=be.isCaseSensitive,ignoreDiacritics:g=be.ignoreDiacritics,ignoreLocation:y=be.ignoreLocation}={}){super(a),this._bitapSearch=new s1(a,{location:i,threshold:l,distance:r,includeMatches:u,findAllMatches:f,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class o1 extends ss{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,l;const r=[],u=this.pattern.length;for(;(l=a.indexOf(this.pattern,i))>-1;)i=l+u,r.push([l,i-1]);const f=!!r.length;return{isMatch:f,score:f?0:1,indices:r}}}const Hf=[Lj,o1,zj,Vj,Gj,Hj,Uj,i1],D0=Hf.length,Pj=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,$j="|";function Fj(n,a={}){return n.split($j).map(i=>{let l=i.trim().split(Pj).filter(u=>u&&!!u.trim()),r=[];for(let u=0,f=l.length;u<f;u+=1){const p=l[u];let m=!1,g=-1;for(;!m&&++g<D0;){const y=Hf[g];let v=y.isMultiMatch(p);v&&(r.push(new y(v,a)),m=!0)}if(!m)for(g=-1;++g<D0;){const y=Hf[g];let v=y.isSingleMatch(p);if(v){r.push(new y(v,a));break}}}return r})}const qj=new Set([i1.type,o1.type]);class Yj{constructor(a,{isCaseSensitive:i=be.isCaseSensitive,ignoreDiacritics:l=be.ignoreDiacritics,includeMatches:r=be.includeMatches,minMatchCharLength:u=be.minMatchCharLength,ignoreLocation:f=be.ignoreLocation,findAllMatches:p=be.findAllMatches,location:m=be.location,threshold:g=be.threshold,distance:y=be.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:l,includeMatches:r,minMatchCharLength:u,findAllMatches:p,ignoreLocation:f,location:m,threshold:g,distance:y},a=i?a:a.toLowerCase(),a=l?pc(a):a,this.pattern=a,this.query=Fj(this.pattern,this.options)}static condition(a,i){return i.useExtendedSearch}searchIn(a){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:l,isCaseSensitive:r,ignoreDiacritics:u}=this.options;a=r?a:a.toLowerCase(),a=u?pc(a):a;let f=0,p=[],m=0;for(let g=0,y=i.length;g<y;g+=1){const v=i[g];p.length=0,f=0;for(let b=0,S=v.length;b<S;b+=1){const k=v[b],{isMatch:C,indices:N,score:E}=k.search(a);if(C){if(f+=1,m+=E,l){const A=k.constructor.type;qj.has(A)?p=[...p,...N]:p.push(N)}}else{m=0,f=0,p.length=0;break}}if(f){let b={isMatch:!0,score:m/f};return l&&(b.indices=p),b}}return{isMatch:!1,score:1}}}const Gf=[];function Kj(...n){Gf.push(...n)}function Pf(n,a){for(let i=0,l=Gf.length;i<l;i+=1){let r=Gf[i];if(r.condition(n,a))return new r(n,a)}return new s1(n,a)}const mc={AND:"$and",OR:"$or"},$f={PATH:"$path",PATTERN:"$val"},Ff=n=>!!(n[mc.AND]||n[mc.OR]),Zj=n=>!!n[$f.PATH],Xj=n=>!_a(n)&&e1(n)&&!Ff(n),M0=n=>({[mc.AND]:Object.keys(n).map(a=>({[a]:n[a]}))});function l1(n,a,{auto:i=!0}={}){const l=r=>{let u=Object.keys(r);const f=Zj(r);if(!f&&u.length>1&&!Ff(r))return l(M0(r));if(Xj(r)){const m=f?r[$f.PATH]:u[0],g=f?r[$f.PATTERN]:r[m];if(!$n(g))throw new Error(_j(m));const y={keyId:Vf(m),pattern:g};return i&&(y.searcher=Pf(g,a)),y}let p={children:[],operator:u[0]};return u.forEach(m=>{const g=r[m];_a(g)&&g.forEach(y=>{p.children.push(l(y))})}),p};return Ff(n)||(n=M0(n)),l(n)}function Qj(n,{ignoreFieldNorm:a=be.ignoreFieldNorm}){n.forEach(i=>{let l=1;i.matches.forEach(({key:r,norm:u,score:f})=>{const p=r?r.weight:null;l*=Math.pow(f===0&&p?Number.EPSILON:f,(p||1)*(a?1:u))}),i.score=l})}function Wj(n,a){const i=n.matches;a.matches=[],un(i)&&i.forEach(l=>{if(!un(l.indices)||!l.indices.length)return;const{indices:r,value:u}=l;let f={indices:r,value:u};l.key&&(f.key=l.key.src),l.idx>-1&&(f.refIndex=l.idx),a.matches.push(f)})}function Jj(n,a){a.score=n.score}function e2(n,a,{includeMatches:i=be.includeMatches,includeScore:l=be.includeScore}={}){const r=[];return i&&r.push(Wj),l&&r.push(Jj),n.map(u=>{const{idx:f}=u,p={item:a[f],refIndex:f};return r.length&&r.forEach(m=>{m(u,p)}),p})}class Yi{constructor(a,i={},l){this.options={...be,...i},this.options.useExtendedSearch,this._keyStore=new Cj(this.options.keys),this.setCollection(a,l)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof Hh))throw new Error(xj);this._myIndex=i||a1(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){un(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let l=0,r=this._docs.length;l<r;l+=1){const u=this._docs[l];a(u,l)&&(this.removeAt(l),l-=1,r-=1,i.push(u))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:l,includeScore:r,shouldSort:u,sortFn:f,ignoreFieldNorm:p}=this.options;let m=$n(a)?$n(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return Qj(m,{ignoreFieldNorm:p}),u&&m.sort(f),Jx(i)&&i>-1&&(m=m.slice(0,i)),e2(m,this._docs,{includeMatches:l,includeScore:r})}_searchStringList(a){const i=Pf(a,this.options),{records:l}=this._myIndex,r=[];return l.forEach(({v:u,i:f,n:p})=>{if(!un(u))return;const{isMatch:m,score:g,indices:y}=i.searchIn(u);m&&r.push({item:u,idx:f,matches:[{score:g,value:u,norm:p,indices:y}]})}),r}_searchLogical(a){const i=l1(a,this.options),l=(p,m,g)=>{if(!p.children){const{keyId:v,searcher:b}=p,S=this._findMatches({key:this._keyStore.get(v),value:this._myIndex.getValueForItemAtKeyId(m,v),searcher:b});return S&&S.length?[{idx:g,item:m,matches:S}]:[]}const y=[];for(let v=0,b=p.children.length;v<b;v+=1){const S=p.children[v],k=l(S,m,g);if(k.length)y.push(...k);else if(p.operator===mc.AND)return[]}return y},r=this._myIndex.records,u={},f=[];return r.forEach(({$:p,i:m})=>{if(un(p)){let g=l(i,p,m);g.length&&(u[m]||(u[m]={idx:m,item:p,matches:[]},f.push(u[m])),g.forEach(({matches:y})=>{u[m].matches.push(...y)}))}}),f}_searchObjectList(a){const i=Pf(a,this.options),{keys:l,records:r}=this._myIndex,u=[];return r.forEach(({$:f,i:p})=>{if(!un(f))return;let m=[];l.forEach((g,y)=>{m.push(...this._findMatches({key:g,value:f[y],searcher:i}))}),m.length&&u.push({idx:p,item:f,matches:m})}),u}_findMatches({key:a,value:i,searcher:l}){if(!un(i))return[];let r=[];if(_a(i))i.forEach(({v:u,i:f,n:p})=>{if(!un(u))return;const{isMatch:m,score:g,indices:y}=l.searchIn(u);m&&r.push({score:g,key:a,value:u,idx:f,norm:p,indices:y})});else{const{v:u,n:f}=i,{isMatch:p,score:m,indices:g}=l.searchIn(u);p&&r.push({score:m,key:a,value:u,norm:f,indices:g})}return r}}Yi.version="7.1.0";Yi.createIndex=a1;Yi.parseIndex=Rj;Yi.config=be;Yi.parseQuery=l1;Kj(Yj);function t2(n,a,i,l){if(!a.trim())return[];const r=.3;return new Yi(n,{keys:i,threshold:r,ignoreLocation:!0,includeScore:!0,includeMatches:!0,minMatchCharLength:2}).search(a).map(m=>({item:m.item,score:m.score??1,matches:(m.matches??[]).map(g=>({key:g.key??"",indices:g.indices}))}))}const qf={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 ts(n){return n==="blocked"?qf.blocked:qf[Gh(n)]}const n2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function a2(n){return n2[Gh(n)]??"statusPending"}const s2=["working","paused","failed","not_started","blocked","complete"],R0=["not_started","working","paused","complete","failed"],i2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Gh(n){return n in qf&&n!=="blocked"?n:i2[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 l2(n){if(n.length===0)return[];const a=[...n].sort((l,r)=>l[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let l=1;l<a.length;l++){const r=i[i.length-1],[u,f]=a[l];u<=r[1]+1?r[1]=Math.max(r[1],f):i.push([u,f])}return i}function r1({text:n,indices:a,highlightClass:i}){if(!a||a.length===0)return c.jsx(c.Fragment,{children:n});const l=l2(a),r=[];let u=0;for(const[f,p]of l)f>u&&r.push(c.jsx("span",{children:n.slice(u,f)},`p${u}`)),r.push(c.jsx("mark",{className:i,children:n.slice(f,p+1)},`m${f}`)),u=p+1;return u<n.length&&r.push(c.jsx("span",{children:n.slice(u)},`p${u}`)),c.jsx(c.Fragment,{children:r})}function r2(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((r,u)=>r.sortOrder-u.sortOrder);return i.sort((l,r)=>l.sortOrder-r.sortOrder)}function c2(n,a){const i=new Map;for(const u of n){const p=u.dependsOn.length>0&&u.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":u.status,m=i.get(p);m?m.push(u):i.set(p,[u])}const l=[],r=new Set;for(const u of s2){r.add(u);const f=i.get(u);if(f&&f.length>0){f.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ts(u);l.push({status:u,label:p.label,style:p,tasks:f})}}for(const[u,f]of i)if(!r.has(u)&&f.length>0){f.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ts(u);l.push({status:u,label:p.label,style:p,tasks:f})}return l}const u2="_container_z4i38_1",d2="_header_z4i38_5",f2="_headerActions_z4i38_17",h2="_searchInput_z4i38_23",p2="_searchHighlight_z4i38_56",m2="_groupToggle_z4i38_62",g2="_groupToggleActive_z4i38_89",v2="_addButton_z4i38_93",y2="_taskRow_z4i38_120",b2="_selected_z4i38_140",x2="_expandArrow_z4i38_150",_2="_expanded_z4i38_157",S2="_leafSpacer_z4i38_161",T2="_taskStatusIcon_z4i38_166",k2="_taskTitle_z4i38_170",C2="_workspaceBadge_z4i38_177",E2="_childCountBadge_z4i38_195",N2="_dependencyBadge_z4i38_208",A2="_blockedBadge_z4i38_220",w2="_addChildButton_z4i38_225",j2="_emptyState_z4i38_268",D2="_statusGroupHeader_z4i38_275",M2="_statusGroupIcon_z4i38_294",R2="_statusGroupLabel_z4i38_298",O2="_statusGroupCount_z4i38_303",Oe={container:u2,header:d2,headerActions:f2,searchInput:h2,searchHighlight:p2,groupToggle:m2,groupToggleActive:g2,addButton:v2,taskRow:y2,selected:b2,expandArrow:x2,expanded:_2,leafSpacer:S2,taskStatusIcon:T2,taskTitle:k2,workspaceBadge:C2,childCountBadge:E2,dependencyBadge:N2,blockedBadge:A2,addChildButton:w2,emptyState:j2,statusGroupHeader:D2,statusGroupIcon:M2,statusGroupLabel:R2,statusGroupCount:O2},B2=[{name:"title",weight:2},{name:"description",weight:1}],c1=16,I2=16,u1="grackle-task-group-by-status";function O0(){try{return localStorage.getItem(u1)==="true"}catch{return!1}}function L2(n){try{localStorage.setItem(u1,String(n))}catch{}}function U2({group:n,isExpanded:a,onToggle:i,selectedTaskId:l,navigate:r,titleHighlights:u,workspaceNames:f}){return c.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[c.jsxs("div",{className:Oe.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i())},children:[c.jsx("span",{className:`${Oe.expandArrow} ${a?Oe.expanded:""}`,children:"▸"}),c.jsx("span",{className:Oe.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),c.jsx("span",{className:Oe.statusGroupLabel,children:n.label}),c.jsx("span",{className:Oe.statusGroupCount,children:n.tasks.length})]}),c.jsx(Zn,{children:a&&c.jsx(kt.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:n.tasks.map(p=>{const m=ts(p.status),g=l===p.id,y=p.parentTaskId||!p.workspaceId?void 0:f.get(p.workspaceId);return c.jsxs("div",{onClick:()=>r(ba(p.id)),className:`${Oe.taskRow} ${g?Oe.selected:""}`,style:{"--task-indent":`${c1}px`},"data-task-id":p.id,children:[c.jsx("span",{className:Oe.leafSpacer}),c.jsx("span",{className:Oe.taskStatusIcon,style:{color:m.color},children:m.icon}),c.jsx("span",{className:Oe.taskTitle,title:p.title,children:c.jsx(r1,{text:p.title,indices:u.get(p.id),highlightClass:Oe.searchHighlight})}),y&&c.jsx("span",{className:Oe.workspaceBadge,title:y,children:y})]},p.id)})})})]})}function d1({node:n,depth:a,expandedTasks:i,toggleTask:l,selectedTaskId:r,navigate:u,taskStatusById:f,titleHighlights:p,workspaceNames:m}){const g=ts(n.status),y=n.dependsOn.length>0&&n.dependsOn.some(E=>f.get(E)!=="complete"),v=i.has(n.id),b=n.children.length>0,S=r===n.id,k=c1+a*I2,N=a===0&&!n.parentTaskId&&n.workspaceId?m.get(n.workspaceId):void 0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{onClick:()=>u(ba(n.id)),className:`${Oe.taskRow} ${S?Oe.selected:""}`,style:{"--task-indent":`${k}px`},"data-task-id":n.id,children:[b&&c.jsx("span",{className:`${Oe.expandArrow} ${v?Oe.expanded:""}`,role:"button",tabIndex:0,"aria-label":v?"Collapse task":"Expand task",onClick:E=>{E.stopPropagation(),l(n.id)},onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),E.stopPropagation(),l(n.id))},children:"▸"}),!b&&c.jsx("span",{className:Oe.leafSpacer}),c.jsx("span",{className:Oe.taskStatusIcon,style:{color:g.color},children:g.icon}),c.jsx("span",{className:Oe.taskTitle,title:n.title,children:c.jsx(r1,{text:n.title,indices:p.get(n.id),highlightClass:Oe.searchHighlight})}),N&&c.jsx("span",{className:Oe.workspaceBadge,title:N,children:N}),b&&c.jsxs("span",{className:Oe.childCountBadge,children:[n.children.filter(E=>E.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&c.jsx("span",{className:`${Oe.dependencyBadge} ${y?Oe.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:y?"blocked":"dep"}),a<mj&&c.jsx("button",{onClick:E=>{E.stopPropagation(),u(Pi(n.workspaceId,n.id))},title:"Add child task","aria-label":"Add child task",className:Oe.addChildButton,children:"+"})]}),c.jsx(Zn,{children:b&&v&&c.jsx(kt.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(E=>c.jsx(d1,{node:E,depth:a+1,expandedTasks:i,toggleTask:l,selectedTaskId:r,navigate:u,taskStatusById:f,titleHighlights:p,workspaceNames:m},E.id))})})]})}function z2(){const{workspaces:n,tasks:a}=We(),i=Ht(),[l,r]=x.useState(new Set),[u,f]=x.useState(new Set),[p,m]=x.useState(O0),[g,y]=x.useState(O0),[v,b]=x.useState(new Map),S=St("/tasks/:taskId/*"),k=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,C=x.useMemo(()=>new Map(a.map(F=>[F.id,F.status])),[a]),N=x.useMemo(()=>new Map(n.map(F=>[F.id,F.name])),[n]),E=()=>{const F=!p;L2(F),m(F),F&&(y(!0),b(new Map))},A=F=>{b(te=>{const B=new Map(te),H=B.has(F)?B.get(F):g;return B.set(F,!H),B})},D=F=>v.has(F)?v.get(F):g,M=F=>{r(te=>{const B=new Set(te);return B.has(F)?(B.delete(F),f(H=>new Set(H).add(F))):(B.add(F),f(H=>{const ae=new Set(H);return ae.delete(F),ae})),B})};x.useEffect(()=>{const F=new Set(a.filter(te=>te.parentTaskId).map(te=>te.parentTaskId));F.size>0&&r(te=>{const B=new Set(te);for(const H of F)u.has(H)||B.add(H);return B})},[a,u]);const[j,K]=x.useState(""),{directMatchTaskIds:q,treeMatchTaskIds:U,titleHighlights:W}=x.useMemo(()=>{if(!j.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const F=t2(a,j,B2),te=new Set(F.map(G=>G.item.id)),B=new Map;for(const G of F){const O=G.matches.find(se=>se.key==="title");O&&B.set(G.item.id,O.indices)}const H=new Set(te),ae=new Map(a.map(G=>[G.id,G]));for(const G of[...te]){let O=ae.get(G);for(;O!=null&&O.parentTaskId;)H.add(O.parentTaskId),O=ae.get(O.parentTaskId)}return{directMatchTaskIds:te,treeMatchTaskIds:H,titleHighlights:B}},[j,a]),ee=q!==null,ie=ee?p?q:U:null,$=ie?a.filter(F=>ie.has(F.id)):a,le=p?[]:r2($);return c.jsxs("div",{className:Oe.container,children:[c.jsxs("div",{className:Oe.header,children:[c.jsx("span",{children:"Tasks"}),c.jsxs("div",{className:Oe.headerActions,children:[c.jsx("button",{className:`${Oe.groupToggle} ${p?Oe.groupToggleActive:""}`,onClick:E,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,title:p?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),c.jsx("button",{className:Oe.addButton,onClick:()=>i(Pi()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&c.jsx("input",{type:"text",value:j,onChange:F=>K(F.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Oe.searchInput,"data-testid":"sidebar-search"}),p?c2($,C).map(F=>c.jsx(U2,{group:F,isExpanded:D(F.status),onToggle:()=>A(F.status),selectedTaskId:k,navigate:i,titleHighlights:W,workspaceNames:N},F.status)):le.map(F=>c.jsx(d1,{node:F,depth:0,expandedTasks:l,toggleTask:M,selectedTaskId:k,navigate:i,taskStatusById:C,titleHighlights:W,workspaceNames:N},F.id)),$.length===0&&!ee&&c.jsx("div",{className:Oe.emptyState,children:"No tasks yet. Click + to create one."}),$.length===0&&ee&&c.jsx("div",{className:Oe.emptyState,children:"No matching tasks"})]})}const V2="_nav_14i94_1",H2="_tab_14i94_24",G2="_tabActive_14i94_62",P2="_tabLabel_14i94_75",$2="_statusDot_14i94_81",F2="_pulse_14i94_87",q2="_addButton_14i94_99",Y2="_empty_14i94_132",Ka={nav:V2,tab:H2,tabActive:G2,tabLabel:P2,statusDot:$2,pulse:F2,addButton:q2,empty:Y2},K2={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function Z2(){const{environments:n}=We(),a=Ht(),i=x.useRef(null),l=St("/environments/:environmentId"),r=St("/environments/:environmentId/edit"),u=St("/environments/:environmentId/workspaces/:workspaceId"),f=St("/environments/:environmentId/workspaces/:workspaceId/*"),p=(l==null?void 0:l.params.environmentId)??(r==null?void 0:r.params.environmentId)??(u==null?void 0:u.params.environmentId)??(f==null?void 0:f.params.environmentId),m=p==="new"?void 0:p,g=x.useCallback(b=>{a(ul(b))},[a]),y=x.useCallback(b=>{var E;const S=(E=i.current)==null?void 0:E.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const k=Array.from(S).findIndex(A=>A===document.activeElement),C=k>=0?k:n.findIndex(A=>A.id===m);let N=C;if(b.key==="ArrowDown")b.preventDefault(),N=(C+1)%S.length;else if(b.key==="ArrowUp")b.preventDefault(),N=(C-1+S.length)%S.length;else if(b.key==="Home")b.preventDefault(),N=0;else if(b.key==="End")b.preventDefault(),N=S.length-1;else return;N<n.length&&a(ul(n[N].id)),S[N].focus()},[m,n,a]),v=m??(n.length>0?n[0].id:void 0);return c.jsxs("div",{className:Ka.nav,"data-testid":"environment-nav",children:[c.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:y,children:n.map(b=>{const S=b.id===m,k=b.id===v,C=K2[b.status]||"var(--text-tertiary)",N=b.status==="connected";return c.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:k?0:-1,className:`${Ka.tab} ${S?Ka.tabActive:""}`,onClick:()=>g(b.id),"data-testid":"env-nav-item",children:[c.jsx("span",{className:`${Ka.statusDot} ${N?Ka.pulse:""}`,style:{color:C},children:"●"}),c.jsx("span",{className:Ka.tabLabel,title:b.displayName||b.id,children:b.displayName||b.id})]},b.id)})}),c.jsx("button",{type:"button",className:Ka.addButton,onClick:()=>a(Fk),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),n.length===0&&c.jsx("div",{className:Ka.empty,children:"No environments yet."})]})}const X2="_nav_1bhou_1",Q2="_tab_1bhou_24",W2="_tabIcon_1bhou_62",J2="_tabActive_1bhou_68",Yr={nav:X2,tab:Q2,tabIcon:W2,tabActive:J2},ma=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function eD(){var f;const n=Nt(),a=Ht(),i=x.useRef(null),l=((f=ma.find(p=>n.pathname===`${el}/${p.path}`))==null?void 0:f.path)??ma[0].path,r=x.useCallback(p=>{a(`${el}/${p}`)},[a]),u=x.useCallback(p=>{var S,k;const m=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(C=>C===document.activeElement),y=g>=0?g:ma.findIndex(C=>C.path===l);let v=y;if(p.key==="ArrowDown")p.preventDefault(),v=(y+1)%ma.length;else if(p.key==="ArrowUp")p.preventDefault(),v=(y-1+ma.length)%ma.length;else if(p.key==="Home")p.preventDefault(),v=0;else if(p.key==="End")p.preventDefault(),v=ma.length-1;else return;const b=ma[v].path;a(`${el}/${b}`),(k=m[v])==null||k.focus()},[l,a]);return c.jsx("nav",{className:Yr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:u,children:ma.map(p=>{const m=p.path===l;return c.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Yr.tab} ${m?Yr.tabActive:""}`,onClick:()=>r(p.path),children:[c.jsx("span",{className:Yr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const tD="_container_pi6ii_1",nD="_content_pi6ii_66",B0={container:tD,content:nD},aD=320,f1=220,h1=600,p1="grackle-sidebar-width";function sD(){try{const n=localStorage.getItem(p1);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=f1&&a<=h1)return a}}catch{}return aD}function iD(n){try{localStorage.setItem(p1,String(n))}catch{}}function oD(){const[n]=x.useState(sD),a=x.useRef(null),i=Nt(),l=Tb(i.pathname);return x.useEffect(()=>{const r=a.current;if(!r)return;const u=new ResizeObserver(f=>{for(const p of f){const m=p.borderBoxSize[0];if(m){const g=Math.round(m.inlineSize);g>=f1&&g<=h1&&iD(g)}}});return u.observe(r),()=>{u.disconnect()}},[]),c.jsx("div",{className:B0.container,ref:a,"data-testid":"sidebar",style:{width:n},children:c.jsxs("div",{className:B0.content,children:[l==="tasks"&&c.jsx(z2,{}),l==="environments"&&c.jsx(Z2,{}),l==="settings"&&c.jsx(eD,{})]})})}const lD="_bar_tnfsh_1",rD="_btnPrimary_tnfsh_32",cD="_statusText_tnfsh_85",uD="_statusCompleted_tnfsh_90",dD="_statusFailed_tnfsh_94",fD="_statusBlocked_tnfsh_98",hD="_hintText_tnfsh_103",ot={bar:lD,btnPrimary:rD,statusText:cD,statusCompleted:uD,statusFailed:dD,statusBlocked:fD,hintText:hD};function pD(){const{sessions:n,tasks:a,environments:i}=We(),l=Ht(),r=Nt(),u=St("/sessions/:sessionId"),f=St("/tasks/:taskId"),p=St("/tasks/:taskId/stream"),m=St("/tasks/:taskId/findings"),g=St("/tasks/:taskId/edit"),y=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),v=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),b=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),k=St("/sessions/new"),C=St("/environments/:environmentId/workspaces/:workspaceId"),N=St("/tasks/new"),E=St("/chat"),A=St("/"),D=St("/settings/*"),M=u==null?void 0:u.params.sessionId,j=(f==null?void 0:f.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(y==null?void 0:y.params.taskId)??(v==null?void 0:v.params.taskId)??(b==null?void 0:b.params.taskId)??(S==null?void 0:S.params.taskId),K=y??v??b??S,q=(K==null?void 0:K.params.environmentId)??(C==null?void 0:C.params.environmentId),U=r.pathname.startsWith("/environments")&&!C&&!K,W=!!E,ee=!!k,ie=!!C&&!y&&!v&&!b&&!S,$=!!N;if(!!A&&!ee&&!ie&&!$||!!D||(!!g||!!S)||$||U||ee)return c.jsx(c.Fragment,{});if(W)return i.find(H=>H.adapterType==="local"&&H.status==="connected")?c.jsx(c.Fragment,{}):c.jsx("div",{className:ot.bar,children:c.jsx("span",{className:ot.hintText,children:"Add a local environment to start chatting"})});if(ie)return c.jsx("div",{className:ot.bar,children:c.jsx("span",{className:ot.hintText,children:"Select a task or click + to create one"})});if(j){const B=a.find(G=>G.id===j);if(!B)return c.jsx("div",{className:ot.bar,children:c.jsx("span",{className:ot.hintText,children:"Loading..."})});const H=new Map(a.map(G=>[G.id,G])),ae=B.dependsOn.some(G=>{const O=H.get(G);return O!==void 0&&O.status!=="complete"});if(B.status==="not_started"){const G=ae?B.dependsOn.map(O=>H.get(O)).filter(O=>O&&O.status!=="complete").map(O=>O.title):[];return c.jsx("div",{className:ot.bar,children:ae?c.jsxs("span",{className:ot.statusBlocked,children:["Blocked by: ",G.join(", ")]}):c.jsx("span",{className:ot.hintText,children:"Use the buttons above to start or manage this task"})})}if(B.status==="working"||B.status==="paused"){const G=B.latestSessionId||void 0,O=G?n.find(ye=>ye.id===G):void 0;return O&&!["completed","failed","interrupted","hibernating"].includes(O.status)?c.jsx(c.Fragment,{}):c.jsx("div",{className:ot.bar,children:c.jsx("span",{className:ot.hintText,children:"Waiting for agent..."})})}if(B.status==="complete")return c.jsxs("div",{className:ot.bar,children:[c.jsx("span",{className:`${ot.statusText} ${ot.statusCompleted}`,children:"Task completed"}),c.jsx("button",{onClick:()=>l(Pi(B.workspaceId,void 0,q)),className:ot.btnPrimary,children:"+ New Task"})]});if(B.status==="failed")return c.jsx("div",{className:ot.bar,children:c.jsx("span",{className:`${ot.statusText} ${ot.statusFailed}`,children:"Task failed"})})}if(M){const B=n.find(G=>G.id===M),H=B!==void 0&&["completed","failed","interrupted","hibernating"].includes(B.status);if(B!==void 0&&!H)return c.jsx(c.Fragment,{});if(H)return c.jsxs("div",{className:ot.bar,children:[c.jsxs("span",{className:`${ot.statusText} ${ot.hintText}`,children:["Session ",B.status]}),c.jsx("button",{onClick:()=>l(mb(B.environmentId)),className:ot.btnPrimary,children:"+ New Chat"})]})}return c.jsx("div",{className:ot.bar,children:c.jsx("span",{className:ot.hintText,children:"Loading..."})})}const mD="_toast_da8ll_1",gD="_success_da8ll_18",vD="_icon_da8ll_22",yD="_error_da8ll_25",bD="_warning_da8ll_32",xD="_info_da8ll_38",_D="_message_da8ll_53",SD="_close_da8ll_60",Yo={toast:mD,success:gD,icon:vD,error:yD,warning:bD,info:xD,message:_D,close:SD},TD={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function kD({toast:n,onDismiss:a}){return x.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),c.jsxs(kt.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:[c.jsx("span",{className:Yo.icon,"aria-hidden":"true",children:TD[n.variant]}),c.jsx("span",{className:Yo.message,children:n.message}),c.jsx("button",{type:"button",className:Yo.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const CD="_container_qqse2_1",ED={container:CD};function ND(){const{toasts:n,dismissToast:a}=$i();return c.jsx("div",{className:ED.container,"data-testid":"toast-container",children:c.jsx(Zn,{children:n.map(i=>c.jsx(kD,{toast:i,onDismiss:a},i.id))})})}const AD="_breadcrumbs_17or2_1",wD="_list_17or2_11",jD="_item_17or2_21",DD="_separator_17or2_28",MD="_link_17or2_34",RD="_current_17or2_57",Ei={breadcrumbs:AD,list:wD,item:jD,separator:DD,link:MD,current:RD},OD="›";function Ki({segments:n}){return c.jsx("nav",{className:Ei.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:c.jsx("ol",{className:Ei.list,children:n.map((a,i)=>{const l=i===n.length-1;return c.jsxs("li",{className:Ei.item,children:[i>0&&c.jsx("span",{className:Ei.separator,"aria-hidden":"true",children:OD}),a.url&&!l?c.jsx(sh,{className:Ei.link,to:a.url,title:a.label,children:a.label}):c.jsx("span",{className:Ei.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function Yf(){Yf=function(r,u){return new i(r,void 0,u)};var n=RegExp.prototype,a=new WeakMap;function i(r,u,f){var p=new RegExp(r,u);return a.set(p,f||a.get(r)),gc(p,i.prototype)}function l(r,u){var f=a.get(u);return Object.keys(f).reduce(function(p,m){var g=f[m];if(typeof g=="number")p[m]=r[g];else{for(var y=0;r[g[y]]===void 0&&y+1<g.length;)y++;p[m]=r[g[y]]}return p},Object.create(null))}return(function(r,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(u&&u.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),u&&gc(r,u)})(i,RegExp),i.prototype.exec=function(r){var u=n.exec.call(this,r);if(u){u.groups=l(u,this);var f=u.indices;f&&(f.groups=l(f,this))}return u},i.prototype[Symbol.replace]=function(r,u){if(typeof u=="string"){var f=a.get(this);return n[Symbol.replace].call(this,r,u.replace(/\$<([^>]+)>/g,function(m,g){var y=f[g];return"$"+(Array.isArray(y)?y.join("$"):y)}))}if(typeof u=="function"){var p=this;return n[Symbol.replace].call(this,r,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(l(m,p)),u.apply(this,m)})}return n[Symbol.replace].call(this,r,u)},Yf.apply(this,arguments)}function gc(n,a){return gc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},gc(n,a)}function I0(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 ff(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(r,u){if(r){if(typeof r=="string")return I0(r,u);var f=Object.prototype.toString.call(r).slice(8,-1);return f==="Object"&&r.constructor&&(f=r.constructor.name),f==="Map"||f==="Set"?Array.from(r):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?I0(r,u):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.
|
|
98
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var BD=(function(n){return function(a){return a===void 0&&(a={}),(function(l,r){if(r&&!l.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(n,a.defaultLanguage),function(l){LS(l,"element",i)};function i(l,r,u){var f,p;if(u&&u.tagName==="pre"&&l.tagName==="code"){var m=(l==null||(f=l.data)==null?void 0:f.meta)||(l==null||(p=l.properties)==null?void 0:p.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 g,y,v=(function(j){for(var K,q=ff(j.properties.className);!(K=q()).done;){var U=K.value;if(U.slice(0,9)==="language-")return U.slice(9).toLowerCase()}return null})(l);if(!v&&a.defaultLanguage&&l.properties.className.push("language-"+(v=a.defaultLanguage)),l.properties.className.push("code-highlight"),v)try{var b,S;S=(b=v)!=null&&b.includes("diff-")?v.split("-")[1]:v,g=n.highlight(zr(l),S),u.properties.className=(u.properties.className||[]).concat("language-"+S)}catch(j){if(!a.ignoreMissing||!/Unknown language/.test(j.message))throw j;g=l}else g=l;g.children=(y=1,function j(K){return K.reduce(function(q,U){if(U.type==="text"){var W=U.value,ee=(W.match(/\n/g)||"").length;if(ee===0)U.position={start:{line:y,column:1},end:{line:y,column:1}},q.push(U);else for(var ie,$=W.split(`
|
|
99
|
-
`),le=ff($.entries());!(ie=le()).done;){var F=ie.value,te=F[0],B=F[1];q.push({type:"text",value:te===$.length-1?B:B+`
|
|
100
|
-
`,position:{start:{line:y+te,column:1},end:{line:y+te,column:1}}})}return y+=ee,q}if(Object.prototype.hasOwnProperty.call(U,"children")){var H=y;return U.children=j(U.children),q.push(U),U.position={start:{line:H,column:1},end:{line:y,column:1}},q}return q.push(U),q},[])})(g.children),g.position=g.children.length>0?{start:{line:g.children[0].position.start.line,column:0},end:{line:g.children[g.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var k,C=(function(j){var K=/{([\d,-]+)}/,q=j.split(",").map(function(ee){return ee.trim()}).join();if(K.test(q)){var U=K.exec(q)[1],W=zS(U);return function(ee){return W.includes(ee+1)}}return function(){return!1}})(m),N=(function(j){var K=Yf(/showLineNumbers=(\d+)/i,{lines:1});if(K.test(j)){var q=K.exec(j);return Number(q.groups.lines)}return 1})(m),E=(function(j){for(var K=new Array(j),q=0;q<j;q++)K[q]={type:"element",tagName:"span",properties:{className:[]},children:[]};return K})(g.position.end.line),A=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],D=function(){var j,K,q=k.value,U=q[0],W=q[1];W.properties.className=["code-line"];var ee=VS(g,function(ie){return ie.position.start.line<=U+1&&ie.position.end.line>=U+1});W.children=ee.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(v))&&!A.some(function(ie){return m.toLowerCase().includes(ie)})&&(W.properties.line=[(U+N).toString()],W.properties.className.push("line-number")),C(U)&&W.properties.className.push("highlight-line"),(v==="diff"||(j=v)!=null&&j.includes("diff-"))&&zr(W).substring(0,1)==="-"?W.properties.className.push("deleted"):(v==="diff"||(K=v)!=null&&K.includes("diff-"))&&zr(W).substring(0,1)==="+"&&W.properties.className.push("inserted")},M=ff(E.entries());!(k=M()).done;)D();E.length>0&&zr(E[E.length-1]).trim()===""&&E.pop(),l.children=E}}}})(US);function m1(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 Vi(n){return n===0?"-":n<.01?`$${n.toFixed(4)}`:`$${n.toFixed(2)}`}const ID="_systemContextEvent_1qbiw_1",LD="_systemContextHeader_1qbiw_7",UD="_systemContextBadge_1qbiw_28",zD="_systemContextToggle_1qbiw_37",VD="_systemContextPre_1qbiw_43",HD="_systemContextEllipsis_1qbiw_54",GD="_systemEvent_1qbiw_58",PD="_systemTimestamp_1qbiw_65",$D="_textEvent_1qbiw_69",FD="_toolUseEvent_1qbiw_155",qD="_toolUseHeader_1qbiw_175",YD="_toolUsePrefix_1qbiw_182",KD="_toolUseName_1qbiw_187",ZD="_toolUseArgs_1qbiw_192",XD="_toolResultEvent_1qbiw_203",QD="_toolResultHeader_1qbiw_208",WD="_toolResultIndicatorOk_1qbiw_232",JD="_toolResultIndicatorError_1qbiw_239",eM="_toolResultLabel_1qbiw_246",tM="_toolResultToggle_1qbiw_250",nM="_toolResultCommand_1qbiw_256",aM="_toolResultEllipsis_1qbiw_266",sM="_toolResultPre_1qbiw_270",iM="_errorEvent_1qbiw_291",oM="_statusEvent_1qbiw_299",lM="_userInputEvent_1qbiw_308",rM="_userInputContent_1qbiw_314",cM="_signalEvent_1qbiw_331",uM="_signalBadge_1qbiw_342",dM="_signalContent_1qbiw_351",fM="_usageEvent_1qbiw_356",hM="_usageBadge_1qbiw_363",pM="_defaultEvent_1qbiw_372",Be={systemContextEvent:ID,systemContextHeader:LD,systemContextBadge:UD,systemContextToggle:zD,systemContextPre:VD,systemContextEllipsis:HD,systemEvent:GD,systemTimestamp:PD,textEvent:$D,toolUseEvent:FD,toolUseHeader:qD,toolUsePrefix:YD,toolUseName:KD,toolUseArgs:ZD,toolResultEvent:XD,toolResultHeader:QD,toolResultIndicatorOk:WD,toolResultIndicatorError:JD,toolResultLabel:eM,toolResultToggle:tM,toolResultCommand:nM,toolResultEllipsis:aM,toolResultPre:sM,errorEvent:iM,statusEvent:oM,userInputEvent:lM,userInputContent:rM,signalEvent:cM,signalBadge:uM,signalContent:dM,usageEvent:fM,usageBadge:hM,defaultEvent:pM},L0=3;function mM({content:n}){const[a,i]=x.useState(!1),l=n.split(`
|
|
101
|
-
`),r=l.length>L0,u=a?n:l.slice(0,L0).join(`
|
|
102
|
-
`);return c.jsxs("div",{className:Be.systemContextEvent,"data-testid":"system-context-event",children:[c.jsxs("button",{type:"button",className:Be.systemContextHeader,onClick:()=>{i(f=>!f)},"aria-expanded":a,children:[c.jsx("span",{className:Be.systemContextBadge,children:"SYSTEM PROMPT"}),r&&c.jsx("span",{className:Be.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),c.jsxs("pre",{className:Be.systemContextPre,children:[u,!a&&r&&c.jsx("span",{className:Be.systemContextEllipsis,children:"…"})]})]})}function gM({time:n,content:a}){return c.jsxs("div",{className:Be.systemEvent,children:[c.jsxs("span",{className:Be.systemTimestamp,children:["[",n,"]"]})," ",a]})}function vM({content:n}){return c.jsx("div",{className:Be.textEvent,children:c.jsx(Zf,{remarkPlugins:[Xf],rehypePlugins:[BD],children:n})})}function yM({content:n}){let a="",i=n;try{const l=JSON.parse(n);a=l.tool||"",i=JSON.stringify(l.args,null,2)}catch{}return c.jsxs("div",{className:Be.toolUseEvent,children:[c.jsxs("div",{className:Be.toolUseHeader,children:[c.jsx("span",{className:Be.toolUsePrefix,children:">"}),a?c.jsx("span",{className:Be.toolUseName,children:a}):null]}),c.jsx("pre",{className:Be.toolUseArgs,children:i})]})}const U0=5;function bM(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 xM({content:n,raw:a,toolUseCtx:i}){const[l,r]=x.useState(!1);let u=!1;if(a)try{u=JSON.parse(a).is_error===!0}catch{}const f=n.split(`
|
|
103
|
-
`),p=f.length>U0,m=l?n:f.slice(0,U0).join(`
|
|
104
|
-
`),y=((i==null?void 0:i.tool)??"")||(u?"Tool error":"Tool output"),v=i?bM(i.tool,i.args):"",b=c.jsxs(c.Fragment,{children:[c.jsx("span",{className:u?Be.toolResultIndicatorError:Be.toolResultIndicatorOk,"aria-label":u?"error":"success","data-testid":u?"tool-result-indicator-error":"tool-result-indicator-ok",children:u?"✗":"✓"}),c.jsx("span",{className:Be.toolResultLabel,"data-testid":"tool-result-label",children:y}),p&&c.jsx("span",{className:Be.toolResultToggle,"aria-hidden":"true",children:l?"▾":"▸"})]});return c.jsxs("div",{className:Be.toolResultEvent,"data-testid":"tool-result",children:[p?c.jsx("button",{className:Be.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{r(S=>!S)},"aria-expanded":l,children:b}):c.jsx("div",{className:Be.toolResultHeader,"data-testid":"tool-result-header",children:b}),v&&c.jsx("div",{className:Be.toolResultCommand,children:v}),c.jsxs("pre",{className:Be.toolResultPre,"data-testid":"tool-result-content",children:[m,!l&&p&&c.jsx("span",{className:Be.toolResultEllipsis,children:"…"})]})]})}function _M({content:n}){return c.jsxs("div",{className:Be.errorEvent,children:["Error: ",n]})}function SM({content:n}){return c.jsxs("div",{className:Be.statusEvent,children:["--- ",n," ---"]})}function TM({content:n}){return c.jsx("div",{className:Be.userInputEvent,children:c.jsx("span",{className:Be.userInputContent,children:n})})}function kM({content:n}){return c.jsxs("div",{className:Be.signalEvent,"data-testid":"signal-event",children:[c.jsx("span",{className:Be.signalBadge,children:"SIGNAL"}),c.jsx("span",{className:Be.signalContent,children:n})]})}function CM({content:n}){let a=n;try{const i=JSON.parse(n),l=Number(i.input_tokens)||0,r=Number(i.output_tokens)||0,u=m1(l+r),f=Vi(Number(i.cost_usd)||0);a=`${u} tokens · ${f}`}catch{}return c.jsx("div",{className:Be.usageEvent,"data-testid":"usage-event",children:c.jsx("span",{className:Be.usageBadge,children:a})})}function EM({content:n}){return c.jsx("div",{className:Be.defaultEvent,children:n})}function NM({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 c.jsx(mM,{content:n.content})}catch{}return c.jsx(gM,{time:i,content:n.content})}case"text":case"output":return c.jsx(vM,{content:n.content});case"tool_use":return c.jsx(yM,{content:n.content});case"tool_result":return c.jsx(xM,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return c.jsx(_M,{content:n.content});case"status":return c.jsx(SM,{content:n.content});case"user_input":return c.jsx(TM,{content:n.content});case"signal":return c.jsx(kM,{content:n.content});case"usage":return c.jsx(CM,{content:n.content});default:return c.jsx(EM,{content:n.content})}}const AM="_overlay_cmicx_1",wM="_dialog_cmicx_11",jM="_title_cmicx_30",DM="_description_cmicx_38",MM="_actions_cmicx_45",RM="_cancelButton_cmicx_52",OM="_confirmButton_cmicx_79",Cs={overlay:AM,dialog:wM,title:jM,description:DM,actions:MM,cancelButton:RM,confirmButton:OM};function wc({isOpen:n,title:a,description:i,confirmLabel:l="Delete",onConfirm:r,onCancel:u}){const f=x.useId(),p=x.useId();return c.jsx(Zn,{children:n&&c.jsx(kt.div,{className:Cs.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:u,onKeyDown:m=>{m.key==="Escape"&&u()},role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-describedby":i?p:void 0,children:c.jsxs(kt.div,{className:Cs.dialog,initial:{opacity:0,scale:.93,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.93,y:-10},transition:{duration:.15,ease:[.16,1,.3,1]},onClick:m=>m.stopPropagation(),children:[c.jsx("h3",{id:f,className:Cs.title,children:a}),i&&c.jsx("p",{id:p,className:Cs.description,children:i}),c.jsxs("div",{className:Cs.actions,children:[c.jsx("button",{type:"button",className:Cs.cancelButton,onClick:u,autoFocus:!0,children:"Cancel"}),c.jsx("button",{type:"button",className:Cs.confirmButton,onClick:r,children:l})]})]})})})}const BM="_spinner_1uyt1_1",IM="_spin_1uyt1_1",LM="_sm_1uyt1_14",UM="_md_1uyt1_20",zM="_lg_1uyt1_26",VM="_xl_1uyt1_32",z0={spinner:BM,spin:IM,sm:LM,md:UM,lg:zM,xl:VM};function Ph({size:n="md",className:a,label:i="Loading",liveRegion:l=!1}){return c.jsx("span",{className:`${z0.spinner} ${z0[n]} ${a??""}`,role:l?"status":void 0,"aria-label":i,"aria-hidden":l?void 0:!0})}const HM="_splash_1bn1g_1",GM="_logo_1bn1g_11",V0={splash:HM,logo:GM};function PM(){return c.jsxs("div",{className:V0.splash,"data-testid":"splash-screen",children:[c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:V0.logo}),c.jsx(Ph,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function $M(n,a){const i=x.useRef(null);x.useEffect(()=>{const l=i.current;if(i.current=n,l===null)return;const r=new Map;for(const f of l)r.set(f.id,f);const u=new Set;for(const f of n){u.add(f.id);const p=r.get(f.id);if(p&&p.status!==f.status&&f.status!=="sleeping"){if(f.status==="connecting"){a("Provisioning environment…","info");continue}f.status==="connected"?a("Environment connected","success"):f.status==="error"?a("Environment provision failed","error"):f.status==="disconnected"&&(p.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const f of l)u.has(f.id)||a("Environment removed","info")},[n,a])}function FM(n,a,i){const l=n.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,r=g1(a),u=a.filter(m=>Kf(m,r)).length,f=a.filter(m=>m.status==="paused"||m.status==="failed"||Kf(m,r)).length,p=i.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:l,blockedTasks:u,attentionTasks:f,unhealthyEnvironments:p}}function g1(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function Kf(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function qM(n,a){var f;const i=new Map;for(const p of a)i.set(p.id,p);const l=g1(n),r=[];for(const p of n){const m=p.workspaceId?((f=i.get(p.workspaceId))==null?void 0:f.name)??"Unknown":"Unknown";p.status==="failed"?r.push({task:p,reason:"failed",workspaceName:m}):Kf(p,l)?r.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&r.push({task:p,reason:"paused",workspaceName:m})}const u={failed:0,blocked:1,paused:2};return r.sort((p,m)=>(u[p.reason]??3)-(u[m.reason]??3)),r}function YM(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 r;return{session:l,environmentName:((r=i.get(l.environmentId))==null?void 0:r.displayName)??"Unknown"}})}function KM(n,a,i){const l=new Map;for(const r of a){if(!r.workspaceId)continue;let u=l.get(r.workspaceId);u||(u={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},l.set(r.workspaceId,u)),u.totalTasks+=1,r.status==="complete"?u.completedTasks+=1:r.status==="working"?u.workingTasks+=1:r.status==="failed"&&(u.failedTasks+=1)}return n.map(r=>{const u=l.get(r.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:r,totalTasks:u.totalTasks,completedTasks:u.completedTasks,workingTasks:u.workingTasks,failedTasks:u.failedTasks}})}const ZM="_dashboard_16pzm_1",XM="_kpiStrip_16pzm_11",QM="_kpiCard_16pzm_23",WM="_kpiValue_16pzm_68",JM="_kpiLabel_16pzm_76",eR="_bodyGrid_16pzm_84",tR="_section_16pzm_96",nR="_sectionHeader_16pzm_109",aR="_sectionIcon_16pzm_118",sR="_sectionTitle_16pzm_123",iR="_sectionCount_16pzm_131",oR="_sectionBody_16pzm_138",lR="_emptyHint_16pzm_143",rR="_sessionRow_16pzm_150",cR="_sessionPrompt_16pzm_177",uR="_sessionEnv_16pzm_186",dR="_sessionRuntime_16pzm_192",fR="_sessionStatus_16pzm_198",hR="_statusDot_16pzm_207",pR="_attentionRow_16pzm_233",mR="_attentionTitle_16pzm_259",gR="_attentionMeta_16pzm_267",vR="_reasonBadge_16pzm_274",yR="_bottomGrid_16pzm_301",bR="_envRow_16pzm_312",xR="_envName_16pzm_323",_R="_envStatusBadge_16pzm_333",SR="_workspaceRow_16pzm_369",TR="_workspaceTop_16pzm_395",kR="_workspaceName_16pzm_401",CR="_workspaceCounts_16pzm_407",ER="_progressBar_16pzm_415",NR="_progressFill_16pzm_422",me={dashboard:ZM,kpiStrip:XM,kpiCard:QM,kpiValue:WM,kpiLabel:JM,bodyGrid:eR,section:tR,sectionHeader:nR,sectionIcon:aR,sectionTitle:sR,sectionCount:iR,sectionBody:oR,emptyHint:lR,sessionRow:rR,sessionPrompt:cR,sessionEnv:uR,sessionRuntime:dR,sessionStatus:fR,statusDot:hR,attentionRow:pR,attentionTitle:mR,attentionMeta:gR,reasonBadge:vR,bottomGrid:yR,envRow:bR,envName:xR,envStatusBadge:_R,workspaceRow:SR,workspaceTop:TR,workspaceName:kR,workspaceCounts:CR,progressBar:ER,progressFill:NR},AR={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 wR(n,a,i,l){const r=[`${n} of ${a} tasks completed`];return i>0&&r.push(`${i} in progress`),l>0&&r.push(`${l} failed`),r.join(", ")}function Zr({value:n,label:a,accent:i,index:l,testId:r}){return c.jsxs(kt.div,{className:me.kpiCard,"data-accent":i,"data-testid":r,variants:AR,initial:"hidden",animate:"visible",custom:l,children:[c.jsx("span",{className:me.kpiValue,children:n}),c.jsx("span",{className:me.kpiLabel,children:a})]})}function jR(){const{workspaces:n,tasks:a,sessions:i,environments:l,loadTasks:r}=We(),u=Ht(),f=x.useRef(new Set);x.useEffect(()=>{for(const v of n)f.current.has(v.id)||(f.current.add(v.id),r(v.id))},[n,r]);const p=x.useMemo(()=>FM(i,a,l),[i,a,l]),m=x.useMemo(()=>YM(i,l),[i,l]),g=x.useMemo(()=>qM(a,n),[a,n]),y=x.useMemo(()=>KM(n,a),[n,a,l]);return c.jsxs("div",{className:me.dashboard,"data-testid":"dashboard",children:[c.jsxs("div",{className:me.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[c.jsx(Zr,{value:p.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),c.jsx(Zr,{value:p.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),c.jsx(Zr,{value:p.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),c.jsx(Zr,{value:p.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),c.jsxs("div",{className:me.bodyGrid,children:[c.jsxs(kt.div,{className:me.section,variants:Kr,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"●"}),c.jsx("span",{className:me.sectionTitle,children:"Active Sessions"}),c.jsx("span",{className:me.sectionCount,children:m.length})]}),c.jsx("div",{className:me.sectionBody,children:m.length===0?c.jsx("div",{className:me.emptyHint,children:"No active sessions"}):m.map(({session:v,environmentName:b})=>c.jsxs("button",{type:"button",className:me.sessionRow,onClick:()=>u(pb(v.id)),"data-testid":"session-row",children:[c.jsx("span",{className:me.sessionPrompt,title:v.prompt,children:v.prompt||"—"}),c.jsx("span",{className:me.sessionEnv,children:b}),c.jsx("span",{className:me.sessionRuntime,children:v.runtime}),c.jsxs("span",{className:me.sessionStatus,children:[c.jsx("span",{className:me.statusDot,"data-status":v.status}),v.status]})]},v.id))})]}),c.jsxs(kt.div,{className:me.section,variants:Kr,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"⚑"}),c.jsx("span",{className:me.sectionTitle,children:"Needs Attention"}),c.jsx("span",{className:me.sectionCount,children:g.length})]}),c.jsx("div",{className:me.sectionBody,children:g.length===0?c.jsx("div",{className:me.emptyHint,children:"All clear"}):g.map(({task:v,reason:b,workspaceName:S})=>c.jsxs("button",{type:"button",className:me.attentionRow,onClick:()=>u(ba(v.id)),"data-testid":"attention-row",children:[c.jsxs("div",{className:me.attentionTitle,children:[c.jsx("span",{className:me.reasonBadge,"data-reason":b,children:b}),v.title]}),c.jsx("div",{className:me.attentionMeta,children:c.jsx("span",{children:S})})]},v.id))})]})]}),c.jsxs("div",{className:me.bottomGrid,children:[c.jsxs(kt.div,{className:me.section,variants:Kr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"◈"}),c.jsx("span",{className:me.sectionTitle,children:"Environment Health"}),c.jsx("span",{className:me.sectionCount,children:l.length})]}),c.jsx("div",{className:me.sectionBody,children:l.length===0?c.jsx("div",{className:me.emptyHint,children:"No environments configured"}):l.map(v=>c.jsxs("div",{className:me.envRow,"data-testid":"dashboard-env-row",children:[c.jsx("span",{className:me.envName,children:v.displayName}),c.jsx("span",{className:me.envStatusBadge,"data-status":v.status,children:v.status})]},v.id))})]}),c.jsxs(kt.div,{className:me.section,variants:Kr,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"▦"}),c.jsx("span",{className:me.sectionTitle,children:"Workspaces"}),c.jsx("span",{className:me.sectionCount,children:n.length})]}),c.jsx("div",{className:me.sectionBody,children:y.length===0?c.jsx("div",{className:me.emptyHint,children:"No workspaces yet"}):y.map(({workspace:v,totalTasks:b,completedTasks:S,workingTasks:k,failedTasks:C})=>{const N=b>0?Math.round(S/b*100):0;return c.jsxs("button",{type:"button",className:me.workspaceRow,onClick:()=>u(Bi(v.id,v.environmentId)),"data-testid":"workspace-row",children:[c.jsxs("div",{className:me.workspaceTop,children:[c.jsx("span",{className:me.workspaceName,children:v.name}),c.jsxs("span",{className:me.workspaceCounts,"aria-label":wR(S,b,k,C),children:[S,"/",b,k>0&&c.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",k]}),C>0&&c.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",C]})]})]}),b>0&&c.jsx("div",{className:me.progressBar,children:c.jsx("div",{className:me.progressFill,style:{width:`${N}%`}})})]},v.id)})})]})]})]})}const DR="_panelContainer_aei9x_1",MR="_emptyState_aei9x_8",RR="_fadeIn_aei9x_1",OR="_workspaceSummary_aei9x_17",BR="_workspaceSummaryTitle_aei9x_28",IR="_workspaceSummarySubtitle_aei9x_32",LR="_header_aei9x_36",UR="_headerInfo_aei9x_69",zR="_killButton_aei9x_75",VR="_headerTitle_aei9x_104",HR="_headerActions_aei9x_119",GR="_taskStatusBadge_aei9x_126",PR="_taskBranch_aei9x_135",$R="_taskBlockedBadge_aei9x_141",FR="_btnPrimary_aei9x_149",qR="_btnDanger_aei9x_180",YR="_btnGhost_aei9x_219",KR="_rejectInput_aei9x_245",ZR="_tabBar_aei9x_275",XR="_tab_aei9x_275",QR="_active_aei9x_301",WR="_eventScroll_aei9x_306",JR="_tabContent_aei9x_312",e3="_noContext_aei9x_317",t3="_overviewContent_aei9x_323",n3="_overviewDashboard_aei9x_332",a3="_overviewHero_aei9x_338",s3="_statusBadge_aei9x_345",i3="_statusPending_aei9x_357",o3="_statusAssigned_aei9x_362",l3="_statusInProgress_aei9x_367",r3="_statusReview_aei9x_372",c3="_statusDone_aei9x_377",u3="_statusFailed_aei9x_382",d3="_statusWaitingInput_aei9x_387",f3="_overviewBranchPill_aei9x_392",h3="_branchLink_aei9x_407",p3="_overviewSection_aei9x_418",m3="_overviewLabel_aei9x_424",g3="_overviewValue_aei9x_431",v3="_overviewMuted_aei9x_436",y3="_overviewMarkdown_aei9x_442",b3="_envRow_aei9x_511",x3="_envDot_aei9x_517",_3="_envDotGreen_aei9x_524",S3="_envDotYellow_aei9x_528",T3="_envDotRed_aei9x_532",k3="_envDotGray_aei9x_536",C3="_depList_aei9x_540",E3="_depItem_aei9x_546",N3="_depBlocked_aei9x_553",A3="_depDone_aei9x_557",w3="_timeline_aei9x_561",j3="_timelineRow_aei9x_567",D3="_timelineKey_aei9x_574",M3="_timelineValue_aei9x_580",R3="_timelineDelta_aei9x_584",O3="_reviewNotes_aei9x_595",B3="_overviewDescription_aei9x_606",I3="_waitingMessage_aei9x_612",L3="_errorMessage_aei9x_616",U3="_eventOverflowWarning_aei9x_620",z3="_attemptSelector_aei9x_634",V3="_attemptLabel_aei9x_650",H3="_attemptButton_aei9x_654",G3="_attemptActive_aei9x_671",P3="_attemptStatus_aei9x_677",$3="_emptyCta_aei9x_683",F3="_ctaTitle_aei9x_695",q3="_ctaDescription_aei9x_701",Y3="_ctaButton_aei9x_708",K3="_ctaCreateForm_aei9x_743",Z3="_ctaCreateInput_aei9x_749",X3="_ctaCreateOk_aei9x_780",Q3="_ctaLink_aei9x_815",W3="_workspaceHeader_aei9x_829",J3="_workspaceName_aei9x_854",eO="_workspaceMeta_aei9x_867",tO="_metaRow_aei9x_875",nO="_metaLabel_aei9x_888",aO="_metaValue_aei9x_903",sO="_archiveButton_aei9x_913",iO="_repoLink_aei9x_943",oO="_metaToggle_aei9x_953",lO="_metaToggleArrow_aei9x_974",rO="_metaToggleArrowOpen_aei9x_979",cO="_progressBarContainer_aei9x_983",uO="_progressBar_aei9x_983",dO="_progressFill_aei9x_999",fO="_progressLabel_aei9x_1006",hO="_metaTimestamps_aei9x_1013",pO="_metaTimestamp_aei9x_1013",I={panelContainer:DR,emptyState:MR,fadeIn:RR,workspaceSummary:OR,workspaceSummaryTitle:BR,workspaceSummarySubtitle:IR,header:LR,headerInfo:UR,killButton:zR,headerTitle:VR,headerActions:HR,taskStatusBadge:GR,taskBranch:PR,taskBlockedBadge:$R,btnPrimary:FR,btnDanger:qR,btnGhost:YR,rejectInput:KR,tabBar:ZR,tab:XR,active:QR,eventScroll:WR,tabContent:JR,noContext:e3,overviewContent:t3,overviewDashboard:n3,overviewHero:a3,statusBadge:s3,statusPending:i3,statusAssigned:o3,statusInProgress:l3,statusReview:r3,statusDone:c3,statusFailed:u3,statusWaitingInput:d3,overviewBranchPill:f3,branchLink:h3,overviewSection:p3,overviewLabel:m3,overviewValue:g3,overviewMuted:v3,overviewMarkdown:y3,envRow:b3,envDot:x3,envDotGreen:_3,envDotYellow:S3,envDotRed:T3,envDotGray:k3,depList:C3,depItem:E3,depBlocked:N3,depDone:A3,timeline:w3,timelineRow:j3,timelineKey:D3,timelineValue:M3,timelineDelta:R3,reviewNotes:O3,overviewDescription:B3,waitingMessage:I3,errorMessage:L3,eventOverflowWarning:U3,attemptSelector:z3,attemptLabel:V3,attemptButton:H3,attemptActive:G3,attemptStatus:P3,emptyCta:$3,ctaTitle:F3,ctaDescription:q3,ctaButton:Y3,ctaCreateForm:K3,ctaCreateInput:Z3,ctaCreateOk:X3,ctaLink:Q3,workspaceHeader:W3,workspaceName:J3,workspaceMeta:eO,metaRow:tO,metaLabel:nO,metaValue:aO,archiveButton:sO,repoLink:iO,metaToggle:oO,metaToggleArrow:lO,metaToggleArrowOpen:rO,progressBarContainer:cO,progressBar:uO,progressFill:dO,progressLabel:fO,metaTimestamps:hO,metaTimestamp:pO};function mO(){return c.jsx("div",{className:I.emptyState,children:"Select a task or click + to create one"})}function gO(){return c.jsx("div",{className:I.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function vO(){const{workspaces:n,environments:a,createWorkspace:i,workspaceCreating:l}=We(),[r,u]=x.useState(!1),[f,p]=x.useState(""),m=a.length>0,g=()=>{!f.trim()||l||!m||i(f.trim(),void 0,void 0,a[0].id)};return n.length>0?c.jsx(jR,{}):c.jsxs("div",{className:I.emptyCta,"data-testid":"welcome-cta",children:[c.jsx("div",{className:I.ctaTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:I.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r?c.jsxs("div",{className:I.ctaCreateForm,children:[c.jsx("input",{type:"text",value:f,onChange:y=>p(y.target.value),onKeyDown:y=>{y.key==="Enter"?g():y.key==="Escape"&&(u(!1),p(""))},placeholder:"Workspace name...","aria-label":"Workspace name",autoFocus:!0,disabled:l,className:I.ctaCreateInput,"data-testid":"welcome-create-input"}),c.jsx("button",{onClick:g,className:I.ctaCreateOk,disabled:l,"aria-label":l?"Creating workspace":void 0,"data-testid":"welcome-create-ok",children:l?c.jsx(Ph,{size:"sm",label:"Creating workspace"}):"OK"})]}):c.jsx("button",{className:I.ctaButton,onClick:()=>u(!0),disabled:l||!m,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!m&&c.jsx("div",{className:I.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const v1=50;function yO(n,a,i,l,r=v1){return l?n<r:a-n-i<r}function bO(n,a){const i=a-n;return i>0?i:0}function xO({scrollRef:n,contentLength:a,isReversed:i}){const[l,r]=x.useState(!0),u=x.useRef(0),f=x.useRef(!1),p=x.useRef(0);x.useEffect(()=>{const g=n.current;if(!g)return;let y=!0;const v=()=>{p.current||(p.current=requestAnimationFrame(()=>{p.current=0;const b=yO(g.scrollTop,g.scrollHeight,g.clientHeight,i,v1);b!==y&&(y=b,r(b))}))};return g.addEventListener("scroll",v,{passive:!0}),()=>{g.removeEventListener("scroll",v),p.current&&(cancelAnimationFrame(p.current),p.current=0)}},[n,i]),x.useLayoutEffect(()=>{const g=n.current;!g||f.current||(f.current=!0,i?g.scrollTop=0:g.scrollTop=g.scrollHeight,r(!0))},[n,i]),x.useLayoutEffect(()=>{const g=n.current;if(g){if(i&&!l){const y=bO(u.current,g.scrollHeight);y>0&&(g.scrollTop+=y)}l&&(i?g.scrollTo({top:0,behavior:"smooth"}):g.scrollTo({top:g.scrollHeight,behavior:"smooth"})),u.current=g.scrollHeight}},[a,l,i,n]);const m=x.useCallback(()=>{const g=n.current;if(!g)return;const y=i?0:g.scrollHeight;g.scrollTo({top:y,behavior:"smooth"}),r(!0)},[n,i]);return{isAtAnchor:l,scrollToAnchor:m}}const _O="_wrapper_p24zt_1",SO="_scrollContainer_p24zt_9",TO="_toolbar_p24zt_15",kO="_directionToggle_p24zt_22",CO="_scrollToAnchor_p24zt_60",EO="_scrollToAnchorBottom_p24zt_84",NO="_scrollToAnchorTop_p24zt_88",Es={wrapper:_O,scrollContainer:SO,toolbar:TO,directionToggle:kO,scrollToAnchor:CO,scrollToAnchorBottom:EO,scrollToAnchorTop:NO},y1="grackle-stream-direction";function AO(){try{return localStorage.getItem(y1)==="reversed"}catch{return!1}}function wO({eventsDropped:n}){return n<=0?c.jsx(c.Fragment,{}):c.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 $h({events:n,eventsDropped:a,emptyState:i}){const l=x.useRef(null),[r,u]=x.useState(AO),f=pj(),p=x.useMemo(()=>r?[...n].reverse():n,[n,r]),{isAtAnchor:m,scrollToAnchor:g}=xO({scrollRef:l,contentLength:n.length,isReversed:r}),y=()=>{const S=!r;u(S);try{localStorage.setItem(y1,S?"reversed":"default")}catch{}},v=f?0:.2,b=r?-8:8;return c.jsxs("div",{className:Es.wrapper,children:[c.jsx("div",{className:Es.toolbar,children:c.jsx("button",{className:Es.directionToggle,onClick:y,title:r?"Showing newest first":"Showing oldest first","aria-label":r?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:r?"↓":"↑"})}),c.jsxs("div",{ref:l,className:Es.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,c.jsx(wO,{eventsDropped:a}),c.jsx(Zn,{initial:!1,children:p.map((S,k)=>{const C=r?n.length-1-k:k;return c.jsx(kt.div,{initial:{opacity:0,y:b},animate:{opacity:1,y:0},transition:{duration:v,ease:"easeOut"},children:c.jsx(NM,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${C}`)})})]}),c.jsx(Zn,{children:!m&&c.jsxs(kt.button,{className:`${Es.scrollToAnchor} ${r?Es.scrollToAnchorTop:Es.scrollToAnchorBottom}`,onClick:g,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.15},"aria-label":"Scroll to latest","data-testid":"scroll-to-anchor",children:[r?"↑":"↓"," New events"]})})]})}const jO="_bar_1xhb4_1",DO="_input_1xhb4_32",MO="_select_1xhb4_67",RO="_btnPrimary_1xhb4_103",OO="_btnDanger_1xhb4_134",BO="_btnGhost_1xhb4_173",IO="_badge_1xhb4_195",LO="_disconnectHint_1xhb4_205",Jt={bar:jO,input:DO,select:MO,btnPrimary:RO,btnDanger:OO,btnGhost:BO,badge:IO,disconnectHint:LO};function UO(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 zO({environmentId:n,onReconnect:a}){return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:Jt.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),c.jsx("button",{type:"button",onClick:()=>a(n),className:Jt.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function gl({mode:n,sessionId:a,environmentId:i,taskId:l,showStop:r,showPersonaSelect:u,onSessionKill:f}){const{sendInput:p,spawn:m,startTask:g,personas:y,environments:v,provisionEnvironment:b}=We(),{showToast:S}=$i(),[k,C]=x.useState(""),[N,E]=x.useState(""),A=UO(i,v),D=M=>{if(M.preventDefault(),!!k.trim())if(n==="send"){if(!a||A)return;p(a,k),C("")}else if(n==="spawn"){if(!i)return;m(i,k,N),S("Session started","success"),C(""),E("")}else{if(!l)return;g(l,void 0,i,k),C("")}};return n==="spawn"?c.jsxs("form",{onSubmit:D,className:Jt.bar,children:[c.jsx("span",{className:Jt.badge,children:"new chat"}),c.jsx("input",{type:"text",value:k,onChange:M=>C(M.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:Jt.input}),u&&c.jsxs("select",{value:N,onChange:M=>E(M.target.value),className:Jt.select,children:[c.jsx("option",{value:"",children:"(Default)"}),y.map(M=>c.jsx("option",{value:M.id,children:M.name},M.id))]}),c.jsx("button",{type:"submit",disabled:!k.trim()||!i,className:Jt.btnPrimary,children:"Go"})]}):n==="start"?c.jsxs("form",{onSubmit:D,className:Jt.bar,children:[c.jsx("input",{type:"text",value:k,onChange:M=>C(M.target.value),placeholder:"Type a message...",autoFocus:!0,className:Jt.input}),c.jsx("button",{type:"submit",disabled:!k.trim(),className:Jt.btnPrimary,children:"Send"})]}):c.jsxs("form",{onSubmit:D,className:Jt.bar,children:[A&&i&&c.jsx(zO,{environmentId:i,onReconnect:b}),c.jsx("input",{type:"text",value:k,onChange:M=>C(M.target.value),placeholder:"Type a message...",autoFocus:!A,disabled:A,className:Jt.input}),c.jsx("span",{title:A?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!k.trim()||A,className:Jt.btnPrimary,children:"Send"})}),r&&f&&c.jsx("button",{type:"button",onClick:f,className:Jt.btnDanger,title:"Stop session",children:"Stop"})]})}function Fh(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 qh(n){const a=new Map;for(const u of n)if(u.raw)try{a.set(u,JSON.parse(u.raw))}catch{}const i=new Map;for(const u of n){if(u.eventType!=="tool_use")continue;const f=a.get(u);if(!(!f||typeof f.id!="string"))try{const p=JSON.parse(u.content);i.set(f.id,{tool:p.tool,args:p.args})}catch{}}const l=new Set;return n.map(u=>{if(u.eventType!=="tool_result")return u;const f=a.get(u);if(!f||typeof f.tool_use_id!="string")return u;const p=i.get(f.tool_use_id);return p?(l.add(f.tool_use_id),{...u,toolUseCtx:p}):u}).filter(u=>{if(u.eventType!=="tool_use")return!0;const f=a.get(u);return f&&typeof f.id=="string"?!l.has(f.id):!0})}const VO="_panelContainer_pz4cr_1",HO="_emptyState_pz4cr_8",GO="_emptyTitle_pz4cr_20",PO="_emptyDescription_pz4cr_26",$O="_emptyHint_pz4cr_32",Jo={panelContainer:VO,emptyState:HO,emptyTitle:GO,emptyDescription:PO,emptyHint:$O};function FO({hasLocalEnvironment:n}){return c.jsxs("div",{className:Jo.emptyState,"data-testid":"chat-empty-state",children:[c.jsx("div",{className:Jo.emptyTitle,children:"Welcome to Grackle"}),c.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&&c.jsx("div",{className:Jo.emptyHint,children:"Go to Settings → Environments to add one."})]})}function qO(){const{tasks:n,sessions:a,events:i,eventsDropped:l,environments:r,loadTaskSessions:u,loadSessionEvents:f,kill:p,taskSessions:m}=We(),g=x.useRef(void 0),y=n.find(C=>C.id===qo),v=y!=null&&y.latestSessionId?a.find(C=>C.id===y.latestSessionId)??(m[qo]??[]).find(C=>C.id===y.latestSessionId):void 0;x.useEffect(()=>{u(qo)},[u]),x.useEffect(()=>{y!=null&&y.latestSessionId&&u(qo)},[y==null?void 0:y.latestSessionId,u]),x.useEffect(()=>{v&&v.id!==g.current&&(g.current=v.id,f(v.id))},[v==null?void 0:v.id,f]);const b=x.useMemo(()=>{if(!v)return[];const C=i.filter(N=>N.sessionId===v.id);return qh(Fh(C))},[i,v==null?void 0:v.id]),S=r.find(C=>C.adapterType==="local"&&C.status==="connected"),k=v!==void 0&&!["completed","failed","interrupted","hibernating","suspended"].includes(v.status);return c.jsxs("div",{className:Jo.panelContainer,"data-testid":"chat-page",children:[c.jsx($h,{events:b,eventsDropped:l,emptyState:c.jsx(FO,{hasLocalEnvironment:!!S})}),S&&k&&c.jsx(gl,{mode:"send",sessionId:v.id,environmentId:v.environmentId,showStop:!0,onSessionKill:()=>p(v.id)}),S&&!k&&c.jsx(gl,{mode:"start",taskId:qo,environmentId:S.id})]})}function YO(n,a){const i=[];let l=n;const r=new Set;for(;l&&a.has(l)&&!r.has(l);){r.add(l);const u=a.get(l);i.unshift(u),l=u.parentTaskId||void 0}return i}const Ms={label:"Home",url:_c};function KO(n){return n?[Ms,{label:"Settings",url:el},{label:n,url:void 0}]:[Ms,{label:"Settings",url:void 0}]}const b1={label:"Environments",url:Ii};function ZO(){return[Ms,{label:"Environments",url:void 0}]}function XO(){return[Ms,{label:"New Chat",url:void 0}]}function QO(n){return[Ms,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function WO(n,a,i,l){const r=i.find(f=>f.id===n),u=l.find(f=>f.id===a);return[Ms,b1,{label:(u==null?void 0:u.displayName)??"Environment",url:ul(a)},{label:(r==null?void 0:r.name)??"Workspace",url:void 0}]}function JO(n,a,i,l,r){const u=YO(n,r),f=r.get(n),p=f==null?void 0:f.workspaceId,m=p?i.find(S=>S.id===p):void 0,g=a??(m==null?void 0:m.environmentId),y=g?l.find(S=>S.id===g):void 0,v=[Ms];y&&g&&(v.push(b1),v.push({label:y.displayName,url:ul(g)})),m&&g&&v.push({label:m.name,url:Bi(m.id,g)});for(let S=0;S<u.length-1;S++)v.push({label:u[S].title,url:ba(u[S].id,void 0,p,g)});const b=u[u.length-1];return v.push({label:(b==null?void 0:b.title)??n,url:void 0}),v}function e6(){const n=XO(),[a]=hb(),i=a.get("env")??"";return c.jsxs("div",{className:I.panelContainer,children:[c.jsx(Ki,{segments:n}),c.jsx("div",{className:I.emptyState,children:"Enter a prompt below to start a new session"}),c.jsx(gl,{mode:"spawn",environmentId:i,showPersonaSelect:!0})]})}function t6({sessionId:n,session:a,isActive:i,onKill:l}){return c.jsxs("div",{className:I.header,children:[c.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.status}`,a!=null&&a.inputTokens||a!=null&&a.outputTokens||a!=null&&a.costUsd?` | ${m1((a.inputTokens??0)+(a.outputTokens??0))} tokens · ${Vi(a.costUsd??0)}`:""]}),c.jsxs("span",{className:I.headerInfo,children:[a&&c.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&c.jsx("button",{onClick:()=>l(n),title:"Stop session",className:I.killButton,children:"×"})]})]})}function n6({session:n}){const a=n&&["completed","failed","interrupted","suspended"].includes(n.status),i=a?`Session ${n.status} with no events recorded.`:"Waiting for events...";return c.jsx("div",{className:a?I.errorMessage:I.waitingMessage,children:i})}function a6(){const{sessionId:n}=ns(),{events:a,eventsDropped:i,sessions:l,kill:r,loadSessionEvents:u}=We(),f=x.useRef(void 0),p=QO(n),m=l.find(v=>v.id===n)??void 0,g=x.useMemo(()=>{const v=n?a.filter(b=>b.sessionId===n):[];return qh(Fh(v))},[a,n]);if(x.useEffect(()=>{n&&n!==f.current&&(f.current=n,u(n))},[n,u]),!n)return c.jsx("div",{className:I.emptyState,children:"No session selected"});const y=(m==null?void 0:m.status)==="running"||(m==null?void 0:m.status)==="idle";return c.jsxs("div",{className:I.panelContainer,children:[c.jsx(Ki,{segments:p}),c.jsx(t6,{sessionId:n,session:m,isActive:y,onKill:r}),c.jsx($h,{events:g,eventsDropped:i,emptyState:c.jsx(n6,{session:m})}),y&&c.jsx(gl,{mode:"send",sessionId:n,environmentId:m.environmentId,showStop:!0,onSessionKill:()=>r(n)})]})}const H0=220,G0=70,s6=40,i6=60,o6="hierarchy",l6="dependency";function r6(n){return x.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new $v.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:s6,ranksep:i6});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 p=l.get(f.parentTaskId)||[];p.push(f),l.set(f.parentTaskId,p)}for(const f of n)a.setNode(f.id,{width:H0,height:G0});const r=[];for(const f of n){if(f.parentTaskId&&i.has(f.parentTaskId)){const p=`hierarchy-${f.parentTaskId}-${f.id}`;a.setEdge(f.parentTaskId,f.id,{},p),r.push({id:p,source:f.parentTaskId,target:f.id,type:"smoothstep",data:{edgeType:o6},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of f.dependsOn)if(i.has(p)){const m=`dependency-${p}-${f.id}`;a.setEdge(p,f.id,{},m),r.push({id:m,source:p,target:f.id,type:"smoothstep",data:{edgeType:l6},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return $v.layout(a),{nodes:n.map(f=>{const p=a.node(f.id),m=l.get(f.id)||[];return{id:f.id,type:"task",position:{x:p.x-H0/2,y:p.y-G0/2},data:{task:f,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:f.dependsOn.length>0}}}),edges:r}},[n])}const c6="_dagContainer_js4w6_1",u6="_taskNode_js4w6_26",d6="_taskNodeBorder_js4w6_54",f6="_taskNodeContent_js4w6_60",h6="_taskNodeHeader_js4w6_70",p6="_taskNodeIcon_js4w6_77",m6="_taskNodeTitle_js4w6_82",g6="_taskNodeBadges_js4w6_90",v6="_childBadge_js4w6_95",y6="_depBadge_js4w6_107",b6="_handle_js4w6_119",x6="_emptyCta_js4w6_126",_6="_ctaDescription_js4w6_137",S6="_ctaButton_js4w6_144",$t={dagContainer:c6,taskNode:u6,taskNodeBorder:d6,taskNodeContent:f6,taskNodeHeader:h6,taskNodeIcon:p6,taskNodeTitle:m6,taskNodeBadges:g6,childBadge:v6,depBadge:y6,handle:b6,emptyCta:x6,ctaDescription:_6,ctaButton:S6};function T6({data:n}){const{task:a,childCount:i,doneChildCount:l,hasDependencies:r}=n,u=ts(a.status);return c.jsxs("div",{className:$t.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[c.jsx(Fv,{type:"target",position:qv.Top,className:$t.handle}),c.jsx("div",{className:$t.taskNodeBorder,style:{backgroundColor:u.color}}),c.jsxs("div",{className:$t.taskNodeContent,children:[c.jsxs("div",{className:$t.taskNodeHeader,children:[c.jsx("span",{className:$t.taskNodeIcon,style:{color:u.color},children:u.icon}),c.jsx("span",{className:$t.taskNodeTitle,children:a.title})]}),c.jsxs("div",{className:$t.taskNodeBadges,children:[i>0&&c.jsxs("span",{className:$t.childBadge,children:[l,"/",i]}),r&&c.jsx("span",{className:$t.depBadge,children:"dep"})]})]}),c.jsx(Fv,{type:"source",position:qv.Bottom,className:$t.handle})]})}const k6=o2,C6={task:T6};function E6({workspaceId:n,environmentId:a}){const{tasks:i}=We(),l=Ht(),{resolvedThemeId:r}=Sb(),u=x.useMemo(()=>i.filter(v=>v.workspaceId===n),[i,n]),{nodes:f,edges:p}=r6(u),m=x.useMemo(()=>{const v=getComputedStyle(document.documentElement),b={};for(const[S,k]of Object.entries(k6))b[S]=v.getPropertyValue(k).trim()||"#6b7a8d";return b},[r]),g=x.useCallback((v,b)=>{l(ba(b.id,void 0,n,a))},[l,n,a]),y=x.useCallback(v=>{const b=v.data;return m[b.task.status]||m.pending},[m]);return u.length===0?c.jsxs("div",{className:$t.emptyCta,children:[c.jsx("button",{className:$t.ctaButton,onClick:()=>l(Pi(n,void 0,a)),children:"Create Task"}),c.jsx("div",{className:$t.ctaDescription,children:"Create tasks to see the dependency graph"})]}):c.jsx("div",{className:$t.dagContainer,children:c.jsxs(GS,{nodes:f,edges:p,nodeTypes:C6,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[c.jsx(PS,{variant:$S.Dots,gap:24,size:1,color:"var(--text-disabled)"}),c.jsx(FS,{showInteractive:!1}),c.jsx(qS,{nodeColor:y,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function N6({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const l=new Map;for(const u of n)if(u.parentTaskId){const f=l.get(u.parentTaskId);f?f.push(u):l.set(u.parentTaskId,[u])}const r=new Map(R0.map(u=>[u,[]]));for(const u of n){const f=Gh(u.status),p=u.dependsOn.length>0&&u.dependsOn.some(k=>a.get(k)!=="complete"),m=l.get(u.id)??[],g=m.length,y=m.filter(k=>k.status==="complete").length;let v;if(f==="paused"&&i){const k=i.get(u.id);k==="idle"?v="Needs input":k==="completed"&&(v="Ready to complete")}const b={task:u,isBlocked:p,childCount:g,doneChildCount:y,pausedSubBadge:v},S=r.get(f);S?S.push(b):r.get("not_started").push(b)}for(const u of r.values())u.sort((f,p)=>f.task.sortOrder-p.task.sortOrder);return R0.map(u=>{const f=ts(u);return{status:u,label:f.label,style:f,tasks:r.get(u)??[]}})}const A6="_boardContainer_1c4y1_1",w6="_column_1c4y1_17",j6="_columnHeader_1c4y1_34",D6="_columnIcon_1c4y1_47",M6="_columnLabel_1c4y1_52",R6="_columnCount_1c4y1_57",O6="_cardList_1c4y1_67",B6="_emptyPlaceholder_1c4y1_76",I6="_card_1c4y1_67",L6="_cardHeader_1c4y1_107",U6="_cardStatusIcon_1c4y1_113",z6="_cardTitle_1c4y1_119",V6="_cardBadges_1c4y1_127",H6="_badge_1c4y1_134",G6="_blockedBadge_1c4y1_146",P6="_childBadge_1c4y1_151",$6="_depBadge_1c4y1_155",F6="_parentBadge_1c4y1_159",q6="_pausedSubBadge_1c4y1_166",Y6="_personaBadge_1c4y1_170",K6="_envBadge_1c4y1_174",Z6="_emptyCta_1c4y1_178",X6="_ctaButton_1c4y1_188",Q6="_ctaDescription_1c4y1_204",Ge={boardContainer:A6,column:w6,columnHeader:j6,columnIcon:D6,columnLabel:M6,columnCount:R6,cardList:O6,emptyPlaceholder:B6,card:I6,cardHeader:L6,cardStatusIcon:U6,cardTitle:z6,cardBadges:V6,badge:H6,blockedBadge:G6,childBadge:P6,depBadge:$6,parentBadge:F6,pausedSubBadge:q6,personaBadge:Y6,envBadge:K6,emptyCta:Z6,ctaButton:X6,ctaDescription:Q6};function W6({workspaceId:n,environmentId:a}){const{tasks:i,sessions:l,personas:r,environments:u}=We(),f=Ht(),p=x.useMemo(()=>i.filter(b=>b.workspaceId===n),[i,n]),m=x.useMemo(()=>new Map(i.map(b=>[b.id,b.status])),[i]),g=x.useMemo(()=>new Map(p.map(b=>[b.id,b])),[p]),y=x.useMemo(()=>{const b=new Map(l.map(A=>[A.id,A])),S=new Map(r.map(A=>[A.id,A])),k=new Map(u.map(A=>[A.id,A])),C=new Map,N=new Map,E=new Map;for(const A of p)if(A.latestSessionId){const D=b.get(A.latestSessionId);if(D){if(C.set(A.id,D.status),D.personaId){const M=S.get(D.personaId);M&&N.set(A.id,M.name)}if(D.environmentId){const M=k.get(D.environmentId);M&&E.set(A.id,M.displayName)}}}return{sessionStatusByTaskId:C,personaNameByTaskId:N,environmentNameByTaskId:E}},[p,l,r,u]),v=x.useMemo(()=>N6({tasks:p,taskStatusById:m,sessionStatusByTaskId:y.sessionStatusByTaskId}),[p,m,y]);return p.length===0?c.jsxs("div",{className:Ge.emptyCta,"data-testid":"board-empty-cta",children:[c.jsx("button",{className:Ge.ctaButton,onClick:()=>f(Pi(n,void 0,a)),children:"Create Task"}),c.jsx("div",{className:Ge.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):c.jsx("div",{className:Ge.boardContainer,"data-testid":"board-container",children:v.map(b=>c.jsxs("section",{className:Ge.column,"data-testid":`board-column-${b.status}`,"aria-label":`${b.label}, ${b.tasks.length} ${b.tasks.length===1?"task":"tasks"}`,children:[c.jsxs("div",{className:Ge.columnHeader,children:[c.jsx("span",{className:Ge.columnIcon,style:{color:b.style.color},children:b.style.icon}),c.jsx("span",{className:Ge.columnLabel,children:b.label}),c.jsx("span",{className:Ge.columnCount,"data-testid":`board-count-${b.status}`,children:b.tasks.length})]}),c.jsx("div",{className:Ge.cardList,children:b.tasks.length===0?c.jsx("div",{className:Ge.emptyPlaceholder,children:"No tasks"}):c.jsx(Zn,{mode:"popLayout",children:b.tasks.map(S=>c.jsx(kt.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:c.jsx(J6,{boardTask:S,tasksById:g,personaName:y.personaNameByTaskId.get(S.task.id),envName:y.environmentNameByTaskId.get(S.task.id),onClick:()=>f(ba(S.task.id,void 0,n,a))})},S.task.id))})})]},b.status))})}function J6({boardTask:n,tasksById:a,personaName:i,envName:l,onClick:r}){const{task:u,isBlocked:f,childCount:p,doneChildCount:m,pausedSubBadge:g}=n,y=ts(u.status),v=u.parentTaskId?a.get(u.parentTaskId):void 0;return c.jsxs("div",{className:Ge.card,tabIndex:0,role:"button","data-testid":`board-card-${u.id}`,onClick:r,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),r())},children:[c.jsxs("div",{className:Ge.cardHeader,children:[c.jsx("span",{className:Ge.cardStatusIcon,style:{color:y.color},children:y.icon}),c.jsx("span",{className:Ge.cardTitle,children:u.title})]}),c.jsxs("div",{className:Ge.cardBadges,children:[v&&c.jsx("span",{className:`${Ge.badge} ${Ge.parentBadge}`,title:v.title,children:v.title}),p>0&&c.jsxs("span",{className:`${Ge.badge} ${Ge.childBadge}`,children:[m,"/",p]}),f&&c.jsx("span",{className:`${Ge.badge} ${Ge.blockedBadge}`,children:"blocked"}),u.dependsOn.length>0&&!f&&c.jsx("span",{className:`${Ge.badge} ${Ge.depBadge}`,children:"dep"}),g&&c.jsx("span",{className:`${Ge.badge} ${Ge.pausedSubBadge}`,children:g}),i&&c.jsx("span",{className:`${Ge.badge} ${Ge.personaBadge}`,children:i}),l&&c.jsx("span",{className:`${Ge.badge} ${Ge.envBadge}`,children:l})]})]})}function Yh(n){const{value:a,onSave:i,validate:l,fieldId:r,activeFieldId:u,onActivate:f,enterToSave:p=!0,trimOnSave:m=!0}=n,[g,y]=x.useState(""),[v,b]=x.useState(""),S=x.useRef(!1),k=u===r,C=x.useCallback(q=>{y(q),b("")},[]),N=x.useCallback(()=>{b("")},[]),E=x.useCallback(()=>{S.current=!1,f==null||f(null),y(""),b("")},[f]),A=x.useCallback(()=>{const q=m?g.trim():g;if(l){const W=l(g);if(W){b(W);return}}const U=m?a.trim():a;if(q===U){E();return}i(q),E()},[g,a,m,l,i,E]),D=x.useCallback(()=>{S.current=!0,f==null||f(r),y(a),b("")},[r,a,f]),M=x.useCallback(q=>{if(S.current){S.current=!1;return}q.relatedTarget instanceof HTMLElement&&q.relatedTarget.dataset.editAction===r||A()},[r,A]),j=x.useCallback(q=>{q.key==="Escape"?E():q.key==="Enter"&&p&&A()},[E,p,A]),K=(()=>{if(!k)return!1;const q=m?a.trim():a;return(m?g.trim():g)!==q})();return x.useEffect(()=>{!k&&(g!==""||v!=="")&&(y(""),b(""))},[k,g,v]),{isEditing:k,draft:g,error:v,isDirty:K,startEdit:D,cancelEdit:E,save:A,setDraft:C,clearError:N,handleBlur:M,handleKeyDown:j,ignoreInitialBlurRef:S}}const eB="_editFieldWrapper_yuzty_1",tB="_editInput_yuzty_10",nB="_editTextarea_yuzty_42",aB="_editSelect_yuzty_78",sB="_editError_yuzty_111",iB="_editInputInvalid_yuzty_118",oB="_editHint_yuzty_123",lB="_unsavedDot_yuzty_132",rB="_metaValueClickable_yuzty_140",cB="_editButton_yuzty_159",uB="_metaPlaceholder_yuzty_175",dB="_worktreeToggle_yuzty_180",ze={editFieldWrapper:eB,editInput:tB,editTextarea:nB,editSelect:aB,editError:sB,editInputInvalid:iB,editHint:oB,unsavedDot:lB,metaValueClickable:rB,editButton:cB,metaPlaceholder:uB,worktreeToggle:dB};function cn(n){const{value:a,onSave:i,validate:l,mode:r="edit",fieldId:u="text",activeFieldId:f,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,maxLength:v,ariaLabel:b,"data-testid":S}=n,k=x.useRef(null),C=Yh({value:a,onSave:i,validate:l,fieldId:u,activeFieldId:f,onActivate:p,enterToSave:!0,trimOnSave:!0});if(x.useEffect(()=>{if(C.isEditing){const E=window.setTimeout(()=>{var A;(A=k.current)==null||A.focus()},0);return()=>window.clearTimeout(E)}},[C.isEditing]),r==="create"){const E=D=>{m==null||m(D.target.value)},A=l==null?void 0:l(a);return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("input",{className:`${ze.editInput} ${A?ze.editInputInvalid:""}`,value:a,onChange:E,maxLength:v,placeholder:y,"aria-label":b,"data-testid":S?`${S}-input`:void 0}),A&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:A})]})}if(C.isEditing)return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("input",{ref:k,className:`${ze.editInput} ${C.error?ze.editInputInvalid:""}`,value:C.draft,onChange:E=>C.setDraft(E.target.value),onBlur:C.handleBlur,onKeyDown:C.handleKeyDown,maxLength:v,placeholder:y,"aria-label":b,"data-testid":S?`${S}-input`:void 0}),C.isDirty&&c.jsx("span",{className:ze.unsavedDot,title:"Unsaved changes"}),C.error&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:C.error}),c.jsx("span",{className:ze.editHint,children:"Enter to save · Esc to cancel"})]});const N=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:ze.metaValueClickable,onClick:()=>C.startEdit(),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),C.startEdit())},title:"Click to edit","aria-label":b,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:a?c.jsx("span",{children:a}):c.jsx("span",{className:ze.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:ze.editButton,"aria-hidden":"true",children:"✏️"})]})}function fB(n){const{value:a,onSave:i,validate:l,mode:r="edit",fieldId:u="textarea",activeFieldId:f,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":b}=n,S=x.useRef(null),k=Yh({value:a,onSave:i,validate:l,fieldId:u,activeFieldId:f,onActivate:p,enterToSave:!1,trimOnSave:!1});if(x.useEffect(()=>{if(k.isEditing){const N=window.setTimeout(()=>{var E;(E=S.current)==null||E.focus()},0);return()=>window.clearTimeout(N)}},[k.isEditing]),r==="create"){const N=A=>{m==null||m(A.target.value)},E=l==null?void 0:l(a);return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("textarea",{className:`${ze.editTextarea} ${E?ze.editInputInvalid:""}`,value:a,onChange:N,placeholder:y,"aria-label":v,"data-testid":b?`${b}-input`:void 0}),E&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:E})]})}if(k.isEditing)return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("textarea",{ref:S,className:`${ze.editTextarea} ${k.error?ze.editInputInvalid:""}`,value:k.draft,onChange:N=>k.setDraft(N.target.value),onBlur:k.handleBlur,onKeyDown:k.handleKeyDown,title:v,"aria-label":v,"data-testid":b?`${b}-input`:void 0}),k.isDirty&&c.jsx("span",{className:ze.unsavedDot,title:"Unsaved changes"}),k.error&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:k.error}),c.jsx("span",{className:ze.editHint,children:"Tab to save · Esc to cancel"})]});const C=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:ze.metaValueClickable,onClick:()=>k.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),k.startEdit())},title:"Click to edit","aria-label":v,"data-testid":b?`${b}-button`:void 0,children:[C!==void 0?C:a?c.jsx("span",{children:a}):c.jsx("span",{className:ze.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:ze.editButton,"aria-hidden":"true",children:"✏️"})]})}function x1(n){var D;const{value:a,onSave:i,mode:l="edit",options:r,fieldId:u="select",activeFieldId:f,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":b}=n,S=x.useRef(null),k=Yh({value:a,onSave:i,fieldId:u,activeFieldId:f,onActivate:p,enterToSave:!1,trimOnSave:!1});x.useEffect(()=>{if(k.isEditing){const M=window.setTimeout(()=>{var j;(j=S.current)==null||j.focus()},0);return()=>window.clearTimeout(M)}},[k.isEditing]);const C=x.useCallback(M=>{const j=M.target.value;k.ignoreInitialBlurRef.current=!1,j!==a&&i(j),k.cancelEdit()},[a,i,k]),N=x.useCallback(M=>{if(k.ignoreInitialBlurRef.current){k.ignoreInitialBlurRef.current=!1;return}M.relatedTarget instanceof HTMLElement&&M.relatedTarget.dataset.editAction===u||k.cancelEdit()},[u,k]);if(l==="create")return c.jsx("select",{className:ze.editSelect,value:a,onChange:M=>m==null?void 0:m(M.target.value),"aria-label":v,"data-testid":b?`${b}-select`:void 0,children:r.map(M=>c.jsx("option",{value:M.value,children:M.label},M.value))});if(k.isEditing)return c.jsx("select",{ref:S,className:ze.editSelect,value:k.draft,onChange:C,onBlur:N,title:v,"aria-label":v,"data-testid":b?`${b}-select`:void 0,children:r.map(M=>c.jsx("option",{value:M.value,children:M.label},M.value))});const E=g==null?void 0:g(a),A=(D=r.find(M=>M.value===a))==null?void 0:D.label;return c.jsxs("button",{type:"button",className:ze.metaValueClickable,onClick:()=>k.startEdit(),title:"Click to change","aria-label":v,"data-testid":b?`${b}-button`:void 0,children:[E!==void 0?E:A?c.jsx("span",{children:A}):c.jsx("span",{className:ze.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:ze.editButton,"aria-hidden":"true",children:"✏️"})]})}function hB(n){const{checked:a,onChange:i,label:l,ariaLabel:r,"data-testid":u}=n;return c.jsxs("label",{className:ze.worktreeToggle,"data-testid":u,children:[c.jsx("input",{type:"checkbox",checked:a,onChange:f=>i(f.target.checked),"aria-label":r}),c.jsx("span",{children:l})]})}const pB="_envRow_1e1r5_1",mB="_envDot_1e1r5_7",gB="_envDotGreen_1e1r5_14",vB="_envDotYellow_1e1r5_18",yB="_envDotRed_1e1r5_22",bB="_envDotGray_1e1r5_26",Oi={envRow:pB,envDot:mB,envDotGreen:gB,envDotYellow:vB,envDotRed:yB,envDotGray:bB};function xB(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Oi.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Oi.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Oi.envDotRed:Oi.envDotGray}function _B(n){const{value:a,onSave:i,environments:l,allowNone:r=!1,fieldId:u="environment",activeFieldId:f,onActivate:p,placeholder:m="No environment",ariaLabel:g="Environment","data-testid":y}=n,v=l.find(k=>k.id===a),b=[...r?[{value:"",label:"None"}]:[],...l.map(k=>({value:k.id,label:k.displayName}))],S=()=>{if(v)return c.jsxs("span",{className:Oi.envRow,children:[c.jsx("span",{className:`${Oi.envDot} ${xB(v.status)}`}),v.displayName]})};return c.jsx(x1,{value:a,onSave:i,options:b,fieldId:u,activeFieldId:f,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:g,"data-testid":y})}function P0(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 r=Math.floor(l/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const u=Math.floor(r/60);if(u<24)return`${u}h ago`;const f=Math.floor(u/24);return f<30?`${f}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const hf=100;function SB(){const{workspaceId:n,environmentId:a}=ns(),i=Ht(),{tasks:l,environments:r,workspaces:u,personas:f,sessions:p,archiveWorkspace:m,updateWorkspace:g,usageCache:y,loadUsage:v}=We(),[b,S]=x.useState("tasks"),[k,C]=x.useState(!1),[N,E]=x.useState(null),[A,D]=x.useState(!1),M=x.useRef(void 0),j=u.find(F=>F.id===n),K=a??(j==null?void 0:j.environmentId)??"",q=WO(n,K,u,r);x.useEffect(()=>{const F=M.current;M.current=n,!(F===void 0||F===n)&&N!==null&&E(null)},[n,N]);const U=p.reduce((F,te)=>F+(te.costUsd??0),0);x.useEffect(()=>{n&&v("workspace",n)},[n,v,U]);const W=n?y[`workspace:${n}`]:void 0,ee=l.filter(F=>F.workspaceId===n),ie=ee.filter(F=>F.status==="complete").length,$=ee.length,le=$>0?Math.round(ie/$*100):0;return c.jsxs("div",{className:I.panelContainer,children:[c.jsx(Ki,{segments:q}),c.jsxs("div",{className:I.workspaceHeader,children:[c.jsx("span",{className:I.workspaceName,"data-testid":"workspace-name",children:c.jsx(cn,{value:(j==null?void 0:j.name)||"",onSave:F=>{j&&g(j.id,{name:F})},validate:F=>{const te=F.trim();if(!te)return"Name is required";if(te.length>hf)return`Max ${hf} characters`},maxLength:hf,fieldId:"name",activeFieldId:N,onActivate:E,ariaLabel:"Workspace name",renderDisplay:F=>F||n||void 0,"data-testid":"edit-name"})}),c.jsx("button",{className:I.archiveButton,onClick:()=>C(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),c.jsxs("button",{className:I.metaToggle,onClick:()=>D(!A),"aria-expanded":!A,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[c.jsx("span",{className:`${I.metaToggleArrow} ${A?"":I.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!A&&c.jsxs("div",{className:I.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[c.jsxs("div",{className:I.metaRow,children:[c.jsx("span",{className:I.metaLabel,children:"Description"}),c.jsx("div",{className:I.metaValue,children:c.jsx(fB,{value:(j==null?void 0:j.description)||"",onSave:F=>{j&&g(j.id,{description:F})},fieldId:"description",activeFieldId:N,onActivate:E,renderDisplay:F=>F?c.jsx("span",{className:I.overviewMarkdown,children:c.jsx(Zf,{remarkPlugins:[Xf],children:F})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),c.jsxs("div",{className:I.metaRow,children:[c.jsx("span",{className:I.metaLabel,children:"Repository"}),c.jsx("div",{className:I.metaValue,children:c.jsx(cn,{value:(j==null?void 0:j.repoUrl)||"",onSave:F=>{j&&g(j.id,{repoUrl:F})},validate:F=>{const te=F.trim();if(te&&!/^https?:\/\/.+/.test(te))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:N,onActivate:E,renderDisplay:F=>F&&/^https?:\/\//i.test(F)?c.jsx("a",{className:I.repoLink,href:F,target:"_blank",rel:"noopener noreferrer",onClick:te=>te.stopPropagation(),children:F}):F?c.jsx("span",{children:F}):void 0,placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),c.jsxs("div",{className:I.metaRow,children:[c.jsx("span",{className:I.metaLabel,children:"Environment"}),c.jsx("div",{className:I.metaValue,children:c.jsx(_B,{value:(j==null?void 0:j.environmentId)||"",onSave:F=>{j&&F&&g(j.id,{environmentId:F})},environments:r,fieldId:"environmentId",activeFieldId:N,onActivate:E,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),c.jsxs("div",{className:I.metaRow,children:[c.jsx("span",{className:I.metaLabel,children:"Persona"}),c.jsx("div",{className:I.metaValue,children:c.jsx(x1,{value:(j==null?void 0:j.defaultPersonaId)||"",onSave:F=>{j&&g(j.id,{defaultPersonaId:F})},options:[{value:"",label:"(Inherit)"},...f.map(F=>({value:F.id,label:F.name}))],fieldId:"defaultPersonaId",activeFieldId:N,onActivate:E,renderDisplay:F=>{const te=f.find(B=>B.id===F);if(te)return c.jsx("span",{children:te.name})},placeholder:(j==null?void 0:j.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),c.jsxs("div",{className:I.metaRow,children:[c.jsx("span",{className:I.metaLabel,children:"Worktrees"}),c.jsx("div",{className:I.metaValue,children:c.jsx(hB,{checked:(j==null?void 0:j.useWorktrees)??!0,onChange:F=>{j&&g(j.id,{useWorktrees:F})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),c.jsxs("div",{className:I.metaRow,children:[c.jsx("span",{className:I.metaLabel,children:"Working Dir"}),c.jsx("div",{className:I.metaValue,children:c.jsx(cn,{value:(j==null?void 0:j.worktreeBasePath)||"",onSave:F=>{j&&g(j.id,{worktreeBasePath:F})},fieldId:"worktreeBasePath",activeFieldId:N,onActivate:E,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-worktree-base-path"})})]}),j&&c.jsxs("div",{className:I.metaTimestamps,children:[c.jsxs("span",{className:I.metaTimestamp,children:["Created ",P0(j.createdAt)]}),j.updatedAt&&j.updatedAt!==j.createdAt&&c.jsxs("span",{className:I.metaTimestamp,children:["· Updated ",P0(j.updatedAt)]})]})]}),$>0&&c.jsxs("div",{className:I.progressBarContainer,"data-testid":"progress-bar",children:[c.jsx("div",{className:I.progressBar,children:c.jsx("div",{className:I.progressFill,style:{width:`${le}%`}})}),c.jsxs("span",{className:I.progressLabel,children:[ie,"/",$]})]}),W&&W.costUsd>0&&c.jsx("div",{className:I.progressBarContainer,children:c.jsxs("span",{className:I.progressLabel,children:["Usage: ",Vi(W.costUsd)," (",W.sessionCount," session",W.sessionCount!==1?"s":"",")"]})}),c.jsxs("div",{className:I.tabBar,role:"tablist","aria-label":"Workspace view",children:[c.jsx("button",{role:"tab","aria-selected":b==="graph",className:`${I.tab} ${b==="graph"?I.active:""}`,onClick:()=>S("graph"),children:"Graph"}),c.jsx("button",{role:"tab","aria-selected":b==="board",className:`${I.tab} ${b==="board"?I.active:""}`,onClick:()=>S("board"),"data-testid":"board-tab",children:"Board"}),c.jsx("button",{role:"tab","aria-selected":b==="tasks",className:`${I.tab} ${b==="tasks"?I.active:""}`,onClick:()=>S("tasks"),children:"Tasks"})]}),b==="tasks"&&$>0&&c.jsxs("div",{className:I.workspaceSummary,children:[c.jsx("span",{className:I.workspaceSummaryTitle,children:`${ie}/${$} tasks complete`}),c.jsx("span",{className:I.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),b==="tasks"&&$===0&&c.jsxs("div",{className:I.emptyCta,children:[c.jsx("button",{className:I.ctaButton,onClick:()=>i(Pi(n,void 0,K)),children:"Create Task"}),c.jsx("div",{className:I.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),b==="board"&&c.jsx(W6,{workspaceId:n,environmentId:K}),b==="graph"&&c.jsx(E6,{workspaceId:n,environmentId:K}),c.jsx(wc,{isOpen:k,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{j&&(m(j.id),i("/",{replace:!0})),C(!1)},onCancel:()=>C(!1)})]})}const TB="_container_cddyd_1",kB="_header_cddyd_8",CB="_headerTitle_cddyd_35",EB="_badge_cddyd_44",NB="_headerActions_cddyd_54",AB="_body_cddyd_61",wB="_formContent_cddyd_73",jB="_section_cddyd_85",DB="_label_cddyd_91",MB="_titleInput_cddyd_98",RB="_descriptionTextarea_cddyd_131",OB="_parentContext_cddyd_167",BB="_parentLabel_cddyd_175",IB="_parentName_cddyd_182",LB="_personaSelect_cddyd_186",UB="_depList_cddyd_220",zB="_depItem_cddyd_226",VB="_depItemSelected_cddyd_248",HB="_noDeps_cddyd_252",GB="_btnPrimary_cddyd_258",PB="_btnGhost_cddyd_289",Ue={container:TB,header:kB,headerTitle:CB,badge:EB,headerActions:NB,body:AB,formContent:wB,section:jB,label:DB,titleInput:MB,descriptionTextarea:RB,parentContext:OB,parentLabel:BB,parentName:IB,personaSelect:LB,depList:UB,depItem:zB,depItemSelected:VB,noDeps:HB,btnPrimary:GB,btnGhost:PB};function _1({mode:n,taskId:a,workspaceId:i,parentTaskId:l,environmentId:r}){const{tasks:u,workspaces:f,personas:p,createTask:m,updateTask:g}=We(),{showToast:y}=$i(),v=Ht(),b=n==="edit",S=b&&a?u.find(he=>he.id===a):void 0,k=b?(S==null?void 0:S.workspaceId)??"":i??"",[C,N]=x.useState(k),E=k||C,A=f.find(he=>he.id===E),D=r??(A==null?void 0:A.environmentId),M=!b&&!i,j=b?(S==null?void 0:S.parentTaskId)??"":l??"",K=j?u.find(he=>he.id===j):void 0,[q,U]=x.useState((S==null?void 0:S.title)??""),[W,ee]=x.useState((S==null?void 0:S.description)??""),[ie,$]=x.useState((S==null?void 0:S.dependsOn)??[]),[le,F]=x.useState((S==null?void 0:S.defaultPersonaId)??""),[te,B]=x.useState((S==null?void 0:S.canDecompose)??!1),[H,ae]=x.useState(!1),G=x.useRef(!1);x.useEffect(()=>{b&&S&&!G.current&&(G.current=!0,U(S.title),ee(S.description),$(S.dependsOn),F(S.defaultPersonaId),B(S.canDecompose))},[b,S]);const O=u.filter(he=>he.workspaceId===E&&(!b||he.id!==a)&&he.id!==j),se=q.trim().length>0&&(!b||S!==void 0)&&E.length>0,ye=he=>{$(jt=>jt.includes(he)?jt.filter(pn=>pn!==he):[...jt,he])},re=()=>{!se||H||b&&S===void 0||(b&&a?(g(a,q.trim(),W,ie,le),y("Task updated","success"),v(ba(a,void 0,E,D),{replace:!0})):(ae(!0),m(E,q.trim(),W,ie.length>0?ie:void 0,j||void 0,le,te,()=>{y("Task created","success"),v(i?Bi(i,D):"/tasks",{replace:!0})},he=>{y(he,"error"),ae(!1)})))},Fe=()=>{v(b&&a?ba(a,void 0,E,D):i?Bi(i,D):"/tasks")},vt=b?"edit task":j?"child task":"new task";return c.jsxs("div",{className:Ue.container,children:[c.jsxs("div",{className:Ue.header,children:[c.jsxs("div",{className:Ue.headerTitle,children:[c.jsx("span",{className:Ue.badge,children:vt}),K&&c.jsxs("span",{className:Ue.parentContext,children:[c.jsx("span",{className:Ue.parentLabel,children:"Child of"}),c.jsx("span",{className:Ue.parentName,children:K.title})]})]}),c.jsxs("div",{className:Ue.headerActions,children:[c.jsx("button",{onClick:re,disabled:!se||H,className:Ue.btnPrimary,"data-testid":"task-edit-save",children:H?"Creating…":b?"Save Changes":"Create"}),c.jsx("button",{onClick:Fe,className:Ue.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:Ue.body,children:c.jsxs("div",{className:Ue.formContent,children:[M&&c.jsxs("div",{className:Ue.section,children:[c.jsx("label",{className:Ue.label,htmlFor:"task-edit-workspace",children:"Workspace"}),c.jsxs("select",{id:"task-edit-workspace",value:C,onChange:he=>N(he.target.value),className:Ue.personaSelect,"data-testid":"task-edit-workspace",children:[c.jsx("option",{value:"",children:"Select a workspace..."}),f.map(he=>c.jsx("option",{value:he.id,children:he.name},he.id))]})]}),c.jsxs("div",{className:Ue.section,children:[c.jsx("label",{className:Ue.label,htmlFor:"task-edit-title",children:"Title"}),c.jsx("input",{id:"task-edit-title",type:"text",value:q,onChange:he=>U(he.target.value),placeholder:"Task title...",autoFocus:!0,className:Ue.titleInput,"data-testid":"task-edit-title",onKeyDown:he=>{he.key==="Enter"&&se&&re()}})]}),c.jsxs("div",{className:Ue.section,children:[c.jsx("label",{className:Ue.label,htmlFor:"task-edit-description",children:"Description"}),c.jsx("textarea",{id:"task-edit-description",value:W,onChange:he=>ee(he.target.value),placeholder:"Describe the task... (markdown supported)",className:Ue.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),c.jsxs("div",{className:Ue.section,children:[c.jsx("label",{className:Ue.label,htmlFor:"task-edit-persona",children:"Default Persona"}),c.jsxs("select",{id:"task-edit-persona",value:le,onChange:he=>F(he.target.value),className:Ue.personaSelect,"data-testid":"task-edit-persona",children:[c.jsx("option",{value:"",children:"(Inherit)"}),p.map(he=>c.jsx("option",{value:he.id,children:he.name},he.id))]})]}),!b&&c.jsx("div",{className:Ue.section,children:c.jsxs("label",{className:Ue.depItem,"data-testid":"task-edit-can-decompose",children:[c.jsx("input",{type:"checkbox",checked:te,onChange:he=>B(he.target.checked)}),"Can spawn subtasks"]})}),c.jsxs("div",{className:Ue.section,children:[c.jsx("div",{className:Ue.label,children:"Dependencies"}),O.length===0?c.jsx("div",{className:Ue.noDeps,children:"No other tasks in this workspace"}):c.jsx("div",{className:Ue.depList,children:O.map(he=>{const jt=ie.includes(he.id);return c.jsxs("label",{className:`${Ue.depItem} ${jt?Ue.depItemSelected:""}`,"data-testid":`dep-option-${he.id}`,children:[c.jsx("input",{type:"checkbox",checked:jt,onChange:()=>ye(he.id)}),he.title,c.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",he.status,")"]})]},he.id)})})]})]})})]})}function $0(){const{workspaceId:n,environmentId:a}=ns(),[i]=hb(),l=n??i.get("workspace")??"",r=i.get("parent")??void 0;return c.jsx(_1,{mode:"new",workspaceId:l,parentTaskId:r,environmentId:a})}function F0(){const{taskId:n,workspaceId:a,environmentId:i}=ns();return c.jsx(_1,{mode:"edit",taskId:n,workspaceId:a,environmentId:i})}const $B="_container_1pqxm_1",FB="_emptyState_1pqxm_8",qB="_card_1pqxm_14",YB="_cardHeader_1pqxm_34",KB="_categoryBadge_1pqxm_46",ZB="_findingTitle_1pqxm_54",XB="_findingDate_1pqxm_60",QB="_findingContent_1pqxm_72",WB="_tags_1pqxm_78",JB="_tag_1pqxm_78",Hn={container:$B,emptyState:FB,card:qB,cardHeader:YB,categoryBadge:KB,findingTitle:ZB,findingDate:XB,findingContent:QB,tags:WB,tag:JB};function e4(n){const a=new Date(n),i=new Date,l=i.getTime()-a.getTime(),r=Math.floor(l/1e3),u=Math.floor(r/60),f=Math.floor(u/60),p=Math.floor(f/24);if(r<60)return"just now";if(u<60)return`${u}m ago`;if(f<24)return`${f}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const m=a.getFullYear()===i.getFullYear(),g=a.toLocaleString("en-US",{month:"short"}),y=a.getDate();return m?`${g} ${y}`:`${g} ${y} ${a.getFullYear()}`}const q0={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 t4({workspaceId:n}){const{findings:a}=We(),i=a.filter(l=>l.workspaceId===n);return i.length===0?c.jsx("div",{className:Hn.emptyState,children:"No findings yet. Agents will post discoveries here."}):c.jsx("div",{className:Hn.container,children:i.map((l,r)=>{const u=q0[l.category]||q0.general;return c.jsxs(kt.div,{className:Hn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},children:[c.jsxs("div",{className:Hn.cardHeader,children:[c.jsx("span",{className:Hn.categoryBadge,style:{background:u.bg,color:u.text},children:l.category}),c.jsx("span",{className:Hn.findingTitle,children:l.title}),c.jsx("span",{className:Hn.findingDate,title:l.createdAt,children:e4(l.createdAt)})]}),c.jsx("div",{className:Hn.findingContent,children:l.content.length>300?l.content.slice(0,300)+"...":l.content}),l.tags.length>0&&c.jsx("div",{className:Hn.tags,children:l.tags.map(f=>c.jsx("span",{className:Hn.tag,style:{color:u.text,textShadow:`0 0 8px ${u.text}`},children:f},f))})]},l.id)})})}function Xr(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 pf(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),r=Math.floor(i%6e4/1e3);if(l===0)return`${r}s`;const u=Math.floor(l/60),f=l%60;return u===0?`${l}m ${r}s`:`${u}h ${f}m`}function Y0(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 n4({status:n}){const a=ts(n),i=a2(n);return c.jsx("span",{className:`${I.statusBadge} ${I[i]??I.statusPending}`,children:a.label})}function a4({task:n,tasksById:a,environments:i,workspaces:l,taskSessions:r,selectedEnvId:u}){const{loadUsage:f,usageCache:p}=We(),m=r.reduce((D,M)=>D+(M.costUsd??0),0);x.useEffect(()=>{f("task",n.id),n.childTaskIds.length>0&&f("task_tree",n.id)},[n.id,n.childTaskIds.length,f,m]);const g=`task:${n.id}`,y=g in p?p[g]:void 0,v=`task_tree:${n.id}`,b=n.childTaskIds.length>0&&v in p?p[v]:void 0,S=r.length>0?r[r.length-1]:void 0,k=(S==null?void 0:S.environmentId)??"",C=k?i.find(D=>D.id===k):void 0,N=l.find(D=>D.id===n.workspaceId),E=i.find(D=>D.id===u),A=n.branch&&(N!=null&&N.repoUrl)?`${N.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return c.jsxs("div",{className:I.overviewDashboard,children:[c.jsxs("div",{className:I.overviewHero,children:[c.jsx(n4,{status:n.status}),n.branch&&c.jsx("span",{className:I.overviewBranchPill,children:A?c.jsxs("a",{href:A,target:"_blank",rel:"noreferrer noopener",className:I.branchLink,children:["🔗"," ",n.branch]}):c.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&c.jsxs("div",{className:I.overviewSection,children:[c.jsx("div",{className:I.overviewLabel,children:"Description"}),c.jsx("div",{className:I.overviewMarkdown,children:c.jsx(Zf,{remarkPlugins:[Xf],children:n.description})})]}),c.jsxs("div",{className:I.overviewSection,children:[c.jsx("div",{className:I.overviewLabel,children:"Environment"}),k&&C?c.jsxs("div",{className:I.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${I.envDot} ${Y0(C.status)}`,title:C.status,"aria-label":`Status: ${C.status}`,role:"img"}),c.jsx("span",{className:I.overviewValue,children:C.displayName})]}):E?c.jsxs("div",{className:I.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${I.envDot} ${Y0(E.status)}`,title:E.status,"aria-label":`Status: ${E.status}`,role:"img"}),c.jsx("span",{className:I.overviewValue,children:E.displayName}),c.jsx("span",{className:I.overviewMuted,children:"(workspace default)"})]}):c.jsx("div",{className:I.overviewMuted,children:"Set in workspace settings"})]}),c.jsxs("div",{className:I.overviewSection,children:[c.jsx("div",{className:I.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?c.jsx("div",{className:I.overviewMuted,children:"None"}):c.jsx("div",{className:I.depList,children:n.dependsOn.map(D=>{const M=a.get(D),j=(M==null?void 0:M.status)==="complete";return c.jsxs("div",{className:`${I.depItem} ${j?I.depDone:I.depBlocked}`,children:[c.jsx("span",{children:j?"✓":"○"}),c.jsx("span",{children:(M==null?void 0:M.title)??D})]},D)})})]}),c.jsxs("div",{className:I.overviewSection,children:[c.jsx("div",{className:I.overviewLabel,children:"Timeline"}),c.jsxs("div",{className:I.timeline,children:[n.createdAt&&c.jsxs("div",{className:I.timelineRow,children:[c.jsx("span",{className:I.timelineKey,children:"Created"}),c.jsx("span",{className:I.timelineValue,children:Xr(n.createdAt)})]}),n.assignedAt&&(()=>{const D=pf(n.createdAt,n.assignedAt);return c.jsxs("div",{className:I.timelineRow,children:[c.jsx("span",{className:I.timelineKey,children:"Assigned"}),c.jsx("span",{className:I.timelineValue,children:Xr(n.assignedAt)}),D!==void 0&&c.jsx("span",{className:I.timelineDelta,children:D})]})})(),n.startedAt&&(()=>{const D=pf(n.assignedAt??n.createdAt,n.startedAt);return c.jsxs("div",{className:I.timelineRow,children:[c.jsx("span",{className:I.timelineKey,children:"Started"}),c.jsx("span",{className:I.timelineValue,children:Xr(n.startedAt)}),D!==void 0&&c.jsx("span",{className:I.timelineDelta,children:D})]})})(),n.completedAt&&(()=>{const D=pf(n.startedAt,n.completedAt);return c.jsxs("div",{className:I.timelineRow,children:[c.jsx("span",{className:I.timelineKey,children:"Completed"}),c.jsx("span",{className:I.timelineValue,children:Xr(n.completedAt)}),D!==void 0&&c.jsx("span",{className:I.timelineDelta,children:D})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&c.jsx("div",{className:I.overviewMuted,children:"No timing data"})]})]}),y&&y.costUsd>0&&c.jsxs("div",{className:I.overviewSection,children:[c.jsx("div",{className:I.overviewLabel,children:"Usage"}),c.jsxs("div",{className:I.timeline,children:[c.jsxs("div",{className:I.timelineRow,children:[c.jsx("span",{className:I.timelineKey,children:"Cost"}),c.jsx("span",{className:I.timelineValue,children:Vi(y.costUsd)}),c.jsxs("span",{className:I.timelineDelta,children:[y.sessionCount," session",y.sessionCount!==1?"s":""]})]}),b&&b.costUsd>y.costUsd&&c.jsxs("div",{className:I.timelineRow,children:[c.jsx("span",{className:I.timelineKey,children:"Total (incl. subtasks)"}),c.jsx("span",{className:I.timelineValue,children:Vi(b.costUsd)}),c.jsxs("span",{className:I.timelineDelta,children:[b.sessionCount," session",b.sessionCount!==1?"s":""]})]})]})]}),n.reviewNotes&&c.jsxs("div",{className:I.overviewSection,children:[c.jsx("div",{className:I.overviewLabel,children:"Review Notes"}),c.jsx("div",{className:I.reviewNotes,children:n.reviewNotes})]})]})}function s4({task:n,sessionId:a,isBlocked:i,onStart:l,onResume:r,onStop:u,onPause:f,onDelete:p,onEdit:m}){if(n.status==="not_started")return i?c.jsxs("div",{className:I.headerActions,children:[c.jsx("button",{onClick:m,className:I.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]}):c.jsxs("div",{className:I.headerActions,children:[c.jsx("button",{onClick:l,className:I.btnPrimary,children:"Start"}),c.jsx("button",{onClick:m,className:I.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]});if(n.status==="working")return c.jsxs("div",{className:I.headerActions,children:[c.jsx("button",{onClick:u,className:I.btnDanger,children:"Stop"}),c.jsx("button",{onClick:f,disabled:!a,className:I.btnGhost,children:"Pause"})]});if(n.status==="paused")return c.jsxs("div",{className:I.headerActions,children:[c.jsx("button",{onClick:u,className:I.btnPrimary,children:"Stop"}),c.jsx("button",{onClick:r,className:I.btnGhost,children:"Resume"}),c.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]});if(n.status==="complete")return c.jsx("div",{className:I.headerActions,children:c.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})});if(n.status==="failed")return c.jsxs("div",{className:I.headerActions,children:[c.jsx("button",{onClick:l,className:I.btnPrimary,children:"Retry"}),c.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]})}function i4({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return c.jsxs("div",{className:I.attemptSelector,"data-testid":"attempt-selector",children:[c.jsx("span",{className:I.attemptLabel,children:"Attempts:"}),n.map((l,r)=>{const u=l.id===a,f=l.status==="completed"?"✓":l.status==="failed"?"✗":l.status==="running"||l.status==="idle"?"●":"";return c.jsxs("button",{className:`${I.attemptButton} ${u?I.attemptActive:""}`,onClick:()=>i(l.id),title:`Attempt #${r+1} — ${l.status}`,"aria-label":`Attempt #${r+1}, ${l.status}`,"aria-pressed":u,"data-testid":`attempt-${r+1}`,children:["#",r+1,f&&c.jsx("span",{className:I.attemptStatus,children:f})]},l.id)})]})}function Ni(){const{taskId:n,workspaceId:a,environmentId:i}=ns(),l=Nt(),r=Ht(),{events:u,eventsDropped:f,tasks:p,sessions:m,environments:g,loadSessionEvents:y,loadFindings:v,kill:b,startTask:S,stopTask:k,resumeTask:C,deleteTask:N,workspaces:E,taskSessions:A,loadTaskSessions:D}=We(),M=x.useRef(void 0),j=x.useRef(void 0),K=x.useRef(void 0),q=x.useRef(void 0),U=x.useRef(void 0),W=l.pathname.endsWith("/stream")?"stream":l.pathname.endsWith("/findings")?"findings":"overview",[ee,ie]=x.useState(W),[$,le]=x.useState(!1),[F,te]=x.useState(void 0),[B,H]=x.useState(""),ae=x.useRef(W);W!==ae.current&&(ae.current=W,W!==ee&&ie(W));const G=p.find(Se=>Se.id===n),O=(G==null?void 0:G.workspaceId)||void 0,se=E.find(Se=>Se.id===O);x.useEffect(()=>{if(B===""){if(se!=null&&se.environmentId)H(se.environmentId);else if(g.length>0){const Se=g.find(ft=>ft.status==="connected");H((Se==null?void 0:Se.id)??g[0].id)}}},[B,se==null?void 0:se.environmentId,g]);const ye=G?A[G.id]??[]:[];let re;F&&ye.some(Se=>Se.id===F)?re=F:re=(G==null?void 0:G.latestSessionId)||void 0;const Fe=()=>{le(!0)},vt=()=>{if(!G)return;N(G.id),le(!1);const Se=i??(se==null?void 0:se.environmentId);r(G.workspaceId&&Se?Bi(G.workspaceId,Se):"/",{replace:!0})};if((G==null?void 0:G.id)!==j.current&&(j.current=G==null?void 0:G.id,F!==void 0&&te(void 0),B!==""&&H("")),x.useEffect(()=>{if(!(G!=null&&G.id))return;const Se=G.id!==q.current,ft=G.latestSessionId!==U.current;(Se||ft)&&(q.current=G.id,U.current=G.latestSessionId,D(G.id))},[G==null?void 0:G.id,G==null?void 0:G.latestSessionId,D]),(G==null?void 0:G.status)!==K.current){const Se=K.current===void 0;K.current=G==null?void 0:G.status;const ft=(G==null?void 0:G.status)==="not_started"?"overview":(G==null?void 0:G.status)==="working"||(G==null?void 0:G.status)==="paused"?"stream":(G==null?void 0:G.status)==="complete"?"findings":void 0;ft&&ft!==ee&&!(Se&&W!=="overview")&&ie(ft)}const he=x.useMemo(()=>new Map(p.map(Se=>[Se.id,Se])),[p]),jt=x.useMemo(()=>{const Se=re?u.filter(ft=>ft.sessionId===re):[];return qh(Fh(Se))},[u,re]),pn=G?G.dependsOn.some(Se=>{const ft=he.get(Se);return ft!==void 0&&ft.status!=="complete"}):!1,jn=x.useMemo(()=>JO(n,i,E,g,he),[n,i,E,g,he]);x.useEffect(()=>{re&&re!==M.current&&(M.current=re,y(re))},[re,y]),x.useEffect(()=>{ee==="findings"&&O&&v(O)},[ee,O,v]);const Bn=Se=>{ie(Se),r(ba(n,Se==="overview"?void 0:Se,a,i))};return c.jsxs("div",{className:I.panelContainer,children:[c.jsx(Ki,{segments:jn}),c.jsxs("div",{className:I.header,children:[c.jsxs("span",{className:I.headerTitle,children:[c.jsx("span",{"data-testid":"task-title",children:(G==null?void 0:G.title)||n}),G&&c.jsx("span",{className:I.taskStatusBadge,"data-testid":"task-status",children:G.status}),(G==null?void 0:G.branch)&&c.jsx("span",{className:I.taskBranch,children:G.branch}),pn&&c.jsx("span",{className:I.taskBlockedBadge,children:"blocked"})]}),G&&c.jsx(s4,{task:G,sessionId:re,isBlocked:pn,onStart:()=>S(G.id,void 0,B),onResume:()=>C(G.id),onStop:()=>k(G.id),onPause:()=>re&&b(re),onDelete:Fe,onEdit:()=>r($k(G.id,a,i))})]}),c.jsxs("div",{className:I.tabBar,role:"tablist","aria-label":"Task view",children:[c.jsx("button",{role:"tab","aria-selected":ee==="overview",className:`${I.tab} ${ee==="overview"?I.active:""}`,onClick:()=>Bn("overview"),children:"Overview"}),c.jsx("button",{role:"tab","aria-selected":ee==="stream",className:`${I.tab} ${ee==="stream"?I.active:""}`,onClick:()=>Bn("stream"),children:"Stream"}),c.jsx("button",{role:"tab","aria-selected":ee==="findings",className:`${I.tab} ${ee==="findings"?I.active:""}`,onClick:()=>Bn("findings"),children:"Findings"})]}),c.jsxs(Zn,{mode:"wait",children:[ee==="overview"&&c.jsx(kt.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:G?c.jsx(a4,{task:G,tasksById:he,environments:g,workspaces:E,taskSessions:ye,selectedEnvId:B}):c.jsx("div",{className:I.waitingMessage,children:"No additional details"})},"overview"),ee==="stream"&&c.jsxs(kt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[c.jsx(i4,{taskSessions:ye,selectedSessionId:re,onSelect:Se=>te(Se)}),c.jsx($h,{events:jt,eventsDropped:f,emptyState:!re&&G?c.jsxs("div",{className:I.emptyCta,children:[c.jsx("button",{className:I.ctaButton,onClick:()=>S(G.id,void 0,B),children:"Start Task"}),c.jsx("div",{className:I.ctaDescription,children:"Click to begin agent execution"})]}):re&&jt.length===0?c.jsx("div",{className:I.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),ee==="findings"&&c.jsx(kt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:I.tabContent,children:O?c.jsx(t4,{workspaceId:O}):c.jsx("div",{className:I.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!G||G.status!=="working"&&G.status!=="paused")return;const Se=re?m.find(ft=>ft.id===re):void 0;if(!(!Se||["completed","failed","interrupted","hibernating"].includes(Se.status)))return c.jsx(gl,{mode:"send",sessionId:Se.id,environmentId:Se.environmentId})})(),G&&c.jsx(wc,{isOpen:$,title:"Delete Task?",description:`"${G.title}" will be permanently removed.`,onConfirm:vt,onCancel:()=>le(!1)})]})}const o4="_container_legrg_1",l4="_header_legrg_8",r4="_headerTitle_legrg_35",c4="_badge_legrg_44",u4="_headerActions_legrg_54",d4="_body_legrg_61",f4="_formContent_legrg_73",h4="_section_legrg_85",p4="_label_legrg_91",m4="_nameInput_legrg_98",g4="_fieldInput_legrg_131",v4="_adapterSelect_legrg_164",y4="_readOnlyValue_legrg_198",b4="_codespaceSection_legrg_204",x4="_codespaceActions_legrg_210",_4="_creatingHint_legrg_216",S4="_errorHint_legrg_222",T4="_btnPrimary_legrg_235",k4="_btnGhost_legrg_266",ne={container:o4,header:l4,headerTitle:r4,badge:c4,headerActions:u4,body:d4,formContent:f4,section:h4,label:p4,nameInput:m4,fieldInput:g4,adapterSelect:v4,readOnlyValue:y4,codespaceSection:b4,codespaceActions:x4,creatingHint:_4,errorHint:S4,btnPrimary:T4,btnGhost:k4},ac=1,sc=65535;function mf(n){if(!n.trim())return!0;const a=Number(n);return Number.isInteger(a)&&a>=ac&&a<=sc}function gf(n){try{const a=JSON.parse(n);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function C4({codespaceName:n,onCodespaceNameChange:a,envName:i,onEnvNameChange:l}){const{codespaces:r,codespaceError:u,codespaceListError:f,codespaceCreating:p,createCodespace:m}=We(),[g,y]=x.useState("pick"),[v,b]=x.useState(""),[S,k]=x.useState("");return g==="create"?c.jsxs("div",{className:ne.codespaceSection,children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Repository"}),c.jsx("input",{type:"text",value:v,onChange:C=>b(C.target.value),placeholder:"owner/repo",className:ne.fieldInput,"data-testid":"env-codespace-repo"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Machine Type"}),c.jsx("input",{type:"text",value:S,onChange:C=>k(C.target.value),placeholder:"Machine type (optional)...",className:ne.fieldInput,"data-testid":"env-codespace-machine"})]}),c.jsxs("div",{className:ne.codespaceActions,children:[c.jsx("button",{onClick:()=>{v.trim()&&(m(v.trim(),S.trim()||void 0),y("pick"),b(""),k(""))},disabled:!v.trim(),className:ne.btnPrimary,children:"Create"}),c.jsx("button",{onClick:()=>{y("pick"),b(""),k("")},className:ne.btnGhost,children:"Cancel"})]})]}):c.jsx("div",{className:ne.codespaceSection,children:c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Codespace"}),!f&&c.jsxs("select",{value:n,onChange:C=>{C.target.value==="__create__"?(y("create"),a("")):(a(C.target.value),C.target.value&&!i.trim()&&l(C.target.value))},disabled:p,className:ne.adapterSelect,"data-testid":"env-codespace-select",children:[c.jsx("option",{value:"",children:"Select a codespace..."}),r.map(C=>c.jsxs("option",{value:C.name,children:[C.name," (",C.repository,") — ",C.state]},C.name)),c.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&c.jsx("span",{className:ne.creatingHint,children:"Creating codespace..."}),f&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:ne.errorHint,children:f}),c.jsx("input",{type:"text",value:n,onChange:C=>a(C.target.value),placeholder:"Or enter codespace name manually...",className:ne.fieldInput,"data-testid":"env-codespace-manual"})]}),u&&!f&&c.jsx("span",{className:ne.errorHint,children:u})]})})}function S1({mode:n,environmentId:a}){const{environments:i,addEnvironment:l,updateEnvironment:r,listCodespaces:u}=We(),{showToast:f}=$i(),p=Ht(),m=n==="edit",g=m&&a?i.find(O=>O.id===a):void 0,[y,v]=x.useState(""),[b,S]=x.useState("local"),[k,C]=x.useState(""),[N,E]=x.useState(""),[A,D]=x.useState(""),[M,j]=x.useState(""),[K,q]=x.useState(""),[U,W]=x.useState(""),[ee,ie]=x.useState(""),[$,le]=x.useState(null),F=x.useCallback(()=>{const O={};if(b==="local"){if(k.trim()&&(O.host=k.trim()),N.trim()){const se=Number(N);Number.isInteger(se)&&(O.port=se)}}else if(b==="ssh"){if(O.host=k.trim(),A.trim()&&(O.user=A.trim()),N.trim()){const se=Number(N);Number.isInteger(se)&&(O.sshPort=se)}M.trim()&&(O.identityFile=M.trim())}else b==="docker"?(K.trim()&&(O.image=K.trim()),U.trim()&&(O.repo=U.trim())):b==="codespace"&&(O.codespaceName=ee.trim());return O},[b,k,N,A,M,K,U,ee]),te=()=>!(!y.trim()||b==="ssh"&&!k.trim()||b==="codespace"&&!ee.trim()||(b==="local"||b==="ssh")&&!mf(N)),B=()=>{te()&&(l(y.trim(),b,F()),f("Environment added successfully","success"),p(Ii,{replace:!0}))},H=()=>{p(a?ul(a):Ii)},ae=x.useCallback((O,se)=>{if(!g||!a)return;const ye=gf(g.adapterConfig),re=se.trim();re?ye[O]=re:delete ye[O],r(a,{adapterConfig:ye})},[g,a,r]),G=x.useCallback((O,se)=>{if(!g||!a)return;const ye=gf(g.adapterConfig);if(se.trim()){const re=Number(se);Number.isInteger(re)&&re>=ac&&re<=sc&&(ye[O]=re)}else delete ye[O];r(a,{adapterConfig:ye})},[g,a,r]);if(m){if(!g)return c.jsxs("div",{className:ne.container,children:[c.jsxs("div",{className:ne.header,children:[c.jsx("div",{className:ne.headerTitle,children:c.jsx("span",{className:ne.badge,children:"edit environment"})}),c.jsx("div",{className:ne.headerActions,children:c.jsx("button",{onClick:H,className:ne.btnGhost,children:"Back"})})]}),c.jsx("div",{className:ne.body,children:c.jsx("div",{className:ne.formContent,children:c.jsx("span",{className:ne.readOnlyValue,children:"Environment not found"})})})]});const O=gf(g.adapterConfig);return c.jsxs("div",{className:ne.container,"data-testid":"env-edit-panel",children:[c.jsxs("div",{className:ne.header,children:[c.jsx("div",{className:ne.headerTitle,children:c.jsx("span",{className:ne.badge,children:"edit environment"})}),c.jsx("div",{className:ne.headerActions,children:c.jsx("button",{onClick:H,className:ne.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),c.jsx("div",{className:ne.body,children:c.jsxs("div",{className:ne.formContent,children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Name"}),c.jsx(cn,{value:g.displayName,onSave:se=>{a&&r(a,{displayName:se})},validate:se=>se.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:$,onActivate:le,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Adapter Type"}),c.jsx("span",{className:ne.readOnlyValue,"data-testid":"env-edit-adapter-type",children:g.adapterType})]}),g.adapterType==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Host"}),c.jsx(cn,{value:String(O.host??""),onSave:se=>ae("host",se),mode:"edit",fieldId:"host",activeFieldId:$,onActivate:le,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Port"}),c.jsx(cn,{value:String(O.port??""),onSave:se=>G("port",se),validate:se=>mf(se)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:$,onActivate:le,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),g.adapterType==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Host"}),c.jsx(cn,{value:String(O.host??""),onSave:se=>ae("host",se),validate:se=>se.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:$,onActivate:le,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"User"}),c.jsx(cn,{value:String(O.user??""),onSave:se=>ae("user",se),mode:"edit",fieldId:"user",activeFieldId:$,onActivate:le,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"SSH Port"}),c.jsx(cn,{value:String(O.sshPort??""),onSave:se=>G("sshPort",se),validate:se=>mf(se)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:$,onActivate:le,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Identity File"}),c.jsx(cn,{value:String(O.identityFile??""),onSave:se=>ae("identityFile",se),mode:"edit",fieldId:"identityFile",activeFieldId:$,onActivate:le,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),g.adapterType==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Image"}),c.jsx(cn,{value:String(O.image??""),onSave:se=>ae("image",se),mode:"edit",fieldId:"image",activeFieldId:$,onActivate:le,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Repo"}),c.jsx(cn,{value:String(O.repo??""),onSave:se=>ae("repo",se),mode:"edit",fieldId:"repo",activeFieldId:$,onActivate:le,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),g.adapterType==="codespace"&&c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Codespace Name"}),c.jsx(cn,{value:String(O.codespaceName??""),onSave:se=>ae("codespaceName",se),validate:se=>se.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:$,onActivate:le,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return c.jsxs("div",{className:ne.container,"data-testid":"env-create-panel",children:[c.jsxs("div",{className:ne.header,children:[c.jsx("div",{className:ne.headerTitle,children:c.jsx("span",{className:ne.badge,children:"new environment"})}),c.jsxs("div",{className:ne.headerActions,children:[c.jsx("button",{onClick:B,disabled:!te(),className:ne.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),c.jsx("button",{onClick:H,className:ne.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:ne.body,children:c.jsxs("div",{className:ne.formContent,children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-name",children:"Name"}),c.jsx("input",{id:"env-create-name",type:"text",value:y,onChange:O=>v(O.target.value),placeholder:"Environment name...",autoFocus:!0,className:ne.nameInput,"data-testid":"env-create-name",onKeyDown:O=>{O.key==="Enter"&&te()&&B()}})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),c.jsxs("select",{id:"env-create-adapter",value:b,onChange:O=>{S(O.target.value),O.target.value==="codespace"&&u()},className:ne.adapterSelect,"data-testid":"env-create-adapter",children:[c.jsx("option",{value:"local",children:"local"}),c.jsx("option",{value:"ssh",children:"ssh"}),c.jsx("option",{value:"docker",children:"docker"}),c.jsx("option",{value:"codespace",children:"codespace"})]})]}),b==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:k,onChange:O=>C(O.target.value),placeholder:"Host (optional)...",className:ne.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-port",children:"Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:ac,max:sc,value:N,onChange:O=>E(O.target.value),placeholder:"Port (optional)...",className:ne.fieldInput,"data-testid":"env-create-port"})]})]}),b==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:k,onChange:O=>C(O.target.value),placeholder:"Host (required)...",className:ne.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-user",children:"User"}),c.jsx("input",{id:"env-create-user",type:"text",value:A,onChange:O=>D(O.target.value),placeholder:"User (optional)...",className:ne.fieldInput,"data-testid":"env-create-user"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-port",children:"SSH Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:ac,max:sc,value:N,onChange:O=>E(O.target.value),placeholder:"SSH port (optional)...",className:ne.fieldInput,"data-testid":"env-create-port"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-identity",children:"Identity File"}),c.jsx("input",{id:"env-create-identity",type:"text",value:M,onChange:O=>j(O.target.value),placeholder:"Identity file (optional)...",className:ne.fieldInput,"data-testid":"env-create-identity"})]})]}),b==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-image",children:"Image"}),c.jsx("input",{id:"env-create-image",type:"text",value:K,onChange:O=>q(O.target.value),placeholder:"Image (optional)...",className:ne.fieldInput,"data-testid":"env-create-image"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-repo",children:"Repo"}),c.jsx("input",{id:"env-create-repo",type:"text",value:U,onChange:O=>W(O.target.value),placeholder:"Repo (optional)...",className:ne.fieldInput,"data-testid":"env-create-repo"})]})]}),b==="codespace"&&c.jsx(C4,{codespaceName:ee,onCodespaceNameChange:ie,envName:y,onEnvNameChange:v})]})})]})}function E4(){return c.jsx(S1,{mode:"new"})}function N4(){const{environmentId:n}=ns();return c.jsx(S1,{mode:"edit",environmentId:n})}const A4="_layout_11u79_1",w4="_content_11u79_8",j4="_tabPanel_11u79_14",ol={layout:A4,content:w4,tabPanel:j4};function D4(){const n=ZO();return c.jsxs("div",{className:ol.layout,children:[c.jsx(Ki,{segments:n}),c.jsx("div",{className:ol.content,children:c.jsx(th,{})})]})}const M4="_container_13sb6_1",R4="_envHeader_13sb6_6",O4="_envTitleRow_13sb6_10",B4="_statusDot_13sb6_16",I4="_envName_13sb6_21",L4="_statusBadge_13sb6_27",U4="_envMeta_13sb6_33",z4="_metaTag_13sb6_39",V4="_actions_13sb6_51",H4="_provisionMessage_13sb6_59",G4="_errorMessage_13sb6_64",P4="_section_13sb6_69",$4="_sectionHeader_13sb6_73",F4="_createForm_13sb6_85",q4="_createInput_13sb6_92",Y4="_cardList_13sb6_121",K4="_card_13sb6_121",Z4="_cardHeader_13sb6_138",X4="_cardName_13sb6_144",Q4="_cardActions_13sb6_149",W4="_cardDescription_13sb6_154",J4="_cardMeta_13sb6_160",eI="_repoLink_13sb6_166",tI="_empty_13sb6_174",nI="_btnPrimary_13sb6_180",aI="_btnOutline_13sb6_214",sI="_btnSmall_13sb6_241",iI="_btnDanger_13sb6_267",Ne={container:M4,envHeader:R4,envTitleRow:O4,statusDot:B4,envName:I4,statusBadge:L4,envMeta:U4,metaTag:z4,actions:V4,provisionMessage:H4,errorMessage:G4,section:P4,sectionHeader:$4,createForm:F4,createInput:q4,cardList:Y4,card:K4,cardHeader:Z4,cardName:X4,cardActions:Q4,cardDescription:W4,cardMeta:J4,repoLink:eI,empty:tI,btnPrimary:nI,btnOutline:aI,btnSmall:sI,btnDanger:iI},oI={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function lI(){const{environmentId:n}=ns(),a=Ht(),{environments:i,workspaces:l,sessions:r,provisionStatus:u,provisionEnvironment:f,stopEnvironment:p,removeEnvironment:m,createWorkspace:g,archiveWorkspace:y,workspaceCreating:v}=We(),[b,S]=x.useState(!1),[k,C]=x.useState(void 0),[N,E]=x.useState(!1),[A,D]=x.useState(""),M=i.find(H=>H.id===n);if(!n||!M)return c.jsx(Gn,{to:Ii,replace:!0});const j=l.filter(H=>H.environmentId===M.id),K=r.filter(H=>H.environmentId===M.id),q=K.reduce((H,ae)=>H+(ae.costUsd??0),0),U=oI[M.status]||"var(--text-tertiary)",W=M.status==="connected",ee=M.status==="connecting",ie=M.status==="disconnected"||M.status==="error",$=M.id in u?u[M.id]:void 0,le=()=>{m(M.id),S(!1),a(Ii,{replace:!0})},F=()=>{!A.trim()||v||(g(A.trim(),void 0,void 0,M.id),D(""),E(!1))},te=H=>{H.key==="Enter"?F():H.key==="Escape"&&(E(!1),D(""))},B=H=>{y(H),C(void 0)};return c.jsxs("div",{className:Ne.container,children:[c.jsx(wc,{isOpen:b,title:"Delete Environment?",description:`"${M.displayName||M.id}" will be permanently removed along with all its data.`,onConfirm:le,onCancel:()=>S(!1)}),c.jsxs("div",{className:Ne.envHeader,children:[c.jsxs("div",{className:Ne.envTitleRow,children:[c.jsx("span",{className:Ne.statusDot,style:{color:U},children:"●"}),c.jsx("h2",{className:Ne.envName,children:M.displayName||M.id}),c.jsx("span",{className:Ne.statusBadge,style:{color:U},children:M.status})]}),c.jsxs("div",{className:Ne.envMeta,children:[c.jsxs("span",{className:Ne.metaTag,children:["Adapter: ",M.adapterType]}),K.length>0&&c.jsxs("span",{className:Ne.metaTag,children:[K.length," session",K.length!==1?"s":""]}),q>0&&c.jsxs("span",{className:Ne.metaTag,children:["Cost: ",Vi(q)]})]})]}),c.jsxs("div",{className:Ne.actions,children:[W&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:Ne.btnPrimary,onClick:()=>a(mb(M.id)),children:"New Chat"}),c.jsx("button",{className:Ne.btnOutline,onClick:()=>p(M.id),children:"Stop"})]}),ie&&c.jsx("button",{className:Ne.btnPrimary,onClick:()=>f(M.id),children:M.status==="error"?"Retry":"Connect"}),ee&&$!==void 0&&c.jsx("span",{className:Ne.provisionMessage,children:$.message}),M.status==="error"&&($==null?void 0:$.stage)==="error"&&c.jsx("span",{className:Ne.errorMessage,children:$.message}),c.jsx("button",{className:Ne.btnOutline,onClick:()=>a(qk(M.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),c.jsx("button",{className:Ne.btnDanger,onClick:()=>S(!0),children:"Delete"})]}),c.jsxs("div",{className:Ne.section,children:[c.jsxs("div",{className:Ne.sectionHeader,children:[c.jsx("h3",{children:"Workspaces"}),c.jsx("button",{className:Ne.btnPrimary,onClick:()=>E(!0),disabled:v,children:"+ New Workspace"})]}),N&&c.jsxs("div",{className:Ne.createForm,children:[c.jsx("input",{type:"text",value:A,onChange:H=>D(H.target.value),onKeyDown:te,placeholder:"Workspace name...",autoFocus:!0,disabled:v,className:Ne.createInput,"data-testid":"workspace-create-input"}),c.jsx("button",{onClick:F,className:Ne.btnPrimary,disabled:v||!A.trim(),"data-testid":"workspace-create-submit",children:v?c.jsx(Ph,{size:"sm",label:"Creating"}):"Create"}),c.jsx("button",{onClick:()=>{E(!1),D("")},className:Ne.btnOutline,children:"Cancel"})]}),j.length===0&&!N&&c.jsx("p",{className:Ne.empty,children:"No workspaces yet. Create one to get started."}),c.jsx("div",{className:Ne.cardList,children:j.map(H=>c.jsx(rI,{workspace:H,confirmArchiveId:k,onOpen:()=>a(Bi(H.id,M.id)),onArchive:()=>C(H.id),onConfirmArchive:()=>B(H.id),onCancelArchive:()=>C(void 0)},H.id))})]})]})}function rI({workspace:n,confirmArchiveId:a,onOpen:i,onArchive:l,onConfirmArchive:r,onCancelArchive:u}){const f=a===n.id,p=n.repoUrl&&/^https?:\/\//.test(n.repoUrl);return c.jsxs("div",{className:Ne.card,"data-testid":"workspace-card",children:[c.jsxs("div",{className:Ne.cardHeader,children:[c.jsx("strong",{className:Ne.cardName,children:n.name}),c.jsxs("div",{className:Ne.cardActions,children:[c.jsx("button",{className:Ne.btnSmall,onClick:i,children:"Open"}),f?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:Ne.btnDanger,onClick:r,children:"Confirm"}),c.jsx("button",{className:Ne.btnSmall,onClick:u,children:"Cancel"})]}):c.jsx("button",{className:Ne.btnSmall,onClick:l,children:"Archive"})]})]}),n.description&&c.jsx("p",{className:Ne.cardDescription,children:n.description}),n.repoUrl&&c.jsx("div",{className:Ne.cardMeta,children:p?c.jsx("a",{href:n.repoUrl,target:"_blank",rel:"noopener noreferrer",className:Ne.repoLink,children:n.repoUrl}):c.jsx("span",{children:n.repoUrl})})]})}const cI={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function uI(){const a=Nt().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=cI[a],l=KO(i);return c.jsxs("div",{className:ol.layout,children:[c.jsx(Ki,{segments:l}),c.jsx("div",{className:ol.content,children:c.jsx("div",{className:ol.tabPanel,children:c.jsx(th,{})},a)})]})}const dI="_section_1ingb_14",fI="_sectionTitle_1ingb_26",hI="_sectionDescription_1ingb_35",pI="_tokenList_1ingb_48",mI="_tokenRow_1ingb_55",gI="_tokenBadge_1ingb_68",vI="_tokenName_1ingb_83",yI="_tokenTarget_1ingb_90",bI="_deleteButton_1ingb_99",xI="_addForm_1ingb_113",_I="_formRow_1ingb_119",SI="_input_1ingb_125",TI="_select_1ingb_155",kI="_addButton_1ingb_187",CI="_emptyStateInfo_1ingb_221",EI="_themeOptions_1ingb_229",NI="_themeOption_1ingb_229",AI="_themeOptionSelected_1ingb_254",wI="_themeOptionHeader_1ingb_259",jI="_themeOptionLabel_1ingb_266",DI="_themeOptionDesc_1ingb_273",MI="_variantToggle_1ingb_279",RI="_variantButton_1ingb_286",OI="_variantActive_1ingb_305",BI="_themeSwatches_1ingb_311",II="_themeSwatch_1ingb_311",LI="_systemToggle_1ingb_325",UI="_systemToggleHint_1ingb_341",zI="_themeActive_1ingb_348",VI="_aboutGrid_1ingb_354",HI="_aboutItem_1ingb_360",GI="_aboutLabel_1ingb_373",PI="_aboutValue_1ingb_379",$I="_aboutDot_1ingb_387",FI="_aboutDotConnected_1ingb_394",qI="_aboutDotDisconnected_1ingb_398",de={section:dI,sectionTitle:fI,sectionDescription:hI,tokenList:pI,tokenRow:mI,tokenBadge:gI,tokenName:vI,tokenTarget:yI,deleteButton:bI,addForm:xI,formRow:_I,input:SI,select:TI,addButton:kI,emptyStateInfo:CI,themeOptions:EI,themeOption:NI,themeOptionSelected:AI,themeOptionHeader:wI,themeOptionLabel:jI,themeOptionDesc:DI,variantToggle:MI,variantButton:RI,variantActive:OI,themeSwatches:BI,themeSwatch:II,systemToggle:LI,systemToggleHint:UI,themeActive:zI,aboutGrid:VI,aboutItem:HI,aboutLabel:GI,aboutValue:PI,aboutDot:$I,aboutDotConnected:FI,aboutDotDisconnected:qI},YI=[{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 KI(){const{credentialProviders:n,updateCredentialProviders:a}=We(),i=(l,r)=>{const u={...n};l==="claude"?u.claude=r:u[l]=r,a(u)};return c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Credential Providers"}),c.jsx("p",{className:de.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),c.jsx("div",{className:de.tokenList,children:YI.map(l=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenName,children:l.label}),c.jsx("span",{className:de.tokenTarget,children:l.description}),c.jsx("select",{className:de.select,value:n[l.key],onChange:r=>i(l.key,r.target.value),children:l.options.map(r=>c.jsx("option",{value:r.value,children:r.label},r.value))})]},l.key))})]})}const ZI=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function XI(){const{tokens:n,setToken:a,deleteToken:i}=We(),{showToast:l}=$i(),[r,u]=x.useState(""),[f,p]=x.useState(""),[m,g]=x.useState("env_var"),[y,v]=x.useState(""),[b,S]=x.useState(null),k=E=>{if(E.preventDefault(),!r||!f)return;const A=m==="env_var"?y||r.toUpperCase()+"_TOKEN":"";a(r,f,m,A,m==="file"?y:""),l("Token saved successfully","success"),u(""),p(""),v("")},C=E=>{S(E)},N=()=>{b&&(i(b),l("Token deleted","info")),S(null)};return c.jsxs(c.Fragment,{children:[c.jsx(wc,{isOpen:b!==null,title:"Delete Token?",description:b?`"${b}" will be permanently removed.`:void 0,onConfirm:N,onCancel:()=>S(null)}),c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Tokens"}),c.jsx("p",{className:de.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?c.jsx("div",{className:de.emptyStateInfo,children:"Add your first API token to enable service integrations."}):c.jsx("div",{className:de.tokenList,children:n.map(E=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenBadge,children:E.tokenType}),c.jsx("span",{className:de.tokenName,children:E.name}),c.jsx("span",{className:de.tokenTarget,children:E.tokenType==="env_var"?E.envVar:E.filePath}),c.jsx("button",{className:de.deleteButton,onClick:()=>C(E.name),title:`Delete ${E.name}`,children:"×"})]},E.name))}),c.jsxs("form",{className:de.addForm,onSubmit:k,children:[c.jsxs("div",{className:de.formRow,children:[c.jsx("input",{className:de.input,type:"text",placeholder:"Token name",value:r,onChange:E=>u(E.target.value)}),c.jsx("input",{className:de.input,type:"password",placeholder:"Value",value:f,onChange:E=>p(E.target.value)})]}),c.jsxs("div",{className:de.formRow,children:[c.jsx("select",{className:de.select,value:m,onChange:E=>g(E.target.value),children:ZI.map(E=>c.jsx("option",{value:E.value,children:E.label},E.value))}),c.jsx("input",{className:de.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:y,onChange:E=>v(E.target.value)}),c.jsx("button",{className:de.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function QI(){return c.jsxs(c.Fragment,{children:[c.jsx(KI,{}),c.jsx(XI,{})]})}const WI="_container_xb7ms_1",JI="_header_xb7ms_7",e5="_form_xb7ms_19",t5="_formActions_xb7ms_87",n5="_list_xb7ms_93",a5="_card_xb7ms_99",s5="_active_xb7ms_109",i5="_cardHeader_xb7ms_113",o5="_cardTitle_xb7ms_123",l5="_defaultBadge_xb7ms_129",r5="_cardActions_xb7ms_143",c5="_description_xb7ms_148",u5="_meta_xb7ms_154",d5="_promptDetails_xb7ms_171",f5="_promptText_xb7ms_183",h5="_empty_xb7ms_200",p5="_btnPrimary_xb7ms_206",m5="_btnSecondary_xb7ms_240",g5="_btnSmall_xb7ms_267",v5="_btnDanger_xb7ms_293",y5="_typeToggle_xb7ms_336",b5="_typeBadge_xb7ms_350",x5="_scriptEditor_xb7ms_364",_5="_optional_xb7ms_371",He={container:WI,header:JI,form:e5,formActions:t5,list:n5,card:a5,active:s5,cardHeader:i5,cardTitle:o5,defaultBadge:l5,cardActions:r5,description:c5,meta:u5,promptDetails:d5,promptText:f5,empty:h5,btnPrimary:p5,btnSecondary:m5,btnSmall:g5,btnDanger:v5,typeToggle:y5,typeBadge:b5,scriptEditor:x5,optional:_5};function S5(){const{personas:n,createPersona:a,updatePersona:i,deletePersona:l,appDefaultPersonaId:r,setAppDefaultPersonaId:u}=We(),[f,p]=x.useState(null),[m,g]=x.useState(!1),[y,v]=x.useState(null),[b,S]=x.useState(""),[k,C]=x.useState(""),[N,E]=x.useState(""),[A,D]=x.useState("claude-code"),[M,j]=x.useState("sonnet"),[K,q]=x.useState(0),[U,W]=x.useState("agent"),[ee,ie]=x.useState(""),$=()=>{S(""),C(""),E(""),D("claude-code"),j("sonnet"),q(0),W("agent"),ie("")},le=()=>{$(),p(null),g(!0)},F=O=>{S(O.name),C(O.description),E(O.systemPrompt);const se=O.type==="script"?"script":"agent";D(se==="script"?O.runtime||"genaiscript":O.runtime),j(O.model),q(O.maxTurns),W(se),ie(O.script||""),p(O),g(!1)},te=O=>{W(O),O==="script"?D("genaiscript"):A==="genaiscript"&&D("claude-code")},B=O=>{if(O.preventDefault(),!!b.trim()){if(U==="script"){if(!ee.trim())return}else if(!N.trim()||!A||!M)return;f?(i(f.id,b,k,N,A,M,K,U,ee),p(null)):(a(b,k,N,A,M,K,U,ee),g(!1)),$()}},H=O=>{l(O),v(null),(f==null?void 0:f.id)===O&&(p(null),$())},ae=()=>{p(null),g(!1),$()},G=()=>c.jsxs("form",{onSubmit:B,className:He.form,children:[c.jsx("h3",{children:f?"Edit Persona":"Create Persona"}),c.jsxs("div",{className:He.typeToggle,"data-testid":"persona-type-toggle",children:[c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:U==="agent",onChange:()=>te("agent")}),"Agent"]}),c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"script",checked:U==="script",onChange:()=>te("script")}),"Script"]})]}),c.jsxs("label",{children:["Name",c.jsx("input",{type:"text",value:b,onChange:O=>S(O.target.value),placeholder:U==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0})]}),c.jsxs("label",{children:["Description",c.jsx("input",{type:"text",value:k,onChange:O=>C(O.target.value),placeholder:"Brief description..."})]}),c.jsxs("label",{children:["Runtime",c.jsx("select",{value:A,onChange:O=>D(O.target.value),"data-testid":"persona-runtime-select",children:U==="script"?c.jsx("option",{value:"genaiscript",children:"genaiscript"}):c.jsxs(c.Fragment,{children:[c.jsx("option",{value:"claude-code",children:"claude-code"}),c.jsx("option",{value:"codex",children:"codex"}),c.jsx("option",{value:"copilot",children:"copilot"}),c.jsx("option",{value:"goose",children:"goose"}),c.jsx("option",{value:"stub",children:"stub"}),c.jsx("option",{value:"claude-code-acp",children:"claude-code-acp (experimental)"}),c.jsx("option",{value:"codex-acp",children:"codex-acp (experimental)"}),c.jsx("option",{value:"copilot-acp",children:"copilot-acp (experimental)"})]})})]}),U==="agent"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model",c.jsx("input",{type:"text",value:M,onChange:O=>j(O.target.value),placeholder:"e.g. sonnet"})]}),c.jsxs("label",{children:["Max Turns",c.jsx("input",{type:"number",value:K,onChange:O=>q(parseInt(O.target.value,10)||0),min:0})]}),c.jsxs("label",{children:["System Prompt",c.jsx("textarea",{value:N,onChange:O=>E(O.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]})]}),U==="script"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model ",c.jsx("span",{className:He.optional,children:"(optional)"}),c.jsx("input",{type:"text",value:M,onChange:O=>j(O.target.value),placeholder:"e.g. sonnet (leave empty for script-only)"})]}),c.jsxs("label",{children:["System Prompt ",c.jsx("span",{className:He.optional,children:"(optional)"}),c.jsx("textarea",{value:N,onChange:O=>E(O.target.value),placeholder:"Optional context for the script...",rows:4})]}),c.jsxs("label",{children:["Script",c.jsx("textarea",{value:ee,onChange:O=>ie(O.target.value),placeholder:`script({ model: "openai:gpt-4o" });
|
|
105
|
-
|
|
106
|
-
const grackle = await host.mcpServer({
|
|
107
|
-
id: "grackle",
|
|
108
|
-
url: env.vars.GRACKLE_MCP_URL,
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
$\`Summarize the current tasks.\`;`,rows:20,className:He.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),c.jsxs("div",{className:He.formActions,children:[c.jsx("button",{type:"submit",className:He.btnPrimary,children:f?"Save":"Create"}),c.jsx("button",{type:"button",onClick:ae,className:He.btnSecondary,children:"Cancel"})]})]});return c.jsxs("div",{className:He.container,children:[c.jsxs("div",{className:He.header,children:[c.jsx("h2",{children:"Personas"}),c.jsx("button",{onClick:le,className:He.btnPrimary,children:"+ New Persona"})]}),(m||f)&&G(),n.length===0&&!m?c.jsx("p",{className:He.empty,children:"No personas yet. Create one to get started."}):c.jsx("div",{className:He.list,children:n.map(O=>{const se=r===O.id,ye=O.type==="script";return c.jsxs("div",{className:`${He.card} ${(f==null?void 0:f.id)===O.id?He.active:""}`,"data-testid":`persona-card-${O.id}`,children:[c.jsxs("div",{className:He.cardHeader,children:[c.jsxs("span",{className:He.cardTitle,children:[c.jsx("strong",{children:O.name}),c.jsx("span",{className:He.typeBadge,"data-testid":`persona-type-badge-${O.id}`,children:ye?"Script":"Agent"}),se&&c.jsx("span",{className:He.defaultBadge,"data-testid":`persona-default-badge-${O.id}`,children:"App Default"})]}),c.jsxs("div",{className:He.cardActions,children:[!se&&c.jsx("button",{onClick:()=>u(O.id),className:He.btnSmall,"data-testid":`persona-set-default-${O.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>F(O),className:He.btnSmall,children:"Edit"}),y===O.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>H(O.id),className:He.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>v(null),className:He.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>v(O.id),className:He.btnSmall,children:"Delete"})]})]}),O.description&&c.jsx("p",{className:He.description,children:O.description}),c.jsxs("div",{className:He.meta,children:[O.runtime&&c.jsxs("span",{children:["Runtime: ",O.runtime]}),O.model&&c.jsxs("span",{children:["Model: ",O.model]}),O.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",O.maxTurns]})]}),ye?c.jsxs("details",{className:He.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:He.promptText,children:O.script})]}):c.jsxs("details",{className:He.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:He.promptText,children:O.systemPrompt})]})]},O.id)})})]})}function T5(){return c.jsx(S5,{})}function k5(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:l,setPreferSystem:r}=Sb();return c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Appearance"}),c.jsx("p",{className:de.sectionDescription,children:"Choose how Grackle looks across the app."}),c.jsx("div",{className:de.themeOptions,children:Sc.filter(u=>!u.hidden).map(u=>{const f=!!(u.variantLightId&&u.variantDarkId),p=f?n===u.id||n===u.variantLightId||n===u.variantDarkId:n===u.id,m=f&&a===u.variantLightId;return c.jsxs("button",{type:"button",className:`${de.themeOption} ${p?de.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(u.id),children:[c.jsxs("span",{className:de.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:de.themeOptionLabel,children:u.label}),c.jsx("span",{className:de.themeOptionDesc,children:u.description})]}),f&&c.jsxs("span",{className:de.variantToggle,children:[c.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${p&&m?de.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),c.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${p&&!m?de.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),u.swatches&&c.jsx("span",{className:de.themeSwatches,children:u.swatches.map((g,y)=>c.jsx("span",{className:de.themeSwatch,style:{background:g}},y))})]},u.id)})}),c.jsxs("label",{className:de.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:l,onChange:u=>r(u.target.checked)}),c.jsx("span",{children:"Match system light/dark preference"})]}),c.jsx("p",{className:de.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),c.jsxs("p",{className:de.themeActive,children:["Active theme: ",c.jsx("strong",{children:a})]})]})}function C5(){return c.jsx(k5,{})}function E5(){const{connected:n,environments:a,sessions:i}=We(),l=a.filter(f=>f.status==="connected").length,r=a.length,u=i.filter(f=>["running","idle"].includes(f.status)).length;return c.jsxs("section",{className:de.section,"data-testid":"about-panel",children:[c.jsx("h3",{className:de.sectionTitle,children:"About"}),c.jsx("p",{className:de.sectionDescription,children:"Connection status and application information."}),c.jsxs("div",{className:de.aboutGrid,children:[c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Connection"}),c.jsxs("span",{className:de.aboutValue,children:[c.jsx("span",{className:`${de.aboutDot} ${n?de.aboutDotConnected:de.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Environments"}),c.jsxs("span",{className:de.aboutValue,children:[l,"/",r," connected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Active Sessions"}),c.jsx("span",{className:de.aboutValue,children:u})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Version"}),c.jsx("span",{className:de.aboutValue,children:"0.70.4"})]})]})]})}function N5(){return c.jsx(E5,{})}const A5="_wizard_1260s_1",w5="_container_1260s_10",j5="_stepContent_1260s_19",D5="_logoArea_1260s_28",M5="_logoImage_1260s_32",R5="_heading_1260s_41",O5="_tagline_1260s_49",B5="_subtitle_1260s_56",I5="_featureList_1260s_64",L5="_runtimeGrid_1260s_89",U5="_runtimeCard_1260s_101",z5="_runtimeName_1260s_133",V5="_runtimeDescription_1260s_139",H5="_buttonRow_1260s_144",G5="_primaryButton_1260s_151",P5="_ghostButton_1260s_185",$5="_dots_1260s_213",F5="_dot_1260s_213",et={wizard:A5,container:w5,stepContent:j5,logoArea:D5,logoImage:M5,heading:R5,tagline:O5,subtitle:B5,featureList:I5,runtimeGrid:L5,runtimeCard:U5,runtimeName:z5,runtimeDescription:V5,buttonRow:H5,primaryButton:G5,ghostButton:P5,dots:$5,dot:F5};function q5({onNext:n}){return c.jsxs("div",{className:et.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:et.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:et.logoImage})}),c.jsx("h1",{className:et.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:et.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:et.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function Y5({onNext:n,onBack:a}){return c.jsxs("div",{className:et.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:et.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:et.featureList,children:[c.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),c.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),c.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),c.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),c.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),c.jsxs("div",{className:et.buttonRow,children:[c.jsx("button",{type:"button",className:et.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:et.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const K5=[{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 Z5({currentRuntime:n,onFinish:a,onBack:i,finishDisabled:l}){const[r,u]=x.useState(n||"claude-code");return x.useEffect(()=>{n&&u(n)},[n]),c.jsxs("div",{className:et.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:et.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:et.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:et.runtimeGrid,children:K5.map(f=>c.jsxs("button",{type:"button",className:et.runtimeCard,"data-selected":r===f.id,"aria-pressed":r===f.id,"data-testid":`runtime-card-${f.id}`,onClick:()=>u(f.id),children:[c.jsx("span",{className:et.runtimeName,children:f.name}),c.jsx("span",{className:et.runtimeDescription,children:f.description})]},f.id))}),c.jsxs("div",{className:et.buttonRow,children:[c.jsx("button",{type:"button",className:et.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:et.primaryButton,onClick:()=>a(r),disabled:l,"data-testid":"setup-finish",children:"Finish"})]})]})}const X5=3,K0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function Q5(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:l}=We(),r=Ht(),[u,f]=x.useState(0),p=n.find(g=>g.id==="claude-code"),m=x.useCallback(g=>{if(p&&g!==p.runtime){const v=K0[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,v)}const y=n.find(v=>v.id===N0);if(y&&g!==y.runtime){const v=K0[g]??"sonnet";a(N0,void 0,void 0,void 0,g,v)}i(),r("/",{replace:!0})},[p,n,a,i,r]);return l===!0?c.jsx(Gn,{to:"/",replace:!0}):c.jsx("div",{className:et.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:et.container,children:[c.jsx(Zn,{mode:"wait",children:c.jsxs(kt.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&c.jsx(q5,{onNext:()=>f(1)}),u===1&&c.jsx(Y5,{onNext:()=>f(2),onBack:()=>f(0)}),u===2&&c.jsx(Z5,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>f(1),finishDisabled:!p})]},u)}),c.jsx("div",{className:et.dots,children:Array.from({length:X5},(g,y)=>c.jsx("span",{className:et.dot,"data-active":y===u},y))})]})})}const W5="_root_zndgp_1",J5="_body_zndgp_7",eL="_main_zndgp_19",tL="_sidebarWrapper_zndgp_26",nL="_overlay_zndgp_51",Ko={root:W5,body:J5,main:eL,sidebarWrapper:tL,overlay:nL},aL=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function sL(){const{lastSpawnedId:n,environments:a,connected:i,onboardingCompleted:l}=We(),{showToast:r}=$i();$M(a,r);const u=Ht(),f=Nt(),[p,m]=x.useState(!1),g=x.useCallback(()=>m(y=>!y),[]);return x.useEffect(()=>{m(!1)},[f.pathname]),x.useEffect(()=>{if(!p)return;const y=v=>{v.key==="Escape"&&m(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[p]),x.useEffect(()=>{n&&!f.pathname.includes("/tasks/")&&u(pb(n),{replace:!0})},[n,u,f.pathname]),i&&l===!1?c.jsx(Gn,{to:"/setup",replace:!0}):c.jsxs("div",{className:Ko.root,children:[c.jsx(IC,{onToggleSidebar:g,sidebarOpen:p}),c.jsx(GC,{}),c.jsxs("div",{className:Ko.body,children:[c.jsx("div",{className:Ko.sidebarWrapper,"data-sidebar-open":p,children:c.jsx(oD,{})}),p&&c.jsx("div",{className:Ko.overlay,"data-testid":"drawer-overlay",onClick:()=>m(!1)}),c.jsxs("div",{className:Ko.main,children:[c.jsx(th,{}),c.jsx(pD,{})]})]}),c.jsx(ND,{})]})}function vf(){const{workspaceId:n}=ns(),{workspaces:a}=We(),i=Nt(),l=a.find(m=>m.id===n);if(!(l!=null&&l.environmentId))return a.length===0?void 0:c.jsx(Gn,{to:"/environments",replace:!0});const r=encodeURIComponent(n),u=`/workspaces/${r}`,f=i.pathname.startsWith(u)?i.pathname.slice(u.length):"",p=`/environments/${encodeURIComponent(l.environmentId)}/workspaces/${r}${f}${i.search}${i.hash}`;return c.jsx(Gn,{to:p,replace:!0})}function iL(){return c.jsxs(ck,{children:[c.jsx(je,{path:"setup",element:c.jsx(Q5,{})}),c.jsxs(je,{element:c.jsx(sL,{}),children:[c.jsx(je,{index:!0,element:c.jsx(vO,{})}),c.jsx(je,{path:"chat",element:c.jsx(qO,{})}),c.jsx(je,{path:"tasks",element:c.jsx(mO,{})}),c.jsx(je,{path:"tasks/new",element:c.jsx($0,{})}),c.jsx(je,{path:"tasks/:taskId",element:c.jsx(Ni,{})}),c.jsx(je,{path:"tasks/:taskId/stream",element:c.jsx(Ni,{})}),c.jsx(je,{path:"tasks/:taskId/findings",element:c.jsx(Ni,{})}),c.jsx(je,{path:"tasks/:taskId/edit",element:c.jsx(F0,{})}),c.jsx(je,{path:"workspaces",element:c.jsx(Gn,{to:"/environments",replace:!0})}),c.jsx(je,{path:"workspaces/:workspaceId",element:c.jsx(vf,{})}),c.jsx(je,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(vf,{})}),c.jsx(je,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:c.jsx(vf,{})}),c.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId",element:c.jsx(SB,{})}),c.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:c.jsx($0,{})}),c.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Ni,{})}),c.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(Ni,{})}),c.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(Ni,{})}),c.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(F0,{})}),c.jsx(je,{path:"sessions/new",element:c.jsx(e6,{})}),c.jsx(je,{path:"sessions/:sessionId",element:c.jsx(a6,{})}),c.jsxs(je,{path:"environments",element:c.jsx(D4,{}),children:[c.jsx(je,{index:!0,element:c.jsx(gO,{})}),c.jsx(je,{path:"new",element:c.jsx(E4,{})}),c.jsx(je,{path:":environmentId",element:c.jsx(lI,{})}),c.jsx(je,{path:":environmentId/edit",element:c.jsx(N4,{})})]}),c.jsxs(je,{path:"settings",element:c.jsx(uI,{}),children:[c.jsx(je,{index:!0,element:c.jsx(Gn,{to:"credentials",replace:!0})}),c.jsx(je,{path:"environments",element:c.jsx(Gn,{to:"/environments",replace:!0})}),c.jsx(je,{path:"credentials",element:c.jsx(QI,{})}),c.jsx(je,{path:"tokens",element:c.jsx(Gn,{to:"../credentials",replace:!0})}),c.jsx(je,{path:"personas",element:c.jsx(T5,{})}),c.jsx(je,{path:"appearance",element:c.jsx(C5,{})}),c.jsx(je,{path:"about",element:c.jsx(N5,{})})]}),c.jsx(je,{path:"*",element:c.jsx(Gn,{to:"/",replace:!0})})]})]})}const oL=1e4;function lL(){const{onboardingCompleted:n}=We(),[a,i]=x.useState(!1);x.useEffect(()=>{if(n!==void 0)return;const r=setTimeout(()=>i(!0),oL);return()=>clearTimeout(r)},[n]);const l=n===void 0&&!a;return c.jsx(Zn,{mode:"wait",children:l?c.jsx(kt.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(PM,{})},"splash"):c.jsx(kt.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(Ok,{children:c.jsx(iL,{})})},"app")})}function rL(){const n=aL?xC:dC;return c.jsx(EC,{children:c.jsx(SC,{children:c.jsx(n,{children:c.jsx(lL,{})})})})}QS.createRoot(document.getElementById("root")).render(c.jsx(x.StrictMode,{children:c.jsx(rL,{})}));
|