@grackle-ai/web 0.58.0 → 0.59.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,100 +0,0 @@
1
- import{r as DS,a as _,j as c,v as MS,b as RS,t as Ir,i as OS,f as BS,M as Yf,c as Kf}from"./markdown-gcy1Jmzi.js";import{r as IS,d as Gv,H as Pv,P as Fv,i as LS,B as US,a as zS,C as VS,M as HS}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"]'))o(r);new MutationObserver(r=>{for(const f of r)if(f.type==="childList")for(const u of f.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&o(u)}).observe(document,{childList:!0,subtree:!0});function i(r){const f={};return r.integrity&&(f.integrity=r.integrity),r.referrerPolicy&&(f.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?f.credentials="include":r.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(r){if(r.ep)return;r.ep=!0;const f=i(r);fetch(r.href,f)}})();var Ud={exports:{}},Vl={},zd={exports:{}},Vd={};/**
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 $v;function GS(){return $v||($v=1,(function(n){function a(I,D){var ne=I.length;I.push(D);e:for(;0<ne;){var oe=ne-1>>>1,z=I[oe];if(0<r(z,D))I[oe]=D,I[ne]=z,ne=oe;else break e}}function i(I){return I.length===0?null:I[0]}function o(I){if(I.length===0)return null;var D=I[0],ne=I.pop();if(ne!==D){I[0]=ne;e:for(var oe=0,z=I.length,J=z>>>1;oe<J;){var Se=2*(oe+1)-1,ae=I[Se],pe=Se+1,qe=I[pe];if(0>r(ae,ne))pe<z&&0>r(qe,ae)?(I[oe]=qe,I[pe]=ne,oe=pe):(I[oe]=ae,I[Se]=ne,oe=Se);else if(pe<z&&0>r(qe,ne))I[oe]=qe,I[pe]=ne,oe=pe;else break e}}return D}function r(I,D){var ne=I.sortIndex-D.sortIndex;return ne!==0?ne:I.id-D.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var u=Date,p=u.now();n.unstable_now=function(){return u.now()-p}}var m=[],g=[],y=1,v=null,b=3,S=!1,k=!1,E=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function B(I){for(var D=i(g);D!==null;){if(D.callback===null)o(g);else if(D.startTime<=I)o(g),D.sortIndex=D.expirationTime,a(m,D);else break;D=i(g)}}function U(I){if(E=!1,B(I),!k)if(i(m)!==null)k=!0,q||(q=!0,se());else{var D=i(g);D!==null&&ie(U,D.startTime-I)}}var q=!1,M=-1,R=5,F=-1;function ee(){return N?!0:!(n.unstable_now()-F<R)}function te(){if(N=!1,q){var I=n.unstable_now();F=I;var D=!0;try{e:{k=!1,E&&(E=!1,A(M),M=-1),S=!0;var ne=b;try{t:{for(B(I),v=i(m);v!==null&&!(v.expirationTime>I&&ee());){var oe=v.callback;if(typeof oe=="function"){v.callback=null,b=v.priorityLevel;var z=oe(v.expirationTime<=I);if(I=n.unstable_now(),typeof z=="function"){v.callback=z,B(I),D=!0;break t}v===i(m)&&o(m),B(I)}else o(m);v=i(m)}if(v!==null)D=!0;else{var J=i(g);J!==null&&ie(U,J.startTime-I),D=!1}}break e}finally{v=null,b=ne,S=!1}D=void 0}}finally{D?se():q=!1}}}var se;if(typeof O=="function")se=function(){O(te)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,Q=re.port2;re.port1.onmessage=te,se=function(){Q.postMessage(null)}}else se=function(){C(te,0)};function ie(I,D){M=C(function(){I(n.unstable_now())},D)}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(I){I.callback=null},n.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<I?Math.floor(1e3/I):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(I){switch(b){case 1:case 2:case 3:var D=3;break;default:D=b}var ne=b;b=D;try{return I()}finally{b=ne}},n.unstable_requestPaint=function(){N=!0},n.unstable_runWithPriority=function(I,D){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var ne=b;b=I;try{return D()}finally{b=ne}},n.unstable_scheduleCallback=function(I,D,ne){var oe=n.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?oe+ne:oe):ne=oe,I){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=ne+z,I={id:y++,callback:D,priorityLevel:I,startTime:ne,expirationTime:z,sortIndex:-1},ne>oe?(I.sortIndex=ne,a(g,I),i(m)===null&&I===i(g)&&(E?(A(M),M=-1):E=!0,ie(U,ne-oe))):(I.sortIndex=z,a(m,I),k||S||(k=!0,q||(q=!0,se()))),I},n.unstable_shouldYield=ee,n.unstable_wrapCallback=function(I){var D=b;return function(){var ne=b;b=D;try{return I.apply(this,arguments)}finally{b=ne}}}})(Vd)),Vd}var qv;function PS(){return qv||(qv=1,zd.exports=GS()),zd.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 Yv;function FS(){if(Yv)return Vl;Yv=1;var n=PS(),a=DS(),i=IS();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(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 u(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(f(e)!==e)throw Error(o(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,l=t;;){var d=s.return;if(d===null)break;var h=d.alternate;if(h===null){if(l=d.return,l!==null){s=l;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===s)return m(d),e;if(h===l)return m(d),t;h=h.sibling}throw Error(o(188))}if(s.return!==l.return)s=d,l=h;else{for(var x=!1,T=d.child;T;){if(T===s){x=!0,s=d,l=h;break}if(T===l){x=!0,l=d,s=h;break}T=T.sibling}if(!x){for(T=h.child;T;){if(T===s){x=!0,s=h,l=d;break}if(T===l){x=!0,l=h,s=d;break}T=T.sibling}if(!x)throw Error(o(189))}}if(s.alternate!==l)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:t}function 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"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),O=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=te&&e[te]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case U:return"Suspense";case q:return"SuspenseList";case F:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case O:return e.displayName||"Context";case A:return(e._context.displayName||"Context")+".Consumer";case B:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M:return t=e.displayName||null,t!==null?t:Q(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}var ie=Array.isArray,I=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},oe=[],z=-1;function J(e){return{current:e}}function Se(e){0>z||(e.current=oe[z],oe[z]=null,z--)}function ae(e,t){z++,oe[z]=e.current,e.current=t}var pe=J(null),qe=J(null),Ot=J(null),vn=J(null);function _t(e,t){switch(ae(Ot,t),ae(qe,e),ae(pe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dv(t),e=fv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Se(pe),ae(pe,e)}function ge(){Se(pe),Se(qe),Se(Ot)}function dt(e){e.memoizedState!==null&&ae(vn,e);var t=pe.current,s=fv(t,e.type);t!==s&&(ae(qe,e),ae(pe,s))}function On(e){qe.current===e&&(Se(pe),Se(qe)),vn.current===e&&(Se(vn),Il._currentValue=ne)}var Jn,Ze;function Te(e){if(Jn===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Jn=t&&t[1]||"",Ze=-1<s.stack.indexOf(`
18
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
19
- `+Jn+e+Ze}var et=!1;function yn(e,t){if(!e||et)return"";et=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch($){var P=$}Reflect.construct(e,[],X)}else{try{X.call()}catch($){P=$}e.call(X.prototype)}}else{try{throw Error()}catch($){P=$}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch($){if($&&P&&typeof $.stack=="string")return[$.stack,P.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),x=h[0],T=h[1];if(x&&T){var j=x.split(`
20
- `),G=T.split(`
21
- `);for(d=l=0;l<j.length&&!j[l].includes("DetermineComponentFrameRoot");)l++;for(;d<G.length&&!G[d].includes("DetermineComponentFrameRoot");)d++;if(l===j.length||d===G.length)for(l=j.length-1,d=G.length-1;1<=l&&0<=d&&j[l]!==G[d];)d--;for(;1<=l&&0<=d;l--,d--)if(j[l]!==G[d]){if(l!==1||d!==1)do if(l--,d--,0>d||j[l]!==G[d]){var Y=`
22
- `+j[l].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=l&&0<=d);break}}}finally{et=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Te(s):""}function Le(e,t){switch(e.tag){case 26:case 27:case 5:return Te(e.type);case 16:return Te("Lazy");case 13:return e.child!==t&&t!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return yn(e.type,!1);case 11:return yn(e.type.render,!1);case 1:return yn(e.type,!0);case 31:return Te("Activity");default:return""}}function zn(e){try{var t="",s=null;do t+=Le(e,s),s=e,e=e.return;while(e);return t}catch(l){return`
23
- Error generating stack: `+l.message+`
24
- `+l.stack}}var Vn=Object.prototype.hasOwnProperty,zs=n.unstable_scheduleCallback,Vs=n.unstable_cancelCallback,_o=n.unstable_shouldYield,So=n.unstable_requestPaint,Ht=n.unstable_now,kc=n.unstable_getCurrentPriorityLevel,Z=n.unstable_ImmediatePriority,le=n.unstable_UserBlockingPriority,ce=n.unstable_NormalPriority,_e=n.unstable_LowPriority,xe=n.unstable_IdlePriority,tt=n.log,Ne=n.unstable_setDisableYieldValue,vt=null,Ae=null;function ft(e){if(typeof tt=="function"&&Ne(e),Ae&&typeof Ae.setStrictMode=="function")try{Ae.setStrictMode(vt,e)}catch{}}var Xe=Math.clz32?Math.clz32:Gt,qt=Math.log,an=Math.LN2;function Gt(e){return e>>>=0,e===0?32:31-(qt(e)/an|0)|0}var Ea=256,bn=262144,Na=4194304;function cs(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 To(e,t,s){var l=e.pendingLanes;if(l===0)return 0;var d=0,h=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var T=l&134217727;return T!==0?(l=T&~h,l!==0?d=cs(l):(x&=T,x!==0?d=cs(x):s||(s=T&~e,s!==0&&(d=cs(s))))):(T=l&~h,T!==0?d=cs(T):x!==0?d=cs(x):s||(s=l&~e,s!==0&&(d=cs(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 Zi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function y_(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 qh(){var e=Na;return Na<<=1,(Na&62914560)===0&&(Na=4194304),e}function Ec(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Xi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function b_(e,t,s,l,d,h){var x=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,j=e.expirationTimes,G=e.hiddenUpdates;for(s=x&~s;0<s;){var Y=31-Xe(s),X=1<<Y;T[Y]=0,j[Y]=-1;var P=G[Y];if(P!==null)for(G[Y]=null,Y=0;Y<P.length;Y++){var $=P[Y];$!==null&&($.lane&=-536870913)}s&=~X}l!==0&&Yh(e,l,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(x&~t))}function Yh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Xe(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function Kh(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var l=31-Xe(s),d=1<<l;d&t|e[l]&t&&(e[l]|=t),s&=~d}}function Zh(e,t){var s=t&-t;return s=(s&42)!==0?1:Nc(s),(s&(e.suspendedLanes|t))!==0?0:s}function Nc(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 Ac(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xh(){var e=D.p;return e!==0?e:(e=window.event,e===void 0?32:Bv(e.type))}function Qh(e,t){var s=D.p;try{return D.p=e,t()}finally{D.p=s}}var Aa=Math.random().toString(36).slice(2),Bt="__reactFiber$"+Aa,Xt="__reactProps$"+Aa,Hs="__reactContainer$"+Aa,jc="__reactEvents$"+Aa,x_="__reactListeners$"+Aa,__="__reactHandles$"+Aa,Wh="__reactResources$"+Aa,Qi="__reactMarker$"+Aa;function wc(e){delete e[Bt],delete e[Xt],delete e[jc],delete e[x_],delete e[__]}function Gs(e){var t=e[Bt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Hs]||s[Bt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=bv(e);e!==null;){if(s=e[Bt])return s;e=bv(e)}return t}e=s,s=e.parentNode}return null}function Ps(e){if(e=e[Bt]||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 Wi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Fs(e){var t=e[Wh];return t||(t=e[Wh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function wt(e){e[Qi]=!0}var Jh=new Set,ep={};function us(e,t){$s(e,t),$s(e+"Capture",t)}function $s(e,t){for(ep[e]=t,e=0;e<t.length;e++)Jh.add(t[e])}var S_=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]*$"),tp={},np={};function T_(e){return Vn.call(np,e)?!0:Vn.call(tp,e)?!1:S_.test(e)?np[e]=!0:(tp[e]=!0,!1)}function Co(e,t,s){if(T_(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function ko(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 ea(e,t,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+l)}}function xn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ap(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function C_(e,t,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,h=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(x){s=""+x,h.call(this,x)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(x){s=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Dc(e){if(!e._valueTracker){var t=ap(e)?"checked":"value";e._valueTracker=C_(e,t,""+e[t])}}function sp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),l="";return e&&(l=ap(e)?e.checked?"true":"false":e.value),e=l,e!==s?(t.setValue(e),!0):!1}function Eo(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 k_=/[\n"\\]/g;function _n(e){return e.replace(k_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Mc(e,t,s,l,d,h,x,T){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xn(t)):e.value!==""+xn(t)&&(e.value=""+xn(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?Rc(e,x,xn(t)):s!=null?Rc(e,x,xn(s)):l!=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=""+xn(T):e.removeAttribute("name")}function ip(e,t,s,l,d,h,x,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)){Dc(e);return}s=s!=null?""+xn(s):"",t=t!=null?""+xn(t):s,T||t===e.value||(e.value=t),e.defaultValue=t}l=l??d,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=T?e.checked:!!l,e.defaultChecked=!!l,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Dc(e)}function Rc(e,t,s){t==="number"&&Eo(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function qs(e,t,s,l){if(e=e.options,t){t={};for(var d=0;d<s.length;d++)t["$"+s[d]]=!0;for(s=0;s<e.length;s++)d=t.hasOwnProperty("$"+e[s].value),e[s].selected!==d&&(e[s].selected=d),d&&l&&(e[s].defaultSelected=!0)}else{for(s=""+xn(s),t=null,d=0;d<e.length;d++){if(e[d].value===s){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function lp(e,t,s){if(t!=null&&(t=""+xn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+xn(s):""}function op(e,t,s,l){if(t==null){if(l!=null){if(s!=null)throw Error(o(92));if(ie(l)){if(1<l.length)throw Error(o(93));l=l[0]}s=l}s==null&&(s=""),t=s}s=xn(t),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),Dc(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 E_=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 rp(e,t,s){var l=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,s):typeof s!="number"||s===0||E_.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function cp(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var d in t)l=t[d],t.hasOwnProperty(d)&&s[d]!==l&&rp(e,d,l)}else for(var h in t)t.hasOwnProperty(h)&&rp(e,h,t[h])}function Oc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var N_=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"]]),A_=/^[\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 No(e){return A_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ta(){}var Bc=null;function Ic(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 up(e){var t=Ps(e);if(t&&(e=t.stateNode)){var s=e[Xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Mc(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="'+_n(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var l=s[t];if(l!==e&&l.form===e.form){var d=l[Xt]||null;if(!d)throw Error(o(90));Mc(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<s.length;t++)l=s[t],l.form===e.form&&sp(l)}break e;case"textarea":lp(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&qs(e,!!s.multiple,t,!1)}}}var Lc=!1;function dp(e,t,s){if(Lc)return e(t,s);Lc=!0;try{var l=e(t);return l}finally{if(Lc=!1,(Ks!==null||Zs!==null)&&(pr(),Ks&&(t=Ks,e=Zs,Zs=Ks=null,up(t),e)))for(t=0;t<e.length;t++)up(e[t])}}function Ji(e,t){var s=e.stateNode;if(s===null)return null;var l=s[Xt]||null;if(l===null)return null;s=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var na=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uc=!1;if(na)try{var el={};Object.defineProperty(el,"passive",{get:function(){Uc=!0}}),window.addEventListener("test",el,el),window.removeEventListener("test",el,el)}catch{Uc=!1}var ja=null,zc=null,Ao=null;function fp(){if(Ao)return Ao;var e,t=zc,s=t.length,l,d="value"in ja?ja.value:ja.textContent,h=d.length;for(e=0;e<s&&t[e]===d[e];e++);var x=s-e;for(l=1;l<=x&&t[s-l]===d[h-l];l++);return Ao=d.slice(e,1<l?1-l:void 0)}function jo(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 wo(){return!0}function hp(){return!1}function Qt(e){function t(s,l,d,h,x){this._reactName=s,this._targetInst=d,this.type=l,this.nativeEvent=h,this.target=x,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)?wo:hp,this.isPropagationStopped=hp,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=wo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=wo)},persist:function(){},isPersistent:wo}),t}var ds={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Do=Qt(ds),tl=v({},ds,{view:0,detail:0}),j_=Qt(tl),Vc,Hc,nl,Mo=v({},tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pc,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!==nl&&(nl&&e.type==="mousemove"?(Vc=e.screenX-nl.screenX,Hc=e.screenY-nl.screenY):Hc=Vc=0,nl=e),Vc)},movementY:function(e){return"movementY"in e?e.movementY:Hc}}),pp=Qt(Mo),w_=v({},Mo,{dataTransfer:0}),D_=Qt(w_),M_=v({},tl,{relatedTarget:0}),Gc=Qt(M_),R_=v({},ds,{animationName:0,elapsedTime:0,pseudoElement:0}),O_=Qt(R_),B_=v({},ds,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),I_=Qt(B_),L_=v({},ds,{data:0}),mp=Qt(L_),U_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},z_={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},V_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function H_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=V_[e])?!!t[e]:!1}function Pc(){return H_}var G_=v({},tl,{key:function(e){if(e.key){var t=U_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=jo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?z_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pc,charCode:function(e){return e.type==="keypress"?jo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?jo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),P_=Qt(G_),F_=v({},Mo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gp=Qt(F_),$_=v({},tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pc}),q_=Qt($_),Y_=v({},ds,{propertyName:0,elapsedTime:0,pseudoElement:0}),K_=Qt(Y_),Z_=v({},Mo,{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}),X_=Qt(Z_),Q_=v({},ds,{newState:0,oldState:0}),W_=Qt(Q_),J_=[9,13,27,32],Fc=na&&"CompositionEvent"in window,al=null;na&&"documentMode"in document&&(al=document.documentMode);var e1=na&&"TextEvent"in window&&!al,vp=na&&(!Fc||al&&8<al&&11>=al),yp=" ",bp=!1;function xp(e,t){switch(e){case"keyup":return J_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _p(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xs=!1;function t1(e,t){switch(e){case"compositionend":return _p(t);case"keypress":return t.which!==32?null:(bp=!0,yp);case"textInput":return e=t.data,e===yp&&bp?null:e;default:return null}}function n1(e,t){if(Xs)return e==="compositionend"||!Fc&&xp(e,t)?(e=fp(),Ao=zc=ja=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 vp&&t.locale!=="ko"?null:t.data;default:return null}}var a1={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 Sp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!a1[e.type]:t==="textarea"}function Tp(e,t,s,l){Ks?Zs?Zs.push(l):Zs=[l]:Ks=l,t=_r(t,"onChange"),0<t.length&&(s=new Do("onChange","change",null,s,l),e.push({event:s,listeners:t}))}var sl=null,il=null;function s1(e){iv(e,0)}function Ro(e){var t=Wi(e);if(sp(t))return e}function Cp(e,t){if(e==="change")return t}var kp=!1;if(na){var $c;if(na){var qc="oninput"in document;if(!qc){var Ep=document.createElement("div");Ep.setAttribute("oninput","return;"),qc=typeof Ep.oninput=="function"}$c=qc}else $c=!1;kp=$c&&(!document.documentMode||9<document.documentMode)}function Np(){sl&&(sl.detachEvent("onpropertychange",Ap),il=sl=null)}function Ap(e){if(e.propertyName==="value"&&Ro(il)){var t=[];Tp(t,il,e,Ic(e)),dp(s1,t)}}function i1(e,t,s){e==="focusin"?(Np(),sl=t,il=s,sl.attachEvent("onpropertychange",Ap)):e==="focusout"&&Np()}function l1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ro(il)}function o1(e,t){if(e==="click")return Ro(t)}function r1(e,t){if(e==="input"||e==="change")return Ro(t)}function c1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sn=typeof Object.is=="function"?Object.is:c1;function ll(e,t){if(sn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var d=s[l];if(!Vn.call(t,d)||!sn(e[d],t[d]))return!1}return!0}function jp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wp(e,t){var s=jp(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=t&&l>=t)return{node:s,offset:t-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=jp(s)}}function Dp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Eo(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=Eo(e.document)}return t}function Yc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var u1=na&&"documentMode"in document&&11>=document.documentMode,Qs=null,Kc=null,ol=null,Zc=!1;function Rp(e,t,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Zc||Qs==null||Qs!==Eo(l)||(l=Qs,"selectionStart"in l&&Yc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ol&&ll(ol,l)||(ol=l,l=_r(Kc,"onSelect"),0<l.length&&(t=new Do("onSelect","select",null,t,s),e.push({event:t,listeners:l}),t.target=Qs)))}function fs(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Ws={animationend:fs("Animation","AnimationEnd"),animationiteration:fs("Animation","AnimationIteration"),animationstart:fs("Animation","AnimationStart"),transitionrun:fs("Transition","TransitionRun"),transitionstart:fs("Transition","TransitionStart"),transitioncancel:fs("Transition","TransitionCancel"),transitionend:fs("Transition","TransitionEnd")},Xc={},Op={};na&&(Op=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 hs(e){if(Xc[e])return Xc[e];if(!Ws[e])return e;var t=Ws[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Op)return Xc[e]=t[s];return e}var Bp=hs("animationend"),Ip=hs("animationiteration"),Lp=hs("animationstart"),d1=hs("transitionrun"),f1=hs("transitionstart"),h1=hs("transitioncancel"),Up=hs("transitionend"),zp=new Map,Qc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Qc.push("scrollEnd");function Bn(e,t){zp.set(e,t),us(t,[e])}var Oo=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)},Sn=[],Js=0,Wc=0;function Bo(){for(var e=Js,t=Wc=Js=0;t<e;){var s=Sn[t];Sn[t++]=null;var l=Sn[t];Sn[t++]=null;var d=Sn[t];Sn[t++]=null;var h=Sn[t];if(Sn[t++]=null,l!==null&&d!==null){var x=l.pending;x===null?d.next=d:(d.next=x.next,x.next=d),l.pending=d}h!==0&&Vp(s,d,h)}}function Io(e,t,s,l){Sn[Js++]=e,Sn[Js++]=t,Sn[Js++]=s,Sn[Js++]=l,Wc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Jc(e,t,s,l){return Io(e,t,s,l),Lo(e)}function ps(e,t){return Io(e,null,null,t),Lo(e)}function Vp(e,t,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var d=!1,h=e.return;h!==null;)h.childLanes|=s,l=h.alternate,l!==null&&(l.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&t!==null&&(d=31-Xe(s),e=h.hiddenUpdates,l=e[d],l===null?e[d]=[t]:l.push(t),t.lane=s|536870912),h):null}function Lo(e){if(50<jl)throw jl=0,rd=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ei={};function p1(e,t,s,l){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ln(e,t,s,l){return new p1(e,t,s,l)}function eu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function aa(e,t){var s=e.alternate;return s===null?(s=ln(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 Hp(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 Uo(e,t,s,l,d,h){var x=0;if(l=e,typeof e=="function")eu(e)&&(x=1);else if(typeof e=="string")x=bS(e,s,pe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case F:return e=ln(31,s,t,d),e.elementType=F,e.lanes=h,e;case E:return ms(s.children,d,h,t);case N:x=8,d|=24;break;case C:return e=ln(12,s,t,d|2),e.elementType=C,e.lanes=h,e;case U:return e=ln(13,s,t,d),e.elementType=U,e.lanes=h,e;case q:return e=ln(19,s,t,d),e.elementType=q,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case O:x=10;break e;case A:x=9;break e;case B:x=11;break e;case M:x=14;break e;case R:x=16,l=null;break e}x=29,s=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=ln(x,s,t,d),t.elementType=e,t.type=l,t.lanes=h,t}function ms(e,t,s,l){return e=ln(7,e,l,t),e.lanes=s,e}function tu(e,t,s){return e=ln(6,e,null,t),e.lanes=s,e}function Gp(e){var t=ln(18,null,null,0);return t.stateNode=e,t}function nu(e,t,s){return t=ln(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pp=new WeakMap;function Tn(e,t){if(typeof e=="object"&&e!==null){var s=Pp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:zn(t)},Pp.set(e,t),t)}return{value:e,source:t,stack:zn(t)}}var ti=[],ni=0,zo=null,rl=0,Cn=[],kn=0,wa=null,Hn=1,Gn="";function sa(e,t){ti[ni++]=rl,ti[ni++]=zo,zo=e,rl=t}function Fp(e,t,s){Cn[kn++]=Hn,Cn[kn++]=Gn,Cn[kn++]=wa,wa=e;var l=Hn;e=Gn;var d=32-Xe(l)-1;l&=~(1<<d),s+=1;var h=32-Xe(t)+d;if(30<h){var x=d-d%5;h=(l&(1<<x)-1).toString(32),l>>=x,d-=x,Hn=1<<32-Xe(t)+d|s<<d|l,Gn=h+e}else Hn=1<<h|s<<d|l,Gn=e}function au(e){e.return!==null&&(sa(e,1),Fp(e,1,0))}function su(e){for(;e===zo;)zo=ti[--ni],ti[ni]=null,rl=ti[--ni],ti[ni]=null;for(;e===wa;)wa=Cn[--kn],Cn[kn]=null,Gn=Cn[--kn],Cn[kn]=null,Hn=Cn[--kn],Cn[kn]=null}function $p(e,t){Cn[kn++]=Hn,Cn[kn++]=Gn,Cn[kn++]=wa,Hn=t.id,Gn=t.overflow,wa=e}var It=null,it=null,Oe=!1,Da=null,En=!1,iu=Error(o(519));function Ma(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw cl(Tn(t,e)),iu}function qp(e){var t=e.stateNode,s=e.type,l=e.memoizedProps;switch(t[Bt]=e,t[Xt]=l,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<Dl.length;s++)we(Dl[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),ip(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":we("invalid",t);break;case"textarea":we("invalid",t),op(t,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||l.suppressHydrationWarning===!0||cv(t.textContent,s)?(l.popover!=null&&(we("beforetoggle",t),we("toggle",t)),l.onScroll!=null&&we("scroll",t),l.onScrollEnd!=null&&we("scrollend",t),l.onClick!=null&&(t.onclick=ta),t=!0):t=!1,t||Ma(e,!0)}function Yp(e){for(It=e.return;It;)switch(It.tag){case 5:case 31:case 13:En=!1;return;case 27:case 3:En=!0;return;default:It=It.return}}function ai(e){if(e!==It)return!1;if(!Oe)return Yp(e),Oe=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Td(e.type,e.memoizedProps)),s=!s),s&&it&&Ma(e),Yp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));it=yv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));it=yv(e)}else t===27?(t=it,qa(e.type)?(e=Ad,Ad=null,it=e):it=t):it=It?An(e.stateNode.nextSibling):null;return!0}function gs(){it=It=null,Oe=!1}function lu(){var e=Da;return e!==null&&(tn===null?tn=e:tn.push.apply(tn,e),Da=null),e}function cl(e){Da===null?Da=[e]:Da.push(e)}var ou=J(null),vs=null,ia=null;function Ra(e,t,s){ae(ou,t._currentValue),t._currentValue=s}function la(e){e._currentValue=ou.current,Se(ou)}function ru(e,t,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===s)break;e=e.return}}function cu(e,t,s,l){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var x=d.child;h=h.firstContext;e:for(;h!==null;){var T=h;h=d;for(var j=0;j<t.length;j++)if(T.context===t[j]){h.lanes|=s,T=h.alternate,T!==null&&(T.lanes|=s),ru(h.return,s,e),l||(x=null);break e}h=T.next}}else if(d.tag===18){if(x=d.return,x===null)throw Error(o(341));x.lanes|=s,h=x.alternate,h!==null&&(h.lanes|=s),ru(x,s,e),x=null}else x=d.child;if(x!==null)x.return=d;else for(x=d;x!==null;){if(x===e){x=null;break}if(d=x.sibling,d!==null){d.return=x.return,x=d;break}x=x.return}d=x}}function si(e,t,s,l){e=null;for(var d=t,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var x=d.alternate;if(x===null)throw Error(o(387));if(x=x.memoizedProps,x!==null){var T=d.type;sn(d.pendingProps.value,x.value)||(e!==null?e.push(T):e=[T])}}else if(d===vn.current){if(x=d.alternate,x===null)throw Error(o(387));x.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Il):e=[Il])}d=d.return}e!==null&&cu(t,e,s,l),t.flags|=262144}function Vo(e){for(e=e.firstContext;e!==null;){if(!sn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ys(e){vs=e,ia=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Lt(e){return Kp(vs,e)}function Ho(e,t){return vs===null&&ys(e),Kp(e,t)}function Kp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},ia===null){if(e===null)throw Error(o(308));ia=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ia=ia.next=t;return s}var m1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},g1=n.unstable_scheduleCallback,v1=n.unstable_NormalPriority,St={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function uu(){return{controller:new m1,data:new Map,refCount:0}}function ul(e){e.refCount--,e.refCount===0&&g1(v1,function(){e.controller.abort()})}var dl=null,du=0,ii=0,li=null;function y1(e,t){if(dl===null){var s=dl=[];du=0,ii=pd(),li={status:"pending",value:void 0,then:function(l){s.push(l)}}}return du++,t.then(Zp,Zp),t}function Zp(){if(--du===0&&dl!==null){li!==null&&(li.status="fulfilled");var e=dl;dl=null,ii=0,li=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function b1(e,t){var s=[],l={status:"pending",value:null,reason:null,then:function(d){s.push(d)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var d=0;d<s.length;d++)(0,s[d])(t)},function(d){for(l.status="rejected",l.reason=d,d=0;d<s.length;d++)(0,s[d])(void 0)}),l}var Xp=I.S;I.S=function(e,t){Rg=Ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&y1(e,t),Xp!==null&&Xp(e,t)};var bs=J(null);function fu(){var e=bs.current;return e!==null?e:nt.pooledCache}function Go(e,t){t===null?ae(bs,bs.current):ae(bs,t.pool)}function Qp(){var e=fu();return e===null?null:{parent:St._currentValue,pool:e}}var oi=Error(o(460)),hu=Error(o(474)),Po=Error(o(542)),Fo={then:function(){}};function Wp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Jp(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(ta,ta),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tm(e),e;default:if(typeof t.status=="string")t.then(ta,ta);else{if(e=nt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=l}},function(l){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tm(e),e}throw _s=t,oi}}function xs(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(_s=s,oi):s}}var _s=null;function em(){if(_s===null)throw Error(o(459));var e=_s;return _s=null,e}function tm(e){if(e===oi||e===Po)throw Error(o(483))}var ri=null,fl=0;function $o(e){var t=fl;return fl+=1,ri===null&&(ri=[]),Jp(ri,e,t)}function hl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function qo(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function nm(e){function t(L,w){if(e){var H=L.deletions;H===null?(L.deletions=[w],L.flags|=16):H.push(w)}}function s(L,w){if(!e)return null;for(;w!==null;)t(L,w),w=w.sibling;return null}function l(L){for(var w=new Map;L!==null;)L.key!==null?w.set(L.key,L):w.set(L.index,L),L=L.sibling;return w}function d(L,w){return L=aa(L,w),L.index=0,L.sibling=null,L}function h(L,w,H){return L.index=H,e?(H=L.alternate,H!==null?(H=H.index,H<w?(L.flags|=67108866,w):H):(L.flags|=67108866,w)):(L.flags|=1048576,w)}function x(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function T(L,w,H,K){return w===null||w.tag!==6?(w=tu(H,L.mode,K),w.return=L,w):(w=d(w,H),w.return=L,w)}function j(L,w,H,K){var he=H.type;return he===E?Y(L,w,H.props.children,K,H.key):w!==null&&(w.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===R&&xs(he)===w.type)?(w=d(w,H.props),hl(w,H),w.return=L,w):(w=Uo(H.type,H.key,H.props,null,L.mode,K),hl(w,H),w.return=L,w)}function G(L,w,H,K){return w===null||w.tag!==4||w.stateNode.containerInfo!==H.containerInfo||w.stateNode.implementation!==H.implementation?(w=nu(H,L.mode,K),w.return=L,w):(w=d(w,H.children||[]),w.return=L,w)}function Y(L,w,H,K,he){return w===null||w.tag!==7?(w=ms(H,L.mode,K,he),w.return=L,w):(w=d(w,H),w.return=L,w)}function X(L,w,H){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=tu(""+w,L.mode,H),w.return=L,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case S:return H=Uo(w.type,w.key,w.props,null,L.mode,H),hl(H,w),H.return=L,H;case k:return w=nu(w,L.mode,H),w.return=L,w;case R:return w=xs(w),X(L,w,H)}if(ie(w)||se(w))return w=ms(w,L.mode,H,null),w.return=L,w;if(typeof w.then=="function")return X(L,$o(w),H);if(w.$$typeof===O)return X(L,Ho(L,w),H);qo(L,w)}return null}function P(L,w,H,K){var he=w!==null?w.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return he!==null?null:T(L,w,""+H,K);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case S:return H.key===he?j(L,w,H,K):null;case k:return H.key===he?G(L,w,H,K):null;case R:return H=xs(H),P(L,w,H,K)}if(ie(H)||se(H))return he!==null?null:Y(L,w,H,K,null);if(typeof H.then=="function")return P(L,w,$o(H),K);if(H.$$typeof===O)return P(L,w,Ho(L,H),K);qo(L,H)}return null}function $(L,w,H,K,he){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return L=L.get(H)||null,T(w,L,""+K,he);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case S:return L=L.get(K.key===null?H:K.key)||null,j(w,L,K,he);case k:return L=L.get(K.key===null?H:K.key)||null,G(w,L,K,he);case R:return K=xs(K),$(L,w,H,K,he)}if(ie(K)||se(K))return L=L.get(H)||null,Y(w,L,K,he,null);if(typeof K.then=="function")return $(L,w,H,$o(K),he);if(K.$$typeof===O)return $(L,w,H,Ho(w,K),he);qo(w,K)}return null}function ue(L,w,H,K){for(var he=null,Ue=null,fe=w,Ee=w=0,Re=null;fe!==null&&Ee<H.length;Ee++){fe.index>Ee?(Re=fe,fe=null):Re=fe.sibling;var ze=P(L,fe,H[Ee],K);if(ze===null){fe===null&&(fe=Re);break}e&&fe&&ze.alternate===null&&t(L,fe),w=h(ze,w,Ee),Ue===null?he=ze:Ue.sibling=ze,Ue=ze,fe=Re}if(Ee===H.length)return s(L,fe),Oe&&sa(L,Ee),he;if(fe===null){for(;Ee<H.length;Ee++)fe=X(L,H[Ee],K),fe!==null&&(w=h(fe,w,Ee),Ue===null?he=fe:Ue.sibling=fe,Ue=fe);return Oe&&sa(L,Ee),he}for(fe=l(fe);Ee<H.length;Ee++)Re=$(fe,L,Ee,H[Ee],K),Re!==null&&(e&&Re.alternate!==null&&fe.delete(Re.key===null?Ee:Re.key),w=h(Re,w,Ee),Ue===null?he=Re:Ue.sibling=Re,Ue=Re);return e&&fe.forEach(function(Qa){return t(L,Qa)}),Oe&&sa(L,Ee),he}function ve(L,w,H,K){if(H==null)throw Error(o(151));for(var he=null,Ue=null,fe=w,Ee=w=0,Re=null,ze=H.next();fe!==null&&!ze.done;Ee++,ze=H.next()){fe.index>Ee?(Re=fe,fe=null):Re=fe.sibling;var Qa=P(L,fe,ze.value,K);if(Qa===null){fe===null&&(fe=Re);break}e&&fe&&Qa.alternate===null&&t(L,fe),w=h(Qa,w,Ee),Ue===null?he=Qa:Ue.sibling=Qa,Ue=Qa,fe=Re}if(ze.done)return s(L,fe),Oe&&sa(L,Ee),he;if(fe===null){for(;!ze.done;Ee++,ze=H.next())ze=X(L,ze.value,K),ze!==null&&(w=h(ze,w,Ee),Ue===null?he=ze:Ue.sibling=ze,Ue=ze);return Oe&&sa(L,Ee),he}for(fe=l(fe);!ze.done;Ee++,ze=H.next())ze=$(fe,L,Ee,ze.value,K),ze!==null&&(e&&ze.alternate!==null&&fe.delete(ze.key===null?Ee:ze.key),w=h(ze,w,Ee),Ue===null?he=ze:Ue.sibling=ze,Ue=ze);return e&&fe.forEach(function(wS){return t(L,wS)}),Oe&&sa(L,Ee),he}function Je(L,w,H,K){if(typeof H=="object"&&H!==null&&H.type===E&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case S:e:{for(var he=H.key;w!==null;){if(w.key===he){if(he=H.type,he===E){if(w.tag===7){s(L,w.sibling),K=d(w,H.props.children),K.return=L,L=K;break e}}else if(w.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===R&&xs(he)===w.type){s(L,w.sibling),K=d(w,H.props),hl(K,H),K.return=L,L=K;break e}s(L,w);break}else t(L,w);w=w.sibling}H.type===E?(K=ms(H.props.children,L.mode,K,H.key),K.return=L,L=K):(K=Uo(H.type,H.key,H.props,null,L.mode,K),hl(K,H),K.return=L,L=K)}return x(L);case k:e:{for(he=H.key;w!==null;){if(w.key===he)if(w.tag===4&&w.stateNode.containerInfo===H.containerInfo&&w.stateNode.implementation===H.implementation){s(L,w.sibling),K=d(w,H.children||[]),K.return=L,L=K;break e}else{s(L,w);break}else t(L,w);w=w.sibling}K=nu(H,L.mode,K),K.return=L,L=K}return x(L);case R:return H=xs(H),Je(L,w,H,K)}if(ie(H))return ue(L,w,H,K);if(se(H)){if(he=se(H),typeof he!="function")throw Error(o(150));return H=he.call(H),ve(L,w,H,K)}if(typeof H.then=="function")return Je(L,w,$o(H),K);if(H.$$typeof===O)return Je(L,w,Ho(L,H),K);qo(L,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,w!==null&&w.tag===6?(s(L,w.sibling),K=d(w,H),K.return=L,L=K):(s(L,w),K=tu(H,L.mode,K),K.return=L,L=K),x(L)):s(L,w)}return function(L,w,H,K){try{fl=0;var he=Je(L,w,H,K);return ri=null,he}catch(fe){if(fe===oi||fe===Po)throw fe;var Ue=ln(29,fe,null,L.mode);return Ue.lanes=K,Ue.return=L,Ue}finally{}}}var Ss=nm(!0),am=nm(!1),Oa=!1;function pu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mu(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 Ba(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ia(e,t,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Pe&2)!==0){var d=l.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),l.pending=t,t=Lo(e),Vp(e,null,s),t}return Io(e,l,t,s),Lo(e)}function pl(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,Kh(e,s)}}function gu(e,t){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var d=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var x={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?d=h=x:h=h.next=x,s=s.next}while(s!==null);h===null?d=h=t:h=h.next=t}else d=h=t;s={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var vu=!1;function ml(){if(vu){var e=li;if(e!==null)throw e}}function gl(e,t,s,l){vu=!1;var d=e.updateQueue;Oa=!1;var h=d.firstBaseUpdate,x=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var j=T,G=j.next;j.next=null,x===null?h=G:x.next=G,x=j;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,T=Y.lastBaseUpdate,T!==x&&(T===null?Y.firstBaseUpdate=G:T.next=G,Y.lastBaseUpdate=j))}if(h!==null){var X=d.baseState;x=0,Y=G=j=null,T=h;do{var P=T.lane&-536870913,$=P!==T.lane;if($?(Me&P)===P:(l&P)===P){P!==0&&P===ii&&(vu=!0),Y!==null&&(Y=Y.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ue=e,ve=T;P=t;var Je=s;switch(ve.tag){case 1:if(ue=ve.payload,typeof ue=="function"){X=ue.call(Je,X,P);break e}X=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ve.payload,P=typeof ue=="function"?ue.call(Je,X,P):ue,P==null)break e;X=v({},X,P);break e;case 2:Oa=!0}}P=T.callback,P!==null&&(e.flags|=64,$&&(e.flags|=8192),$=d.callbacks,$===null?d.callbacks=[P]:$.push(P))}else $={lane:P,tag:T.tag,payload:T.payload,callback:T.callback,next:null},Y===null?(G=Y=$,j=X):Y=Y.next=$,x|=P;if(T=T.next,T===null){if(T=d.shared.pending,T===null)break;$=T,T=$.next,$.next=null,d.lastBaseUpdate=$,d.shared.pending=null}}while(!0);Y===null&&(j=X),d.baseState=j,d.firstBaseUpdate=G,d.lastBaseUpdate=Y,h===null&&(d.shared.lanes=0),Ha|=x,e.lanes=x,e.memoizedState=X}}function sm(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function im(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)sm(s[e],t)}var ci=J(null),Yo=J(0);function lm(e,t){e=ma,ae(Yo,e),ae(ci,t),ma=e|t.baseLanes}function yu(){ae(Yo,ma),ae(ci,ci.current)}function bu(){ma=Yo.current,Se(ci),Se(Yo)}var on=J(null),Nn=null;function La(e){var t=e.alternate;ae(yt,yt.current&1),ae(on,e),Nn===null&&(t===null||ci.current!==null||t.memoizedState!==null)&&(Nn=e)}function xu(e){ae(yt,yt.current),ae(on,e),Nn===null&&(Nn=e)}function om(e){e.tag===22?(ae(yt,yt.current),ae(on,e),Nn===null&&(Nn=e)):Ua()}function Ua(){ae(yt,yt.current),ae(on,on.current)}function rn(e){Se(on),Nn===e&&(Nn=null),Se(yt)}var yt=J(0);function Ko(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Ed(s)||Nd(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 oa=0,ke=null,Qe=null,Tt=null,Zo=!1,ui=!1,Ts=!1,Xo=0,vl=0,di=null,x1=0;function pt(){throw Error(o(321))}function _u(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!sn(e[s],t[s]))return!1;return!0}function Su(e,t,s,l,d,h){return oa=h,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Fm:Lu,Ts=!1,h=s(l,d),Ts=!1,ui&&(h=cm(t,s,l,d)),rm(e),h}function rm(e){I.H=xl;var t=Qe!==null&&Qe.next!==null;if(oa=0,Tt=Qe=ke=null,Zo=!1,vl=0,di=null,t)throw Error(o(300));e===null||Ct||(e=e.dependencies,e!==null&&Vo(e)&&(Ct=!0))}function cm(e,t,s,l){ke=e;var d=0;do{if(ui&&(di=null),vl=0,ui=!1,25<=d)throw Error(o(301));if(d+=1,Tt=Qe=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}I.H=$m,h=t(s,l)}while(ui);return h}function _1(){var e=I.H,t=e.useState()[0];return t=typeof t.then=="function"?yl(t):t,e=e.useState()[0],(Qe!==null?Qe.memoizedState:null)!==e&&(ke.flags|=1024),t}function Tu(){var e=Xo!==0;return Xo=0,e}function Cu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function ku(e){if(Zo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Zo=!1}oa=0,Tt=Qe=ke=null,ui=!1,vl=Xo=0,di=null}function Yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?ke.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function bt(){if(Qe===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=Tt===null?ke.memoizedState:Tt.next;if(t!==null)Tt=t,Qe=e;else{if(e===null)throw ke.alternate===null?Error(o(467)):Error(o(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},Tt===null?ke.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function Qo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yl(e){var t=vl;return vl+=1,di===null&&(di=[]),e=Jp(di,e,t),t=ke,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Fm:Lu),e}function Wo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return yl(e);if(e.$$typeof===O)return Lt(e)}throw Error(o(438,String(e)))}function Eu(e){var t=null,s=ke.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var l=ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Qo(),ke.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),l=0;l<e;l++)s[l]=ee;return t.index++,s}function ra(e,t){return typeof t=="function"?t(e):t}function Jo(e){var t=bt();return Nu(t,Qe,e)}function Nu(e,t,s){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=s;var d=e.baseQueue,h=l.pending;if(h!==null){if(d!==null){var x=d.next;d.next=h.next,h.next=x}t.baseQueue=d=h,l.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{t=d.next;var T=x=null,j=null,G=t,Y=!1;do{var X=G.lane&-536870913;if(X!==G.lane?(Me&X)===X:(oa&X)===X){var P=G.revertLane;if(P===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),X===ii&&(Y=!0);else if((oa&P)===P){G=G.next,P===ii&&(Y=!0);continue}else X={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},j===null?(T=j=X,x=h):j=j.next=X,ke.lanes|=P,Ha|=P;X=G.action,Ts&&s(h,X),h=G.hasEagerState?G.eagerState:s(h,X)}else P={lane:X,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},j===null?(T=j=P,x=h):j=j.next=P,ke.lanes|=X,Ha|=X;G=G.next}while(G!==null&&G!==t);if(j===null?x=h:j.next=T,!sn(h,e.memoizedState)&&(Ct=!0,Y&&(s=li,s!==null)))throw s;e.memoizedState=h,e.baseState=x,e.baseQueue=j,l.lastRenderedState=h}return d===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Au(e){var t=bt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var l=s.dispatch,d=s.pending,h=t.memoizedState;if(d!==null){s.pending=null;var x=d=d.next;do h=e(h,x.action),x=x.next;while(x!==d);sn(h,t.memoizedState)||(Ct=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,l]}function um(e,t,s){var l=ke,d=bt(),h=Oe;if(h){if(s===void 0)throw Error(o(407));s=s()}else s=t();var x=!sn((Qe||d).memoizedState,s);if(x&&(d.memoizedState=s,Ct=!0),d=d.queue,Du(hm.bind(null,l,d,e),[e]),d.getSnapshot!==t||x||Tt!==null&&Tt.memoizedState.tag&1){if(l.flags|=2048,fi(9,{destroy:void 0},fm.bind(null,l,d,s,t),null),nt===null)throw Error(o(349));h||(oa&127)!==0||dm(l,t,s)}return s}function dm(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=ke.updateQueue,t===null?(t=Qo(),ke.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function fm(e,t,s,l){t.value=s,t.getSnapshot=l,pm(t)&&mm(e)}function hm(e,t,s){return s(function(){pm(t)&&mm(e)})}function pm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!sn(e,s)}catch{return!0}}function mm(e){var t=ps(e,2);t!==null&&nn(t,e,2)}function ju(e){var t=Yt();if(typeof e=="function"){var s=e;if(e=s(),Ts){ft(!0);try{s()}finally{ft(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:e},t}function gm(e,t,s,l){return e.baseState=s,Nu(e,Qe,typeof l=="function"?l:ra)}function S1(e,t,s,l,d){if(nr(e))throw Error(o(485));if(e=t.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){h.listeners.push(x)}};I.T!==null?s(!0):h.isTransition=!1,l(h),s=t.pending,s===null?(h.next=t.pending=h,vm(t,h)):(h.next=s.next,t.pending=s.next=h)}}function vm(e,t){var s=t.action,l=t.payload,d=e.state;if(t.isTransition){var h=I.T,x={};I.T=x;try{var T=s(d,l),j=I.S;j!==null&&j(x,T),ym(e,t,T)}catch(G){wu(e,t,G)}finally{h!==null&&x.types!==null&&(h.types=x.types),I.T=h}}else try{h=s(d,l),ym(e,t,h)}catch(G){wu(e,t,G)}}function ym(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){bm(e,t,l)},function(l){return wu(e,t,l)}):bm(e,t,s)}function bm(e,t,s){t.status="fulfilled",t.value=s,xm(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,vm(e,s)))}function wu(e,t,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=s,xm(t),t=t.next;while(t!==l)}e.action=null}function xm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function _m(e,t){return t}function Sm(e,t){if(Oe){var s=nt.formState;if(s!==null){e:{var l=ke;if(Oe){if(it){t:{for(var d=it,h=En;d.nodeType!==8;){if(!h){d=null;break t}if(d=An(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){it=An(d.nextSibling),l=d.data==="F!";break e}}Ma(l)}l=!1}l&&(t=s[0])}}return s=Yt(),s.memoizedState=s.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_m,lastRenderedState:t},s.queue=l,s=Hm.bind(null,ke,l),l.dispatch=s,l=ju(!1),h=Iu.bind(null,ke,!1,l.queue),l=Yt(),d={state:t,dispatch:null,action:e,pending:null},l.queue=d,s=S1.bind(null,ke,d,h,s),d.dispatch=s,l.memoizedState=e,[t,s,!1]}function Tm(e){var t=bt();return Cm(t,Qe,e)}function Cm(e,t,s){if(t=Nu(e,t,_m)[0],e=Jo(ra)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=yl(t)}catch(x){throw x===oi?Po:x}else l=t;t=bt();var d=t.queue,h=d.dispatch;return s!==t.memoizedState&&(ke.flags|=2048,fi(9,{destroy:void 0},T1.bind(null,d,s),null)),[l,h,e]}function T1(e,t){e.action=t}function km(e){var t=bt(),s=Qe;if(s!==null)return Cm(t,s,e);bt(),t=t.memoizedState,s=bt();var l=s.queue.dispatch;return s.memoizedState=e,[t,l,!1]}function fi(e,t,s,l){return e={tag:e,create:s,deps:l,inst:t,next:null},t=ke.updateQueue,t===null&&(t=Qo(),ke.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,t.lastEffect=e),e}function Em(){return bt().memoizedState}function er(e,t,s,l){var d=Yt();ke.flags|=e,d.memoizedState=fi(1|t,{destroy:void 0},s,l===void 0?null:l)}function tr(e,t,s,l){var d=bt();l=l===void 0?null:l;var h=d.memoizedState.inst;Qe!==null&&l!==null&&_u(l,Qe.memoizedState.deps)?d.memoizedState=fi(t,h,s,l):(ke.flags|=e,d.memoizedState=fi(1|t,h,s,l))}function Nm(e,t){er(8390656,8,e,t)}function Du(e,t){tr(2048,8,e,t)}function C1(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=Qo(),ke.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Am(e){var t=bt().memoizedState;return C1({ref:t,nextImpl:e}),function(){if((Pe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function jm(e,t){return tr(4,2,e,t)}function wm(e,t){return tr(4,4,e,t)}function Dm(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 Mm(e,t,s){s=s!=null?s.concat([e]):null,tr(4,4,Dm.bind(null,t,e),s)}function Mu(){}function Rm(e,t){var s=bt();t=t===void 0?null:t;var l=s.memoizedState;return t!==null&&_u(t,l[1])?l[0]:(s.memoizedState=[e,t],e)}function Om(e,t){var s=bt();t=t===void 0?null:t;var l=s.memoizedState;if(t!==null&&_u(t,l[1]))return l[0];if(l=e(),Ts){ft(!0);try{e()}finally{ft(!1)}}return s.memoizedState=[l,t],l}function Ru(e,t,s){return s===void 0||(oa&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Bg(),ke.lanes|=e,Ha|=e,s)}function Bm(e,t,s,l){return sn(s,t)?s:ci.current!==null?(e=Ru(e,s,l),sn(e,t)||(Ct=!0),e):(oa&42)===0||(oa&1073741824)!==0&&(Me&261930)===0?(Ct=!0,e.memoizedState=s):(e=Bg(),ke.lanes|=e,Ha|=e,t)}function Im(e,t,s,l,d){var h=D.p;D.p=h!==0&&8>h?h:8;var x=I.T,T={};I.T=T,Iu(e,!1,t,s);try{var j=d(),G=I.S;if(G!==null&&G(T,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var Y=b1(j,l);bl(e,t,Y,dn(e))}else bl(e,t,l,dn(e))}catch(X){bl(e,t,{then:function(){},status:"rejected",reason:X},dn())}finally{D.p=h,x!==null&&T.types!==null&&(x.types=T.types),I.T=x}}function k1(){}function Ou(e,t,s,l){if(e.tag!==5)throw Error(o(476));var d=Lm(e).queue;Im(e,d,t,ne,s===null?k1:function(){return Um(e),s(l)})}function Lm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:ne},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Um(e){var t=Lm(e);t.next===null&&(t=e.alternate.memoizedState),bl(e,t.next.queue,{},dn())}function Bu(){return Lt(Il)}function zm(){return bt().memoizedState}function Vm(){return bt().memoizedState}function E1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=dn();e=Ba(s);var l=Ia(t,e,s);l!==null&&(nn(l,t,s),pl(l,t,s)),t={cache:uu()},e.payload=t;return}t=t.return}}function N1(e,t,s){var l=dn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},nr(e)?Gm(t,s):(s=Jc(e,t,s,l),s!==null&&(nn(s,e,l),Pm(s,t,l)))}function Hm(e,t,s){var l=dn();bl(e,t,s,l)}function bl(e,t,s,l){var d={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(nr(e))Gm(t,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var x=t.lastRenderedState,T=h(x,s);if(d.hasEagerState=!0,d.eagerState=T,sn(T,x))return Io(e,t,d,0),nt===null&&Bo(),!1}catch{}finally{}if(s=Jc(e,t,d,l),s!==null)return nn(s,e,l),Pm(s,t,l),!0}return!1}function Iu(e,t,s,l){if(l={lane:2,revertLane:pd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},nr(e)){if(t)throw Error(o(479))}else t=Jc(e,s,l,2),t!==null&&nn(t,e,2)}function nr(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function Gm(e,t){ui=Zo=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Pm(e,t,s){if((s&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,Kh(e,s)}}var xl={readContext:Lt,use:Wo,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt};xl.useEffectEvent=pt;var Fm={readContext:Lt,use:Wo,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:Nm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,er(4194308,4,Dm.bind(null,t,e),s)},useLayoutEffect:function(e,t){return er(4194308,4,e,t)},useInsertionEffect:function(e,t){er(4,2,e,t)},useMemo:function(e,t){var s=Yt();t=t===void 0?null:t;var l=e();if(Ts){ft(!0);try{e()}finally{ft(!1)}}return s.memoizedState=[l,t],l},useReducer:function(e,t,s){var l=Yt();if(s!==void 0){var d=s(t);if(Ts){ft(!0);try{s(t)}finally{ft(!1)}}}else d=t;return l.memoizedState=l.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},l.queue=e,e=e.dispatch=N1.bind(null,ke,e),[l.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:function(e){e=ju(e);var t=e.queue,s=Hm.bind(null,ke,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Mu,useDeferredValue:function(e,t){var s=Yt();return Ru(s,e,t)},useTransition:function(){var e=ju(!1);return e=Im.bind(null,ke,e.queue,!0,!1),Yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var l=ke,d=Yt();if(Oe){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),nt===null)throw Error(o(349));(Me&127)!==0||dm(l,t,s)}d.memoizedState=s;var h={value:s,getSnapshot:t};return d.queue=h,Nm(hm.bind(null,l,h,e),[e]),l.flags|=2048,fi(9,{destroy:void 0},fm.bind(null,l,h,s,t),null),s},useId:function(){var e=Yt(),t=nt.identifierPrefix;if(Oe){var s=Gn,l=Hn;s=(l&~(1<<32-Xe(l)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Xo++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=x1++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Bu,useFormState:Sm,useActionState:Sm,useOptimistic:function(e){var t=Yt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Iu.bind(null,ke,!0,s),s.dispatch=t,[e,t]},useMemoCache:Eu,useCacheRefresh:function(){return Yt().memoizedState=E1.bind(null,ke)},useEffectEvent:function(e){var t=Yt(),s={impl:e};return t.memoizedState=s,function(){if((Pe&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Lu={readContext:Lt,use:Wo,useCallback:Rm,useContext:Lt,useEffect:Du,useImperativeHandle:Mm,useInsertionEffect:jm,useLayoutEffect:wm,useMemo:Om,useReducer:Jo,useRef:Em,useState:function(){return Jo(ra)},useDebugValue:Mu,useDeferredValue:function(e,t){var s=bt();return Bm(s,Qe.memoizedState,e,t)},useTransition:function(){var e=Jo(ra)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:yl(e),t]},useSyncExternalStore:um,useId:zm,useHostTransitionStatus:Bu,useFormState:Tm,useActionState:Tm,useOptimistic:function(e,t){var s=bt();return gm(s,Qe,e,t)},useMemoCache:Eu,useCacheRefresh:Vm};Lu.useEffectEvent=Am;var $m={readContext:Lt,use:Wo,useCallback:Rm,useContext:Lt,useEffect:Du,useImperativeHandle:Mm,useInsertionEffect:jm,useLayoutEffect:wm,useMemo:Om,useReducer:Au,useRef:Em,useState:function(){return Au(ra)},useDebugValue:Mu,useDeferredValue:function(e,t){var s=bt();return Qe===null?Ru(s,e,t):Bm(s,Qe.memoizedState,e,t)},useTransition:function(){var e=Au(ra)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:yl(e),t]},useSyncExternalStore:um,useId:zm,useHostTransitionStatus:Bu,useFormState:km,useActionState:km,useOptimistic:function(e,t){var s=bt();return Qe!==null?gm(s,Qe,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Eu,useCacheRefresh:Vm};$m.useEffectEvent=Am;function Uu(e,t,s,l){t=e.memoizedState,s=s(l,t),s=s==null?t:v({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var zu={enqueueSetState:function(e,t,s){e=e._reactInternals;var l=dn(),d=Ba(l);d.payload=t,s!=null&&(d.callback=s),t=Ia(e,d,l),t!==null&&(nn(t,e,l),pl(t,e,l))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var l=dn(),d=Ba(l);d.tag=1,d.payload=t,s!=null&&(d.callback=s),t=Ia(e,d,l),t!==null&&(nn(t,e,l),pl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=dn(),l=Ba(s);l.tag=2,t!=null&&(l.callback=t),t=Ia(e,l,s),t!==null&&(nn(t,e,s),pl(t,e,s))}};function qm(e,t,s,l,d,h,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,x):t.prototype&&t.prototype.isPureReactComponent?!ll(s,l)||!ll(d,h):!0}function Ym(e,t,s,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,l),t.state!==e&&zu.enqueueReplaceState(t,t.state,null)}function Cs(e,t){var s=t;if("ref"in t){s={};for(var l in t)l!=="ref"&&(s[l]=t[l])}if(e=e.defaultProps){s===t&&(s=v({},s));for(var d in e)s[d]===void 0&&(s[d]=e[d])}return s}function Km(e){Oo(e)}function Zm(e){console.error(e)}function Xm(e){Oo(e)}function ar(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Qm(e,t,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Vu(e,t,s){return s=Ba(s),s.tag=3,s.payload={element:null},s.callback=function(){ar(e,t)},s}function Wm(e){return e=Ba(e),e.tag=3,e}function Jm(e,t,s,l){var d=s.type.getDerivedStateFromError;if(typeof d=="function"){var h=l.value;e.payload=function(){return d(h)},e.callback=function(){Qm(t,s,l)}}var x=s.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Qm(t,s,l),typeof d!="function"&&(Ga===null?Ga=new Set([this]):Ga.add(this));var T=l.stack;this.componentDidCatch(l.value,{componentStack:T!==null?T:""})})}function A1(e,t,s,l,d){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=s.alternate,t!==null&&si(t,s,d,!0),s=on.current,s!==null){switch(s.tag){case 31:case 13:return Nn===null?mr():s.alternate===null&&mt===0&&(mt=3),s.flags&=-257,s.flags|=65536,s.lanes=d,l===Fo?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([l]):t.add(l),dd(e,l,d)),!1;case 22:return s.flags|=65536,l===Fo?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([l]):s.add(l)),dd(e,l,d)),!1}throw Error(o(435,s.tag))}return dd(e,l,d),mr(),!1}if(Oe)return t=on.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,l!==iu&&(e=Error(o(422),{cause:l}),cl(Tn(e,s)))):(l!==iu&&(t=Error(o(423),{cause:l}),cl(Tn(t,s))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,l=Tn(l,s),d=Vu(e.stateNode,l,d),gu(e,d),mt!==4&&(mt=2)),!1;var h=Error(o(520),{cause:l});if(h=Tn(h,s),Al===null?Al=[h]:Al.push(h),mt!==4&&(mt=2),t===null)return!0;l=Tn(l,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=d&-d,s.lanes|=e,e=Vu(s.stateNode,l,e),gu(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"&&(Ga===null||!Ga.has(h))))return s.flags|=65536,d&=-d,s.lanes|=d,d=Wm(d),Jm(d,e,s,l),gu(s,d),!1}s=s.return}while(s!==null);return!1}var Hu=Error(o(461)),Ct=!1;function Ut(e,t,s,l){t.child=e===null?am(t,null,s,l):Ss(t,e.child,s,l)}function eg(e,t,s,l,d){s=s.render;var h=t.ref;if("ref"in l){var x={};for(var T in l)T!=="ref"&&(x[T]=l[T])}else x=l;return ys(t),l=Su(e,t,s,x,h,d),T=Tu(),e!==null&&!Ct?(Cu(e,t,d),ca(e,t,d)):(Oe&&T&&au(t),t.flags|=1,Ut(e,t,l,d),t.child)}function tg(e,t,s,l,d){if(e===null){var h=s.type;return typeof h=="function"&&!eu(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,ng(e,t,h,l,d)):(e=Uo(s.type,null,l,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Zu(e,d)){var x=h.memoizedProps;if(s=s.compare,s=s!==null?s:ll,s(x,l)&&e.ref===t.ref)return ca(e,t,d)}return t.flags|=1,e=aa(h,l),e.ref=t.ref,e.return=t,t.child=e}function ng(e,t,s,l,d){if(e!==null){var h=e.memoizedProps;if(ll(h,l)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=l=h,Zu(e,d))(e.flags&131072)!==0&&(Ct=!0);else return t.lanes=e.lanes,ca(e,t,d)}return Gu(e,t,s,l,d)}function ag(e,t,s,l){var d=l.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(l=t.child=e.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~h}else l=0,t.child=null;return sg(e,t,h,s,l)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Go(t,h!==null?h.cachePool:null),h!==null?lm(t,h):yu(),om(t);else return l=t.lanes=536870912,sg(e,t,h!==null?h.baseLanes|s:s,s,l)}else h!==null?(Go(t,h.cachePool),lm(t,h),Ua(),t.memoizedState=null):(e!==null&&Go(t,null),yu(),Ua());return Ut(e,t,d,s),t.child}function _l(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sg(e,t,s,l,d){var h=fu();return h=h===null?null:{parent:St._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&Go(t,null),yu(),om(t),e!==null&&si(e,t,l,!0),t.childLanes=d,null}function sr(e,t){return t=lr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ig(e,t,s){return Ss(t,e.child,null,s),e=sr(t,t.pendingProps),e.flags|=2,rn(t),t.memoizedState=null,e}function j1(e,t,s){var l=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Oe){if(l.mode==="hidden")return e=sr(t,l),t.lanes=536870912,_l(null,e);if(xu(t),(e=it)?(e=vv(e,En),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wa!==null?{id:Hn,overflow:Gn}:null,retryLane:536870912,hydrationErrors:null},s=Gp(e),s.return=t,t.child=s,It=t,it=null)):e=null,e===null)throw Ma(t);return t.lanes=536870912,null}return sr(t,l)}var h=e.memoizedState;if(h!==null){var x=h.dehydrated;if(xu(t),d)if(t.flags&256)t.flags&=-257,t=ig(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ct||si(e,t,s,!1),d=(s&e.childLanes)!==0,Ct||d){if(l=nt,l!==null&&(x=Zh(l,s),x!==0&&x!==h.retryLane))throw h.retryLane=x,ps(e,x),nn(l,e,x),Hu;mr(),t=ig(e,t,s)}else e=h.treeContext,it=An(x.nextSibling),It=t,Oe=!0,Da=null,En=!1,e!==null&&$p(t,e),t=sr(t,l),t.flags|=4096;return t}return e=aa(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ir(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Gu(e,t,s,l,d){return ys(t),s=Su(e,t,s,l,void 0,d),l=Tu(),e!==null&&!Ct?(Cu(e,t,d),ca(e,t,d)):(Oe&&l&&au(t),t.flags|=1,Ut(e,t,s,d),t.child)}function lg(e,t,s,l,d,h){return ys(t),t.updateQueue=null,s=cm(t,l,s,d),rm(e),l=Tu(),e!==null&&!Ct?(Cu(e,t,h),ca(e,t,h)):(Oe&&l&&au(t),t.flags|=1,Ut(e,t,s,h),t.child)}function og(e,t,s,l,d){if(ys(t),t.stateNode===null){var h=ei,x=s.contextType;typeof x=="object"&&x!==null&&(h=Lt(x)),h=new s(l,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=zu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=l,h.state=t.memoizedState,h.refs={},pu(t),x=s.contextType,h.context=typeof x=="object"&&x!==null?Lt(x):ei,h.state=t.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(Uu(t,s,x,l),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(x=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),x!==h.state&&zu.enqueueReplaceState(h,h.state,null),gl(t,l,h,d),ml(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){h=t.stateNode;var T=t.memoizedProps,j=Cs(s,T);h.props=j;var G=h.context,Y=s.contextType;x=ei,typeof Y=="object"&&Y!==null&&(x=Lt(Y));var X=s.getDerivedStateFromProps;Y=typeof X=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,Y||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||G!==x)&&Ym(t,h,l,x),Oa=!1;var P=t.memoizedState;h.state=P,gl(t,l,h,d),ml(),G=t.memoizedState,T||P!==G||Oa?(typeof X=="function"&&(Uu(t,s,X,l),G=t.memoizedState),(j=Oa||qm(t,s,j,l,P,G,x))?(Y||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=G),h.props=l,h.state=G,h.context=x,l=j):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{h=t.stateNode,mu(e,t),x=t.memoizedProps,Y=Cs(s,x),h.props=Y,X=t.pendingProps,P=h.context,G=s.contextType,j=ei,typeof G=="object"&&G!==null&&(j=Lt(G)),T=s.getDerivedStateFromProps,(G=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==X||P!==j)&&Ym(t,h,l,j),Oa=!1,P=t.memoizedState,h.state=P,gl(t,l,h,d),ml();var $=t.memoizedState;x!==X||P!==$||Oa||e!==null&&e.dependencies!==null&&Vo(e.dependencies)?(typeof T=="function"&&(Uu(t,s,T,l),$=t.memoizedState),(Y=Oa||qm(t,s,Y,l,P,$,j)||e!==null&&e.dependencies!==null&&Vo(e.dependencies))?(G||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,$,j),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,$,j)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=$),h.props=l,h.state=$,h.context=j,l=Y):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),l=!1)}return h=l,ir(e,t),l=(t.flags&128)!==0,h||l?(h=t.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&l?(t.child=Ss(t,e.child,null,d),t.child=Ss(t,null,s,d)):Ut(e,t,s,d),t.memoizedState=h.state,e=t.child):e=ca(e,t,d),e}function rg(e,t,s,l){return gs(),t.flags|=256,Ut(e,t,s,l),t.child}var Pu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fu(e){return{baseLanes:e,cachePool:Qp()}}function $u(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=un),e}function cg(e,t,s){var l=t.pendingProps,d=!1,h=(t.flags&128)!==0,x;if((x=h)||(x=e!==null&&e.memoizedState===null?!1:(yt.current&2)!==0),x&&(d=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(Oe){if(d?La(t):Ua(),(e=it)?(e=vv(e,En),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wa!==null?{id:Hn,overflow:Gn}:null,retryLane:536870912,hydrationErrors:null},s=Gp(e),s.return=t,t.child=s,It=t,it=null)):e=null,e===null)throw Ma(t);return Nd(e)?t.lanes=32:t.lanes=536870912,null}var T=l.children;return l=l.fallback,d?(Ua(),d=t.mode,T=lr({mode:"hidden",children:T},d),l=ms(l,d,s,null),T.return=t,l.return=t,T.sibling=l,t.child=T,l=t.child,l.memoizedState=Fu(s),l.childLanes=$u(e,x,s),t.memoizedState=Pu,_l(null,l)):(La(t),qu(t,T))}var j=e.memoizedState;if(j!==null&&(T=j.dehydrated,T!==null)){if(h)t.flags&256?(La(t),t.flags&=-257,t=Yu(e,t,s)):t.memoizedState!==null?(Ua(),t.child=e.child,t.flags|=128,t=null):(Ua(),T=l.fallback,d=t.mode,l=lr({mode:"visible",children:l.children},d),T=ms(T,d,s,null),T.flags|=2,l.return=t,T.return=t,l.sibling=T,t.child=l,Ss(t,e.child,null,s),l=t.child,l.memoizedState=Fu(s),l.childLanes=$u(e,x,s),t.memoizedState=Pu,t=_l(null,l));else if(La(t),Nd(T)){if(x=T.nextSibling&&T.nextSibling.dataset,x)var G=x.dgst;x=G,l=Error(o(419)),l.stack="",l.digest=x,cl({value:l,source:null,stack:null}),t=Yu(e,t,s)}else if(Ct||si(e,t,s,!1),x=(s&e.childLanes)!==0,Ct||x){if(x=nt,x!==null&&(l=Zh(x,s),l!==0&&l!==j.retryLane))throw j.retryLane=l,ps(e,l),nn(x,e,l),Hu;Ed(T)||mr(),t=Yu(e,t,s)}else Ed(T)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,it=An(T.nextSibling),It=t,Oe=!0,Da=null,En=!1,e!==null&&$p(t,e),t=qu(t,l.children),t.flags|=4096);return t}return d?(Ua(),T=l.fallback,d=t.mode,j=e.child,G=j.sibling,l=aa(j,{mode:"hidden",children:l.children}),l.subtreeFlags=j.subtreeFlags&65011712,G!==null?T=aa(G,T):(T=ms(T,d,s,null),T.flags|=2),T.return=t,l.return=t,l.sibling=T,t.child=l,_l(null,l),l=t.child,T=e.child.memoizedState,T===null?T=Fu(s):(d=T.cachePool,d!==null?(j=St._currentValue,d=d.parent!==j?{parent:j,pool:j}:d):d=Qp(),T={baseLanes:T.baseLanes|s,cachePool:d}),l.memoizedState=T,l.childLanes=$u(e,x,s),t.memoizedState=Pu,_l(e.child,l)):(La(t),s=e.child,e=s.sibling,s=aa(s,{mode:"visible",children:l.children}),s.return=t,s.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=s,t.memoizedState=null,s)}function qu(e,t){return t=lr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function lr(e,t){return e=ln(22,e,null,t),e.lanes=0,e}function Yu(e,t,s){return Ss(t,e.child,null,s),e=qu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ug(e,t,s){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),ru(e.return,t,s)}function Ku(e,t,s,l,d,h){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:d,treeForkCount:h}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=l,x.tail=s,x.tailMode=d,x.treeForkCount=h)}function dg(e,t,s){var l=t.pendingProps,d=l.revealOrder,h=l.tail;l=l.children;var x=yt.current,T=(x&2)!==0;if(T?(x=x&1|2,t.flags|=128):x&=1,ae(yt,x),Ut(e,t,l,s),l=Oe?rl:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ug(e,s,t);else if(e.tag===19)ug(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&&Ko(e)===null&&(d=s),s=s.sibling;s=d,s===null?(d=t.child,t.child=null):(d=s.sibling,s.sibling=null),Ku(t,!1,d,s,h,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Ko(e)===null){t.child=d;break}e=d.sibling,d.sibling=s,s=d,d=e}Ku(t,!0,s,null,h,l);break;case"together":Ku(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ca(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ha|=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(o(153));if(t.child!==null){for(e=t.child,s=aa(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=aa(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Zu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Vo(e)))}function w1(e,t,s){switch(t.tag){case 3:_t(t,t.stateNode.containerInfo),Ra(t,St,e.memoizedState.cache),gs();break;case 27:case 5:dt(t);break;case 4:_t(t,t.stateNode.containerInfo);break;case 10:Ra(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,xu(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(La(t),t.flags|=128,null):(s&t.child.childLanes)!==0?cg(e,t,s):(La(t),e=ca(e,t,s),e!==null?e.sibling:null);La(t);break;case 19:var d=(e.flags&128)!==0;if(l=(s&t.childLanes)!==0,l||(si(e,t,s,!1),l=(s&t.childLanes)!==0),d){if(l)return dg(e,t,s);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ae(yt,yt.current),l)break;return null;case 22:return t.lanes=0,ag(e,t,s,t.pendingProps);case 24:Ra(t,St,e.memoizedState.cache)}return ca(e,t,s)}function fg(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ct=!0;else{if(!Zu(e,s)&&(t.flags&128)===0)return Ct=!1,w1(e,t,s);Ct=(e.flags&131072)!==0}else Ct=!1,Oe&&(t.flags&1048576)!==0&&Fp(t,rl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=xs(t.elementType),t.type=e,typeof e=="function")eu(e)?(l=Cs(e,l),t.tag=1,t=og(null,t,e,l,s)):(t.tag=0,t=Gu(null,t,e,l,s));else{if(e!=null){var d=e.$$typeof;if(d===B){t.tag=11,t=eg(null,t,e,l,s);break e}else if(d===M){t.tag=14,t=tg(null,t,e,l,s);break e}}throw t=Q(e)||e,Error(o(306,t,""))}}return t;case 0:return Gu(e,t,t.type,t.pendingProps,s);case 1:return l=t.type,d=Cs(l,t.pendingProps),og(e,t,l,d,s);case 3:e:{if(_t(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var h=t.memoizedState;d=h.element,mu(e,t),gl(t,l,null,s);var x=t.memoizedState;if(l=x.cache,Ra(t,St,l),l!==h.cache&&cu(t,[St],s,!0),ml(),l=x.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=rg(e,t,l,s);break e}else if(l!==d){d=Tn(Error(o(424)),t),cl(d),t=rg(e,t,l,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(it=An(e.firstChild),It=t,Oe=!0,Da=null,En=!0,s=am(t,null,l,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(gs(),l===d){t=ca(e,t,s);break e}Ut(e,t,l,s)}t=t.child}return t;case 26:return ir(e,t),e===null?(s=Tv(t.type,null,t.pendingProps,null))?t.memoizedState=s:Oe||(s=t.type,e=t.pendingProps,l=Sr(Ot.current).createElement(s),l[Bt]=t,l[Xt]=e,zt(l,s,e),wt(l),t.stateNode=l):t.memoizedState=Tv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return dt(t),e===null&&Oe&&(l=t.stateNode=xv(t.type,t.pendingProps,Ot.current),It=t,En=!0,d=it,qa(t.type)?(Ad=d,it=An(l.firstChild)):it=d),Ut(e,t,t.pendingProps.children,s),ir(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oe&&((d=l=it)&&(l=lS(l,t.type,t.pendingProps,En),l!==null?(t.stateNode=l,It=t,it=An(l.firstChild),En=!1,d=!0):d=!1),d||Ma(t)),dt(t),d=t.type,h=t.pendingProps,x=e!==null?e.memoizedProps:null,l=h.children,Td(d,h)?l=null:x!==null&&Td(d,x)&&(t.flags|=32),t.memoizedState!==null&&(d=Su(e,t,_1,null,null,s),Il._currentValue=d),ir(e,t),Ut(e,t,l,s),t.child;case 6:return e===null&&Oe&&((e=s=it)&&(s=oS(s,t.pendingProps,En),s!==null?(t.stateNode=s,It=t,it=null,e=!0):e=!1),e||Ma(t)),null;case 13:return cg(e,t,s);case 4:return _t(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Ss(t,null,l,s):Ut(e,t,l,s),t.child;case 11:return eg(e,t,t.type,t.pendingProps,s);case 7:return Ut(e,t,t.pendingProps,s),t.child;case 8:return Ut(e,t,t.pendingProps.children,s),t.child;case 12:return Ut(e,t,t.pendingProps.children,s),t.child;case 10:return l=t.pendingProps,Ra(t,t.type,l.value),Ut(e,t,l.children,s),t.child;case 9:return d=t.type._context,l=t.pendingProps.children,ys(t),d=Lt(d),l=l(d),t.flags|=1,Ut(e,t,l,s),t.child;case 14:return tg(e,t,t.type,t.pendingProps,s);case 15:return ng(e,t,t.type,t.pendingProps,s);case 19:return dg(e,t,s);case 31:return j1(e,t,s);case 22:return ag(e,t,s,t.pendingProps);case 24:return ys(t),l=Lt(St),e===null?(d=fu(),d===null&&(d=nt,h=uu(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=s),d=h),t.memoizedState={parent:l,cache:d},pu(t),Ra(t,St,d)):((e.lanes&s)!==0&&(mu(e,t),gl(t,null,null,s),ml()),d=e.memoizedState,h=t.memoizedState,d.parent!==l?(d={parent:l,cache:l},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),Ra(t,St,l)):(l=h.cache,Ra(t,St,l),l!==d.cache&&cu(t,[St],s,!0))),Ut(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ua(e){e.flags|=4}function Xu(e,t,s,l,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(zg())e.flags|=8192;else throw _s=Fo,hu}else e.flags&=-16777217}function hg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Av(t))if(zg())e.flags|=8192;else throw _s=Fo,hu}function or(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?qh():536870912,e.lanes|=t,gi|=t)}function Sl(e,t){if(!Oe)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(t)for(var d=e.child;d!==null;)s|=d.lanes|d.childLanes,l|=d.subtreeFlags&65011712,l|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)s|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=s,t}function D1(e,t,s){var l=t.pendingProps;switch(su(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return lt(t),null;case 3:return s=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),la(St),ge(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ai(t)?ua(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,lu())),lt(t),null;case 26:var d=t.type,h=t.memoizedState;return e===null?(ua(t),h!==null?(lt(t),hg(t,h)):(lt(t),Xu(t,d,null,l,s))):h?h!==e.memoizedState?(ua(t),lt(t),hg(t,h)):(lt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&ua(t),lt(t),Xu(t,d,e,l,s)),null;case 27:if(On(t),s=Ot.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ua(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return lt(t),null}e=pe.current,ai(t)?qp(t):(e=xv(d,l,s),t.stateNode=e,ua(t))}return lt(t),null;case 5:if(On(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ua(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return lt(t),null}if(h=pe.current,ai(t))qp(t);else{var x=Sr(Ot.current);switch(h){case 1:h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=x.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?x.createElement("select",{is:l.is}):x.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?x.createElement(d,{is:l.is}):x.createElement(d)}}h[Bt]=t,h[Xt]=l;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)h.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=h;e:switch(zt(h,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ua(t)}}return lt(t),Xu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&ua(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=Ot.current,ai(t)){if(e=t.stateNode,s=t.memoizedProps,l=null,d=It,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}e[Bt]=t,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||cv(e.nodeValue,s)),e||Ma(t,!0)}else e=Sr(e).createTextNode(l),e[Bt]=t,t.stateNode=e}return lt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(l=ai(t),s!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Bt]=t}else gs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),e=!1}else s=lu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(rn(t),t):(rn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return lt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=ai(t),l!==null&&l.dehydrated!==null){if(e===null){if(!d)throw Error(o(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));d[Bt]=t}else gs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),d=!1}else d=lu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(rn(t),t):(rn(t),null)}return rn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=t.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==d&&(l.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),or(t,t.updateQueue),lt(t),null);case 4:return ge(),e===null&&yd(t.stateNode.containerInfo),lt(t),null;case 10:return la(t.type),lt(t),null;case 19:if(Se(yt),l=t.memoizedState,l===null)return lt(t),null;if(d=(t.flags&128)!==0,h=l.rendering,h===null)if(d)Sl(l,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Ko(e),h!==null){for(t.flags|=128,Sl(l,!1),e=h.updateQueue,t.updateQueue=e,or(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Hp(s,e),s=s.sibling;return ae(yt,yt.current&1|2),Oe&&sa(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ht()>fr&&(t.flags|=128,d=!0,Sl(l,!1),t.lanes=4194304)}else{if(!d)if(e=Ko(h),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,or(t,e),Sl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Oe)return lt(t),null}else 2*Ht()-l.renderingStartTime>fr&&s!==536870912&&(t.flags|=128,d=!0,Sl(l,!1),t.lanes=4194304);l.isBackwards?(h.sibling=t.child,t.child=h):(e=l.last,e!==null?e.sibling=h:t.child=h,l.last=h)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ht(),e.sibling=null,s=yt.current,ae(yt,d?s&1|2:s&1),Oe&&sa(t,l.treeForkCount),e):(lt(t),null);case 22:case 23:return rn(t),bu(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(s&536870912)!==0&&(t.flags&128)===0&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),s=t.updateQueue,s!==null&&or(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==s&&(t.flags|=2048),e!==null&&Se(bs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),la(St),lt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function M1(e,t){switch(su(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return la(St),ge(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return On(t),null;case 31:if(t.memoizedState!==null){if(rn(t),t.alternate===null)throw Error(o(340));gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(rn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(yt),null;case 4:return ge(),null;case 10:return la(t.type),null;case 22:case 23:return rn(t),bu(),e!==null&&Se(bs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return la(St),null;case 25:return null;default:return null}}function pg(e,t){switch(su(t),t.tag){case 3:la(St),ge();break;case 26:case 27:case 5:On(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&rn(t);break;case 13:rn(t);break;case 19:Se(yt);break;case 10:la(t.type);break;case 22:case 23:rn(t),bu(),e!==null&&Se(bs);break;case 24:la(St)}}function Tl(e,t){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var d=l.next;s=d;do{if((s.tag&e)===e){l=void 0;var h=s.create,x=s.inst;l=h(),x.destroy=l}s=s.next}while(s!==d)}}catch(T){Ke(t,t.return,T)}}function za(e,t,s){try{var l=t.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var h=d.next;l=h;do{if((l.tag&e)===e){var x=l.inst,T=x.destroy;if(T!==void 0){x.destroy=void 0,d=t;var j=s,G=T;try{G()}catch(Y){Ke(d,j,Y)}}}l=l.next}while(l!==h)}}catch(Y){Ke(t,t.return,Y)}}function mg(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{im(t,s)}catch(l){Ke(e,e.return,l)}}}function gg(e,t,s){s.props=Cs(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){Ke(e,t,l)}}function Cl(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(d){Ke(e,t,d)}}function Pn(e,t){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(d){Ke(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){Ke(e,t,d)}else s.current=null}function vg(e){var t=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(d){Ke(e,e.return,d)}}function Qu(e,t,s){try{var l=e.stateNode;eS(l,e.type,s,t),l[Xt]=t}catch(d){Ke(e,e.return,d)}}function yg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&qa(e.type)||e.tag===4}function Wu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&qa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ju(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=ta));else if(l!==4&&(l===27&&qa(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Ju(e,t,s),e=e.sibling;e!==null;)Ju(e,t,s),e=e.sibling}function rr(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(l!==4&&(l===27&&qa(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(rr(e,t,s),e=e.sibling;e!==null;)rr(e,t,s),e=e.sibling}function bg(e){var t=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);zt(t,l,s),t[Bt]=e,t[Xt]=s}catch(h){Ke(e,e.return,h)}}var da=!1,kt=!1,ed=!1,xg=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function R1(e,t){if(e=e.containerInfo,_d=jr,e=Mp(e),Yc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var d=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var x=0,T=-1,j=-1,G=0,Y=0,X=e,P=null;t:for(;;){for(var $;X!==s||d!==0&&X.nodeType!==3||(T=x+d),X!==h||l!==0&&X.nodeType!==3||(j=x+l),X.nodeType===3&&(x+=X.nodeValue.length),($=X.firstChild)!==null;)P=X,X=$;for(;;){if(X===e)break t;if(P===s&&++G===d&&(T=x),P===h&&++Y===l&&(j=x),($=X.nextSibling)!==null)break;X=P,P=X.parentNode}X=$}s=T===-1||j===-1?null:{start:T,end:j}}else s=null}s=s||{start:0,end:0}}else s=null;for(Sd={focusedElem:e,selectionRange:s},jr=!1,Dt=t;Dt!==null;)if(t=Dt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Dt=e;else for(;Dt!==null;){switch(t=Dt,h=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)d=e[s],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=t,d=h.memoizedProps,h=h.memoizedState,l=s.stateNode;try{var ue=Cs(s.type,d);e=l.getSnapshotBeforeUpdate(ue,h),l.__reactInternalSnapshotBeforeUpdate=e}catch(ve){Ke(s,s.return,ve)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)kd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":kd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Dt=e;break}Dt=t.return}}function _g(e,t,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:ha(e,s),l&4&&Tl(5,s);break;case 1:if(ha(e,s),l&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(x){Ke(s,s.return,x)}else{var d=Cs(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Ke(s,s.return,x)}}l&64&&mg(s),l&512&&Cl(s,s.return);break;case 3:if(ha(e,s),l&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{im(e,t)}catch(x){Ke(s,s.return,x)}}break;case 27:t===null&&l&4&&bg(s);case 26:case 5:ha(e,s),t===null&&l&4&&vg(s),l&512&&Cl(s,s.return);break;case 12:ha(e,s);break;case 31:ha(e,s),l&4&&Cg(e,s);break;case 13:ha(e,s),l&4&&kg(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=G1.bind(null,s),rS(e,s))));break;case 22:if(l=s.memoizedState!==null||da,!l){t=t!==null&&t.memoizedState!==null||kt,d=da;var h=kt;da=l,(kt=t)&&!h?pa(e,s,(s.subtreeFlags&8772)!==0):ha(e,s),da=d,kt=h}break;case 30:break;default:ha(e,s)}}function Sg(e){var t=e.alternate;t!==null&&(e.alternate=null,Sg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wc(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ct=null,Wt=!1;function fa(e,t,s){for(s=s.child;s!==null;)Tg(e,t,s),s=s.sibling}function Tg(e,t,s){if(Ae&&typeof Ae.onCommitFiberUnmount=="function")try{Ae.onCommitFiberUnmount(vt,s)}catch{}switch(s.tag){case 26:kt||Pn(s,t),fa(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:kt||Pn(s,t);var l=ct,d=Wt;qa(s.type)&&(ct=s.stateNode,Wt=!1),fa(e,t,s),Rl(s.stateNode),ct=l,Wt=d;break;case 5:kt||Pn(s,t);case 6:if(l=ct,d=Wt,ct=null,fa(e,t,s),ct=l,Wt=d,ct!==null)if(Wt)try{(ct.nodeType===9?ct.body:ct.nodeName==="HTML"?ct.ownerDocument.body:ct).removeChild(s.stateNode)}catch(h){Ke(s,t,h)}else try{ct.removeChild(s.stateNode)}catch(h){Ke(s,t,h)}break;case 18:ct!==null&&(Wt?(e=ct,mv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Ci(e)):mv(ct,s.stateNode));break;case 4:l=ct,d=Wt,ct=s.stateNode.containerInfo,Wt=!0,fa(e,t,s),ct=l,Wt=d;break;case 0:case 11:case 14:case 15:za(2,s,t),kt||za(4,s,t),fa(e,t,s);break;case 1:kt||(Pn(s,t),l=s.stateNode,typeof l.componentWillUnmount=="function"&&gg(s,t,l)),fa(e,t,s);break;case 21:fa(e,t,s);break;case 22:kt=(l=kt)||s.memoizedState!==null,fa(e,t,s),kt=l;break;default:fa(e,t,s)}}function Cg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ci(e)}catch(s){Ke(t,t.return,s)}}}function kg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ci(e)}catch(s){Ke(t,t.return,s)}}function O1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new xg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new xg),t;default:throw Error(o(435,e.tag))}}function cr(e,t){var s=O1(e);t.forEach(function(l){if(!s.has(l)){s.add(l);var d=P1.bind(null,e,l);l.then(d,d)}})}function Jt(e,t){var s=t.deletions;if(s!==null)for(var l=0;l<s.length;l++){var d=s[l],h=e,x=t,T=x;e:for(;T!==null;){switch(T.tag){case 27:if(qa(T.type)){ct=T.stateNode,Wt=!1;break e}break;case 5:ct=T.stateNode,Wt=!1;break e;case 3:case 4:ct=T.stateNode.containerInfo,Wt=!0;break e}T=T.return}if(ct===null)throw Error(o(160));Tg(h,x,d),ct=null,Wt=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eg(t,e),t=t.sibling}var In=null;function Eg(e,t){var s=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Jt(t,e),en(e),l&4&&(za(3,e,e.return),Tl(3,e),za(5,e,e.return));break;case 1:Jt(t,e),en(e),l&512&&(kt||s===null||Pn(s,s.return)),l&64&&da&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var d=In;if(Jt(t,e),en(e),l&512&&(kt||s===null||Pn(s,s.return)),l&4){var h=s!==null?s.memoizedState:null;if(l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null){e:{l=e.type,s=e.memoizedProps,d=d.ownerDocument||d;t:switch(l){case"title":h=d.getElementsByTagName("title")[0],(!h||h[Qi]||h[Bt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(l),d.head.insertBefore(h,d.querySelector("head > title"))),zt(h,l,s),h[Bt]=e,wt(h),l=h;break e;case"link":var x=Ev("link","href",d).get(l+(s.href||""));if(x){for(var T=0;T<x.length;T++)if(h=x[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)){x.splice(T,1);break t}}h=d.createElement(l),zt(h,l,s),d.head.appendChild(h);break;case"meta":if(x=Ev("meta","content",d).get(l+(s.content||""))){for(T=0;T<x.length;T++)if(h=x[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)){x.splice(T,1);break t}}h=d.createElement(l),zt(h,l,s),d.head.appendChild(h);break;default:throw Error(o(468,l))}h[Bt]=e,wt(h),l=h}e.stateNode=l}else Nv(d,e.type,e.stateNode);else e.stateNode=kv(d,l,e.memoizedProps);else h!==l?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,l===null?Nv(d,e.type,e.stateNode):kv(d,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Qu(e,e.memoizedProps,s.memoizedProps)}break;case 27:Jt(t,e),en(e),l&512&&(kt||s===null||Pn(s,s.return)),s!==null&&l&4&&Qu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Jt(t,e),en(e),l&512&&(kt||s===null||Pn(s,s.return)),e.flags&32){d=e.stateNode;try{Ys(d,"")}catch(ue){Ke(e,e.return,ue)}}l&4&&e.stateNode!=null&&(d=e.memoizedProps,Qu(e,d,s!==null?s.memoizedProps:d)),l&1024&&(ed=!0);break;case 6:if(Jt(t,e),en(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,s=e.stateNode;try{s.nodeValue=l}catch(ue){Ke(e,e.return,ue)}}break;case 3:if(kr=null,d=In,In=Tr(t.containerInfo),Jt(t,e),In=d,en(e),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Ci(t.containerInfo)}catch(ue){Ke(e,e.return,ue)}ed&&(ed=!1,Ng(e));break;case 4:l=In,In=Tr(e.stateNode.containerInfo),Jt(t,e),en(e),In=l;break;case 12:Jt(t,e),en(e);break;case 31:Jt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,cr(e,l)));break;case 13:Jt(t,e),en(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(dr=Ht()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,cr(e,l)));break;case 22:d=e.memoizedState!==null;var j=s!==null&&s.memoizedState!==null,G=da,Y=kt;if(da=G||d,kt=Y||j,Jt(t,e),kt=Y,da=G,en(e),l&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(s===null||j||da||kt||ks(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){j=s=t;try{if(h=j.stateNode,d)x=h.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{T=j.stateNode;var X=j.memoizedProps.style,P=X!=null&&X.hasOwnProperty("display")?X.display:null;T.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(ue){Ke(j,j.return,ue)}}}else if(t.tag===6){if(s===null){j=t;try{j.stateNode.nodeValue=d?"":j.memoizedProps}catch(ue){Ke(j,j.return,ue)}}}else if(t.tag===18){if(s===null){j=t;try{var $=j.stateNode;d?gv($,!0):gv(j.stateNode,!1)}catch(ue){Ke(j,j.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}l&4&&(l=e.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,cr(e,s))));break;case 19:Jt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,cr(e,l)));break;case 30:break;case 21:break;default:Jt(t,e),en(e)}}function en(e){var t=e.flags;if(t&2){try{for(var s,l=e.return;l!==null;){if(yg(l)){s=l;break}l=l.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var d=s.stateNode,h=Wu(e);rr(e,h,d);break;case 5:var x=s.stateNode;s.flags&32&&(Ys(x,""),s.flags&=-33);var T=Wu(e);rr(e,T,x);break;case 3:case 4:var j=s.stateNode.containerInfo,G=Wu(e);Ju(e,G,j);break;default:throw Error(o(161))}}catch(Y){Ke(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ng(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ng(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ha(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_g(e,t.alternate,t),t=t.sibling}function ks(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:za(4,t,t.return),ks(t);break;case 1:Pn(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&gg(t,t.return,s),ks(t);break;case 27:Rl(t.stateNode);case 26:case 5:Pn(t,t.return),ks(t);break;case 22:t.memoizedState===null&&ks(t);break;case 30:ks(t);break;default:ks(t)}e=e.sibling}}function pa(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,d=e,h=t,x=h.flags;switch(h.tag){case 0:case 11:case 15:pa(d,h,s),Tl(4,h);break;case 1:if(pa(d,h,s),l=h,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(G){Ke(l,l.return,G)}if(l=h,d=l.updateQueue,d!==null){var T=l.stateNode;try{var j=d.shared.hiddenCallbacks;if(j!==null)for(d.shared.hiddenCallbacks=null,d=0;d<j.length;d++)sm(j[d],T)}catch(G){Ke(l,l.return,G)}}s&&x&64&&mg(h),Cl(h,h.return);break;case 27:bg(h);case 26:case 5:pa(d,h,s),s&&l===null&&x&4&&vg(h),Cl(h,h.return);break;case 12:pa(d,h,s);break;case 31:pa(d,h,s),s&&x&4&&Cg(d,h);break;case 13:pa(d,h,s),s&&x&4&&kg(d,h);break;case 22:h.memoizedState===null&&pa(d,h,s),Cl(h,h.return);break;case 30:break;default:pa(d,h,s)}t=t.sibling}}function td(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&ul(s))}function nd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ul(e))}function Ln(e,t,s,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ag(e,t,s,l),t=t.sibling}function Ag(e,t,s,l){var d=t.flags;switch(t.tag){case 0:case 11:case 15:Ln(e,t,s,l),d&2048&&Tl(9,t);break;case 1:Ln(e,t,s,l);break;case 3:Ln(e,t,s,l),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ul(e)));break;case 12:if(d&2048){Ln(e,t,s,l),e=t.stateNode;try{var h=t.memoizedProps,x=h.id,T=h.onPostCommit;typeof T=="function"&&T(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){Ke(t,t.return,j)}}else Ln(e,t,s,l);break;case 31:Ln(e,t,s,l);break;case 13:Ln(e,t,s,l);break;case 23:break;case 22:h=t.stateNode,x=t.alternate,t.memoizedState!==null?h._visibility&2?Ln(e,t,s,l):kl(e,t):h._visibility&2?Ln(e,t,s,l):(h._visibility|=2,hi(e,t,s,l,(t.subtreeFlags&10256)!==0||!1)),d&2048&&td(x,t);break;case 24:Ln(e,t,s,l),d&2048&&nd(t.alternate,t);break;default:Ln(e,t,s,l)}}function hi(e,t,s,l,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,x=t,T=s,j=l,G=x.flags;switch(x.tag){case 0:case 11:case 15:hi(h,x,T,j,d),Tl(8,x);break;case 23:break;case 22:var Y=x.stateNode;x.memoizedState!==null?Y._visibility&2?hi(h,x,T,j,d):kl(h,x):(Y._visibility|=2,hi(h,x,T,j,d)),d&&G&2048&&td(x.alternate,x);break;case 24:hi(h,x,T,j,d),d&&G&2048&&nd(x.alternate,x);break;default:hi(h,x,T,j,d)}t=t.sibling}}function kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,l=t,d=l.flags;switch(l.tag){case 22:kl(s,l),d&2048&&td(l.alternate,l);break;case 24:kl(s,l),d&2048&&nd(l.alternate,l);break;default:kl(s,l)}t=t.sibling}}var El=8192;function pi(e,t,s){if(e.subtreeFlags&El)for(e=e.child;e!==null;)jg(e,t,s),e=e.sibling}function jg(e,t,s){switch(e.tag){case 26:pi(e,t,s),e.flags&El&&e.memoizedState!==null&&xS(s,In,e.memoizedState,e.memoizedProps);break;case 5:pi(e,t,s);break;case 3:case 4:var l=In;In=Tr(e.stateNode.containerInfo),pi(e,t,s),In=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=El,El=16777216,pi(e,t,s),El=l):pi(e,t,s));break;default:pi(e,t,s)}}function wg(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 Nl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];Dt=l,Mg(l,e)}wg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Dg(e),e=e.sibling}function Dg(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&za(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ur(e)):Nl(e);break;default:Nl(e)}}function ur(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];Dt=l,Mg(l,e)}wg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:za(8,t,t.return),ur(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,ur(t));break;default:ur(t)}e=e.sibling}}function Mg(e,t){for(;Dt!==null;){var s=Dt;switch(s.tag){case 0:case 11:case 15:za(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ul(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,Dt=l;else e:for(s=e;Dt!==null;){l=Dt;var d=l.sibling,h=l.return;if(Sg(l),l===s){Dt=null;break e}if(d!==null){d.return=h,Dt=d;break e}Dt=h}}}var B1={getCacheForType:function(e){var t=Lt(St),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Lt(St).controller.signal}},I1=typeof WeakMap=="function"?WeakMap:Map,Pe=0,nt=null,je=null,Me=0,Ye=0,cn=null,Va=!1,mi=!1,ad=!1,ma=0,mt=0,Ha=0,Es=0,sd=0,un=0,gi=0,Al=null,tn=null,id=!1,dr=0,Rg=0,fr=1/0,hr=null,Ga=null,At=0,Pa=null,vi=null,ga=0,ld=0,od=null,Og=null,jl=0,rd=null;function dn(){return(Pe&2)!==0&&Me!==0?Me&-Me:I.T!==null?pd():Xh()}function Bg(){if(un===0)if((Me&536870912)===0||Oe){var e=bn;bn<<=1,(bn&3932160)===0&&(bn=262144),un=e}else un=536870912;return e=on.current,e!==null&&(e.flags|=32),un}function nn(e,t,s){(e===nt&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)&&(yi(e,0),Fa(e,Me,un,!1)),Xi(e,s),((Pe&2)===0||e!==nt)&&(e===nt&&((Pe&2)===0&&(Es|=s),mt===4&&Fa(e,Me,un,!1)),Fn(e))}function Ig(e,t,s){if((Pe&6)!==0)throw Error(o(327));var l=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Zi(e,t),d=l?z1(e,t):ud(e,t,!0),h=l;do{if(d===0){mi&&!l&&Fa(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!L1(s)){d=ud(e,t,!1),h=!1;continue}if(d===2){if(h=t,e.errorRecoveryDisabledLanes&h)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var T=e;d=Al;var j=T.current.memoizedState.isDehydrated;if(j&&(yi(T,x).flags|=256),x=ud(T,x,!1),x!==2){if(ad&&!j){T.errorRecoveryDisabledLanes|=h,Es|=h,d=4;break e}h=tn,tn=d,h!==null&&(tn===null?tn=h:tn.push.apply(tn,h))}d=x}if(h=!1,d!==2)continue}}if(d===1){yi(e,0),Fa(e,t,0,!0);break}e:{switch(l=e,h=d,h){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Fa(l,t,un,!Va);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(d=dr+300-Ht(),10<d)){if(Fa(l,t,un,!Va),To(l,0,!0)!==0)break e;ga=t,l.timeoutHandle=hv(Lg.bind(null,l,s,tn,hr,id,t,un,Es,gi,Va,h,"Throttled",-0,0),d);break e}Lg(l,s,tn,hr,id,t,un,Es,gi,Va,h,null,-0,0)}}break}while(!0);Fn(e)}function Lg(e,t,s,l,d,h,x,T,j,G,Y,X,P,$){if(e.timeoutHandle=-1,X=t.subtreeFlags,X&8192||(X&16785408)===16785408){X={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ta},jg(t,h,X);var ue=(h&62914560)===h?dr-Ht():(h&4194048)===h?Rg-Ht():0;if(ue=_S(X,ue),ue!==null){ga=h,e.cancelPendingCommit=ue($g.bind(null,e,t,h,s,l,d,x,T,j,Y,X,null,P,$)),Fa(e,h,x,!G);return}}$g(e,t,h,s,l,d,x,T,j)}function L1(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var d=s[l],h=d.getSnapshot;d=d.value;try{if(!sn(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 Fa(e,t,s,l){t&=~sd,t&=~Es,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var d=t;0<d;){var h=31-Xe(d),x=1<<h;l[h]=-1,d&=~x}s!==0&&Yh(e,s,t)}function pr(){return(Pe&6)===0?(wl(0),!1):!0}function cd(){if(je!==null){if(Ye===0)var e=je.return;else e=je,ia=vs=null,ku(e),ri=null,fl=0,e=je;for(;e!==null;)pg(e.alternate,e),e=e.return;je=null}}function yi(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,aS(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ga=0,cd(),nt=e,je=s=aa(e.current,null),Me=t,Ye=0,cn=null,Va=!1,mi=Zi(e,t),ad=!1,gi=un=sd=Es=Ha=mt=0,tn=Al=null,id=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var d=31-Xe(l),h=1<<d;t|=e[d],l&=~h}return ma=t,Bo(),s}function Ug(e,t){ke=null,I.H=xl,t===oi||t===Po?(t=em(),Ye=3):t===hu?(t=em(),Ye=4):Ye=t===Hu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,cn=t,je===null&&(mt=1,ar(e,Tn(t,e.current)))}function zg(){var e=on.current;return e===null?!0:(Me&4194048)===Me?Nn===null:(Me&62914560)===Me||(Me&536870912)!==0?e===Nn:!1}function Vg(){var e=I.H;return I.H=xl,e===null?xl:e}function Hg(){var e=I.A;return I.A=B1,e}function mr(){mt=4,Va||(Me&4194048)!==Me&&on.current!==null||(mi=!0),(Ha&134217727)===0&&(Es&134217727)===0||nt===null||Fa(nt,Me,un,!1)}function ud(e,t,s){var l=Pe;Pe|=2;var d=Vg(),h=Hg();(nt!==e||Me!==t)&&(hr=null,yi(e,t)),t=!1;var x=mt;e:do try{if(Ye!==0&&je!==null){var T=je,j=cn;switch(Ye){case 8:cd(),x=6;break e;case 3:case 2:case 9:case 6:on.current===null&&(t=!0);var G=Ye;if(Ye=0,cn=null,bi(e,T,j,G),s&&mi){x=0;break e}break;default:G=Ye,Ye=0,cn=null,bi(e,T,j,G)}}U1(),x=mt;break}catch(Y){Ug(e,Y)}while(!0);return t&&e.shellSuspendCounter++,ia=vs=null,Pe=l,I.H=d,I.A=h,je===null&&(nt=null,Me=0,Bo()),x}function U1(){for(;je!==null;)Gg(je)}function z1(e,t){var s=Pe;Pe|=2;var l=Vg(),d=Hg();nt!==e||Me!==t?(hr=null,fr=Ht()+500,yi(e,t)):mi=Zi(e,t);e:do try{if(Ye!==0&&je!==null){t=je;var h=cn;t:switch(Ye){case 1:Ye=0,cn=null,bi(e,t,h,1);break;case 2:case 9:if(Wp(h)){Ye=0,cn=null,Pg(t);break}t=function(){Ye!==2&&Ye!==9||nt!==e||(Ye=7),Fn(e)},h.then(t,t);break e;case 3:Ye=7;break e;case 4:Ye=5;break e;case 7:Wp(h)?(Ye=0,cn=null,Pg(t)):(Ye=0,cn=null,bi(e,t,h,7));break;case 5:var x=null;switch(je.tag){case 26:x=je.memoizedState;case 5:case 27:var T=je;if(x?Av(x):T.stateNode.complete){Ye=0,cn=null;var j=T.sibling;if(j!==null)je=j;else{var G=T.return;G!==null?(je=G,gr(G)):je=null}break t}}Ye=0,cn=null,bi(e,t,h,5);break;case 6:Ye=0,cn=null,bi(e,t,h,6);break;case 8:cd(),mt=6;break e;default:throw Error(o(462))}}V1();break}catch(Y){Ug(e,Y)}while(!0);return ia=vs=null,I.H=l,I.A=d,Pe=s,je!==null?0:(nt=null,Me=0,Bo(),mt)}function V1(){for(;je!==null&&!_o();)Gg(je)}function Gg(e){var t=fg(e.alternate,e,ma);e.memoizedProps=e.pendingProps,t===null?gr(e):je=t}function Pg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=lg(s,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=lg(s,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:ku(t);default:pg(s,t),t=je=Hp(t,ma),t=fg(s,t,ma)}e.memoizedProps=e.pendingProps,t===null?gr(e):je=t}function bi(e,t,s,l){ia=vs=null,ku(t),ri=null,fl=0;var d=t.return;try{if(A1(e,d,t,s,Me)){mt=1,ar(e,Tn(s,e.current)),je=null;return}}catch(h){if(d!==null)throw je=d,h;mt=1,ar(e,Tn(s,e.current)),je=null;return}t.flags&32768?(Oe||l===1?e=!0:mi||(Me&536870912)!==0?e=!1:(Va=e=!0,(l===2||l===9||l===3||l===6)&&(l=on.current,l!==null&&l.tag===13&&(l.flags|=16384))),Fg(t,e)):gr(t)}function gr(e){var t=e;do{if((t.flags&32768)!==0){Fg(t,Va);return}e=t.return;var s=D1(t.alternate,t,ma);if(s!==null){je=s;return}if(t=t.sibling,t!==null){je=t;return}je=t=e}while(t!==null);mt===0&&(mt=5)}function Fg(e,t){do{var s=M1(e.alternate,e);if(s!==null){s.flags&=32767,je=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){je=e;return}je=e=s}while(e!==null);mt=6,je=null}function $g(e,t,s,l,d,h,x,T,j){e.cancelPendingCommit=null;do vr();while(At!==0);if((Pe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(h=t.lanes|t.childLanes,h|=Wc,b_(e,s,h,x,T,j),e===nt&&(je=nt=null,Me=0),vi=t,Pa=e,ga=s,ld=h,od=d,Og=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,F1(ce,function(){return Xg(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=I.T,I.T=null,d=D.p,D.p=2,x=Pe,Pe|=4;try{R1(e,t,s)}finally{Pe=x,D.p=d,I.T=l}}At=1,qg(),Yg(),Kg()}}function qg(){if(At===1){At=0;var e=Pa,t=vi,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=I.T,I.T=null;var l=D.p;D.p=2;var d=Pe;Pe|=4;try{Eg(t,e);var h=Sd,x=Mp(e.containerInfo),T=h.focusedElem,j=h.selectionRange;if(x!==T&&T&&T.ownerDocument&&Dp(T.ownerDocument.documentElement,T)){if(j!==null&&Yc(T)){var G=j.start,Y=j.end;if(Y===void 0&&(Y=G),"selectionStart"in T)T.selectionStart=G,T.selectionEnd=Math.min(Y,T.value.length);else{var X=T.ownerDocument||document,P=X&&X.defaultView||window;if(P.getSelection){var $=P.getSelection(),ue=T.textContent.length,ve=Math.min(j.start,ue),Je=j.end===void 0?ve:Math.min(j.end,ue);!$.extend&&ve>Je&&(x=Je,Je=ve,ve=x);var L=wp(T,ve),w=wp(T,Je);if(L&&w&&($.rangeCount!==1||$.anchorNode!==L.node||$.anchorOffset!==L.offset||$.focusNode!==w.node||$.focusOffset!==w.offset)){var H=X.createRange();H.setStart(L.node,L.offset),$.removeAllRanges(),ve>Je?($.addRange(H),$.extend(w.node,w.offset)):(H.setEnd(w.node,w.offset),$.addRange(H))}}}}for(X=[],$=T;$=$.parentNode;)$.nodeType===1&&X.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<X.length;T++){var K=X[T];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}jr=!!_d,Sd=_d=null}finally{Pe=d,D.p=l,I.T=s}}e.current=t,At=2}}function Yg(){if(At===2){At=0;var e=Pa,t=vi,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=I.T,I.T=null;var l=D.p;D.p=2;var d=Pe;Pe|=4;try{_g(e,t.alternate,t)}finally{Pe=d,D.p=l,I.T=s}}At=3}}function Kg(){if(At===4||At===3){At=0,So();var e=Pa,t=vi,s=ga,l=Og;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?At=5:(At=0,vi=Pa=null,Zg(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Ga=null),Ac(s),t=t.stateNode,Ae&&typeof Ae.onCommitFiberRoot=="function")try{Ae.onCommitFiberRoot(vt,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=I.T,d=D.p,D.p=2,I.T=null;try{for(var h=e.onRecoverableError,x=0;x<l.length;x++){var T=l[x];h(T.value,{componentStack:T.stack})}}finally{I.T=t,D.p=d}}(ga&3)!==0&&vr(),Fn(e),d=e.pendingLanes,(s&261930)!==0&&(d&42)!==0?e===rd?jl++:(jl=0,rd=e):jl=0,wl(0)}}function Zg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ul(t)))}function vr(){return qg(),Yg(),Kg(),Xg()}function Xg(){if(At!==5)return!1;var e=Pa,t=ld;ld=0;var s=Ac(ga),l=I.T,d=D.p;try{D.p=32>s?32:s,I.T=null,s=od,od=null;var h=Pa,x=ga;if(At=0,vi=Pa=null,ga=0,(Pe&6)!==0)throw Error(o(331));var T=Pe;if(Pe|=4,Dg(h.current),Ag(h,h.current,x,s),Pe=T,wl(0,!1),Ae&&typeof Ae.onPostCommitFiberRoot=="function")try{Ae.onPostCommitFiberRoot(vt,h)}catch{}return!0}finally{D.p=d,I.T=l,Zg(e,t)}}function Qg(e,t,s){t=Tn(s,t),t=Vu(e.stateNode,t,2),e=Ia(e,t,2),e!==null&&(Xi(e,2),Fn(e))}function Ke(e,t,s){if(e.tag===3)Qg(e,e,s);else for(;t!==null;){if(t.tag===3){Qg(t,e,s);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ga===null||!Ga.has(l))){e=Tn(s,e),s=Wm(2),l=Ia(t,s,2),l!==null&&(Jm(s,l,t,e),Xi(l,2),Fn(l));break}}t=t.return}}function dd(e,t,s){var l=e.pingCache;if(l===null){l=e.pingCache=new I1;var d=new Set;l.set(t,d)}else d=l.get(t),d===void 0&&(d=new Set,l.set(t,d));d.has(s)||(ad=!0,d.add(s),e=H1.bind(null,e,t,s),t.then(e,e))}function H1(e,t,s){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,nt===e&&(Me&s)===s&&(mt===4||mt===3&&(Me&62914560)===Me&&300>Ht()-dr?(Pe&2)===0&&yi(e,0):sd|=s,gi===Me&&(gi=0)),Fn(e)}function Wg(e,t){t===0&&(t=qh()),e=ps(e,t),e!==null&&(Xi(e,t),Fn(e))}function G1(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Wg(e,s)}function P1(e,t){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),Wg(e,s)}function F1(e,t){return zs(e,t)}var yr=null,xi=null,fd=!1,br=!1,hd=!1,$a=0;function Fn(e){e!==xi&&e.next===null&&(xi===null?yr=xi=e:xi=xi.next=e),br=!0,fd||(fd=!0,q1())}function wl(e,t){if(!hd&&br){hd=!0;do for(var s=!1,l=yr;l!==null;){if(e!==0){var d=l.pendingLanes;if(d===0)var h=0;else{var x=l.suspendedLanes,T=l.pingedLanes;h=(1<<31-Xe(42|e)+1)-1,h&=d&~(x&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,nv(l,h))}else h=Me,h=To(l,l===nt?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||Zi(l,h)||(s=!0,nv(l,h));l=l.next}while(s);hd=!1}}function $1(){Jg()}function Jg(){br=fd=!1;var e=0;$a!==0&&nS()&&(e=$a);for(var t=Ht(),s=null,l=yr;l!==null;){var d=l.next,h=ev(l,t);h===0?(l.next=null,s===null?yr=d:s.next=d,d===null&&(xi=s)):(s=l,(e!==0||(h&3)!==0)&&(br=!0)),l=d}At!==0&&At!==5||wl(e),$a!==0&&($a=0)}function ev(e,t){for(var s=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var x=31-Xe(h),T=1<<x,j=d[x];j===-1?((T&s)===0||(T&l)!==0)&&(d[x]=y_(T,t)):j<=t&&(e.expiredLanes|=T),h&=~T}if(t=nt,s=Me,s=To(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===t&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Vs(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Zi(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(l!==null&&Vs(l),Ac(s)){case 2:case 8:s=le;break;case 32:s=ce;break;case 268435456:s=xe;break;default:s=ce}return l=tv.bind(null,e),s=zs(s,l),e.callbackPriority=t,e.callbackNode=s,t}return l!==null&&l!==null&&Vs(l),e.callbackPriority=2,e.callbackNode=null,2}function tv(e,t){if(At!==0&&At!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(vr()&&e.callbackNode!==s)return null;var l=Me;return l=To(e,e===nt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Ig(e,l,t),ev(e,Ht()),e.callbackNode!=null&&e.callbackNode===s?tv.bind(null,e):null)}function nv(e,t){if(vr())return null;Ig(e,t,!0)}function q1(){sS(function(){(Pe&6)!==0?zs(Z,$1):Jg()})}function pd(){if($a===0){var e=ii;e===0&&(e=Ea,Ea<<=1,(Ea&261888)===0&&(Ea=256)),$a=e}return $a}function av(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:No(""+e)}function sv(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 Y1(e,t,s,l,d){if(t==="submit"&&s&&s.stateNode===d){var h=av((d[Xt]||null).action),x=l.submitter;x&&(t=(t=x[Xt]||null)?av(t.formAction):x.getAttribute("formAction"),t!==null&&(h=t,x=null));var T=new Do("action","action",null,l,d);e.push({event:T,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if($a!==0){var j=x?sv(d,x):new FormData(d);Ou(s,{pending:!0,data:j,method:d.method,action:h},null,j)}}else typeof h=="function"&&(T.preventDefault(),j=x?sv(d,x):new FormData(d),Ou(s,{pending:!0,data:j,method:d.method,action:h},h,j))},currentTarget:d}]})}}for(var md=0;md<Qc.length;md++){var gd=Qc[md],K1=gd.toLowerCase(),Z1=gd[0].toUpperCase()+gd.slice(1);Bn(K1,"on"+Z1)}Bn(Bp,"onAnimationEnd"),Bn(Ip,"onAnimationIteration"),Bn(Lp,"onAnimationStart"),Bn("dblclick","onDoubleClick"),Bn("focusin","onFocus"),Bn("focusout","onBlur"),Bn(d1,"onTransitionRun"),Bn(f1,"onTransitionStart"),Bn(h1,"onTransitionCancel"),Bn(Up,"onTransitionEnd"),$s("onMouseEnter",["mouseout","mouseover"]),$s("onMouseLeave",["mouseout","mouseover"]),$s("onPointerEnter",["pointerout","pointerover"]),$s("onPointerLeave",["pointerout","pointerover"]),us("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),us("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),us("onBeforeInput",["compositionend","keypress","textInput","paste"]),us("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),us("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),us("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dl="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(" "),X1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Dl));function iv(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],d=l.event;l=l.listeners;e:{var h=void 0;if(t)for(var x=l.length-1;0<=x;x--){var T=l[x],j=T.instance,G=T.currentTarget;if(T=T.listener,j!==h&&d.isPropagationStopped())break e;h=T,d.currentTarget=G;try{h(d)}catch(Y){Oo(Y)}d.currentTarget=null,h=j}else for(x=0;x<l.length;x++){if(T=l[x],j=T.instance,G=T.currentTarget,T=T.listener,j!==h&&d.isPropagationStopped())break e;h=T,d.currentTarget=G;try{h(d)}catch(Y){Oo(Y)}d.currentTarget=null,h=j}}}}function we(e,t){var s=t[jc];s===void 0&&(s=t[jc]=new Set);var l=e+"__bubble";s.has(l)||(lv(t,e,2,!1),s.add(l))}function vd(e,t,s){var l=0;t&&(l|=4),lv(s,e,l,t)}var xr="_reactListening"+Math.random().toString(36).slice(2);function yd(e){if(!e[xr]){e[xr]=!0,Jh.forEach(function(s){s!=="selectionchange"&&(X1.has(s)||vd(s,!1,e),vd(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xr]||(t[xr]=!0,vd("selectionchange",!1,t))}}function lv(e,t,s,l){switch(Bv(t)){case 2:var d=CS;break;case 8:d=kS;break;default:d=Rd}s=d.bind(null,t,s,e),d=void 0,!Uc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),l?d!==void 0?e.addEventListener(t,s,{capture:!0,passive:d}):e.addEventListener(t,s,!0):d!==void 0?e.addEventListener(t,s,{passive:d}):e.addEventListener(t,s,!1)}function bd(e,t,s,l,d){var h=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var x=l.tag;if(x===3||x===4){var T=l.stateNode.containerInfo;if(T===d)break;if(x===4)for(x=l.return;x!==null;){var j=x.tag;if((j===3||j===4)&&x.stateNode.containerInfo===d)return;x=x.return}for(;T!==null;){if(x=Gs(T),x===null)return;if(j=x.tag,j===5||j===6||j===26||j===27){l=h=x;continue e}T=T.parentNode}}l=l.return}dp(function(){var G=h,Y=Ic(s),X=[];e:{var P=zp.get(e);if(P!==void 0){var $=Do,ue=e;switch(e){case"keypress":if(jo(s)===0)break e;case"keydown":case"keyup":$=P_;break;case"focusin":ue="focus",$=Gc;break;case"focusout":ue="blur",$=Gc;break;case"beforeblur":case"afterblur":$=Gc;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":$=pp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=D_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=q_;break;case Bp:case Ip:case Lp:$=O_;break;case Up:$=K_;break;case"scroll":case"scrollend":$=j_;break;case"wheel":$=X_;break;case"copy":case"cut":case"paste":$=I_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=gp;break;case"toggle":case"beforetoggle":$=W_}var ve=(t&4)!==0,Je=!ve&&(e==="scroll"||e==="scrollend"),L=ve?P!==null?P+"Capture":null:P;ve=[];for(var w=G,H;w!==null;){var K=w;if(H=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||H===null||L===null||(K=Ji(w,L),K!=null&&ve.push(Ml(w,K,H))),Je)break;w=w.return}0<ve.length&&(P=new $(P,ue,null,s,Y),X.push({event:P,listeners:ve}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",$=e==="mouseout"||e==="pointerout",P&&s!==Bc&&(ue=s.relatedTarget||s.fromElement)&&(Gs(ue)||ue[Hs]))break e;if(($||P)&&(P=Y.window===Y?Y:(P=Y.ownerDocument)?P.defaultView||P.parentWindow:window,$?(ue=s.relatedTarget||s.toElement,$=G,ue=ue?Gs(ue):null,ue!==null&&(Je=f(ue),ve=ue.tag,ue!==Je||ve!==5&&ve!==27&&ve!==6)&&(ue=null)):($=null,ue=G),$!==ue)){if(ve=pp,K="onMouseLeave",L="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(ve=gp,K="onPointerLeave",L="onPointerEnter",w="pointer"),Je=$==null?P:Wi($),H=ue==null?P:Wi(ue),P=new ve(K,w+"leave",$,s,Y),P.target=Je,P.relatedTarget=H,K=null,Gs(Y)===G&&(ve=new ve(L,w+"enter",ue,s,Y),ve.target=H,ve.relatedTarget=Je,K=ve),Je=K,$&&ue)t:{for(ve=Q1,L=$,w=ue,H=0,K=L;K;K=ve(K))H++;K=0;for(var he=w;he;he=ve(he))K++;for(;0<H-K;)L=ve(L),H--;for(;0<K-H;)w=ve(w),K--;for(;H--;){if(L===w||w!==null&&L===w.alternate){ve=L;break t}L=ve(L),w=ve(w)}ve=null}else ve=null;$!==null&&ov(X,P,$,ve,!1),ue!==null&&Je!==null&&ov(X,Je,ue,ve,!0)}}e:{if(P=G?Wi(G):window,$=P.nodeName&&P.nodeName.toLowerCase(),$==="select"||$==="input"&&P.type==="file")var Ue=Cp;else if(Sp(P))if(kp)Ue=r1;else{Ue=l1;var fe=i1}else $=P.nodeName,!$||$.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?G&&Oc(G.elementType)&&(Ue=Cp):Ue=o1;if(Ue&&(Ue=Ue(e,G))){Tp(X,Ue,s,Y);break e}fe&&fe(e,P,G),e==="focusout"&&G&&P.type==="number"&&G.memoizedProps.value!=null&&Rc(P,"number",P.value)}switch(fe=G?Wi(G):window,e){case"focusin":(Sp(fe)||fe.contentEditable==="true")&&(Qs=fe,Kc=G,ol=null);break;case"focusout":ol=Kc=Qs=null;break;case"mousedown":Zc=!0;break;case"contextmenu":case"mouseup":case"dragend":Zc=!1,Rp(X,s,Y);break;case"selectionchange":if(u1)break;case"keydown":case"keyup":Rp(X,s,Y)}var Ee;if(Fc)e:{switch(e){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else Xs?xp(e,s)&&(Re="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Re="onCompositionStart");Re&&(vp&&s.locale!=="ko"&&(Xs||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&Xs&&(Ee=fp()):(ja=Y,zc="value"in ja?ja.value:ja.textContent,Xs=!0)),fe=_r(G,Re),0<fe.length&&(Re=new mp(Re,e,null,s,Y),X.push({event:Re,listeners:fe}),Ee?Re.data=Ee:(Ee=_p(s),Ee!==null&&(Re.data=Ee)))),(Ee=e1?t1(e,s):n1(e,s))&&(Re=_r(G,"onBeforeInput"),0<Re.length&&(fe=new mp("onBeforeInput","beforeinput",null,s,Y),X.push({event:fe,listeners:Re}),fe.data=Ee)),Y1(X,e,G,s,Y)}iv(X,t)})}function Ml(e,t,s){return{instance:e,listener:t,currentTarget:s}}function _r(e,t){for(var s=t+"Capture",l=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=Ji(e,s),d!=null&&l.unshift(Ml(e,d,h)),d=Ji(e,t),d!=null&&l.push(Ml(e,d,h))),e.tag===3)return l;e=e.return}return[]}function Q1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ov(e,t,s,l,d){for(var h=t._reactName,x=[];s!==null&&s!==l;){var T=s,j=T.alternate,G=T.stateNode;if(T=T.tag,j!==null&&j===l)break;T!==5&&T!==26&&T!==27||G===null||(j=G,d?(G=Ji(s,h),G!=null&&x.unshift(Ml(s,G,j))):d||(G=Ji(s,h),G!=null&&x.push(Ml(s,G,j)))),s=s.return}x.length!==0&&e.push({event:t,listeners:x})}var W1=/\r\n?/g,J1=/\u0000|\uFFFD/g;function rv(e){return(typeof e=="string"?e:""+e).replace(W1,`
25
- `).replace(J1,"")}function cv(e,t){return t=rv(t),rv(e)===t}function We(e,t,s,l,d,h){switch(s){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Ys(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Ys(e,""+l);break;case"className":ko(e,"class",l);break;case"tabIndex":ko(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ko(e,s,l);break;case"style":cp(e,l,h);break;case"data":if(t!=="object"){ko(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=No(""+l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(s==="formAction"?(t!=="input"&&We(e,t,"name",d.name,d,null),We(e,t,"formEncType",d.formEncType,d,null),We(e,t,"formMethod",d.formMethod,d,null),We(e,t,"formTarget",d.formTarget,d,null)):(We(e,t,"encType",d.encType,d,null),We(e,t,"method",d.method,d,null),We(e,t,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=No(""+l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=ta);break;case"onScroll":l!=null&&we("scroll",e);break;case"onScrollEnd":l!=null&&we("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}s=No(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""+l):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":we("beforetoggle",e),we("toggle",e),Co(e,"popover",l);break;case"xlinkActuate":ea(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":ea(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":ea(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":ea(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":ea(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":ea(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":ea(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":ea(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":ea(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Co(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=N_.get(s)||s,Co(e,s,l))}}function xd(e,t,s,l,d,h){switch(s){case"style":cp(e,l,h);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof l=="string"?Ys(e,l):(typeof l=="number"||typeof l=="bigint")&&Ys(e,""+l);break;case"onScroll":l!=null&&we("scroll",e);break;case"onScrollEnd":l!=null&&we("scrollend",e);break;case"onClick":l!=null&&(e.onclick=ta);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ep.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[Xt]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(t,h,d),typeof l=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,l,d);break e}s in e?e[s]=l:l===!0?e.setAttribute(s,""):Co(e,s,l)}}}function zt(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 l=!1,d=!1,h;for(h in s)if(s.hasOwnProperty(h)){var x=s[h];if(x!=null)switch(h){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:We(e,t,h,x,s,null)}}d&&We(e,t,"srcSet",s.srcSet,s,null),l&&We(e,t,"src",s.src,s,null);return;case"input":we("invalid",e);var T=h=x=d=null,j=null,G=null;for(l in s)if(s.hasOwnProperty(l)){var Y=s[l];if(Y!=null)switch(l){case"name":d=Y;break;case"type":x=Y;break;case"checked":j=Y;break;case"defaultChecked":G=Y;break;case"value":h=Y;break;case"defaultValue":T=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(o(137,t));break;default:We(e,t,l,Y,s,null)}}ip(e,h,T,j,G,x,d,!1);return;case"select":we("invalid",e),l=x=h=null;for(d in s)if(s.hasOwnProperty(d)&&(T=s[d],T!=null))switch(d){case"value":h=T;break;case"defaultValue":x=T;break;case"multiple":l=T;default:We(e,t,d,T,s,null)}t=h,s=x,e.multiple=!!l,t!=null?qs(e,!!l,t,!1):s!=null&&qs(e,!!l,s,!0);return;case"textarea":we("invalid",e),h=d=l=null;for(x in s)if(s.hasOwnProperty(x)&&(T=s[x],T!=null))switch(x){case"value":l=T;break;case"defaultValue":d=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(o(91));break;default:We(e,t,x,T,s,null)}op(e,l,d,h);return;case"option":for(j in s)if(s.hasOwnProperty(j)&&(l=s[j],l!=null))switch(j){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:We(e,t,j,l,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(l=0;l<Dl.length;l++)we(Dl[l],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(G in s)if(s.hasOwnProperty(G)&&(l=s[G],l!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:We(e,t,G,l,s,null)}return;default:if(Oc(t)){for(Y in s)s.hasOwnProperty(Y)&&(l=s[Y],l!==void 0&&xd(e,t,Y,l,s,void 0));return}}for(T in s)s.hasOwnProperty(T)&&(l=s[T],l!=null&&We(e,t,T,l,s,null))}function eS(e,t,s,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,x=null,T=null,j=null,G=null,Y=null;for($ in s){var X=s[$];if(s.hasOwnProperty($)&&X!=null)switch($){case"checked":break;case"value":break;case"defaultValue":j=X;default:l.hasOwnProperty($)||We(e,t,$,null,l,X)}}for(var P in l){var $=l[P];if(X=s[P],l.hasOwnProperty(P)&&($!=null||X!=null))switch(P){case"type":h=$;break;case"name":d=$;break;case"checked":G=$;break;case"defaultChecked":Y=$;break;case"value":x=$;break;case"defaultValue":T=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(o(137,t));break;default:$!==X&&We(e,t,P,$,l,X)}}Mc(e,x,T,j,G,Y,h,d);return;case"select":$=x=T=P=null;for(h in s)if(j=s[h],s.hasOwnProperty(h)&&j!=null)switch(h){case"value":break;case"multiple":$=j;default:l.hasOwnProperty(h)||We(e,t,h,null,l,j)}for(d in l)if(h=l[d],j=s[d],l.hasOwnProperty(d)&&(h!=null||j!=null))switch(d){case"value":P=h;break;case"defaultValue":T=h;break;case"multiple":x=h;default:h!==j&&We(e,t,d,h,l,j)}t=T,s=x,l=$,P!=null?qs(e,!!s,P,!1):!!l!=!!s&&(t!=null?qs(e,!!s,t,!0):qs(e,!!s,s?[]:"",!1));return;case"textarea":$=P=null;for(T in s)if(d=s[T],s.hasOwnProperty(T)&&d!=null&&!l.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:We(e,t,T,null,l,d)}for(x in l)if(d=l[x],h=s[x],l.hasOwnProperty(x)&&(d!=null||h!=null))switch(x){case"value":P=d;break;case"defaultValue":$=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:d!==h&&We(e,t,x,d,l,h)}lp(e,P,$);return;case"option":for(var ue in s)if(P=s[ue],s.hasOwnProperty(ue)&&P!=null&&!l.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:We(e,t,ue,null,l,P)}for(j in l)if(P=l[j],$=s[j],l.hasOwnProperty(j)&&P!==$&&(P!=null||$!=null))switch(j){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:We(e,t,j,P,l,$)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in s)P=s[ve],s.hasOwnProperty(ve)&&P!=null&&!l.hasOwnProperty(ve)&&We(e,t,ve,null,l,P);for(G in l)if(P=l[G],$=s[G],l.hasOwnProperty(G)&&P!==$&&(P!=null||$!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(o(137,t));break;default:We(e,t,G,P,l,$)}return;default:if(Oc(t)){for(var Je in s)P=s[Je],s.hasOwnProperty(Je)&&P!==void 0&&!l.hasOwnProperty(Je)&&xd(e,t,Je,void 0,l,P);for(Y in l)P=l[Y],$=s[Y],!l.hasOwnProperty(Y)||P===$||P===void 0&&$===void 0||xd(e,t,Y,P,l,$);return}}for(var L in s)P=s[L],s.hasOwnProperty(L)&&P!=null&&!l.hasOwnProperty(L)&&We(e,t,L,null,l,P);for(X in l)P=l[X],$=s[X],!l.hasOwnProperty(X)||P===$||P==null&&$==null||We(e,t,X,P,l,$)}function uv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var d=s[l],h=d.transferSize,x=d.initiatorType,T=d.duration;if(h&&T&&uv(x)){for(x=0,T=d.responseEnd,l+=1;l<s.length;l++){var j=s[l],G=j.startTime;if(G>T)break;var Y=j.transferSize,X=j.initiatorType;Y&&uv(X)&&(j=j.responseEnd,x+=Y*(j<T?1:(T-G)/(j-G)))}if(--l,t+=8*(h+x)/(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 _d=null,Sd=null;function Sr(e){return e.nodeType===9?e:e.ownerDocument}function dv(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 fv(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Td(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Cd=null;function nS(){var e=window.event;return e&&e.type==="popstate"?e===Cd?!1:(Cd=e,!0):(Cd=null,!1)}var hv=typeof setTimeout=="function"?setTimeout:void 0,aS=typeof clearTimeout=="function"?clearTimeout:void 0,pv=typeof Promise=="function"?Promise:void 0,sS=typeof queueMicrotask=="function"?queueMicrotask:typeof pv<"u"?function(e){return pv.resolve(null).then(e).catch(iS)}:hv;function iS(e){setTimeout(function(){throw e})}function qa(e){return e==="head"}function mv(e,t){var s=t,l=0;do{var d=s.nextSibling;if(e.removeChild(s),d&&d.nodeType===8)if(s=d.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(d),Ci(t);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Rl(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Rl(s);for(var h=s.firstChild;h;){var x=h.nextSibling,T=h.nodeName;h[Qi]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=x}}else s==="body"&&Rl(e.ownerDocument.body);s=d}while(s);Ci(t)}function gv(e,t){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function kd(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":kd(s),wc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function lS(e,t,s,l){for(;e.nodeType===1;){var d=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Qi])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=An(e.nextSibling),e===null)break}return null}function oS(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=An(e.nextSibling),e===null))return null;return e}function vv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=An(e.nextSibling),e===null))return null;return e}function Ed(e){return e.data==="$?"||e.data==="$~"}function Nd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function rS(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var l=function(){t(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function An(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 Ad=null;function yv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return An(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function bv(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 xv(e,t,s){switch(t=Sr(s),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Rl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wc(e)}var jn=new Map,_v=new Set;function Tr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var va=D.d;D.d={f:cS,r:uS,D:dS,C:fS,L:hS,m:pS,X:gS,S:mS,M:vS};function cS(){var e=va.f(),t=pr();return e||t}function uS(e){var t=Ps(e);t!==null&&t.tag===5&&t.type==="form"?Um(t):va.r(e)}var _i=typeof document>"u"?null:document;function Sv(e,t,s){var l=_i;if(l&&typeof t=="string"&&t){var d=_n(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof s=="string"&&(d+='[crossorigin="'+s+'"]'),_v.has(d)||(_v.add(d),e={rel:e,crossOrigin:s,href:t},l.querySelector(d)===null&&(t=l.createElement("link"),zt(t,"link",e),wt(t),l.head.appendChild(t)))}}function dS(e){va.D(e),Sv("dns-prefetch",e,null)}function fS(e,t){va.C(e,t),Sv("preconnect",e,t)}function hS(e,t,s){va.L(e,t,s);var l=_i;if(l&&e&&t){var d='link[rel="preload"][as="'+_n(t)+'"]';t==="image"&&s&&s.imageSrcSet?(d+='[imagesrcset="'+_n(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(d+='[imagesizes="'+_n(s.imageSizes)+'"]')):d+='[href="'+_n(e)+'"]';var h=d;switch(t){case"style":h=Si(e);break;case"script":h=Ti(e)}jn.has(h)||(e=v({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),jn.set(h,e),l.querySelector(d)!==null||t==="style"&&l.querySelector(Ol(h))||t==="script"&&l.querySelector(Bl(h))||(t=l.createElement("link"),zt(t,"link",e),wt(t),l.head.appendChild(t)))}}function pS(e,t){va.m(e,t);var s=_i;if(s&&e){var l=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+_n(l)+'"][href="'+_n(e)+'"]',h=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ti(e)}if(!jn.has(h)&&(e=v({rel:"modulepreload",href:e},t),jn.set(h,e),s.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Bl(h)))return}l=s.createElement("link"),zt(l,"link",e),wt(l),s.head.appendChild(l)}}}function mS(e,t,s){va.S(e,t,s);var l=_i;if(l&&e){var d=Fs(l).hoistableStyles,h=Si(e);t=t||"default";var x=d.get(h);if(!x){var T={loading:0,preload:null};if(x=l.querySelector(Ol(h)))T.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},s),(s=jn.get(h))&&jd(e,s);var j=x=l.createElement("link");wt(j),zt(j,"link",e),j._p=new Promise(function(G,Y){j.onload=G,j.onerror=Y}),j.addEventListener("load",function(){T.loading|=1}),j.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Cr(x,t,l)}x={type:"stylesheet",instance:x,count:1,state:T},d.set(h,x)}}}function gS(e,t){va.X(e,t);var s=_i;if(s&&e){var l=Fs(s).hoistableScripts,d=Ti(e),h=l.get(d);h||(h=s.querySelector(Bl(d)),h||(e=v({src:e,async:!0},t),(t=jn.get(d))&&wd(e,t),h=s.createElement("script"),wt(h),zt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function vS(e,t){va.M(e,t);var s=_i;if(s&&e){var l=Fs(s).hoistableScripts,d=Ti(e),h=l.get(d);h||(h=s.querySelector(Bl(d)),h||(e=v({src:e,async:!0,type:"module"},t),(t=jn.get(d))&&wd(e,t),h=s.createElement("script"),wt(h),zt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function Tv(e,t,s,l){var d=(d=Ot.current)?Tr(d):null;if(!d)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Si(s.href),s=Fs(d).hoistableStyles,l=s.get(t),l||(l={type:"style",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Si(s.href);var h=Fs(d).hoistableStyles,x=h.get(e);if(x||(d=d.ownerDocument||d,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,x),(h=d.querySelector(Ol(e)))&&!h._p&&(x.instance=h,x.state.loading=5),jn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},jn.set(e,s),h||yS(d,e,s,x.state))),t&&l===null)throw Error(o(528,""));return x}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ti(s),s=Fs(d).hoistableScripts,l=s.get(t),l||(l={type:"script",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Si(e){return'href="'+_n(e)+'"'}function Ol(e){return'link[rel="stylesheet"]['+e+"]"}function Cv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function yS(e,t,s,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),zt(t,"link",s),wt(t),e.head.appendChild(t))}function Ti(e){return'[src="'+_n(e)+'"]'}function Bl(e){return"script[async]"+e}function kv(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+_n(s.href)+'"]');if(l)return t.instance=l,wt(l),l;var d=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),wt(l),zt(l,"style",d),Cr(l,s.precedence,e),t.instance=l;case"stylesheet":d=Si(s.href);var h=e.querySelector(Ol(d));if(h)return t.state.loading|=4,t.instance=h,wt(h),h;l=Cv(s),(d=jn.get(d))&&jd(l,d),h=(e.ownerDocument||e).createElement("link"),wt(h);var x=h;return x._p=new Promise(function(T,j){x.onload=T,x.onerror=j}),zt(h,"link",l),t.state.loading|=4,Cr(h,s.precedence,e),t.instance=h;case"script":return h=Ti(s.src),(d=e.querySelector(Bl(h)))?(t.instance=d,wt(d),d):(l=s,(d=jn.get(h))&&(l=v({},s),wd(l,d)),e=e.ownerDocument||e,d=e.createElement("script"),wt(d),zt(d,"link",l),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Cr(l,s.precedence,e));return t.instance}function Cr(e,t,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,h=d,x=0;x<l.length;x++){var T=l[x];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 jd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function wd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var kr=null;function Ev(e,t,s){if(kr===null){var l=new Map,d=kr=new Map;d.set(s,l)}else d=kr,l=d.get(s),l||(l=new Map,d.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),d=0;d<s.length;d++){var h=s[d];if(!(h[Qi]||h[Bt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var x=h.getAttribute(t)||"";x=e+x;var T=l.get(x);T?T.push(h):l.set(x,[h])}}return l}function Nv(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function bS(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 Av(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function xS(e,t,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var d=Si(l.href),h=t.querySelector(Ol(d));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Er.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,wt(h);return}h=t.ownerDocument||t,l=Cv(l),(d=jn.get(d))&&jd(l,d),h=h.createElement("link"),wt(h);var x=h;x._p=new Promise(function(T,j){x.onload=T,x.onerror=j}),zt(h,"link",l),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Er.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Dd=0;function _S(e,t){return e.stylesheets&&e.count===0&&Ar(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&Ar(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Dd===0&&(Dd=62500*tS());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ar(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Dd?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function Er(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ar(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Nr=null;function Ar(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Nr=new Map,t.forEach(SS,e),Nr=null,Er.call(e))}function SS(e,t){if(!(t.state.loading&4)){var s=Nr.get(e);if(s)var l=s.get(null);else{s=new Map,Nr.set(e,s);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var x=d[h];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(s.set(x.dataset.precedence,x),l=x)}l&&s.set(null,l)}d=t.instance,x=d.getAttribute("data-precedence"),h=s.get(x)||l,h===l&&s.set(null,d),s.set(x,d),this.count++,l=Er.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Il={$$typeof:O,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function TS(e,t,s,l,d,h,x,T,j){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=Ec(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ec(0),this.hiddenUpdates=Ec(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function jv(e,t,s,l,d,h,x,T,j,G,Y,X){return e=new TS(e,t,s,x,j,G,Y,X,T),t=1,h===!0&&(t|=24),h=ln(3,null,null,t),e.current=h,h.stateNode=e,t=uu(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:l,isDehydrated:s,cache:t},pu(h),e}function wv(e){return e?(e=ei,e):ei}function Dv(e,t,s,l,d,h){d=wv(d),l.context===null?l.context=d:l.pendingContext=d,l=Ba(t),l.payload={element:s},h=h===void 0?null:h,h!==null&&(l.callback=h),s=Ia(e,l,t),s!==null&&(nn(s,e,t),pl(s,e,t))}function Mv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Md(e,t){Mv(e,t),(e=e.alternate)&&Mv(e,t)}function Rv(e){if(e.tag===13||e.tag===31){var t=ps(e,67108864);t!==null&&nn(t,e,67108864),Md(e,67108864)}}function Ov(e){if(e.tag===13||e.tag===31){var t=dn();t=Nc(t);var s=ps(e,t);s!==null&&nn(s,e,t),Md(e,t)}}var jr=!0;function CS(e,t,s,l){var d=I.T;I.T=null;var h=D.p;try{D.p=2,Rd(e,t,s,l)}finally{D.p=h,I.T=d}}function kS(e,t,s,l){var d=I.T;I.T=null;var h=D.p;try{D.p=8,Rd(e,t,s,l)}finally{D.p=h,I.T=d}}function Rd(e,t,s,l){if(jr){var d=Od(l);if(d===null)bd(e,t,l,wr,s),Iv(e,l);else if(NS(d,e,t,s,l))l.stopPropagation();else if(Iv(e,l),t&4&&-1<ES.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 x=cs(h.pendingLanes);if(x!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;x;){var j=1<<31-Xe(x);T.entanglements[1]|=j,x&=~j}Fn(h),(Pe&6)===0&&(fr=Ht()+500,wl(0))}}break;case 31:case 13:T=ps(h,2),T!==null&&nn(T,h,2),pr(),Md(h,2)}if(h=Od(l),h===null&&bd(e,t,l,wr,s),h===d)break;d=h}d!==null&&l.stopPropagation()}else bd(e,t,l,null,s)}}function Od(e){return e=Ic(e),Bd(e)}var wr=null;function Bd(e){if(wr=null,e=Gs(e),e!==null){var t=f(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=u(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 wr=e,null}function Bv(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(kc()){case Z:return 2;case le:return 8;case ce:case _e:return 32;case xe:return 268435456;default:return 32}default:return 32}}var Id=!1,Ya=null,Ka=null,Za=null,Ll=new Map,Ul=new Map,Xa=[],ES="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 Iv(e,t){switch(e){case"focusin":case"focusout":Ya=null;break;case"dragenter":case"dragleave":Ka=null;break;case"mouseover":case"mouseout":Za=null;break;case"pointerover":case"pointerout":Ll.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ul.delete(t.pointerId)}}function zl(e,t,s,l,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:l,nativeEvent:h,targetContainers:[d]},t!==null&&(t=Ps(t),t!==null&&Rv(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function NS(e,t,s,l,d){switch(t){case"focusin":return Ya=zl(Ya,e,t,s,l,d),!0;case"dragenter":return Ka=zl(Ka,e,t,s,l,d),!0;case"mouseover":return Za=zl(Za,e,t,s,l,d),!0;case"pointerover":var h=d.pointerId;return Ll.set(h,zl(Ll.get(h)||null,e,t,s,l,d)),!0;case"gotpointercapture":return h=d.pointerId,Ul.set(h,zl(Ul.get(h)||null,e,t,s,l,d)),!0}return!1}function Lv(e){var t=Gs(e.target);if(t!==null){var s=f(t);if(s!==null){if(t=s.tag,t===13){if(t=u(s),t!==null){e.blockedOn=t,Qh(e.priority,function(){Ov(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,Qh(e.priority,function(){Ov(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Od(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);Bc=l,s.target.dispatchEvent(l),Bc=null}else return t=Ps(s),t!==null&&Rv(t),e.blockedOn=s,!1;t.shift()}return!0}function Uv(e,t,s){Dr(e)&&s.delete(t)}function AS(){Id=!1,Ya!==null&&Dr(Ya)&&(Ya=null),Ka!==null&&Dr(Ka)&&(Ka=null),Za!==null&&Dr(Za)&&(Za=null),Ll.forEach(Uv),Ul.forEach(Uv)}function Mr(e,t){e.blockedOn===t&&(e.blockedOn=null,Id||(Id=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,AS)))}var Rr=null;function zv(e){Rr!==e&&(Rr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Rr===e&&(Rr=null);for(var t=0;t<e.length;t+=3){var s=e[t],l=e[t+1],d=e[t+2];if(typeof l!="function"){if(Bd(l||s)===null)continue;break}var h=Ps(s);h!==null&&(e.splice(t,3),t-=3,Ou(h,{pending:!0,data:d,method:s.method,action:l},l,d))}}))}function Ci(e){function t(j){return Mr(j,e)}Ya!==null&&Mr(Ya,e),Ka!==null&&Mr(Ka,e),Za!==null&&Mr(Za,e),Ll.forEach(t),Ul.forEach(t);for(var s=0;s<Xa.length;s++){var l=Xa[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Xa.length&&(s=Xa[0],s.blockedOn===null);)Lv(s),s.blockedOn===null&&Xa.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var d=s[l],h=s[l+1],x=d[Xt]||null;if(typeof h=="function")x||zv(s);else if(x){var T=null;if(h&&h.hasAttribute("formAction")){if(d=h,x=h[Xt]||null)T=x.formAction;else if(Bd(d)!==null)continue}else T=x.action;typeof T=="function"?s[l+1]=T:(s.splice(l,3),l-=3),zv(s)}}}function Vv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(x){return d=x})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function Ld(e){this._internalRoot=e}Or.prototype.render=Ld.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,l=dn();Dv(s,l,e,t,null,null)},Or.prototype.unmount=Ld.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dv(e.current,2,null,e,null,null),pr(),t[Hs]=null}};function Or(e){this._internalRoot=e}Or.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xh();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Xa.length&&t!==0&&t<Xa[s].priority;s++);Xa.splice(s,0,e),s===0&&Lv(e)}};var Hv=a.version;if(Hv!=="19.2.4")throw Error(o(527,Hv,"19.2.4"));D.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var jS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Br=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Br.isDisabled&&Br.supportsFiber)try{vt=Br.inject(jS),Ae=Br}catch{}}return Vl.createRoot=function(e,t){if(!r(e))throw Error(o(299));var s=!1,l="",d=Km,h=Zm,x=Xm;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=jv(e,1,!1,null,null,s,l,null,d,h,x,Vv),e[Hs]=t.current,yd(e),new Ld(t)},Vl.hydrateRoot=function(e,t,s){if(!r(e))throw Error(o(299));var l=!1,d="",h=Km,x=Zm,T=Xm,j=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(T=s.onRecoverableError),s.formState!==void 0&&(j=s.formState)),t=jv(e,1,!0,t,s??null,l,d,j,h,x,T,Vv),t.context=wv(null),s=t.current,l=dn(),l=Nc(l),d=Ba(l),d.callback=null,Ia(s,d,l),s=l,t.current.lanes=s,Xi(t,s),Fn(t),e[Hs]=t.current,yd(e),new Or(t)},Vl.version="19.2.4",Vl}var Kv;function $S(){if(Kv)return Ud.exports;Kv=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(),Ud.exports=FS(),Ud.exports}var qS=$S();function Zt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function so(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function YS(n){return Zt(n)&&typeof n.id=="string"&&typeof n.type=="string"&&typeof n.timestamp=="string"&&Zt(n.payload)}function KS(n){return Zt(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 ZS(n){return{...n,adapterConfig:n.adapterConfig??"{}"}}function Zv(n){return Zt(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 Xv(n){return Zt(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 XS(n){return Zt(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 QS(n){return Zt(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 WS(n){return Zt(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 JS(n){return Zt(n)&&typeof n.name=="string"&&typeof n.tokenType=="string"&&typeof n.envVar=="string"&&typeof n.filePath=="string"&&typeof n.expiresAt=="string"}const eT=new Set(["off","subscription","api_key"]),Hd=new Set(["off","on"]);function Qv(n){return Zt(n)&&eT.has(n.claude)&&Hd.has(n.github)&&Hd.has(n.copilot)&&Hd.has(n.codex)}function tT(n){return Zt(n)&&typeof n.name=="string"&&typeof n.repository=="string"&&typeof n.state=="string"&&typeof n.gitStatus=="string"}function nT(n){return Zt(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 Kn(n,a,i,o){return Array.isArray(n)?n.filter((r,f)=>a(r)?!0:(so(i,`item at index ${f} in "${o}" has unexpected shape`),!1)):(so(i,`expected "${o}" to be an array, got ${typeof n}`),[])}function aT(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!Zt(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:Zt(a.payload)?a.payload:{}}:{type:a.type,payload:Zt(a.payload)?a.payload:void 0}}function sT(n){switch(n){case"waiting_input":return"idle";case"killed":return"interrupted";default:return n}}const iT=3e3,ki=5e3,lT=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 Wv="popstate";function Jv(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function oT(n={}){function a(o,r){var g;let f=(g=r.state)==null?void 0:g.masked,{pathname:u,search:p,hash:m}=f||o.location;return mf("",{pathname:u,search:p,hash:m},r.state&&r.state.usr||null,r.state&&r.state.key||"default",f?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function i(o,r){return typeof r=="string"?r:io(r)}return cT(a,i,null,n)}function ot(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Mn(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function rT(){return Math.random().toString(36).substring(2,10)}function ey(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 mf(n,a,i=null,o,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Vi(a):a,state:i,key:a&&a.key||o||rT(),unstable_mask:r}}function io({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 Vi(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let o=n.indexOf("?");o>=0&&(a.search=n.substring(o),n=n.substring(0,o)),n&&(a.pathname=n)}return a}function cT(n,a,i,o={}){let{window:r=document.defaultView,v5Compat:f=!1}=o,u=r.history,p="POP",m=null,g=y();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function y(){return(u.state||{idx:null}).idx}function v(){p="POP";let N=y(),C=N==null?null:N-g;g=N,m&&m({action:p,location:E.location,delta:C})}function b(N,C){p="PUSH";let A=Jv(N)?N:mf(E.location,N,C);g=y()+1;let O=ey(A,g),B=E.createHref(A.unstable_mask||A);try{u.pushState(O,"",B)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;r.location.assign(B)}f&&m&&m({action:p,location:E.location,delta:1})}function S(N,C){p="REPLACE";let A=Jv(N)?N:mf(E.location,N,C);g=y();let O=ey(A,g),B=E.createHref(A.unstable_mask||A);u.replaceState(O,"",B),f&&m&&m({action:p,location:E.location,delta:0})}function k(N){return uT(N)}let E={get action(){return p},get location(){return n(r,u)},listen(N){if(m)throw new Error("A history only accepts one active listener");return r.addEventListener(Wv,v),m=N,()=>{r.removeEventListener(Wv,v),m=null}},createHref(N){return a(r,N)},createURL:k,encodeLocation(N){let C=k(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:S,go(N){return u.go(N)}};return E}function uT(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),ot(i,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:io(n);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=i+o),new URL(o,i)}function q0(n,a,i="/"){return dT(n,a,i,!1)}function dT(n,a,i,o){let r=typeof a=="string"?Vi(a):a,f=Sa(r.pathname||"/",i);if(f==null)return null;let u=Y0(n);fT(u);let p=null;for(let m=0;p==null&&m<u.length;++m){let g=Z0(f);p=_T(u[m],g,o)}return p}function Y0(n,a=[],i=[],o="",r=!1){let f=(u,p,m=r,g)=>{let y={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:p,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&m)return;ot(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let v=Zn([o,y.relativePath]),b=i.concat(y);u.children&&u.children.length>0&&(ot(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Y0(u.children,a,b,v,m)),!(u.path==null&&!u.index)&&a.push({path:v,score:bT(v,u.index),routesMeta:b})};return n.forEach((u,p)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))f(u,p);else for(let g of K0(u.path))f(u,p,!0,g)}),a}function K0(n){let a=n.split("/");if(a.length===0)return[];let[i,...o]=a,r=i.endsWith("?"),f=i.replace(/\?$/,"");if(o.length===0)return r?[f,""]:[f];let u=K0(o.join("/")),p=[];return p.push(...u.map(m=>m===""?f:[f,m].join("/"))),r&&p.push(...u),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function fT(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:xT(a.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var hT=/^:[\w-]+$/,pT=3,mT=2,gT=1,vT=10,yT=-2,ty=n=>n==="*";function bT(n,a){let i=n.split("/"),o=i.length;return i.some(ty)&&(o+=yT),a&&(o+=mT),i.filter(r=>!ty(r)).reduce((r,f)=>r+(hT.test(f)?pT:f===""?gT:vT),o)}function xT(n,a){return n.length===a.length&&n.slice(0,-1).every((o,r)=>o===a[r])?n[n.length-1]-a[a.length-1]:0}function _T(n,a,i=!1){let{routesMeta:o}=n,r={},f="/",u=[];for(let p=0;p<o.length;++p){let m=o[p],g=p===o.length-1,y=f==="/"?a:a.slice(f.length)||"/",v=lo({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},y),b=m.route;if(!v&&g&&i&&!o[o.length-1].route.index&&(v=lo({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!v)return null;Object.assign(r,v.params),u.push({params:r,pathname:Zn([f,v.pathname]),pathnameBase:ET(Zn([f,v.pathnameBase])),route:b}),v.pathnameBase!=="/"&&(f=Zn([f,v.pathnameBase]))}return u}function lo(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,o]=ST(n.path,n.caseSensitive,n.end),r=a.match(i);if(!r)return null;let f=r[0],u=f.replace(/(.)\/+$/,"$1"),p=r.slice(1);return{params:o.reduce((g,{paramName:y,isOptional:v},b)=>{if(y==="*"){let k=p[b]||"";u=f.slice(0,f.length-k.length).replace(/(.)\/+$/,"$1")}const S=p[b];return v&&!S?g[y]=void 0:g[y]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:f,pathnameBase:u,pattern:n}}function ST(n,a=!1,i=!0){Mn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let o=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,p,m,g,y)=>{if(o.push({paramName:p,isOptional:m!=null}),m){let v=y.charAt(g+u.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,a?void 0:"i"),o]}function Z0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Mn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function Sa(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,o=n.charAt(i);return o&&o!=="/"?null:n.slice(i)||"/"}var TT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function CT(n,a="/"){let{pathname:i,search:o="",hash:r=""}=typeof n=="string"?Vi(n):n,f;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?f=ny(i.substring(1),"/"):f=ny(i,a)):f=a,{pathname:f,search:NT(o),hash:AT(r)}}function ny(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 Gd(n,a,i,o){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function kT(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Zf(n){let a=kT(n);return a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase)}function hc(n,a,i,o=!1){let r;typeof n=="string"?r=Vi(n):(r={...n},ot(!r.pathname||!r.pathname.includes("?"),Gd("?","pathname","search",r)),ot(!r.pathname||!r.pathname.includes("#"),Gd("#","pathname","hash",r)),ot(!r.search||!r.search.includes("#"),Gd("#","search","hash",r)));let f=n===""||r.pathname==="",u=f?"/":r.pathname,p;if(u==null)p=i;else{let v=a.length-1;if(!o&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),v-=1;r.pathname=b.join("/")}p=v>=0?a[v]:"/"}let m=CT(r,p),g=u&&u!=="/"&&u.endsWith("/"),y=(f||u===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(g||y)&&(m.pathname+="/"),m}var Zn=n=>n.join("/").replace(/\/\/+/g,"/"),ET=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),NT=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,AT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,jT=class{constructor(n,a,i,o=!1){this.status=n,this.statusText=a||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function wT(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function DT(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var X0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Q0(n,a){let i=n;if(typeof i!="string"||!TT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,r=!1;if(X0)try{let f=new URL(window.location.href),u=i.startsWith("//")?new URL(f.protocol+i):new URL(i),p=Sa(u.pathname,a);u.origin===f.origin&&p!=null?i=p+u.search+u.hash:r=!0}catch{Mn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:r,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var W0=["POST","PUT","PATCH","DELETE"];new Set(W0);var MT=["GET",...W0];new Set(MT);var Hi=_.createContext(null);Hi.displayName="DataRouter";var pc=_.createContext(null);pc.displayName="DataRouterState";var RT=_.createContext(!1),J0=_.createContext({isTransitioning:!1});J0.displayName="ViewTransition";var OT=_.createContext(new Map);OT.displayName="Fetchers";var BT=_.createContext(null);BT.displayName="Await";var gn=_.createContext(null);gn.displayName="Navigation";var po=_.createContext(null);po.displayName="Location";var Rn=_.createContext({outlet:null,matches:[],isDataRoute:!1});Rn.displayName="Route";var Xf=_.createContext(null);Xf.displayName="RouteError";var eb="REACT_ROUTER_ERROR",IT="REDIRECT",LT="ROUTE_ERROR_RESPONSE";function UT(n){if(n.startsWith(`${eb}:${IT}:{`))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 zT(n){if(n.startsWith(`${eb}:${LT}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new jT(a.status,a.statusText,a.data)}catch{}}function VT(n,{relative:a}={}){ot(Ls(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:o}=_.useContext(gn),{hash:r,pathname:f,search:u}=mo(n,{relative:a}),p=f;return i!=="/"&&(p=f==="/"?i:Zn([i,f])),o.createHref({pathname:p,search:u,hash:r})}function Ls(){return _.useContext(po)!=null}function Rt(){return ot(Ls(),"useLocation() may be used only in the context of a <Router> component."),_.useContext(po).location}function Mt(n){ot(Ls(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=Rt();return _.useMemo(()=>lo(n,Z0(a)),[a,n])}var tb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nb(n){_.useContext(gn).static||_.useLayoutEffect(n)}function mc(){let{isDataRoute:n}=_.useContext(Rn);return n?tC():HT()}function HT(){ot(Ls(),"useNavigate() may be used only in the context of a <Router> component.");let n=_.useContext(Hi),{basename:a,navigator:i}=_.useContext(gn),{matches:o}=_.useContext(Rn),{pathname:r}=Rt(),f=JSON.stringify(Zf(o)),u=_.useRef(!1);return nb(()=>{u.current=!0}),_.useCallback((m,g={})=>{if(Mn(u.current,tb),!u.current)return;if(typeof m=="number"){i.go(m);return}let y=hc(m,JSON.parse(f),r,g.relative==="path");n==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:Zn([a,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[a,i,f,r,n])}var GT=_.createContext(null);function PT(n){let a=_.useContext(Rn).outlet;return _.useMemo(()=>a&&_.createElement(GT.Provider,{value:n},a),[a,n])}function Gi(){let{matches:n}=_.useContext(Rn),a=n[n.length-1];return a?a.params:{}}function mo(n,{relative:a}={}){let{matches:i}=_.useContext(Rn),{pathname:o}=Rt(),r=JSON.stringify(Zf(i));return _.useMemo(()=>hc(n,JSON.parse(r),o,a==="path"),[n,r,o,a])}function FT(n,a){return ab(n,a)}function ab(n,a,i){var N;ot(Ls(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=_.useContext(gn),{matches:r}=_.useContext(Rn),f=r[r.length-1],u=f?f.params:{},p=f?f.pathname:"/",m=f?f.pathnameBase:"/",g=f&&f.route;{let C=g&&g.path||"";ib(p,!g||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
35
-
36
- Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let y=Rt(),v;if(a){let C=typeof a=="string"?Vi(a):a;ot(m==="/"||((N=C.pathname)==null?void 0:N.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${C.pathname}" was given in the \`location\` prop.`),v=C}else v=y;let b=v.pathname||"/",S=b;if(m!=="/"){let C=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=q0(n,{pathname:S});Mn(g||k!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Mn(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 E=ZT(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:Zn([m,o.encodeLocation?o.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:Zn([m,o.encodeLocation?o.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),r,i);return a&&E?_.createElement(po.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},E):E}function $T(){let n=eC(),a=wT(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:o},f={padding:"2px 4px",backgroundColor:o},u=null;return console.error("Error handled by React Router default ErrorBoundary:",n),u=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:f},"ErrorBoundary")," or"," ",_.createElement("code",{style:f},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},a),i?_.createElement("pre",{style:r},i):null,u)}var qT=_.createElement($T,null),sb=class extends _.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=zT(n.digest);i&&(n=i)}let a=n!==void 0?_.createElement(Rn.Provider,{value:this.props.routeContext},_.createElement(Xf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?_.createElement(YT,{error:n},a):a}};sb.contextType=RT;var Pd=new WeakMap;function YT({children:n,error:a}){let{basename:i}=_.useContext(gn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=UT(a.digest);if(o){let r=Pd.get(a);if(r)throw r;let f=Q0(o.location,i);if(X0&&!Pd.get(a))if(f.isExternal||o.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:o.replace}));throw Pd.set(a,u),u}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return n}function KT({routeContext:n,match:a,children:i}){let o=_.useContext(Hi);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),_.createElement(Rn.Provider,{value:n},i)}function ZT(n,a=[],i){let o=i==null?void 0:i.state;if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let r=n,f=o==null?void 0:o.errors;if(f!=null){let y=r.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);ot(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),r=r.slice(0,Math.min(r.length,y+1))}let u=!1,p=-1;if(i&&o){u=o.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}=o,k=v.route.loader&&!b.hasOwnProperty(v.route.id)&&(!S||S[v.route.id]===void 0);if(v.route.lazy||k){i.isStatic&&(u=!0),p>=0?r=r.slice(0,p+1):r=[r[0]];break}}}}let m=i==null?void 0:i.onError,g=o&&m?(y,v)=>{var b,S;m(y,{location:o.location,params:((S=(b=o.matches)==null?void 0:b[0])==null?void 0:S.params)??{},unstable_pattern:DT(o.matches),errorInfo:v})}:void 0;return r.reduceRight((y,v,b)=>{let S,k=!1,E=null,N=null;o&&(S=f&&v.route.id?f[v.route.id]:void 0,E=v.route.errorElement||qT,u&&(p<0&&b===0?(ib("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 C=a.concat(r.slice(0,b+1)),A=()=>{let O;return S?O=E:k?O=N:v.route.Component?O=_.createElement(v.route.Component,null):v.route.element?O=v.route.element:O=y,_.createElement(KT,{match:v,routeContext:{outlet:y,matches:C,isDataRoute:o!=null},children:O})};return o&&(v.route.ErrorBoundary||v.route.errorElement||b===0)?_.createElement(sb,{location:o.location,revalidation:o.revalidation,component:E,error:S,children:A(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:g}):A()},null)}function Qf(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function XT(n){let a=_.useContext(Hi);return ot(a,Qf(n)),a}function QT(n){let a=_.useContext(pc);return ot(a,Qf(n)),a}function WT(n){let a=_.useContext(Rn);return ot(a,Qf(n)),a}function Wf(n){let a=WT(n),i=a.matches[a.matches.length-1];return ot(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function JT(){return Wf("useRouteId")}function eC(){var o;let n=_.useContext(Xf),a=QT("useRouteError"),i=Wf("useRouteError");return n!==void 0?n:(o=a.errors)==null?void 0:o[i]}function tC(){let{router:n}=XT("useNavigate"),a=Wf("useNavigate"),i=_.useRef(!1);return nb(()=>{i.current=!0}),_.useCallback(async(r,f={})=>{Mn(i.current,tb),i.current&&(typeof r=="number"?await n.navigate(r):await n.navigate(r,{fromRouteId:a,...f}))},[n,a])}var ay={};function ib(n,a,i){!a&&!ay[n]&&(ay[n]=!0,Mn(!1,i))}_.memo(nC);function nC({routes:n,future:a,state:i,isStatic:o,onError:r}){return ab(n,void 0,{state:i,isStatic:o,onError:r})}function es({to:n,replace:a,state:i,relative:o}){ot(Ls(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=_.useContext(gn);Mn(!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:f}=_.useContext(Rn),{pathname:u}=Rt(),p=mc(),m=hc(n,Zf(f),u,o==="path"),g=JSON.stringify(m);return _.useEffect(()=>{p(JSON.parse(g),{replace:a,state:i,relative:o})},[p,g,o,a,i]),null}function Jf(n){return PT(n.context)}function Ie(n){ot(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function aC({basename:n="/",children:a=null,location:i,navigationType:o="POP",navigator:r,static:f=!1,unstable_useTransitions:u}){ot(!Ls(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),m=_.useMemo(()=>({basename:p,navigator:r,static:f,unstable_useTransitions:u,future:{}}),[p,r,f,u]);typeof i=="string"&&(i=Vi(i));let{pathname:g="/",search:y="",hash:v="",state:b=null,key:S="default",unstable_mask:k}=i,E=_.useMemo(()=>{let N=Sa(g,p);return N==null?null:{location:{pathname:N,search:y,hash:v,state:b,key:S,unstable_mask:k},navigationType:o}},[p,g,y,v,b,S,o,k]);return Mn(E!=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.`),E==null?null:_.createElement(gn.Provider,{value:m},_.createElement(po.Provider,{children:a,value:E}))}function sC({children:n,location:a}){return FT(gf(n),a)}function gf(n,a=[]){let i=[];return _.Children.forEach(n,(o,r)=>{if(!_.isValidElement(o))return;let f=[...a,r];if(o.type===_.Fragment){i.push.apply(i,gf(o.props.children,f));return}ot(o.type===Ie,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ot(!o.props.index||!o.props.children,"An index route cannot have child routes.");let u={id:o.props.id||f.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(u.children=gf(o.props.children,f)),i.push(u)}),i}var Yr="get",Kr="application/x-www-form-urlencoded";function gc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function iC(n){return gc(n)&&n.tagName.toLowerCase()==="button"}function lC(n){return gc(n)&&n.tagName.toLowerCase()==="form"}function oC(n){return gc(n)&&n.tagName.toLowerCase()==="input"}function rC(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function cC(n,a){return n.button===0&&(!a||a==="_self")&&!rC(n)}function vf(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let o=n[i];return a.concat(Array.isArray(o)?o.map(r=>[i,r]):[[i,o]])},[]))}function uC(n,a){let i=vf(n);return a&&a.forEach((o,r)=>{i.has(r)||a.getAll(r).forEach(f=>{i.append(r,f)})}),i}var Lr=null;function dC(){if(Lr===null)try{new FormData(document.createElement("form"),0),Lr=!1}catch{Lr=!0}return Lr}var fC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Fd(n){return n!=null&&!fC.has(n)?(Mn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kr}"`),null):n}function hC(n,a){let i,o,r,f,u;if(lC(n)){let p=n.getAttribute("action");o=p?Sa(p,a):null,i=n.getAttribute("method")||Yr,r=Fd(n.getAttribute("enctype"))||Kr,f=new FormData(n)}else if(iC(n)||oC(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=n.getAttribute("formaction")||p.getAttribute("action");if(o=m?Sa(m,a):null,i=n.getAttribute("formmethod")||p.getAttribute("method")||Yr,r=Fd(n.getAttribute("formenctype"))||Fd(p.getAttribute("enctype"))||Kr,f=new FormData(p,n),!dC()){let{name:g,type:y,value:v}=n;if(y==="image"){let b=g?`${g}.`:"";f.append(`${b}x`,"0"),f.append(`${b}y`,"0")}else g&&f.append(g,v)}}else{if(gc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Yr,o=null,r=Kr,u=n}return f&&r==="text/plain"&&(u=f,f=void 0),{action:o,method:i.toLowerCase(),encType:r,formData:f,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function eh(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function pC(n,a,i,o){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}_.${o}`:r.pathname=`${r.pathname}.${o}`:r.pathname==="/"?r.pathname=`_root.${o}`:a&&Sa(r.pathname,a)==="/"?r.pathname=`${a.replace(/\/$/,"")}/_root.${o}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${o}`,r}async function mC(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 gC(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 vC(n,a,i){let o=await Promise.all(n.map(async r=>{let f=a.routes[r.route.id];if(f){let u=await mC(f,i);return u.links?u.links():[]}return[]}));return _C(o.flat(1).filter(gC).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function sy(n,a,i,o,r,f){let u=(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 f==="assets"?a.filter((m,g)=>u(m,g)||p(m,g)):f==="data"?a.filter((m,g)=>{var v;let y=o.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(u(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 yC(n,a,{includeHydrateFallback:i}={}){return bC(n.map(o=>{let r=a.routes[o.route.id];if(!r)return[];let f=[r.module];return r.clientActionModule&&(f=f.concat(r.clientActionModule)),r.clientLoaderModule&&(f=f.concat(r.clientLoaderModule)),i&&r.hydrateFallbackModule&&(f=f.concat(r.hydrateFallbackModule)),r.imports&&(f=f.concat(r.imports)),f}).flat(1))}function bC(n){return[...new Set(n)]}function xC(n){let a={},i=Object.keys(n).sort();for(let o of i)a[o]=n[o];return a}function _C(n,a){let i=new Set;return new Set(a),n.reduce((o,r)=>{let f=JSON.stringify(xC(r));return i.has(f)||(i.add(f),o.push({key:f,link:r})),o},[])}function lb(){let n=_.useContext(Hi);return eh(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function SC(){let n=_.useContext(pc);return eh(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var th=_.createContext(void 0);th.displayName="FrameworkContext";function ob(){let n=_.useContext(th);return eh(n,"You must render this element inside a <HydratedRouter> element"),n}function TC(n,a){let i=_.useContext(th),[o,r]=_.useState(!1),[f,u]=_.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:y,onTouchStart:v}=a,b=_.useRef(null);_.useEffect(()=>{if(n==="render"&&u(!0),n==="viewport"){let E=C=>{C.forEach(A=>{u(A.isIntersecting)})},N=new IntersectionObserver(E,{threshold:.5});return b.current&&N.observe(b.current),()=>{N.disconnect()}}},[n]),_.useEffect(()=>{if(o){let E=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(E)}}},[o]);let S=()=>{r(!0)},k=()=>{r(!1),u(!1)};return i?n!=="intent"?[f,b,{}]:[f,b,{onFocus:Hl(p,S),onBlur:Hl(m,k),onMouseEnter:Hl(g,S),onMouseLeave:Hl(y,k),onTouchStart:Hl(v,S)}]:[!1,b,{}]}function Hl(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function CC({page:n,...a}){let{router:i}=lb(),o=_.useMemo(()=>q0(i.routes,n,i.basename),[i.routes,n,i.basename]);return o?_.createElement(EC,{page:n,matches:o,...a}):null}function kC(n){let{manifest:a,routeModules:i}=ob(),[o,r]=_.useState([]);return _.useEffect(()=>{let f=!1;return vC(n,a,i).then(u=>{f||r(u)}),()=>{f=!0}},[n,a,i]),o}function EC({page:n,matches:a,...i}){let o=Rt(),{future:r,manifest:f,routeModules:u}=ob(),{basename:p}=lb(),{loaderData:m,matches:g}=SC(),y=_.useMemo(()=>sy(n,a,g,f,o,"data"),[n,a,g,f,o]),v=_.useMemo(()=>sy(n,a,g,f,o,"assets"),[n,a,g,f,o]),b=_.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let E=new Set,N=!1;if(a.forEach(A=>{var B;let O=f.routes[A.route.id];!O||!O.hasLoader||(!y.some(U=>U.route.id===A.route.id)&&A.route.id in m&&((B=u[A.route.id])!=null&&B.shouldRevalidate)||O.hasClientLoader?N=!0:E.add(A.route.id))}),E.size===0)return[];let C=pC(n,p,r.unstable_trailingSlashAwareDataRequests,"data");return N&&E.size>0&&C.searchParams.set("_routes",a.filter(A=>E.has(A.route.id)).map(A=>A.route.id).join(",")),[C.pathname+C.search]},[p,r.unstable_trailingSlashAwareDataRequests,m,o,f,y,a,n,u]),S=_.useMemo(()=>yC(v,f),[v,f]),k=kC(v);return _.createElement(_.Fragment,null,b.map(E=>_.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...i})),S.map(E=>_.createElement("link",{key:E,rel:"modulepreload",href:E,...i})),k.map(({key:E,link:N})=>_.createElement("link",{key:E,nonce:i.nonce,...N,crossOrigin:N.crossOrigin??i.crossOrigin})))}function NC(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var AC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{AC&&(window.__reactRouterVersion="7.13.1")}catch{}function jC({basename:n,children:a,unstable_useTransitions:i,window:o}){let r=_.useRef();r.current==null&&(r.current=oT({window:o,v5Compat:!0}));let f=r.current,[u,p]=_.useState({action:f.action,location:f.location}),m=_.useCallback(g=>{i===!1?p(g):_.startTransition(()=>p(g))},[i]);return _.useLayoutEffect(()=>f.listen(m),[f,m]),_.createElement(aC,{basename:n,children:a,location:u.location,navigationType:u.action,navigator:f,unstable_useTransitions:i})}var rb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nh=_.forwardRef(function({onClick:a,discover:i="render",prefetch:o="none",relative:r,reloadDocument:f,replace:u,unstable_mask:p,state:m,target:g,to:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:S,...k},E){let{basename:N,navigator:C,unstable_useTransitions:A}=_.useContext(gn),O=typeof y=="string"&&rb.test(y),B=Q0(y,N);y=B.to;let U=VT(y,{relative:r}),q=Rt(),M=null;if(p){let ie=hc(p,[],q.unstable_mask?q.unstable_mask.pathname:"/",!0);N!=="/"&&(ie.pathname=ie.pathname==="/"?N:Zn([N,ie.pathname])),M=C.createHref(ie)}let[R,F,ee]=TC(o,k),te=RC(y,{replace:u,unstable_mask:p,state:m,target:g,preventScrollReset:v,relative:r,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:A});function se(ie){a&&a(ie),ie.defaultPrevented||te(ie)}let re=!(B.isExternal||f),Q=_.createElement("a",{...k,...ee,href:(re?M:void 0)||B.absoluteURL||U,onClick:re?se:a,ref:NC(E,F),target:g,"data-discover":!O&&i==="render"?"true":void 0});return R&&!O?_.createElement(_.Fragment,null,Q,_.createElement(CC,{page:U})):Q});nh.displayName="Link";var wC=_.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:o="",end:r=!1,style:f,to:u,viewTransition:p,children:m,...g},y){let v=mo(u,{relative:g.relative}),b=Rt(),S=_.useContext(pc),{navigator:k,basename:E}=_.useContext(gn),N=S!=null&&UC(v)&&p===!0,C=k.encodeLocation?k.encodeLocation(v).pathname:v.pathname,A=b.pathname,O=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(A=A.toLowerCase(),O=O?O.toLowerCase():null,C=C.toLowerCase()),O&&E&&(O=Sa(O,E)||O);const B=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let U=A===C||!r&&A.startsWith(C)&&A.charAt(B)==="/",q=O!=null&&(O===C||!r&&O.startsWith(C)&&O.charAt(C.length)==="/"),M={isActive:U,isPending:q,isTransitioning:N},R=U?a:void 0,F;typeof o=="function"?F=o(M):F=[o,U?"active":null,q?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let ee=typeof f=="function"?f(M):f;return _.createElement(nh,{...g,"aria-current":R,className:F,ref:y,style:ee,to:u,viewTransition:p},typeof m=="function"?m(M):m)});wC.displayName="NavLink";var DC=_.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:o,replace:r,state:f,method:u=Yr,action:p,onSubmit:m,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:b,...S},k)=>{let{unstable_useTransitions:E}=_.useContext(gn),N=IC(),C=LC(p,{relative:g}),A=u.toLowerCase()==="get"?"get":"post",O=typeof p=="string"&&rb.test(p),B=U=>{if(m&&m(U),U.defaultPrevented)return;U.preventDefault();let q=U.nativeEvent.submitter,M=(q==null?void 0:q.getAttribute("formmethod"))||u,R=()=>N(q||U.currentTarget,{fetcherKey:a,method:M,navigate:i,replace:r,state:f,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:b});E&&i!==!1?_.startTransition(()=>R()):R()};return _.createElement("form",{ref:k,method:A,action:C,onSubmit:o?m:B,...S,"data-discover":!O&&n==="render"?"true":void 0})});DC.displayName="Form";function MC(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cb(n){let a=_.useContext(Hi);return ot(a,MC(n)),a}function RC(n,{target:a,replace:i,unstable_mask:o,state:r,preventScrollReset:f,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let y=mc(),v=Rt(),b=mo(n,{relative:u});return _.useCallback(S=>{if(cC(S,a)){S.preventDefault();let k=i!==void 0?i:io(v)===io(b),E=()=>y(n,{replace:k,unstable_mask:o,state:r,preventScrollReset:f,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m});g?_.startTransition(()=>E()):E()}},[v,y,b,i,o,r,a,n,f,u,p,m,g])}function ub(n){Mn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=_.useRef(vf(n)),i=_.useRef(!1),o=Rt(),r=_.useMemo(()=>uC(o.search,i.current?null:a.current),[o.search]),f=mc(),u=_.useCallback((p,m)=>{const g=vf(typeof p=="function"?p(new URLSearchParams(r)):p);i.current=!0,f("?"+g,m)},[f,r]);return[r,u]}var OC=0,BC=()=>`__${String(++OC)}__`;function IC(){let{router:n}=cb("useSubmit"),{basename:a}=_.useContext(gn),i=JT(),o=n.fetch,r=n.navigate;return _.useCallback(async(f,u={})=>{let{action:p,method:m,encType:g,formData:y,body:v}=hC(f,a);if(u.navigate===!1){let b=u.fetcherKey||BC();await o(b,i,u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:v,formMethod:u.method||m,formEncType:u.encType||g,flushSync:u.flushSync})}else await r(u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:v,formMethod:u.method||m,formEncType:u.encType||g,replace:u.replace,state:u.state,fromRouteId:i,flushSync:u.flushSync,viewTransition:u.viewTransition})},[o,r,a,i])}function LC(n,{relative:a}={}){let{basename:i}=_.useContext(gn),o=_.useContext(Rn);ot(o,"useFormAction must be used inside a RouteContext");let[r]=o.matches.slice(-1),f={...mo(n||".",{relative:a})},u=Rt();if(n==null){f.search=u.search;let p=new URLSearchParams(f.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();f.search=y?`?${y}`:""}}return(!n||n===".")&&r.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(f.pathname=f.pathname==="/"?i:Zn([i,f.pathname])),io(f)}function UC(n,{relative:a}={}){let i=_.useContext(J0);ot(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=cb("useViewTransitionState"),r=mo(n,{relative:a});if(!i.isTransitioning)return!1;let f=Sa(i.currentLocation.pathname,o)||i.currentLocation.pathname,u=Sa(i.nextLocation.pathname,o)||i.nextLocation.pathname;return lo(r.pathname,u)!=null||lo(r.pathname,f)!=null}function $t(){const n=mc();return _.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function db(n){return`/sessions/${encodeURIComponent(n)}`}function Bi(n){return`/workspaces/${encodeURIComponent(n)}`}function Ta(n,a,i){const o=encodeURIComponent(n),r=i?`/workspaces/${encodeURIComponent(i)}/tasks/${o}`:`/tasks/${o}`;return a?`${r}/${a}`:r}function zC(n,a){return a?`/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(n)}/edit`:`/tasks/${encodeURIComponent(n)}/edit`}function Pi(n,a){const i=new URLSearchParams;n&&i.set("workspace",n),a&&i.set("parent",a);const o=i.toString();return o?`/tasks/new?${o}`:"/tasks/new"}function fb(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const oo="/environments",VC="/environments/new";function yf(n){return`/environments/${encodeURIComponent(n)}`}function HC(n){return`/environments/${encodeURIComponent(n)}/edit`}const Ql="/settings",GC="/settings/credentials",PC="/pair",FC="/chat",go="/",$C="/tasks";function qC(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",o=_.useRef(void 0),[r,f]=_.useState(!1),u=_.useRef(a.onMessage);u.current=a.onMessage;const p=_.useRef(a.onConnect);p.current=a.onConnect;const m=_.useRef(a.onDisconnect);m.current=a.onDisconnect;const g=_.useCallback(y=>{var v;((v=o.current)==null?void 0:v.readyState)===WebSocket.OPEN&&o.current.send(JSON.stringify(y))},[]);return _.useEffect(()=>{let y,v;function b(){y=new WebSocket(i),o.current=y,y.onopen=()=>{f(!0),p.current(g)},y.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const k=aT(S.data);k&&u.current(k)},y.onclose=S=>{var k;if(f(!1),o.current=void 0,(k=m.current)==null||k.call(m),clearTimeout(v),S.code===lT){window.location.href=PC;return}v=setTimeout(b,iT)},y.onerror=()=>{y.close()}}return b(),()=>{clearTimeout(v),y==null||y.close()}},[i,g]),{connected:r,send:g}}const YC=5e3;function KC(n){const[a,i]=_.useState([]),[o,r]=_.useState({}),f=_.useCallback(b=>{switch(b.type){case"environment.added":return!0;case"environment.removed":{const S=b.payload.environmentId;return S&&(i(k=>k.filter(E=>E.id!==S)),r(k=>{const E={...k};return delete E[S],E})),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 so("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(E=>{const N={...E};return delete N[k],N})},YC)}return!0}default:return!1}},[n]),u=_.useCallback(b=>{var S;switch(b.type){case"environments":return i(Kn((S=b.payload)==null?void 0:S.environments,KS,"environments","environments").map(ZS)),!0;default:return!1}},[]),p=_.useCallback((b,S,k)=>{n({type:"add_environment",payload:{displayName:b,adapterType:S,adapterConfig:k||{}}})},[n]),m=_.useCallback((b,S)=>{const k={environmentId:b,...S};n({type:"update_environment",payload:k})},[n]),g=_.useCallback(b=>{n({type:"provision_environment",payload:{environmentId:b}})},[n]),y=_.useCallback(b=>{n({type:"stop_environment",payload:{environmentId:b}})},[n]),v=_.useCallback(b=>{n({type:"remove_environment",payload:{environmentId:b}})},[n]);return{environments:a,provisionStatus:o,addEnvironment:p,updateEnvironment:m,provisionEnvironment:g,stopEnvironment:y,removeEnvironment:v,handleMessage:u,handleEvent:f}}const $d=new Set(["pending","running","idle"]),ZC=new Set(["completed","failed","interrupted","hibernating"]),iy=["pending","running","idle"];function XC(n){const[a,i]=_.useState([]),[o,r]=_.useState([]),[f,u]=_.useState(0),[p,m]=_.useState(void 0),[g,y]=_.useState({}),v=_.useCallback(A=>{var O,B,U,q,M;switch(A.type){case"sessions":return i(R=>{var te;const F=Kn((te=A.payload)==null?void 0:te.sessions,Zv,"sessions","sessions"),ee=new Map(R.map(se=>[se.id,se.status]));return F.map(se=>{const re=ee.get(se.id);return!re||re===se.status?se:ZC.has(re)&&$d.has(se.status)?{...se,status:re}:$d.has(re)&&$d.has(se.status)&&iy.indexOf(re)>iy.indexOf(se.status)?{...se,status:re}:se})}),!0;case"session_event":{if(!Xv(A.payload))return so("session_event","payload is not a valid SessionEvent"),!0;const R=A.payload;let F=0;if(r(ee=>{const te=[...ee,R];return te.length>ki?(F=te.length-ki,te.slice(-ki)):te}),F>0&&u(ee=>ee+F),R.eventType==="status"){const ee=sT(R.content);i(te=>te.some(re=>re.id===R.sessionId)?te.map(re=>re.id===R.sessionId?{...re,status:ee}:re):[...te,{id:R.sessionId,environmentId:"",runtime:"",status:ee,prompt:"",startedAt:R.timestamp}])}return!0}case"session_events":{const R=Kn((O=A.payload)==null?void 0:O.events,Xv,"session_events","events"),F=(B=A.payload)==null?void 0:B.sessionId;if(typeof F!="string")return so("session_events","missing or non-string sessionId"),!0;if(R.length>0){let ee=0;r(te=>{const se=new Set;for(const ie of te)ie.sessionId===F&&se.add(`${ie.timestamp}|${ie.eventType}`);const re=R.filter(ie=>!se.has(`${ie.timestamp}|${ie.eventType}`)),Q=[...te,...re].sort((ie,I)=>ie.sessionId!==I.sessionId?0:ie.timestamp.localeCompare(I.timestamp));return Q.length>ki?(ee=Q.length-ki,Q.slice(-ki)):Q}),ee>0&&u(te=>te+ee)}return!0}case"spawned":{const R=(U=A.payload)==null?void 0:U.sessionId;return typeof R=="string"&&R&&m(R),n({type:"list_sessions"}),!0}case"task_sessions":{const R=(q=A.payload)==null?void 0:q.taskId;if(typeof R!="string"||!R)return!0;const F=Kn((M=A.payload)==null?void 0:M.sessions,Zv,"task_sessions","sessions");return y(ee=>({...ee,[R]:F})),!0}default:return!1}},[n]),b=_.useCallback((A,O,B,U)=>{n({type:"spawn",payload:{environmentId:A,prompt:O,personaId:B||"",worktreeBasePath:U||""}})},[n]),S=_.useCallback((A,O)=>{n({type:"send_input",payload:{sessionId:A,text:O}})},[n]),k=_.useCallback(A=>{n({type:"kill",payload:{sessionId:A}})},[n]),E=_.useCallback(A=>{n({type:"get_session_events",payload:{sessionId:A}})},[n]),N=_.useCallback(()=>{r([]),u(0)},[]),C=_.useCallback(A=>{n({type:"get_task_sessions",payload:{taskId:A}})},[n]);return{sessions:a,events:o,eventsDropped:f,lastSpawnedId:p,taskSessions:g,spawn:b,sendInput:S,kill:k,loadSessionEvents:E,clearEvents:N,loadTaskSessions:C,handleMessage:v}}function QC(n){const[a,i]=_.useState([]),[o,r]=_.useState(!1),f=_.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]),u=_.useCallback(v=>{var b;switch(v.type){case"workspaces":return i(Kn((b=v.payload)==null?void 0:b.workspaces,XS,"workspaces","workspaces")),!0;default:return!1}},[]),p=_.useCallback(()=>{r(!1)},[]),m=_.useCallback((v,b,S,k,E)=>{r(!0),n({type:"create_workspace",payload:{name:v,description:b||"",repoUrl:S||"",environmentId:k||"",defaultPersonaId:E||""}})},[n]),g=_.useCallback(v=>{n({type:"archive_workspace",payload:{workspaceId:v}})},[n]),y=_.useCallback((v,b)=>{n({type:"update_workspace",payload:{workspaceId:v,...b}})},[n]);return{workspaces:a,workspaceCreating:o,createWorkspace:m,archiveWorkspace:g,updateWorkspace:y,handleMessage:u,handleEvent:f,onDisconnect:p}}const WC=15e3;function JC(n){const[a,i]=_.useState([]),[o,r]=_.useState(void 0),f=_.useRef(new Map),u=_.useCallback(A=>{const O=A.payload;switch(A.type){case"task.created":{const B=typeof O.requestId=="string"?O.requestId:"";if(B){const q=f.current.get(B);q&&(clearTimeout(q.timer),f.current.delete(B),q.onSuccess())}const U=typeof O.workspaceId=="string"?O.workspaceId:"";return U&&n({type:"list_tasks",payload:{workspaceId:U}}),!0}case"task.started":{const B=typeof O.taskId=="string"?O.taskId:"",U=typeof O.sessionId=="string"?O.sessionId:"",q=typeof O.workspaceId=="string"?O.workspaceId:"";return r(M=>B&&M===B?void 0:M),U&&(n({type:"list_sessions"}),B&&i(M=>M.map(R=>R.id===B?{...R,latestSessionId:U}:R))),q?n({type:"list_tasks",payload:{workspaceId:q}}):B&&i(M=>{const R=M.find(F=>F.id===B);return R!=null&&R.workspaceId?n({type:"list_tasks",payload:{workspaceId:R.workspaceId}}):n({type:"list_tasks",payload:{}}),M}),!0}case"task.completed":case"task.deleted":case"task.updated":{const B=typeof O.workspaceId=="string"?O.workspaceId:"",U=typeof O.taskId=="string"?O.taskId:"";return B?n({type:"list_tasks",payload:{workspaceId:B}}):U&&i(q=>{const M=q.find(R=>R.id===U);return M!=null&&M.workspaceId?n({type:"list_tasks",payload:{workspaceId:M.workspaceId}}):n({type:"list_tasks",payload:{}}),q}),!0}default:return!1}},[n]),p=_.useCallback(A=>{var O,B,U,q;switch(A.type){case"tasks":{const M=Kn((O=A.payload)==null?void 0:O.tasks,QS,"tasks","tasks"),R=typeof((B=A.payload)==null?void 0:B.workspaceId)=="string"&&A.payload.workspaceId?A.payload.workspaceId:"";return R?(i(F=>[...F.filter(ee=>ee.workspaceId!==R),...M]),!0):(i(F=>{const ee=new Set(M.map(te=>te.id));return[...F.filter(te=>!ee.has(te.id)),...M]}),!0)}case"create_task_error":{const M=typeof((U=A.payload)==null?void 0:U.requestId)=="string"?A.payload.requestId:"",R=typeof((q=A.payload)==null?void 0:q.message)=="string"?A.payload.message:"Failed to create task";if(M){const F=f.current.get(M);F?(clearTimeout(F.timer),f.current.delete(M),F.onError(R)):console.error("[useTasks] create_task_error with unknown requestId:",R)}else console.error("[useTasks] create_task_error:",R);return!0}default:return!1}},[]),m=_.useCallback(()=>{r(void 0);for(const[,A]of f.current)clearTimeout(A.timer),A.onError("Disconnected");f.current.clear()},[]),g=_.useCallback(A=>{n({type:"list_tasks",payload:{workspaceId:A}})},[n]),y=_.useCallback(()=>{n({type:"list_tasks",payload:{}})},[n]),v=_.useCallback((A,O,B,U,q,M,R,F,ee)=>{const te={workspaceId:A,title:O,description:B||"",dependsOn:U||[],parentTaskId:q||"",defaultPersonaId:M||"",canDecompose:R||!1};if(F||ee){const se=crypto.randomUUID();te.requestId=se;const re=ee??(()=>{}),Q=setTimeout(()=>{f.current.delete(se)&&re("Request timed out")},WC);f.current.set(se,{onSuccess:F??(()=>{}),onError:re,timer:Q})}n({type:"create_task",payload:te})},[n]),b=_.useCallback((A,O,B,U)=>{r(A),n({type:"start_task",payload:{taskId:A,personaId:O||"",environmentId:B||"",notes:U||""}})},[n]),S=_.useCallback(A=>{n({type:"stop_task",payload:{taskId:A}})},[n]),k=_.useCallback(A=>{n({type:"complete_task",payload:{taskId:A}})},[n]),E=_.useCallback(A=>{n({type:"resume_task",payload:{taskId:A}})},[n]),N=_.useCallback((A,O,B,U,q)=>{const M={taskId:A,title:O,description:B,dependsOn:U};q!==void 0&&(M.defaultPersonaId=q),n({type:"update_task",payload:M})},[n]),C=_.useCallback(A=>{n({type:"delete_task",payload:{taskId:A}})},[n]);return{tasks:a,taskStartingId:o,loadTasks:g,loadAllTasks:y,createTask:v,startTask:b,stopTask:S,completeTask:k,resumeTask:E,updateTask:N,deleteTask:C,handleMessage:p,handleEvent:u,onDisconnect:m}}function ek(n){const[a,i]=_.useState([]),o=_.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=_.useCallback(p=>{var m;switch(p.type){case"findings":return i(Kn((m=p.payload)==null?void 0:m.findings,WS,"findings","findings")),!0;default:return!1}},[]),f=_.useCallback(p=>{n({type:"list_findings",payload:{workspaceId:p}})},[n]),u=_.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:f,postFinding:u,handleMessage:r,handleEvent:o}}function tk(n){const[a,i]=_.useState([]),o=_.useCallback(m=>m.type==="token.changed"?(n({type:"list_tokens"}),!0):!1,[n]),r=_.useCallback(m=>{var g;switch(m.type){case"tokens":return i(Kn((g=m.payload)==null?void 0:g.tokens,JS,"tokens","tokens")),!0;default:return!1}},[]),f=_.useCallback(()=>{n({type:"list_tokens"})},[n]),u=_.useCallback((m,g,y,v,b)=>{n({type:"set_token",payload:{name:m,value:g,tokenType:y,envVar:v,filePath:b}})},[n]),p=_.useCallback(m=>{n({type:"delete_token",payload:{name:m}})},[n]);return{tokens:a,loadTokens:f,setToken:u,deleteToken:p,handleMessage:r,handleEvent:o}}function nk(n){const[a,i]=_.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),o=_.useCallback(u=>u.type==="credential.providers_changed"?(Qv(u.payload)&&i(u.payload),!0):!1,[]),r=_.useCallback(u=>{switch(u.type){case"credential_providers":return Qv(u.payload)&&i(u.payload),!0;default:return!1}},[]),f=_.useCallback(u=>{n({type:"set_credential_providers",payload:u})},[n]);return{credentialProviders:a,updateCredentialProviders:f,handleMessage:r,handleEvent:o}}function ak(n,a){const[i,o]=_.useState([]),[r,f]=_.useState(""),[u,p]=_.useState(""),[m,g]=_.useState(!1),y=_.useCallback(S=>{var k,E,N;switch(S.type){case"codespaces_list":{const C=Kn((k=S.payload)==null?void 0:k.codespaces,tT,"codespaces_list","codespaces"),A=typeof((E=S.payload)==null?void 0:E.error)=="string"?S.payload.error:"";return o(C),p(A),!0}case"codespace_created":return g(!1),n({type:"list_codespaces"}),!0;case"codespace_create_error":{g(!1);const C=typeof((N=S.payload)==null?void 0:N.message)=="string"?S.payload.message:"Failed to create codespace";return f(C),!0}default:return!1}},[n]),v=_.useCallback(()=>{n({type:"list_codespaces"})},[n]),b=_.useCallback((S,k)=>{if(!a){f("Not connected to server. Please try again once the connection is restored.");return}g(!0),f("");const E={repo:S};k&&(E.machine=k),n({type:"create_codespace",payload:E})},[n,a]);return{codespaces:i,codespaceError:r,codespaceListError:u,codespaceCreating:m,listCodespaces:v,createCodespace:b,handleMessage:y}}function sk(n){const[a,i]=_.useState([]),o=_.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=_.useCallback(m=>{var g;switch(m.type){case"personas":{const y=Kn((g=m.payload)==null?void 0:g.personas,nT,"personas","personas");return i(y),!0}default:return!1}},[]),f=_.useCallback((m,g,y,v,b,S,k,E)=>{n({type:"create_persona",payload:{name:m,description:g,systemPrompt:y,runtime:v||"",model:b||"",maxTurns:S||0,type:k||"agent",script:E||""}})},[n]),u=_.useCallback((m,g,y,v,b,S,k,E,N)=>{const C={personaId:m};g!==void 0&&(C.name=g),y!==void 0&&(C.description=y),v!==void 0&&(C.systemPrompt=v),b!==void 0&&(C.runtime=b),S!==void 0&&(C.model=S),k!==void 0&&(C.maxTurns=k),E!==void 0&&(C.type=E),N!==void 0&&(C.script=N),n({type:"update_persona",payload:C})},[n]),p=_.useCallback(m=>{n({type:"delete_persona",payload:{personaId:m}})},[n]);return{personas:a,createPersona:f,updatePersona:u,deletePersona:p,handleMessage:r,handleEvent:o}}function ik(n){const[a,i]=_.useState(""),[o,r]=_.useState(void 0),{connected:f,send:u}=qC(n,{onMessage:U,onConnect:q,onDisconnect:M}),p=KC(u),m=XC(u),g=QC(u),y=JC(u),v=ek(u),b=tk(u),S=nk(u),k=ak(u,f),E=sk(u),N="default_persona_id",C="onboarding_completed",A=_.useCallback(F=>{i(F),u({type:"set_setting",payload:{key:N,value:F}})},[u]),O=_.useCallback(()=>{r(!0),u({type:"set_setting",payload:{key:C,value:"true"}})},[u]);function B(F){const ee=F.payload.key,te=F.payload.value;if(F.type==="setting.changed"){ee===N&&i(te??""),ee===C&&r(te==="true");return}p.handleEvent(F)||g.handleEvent(F)||y.handleEvent(F)||v.handleEvent(F)||b.handleEvent(F)||S.handleEvent(F)||E.handleEvent(F)}function U(F){var ee,te,se;if(YS(F)){B(F);return}if(F.type==="setting"){const re=(ee=F.payload)==null?void 0:ee.key,Q=(te=F.payload)==null?void 0:te.value;re===N&&i(Q??""),re===C&&r(Q==="true");return}if(!p.handleMessage(F)&&!m.handleMessage(F)&&!g.handleMessage(F)&&!y.handleMessage(F)&&!v.handleMessage(F)&&!b.handleMessage(F)&&!S.handleMessage(F)&&!k.handleMessage(F)&&!E.handleMessage(F)&&F.type==="error"){console.error("[ws]",(se=F.payload)==null?void 0:se.message);return}}function q(F){F({type:"list_environments"}),F({type:"list_sessions"}),F({type:"list_workspaces"}),F({type:"list_tokens"}),F({type:"get_credential_providers"}),F({type:"list_personas"}),F({type:"get_setting",payload:{key:N}}),F({type:"get_setting",payload:{key:C}}),F({type:"list_tasks",payload:{}}),F({type:"subscribe_all"})}function M(){g.onDisconnect(),y.onDisconnect()}const R=_.useCallback(()=>{u({type:"list_environments"}),u({type:"list_sessions"}),u({type:"list_workspaces"}),u({type:"list_tokens"})},[u]);return{connected:f,environments:p.environments,sessions:m.sessions,events:m.events,eventsDropped:m.eventsDropped,lastSpawnedId:m.lastSpawnedId,workspaces:g.workspaces,tasks:y.tasks,findings:v.findings,tokens:b.tokens,spawn:m.spawn,sendInput:m.sendInput,kill:m.kill,refresh:R,loadSessionEvents:m.loadSessionEvents,clearEvents:m.clearEvents,createWorkspace:g.createWorkspace,archiveWorkspace:g.archiveWorkspace,updateWorkspace:g.updateWorkspace,loadTasks:y.loadTasks,loadAllTasks:y.loadAllTasks,createTask:y.createTask,startTask:y.startTask,stopTask:y.stopTask,completeTask:y.completeTask,resumeTask:y.resumeTask,updateTask:y.updateTask,deleteTask:y.deleteTask,loadFindings:v.loadFindings,postFinding:v.postFinding,addEnvironment:p.addEnvironment,updateEnvironment:p.updateEnvironment,loadTokens:b.loadTokens,setToken:b.setToken,deleteToken:b.deleteToken,credentialProviders:S.credentialProviders,updateCredentialProviders:S.updateCredentialProviders,provisionStatus:p.provisionStatus,provisionEnvironment:p.provisionEnvironment,stopEnvironment:p.stopEnvironment,removeEnvironment:p.removeEnvironment,codespaces:k.codespaces,codespaceError:k.codespaceError,codespaceListError:k.codespaceListError,codespaceCreating:k.codespaceCreating,listCodespaces:k.listCodespaces,createCodespace:k.createCodespace,workspaceCreating:g.workspaceCreating,taskStartingId:y.taskStartingId,personas:E.personas,createPersona:E.createPersona,updatePersona:E.updatePersona,deletePersona:E.deletePersona,taskSessions:m.taskSessions,loadTaskSessions:m.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:A,onboardingCompleted:o,completeOnboarding:O}}const ah=_.createContext(void 0);function lk({children:n}){const a=ik();return c.jsx(ah.Provider,{value:a,children:n})}function ut(){const n=_.useContext(ah);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const ok=[{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}],rk=[{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"},{id:"sess-001",environmentId:"env-local-01",runtime:"node",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z"},{id:"sess-002",environmentId:"env-docker-01",runtime:"python",status:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z"},{id:"sess-003",environmentId:"env-local-01",runtime:"node",status:"failed",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z"},{id:"sess-004",environmentId:"env-docker-01",runtime:"python",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z"}],ck=[{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"}],uk=[{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"}],dk=[{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:""}],ly=[{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"}],fk=[{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:""}],hk=[{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:""}],pk={"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 jt(n){return new Date(Date.now()+n).toISOString()}const oy=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:jt(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:jt(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:jt(1600),content:`Found 5 endpoints that need refactoring:
61
- - GET /api/users
62
- - POST /api/users
63
- - GET /api/users/:id
64
- - PUT /api/users/:id
65
- - DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:jt(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:jt(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:jt(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:jt(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:jt(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:jt(1400),content:`Found tables to modify:
66
- - users (add column: last_login_at)
67
- - sessions (add index on expires_at)
68
- - audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:jt(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
69
- The table has 50,000+ rows — this may lock the table briefly.
70
-
71
- Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:jt(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:jt(1e3),content:`Migration 001_add_last_login.sql applied successfully.
72
- Migration 002_sessions_index.sql applied successfully.
73
- Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:jt(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:jt(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:jt(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:jt(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:jt(1800),content:`Writing test cases:
74
- - should calculate monthly total
75
- - should apply discount codes
76
- - should handle currency conversion
77
- - should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:jt(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
78
- The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:jt(3500),content:"failed"}}]}],ry=400;function mk({children:n}){const[a,i]=_.useState(ok),[o,r]=_.useState(rk),[f,u]=_.useState(ck),[p,m]=_.useState(void 0),[g,y]=_.useState(uk),[v,b]=_.useState(dk),[S,k]=_.useState(ly),[E,N]=_.useState(fk),[C,A]=_.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),[O,B]=_.useState(hk),[U]=_.useState(pk),[q,M]=_.useState(""),R=_.useRef(0),F=_.useRef(0),ee=_.useRef(new Set),te=_.useRef(new Map),se=_.useRef(v);se.current=v;const re=_.useRef(new Map),Q=_.useRef(new Map),ie=_.useCallback(Z=>(R.current+=1,`mock-${Z}-${String(R.current).padStart(3,"0")}`),[]),I=_.useCallback(()=>{const Z=oy[F.current%oy.length];return F.current+=1,Z},[]),D=_.useCallback((Z,le,ce)=>{const _e=setTimeout(()=>{var xe;ee.current.delete(_e),ce&&((xe=te.current.get(ce))==null||xe.delete(_e)),Z()},le);ee.current.add(_e),ce&&(te.current.has(ce)||te.current.set(ce,new Set),te.current.get(ce).add(_e))},[]),ne=_.useCallback(Z=>{const le=te.current.get(Z);le&&(le.forEach(ce=>{clearTimeout(ce),ee.current.delete(ce)}),te.current.delete(Z))},[]),oe=_.useCallback((Z,le)=>{r(ce=>ce.map(_e=>_e.id===Z?{..._e,status:le}:_e))},[]),z=_.useCallback(Z=>{u(le=>[...le,Z])},[]),J=_.useCallback((Z,le,ce)=>{le.forEach((_e,xe)=>{D(()=>{const tt={sessionId:Z,..._e.event,timestamp:new Date().toISOString()};z(tt),_e.event.eventType==="status"&&oe(Z,_e.event.content),xe===le.length-1&&ce&&ce()},_e.delayMs,Z)})},[D,z,oe]),Se=_.useCallback((Z,le,ce,_e)=>{console.log("[MockGrackle] spawn",{environmentId:Z,prompt:le,runtime:_e});const xe=ie("sess"),tt={id:xe,environmentId:Z,runtime:_e||"claude-code",status:"running",prompt:le,startedAt:new Date().toISOString()};r(vt=>[...vt,tt]),m(xe);const Ne=I();if(console.log(`[MockGrackle] Playing scenario: ${Ne.label}`),Ne.pauseForInput){const vt=Ne.pauseAfterStep??Ne.steps.length-1,Ae=Ne.steps.slice(0,vt+1),ft=Ae.length>0?Ae[Ae.length-1].delayMs:0;J(xe,Ae),D(()=>{oe(xe,"idle"),z({sessionId:xe,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},ft+ry,xe),Ne.resumeSteps&&re.current.set(xe,Ne.resumeSteps)}else J(xe,Ne.steps)},[ie,I,J,D,oe,z]),ae=_.useCallback(Z=>{console.log("[MockGrackle] kill",Z),ne(Z),re.current.delete(Z),oe(Z,"interrupted"),z({sessionId:Z,eventType:"status",timestamp:new Date().toISOString(),content:"interrupted"}),b(le=>le.map(ce=>ce.latestSessionId===Z&&ce.status==="working"?{...ce,status:"not_started"}:ce))},[ne,oe,z]),pe=_.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),qe=_.useCallback(Z=>{console.log("[MockGrackle] loadSessionEvents",Z)},[]),Ot=_.useCallback(()=>{console.log("[MockGrackle] clearEvents"),u([])},[]),vn=_.useCallback((Z,le,ce,_e,xe)=>{console.log("[MockGrackle] createWorkspace",{name:Z,description:le});const tt={id:ie("proj"),name:Z,description:le||"",repoUrl:ce||"",environmentId:_e||"",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:xe||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};y(Ne=>[...Ne,tt])},[ie]),_t=_.useCallback(Z=>{console.log("[MockGrackle] archiveWorkspace",Z),y(le=>le.map(ce=>ce.id===Z?{...ce,status:"archived"}:ce))},[]),ge=_.useCallback(Z=>{console.log("[MockGrackle] loadTasks",Z)},[]),dt=_.useCallback((Z,le,ce,_e,xe,tt,Ne,vt,Ae)=>{console.log("[MockGrackle] createTask",{workspaceId:Z,title:le,parentTaskId:xe}),b(ft=>{const qt=ft.filter(bn=>bn.workspaceId===Z).reduce((bn,Na)=>Math.max(bn,Na.sortOrder),0),an=xe?ft.find(bn=>bn.id===xe):void 0;if(xe&&!an)return console.warn("[MockGrackle] Parent task not found:",xe),ft;if(an&&!an.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",xe),ft;const Gt=an?an.depth+1:0,Ea={id:ie("task"),workspaceId:Z,title:le,description:ce||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:_e||[],reviewNotes:void 0,sortOrder:qt+1,createdAt:new Date().toISOString(),parentTaskId:xe||"",depth:Gt,childTaskIds:[],canDecompose:Ne??!xe,defaultPersonaId:tt||""};return[...ft,Ea]}),vt&&vt()},[ie]),On=_.useCallback((Z,le,ce,_e)=>{var ft;console.log("[MockGrackle] startTask",{taskId:Z});const xe=se.current.find(Xe=>Xe.id===Z),tt=(xe==null?void 0:xe.title)??"",Ne=ie("sess"),vt={id:Ne,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:tt||Z,startedAt:new Date().toISOString()};r(Xe=>[...Xe,vt]),b(Xe=>Xe.map(qt=>qt.id===Z?{...qt,status:"working",latestSessionId:Ne,branch:`mock/${Z.slice(0,8)}`}:qt));const Ae=I();if(console.log(`[MockGrackle] Playing task scenario: ${Ae.label}`),Ae.pauseForInput){const Xe=Ae.pauseAfterStep??Ae.steps.length-1,qt=Ae.steps.slice(0,Xe+1),an=qt.length>0?qt[qt.length-1].delayMs:0;if(J(Ne,qt),D(()=>{oe(Ne,"idle"),z({sessionId:Ne,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},an+ry,Ne),Ae.resumeSteps){const Gt=[...Ae.resumeSteps];re.current.set(Ne,Gt);const Ea=Gt.reduce((bn,Na)=>Math.max(bn,Na.delayMs),0);Q.current.set(Ne,{taskId:Z,delayAfterResume:Ea+200})}}else{const Xe=Ae.steps.length>0?Ae.steps[Ae.steps.length-1].delayMs:0;J(Ne,Ae.steps);const qt=(ft=Ae.steps[Ae.steps.length-1])==null?void 0:ft.event.content;D(()=>{qt==="completed"?b(an=>an.map(Gt=>Gt.id===Z&&Gt.status==="working"?{...Gt,status:"paused"}:Gt)):qt==="failed"&&b(an=>an.map(Gt=>Gt.id===Z&&Gt.status==="working"?{...Gt,status:"failed"}:Gt))},Xe+100,Ne)}},[ie,I,J,D,oe,z]),Jn=_.useCallback((Z,le)=>{console.log("[MockGrackle] sendInput",{sessionId:Z,text:le}),z({sessionId:Z,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${le}`}),oe(Z,"running"),z({sessionId:Z,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const ce=re.current.get(Z);if(ce)re.current.delete(Z),J(Z,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"}}];J(Z,xe)}const _e=Q.current.get(Z);_e&&(Q.current.delete(Z),D(()=>{b(xe=>xe.map(tt=>tt.id===_e.taskId&&tt.status==="working"?{...tt,status:"paused"}:tt))},_e.delayAfterResume,Z))},[z,oe,J,D]),Ze=_.useCallback(Z=>{console.log("[MockGrackle] completeTask",Z),b(le=>le.map(ce=>ce.id===Z?{...ce,status:"complete"}:ce))},[]),Te=_.useCallback(Z=>{console.log("[MockGrackle] resumeTask",Z)},[]),et=_.useCallback((Z,le,ce,_e,xe)=>{console.log("[MockGrackle] updateTask",{taskId:Z,title:le}),b(tt=>tt.map(Ne=>Ne.id===Z?{...Ne,title:le.trim()||Ne.title,description:ce,dependsOn:_e,...xe!==void 0?{defaultPersonaId:xe}:{}}:Ne))},[]),yn=_.useCallback(Z=>{console.log("[MockGrackle] deleteTask",Z),b(le=>le.filter(ce=>ce.id!==Z))},[]),Le=_.useCallback(Z=>{console.log("[MockGrackle] loadFindings",Z),k(ly.filter(le=>le.workspaceId===Z))},[]),zn=_.useCallback((Z,le,ce,_e,xe)=>{console.log("[MockGrackle] postFinding",{workspaceId:Z,title:le});const tt={id:ie("find"),workspaceId:Z,taskId:"",sessionId:"",category:_e||"general",title:le,content:ce,tags:xe||[],createdAt:new Date().toISOString()};k(Ne=>[...Ne,tt])},[ie]),Vn=_.useCallback((Z,le,ce)=>{console.log("[MockGrackle] addEnvironment",{displayName:Z,adapterType:le,adapterConfig:ce})},[]),zs=_.useCallback((Z,le)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:Z,...le}),i(ce=>ce.map(_e=>_e.id!==Z?_e:{..._e,...le.displayName!==void 0?{displayName:le.displayName}:{},...le.adapterConfig!==void 0?{adapterConfig:JSON.stringify(le.adapterConfig)}:{}}))},[]),Vs=_.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),_o=_.useCallback((Z,le,ce,_e,xe)=>{console.log("[MockGrackle] setToken",{name:Z,tokenType:ce}),N(tt=>[...tt.filter(vt=>vt.name!==Z),{name:Z,tokenType:ce,envVar:_e,filePath:xe,expiresAt:""}])},[]),So=_.useCallback(Z=>{console.log("[MockGrackle] deleteToken",Z),N(le=>le.filter(ce=>ce.name!==Z))},[]),Ht=_.useCallback(Z=>{console.log("[MockGrackle] updateCredentialProviders",Z),A(Z)},[]);_.useEffect(()=>()=>{ee.current.forEach(clearTimeout),ee.current.clear()},[]);const kc=_.useMemo(()=>({connected:!0,environments:a,sessions:o,events:f,eventsDropped:0,lastSpawnedId:p,workspaces:g,tasks:v,findings:S,tokens:E,credentialProviders:C,spawn:Se,sendInput:Jn,kill:ae,refresh:pe,loadSessionEvents:qe,clearEvents:Ot,createWorkspace:vn,archiveWorkspace:_t,updateWorkspace:(Z,le)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:Z,...le}),y(ce=>ce.map(_e=>_e.id!==Z?_e:{..._e,...le.name!==void 0?{name:le.name}:{},...le.description!==void 0?{description:le.description}:{},...le.repoUrl!==void 0?{repoUrl:le.repoUrl}:{},...le.environmentId!==void 0?{environmentId:le.environmentId}:{},...le.worktreeBasePath!==void 0?{worktreeBasePath:le.worktreeBasePath}:{},...le.useWorktrees!==void 0?{useWorktrees:le.useWorktrees}:{},...le.defaultPersonaId!==void 0?{defaultPersonaId:le.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:ge,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:dt,startTask:On,stopTask:Z=>{console.log("[MockGrackle] stopTask",{taskId:Z}),Ze(Z)},completeTask:Ze,resumeTask:Te,updateTask:et,deleteTask:yn,loadFindings:Le,postFinding:zn,addEnvironment:Vn,updateEnvironment:zs,loadTokens:Vs,setToken:_o,deleteToken:So,updateCredentialProviders:Ht,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:O,createPersona:(Z,le,ce,_e,xe,tt,Ne,vt)=>{console.log("[MockGrackle] createPersona",{name:Z});const Ae={id:`mock-persona-${Date.now()}`,name:Z,description:le,systemPrompt:ce,toolConfig:"{}",runtime:_e??"claude-code",model:xe||"",maxTurns:tt||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Ne||"agent",script:vt||""};B(ft=>[...ft,Ae])},updatePersona:(Z,le,ce,_e,xe,tt,Ne,vt,Ae)=>{console.log("[MockGrackle] updatePersona",{personaId:Z,name:le}),B(ft=>ft.map(Xe=>Xe.id!==Z?Xe:{...Xe,...le!==void 0?{name:le}:{},...ce!==void 0?{description:ce}:{},..._e!==void 0?{systemPrompt:_e}:{},...xe!==void 0?{runtime:xe}:{},...tt!==void 0?{model:tt}:{},...Ne!==void 0?{maxTurns:Ne}:{},...vt!==void 0?{type:vt}:{},...Ae!==void 0?{script:Ae}:{},updatedAt:new Date().toISOString()}))},deletePersona:Z=>{console.log("[MockGrackle] deletePersona",Z),B(le=>le.filter(ce=>ce.id!==Z))},taskSessions:U,loadTaskSessions:Z=>{console.log("[MockGrackle] loadTaskSessions",Z)},appDefaultPersonaId:q,setAppDefaultPersonaId:Z=>{console.log("[MockGrackle] setAppDefaultPersonaId",Z),M(Z)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")}}),[a,o,f,p,g,v,S,E,C,O,U,q,Se,Jn,ae,pe,qe,Ot,vn,_t,ge,dt,On,Ze,Te,et,yn,Le,zn,Vn,zs,Vs,_o,So,Ht]);return c.jsx(ah.Provider,{value:kc,children:n})}const hb=_.createContext(void 0),gk=4e3;function vk({children:n}){const[a,i]=_.useState([]),o=_.useRef(0),r=_.useCallback(u=>{i(p=>p.filter(m=>m.id!==u))},[]),f=_.useCallback((u,p="info",m=gk)=>{const g=`toast-${++o.current}`;i(y=>[...y,{id:g,message:u,variant:p,duration:m}])},[]);return c.jsx(hb.Provider,{value:{toasts:a,showToast:f,dismissToast:r},children:n})}function Fi(){const n=_.useContext(hb);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const vc=[{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"]}],pb=new Set(vc.map(n=>n.id)),cy="grackle";function bf(n){return vc.find(a=>a.id===n)}const xf="grackle-theme",mb="grackle-prefer-system",gb="(prefers-color-scheme: dark)";let ql=[],Zr;function qd(){Zr=void 0;for(const n of ql)n()}function _f(){return typeof window>"u"?!1:window.matchMedia(gb).matches}function Wl(){if(typeof localStorage>"u")return cy;try{const n=localStorage.getItem(xf);if(n!==null&&pb.has(n))return n}catch{}return cy}function tc(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(mb)==="true"}catch{return!1}}function Sf(n){return vc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function vb(n,a){const i=bf(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?_f()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const o=Sf(n);if(o!=null&&o.variantLightId&&o.variantDarkId)return _f()?o.variantDarkId:o.variantLightId}return n}function Ai(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=vb(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Ai(Wl(),tc());function yk(){return Zr===void 0&&(Zr={themeId:Wl(),systemDark:_f(),preferSystem:tc()}),Zr}function bk(n){return ql=[...ql,n],()=>{ql=ql.filter(a=>a!==n)}}function xk(){const n=_.useSyncExternalStore(bk,yk),{themeId:a,preferSystem:i}=n,o=vb(a,i),r=_.useCallback(u=>{if(pb.has(u)){try{localStorage.setItem(xf,u)}catch{}Ai(u,tc(),!0),qd()}},[]),f=_.useCallback(u=>{try{localStorage.setItem(mb,u?"true":"false")}catch{}if(u){const p=Wl(),m=bf(p);if(m!=null&&m.hidden){const g=Sf(p);if(g)try{localStorage.setItem(xf,g.id)}catch{}}}Ai(Wl(),u,!0),qd()},[]);return _.useEffect(()=>{Ai(a,i)},[a,i]),_.useEffect(()=>{if(typeof window>"u")return;const u=window.matchMedia(gb),p=()=>{const m=Wl(),g=tc();if(g){const y=bf(m);if(y!=null&&y.variantDarkId&&y.variantLightId&&Ai(m,g),y!=null&&y.hidden){const v=Sf(m);v!=null&&v.variantDarkId&&v.variantLightId&&Ai(m,g)}}qd()};return u.addEventListener("change",p),()=>{u.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:o,preferSystem:i,setPreferSystem:f}}const yb=_.createContext(void 0);function _k({children:n}){const a=xk();return c.jsx(yb.Provider,{value:a,children:n})}function bb(){const n=_.useContext(yb);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const Sk="_container_1mq5u_1",Tk="_hamburger_1mq5u_33",Ck="_brand_1mq5u_49",kk="_brandLogo_1mq5u_68",Ek="_info_1mq5u_75",Nk="_connectionLabel_1mq5u_90",Ak="_connectionDot_1mq5u_103",jk="_connected_1mq5u_106",wk="_disconnected_1mq5u_110",ya={container:Sk,hamburger:Tk,brand:Ck,brandLogo:kk,info:Ek,connectionLabel:Nk,connectionDot:Ak,connected:jk,disconnected:wk};function Dk({onToggleSidebar:n,sidebarOpen:a}){const{connected:i,environments:o,sessions:r}=ut(),f=$t(),u=o.length,p=o.filter(g=>g.status==="connected").length,m=r.filter(g=>["running","idle"].includes(g.status)).length;return c.jsxs("div",{className:ya.container,children:[n&&c.jsx("button",{type:"button",className:ya.hamburger,onClick:n,"aria-label":"Toggle sidebar","aria-expanded":a,children:"☰"}),c.jsxs("button",{type:"button",className:ya.brand,onClick:()=>f(go),title:"Home",children:[c.jsx("img",{src:"/icon-192x192.png",alt:"",className:ya.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),c.jsxs("div",{className:ya.info,children:[c.jsxs("span",{"aria-label":i?"Connected":"Disconnected",children:[c.jsx("span",{className:`${ya.connectionDot} ${i?ya.connected:ya.disconnected}`,"aria-hidden":"true",children:"●"})," ",c.jsx("span",{className:ya.connectionLabel,"aria-hidden":"true",children:i?"Connected":"Disconnected"})]}),c.jsxs("span",{children:[p,"/",u," env",u!==1?"s":""]}),c.jsxs("span",{children:[m," active"]})]})]})}const Mk="_nav_13gkc_1",Rk="_tab_13gkc_35",Ok="_tabIcon_13gkc_68",Bk="_tabLabel_13gkc_79",Ik="_tabActive_13gkc_84",Gl={nav:Mk,tab:Rk,tabIcon:Ok,tabLabel:Bk,tabActive:Ik},Ns=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:go,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:FC,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:$C,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:oo,testId:"sidebar-tab-environments"},{view:"settings",label:"Settings",icon:"⚙️",route:GC,testId:"sidebar-tab-settings"}];function xb(n){return n===go||n==="/"?"dashboard":n.startsWith("/chat")||n.startsWith("/sessions")?"chat":n.startsWith("/workspaces")||n.startsWith("/environments")?"environments":n.startsWith(Ql)?"settings":"tasks"}function Lk(){const n=Rt(),a=$t(),i=_.useRef(null),o=xb(n.pathname),r=_.useCallback(u=>{a(u.route)},[a]),f=_.useCallback(u=>{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:Ns.findIndex(S=>S.view===o);let y=g;if(u.key==="ArrowRight")u.preventDefault(),y=(g+1)%Ns.length;else if(u.key==="ArrowLeft")u.preventDefault(),y=(g-1+Ns.length)%Ns.length;else if(u.key==="Home")u.preventDefault(),y=0;else if(u.key==="End")u.preventDefault(),y=Ns.length-1;else return;a(Ns[y].route),(b=p[y])==null||b.focus()},[o,a]);return c.jsx("nav",{className:Gl.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:f,"data-testid":"sidebar-nav",children:Ns.map(u=>{const p=u.view===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Gl.tab} ${p?Gl.tabActive:""}`,onClick:()=>r(u),"data-testid":u.testId,title:u.label,"aria-label":u.label,children:[c.jsx("span",{className:Gl.tabIcon,"aria-hidden":"true",children:u.icon}),c.jsx("span",{className:Gl.tabLabel,children:u.label})]},u.view)})})}const sh=_.createContext({});function ih(n){const a=_.useRef(null);return a.current===null&&(a.current=n()),a.current}const yc=_.createContext(null),lh=_.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class Uk extends _.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=i.offsetHeight||0,o.width=i.offsetWidth||0,o.top=i.offsetTop,o.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function zk({children:n,isPresent:a}){const i=_.useId(),o=_.useRef(null),r=_.useRef({width:0,height:0,top:0,left:0}),{nonce:f}=_.useContext(lh);return _.useInsertionEffect(()=>{const{width:u,height:p,top:m,left:g}=r.current;if(a||!o.current||!u||!p)return;o.current.dataset.motionPopId=i;const y=document.createElement("style");return f&&(y.nonce=f),document.head.appendChild(y),y.sheet&&y.sheet.insertRule(`
79
- [data-motion-pop-id="${i}"] {
80
- position: absolute !important;
81
- width: ${u}px !important;
82
- height: ${p}px !important;
83
- top: ${m}px !important;
84
- left: ${g}px !important;
85
- }
86
- `),()=>{document.head.removeChild(y)}},[a]),c.jsx(Uk,{isPresent:a,childRef:o,sizeRef:r,children:_.cloneElement(n,{ref:o})})}const Vk=({children:n,initial:a,isPresent:i,onExitComplete:o,custom:r,presenceAffectsLayout:f,mode:u})=>{const p=ih(Hk),m=_.useId(),g=_.useCallback(v=>{p.set(v,!0);for(const b of p.values())if(!b)return;o&&o()},[p,o]),y=_.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:v=>(p.set(v,!1),()=>p.delete(v))}),f?[Math.random(),g]:[i,g]);return _.useMemo(()=>{p.forEach((v,b)=>p.set(b,!1))},[i]),_.useEffect(()=>{!i&&!p.size&&o&&o()},[i]),u==="popLayout"&&(n=c.jsx(zk,{isPresent:i,children:n})),c.jsx(yc.Provider,{value:y,children:n})};function Hk(){return new Map}function _b(n=!0){const a=_.useContext(yc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:o,register:r}=a,f=_.useId();_.useEffect(()=>{n&&r(f)},[n]);const u=_.useCallback(()=>n&&o&&o(f),[f,o,n]);return!i&&o?[!1,u]:[!0]}const Ur=n=>n.key||"";function uy(n){const a=[];return _.Children.forEach(n,i=>{_.isValidElement(i)&&a.push(i)}),a}const oh=typeof window<"u",Sb=oh?_.useLayoutEffect:_.useEffect,Wn=({children:n,custom:a,initial:i=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:f="sync",propagate:u=!1})=>{const[p,m]=_b(u),g=_.useMemo(()=>uy(n),[n]),y=u&&!p?[]:g.map(Ur),v=_.useRef(!0),b=_.useRef(g),S=ih(()=>new Map),[k,E]=_.useState(g),[N,C]=_.useState(g);Sb(()=>{v.current=!1,b.current=g;for(let B=0;B<N.length;B++){const U=Ur(N[B]);y.includes(U)?S.delete(U):S.get(U)!==!0&&S.set(U,!1)}},[N,y.length,y.join("-")]);const A=[];if(g!==k){let B=[...g];for(let U=0;U<N.length;U++){const q=N[U],M=Ur(q);y.includes(M)||(B.splice(U,0,q),A.push(q))}f==="wait"&&A.length&&(B=A),C(uy(B)),E(g);return}const{forceRender:O}=_.useContext(sh);return c.jsx(c.Fragment,{children:N.map(B=>{const U=Ur(B),q=u&&!p?!1:g===N||y.includes(U),M=()=>{if(S.has(U))S.set(U,!0);else return;let R=!0;S.forEach(F=>{F||(R=!1)}),R&&(O==null||O(),C(b.current),u&&(m==null||m()),o&&o())};return c.jsx(Vk,{isPresent:q,initial:!v.current||i?void 0:!1,custom:q?void 0:a,presenceAffectsLayout:r,mode:f,onExitComplete:q?void 0:M,children:B},U)})})},pn=n=>n;let Tb=pn;const Gk={useManualTiming:!1};function Pk(n){let a=new Set,i=new Set,o=!1,r=!1;const f=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function p(g){f.has(g)&&(m.schedule(g),n()),g(u)}const m={schedule:(g,y=!1,v=!1)=>{const S=v&&o?a:i;return y&&f.add(g),S.has(g)||S.add(g),g},cancel:g=>{i.delete(g),f.delete(g)},process:g=>{if(u=g,o){r=!0;return}o=!0,[a,i]=[i,a],a.forEach(p),a.clear(),o=!1,r&&(r=!1,m.process(g))}};return m}const zr=["read","resolveKeyframes","update","preRender","render","postRender"],Fk=40;function Cb(n,a){let i=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},f=()=>i=!0,u=zr.reduce((C,A)=>(C[A]=Pk(f),C),{}),{read:p,resolveKeyframes:m,update:g,preRender:y,render:v,postRender:b}=u,S=()=>{const C=performance.now();i=!1,r.delta=o?1e3/60:Math.max(Math.min(C-r.timestamp,Fk),1),r.timestamp=C,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&&(o=!1,n(S))},k=()=>{i=!0,o=!0,r.isProcessing||n(S)};return{schedule:zr.reduce((C,A)=>{const O=u[A];return C[A]=(B,U=!1,q=!1)=>(i||k(),O.schedule(B,U,q)),C},{}),cancel:C=>{for(let A=0;A<zr.length;A++)u[zr[A]].cancel(C)},state:r,steps:u}}const{schedule:rt,cancel:ss,state:Vt,steps:Yd}=Cb(typeof requestAnimationFrame<"u"?requestAnimationFrame:pn,!0),kb=_.createContext({strict:!1}),dy={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"]},Ii={};for(const n in dy)Ii[n]={isEnabled:a=>dy[n].some(i=>!!a[i])};function $k(n){for(const a in n)Ii[a]={...Ii[a],...n[a]}}const qk=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 nc(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||qk.has(n)}let Eb=n=>!nc(n);function Yk(n){n&&(Eb=a=>a.startsWith("on")?!nc(a):n(a))}try{Yk(require("@emotion/is-prop-valid").default)}catch{}function Kk(n,a,i){const o={};for(const r in n)r==="values"&&typeof n.values=="object"||(Eb(r)||i===!0&&nc(r)||!a&&!nc(r)||n.draggable&&r.startsWith("onDrag"))&&(o[r]=n[r]);return o}function Zk(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...o)=>n(...o);return new Proxy(i,{get:(o,r)=>r==="create"?n:(a.has(r)||a.set(r,n(r)),a.get(r))})}const bc=_.createContext({});function ro(n){return typeof n=="string"||Array.isArray(n)}function xc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const rh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ch=["initial",...rh];function _c(n){return xc(n.animate)||ch.some(a=>ro(n[a]))}function Nb(n){return!!(_c(n)||n.variants)}function Xk(n,a){if(_c(n)){const{initial:i,animate:o}=n;return{initial:i===!1||ro(i)?i:void 0,animate:ro(o)?o:void 0}}return n.inherit!==!1?a:{}}function Qk(n){const{initial:a,animate:i}=Xk(n,_.useContext(bc));return _.useMemo(()=>({initial:a,animate:i}),[fy(a),fy(i)])}function fy(n){return Array.isArray(n)?n.join(" "):n}const Wk=Symbol.for("motionComponentSymbol");function ji(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function Jk(n,a,i){return _.useCallback(o=>{o&&n.onMount&&n.onMount(o),a&&(o?a.mount(o):a.unmount()),i&&(typeof i=="function"?i(o):ji(i)&&(i.current=o))},[a])}const uh=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),eE="framerAppearId",Ab="data-"+uh(eE),{schedule:dh}=Cb(queueMicrotask,!1),jb=_.createContext({});function tE(n,a,i,o,r){var f,u;const{visualElement:p}=_.useContext(bc),m=_.useContext(kb),g=_.useContext(yc),y=_.useContext(lh).reducedMotion,v=_.useRef(null);o=o||m.renderer,!v.current&&o&&(v.current=o(n,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:y}));const b=v.current,S=_.useContext(jb);b&&!b.projection&&r&&(b.type==="html"||b.type==="svg")&&nE(v.current,i,r,S);const k=_.useRef(!1);_.useInsertionEffect(()=>{b&&k.current&&b.update(i,g)});const E=i[Ab],N=_.useRef(!!E&&!(!((f=window.MotionHandoffIsComplete)===null||f===void 0)&&f.call(window,E))&&((u=window.MotionHasOptimisedAnimation)===null||u===void 0?void 0:u.call(window,E)));return Sb(()=>{b&&(k.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),dh.render(b.render),N.current&&b.animationState&&b.animationState.animateChanges())}),_.useEffect(()=>{b&&(!N.current&&b.animationState&&b.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)===null||C===void 0||C.call(window,E)}),N.current=!1))}),b}function nE(n,a,i,o){const{layoutId:r,layout:f,drag:u,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:wb(n.parent)),n.projection.setOptions({layoutId:r,layout:f,alwaysMeasureLayout:!!u||p&&ji(p),visualElement:n,animationType:typeof f=="string"?f:"both",initialPromotionConfig:o,layoutScroll:m,layoutRoot:g})}function wb(n){if(n)return n.options.allowProjection!==!1?n.projection:wb(n.parent)}function aE({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:o,Component:r}){var f,u;n&&$k(n);function p(g,y){let v;const b={..._.useContext(lh),...g,layoutId:sE(g)},{isStatic:S}=b,k=Qk(g),E=o(g,S);if(!S&&oh){iE();const N=lE(b);v=N.MeasureLayout,k.visualElement=tE(r,E,b,a,N.ProjectionNode)}return c.jsxs(bc.Provider,{value:k,children:[v&&k.visualElement?c.jsx(v,{visualElement:k.visualElement,...b}):null,i(r,g,Jk(E,k.visualElement,y),E,S,k.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(u=(f=r.displayName)!==null&&f!==void 0?f:r.name)!==null&&u!==void 0?u:""})`}`;const m=_.forwardRef(p);return m[Wk]=r,m}function sE({layoutId:n}){const a=_.useContext(sh).id;return a&&n!==void 0?a+"-"+n:n}function iE(n,a){_.useContext(kb).strict}function lE(n){const{drag:a,layout:i}=Ii;if(!a&&!i)return{};const o={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(n)||i!=null&&i.isEnabled(n)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const oE=["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 fh(n){return typeof n!="string"||n.includes("-")?!1:!!(oE.indexOf(n)>-1||/[A-Z]/u.test(n))}function hy(n){const a=[{},{}];return n==null||n.values.forEach((i,o)=>{a[0][o]=i.get(),a[1][o]=i.getVelocity()}),a}function hh(n,a,i,o){if(typeof a=="function"){const[r,f]=hy(o);a=a(i!==void 0?i:n.custom,r,f)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[r,f]=hy(o);a=a(i!==void 0?i:n.custom,r,f)}return a}const Tf=n=>Array.isArray(n),rE=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),cE=n=>Tf(n)?n[n.length-1]||0:n,Ft=n=>!!(n&&n.getVelocity);function Xr(n){const a=Ft(n)?n.get():n;return rE(a)?a.toValue():a}function uE({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},o,r,f){const u={latestValues:dE(o,r,f,n),renderState:a()};return i&&(u.onMount=p=>i({props:o,current:p,...u}),u.onUpdate=p=>i(p)),u}const Db=n=>(a,i)=>{const o=_.useContext(bc),r=_.useContext(yc),f=()=>uE(n,a,o,r);return i?f():ih(f)};function dE(n,a,i,o){const r={},f=o(n,{});for(const b in f)r[b]=Xr(f[b]);let{initial:u,animate:p}=n;const m=_c(n),g=Nb(n);a&&g&&!m&&n.inherit!==!1&&(u===void 0&&(u=a.initial),p===void 0&&(p=a.animate));let y=i?i.initial===!1:!1;y=y||u===!1;const v=y?p:u;if(v&&typeof v!="boolean"&&!xc(v)){const b=Array.isArray(v)?v:[v];for(let S=0;S<b.length;S++){const k=hh(n,b[S]);if(k){const{transitionEnd:E,transition:N,...C}=k;for(const A in C){let O=C[A];if(Array.isArray(O)){const B=y?O.length-1:0;O=O[B]}O!==null&&(r[A]=O)}for(const A in E)r[A]=E[A]}}}return r}const $i=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Us=new Set($i),Mb=n=>a=>typeof a=="string"&&a.startsWith(n),Rb=Mb("--"),fE=Mb("var(--"),ph=n=>fE(n)?hE.test(n.split("/*")[0].trim()):!1,hE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ob=(n,a)=>a&&typeof n=="number"?a.transform(n):n,Ca=(n,a,i)=>i>a?a:i<n?n:i,qi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},co={...qi,transform:n=>Ca(0,1,n)},Vr={...qi,default:1},vo=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),Ja=vo("deg"),Xn=vo("%"),ye=vo("px"),pE=vo("vh"),mE=vo("vw"),py={...Xn,parse:n=>Xn.parse(n)/100,transform:n=>Xn.transform(n*100)},gE={borderWidth:ye,borderTopWidth:ye,borderRightWidth:ye,borderBottomWidth:ye,borderLeftWidth:ye,borderRadius:ye,radius:ye,borderTopLeftRadius:ye,borderTopRightRadius:ye,borderBottomRightRadius:ye,borderBottomLeftRadius:ye,width:ye,maxWidth:ye,height:ye,maxHeight:ye,top:ye,right:ye,bottom:ye,left:ye,padding:ye,paddingTop:ye,paddingRight:ye,paddingBottom:ye,paddingLeft:ye,margin:ye,marginTop:ye,marginRight:ye,marginBottom:ye,marginLeft:ye,backgroundPositionX:ye,backgroundPositionY:ye},vE={rotate:Ja,rotateX:Ja,rotateY:Ja,rotateZ:Ja,scale:Vr,scaleX:Vr,scaleY:Vr,scaleZ:Vr,skew:Ja,skewX:Ja,skewY:Ja,distance:ye,translateX:ye,translateY:ye,translateZ:ye,x:ye,y:ye,z:ye,perspective:ye,transformPerspective:ye,opacity:co,originX:py,originY:py,originZ:ye},my={...qi,transform:Math.round},mh={...gE,...vE,zIndex:my,size:ye,fillOpacity:co,strokeOpacity:co,numOctaves:my},yE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bE=$i.length;function xE(n,a,i){let o="",r=!0;for(let f=0;f<bE;f++){const u=$i[f],p=n[u];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(u.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const g=Ob(p,mh[u]);if(!m){r=!1;const y=yE[u]||u;o+=`${y}(${g}) `}i&&(a[u]=g)}}return o=o.trim(),i?o=i(a,r?"":o):r&&(o="none"),o}function gh(n,a,i){const{style:o,vars:r,transformOrigin:f}=n;let u=!1,p=!1;for(const m in a){const g=a[m];if(Us.has(m)){u=!0;continue}else if(Rb(m)){r[m]=g;continue}else{const y=Ob(g,mh[m]);m.startsWith("origin")?(p=!0,f[m]=y):o[m]=y}}if(a.transform||(u||i?o.transform=xE(a,n.transform,i):o.transform&&(o.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:y=0}=f;o.transformOrigin=`${m} ${g} ${y}`}}const _E={offset:"stroke-dashoffset",array:"stroke-dasharray"},SE={offset:"strokeDashoffset",array:"strokeDasharray"};function TE(n,a,i=1,o=0,r=!0){n.pathLength=1;const f=r?_E:SE;n[f.offset]=ye.transform(-o);const u=ye.transform(a),p=ye.transform(i);n[f.array]=`${u} ${p}`}function gy(n,a,i){return typeof n=="string"?n:ye.transform(a+i*n)}function CE(n,a,i){const o=gy(a,n.x,n.width),r=gy(i,n.y,n.height);return`${o} ${r}`}function vh(n,{attrX:a,attrY:i,attrScale:o,originX:r,originY:f,pathLength:u,pathSpacing:p=1,pathOffset:m=0,...g},y,v){if(gh(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||f!==void 0||S.transform)&&(S.transformOrigin=CE(k,r!==void 0?r:.5,f!==void 0?f:.5)),a!==void 0&&(b.x=a),i!==void 0&&(b.y=i),o!==void 0&&(b.scale=o),u!==void 0&&TE(b,u,p,m,!1)}const yh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Bb=()=>({...yh(),attrs:{}}),bh=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Ib(n,{style:a,vars:i},o,r){Object.assign(n.style,a,r&&r.getProjectionStyles(o));for(const f in i)n.style.setProperty(f,i[f])}const Lb=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 Ub(n,a,i,o){Ib(n,a,void 0,o);for(const r in a.attrs)n.setAttribute(Lb.has(r)?r:uh(r),a.attrs[r])}const ac={};function kE(n){Object.assign(ac,n)}function zb(n,{layout:a,layoutId:i}){return Us.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!ac[n]||n==="opacity")}function xh(n,a,i){var o;const{style:r}=n,f={};for(const u in r)(Ft(r[u])||a.style&&Ft(a.style[u])||zb(u,n)||((o=i==null?void 0:i.getValue(u))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(f[u]=r[u]);return f}function Vb(n,a,i){const o=xh(n,a,i);for(const r in n)if(Ft(n[r])||Ft(a[r])){const f=$i.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[f]=n[r]}return o}function EE(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 vy=["x","y","width","height","cx","cy","r"],NE={useVisualState:Db({scrapeMotionValuesFromProps:Vb,createRenderState:Bb,onUpdate:({props:n,prevProps:a,current:i,renderState:o,latestValues:r})=>{if(!i)return;let f=!!n.drag;if(!f){for(const p in r)if(Us.has(p)){f=!0;break}}if(!f)return;let u=!a;if(a)for(let p=0;p<vy.length;p++){const m=vy[p];n[m]!==a[m]&&(u=!0)}u&&rt.read(()=>{EE(i,o),rt.render(()=>{vh(o,r,bh(i.tagName),n.transformTemplate),Ub(i,o)})})}})},AE={useVisualState:Db({scrapeMotionValuesFromProps:xh,createRenderState:yh})};function Hb(n,a,i){for(const o in a)!Ft(a[o])&&!zb(o,i)&&(n[o]=a[o])}function jE({transformTemplate:n},a){return _.useMemo(()=>{const i=yh();return gh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function wE(n,a){const i=n.style||{},o={};return Hb(o,i,n),Object.assign(o,jE(n,a)),o}function DE(n,a){const i={},o=wE(n,a);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=o,i}function ME(n,a,i,o){const r=_.useMemo(()=>{const f=Bb();return vh(f,a,bh(o),n.transformTemplate),{...f.attrs,style:{...f.style}}},[a]);if(n.style){const f={};Hb(f,n.style,n),r.style={...f,...r.style}}return r}function RE(n=!1){return(i,o,r,{latestValues:f},u)=>{const m=(fh(i)?ME:DE)(o,f,u,i),g=Kk(o,typeof i=="string",n),y=i!==_.Fragment?{...g,...m,ref:r}:{},{children:v}=o,b=_.useMemo(()=>Ft(v)?v.get():v,[v]);return _.createElement(i,{...y,children:b})}}function OE(n,a){return function(o,{forwardMotionProps:r}={forwardMotionProps:!1}){const u={...fh(o)?NE:AE,preloadedFeatures:n,useRender:RE(r),createVisualElement:a,Component:o};return aE(u)}}function Gb(n,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==n.length)return!1;for(let o=0;o<i;o++)if(a[o]!==n[o])return!1;return!0}function Sc(n,a,i){const o=n.getProps();return hh(o,a,i!==void 0?i:o.custom,n)}function _h(n,a){return n?n[a]||n.default||n:void 0}const Pb=new Set(["width","height","top","left","right","bottom",...$i]);let Qr;function BE(){Qr=void 0}const Qn={now:()=>(Qr===void 0&&Qn.set(Vt.isProcessing||Gk.useManualTiming?Vt.timestamp:performance.now()),Qr),set:n=>{Qr=n,queueMicrotask(BE)}};function Sh(n,a){n.indexOf(a)===-1&&n.push(a)}function Th(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class Ch{constructor(){this.subscriptions=[]}add(a){return Sh(this.subscriptions,a),()=>Th(this.subscriptions,a)}notify(a,i,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,o);else for(let f=0;f<r;f++){const u=this.subscriptions[f];u&&u(a,i,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Fb(n,a){return a?n*(1e3/a):0}const yy=30,IE=n=>!isNaN(parseFloat(n));class LE{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,r=!0)=>{const f=Qn.now();this.updatedAt!==f&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=Qn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=IE(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 Ch);const o=this.events[a].add(i);return a==="change"?()=>{o(),rt.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,i){this.passiveEffect=a,this.stopPassiveEffect=i}set(a,i=!0){!i||!this.passiveEffect?this.updateAndNotify(a,i):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,i,o){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-o}jump(a,i=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=Qn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>yy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,yy);return Fb(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(a){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=a(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function uo(n,a){return new LE(n,a)}function UE(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,uo(i))}function zE(n,a){const i=Sc(n,a);let{transitionEnd:o={},transition:r={},...f}=i||{};f={...f,...o};for(const u in f){const p=cE(f[u]);UE(n,u,p)}}function VE(n){return!!(Ft(n)&&n.add)}function Cf(n,a){const i=n.getValue("willChange");if(VE(i))return i.add(a)}function $b(n){return n.props[Ab]}function kh(n){let a;return()=>(a===void 0&&(a=n()),a)}const HE=kh(()=>window.ScrollTimeline!==void 0);class GE{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}get finished(){return Promise.all(this.animations.map(a=>"finished"in a?a.finished:a))}getAll(a){return this.animations[0][a]}setAll(a,i){for(let o=0;o<this.animations.length;o++)this.animations[o][a]=i}attachTimeline(a,i){const o=this.animations.map(r=>{if(HE()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{o.forEach((r,f)=>{r&&r(),this.animations[f].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 PE extends GE{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const xa=n=>n*1e3,_a=n=>n/1e3;function Eh(n){return typeof n=="function"}function by(n,a){n.timeline=a,n.onfinish=null}const Nh=n=>Array.isArray(n)&&typeof n[0]=="number",FE={linearEasing:void 0};function $E(n,a){const i=kh(n);return()=>{var o;return(o=FE[a])!==null&&o!==void 0?o:i()}}const sc=$E(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Li=(n,a,i)=>{const o=a-n;return o===0?1:(i-n)/o},qb=(n,a,i=10)=>{let o="";const r=Math.max(Math.round(a/i),2);for(let f=0;f<r;f++)o+=n(Li(0,r-1,f))+", ";return`linear(${o.substring(0,o.length-2)})`};function Yb(n){return!!(typeof n=="function"&&sc()||!n||typeof n=="string"&&(n in kf||sc())||Nh(n)||Array.isArray(n)&&n.every(Yb))}const Yl=([n,a,i,o])=>`cubic-bezier(${n}, ${a}, ${i}, ${o})`,kf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yl([0,.65,.55,1]),circOut:Yl([.55,0,1,.45]),backIn:Yl([.31,.01,.66,-.59]),backOut:Yl([.33,1.53,.69,.99])};function Kb(n,a){if(n)return typeof n=="function"&&sc()?qb(n,a):Nh(n)?Yl(n):Array.isArray(n)?n.map(i=>Kb(i,a)||kf.easeOut):kf[n]}const Zb=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,qE=1e-7,YE=12;function KE(n,a,i,o,r){let f,u,p=0;do u=a+(i-a)/2,f=Zb(u,o,r)-n,f>0?i=u:a=u;while(Math.abs(f)>qE&&++p<YE);return u}function yo(n,a,i,o){if(n===a&&i===o)return pn;const r=f=>KE(f,0,1,n,i);return f=>f===0||f===1?f:Zb(r(f),a,o)}const Xb=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,Qb=n=>a=>1-n(1-a),Wb=yo(.33,1.53,.69,.99),Ah=Qb(Wb),Jb=Xb(Ah),ex=n=>(n*=2)<1?.5*Ah(n):.5*(2-Math.pow(2,-10*(n-1))),jh=n=>1-Math.sin(Math.acos(n)),tx=Qb(jh),nx=Xb(jh),ax=n=>/^0[^.\s]+$/u.test(n);function ZE(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||ax(n):!0}const Jl=n=>Math.round(n*1e5)/1e5,wh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function XE(n){return n==null}const QE=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Dh=(n,a)=>i=>!!(typeof i=="string"&&QE.test(i)&&i.startsWith(n)||a&&!XE(i)&&Object.prototype.hasOwnProperty.call(i,a)),sx=(n,a,i)=>o=>{if(typeof o!="string")return o;const[r,f,u,p]=o.match(wh);return{[n]:parseFloat(r),[a]:parseFloat(f),[i]:parseFloat(u),alpha:p!==void 0?parseFloat(p):1}},WE=n=>Ca(0,255,n),Kd={...qi,transform:n=>Math.round(WE(n))},Os={test:Dh("rgb","red"),parse:sx("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:o=1})=>"rgba("+Kd.transform(n)+", "+Kd.transform(a)+", "+Kd.transform(i)+", "+Jl(co.transform(o))+")"};function JE(n){let a="",i="",o="",r="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),o=n.substring(5,7),r=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),o=n.substring(3,4),r=n.substring(4,5),a+=a,i+=i,o+=o,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const Ef={test:Dh("#"),parse:JE,transform:Os.transform},wi={test:Dh("hsl","hue"),parse:sx("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:o=1})=>"hsla("+Math.round(n)+", "+Xn.transform(Jl(a))+", "+Xn.transform(Jl(i))+", "+Jl(co.transform(o))+")"},Pt={test:n=>Os.test(n)||Ef.test(n)||wi.test(n),parse:n=>Os.test(n)?Os.parse(n):wi.test(n)?wi.parse(n):Ef.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Os.transform(n):wi.transform(n)},eN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function tN(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(wh))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(eN))===null||i===void 0?void 0:i.length)||0)>0}const ix="number",lx="color",nN="var",aN="var(",xy="${}",sN=/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 fo(n){const a=n.toString(),i=[],o={color:[],number:[],var:[]},r=[];let f=0;const p=a.replace(sN,m=>(Pt.test(m)?(o.color.push(f),r.push(lx),i.push(Pt.parse(m))):m.startsWith(aN)?(o.var.push(f),r.push(nN),i.push(m)):(o.number.push(f),r.push(ix),i.push(parseFloat(m))),++f,xy)).split(xy);return{values:i,split:p,indexes:o,types:r}}function ox(n){return fo(n).values}function rx(n){const{split:a,types:i}=fo(n),o=a.length;return r=>{let f="";for(let u=0;u<o;u++)if(f+=a[u],r[u]!==void 0){const p=i[u];p===ix?f+=Jl(r[u]):p===lx?f+=Pt.transform(r[u]):f+=r[u]}return f}}const iN=n=>typeof n=="number"?0:n;function lN(n){const a=ox(n);return rx(n)(a.map(iN))}const is={test:tN,parse:ox,createTransformer:rx,getAnimatableNone:lN},oN=new Set(["brightness","contrast","saturate","opacity"]);function rN(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[o]=i.match(wh)||[];if(!o)return n;const r=i.replace(o,"");let f=oN.has(a)?1:0;return o!==i&&(f*=100),a+"("+f+r+")"}const cN=/\b([a-z-]*)\(.*?\)/gu,Nf={...is,getAnimatableNone:n=>{const a=n.match(cN);return a?a.map(rN).join(" "):n}},uN={...mh,color:Pt,backgroundColor:Pt,outlineColor:Pt,fill:Pt,stroke:Pt,borderColor:Pt,borderTopColor:Pt,borderRightColor:Pt,borderBottomColor:Pt,borderLeftColor:Pt,filter:Nf,WebkitFilter:Nf},Mh=n=>uN[n];function cx(n,a){let i=Mh(n);return i!==Nf&&(i=is),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const dN=new Set(["auto","none","0"]);function fN(n,a,i){let o=0,r;for(;o<n.length&&!r;){const f=n[o];typeof f=="string"&&!dN.has(f)&&fo(f).values.length&&(r=n[o]),o++}if(r&&i)for(const f of a)n[f]=cx(i,r)}const _y=n=>n===qi||n===ye,Sy=(n,a)=>parseFloat(n.split(", ")[a]),Ty=(n,a)=>(i,{transform:o})=>{if(o==="none"||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/u);if(r)return Sy(r[1],a);{const f=o.match(/^matrix\((.+)\)$/u);return f?Sy(f[1],n):0}},hN=new Set(["x","y","z"]),pN=$i.filter(n=>!hN.has(n));function mN(n){const a=[];return pN.forEach(i=>{const o=n.getValue(i);o!==void 0&&(a.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),a}const Ui={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:Ty(4,13),y:Ty(5,14)};Ui.translateX=Ui.x;Ui.translateY=Ui.y;const Is=new Set;let Af=!1,jf=!1;function ux(){if(jf){const n=Array.from(Is).filter(o=>o.needsMeasurement),a=new Set(n.map(o=>o.element)),i=new Map;a.forEach(o=>{const r=mN(o);r.length&&(i.set(o,r),o.render())}),n.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const r=i.get(o);r&&r.forEach(([f,u])=>{var p;(p=o.getValue(f))===null||p===void 0||p.set(u)})}),n.forEach(o=>o.measureEndState()),n.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}jf=!1,Af=!1,Is.forEach(n=>n.complete()),Is.clear()}function dx(){Is.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(jf=!0)})}function gN(){dx(),ux()}class Rh{constructor(a,i,o,r,f,u=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=o,this.motionValue=r,this.element=f,this.isAsync=u}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Is.add(this),Af||(Af=!0,rt.read(dx),rt.resolveKeyframes(ux))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:o,motionValue:r}=this;for(let f=0;f<a.length;f++)if(a[f]===null)if(f===0){const u=r==null?void 0:r.get(),p=a[a.length-1];if(u!==void 0)a[0]=u;else if(o&&i){const m=o.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),r&&u===void 0&&r.set(a[0])}else a[f]=a[f-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Is.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Is.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const fx=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),vN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yN(n){const a=vN.exec(n);if(!a)return[,];const[,i,o,r]=a;return[`--${i??o}`,r]}function hx(n,a,i=1){const[o,r]=yN(n);if(!o)return;const f=window.getComputedStyle(a).getPropertyValue(o);if(f){const u=f.trim();return fx(u)?parseFloat(u):u}return ph(r)?hx(r,a,i+1):r}const px=n=>a=>a.test(n),bN={test:n=>n==="auto",parse:n=>n},mx=[qi,ye,Xn,Ja,mE,pE,bN],Cy=n=>mx.find(px(n));class gx extends Rh{constructor(a,i,o,r,f){super(a,i,o,r,f,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:o}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<a.length;m++){let g=a[m];if(typeof g=="string"&&(g=g.trim(),ph(g))){const y=hx(g,i.current);y!==void 0&&(a[m]=y),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!Pb.has(o)||a.length!==2)return;const[r,f]=a,u=Cy(r),p=Cy(f);if(u!==p)if(_y(u)&&_y(p))for(let m=0;m<a.length;m++){const g=a[m];typeof g=="string"&&(a[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,o=[];for(let r=0;r<a.length;r++)ZE(a[r])&&o.push(r);o.length&&fN(a,o,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:o}=this;if(!a||!a.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ui[o](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&a.getValue(o,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:o,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const f=i.getValue(o);f&&f.jump(this.measuredOrigin,!1);const u=r.length-1,p=r[u];r[u]=Ui[o](i.measureViewportBox(),window.getComputedStyle(i.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([m,g])=>{i.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const ky=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(is.test(n)||n==="0")&&!n.startsWith("url("));function xN(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 _N(n,a,i,o){const r=n[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const f=n[n.length-1],u=ky(r,a),p=ky(f,a);return!u||!p?!1:xN(n)||(i==="spring"||Eh(i))&&o}const SN=n=>n!==null;function Tc(n,{repeat:a,repeatType:i="loop"},o){const r=n.filter(SN),f=a&&i!=="loop"&&a%2===1?0:r.length-1;return!f||o===void 0?r[f]:o}const TN=40;class vx{constructor({autoplay:a=!0,delay:i=0,type:o="keyframes",repeat:r=0,repeatDelay:f=0,repeatType:u="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Qn.now(),this.options={autoplay:a,delay:i,type:o,repeat:r,repeatDelay:f,repeatType:u,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>TN?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&gN(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Qn.now(),this.hasAttemptedResolve=!0;const{name:o,type:r,velocity:f,delay:u,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!_N(a,o,r,f))if(u)this.options.duration=0;else{m&&m(Tc(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 wf=2e4;function yx(n){let a=0;const i=50;let o=n.next(a);for(;!o.done&&a<wf;)a+=i,o=n.next(a);return a>=wf?1/0:a}const ht=(n,a,i)=>n+(a-n)*i;function Zd(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 CN({hue:n,saturation:a,lightness:i,alpha:o}){n/=360,a/=100,i/=100;let r=0,f=0,u=0;if(!a)r=f=u=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=Zd(m,p,n+1/3),f=Zd(m,p,n),u=Zd(m,p,n-1/3)}return{red:Math.round(r*255),green:Math.round(f*255),blue:Math.round(u*255),alpha:o}}function ic(n,a){return i=>i>0?a:n}const Xd=(n,a,i)=>{const o=n*n,r=i*(a*a-o)+o;return r<0?0:Math.sqrt(r)},kN=[Ef,Os,wi],EN=n=>kN.find(a=>a.test(n));function Ey(n){const a=EN(n);if(!a)return!1;let i=a.parse(n);return a===wi&&(i=CN(i)),i}const Ny=(n,a)=>{const i=Ey(n),o=Ey(a);if(!i||!o)return ic(n,a);const r={...i};return f=>(r.red=Xd(i.red,o.red,f),r.green=Xd(i.green,o.green,f),r.blue=Xd(i.blue,o.blue,f),r.alpha=ht(i.alpha,o.alpha,f),Os.transform(r))},NN=(n,a)=>i=>a(n(i)),bo=(...n)=>n.reduce(NN),Df=new Set(["none","hidden"]);function AN(n,a){return Df.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function jN(n,a){return i=>ht(n,a,i)}function Oh(n){return typeof n=="number"?jN:typeof n=="string"?ph(n)?ic:Pt.test(n)?Ny:MN:Array.isArray(n)?bx:typeof n=="object"?Pt.test(n)?Ny:wN:ic}function bx(n,a){const i=[...n],o=i.length,r=n.map((f,u)=>Oh(f)(f,a[u]));return f=>{for(let u=0;u<o;u++)i[u]=r[u](f);return i}}function wN(n,a){const i={...n,...a},o={};for(const r in i)n[r]!==void 0&&a[r]!==void 0&&(o[r]=Oh(n[r])(n[r],a[r]));return r=>{for(const f in o)i[f]=o[f](r);return i}}function DN(n,a){var i;const o=[],r={color:0,var:0,number:0};for(let f=0;f<a.values.length;f++){const u=a.types[f],p=n.indexes[u][r[u]],m=(i=n.values[p])!==null&&i!==void 0?i:0;o[f]=m,r[u]++}return o}const MN=(n,a)=>{const i=is.createTransformer(a),o=fo(n),r=fo(a);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?Df.has(n)&&!r.values.length||Df.has(a)&&!o.values.length?AN(n,a):bo(bx(DN(o,r),r.values),i):ic(n,a)};function xx(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?ht(n,a,i):Oh(n)(n,a)}const RN=5;function _x(n,a,i){const o=Math.max(a-RN,0);return Fb(i-n(o),a-o)}const gt={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},Qd=.001;function ON({duration:n=gt.duration,bounce:a=gt.bounce,velocity:i=gt.velocity,mass:o=gt.mass}){let r,f,u=1-a;u=Ca(gt.minDamping,gt.maxDamping,u),n=Ca(gt.minDuration,gt.maxDuration,_a(n)),u<1?(r=g=>{const y=g*u,v=y*n,b=y-i,S=Mf(g,u),k=Math.exp(-v);return Qd-b/S*k},f=g=>{const v=g*u*n,b=v*i+i,S=Math.pow(u,2)*Math.pow(g,2)*n,k=Math.exp(-v),E=Mf(Math.pow(g,2),u);return(-r(g)+Qd>0?-1:1)*((b-S)*k)/E}):(r=g=>{const y=Math.exp(-g*n),v=(g-i)*n+1;return-Qd+y*v},f=g=>{const y=Math.exp(-g*n),v=(i-g)*(n*n);return y*v});const p=5/n,m=IN(r,f,p);if(n=xa(n),isNaN(m))return{stiffness:gt.stiffness,damping:gt.damping,duration:n};{const g=Math.pow(m,2)*o;return{stiffness:g,damping:u*2*Math.sqrt(o*g),duration:n}}}const BN=12;function IN(n,a,i){let o=i;for(let r=1;r<BN;r++)o=o-n(o)/a(o);return o}function Mf(n,a){return n*Math.sqrt(1-a*a)}const LN=["duration","bounce"],UN=["stiffness","damping","mass"];function Ay(n,a){return a.some(i=>n[i]!==void 0)}function zN(n){let a={velocity:gt.velocity,stiffness:gt.stiffness,damping:gt.damping,mass:gt.mass,isResolvedFromDuration:!1,...n};if(!Ay(n,UN)&&Ay(n,LN))if(n.visualDuration){const i=n.visualDuration,o=2*Math.PI/(i*1.2),r=o*o,f=2*Ca(.05,1,1-(n.bounce||0))*Math.sqrt(r);a={...a,mass:gt.mass,stiffness:r,damping:f}}else{const i=ON(n);a={...a,...i,mass:gt.mass},a.isResolvedFromDuration=!0}return a}function Sx(n=gt.visualDuration,a=gt.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:o,restDelta:r}=i;const f=i.keyframes[0],u=i.keyframes[i.keyframes.length-1],p={done:!1,value:f},{stiffness:m,damping:g,mass:y,duration:v,velocity:b,isResolvedFromDuration:S}=zN({...i,velocity:-_a(i.velocity||0)}),k=b||0,E=g/(2*Math.sqrt(m*y)),N=u-f,C=_a(Math.sqrt(m/y)),A=Math.abs(N)<5;o||(o=A?gt.restSpeed.granular:gt.restSpeed.default),r||(r=A?gt.restDelta.granular:gt.restDelta.default);let O;if(E<1){const U=Mf(C,E);O=q=>{const M=Math.exp(-E*C*q);return u-M*((k+E*C*N)/U*Math.sin(U*q)+N*Math.cos(U*q))}}else if(E===1)O=U=>u-Math.exp(-C*U)*(N+(k+C*N)*U);else{const U=C*Math.sqrt(E*E-1);O=q=>{const M=Math.exp(-E*C*q),R=Math.min(U*q,300);return u-M*((k+E*C*N)*Math.sinh(R)+U*N*Math.cosh(R))/U}}const B={calculatedDuration:S&&v||null,next:U=>{const q=O(U);if(S)p.done=U>=v;else{let M=0;E<1&&(M=U===0?xa(k):_x(O,U,q));const R=Math.abs(M)<=o,F=Math.abs(u-q)<=r;p.done=R&&F}return p.value=p.done?u:q,p},toString:()=>{const U=Math.min(yx(B),wf),q=qb(M=>B.next(U*M).value,U,30);return U+"ms "+q}};return B}function jy({keyframes:n,velocity:a=0,power:i=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:f=500,modifyTarget:u,min:p,max:m,restDelta:g=.5,restSpeed:y}){const v=n[0],b={done:!1,value:v},S=R=>p!==void 0&&R<p||m!==void 0&&R>m,k=R=>p===void 0?m:m===void 0||Math.abs(p-R)<Math.abs(m-R)?p:m;let E=i*a;const N=v+E,C=u===void 0?N:u(N);C!==N&&(E=C-v);const A=R=>-E*Math.exp(-R/o),O=R=>C+A(R),B=R=>{const F=A(R),ee=O(R);b.done=Math.abs(F)<=g,b.value=b.done?C:ee};let U,q;const M=R=>{S(b.value)&&(U=R,q=Sx({keyframes:[b.value,k(b.value)],velocity:_x(O,R,b.value),damping:r,stiffness:f,restDelta:g,restSpeed:y}))};return M(0),{calculatedDuration:null,next:R=>{let F=!1;return!q&&U===void 0&&(F=!0,B(R),M(R)),U!==void 0&&R>=U?q.next(R-U):(!F&&B(R),b)}}}const VN=yo(.42,0,1,1),HN=yo(0,0,.58,1),Tx=yo(.42,0,.58,1),GN=n=>Array.isArray(n)&&typeof n[0]!="number",PN={linear:pn,easeIn:VN,easeInOut:Tx,easeOut:HN,circIn:jh,circInOut:nx,circOut:tx,backIn:Ah,backInOut:Jb,backOut:Wb,anticipate:ex},wy=n=>{if(Nh(n)){Tb(n.length===4);const[a,i,o,r]=n;return yo(a,i,o,r)}else if(typeof n=="string")return PN[n];return n};function FN(n,a,i){const o=[],r=i||xx,f=n.length-1;for(let u=0;u<f;u++){let p=r(n[u],n[u+1]);if(a){const m=Array.isArray(a)?a[u]||pn:a;p=bo(m,p)}o.push(p)}return o}function $N(n,a,{clamp:i=!0,ease:o,mixer:r}={}){const f=n.length;if(Tb(f===a.length),f===1)return()=>a[0];if(f===2&&a[0]===a[1])return()=>a[1];const u=n[0]===n[1];n[0]>n[f-1]&&(n=[...n].reverse(),a=[...a].reverse());const p=FN(a,o,r),m=p.length,g=y=>{if(u&&y<n[0])return a[0];let v=0;if(m>1)for(;v<n.length-2&&!(y<n[v+1]);v++);const b=Li(n[v],n[v+1],y);return p[v](b)};return i?y=>g(Ca(n[0],n[f-1],y)):g}function qN(n,a){const i=n[n.length-1];for(let o=1;o<=a;o++){const r=Li(0,a,o);n.push(ht(i,1,r))}}function YN(n){const a=[0];return qN(a,n.length-1),a}function KN(n,a){return n.map(i=>i*a)}function ZN(n,a){return n.map(()=>a||Tx).splice(0,n.length-1)}function lc({duration:n=300,keyframes:a,times:i,ease:o="easeInOut"}){const r=GN(o)?o.map(wy):wy(o),f={done:!1,value:a[0]},u=KN(i&&i.length===a.length?i:YN(a),n),p=$N(u,a,{ease:Array.isArray(r)?r:ZN(a,r)});return{calculatedDuration:n,next:m=>(f.value=p(m),f.done=m>=n,f)}}const XN=n=>{const a=({timestamp:i})=>n(i);return{start:()=>rt.update(a,!0),stop:()=>ss(a),now:()=>Vt.isProcessing?Vt.timestamp:Qn.now()}},QN={decay:jy,inertia:jy,tween:lc,keyframes:lc,spring:Sx},WN=n=>n/100;class Bh extends vx{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:i,motionValue:o,element:r,keyframes:f}=this.options,u=(r==null?void 0:r.KeyframeResolver)||Rh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new u(f,p,i,o,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:o=0,repeatDelay:r=0,repeatType:f,velocity:u=0}=this.options,p=Eh(i)?i:QN[i]||lc;let m,g;p!==lc&&typeof a[0]!="number"&&(m=bo(WN,xx(a[0],a[1])),a=[0,100]);const y=p({...this.options,keyframes:a});f==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-u})),y.calculatedDuration===null&&(y.calculatedDuration=yx(y));const{calculatedDuration:v}=y,b=v+r,S=b*(o+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:o}=this;if(!o){const{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}const{finalKeyframe:r,generator:f,mirroredGenerator:u,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:y,resolvedDuration:v}=o;if(this.startTime===null)return f.next(0);const{delay:b,repeat:S,repeatType:k,repeatDelay:E,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 C=this.currentTime-b*(this.speed>=0?1:-1),A=this.speed>=0?C<0:C>y;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=y);let O=this.currentTime,B=f;if(S){const R=Math.min(this.currentTime,y)/v;let F=Math.floor(R),ee=R%1;!ee&&R>=1&&(ee=1),ee===1&&F--,F=Math.min(F,S+1),!!(F%2)&&(k==="reverse"?(ee=1-ee,E&&(ee-=E/v)):k==="mirror"&&(B=u)),O=Ca(0,1,ee)*v}const U=A?{done:!1,value:m[0]}:B.next(O);p&&(U.value=p(U.value));let{done:q}=U;!A&&g!==null&&(q=this.speed>=0?this.currentTime>=y:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&q);return M&&r!==void 0&&(U.value=Tc(m,this.options,r)),N&&N(U.value),M&&this.finish(),U}get duration(){const{resolved:a}=this;return a?_a(a.calculatedDuration):0}get time(){return _a(this.currentTime)}set time(a){a=xa(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=_a(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=XN,onPlay:i,startTime:o}=this.options;this.driver||(this.driver=a(f=>this.tick(f))),i&&i();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=o??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const JN=new Set(["opacity","clipPath","filter","transform"]);function eA(n,a,i,{delay:o=0,duration:r=300,repeat:f=0,repeatType:u="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const y=Kb(p,r);return Array.isArray(y)&&(g.easing=y),n.animate(g,{delay:o,duration:r,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:f+1,direction:u==="reverse"?"alternate":"normal"})}const tA=kh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),oc=10,nA=2e4;function aA(n){return Eh(n.type)||n.type==="spring"||!Yb(n.ease)}function sA(n,a){const i=new Bh({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:n[0]};const r=[];let f=0;for(;!o.done&&f<nA;)o=i.sample(f),r.push(o.value),f+=oc;return{times:void 0,keyframes:r,duration:f-oc,ease:"linear"}}const Cx={anticipate:ex,backInOut:Jb,circInOut:nx};function iA(n){return n in Cx}class Dy extends vx{constructor(a){super(a);const{name:i,motionValue:o,element:r,keyframes:f}=this.options;this.resolver=new gx(f,(u,p)=>this.onKeyframesResolved(u,p),i,o,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:o=300,times:r,ease:f,type:u,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof f=="string"&&sc()&&iA(f)&&(f=Cx[f]),aA(this.options)){const{onComplete:v,onUpdate:b,motionValue:S,element:k,...E}=this.options,N=sA(a,E);a=N.keyframes,a.length===1&&(a[1]=a[0]),o=N.duration,r=N.times,f=N.ease,u="keyframes"}const y=eA(p.owner.current,m,a,{...this.options,duration:o,times:r,ease:f});return y.startTime=g??this.calcStartTime(),this.pendingTimeline?(by(y,this.pendingTimeline),this.pendingTimeline=void 0):y.onfinish=()=>{const{onComplete:v}=this.options;p.set(Tc(a,this.options,i)),v&&v(),this.cancel(),this.resolveFinishedPromise()},{animation:y,duration:o,times:r,type:u,ease:f,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return _a(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return _a(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.currentTime=xa(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:i}=a;return i.playbackRate}set speed(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:i}=a;return i.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:i}=a;return i.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:i}=this;if(!i)return pn;const{animation:o}=i;by(o,a)}return pn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:i,keyframes:o,duration:r,type:f,ease:u,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 Bh({...S,keyframes:o,duration:r,type:f,ease:u,times:p,isGenerator:!0}),E=xa(this.time);g.setWithVelocity(k.sample(E-oc).value,k.sample(E).value,oc)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:o,repeatDelay:r,repeatType:f,damping:u,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=i.owner.getProps();return tA()&&o&&JN.has(o)&&!m&&!g&&!r&&f!=="mirror"&&u!==0&&p!=="inertia"}}const lA={type:"spring",stiffness:500,damping:25,restSpeed:10},oA=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),rA={type:"keyframes",duration:.8},cA={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},uA=(n,{keyframes:a})=>a.length>2?rA:Us.has(n)?n.startsWith("scale")?oA(a[1]):lA:cA;function dA({when:n,delay:a,delayChildren:i,staggerChildren:o,staggerDirection:r,repeat:f,repeatType:u,repeatDelay:p,from:m,elapsed:g,...y}){return!!Object.keys(y).length}const Ih=(n,a,i,o={},r,f)=>u=>{const p=_h(o,n)||{},m=p.delay||o.delay||0;let{elapsed:g=0}=o;g=g-xa(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:()=>{u(),p.onComplete&&p.onComplete()},name:n,motionValue:a,element:f?void 0:r};dA(p)||(y={...y,...uA(n,y)}),y.duration&&(y.duration=xa(y.duration)),y.repeatDelay&&(y.repeatDelay=xa(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&&!f&&a.get()!==void 0){const b=Tc(y.keyframes,p);if(b!==void 0)return rt.update(()=>{y.onUpdate(b),y.onComplete()}),new PE([])}return!f&&Dy.supports(y)?new Dy(y):new Bh(y)};function fA({protectedKeys:n,needsAnimating:a},i){const o=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,o}function kx(n,a,{delay:i=0,transitionOverride:o,type:r}={}){var f;let{transition:u=n.getDefaultTransition(),transitionEnd:p,...m}=a;o&&(u=o);const g=[],y=r&&n.animationState&&n.animationState.getState()[r];for(const v in m){const b=n.getValue(v,(f=n.latestValues[v])!==null&&f!==void 0?f:null),S=m[v];if(S===void 0||y&&fA(y,v))continue;const k={delay:i,..._h(u||{},v)};let E=!1;if(window.MotionHandoffAnimation){const C=$b(n);if(C){const A=window.MotionHandoffAnimation(C,v,rt);A!==null&&(k.startTime=A,E=!0)}}Cf(n,v),b.start(Ih(v,b,S,n.shouldReduceMotion&&Pb.has(v)?{type:!1}:k,n,E));const N=b.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{rt.update(()=>{p&&zE(n,p)})}),g}function Rf(n,a,i={}){var o;const r=Sc(n,a,i.type==="exit"?(o=n.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:f=n.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(f=i.transitionOverride);const u=r?()=>Promise.all(kx(n,r,i)):()=>Promise.resolve(),p=n.variantChildren&&n.variantChildren.size?(g=0)=>{const{delayChildren:y=0,staggerChildren:v,staggerDirection:b}=f;return hA(n,a,y+g,v,b,i)}:()=>Promise.resolve(),{when:m}=f;if(m){const[g,y]=m==="beforeChildren"?[u,p]:[p,u];return g().then(()=>y())}else return Promise.all([u(),p(i.delay)])}function hA(n,a,i=0,o=0,r=1,f){const u=[],p=(n.variantChildren.size-1)*o,m=r===1?(g=0)=>g*o:(g=0)=>p-g*o;return Array.from(n.variantChildren).sort(pA).forEach((g,y)=>{g.notify("AnimationStart",a),u.push(Rf(g,a,{...f,delay:i+m(y)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(u)}function pA(n,a){return n.sortNodePosition(a)}function mA(n,a,i={}){n.notify("AnimationStart",a);let o;if(Array.isArray(a)){const r=a.map(f=>Rf(n,f,i));o=Promise.all(r)}else if(typeof a=="string")o=Rf(n,a,i);else{const r=typeof a=="function"?Sc(n,a,i.custom):a;o=Promise.all(kx(n,r,i))}return o.then(()=>{n.notify("AnimationComplete",a)})}const gA=ch.length;function Ex(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?Ex(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<gA;i++){const o=ch[i],r=n.props[o];(ro(r)||r===!1)&&(a[o]=r)}return a}const vA=[...rh].reverse(),yA=rh.length;function bA(n){return a=>Promise.all(a.map(({animation:i,options:o})=>mA(n,i,o)))}function xA(n){let a=bA(n),i=My(),o=!0;const r=m=>(g,y)=>{var v;const b=Sc(n,y,m==="exit"?(v=n.presenceContext)===null||v===void 0?void 0:v.custom:void 0);if(b){const{transition:S,transitionEnd:k,...E}=b;g={...g,...E,...k}}return g};function f(m){a=m(n)}function u(m){const{props:g}=n,y=Ex(n.parent)||{},v=[],b=new Set;let S={},k=1/0;for(let N=0;N<yA;N++){const C=vA[N],A=i[C],O=g[C]!==void 0?g[C]:y[C],B=ro(O),U=C===m?A.isActive:null;U===!1&&(k=N);let q=O===y[C]&&O!==g[C]&&B;if(q&&o&&n.manuallyAnimateOnMount&&(q=!1),A.protectedKeys={...S},!A.isActive&&U===null||!O&&!A.prevProp||xc(O)||typeof O=="boolean")continue;const M=_A(A.prevProp,O);let R=M||C===m&&A.isActive&&!q&&B||N>k&&B,F=!1;const ee=Array.isArray(O)?O:[O];let te=ee.reduce(r(C),{});U===!1&&(te={});const{prevResolvedValues:se={}}=A,re={...se,...te},Q=D=>{R=!0,b.has(D)&&(F=!0,b.delete(D)),A.needsAnimating[D]=!0;const ne=n.getValue(D);ne&&(ne.liveStyle=!1)};for(const D in re){const ne=te[D],oe=se[D];if(S.hasOwnProperty(D))continue;let z=!1;Tf(ne)&&Tf(oe)?z=!Gb(ne,oe):z=ne!==oe,z?ne!=null?Q(D):b.add(D):ne!==void 0&&b.has(D)?Q(D):A.protectedKeys[D]=!0}A.prevProp=O,A.prevResolvedValues=te,A.isActive&&(S={...S,...te}),o&&n.blockInitialAnimation&&(R=!1),R&&(!(q&&M)||F)&&v.push(...ee.map(D=>({animation:D,options:{type:C}})))}if(b.size){const N={};b.forEach(C=>{const A=n.getBaseTarget(C),O=n.getValue(C);O&&(O.liveStyle=!0),N[C]=A??null}),v.push({animation:N})}let E=!!v.length;return o&&(g.initial===!1||g.initial===g.animate)&&!n.manuallyAnimateOnMount&&(E=!1),o=!1,E?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=u(m);for(const b in i)i[b].protectedKeys={};return v}return{animateChanges:u,setActive:p,setAnimateFunction:f,getState:()=>i,reset:()=>{i=My(),o=!0}}}function _A(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!Gb(a,n):!1}function As(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function My(){return{animate:As(!0),whileInView:As(),whileHover:As(),whileTap:As(),whileDrag:As(),whileFocus:As(),exit:As()}}class os{constructor(a){this.isMounted=!1,this.node=a}update(){}}class SA extends os{constructor(a){super(a),a.animationState||(a.animationState=xA(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();xc(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 TA=0;class CA extends os{constructor(){super(...arguments),this.id=TA++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)return;const r=this.node.animationState.setActive("exit",!a);i&&!a&&r.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const kA={animation:{Feature:SA},exit:{Feature:CA}},Un={x:!1,y:!1};function Nx(){return Un.x||Un.y}function EA(n){return n==="x"||n==="y"?Un[n]?null:(Un[n]=!0,()=>{Un[n]=!1}):Un.x||Un.y?null:(Un.x=Un.y=!0,()=>{Un.x=Un.y=!1})}const Lh=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function ho(n,a,i,o={passive:!0}){return n.addEventListener(a,i,o),()=>n.removeEventListener(a,i)}function xo(n){return{point:{x:n.pageX,y:n.pageY}}}const NA=n=>a=>Lh(a)&&n(a,xo(a));function eo(n,a,i,o){return ho(n,a,NA(i),o)}const Ry=(n,a)=>Math.abs(n-a);function AA(n,a){const i=Ry(n.x,a.x),o=Ry(n.y,a.y);return Math.sqrt(i**2+o**2)}class Ax{constructor(a,i,{transformPagePoint:o,contextWindow:r,dragSnapToOrigin:f=!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=Jd(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,S=AA(v.offset,{x:0,y:0})>=3;if(!b&&!S)return;const{point:k}=v,{timestamp:E}=Vt;this.history.push({...k,timestamp:E});const{onStart:N,onMove:C}=this.handlers;b||(N&&N(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,v)},this.handlePointerMove=(v,b)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=Wd(b,this.transformPagePoint),rt.update(this.updatePoint,!0)},this.handlePointerUp=(v,b)=>{this.end();const{onEnd:S,onSessionEnd:k,resumeAnimation:E}=this.handlers;if(this.dragSnapToOrigin&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=Jd(v.type==="pointercancel"?this.lastMoveEventInfo:Wd(b,this.transformPagePoint),this.history);this.startEvent&&S&&S(v,N),k&&k(v,N)},!Lh(a))return;this.dragSnapToOrigin=f,this.handlers=i,this.transformPagePoint=o,this.contextWindow=r||window;const u=xo(a),p=Wd(u,this.transformPagePoint),{point:m}=p,{timestamp:g}=Vt;this.history=[{...m,timestamp:g}];const{onSessionStart:y}=i;y&&y(a,Jd(p,this.history)),this.removeListeners=bo(eo(this.contextWindow,"pointermove",this.handlePointerMove),eo(this.contextWindow,"pointerup",this.handlePointerUp),eo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),ss(this.updatePoint)}}function Wd(n,a){return a?{point:a(n.point)}:n}function Oy(n,a){return{x:n.x-a.x,y:n.y-a.y}}function Jd({point:n},a){return{point:n,delta:Oy(n,jx(a)),offset:Oy(n,jA(a)),velocity:wA(a,.1)}}function jA(n){return n[0]}function jx(n){return n[n.length-1]}function wA(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,o=null;const r=jx(n);for(;i>=0&&(o=n[i],!(r.timestamp-o.timestamp>xa(a)));)i--;if(!o)return{x:0,y:0};const f=_a(r.timestamp-o.timestamp);if(f===0)return{x:0,y:0};const u={x:(r.x-o.x)/f,y:(r.y-o.y)/f};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}const wx=1e-4,DA=1-wx,MA=1+wx,Dx=.01,RA=0-Dx,OA=0+Dx;function mn(n){return n.max-n.min}function BA(n,a,i){return Math.abs(n-a)<=i}function By(n,a,i,o=.5){n.origin=o,n.originPoint=ht(a.min,a.max,n.origin),n.scale=mn(i)/mn(a),n.translate=ht(i.min,i.max,n.origin)-n.originPoint,(n.scale>=DA&&n.scale<=MA||isNaN(n.scale))&&(n.scale=1),(n.translate>=RA&&n.translate<=OA||isNaN(n.translate))&&(n.translate=0)}function to(n,a,i,o){By(n.x,a.x,i.x,o?o.originX:void 0),By(n.y,a.y,i.y,o?o.originY:void 0)}function Iy(n,a,i){n.min=i.min+a.min,n.max=n.min+mn(a)}function IA(n,a,i){Iy(n.x,a.x,i.x),Iy(n.y,a.y,i.y)}function Ly(n,a,i){n.min=a.min-i.min,n.max=n.min+mn(a)}function no(n,a,i){Ly(n.x,a.x,i.x),Ly(n.y,a.y,i.y)}function LA(n,{min:a,max:i},o){return a!==void 0&&n<a?n=o?ht(a,n,o.min):Math.max(n,a):i!==void 0&&n>i&&(n=o?ht(i,n,o.max):Math.min(n,i)),n}function Uy(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 UA(n,{top:a,left:i,bottom:o,right:r}){return{x:Uy(n.x,i,r),y:Uy(n.y,a,o)}}function zy(n,a){let i=a.min-n.min,o=a.max-n.max;return a.max-a.min<n.max-n.min&&([i,o]=[o,i]),{min:i,max:o}}function zA(n,a){return{x:zy(n.x,a.x),y:zy(n.y,a.y)}}function VA(n,a){let i=.5;const o=mn(n),r=mn(a);return r>o?i=Li(a.min,a.max-o,n.min):o>r&&(i=Li(n.min,n.max-r,a.min)),Ca(0,1,i)}function HA(n,a){const i={};return a.min!==void 0&&(i.min=a.min-n.min),a.max!==void 0&&(i.max=a.max-n.min),i}const Of=.35;function GA(n=Of){return n===!1?n=0:n===!0&&(n=Of),{x:Vy(n,"left","right"),y:Vy(n,"top","bottom")}}function Vy(n,a,i){return{min:Hy(n,a),max:Hy(n,i)}}function Hy(n,a){return typeof n=="number"?n:n[a]||0}const Gy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Di=()=>({x:Gy(),y:Gy()}),Py=()=>({min:0,max:0}),xt=()=>({x:Py(),y:Py()});function Dn(n){return[n("x"),n("y")]}function Mx({top:n,left:a,right:i,bottom:o}){return{x:{min:a,max:i},y:{min:n,max:o}}}function PA({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function FA(n,a){if(!a)return n;const i=a({x:n.left,y:n.top}),o=a({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function ef(n){return n===void 0||n===1}function Bf({scale:n,scaleX:a,scaleY:i}){return!ef(n)||!ef(a)||!ef(i)}function Ds(n){return Bf(n)||Rx(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Rx(n){return Fy(n.x)||Fy(n.y)}function Fy(n){return n&&n!=="0%"}function rc(n,a,i){const o=n-i,r=a*o;return i+r}function $y(n,a,i,o,r){return r!==void 0&&(n=rc(n,r,o)),rc(n,i,o)+a}function If(n,a=0,i=1,o,r){n.min=$y(n.min,a,i,o,r),n.max=$y(n.max,a,i,o,r)}function Ox(n,{x:a,y:i}){If(n.x,a.translate,a.scale,a.originPoint),If(n.y,i.translate,i.scale,i.originPoint)}const qy=.999999999999,Yy=1.0000000000001;function $A(n,a,i,o=!1){const r=i.length;if(!r)return;a.x=a.y=1;let f,u;for(let p=0;p<r;p++){f=i[p],u=f.projectionDelta;const{visualElement:m}=f.options;m&&m.props.style&&m.props.style.display==="contents"||(o&&f.options.layoutScroll&&f.scroll&&f!==f.root&&Ri(n,{x:-f.scroll.offset.x,y:-f.scroll.offset.y}),u&&(a.x*=u.x.scale,a.y*=u.y.scale,Ox(n,u)),o&&Ds(f.latestValues)&&Ri(n,f.latestValues))}a.x<Yy&&a.x>qy&&(a.x=1),a.y<Yy&&a.y>qy&&(a.y=1)}function Mi(n,a){n.min=n.min+a,n.max=n.max+a}function Ky(n,a,i,o,r=.5){const f=ht(n.min,n.max,r);If(n,a,i,f,o)}function Ri(n,a){Ky(n.x,a.x,a.scaleX,a.scale,a.originX),Ky(n.y,a.y,a.scaleY,a.scale,a.originY)}function Bx(n,a){return Mx(FA(n.getBoundingClientRect(),a))}function qA(n,a,i){const o=Bx(n,i),{scroll:r}=a;return r&&(Mi(o.x,r.offset.x),Mi(o.y,r.offset.y)),o}const Ix=({current:n})=>n?n.ownerDocument.defaultView:null,YA=new WeakMap;class KA{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=xt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=y=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(xo(y).point)},f=(y,v)=>{const{drag:b,dragPropagation:S,onDragStart:k}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=EA(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),Dn(N=>{let C=this.getAxisMotionValue(N).get()||0;if(Xn.test(C)){const{projection:A}=this.visualElement;if(A&&A.layout){const O=A.layout.layoutBox[N];O&&(C=mn(O)*(parseFloat(C)/100))}}this.originPoint[N]=C}),k&&rt.postRender(()=>k(y,v)),Cf(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},u=(y,v)=>{const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:k,onDrag:E}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:N}=v;if(S&&this.currentDirection===null){this.currentDirection=ZA(N),this.currentDirection!==null&&k&&k(this.currentDirection);return}this.updateAxis("x",v.point,N),this.updateAxis("y",v.point,N),this.visualElement.render(),E&&E(y,v)},p=(y,v)=>this.stop(y,v),m=()=>Dn(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 Ax(a,{onSessionStart:r,onStart:f,onMove:u,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:Ix(this.visualElement)})}stop(a,i){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:f}=this.getProps();f&&rt.postRender(()=>f(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,o){const{drag:r}=this.getProps();if(!o||!Hr(a,r,this.currentDirection))return;const f=this.getAxisMotionValue(a);let u=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(u=LA(u,this.constraints[a],this.elastic[a])),f.set(u)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:o}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,f=this.constraints;i&&ji(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=UA(r.layoutBox,i):this.constraints=!1,this.elastic=GA(o),f!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Dn(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=HA(r.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!ji(a))return!1;const o=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const f=qA(o,r.root,this.visualElement.getTransformPagePoint());let u=zA(r.layout.layoutBox,f);if(i){const p=i(PA(u));this.hasMutatedConstraints=!!p,p&&(u=Mx(p))}return u}startAnimation(a){const{drag:i,dragMomentum:o,dragElastic:r,dragTransition:f,dragSnapToOrigin:u,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=Dn(y=>{if(!Hr(y,i,this.currentDirection))return;let v=m&&m[y]||{};u&&(v={min:0,max:0});const b=r?200:1e6,S=r?40:1e7,k={type:"inertia",velocity:o?a[y]:0,bounceStiffness:b,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...f,...v};return this.startAxisValueAnimation(y,k)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const o=this.getAxisMotionValue(a);return Cf(this.visualElement,a),o.start(Ih(a,o,0,i,this.visualElement,!1))}stopAnimation(){Dn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){Dn(a=>{var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(a){var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(a){const i=`_drag${a.toUpperCase()}`,o=this.visualElement.getProps(),r=o[i];return r||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){Dn(i=>{const{drag:o}=this.getProps();if(!Hr(i,o,this.currentDirection))return;const{projection:r}=this.visualElement,f=this.getAxisMotionValue(i);if(r&&r.layout){const{min:u,max:p}=r.layout.layoutBox[i];f.set(a[i]-ht(u,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:o}=this.visualElement;if(!ji(i)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Dn(u=>{const p=this.getAxisMotionValue(u);if(p&&this.constraints!==!1){const m=p.get();r[u]=VA({min:m,max:m},this.constraints[u])}});const{transformTemplate:f}=this.visualElement.getProps();this.visualElement.current.style.transform=f?f({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),Dn(u=>{if(!Hr(u,a,null))return;const p=this.getAxisMotionValue(u),{min:m,max:g}=this.constraints[u];p.set(ht(m,g,r[u]))})}addListeners(){if(!this.visualElement.current)return;YA.set(this.visualElement,this);const a=this.visualElement.current,i=eo(a,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps();g&&y&&this.start(m)}),o=()=>{const{dragConstraints:m}=this.getProps();ji(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,f=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),rt.read(o);const u=ho(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(Dn(y=>{const v=this.getAxisMotionValue(y);v&&(this.originPoint[y]+=m[y].translate,v.set(v.get()+m[y].translate))}),this.visualElement.render())}));return()=>{u(),i(),f(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:f=!1,dragElastic:u=Of,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:o,dragPropagation:r,dragConstraints:f,dragElastic:u,dragMomentum:p}}}function Hr(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function ZA(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class XA extends os{constructor(a){super(a),this.removeGroupControls=pn,this.removeListeners=pn,this.controls=new KA(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Zy=n=>(a,i)=>{n&&rt.postRender(()=>n(a,i))};class QA extends os{constructor(){super(...arguments),this.removePointerDownListener=pn}onPointerDown(a){this.session=new Ax(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ix(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:Zy(a),onStart:Zy(i),onMove:o,onEnd:(f,u)=>{delete this.session,r&&rt.postRender(()=>r(f,u))}}}mount(){this.removePointerDownListener=eo(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 Wr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Xy(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Pl={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(ye.test(n))n=parseFloat(n);else return n;const i=Xy(n,a.target.x),o=Xy(n,a.target.y);return`${i}% ${o}%`}},WA={correct:(n,{treeScale:a,projectionDelta:i})=>{const o=n,r=is.parse(n);if(r.length>5)return o;const f=is.createTransformer(n),u=typeof r[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;r[0+u]/=p,r[1+u]/=m;const g=ht(p,m,.5);return typeof r[2+u]=="number"&&(r[2+u]/=g),typeof r[3+u]=="number"&&(r[3+u]/=g),f(r)}};class JA extends _.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o,layoutId:r}=this.props,{projection:f}=a;kE(ej),f&&(i.group&&i.group.add(f),o&&o.register&&r&&o.register(f),f.root.didUpdate(),f.addEventListener("animationComplete",()=>{this.safeToRemove()}),f.setOptions({...f.options,onExitComplete:()=>this.safeToRemove()})),Wr.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:o,drag:r,isPresent:f}=this.props,u=o.projection;return u&&(u.isPresent=f,r||a.layoutDependency!==i||i===void 0?u.willUpdate():this.safeToRemove(),a.isPresent!==f&&(f?u.promote():u.relegate()||rt.postRender(()=>{const p=u.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),dh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function Lx(n){const[a,i]=_b(),o=_.useContext(sh);return c.jsx(JA,{...n,layoutGroup:o,switchLayoutGroup:_.useContext(jb),isPresent:a,safeToRemove:i})}const ej={borderRadius:{...Pl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Pl,borderTopRightRadius:Pl,borderBottomLeftRadius:Pl,borderBottomRightRadius:Pl,boxShadow:WA};function tj(n,a,i){const o=Ft(n)?n:uo(n);return o.start(Ih("",o,a,i)),o.animation}function nj(n){return n instanceof SVGElement&&n.tagName!=="svg"}const aj=(n,a)=>n.depth-a.depth;class sj{constructor(){this.children=[],this.isDirty=!1}add(a){Sh(this.children,a),this.isDirty=!0}remove(a){Th(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(aj),this.isDirty=!1,this.children.forEach(a)}}function ij(n,a){const i=Qn.now(),o=({timestamp:r})=>{const f=r-i;f>=a&&(ss(o),n(f-a))};return rt.read(o,!0),()=>ss(o)}const Ux=["TopLeft","TopRight","BottomLeft","BottomRight"],lj=Ux.length,Qy=n=>typeof n=="string"?parseFloat(n):n,Wy=n=>typeof n=="number"||ye.test(n);function oj(n,a,i,o,r,f){r?(n.opacity=ht(0,i.opacity!==void 0?i.opacity:1,rj(o)),n.opacityExit=ht(a.opacity!==void 0?a.opacity:1,0,cj(o))):f&&(n.opacity=ht(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,o));for(let u=0;u<lj;u++){const p=`border${Ux[u]}Radius`;let m=Jy(a,p),g=Jy(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||Wy(m)===Wy(g)?(n[p]=Math.max(ht(Qy(m),Qy(g),o),0),(Xn.test(g)||Xn.test(m))&&(n[p]+="%")):n[p]=g}(a.rotate||i.rotate)&&(n.rotate=ht(a.rotate||0,i.rotate||0,o))}function Jy(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const rj=zx(0,.5,tx),cj=zx(.5,.95,pn);function zx(n,a,i){return o=>o<n?0:o>a?1:i(Li(n,a,o))}function e0(n,a){n.min=a.min,n.max=a.max}function wn(n,a){e0(n.x,a.x),e0(n.y,a.y)}function t0(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function n0(n,a,i,o,r){return n-=a,n=rc(n,1/i,o),r!==void 0&&(n=rc(n,1/r,o)),n}function uj(n,a=0,i=1,o=.5,r,f=n,u=n){if(Xn.test(a)&&(a=parseFloat(a),a=ht(u.min,u.max,a/100)-u.min),typeof a!="number")return;let p=ht(f.min,f.max,o);n===f&&(p-=a),n.min=n0(n.min,a,i,p,r),n.max=n0(n.max,a,i,p,r)}function a0(n,a,[i,o,r],f,u){uj(n,a[i],a[o],a[r],a.scale,f,u)}const dj=["x","scaleX","originX"],fj=["y","scaleY","originY"];function s0(n,a,i,o){a0(n.x,a,dj,i?i.x:void 0,o?o.x:void 0),a0(n.y,a,fj,i?i.y:void 0,o?o.y:void 0)}function i0(n){return n.translate===0&&n.scale===1}function Vx(n){return i0(n.x)&&i0(n.y)}function l0(n,a){return n.min===a.min&&n.max===a.max}function hj(n,a){return l0(n.x,a.x)&&l0(n.y,a.y)}function o0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function Hx(n,a){return o0(n.x,a.x)&&o0(n.y,a.y)}function r0(n){return mn(n.x)/mn(n.y)}function c0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class pj{constructor(){this.members=[]}add(a){Sh(this.members,a),a.scheduleRender()}remove(a){if(Th(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(r=>a===r);if(i===0)return!1;let o;for(let r=i;r>=0;r--){const f=this.members[r];if(f.isPresent!==!1){o=f;break}}return o?(this.promote(o),!0):!1}promote(a,i){const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.instance&&o.scheduleRender(),a.scheduleRender(),a.resumeFrom=o,i&&(a.resumeFrom.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:o}=a;i.onExitComplete&&i.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function mj(n,a,i){let o="";const r=n.x.translate/a.x,f=n.y.translate/a.y,u=(i==null?void 0:i.z)||0;if((r||f||u)&&(o=`translate3d(${r}px, ${f}px, ${u}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:y,rotateX:v,rotateY:b,skewX:S,skewY:k}=i;g&&(o=`perspective(${g}px) ${o}`),y&&(o+=`rotate(${y}deg) `),v&&(o+=`rotateX(${v}deg) `),b&&(o+=`rotateY(${b}deg) `),S&&(o+=`skewX(${S}deg) `),k&&(o+=`skewY(${k}deg) `)}const p=n.x.scale*a.x,m=n.y.scale*a.y;return(p!==1||m!==1)&&(o+=`scale(${p}, ${m})`),o||"none"}const Ms={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Kl=typeof window<"u"&&window.MotionDebug!==void 0,tf=["","X","Y","Z"],gj={visibility:"hidden"},u0=1e3;let vj=0;function nf(n,a,i,o){const{latestValues:r}=a;r[n]&&(i[n]=r[n],a.setStaticValue(n,0),o&&(o[n]=0))}function Gx(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=$b(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:f}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",rt,!(r||f))}const{parent:o}=n;o&&!o.hasCheckedOptimisedAppear&&Gx(o)}function Px({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(u={},p=a==null?void 0:a()){this.id=vj++,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,Kl&&(Ms.totalNodes=Ms.resolvedTargetDeltas=Ms.recalculatedProjection=0),this.nodes.forEach(xj),this.nodes.forEach(kj),this.nodes.forEach(Ej),this.nodes.forEach(_j),Kl&&window.MotionDebug.record(Ms)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,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 sj)}addEventListener(u,p){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new Ch),this.eventHandlers.get(u).add(p)}notifyListeners(u,...p){const m=this.eventHandlers.get(u);m&&m.notify(...p)}hasListeners(u){return this.eventHandlers.has(u)}mount(u,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=nj(u),this.instance=u;const{layoutId:m,layout:g,visualElement:y}=this.options;if(y&&!y.current&&y.mount(u),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(u,()=>{this.root.updateBlockedByResize=!0,v&&v(),v=ij(b,250),Wr.hasAnimatedSinceResize&&(Wr.hasAnimatedSinceResize=!1,this.nodes.forEach(f0))})}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 E=this.options.transition||y.getDefaultTransition()||Dj,{onLayoutAnimationStart:N,onLayoutAnimationComplete:C}=y.getProps(),A=!this.targetLayout||!Hx(this.targetLayout,k)||S,O=!b&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||O||b&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(v,O);const B={..._h(E,"layout"),onPlay:N,onComplete:C};(y.shouldReduceMotion||this.options.layoutRoot)&&(B.delay=0,B.type=!1),this.startAnimation(B)}else b||f0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=k})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ss(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(Nj),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Gx(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(),u&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(d0);return}this.isUpdating||this.nodes.forEach(Tj),this.isUpdating=!1,this.nodes.forEach(Cj),this.nodes.forEach(yj),this.nodes.forEach(bj),this.clearAllSnapshots();const p=Qn.now();Vt.delta=Ca(0,1e3/60,p-Vt.timestamp),Vt.timestamp=p,Vt.isProcessing=!0,Yd.update.process(Vt),Yd.preRender.process(Vt),Yd.render.process(Vt),Vt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,dh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Sj),this.sharedNodes.forEach(Aj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rt.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 u=this.layout;this.layout=this.measure(!1),this.layoutCorrected=xt(),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,u?u.layoutBox:void 0)}updateScroll(u="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(p=!1),p){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!r)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!Vx(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,y=g!==this.prevTransformTemplateValue;u&&(p||Ds(this.latestValues)||y)&&(r(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return u&&(m=this.removeTransform(m)),Mj(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:p}=this.options;if(!p)return xt();const m=p.measureViewportBox();if(!(((u=this.scroll)===null||u===void 0?void 0:u.wasRoot)||this.path.some(Rj))){const{scroll:y}=this.root;y&&(Mi(m.x,y.offset.x),Mi(m.y,y.offset.y))}return m}removeElementScroll(u){var p;const m=xt();if(wn(m,u),!((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&&wn(m,u),Mi(m.x,v.offset.x),Mi(m.y,v.offset.y))}return m}applyTransform(u,p=!1){const m=xt();wn(m,u);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}),Ds(y.latestValues)&&Ri(m,y.latestValues)}return Ds(this.latestValues)&&Ri(m,this.latestValues),m}removeTransform(u){const p=xt();wn(p,u);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!Ds(g.latestValues))continue;Bf(g.latestValues)&&g.updateSnapshot();const y=xt(),v=g.measurePageBox();wn(y,v),s0(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,y)}return Ds(this.latestValues)&&s0(p,this.latestValues),p}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.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!==Vt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!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(!(u||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=Vt.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xt(),this.relativeTargetOrigin=xt(),no(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),wn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=xt(),this.targetWithTransforms=xt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),IA(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):wn(this.target,this.layout.layoutBox),Ox(this.target,this.targetDelta)):wn(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=xt(),this.relativeTargetOrigin=xt(),no(this.relativeTargetOrigin,this.target,S.target),wn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Kl&&Ms.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Bf(this.parent.latestValues)||Rx(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 u;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===Vt.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;wn(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,S=this.treeScale.y;$A(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=xt());const{target:k}=p;if(!k){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(t0(this.prevProjectionDelta.x,this.projectionDelta.x),t0(this.prevProjectionDelta.y,this.projectionDelta.y)),to(this.projectionDelta,this.layoutCorrected,k,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==S||!c0(this.projectionDelta.x,this.prevProjectionDelta.x)||!c0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",k)),Kl&&Ms.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),u){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(u,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=xt(),S=m?m.source:void 0,k=this.layout?this.layout.source:void 0,E=S!==k,N=this.getStack(),C=!N||N.members.length<=1,A=!!(E&&!C&&this.options.crossfade===!0&&!this.path.some(wj));this.animationProgress=0;let O;this.mixTargetDelta=B=>{const U=B/1e3;h0(v.x,u.x,U),h0(v.y,u.y,U),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(no(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jj(this.relativeTarget,this.relativeTargetOrigin,b,U),O&&hj(this.relativeTarget,O)&&(this.isProjectionDirty=!1),O||(O=xt()),wn(O,this.relativeTarget)),E&&(this.animationValues=y,oj(y,g,this.latestValues,U,A,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=U},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ss(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rt.update(()=>{Wr.hasAnimatedSinceResize=!0,this.currentAnimation=tj(0,u0,{...u,onUpdate:p=>{this.mixTargetDelta(p),u.onUpdate&&u.onUpdate(p)},onComplete:()=>{u.onComplete&&u.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 u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(u0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:y}=u;if(!(!p||!m||!g)){if(this!==u&&this.layout&&g&&Fx(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||xt();const v=mn(this.layout.layoutBox.x);m.x.min=u.target.x.min,m.x.max=m.x.min+v;const b=mn(this.layout.layoutBox.y);m.y.min=u.target.y.min,m.y.max=m.y.min+b}wn(p,m),Ri(p,y),to(this.projectionDeltaWithTransform,this.layoutCorrected,p,y)}}registerSharedNode(u,p){this.sharedNodes.has(u)||this.sharedNodes.set(u,new pj),this.sharedNodes.get(u).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 u=this.getStack();return u?u.lead===this:!0}getLead(){var u;const{layoutId:p}=this.options;return p?((u=this.getStack())===null||u===void 0?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:p}=this.options;return p?(u=this.getStack())===null||u===void 0?void 0:u.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),u&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let p=!1;const{latestValues:m}=u;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&nf("z",u,g,this.animationValues);for(let y=0;y<tf.length;y++)nf(`rotate${tf[y]}`,u,g,this.animationValues),nf(`skew${tf[y]}`,u,g,this.animationValues);u.render();for(const y in g)u.setStaticValue(y,g[y]),this.animationValues&&(this.animationValues[y]=g[y]);u.scheduleRender()}getProjectionStyles(u){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return gj;const g={visibility:""},y=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=Xr(u==null?void 0:u.pointerEvents)||"",g.transform=y?y(this.latestValues,""):"none",g;const v=this.getLead();if(!this.projectionDelta||!this.layout||!v.target){const E={};return this.options.layoutId&&(E.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,E.pointerEvents=Xr(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!Ds(this.latestValues)&&(E.transform=y?y({},""):"none",this.hasProjected=!1),E}const b=v.animationValues||v.latestValues;this.applyTransformsToTarget(),g.transform=mj(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 E in ac){if(b[E]===void 0)continue;const{correct:N,applyTo:C}=ac[E],A=g.transform==="none"?b[E]:N(b[E],v);if(C){const O=C.length;for(let B=0;B<O;B++)g[C[B]]=A}else g[E]=A}return this.options.layoutId&&(g.pointerEvents=v===this?Xr(u==null?void 0:u.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>{var p;return(p=u.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(d0),this.root.sharedNodes.clear()}}}function yj(n){n.updateLayout()}function bj(n){var a;const i=((a=n.resumeFrom)===null||a===void 0?void 0:a.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&i&&n.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:r}=n.layout,{animationType:f}=n.options,u=i.source!==n.layout.source;f==="size"?Dn(v=>{const b=u?i.measuredBox[v]:i.layoutBox[v],S=mn(b);b.min=o[v].min,b.max=b.min+S}):Fx(f,i.layoutBox,o)&&Dn(v=>{const b=u?i.measuredBox[v]:i.layoutBox[v],S=mn(o[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();to(p,o,i.layoutBox);const m=Di();u?to(m,n.applyTransform(r,!0),i.measuredBox):to(m,o,i.layoutBox);const g=!Vx(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=xt();no(k,i.layoutBox,b.layoutBox);const E=xt();no(E,o,S.layoutBox),Hx(k,E)||(y=!0),v.options.layoutRoot&&(n.relativeTarget=E,n.relativeTargetOrigin=k,n.relativeParent=v)}}}n.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:y})}else if(n.isLead()){const{onExitComplete:o}=n.options;o&&o()}n.options.transition=void 0}function xj(n){Kl&&Ms.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 _j(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function Sj(n){n.clearSnapshot()}function d0(n){n.clearMeasurements()}function Tj(n){n.isLayoutDirty=!1}function Cj(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function f0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function kj(n){n.resolveTargetDelta()}function Ej(n){n.calcProjection()}function Nj(n){n.resetSkewAndRotation()}function Aj(n){n.removeLeadSnapshot()}function h0(n,a,i){n.translate=ht(a.translate,0,i),n.scale=ht(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function p0(n,a,i,o){n.min=ht(a.min,i.min,o),n.max=ht(a.max,i.max,o)}function jj(n,a,i,o){p0(n.x,a.x,i.x,o),p0(n.y,a.y,i.y,o)}function wj(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const Dj={duration:.45,ease:[.4,0,.1,1]},m0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),g0=m0("applewebkit/")&&!m0("chrome/")?Math.round:pn;function v0(n){n.min=g0(n.min),n.max=g0(n.max)}function Mj(n){v0(n.x),v0(n.y)}function Fx(n,a,i){return n==="position"||n==="preserve-aspect"&&!BA(r0(a),r0(i),.2)}function Rj(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const Oj=Px({attachResizeListener:(n,a)=>ho(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),af={current:void 0},$x=Px({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!af.current){const n=new Oj({});n.mount(window),n.setOptions({layoutScroll:!0}),af.current=n}return af.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),Bj={pan:{Feature:QA},drag:{Feature:XA,ProjectionNode:$x,MeasureLayout:Lx}};function Ij(n,a,i){var o;if(n instanceof Element)return[n];if(typeof n=="string"){let r=document;const f=(o=void 0)!==null&&o!==void 0?o:r.querySelectorAll(n);return f?Array.from(f):[]}return Array.from(n)}function qx(n,a){const i=Ij(n),o=new AbortController,r={passive:!0,...a,signal:o.signal};return[i,r,()=>o.abort()]}function y0(n){return a=>{a.pointerType==="touch"||Nx()||n(a)}}function Lj(n,a,i={}){const[o,r,f]=qx(n,i),u=y0(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const y=y0(v=>{g(v),m.removeEventListener("pointerleave",y)});m.addEventListener("pointerleave",y,r)});return o.forEach(p=>{p.addEventListener("pointerenter",u,r)}),f}function b0(n,a,i){const{props:o}=n;n.animationState&&o.whileHover&&n.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,f=o[r];f&&rt.postRender(()=>f(a,xo(a)))}class Uj extends os{mount(){const{current:a}=this.node;a&&(this.unmount=Lj(a,i=>(b0(this.node,i,"Start"),o=>b0(this.node,o,"End"))))}unmount(){}}class zj extends os{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=bo(ho(this.node.current,"focus",()=>this.onFocus()),ho(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Yx=(n,a)=>a?n===a?!0:Yx(n,a.parentElement):!1,Vj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Hj(n){return Vj.has(n.tagName)||n.tabIndex!==-1}const Zl=new WeakSet;function x0(n){return a=>{a.key==="Enter"&&n(a)}}function sf(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const Gj=(n,a)=>{const i=n.currentTarget;if(!i)return;const o=x0(()=>{if(Zl.has(i))return;sf(i,"down");const r=x0(()=>{sf(i,"up")}),f=()=>sf(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",f,a)});i.addEventListener("keydown",o,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),a)};function _0(n){return Lh(n)&&!Nx()}function Pj(n,a,i={}){const[o,r,f]=qx(n,i),u=p=>{const m=p.currentTarget;if(!_0(p)||Zl.has(m))return;Zl.add(m);const g=a(p),y=(S,k)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",b),!(!_0(S)||!Zl.has(m))&&(Zl.delete(m),typeof g=="function"&&g(S,{success:k}))},v=S=>{y(S,i.useGlobalTarget||Yx(m,S.target))},b=S=>{y(S,!1)};window.addEventListener("pointerup",v,r),window.addEventListener("pointercancel",b,r)};return o.forEach(p=>{!Hj(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",u,r),p.addEventListener("focus",g=>Gj(g,r),r)}),f}function S0(n,a,i){const{props:o}=n;n.animationState&&o.whileTap&&n.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),f=o[r];f&&rt.postRender(()=>f(a,xo(a)))}class Fj extends os{mount(){const{current:a}=this.node;a&&(this.unmount=Pj(a,i=>(S0(this.node,i,"Start"),(o,{success:r})=>S0(this.node,o,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Lf=new WeakMap,lf=new WeakMap,$j=n=>{const a=Lf.get(n.target);a&&a(n)},qj=n=>{n.forEach($j)};function Yj({root:n,...a}){const i=n||document;lf.has(i)||lf.set(i,{});const o=lf.get(i),r=JSON.stringify(a);return o[r]||(o[r]=new IntersectionObserver(qj,{root:n,...a})),o[r]}function Kj(n,a,i){const o=Yj(a);return Lf.set(n,i),o.observe(n),()=>{Lf.delete(n),o.unobserve(n)}}const Zj={some:0,all:1};class Xj extends os{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:o,amount:r="some",once:f}=a,u={root:i?i.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:Zj[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,f&&!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 Kj(this.node.current,u,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(Qj(a,i))&&this.startObserver()}unmount(){}}function Qj({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const Wj={inView:{Feature:Xj},tap:{Feature:Fj},focus:{Feature:zj},hover:{Feature:Uj}},Jj={layout:{ProjectionNode:$x,MeasureLayout:Lx}},cc={current:null},Uh={current:!1};function Kx(){if(Uh.current=!0,!!oh)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>cc.current=n.matches;n.addListener(a),a()}else cc.current=!1}const ew=[...mx,Pt,is],tw=n=>ew.find(px(n)),T0=new WeakMap;function nw(n,a,i){for(const o in a){const r=a[o],f=i[o];if(Ft(r))n.addValue(o,r);else if(Ft(f))n.addValue(o,uo(r,{owner:n}));else if(f!==r)if(n.hasValue(o)){const u=n.getValue(o);u.liveStyle===!0?u.jump(r):u.hasAnimated||u.set(r)}else{const u=n.getStaticValue(o);n.addValue(o,uo(u!==void 0?u:r,{owner:n}))}}for(const o in i)a[o]===void 0&&n.removeValue(o);return a}const C0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class aw{scrapeMotionValuesFromProps(a,i,o){return{}}constructor({parent:a,props:i,presenceContext:o,reducedMotionConfig:r,blockInitialAnimation:f,visualState:u},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Rh,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=Qn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,rt.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:y}=u;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=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!f,this.isControllingVariants=_c(i),this.isVariantNode=Nb(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&&Ft(k)&&k.set(m[S],!1)}}mount(a){this.current=a,T0.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,o)=>this.bindToMotionValue(o,i)),Uh.current||Kx(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:cc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){T0.delete(this.current),this.projection&&this.projection.unmount(),ss(this.notifyUpdate),ss(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const i=this.features[a];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(a,i){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const o=Us.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&rt.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),f=i.on("renderRequest",this.scheduleRender);let u;window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),f(),u&&u(),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 Ii){const i=Ii[a];if(!i)continue;const{isEnabled:o,Feature:r}=i;if(!this.features[a]&&r&&o(this.props)&&(this.features[a]=new r(this)),this.features[a]){const f=this.features[a];f.isMounted?f.update():(f.mount(),f.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):xt()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,i){this.latestValues[a]=i}update(a,i){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let o=0;o<C0.length;o++){const r=C0[o];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const f="on"+r,u=a[f];u&&(this.propEventSubscriptions[r]=this.on(r,u))}this.prevMotionValues=nw(this,this.scrapeMotionValuesFromProps(a,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(a){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(a),()=>i.variantChildren.delete(a)}addValue(a,i){const o=this.values.get(a);i!==o&&(o&&this.removeValue(a),this.bindToMotionValue(a,i),this.values.set(a,i),this.latestValues[a]=i.get())}removeValue(a){this.values.delete(a);const i=this.valueSubscriptions.get(a);i&&(i(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,i){if(this.props.values&&this.props.values[a])return this.props.values[a];let o=this.values.get(a);return o===void 0&&i!==void 0&&(o=uo(i===null?void 0:i,{owner:this}),this.addValue(a,o)),o}readValue(a,i){var o;let r=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(o=this.getBaseTargetFromProps(this.props,a))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,a,this.options);return r!=null&&(typeof r=="string"&&(fx(r)||ax(r))?r=parseFloat(r):!tw(r)&&is.test(i)&&(r=cx(a,i)),this.setBaseTarget(a,Ft(r)?r.get():r)),Ft(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:o}=this.props;let r;if(typeof o=="string"||typeof o=="object"){const u=hh(this.props,o,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);u&&(r=u[a])}if(o&&r!==void 0)return r;const f=this.getBaseTargetFromProps(this.props,a);return f!==void 0&&!Ft(f)?f:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new Ch),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class Zx extends aw{constructor(){super(...arguments),this.KeyframeResolver=gx}sortInstanceNodePosition(a,i){return a.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(a,i){return a.style?a.style[i]:void 0}removeValueFromRenderState(a,{vars:i,style:o}){delete i[a],delete o[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Ft(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function sw(n){return window.getComputedStyle(n)}class iw extends Zx{constructor(){super(...arguments),this.type="html",this.renderInstance=Ib}readValueFromInstance(a,i){if(Us.has(i)){const o=Mh(i);return o&&o.default||0}else{const o=sw(a),r=(Rb(i)?o.getPropertyValue(i):o[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Bx(a,i)}build(a,i,o){gh(a,i,o.transformTemplate)}scrapeMotionValuesFromProps(a,i,o){return xh(a,i,o)}}class lw extends Zx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Us.has(i)){const o=Mh(i);return o&&o.default||0}return i=Lb.has(i)?i:uh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,o){return Vb(a,i,o)}build(a,i,o){vh(a,i,this.isSVGTag,o.transformTemplate)}renderInstance(a,i,o,r){Ub(a,i,o,r)}mount(a){this.isSVGTag=bh(a.tagName),super.mount(a)}}const ow=(n,a)=>fh(n)?new lw(a):new iw(a,{allowProjection:n!==_.Fragment}),rw=OE({...kA,...Wj,...Bj,...Jj},ow),Nt=Zk(rw);function cw(){!Uh.current&&Kx();const[n]=_.useState(cc.current);return n}var at;(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"})(at||(at={}));var Et;(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"})(Et||(Et={}));var ts;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.ACTIVE=1]="ACTIVE",n[n.ARCHIVED=2]="ARCHIVED"})(ts||(ts={}));var ns;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OPEN=1]="OPEN",n[n.CLOSED=2]="CLOSED"})(ns||(ns={}));var qn;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.SUBSCRIPTION=2]="SUBSCRIPTION",n[n.API_KEY=3]="API_KEY"})(qn||(qn={}));var as;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.ON=2]="ON"})(as||(as={}));const uw=8,k0="system",Bs="system";Object.assign(Object.create(null),{"":at.UNSPECIFIED,text:at.TEXT,tool_use:at.TOOL_USE,tool_result:at.TOOL_RESULT,error:at.ERROR,status:at.STATUS,system:at.SYSTEM,finding:at.FINDING,subtask_create:at.SUBTASK_CREATE,user_input:at.USER_INPUT,signal:at.SIGNAL,usage:at.USAGE});at.UNSPECIFIED+"",at.TEXT+"",at.TOOL_USE+"",at.TOOL_RESULT+"",at.ERROR+"",at.STATUS+"",at.SYSTEM+"",at.FINDING+"",at.SUBTASK_CREATE+"",at.USER_INPUT+"",at.SIGNAL+"",at.USAGE+"";Object.assign(Object.create(null),{"":Et.UNSPECIFIED,not_started:Et.NOT_STARTED,working:Et.WORKING,paused:Et.PAUSED,complete:Et.COMPLETE,failed:Et.FAILED,pending:Et.NOT_STARTED,assigned:Et.NOT_STARTED,in_progress:Et.WORKING,waiting_input:Et.PAUSED,review:Et.PAUSED,done:Et.COMPLETE});Et.UNSPECIFIED+"",Et.NOT_STARTED+"",Et.WORKING+"",Et.PAUSED+"",Et.COMPLETE+"",Et.FAILED+"";Object.assign(Object.create(null),{"":ts.UNSPECIFIED,active:ts.ACTIVE,archived:ts.ARCHIVED});ts.UNSPECIFIED+"",ts.ACTIVE+"",ts.ARCHIVED+"";Object.assign(Object.create(null),{"":ns.UNSPECIFIED,open:ns.OPEN,closed:ns.CLOSED});ns.UNSPECIFIED+"",ns.OPEN+"",ns.CLOSED+"";Object.assign(Object.create(null),{"":qn.UNSPECIFIED,off:qn.OFF,subscription:qn.SUBSCRIPTION,api_key:qn.API_KEY});qn.UNSPECIFIED+"",qn.OFF+"",qn.SUBSCRIPTION+"",qn.API_KEY+"";Object.assign(Object.create(null),{"":as.UNSPECIFIED,off:as.OFF,on:as.ON});as.UNSPECIFIED+"",as.OFF+"",as.ON+"";function ka(n){return Array.isArray?Array.isArray(n):Wx(n)==="[object Array]"}function dw(n){if(typeof n=="string")return n;let a=n+"";return a=="0"&&1/n==-1/0?"-0":a}function fw(n){return n==null?"":dw(n)}function Yn(n){return typeof n=="string"}function Xx(n){return typeof n=="number"}function hw(n){return n===!0||n===!1||pw(n)&&Wx(n)=="[object Boolean]"}function Qx(n){return typeof n=="object"}function pw(n){return Qx(n)&&n!==null}function hn(n){return n!=null}function of(n){return!n.trim().length}function Wx(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const mw="Incorrect 'index' type",gw=n=>`Invalid value for key ${n}`,vw=n=>`Pattern length exceeds max of ${n}.`,yw=n=>`Missing ${n} property in key`,bw=n=>`Property 'weight' in key '${n}' must be a positive integer`,E0=Object.prototype.hasOwnProperty;class xw{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(o=>{let r=Jx(o);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(o=>{o.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Jx(n){let a=null,i=null,o=null,r=1,f=null;if(Yn(n)||ka(n))o=n,a=N0(n),i=Uf(n);else{if(!E0.call(n,"name"))throw new Error(yw("name"));const u=n.name;if(o=u,E0.call(n,"weight")&&(r=n.weight,r<=0))throw new Error(bw(u));a=N0(u),i=Uf(u),f=n.getFn}return{path:a,id:i,weight:r,src:o,getFn:f}}function N0(n){return ka(n)?n:n.split(".")}function Uf(n){return ka(n)?n.join("."):n}function _w(n,a){let i=[],o=!1;const r=(f,u,p)=>{if(hn(f))if(!u[p])i.push(f);else{let m=u[p];const g=f[m];if(!hn(g))return;if(p===u.length-1&&(Yn(g)||Xx(g)||hw(g)))i.push(fw(g));else if(ka(g)){o=!0;for(let y=0,v=g.length;y<v;y+=1)r(g[y],u,p+1)}else u.length&&r(g,u,p+1)}};return r(n,Yn(a)?a.split("."):a,0),o?i:i[0]}const Sw={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Tw={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},Cw={location:0,threshold:.6,distance:100},kw={useExtendedSearch:!1,getFn:_w,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var be={...Tw,...Sw,...Cw,...kw};const Ew=/[^ ]+/g;function Nw(n=1,a=3){const i=new Map,o=Math.pow(10,a);return{get(r){const f=r.match(Ew).length;if(i.has(f))return i.get(f);const u=1/Math.pow(f,.5*n),p=parseFloat(Math.round(u*o)/o);return i.set(f,p),p},clear(){i.clear()}}}class zh{constructor({getFn:a=be.getFn,fieldNormWeight:i=be.fieldNormWeight}={}){this.norm=Nw(i,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((i,o)=>{this._keysMap[i.id]=o})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Yn(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();Yn(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,o=this.size();i<o;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!hn(a)||of(a))return;let o={v:a,i,n:this.norm.get(a)};this.records.push(o)}_addObject(a,i){let o={i,$:{}};this.keys.forEach((r,f)=>{let u=r.getFn?r.getFn(a):this.getFn(a,r.path);if(hn(u)){if(ka(u)){let p=[];const m=[{nestedArrIndex:-1,value:u}];for(;m.length;){const{nestedArrIndex:g,value:y}=m.pop();if(hn(y))if(Yn(y)&&!of(y)){let v={v:y,i:g,n:this.norm.get(y)};p.push(v)}else ka(y)&&y.forEach((v,b)=>{m.push({nestedArrIndex:b,value:v})})}o.$[f]=p}else if(Yn(u)&&!of(u)){let p={v:u,n:this.norm.get(u)};o.$[f]=p}}}),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function e_(n,a,{getFn:i=be.getFn,fieldNormWeight:o=be.fieldNormWeight}={}){const r=new zh({getFn:i,fieldNormWeight:o});return r.setKeys(n.map(Jx)),r.setSources(a),r.create(),r}function Aw(n,{getFn:a=be.getFn,fieldNormWeight:i=be.fieldNormWeight}={}){const{keys:o,records:r}=n,f=new zh({getFn:a,fieldNormWeight:i});return f.setKeys(o),f.setIndexRecords(r),f}function Gr(n,{errors:a=0,currentLocation:i=0,expectedLocation:o=0,distance:r=be.distance,ignoreLocation:f=be.ignoreLocation}={}){const u=a/n.length;if(f)return u;const p=Math.abs(o-i);return r?u+p/r:p?1:u}function jw(n=[],a=be.minMatchCharLength){let i=[],o=-1,r=-1,f=0;for(let u=n.length;f<u;f+=1){let p=n[f];p&&o===-1?o=f:!p&&o!==-1&&(r=f-1,r-o+1>=a&&i.push([o,r]),o=-1)}return n[f-1]&&f-o>=a&&i.push([o,f-1]),i}const Rs=32;function ww(n,a,i,{location:o=be.location,distance:r=be.distance,threshold:f=be.threshold,findAllMatches:u=be.findAllMatches,minMatchCharLength:p=be.minMatchCharLength,includeMatches:m=be.includeMatches,ignoreLocation:g=be.ignoreLocation}={}){if(a.length>Rs)throw new Error(vw(Rs));const y=a.length,v=n.length,b=Math.max(0,Math.min(o,v));let S=f,k=b;const E=p>1||m,N=E?Array(v):[];let C;for(;(C=n.indexOf(a,k))>-1;){let M=Gr(a,{currentLocation:C,expectedLocation:b,distance:r,ignoreLocation:g});if(S=Math.min(M,S),k=C+y,E){let R=0;for(;R<y;)N[C+R]=1,R+=1}}k=-1;let A=[],O=1,B=y+v;const U=1<<y-1;for(let M=0;M<y;M+=1){let R=0,F=B;for(;R<F;)Gr(a,{errors:M,currentLocation:b+F,expectedLocation:b,distance:r,ignoreLocation:g})<=S?R=F:B=F,F=Math.floor((B-R)/2+R);B=F;let ee=Math.max(1,b-F+1),te=u?v:Math.min(b+F,v)+y,se=Array(te+2);se[te+1]=(1<<M)-1;for(let Q=te;Q>=ee;Q-=1){let ie=Q-1,I=i[n.charAt(ie)];if(E&&(N[ie]=+!!I),se[Q]=(se[Q+1]<<1|1)&I,M&&(se[Q]|=(A[Q+1]|A[Q])<<1|1|A[Q+1]),se[Q]&U&&(O=Gr(a,{errors:M,currentLocation:ie,expectedLocation:b,distance:r,ignoreLocation:g}),O<=S)){if(S=O,k=ie,k<=b)break;ee=Math.max(1,2*b-k)}}if(Gr(a,{errors:M+1,currentLocation:b,expectedLocation:b,distance:r,ignoreLocation:g})>S)break;A=se}const q={isMatch:k>=0,score:Math.max(.001,O)};if(E){const M=jw(N,p);M.length?m&&(q.indices=M):q.isMatch=!1}return q}function Dw(n){let a={};for(let i=0,o=n.length;i<o;i+=1){const r=n.charAt(i);a[r]=(a[r]||0)|1<<o-i-1}return a}const uc=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 t_{constructor(a,{location:i=be.location,threshold:o=be.threshold,distance:r=be.distance,includeMatches:f=be.includeMatches,findAllMatches:u=be.findAllMatches,minMatchCharLength:p=be.minMatchCharLength,isCaseSensitive:m=be.isCaseSensitive,ignoreDiacritics:g=be.ignoreDiacritics,ignoreLocation:y=be.ignoreLocation}={}){if(this.options={location:i,threshold:o,distance:r,includeMatches:f,findAllMatches:u,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y},a=m?a:a.toLowerCase(),a=g?uc(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const v=(S,k)=>{this.chunks.push({pattern:S,alphabet:Dw(S),startIndex:k})},b=this.pattern.length;if(b>Rs){let S=0;const k=b%Rs,E=b-k;for(;S<E;)v(this.pattern.substr(S,Rs),S),S+=Rs;if(k){const N=b-Rs;v(this.pattern.substr(N),N)}}else v(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=o?uc(a):a,this.pattern===a){let E={isMatch:!0,score:0};return r&&(E.indices=[[0,a.length-1]]),E}const{location:f,distance:u,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:y}=this.options;let v=[],b=0,S=!1;this.chunks.forEach(({pattern:E,alphabet:N,startIndex:C})=>{const{isMatch:A,score:O,indices:B}=ww(a,E,N,{location:f+C,distance:u,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:y});A&&(S=!0),b+=O,A&&B&&(v=[...v,...B])});let k={isMatch:S,score:S?b/this.chunks.length:1};return S&&r&&(k.indices=v),k}}class rs{constructor(a){this.pattern=a}static isMultiMatch(a){return A0(a,this.multiRegex)}static isSingleMatch(a){return A0(a,this.singleRegex)}search(){}}function A0(n,a){const i=n.match(a);return i?i[1]:null}class Mw extends rs{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 Rw extends rs{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const o=a.indexOf(this.pattern)===-1;return{isMatch:o,score:o?0:1,indices:[0,a.length-1]}}}class Ow extends rs{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 Bw extends rs{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 Iw extends rs{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 Lw extends rs{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 n_ extends rs{constructor(a,{location:i=be.location,threshold:o=be.threshold,distance:r=be.distance,includeMatches:f=be.includeMatches,findAllMatches:u=be.findAllMatches,minMatchCharLength:p=be.minMatchCharLength,isCaseSensitive:m=be.isCaseSensitive,ignoreDiacritics:g=be.ignoreDiacritics,ignoreLocation:y=be.ignoreLocation}={}){super(a),this._bitapSearch=new t_(a,{location:i,threshold:o,distance:r,includeMatches:f,findAllMatches:u,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 a_ extends rs{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,o;const r=[],f=this.pattern.length;for(;(o=a.indexOf(this.pattern,i))>-1;)i=o+f,r.push([o,i-1]);const u=!!r.length;return{isMatch:u,score:u?0:1,indices:r}}}const zf=[Mw,a_,Ow,Bw,Lw,Iw,Rw,n_],j0=zf.length,Uw=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,zw="|";function Vw(n,a={}){return n.split(zw).map(i=>{let o=i.trim().split(Uw).filter(f=>f&&!!f.trim()),r=[];for(let f=0,u=o.length;f<u;f+=1){const p=o[f];let m=!1,g=-1;for(;!m&&++g<j0;){const y=zf[g];let v=y.isMultiMatch(p);v&&(r.push(new y(v,a)),m=!0)}if(!m)for(g=-1;++g<j0;){const y=zf[g];let v=y.isSingleMatch(p);if(v){r.push(new y(v,a));break}}}return r})}const Hw=new Set([n_.type,a_.type]);class Gw{constructor(a,{isCaseSensitive:i=be.isCaseSensitive,ignoreDiacritics:o=be.ignoreDiacritics,includeMatches:r=be.includeMatches,minMatchCharLength:f=be.minMatchCharLength,ignoreLocation:u=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:o,includeMatches:r,minMatchCharLength:f,findAllMatches:p,ignoreLocation:u,location:m,threshold:g,distance:y},a=i?a:a.toLowerCase(),a=o?uc(a):a,this.pattern=a,this.query=Vw(this.pattern,this.options)}static condition(a,i){return i.useExtendedSearch}searchIn(a){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:o,isCaseSensitive:r,ignoreDiacritics:f}=this.options;a=r?a:a.toLowerCase(),a=f?uc(a):a;let u=0,p=[],m=0;for(let g=0,y=i.length;g<y;g+=1){const v=i[g];p.length=0,u=0;for(let b=0,S=v.length;b<S;b+=1){const k=v[b],{isMatch:E,indices:N,score:C}=k.search(a);if(E){if(u+=1,m+=C,o){const A=k.constructor.type;Hw.has(A)?p=[...p,...N]:p.push(N)}}else{m=0,u=0,p.length=0;break}}if(u){let b={isMatch:!0,score:m/u};return o&&(b.indices=p),b}}return{isMatch:!1,score:1}}}const Vf=[];function Pw(...n){Vf.push(...n)}function Hf(n,a){for(let i=0,o=Vf.length;i<o;i+=1){let r=Vf[i];if(r.condition(n,a))return new r(n,a)}return new t_(n,a)}const dc={AND:"$and",OR:"$or"},Gf={PATH:"$path",PATTERN:"$val"},Pf=n=>!!(n[dc.AND]||n[dc.OR]),Fw=n=>!!n[Gf.PATH],$w=n=>!ka(n)&&Qx(n)&&!Pf(n),w0=n=>({[dc.AND]:Object.keys(n).map(a=>({[a]:n[a]}))});function s_(n,a,{auto:i=!0}={}){const o=r=>{let f=Object.keys(r);const u=Fw(r);if(!u&&f.length>1&&!Pf(r))return o(w0(r));if($w(r)){const m=u?r[Gf.PATH]:f[0],g=u?r[Gf.PATTERN]:r[m];if(!Yn(g))throw new Error(gw(m));const y={keyId:Uf(m),pattern:g};return i&&(y.searcher=Hf(g,a)),y}let p={children:[],operator:f[0]};return f.forEach(m=>{const g=r[m];ka(g)&&g.forEach(y=>{p.children.push(o(y))})}),p};return Pf(n)||(n=w0(n)),o(n)}function qw(n,{ignoreFieldNorm:a=be.ignoreFieldNorm}){n.forEach(i=>{let o=1;i.matches.forEach(({key:r,norm:f,score:u})=>{const p=r?r.weight:null;o*=Math.pow(u===0&&p?Number.EPSILON:u,(p||1)*(a?1:f))}),i.score=o})}function Yw(n,a){const i=n.matches;a.matches=[],hn(i)&&i.forEach(o=>{if(!hn(o.indices)||!o.indices.length)return;const{indices:r,value:f}=o;let u={indices:r,value:f};o.key&&(u.key=o.key.src),o.idx>-1&&(u.refIndex=o.idx),a.matches.push(u)})}function Kw(n,a){a.score=n.score}function Zw(n,a,{includeMatches:i=be.includeMatches,includeScore:o=be.includeScore}={}){const r=[];return i&&r.push(Yw),o&&r.push(Kw),n.map(f=>{const{idx:u}=f,p={item:a[u],refIndex:u};return r.length&&r.forEach(m=>{m(f,p)}),p})}class Yi{constructor(a,i={},o){this.options={...be,...i},this.options.useExtendedSearch,this._keyStore=new xw(this.options.keys),this.setCollection(a,o)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof zh))throw new Error(mw);this._myIndex=i||e_(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){hn(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let o=0,r=this._docs.length;o<r;o+=1){const f=this._docs[o];a(f,o)&&(this.removeAt(o),o-=1,r-=1,i.push(f))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:o,includeScore:r,shouldSort:f,sortFn:u,ignoreFieldNorm:p}=this.options;let m=Yn(a)?Yn(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return qw(m,{ignoreFieldNorm:p}),f&&m.sort(u),Xx(i)&&i>-1&&(m=m.slice(0,i)),Zw(m,this._docs,{includeMatches:o,includeScore:r})}_searchStringList(a){const i=Hf(a,this.options),{records:o}=this._myIndex,r=[];return o.forEach(({v:f,i:u,n:p})=>{if(!hn(f))return;const{isMatch:m,score:g,indices:y}=i.searchIn(f);m&&r.push({item:f,idx:u,matches:[{score:g,value:f,norm:p,indices:y}]})}),r}_searchLogical(a){const i=s_(a,this.options),o=(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=o(S,m,g);if(k.length)y.push(...k);else if(p.operator===dc.AND)return[]}return y},r=this._myIndex.records,f={},u=[];return r.forEach(({$:p,i:m})=>{if(hn(p)){let g=o(i,p,m);g.length&&(f[m]||(f[m]={idx:m,item:p,matches:[]},u.push(f[m])),g.forEach(({matches:y})=>{f[m].matches.push(...y)}))}}),u}_searchObjectList(a){const i=Hf(a,this.options),{keys:o,records:r}=this._myIndex,f=[];return r.forEach(({$:u,i:p})=>{if(!hn(u))return;let m=[];o.forEach((g,y)=>{m.push(...this._findMatches({key:g,value:u[y],searcher:i}))}),m.length&&f.push({idx:p,item:u,matches:m})}),f}_findMatches({key:a,value:i,searcher:o}){if(!hn(i))return[];let r=[];if(ka(i))i.forEach(({v:f,i:u,n:p})=>{if(!hn(f))return;const{isMatch:m,score:g,indices:y}=o.searchIn(f);m&&r.push({score:g,key:a,value:f,idx:u,norm:p,indices:y})});else{const{v:f,n:u}=i,{isMatch:p,score:m,indices:g}=o.searchIn(f);p&&r.push({score:m,key:a,value:f,norm:u,indices:g})}return r}}Yi.version="7.1.0";Yi.createIndex=e_;Yi.parseIndex=Aw;Yi.config=be;Yi.parseQuery=s_;Pw(Gw);function Xw(n,a,i,o){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 Ff={not_started:{color:"var(--text-tertiary)",icon:"○",label:"Not Started"},working:{color:"var(--accent-green)",icon:"●",label:"Working"},paused:{color:"var(--accent-yellow)",icon:"◉",label:"Paused"},complete:{color:"var(--accent-green)",icon:"✓",label:"Complete"},failed:{color:"var(--accent-red)",icon:"✗",label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:"⦸",label:"Blocked"}};function ls(n){return n==="blocked"?Ff.blocked:Ff[Vh(n)]}const Qw={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function Ww(n){return Qw[Vh(n)]??"statusPending"}const Jw=["working","paused","failed","not_started","blocked","complete"],D0=["not_started","working","paused","complete","failed"],e2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Vh(n){return n in Ff&&n!=="blocked"?n:e2[n]??"not_started"}const t2={not_started:"--text-tertiary",working:"--accent-green",paused:"--accent-yellow",complete:"--accent-green",failed:"--accent-red",pending:"--text-tertiary",assigned:"--text-tertiary",in_progress:"--accent-green",review:"--accent-yellow",done:"--accent-green",waiting_input:"--accent-yellow"};function n2(n){if(n.length===0)return[];const a=[...n].sort((o,r)=>o[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let o=1;o<a.length;o++){const r=i[i.length-1],[f,u]=a[o];f<=r[1]+1?r[1]=Math.max(r[1],u):i.push([f,u])}return i}function i_({text:n,indices:a,highlightClass:i}){if(!a||a.length===0)return c.jsx(c.Fragment,{children:n});const o=n2(a),r=[];let f=0;for(const[u,p]of o)u>f&&r.push(c.jsx("span",{children:n.slice(f,u)},`p${f}`)),r.push(c.jsx("mark",{className:i,children:n.slice(u,p+1)},`m${u}`)),f=p+1;return f<n.length&&r.push(c.jsx("span",{children:n.slice(f)},`p${f}`)),c.jsx(c.Fragment,{children:r})}function a2(n){const a=new Map(n.map(o=>[o.id,{...o,children:[]}])),i=[];for(const o of a.values())o.parentTaskId&&a.has(o.parentTaskId)?a.get(o.parentTaskId).children.push(o):i.push(o);for(const o of a.values())o.children.sort((r,f)=>r.sortOrder-f.sortOrder);return i.sort((o,r)=>o.sortOrder-r.sortOrder)}function s2(n,a){const i=new Map;for(const f of n){const p=f.dependsOn.length>0&&f.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":f.status,m=i.get(p);m?m.push(f):i.set(p,[f])}const o=[],r=new Set;for(const f of Jw){r.add(f);const u=i.get(f);if(u&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ls(f);o.push({status:f,label:p.label,style:p,tasks:u})}}for(const[f,u]of i)if(!r.has(f)&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ls(f);o.push({status:f,label:p.label,style:p,tasks:u})}return o}const i2="_container_z4i38_1",l2="_header_z4i38_5",o2="_headerActions_z4i38_17",r2="_searchInput_z4i38_23",c2="_searchHighlight_z4i38_56",u2="_groupToggle_z4i38_62",d2="_groupToggleActive_z4i38_89",f2="_addButton_z4i38_93",h2="_taskRow_z4i38_120",p2="_selected_z4i38_140",m2="_expandArrow_z4i38_150",g2="_expanded_z4i38_157",v2="_leafSpacer_z4i38_161",y2="_taskStatusIcon_z4i38_166",b2="_taskTitle_z4i38_170",x2="_workspaceBadge_z4i38_177",_2="_childCountBadge_z4i38_195",S2="_dependencyBadge_z4i38_208",T2="_blockedBadge_z4i38_220",C2="_addChildButton_z4i38_225",k2="_emptyState_z4i38_268",E2="_statusGroupHeader_z4i38_275",N2="_statusGroupIcon_z4i38_294",A2="_statusGroupLabel_z4i38_298",j2="_statusGroupCount_z4i38_303",Be={container:i2,header:l2,headerActions:o2,searchInput:r2,searchHighlight:c2,groupToggle:u2,groupToggleActive:d2,addButton:f2,taskRow:h2,selected:p2,expandArrow:m2,expanded:g2,leafSpacer:v2,taskStatusIcon:y2,taskTitle:b2,workspaceBadge:x2,childCountBadge:_2,dependencyBadge:S2,blockedBadge:T2,addChildButton:C2,emptyState:k2,statusGroupHeader:E2,statusGroupIcon:N2,statusGroupLabel:A2,statusGroupCount:j2},w2=[{name:"title",weight:2},{name:"description",weight:1}],l_=16,D2=16,o_="grackle-task-group-by-status";function M0(){try{return localStorage.getItem(o_)==="true"}catch{return!1}}function M2(n){try{localStorage.setItem(o_,String(n))}catch{}}function R2({group:n,isExpanded:a,onToggle:i,selectedTaskId:o,navigate:r,titleHighlights:f,workspaceNames:u}){return c.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[c.jsxs("div",{className:Be.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:`${Be.expandArrow} ${a?Be.expanded:""}`,children:"▸"}),c.jsx("span",{className:Be.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),c.jsx("span",{className:Be.statusGroupLabel,children:n.label}),c.jsx("span",{className:Be.statusGroupCount,children:n.tasks.length})]}),c.jsx(Wn,{children:a&&c.jsx(Nt.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=ls(p.status),g=o===p.id,y=p.parentTaskId||!p.workspaceId?void 0:u.get(p.workspaceId);return c.jsxs("div",{onClick:()=>r(Ta(p.id)),className:`${Be.taskRow} ${g?Be.selected:""}`,style:{"--task-indent":`${l_}px`},"data-task-id":p.id,children:[c.jsx("span",{className:Be.leafSpacer}),c.jsx("span",{className:Be.taskStatusIcon,style:{color:m.color},children:m.icon}),c.jsx("span",{className:Be.taskTitle,title:p.title,children:c.jsx(i_,{text:p.title,indices:f.get(p.id),highlightClass:Be.searchHighlight})}),y&&c.jsx("span",{className:Be.workspaceBadge,title:y,children:y})]},p.id)})})})]})}function r_({node:n,depth:a,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:f,taskStatusById:u,titleHighlights:p,workspaceNames:m}){const g=ls(n.status),y=n.dependsOn.length>0&&n.dependsOn.some(C=>u.get(C)!=="complete"),v=i.has(n.id),b=n.children.length>0,S=r===n.id,k=l_+a*D2,N=a===0&&!n.parentTaskId&&n.workspaceId?m.get(n.workspaceId):void 0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{onClick:()=>f(Ta(n.id)),className:`${Be.taskRow} ${S?Be.selected:""}`,style:{"--task-indent":`${k}px`},"data-task-id":n.id,children:[b&&c.jsx("span",{className:`${Be.expandArrow} ${v?Be.expanded:""}`,role:"button",tabIndex:0,"aria-label":v?"Collapse task":"Expand task",onClick:C=>{C.stopPropagation(),o(n.id)},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),C.stopPropagation(),o(n.id))},children:"▸"}),!b&&c.jsx("span",{className:Be.leafSpacer}),c.jsx("span",{className:Be.taskStatusIcon,style:{color:g.color},children:g.icon}),c.jsx("span",{className:Be.taskTitle,title:n.title,children:c.jsx(i_,{text:n.title,indices:p.get(n.id),highlightClass:Be.searchHighlight})}),N&&c.jsx("span",{className:Be.workspaceBadge,title:N,children:N}),b&&c.jsxs("span",{className:Be.childCountBadge,children:[n.children.filter(C=>C.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&c.jsx("span",{className:`${Be.dependencyBadge} ${y?Be.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:y?"blocked":"dep"}),a<uw&&c.jsx("button",{onClick:C=>{C.stopPropagation(),f(Pi(n.workspaceId,n.id))},title:"Add child task","aria-label":"Add child task",className:Be.addChildButton,children:"+"})]}),c.jsx(Wn,{children:b&&v&&c.jsx(Nt.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(C=>c.jsx(r_,{node:C,depth:a+1,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:f,taskStatusById:u,titleHighlights:p,workspaceNames:m},C.id))})})]})}function O2(){const{workspaces:n,tasks:a}=ut(),i=$t(),[o,r]=_.useState(new Set),[f,u]=_.useState(new Set),[p,m]=_.useState(M0),[g,y]=_.useState(M0),[v,b]=_.useState(new Map),S=Mt("/tasks/:taskId/*"),k=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,E=_.useMemo(()=>new Map(a.map(Q=>[Q.id,Q.status])),[a]),N=_.useMemo(()=>new Map(n.map(Q=>[Q.id,Q.name])),[n]),C=()=>{const Q=!p;M2(Q),m(Q),Q&&(y(!0),b(new Map))},A=Q=>{b(ie=>{const I=new Map(ie),D=I.has(Q)?I.get(Q):g;return I.set(Q,!D),I})},O=Q=>v.has(Q)?v.get(Q):g,B=Q=>{r(ie=>{const I=new Set(ie);return I.has(Q)?(I.delete(Q),u(D=>new Set(D).add(Q))):(I.add(Q),u(D=>{const ne=new Set(D);return ne.delete(Q),ne})),I})};_.useEffect(()=>{const Q=new Set(a.filter(ie=>ie.parentTaskId).map(ie=>ie.parentTaskId));Q.size>0&&r(ie=>{const I=new Set(ie);for(const D of Q)f.has(D)||I.add(D);return I})},[a,f]);const[U,q]=_.useState(""),{directMatchTaskIds:M,treeMatchTaskIds:R,titleHighlights:F}=_.useMemo(()=>{if(!U.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const Q=Xw(a,U,w2),ie=new Set(Q.map(oe=>oe.item.id)),I=new Map;for(const oe of Q){const z=oe.matches.find(J=>J.key==="title");z&&I.set(oe.item.id,z.indices)}const D=new Set(ie),ne=new Map(a.map(oe=>[oe.id,oe]));for(const oe of[...ie]){let z=ne.get(oe);for(;z!=null&&z.parentTaskId;)D.add(z.parentTaskId),z=ne.get(z.parentTaskId)}return{directMatchTaskIds:ie,treeMatchTaskIds:D,titleHighlights:I}},[U,a]),ee=M!==null,te=ee?p?M:R:null,se=te?a.filter(Q=>te.has(Q.id)):a,re=p?[]:a2(se);return c.jsxs("div",{className:Be.container,children:[c.jsxs("div",{className:Be.header,children:[c.jsx("span",{children:"Tasks"}),c.jsxs("div",{className:Be.headerActions,children:[c.jsx("button",{className:`${Be.groupToggle} ${p?Be.groupToggleActive:""}`,onClick:C,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,title:p?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),c.jsx("button",{className:Be.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:U,onChange:Q=>q(Q.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Be.searchInput,"data-testid":"sidebar-search"}),p?s2(se,E).map(Q=>c.jsx(R2,{group:Q,isExpanded:O(Q.status),onToggle:()=>A(Q.status),selectedTaskId:k,navigate:i,titleHighlights:F,workspaceNames:N},Q.status)):re.map(Q=>c.jsx(r_,{node:Q,depth:0,expandedTasks:o,toggleTask:B,selectedTaskId:k,navigate:i,taskStatusById:E,titleHighlights:F,workspaceNames:N},Q.id)),se.length===0&&!ee&&c.jsx("div",{className:Be.emptyState,children:"No tasks yet. Click + to create one."}),se.length===0&&ee&&c.jsx("div",{className:Be.emptyState,children:"No matching tasks"})]})}const B2="_nav_14i94_1",I2="_tab_14i94_24",L2="_tabActive_14i94_62",U2="_tabLabel_14i94_75",z2="_statusDot_14i94_81",V2="_pulse_14i94_87",H2="_addButton_14i94_99",G2="_empty_14i94_132",Wa={nav:B2,tab:I2,tabActive:L2,tabLabel:U2,statusDot:z2,pulse:V2,addButton:H2,empty:G2},P2={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function F2(){const{environments:n}=ut(),a=$t(),i=_.useRef(null),o=Mt("/environments/:environmentId"),r=Mt("/environments/:environmentId/edit"),f=(o==null?void 0:o.params.environmentId)??(r==null?void 0:r.params.environmentId),u=f==="new"?void 0:f,p=_.useCallback(y=>{a(yf(y))},[a]),m=_.useCallback(y=>{var E;const v=(E=i.current)==null?void 0:E.querySelectorAll('[role="tab"]');if(!v||v.length===0)return;const b=Array.from(v).findIndex(N=>N===document.activeElement),S=b>=0?b:n.findIndex(N=>N.id===u);let k=S;if(y.key==="ArrowDown")y.preventDefault(),k=(S+1)%v.length;else if(y.key==="ArrowUp")y.preventDefault(),k=(S-1+v.length)%v.length;else if(y.key==="Home")y.preventDefault(),k=0;else if(y.key==="End")y.preventDefault(),k=v.length-1;else return;k<n.length&&a(yf(n[k].id)),v[k].focus()},[u,n,a]),g=u??(n.length>0?n[0].id:void 0);return c.jsxs("div",{className:Wa.nav,"data-testid":"environment-nav",children:[c.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:m,children:n.map(y=>{const v=y.id===u,b=y.id===g,S=P2[y.status]||"var(--text-tertiary)",k=y.status==="connected";return c.jsxs("button",{role:"tab",type:"button","aria-selected":v,tabIndex:b?0:-1,className:`${Wa.tab} ${v?Wa.tabActive:""}`,onClick:()=>p(y.id),"data-testid":"env-nav-item",children:[c.jsx("span",{className:`${Wa.statusDot} ${k?Wa.pulse:""}`,style:{color:S},children:"●"}),c.jsx("span",{className:Wa.tabLabel,title:y.displayName||y.id,children:y.displayName||y.id})]},y.id)})}),c.jsx("button",{type:"button",className:Wa.addButton,onClick:()=>a(VC),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),n.length===0&&c.jsx("div",{className:Wa.empty,children:"No environments yet."})]})}const $2="_nav_1bhou_1",q2="_tab_1bhou_24",Y2="_tabIcon_1bhou_62",K2="_tabActive_1bhou_68",Pr={nav:$2,tab:q2,tabIcon:Y2,tabActive:K2},ba=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function Z2(){var u;const n=Rt(),a=$t(),i=_.useRef(null),o=((u=ba.find(p=>n.pathname===`${Ql}/${p.path}`))==null?void 0:u.path)??ba[0].path,r=_.useCallback(p=>{a(`${Ql}/${p}`)},[a]),f=_.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(E=>E===document.activeElement),y=g>=0?g:ba.findIndex(E=>E.path===o);let v=y;if(p.key==="ArrowDown")p.preventDefault(),v=(y+1)%ba.length;else if(p.key==="ArrowUp")p.preventDefault(),v=(y-1+ba.length)%ba.length;else if(p.key==="Home")p.preventDefault(),v=0;else if(p.key==="End")p.preventDefault(),v=ba.length-1;else return;const b=ba[v].path;a(`${Ql}/${b}`),(k=m[v])==null||k.focus()},[o,a]);return c.jsx("nav",{className:Pr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:f,children:ba.map(p=>{const m=p.path===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Pr.tab} ${m?Pr.tabActive:""}`,onClick:()=>r(p.path),children:[c.jsx("span",{className:Pr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const X2="_container_pi6ii_1",Q2="_content_pi6ii_66",R0={container:X2,content:Q2},W2=320,c_=220,u_=600,d_="grackle-sidebar-width";function J2(){try{const n=localStorage.getItem(d_);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=c_&&a<=u_)return a}}catch{}return W2}function eD(n){try{localStorage.setItem(d_,String(n))}catch{}}function tD(){const[n]=_.useState(J2),a=_.useRef(null),i=Rt(),o=xb(i.pathname);return _.useEffect(()=>{const r=a.current;if(!r)return;const f=new ResizeObserver(u=>{for(const p of u){const m=p.borderBoxSize[0];if(m){const g=Math.round(m.inlineSize);g>=c_&&g<=u_&&eD(g)}}});return f.observe(r),()=>{f.disconnect()}},[]),c.jsx("div",{className:R0.container,ref:a,"data-testid":"sidebar",style:{width:n},children:c.jsxs("div",{className:R0.content,children:[o==="tasks"&&c.jsx(O2,{}),o==="environments"&&c.jsx(F2,{}),o==="settings"&&c.jsx(Z2,{})]})})}const nD="_bar_8ghh5_1",aD="_input_8ghh5_74",sD="_select_8ghh5_178",iD="_btnPrimary_8ghh5_214",lD="_btnDanger_8ghh5_245",oD="_btnGhost_8ghh5_284",rD="_badge_8ghh5_312",cD="_statusText_8ghh5_322",uD="_statusCompleted_8ghh5_327",dD="_statusFailed_8ghh5_331",fD="_statusBlocked_8ghh5_335",hD="_hintText_8ghh5_340",pD="_disconnectHint_8ghh5_359",Ce={bar:nD,input:aD,select:sD,btnPrimary:iD,btnDanger:lD,btnGhost:oD,badge:rD,statusText:cD,statusCompleted:uD,statusFailed:dD,statusBlocked:fD,hintText:hD,disconnectHint:pD};function rf(n,a){if(!n)return!1;const i=a.find(o=>o.id===n);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function cf({environmentId:n,onReconnect:a}){return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:Ce.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),c.jsx("button",{type:"button",onClick:()=>a(n),className:Ce.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function mD(){const{spawn:n,sendInput:a,kill:i,sessions:o,tasks:r,environments:f,personas:u,provisionEnvironment:p,startTask:m,taskSessions:g}=ut(),{showToast:y}=Fi(),v=$t(),b=Rt(),[S]=ub(),k=Mt("/sessions/:sessionId"),E=Mt("/tasks/:taskId"),N=Mt("/tasks/:taskId/stream"),C=Mt("/tasks/:taskId/findings"),A=Mt("/tasks/:taskId/edit"),O=Mt("/workspaces/:workspaceId/tasks/:taskId"),B=Mt("/workspaces/:workspaceId/tasks/:taskId/stream"),U=Mt("/workspaces/:workspaceId/tasks/:taskId/findings"),q=Mt("/workspaces/:workspaceId/tasks/:taskId/edit"),M=Mt("/sessions/new"),R=b.pathname.startsWith("/environments"),F=Mt("/workspaces/:workspaceId"),ee=Mt("/tasks/new"),te=Mt("/chat"),se=Mt("/"),re=Mt("/settings/*"),Q=k==null?void 0:k.params.sessionId,ie=(E==null?void 0:E.params.taskId)??(N==null?void 0:N.params.taskId)??(C==null?void 0:C.params.taskId)??(O==null?void 0:O.params.taskId)??(B==null?void 0:B.params.taskId)??(U==null?void 0:U.params.taskId)??(q==null?void 0:q.params.taskId),I=!!te,D=!!M,ne=!!F&&!O&&!B&&!U&&!q,oe=!!ee,z=!!A||!!q,J=!!se&&!D&&!ne&&!oe,Se=!!re,ae=D?S.get("env")??"":"",[pe,qe]=_.useState(""),[Ot,vn]=_.useState(""),_t=Q?o.find(Ze=>Ze.id===Q):void 0,ge=ie?r.find(Ze=>Ze.id===ie):void 0,dt=(ge==null?void 0:ge.latestSessionId)||void 0,On=dt?o.find(Ze=>Ze.id===dt):void 0,Jn=ge?ge.dependsOn.some(Ze=>{const Te=r.find(et=>et.id===Ze);return Te&&Te.status!=="complete"}):!1;if(I){const Ze=r.find(Le=>Le.id===Bs),Te=Ze!=null&&Ze.latestSessionId?o.find(Le=>Le.id===Ze.latestSessionId)??(g[Bs]??[]).find(Le=>Le.id===Ze.latestSessionId):void 0,et=f.find(Le=>Le.adapterType==="local"&&Le.status==="connected");if(!et)return c.jsx("div",{className:Ce.bar,children:c.jsx("span",{className:Ce.hintText,children:"Add a local environment to start chatting"})});if(Te&&!["completed","failed","interrupted","hibernating"].includes(Te.status)){const Le=rf(Te.environmentId,f),zn=Vn=>{Vn.preventDefault(),!(!pe.trim()||Le)&&(a(Te.id,pe),qe(""))};return c.jsxs("form",{onSubmit:zn,className:Ce.bar,children:[Le&&Te.environmentId&&c.jsx(cf,{environmentId:Te.environmentId,onReconnect:p}),c.jsx("input",{type:"text",value:pe,onChange:Vn=>qe(Vn.target.value),placeholder:"Type a message...",autoFocus:!Le,disabled:Le,className:Ce.input}),c.jsx("span",{title:Le?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!pe.trim()||Le,className:Ce.btnPrimary,children:"Send"})}),c.jsx("button",{type:"button",onClick:()=>i(Te.id),className:Ce.btnDanger,title:"Stop session",children:"Stop"})]})}const yn=Le=>{Le.preventDefault(),pe.trim()&&(m(Bs,void 0,et.id,pe),qe(""))};return c.jsxs("form",{onSubmit:yn,className:Ce.bar,children:[c.jsx("input",{type:"text",value:pe,onChange:Le=>qe(Le.target.value),placeholder:"Type a message...",autoFocus:!0,className:Ce.input}),c.jsx("button",{type:"submit",disabled:!pe.trim(),className:Ce.btnPrimary,children:"Send"})]})}if(J||Se)return c.jsx(c.Fragment,{});if(z||oe||R)return c.jsx(c.Fragment,{});if(ne)return c.jsx("div",{className:Ce.bar,children:c.jsx("span",{className:Ce.hintText,children:"Select a task or click + to create one"})});if(ie&&ge){if(ge.status==="not_started"){const Ze=Jn?ge.dependsOn.map(Te=>r.find(et=>et.id===Te)).filter(Te=>Te&&Te.status!=="complete").map(Te=>Te.title):[];return c.jsx("div",{className:Ce.bar,children:Jn?c.jsxs("span",{className:Ce.statusBlocked,children:["Blocked by: ",Ze.join(", ")]}):c.jsx("span",{className:Ce.hintText,children:"Use the buttons above to start or manage this task"})})}if(ge.status==="working"||ge.status==="paused"){if(On&&!["completed","failed","interrupted","hibernating"].includes(On.status)){const Te=On.environmentId,et=rf(Te,f),yn=Le=>{Le.preventDefault();const zn=ge.latestSessionId||dt;!pe.trim()||!zn||et||(a(zn,pe),qe(""))};return c.jsxs("form",{onSubmit:yn,className:Ce.bar,children:[et&&Te&&c.jsx(cf,{environmentId:Te,onReconnect:p}),c.jsx("input",{type:"text",value:pe,onChange:Le=>qe(Le.target.value),placeholder:"Type a message...",autoFocus:!et,disabled:et,className:Ce.input}),c.jsx("span",{title:et?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!pe.trim()||et,className:Ce.btnPrimary,children:"Send"})})]})}return c.jsx("div",{className:Ce.bar,children:c.jsx("span",{className:Ce.hintText,children:"Waiting for agent..."})})}if(ge.status==="complete")return c.jsxs("div",{className:Ce.bar,children:[c.jsx("span",{className:`${Ce.statusText} ${Ce.statusCompleted}`,children:"Task completed"}),c.jsx("button",{onClick:()=>v(Pi(ge.workspaceId)),className:Ce.btnPrimary,children:"+ New Task"})]});if(ge.status==="failed")return c.jsx("div",{className:Ce.bar,children:c.jsx("span",{className:`${Ce.statusText} ${Ce.statusFailed}`,children:"Task failed"})})}if(D){const Ze=Te=>{Te.preventDefault(),!(!pe.trim()||!ae)&&(n(ae,pe,Ot),y("Session started","success"),qe(""),vn(""))};return c.jsxs("form",{onSubmit:Ze,className:Ce.bar,children:[c.jsx("span",{className:Ce.badge,children:"new chat"}),c.jsx("input",{type:"text",value:pe,onChange:Te=>qe(Te.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:Ce.input}),c.jsxs("select",{value:Ot,onChange:Te=>vn(Te.target.value),className:Ce.select,children:[c.jsx("option",{value:"",children:"(Default)"}),u.map(Te=>c.jsx("option",{value:Te.id,children:Te.name},Te.id))]}),c.jsx("button",{type:"submit",disabled:!pe.trim()||!ae,className:Ce.btnPrimary,children:"Go"})]})}if(Q){const Ze=_t!==void 0&&["completed","failed","interrupted","hibernating"].includes(_t.status);if(_t!==void 0&&!Ze){const et=rf(_t.environmentId,f),yn=Le=>{Le.preventDefault(),!(!pe.trim()||et)&&(a(Q,pe),qe(""))};return c.jsxs("form",{onSubmit:yn,className:Ce.bar,children:[et&&_t.environmentId&&c.jsx(cf,{environmentId:_t.environmentId,onReconnect:p}),c.jsx("input",{type:"text",value:pe,onChange:Le=>qe(Le.target.value),placeholder:"Type a message...",autoFocus:!et,disabled:et,className:Ce.input}),c.jsx("span",{title:et?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!pe.trim()||et,className:Ce.btnPrimary,children:"Send"})}),c.jsx("button",{type:"button",onClick:()=>i(Q),className:Ce.btnDanger,title:"Stop session",children:"Stop"})]})}if(Ze)return c.jsxs("div",{className:Ce.bar,children:[c.jsxs("span",{className:`${Ce.statusText} ${Ce.hintText}`,children:["Session ",_t.status]}),c.jsx("button",{onClick:()=>v(fb(_t.environmentId)),className:Ce.btnPrimary,children:"+ New Chat"})]})}return c.jsx("div",{className:Ce.bar,children:c.jsx("span",{className:Ce.hintText,children:"Loading..."})})}const gD="_toast_da8ll_1",vD="_success_da8ll_18",yD="_icon_da8ll_22",bD="_error_da8ll_25",xD="_warning_da8ll_32",_D="_info_da8ll_38",SD="_message_da8ll_53",TD="_close_da8ll_60",Fl={toast:gD,success:vD,icon:yD,error:bD,warning:xD,info:_D,message:SD,close:TD},CD={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function kD({toast:n,onDismiss:a}){return _.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),c.jsxs(Nt.div,{className:`${Fl.toast} ${Fl[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:Fl.icon,"aria-hidden":"true",children:CD[n.variant]}),c.jsx("span",{className:Fl.message,children:n.message}),c.jsx("button",{type:"button",className:Fl.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const ED="_container_qqse2_1",ND={container:ED};function AD(){const{toasts:n,dismissToast:a}=Fi();return c.jsx("div",{className:ND.container,"data-testid":"toast-container",children:c.jsx(Wn,{children:n.map(i=>c.jsx(kD,{toast:i,onDismiss:a},i.id))})})}const jD="_breadcrumbs_17or2_1",wD="_list_17or2_11",DD="_item_17or2_21",MD="_separator_17or2_28",RD="_link_17or2_34",OD="_current_17or2_57",Ei={breadcrumbs:jD,list:wD,item:DD,separator:MD,link:RD,current:OD},BD="›";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 o=i===n.length-1;return c.jsxs("li",{className:Ei.item,children:[i>0&&c.jsx("span",{className:Ei.separator,"aria-hidden":"true",children:BD}),a.url&&!o?c.jsx(nh,{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 $f(){$f=function(r,f){return new i(r,void 0,f)};var n=RegExp.prototype,a=new WeakMap;function i(r,f,u){var p=new RegExp(r,f);return a.set(p,u||a.get(r)),fc(p,i.prototype)}function o(r,f){var u=a.get(f);return Object.keys(u).reduce(function(p,m){var g=u[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,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(f&&f.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),f&&fc(r,f)})(i,RegExp),i.prototype.exec=function(r){var f=n.exec.call(this,r);if(f){f.groups=o(f,this);var u=f.indices;u&&(u.groups=o(u,this))}return f},i.prototype[Symbol.replace]=function(r,f){if(typeof f=="string"){var u=a.get(this);return n[Symbol.replace].call(this,r,f.replace(/\$<([^>]+)>/g,function(m,g){var y=u[g];return"$"+(Array.isArray(y)?y.join("$"):y)}))}if(typeof f=="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(o(m,p)),f.apply(this,m)})}return n[Symbol.replace].call(this,r,f)},$f.apply(this,arguments)}function fc(n,a){return fc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},fc(n,a)}function O0(n,a){(a==null||a>n.length)&&(a=n.length);for(var i=0,o=new Array(a);i<a;i++)o[i]=n[i];return o}function uf(n,a){var i=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i)return(i=i.call(n)).next.bind(i);if(Array.isArray(n)||(i=(function(r,f){if(r){if(typeof r=="string")return O0(r,f);var u=Object.prototype.toString.call(r).slice(8,-1);return u==="Object"&&r.constructor&&(u=r.constructor.name),u==="Map"||u==="Set"?Array.from(r):u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u)?O0(r,f):void 0}})(n))||a){i&&(n=i);var o=0;return function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
87
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ID=(function(n){return function(a){return a===void 0&&(a={}),(function(o,r){if(r&&!o.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(n,a.defaultLanguage),function(o){MS(o,"element",i)};function i(o,r,f){var u,p;if(f&&f.tagName==="pre"&&o.tagName==="code"){var m=(o==null||(u=o.data)==null?void 0:u.meta)||(o==null||(p=o.properties)==null?void 0:p.metastring)||"";o.properties.className?typeof o.properties.className=="boolean"?o.properties.className=[]:Array.isArray(o.properties.className)||(o.properties.className=[o.properties.className]):o.properties.className=[];var g,y,v=(function(U){for(var q,M=uf(U.properties.className);!(q=M()).done;){var R=q.value;if(R.slice(0,9)==="language-")return R.slice(9).toLowerCase()}return null})(o);if(!v&&a.defaultLanguage&&o.properties.className.push("language-"+(v=a.defaultLanguage)),o.properties.className.push("code-highlight"),v)try{var b,S;S=(b=v)!=null&&b.includes("diff-")?v.split("-")[1]:v,g=n.highlight(Ir(o),S),f.properties.className=(f.properties.className||[]).concat("language-"+S)}catch(U){if(!a.ignoreMissing||!/Unknown language/.test(U.message))throw U;g=o}else g=o;g.children=(y=1,function U(q){return q.reduce(function(M,R){if(R.type==="text"){var F=R.value,ee=(F.match(/\n/g)||"").length;if(ee===0)R.position={start:{line:y,column:1},end:{line:y,column:1}},M.push(R);else for(var te,se=F.split(`
88
- `),re=uf(se.entries());!(te=re()).done;){var Q=te.value,ie=Q[0],I=Q[1];M.push({type:"text",value:ie===se.length-1?I:I+`
89
- `,position:{start:{line:y+ie,column:1},end:{line:y+ie,column:1}}})}return y+=ee,M}if(Object.prototype.hasOwnProperty.call(R,"children")){var D=y;return R.children=U(R.children),M.push(R),R.position={start:{line:D,column:1},end:{line:y,column:1}},M}return M.push(R),M},[])})(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,E=(function(U){var q=/{([\d,-]+)}/,M=U.split(",").map(function(ee){return ee.trim()}).join();if(q.test(M)){var R=q.exec(M)[1],F=OS(R);return function(ee){return F.includes(ee+1)}}return function(){return!1}})(m),N=(function(U){var q=$f(/showLineNumbers=(\d+)/i,{lines:1});if(q.test(U)){var M=q.exec(U);return Number(M.groups.lines)}return 1})(m),C=(function(U){for(var q=new Array(U),M=0;M<U;M++)q[M]={type:"element",tagName:"span",properties:{className:[]},children:[]};return q})(g.position.end.line),A=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],O=function(){var U,q,M=k.value,R=M[0],F=M[1];F.properties.className=["code-line"];var ee=BS(g,function(te){return te.position.start.line<=R+1&&te.position.end.line>=R+1});F.children=ee.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(v))&&!A.some(function(te){return m.toLowerCase().includes(te)})&&(F.properties.line=[(R+N).toString()],F.properties.className.push("line-number")),E(R)&&F.properties.className.push("highlight-line"),(v==="diff"||(U=v)!=null&&U.includes("diff-"))&&Ir(F).substring(0,1)==="-"?F.properties.className.push("deleted"):(v==="diff"||(q=v)!=null&&q.includes("diff-"))&&Ir(F).substring(0,1)==="+"&&F.properties.className.push("inserted")},B=uf(C.entries());!(k=B()).done;)O();C.length>0&&Ir(C[C.length-1]).trim()===""&&C.pop(),o.children=C}}}})(RS);const LD="_systemContextEvent_5vmgk_1",UD="_systemContextHeader_5vmgk_7",zD="_systemContextBadge_5vmgk_28",VD="_systemContextToggle_5vmgk_37",HD="_systemContextPre_5vmgk_43",GD="_systemContextEllipsis_5vmgk_54",PD="_systemEvent_5vmgk_58",FD="_systemTimestamp_5vmgk_65",$D="_textEvent_5vmgk_69",qD="_toolUseEvent_5vmgk_155",YD="_toolUseHeader_5vmgk_175",KD="_toolUsePrefix_5vmgk_182",ZD="_toolUseName_5vmgk_187",XD="_toolUseArgs_5vmgk_192",QD="_toolResultEvent_5vmgk_203",WD="_toolResultHeader_5vmgk_208",JD="_toolResultIndicatorOk_5vmgk_232",eM="_toolResultIndicatorError_5vmgk_239",tM="_toolResultLabel_5vmgk_246",nM="_toolResultToggle_5vmgk_250",aM="_toolResultCommand_5vmgk_256",sM="_toolResultEllipsis_5vmgk_266",iM="_toolResultPre_5vmgk_270",lM="_errorEvent_5vmgk_291",oM="_statusEvent_5vmgk_299",rM="_userInputEvent_5vmgk_308",cM="_userInputContent_5vmgk_314",uM="_signalEvent_5vmgk_331",dM="_signalBadge_5vmgk_342",fM="_signalContent_5vmgk_351",hM="_defaultEvent_5vmgk_356",Ge={systemContextEvent:LD,systemContextHeader:UD,systemContextBadge:zD,systemContextToggle:VD,systemContextPre:HD,systemContextEllipsis:GD,systemEvent:PD,systemTimestamp:FD,textEvent:$D,toolUseEvent:qD,toolUseHeader:YD,toolUsePrefix:KD,toolUseName:ZD,toolUseArgs:XD,toolResultEvent:QD,toolResultHeader:WD,toolResultIndicatorOk:JD,toolResultIndicatorError:eM,toolResultLabel:tM,toolResultToggle:nM,toolResultCommand:aM,toolResultEllipsis:sM,toolResultPre:iM,errorEvent:lM,statusEvent:oM,userInputEvent:rM,userInputContent:cM,signalEvent:uM,signalBadge:dM,signalContent:fM,defaultEvent:hM},B0=3;function pM({content:n}){const[a,i]=_.useState(!1),o=n.split(`
90
- `),r=o.length>B0,f=a?n:o.slice(0,B0).join(`
91
- `);return c.jsxs("div",{className:Ge.systemContextEvent,"data-testid":"system-context-event",children:[c.jsxs("button",{type:"button",className:Ge.systemContextHeader,onClick:()=>{i(u=>!u)},"aria-expanded":a,children:[c.jsx("span",{className:Ge.systemContextBadge,children:"SYSTEM PROMPT"}),r&&c.jsx("span",{className:Ge.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),c.jsxs("pre",{className:Ge.systemContextPre,children:[f,!a&&r&&c.jsx("span",{className:Ge.systemContextEllipsis,children:"…"})]})]})}function mM({time:n,content:a}){return c.jsxs("div",{className:Ge.systemEvent,children:[c.jsxs("span",{className:Ge.systemTimestamp,children:["[",n,"]"]})," ",a]})}function gM({content:n}){return c.jsx("div",{className:Ge.textEvent,children:c.jsx(Yf,{remarkPlugins:[Kf],rehypePlugins:[ID],children:n})})}function vM({content:n}){let a="",i=n;try{const o=JSON.parse(n);a=o.tool||"",i=JSON.stringify(o.args,null,2)}catch{}return c.jsxs("div",{className:Ge.toolUseEvent,children:[c.jsxs("div",{className:Ge.toolUseHeader,children:[c.jsx("span",{className:Ge.toolUsePrefix,children:">"}),a?c.jsx("span",{className:Ge.toolUseName,children:a}):null]}),c.jsx("pre",{className:Ge.toolUseArgs,children:i})]})}const I0=5;function yM(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 o=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${o}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const o=JSON.stringify(a);return o.length>150?`${o.slice(0,150)}…`:o}catch{return""}}function bM({content:n,raw:a,toolUseCtx:i}){const[o,r]=_.useState(!1);let f=!1;if(a)try{f=JSON.parse(a).is_error===!0}catch{}const u=n.split(`
92
- `),p=u.length>I0,m=o?n:u.slice(0,I0).join(`
93
- `),y=((i==null?void 0:i.tool)??"")||(f?"Tool error":"Tool output"),v=i?yM(i.tool,i.args):"",b=c.jsxs(c.Fragment,{children:[c.jsx("span",{className:f?Ge.toolResultIndicatorError:Ge.toolResultIndicatorOk,"aria-label":f?"error":"success","data-testid":f?"tool-result-indicator-error":"tool-result-indicator-ok",children:f?"✗":"✓"}),c.jsx("span",{className:Ge.toolResultLabel,"data-testid":"tool-result-label",children:y}),p&&c.jsx("span",{className:Ge.toolResultToggle,"aria-hidden":"true",children:o?"▾":"▸"})]});return c.jsxs("div",{className:Ge.toolResultEvent,"data-testid":"tool-result",children:[p?c.jsx("button",{className:Ge.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{r(S=>!S)},"aria-expanded":o,children:b}):c.jsx("div",{className:Ge.toolResultHeader,"data-testid":"tool-result-header",children:b}),v&&c.jsx("div",{className:Ge.toolResultCommand,children:v}),c.jsxs("pre",{className:Ge.toolResultPre,"data-testid":"tool-result-content",children:[m,!o&&p&&c.jsx("span",{className:Ge.toolResultEllipsis,children:"…"})]})]})}function xM({content:n}){return c.jsxs("div",{className:Ge.errorEvent,children:["Error: ",n]})}function _M({content:n}){return c.jsxs("div",{className:Ge.statusEvent,children:["--- ",n," ---"]})}function SM({content:n}){return c.jsx("div",{className:Ge.userInputEvent,children:c.jsx("span",{className:Ge.userInputContent,children:n})})}function TM({content:n}){return c.jsxs("div",{className:Ge.signalEvent,"data-testid":"signal-event",children:[c.jsx("span",{className:Ge.signalBadge,children:"SIGNAL"}),c.jsx("span",{className:Ge.signalContent,children:n})]})}function CM({content:n}){return c.jsx("div",{className:Ge.defaultEvent,children:n})}function kM({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(pM,{content:n.content})}catch{}return c.jsx(mM,{time:i,content:n.content})}case"text":case"output":return c.jsx(gM,{content:n.content});case"tool_use":return c.jsx(vM,{content:n.content});case"tool_result":return c.jsx(bM,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return c.jsx(xM,{content:n.content});case"status":return c.jsx(_M,{content:n.content});case"user_input":return c.jsx(SM,{content:n.content});case"signal":return c.jsx(TM,{content:n.content});default:return c.jsx(CM,{content:n.content})}}const EM="_overlay_cmicx_1",NM="_dialog_cmicx_11",AM="_title_cmicx_30",jM="_description_cmicx_38",wM="_actions_cmicx_45",DM="_cancelButton_cmicx_52",MM="_confirmButton_cmicx_79",js={overlay:EM,dialog:NM,title:AM,description:jM,actions:wM,cancelButton:DM,confirmButton:MM};function Cc({isOpen:n,title:a,description:i,confirmLabel:o="Delete",onConfirm:r,onCancel:f}){const u=_.useId(),p=_.useId();return c.jsx(Wn,{children:n&&c.jsx(Nt.div,{className:js.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:f,onKeyDown:m=>{m.key==="Escape"&&f()},role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":i?p:void 0,children:c.jsxs(Nt.div,{className:js.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:u,className:js.title,children:a}),i&&c.jsx("p",{id:p,className:js.description,children:i}),c.jsxs("div",{className:js.actions,children:[c.jsx("button",{type:"button",className:js.cancelButton,onClick:f,autoFocus:!0,children:"Cancel"}),c.jsx("button",{type:"button",className:js.confirmButton,onClick:r,children:o})]})]})})})}const RM="_spinner_1uyt1_1",OM="_spin_1uyt1_1",BM="_sm_1uyt1_14",IM="_md_1uyt1_20",LM="_lg_1uyt1_26",UM="_xl_1uyt1_32",L0={spinner:RM,spin:OM,sm:BM,md:IM,lg:LM,xl:UM};function Hh({size:n="md",className:a,label:i="Loading",liveRegion:o=!1}){return c.jsx("span",{className:`${L0.spinner} ${L0[n]} ${a??""}`,role:o?"status":void 0,"aria-label":i,"aria-hidden":o?void 0:!0})}const zM="_splash_1bn1g_1",VM="_logo_1bn1g_11",U0={splash:zM,logo:VM};function HM(){return c.jsxs("div",{className:U0.splash,"data-testid":"splash-screen",children:[c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:U0.logo}),c.jsx(Hh,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function GM(n,a){const i=_.useRef(null);_.useEffect(()=>{const o=i.current;if(i.current=n,o===null)return;const r=new Map;for(const u of o)r.set(u.id,u);const f=new Set;for(const u of n){f.add(u.id);const p=r.get(u.id);if(p&&p.status!==u.status&&u.status!=="sleeping"){if(u.status==="connecting"){a("Provisioning environment…","info");continue}u.status==="connected"?a("Environment connected","success"):u.status==="error"?a("Environment provision failed","error"):u.status==="disconnected"&&(p.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const u of o)f.has(u.id)||a("Environment removed","info")},[n,a])}function PM(n,a,i){const o=n.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,r=f_(a),f=a.filter(m=>qf(m,r)).length,u=a.filter(m=>m.status==="paused"||m.status==="failed"||qf(m,r)).length,p=i.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:o,blockedTasks:f,attentionTasks:u,unhealthyEnvironments:p}}function f_(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function qf(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function FM(n,a){var u;const i=new Map;for(const p of a)i.set(p.id,p);const o=f_(n),r=[];for(const p of n){const m=p.workspaceId?((u=i.get(p.workspaceId))==null?void 0:u.name)??"Unknown":"Unknown";p.status==="failed"?r.push({task:p,reason:"failed",workspaceName:m}):qf(p,o)?r.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&r.push({task:p,reason:"paused",workspaceName:m})}const f={failed:0,blocked:1,paused:2};return r.sort((p,m)=>(f[p.reason]??3)-(f[m.reason]??3)),r}function $M(n,a){const i=new Map;for(const o of a)i.set(o.id,o);return n.filter(o=>o.status==="running"||o.status==="idle"||o.status==="waiting").map(o=>{var r;return{session:o,environmentName:((r=i.get(o.environmentId))==null?void 0:r.displayName)??"Unknown"}})}function qM(n,a,i){const o=new Map;for(const r of a){if(!r.workspaceId)continue;let f=o.get(r.workspaceId);f||(f={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},o.set(r.workspaceId,f)),f.totalTasks+=1,r.status==="complete"?f.completedTasks+=1:r.status==="working"?f.workingTasks+=1:r.status==="failed"&&(f.failedTasks+=1)}return n.map(r=>{const f=o.get(r.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:r,totalTasks:f.totalTasks,completedTasks:f.completedTasks,workingTasks:f.workingTasks,failedTasks:f.failedTasks}})}const YM="_dashboard_1avpn_1",KM="_kpiStrip_1avpn_11",ZM="_kpiCard_1avpn_23",XM="_kpiValue_1avpn_68",QM="_kpiLabel_1avpn_76",WM="_bodyGrid_1avpn_84",JM="_section_1avpn_96",eR="_sectionHeader_1avpn_109",tR="_sectionIcon_1avpn_118",nR="_sectionTitle_1avpn_123",aR="_sectionCount_1avpn_131",sR="_sectionBody_1avpn_138",iR="_emptyHint_1avpn_143",lR="_sessionRow_1avpn_150",oR="_sessionPrompt_1avpn_177",rR="_sessionEnv_1avpn_186",cR="_sessionRuntime_1avpn_192",uR="_sessionStatus_1avpn_198",dR="_statusDot_1avpn_207",fR="_attentionRow_1avpn_229",hR="_attentionTitle_1avpn_255",pR="_attentionMeta_1avpn_263",mR="_reasonBadge_1avpn_270",gR="_bottomGrid_1avpn_297",vR="_envRow_1avpn_308",yR="_envName_1avpn_319",bR="_envStatusBadge_1avpn_329",xR="_workspaceRow_1avpn_365",_R="_workspaceTop_1avpn_391",SR="_workspaceName_1avpn_397",TR="_workspaceCounts_1avpn_403",CR="_progressBar_1avpn_411",kR="_progressFill_1avpn_418",me={dashboard:YM,kpiStrip:KM,kpiCard:ZM,kpiValue:XM,kpiLabel:QM,bodyGrid:WM,section:JM,sectionHeader:eR,sectionIcon:tR,sectionTitle:nR,sectionCount:aR,sectionBody:sR,emptyHint:iR,sessionRow:lR,sessionPrompt:oR,sessionEnv:rR,sessionRuntime:cR,sessionStatus:uR,statusDot:dR,attentionRow:fR,attentionTitle:hR,attentionMeta:pR,reasonBadge:mR,bottomGrid:gR,envRow:vR,envName:yR,envStatusBadge:bR,workspaceRow:xR,workspaceTop:_R,workspaceName:SR,workspaceCounts:TR,progressBar:CR,progressFill:kR},ER={hidden:{opacity:0,y:12},visible:n=>({opacity:1,y:0,transition:{delay:n*.06,duration:.3,ease:"easeOut"}})},Fr={hidden:{opacity:0,y:16},visible:n=>({opacity:1,y:0,transition:{delay:.15+n*.08,duration:.35,ease:"easeOut"}})};function NR(n,a,i,o){const r=[`${n} of ${a} tasks completed`];return i>0&&r.push(`${i} in progress`),o>0&&r.push(`${o} failed`),r.join(", ")}function $r({value:n,label:a,accent:i,index:o,testId:r}){return c.jsxs(Nt.div,{className:me.kpiCard,"data-accent":i,"data-testid":r,variants:ER,initial:"hidden",animate:"visible",custom:o,children:[c.jsx("span",{className:me.kpiValue,children:n}),c.jsx("span",{className:me.kpiLabel,children:a})]})}function AR(){const{workspaces:n,tasks:a,sessions:i,environments:o,loadTasks:r}=ut(),f=$t(),u=_.useRef(new Set);_.useEffect(()=>{for(const v of n)u.current.has(v.id)||(u.current.add(v.id),r(v.id))},[n,r]);const p=_.useMemo(()=>PM(i,a,o),[i,a,o]),m=_.useMemo(()=>$M(i,o),[i,o]),g=_.useMemo(()=>FM(a,n),[a,n]),y=_.useMemo(()=>qM(n,a),[n,a,o]);return c.jsxs("div",{className:me.dashboard,"data-testid":"dashboard",children:[c.jsxs("div",{className:me.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[c.jsx($r,{value:p.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),c.jsx($r,{value:p.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),c.jsx($r,{value:p.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),c.jsx($r,{value:p.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),c.jsxs("div",{className:me.bodyGrid,children:[c.jsxs(Nt.div,{className:me.section,variants:Fr,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:()=>f(db(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(Nt.div,{className:me.section,variants:Fr,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:()=>f(Ta(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(Nt.div,{className:me.section,variants:Fr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"◈"}),c.jsx("span",{className:me.sectionTitle,children:"Environment Health"}),c.jsx("span",{className:me.sectionCount,children:o.length})]}),c.jsx("div",{className:me.sectionBody,children:o.length===0?c.jsx("div",{className:me.emptyHint,children:"No environments configured"}):o.map(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(Nt.div,{className:me.section,variants:Fr,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:E})=>{const N=b>0?Math.round(S/b*100):0;return c.jsxs("button",{type:"button",className:me.workspaceRow,onClick:()=>f(Bi(v.id)),"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":NR(S,b,k,E),children:[S,"/",b,k>0&&c.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",k]}),E>0&&c.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",E]})]})]}),b>0&&c.jsx("div",{className:me.progressBar,children:c.jsx("div",{className:me.progressFill,style:{width:`${N}%`}})})]},v.id)})})]})]})]})}const jR="_panelContainer_aei9x_1",wR="_emptyState_aei9x_8",DR="_fadeIn_aei9x_1",MR="_workspaceSummary_aei9x_17",RR="_workspaceSummaryTitle_aei9x_28",OR="_workspaceSummarySubtitle_aei9x_32",BR="_header_aei9x_36",IR="_headerInfo_aei9x_69",LR="_killButton_aei9x_75",UR="_headerTitle_aei9x_104",zR="_headerActions_aei9x_119",VR="_taskStatusBadge_aei9x_126",HR="_taskBranch_aei9x_135",GR="_taskBlockedBadge_aei9x_141",PR="_btnPrimary_aei9x_149",FR="_btnDanger_aei9x_180",$R="_btnGhost_aei9x_219",qR="_rejectInput_aei9x_245",YR="_tabBar_aei9x_275",KR="_tab_aei9x_275",ZR="_active_aei9x_301",XR="_eventScroll_aei9x_306",QR="_tabContent_aei9x_312",WR="_noContext_aei9x_317",JR="_overviewContent_aei9x_323",e3="_overviewDashboard_aei9x_332",t3="_overviewHero_aei9x_338",n3="_statusBadge_aei9x_345",a3="_statusPending_aei9x_357",s3="_statusAssigned_aei9x_362",i3="_statusInProgress_aei9x_367",l3="_statusReview_aei9x_372",o3="_statusDone_aei9x_377",r3="_statusFailed_aei9x_382",c3="_statusWaitingInput_aei9x_387",u3="_overviewBranchPill_aei9x_392",d3="_branchLink_aei9x_407",f3="_overviewSection_aei9x_418",h3="_overviewLabel_aei9x_424",p3="_overviewValue_aei9x_431",m3="_overviewMuted_aei9x_436",g3="_overviewMarkdown_aei9x_442",v3="_envRow_aei9x_511",y3="_envDot_aei9x_517",b3="_envDotGreen_aei9x_524",x3="_envDotYellow_aei9x_528",_3="_envDotRed_aei9x_532",S3="_envDotGray_aei9x_536",T3="_depList_aei9x_540",C3="_depItem_aei9x_546",k3="_depBlocked_aei9x_553",E3="_depDone_aei9x_557",N3="_timeline_aei9x_561",A3="_timelineRow_aei9x_567",j3="_timelineKey_aei9x_574",w3="_timelineValue_aei9x_580",D3="_timelineDelta_aei9x_584",M3="_reviewNotes_aei9x_595",R3="_overviewDescription_aei9x_606",O3="_waitingMessage_aei9x_612",B3="_errorMessage_aei9x_616",I3="_eventOverflowWarning_aei9x_620",L3="_attemptSelector_aei9x_634",U3="_attemptLabel_aei9x_650",z3="_attemptButton_aei9x_654",V3="_attemptActive_aei9x_671",H3="_attemptStatus_aei9x_677",G3="_emptyCta_aei9x_683",P3="_ctaTitle_aei9x_695",F3="_ctaDescription_aei9x_701",$3="_ctaButton_aei9x_708",q3="_ctaCreateForm_aei9x_743",Y3="_ctaCreateInput_aei9x_749",K3="_ctaCreateOk_aei9x_780",Z3="_ctaLink_aei9x_815",X3="_workspaceHeader_aei9x_829",Q3="_workspaceName_aei9x_854",W3="_workspaceMeta_aei9x_867",J3="_metaRow_aei9x_875",eO="_metaLabel_aei9x_888",tO="_metaValue_aei9x_903",nO="_archiveButton_aei9x_913",aO="_repoLink_aei9x_943",sO="_metaToggle_aei9x_953",iO="_metaToggleArrow_aei9x_974",lO="_metaToggleArrowOpen_aei9x_979",oO="_progressBarContainer_aei9x_983",rO="_progressBar_aei9x_983",cO="_progressFill_aei9x_999",uO="_progressLabel_aei9x_1006",dO="_metaTimestamps_aei9x_1013",fO="_metaTimestamp_aei9x_1013",V={panelContainer:jR,emptyState:wR,fadeIn:DR,workspaceSummary:MR,workspaceSummaryTitle:RR,workspaceSummarySubtitle:OR,header:BR,headerInfo:IR,killButton:LR,headerTitle:UR,headerActions:zR,taskStatusBadge:VR,taskBranch:HR,taskBlockedBadge:GR,btnPrimary:PR,btnDanger:FR,btnGhost:$R,rejectInput:qR,tabBar:YR,tab:KR,active:ZR,eventScroll:XR,tabContent:QR,noContext:WR,overviewContent:JR,overviewDashboard:e3,overviewHero:t3,statusBadge:n3,statusPending:a3,statusAssigned:s3,statusInProgress:i3,statusReview:l3,statusDone:o3,statusFailed:r3,statusWaitingInput:c3,overviewBranchPill:u3,branchLink:d3,overviewSection:f3,overviewLabel:h3,overviewValue:p3,overviewMuted:m3,overviewMarkdown:g3,envRow:v3,envDot:y3,envDotGreen:b3,envDotYellow:x3,envDotRed:_3,envDotGray:S3,depList:T3,depItem:C3,depBlocked:k3,depDone:E3,timeline:N3,timelineRow:A3,timelineKey:j3,timelineValue:w3,timelineDelta:D3,reviewNotes:M3,overviewDescription:R3,waitingMessage:O3,errorMessage:B3,eventOverflowWarning:I3,attemptSelector:L3,attemptLabel:U3,attemptButton:z3,attemptActive:V3,attemptStatus:H3,emptyCta:G3,ctaTitle:P3,ctaDescription:F3,ctaButton:$3,ctaCreateForm:q3,ctaCreateInput:Y3,ctaCreateOk:K3,ctaLink:Z3,workspaceHeader:X3,workspaceName:Q3,workspaceMeta:W3,metaRow:J3,metaLabel:eO,metaValue:tO,archiveButton:nO,repoLink:aO,metaToggle:sO,metaToggleArrow:iO,metaToggleArrowOpen:lO,progressBarContainer:oO,progressBar:rO,progressFill:cO,progressLabel:uO,metaTimestamps:dO,metaTimestamp:fO};function hO(){return c.jsx("div",{className:V.emptyState,children:"Select a task or click + to create one"})}function pO(){return c.jsx("div",{className:V.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function mO(){const{workspaces:n,environments:a,createWorkspace:i,workspaceCreating:o}=ut(),[r,f]=_.useState(!1),[u,p]=_.useState(""),m=a.length>0,g=()=>{!u.trim()||o||!m||i(u.trim(),void 0,void 0,a[0].id)};return n.length>0?c.jsx(AR,{}):c.jsxs("div",{className:V.emptyCta,"data-testid":"welcome-cta",children:[c.jsx("div",{className:V.ctaTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:V.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r?c.jsxs("div",{className:V.ctaCreateForm,children:[c.jsx("input",{type:"text",value:u,onChange:y=>p(y.target.value),onKeyDown:y=>{y.key==="Enter"?g():y.key==="Escape"&&(f(!1),p(""))},placeholder:"Workspace name...","aria-label":"Workspace name",autoFocus:!0,disabled:o,className:V.ctaCreateInput,"data-testid":"welcome-create-input"}),c.jsx("button",{onClick:g,className:V.ctaCreateOk,disabled:o,"aria-label":o?"Creating workspace":void 0,"data-testid":"welcome-create-ok",children:o?c.jsx(Hh,{size:"sm",label:"Creating workspace"}):"OK"})]}):c.jsx("button",{className:V.ctaButton,onClick:()=>f(!0),disabled:o||!m,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!m&&c.jsx("div",{className:V.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const h_=50;function gO(n,a,i,o,r=h_){return o?n<r:a-n-i<r}function vO(n,a){const i=a-n;return i>0?i:0}function yO({scrollRef:n,contentLength:a,isReversed:i}){const[o,r]=_.useState(!0),f=_.useRef(0),u=_.useRef(!1),p=_.useRef(0);_.useEffect(()=>{const g=n.current;if(!g)return;let y=!0;const v=()=>{p.current||(p.current=requestAnimationFrame(()=>{p.current=0;const b=gO(g.scrollTop,g.scrollHeight,g.clientHeight,i,h_);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]),_.useLayoutEffect(()=>{const g=n.current;!g||u.current||(u.current=!0,i?g.scrollTop=0:g.scrollTop=g.scrollHeight,r(!0))},[n,i]),_.useLayoutEffect(()=>{const g=n.current;if(g){if(i&&!o){const y=vO(f.current,g.scrollHeight);y>0&&(g.scrollTop+=y)}o&&(i?g.scrollTo({top:0,behavior:"smooth"}):g.scrollTo({top:g.scrollHeight,behavior:"smooth"})),f.current=g.scrollHeight}},[a,o,i,n]);const m=_.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:o,scrollToAnchor:m}}const bO="_wrapper_p24zt_1",xO="_scrollContainer_p24zt_9",_O="_toolbar_p24zt_15",SO="_directionToggle_p24zt_22",TO="_scrollToAnchor_p24zt_60",CO="_scrollToAnchorBottom_p24zt_84",kO="_scrollToAnchorTop_p24zt_88",ws={wrapper:bO,scrollContainer:xO,toolbar:_O,directionToggle:SO,scrollToAnchor:TO,scrollToAnchorBottom:CO,scrollToAnchorTop:kO},p_="grackle-stream-direction";function EO(){try{return localStorage.getItem(p_)==="reversed"}catch{return!1}}function NO({eventsDropped:n}){return n<=0?c.jsx(c.Fragment,{}):c.jsxs("div",{className:V.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 Gh({events:n,eventsDropped:a,emptyState:i}){const o=_.useRef(null),[r,f]=_.useState(EO),u=cw(),p=_.useMemo(()=>r?[...n].reverse():n,[n,r]),{isAtAnchor:m,scrollToAnchor:g}=yO({scrollRef:o,contentLength:n.length,isReversed:r}),y=()=>{const S=!r;f(S);try{localStorage.setItem(p_,S?"reversed":"default")}catch{}},v=u?0:.2,b=r?-8:8;return c.jsxs("div",{className:ws.wrapper,children:[c.jsx("div",{className:ws.toolbar,children:c.jsx("button",{className:ws.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:o,className:ws.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,c.jsx(NO,{eventsDropped:a}),c.jsx(Wn,{initial:!1,children:p.map((S,k)=>{const E=r?n.length-1-k:k;return c.jsx(Nt.div,{initial:{opacity:0,y:b},animate:{opacity:1,y:0},transition:{duration:v,ease:"easeOut"},children:c.jsx(kM,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${E}`)})})]}),c.jsx(Wn,{children:!m&&c.jsxs(Nt.button,{className:`${ws.scrollToAnchor} ${r?ws.scrollToAnchorTop:ws.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"]})})]})}function Ph(n){const a=[];for(const i of n){const o=a[a.length-1];i.eventType==="text"&&(o==null?void 0:o.eventType)==="text"?a[a.length-1]={...o,content:o.content+i.content}:a.push(i)}return a}function Fh(n){const a=new Map;for(const f of n)if(f.raw)try{a.set(f,JSON.parse(f.raw))}catch{}const i=new Map;for(const f of n){if(f.eventType!=="tool_use")continue;const u=a.get(f);if(!(!u||typeof u.id!="string"))try{const p=JSON.parse(f.content);i.set(u.id,{tool:p.tool,args:p.args})}catch{}}const o=new Set;return n.map(f=>{if(f.eventType!=="tool_result")return f;const u=a.get(f);if(!u||typeof u.tool_use_id!="string")return f;const p=i.get(u.tool_use_id);return p?(o.add(u.tool_use_id),{...f,toolUseCtx:p}):f}).filter(f=>{if(f.eventType!=="tool_use")return!0;const u=a.get(f);return u&&typeof u.id=="string"?!o.has(u.id):!0})}const AO="_panelContainer_pz4cr_1",jO="_emptyState_pz4cr_8",wO="_emptyTitle_pz4cr_20",DO="_emptyDescription_pz4cr_26",MO="_emptyHint_pz4cr_32",Xl={panelContainer:AO,emptyState:jO,emptyTitle:wO,emptyDescription:DO,emptyHint:MO};function RO({hasLocalEnvironment:n}){return c.jsxs("div",{className:Xl.emptyState,"data-testid":"chat-empty-state",children:[c.jsx("div",{className:Xl.emptyTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:Xl.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:Xl.emptyHint,children:"Go to Settings → Environments to add one."})]})}function OO(){const{tasks:n,sessions:a,events:i,eventsDropped:o,environments:r,loadTaskSessions:f,loadSessionEvents:u,taskSessions:p}=ut(),m=_.useRef(void 0),g=n.find(S=>S.id===Bs),y=g!=null&&g.latestSessionId?a.find(S=>S.id===g.latestSessionId)??(p[Bs]??[]).find(S=>S.id===g.latestSessionId):void 0;_.useEffect(()=>{f(Bs)},[f]),_.useEffect(()=>{g!=null&&g.latestSessionId&&f(Bs)},[g==null?void 0:g.latestSessionId,f]),_.useEffect(()=>{y&&y.id!==m.current&&(m.current=y.id,u(y.id))},[y==null?void 0:y.id,u]);const v=_.useMemo(()=>{if(!y)return[];const S=i.filter(k=>k.sessionId===y.id);return Fh(Ph(S))},[i,y==null?void 0:y.id]),b=r.find(S=>S.adapterType==="local"&&S.status==="connected");return c.jsx("div",{className:Xl.panelContainer,"data-testid":"chat-page",children:c.jsx(Gh,{events:v,eventsDropped:o,emptyState:c.jsx(RO,{hasLocalEnvironment:!!b})})})}function BO(n,a){const i=[];let o=n;const r=new Set;for(;o&&a.has(o)&&!r.has(o);){r.add(o);const f=a.get(o);i.unshift(f),o=f.parentTaskId||void 0}return i}const zi={label:"Home",url:go};function IO(n){return n?[zi,{label:"Settings",url:Ql},{label:n,url:void 0}]:[zi,{label:"Settings",url:void 0}]}function LO(){return[zi,{label:"Environments",url:void 0}]}function UO(){return[zi,{label:"New Chat",url:void 0}]}function zO(n){return[zi,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function VO(n,a,i){const o=BO(n,i),r=i.get(n),f=r==null?void 0:r.workspaceId,u=f?a.find(g=>g.id===f):void 0,p=[zi];u&&p.push({label:u.name,url:Bi(u.id)});for(let g=0;g<o.length-1;g++)p.push({label:o[g].title,url:Ta(o[g].id)});const m=o[o.length-1];return p.push({label:(m==null?void 0:m.title)??n,url:void 0}),p}function HO(){const n=UO();return c.jsxs("div",{className:V.panelContainer,children:[c.jsx(Ki,{segments:n}),c.jsx("div",{className:V.emptyState,children:"Enter a prompt below to start a new session"})]})}function GO({sessionId:n,session:a,isActive:i,onKill:o}){return c.jsxs("div",{className:V.header,children:[c.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.status}`]}),c.jsxs("span",{className:V.headerInfo,children:[a&&c.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&c.jsx("button",{onClick:()=>o(n),title:"Stop session",className:V.killButton,children:"×"})]})]})}function PO({session:n}){const a=n&&["completed","failed","interrupted"].includes(n.status),i=a?`Session ${n.status} with no events recorded.`:"Waiting for events...";return c.jsx("div",{className:a?V.errorMessage:V.waitingMessage,children:i})}function FO(){const{sessionId:n}=Gi(),{events:a,eventsDropped:i,sessions:o,kill:r,loadSessionEvents:f}=ut(),u=_.useRef(void 0),p=zO(n),m=o.find(v=>v.id===n)??void 0,g=_.useMemo(()=>{const v=n?a.filter(b=>b.sessionId===n):[];return Fh(Ph(v))},[a,n]);if(_.useEffect(()=>{n&&n!==u.current&&(u.current=n,f(n))},[n,f]),!n)return c.jsx("div",{className:V.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:V.panelContainer,children:[c.jsx(Ki,{segments:p}),c.jsx(GO,{sessionId:n,session:m,isActive:y,onKill:r}),c.jsx(Gh,{events:g,eventsDropped:i,emptyState:c.jsx(PO,{session:m})})]})}const z0=220,V0=70,$O=40,qO=60,YO="hierarchy",KO="dependency";function ZO(n){return _.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new Gv.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:$O,ranksep:qO});const i=new Map(n.map(u=>[u.id,u])),o=new Map;for(const u of n)if(u.parentTaskId&&i.has(u.parentTaskId)){const p=o.get(u.parentTaskId)||[];p.push(u),o.set(u.parentTaskId,p)}for(const u of n)a.setNode(u.id,{width:z0,height:V0});const r=[];for(const u of n){if(u.parentTaskId&&i.has(u.parentTaskId)){const p=`hierarchy-${u.parentTaskId}-${u.id}`;a.setEdge(u.parentTaskId,u.id,{},p),r.push({id:p,source:u.parentTaskId,target:u.id,type:"smoothstep",data:{edgeType:YO},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of u.dependsOn)if(i.has(p)){const m=`dependency-${p}-${u.id}`;a.setEdge(p,u.id,{},m),r.push({id:m,source:p,target:u.id,type:"smoothstep",data:{edgeType:KO},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Gv.layout(a),{nodes:n.map(u=>{const p=a.node(u.id),m=o.get(u.id)||[];return{id:u.id,type:"task",position:{x:p.x-z0/2,y:p.y-V0/2},data:{task:u,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:u.dependsOn.length>0}}}),edges:r}},[n])}const XO="_dagContainer_js4w6_1",QO="_taskNode_js4w6_26",WO="_taskNodeBorder_js4w6_54",JO="_taskNodeContent_js4w6_60",eB="_taskNodeHeader_js4w6_70",tB="_taskNodeIcon_js4w6_77",nB="_taskNodeTitle_js4w6_82",aB="_taskNodeBadges_js4w6_90",sB="_childBadge_js4w6_95",iB="_depBadge_js4w6_107",lB="_handle_js4w6_119",oB="_emptyCta_js4w6_126",rB="_ctaDescription_js4w6_137",cB="_ctaButton_js4w6_144",Kt={dagContainer:XO,taskNode:QO,taskNodeBorder:WO,taskNodeContent:JO,taskNodeHeader:eB,taskNodeIcon:tB,taskNodeTitle:nB,taskNodeBadges:aB,childBadge:sB,depBadge:iB,handle:lB,emptyCta:oB,ctaDescription:rB,ctaButton:cB};function uB({data:n}){const{task:a,childCount:i,doneChildCount:o,hasDependencies:r}=n,f=ls(a.status);return c.jsxs("div",{className:Kt.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[c.jsx(Pv,{type:"target",position:Fv.Top,className:Kt.handle}),c.jsx("div",{className:Kt.taskNodeBorder,style:{backgroundColor:f.color}}),c.jsxs("div",{className:Kt.taskNodeContent,children:[c.jsxs("div",{className:Kt.taskNodeHeader,children:[c.jsx("span",{className:Kt.taskNodeIcon,style:{color:f.color},children:f.icon}),c.jsx("span",{className:Kt.taskNodeTitle,children:a.title})]}),c.jsxs("div",{className:Kt.taskNodeBadges,children:[i>0&&c.jsxs("span",{className:Kt.childBadge,children:[o,"/",i]}),r&&c.jsx("span",{className:Kt.depBadge,children:"dep"})]})]}),c.jsx(Pv,{type:"source",position:Fv.Bottom,className:Kt.handle})]})}const dB=t2,fB={task:uB};function hB({workspaceId:n}){const{tasks:a}=ut(),i=$t(),{resolvedThemeId:o}=bb(),r=_.useMemo(()=>a.filter(y=>y.workspaceId===n),[a,n]),{nodes:f,edges:u}=ZO(r),p=_.useMemo(()=>{const y=getComputedStyle(document.documentElement),v={};for(const[b,S]of Object.entries(dB))v[b]=y.getPropertyValue(S).trim()||"#6b7a8d";return v},[o]),m=_.useCallback((y,v)=>{i(Ta(v.id,void 0,n))},[i,n]),g=_.useCallback(y=>{const v=y.data;return p[v.task.status]||p.pending},[p]);return r.length===0?c.jsxs("div",{className:Kt.emptyCta,children:[c.jsx("button",{className:Kt.ctaButton,onClick:()=>i(Pi(n)),children:"Create Task"}),c.jsx("div",{className:Kt.ctaDescription,children:"Create tasks to see the dependency graph"})]}):c.jsx("div",{className:Kt.dagContainer,children:c.jsxs(LS,{nodes:f,edges:u,nodeTypes:fB,onNodeClick:m,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[c.jsx(US,{variant:zS.Dots,gap:24,size:1,color:"var(--text-disabled)"}),c.jsx(VS,{showInteractive:!1}),c.jsx(HS,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function pB({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const o=new Map;for(const f of n)if(f.parentTaskId){const u=o.get(f.parentTaskId);u?u.push(f):o.set(f.parentTaskId,[f])}const r=new Map(D0.map(f=>[f,[]]));for(const f of n){const u=Vh(f.status),p=f.dependsOn.length>0&&f.dependsOn.some(k=>a.get(k)!=="complete"),m=o.get(f.id)??[],g=m.length,y=m.filter(k=>k.status==="complete").length;let v;if(u==="paused"&&i){const k=i.get(f.id);k==="idle"?v="Needs input":k==="completed"&&(v="Ready to complete")}const b={task:f,isBlocked:p,childCount:g,doneChildCount:y,pausedSubBadge:v},S=r.get(u);S?S.push(b):r.get("not_started").push(b)}for(const f of r.values())f.sort((u,p)=>u.task.sortOrder-p.task.sortOrder);return D0.map(f=>{const u=ls(f);return{status:f,label:u.label,style:u,tasks:r.get(f)??[]}})}const mB="_boardContainer_1c4y1_1",gB="_column_1c4y1_17",vB="_columnHeader_1c4y1_34",yB="_columnIcon_1c4y1_47",bB="_columnLabel_1c4y1_52",xB="_columnCount_1c4y1_57",_B="_cardList_1c4y1_67",SB="_emptyPlaceholder_1c4y1_76",TB="_card_1c4y1_67",CB="_cardHeader_1c4y1_107",kB="_cardStatusIcon_1c4y1_113",EB="_cardTitle_1c4y1_119",NB="_cardBadges_1c4y1_127",AB="_badge_1c4y1_134",jB="_blockedBadge_1c4y1_146",wB="_childBadge_1c4y1_151",DB="_depBadge_1c4y1_155",MB="_parentBadge_1c4y1_159",RB="_pausedSubBadge_1c4y1_166",OB="_personaBadge_1c4y1_170",BB="_envBadge_1c4y1_174",IB="_emptyCta_1c4y1_178",LB="_ctaButton_1c4y1_188",UB="_ctaDescription_1c4y1_204",$e={boardContainer:mB,column:gB,columnHeader:vB,columnIcon:yB,columnLabel:bB,columnCount:xB,cardList:_B,emptyPlaceholder:SB,card:TB,cardHeader:CB,cardStatusIcon:kB,cardTitle:EB,cardBadges:NB,badge:AB,blockedBadge:jB,childBadge:wB,depBadge:DB,parentBadge:MB,pausedSubBadge:RB,personaBadge:OB,envBadge:BB,emptyCta:IB,ctaButton:LB,ctaDescription:UB};function zB({workspaceId:n}){const{tasks:a,sessions:i,personas:o,environments:r}=ut(),f=$t(),u=_.useMemo(()=>a.filter(v=>v.workspaceId===n),[a,n]),p=_.useMemo(()=>new Map(a.map(v=>[v.id,v.status])),[a]),m=_.useMemo(()=>new Map(u.map(v=>[v.id,v])),[u]),g=_.useMemo(()=>{const v=new Map(i.map(C=>[C.id,C])),b=new Map(o.map(C=>[C.id,C])),S=new Map(r.map(C=>[C.id,C])),k=new Map,E=new Map,N=new Map;for(const C of u)if(C.latestSessionId){const A=v.get(C.latestSessionId);if(A){if(k.set(C.id,A.status),A.personaId){const O=b.get(A.personaId);O&&E.set(C.id,O.name)}if(A.environmentId){const O=S.get(A.environmentId);O&&N.set(C.id,O.displayName)}}}return{sessionStatusByTaskId:k,personaNameByTaskId:E,environmentNameByTaskId:N}},[u,i,o,r]),y=_.useMemo(()=>pB({tasks:u,taskStatusById:p,sessionStatusByTaskId:g.sessionStatusByTaskId}),[u,p,g]);return u.length===0?c.jsxs("div",{className:$e.emptyCta,"data-testid":"board-empty-cta",children:[c.jsx("button",{className:$e.ctaButton,onClick:()=>f(Pi(n)),children:"Create Task"}),c.jsx("div",{className:$e.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):c.jsx("div",{className:$e.boardContainer,"data-testid":"board-container",children:y.map(v=>c.jsxs("section",{className:$e.column,"data-testid":`board-column-${v.status}`,"aria-label":`${v.label}, ${v.tasks.length} ${v.tasks.length===1?"task":"tasks"}`,children:[c.jsxs("div",{className:$e.columnHeader,children:[c.jsx("span",{className:$e.columnIcon,style:{color:v.style.color},children:v.style.icon}),c.jsx("span",{className:$e.columnLabel,children:v.label}),c.jsx("span",{className:$e.columnCount,"data-testid":`board-count-${v.status}`,children:v.tasks.length})]}),c.jsx("div",{className:$e.cardList,children:v.tasks.length===0?c.jsx("div",{className:$e.emptyPlaceholder,children:"No tasks"}):c.jsx(Wn,{mode:"popLayout",children:v.tasks.map(b=>c.jsx(Nt.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:c.jsx(VB,{boardTask:b,tasksById:m,personaName:g.personaNameByTaskId.get(b.task.id),envName:g.environmentNameByTaskId.get(b.task.id),onClick:()=>f(Ta(b.task.id,void 0,n))})},b.task.id))})})]},v.status))})}function VB({boardTask:n,tasksById:a,personaName:i,envName:o,onClick:r}){const{task:f,isBlocked:u,childCount:p,doneChildCount:m,pausedSubBadge:g}=n,y=ls(f.status),v=f.parentTaskId?a.get(f.parentTaskId):void 0;return c.jsxs("div",{className:$e.card,tabIndex:0,role:"button","data-testid":`board-card-${f.id}`,onClick:r,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),r())},children:[c.jsxs("div",{className:$e.cardHeader,children:[c.jsx("span",{className:$e.cardStatusIcon,style:{color:y.color},children:y.icon}),c.jsx("span",{className:$e.cardTitle,children:f.title})]}),c.jsxs("div",{className:$e.cardBadges,children:[v&&c.jsx("span",{className:`${$e.badge} ${$e.parentBadge}`,title:v.title,children:v.title}),p>0&&c.jsxs("span",{className:`${$e.badge} ${$e.childBadge}`,children:[m,"/",p]}),u&&c.jsx("span",{className:`${$e.badge} ${$e.blockedBadge}`,children:"blocked"}),f.dependsOn.length>0&&!u&&c.jsx("span",{className:`${$e.badge} ${$e.depBadge}`,children:"dep"}),g&&c.jsx("span",{className:`${$e.badge} ${$e.pausedSubBadge}`,children:g}),i&&c.jsx("span",{className:`${$e.badge} ${$e.personaBadge}`,children:i}),o&&c.jsx("span",{className:`${$e.badge} ${$e.envBadge}`,children:o})]})]})}function $h(n){const{value:a,onSave:i,validate:o,fieldId:r,activeFieldId:f,onActivate:u,enterToSave:p=!0,trimOnSave:m=!0}=n,[g,y]=_.useState(""),[v,b]=_.useState(""),S=_.useRef(!1),k=f===r,E=_.useCallback(M=>{y(M),b("")},[]),N=_.useCallback(()=>{b("")},[]),C=_.useCallback(()=>{S.current=!1,u==null||u(null),y(""),b("")},[u]),A=_.useCallback(()=>{const M=m?g.trim():g;if(o){const F=o(g);if(F){b(F);return}}const R=m?a.trim():a;if(M===R){C();return}i(M),C()},[g,a,m,o,i,C]),O=_.useCallback(()=>{S.current=!0,u==null||u(r),y(a),b("")},[r,a,u]),B=_.useCallback(M=>{if(S.current){S.current=!1;return}M.relatedTarget instanceof HTMLElement&&M.relatedTarget.dataset.editAction===r||A()},[r,A]),U=_.useCallback(M=>{M.key==="Escape"?C():M.key==="Enter"&&p&&A()},[C,p,A]),q=(()=>{if(!k)return!1;const M=m?a.trim():a;return(m?g.trim():g)!==M})();return _.useEffect(()=>{!k&&(g!==""||v!=="")&&(y(""),b(""))},[k,g,v]),{isEditing:k,draft:g,error:v,isDirty:q,startEdit:O,cancelEdit:C,save:A,setDraft:E,clearError:N,handleBlur:B,handleKeyDown:U,ignoreInitialBlurRef:S}}const HB="_editFieldWrapper_yuzty_1",GB="_editInput_yuzty_10",PB="_editTextarea_yuzty_42",FB="_editSelect_yuzty_78",$B="_editError_yuzty_111",qB="_editInputInvalid_yuzty_118",YB="_editHint_yuzty_123",KB="_unsavedDot_yuzty_132",ZB="_metaValueClickable_yuzty_140",XB="_editButton_yuzty_159",QB="_metaPlaceholder_yuzty_175",WB="_worktreeToggle_yuzty_180",He={editFieldWrapper:HB,editInput:GB,editTextarea:PB,editSelect:FB,editError:$B,editInputInvalid:qB,editHint:YB,unsavedDot:KB,metaValueClickable:ZB,editButton:XB,metaPlaceholder:QB,worktreeToggle:WB};function fn(n){const{value:a,onSave:i,validate:o,mode:r="edit",fieldId:f="text",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,maxLength:v,ariaLabel:b,"data-testid":S}=n,k=_.useRef(null),E=$h({value:a,onSave:i,validate:o,fieldId:f,activeFieldId:u,onActivate:p,enterToSave:!0,trimOnSave:!0});if(_.useEffect(()=>{if(E.isEditing){const C=window.setTimeout(()=>{var A;(A=k.current)==null||A.focus()},0);return()=>window.clearTimeout(C)}},[E.isEditing]),r==="create"){const C=O=>{m==null||m(O.target.value)},A=o==null?void 0:o(a);return c.jsxs("div",{className:He.editFieldWrapper,children:[c.jsx("input",{className:`${He.editInput} ${A?He.editInputInvalid:""}`,value:a,onChange:C,maxLength:v,placeholder:y,"aria-label":b,"data-testid":S?`${S}-input`:void 0}),A&&c.jsx("span",{className:He.editError,"data-testid":"edit-error",children:A})]})}if(E.isEditing)return c.jsxs("div",{className:He.editFieldWrapper,children:[c.jsx("input",{ref:k,className:`${He.editInput} ${E.error?He.editInputInvalid:""}`,value:E.draft,onChange:C=>E.setDraft(C.target.value),onBlur:E.handleBlur,onKeyDown:E.handleKeyDown,maxLength:v,placeholder:y,"aria-label":b,"data-testid":S?`${S}-input`:void 0}),E.isDirty&&c.jsx("span",{className:He.unsavedDot,title:"Unsaved changes"}),E.error&&c.jsx("span",{className:He.editError,"data-testid":"edit-error",children:E.error}),c.jsx("span",{className:He.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:He.metaValueClickable,onClick:()=>E.startEdit(),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),E.startEdit())},title:"Click to edit","aria-label":b,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:a?c.jsx("span",{children:a}):c.jsx("span",{className:He.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:He.editButton,"aria-hidden":"true",children:"✏️"})]})}function JB(n){const{value:a,onSave:i,validate:o,mode:r="edit",fieldId:f="textarea",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":b}=n,S=_.useRef(null),k=$h({value:a,onSave:i,validate:o,fieldId:f,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});if(_.useEffect(()=>{if(k.isEditing){const N=window.setTimeout(()=>{var C;(C=S.current)==null||C.focus()},0);return()=>window.clearTimeout(N)}},[k.isEditing]),r==="create"){const N=A=>{m==null||m(A.target.value)},C=o==null?void 0:o(a);return c.jsxs("div",{className:He.editFieldWrapper,children:[c.jsx("textarea",{className:`${He.editTextarea} ${C?He.editInputInvalid:""}`,value:a,onChange:N,placeholder:y,"aria-label":v,"data-testid":b?`${b}-input`:void 0}),C&&c.jsx("span",{className:He.editError,"data-testid":"edit-error",children:C})]})}if(k.isEditing)return c.jsxs("div",{className:He.editFieldWrapper,children:[c.jsx("textarea",{ref:S,className:`${He.editTextarea} ${k.error?He.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:He.unsavedDot,title:"Unsaved changes"}),k.error&&c.jsx("span",{className:He.editError,"data-testid":"edit-error",children:k.error}),c.jsx("span",{className:He.editHint,children:"Tab to save · Esc to cancel"})]});const E=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:He.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:[E!==void 0?E:a?c.jsx("span",{children:a}):c.jsx("span",{className:He.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:He.editButton,"aria-hidden":"true",children:"✏️"})]})}function m_(n){var O;const{value:a,onSave:i,mode:o="edit",options:r,fieldId:f="select",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":b}=n,S=_.useRef(null),k=$h({value:a,onSave:i,fieldId:f,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});_.useEffect(()=>{if(k.isEditing){const B=window.setTimeout(()=>{var U;(U=S.current)==null||U.focus()},0);return()=>window.clearTimeout(B)}},[k.isEditing]);const E=_.useCallback(B=>{const U=B.target.value;k.ignoreInitialBlurRef.current=!1,U!==a&&i(U),k.cancelEdit()},[a,i,k]),N=_.useCallback(B=>{if(k.ignoreInitialBlurRef.current){k.ignoreInitialBlurRef.current=!1;return}B.relatedTarget instanceof HTMLElement&&B.relatedTarget.dataset.editAction===f||k.cancelEdit()},[f,k]);if(o==="create")return c.jsx("select",{className:He.editSelect,value:a,onChange:B=>m==null?void 0:m(B.target.value),"aria-label":v,"data-testid":b?`${b}-select`:void 0,children:r.map(B=>c.jsx("option",{value:B.value,children:B.label},B.value))});if(k.isEditing)return c.jsx("select",{ref:S,className:He.editSelect,value:k.draft,onChange:E,onBlur:N,title:v,"aria-label":v,"data-testid":b?`${b}-select`:void 0,children:r.map(B=>c.jsx("option",{value:B.value,children:B.label},B.value))});const C=g==null?void 0:g(a),A=(O=r.find(B=>B.value===a))==null?void 0:O.label;return c.jsxs("button",{type:"button",className:He.metaValueClickable,onClick:()=>k.startEdit(),title:"Click to change","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:He.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:He.editButton,"aria-hidden":"true",children:"✏️"})]})}function e6(n){const{checked:a,onChange:i,label:o,ariaLabel:r,"data-testid":f}=n;return c.jsxs("label",{className:He.worktreeToggle,"data-testid":f,children:[c.jsx("input",{type:"checkbox",checked:a,onChange:u=>i(u.target.checked),"aria-label":r}),c.jsx("span",{children:o})]})}const t6="_envRow_1e1r5_1",n6="_envDot_1e1r5_7",a6="_envDotGreen_1e1r5_14",s6="_envDotYellow_1e1r5_18",i6="_envDotRed_1e1r5_22",l6="_envDotGray_1e1r5_26",Oi={envRow:t6,envDot:n6,envDotGreen:a6,envDotYellow:s6,envDotRed:i6,envDotGray:l6};function o6(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 r6(n){const{value:a,onSave:i,environments:o,allowNone:r=!1,fieldId:f="environment",activeFieldId:u,onActivate:p,placeholder:m="No environment",ariaLabel:g="Environment","data-testid":y}=n,v=o.find(k=>k.id===a),b=[...r?[{value:"",label:"None"}]:[],...o.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} ${o6(v.status)}`}),v.displayName]})};return c.jsx(m_,{value:a,onSave:i,options:b,fieldId:f,activeFieldId:u,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:g,"data-testid":y})}function H0(n){if(!n)return"";const a=new Date(n);if(isNaN(a.getTime()))return"";const o=Date.now()-a.getTime();if(o<0)return"just now";const r=Math.floor(o/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const f=Math.floor(r/60);if(f<24)return`${f}h ago`;const u=Math.floor(f/24);return u<30?`${u}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const df=100;function c6(){const{workspaceId:n}=Gi(),a=$t(),{tasks:i,environments:o,workspaces:r,personas:f,archiveWorkspace:u,updateWorkspace:p}=ut(),[m,g]=_.useState("tasks"),[y,v]=_.useState(!1),[b,S]=_.useState(null),[k,E]=_.useState(!1),N=_.useRef(void 0),C=r.find(M=>M.id===n),A=[{label:"Home",url:go},{label:(C==null?void 0:C.name)??"Workspace",url:void 0}];_.useEffect(()=>{const M=N.current;N.current=n,!(M===void 0||M===n)&&b!==null&&S(null)},[n,b]);const O=i.filter(M=>M.workspaceId===n),B=O.filter(M=>M.status==="complete").length,U=O.length,q=U>0?Math.round(B/U*100):0;return c.jsxs("div",{className:V.panelContainer,children:[c.jsx(Ki,{segments:A}),c.jsxs("div",{className:V.workspaceHeader,children:[c.jsx("span",{className:V.workspaceName,"data-testid":"workspace-name",children:c.jsx(fn,{value:(C==null?void 0:C.name)||"",onSave:M=>{C&&p(C.id,{name:M})},validate:M=>{const R=M.trim();if(!R)return"Name is required";if(R.length>df)return`Max ${df} characters`},maxLength:df,fieldId:"name",activeFieldId:b,onActivate:S,ariaLabel:"Workspace name",renderDisplay:M=>M||n||void 0,"data-testid":"edit-name"})}),c.jsx("button",{className:V.archiveButton,onClick:()=>v(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),c.jsxs("button",{className:V.metaToggle,onClick:()=>E(!k),"aria-expanded":!k,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[c.jsx("span",{className:`${V.metaToggleArrow} ${k?"":V.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!k&&c.jsxs("div",{className:V.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[c.jsxs("div",{className:V.metaRow,children:[c.jsx("span",{className:V.metaLabel,children:"Description"}),c.jsx("div",{className:V.metaValue,children:c.jsx(JB,{value:(C==null?void 0:C.description)||"",onSave:M=>{C&&p(C.id,{description:M})},fieldId:"description",activeFieldId:b,onActivate:S,renderDisplay:M=>M?c.jsx("span",{className:V.overviewMarkdown,children:c.jsx(Yf,{remarkPlugins:[Kf],children:M})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),c.jsxs("div",{className:V.metaRow,children:[c.jsx("span",{className:V.metaLabel,children:"Repository"}),c.jsx("div",{className:V.metaValue,children:c.jsx(fn,{value:(C==null?void 0:C.repoUrl)||"",onSave:M=>{C&&p(C.id,{repoUrl:M})},validate:M=>{const R=M.trim();if(R&&!/^https?:\/\/.+/.test(R))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:b,onActivate:S,renderDisplay:M=>M&&/^https?:\/\//i.test(M)?c.jsx("a",{className:V.repoLink,href:M,target:"_blank",rel:"noopener noreferrer",onClick:R=>R.stopPropagation(),children:M}):M?c.jsx("span",{children:M}):void 0,placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),c.jsxs("div",{className:V.metaRow,children:[c.jsx("span",{className:V.metaLabel,children:"Environment"}),c.jsx("div",{className:V.metaValue,children:c.jsx(r6,{value:(C==null?void 0:C.environmentId)||"",onSave:M=>{C&&M&&p(C.id,{environmentId:M})},environments:o,fieldId:"environmentId",activeFieldId:b,onActivate:S,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),c.jsxs("div",{className:V.metaRow,children:[c.jsx("span",{className:V.metaLabel,children:"Persona"}),c.jsx("div",{className:V.metaValue,children:c.jsx(m_,{value:(C==null?void 0:C.defaultPersonaId)||"",onSave:M=>{C&&p(C.id,{defaultPersonaId:M})},options:[{value:"",label:"(Inherit)"},...f.map(M=>({value:M.id,label:M.name}))],fieldId:"defaultPersonaId",activeFieldId:b,onActivate:S,renderDisplay:M=>{const R=f.find(F=>F.id===M);if(R)return c.jsx("span",{children:R.name})},placeholder:(C==null?void 0:C.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),c.jsxs("div",{className:V.metaRow,children:[c.jsx("span",{className:V.metaLabel,children:"Worktrees"}),c.jsx("div",{className:V.metaValue,children:c.jsx(e6,{checked:(C==null?void 0:C.useWorktrees)??!0,onChange:M=>{C&&p(C.id,{useWorktrees:M})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),c.jsxs("div",{className:V.metaRow,children:[c.jsx("span",{className:V.metaLabel,children:"Working Dir"}),c.jsx("div",{className:V.metaValue,children:c.jsx(fn,{value:(C==null?void 0:C.worktreeBasePath)||"",onSave:M=>{C&&p(C.id,{worktreeBasePath:M})},fieldId:"worktreeBasePath",activeFieldId:b,onActivate:S,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-worktree-base-path"})})]}),C&&c.jsxs("div",{className:V.metaTimestamps,children:[c.jsxs("span",{className:V.metaTimestamp,children:["Created ",H0(C.createdAt)]}),C.updatedAt&&C.updatedAt!==C.createdAt&&c.jsxs("span",{className:V.metaTimestamp,children:["· Updated ",H0(C.updatedAt)]})]})]}),U>0&&c.jsxs("div",{className:V.progressBarContainer,"data-testid":"progress-bar",children:[c.jsx("div",{className:V.progressBar,children:c.jsx("div",{className:V.progressFill,style:{width:`${q}%`}})}),c.jsxs("span",{className:V.progressLabel,children:[B,"/",U]})]}),c.jsxs("div",{className:V.tabBar,role:"tablist","aria-label":"Workspace view",children:[c.jsx("button",{role:"tab","aria-selected":m==="graph",className:`${V.tab} ${m==="graph"?V.active:""}`,onClick:()=>g("graph"),children:"Graph"}),c.jsx("button",{role:"tab","aria-selected":m==="board",className:`${V.tab} ${m==="board"?V.active:""}`,onClick:()=>g("board"),"data-testid":"board-tab",children:"Board"}),c.jsx("button",{role:"tab","aria-selected":m==="tasks",className:`${V.tab} ${m==="tasks"?V.active:""}`,onClick:()=>g("tasks"),children:"Tasks"})]}),m==="tasks"&&U>0&&c.jsxs("div",{className:V.workspaceSummary,children:[c.jsx("span",{className:V.workspaceSummaryTitle,children:`${B}/${U} tasks complete`}),c.jsx("span",{className:V.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),m==="tasks"&&U===0&&c.jsxs("div",{className:V.emptyCta,children:[c.jsx("button",{className:V.ctaButton,onClick:()=>a(Pi(n)),children:"Create Task"}),c.jsx("div",{className:V.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),m==="board"&&c.jsx(zB,{workspaceId:n}),m==="graph"&&c.jsx(hB,{workspaceId:n}),c.jsx(Cc,{isOpen:y,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{C&&(u(C.id),a("/",{replace:!0})),v(!1)},onCancel:()=>v(!1)})]})}const u6="_container_cddyd_1",d6="_header_cddyd_8",f6="_headerTitle_cddyd_35",h6="_badge_cddyd_44",p6="_headerActions_cddyd_54",m6="_body_cddyd_61",g6="_formContent_cddyd_73",v6="_section_cddyd_85",y6="_label_cddyd_91",b6="_titleInput_cddyd_98",x6="_descriptionTextarea_cddyd_131",_6="_parentContext_cddyd_167",S6="_parentLabel_cddyd_175",T6="_parentName_cddyd_182",C6="_personaSelect_cddyd_186",k6="_depList_cddyd_220",E6="_depItem_cddyd_226",N6="_depItemSelected_cddyd_248",A6="_noDeps_cddyd_252",j6="_btnPrimary_cddyd_258",w6="_btnGhost_cddyd_289",Ve={container:u6,header:d6,headerTitle:f6,badge:h6,headerActions:p6,body:m6,formContent:g6,section:v6,label:y6,titleInput:b6,descriptionTextarea:x6,parentContext:_6,parentLabel:S6,parentName:T6,personaSelect:C6,depList:k6,depItem:E6,depItemSelected:N6,noDeps:A6,btnPrimary:j6,btnGhost:w6};function g_({mode:n,taskId:a,workspaceId:i,parentTaskId:o}){const{tasks:r,workspaces:f,personas:u,createTask:p,updateTask:m}=ut(),{showToast:g}=Fi(),y=$t(),v=n==="edit",b=v&&a?r.find(ae=>ae.id===a):void 0,S=v?(b==null?void 0:b.workspaceId)??"":i??"",[k,E]=_.useState(S),N=S||k,C=!v&&!i,A=v?(b==null?void 0:b.parentTaskId)??"":o??"",O=A?r.find(ae=>ae.id===A):void 0,[B,U]=_.useState((b==null?void 0:b.title)??""),[q,M]=_.useState((b==null?void 0:b.description)??""),[R,F]=_.useState((b==null?void 0:b.dependsOn)??[]),[ee,te]=_.useState((b==null?void 0:b.defaultPersonaId)??""),[se,re]=_.useState((b==null?void 0:b.canDecompose)??!1),[Q,ie]=_.useState(!1),I=_.useRef(!1);_.useEffect(()=>{v&&b&&!I.current&&(I.current=!0,U(b.title),M(b.description),F(b.dependsOn),te(b.defaultPersonaId),re(b.canDecompose))},[v,b]);const D=r.filter(ae=>ae.workspaceId===N&&(!v||ae.id!==a)&&ae.id!==A),ne=B.trim().length>0&&(!v||b!==void 0)&&N.length>0,oe=ae=>{F(pe=>pe.includes(ae)?pe.filter(qe=>qe!==ae):[...pe,ae])},z=()=>{!ne||Q||v&&b===void 0||(v&&a?(m(a,B.trim(),q,R,ee),g("Task updated","success"),y(Ta(a,void 0,N),{replace:!0})):(ie(!0),p(N,B.trim(),q,R.length>0?R:void 0,A||void 0,ee,se,()=>{g("Task created","success"),y(i?Bi(i):"/tasks",{replace:!0})},ae=>{g(ae,"error"),ie(!1)})))},J=()=>{y(v&&a?Ta(a,void 0,N):i?Bi(i):"/tasks")},Se=v?"edit task":A?"child task":"new task";return c.jsxs("div",{className:Ve.container,children:[c.jsxs("div",{className:Ve.header,children:[c.jsxs("div",{className:Ve.headerTitle,children:[c.jsx("span",{className:Ve.badge,children:Se}),O&&c.jsxs("span",{className:Ve.parentContext,children:[c.jsx("span",{className:Ve.parentLabel,children:"Child of"}),c.jsx("span",{className:Ve.parentName,children:O.title})]})]}),c.jsxs("div",{className:Ve.headerActions,children:[c.jsx("button",{onClick:z,disabled:!ne||Q,className:Ve.btnPrimary,"data-testid":"task-edit-save",children:Q?"Creating…":v?"Save Changes":"Create"}),c.jsx("button",{onClick:J,className:Ve.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:Ve.body,children:c.jsxs("div",{className:Ve.formContent,children:[C&&c.jsxs("div",{className:Ve.section,children:[c.jsx("label",{className:Ve.label,htmlFor:"task-edit-workspace",children:"Workspace"}),c.jsxs("select",{id:"task-edit-workspace",value:k,onChange:ae=>E(ae.target.value),className:Ve.personaSelect,"data-testid":"task-edit-workspace",children:[c.jsx("option",{value:"",children:"Select a workspace..."}),f.map(ae=>c.jsx("option",{value:ae.id,children:ae.name},ae.id))]})]}),c.jsxs("div",{className:Ve.section,children:[c.jsx("label",{className:Ve.label,htmlFor:"task-edit-title",children:"Title"}),c.jsx("input",{id:"task-edit-title",type:"text",value:B,onChange:ae=>U(ae.target.value),placeholder:"Task title...",autoFocus:!0,className:Ve.titleInput,"data-testid":"task-edit-title",onKeyDown:ae=>{ae.key==="Enter"&&ne&&z()}})]}),c.jsxs("div",{className:Ve.section,children:[c.jsx("label",{className:Ve.label,htmlFor:"task-edit-description",children:"Description"}),c.jsx("textarea",{id:"task-edit-description",value:q,onChange:ae=>M(ae.target.value),placeholder:"Describe the task... (markdown supported)",className:Ve.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),c.jsxs("div",{className:Ve.section,children:[c.jsx("label",{className:Ve.label,htmlFor:"task-edit-persona",children:"Default Persona"}),c.jsxs("select",{id:"task-edit-persona",value:ee,onChange:ae=>te(ae.target.value),className:Ve.personaSelect,"data-testid":"task-edit-persona",children:[c.jsx("option",{value:"",children:"(Inherit)"}),u.map(ae=>c.jsx("option",{value:ae.id,children:ae.name},ae.id))]})]}),!v&&c.jsx("div",{className:Ve.section,children:c.jsxs("label",{className:Ve.depItem,"data-testid":"task-edit-can-decompose",children:[c.jsx("input",{type:"checkbox",checked:se,onChange:ae=>re(ae.target.checked)}),"Can spawn subtasks"]})}),c.jsxs("div",{className:Ve.section,children:[c.jsx("div",{className:Ve.label,children:"Dependencies"}),D.length===0?c.jsx("div",{className:Ve.noDeps,children:"No other tasks in this workspace"}):c.jsx("div",{className:Ve.depList,children:D.map(ae=>{const pe=R.includes(ae.id);return c.jsxs("label",{className:`${Ve.depItem} ${pe?Ve.depItemSelected:""}`,"data-testid":`dep-option-${ae.id}`,children:[c.jsx("input",{type:"checkbox",checked:pe,onChange:()=>oe(ae.id)}),ae.title,c.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",ae.status,")"]})]},ae.id)})})]})]})})]})}function D6(){const[n]=ub(),a=n.get("workspace")??"",i=n.get("parent")??void 0;return c.jsx(g_,{mode:"new",workspaceId:a,parentTaskId:i})}function G0(){const{taskId:n}=Gi();return c.jsx(g_,{mode:"edit",taskId:n})}const M6="_container_1pqxm_1",R6="_emptyState_1pqxm_8",O6="_card_1pqxm_14",B6="_cardHeader_1pqxm_34",I6="_categoryBadge_1pqxm_46",L6="_findingTitle_1pqxm_54",U6="_findingDate_1pqxm_60",z6="_findingContent_1pqxm_72",V6="_tags_1pqxm_78",H6="_tag_1pqxm_78",$n={container:M6,emptyState:R6,card:O6,cardHeader:B6,categoryBadge:I6,findingTitle:L6,findingDate:U6,findingContent:z6,tags:V6,tag:H6};function G6(n){const a=new Date(n),i=new Date,o=i.getTime()-a.getTime(),r=Math.floor(o/1e3),f=Math.floor(r/60),u=Math.floor(f/60),p=Math.floor(u/24);if(r<60)return"just now";if(f<60)return`${f}m ago`;if(u<24)return`${u}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 P0={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 P6({workspaceId:n}){const{findings:a}=ut(),i=a.filter(o=>o.workspaceId===n);return i.length===0?c.jsx("div",{className:$n.emptyState,children:"No findings yet. Agents will post discoveries here."}):c.jsx("div",{className:$n.container,children:i.map((o,r)=>{const f=P0[o.category]||P0.general;return c.jsxs(Nt.div,{className:$n.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},children:[c.jsxs("div",{className:$n.cardHeader,children:[c.jsx("span",{className:$n.categoryBadge,style:{background:f.bg,color:f.text},children:o.category}),c.jsx("span",{className:$n.findingTitle,children:o.title}),c.jsx("span",{className:$n.findingDate,title:o.createdAt,children:G6(o.createdAt)})]}),c.jsx("div",{className:$n.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&c.jsx("div",{className:$n.tags,children:o.tags.map(u=>c.jsx("span",{className:$n.tag,style:{color:f.text,textShadow:`0 0 8px ${f.text}`},children:u},u))})]},o.id)})})}function qr(n){if(!n)return"—";const a=new Date(n);return isNaN(a.getTime())?"—":a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function ff(n,a){if(!n||!a)return;const i=new Date(a).getTime()-new Date(n).getTime();if(isNaN(i)||i<0)return;const o=Math.floor(i/6e4),r=Math.floor(i%6e4/1e3);if(o===0)return`${r}s`;const f=Math.floor(o/60),u=o%60;return f===0?`${o}m ${r}s`:`${f}h ${u}m`}function F0(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?V.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?V.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?V.envDotRed:V.envDotGray}function F6({status:n}){const a=ls(n),i=Ww(n);return c.jsx("span",{className:`${V.statusBadge} ${V[i]??V.statusPending}`,children:a.label})}function $6({task:n,tasksById:a,environments:i,workspaces:o,taskSessions:r,selectedEnvId:f}){const u=r.length>0?r[r.length-1]:void 0,p=(u==null?void 0:u.environmentId)??"",m=p?i.find(b=>b.id===p):void 0,g=o.find(b=>b.id===n.workspaceId),y=i.find(b=>b.id===f),v=n.branch&&(g!=null&&g.repoUrl)?`${g.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return c.jsxs("div",{className:V.overviewDashboard,children:[c.jsxs("div",{className:V.overviewHero,children:[c.jsx(F6,{status:n.status}),n.branch&&c.jsx("span",{className:V.overviewBranchPill,children:v?c.jsxs("a",{href:v,target:"_blank",rel:"noreferrer noopener",className:V.branchLink,children:["🔗"," ",n.branch]}):c.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&c.jsxs("div",{className:V.overviewSection,children:[c.jsx("div",{className:V.overviewLabel,children:"Description"}),c.jsx("div",{className:V.overviewMarkdown,children:c.jsx(Yf,{remarkPlugins:[Kf],children:n.description})})]}),c.jsxs("div",{className:V.overviewSection,children:[c.jsx("div",{className:V.overviewLabel,children:"Environment"}),p&&m?c.jsxs("div",{className:V.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${V.envDot} ${F0(m.status)}`,title:m.status,"aria-label":`Status: ${m.status}`,role:"img"}),c.jsx("span",{className:V.overviewValue,children:m.displayName})]}):y?c.jsxs("div",{className:V.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${V.envDot} ${F0(y.status)}`,title:y.status,"aria-label":`Status: ${y.status}`,role:"img"}),c.jsx("span",{className:V.overviewValue,children:y.displayName}),c.jsx("span",{className:V.overviewMuted,children:"(workspace default)"})]}):c.jsx("div",{className:V.overviewMuted,children:"Set in workspace settings"})]}),c.jsxs("div",{className:V.overviewSection,children:[c.jsx("div",{className:V.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?c.jsx("div",{className:V.overviewMuted,children:"None"}):c.jsx("div",{className:V.depList,children:n.dependsOn.map(b=>{const S=a.get(b),k=(S==null?void 0:S.status)==="complete";return c.jsxs("div",{className:`${V.depItem} ${k?V.depDone:V.depBlocked}`,children:[c.jsx("span",{children:k?"✓":"○"}),c.jsx("span",{children:(S==null?void 0:S.title)??b})]},b)})})]}),c.jsxs("div",{className:V.overviewSection,children:[c.jsx("div",{className:V.overviewLabel,children:"Timeline"}),c.jsxs("div",{className:V.timeline,children:[n.createdAt&&c.jsxs("div",{className:V.timelineRow,children:[c.jsx("span",{className:V.timelineKey,children:"Created"}),c.jsx("span",{className:V.timelineValue,children:qr(n.createdAt)})]}),n.assignedAt&&(()=>{const b=ff(n.createdAt,n.assignedAt);return c.jsxs("div",{className:V.timelineRow,children:[c.jsx("span",{className:V.timelineKey,children:"Assigned"}),c.jsx("span",{className:V.timelineValue,children:qr(n.assignedAt)}),b!==void 0&&c.jsx("span",{className:V.timelineDelta,children:b})]})})(),n.startedAt&&(()=>{const b=ff(n.assignedAt??n.createdAt,n.startedAt);return c.jsxs("div",{className:V.timelineRow,children:[c.jsx("span",{className:V.timelineKey,children:"Started"}),c.jsx("span",{className:V.timelineValue,children:qr(n.startedAt)}),b!==void 0&&c.jsx("span",{className:V.timelineDelta,children:b})]})})(),n.completedAt&&(()=>{const b=ff(n.startedAt,n.completedAt);return c.jsxs("div",{className:V.timelineRow,children:[c.jsx("span",{className:V.timelineKey,children:"Completed"}),c.jsx("span",{className:V.timelineValue,children:qr(n.completedAt)}),b!==void 0&&c.jsx("span",{className:V.timelineDelta,children:b})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&c.jsx("div",{className:V.overviewMuted,children:"No timing data"})]})]}),n.reviewNotes&&c.jsxs("div",{className:V.overviewSection,children:[c.jsx("div",{className:V.overviewLabel,children:"Review Notes"}),c.jsx("div",{className:V.reviewNotes,children:n.reviewNotes})]})]})}function q6({task:n,sessionId:a,isBlocked:i,onStart:o,onResume:r,onStop:f,onPause:u,onDelete:p,onEdit:m}){if(n.status==="not_started")return i?c.jsxs("div",{className:V.headerActions,children:[c.jsx("button",{onClick:m,className:V.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:V.btnDanger,children:"Delete"})]}):c.jsxs("div",{className:V.headerActions,children:[c.jsx("button",{onClick:o,className:V.btnPrimary,children:"Start"}),c.jsx("button",{onClick:m,className:V.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:V.btnDanger,children:"Delete"})]});if(n.status==="working")return c.jsxs("div",{className:V.headerActions,children:[c.jsx("button",{onClick:f,className:V.btnDanger,children:"Stop"}),c.jsx("button",{onClick:u,disabled:!a,className:V.btnGhost,children:"Pause"})]});if(n.status==="paused")return c.jsxs("div",{className:V.headerActions,children:[c.jsx("button",{onClick:f,className:V.btnPrimary,children:"Stop"}),c.jsx("button",{onClick:r,className:V.btnGhost,children:"Resume"}),c.jsx("button",{onClick:p,className:V.btnDanger,children:"Delete"})]});if(n.status==="complete")return c.jsx("div",{className:V.headerActions,children:c.jsx("button",{onClick:p,className:V.btnDanger,children:"Delete"})});if(n.status==="failed")return c.jsxs("div",{className:V.headerActions,children:[c.jsx("button",{onClick:o,className:V.btnPrimary,children:"Retry"}),c.jsx("button",{onClick:p,className:V.btnDanger,children:"Delete"})]})}function Y6({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return c.jsxs("div",{className:V.attemptSelector,"data-testid":"attempt-selector",children:[c.jsx("span",{className:V.attemptLabel,children:"Attempts:"}),n.map((o,r)=>{const f=o.id===a,u=o.status==="completed"?"✓":o.status==="failed"?"✗":o.status==="running"||o.status==="idle"?"●":"";return c.jsxs("button",{className:`${V.attemptButton} ${f?V.attemptActive:""}`,onClick:()=>i(o.id),title:`Attempt #${r+1} — ${o.status}`,"aria-label":`Attempt #${r+1}, ${o.status}`,"aria-pressed":f,"data-testid":`attempt-${r+1}`,children:["#",r+1,u&&c.jsx("span",{className:V.attemptStatus,children:u})]},o.id)})]})}function Ni(){const{taskId:n,workspaceId:a}=Gi(),i=Rt(),o=$t(),{events:r,eventsDropped:f,tasks:u,environments:p,loadSessionEvents:m,loadFindings:g,kill:y,startTask:v,stopTask:b,resumeTask:S,deleteTask:k,workspaces:E,taskSessions:N,loadTaskSessions:C}=ut(),A=_.useRef(void 0),O=_.useRef(void 0),B=_.useRef(void 0),U=_.useRef(void 0),q=_.useRef(void 0),M=i.pathname.endsWith("/stream")?"stream":i.pathname.endsWith("/findings")?"findings":"overview",[R,F]=_.useState(M),[ee,te]=_.useState(!1),[se,re]=_.useState(void 0),[Q,ie]=_.useState(""),I=_.useRef(M);M!==I.current&&(I.current=M,M!==R&&F(M));const D=u.find(ge=>ge.id===n),ne=(D==null?void 0:D.workspaceId)||void 0,oe=E.find(ge=>ge.id===ne);_.useEffect(()=>{if(Q===""){if(oe!=null&&oe.environmentId)ie(oe.environmentId);else if(p.length>0){const ge=p.find(dt=>dt.status==="connected");ie((ge==null?void 0:ge.id)??p[0].id)}}},[Q,oe==null?void 0:oe.environmentId,p]);const z=D?N[D.id]??[]:[];let J;se&&z.some(ge=>ge.id===se)?J=se:J=(D==null?void 0:D.latestSessionId)||void 0;const Se=()=>{te(!0)},ae=()=>{D&&(k(D.id),te(!1),o(D.workspaceId?Bi(D.workspaceId):"/",{replace:!0}))};if((D==null?void 0:D.id)!==O.current&&(O.current=D==null?void 0:D.id,se!==void 0&&re(void 0),Q!==""&&ie("")),_.useEffect(()=>{if(!(D!=null&&D.id))return;const ge=D.id!==U.current,dt=D.latestSessionId!==q.current;(ge||dt)&&(U.current=D.id,q.current=D.latestSessionId,C(D.id))},[D==null?void 0:D.id,D==null?void 0:D.latestSessionId,C]),(D==null?void 0:D.status)!==B.current){const ge=B.current===void 0;B.current=D==null?void 0:D.status;const dt=(D==null?void 0:D.status)==="not_started"?"overview":(D==null?void 0:D.status)==="working"||(D==null?void 0:D.status)==="paused"?"stream":(D==null?void 0:D.status)==="complete"?"findings":void 0;dt&&dt!==R&&!(ge&&M!=="overview")&&F(dt)}const pe=_.useMemo(()=>new Map(u.map(ge=>[ge.id,ge])),[u]),qe=_.useMemo(()=>{const ge=J?r.filter(dt=>dt.sessionId===J):[];return Fh(Ph(ge))},[r,J]),Ot=D?D.dependsOn.some(ge=>{const dt=pe.get(ge);return dt!==void 0&&dt.status!=="complete"}):!1,vn=_.useMemo(()=>VO(n,E,pe),[n,E,pe]);_.useEffect(()=>{J&&J!==A.current&&(A.current=J,m(J))},[J,m]),_.useEffect(()=>{R==="findings"&&ne&&g(ne)},[R,ne,g]);const _t=ge=>{F(ge),o(Ta(n,ge==="overview"?void 0:ge,a))};return c.jsxs("div",{className:V.panelContainer,children:[c.jsx(Ki,{segments:vn}),c.jsxs("div",{className:V.header,children:[c.jsxs("span",{className:V.headerTitle,children:[c.jsx("span",{"data-testid":"task-title",children:(D==null?void 0:D.title)||n}),D&&c.jsx("span",{className:V.taskStatusBadge,"data-testid":"task-status",children:D.status}),(D==null?void 0:D.branch)&&c.jsx("span",{className:V.taskBranch,children:D.branch}),Ot&&c.jsx("span",{className:V.taskBlockedBadge,children:"blocked"})]}),D&&c.jsx(q6,{task:D,sessionId:J,isBlocked:Ot,onStart:()=>v(D.id,void 0,Q),onResume:()=>S(D.id),onStop:()=>b(D.id),onPause:()=>J&&y(J),onDelete:Se,onEdit:()=>o(zC(D.id,a))})]}),c.jsxs("div",{className:V.tabBar,role:"tablist","aria-label":"Task view",children:[c.jsx("button",{role:"tab","aria-selected":R==="overview",className:`${V.tab} ${R==="overview"?V.active:""}`,onClick:()=>_t("overview"),children:"Overview"}),c.jsx("button",{role:"tab","aria-selected":R==="stream",className:`${V.tab} ${R==="stream"?V.active:""}`,onClick:()=>_t("stream"),children:"Stream"}),c.jsx("button",{role:"tab","aria-selected":R==="findings",className:`${V.tab} ${R==="findings"?V.active:""}`,onClick:()=>_t("findings"),children:"Findings"})]}),c.jsxs(Wn,{mode:"wait",children:[R==="overview"&&c.jsx(Nt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:V.overviewContent,"data-testid":"task-overview",children:D?c.jsx($6,{task:D,tasksById:pe,environments:p,workspaces:E,taskSessions:z,selectedEnvId:Q}):c.jsx("div",{className:V.waitingMessage,children:"No additional details"})},"overview"),R==="stream"&&c.jsxs(Nt.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(Y6,{taskSessions:z,selectedSessionId:J,onSelect:ge=>re(ge)}),c.jsx(Gh,{events:qe,eventsDropped:f,emptyState:!J&&D?c.jsxs("div",{className:V.emptyCta,children:[c.jsx("button",{className:V.ctaButton,onClick:()=>v(D.id,void 0,Q),children:"Start Task"}),c.jsx("div",{className:V.ctaDescription,children:"Click to begin agent execution"})]}):J&&qe.length===0?c.jsx("div",{className:V.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),R==="findings"&&c.jsx(Nt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:V.tabContent,children:ne?c.jsx(P6,{workspaceId:ne}):c.jsx("div",{className:V.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),D&&c.jsx(Cc,{isOpen:ee,title:"Delete Task?",description:`"${D.title}" will be permanently removed.`,onConfirm:ae,onCancel:()=>te(!1)})]})}const K6="_container_legrg_1",Z6="_header_legrg_8",X6="_headerTitle_legrg_35",Q6="_badge_legrg_44",W6="_headerActions_legrg_54",J6="_body_legrg_61",e4="_formContent_legrg_73",t4="_section_legrg_85",n4="_label_legrg_91",a4="_nameInput_legrg_98",s4="_fieldInput_legrg_131",i4="_adapterSelect_legrg_164",l4="_readOnlyValue_legrg_198",o4="_codespaceSection_legrg_204",r4="_codespaceActions_legrg_210",c4="_creatingHint_legrg_216",u4="_errorHint_legrg_222",d4="_btnPrimary_legrg_235",f4="_btnGhost_legrg_266",W={container:K6,header:Z6,headerTitle:X6,badge:Q6,headerActions:W6,body:J6,formContent:e4,section:t4,label:n4,nameInput:a4,fieldInput:s4,adapterSelect:i4,readOnlyValue:l4,codespaceSection:o4,codespaceActions:r4,creatingHint:c4,errorHint:u4,btnPrimary:d4,btnGhost:f4},Jr=1,ec=65535;function hf(n){if(!n.trim())return!0;const a=Number(n);return Number.isInteger(a)&&a>=Jr&&a<=ec}function pf(n){try{const a=JSON.parse(n);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function h4({codespaceName:n,onCodespaceNameChange:a,envName:i,onEnvNameChange:o}){const{codespaces:r,codespaceError:f,codespaceListError:u,codespaceCreating:p,createCodespace:m}=ut(),[g,y]=_.useState("pick"),[v,b]=_.useState(""),[S,k]=_.useState("");return g==="create"?c.jsxs("div",{className:W.codespaceSection,children:[c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"Repository"}),c.jsx("input",{type:"text",value:v,onChange:E=>b(E.target.value),placeholder:"owner/repo",className:W.fieldInput,"data-testid":"env-codespace-repo"})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"Machine Type"}),c.jsx("input",{type:"text",value:S,onChange:E=>k(E.target.value),placeholder:"Machine type (optional)...",className:W.fieldInput,"data-testid":"env-codespace-machine"})]}),c.jsxs("div",{className:W.codespaceActions,children:[c.jsx("button",{onClick:()=>{v.trim()&&(m(v.trim(),S.trim()||void 0),y("pick"),b(""),k(""))},disabled:!v.trim(),className:W.btnPrimary,children:"Create"}),c.jsx("button",{onClick:()=>{y("pick"),b(""),k("")},className:W.btnGhost,children:"Cancel"})]})]}):c.jsx("div",{className:W.codespaceSection,children:c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"Codespace"}),!u&&c.jsxs("select",{value:n,onChange:E=>{E.target.value==="__create__"?(y("create"),a("")):(a(E.target.value),E.target.value&&!i.trim()&&o(E.target.value))},disabled:p,className:W.adapterSelect,"data-testid":"env-codespace-select",children:[c.jsx("option",{value:"",children:"Select a codespace..."}),r.map(E=>c.jsxs("option",{value:E.name,children:[E.name," (",E.repository,") — ",E.state]},E.name)),c.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&c.jsx("span",{className:W.creatingHint,children:"Creating codespace..."}),u&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:W.errorHint,children:u}),c.jsx("input",{type:"text",value:n,onChange:E=>a(E.target.value),placeholder:"Or enter codespace name manually...",className:W.fieldInput,"data-testid":"env-codespace-manual"})]}),f&&!u&&c.jsx("span",{className:W.errorHint,children:f})]})})}function v_({mode:n,environmentId:a}){const{environments:i,addEnvironment:o,updateEnvironment:r,listCodespaces:f}=ut(),{showToast:u}=Fi(),p=$t(),m=n==="edit",g=m&&a?i.find(z=>z.id===a):void 0,[y,v]=_.useState(""),[b,S]=_.useState("local"),[k,E]=_.useState(""),[N,C]=_.useState(""),[A,O]=_.useState(""),[B,U]=_.useState(""),[q,M]=_.useState(""),[R,F]=_.useState(""),[ee,te]=_.useState(""),[se,re]=_.useState(null),Q=_.useCallback(()=>{const z={};if(b==="local"){if(k.trim()&&(z.host=k.trim()),N.trim()){const J=Number(N);Number.isInteger(J)&&(z.port=J)}}else if(b==="ssh"){if(z.host=k.trim(),A.trim()&&(z.user=A.trim()),N.trim()){const J=Number(N);Number.isInteger(J)&&(z.sshPort=J)}B.trim()&&(z.identityFile=B.trim())}else b==="docker"?(q.trim()&&(z.image=q.trim()),R.trim()&&(z.repo=R.trim())):b==="codespace"&&(z.codespaceName=ee.trim());return z},[b,k,N,A,B,q,R,ee]),ie=()=>!(!y.trim()||b==="ssh"&&!k.trim()||b==="codespace"&&!ee.trim()||(b==="local"||b==="ssh")&&!hf(N)),I=()=>{ie()&&(o(y.trim(),b,Q()),u("Environment added successfully","success"),p(oo,{replace:!0}))},D=()=>{p(a?yf(a):oo)},ne=_.useCallback((z,J)=>{if(!g||!a)return;const Se=pf(g.adapterConfig),ae=J.trim();ae?Se[z]=ae:delete Se[z],r(a,{adapterConfig:Se})},[g,a,r]),oe=_.useCallback((z,J)=>{if(!g||!a)return;const Se=pf(g.adapterConfig);if(J.trim()){const ae=Number(J);Number.isInteger(ae)&&ae>=Jr&&ae<=ec&&(Se[z]=ae)}else delete Se[z];r(a,{adapterConfig:Se})},[g,a,r]);if(m){if(!g)return c.jsxs("div",{className:W.container,children:[c.jsxs("div",{className:W.header,children:[c.jsx("div",{className:W.headerTitle,children:c.jsx("span",{className:W.badge,children:"edit environment"})}),c.jsx("div",{className:W.headerActions,children:c.jsx("button",{onClick:D,className:W.btnGhost,children:"Back"})})]}),c.jsx("div",{className:W.body,children:c.jsx("div",{className:W.formContent,children:c.jsx("span",{className:W.readOnlyValue,children:"Environment not found"})})})]});const z=pf(g.adapterConfig);return c.jsxs("div",{className:W.container,"data-testid":"env-edit-panel",children:[c.jsxs("div",{className:W.header,children:[c.jsx("div",{className:W.headerTitle,children:c.jsx("span",{className:W.badge,children:"edit environment"})}),c.jsx("div",{className:W.headerActions,children:c.jsx("button",{onClick:D,className:W.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),c.jsx("div",{className:W.body,children:c.jsxs("div",{className:W.formContent,children:[c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"Name"}),c.jsx(fn,{value:g.displayName,onSave:J=>{a&&r(a,{displayName:J})},validate:J=>J.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:se,onActivate:re,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"Adapter Type"}),c.jsx("span",{className:W.readOnlyValue,"data-testid":"env-edit-adapter-type",children:g.adapterType})]}),g.adapterType==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"Host"}),c.jsx(fn,{value:String(z.host??""),onSave:J=>ne("host",J),mode:"edit",fieldId:"host",activeFieldId:se,onActivate:re,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"Port"}),c.jsx(fn,{value:String(z.port??""),onSave:J=>oe("port",J),validate:J=>hf(J)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:se,onActivate:re,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),g.adapterType==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"Host"}),c.jsx(fn,{value:String(z.host??""),onSave:J=>ne("host",J),validate:J=>J.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:se,onActivate:re,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"User"}),c.jsx(fn,{value:String(z.user??""),onSave:J=>ne("user",J),mode:"edit",fieldId:"user",activeFieldId:se,onActivate:re,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"SSH Port"}),c.jsx(fn,{value:String(z.sshPort??""),onSave:J=>oe("sshPort",J),validate:J=>hf(J)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:se,onActivate:re,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"Identity File"}),c.jsx(fn,{value:String(z.identityFile??""),onSave:J=>ne("identityFile",J),mode:"edit",fieldId:"identityFile",activeFieldId:se,onActivate:re,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:W.section,children:[c.jsx("label",{className:W.label,children:"Image"}),c.jsx(fn,{value:String(z.image??""),onSave:J=>ne("image",J),mode:"edit",fieldId:"image",activeFieldId:se,onActivate:re,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"Repo"}),c.jsx(fn,{value:String(z.repo??""),onSave:J=>ne("repo",J),mode:"edit",fieldId:"repo",activeFieldId:se,onActivate:re,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),g.adapterType==="codespace"&&c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,children:"Codespace Name"}),c.jsx(fn,{value:String(z.codespaceName??""),onSave:J=>ne("codespaceName",J),validate:J=>J.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:se,onActivate:re,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return c.jsxs("div",{className:W.container,"data-testid":"env-create-panel",children:[c.jsxs("div",{className:W.header,children:[c.jsx("div",{className:W.headerTitle,children:c.jsx("span",{className:W.badge,children:"new environment"})}),c.jsxs("div",{className:W.headerActions,children:[c.jsx("button",{onClick:I,disabled:!ie(),className:W.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),c.jsx("button",{onClick:D,className:W.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:W.body,children:c.jsxs("div",{className:W.formContent,children:[c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,htmlFor:"env-create-name",children:"Name"}),c.jsx("input",{id:"env-create-name",type:"text",value:y,onChange:z=>v(z.target.value),placeholder:"Environment name...",autoFocus:!0,className:W.nameInput,"data-testid":"env-create-name",onKeyDown:z=>{z.key==="Enter"&&ie()&&I()}})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),c.jsxs("select",{id:"env-create-adapter",value:b,onChange:z=>{S(z.target.value),z.target.value==="codespace"&&f()},className:W.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:W.section,children:[c.jsx("label",{className:W.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:k,onChange:z=>E(z.target.value),placeholder:"Host (optional)...",className:W.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,htmlFor:"env-create-port",children:"Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:Jr,max:ec,value:N,onChange:z=>C(z.target.value),placeholder:"Port (optional)...",className:W.fieldInput,"data-testid":"env-create-port"})]})]}),b==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:k,onChange:z=>E(z.target.value),placeholder:"Host (required)...",className:W.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,htmlFor:"env-create-user",children:"User"}),c.jsx("input",{id:"env-create-user",type:"text",value:A,onChange:z=>O(z.target.value),placeholder:"User (optional)...",className:W.fieldInput,"data-testid":"env-create-user"})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,htmlFor:"env-create-port",children:"SSH Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:Jr,max:ec,value:N,onChange:z=>C(z.target.value),placeholder:"SSH port (optional)...",className:W.fieldInput,"data-testid":"env-create-port"})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,htmlFor:"env-create-identity",children:"Identity File"}),c.jsx("input",{id:"env-create-identity",type:"text",value:B,onChange:z=>U(z.target.value),placeholder:"Identity file (optional)...",className:W.fieldInput,"data-testid":"env-create-identity"})]})]}),b==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,htmlFor:"env-create-image",children:"Image"}),c.jsx("input",{id:"env-create-image",type:"text",value:q,onChange:z=>M(z.target.value),placeholder:"Image (optional)...",className:W.fieldInput,"data-testid":"env-create-image"})]}),c.jsxs("div",{className:W.section,children:[c.jsx("label",{className:W.label,htmlFor:"env-create-repo",children:"Repo"}),c.jsx("input",{id:"env-create-repo",type:"text",value:R,onChange:z=>F(z.target.value),placeholder:"Repo (optional)...",className:W.fieldInput,"data-testid":"env-create-repo"})]})]}),b==="codespace"&&c.jsx(h4,{codespaceName:ee,onCodespaceNameChange:te,envName:y,onEnvNameChange:v})]})})]})}function p4(){return c.jsx(v_,{mode:"new"})}function m4(){const{environmentId:n}=Gi();return c.jsx(v_,{mode:"edit",environmentId:n})}const g4="_layout_11u79_1",v4="_content_11u79_8",y4="_tabPanel_11u79_14",ao={layout:g4,content:v4,tabPanel:y4};function b4(){const n=LO();return c.jsxs("div",{className:ao.layout,children:[c.jsx(Ki,{segments:n}),c.jsx("div",{className:ao.content,children:c.jsx(Jf,{})})]})}const x4="_container_13sb6_1",_4="_envHeader_13sb6_6",S4="_envTitleRow_13sb6_10",T4="_statusDot_13sb6_16",C4="_envName_13sb6_21",k4="_statusBadge_13sb6_27",E4="_envMeta_13sb6_33",N4="_metaTag_13sb6_39",A4="_actions_13sb6_51",j4="_provisionMessage_13sb6_59",w4="_errorMessage_13sb6_64",D4="_section_13sb6_69",M4="_sectionHeader_13sb6_73",R4="_createForm_13sb6_85",O4="_createInput_13sb6_92",B4="_cardList_13sb6_121",I4="_card_13sb6_121",L4="_cardHeader_13sb6_138",U4="_cardName_13sb6_144",z4="_cardActions_13sb6_149",V4="_cardDescription_13sb6_154",H4="_cardMeta_13sb6_160",G4="_repoLink_13sb6_166",P4="_empty_13sb6_174",F4="_btnPrimary_13sb6_180",$4="_btnOutline_13sb6_214",q4="_btnSmall_13sb6_241",Y4="_btnDanger_13sb6_267",De={container:x4,envHeader:_4,envTitleRow:S4,statusDot:T4,envName:C4,statusBadge:k4,envMeta:E4,metaTag:N4,actions:A4,provisionMessage:j4,errorMessage:w4,section:D4,sectionHeader:M4,createForm:R4,createInput:O4,cardList:B4,card:I4,cardHeader:L4,cardName:U4,cardActions:z4,cardDescription:V4,cardMeta:H4,repoLink:G4,empty:P4,btnPrimary:F4,btnOutline:$4,btnSmall:q4,btnDanger:Y4},K4={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function Z4(){const{environmentId:n}=Gi(),a=$t(),{environments:i,workspaces:o,sessions:r,provisionStatus:f,provisionEnvironment:u,stopEnvironment:p,removeEnvironment:m,createWorkspace:g,archiveWorkspace:y,workspaceCreating:v}=ut(),[b,S]=_.useState(!1),[k,E]=_.useState(void 0),[N,C]=_.useState(!1),[A,O]=_.useState(""),B=i.find(I=>I.id===n);if(!n||!B)return c.jsx(es,{to:oo,replace:!0});const U=o.filter(I=>I.environmentId===B.id),q=r.filter(I=>I.environmentId===B.id),M=K4[B.status]||"var(--text-tertiary)",R=B.status==="connected",F=B.status==="connecting",ee=B.status==="disconnected"||B.status==="error",te=B.id in f?f[B.id]:void 0,se=()=>{m(B.id),S(!1),a(oo,{replace:!0})},re=()=>{!A.trim()||v||(g(A.trim(),void 0,void 0,B.id),O(""),C(!1))},Q=I=>{I.key==="Enter"?re():I.key==="Escape"&&(C(!1),O(""))},ie=I=>{y(I),E(void 0)};return c.jsxs("div",{className:De.container,children:[c.jsx(Cc,{isOpen:b,title:"Delete Environment?",description:`"${B.displayName||B.id}" will be permanently removed along with all its data.`,onConfirm:se,onCancel:()=>S(!1)}),c.jsxs("div",{className:De.envHeader,children:[c.jsxs("div",{className:De.envTitleRow,children:[c.jsx("span",{className:De.statusDot,style:{color:M},children:"●"}),c.jsx("h2",{className:De.envName,children:B.displayName||B.id}),c.jsx("span",{className:De.statusBadge,style:{color:M},children:B.status})]}),c.jsxs("div",{className:De.envMeta,children:[c.jsxs("span",{className:De.metaTag,children:["Adapter: ",B.adapterType]}),q.length>0&&c.jsxs("span",{className:De.metaTag,children:[q.length," session",q.length!==1?"s":""]})]})]}),c.jsxs("div",{className:De.actions,children:[R&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:De.btnPrimary,onClick:()=>a(fb(B.id)),children:"New Chat"}),c.jsx("button",{className:De.btnOutline,onClick:()=>p(B.id),children:"Stop"})]}),ee&&c.jsx("button",{className:De.btnPrimary,onClick:()=>u(B.id),children:B.status==="error"?"Retry":"Connect"}),F&&te!==void 0&&c.jsx("span",{className:De.provisionMessage,children:te.message}),B.status==="error"&&(te==null?void 0:te.stage)==="error"&&c.jsx("span",{className:De.errorMessage,children:te.message}),c.jsx("button",{className:De.btnOutline,onClick:()=>a(HC(B.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),c.jsx("button",{className:De.btnDanger,onClick:()=>S(!0),children:"Delete"})]}),c.jsxs("div",{className:De.section,children:[c.jsxs("div",{className:De.sectionHeader,children:[c.jsx("h3",{children:"Workspaces"}),c.jsx("button",{className:De.btnPrimary,onClick:()=>C(!0),disabled:v,children:"+ New Workspace"})]}),N&&c.jsxs("div",{className:De.createForm,children:[c.jsx("input",{type:"text",value:A,onChange:I=>O(I.target.value),onKeyDown:Q,placeholder:"Workspace name...",autoFocus:!0,disabled:v,className:De.createInput,"data-testid":"workspace-create-input"}),c.jsx("button",{onClick:re,className:De.btnPrimary,disabled:v||!A.trim(),"data-testid":"workspace-create-submit",children:v?c.jsx(Hh,{size:"sm",label:"Creating"}):"Create"}),c.jsx("button",{onClick:()=>{C(!1),O("")},className:De.btnOutline,children:"Cancel"})]}),U.length===0&&!N&&c.jsx("p",{className:De.empty,children:"No workspaces yet. Create one to get started."}),c.jsx("div",{className:De.cardList,children:U.map(I=>c.jsx(X4,{workspace:I,confirmArchiveId:k,onOpen:()=>a(Bi(I.id)),onArchive:()=>E(I.id),onConfirmArchive:()=>ie(I.id),onCancelArchive:()=>E(void 0)},I.id))})]})]})}function X4({workspace:n,confirmArchiveId:a,onOpen:i,onArchive:o,onConfirmArchive:r,onCancelArchive:f}){const u=a===n.id,p=n.repoUrl&&/^https?:\/\//.test(n.repoUrl);return c.jsxs("div",{className:De.card,"data-testid":"workspace-card",children:[c.jsxs("div",{className:De.cardHeader,children:[c.jsx("strong",{className:De.cardName,children:n.name}),c.jsxs("div",{className:De.cardActions,children:[c.jsx("button",{className:De.btnSmall,onClick:i,children:"Open"}),u?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:De.btnDanger,onClick:r,children:"Confirm"}),c.jsx("button",{className:De.btnSmall,onClick:f,children:"Cancel"})]}):c.jsx("button",{className:De.btnSmall,onClick:o,children:"Archive"})]})]}),n.description&&c.jsx("p",{className:De.cardDescription,children:n.description}),n.repoUrl&&c.jsx("div",{className:De.cardMeta,children:p?c.jsx("a",{href:n.repoUrl,target:"_blank",rel:"noopener noreferrer",className:De.repoLink,children:n.repoUrl}):c.jsx("span",{children:n.repoUrl})})]})}const Q4={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function W4(){const a=Rt().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=Q4[a],o=IO(i);return c.jsxs("div",{className:ao.layout,children:[c.jsx(Ki,{segments:o}),c.jsx("div",{className:ao.content,children:c.jsx("div",{className:ao.tabPanel,children:c.jsx(Jf,{})},a)})]})}const J4="_section_1ingb_14",e5="_sectionTitle_1ingb_26",t5="_sectionDescription_1ingb_35",n5="_tokenList_1ingb_48",a5="_tokenRow_1ingb_55",s5="_tokenBadge_1ingb_68",i5="_tokenName_1ingb_83",l5="_tokenTarget_1ingb_90",o5="_deleteButton_1ingb_99",r5="_addForm_1ingb_113",c5="_formRow_1ingb_119",u5="_input_1ingb_125",d5="_select_1ingb_155",f5="_addButton_1ingb_187",h5="_emptyStateInfo_1ingb_221",p5="_themeOptions_1ingb_229",m5="_themeOption_1ingb_229",g5="_themeOptionSelected_1ingb_254",v5="_themeOptionHeader_1ingb_259",y5="_themeOptionLabel_1ingb_266",b5="_themeOptionDesc_1ingb_273",x5="_variantToggle_1ingb_279",_5="_variantButton_1ingb_286",S5="_variantActive_1ingb_305",T5="_themeSwatches_1ingb_311",C5="_themeSwatch_1ingb_311",k5="_systemToggle_1ingb_325",E5="_systemToggleHint_1ingb_341",N5="_themeActive_1ingb_348",A5="_aboutGrid_1ingb_354",j5="_aboutItem_1ingb_360",w5="_aboutLabel_1ingb_373",D5="_aboutValue_1ingb_379",M5="_aboutDot_1ingb_387",R5="_aboutDotConnected_1ingb_394",O5="_aboutDotDisconnected_1ingb_398",de={section:J4,sectionTitle:e5,sectionDescription:t5,tokenList:n5,tokenRow:a5,tokenBadge:s5,tokenName:i5,tokenTarget:l5,deleteButton:o5,addForm:r5,formRow:c5,input:u5,select:d5,addButton:f5,emptyStateInfo:h5,themeOptions:p5,themeOption:m5,themeOptionSelected:g5,themeOptionHeader:v5,themeOptionLabel:y5,themeOptionDesc:b5,variantToggle:x5,variantButton:_5,variantActive:S5,themeSwatches:T5,themeSwatch:C5,systemToggle:k5,systemToggleHint:E5,themeActive:N5,aboutGrid:A5,aboutItem:j5,aboutLabel:w5,aboutValue:D5,aboutDot:M5,aboutDotConnected:R5,aboutDotDisconnected:O5},B5=[{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"}]}];function I5(){const{credentialProviders:n,updateCredentialProviders:a}=ut(),i=(o,r)=>{const f={...n};o==="claude"?f.claude=r:f[o]=r,a(f)};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:B5.map(o=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenName,children:o.label}),c.jsx("span",{className:de.tokenTarget,children:o.description}),c.jsx("select",{className:de.select,value:n[o.key],onChange:r=>i(o.key,r.target.value),children:o.options.map(r=>c.jsx("option",{value:r.value,children:r.label},r.value))})]},o.key))})]})}const L5=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function U5(){const{tokens:n,setToken:a,deleteToken:i}=ut(),{showToast:o}=Fi(),[r,f]=_.useState(""),[u,p]=_.useState(""),[m,g]=_.useState("env_var"),[y,v]=_.useState(""),[b,S]=_.useState(null),k=C=>{if(C.preventDefault(),!r||!u)return;const A=m==="env_var"?y||r.toUpperCase()+"_TOKEN":"";a(r,u,m,A,m==="file"?y:""),o("Token saved successfully","success"),f(""),p(""),v("")},E=C=>{S(C)},N=()=>{b&&(i(b),o("Token deleted","info")),S(null)};return c.jsxs(c.Fragment,{children:[c.jsx(Cc,{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(C=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenBadge,children:C.tokenType}),c.jsx("span",{className:de.tokenName,children:C.name}),c.jsx("span",{className:de.tokenTarget,children:C.tokenType==="env_var"?C.envVar:C.filePath}),c.jsx("button",{className:de.deleteButton,onClick:()=>E(C.name),title:`Delete ${C.name}`,children:"×"})]},C.name))}),c.jsxs("form",{className:de.addForm,onSubmit:k,children:[c.jsxs("div",{className:de.formRow,children:[c.jsx("input",{className:de.input,type:"text",placeholder:"Token name",value:r,onChange:C=>f(C.target.value)}),c.jsx("input",{className:de.input,type:"password",placeholder:"Value",value:u,onChange:C=>p(C.target.value)})]}),c.jsxs("div",{className:de.formRow,children:[c.jsx("select",{className:de.select,value:m,onChange:C=>g(C.target.value),children:L5.map(C=>c.jsx("option",{value:C.value,children:C.label},C.value))}),c.jsx("input",{className:de.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:y,onChange:C=>v(C.target.value)}),c.jsx("button",{className:de.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function z5(){return c.jsxs(c.Fragment,{children:[c.jsx(I5,{}),c.jsx(U5,{})]})}const V5="_container_xb7ms_1",H5="_header_xb7ms_7",G5="_form_xb7ms_19",P5="_formActions_xb7ms_87",F5="_list_xb7ms_93",$5="_card_xb7ms_99",q5="_active_xb7ms_109",Y5="_cardHeader_xb7ms_113",K5="_cardTitle_xb7ms_123",Z5="_defaultBadge_xb7ms_129",X5="_cardActions_xb7ms_143",Q5="_description_xb7ms_148",W5="_meta_xb7ms_154",J5="_promptDetails_xb7ms_171",eI="_promptText_xb7ms_183",tI="_empty_xb7ms_200",nI="_btnPrimary_xb7ms_206",aI="_btnSecondary_xb7ms_240",sI="_btnSmall_xb7ms_267",iI="_btnDanger_xb7ms_293",lI="_typeToggle_xb7ms_336",oI="_typeBadge_xb7ms_350",rI="_scriptEditor_xb7ms_364",cI="_optional_xb7ms_371",Fe={container:V5,header:H5,form:G5,formActions:P5,list:F5,card:$5,active:q5,cardHeader:Y5,cardTitle:K5,defaultBadge:Z5,cardActions:X5,description:Q5,meta:W5,promptDetails:J5,promptText:eI,empty:tI,btnPrimary:nI,btnSecondary:aI,btnSmall:sI,btnDanger:iI,typeToggle:lI,typeBadge:oI,scriptEditor:rI,optional:cI};function uI(){const{personas:n,createPersona:a,updatePersona:i,deletePersona:o,appDefaultPersonaId:r,setAppDefaultPersonaId:f}=ut(),[u,p]=_.useState(null),[m,g]=_.useState(!1),[y,v]=_.useState(null),[b,S]=_.useState(""),[k,E]=_.useState(""),[N,C]=_.useState(""),[A,O]=_.useState("claude-code"),[B,U]=_.useState("sonnet"),[q,M]=_.useState(0),[R,F]=_.useState("agent"),[ee,te]=_.useState(""),se=()=>{S(""),E(""),C(""),O("claude-code"),U("sonnet"),M(0),F("agent"),te("")},re=()=>{se(),p(null),g(!0)},Q=z=>{S(z.name),E(z.description),C(z.systemPrompt);const J=z.type==="script"?"script":"agent";O(J==="script"?z.runtime||"genaiscript":z.runtime),U(z.model),M(z.maxTurns),F(J),te(z.script||""),p(z),g(!1)},ie=z=>{F(z),z==="script"?O("genaiscript"):A==="genaiscript"&&O("claude-code")},I=z=>{if(z.preventDefault(),!!b.trim()){if(R==="script"){if(!ee.trim())return}else if(!N.trim()||!A||!B)return;u?(i(u.id,b,k,N,A,B,q,R,ee),p(null)):(a(b,k,N,A,B,q,R,ee),g(!1)),se()}},D=z=>{o(z),v(null),(u==null?void 0:u.id)===z&&(p(null),se())},ne=()=>{p(null),g(!1),se()},oe=()=>c.jsxs("form",{onSubmit:I,className:Fe.form,children:[c.jsx("h3",{children:u?"Edit Persona":"Create Persona"}),c.jsxs("div",{className:Fe.typeToggle,"data-testid":"persona-type-toggle",children:[c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:R==="agent",onChange:()=>ie("agent")}),"Agent"]}),c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"script",checked:R==="script",onChange:()=>ie("script")}),"Script"]})]}),c.jsxs("label",{children:["Name",c.jsx("input",{type:"text",value:b,onChange:z=>S(z.target.value),placeholder:R==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0})]}),c.jsxs("label",{children:["Description",c.jsx("input",{type:"text",value:k,onChange:z=>E(z.target.value),placeholder:"Brief description..."})]}),c.jsxs("label",{children:["Runtime",c.jsx("select",{value:A,onChange:z=>O(z.target.value),"data-testid":"persona-runtime-select",children:R==="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:"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)"})]})})]}),R==="agent"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model",c.jsx("input",{type:"text",value:B,onChange:z=>U(z.target.value),placeholder:"e.g. sonnet"})]}),c.jsxs("label",{children:["Max Turns",c.jsx("input",{type:"number",value:q,onChange:z=>M(parseInt(z.target.value,10)||0),min:0})]}),c.jsxs("label",{children:["System Prompt",c.jsx("textarea",{value:N,onChange:z=>C(z.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]})]}),R==="script"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model ",c.jsx("span",{className:Fe.optional,children:"(optional)"}),c.jsx("input",{type:"text",value:B,onChange:z=>U(z.target.value),placeholder:"e.g. sonnet (leave empty for script-only)"})]}),c.jsxs("label",{children:["System Prompt ",c.jsx("span",{className:Fe.optional,children:"(optional)"}),c.jsx("textarea",{value:N,onChange:z=>C(z.target.value),placeholder:"Optional context for the script...",rows:4})]}),c.jsxs("label",{children:["Script",c.jsx("textarea",{value:ee,onChange:z=>te(z.target.value),placeholder:`script({ model: "openai:gpt-4o" });
94
-
95
- const grackle = await host.mcpServer({
96
- id: "grackle",
97
- url: env.vars.GRACKLE_MCP_URL,
98
- });
99
-
100
- $\`Summarize the current tasks.\`;`,rows:20,className:Fe.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),c.jsxs("div",{className:Fe.formActions,children:[c.jsx("button",{type:"submit",className:Fe.btnPrimary,children:u?"Save":"Create"}),c.jsx("button",{type:"button",onClick:ne,className:Fe.btnSecondary,children:"Cancel"})]})]});return c.jsxs("div",{className:Fe.container,children:[c.jsxs("div",{className:Fe.header,children:[c.jsx("h2",{children:"Personas"}),c.jsx("button",{onClick:re,className:Fe.btnPrimary,children:"+ New Persona"})]}),(m||u)&&oe(),n.length===0&&!m?c.jsx("p",{className:Fe.empty,children:"No personas yet. Create one to get started."}):c.jsx("div",{className:Fe.list,children:n.map(z=>{const J=r===z.id,Se=z.type==="script";return c.jsxs("div",{className:`${Fe.card} ${(u==null?void 0:u.id)===z.id?Fe.active:""}`,"data-testid":`persona-card-${z.id}`,children:[c.jsxs("div",{className:Fe.cardHeader,children:[c.jsxs("span",{className:Fe.cardTitle,children:[c.jsx("strong",{children:z.name}),c.jsx("span",{className:Fe.typeBadge,"data-testid":`persona-type-badge-${z.id}`,children:Se?"Script":"Agent"}),J&&c.jsx("span",{className:Fe.defaultBadge,"data-testid":`persona-default-badge-${z.id}`,children:"App Default"})]}),c.jsxs("div",{className:Fe.cardActions,children:[!J&&c.jsx("button",{onClick:()=>f(z.id),className:Fe.btnSmall,"data-testid":`persona-set-default-${z.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>Q(z),className:Fe.btnSmall,children:"Edit"}),y===z.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>D(z.id),className:Fe.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>v(null),className:Fe.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>v(z.id),className:Fe.btnSmall,children:"Delete"})]})]}),z.description&&c.jsx("p",{className:Fe.description,children:z.description}),c.jsxs("div",{className:Fe.meta,children:[z.runtime&&c.jsxs("span",{children:["Runtime: ",z.runtime]}),z.model&&c.jsxs("span",{children:["Model: ",z.model]}),z.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",z.maxTurns]})]}),Se?c.jsxs("details",{className:Fe.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:Fe.promptText,children:z.script})]}):c.jsxs("details",{className:Fe.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:Fe.promptText,children:z.systemPrompt})]})]},z.id)})})]})}function dI(){return c.jsx(uI,{})}function fI(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:o,setPreferSystem:r}=bb();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:vc.filter(f=>!f.hidden).map(f=>{const u=!!(f.variantLightId&&f.variantDarkId),p=u?n===f.id||n===f.variantLightId||n===f.variantDarkId:n===f.id,m=u&&a===f.variantLightId;return c.jsxs("button",{type:"button",className:`${de.themeOption} ${p?de.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(f.id),children:[c.jsxs("span",{className:de.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:de.themeOptionLabel,children:f.label}),c.jsx("span",{className:de.themeOptionDesc,children:f.description})]}),u&&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(f.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(f.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(f.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(f.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),f.swatches&&c.jsx("span",{className:de.themeSwatches,children:f.swatches.map((g,y)=>c.jsx("span",{className:de.themeSwatch,style:{background:g}},y))})]},f.id)})}),c.jsxs("label",{className:de.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:o,onChange:f=>r(f.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 hI(){return c.jsx(fI,{})}function pI(){const{connected:n,environments:a,sessions:i}=ut(),o=a.filter(u=>u.status==="connected").length,r=a.length,f=i.filter(u=>["running","idle"].includes(u.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:[o,"/",r," connected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Active Sessions"}),c.jsx("span",{className:de.aboutValue,children:f})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Version"}),c.jsx("span",{className:de.aboutValue,children:"0.57.1"})]})]})]})}function mI(){return c.jsx(pI,{})}const gI="_wizard_1260s_1",vI="_container_1260s_10",yI="_stepContent_1260s_19",bI="_logoArea_1260s_28",xI="_logoImage_1260s_32",_I="_heading_1260s_41",SI="_tagline_1260s_49",TI="_subtitle_1260s_56",CI="_featureList_1260s_64",kI="_runtimeGrid_1260s_89",EI="_runtimeCard_1260s_101",NI="_runtimeName_1260s_133",AI="_runtimeDescription_1260s_139",jI="_buttonRow_1260s_144",wI="_primaryButton_1260s_151",DI="_ghostButton_1260s_185",MI="_dots_1260s_213",RI="_dot_1260s_213",st={wizard:gI,container:vI,stepContent:yI,logoArea:bI,logoImage:xI,heading:_I,tagline:SI,subtitle:TI,featureList:CI,runtimeGrid:kI,runtimeCard:EI,runtimeName:NI,runtimeDescription:AI,buttonRow:jI,primaryButton:wI,ghostButton:DI,dots:MI,dot:RI};function OI({onNext:n}){return c.jsxs("div",{className:st.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:st.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:st.logoImage})}),c.jsx("h1",{className:st.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:st.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:st.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function BI({onNext:n,onBack:a}){return c.jsxs("div",{className:st.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:st.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:st.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:st.buttonRow,children:[c.jsx("button",{type:"button",className:st.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:st.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const II=[{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"}];function LI({currentRuntime:n,onFinish:a,onBack:i,finishDisabled:o}){const[r,f]=_.useState(n||"claude-code");return _.useEffect(()=>{n&&f(n)},[n]),c.jsxs("div",{className:st.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:st.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:st.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:st.runtimeGrid,children:II.map(u=>c.jsxs("button",{type:"button",className:st.runtimeCard,"data-selected":r===u.id,"aria-pressed":r===u.id,"data-testid":`runtime-card-${u.id}`,onClick:()=>f(u.id),children:[c.jsx("span",{className:st.runtimeName,children:u.name}),c.jsx("span",{className:st.runtimeDescription,children:u.description})]},u.id))}),c.jsxs("div",{className:st.buttonRow,children:[c.jsx("button",{type:"button",className:st.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:st.primaryButton,onClick:()=>a(r),disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const UI=3,$0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3"};function zI(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:o}=ut(),r=$t(),[f,u]=_.useState(0),p=n.find(g=>g.id==="claude-code"),m=_.useCallback(g=>{if(p&&g!==p.runtime){const v=$0[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,v)}const y=n.find(v=>v.id===k0);if(y&&g!==y.runtime){const v=$0[g]??"sonnet";a(k0,void 0,void 0,void 0,g,v)}i(),r("/",{replace:!0})},[p,n,a,i,r]);return o===!0?c.jsx(es,{to:"/",replace:!0}):c.jsx("div",{className:st.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:st.container,children:[c.jsx(Wn,{mode:"wait",children:c.jsxs(Nt.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[f===0&&c.jsx(OI,{onNext:()=>u(1)}),f===1&&c.jsx(BI,{onNext:()=>u(2),onBack:()=>u(0)}),f===2&&c.jsx(LI,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>u(1),finishDisabled:!p})]},f)}),c.jsx("div",{className:st.dots,children:Array.from({length:UI},(g,y)=>c.jsx("span",{className:st.dot,"data-active":y===f},y))})]})})}const VI="_root_zndgp_1",HI="_body_zndgp_7",GI="_main_zndgp_19",PI="_sidebarWrapper_zndgp_26",FI="_overlay_zndgp_51",$l={root:VI,body:HI,main:GI,sidebarWrapper:PI,overlay:FI},$I=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function qI(){const{lastSpawnedId:n,environments:a,connected:i,onboardingCompleted:o}=ut(),{showToast:r}=Fi();GM(a,r);const f=$t(),u=Rt(),[p,m]=_.useState(!1),g=_.useCallback(()=>m(y=>!y),[]);return _.useEffect(()=>{m(!1)},[u.pathname]),_.useEffect(()=>{if(!p)return;const y=v=>{v.key==="Escape"&&m(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[p]),_.useEffect(()=>{n&&!u.pathname.includes("/tasks/")&&f(db(n),{replace:!0})},[n,f,u.pathname]),i&&o===!1?c.jsx(es,{to:"/setup",replace:!0}):c.jsxs("div",{className:$l.root,children:[c.jsx(Dk,{onToggleSidebar:g,sidebarOpen:p}),c.jsx(Lk,{}),c.jsxs("div",{className:$l.body,children:[c.jsx("div",{className:$l.sidebarWrapper,"data-sidebar-open":p,children:c.jsx(tD,{})}),p&&c.jsx("div",{className:$l.overlay,"data-testid":"drawer-overlay",onClick:()=>m(!1)}),c.jsxs("div",{className:$l.main,children:[c.jsx(Jf,{}),c.jsx(mD,{})]})]}),c.jsx(AD,{})]})}function YI(){return c.jsxs(sC,{children:[c.jsx(Ie,{path:"setup",element:c.jsx(zI,{})}),c.jsxs(Ie,{element:c.jsx(qI,{}),children:[c.jsx(Ie,{index:!0,element:c.jsx(mO,{})}),c.jsx(Ie,{path:"chat",element:c.jsx(OO,{})}),c.jsx(Ie,{path:"tasks",element:c.jsx(hO,{})}),c.jsx(Ie,{path:"tasks/new",element:c.jsx(D6,{})}),c.jsx(Ie,{path:"tasks/:taskId",element:c.jsx(Ni,{})}),c.jsx(Ie,{path:"tasks/:taskId/stream",element:c.jsx(Ni,{})}),c.jsx(Ie,{path:"tasks/:taskId/findings",element:c.jsx(Ni,{})}),c.jsx(Ie,{path:"tasks/:taskId/edit",element:c.jsx(G0,{})}),c.jsx(Ie,{path:"workspaces",element:c.jsx(es,{to:"/environments",replace:!0})}),c.jsx(Ie,{path:"workspaces/:workspaceId",element:c.jsx(c6,{})}),c.jsx(Ie,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Ni,{})}),c.jsx(Ie,{path:"workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(Ni,{})}),c.jsx(Ie,{path:"workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(Ni,{})}),c.jsx(Ie,{path:"workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(G0,{})}),c.jsx(Ie,{path:"sessions/new",element:c.jsx(HO,{})}),c.jsx(Ie,{path:"sessions/:sessionId",element:c.jsx(FO,{})}),c.jsxs(Ie,{path:"environments",element:c.jsx(b4,{}),children:[c.jsx(Ie,{index:!0,element:c.jsx(pO,{})}),c.jsx(Ie,{path:"new",element:c.jsx(p4,{})}),c.jsx(Ie,{path:":environmentId",element:c.jsx(Z4,{})}),c.jsx(Ie,{path:":environmentId/edit",element:c.jsx(m4,{})})]}),c.jsxs(Ie,{path:"settings",element:c.jsx(W4,{}),children:[c.jsx(Ie,{index:!0,element:c.jsx(es,{to:"credentials",replace:!0})}),c.jsx(Ie,{path:"environments",element:c.jsx(es,{to:"/environments",replace:!0})}),c.jsx(Ie,{path:"credentials",element:c.jsx(z5,{})}),c.jsx(Ie,{path:"tokens",element:c.jsx(es,{to:"../credentials",replace:!0})}),c.jsx(Ie,{path:"personas",element:c.jsx(dI,{})}),c.jsx(Ie,{path:"appearance",element:c.jsx(hI,{})}),c.jsx(Ie,{path:"about",element:c.jsx(mI,{})})]}),c.jsx(Ie,{path:"*",element:c.jsx(es,{to:"/",replace:!0})})]})]})}const KI=1e4;function ZI(){const{onboardingCompleted:n}=ut(),[a,i]=_.useState(!1);_.useEffect(()=>{if(n!==void 0)return;const r=setTimeout(()=>i(!0),KI);return()=>clearTimeout(r)},[n]);const o=n===void 0&&!a;return c.jsx(Wn,{mode:"wait",children:o?c.jsx(Nt.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(HM,{})},"splash"):c.jsx(Nt.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(jC,{children:c.jsx(YI,{})})},"app")})}function XI(){const n=$I?mk:lk;return c.jsx(_k,{children:c.jsx(vk,{children:c.jsx(n,{children:c.jsx(ZI,{})})})})}qS.createRoot(document.getElementById("root")).render(c.jsx(_.StrictMode,{children:c.jsx(XI,{})}));