@amenophis1er/foreman 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,67 @@
1
+ (function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const g of h.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&o(g)}).observe(document,{childList:!0,subtree:!0});function u(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(f){if(f.ep)return;f.ep=!0;const h=u(f);fetch(f.href,h)}})();function lm(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var fc={exports:{}},gi={};var Rh;function am(){if(Rh)return gi;Rh=1;var s=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function u(o,f,h){var g=null;if(h!==void 0&&(g=""+h),f.key!==void 0&&(g=""+f.key),"key"in f){h={};for(var b in f)b!=="key"&&(h[b]=f[b])}else h=f;return f=h.ref,{$$typeof:s,type:o,key:g,ref:f!==void 0?f:null,props:h}}return gi.Fragment=c,gi.jsx=u,gi.jsxs=u,gi}var Oh;function im(){return Oh||(Oh=1,fc.exports=am()),fc.exports}var a=im(),hc={exports:{}},me={};var Nh;function sm(){if(Nh)return me;Nh=1;var s=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),g=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),S=Symbol.iterator;function H(m){return m===null||typeof m!="object"?null:(m=S&&m[S]||m["@@iterator"],typeof m=="function"?m:null)}var Q={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F=Object.assign,C={};function _(m,N,Z){this.props=m,this.context=N,this.refs=C,this.updater=Z||Q}_.prototype.isReactComponent={},_.prototype.setState=function(m,N){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,N,"setState")},_.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function V(){}V.prototype=_.prototype;function $(m,N,Z){this.props=m,this.context=N,this.refs=C,this.updater=Z||Q}var W=$.prototype=new V;W.constructor=$,F(W,_.prototype),W.isPureReactComponent=!0;var se=Array.isArray;function E(){}var B={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function R(m,N,Z){var P=Z.ref;return{$$typeof:s,type:m,key:N,ref:P!==void 0?P:null,props:Z}}function ne(m,N){return R(m.type,N,m.props)}function pe(m){return typeof m=="object"&&m!==null&&m.$$typeof===s}function fe(m){var N={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(Z){return N[Z]})}var ye=/\/+/g;function re(m,N){return typeof m=="object"&&m!==null&&m.key!=null?fe(""+m.key):N.toString(36)}function ke(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(E,E):(m.status="pending",m.then(function(N){m.status==="pending"&&(m.status="fulfilled",m.value=N)},function(N){m.status==="pending"&&(m.status="rejected",m.reason=N)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function M(m,N,Z,P,le){var ae=typeof m;(ae==="undefined"||ae==="boolean")&&(m=null);var xe=!1;if(m===null)xe=!0;else switch(ae){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(m.$$typeof){case s:case c:xe=!0;break;case w:return xe=m._init,M(xe(m._payload),N,Z,P,le)}}if(xe)return le=le(m),xe=P===""?"."+re(m,0):P,se(le)?(Z="",xe!=null&&(Z=xe.replace(ye,"$&/")+"/"),M(le,N,Z,"",function(Be){return Be})):le!=null&&(pe(le)&&(le=ne(le,Z+(le.key==null||m&&m.key===le.key?"":(""+le.key).replace(ye,"$&/")+"/")+xe)),N.push(le)),1;xe=0;var I=P===""?".":P+":";if(se(m))for(var K=0;K<m.length;K++)P=m[K],ae=I+re(P,K),xe+=M(P,N,Z,ae,le);else if(K=H(m),typeof K=="function")for(m=K.call(m),K=0;!(P=m.next()).done;)P=P.value,ae=I+re(P,K++),xe+=M(P,N,Z,ae,le);else if(ae==="object"){if(typeof m.then=="function")return M(ke(m),N,Z,P,le);throw N=String(m),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.")}return xe}function L(m,N,Z){if(m==null)return m;var P=[],le=0;return M(m,P,"","",function(ae){return N.call(Z,ae,le++)}),P}function J(m){if(m._status===-1){var N=m._result;N=N(),N.then(function(Z){(m._status===0||m._status===-1)&&(m._status=1,m._result=Z)},function(Z){(m._status===0||m._status===-1)&&(m._status=2,m._result=Z)}),m._status===-1&&(m._status=0,m._result=N)}if(m._status===1)return m._result.default;throw m._result}var ve=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var N=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(N))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},Se={map:L,forEach:function(m,N,Z){L(m,function(){N.apply(this,arguments)},Z)},count:function(m){var N=0;return L(m,function(){N++}),N},toArray:function(m){return L(m,function(N){return N})||[]},only:function(m){if(!pe(m))throw Error("React.Children.only expected to receive a single React element child.");return m}};return me.Activity=k,me.Children=Se,me.Component=_,me.Fragment=u,me.Profiler=f,me.PureComponent=$,me.StrictMode=o,me.Suspense=y,me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,me.__COMPILER_RUNTIME={__proto__:null,c:function(m){return B.H.useMemoCache(m)}},me.cache=function(m){return function(){return m.apply(null,arguments)}},me.cacheSignal=function(){return null},me.cloneElement=function(m,N,Z){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var P=F({},m.props),le=m.key;if(N!=null)for(ae in N.key!==void 0&&(le=""+N.key),N)!q.call(N,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&N.ref===void 0||(P[ae]=N[ae]);var ae=arguments.length-2;if(ae===1)P.children=Z;else if(1<ae){for(var xe=Array(ae),I=0;I<ae;I++)xe[I]=arguments[I+2];P.children=xe}return R(m.type,le,P)},me.createContext=function(m){return m={$$typeof:g,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:h,_context:m},m},me.createElement=function(m,N,Z){var P,le={},ae=null;if(N!=null)for(P in N.key!==void 0&&(ae=""+N.key),N)q.call(N,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(le[P]=N[P]);var xe=arguments.length-2;if(xe===1)le.children=Z;else if(1<xe){for(var I=Array(xe),K=0;K<xe;K++)I[K]=arguments[K+2];le.children=I}if(m&&m.defaultProps)for(P in xe=m.defaultProps,xe)le[P]===void 0&&(le[P]=xe[P]);return R(m,ae,le)},me.createRef=function(){return{current:null}},me.forwardRef=function(m){return{$$typeof:b,render:m}},me.isValidElement=pe,me.lazy=function(m){return{$$typeof:w,_payload:{_status:-1,_result:m},_init:J}},me.memo=function(m,N){return{$$typeof:v,type:m,compare:N===void 0?null:N}},me.startTransition=function(m){var N=B.T,Z={};B.T=Z;try{var P=m(),le=B.S;le!==null&&le(Z,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(E,ve)}catch(ae){ve(ae)}finally{N!==null&&Z.types!==null&&(N.types=Z.types),B.T=N}},me.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},me.use=function(m){return B.H.use(m)},me.useActionState=function(m,N,Z){return B.H.useActionState(m,N,Z)},me.useCallback=function(m,N){return B.H.useCallback(m,N)},me.useContext=function(m){return B.H.useContext(m)},me.useDebugValue=function(){},me.useDeferredValue=function(m,N){return B.H.useDeferredValue(m,N)},me.useEffect=function(m,N){return B.H.useEffect(m,N)},me.useEffectEvent=function(m){return B.H.useEffectEvent(m)},me.useId=function(){return B.H.useId()},me.useImperativeHandle=function(m,N,Z){return B.H.useImperativeHandle(m,N,Z)},me.useInsertionEffect=function(m,N){return B.H.useInsertionEffect(m,N)},me.useLayoutEffect=function(m,N){return B.H.useLayoutEffect(m,N)},me.useMemo=function(m,N){return B.H.useMemo(m,N)},me.useOptimistic=function(m,N){return B.H.useOptimistic(m,N)},me.useReducer=function(m,N,Z){return B.H.useReducer(m,N,Z)},me.useRef=function(m){return B.H.useRef(m)},me.useState=function(m){return B.H.useState(m)},me.useSyncExternalStore=function(m,N,Z){return B.H.useSyncExternalStore(m,N,Z)},me.useTransition=function(){return B.H.useTransition()},me.version="19.2.8",me}var Hh;function Nc(){return Hh||(Hh=1,hc.exports=sm()),hc.exports}var x=Nc();const Cn=lm(x);var pc={exports:{}},mi={},vc={exports:{}},gc={};var Uh;function rm(){return Uh||(Uh=1,(function(s){function c(M,L){var J=M.length;M.push(L);e:for(;0<J;){var ve=J-1>>>1,Se=M[ve];if(0<f(Se,L))M[ve]=L,M[J]=Se,J=ve;else break e}}function u(M){return M.length===0?null:M[0]}function o(M){if(M.length===0)return null;var L=M[0],J=M.pop();if(J!==L){M[0]=J;e:for(var ve=0,Se=M.length,m=Se>>>1;ve<m;){var N=2*(ve+1)-1,Z=M[N],P=N+1,le=M[P];if(0>f(Z,J))P<Se&&0>f(le,Z)?(M[ve]=le,M[P]=J,ve=P):(M[ve]=Z,M[N]=J,ve=N);else if(P<Se&&0>f(le,J))M[ve]=le,M[P]=J,ve=P;else break e}}return L}function f(M,L){var J=M.sortIndex-L.sortIndex;return J!==0?J:M.id-L.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;s.unstable_now=function(){return h.now()}}else{var g=Date,b=g.now();s.unstable_now=function(){return g.now()-b}}var y=[],v=[],w=1,k=null,S=3,H=!1,Q=!1,F=!1,C=!1,_=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function W(M){for(var L=u(v);L!==null;){if(L.callback===null)o(v);else if(L.startTime<=M)o(v),L.sortIndex=L.expirationTime,c(y,L);else break;L=u(v)}}function se(M){if(F=!1,W(M),!Q)if(u(y)!==null)Q=!0,E||(E=!0,fe());else{var L=u(v);L!==null&&ke(se,L.startTime-M)}}var E=!1,B=-1,q=5,R=-1;function ne(){return C?!0:!(s.unstable_now()-R<q)}function pe(){if(C=!1,E){var M=s.unstable_now();R=M;var L=!0;try{e:{Q=!1,F&&(F=!1,V(B),B=-1),H=!0;var J=S;try{t:{for(W(M),k=u(y);k!==null&&!(k.expirationTime>M&&ne());){var ve=k.callback;if(typeof ve=="function"){k.callback=null,S=k.priorityLevel;var Se=ve(k.expirationTime<=M);if(M=s.unstable_now(),typeof Se=="function"){k.callback=Se,W(M),L=!0;break t}k===u(y)&&o(y),W(M)}else o(y);k=u(y)}if(k!==null)L=!0;else{var m=u(v);m!==null&&ke(se,m.startTime-M),L=!1}}break e}finally{k=null,S=J,H=!1}L=void 0}}finally{L?fe():E=!1}}}var fe;if(typeof $=="function")fe=function(){$(pe)};else if(typeof MessageChannel<"u"){var ye=new MessageChannel,re=ye.port2;ye.port1.onmessage=pe,fe=function(){re.postMessage(null)}}else fe=function(){_(pe,0)};function ke(M,L){B=_(function(){M(s.unstable_now())},L)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(M){M.callback=null},s.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<M?Math.floor(1e3/M):5},s.unstable_getCurrentPriorityLevel=function(){return S},s.unstable_next=function(M){switch(S){case 1:case 2:case 3:var L=3;break;default:L=S}var J=S;S=L;try{return M()}finally{S=J}},s.unstable_requestPaint=function(){C=!0},s.unstable_runWithPriority=function(M,L){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var J=S;S=M;try{return L()}finally{S=J}},s.unstable_scheduleCallback=function(M,L,J){var ve=s.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?ve+J:ve):J=ve,M){case 1:var Se=-1;break;case 2:Se=250;break;case 5:Se=1073741823;break;case 4:Se=1e4;break;default:Se=5e3}return Se=J+Se,M={id:w++,callback:L,priorityLevel:M,startTime:J,expirationTime:Se,sortIndex:-1},J>ve?(M.sortIndex=J,c(v,M),u(y)===null&&M===u(v)&&(F?(V(B),B=-1):F=!0,ke(se,J-ve))):(M.sortIndex=Se,c(y,M),Q||H||(Q=!0,E||(E=!0,fe()))),M},s.unstable_shouldYield=ne,s.unstable_wrapCallback=function(M){var L=S;return function(){var J=S;S=L;try{return M.apply(this,arguments)}finally{S=J}}}})(gc)),gc}var Bh;function om(){return Bh||(Bh=1,vc.exports=rm()),vc.exports}var mc={exports:{}},pt={};var qh;function cm(){if(qh)return pt;qh=1;var s=Nc();function c(y){var v="https://react.dev/errors/"+y;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)v+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+y+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var o={d:{f:u,r:function(){throw Error(c(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},f=Symbol.for("react.portal");function h(y,v,w){var k=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:k==null?null:""+k,children:y,containerInfo:v,implementation:w}}var g=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(y,v){if(y==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,pt.createPortal=function(y,v){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(c(299));return h(y,v,null,w)},pt.flushSync=function(y){var v=g.T,w=o.p;try{if(g.T=null,o.p=2,y)return y()}finally{g.T=v,o.p=w,o.d.f()}},pt.preconnect=function(y,v){typeof y=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,o.d.C(y,v))},pt.prefetchDNS=function(y){typeof y=="string"&&o.d.D(y)},pt.preinit=function(y,v){if(typeof y=="string"&&v&&typeof v.as=="string"){var w=v.as,k=b(w,v.crossOrigin),S=typeof v.integrity=="string"?v.integrity:void 0,H=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;w==="style"?o.d.S(y,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:k,integrity:S,fetchPriority:H}):w==="script"&&o.d.X(y,{crossOrigin:k,integrity:S,fetchPriority:H,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},pt.preinitModule=function(y,v){if(typeof y=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var w=b(v.as,v.crossOrigin);o.d.M(y,{crossOrigin:w,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&o.d.M(y)},pt.preload=function(y,v){if(typeof y=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var w=v.as,k=b(w,v.crossOrigin);o.d.L(y,w,{crossOrigin:k,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},pt.preloadModule=function(y,v){if(typeof y=="string")if(v){var w=b(v.as,v.crossOrigin);o.d.m(y,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:w,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else o.d.m(y)},pt.requestFormReset=function(y){o.d.r(y)},pt.unstable_batchedUpdates=function(y,v){return y(v)},pt.useFormState=function(y,v,w){return g.H.useFormState(y,v,w)},pt.useFormStatus=function(){return g.H.useHostTransitionStatus()},pt.version="19.2.8",pt}var Lh;function um(){if(Lh)return mc.exports;Lh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(c){console.error(c)}}return s(),mc.exports=cm(),mc.exports}var Yh;function dm(){if(Yh)return mi;Yh=1;var s=om(),c=Nc(),u=um();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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 f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function g(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 b(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 y(e){if(h(e)!==e)throw Error(o(188))}function v(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var r=i.alternate;if(r===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===n)return y(i),e;if(r===l)return y(i),t;r=r.sibling}throw Error(o(188))}if(n.return!==l.return)n=i,l=r;else{for(var d=!1,p=i.child;p;){if(p===n){d=!0,n=i,l=r;break}if(p===l){d=!0,l=i,n=r;break}p=p.sibling}if(!d){for(p=r.child;p;){if(p===n){d=!0,n=r,l=i;break}if(p===l){d=!0,l=r,n=i;break}p=p.sibling}if(!d)throw Error(o(189))}}if(n.alternate!==l)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function w(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=w(e),t!==null)return t;e=e.sibling}return null}var k=Object.assign,S=Symbol.for("react.element"),H=Symbol.for("react.transitional.element"),Q=Symbol.for("react.portal"),F=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),$=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),pe=Symbol.iterator;function fe(e){return e===null||typeof e!="object"?null:(e=pe&&e[pe]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Symbol.for("react.client.reference");function re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case F:return"Fragment";case _:return"Profiler";case C:return"StrictMode";case se:return"Suspense";case E:return"SuspenseList";case R:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Q:return"Portal";case $:return e.displayName||"Context";case V:return(e._context.displayName||"Context")+".Consumer";case W:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return t=e.displayName||null,t!==null?t:re(e.type)||"Memo";case q:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ke=Array.isArray,M=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},ve=[],Se=-1;function m(e){return{current:e}}function N(e){0>Se||(e.current=ve[Se],ve[Se]=null,Se--)}function Z(e,t){Se++,ve[Se]=e.current,e.current=t}var P=m(null),le=m(null),ae=m(null),xe=m(null);function I(e,t){switch(Z(ae,t),Z(le,e),Z(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nh(t),e=lh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}N(P),Z(P,e)}function K(){N(P),N(le),N(ae)}function Be(e){e.memoizedState!==null&&Z(xe,e);var t=P.current,n=lh(t,e.type);t!==n&&(Z(le,e),Z(P,n))}function Le(e){le.current===e&&(N(P),N(le)),xe.current===e&&(N(xe),fi._currentValue=J)}var ee,De;function $e(e){if(ee===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ee=t&&t[1]||"",De=-1<n.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+ee+e+De}var vt=!1;function il(e,t){if(!e||vt)return"";vt=!0;var n=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(U){var O=U}Reflect.construct(e,[],X)}else{try{X.call()}catch(U){O=U}e.call(X.prototype)}}else{try{throw Error()}catch(U){O=U}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch(U){if(U&&O&&typeof U.stack=="string")return[U.stack,O.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=l.DetermineComponentFrameRoot(),d=r[0],p=r[1];if(d&&p){var j=d.split(`
4
+ `),D=p.split(`
5
+ `);for(i=l=0;l<j.length&&!j[l].includes("DetermineComponentFrameRoot");)l++;for(;i<D.length&&!D[i].includes("DetermineComponentFrameRoot");)i++;if(l===j.length||i===D.length)for(l=j.length-1,i=D.length-1;1<=l&&0<=i&&j[l]!==D[i];)i--;for(;1<=l&&0<=i;l--,i--)if(j[l]!==D[i]){if(l!==1||i!==1)do if(l--,i--,0>i||j[l]!==D[i]){var Y=`
6
+ `+j[l].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=l&&0<=i);break}}}finally{vt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?$e(n):""}function Ot(e,t){switch(e.tag){case 26:case 27:case 5:return $e(e.type);case 16:return $e("Lazy");case 13:return e.child!==t&&t!==null?$e("Suspense Fallback"):$e("Suspense");case 19:return $e("SuspenseList");case 0:case 15:return il(e.type,!1);case 11:return il(e.type.render,!1);case 1:return il(e.type,!0);case 31:return $e("Activity");default:return""}}function sl(e){try{var t="",n=null;do t+=Ot(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
7
+ Error generating stack: `+l.message+`
8
+ `+l.stack}}var _l=Object.prototype.hasOwnProperty,An=s.unstable_scheduleCallback,Cl=s.unstable_cancelCallback,ji=s.unstable_shouldYield,Fs=s.unstable_requestPaint,ht=s.unstable_now,Sa=s.unstable_getCurrentPriorityLevel,ja=s.unstable_ImmediatePriority,Al=s.unstable_UserBlockingPriority,Dl=s.unstable_NormalPriority,Is=s.unstable_LowPriority,ka=s.unstable_IdlePriority,sn=s.log,rn=s.unstable_setDisableYieldValue,on=null,rt=null;function Vt(e){if(typeof sn=="function"&&rn(e),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(on,e)}catch{}}var gt=Math.clz32?Math.clz32:ki,Ps=Math.log,er=Math.LN2;function ki(e){return e>>>=0,e===0?32:31-(Ps(e)/er|0)|0}var Rl=256,Ol=262144,Nl=4194304;function cn(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 un(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,r=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var p=l&134217727;return p!==0?(l=p&~r,l!==0?i=cn(l):(d&=p,d!==0?i=cn(d):n||(n=p&~e,n!==0&&(i=cn(n))))):(p=l&~r,p!==0?i=cn(p):d!==0?i=cn(d):n||(n=l&~e,n!==0&&(i=cn(n)))),i===0?0:t!==0&&t!==i&&(t&r)===0&&(r=i&-i,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:i}function Dn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function wi(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 wa(){var e=Nl;return Nl<<=1,(Nl&62914560)===0&&(Nl=4194304),e}function Hl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function tr(e,t,n,l,i,r){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var p=e.entanglements,j=e.expirationTimes,D=e.hiddenUpdates;for(n=d&~n;0<n;){var Y=31-gt(n),X=1<<Y;p[Y]=0,j[Y]=-1;var O=D[Y];if(O!==null)for(D[Y]=null,Y=0;Y<O.length;Y++){var U=O[Y];U!==null&&(U.lane&=-536870913)}n&=~X}l!==0&&za(e,l,0),r!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=r&~(d&~t))}function za(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-gt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function ie(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-gt(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=(n&42)!==0?1:Kt(n),(n&(e.suspendedLanes|t))!==0?0:n}function Kt(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 Rn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ta(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:Th(e.type))}function zi(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var On=Math.random().toString(36).slice(2),ot="__reactFiber$"+On,yt="__reactProps$"+On,Ul="__reactContainer$"+On,nr="__reactEvents$"+On,Vp="__reactListeners$"+On,Kp="__reactHandles$"+On,$c="__reactResources$"+On,Ma="__reactMarker$"+On;function lr(e){delete e[ot],delete e[yt],delete e[nr],delete e[Vp],delete e[Kp]}function Bl(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ul]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=uh(e);e!==null;){if(n=e[ot])return n;e=uh(e)}return t}e=n,n=e.parentNode}return null}function ql(e){if(e=e[ot]||e[Ul]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ea(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Ll(e){var t=e[$c];return t||(t=e[$c]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function at(e){e[Ma]=!0}var Gc=new Set,Xc={};function ol(e,t){Yl(e,t),Yl(e+"Capture",t)}function Yl(e,t){for(Xc[e]=t,e=0;e<t.length;e++)Gc.add(t[e])}var Zp=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]*$"),Qc={},Vc={};function Wp(e){return _l.call(Vc,e)?!0:_l.call(Qc,e)?!1:Zp.test(e)?Vc[e]=!0:(Qc[e]=!0,!1)}function Ti(e,t,n){if(Wp(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){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,""+n)}}function Mi(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function dn(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function Nt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Kc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jp(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var i=l.get,r=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(d){n=""+d,r.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ar(e){if(!e._valueTracker){var t=Kc(e)?"checked":"value";e._valueTracker=Jp(e,t,""+e[t])}}function Zc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Kc(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Ei(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 Fp=/[\n"\\]/g;function Ht(e){return e.replace(Fp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ir(e,t,n,l,i,r,d,p){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Nt(t)):e.value!==""+Nt(t)&&(e.value=""+Nt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?sr(e,d,Nt(t)):n!=null?sr(e,d,Nt(n)):l!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Nt(p):e.removeAttribute("name")}function Wc(e,t,n,l,i,r,d,p){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){ar(e);return}n=n!=null?""+Nt(n):"",t=t!=null?""+Nt(t):n,p||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=p?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),ar(e)}function sr(e,t,n){t==="number"&&Ei(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function $l(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Nt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Jc(e,t,n){if(t!=null&&(t=""+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Nt(n):""}function Fc(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if(ke(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Nt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),ar(e)}function Gl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ip=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 Ic(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||Ip.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Pc(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&Ic(e,i,l)}else for(var r in t)t.hasOwnProperty(r)&&Ic(e,r,t[r])}function rr(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 Pp=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"]]),ev=/^[\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 _i(e){return ev.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function fn(){}var or=null;function cr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xl=null,Ql=null;function eu(e){var t=ql(e);if(t&&(e=t.stateNode)){var n=e[yt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ir(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Ht(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[yt]||null;if(!i)throw Error(o(90));ir(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Zc(l)}break e;case"textarea":Jc(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&$l(e,!!n.multiple,t,!1)}}}var ur=!1;function tu(e,t,n){if(ur)return e(t,n);ur=!0;try{var l=e(t);return l}finally{if(ur=!1,(Xl!==null||Ql!==null)&&(gs(),Xl&&(t=Xl,e=Ql,Ql=Xl=null,eu(t),e)))for(t=0;t<e.length;t++)eu(e[t])}}function _a(e,t){var n=e.stateNode;if(n===null)return null;var l=n[yt]||null;if(l===null)return null;n=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(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dr=!1;if(hn)try{var Ca={};Object.defineProperty(Ca,"passive",{get:function(){dr=!0}}),window.addEventListener("test",Ca,Ca),window.removeEventListener("test",Ca,Ca)}catch{dr=!1}var Nn=null,fr=null,Ci=null;function nu(){if(Ci)return Ci;var e,t=fr,n=t.length,l,i="value"in Nn?Nn.value:Nn.textContent,r=i.length;for(e=0;e<n&&t[e]===i[e];e++);var d=n-e;for(l=1;l<=d&&t[n-l]===i[r-l];l++);return Ci=i.slice(e,1<l?1-l:void 0)}function Ai(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 Di(){return!0}function lu(){return!1}function xt(e){function t(n,l,i,r,d){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=r,this.target=d,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(n=e[p],this[p]=n?n(r):r[p]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Di:lu,this.isPropagationStopped=lu,this}return k(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Di)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Di)},persist:function(){},isPersistent:Di}),t}var cl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ri=xt(cl),Aa=k({},cl,{view:0,detail:0}),tv=xt(Aa),hr,pr,Da,Oi=k({},Aa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gr,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!==Da&&(Da&&e.type==="mousemove"?(hr=e.screenX-Da.screenX,pr=e.screenY-Da.screenY):pr=hr=0,Da=e),hr)},movementY:function(e){return"movementY"in e?e.movementY:pr}}),au=xt(Oi),nv=k({},Oi,{dataTransfer:0}),lv=xt(nv),av=k({},Aa,{relatedTarget:0}),vr=xt(av),iv=k({},cl,{animationName:0,elapsedTime:0,pseudoElement:0}),sv=xt(iv),rv=k({},cl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ov=xt(rv),cv=k({},cl,{data:0}),iu=xt(cv),uv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dv={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"},fv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fv[e])?!!t[e]:!1}function gr(){return hv}var pv=k({},Aa,{key:function(e){if(e.key){var t=uv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ai(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gr,charCode:function(e){return e.type==="keypress"?Ai(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ai(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vv=xt(pv),gv=k({},Oi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),su=xt(gv),mv=k({},Aa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gr}),yv=xt(mv),xv=k({},cl,{propertyName:0,elapsedTime:0,pseudoElement:0}),bv=xt(xv),Sv=k({},Oi,{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}),jv=xt(Sv),kv=k({},cl,{newState:0,oldState:0}),wv=xt(kv),zv=[9,13,27,32],mr=hn&&"CompositionEvent"in window,Ra=null;hn&&"documentMode"in document&&(Ra=document.documentMode);var Tv=hn&&"TextEvent"in window&&!Ra,ru=hn&&(!mr||Ra&&8<Ra&&11>=Ra),ou=" ",cu=!1;function uu(e,t){switch(e){case"keyup":return zv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function du(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vl=!1;function Mv(e,t){switch(e){case"compositionend":return du(t);case"keypress":return t.which!==32?null:(cu=!0,ou);case"textInput":return e=t.data,e===ou&&cu?null:e;default:return null}}function Ev(e,t){if(Vl)return e==="compositionend"||!mr&&uu(e,t)?(e=nu(),Ci=fr=Nn=null,Vl=!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 ru&&t.locale!=="ko"?null:t.data;default:return null}}var _v={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 fu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_v[e.type]:t==="textarea"}function hu(e,t,n,l){Xl?Ql?Ql.push(l):Ql=[l]:Xl=l,t=ks(t,"onChange"),0<t.length&&(n=new Ri("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Oa=null,Na=null;function Cv(e){Jf(e,0)}function Ni(e){var t=Ea(e);if(Zc(t))return e}function pu(e,t){if(e==="change")return t}var vu=!1;if(hn){var yr;if(hn){var xr="oninput"in document;if(!xr){var gu=document.createElement("div");gu.setAttribute("oninput","return;"),xr=typeof gu.oninput=="function"}yr=xr}else yr=!1;vu=yr&&(!document.documentMode||9<document.documentMode)}function mu(){Oa&&(Oa.detachEvent("onpropertychange",yu),Na=Oa=null)}function yu(e){if(e.propertyName==="value"&&Ni(Na)){var t=[];hu(t,Na,e,cr(e)),tu(Cv,t)}}function Av(e,t,n){e==="focusin"?(mu(),Oa=t,Na=n,Oa.attachEvent("onpropertychange",yu)):e==="focusout"&&mu()}function Dv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ni(Na)}function Rv(e,t){if(e==="click")return Ni(t)}function Ov(e,t){if(e==="input"||e==="change")return Ni(t)}function Nv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zt=typeof Object.is=="function"?Object.is:Nv;function Ha(e,t){if(zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var i=n[l];if(!_l.call(t,i)||!zt(e[i],t[i]))return!1}return!0}function xu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bu(e,t){var n=xu(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xu(n)}}function Su(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Su(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ju(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ei(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ei(e.document)}return t}function br(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 Hv=hn&&"documentMode"in document&&11>=document.documentMode,Kl=null,Sr=null,Ua=null,jr=!1;function ku(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Kl==null||Kl!==Ei(l)||(l=Kl,"selectionStart"in l&&br(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}),Ua&&Ha(Ua,l)||(Ua=l,l=ks(Sr,"onSelect"),0<l.length&&(t=new Ri("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Kl)))}function ul(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Zl={animationend:ul("Animation","AnimationEnd"),animationiteration:ul("Animation","AnimationIteration"),animationstart:ul("Animation","AnimationStart"),transitionrun:ul("Transition","TransitionRun"),transitionstart:ul("Transition","TransitionStart"),transitioncancel:ul("Transition","TransitionCancel"),transitionend:ul("Transition","TransitionEnd")},kr={},wu={};hn&&(wu=document.createElement("div").style,"AnimationEvent"in window||(delete Zl.animationend.animation,delete Zl.animationiteration.animation,delete Zl.animationstart.animation),"TransitionEvent"in window||delete Zl.transitionend.transition);function dl(e){if(kr[e])return kr[e];if(!Zl[e])return e;var t=Zl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in wu)return kr[e]=t[n];return e}var zu=dl("animationend"),Tu=dl("animationiteration"),Mu=dl("animationstart"),Uv=dl("transitionrun"),Bv=dl("transitionstart"),qv=dl("transitioncancel"),Eu=dl("transitionend"),_u=new Map,wr="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(" ");wr.push("scrollEnd");function Zt(e,t){_u.set(e,t),ol(t,[e])}var Hi=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)},Ut=[],Wl=0,zr=0;function Ui(){for(var e=Wl,t=zr=Wl=0;t<e;){var n=Ut[t];Ut[t++]=null;var l=Ut[t];Ut[t++]=null;var i=Ut[t];Ut[t++]=null;var r=Ut[t];if(Ut[t++]=null,l!==null&&i!==null){var d=l.pending;d===null?i.next=i:(i.next=d.next,d.next=i),l.pending=i}r!==0&&Cu(n,i,r)}}function Bi(e,t,n,l){Ut[Wl++]=e,Ut[Wl++]=t,Ut[Wl++]=n,Ut[Wl++]=l,zr|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Tr(e,t,n,l){return Bi(e,t,n,l),qi(e)}function fl(e,t){return Bi(e,null,null,t),qi(e)}function Cu(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,r=e.return;r!==null;)r.childLanes|=n,l=r.alternate,l!==null&&(l.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(i=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,i&&t!==null&&(i=31-gt(n),e=r.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),r):null}function qi(e){if(50<ii)throw ii=0,Ho=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Jl={};function Lv(e,t,n,l){this.tag=e,this.key=n,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 Tt(e,t,n,l){return new Lv(e,t,n,l)}function Mr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pn(e,t){var n=e.alternate;return n===null?(n=Tt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Au(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Li(e,t,n,l,i,r){var d=0;if(l=e,typeof e=="function")Mr(e)&&(d=1);else if(typeof e=="string")d=Qg(e,n,P.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=Tt(31,n,t,i),e.elementType=R,e.lanes=r,e;case F:return hl(n.children,i,r,t);case C:d=8,i|=24;break;case _:return e=Tt(12,n,t,i|2),e.elementType=_,e.lanes=r,e;case se:return e=Tt(13,n,t,i),e.elementType=se,e.lanes=r,e;case E:return e=Tt(19,n,t,i),e.elementType=E,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $:d=10;break e;case V:d=9;break e;case W:d=11;break e;case B:d=14;break e;case q:d=16,l=null;break e}d=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=Tt(d,n,t,i),t.elementType=e,t.type=l,t.lanes=r,t}function hl(e,t,n,l){return e=Tt(7,e,l,t),e.lanes=n,e}function Er(e,t,n){return e=Tt(6,e,null,t),e.lanes=n,e}function Du(e){var t=Tt(18,null,null,0);return t.stateNode=e,t}function _r(e,t,n){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ru=new WeakMap;function Bt(e,t){if(typeof e=="object"&&e!==null){var n=Ru.get(e);return n!==void 0?n:(t={value:e,source:t,stack:sl(t)},Ru.set(e,t),t)}return{value:e,source:t,stack:sl(t)}}var Fl=[],Il=0,Yi=null,Ba=0,qt=[],Lt=0,Hn=null,Pt=1,en="";function vn(e,t){Fl[Il++]=Ba,Fl[Il++]=Yi,Yi=e,Ba=t}function Ou(e,t,n){qt[Lt++]=Pt,qt[Lt++]=en,qt[Lt++]=Hn,Hn=e;var l=Pt;e=en;var i=32-gt(l)-1;l&=~(1<<i),n+=1;var r=32-gt(t)+i;if(30<r){var d=i-i%5;r=(l&(1<<d)-1).toString(32),l>>=d,i-=d,Pt=1<<32-gt(t)+i|n<<i|l,en=r+e}else Pt=1<<r|n<<i|l,en=e}function Cr(e){e.return!==null&&(vn(e,1),Ou(e,1,0))}function Ar(e){for(;e===Yi;)Yi=Fl[--Il],Fl[Il]=null,Ba=Fl[--Il],Fl[Il]=null;for(;e===Hn;)Hn=qt[--Lt],qt[Lt]=null,en=qt[--Lt],qt[Lt]=null,Pt=qt[--Lt],qt[Lt]=null}function Nu(e,t){qt[Lt++]=Pt,qt[Lt++]=en,qt[Lt++]=Hn,Pt=t.id,en=t.overflow,Hn=e}var ct=null,Ge=null,Ee=!1,Un=null,Yt=!1,Dr=Error(o(519));function Bn(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qa(Bt(t,e)),Dr}function Hu(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[ot]=e,t[yt]=l,n){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(n=0;n<ri.length;n++)ze(ri[n],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),Wc(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),Fc(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||eh(t.textContent,n)?(l.popover!=null&&(ze("beforetoggle",t),ze("toggle",t)),l.onScroll!=null&&ze("scroll",t),l.onScrollEnd!=null&&ze("scrollend",t),l.onClick!=null&&(t.onclick=fn),t=!0):t=!1,t||Bn(e,!0)}function Uu(e){for(ct=e.return;ct;)switch(ct.tag){case 5:case 31:case 13:Yt=!1;return;case 27:case 3:Yt=!0;return;default:ct=ct.return}}function Pl(e){if(e!==ct)return!1;if(!Ee)return Uu(e),Ee=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Fo(e.type,e.memoizedProps)),n=!n),n&&Ge&&Bn(e),Uu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ge=ch(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ge=ch(e)}else t===27?(t=Ge,In(e.type)?(e=nc,nc=null,Ge=e):Ge=t):Ge=ct?Gt(e.stateNode.nextSibling):null;return!0}function pl(){Ge=ct=null,Ee=!1}function Rr(){var e=Un;return e!==null&&(kt===null?kt=e:kt.push.apply(kt,e),Un=null),e}function qa(e){Un===null?Un=[e]:Un.push(e)}var Or=m(null),vl=null,gn=null;function qn(e,t,n){Z(Or,t._currentValue),t._currentValue=n}function mn(e){e._currentValue=Or.current,N(Or)}function Nr(e,t,n){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===n)break;e=e.return}}function Hr(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var r=i.dependencies;if(r!==null){var d=i.child;r=r.firstContext;e:for(;r!==null;){var p=r;r=i;for(var j=0;j<t.length;j++)if(p.context===t[j]){r.lanes|=n,p=r.alternate,p!==null&&(p.lanes|=n),Nr(r.return,n,e),l||(d=null);break e}r=p.next}}else if(i.tag===18){if(d=i.return,d===null)throw Error(o(341));d.lanes|=n,r=d.alternate,r!==null&&(r.lanes|=n),Nr(d,n,e),d=null}else d=i.child;if(d!==null)d.return=i;else for(d=i;d!==null;){if(d===e){d=null;break}if(i=d.sibling,i!==null){i.return=d.return,d=i;break}d=d.return}i=d}}function ea(e,t,n,l){e=null;for(var i=t,r=!1;i!==null;){if(!r){if((i.flags&524288)!==0)r=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var d=i.alternate;if(d===null)throw Error(o(387));if(d=d.memoizedProps,d!==null){var p=i.type;zt(i.pendingProps.value,d.value)||(e!==null?e.push(p):e=[p])}}else if(i===xe.current){if(d=i.alternate,d===null)throw Error(o(387));d.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(fi):e=[fi])}i=i.return}e!==null&&Hr(t,e,n,l),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function gl(e){vl=e,gn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ut(e){return Bu(vl,e)}function Gi(e,t){return vl===null&&gl(e),Bu(e,t)}function Bu(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},gn===null){if(e===null)throw Error(o(308));gn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else gn=gn.next=t;return n}var Yv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},$v=s.unstable_scheduleCallback,Gv=s.unstable_NormalPriority,Ie={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ur(){return{controller:new Yv,data:new Map,refCount:0}}function La(e){e.refCount--,e.refCount===0&&$v(Gv,function(){e.controller.abort()})}var Ya=null,Br=0,ta=0,na=null;function Xv(e,t){if(Ya===null){var n=Ya=[];Br=0,ta=$o(),na={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Br++,t.then(qu,qu),t}function qu(){if(--Br===0&&Ya!==null){na!==null&&(na.status="fulfilled");var e=Ya;Ya=null,ta=0,na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Qv(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),l}var Lu=M.S;M.S=function(e,t){wf=ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Xv(e,t),Lu!==null&&Lu(e,t)};var ml=m(null);function qr(){var e=ml.current;return e!==null?e:qe.pooledCache}function Xi(e,t){t===null?Z(ml,ml.current):Z(ml,t.pool)}function Yu(){var e=qr();return e===null?null:{parent:Ie._currentValue,pool:e}}var la=Error(o(460)),Lr=Error(o(474)),Qi=Error(o(542)),Vi={then:function(){}};function $u(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Gu(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(fn,fn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Qu(e),e;default:if(typeof t.status=="string")t.then(fn,fn);else{if(e=qe,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Qu(e),e}throw xl=t,la}}function yl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(xl=n,la):n}}var xl=null;function Xu(){if(xl===null)throw Error(o(459));var e=xl;return xl=null,e}function Qu(e){if(e===la||e===Qi)throw Error(o(483))}var aa=null,$a=0;function Ki(e){var t=$a;return $a+=1,aa===null&&(aa=[]),Gu(aa,e,t)}function Ga(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Zi(e,t){throw t.$$typeof===S?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Vu(e){function t(T,z){if(e){var A=T.deletions;A===null?(T.deletions=[z],T.flags|=16):A.push(z)}}function n(T,z){if(!e)return null;for(;z!==null;)t(T,z),z=z.sibling;return null}function l(T){for(var z=new Map;T!==null;)T.key!==null?z.set(T.key,T):z.set(T.index,T),T=T.sibling;return z}function i(T,z){return T=pn(T,z),T.index=0,T.sibling=null,T}function r(T,z,A){return T.index=A,e?(A=T.alternate,A!==null?(A=A.index,A<z?(T.flags|=67108866,z):A):(T.flags|=67108866,z)):(T.flags|=1048576,z)}function d(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function p(T,z,A,G){return z===null||z.tag!==6?(z=Er(A,T.mode,G),z.return=T,z):(z=i(z,A),z.return=T,z)}function j(T,z,A,G){var he=A.type;return he===F?Y(T,z,A.props.children,G,A.key):z!==null&&(z.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===q&&yl(he)===z.type)?(z=i(z,A.props),Ga(z,A),z.return=T,z):(z=Li(A.type,A.key,A.props,null,T.mode,G),Ga(z,A),z.return=T,z)}function D(T,z,A,G){return z===null||z.tag!==4||z.stateNode.containerInfo!==A.containerInfo||z.stateNode.implementation!==A.implementation?(z=_r(A,T.mode,G),z.return=T,z):(z=i(z,A.children||[]),z.return=T,z)}function Y(T,z,A,G,he){return z===null||z.tag!==7?(z=hl(A,T.mode,G,he),z.return=T,z):(z=i(z,A),z.return=T,z)}function X(T,z,A){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Er(""+z,T.mode,A),z.return=T,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case H:return A=Li(z.type,z.key,z.props,null,T.mode,A),Ga(A,z),A.return=T,A;case Q:return z=_r(z,T.mode,A),z.return=T,z;case q:return z=yl(z),X(T,z,A)}if(ke(z)||fe(z))return z=hl(z,T.mode,A,null),z.return=T,z;if(typeof z.then=="function")return X(T,Ki(z),A);if(z.$$typeof===$)return X(T,Gi(T,z),A);Zi(T,z)}return null}function O(T,z,A,G){var he=z!==null?z.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return he!==null?null:p(T,z,""+A,G);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case H:return A.key===he?j(T,z,A,G):null;case Q:return A.key===he?D(T,z,A,G):null;case q:return A=yl(A),O(T,z,A,G)}if(ke(A)||fe(A))return he!==null?null:Y(T,z,A,G,null);if(typeof A.then=="function")return O(T,z,Ki(A),G);if(A.$$typeof===$)return O(T,z,Gi(T,A),G);Zi(T,A)}return null}function U(T,z,A,G,he){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return T=T.get(A)||null,p(z,T,""+G,he);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case H:return T=T.get(G.key===null?A:G.key)||null,j(z,T,G,he);case Q:return T=T.get(G.key===null?A:G.key)||null,D(z,T,G,he);case q:return G=yl(G),U(T,z,A,G,he)}if(ke(G)||fe(G))return T=T.get(A)||null,Y(z,T,G,he,null);if(typeof G.then=="function")return U(T,z,A,Ki(G),he);if(G.$$typeof===$)return U(T,z,A,Gi(z,G),he);Zi(z,G)}return null}function ce(T,z,A,G){for(var he=null,_e=null,ue=z,je=z=0,Me=null;ue!==null&&je<A.length;je++){ue.index>je?(Me=ue,ue=null):Me=ue.sibling;var Ce=O(T,ue,A[je],G);if(Ce===null){ue===null&&(ue=Me);break}e&&ue&&Ce.alternate===null&&t(T,ue),z=r(Ce,z,je),_e===null?he=Ce:_e.sibling=Ce,_e=Ce,ue=Me}if(je===A.length)return n(T,ue),Ee&&vn(T,je),he;if(ue===null){for(;je<A.length;je++)ue=X(T,A[je],G),ue!==null&&(z=r(ue,z,je),_e===null?he=ue:_e.sibling=ue,_e=ue);return Ee&&vn(T,je),he}for(ue=l(ue);je<A.length;je++)Me=U(ue,T,je,A[je],G),Me!==null&&(e&&Me.alternate!==null&&ue.delete(Me.key===null?je:Me.key),z=r(Me,z,je),_e===null?he=Me:_e.sibling=Me,_e=Me);return e&&ue.forEach(function(ll){return t(T,ll)}),Ee&&vn(T,je),he}function ge(T,z,A,G){if(A==null)throw Error(o(151));for(var he=null,_e=null,ue=z,je=z=0,Me=null,Ce=A.next();ue!==null&&!Ce.done;je++,Ce=A.next()){ue.index>je?(Me=ue,ue=null):Me=ue.sibling;var ll=O(T,ue,Ce.value,G);if(ll===null){ue===null&&(ue=Me);break}e&&ue&&ll.alternate===null&&t(T,ue),z=r(ll,z,je),_e===null?he=ll:_e.sibling=ll,_e=ll,ue=Me}if(Ce.done)return n(T,ue),Ee&&vn(T,je),he;if(ue===null){for(;!Ce.done;je++,Ce=A.next())Ce=X(T,Ce.value,G),Ce!==null&&(z=r(Ce,z,je),_e===null?he=Ce:_e.sibling=Ce,_e=Ce);return Ee&&vn(T,je),he}for(ue=l(ue);!Ce.done;je++,Ce=A.next())Ce=U(ue,T,je,Ce.value,G),Ce!==null&&(e&&Ce.alternate!==null&&ue.delete(Ce.key===null?je:Ce.key),z=r(Ce,z,je),_e===null?he=Ce:_e.sibling=Ce,_e=Ce);return e&&ue.forEach(function(nm){return t(T,nm)}),Ee&&vn(T,je),he}function Ue(T,z,A,G){if(typeof A=="object"&&A!==null&&A.type===F&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case H:e:{for(var he=A.key;z!==null;){if(z.key===he){if(he=A.type,he===F){if(z.tag===7){n(T,z.sibling),G=i(z,A.props.children),G.return=T,T=G;break e}}else if(z.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===q&&yl(he)===z.type){n(T,z.sibling),G=i(z,A.props),Ga(G,A),G.return=T,T=G;break e}n(T,z);break}else t(T,z);z=z.sibling}A.type===F?(G=hl(A.props.children,T.mode,G,A.key),G.return=T,T=G):(G=Li(A.type,A.key,A.props,null,T.mode,G),Ga(G,A),G.return=T,T=G)}return d(T);case Q:e:{for(he=A.key;z!==null;){if(z.key===he)if(z.tag===4&&z.stateNode.containerInfo===A.containerInfo&&z.stateNode.implementation===A.implementation){n(T,z.sibling),G=i(z,A.children||[]),G.return=T,T=G;break e}else{n(T,z);break}else t(T,z);z=z.sibling}G=_r(A,T.mode,G),G.return=T,T=G}return d(T);case q:return A=yl(A),Ue(T,z,A,G)}if(ke(A))return ce(T,z,A,G);if(fe(A)){if(he=fe(A),typeof he!="function")throw Error(o(150));return A=he.call(A),ge(T,z,A,G)}if(typeof A.then=="function")return Ue(T,z,Ki(A),G);if(A.$$typeof===$)return Ue(T,z,Gi(T,A),G);Zi(T,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,z!==null&&z.tag===6?(n(T,z.sibling),G=i(z,A),G.return=T,T=G):(n(T,z),G=Er(A,T.mode,G),G.return=T,T=G),d(T)):n(T,z)}return function(T,z,A,G){try{$a=0;var he=Ue(T,z,A,G);return aa=null,he}catch(ue){if(ue===la||ue===Qi)throw ue;var _e=Tt(29,ue,null,T.mode);return _e.lanes=G,_e.return=T,_e}}}var bl=Vu(!0),Ku=Vu(!1),Ln=!1;function Yr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $r(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 Yn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function $n(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ae&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=qi(e),Cu(e,null,n),t}return Bi(e,l,t,n),qi(e)}function Xa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,ie(e,n)}}function Gr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?i=r=d:r=r.next=d,n=n.next}while(n!==null);r===null?i=r=t:r=r.next=t}else i=r=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xr=!1;function Qa(){if(Xr){var e=na;if(e!==null)throw e}}function Va(e,t,n,l){Xr=!1;var i=e.updateQueue;Ln=!1;var r=i.firstBaseUpdate,d=i.lastBaseUpdate,p=i.shared.pending;if(p!==null){i.shared.pending=null;var j=p,D=j.next;j.next=null,d===null?r=D:d.next=D,d=j;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,p=Y.lastBaseUpdate,p!==d&&(p===null?Y.firstBaseUpdate=D:p.next=D,Y.lastBaseUpdate=j))}if(r!==null){var X=i.baseState;d=0,Y=D=j=null,p=r;do{var O=p.lane&-536870913,U=O!==p.lane;if(U?(Te&O)===O:(l&O)===O){O!==0&&O===ta&&(Xr=!0),Y!==null&&(Y=Y.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var ce=e,ge=p;O=t;var Ue=n;switch(ge.tag){case 1:if(ce=ge.payload,typeof ce=="function"){X=ce.call(Ue,X,O);break e}X=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=ge.payload,O=typeof ce=="function"?ce.call(Ue,X,O):ce,O==null)break e;X=k({},X,O);break e;case 2:Ln=!0}}O=p.callback,O!==null&&(e.flags|=64,U&&(e.flags|=8192),U=i.callbacks,U===null?i.callbacks=[O]:U.push(O))}else U={lane:O,tag:p.tag,payload:p.payload,callback:p.callback,next:null},Y===null?(D=Y=U,j=X):Y=Y.next=U,d|=O;if(p=p.next,p===null){if(p=i.shared.pending,p===null)break;U=p,p=U.next,U.next=null,i.lastBaseUpdate=U,i.shared.pending=null}}while(!0);Y===null&&(j=X),i.baseState=j,i.firstBaseUpdate=D,i.lastBaseUpdate=Y,r===null&&(i.shared.lanes=0),Kn|=d,e.lanes=d,e.memoizedState=X}}function Zu(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Wu(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Zu(n[e],t)}var ia=m(null),Wi=m(0);function Ju(e,t){e=Tn,Z(Wi,e),Z(ia,t),Tn=e|t.baseLanes}function Qr(){Z(Wi,Tn),Z(ia,ia.current)}function Vr(){Tn=Wi.current,N(ia),N(Wi)}var Mt=m(null),$t=null;function Gn(e){var t=e.alternate;Z(Ze,Ze.current&1),Z(Mt,e),$t===null&&(t===null||ia.current!==null||t.memoizedState!==null)&&($t=e)}function Kr(e){Z(Ze,Ze.current),Z(Mt,e),$t===null&&($t=e)}function Fu(e){e.tag===22?(Z(Ze,Ze.current),Z(Mt,e),$t===null&&($t=e)):Xn()}function Xn(){Z(Ze,Ze.current),Z(Mt,Mt.current)}function Et(e){N(Mt),$t===e&&($t=null),N(Ze)}var Ze=m(0);function Ji(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ec(n)||tc(n)))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 yn=0,be=null,Ne=null,Pe=null,Fi=!1,sa=!1,Sl=!1,Ii=0,Ka=0,ra=null,Vv=0;function Ve(){throw Error(o(321))}function Zr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!zt(e[n],t[n]))return!1;return!0}function Wr(e,t,n,l,i,r){return yn=r,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Od:uo,Sl=!1,r=n(l,i),Sl=!1,sa&&(r=Pu(t,n,l,i)),Iu(e),r}function Iu(e){M.H=Ja;var t=Ne!==null&&Ne.next!==null;if(yn=0,Pe=Ne=be=null,Fi=!1,Ka=0,ra=null,t)throw Error(o(300));e===null||et||(e=e.dependencies,e!==null&&$i(e)&&(et=!0))}function Pu(e,t,n,l){be=e;var i=0;do{if(sa&&(ra=null),Ka=0,sa=!1,25<=i)throw Error(o(301));if(i+=1,Pe=Ne=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}M.H=Nd,r=t(n,l)}while(sa);return r}function Kv(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?Za(t):t,e=e.useState()[0],(Ne!==null?Ne.memoizedState:null)!==e&&(be.flags|=1024),t}function Jr(){var e=Ii!==0;return Ii=0,e}function Fr(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ir(e){if(Fi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Fi=!1}yn=0,Pe=Ne=be=null,sa=!1,Ka=Ii=0,ra=null}function mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pe===null?be.memoizedState=Pe=e:Pe=Pe.next=e,Pe}function We(){if(Ne===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Ne.next;var t=Pe===null?be.memoizedState:Pe.next;if(t!==null)Pe=t,Ne=e;else{if(e===null)throw be.alternate===null?Error(o(467)):Error(o(310));Ne=e,e={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},Pe===null?be.memoizedState=Pe=e:Pe=Pe.next=e}return Pe}function Pi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Za(e){var t=Ka;return Ka+=1,ra===null&&(ra=[]),e=Gu(ra,e,t),t=be,(Pe===null?t.memoizedState:Pe.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Od:uo),e}function es(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Za(e);if(e.$$typeof===$)return ut(e)}throw Error(o(438,String(e)))}function Pr(e){var t=null,n=be.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=be.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Pi(),be.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=ne;return t.index++,n}function xn(e,t){return typeof t=="function"?t(e):t}function ts(e){var t=We();return eo(t,Ne,e)}function eo(e,t,n){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=n;var i=e.baseQueue,r=l.pending;if(r!==null){if(i!==null){var d=i.next;i.next=r.next,r.next=d}t.baseQueue=i=r,l.pending=null}if(r=e.baseState,i===null)e.memoizedState=r;else{t=i.next;var p=d=null,j=null,D=t,Y=!1;do{var X=D.lane&-536870913;if(X!==D.lane?(Te&X)===X:(yn&X)===X){var O=D.revertLane;if(O===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),X===ta&&(Y=!0);else if((yn&O)===O){D=D.next,O===ta&&(Y=!0);continue}else X={lane:0,revertLane:D.revertLane,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},j===null?(p=j=X,d=r):j=j.next=X,be.lanes|=O,Kn|=O;X=D.action,Sl&&n(r,X),r=D.hasEagerState?D.eagerState:n(r,X)}else O={lane:X,revertLane:D.revertLane,gesture:D.gesture,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},j===null?(p=j=O,d=r):j=j.next=O,be.lanes|=X,Kn|=X;D=D.next}while(D!==null&&D!==t);if(j===null?d=r:j.next=p,!zt(r,e.memoizedState)&&(et=!0,Y&&(n=na,n!==null)))throw n;e.memoizedState=r,e.baseState=d,e.baseQueue=j,l.lastRenderedState=r}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function to(e){var t=We(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,r=t.memoizedState;if(i!==null){n.pending=null;var d=i=i.next;do r=e(r,d.action),d=d.next;while(d!==i);zt(r,t.memoizedState)||(et=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,l]}function ed(e,t,n){var l=be,i=We(),r=Ee;if(r){if(n===void 0)throw Error(o(407));n=n()}else n=t();var d=!zt((Ne||i).memoizedState,n);if(d&&(i.memoizedState=n,et=!0),i=i.queue,ao(ld.bind(null,l,i,e),[e]),i.getSnapshot!==t||d||Pe!==null&&Pe.memoizedState.tag&1){if(l.flags|=2048,oa(9,{destroy:void 0},nd.bind(null,l,i,n,t),null),qe===null)throw Error(o(349));r||(yn&127)!==0||td(l,t,n)}return n}function td(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=be.updateQueue,t===null?(t=Pi(),be.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function nd(e,t,n,l){t.value=n,t.getSnapshot=l,ad(t)&&id(e)}function ld(e,t,n){return n(function(){ad(t)&&id(e)})}function ad(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zt(e,n)}catch{return!0}}function id(e){var t=fl(e,2);t!==null&&wt(t,e,2)}function no(e){var t=mt();if(typeof e=="function"){var n=e;if(e=n(),Sl){Vt(!0);try{n()}finally{Vt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xn,lastRenderedState:e},t}function sd(e,t,n,l){return e.baseState=n,eo(e,Ne,typeof l=="function"?l:xn)}function Zv(e,t,n,l,i){if(as(e))throw Error(o(485));if(e=t.action,e!==null){var r={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){r.listeners.push(d)}};M.T!==null?n(!0):r.isTransition=!1,l(r),n=t.pending,n===null?(r.next=t.pending=r,rd(t,r)):(r.next=n.next,t.pending=n.next=r)}}function rd(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var r=M.T,d={};M.T=d;try{var p=n(i,l),j=M.S;j!==null&&j(d,p),od(e,t,p)}catch(D){lo(e,t,D)}finally{r!==null&&d.types!==null&&(r.types=d.types),M.T=r}}else try{r=n(i,l),od(e,t,r)}catch(D){lo(e,t,D)}}function od(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){cd(e,t,l)},function(l){return lo(e,t,l)}):cd(e,t,n)}function cd(e,t,n){t.status="fulfilled",t.value=n,ud(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,rd(e,n)))}function lo(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,ud(t),t=t.next;while(t!==l)}e.action=null}function ud(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function dd(e,t){return t}function fd(e,t){if(Ee){var n=qe.formState;if(n!==null){e:{var l=be;if(Ee){if(Ge){t:{for(var i=Ge,r=Yt;i.nodeType!==8;){if(!r){i=null;break t}if(i=Gt(i.nextSibling),i===null){i=null;break t}}r=i.data,i=r==="F!"||r==="F"?i:null}if(i){Ge=Gt(i.nextSibling),l=i.data==="F!";break e}}Bn(l)}l=!1}l&&(t=n[0])}}return n=mt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dd,lastRenderedState:t},n.queue=l,n=Ad.bind(null,be,l),l.dispatch=n,l=no(!1),r=co.bind(null,be,!1,l.queue),l=mt(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=Zv.bind(null,be,i,r,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function hd(e){var t=We();return pd(t,Ne,e)}function pd(e,t,n){if(t=eo(e,t,dd)[0],e=ts(xn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Za(t)}catch(d){throw d===la?Qi:d}else l=t;t=We();var i=t.queue,r=i.dispatch;return n!==t.memoizedState&&(be.flags|=2048,oa(9,{destroy:void 0},Wv.bind(null,i,n),null)),[l,r,e]}function Wv(e,t){e.action=t}function vd(e){var t=We(),n=Ne;if(n!==null)return pd(t,n,e);We(),t=t.memoizedState,n=We();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function oa(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=be.updateQueue,t===null&&(t=Pi(),be.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function gd(){return We().memoizedState}function ns(e,t,n,l){var i=mt();be.flags|=e,i.memoizedState=oa(1|t,{destroy:void 0},n,l===void 0?null:l)}function ls(e,t,n,l){var i=We();l=l===void 0?null:l;var r=i.memoizedState.inst;Ne!==null&&l!==null&&Zr(l,Ne.memoizedState.deps)?i.memoizedState=oa(t,r,n,l):(be.flags|=e,i.memoizedState=oa(1|t,r,n,l))}function md(e,t){ns(8390656,8,e,t)}function ao(e,t){ls(2048,8,e,t)}function Jv(e){be.flags|=4;var t=be.updateQueue;if(t===null)t=Pi(),be.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function yd(e){var t=We().memoizedState;return Jv({ref:t,nextImpl:e}),function(){if((Ae&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function xd(e,t){return ls(4,2,e,t)}function bd(e,t){return ls(4,4,e,t)}function Sd(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jd(e,t,n){n=n!=null?n.concat([e]):null,ls(4,4,Sd.bind(null,t,e),n)}function io(){}function kd(e,t){var n=We();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Zr(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function wd(e,t){var n=We();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Zr(t,l[1]))return l[0];if(l=e(),Sl){Vt(!0);try{e()}finally{Vt(!1)}}return n.memoizedState=[l,t],l}function so(e,t,n){return n===void 0||(yn&1073741824)!==0&&(Te&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Tf(),be.lanes|=e,Kn|=e,n)}function zd(e,t,n,l){return zt(n,t)?n:ia.current!==null?(e=so(e,n,l),zt(e,t)||(et=!0),e):(yn&42)===0||(yn&1073741824)!==0&&(Te&261930)===0?(et=!0,e.memoizedState=n):(e=Tf(),be.lanes|=e,Kn|=e,t)}function Td(e,t,n,l,i){var r=L.p;L.p=r!==0&&8>r?r:8;var d=M.T,p={};M.T=p,co(e,!1,t,n);try{var j=i(),D=M.S;if(D!==null&&D(p,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var Y=Qv(j,l);Wa(e,t,Y,At(e))}else Wa(e,t,l,At(e))}catch(X){Wa(e,t,{then:function(){},status:"rejected",reason:X},At())}finally{L.p=r,d!==null&&p.types!==null&&(d.types=p.types),M.T=d}}function Fv(){}function ro(e,t,n,l){if(e.tag!==5)throw Error(o(476));var i=Md(e).queue;Td(e,i,t,J,n===null?Fv:function(){return Ed(e),n(l)})}function Md(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xn,lastRenderedState:J},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ed(e){var t=Md(e);t.next===null&&(t=e.alternate.memoizedState),Wa(e,t.next.queue,{},At())}function oo(){return ut(fi)}function _d(){return We().memoizedState}function Cd(){return We().memoizedState}function Iv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=At();e=Yn(n);var l=$n(t,e,n);l!==null&&(wt(l,t,n),Xa(l,t,n)),t={cache:Ur()},e.payload=t;return}t=t.return}}function Pv(e,t,n){var l=At();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},as(e)?Dd(t,n):(n=Tr(e,t,n,l),n!==null&&(wt(n,e,l),Rd(n,t,l)))}function Ad(e,t,n){var l=At();Wa(e,t,n,l)}function Wa(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(as(e))Dd(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var d=t.lastRenderedState,p=r(d,n);if(i.hasEagerState=!0,i.eagerState=p,zt(p,d))return Bi(e,t,i,0),qe===null&&Ui(),!1}catch{}if(n=Tr(e,t,i,l),n!==null)return wt(n,e,l),Rd(n,t,l),!0}return!1}function co(e,t,n,l){if(l={lane:2,revertLane:$o(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},as(e)){if(t)throw Error(o(479))}else t=Tr(e,n,l,2),t!==null&&wt(t,e,2)}function as(e){var t=e.alternate;return e===be||t!==null&&t===be}function Dd(e,t){sa=Fi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rd(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,ie(e,n)}}var Ja={readContext:ut,use:es,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useLayoutEffect:Ve,useInsertionEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useSyncExternalStore:Ve,useId:Ve,useHostTransitionStatus:Ve,useFormState:Ve,useActionState:Ve,useOptimistic:Ve,useMemoCache:Ve,useCacheRefresh:Ve};Ja.useEffectEvent=Ve;var Od={readContext:ut,use:es,useCallback:function(e,t){return mt().memoizedState=[e,t===void 0?null:t],e},useContext:ut,useEffect:md,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ns(4194308,4,Sd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ns(4194308,4,e,t)},useInsertionEffect:function(e,t){ns(4,2,e,t)},useMemo:function(e,t){var n=mt();t=t===void 0?null:t;var l=e();if(Sl){Vt(!0);try{e()}finally{Vt(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=mt();if(n!==void 0){var i=n(t);if(Sl){Vt(!0);try{n(t)}finally{Vt(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=Pv.bind(null,be,e),[l.memoizedState,e]},useRef:function(e){var t=mt();return e={current:e},t.memoizedState=e},useState:function(e){e=no(e);var t=e.queue,n=Ad.bind(null,be,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:io,useDeferredValue:function(e,t){var n=mt();return so(n,e,t)},useTransition:function(){var e=no(!1);return e=Td.bind(null,be,e.queue,!0,!1),mt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=be,i=mt();if(Ee){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),qe===null)throw Error(o(349));(Te&127)!==0||td(l,t,n)}i.memoizedState=n;var r={value:n,getSnapshot:t};return i.queue=r,md(ld.bind(null,l,r,e),[e]),l.flags|=2048,oa(9,{destroy:void 0},nd.bind(null,l,r,n,t),null),n},useId:function(){var e=mt(),t=qe.identifierPrefix;if(Ee){var n=en,l=Pt;n=(l&~(1<<32-gt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Ii++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Vv++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:oo,useFormState:fd,useActionState:fd,useOptimistic:function(e){var t=mt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=co.bind(null,be,!0,n),n.dispatch=t,[e,t]},useMemoCache:Pr,useCacheRefresh:function(){return mt().memoizedState=Iv.bind(null,be)},useEffectEvent:function(e){var t=mt(),n={impl:e};return t.memoizedState=n,function(){if((Ae&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},uo={readContext:ut,use:es,useCallback:kd,useContext:ut,useEffect:ao,useImperativeHandle:jd,useInsertionEffect:xd,useLayoutEffect:bd,useMemo:wd,useReducer:ts,useRef:gd,useState:function(){return ts(xn)},useDebugValue:io,useDeferredValue:function(e,t){var n=We();return zd(n,Ne.memoizedState,e,t)},useTransition:function(){var e=ts(xn)[0],t=We().memoizedState;return[typeof e=="boolean"?e:Za(e),t]},useSyncExternalStore:ed,useId:_d,useHostTransitionStatus:oo,useFormState:hd,useActionState:hd,useOptimistic:function(e,t){var n=We();return sd(n,Ne,e,t)},useMemoCache:Pr,useCacheRefresh:Cd};uo.useEffectEvent=yd;var Nd={readContext:ut,use:es,useCallback:kd,useContext:ut,useEffect:ao,useImperativeHandle:jd,useInsertionEffect:xd,useLayoutEffect:bd,useMemo:wd,useReducer:to,useRef:gd,useState:function(){return to(xn)},useDebugValue:io,useDeferredValue:function(e,t){var n=We();return Ne===null?so(n,e,t):zd(n,Ne.memoizedState,e,t)},useTransition:function(){var e=to(xn)[0],t=We().memoizedState;return[typeof e=="boolean"?e:Za(e),t]},useSyncExternalStore:ed,useId:_d,useHostTransitionStatus:oo,useFormState:vd,useActionState:vd,useOptimistic:function(e,t){var n=We();return Ne!==null?sd(n,Ne,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Pr,useCacheRefresh:Cd};Nd.useEffectEvent=yd;function fo(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:k({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ho={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=At(),i=Yn(l);i.payload=t,n!=null&&(i.callback=n),t=$n(e,i,l),t!==null&&(wt(t,e,l),Xa(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=At(),i=Yn(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=$n(e,i,l),t!==null&&(wt(t,e,l),Xa(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=At(),l=Yn(n);l.tag=2,t!=null&&(l.callback=t),t=$n(e,l,n),t!==null&&(wt(t,e,n),Xa(t,e,n))}};function Hd(e,t,n,l,i,r,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,r,d):t.prototype&&t.prototype.isPureReactComponent?!Ha(n,l)||!Ha(i,r):!0}function Ud(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&ho.enqueueReplaceState(t,t.state,null)}function jl(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=k({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function Bd(e){Hi(e)}function qd(e){console.error(e)}function Ld(e){Hi(e)}function is(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Yd(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function po(e,t,n){return n=Yn(n),n.tag=3,n.payload={element:null},n.callback=function(){is(e,t)},n}function $d(e){return e=Yn(e),e.tag=3,e}function Gd(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=l.value;e.payload=function(){return i(r)},e.callback=function(){Yd(t,n,l)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Yd(t,n,l),typeof i!="function"&&(Zn===null?Zn=new Set([this]):Zn.add(this));var p=l.stack;this.componentDidCatch(l.value,{componentStack:p!==null?p:""})})}function eg(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&ea(t,n,i,!0),n=Mt.current,n!==null){switch(n.tag){case 31:case 13:return $t===null?ms():n.alternate===null&&Ke===0&&(Ke=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===Vi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),qo(e,l,i)),!1;case 22:return n.flags|=65536,l===Vi?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),qo(e,l,i)),!1}throw Error(o(435,n.tag))}return qo(e,l,i),ms(),!1}if(Ee)return t=Mt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==Dr&&(e=Error(o(422),{cause:l}),qa(Bt(e,n)))):(l!==Dr&&(t=Error(o(423),{cause:l}),qa(Bt(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=Bt(l,n),i=po(e.stateNode,l,i),Gr(e,i),Ke!==4&&(Ke=2)),!1;var r=Error(o(520),{cause:l});if(r=Bt(r,n),ai===null?ai=[r]:ai.push(r),Ke!==4&&(Ke=2),t===null)return!0;l=Bt(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=po(n.stateNode,l,e),Gr(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Zn===null||!Zn.has(r))))return n.flags|=65536,i&=-i,n.lanes|=i,i=$d(i),Gd(i,e,n,l),Gr(n,i),!1}n=n.return}while(n!==null);return!1}var vo=Error(o(461)),et=!1;function dt(e,t,n,l){t.child=e===null?Ku(t,null,n,l):bl(t,e.child,n,l)}function Xd(e,t,n,l,i){n=n.render;var r=t.ref;if("ref"in l){var d={};for(var p in l)p!=="ref"&&(d[p]=l[p])}else d=l;return gl(t),l=Wr(e,t,n,d,r,i),p=Jr(),e!==null&&!et?(Fr(e,t,i),bn(e,t,i)):(Ee&&p&&Cr(t),t.flags|=1,dt(e,t,l,i),t.child)}function Qd(e,t,n,l,i){if(e===null){var r=n.type;return typeof r=="function"&&!Mr(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,Vd(e,t,r,l,i)):(e=Li(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!ko(e,i)){var d=r.memoizedProps;if(n=n.compare,n=n!==null?n:Ha,n(d,l)&&e.ref===t.ref)return bn(e,t,i)}return t.flags|=1,e=pn(r,l),e.ref=t.ref,e.return=t,t.child=e}function Vd(e,t,n,l,i){if(e!==null){var r=e.memoizedProps;if(Ha(r,l)&&e.ref===t.ref)if(et=!1,t.pendingProps=l=r,ko(e,i))(e.flags&131072)!==0&&(et=!0);else return t.lanes=e.lanes,bn(e,t,i)}return go(e,t,n,l,i)}function Kd(e,t,n,l){var i=l.children,r=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(r=r!==null?r.baseLanes|n:n,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~r}else l=0,t.child=null;return Zd(e,t,r,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xi(t,r!==null?r.cachePool:null),r!==null?Ju(t,r):Qr(),Fu(t);else return l=t.lanes=536870912,Zd(e,t,r!==null?r.baseLanes|n:n,n,l)}else r!==null?(Xi(t,r.cachePool),Ju(t,r),Xn(),t.memoizedState=null):(e!==null&&Xi(t,null),Qr(),Xn());return dt(e,t,i,n),t.child}function Fa(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Zd(e,t,n,l,i){var r=qr();return r=r===null?null:{parent:Ie._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Xi(t,null),Qr(),Fu(t),e!==null&&ea(e,t,l,!0),t.childLanes=i,null}function ss(e,t){return t=os({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wd(e,t,n){return bl(t,e.child,null,n),e=ss(t,t.pendingProps),e.flags|=2,Et(t),t.memoizedState=null,e}function tg(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ee){if(l.mode==="hidden")return e=ss(t,l),t.lanes=536870912,Fa(null,e);if(Kr(t),(e=Ge)?(e=oh(e,Yt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hn!==null?{id:Pt,overflow:en}:null,retryLane:536870912,hydrationErrors:null},n=Du(e),n.return=t,t.child=n,ct=t,Ge=null)):e=null,e===null)throw Bn(t);return t.lanes=536870912,null}return ss(t,l)}var r=e.memoizedState;if(r!==null){var d=r.dehydrated;if(Kr(t),i)if(t.flags&256)t.flags&=-257,t=Wd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(et||ea(e,t,n,!1),i=(n&e.childLanes)!==0,et||i){if(l=qe,l!==null&&(d=nt(l,n),d!==0&&d!==r.retryLane))throw r.retryLane=d,fl(e,d),wt(l,e,d),vo;ms(),t=Wd(e,t,n)}else e=r.treeContext,Ge=Gt(d.nextSibling),ct=t,Ee=!0,Un=null,Yt=!1,e!==null&&Nu(t,e),t=ss(t,l),t.flags|=4096;return t}return e=pn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function rs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function go(e,t,n,l,i){return gl(t),n=Wr(e,t,n,l,void 0,i),l=Jr(),e!==null&&!et?(Fr(e,t,i),bn(e,t,i)):(Ee&&l&&Cr(t),t.flags|=1,dt(e,t,n,i),t.child)}function Jd(e,t,n,l,i,r){return gl(t),t.updateQueue=null,n=Pu(t,l,n,i),Iu(e),l=Jr(),e!==null&&!et?(Fr(e,t,r),bn(e,t,r)):(Ee&&l&&Cr(t),t.flags|=1,dt(e,t,n,r),t.child)}function Fd(e,t,n,l,i){if(gl(t),t.stateNode===null){var r=Jl,d=n.contextType;typeof d=="object"&&d!==null&&(r=ut(d)),r=new n(l,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=ho,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=l,r.state=t.memoizedState,r.refs={},Yr(t),d=n.contextType,r.context=typeof d=="object"&&d!==null?ut(d):Jl,r.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(fo(t,n,d,l),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(d=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),d!==r.state&&ho.enqueueReplaceState(r,r.state,null),Va(t,l,r,i),Qa(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){r=t.stateNode;var p=t.memoizedProps,j=jl(n,p);r.props=j;var D=r.context,Y=n.contextType;d=Jl,typeof Y=="object"&&Y!==null&&(d=ut(Y));var X=n.getDerivedStateFromProps;Y=typeof X=="function"||typeof r.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,Y||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(p||D!==d)&&Ud(t,r,l,d),Ln=!1;var O=t.memoizedState;r.state=O,Va(t,l,r,i),Qa(),D=t.memoizedState,p||O!==D||Ln?(typeof X=="function"&&(fo(t,n,X,l),D=t.memoizedState),(j=Ln||Hd(t,n,j,l,O,D,d))?(Y||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=D),r.props=l,r.state=D,r.context=d,l=j):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{r=t.stateNode,$r(e,t),d=t.memoizedProps,Y=jl(n,d),r.props=Y,X=t.pendingProps,O=r.context,D=n.contextType,j=Jl,typeof D=="object"&&D!==null&&(j=ut(D)),p=n.getDerivedStateFromProps,(D=typeof p=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(d!==X||O!==j)&&Ud(t,r,l,j),Ln=!1,O=t.memoizedState,r.state=O,Va(t,l,r,i),Qa();var U=t.memoizedState;d!==X||O!==U||Ln||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof p=="function"&&(fo(t,n,p,l),U=t.memoizedState),(Y=Ln||Hd(t,n,Y,l,O,U,j)||e!==null&&e.dependencies!==null&&$i(e.dependencies))?(D||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(l,U,j),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(l,U,j)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=U),r.props=l,r.state=U,r.context=j,l=Y):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),l=!1)}return r=l,rs(e,t),l=(t.flags&128)!==0,r||l?(r=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&l?(t.child=bl(t,e.child,null,i),t.child=bl(t,null,n,i)):dt(e,t,n,i),t.memoizedState=r.state,e=t.child):e=bn(e,t,i),e}function Id(e,t,n,l){return pl(),t.flags|=256,dt(e,t,n,l),t.child}var mo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yo(e){return{baseLanes:e,cachePool:Yu()}}function xo(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Ct),e}function Pd(e,t,n){var l=t.pendingProps,i=!1,r=(t.flags&128)!==0,d;if((d=r)||(d=e!==null&&e.memoizedState===null?!1:(Ze.current&2)!==0),d&&(i=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ee){if(i?Gn(t):Xn(),(e=Ge)?(e=oh(e,Yt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hn!==null?{id:Pt,overflow:en}:null,retryLane:536870912,hydrationErrors:null},n=Du(e),n.return=t,t.child=n,ct=t,Ge=null)):e=null,e===null)throw Bn(t);return tc(e)?t.lanes=32:t.lanes=536870912,null}var p=l.children;return l=l.fallback,i?(Xn(),i=t.mode,p=os({mode:"hidden",children:p},i),l=hl(l,i,n,null),p.return=t,l.return=t,p.sibling=l,t.child=p,l=t.child,l.memoizedState=yo(n),l.childLanes=xo(e,d,n),t.memoizedState=mo,Fa(null,l)):(Gn(t),bo(t,p))}var j=e.memoizedState;if(j!==null&&(p=j.dehydrated,p!==null)){if(r)t.flags&256?(Gn(t),t.flags&=-257,t=So(e,t,n)):t.memoizedState!==null?(Xn(),t.child=e.child,t.flags|=128,t=null):(Xn(),p=l.fallback,i=t.mode,l=os({mode:"visible",children:l.children},i),p=hl(p,i,n,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,bl(t,e.child,null,n),l=t.child,l.memoizedState=yo(n),l.childLanes=xo(e,d,n),t.memoizedState=mo,t=Fa(null,l));else if(Gn(t),tc(p)){if(d=p.nextSibling&&p.nextSibling.dataset,d)var D=d.dgst;d=D,l=Error(o(419)),l.stack="",l.digest=d,qa({value:l,source:null,stack:null}),t=So(e,t,n)}else if(et||ea(e,t,n,!1),d=(n&e.childLanes)!==0,et||d){if(d=qe,d!==null&&(l=nt(d,n),l!==0&&l!==j.retryLane))throw j.retryLane=l,fl(e,l),wt(d,e,l),vo;ec(p)||ms(),t=So(e,t,n)}else ec(p)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Ge=Gt(p.nextSibling),ct=t,Ee=!0,Un=null,Yt=!1,e!==null&&Nu(t,e),t=bo(t,l.children),t.flags|=4096);return t}return i?(Xn(),p=l.fallback,i=t.mode,j=e.child,D=j.sibling,l=pn(j,{mode:"hidden",children:l.children}),l.subtreeFlags=j.subtreeFlags&65011712,D!==null?p=pn(D,p):(p=hl(p,i,n,null),p.flags|=2),p.return=t,l.return=t,l.sibling=p,t.child=l,Fa(null,l),l=t.child,p=e.child.memoizedState,p===null?p=yo(n):(i=p.cachePool,i!==null?(j=Ie._currentValue,i=i.parent!==j?{parent:j,pool:j}:i):i=Yu(),p={baseLanes:p.baseLanes|n,cachePool:i}),l.memoizedState=p,l.childLanes=xo(e,d,n),t.memoizedState=mo,Fa(e.child,l)):(Gn(t),n=e.child,e=n.sibling,n=pn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}function bo(e,t){return t=os({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function os(e,t){return e=Tt(22,e,null,t),e.lanes=0,e}function So(e,t,n){return bl(t,e.child,null,n),e=bo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ef(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Nr(e.return,t,n)}function jo(e,t,n,l,i,r){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:r}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=i,d.treeForkCount=r)}function tf(e,t,n){var l=t.pendingProps,i=l.revealOrder,r=l.tail;l=l.children;var d=Ze.current,p=(d&2)!==0;if(p?(d=d&1|2,t.flags|=128):d&=1,Z(Ze,d),dt(e,t,l,n),l=Ee?Ba:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ef(e,n,t);else if(e.tag===19)ef(e,n,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(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ji(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),jo(t,!1,i,n,r,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ji(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}jo(t,!0,n,null,r,l);break;case"together":jo(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function bn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ea(e,t,n,!1),(n&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,n=pn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ko(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&$i(e)))}function ng(e,t,n){switch(t.tag){case 3:I(t,t.stateNode.containerInfo),qn(t,Ie,e.memoizedState.cache),pl();break;case 27:case 5:Be(t);break;case 4:I(t,t.stateNode.containerInfo);break;case 10:qn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Kr(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Gn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Pd(e,t,n):(Gn(t),e=bn(e,t,n),e!==null?e.sibling:null);Gn(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(ea(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return tf(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Z(Ze,Ze.current),l)break;return null;case 22:return t.lanes=0,Kd(e,t,n,t.pendingProps);case 24:qn(t,Ie,e.memoizedState.cache)}return bn(e,t,n)}function nf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)et=!0;else{if(!ko(e,n)&&(t.flags&128)===0)return et=!1,ng(e,t,n);et=(e.flags&131072)!==0}else et=!1,Ee&&(t.flags&1048576)!==0&&Ou(t,Ba,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=yl(t.elementType),t.type=e,typeof e=="function")Mr(e)?(l=jl(e,l),t.tag=1,t=Fd(null,t,e,l,n)):(t.tag=0,t=go(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===W){t.tag=11,t=Xd(null,t,e,l,n);break e}else if(i===B){t.tag=14,t=Qd(null,t,e,l,n);break e}}throw t=re(e)||e,Error(o(306,t,""))}}return t;case 0:return go(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=jl(l,t.pendingProps),Fd(e,t,l,i,n);case 3:e:{if(I(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var r=t.memoizedState;i=r.element,$r(e,t),Va(t,l,null,n);var d=t.memoizedState;if(l=d.cache,qn(t,Ie,l),l!==r.cache&&Hr(t,[Ie],n,!0),Qa(),l=d.element,r.isDehydrated)if(r={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Id(e,t,l,n);break e}else if(l!==i){i=Bt(Error(o(424)),t),qa(i),t=Id(e,t,l,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ge=Gt(e.firstChild),ct=t,Ee=!0,Un=null,Yt=!0,n=Ku(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pl(),l===i){t=bn(e,t,n);break e}dt(e,t,l,n)}t=t.child}return t;case 26:return rs(e,t),e===null?(n=ph(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ee||(n=t.type,e=t.pendingProps,l=ws(ae.current).createElement(n),l[ot]=t,l[yt]=e,ft(l,n,e),at(l),t.stateNode=l):t.memoizedState=ph(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Be(t),e===null&&Ee&&(l=t.stateNode=dh(t.type,t.pendingProps,ae.current),ct=t,Yt=!0,i=Ge,In(t.type)?(nc=i,Ge=Gt(l.firstChild)):Ge=i),dt(e,t,t.pendingProps.children,n),rs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ee&&((i=l=Ge)&&(l=Dg(l,t.type,t.pendingProps,Yt),l!==null?(t.stateNode=l,ct=t,Ge=Gt(l.firstChild),Yt=!1,i=!0):i=!1),i||Bn(t)),Be(t),i=t.type,r=t.pendingProps,d=e!==null?e.memoizedProps:null,l=r.children,Fo(i,r)?l=null:d!==null&&Fo(i,d)&&(t.flags|=32),t.memoizedState!==null&&(i=Wr(e,t,Kv,null,null,n),fi._currentValue=i),rs(e,t),dt(e,t,l,n),t.child;case 6:return e===null&&Ee&&((e=n=Ge)&&(n=Rg(n,t.pendingProps,Yt),n!==null?(t.stateNode=n,ct=t,Ge=null,e=!0):e=!1),e||Bn(t)),null;case 13:return Pd(e,t,n);case 4:return I(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=bl(t,null,l,n):dt(e,t,l,n),t.child;case 11:return Xd(e,t,t.type,t.pendingProps,n);case 7:return dt(e,t,t.pendingProps,n),t.child;case 8:return dt(e,t,t.pendingProps.children,n),t.child;case 12:return dt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,qn(t,t.type,l.value),dt(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,gl(t),i=ut(i),l=l(i),t.flags|=1,dt(e,t,l,n),t.child;case 14:return Qd(e,t,t.type,t.pendingProps,n);case 15:return Vd(e,t,t.type,t.pendingProps,n);case 19:return tf(e,t,n);case 31:return tg(e,t,n);case 22:return Kd(e,t,n,t.pendingProps);case 24:return gl(t),l=ut(Ie),e===null?(i=qr(),i===null&&(i=qe,r=Ur(),i.pooledCache=r,r.refCount++,r!==null&&(i.pooledCacheLanes|=n),i=r),t.memoizedState={parent:l,cache:i},Yr(t),qn(t,Ie,i)):((e.lanes&n)!==0&&($r(e,t),Va(t,null,null,n),Qa()),i=e.memoizedState,r=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),qn(t,Ie,l)):(l=r.cache,qn(t,Ie,l),l!==i.cache&&Hr(t,[Ie],n,!0))),dt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Sn(e){e.flags|=4}function wo(e,t,n,l,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Cf())e.flags|=8192;else throw xl=Vi,Lr}else e.flags&=-16777217}function lf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!xh(t))if(Cf())e.flags|=8192;else throw xl=Vi,Lr}function cs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?wa():536870912,e.lanes|=t,fa|=t)}function Ia(e,t){if(!Ee)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags&65011712,l|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function lg(e,t,n){var l=t.pendingProps;switch(Ar(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return Xe(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),mn(Ie),K(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Pl(t)?Sn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Rr())),Xe(t),null;case 26:var i=t.type,r=t.memoizedState;return e===null?(Sn(t),r!==null?(Xe(t),lf(t,r)):(Xe(t),wo(t,i,null,l,n))):r?r!==e.memoizedState?(Sn(t),Xe(t),lf(t,r)):(Xe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Sn(t),Xe(t),wo(t,i,e,l,n)),null;case 27:if(Le(t),n=ae.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Sn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Xe(t),null}e=P.current,Pl(t)?Hu(t):(e=dh(i,l,n),t.stateNode=e,Sn(t))}return Xe(t),null;case 5:if(Le(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Sn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Xe(t),null}if(r=P.current,Pl(t))Hu(t);else{var d=ws(ae.current);switch(r){case 1:r=d.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:r=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":r=d.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":r=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":r=d.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?r.multiple=!0:l.size&&(r.size=l.size);break;default:r=typeof l.is=="string"?d.createElement(i,{is:l.is}):d.createElement(i)}}r[ot]=t,r[yt]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)r.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=r;e:switch(ft(r,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Sn(t)}}return Xe(t),wo(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Sn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=ae.current,Pl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=ct,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||eh(e.nodeValue,n)),e||Bn(t,!0)}else e=ws(e).createTextNode(l),e[ot]=t,t.stateNode=e}return Xe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Pl(t),n!==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[ot]=t}else pl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),e=!1}else n=Rr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Et(t),t):(Et(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Xe(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Pl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(o(317));i[ot]=t}else pl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),i=!1}else i=Rr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Et(t),t):(Et(t),null)}return Et(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),r=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(r=l.memoizedState.cachePool.pool),r!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),cs(t,t.updateQueue),Xe(t),null);case 4:return K(),e===null&&Vo(t.stateNode.containerInfo),Xe(t),null;case 10:return mn(t.type),Xe(t),null;case 19:if(N(Ze),l=t.memoizedState,l===null)return Xe(t),null;if(i=(t.flags&128)!==0,r=l.rendering,r===null)if(i)Ia(l,!1);else{if(Ke!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Ji(e),r!==null){for(t.flags|=128,Ia(l,!1),e=r.updateQueue,t.updateQueue=e,cs(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Au(n,e),n=n.sibling;return Z(Ze,Ze.current&1|2),Ee&&vn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ht()>ps&&(t.flags|=128,i=!0,Ia(l,!1),t.lanes=4194304)}else{if(!i)if(e=Ji(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,cs(t,e),Ia(l,!0),l.tail===null&&l.tailMode==="hidden"&&!r.alternate&&!Ee)return Xe(t),null}else 2*ht()-l.renderingStartTime>ps&&n!==536870912&&(t.flags|=128,i=!0,Ia(l,!1),t.lanes=4194304);l.isBackwards?(r.sibling=t.child,t.child=r):(e=l.last,e!==null?e.sibling=r:t.child=r,l.last=r)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ht(),e.sibling=null,n=Ze.current,Z(Ze,i?n&1|2:n&1),Ee&&vn(t,l.treeForkCount),e):(Xe(t),null);case 22:case 23:return Et(t),Vr(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),n=t.updateQueue,n!==null&&cs(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&N(ml),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),mn(Ie),Xe(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function ag(e,t){switch(Ar(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mn(Ie),K(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Le(t),null;case 31:if(t.memoizedState!==null){if(Et(t),t.alternate===null)throw Error(o(340));pl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Et(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));pl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return N(Ze),null;case 4:return K(),null;case 10:return mn(t.type),null;case 22:case 23:return Et(t),Vr(),e!==null&&N(ml),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return mn(Ie),null;case 25:return null;default:return null}}function af(e,t){switch(Ar(t),t.tag){case 3:mn(Ie),K();break;case 26:case 27:case 5:Le(t);break;case 4:K();break;case 31:t.memoizedState!==null&&Et(t);break;case 13:Et(t);break;case 19:N(Ze);break;case 10:mn(t.type);break;case 22:case 23:Et(t),Vr(),e!==null&&N(ml);break;case 24:mn(Ie)}}function Pa(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var r=n.create,d=n.inst;l=r(),d.destroy=l}n=n.next}while(n!==i)}}catch(p){Oe(t,t.return,p)}}function Qn(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var r=i.next;l=r;do{if((l.tag&e)===e){var d=l.inst,p=d.destroy;if(p!==void 0){d.destroy=void 0,i=t;var j=n,D=p;try{D()}catch(Y){Oe(i,j,Y)}}}l=l.next}while(l!==r)}}catch(Y){Oe(t,t.return,Y)}}function sf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Wu(t,n)}catch(l){Oe(e,e.return,l)}}}function rf(e,t,n){n.props=jl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Oe(e,t,l)}}function ei(e,t){try{var n=e.ref;if(n!==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 n=="function"?e.refCleanup=n(l):n.current=l}}catch(i){Oe(e,t,i)}}function tn(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){Oe(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Oe(e,t,i)}else n.current=null}function of(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(i){Oe(e,e.return,i)}}function zo(e,t,n){try{var l=e.stateNode;Tg(l,e.type,n,t),l[yt]=t}catch(i){Oe(e,e.return,i)}}function cf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&In(e.type)||e.tag===4}function To(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cf(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&&In(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 Mo(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=fn));else if(l!==4&&(l===27&&In(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Mo(e,t,n),e=e.sibling;e!==null;)Mo(e,t,n),e=e.sibling}function us(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&In(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(us(e,t,n),e=e.sibling;e!==null;)us(e,t,n),e=e.sibling}function uf(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ft(t,l,n),t[ot]=e,t[yt]=n}catch(r){Oe(e,e.return,r)}}var jn=!1,tt=!1,Eo=!1,df=typeof WeakSet=="function"?WeakSet:Set,it=null;function ig(e,t){if(e=e.containerInfo,Wo=As,e=ju(e),br(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var i=l.anchorOffset,r=l.focusNode;l=l.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var d=0,p=-1,j=-1,D=0,Y=0,X=e,O=null;t:for(;;){for(var U;X!==n||i!==0&&X.nodeType!==3||(p=d+i),X!==r||l!==0&&X.nodeType!==3||(j=d+l),X.nodeType===3&&(d+=X.nodeValue.length),(U=X.firstChild)!==null;)O=X,X=U;for(;;){if(X===e)break t;if(O===n&&++D===i&&(p=d),O===r&&++Y===l&&(j=d),(U=X.nextSibling)!==null)break;X=O,O=X.parentNode}X=U}n=p===-1||j===-1?null:{start:p,end:j}}else n=null}n=n||{start:0,end:0}}else n=null;for(Jo={focusedElem:e,selectionRange:n},As=!1,it=t;it!==null;)if(t=it,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,it=e;else for(;it!==null;){switch(t=it,r=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(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,n=t,i=r.memoizedProps,r=r.memoizedState,l=n.stateNode;try{var ce=jl(n.type,i);e=l.getSnapshotBeforeUpdate(ce,r),l.__reactInternalSnapshotBeforeUpdate=e}catch(ge){Oe(n,n.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Po(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Po(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,it=e;break}it=t.return}}function ff(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:wn(e,n),l&4&&Pa(5,n);break;case 1:if(wn(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){Oe(n,n.return,d)}else{var i=jl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Oe(n,n.return,d)}}l&64&&sf(n),l&512&&ei(n,n.return);break;case 3:if(wn(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Wu(e,t)}catch(d){Oe(n,n.return,d)}}break;case 27:t===null&&l&4&&uf(n);case 26:case 5:wn(e,n),t===null&&l&4&&of(n),l&512&&ei(n,n.return);break;case 12:wn(e,n);break;case 31:wn(e,n),l&4&&vf(e,n);break;case 13:wn(e,n),l&4&&gf(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=pg.bind(null,n),Og(e,n))));break;case 22:if(l=n.memoizedState!==null||jn,!l){t=t!==null&&t.memoizedState!==null||tt,i=jn;var r=tt;jn=l,(tt=t)&&!r?zn(e,n,(n.subtreeFlags&8772)!==0):wn(e,n),jn=i,tt=r}break;case 30:break;default:wn(e,n)}}function hf(e){var t=e.alternate;t!==null&&(e.alternate=null,hf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&lr(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 Qe=null,bt=!1;function kn(e,t,n){for(n=n.child;n!==null;)pf(e,t,n),n=n.sibling}function pf(e,t,n){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(on,n)}catch{}switch(n.tag){case 26:tt||tn(n,t),kn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tt||tn(n,t);var l=Qe,i=bt;In(n.type)&&(Qe=n.stateNode,bt=!1),kn(e,t,n),ci(n.stateNode),Qe=l,bt=i;break;case 5:tt||tn(n,t);case 6:if(l=Qe,i=bt,Qe=null,kn(e,t,n),Qe=l,bt=i,Qe!==null)if(bt)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(n.stateNode)}catch(r){Oe(n,t,r)}else try{Qe.removeChild(n.stateNode)}catch(r){Oe(n,t,r)}break;case 18:Qe!==null&&(bt?(e=Qe,sh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ba(e)):sh(Qe,n.stateNode));break;case 4:l=Qe,i=bt,Qe=n.stateNode.containerInfo,bt=!0,kn(e,t,n),Qe=l,bt=i;break;case 0:case 11:case 14:case 15:Qn(2,n,t),tt||Qn(4,n,t),kn(e,t,n);break;case 1:tt||(tn(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&rf(n,t,l)),kn(e,t,n);break;case 21:kn(e,t,n);break;case 22:tt=(l=tt)||n.memoizedState!==null,kn(e,t,n),tt=l;break;default:kn(e,t,n)}}function vf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ba(e)}catch(n){Oe(t,t.return,n)}}}function gf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ba(e)}catch(n){Oe(t,t.return,n)}}function sg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new df),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new df),t;default:throw Error(o(435,e.tag))}}function ds(e,t){var n=sg(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=vg.bind(null,e,l);l.then(i,i)}})}function St(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],r=e,d=t,p=d;e:for(;p!==null;){switch(p.tag){case 27:if(In(p.type)){Qe=p.stateNode,bt=!1;break e}break;case 5:Qe=p.stateNode,bt=!1;break e;case 3:case 4:Qe=p.stateNode.containerInfo,bt=!0;break e}p=p.return}if(Qe===null)throw Error(o(160));pf(r,d,i),Qe=null,bt=!1,r=i.alternate,r!==null&&(r.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)mf(t,e),t=t.sibling}var Wt=null;function mf(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:St(t,e),jt(e),l&4&&(Qn(3,e,e.return),Pa(3,e),Qn(5,e,e.return));break;case 1:St(t,e),jt(e),l&512&&(tt||n===null||tn(n,n.return)),l&64&&jn&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var i=Wt;if(St(t,e),jt(e),l&512&&(tt||n===null||tn(n,n.return)),l&4){var r=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(l){case"title":r=i.getElementsByTagName("title")[0],(!r||r[Ma]||r[ot]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=i.createElement(l),i.head.insertBefore(r,i.querySelector("head > title"))),ft(r,l,n),r[ot]=e,at(r),l=r;break e;case"link":var d=mh("link","href",i).get(l+(n.href||""));if(d){for(var p=0;p<d.length;p++)if(r=d[p],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){d.splice(p,1);break t}}r=i.createElement(l),ft(r,l,n),i.head.appendChild(r);break;case"meta":if(d=mh("meta","content",i).get(l+(n.content||""))){for(p=0;p<d.length;p++)if(r=d[p],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){d.splice(p,1);break t}}r=i.createElement(l),ft(r,l,n),i.head.appendChild(r);break;default:throw Error(o(468,l))}r[ot]=e,at(r),l=r}e.stateNode=l}else yh(i,e.type,e.stateNode);else e.stateNode=gh(i,l,e.memoizedProps);else r!==l?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,l===null?yh(i,e.type,e.stateNode):gh(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&zo(e,e.memoizedProps,n.memoizedProps)}break;case 27:St(t,e),jt(e),l&512&&(tt||n===null||tn(n,n.return)),n!==null&&l&4&&zo(e,e.memoizedProps,n.memoizedProps);break;case 5:if(St(t,e),jt(e),l&512&&(tt||n===null||tn(n,n.return)),e.flags&32){i=e.stateNode;try{Gl(i,"")}catch(ce){Oe(e,e.return,ce)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,zo(e,i,n!==null?n.memoizedProps:i)),l&1024&&(Eo=!0);break;case 6:if(St(t,e),jt(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ce){Oe(e,e.return,ce)}}break;case 3:if(Ms=null,i=Wt,Wt=zs(t.containerInfo),St(t,e),Wt=i,jt(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{ba(t.containerInfo)}catch(ce){Oe(e,e.return,ce)}Eo&&(Eo=!1,yf(e));break;case 4:l=Wt,Wt=zs(e.stateNode.containerInfo),St(t,e),jt(e),Wt=l;break;case 12:St(t,e),jt(e);break;case 31:St(t,e),jt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ds(e,l)));break;case 13:St(t,e),jt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(hs=ht()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ds(e,l)));break;case 22:i=e.memoizedState!==null;var j=n!==null&&n.memoizedState!==null,D=jn,Y=tt;if(jn=D||i,tt=Y||j,St(t,e),tt=Y,jn=D,jt(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||j||jn||tt||kl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){j=n=t;try{if(r=j.stateNode,i)d=r.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{p=j.stateNode;var X=j.memoizedProps.style,O=X!=null&&X.hasOwnProperty("display")?X.display:null;p.style.display=O==null||typeof O=="boolean"?"":(""+O).trim()}}catch(ce){Oe(j,j.return,ce)}}}else if(t.tag===6){if(n===null){j=t;try{j.stateNode.nodeValue=i?"":j.memoizedProps}catch(ce){Oe(j,j.return,ce)}}}else if(t.tag===18){if(n===null){j=t;try{var U=j.stateNode;i?rh(U,!0):rh(j.stateNode,!1)}catch(ce){Oe(j,j.return,ce)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,ds(e,n))));break;case 19:St(t,e),jt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ds(e,l)));break;case 30:break;case 21:break;default:St(t,e),jt(e)}}function jt(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(cf(l)){n=l;break}l=l.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var i=n.stateNode,r=To(e);us(e,r,i);break;case 5:var d=n.stateNode;n.flags&32&&(Gl(d,""),n.flags&=-33);var p=To(e);us(e,p,d);break;case 3:case 4:var j=n.stateNode.containerInfo,D=To(e);Mo(e,D,j);break;default:throw Error(o(161))}}catch(Y){Oe(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function wn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ff(e,t.alternate,t),t=t.sibling}function kl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Qn(4,t,t.return),kl(t);break;case 1:tn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&rf(t,t.return,n),kl(t);break;case 27:ci(t.stateNode);case 26:case 5:tn(t,t.return),kl(t);break;case 22:t.memoizedState===null&&kl(t);break;case 30:kl(t);break;default:kl(t)}e=e.sibling}}function zn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,r=t,d=r.flags;switch(r.tag){case 0:case 11:case 15:zn(i,r,n),Pa(4,r);break;case 1:if(zn(i,r,n),l=r,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(D){Oe(l,l.return,D)}if(l=r,i=l.updateQueue,i!==null){var p=l.stateNode;try{var j=i.shared.hiddenCallbacks;if(j!==null)for(i.shared.hiddenCallbacks=null,i=0;i<j.length;i++)Zu(j[i],p)}catch(D){Oe(l,l.return,D)}}n&&d&64&&sf(r),ei(r,r.return);break;case 27:uf(r);case 26:case 5:zn(i,r,n),n&&l===null&&d&4&&of(r),ei(r,r.return);break;case 12:zn(i,r,n);break;case 31:zn(i,r,n),n&&d&4&&vf(i,r);break;case 13:zn(i,r,n),n&&d&4&&gf(i,r);break;case 22:r.memoizedState===null&&zn(i,r,n),ei(r,r.return);break;case 30:break;default:zn(i,r,n)}t=t.sibling}}function _o(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&La(n))}function Co(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&La(e))}function Jt(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xf(e,t,n,l),t=t.sibling}function xf(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Jt(e,t,n,l),i&2048&&Pa(9,t);break;case 1:Jt(e,t,n,l);break;case 3:Jt(e,t,n,l),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&La(e)));break;case 12:if(i&2048){Jt(e,t,n,l),e=t.stateNode;try{var r=t.memoizedProps,d=r.id,p=r.onPostCommit;typeof p=="function"&&p(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){Oe(t,t.return,j)}}else Jt(e,t,n,l);break;case 31:Jt(e,t,n,l);break;case 13:Jt(e,t,n,l);break;case 23:break;case 22:r=t.stateNode,d=t.alternate,t.memoizedState!==null?r._visibility&2?Jt(e,t,n,l):ti(e,t):r._visibility&2?Jt(e,t,n,l):(r._visibility|=2,ca(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&_o(d,t);break;case 24:Jt(e,t,n,l),i&2048&&Co(t.alternate,t);break;default:Jt(e,t,n,l)}}function ca(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,d=t,p=n,j=l,D=d.flags;switch(d.tag){case 0:case 11:case 15:ca(r,d,p,j,i),Pa(8,d);break;case 23:break;case 22:var Y=d.stateNode;d.memoizedState!==null?Y._visibility&2?ca(r,d,p,j,i):ti(r,d):(Y._visibility|=2,ca(r,d,p,j,i)),i&&D&2048&&_o(d.alternate,d);break;case 24:ca(r,d,p,j,i),i&&D&2048&&Co(d.alternate,d);break;default:ca(r,d,p,j,i)}t=t.sibling}}function ti(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,i=l.flags;switch(l.tag){case 22:ti(n,l),i&2048&&_o(l.alternate,l);break;case 24:ti(n,l),i&2048&&Co(l.alternate,l);break;default:ti(n,l)}t=t.sibling}}var ni=8192;function ua(e,t,n){if(e.subtreeFlags&ni)for(e=e.child;e!==null;)bf(e,t,n),e=e.sibling}function bf(e,t,n){switch(e.tag){case 26:ua(e,t,n),e.flags&ni&&e.memoizedState!==null&&Vg(n,Wt,e.memoizedState,e.memoizedProps);break;case 5:ua(e,t,n);break;case 3:case 4:var l=Wt;Wt=zs(e.stateNode.containerInfo),ua(e,t,n),Wt=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=ni,ni=16777216,ua(e,t,n),ni=l):ua(e,t,n));break;default:ua(e,t,n)}}function Sf(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 li(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];it=l,kf(l,e)}Sf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jf(e),e=e.sibling}function jf(e){switch(e.tag){case 0:case 11:case 15:li(e),e.flags&2048&&Qn(9,e,e.return);break;case 3:li(e);break;case 12:li(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,fs(e)):li(e);break;default:li(e)}}function fs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];it=l,kf(l,e)}Sf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Qn(8,t,t.return),fs(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,fs(t));break;default:fs(t)}e=e.sibling}}function kf(e,t){for(;it!==null;){var n=it;switch(n.tag){case 0:case 11:case 15:Qn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:La(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,it=l;else e:for(n=e;it!==null;){l=it;var i=l.sibling,r=l.return;if(hf(l),l===n){it=null;break e}if(i!==null){i.return=r,it=i;break e}it=r}}}var rg={getCacheForType:function(e){var t=ut(Ie),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ut(Ie).controller.signal}},og=typeof WeakMap=="function"?WeakMap:Map,Ae=0,qe=null,we=null,Te=0,Re=0,_t=null,Vn=!1,da=!1,Ao=!1,Tn=0,Ke=0,Kn=0,wl=0,Do=0,Ct=0,fa=0,ai=null,kt=null,Ro=!1,hs=0,wf=0,ps=1/0,vs=null,Zn=null,lt=0,Wn=null,ha=null,Mn=0,Oo=0,No=null,zf=null,ii=0,Ho=null;function At(){return(Ae&2)!==0&&Te!==0?Te&-Te:M.T!==null?$o():Ta()}function Tf(){if(Ct===0)if((Te&536870912)===0||Ee){var e=Ol;Ol<<=1,(Ol&3932160)===0&&(Ol=262144),Ct=e}else Ct=536870912;return e=Mt.current,e!==null&&(e.flags|=32),Ct}function wt(e,t,n){(e===qe&&(Re===2||Re===9)||e.cancelPendingCommit!==null)&&(pa(e,0),Jn(e,Te,Ct,!1)),rl(e,n),((Ae&2)===0||e!==qe)&&(e===qe&&((Ae&2)===0&&(wl|=n),Ke===4&&Jn(e,Te,Ct,!1)),nn(e))}function Mf(e,t,n){if((Ae&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Dn(e,t),i=l?dg(e,t):Bo(e,t,!0),r=l;do{if(i===0){da&&!l&&Jn(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!cg(n)){i=Bo(e,t,!1),r=!1;continue}if(i===2){if(r=t,e.errorRecoveryDisabledLanes&r)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var p=e;i=ai;var j=p.current.memoizedState.isDehydrated;if(j&&(pa(p,d).flags|=256),d=Bo(p,d,!1),d!==2){if(Ao&&!j){p.errorRecoveryDisabledLanes|=r,wl|=r,i=4;break e}r=kt,kt=i,r!==null&&(kt===null?kt=r:kt.push.apply(kt,r))}i=d}if(r=!1,i!==2)continue}}if(i===1){pa(e,0),Jn(e,t,0,!0);break}e:{switch(l=e,r=i,r){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Jn(l,t,Ct,!Vn);break e;case 2:kt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=hs+300-ht(),10<i)){if(Jn(l,t,Ct,!Vn),un(l,0,!0)!==0)break e;Mn=t,l.timeoutHandle=ah(Ef.bind(null,l,n,kt,vs,Ro,t,Ct,wl,fa,Vn,r,"Throttled",-0,0),i);break e}Ef(l,n,kt,vs,Ro,t,Ct,wl,fa,Vn,r,null,-0,0)}}break}while(!0);nn(e)}function Ef(e,t,n,l,i,r,d,p,j,D,Y,X,O,U){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:fn},bf(t,r,X);var ce=(r&62914560)===r?hs-ht():(r&4194048)===r?wf-ht():0;if(ce=Kg(X,ce),ce!==null){Mn=r,e.cancelPendingCommit=ce(Hf.bind(null,e,t,r,n,l,i,d,p,j,Y,X,null,O,U)),Jn(e,r,d,!D);return}}Hf(e,t,r,n,l,i,d,p,j)}function cg(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var i=n[l],r=i.getSnapshot;i=i.value;try{if(!zt(r(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Jn(e,t,n,l){t&=~Do,t&=~wl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var r=31-gt(i),d=1<<r;l[r]=-1,i&=~d}n!==0&&za(e,n,t)}function gs(){return(Ae&6)===0?(si(0),!1):!0}function Uo(){if(we!==null){if(Re===0)var e=we.return;else e=we,gn=vl=null,Ir(e),aa=null,$a=0,e=we;for(;e!==null;)af(e.alternate,e),e=e.return;we=null}}function pa(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,_g(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Mn=0,Uo(),qe=e,we=n=pn(e.current,null),Te=t,Re=0,_t=null,Vn=!1,da=Dn(e,t),Ao=!1,fa=Ct=Do=wl=Kn=Ke=0,kt=ai=null,Ro=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var i=31-gt(l),r=1<<i;t|=e[i],l&=~r}return Tn=t,Ui(),n}function _f(e,t){be=null,M.H=Ja,t===la||t===Qi?(t=Xu(),Re=3):t===Lr?(t=Xu(),Re=4):Re=t===vo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,_t=t,we===null&&(Ke=1,is(e,Bt(t,e.current)))}function Cf(){var e=Mt.current;return e===null?!0:(Te&4194048)===Te?$t===null:(Te&62914560)===Te||(Te&536870912)!==0?e===$t:!1}function Af(){var e=M.H;return M.H=Ja,e===null?Ja:e}function Df(){var e=M.A;return M.A=rg,e}function ms(){Ke=4,Vn||(Te&4194048)!==Te&&Mt.current!==null||(da=!0),(Kn&134217727)===0&&(wl&134217727)===0||qe===null||Jn(qe,Te,Ct,!1)}function Bo(e,t,n){var l=Ae;Ae|=2;var i=Af(),r=Df();(qe!==e||Te!==t)&&(vs=null,pa(e,t)),t=!1;var d=Ke;e:do try{if(Re!==0&&we!==null){var p=we,j=_t;switch(Re){case 8:Uo(),d=6;break e;case 3:case 2:case 9:case 6:Mt.current===null&&(t=!0);var D=Re;if(Re=0,_t=null,va(e,p,j,D),n&&da){d=0;break e}break;default:D=Re,Re=0,_t=null,va(e,p,j,D)}}ug(),d=Ke;break}catch(Y){_f(e,Y)}while(!0);return t&&e.shellSuspendCounter++,gn=vl=null,Ae=l,M.H=i,M.A=r,we===null&&(qe=null,Te=0,Ui()),d}function ug(){for(;we!==null;)Rf(we)}function dg(e,t){var n=Ae;Ae|=2;var l=Af(),i=Df();qe!==e||Te!==t?(vs=null,ps=ht()+500,pa(e,t)):da=Dn(e,t);e:do try{if(Re!==0&&we!==null){t=we;var r=_t;t:switch(Re){case 1:Re=0,_t=null,va(e,t,r,1);break;case 2:case 9:if($u(r)){Re=0,_t=null,Of(t);break}t=function(){Re!==2&&Re!==9||qe!==e||(Re=7),nn(e)},r.then(t,t);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:$u(r)?(Re=0,_t=null,Of(t)):(Re=0,_t=null,va(e,t,r,7));break;case 5:var d=null;switch(we.tag){case 26:d=we.memoizedState;case 5:case 27:var p=we;if(d?xh(d):p.stateNode.complete){Re=0,_t=null;var j=p.sibling;if(j!==null)we=j;else{var D=p.return;D!==null?(we=D,ys(D)):we=null}break t}}Re=0,_t=null,va(e,t,r,5);break;case 6:Re=0,_t=null,va(e,t,r,6);break;case 8:Uo(),Ke=6;break e;default:throw Error(o(462))}}fg();break}catch(Y){_f(e,Y)}while(!0);return gn=vl=null,M.H=l,M.A=i,Ae=n,we!==null?0:(qe=null,Te=0,Ui(),Ke)}function fg(){for(;we!==null&&!ji();)Rf(we)}function Rf(e){var t=nf(e.alternate,e,Tn);e.memoizedProps=e.pendingProps,t===null?ys(e):we=t}function Of(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jd(n,t,t.pendingProps,t.type,void 0,Te);break;case 11:t=Jd(n,t,t.pendingProps,t.type.render,t.ref,Te);break;case 5:Ir(t);default:af(n,t),t=we=Au(t,Tn),t=nf(n,t,Tn)}e.memoizedProps=e.pendingProps,t===null?ys(e):we=t}function va(e,t,n,l){gn=vl=null,Ir(t),aa=null,$a=0;var i=t.return;try{if(eg(e,i,t,n,Te)){Ke=1,is(e,Bt(n,e.current)),we=null;return}}catch(r){if(i!==null)throw we=i,r;Ke=1,is(e,Bt(n,e.current)),we=null;return}t.flags&32768?(Ee||l===1?e=!0:da||(Te&536870912)!==0?e=!1:(Vn=e=!0,(l===2||l===9||l===3||l===6)&&(l=Mt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Nf(t,e)):ys(t)}function ys(e){var t=e;do{if((t.flags&32768)!==0){Nf(t,Vn);return}e=t.return;var n=lg(t.alternate,t,Tn);if(n!==null){we=n;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);Ke===0&&(Ke=5)}function Nf(e,t){do{var n=ag(e.alternate,e);if(n!==null){n.flags&=32767,we=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){we=e;return}we=e=n}while(e!==null);Ke=6,we=null}function Hf(e,t,n,l,i,r,d,p,j){e.cancelPendingCommit=null;do xs();while(lt!==0);if((Ae&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(r=t.lanes|t.childLanes,r|=zr,tr(e,n,r,d,p,j),e===qe&&(we=qe=null,Te=0),ha=t,Wn=e,Mn=n,Oo=r,No=i,zf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,gg(Dl,function(){return Yf(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=M.T,M.T=null,i=L.p,L.p=2,d=Ae,Ae|=4;try{ig(e,t,n)}finally{Ae=d,L.p=i,M.T=l}}lt=1,Uf(),Bf(),qf()}}function Uf(){if(lt===1){lt=0;var e=Wn,t=ha,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=M.T,M.T=null;var l=L.p;L.p=2;var i=Ae;Ae|=4;try{mf(t,e);var r=Jo,d=ju(e.containerInfo),p=r.focusedElem,j=r.selectionRange;if(d!==p&&p&&p.ownerDocument&&Su(p.ownerDocument.documentElement,p)){if(j!==null&&br(p)){var D=j.start,Y=j.end;if(Y===void 0&&(Y=D),"selectionStart"in p)p.selectionStart=D,p.selectionEnd=Math.min(Y,p.value.length);else{var X=p.ownerDocument||document,O=X&&X.defaultView||window;if(O.getSelection){var U=O.getSelection(),ce=p.textContent.length,ge=Math.min(j.start,ce),Ue=j.end===void 0?ge:Math.min(j.end,ce);!U.extend&&ge>Ue&&(d=Ue,Ue=ge,ge=d);var T=bu(p,ge),z=bu(p,Ue);if(T&&z&&(U.rangeCount!==1||U.anchorNode!==T.node||U.anchorOffset!==T.offset||U.focusNode!==z.node||U.focusOffset!==z.offset)){var A=X.createRange();A.setStart(T.node,T.offset),U.removeAllRanges(),ge>Ue?(U.addRange(A),U.extend(z.node,z.offset)):(A.setEnd(z.node,z.offset),U.addRange(A))}}}}for(X=[],U=p;U=U.parentNode;)U.nodeType===1&&X.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<X.length;p++){var G=X[p];G.element.scrollLeft=G.left,G.element.scrollTop=G.top}}As=!!Wo,Jo=Wo=null}finally{Ae=i,L.p=l,M.T=n}}e.current=t,lt=2}}function Bf(){if(lt===2){lt=0;var e=Wn,t=ha,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=M.T,M.T=null;var l=L.p;L.p=2;var i=Ae;Ae|=4;try{ff(e,t.alternate,t)}finally{Ae=i,L.p=l,M.T=n}}lt=3}}function qf(){if(lt===4||lt===3){lt=0,Fs();var e=Wn,t=ha,n=Mn,l=zf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?lt=5:(lt=0,ha=Wn=null,Lf(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Zn=null),Rn(n),t=t.stateNode,rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(on,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=M.T,i=L.p,L.p=2,M.T=null;try{for(var r=e.onRecoverableError,d=0;d<l.length;d++){var p=l[d];r(p.value,{componentStack:p.stack})}}finally{M.T=t,L.p=i}}(Mn&3)!==0&&xs(),nn(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===Ho?ii++:(ii=0,Ho=e):ii=0,si(0)}}function Lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,La(t)))}function xs(){return Uf(),Bf(),qf(),Yf()}function Yf(){if(lt!==5)return!1;var e=Wn,t=Oo;Oo=0;var n=Rn(Mn),l=M.T,i=L.p;try{L.p=32>n?32:n,M.T=null,n=No,No=null;var r=Wn,d=Mn;if(lt=0,ha=Wn=null,Mn=0,(Ae&6)!==0)throw Error(o(331));var p=Ae;if(Ae|=4,jf(r.current),xf(r,r.current,d,n),Ae=p,si(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(on,r)}catch{}return!0}finally{L.p=i,M.T=l,Lf(e,t)}}function $f(e,t,n){t=Bt(n,t),t=po(e.stateNode,t,2),e=$n(e,t,2),e!==null&&(rl(e,2),nn(e))}function Oe(e,t,n){if(e.tag===3)$f(e,e,n);else for(;t!==null;){if(t.tag===3){$f(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Zn===null||!Zn.has(l))){e=Bt(n,e),n=$d(2),l=$n(t,n,2),l!==null&&(Gd(n,l,t,e),rl(l,2),nn(l));break}}t=t.return}}function qo(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new og;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(Ao=!0,i.add(n),e=hg.bind(null,e,t,n),t.then(e,e))}function hg(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,qe===e&&(Te&n)===n&&(Ke===4||Ke===3&&(Te&62914560)===Te&&300>ht()-hs?(Ae&2)===0&&pa(e,0):Do|=n,fa===Te&&(fa=0)),nn(e)}function Gf(e,t){t===0&&(t=wa()),e=fl(e,t),e!==null&&(rl(e,t),nn(e))}function pg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gf(e,n)}function vg(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.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),Gf(e,n)}function gg(e,t){return An(e,t)}var bs=null,ga=null,Lo=!1,Ss=!1,Yo=!1,Fn=0;function nn(e){e!==ga&&e.next===null&&(ga===null?bs=ga=e:ga=ga.next=e),Ss=!0,Lo||(Lo=!0,yg())}function si(e,t){if(!Yo&&Ss){Yo=!0;do for(var n=!1,l=bs;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var r=0;else{var d=l.suspendedLanes,p=l.pingedLanes;r=(1<<31-gt(42|e)+1)-1,r&=i&~(d&~p),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,Kf(l,r))}else r=Te,r=un(l,l===qe?r:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(r&3)===0||Dn(l,r)||(n=!0,Kf(l,r));l=l.next}while(n);Yo=!1}}function mg(){Xf()}function Xf(){Ss=Lo=!1;var e=0;Fn!==0&&Eg()&&(e=Fn);for(var t=ht(),n=null,l=bs;l!==null;){var i=l.next,r=Qf(l,t);r===0?(l.next=null,n===null?bs=i:n.next=i,i===null&&(ga=n)):(n=l,(e!==0||(r&3)!==0)&&(Ss=!0)),l=i}lt!==0&&lt!==5||si(e),Fn!==0&&(Fn=0)}function Qf(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var d=31-gt(r),p=1<<d,j=i[d];j===-1?((p&n)===0||(p&l)!==0)&&(i[d]=wi(p,t)):j<=t&&(e.expiredLanes|=p),r&=~p}if(t=qe,n=Te,n=un(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Re===2||Re===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Cl(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Dn(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Cl(l),Rn(n)){case 2:case 8:n=Al;break;case 32:n=Dl;break;case 268435456:n=ka;break;default:n=Dl}return l=Vf.bind(null,e),n=An(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Cl(l),e.callbackPriority=2,e.callbackNode=null,2}function Vf(e,t){if(lt!==0&&lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(xs()&&e.callbackNode!==n)return null;var l=Te;return l=un(e,e===qe?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Mf(e,l,t),Qf(e,ht()),e.callbackNode!=null&&e.callbackNode===n?Vf.bind(null,e):null)}function Kf(e,t){if(xs())return null;Mf(e,t,!0)}function yg(){Cg(function(){(Ae&6)!==0?An(ja,mg):Xf()})}function $o(){if(Fn===0){var e=ta;e===0&&(e=Rl,Rl<<=1,(Rl&261888)===0&&(Rl=256)),Fn=e}return Fn}function Zf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_i(""+e)}function Wf(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function xg(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var r=Zf((i[yt]||null).action),d=l.submitter;d&&(t=(t=d[yt]||null)?Zf(t.formAction):d.getAttribute("formAction"),t!==null&&(r=t,d=null));var p=new Ri("action","action",null,l,i);e.push({event:p,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Fn!==0){var j=d?Wf(i,d):new FormData(i);ro(n,{pending:!0,data:j,method:i.method,action:r},null,j)}}else typeof r=="function"&&(p.preventDefault(),j=d?Wf(i,d):new FormData(i),ro(n,{pending:!0,data:j,method:i.method,action:r},r,j))},currentTarget:i}]})}}for(var Go=0;Go<wr.length;Go++){var Xo=wr[Go],bg=Xo.toLowerCase(),Sg=Xo[0].toUpperCase()+Xo.slice(1);Zt(bg,"on"+Sg)}Zt(zu,"onAnimationEnd"),Zt(Tu,"onAnimationIteration"),Zt(Mu,"onAnimationStart"),Zt("dblclick","onDoubleClick"),Zt("focusin","onFocus"),Zt("focusout","onBlur"),Zt(Uv,"onTransitionRun"),Zt(Bv,"onTransitionStart"),Zt(qv,"onTransitionCancel"),Zt(Eu,"onTransitionEnd"),Yl("onMouseEnter",["mouseout","mouseover"]),Yl("onMouseLeave",["mouseout","mouseover"]),Yl("onPointerEnter",["pointerout","pointerover"]),Yl("onPointerLeave",["pointerout","pointerover"]),ol("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ol("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ol("onBeforeInput",["compositionend","keypress","textInput","paste"]),ol("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ol("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ol("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ri="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(" "),jg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ri));function Jf(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],i=l.event;l=l.listeners;e:{var r=void 0;if(t)for(var d=l.length-1;0<=d;d--){var p=l[d],j=p.instance,D=p.currentTarget;if(p=p.listener,j!==r&&i.isPropagationStopped())break e;r=p,i.currentTarget=D;try{r(i)}catch(Y){Hi(Y)}i.currentTarget=null,r=j}else for(d=0;d<l.length;d++){if(p=l[d],j=p.instance,D=p.currentTarget,p=p.listener,j!==r&&i.isPropagationStopped())break e;r=p,i.currentTarget=D;try{r(i)}catch(Y){Hi(Y)}i.currentTarget=null,r=j}}}}function ze(e,t){var n=t[nr];n===void 0&&(n=t[nr]=new Set);var l=e+"__bubble";n.has(l)||(Ff(t,e,2,!1),n.add(l))}function Qo(e,t,n){var l=0;t&&(l|=4),Ff(n,e,l,t)}var js="_reactListening"+Math.random().toString(36).slice(2);function Vo(e){if(!e[js]){e[js]=!0,Gc.forEach(function(n){n!=="selectionchange"&&(jg.has(n)||Qo(n,!1,e),Qo(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[js]||(t[js]=!0,Qo("selectionchange",!1,t))}}function Ff(e,t,n,l){switch(Th(t)){case 2:var i=Jg;break;case 8:i=Fg;break;default:i=rc}n=i.bind(null,t,n,e),i=void 0,!dr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ko(e,t,n,l,i){var r=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var p=l.stateNode.containerInfo;if(p===i)break;if(d===4)for(d=l.return;d!==null;){var j=d.tag;if((j===3||j===4)&&d.stateNode.containerInfo===i)return;d=d.return}for(;p!==null;){if(d=Bl(p),d===null)return;if(j=d.tag,j===5||j===6||j===26||j===27){l=r=d;continue e}p=p.parentNode}}l=l.return}tu(function(){var D=r,Y=cr(n),X=[];e:{var O=_u.get(e);if(O!==void 0){var U=Ri,ce=e;switch(e){case"keypress":if(Ai(n)===0)break e;case"keydown":case"keyup":U=vv;break;case"focusin":ce="focus",U=vr;break;case"focusout":ce="blur",U=vr;break;case"beforeblur":case"afterblur":U=vr;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":U=au;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=lv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=yv;break;case zu:case Tu:case Mu:U=sv;break;case Eu:U=bv;break;case"scroll":case"scrollend":U=tv;break;case"wheel":U=jv;break;case"copy":case"cut":case"paste":U=ov;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=su;break;case"toggle":case"beforetoggle":U=wv}var ge=(t&4)!==0,Ue=!ge&&(e==="scroll"||e==="scrollend"),T=ge?O!==null?O+"Capture":null:O;ge=[];for(var z=D,A;z!==null;){var G=z;if(A=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||A===null||T===null||(G=_a(z,T),G!=null&&ge.push(oi(z,G,A))),Ue)break;z=z.return}0<ge.length&&(O=new U(O,ce,null,n,Y),X.push({event:O,listeners:ge}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",O&&n!==or&&(ce=n.relatedTarget||n.fromElement)&&(Bl(ce)||ce[Ul]))break e;if((U||O)&&(O=Y.window===Y?Y:(O=Y.ownerDocument)?O.defaultView||O.parentWindow:window,U?(ce=n.relatedTarget||n.toElement,U=D,ce=ce?Bl(ce):null,ce!==null&&(Ue=h(ce),ge=ce.tag,ce!==Ue||ge!==5&&ge!==27&&ge!==6)&&(ce=null)):(U=null,ce=D),U!==ce)){if(ge=au,G="onMouseLeave",T="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(ge=su,G="onPointerLeave",T="onPointerEnter",z="pointer"),Ue=U==null?O:Ea(U),A=ce==null?O:Ea(ce),O=new ge(G,z+"leave",U,n,Y),O.target=Ue,O.relatedTarget=A,G=null,Bl(Y)===D&&(ge=new ge(T,z+"enter",ce,n,Y),ge.target=A,ge.relatedTarget=Ue,G=ge),Ue=G,U&&ce)t:{for(ge=kg,T=U,z=ce,A=0,G=T;G;G=ge(G))A++;G=0;for(var he=z;he;he=ge(he))G++;for(;0<A-G;)T=ge(T),A--;for(;0<G-A;)z=ge(z),G--;for(;A--;){if(T===z||z!==null&&T===z.alternate){ge=T;break t}T=ge(T),z=ge(z)}ge=null}else ge=null;U!==null&&If(X,O,U,ge,!1),ce!==null&&Ue!==null&&If(X,Ue,ce,ge,!0)}}e:{if(O=D?Ea(D):window,U=O.nodeName&&O.nodeName.toLowerCase(),U==="select"||U==="input"&&O.type==="file")var _e=pu;else if(fu(O))if(vu)_e=Ov;else{_e=Dv;var ue=Av}else U=O.nodeName,!U||U.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?D&&rr(D.elementType)&&(_e=pu):_e=Rv;if(_e&&(_e=_e(e,D))){hu(X,_e,n,Y);break e}ue&&ue(e,O,D),e==="focusout"&&D&&O.type==="number"&&D.memoizedProps.value!=null&&sr(O,"number",O.value)}switch(ue=D?Ea(D):window,e){case"focusin":(fu(ue)||ue.contentEditable==="true")&&(Kl=ue,Sr=D,Ua=null);break;case"focusout":Ua=Sr=Kl=null;break;case"mousedown":jr=!0;break;case"contextmenu":case"mouseup":case"dragend":jr=!1,ku(X,n,Y);break;case"selectionchange":if(Hv)break;case"keydown":case"keyup":ku(X,n,Y)}var je;if(mr)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Vl?uu(e,n)&&(Me="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Me="onCompositionStart");Me&&(ru&&n.locale!=="ko"&&(Vl||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Vl&&(je=nu()):(Nn=Y,fr="value"in Nn?Nn.value:Nn.textContent,Vl=!0)),ue=ks(D,Me),0<ue.length&&(Me=new iu(Me,e,null,n,Y),X.push({event:Me,listeners:ue}),je?Me.data=je:(je=du(n),je!==null&&(Me.data=je)))),(je=Tv?Mv(e,n):Ev(e,n))&&(Me=ks(D,"onBeforeInput"),0<Me.length&&(ue=new iu("onBeforeInput","beforeinput",null,n,Y),X.push({event:ue,listeners:Me}),ue.data=je)),xg(X,e,D,n,Y)}Jf(X,t)})}function oi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ks(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,r=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||r===null||(i=_a(e,n),i!=null&&l.unshift(oi(e,i,r)),i=_a(e,t),i!=null&&l.push(oi(e,i,r))),e.tag===3)return l;e=e.return}return[]}function kg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function If(e,t,n,l,i){for(var r=t._reactName,d=[];n!==null&&n!==l;){var p=n,j=p.alternate,D=p.stateNode;if(p=p.tag,j!==null&&j===l)break;p!==5&&p!==26&&p!==27||D===null||(j=D,i?(D=_a(n,r),D!=null&&d.unshift(oi(n,D,j))):i||(D=_a(n,r),D!=null&&d.push(oi(n,D,j)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var wg=/\r\n?/g,zg=/\u0000|\uFFFD/g;function Pf(e){return(typeof e=="string"?e:""+e).replace(wg,`
9
+ `).replace(zg,"")}function eh(e,t){return t=Pf(t),Pf(e)===t}function He(e,t,n,l,i,r){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Gl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Gl(e,""+l);break;case"className":Mi(e,"class",l);break;case"tabIndex":Mi(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Mi(e,n,l);break;case"style":Pc(e,l,r);break;case"data":if(t!=="object"){Mi(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=_i(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"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 r=="function"&&(n==="formAction"?(t!=="input"&&He(e,t,"name",i.name,i,null),He(e,t,"formEncType",i.formEncType,i,null),He(e,t,"formMethod",i.formMethod,i,null),He(e,t,"formTarget",i.formTarget,i,null)):(He(e,t,"encType",i.encType,i,null),He(e,t,"method",i.method,i,null),He(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=_i(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=fn);break;case"onScroll":l!=null&&ze("scroll",e);break;case"onScrollEnd":l!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}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}n=_i(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);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(n,""+l):e.removeAttribute(n);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(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":ze("beforetoggle",e),ze("toggle",e),Ti(e,"popover",l);break;case"xlinkActuate":dn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":dn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":dn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":dn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":dn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":dn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":dn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":dn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":dn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ti(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Pp.get(n)||n,Ti(e,n,l))}}function Zo(e,t,n,l,i,r){switch(n){case"style":Pc(e,l,r);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof l=="string"?Gl(e,l):(typeof l=="number"||typeof l=="bigint")&&Gl(e,""+l);break;case"onScroll":l!=null&&ze("scroll",e);break;case"onScrollEnd":l!=null&&ze("scrollend",e);break;case"onClick":l!=null&&(e.onclick=fn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xc.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),r=e[yt]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,i),typeof l=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,i);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):Ti(e,n,l)}}}function ft(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var l=!1,i=!1,r;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:He(e,t,r,d,n,null)}}i&&He(e,t,"srcSet",n.srcSet,n,null),l&&He(e,t,"src",n.src,n,null);return;case"input":ze("invalid",e);var p=r=d=i=null,j=null,D=null;for(l in n)if(n.hasOwnProperty(l)){var Y=n[l];if(Y!=null)switch(l){case"name":i=Y;break;case"type":d=Y;break;case"checked":j=Y;break;case"defaultChecked":D=Y;break;case"value":r=Y;break;case"defaultValue":p=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(o(137,t));break;default:He(e,t,l,Y,n,null)}}Wc(e,r,p,j,D,d,i,!1);return;case"select":ze("invalid",e),l=d=r=null;for(i in n)if(n.hasOwnProperty(i)&&(p=n[i],p!=null))switch(i){case"value":r=p;break;case"defaultValue":d=p;break;case"multiple":l=p;default:He(e,t,i,p,n,null)}t=r,n=d,e.multiple=!!l,t!=null?$l(e,!!l,t,!1):n!=null&&$l(e,!!l,n,!0);return;case"textarea":ze("invalid",e),r=i=l=null;for(d in n)if(n.hasOwnProperty(d)&&(p=n[d],p!=null))switch(d){case"value":l=p;break;case"defaultValue":i=p;break;case"children":r=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(91));break;default:He(e,t,d,p,n,null)}Fc(e,l,i,r);return;case"option":for(j in n)n.hasOwnProperty(j)&&(l=n[j],l!=null)&&(j==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":He(e,t,j,l,n,null));return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(l=0;l<ri.length;l++)ze(ri[l],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("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(D in n)if(n.hasOwnProperty(D)&&(l=n[D],l!=null))switch(D){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:He(e,t,D,l,n,null)}return;default:if(rr(t)){for(Y in n)n.hasOwnProperty(Y)&&(l=n[Y],l!==void 0&&Zo(e,t,Y,l,n,void 0));return}}for(p in n)n.hasOwnProperty(p)&&(l=n[p],l!=null&&He(e,t,p,l,n,null))}function Tg(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,r=null,d=null,p=null,j=null,D=null,Y=null;for(U in n){var X=n[U];if(n.hasOwnProperty(U)&&X!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":j=X;default:l.hasOwnProperty(U)||He(e,t,U,null,l,X)}}for(var O in l){var U=l[O];if(X=n[O],l.hasOwnProperty(O)&&(U!=null||X!=null))switch(O){case"type":r=U;break;case"name":i=U;break;case"checked":D=U;break;case"defaultChecked":Y=U;break;case"value":d=U;break;case"defaultValue":p=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(o(137,t));break;default:U!==X&&He(e,t,O,U,l,X)}}ir(e,d,p,j,D,Y,r,i);return;case"select":U=d=p=O=null;for(r in n)if(j=n[r],n.hasOwnProperty(r)&&j!=null)switch(r){case"value":break;case"multiple":U=j;default:l.hasOwnProperty(r)||He(e,t,r,null,l,j)}for(i in l)if(r=l[i],j=n[i],l.hasOwnProperty(i)&&(r!=null||j!=null))switch(i){case"value":O=r;break;case"defaultValue":p=r;break;case"multiple":d=r;default:r!==j&&He(e,t,i,r,l,j)}t=p,n=d,l=U,O!=null?$l(e,!!n,O,!1):!!l!=!!n&&(t!=null?$l(e,!!n,t,!0):$l(e,!!n,n?[]:"",!1));return;case"textarea":U=O=null;for(p in n)if(i=n[p],n.hasOwnProperty(p)&&i!=null&&!l.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:He(e,t,p,null,l,i)}for(d in l)if(i=l[d],r=n[d],l.hasOwnProperty(d)&&(i!=null||r!=null))switch(d){case"value":O=i;break;case"defaultValue":U=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(o(91));break;default:i!==r&&He(e,t,d,i,l,r)}Jc(e,O,U);return;case"option":for(var ce in n)O=n[ce],n.hasOwnProperty(ce)&&O!=null&&!l.hasOwnProperty(ce)&&(ce==="selected"?e.selected=!1:He(e,t,ce,null,l,O));for(j in l)O=l[j],U=n[j],l.hasOwnProperty(j)&&O!==U&&(O!=null||U!=null)&&(j==="selected"?e.selected=O&&typeof O!="function"&&typeof O!="symbol":He(e,t,j,O,l,U));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ge in n)O=n[ge],n.hasOwnProperty(ge)&&O!=null&&!l.hasOwnProperty(ge)&&He(e,t,ge,null,l,O);for(D in l)if(O=l[D],U=n[D],l.hasOwnProperty(D)&&O!==U&&(O!=null||U!=null))switch(D){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(o(137,t));break;default:He(e,t,D,O,l,U)}return;default:if(rr(t)){for(var Ue in n)O=n[Ue],n.hasOwnProperty(Ue)&&O!==void 0&&!l.hasOwnProperty(Ue)&&Zo(e,t,Ue,void 0,l,O);for(Y in l)O=l[Y],U=n[Y],!l.hasOwnProperty(Y)||O===U||O===void 0&&U===void 0||Zo(e,t,Y,O,l,U);return}}for(var T in n)O=n[T],n.hasOwnProperty(T)&&O!=null&&!l.hasOwnProperty(T)&&He(e,t,T,null,l,O);for(X in l)O=l[X],U=n[X],!l.hasOwnProperty(X)||O===U||O==null&&U==null||He(e,t,X,O,l,U)}function th(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Mg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var i=n[l],r=i.transferSize,d=i.initiatorType,p=i.duration;if(r&&p&&th(d)){for(d=0,p=i.responseEnd,l+=1;l<n.length;l++){var j=n[l],D=j.startTime;if(D>p)break;var Y=j.transferSize,X=j.initiatorType;Y&&th(X)&&(j=j.responseEnd,d+=Y*(j<p?1:(p-D)/(j-D)))}if(--l,t+=8*(r+d)/(i.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 Wo=null,Jo=null;function ws(e){return e.nodeType===9?e:e.ownerDocument}function nh(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 lh(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 Fo(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 Io=null;function Eg(){var e=window.event;return e&&e.type==="popstate"?e===Io?!1:(Io=e,!0):(Io=null,!1)}var ah=typeof setTimeout=="function"?setTimeout:void 0,_g=typeof clearTimeout=="function"?clearTimeout:void 0,ih=typeof Promise=="function"?Promise:void 0,Cg=typeof queueMicrotask=="function"?queueMicrotask:typeof ih<"u"?function(e){return ih.resolve(null).then(e).catch(Ag)}:ah;function Ag(e){setTimeout(function(){throw e})}function In(e){return e==="head"}function sh(e,t){var n=t,l=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(i),ba(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")ci(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ci(n);for(var r=n.firstChild;r;){var d=r.nextSibling,p=r.nodeName;r[Ma]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=d}}else n==="body"&&ci(e.ownerDocument.body);n=i}while(n);ba(t)}function rh(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Po(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Po(n),lr(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Dg(e,t,n,l){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ma])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Gt(e.nextSibling),e===null)break}return null}function Rg(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Gt(e.nextSibling),e===null))return null;return e}function oh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Gt(e.nextSibling),e===null))return null;return e}function ec(e){return e.data==="$?"||e.data==="$~"}function tc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Og(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Gt(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 nc=null;function ch(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Gt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function uh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function dh(e,t,n){switch(t=ws(n),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 ci(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lr(e)}var Xt=new Map,fh=new Set;function zs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var En=L.d;L.d={f:Ng,r:Hg,D:Ug,C:Bg,L:qg,m:Lg,X:$g,S:Yg,M:Gg};function Ng(){var e=En.f(),t=gs();return e||t}function Hg(e){var t=ql(e);t!==null&&t.tag===5&&t.type==="form"?Ed(t):En.r(e)}var ma=typeof document>"u"?null:document;function hh(e,t,n){var l=ma;if(l&&typeof t=="string"&&t){var i=Ht(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),fh.has(i)||(fh.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),ft(t,"link",e),at(t),l.head.appendChild(t)))}}function Ug(e){En.D(e),hh("dns-prefetch",e,null)}function Bg(e,t){En.C(e,t),hh("preconnect",e,t)}function qg(e,t,n){En.L(e,t,n);var l=ma;if(l&&e&&t){var i='link[rel="preload"][as="'+Ht(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Ht(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Ht(n.imageSizes)+'"]')):i+='[href="'+Ht(e)+'"]';var r=i;switch(t){case"style":r=ya(e);break;case"script":r=xa(e)}Xt.has(r)||(e=k({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Xt.set(r,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(ui(r))||t==="script"&&l.querySelector(di(r))||(t=l.createElement("link"),ft(t,"link",e),at(t),l.head.appendChild(t)))}}function Lg(e,t){En.m(e,t);var n=ma;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Ht(l)+'"][href="'+Ht(e)+'"]',r=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=xa(e)}if(!Xt.has(r)&&(e=k({rel:"modulepreload",href:e},t),Xt.set(r,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(di(r)))return}l=n.createElement("link"),ft(l,"link",e),at(l),n.head.appendChild(l)}}}function Yg(e,t,n){En.S(e,t,n);var l=ma;if(l&&e){var i=Ll(l).hoistableStyles,r=ya(e);t=t||"default";var d=i.get(r);if(!d){var p={loading:0,preload:null};if(d=l.querySelector(ui(r)))p.loading=5;else{e=k({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Xt.get(r))&&lc(e,n);var j=d=l.createElement("link");at(j),ft(j,"link",e),j._p=new Promise(function(D,Y){j.onload=D,j.onerror=Y}),j.addEventListener("load",function(){p.loading|=1}),j.addEventListener("error",function(){p.loading|=2}),p.loading|=4,Ts(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:p},i.set(r,d)}}}function $g(e,t){En.X(e,t);var n=ma;if(n&&e){var l=Ll(n).hoistableScripts,i=xa(e),r=l.get(i);r||(r=n.querySelector(di(i)),r||(e=k({src:e,async:!0},t),(t=Xt.get(i))&&ac(e,t),r=n.createElement("script"),at(r),ft(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},l.set(i,r))}}function Gg(e,t){En.M(e,t);var n=ma;if(n&&e){var l=Ll(n).hoistableScripts,i=xa(e),r=l.get(i);r||(r=n.querySelector(di(i)),r||(e=k({src:e,async:!0,type:"module"},t),(t=Xt.get(i))&&ac(e,t),r=n.createElement("script"),at(r),ft(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},l.set(i,r))}}function ph(e,t,n,l){var i=(i=ae.current)?zs(i):null;if(!i)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ya(n.href),n=Ll(i).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ya(n.href);var r=Ll(i).hoistableStyles,d=r.get(e);if(d||(i=i.ownerDocument||i,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,d),(r=i.querySelector(ui(e)))&&!r._p&&(d.instance=r,d.state.loading=5),Xt.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Xt.set(e,n),r||Xg(i,e,n,d.state))),t&&l===null)throw Error(o(528,""));return d}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=xa(n),n=Ll(i).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ya(e){return'href="'+Ht(e)+'"'}function ui(e){return'link[rel="stylesheet"]['+e+"]"}function vh(e){return k({},e,{"data-precedence":e.precedence,precedence:null})}function Xg(e,t,n,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}),ft(t,"link",n),at(t),e.head.appendChild(t))}function xa(e){return'[src="'+Ht(e)+'"]'}function di(e){return"script[async]"+e}function gh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Ht(n.href)+'"]');if(l)return t.instance=l,at(l),l;var i=k({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),at(l),ft(l,"style",i),Ts(l,n.precedence,e),t.instance=l;case"stylesheet":i=ya(n.href);var r=e.querySelector(ui(i));if(r)return t.state.loading|=4,t.instance=r,at(r),r;l=vh(n),(i=Xt.get(i))&&lc(l,i),r=(e.ownerDocument||e).createElement("link"),at(r);var d=r;return d._p=new Promise(function(p,j){d.onload=p,d.onerror=j}),ft(r,"link",l),t.state.loading|=4,Ts(r,n.precedence,e),t.instance=r;case"script":return r=xa(n.src),(i=e.querySelector(di(r)))?(t.instance=i,at(i),i):(l=n,(i=Xt.get(r))&&(l=k({},n),ac(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),at(i),ft(i,"link",l),e.head.appendChild(i),t.instance=i);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,Ts(l,n.precedence,e));return t.instance}function Ts(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,r=i,d=0;d<l.length;d++){var p=l[d];if(p.dataset.precedence===t)r=p;else if(r!==i)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function lc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ac(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ms=null;function mh(e,t,n){if(Ms===null){var l=new Map,i=Ms=new Map;i.set(n,l)}else i=Ms,l=i.get(n),l||(l=new Map,i.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var r=n[i];if(!(r[Ma]||r[ot]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var d=r.getAttribute(t)||"";d=e+d;var p=l.get(d);p?p.push(r):l.set(d,[r])}}return l}function yh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Qg(e,t,n){if(n===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 xh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Vg(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=ya(l.href),r=t.querySelector(ui(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Es.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,at(r);return}r=t.ownerDocument||t,l=vh(l),(i=Xt.get(i))&&lc(l,i),r=r.createElement("link"),at(r);var d=r;d._p=new Promise(function(p,j){d.onload=p,d.onerror=j}),ft(r,"link",l),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Es.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var ic=0;function Kg(e,t){return e.stylesheets&&e.count===0&&Cs(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Cs(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&ic===0&&(ic=62500*Mg());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Cs(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>ic?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function Es(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _s=null;function Cs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_s=new Map,t.forEach(Zg,e),_s=null,Es.call(e))}function Zg(e,t){if(!(t.state.loading&4)){var n=_s.get(e);if(n)var l=n.get(null);else{n=new Map,_s.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var d=i[r];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}i=t.instance,d=i.getAttribute("data-precedence"),r=n.get(d)||l,r===l&&n.set(null,i),n.set(d,i),this.count++,l=Es.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),r?r.parentNode.insertBefore(i,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var fi={$$typeof:$,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function Wg(e,t,n,l,i,r,d,p,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=Hl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hl(0),this.hiddenUpdates=Hl(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function bh(e,t,n,l,i,r,d,p,j,D,Y,X){return e=new Wg(e,t,n,d,j,D,Y,X,p),t=1,r===!0&&(t|=24),r=Tt(3,null,null,t),e.current=r,r.stateNode=e,t=Ur(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:l,isDehydrated:n,cache:t},Yr(r),e}function Sh(e){return e?(e=Jl,e):Jl}function jh(e,t,n,l,i,r){i=Sh(i),l.context===null?l.context=i:l.pendingContext=i,l=Yn(t),l.payload={element:n},r=r===void 0?null:r,r!==null&&(l.callback=r),n=$n(e,l,t),n!==null&&(wt(n,e,t),Xa(n,e,t))}function kh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sc(e,t){kh(e,t),(e=e.alternate)&&kh(e,t)}function wh(e){if(e.tag===13||e.tag===31){var t=fl(e,67108864);t!==null&&wt(t,e,67108864),sc(e,67108864)}}function zh(e){if(e.tag===13||e.tag===31){var t=At();t=Kt(t);var n=fl(e,t);n!==null&&wt(n,e,t),sc(e,t)}}var As=!0;function Jg(e,t,n,l){var i=M.T;M.T=null;var r=L.p;try{L.p=2,rc(e,t,n,l)}finally{L.p=r,M.T=i}}function Fg(e,t,n,l){var i=M.T;M.T=null;var r=L.p;try{L.p=8,rc(e,t,n,l)}finally{L.p=r,M.T=i}}function rc(e,t,n,l){if(As){var i=oc(l);if(i===null)Ko(e,t,l,Ds,n),Mh(e,l);else if(Pg(i,e,t,n,l))l.stopPropagation();else if(Mh(e,l),t&4&&-1<Ig.indexOf(e)){for(;i!==null;){var r=ql(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var d=cn(r.pendingLanes);if(d!==0){var p=r;for(p.pendingLanes|=2,p.entangledLanes|=2;d;){var j=1<<31-gt(d);p.entanglements[1]|=j,d&=~j}nn(r),(Ae&6)===0&&(ps=ht()+500,si(0))}}break;case 31:case 13:p=fl(r,2),p!==null&&wt(p,r,2),gs(),sc(r,2)}if(r=oc(l),r===null&&Ko(e,t,l,Ds,n),r===i)break;i=r}i!==null&&l.stopPropagation()}else Ko(e,t,l,null,n)}}function oc(e){return e=cr(e),cc(e)}var Ds=null;function cc(e){if(Ds=null,e=Bl(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=g(t),e!==null)return e;e=null}else if(n===31){if(e=b(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ds=e,null}function Th(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(Sa()){case ja:return 2;case Al:return 8;case Dl:case Is:return 32;case ka:return 268435456;default:return 32}default:return 32}}var uc=!1,Pn=null,el=null,tl=null,hi=new Map,pi=new Map,nl=[],Ig="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 Mh(e,t){switch(e){case"focusin":case"focusout":Pn=null;break;case"dragenter":case"dragleave":el=null;break;case"mouseover":case"mouseout":tl=null;break;case"pointerover":case"pointerout":hi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pi.delete(t.pointerId)}}function vi(e,t,n,l,i,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:r,targetContainers:[i]},t!==null&&(t=ql(t),t!==null&&wh(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Pg(e,t,n,l,i){switch(t){case"focusin":return Pn=vi(Pn,e,t,n,l,i),!0;case"dragenter":return el=vi(el,e,t,n,l,i),!0;case"mouseover":return tl=vi(tl,e,t,n,l,i),!0;case"pointerover":var r=i.pointerId;return hi.set(r,vi(hi.get(r)||null,e,t,n,l,i)),!0;case"gotpointercapture":return r=i.pointerId,pi.set(r,vi(pi.get(r)||null,e,t,n,l,i)),!0}return!1}function Eh(e){var t=Bl(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=g(n),t!==null){e.blockedOn=t,zi(e.priority,function(){zh(n)});return}}else if(t===31){if(t=b(n),t!==null){e.blockedOn=t,zi(e.priority,function(){zh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=oc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);or=l,n.target.dispatchEvent(l),or=null}else return t=ql(n),t!==null&&wh(t),e.blockedOn=n,!1;t.shift()}return!0}function _h(e,t,n){Rs(e)&&n.delete(t)}function em(){uc=!1,Pn!==null&&Rs(Pn)&&(Pn=null),el!==null&&Rs(el)&&(el=null),tl!==null&&Rs(tl)&&(tl=null),hi.forEach(_h),pi.forEach(_h)}function Os(e,t){e.blockedOn===t&&(e.blockedOn=null,uc||(uc=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,em)))}var Ns=null;function Ch(e){Ns!==e&&(Ns=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Ns===e&&(Ns=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(cc(l||n)===null)continue;break}var r=ql(n);r!==null&&(e.splice(t,3),t-=3,ro(r,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function ba(e){function t(j){return Os(j,e)}Pn!==null&&Os(Pn,e),el!==null&&Os(el,e),tl!==null&&Os(tl,e),hi.forEach(t),pi.forEach(t);for(var n=0;n<nl.length;n++){var l=nl[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<nl.length&&(n=nl[0],n.blockedOn===null);)Eh(n),n.blockedOn===null&&nl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],r=n[l+1],d=i[yt]||null;if(typeof r=="function")d||Ch(n);else if(d){var p=null;if(r&&r.hasAttribute("formAction")){if(i=r,d=r[yt]||null)p=d.formAction;else if(cc(i)!==null)continue}else p=d.action;typeof p=="function"?n[l+1]=p:(n.splice(l,3),l-=3),Ch(n)}}}function Ah(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(d){return i=d})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function dc(e){this._internalRoot=e}Hs.prototype.render=dc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=At();jh(n,l,e,t,null,null)},Hs.prototype.unmount=dc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jh(e.current,2,null,e,null,null),gs(),t[Ul]=null}};function Hs(e){this._internalRoot=e}Hs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ta();e={blockedOn:null,target:e,priority:t};for(var n=0;n<nl.length&&t!==0&&t<nl[n].priority;n++);nl.splice(n,0,e),n===0&&Eh(e)}};var Dh=c.version;if(Dh!=="19.2.8")throw Error(o(527,Dh,"19.2.8"));L.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=v(t),e=e!==null?w(e):null,e=e===null?null:e.stateNode,e};var tm={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Us=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Us.isDisabled&&Us.supportsFiber)try{on=Us.inject(tm),rt=Us}catch{}}return mi.createRoot=function(e,t){if(!f(e))throw Error(o(299));var n=!1,l="",i=Bd,r=qd,d=Ld;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=bh(e,1,!1,null,null,n,l,null,i,r,d,Ah),e[Ul]=t.current,Vo(e),new dc(t)},mi.hydrateRoot=function(e,t,n){if(!f(e))throw Error(o(299));var l=!1,i="",r=Bd,d=qd,p=Ld,j=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(p=n.onRecoverableError),n.formState!==void 0&&(j=n.formState)),t=bh(e,1,!0,t,n??null,l,i,j,r,d,p,Ah),t.context=Sh(null),n=t.current,l=At(),l=Kt(l),i=Yn(l),i.callback=null,$n(n,i,l),n=l,t.current.lanes=n,rl(t,n),nn(t),e[Ul]=t.current,Vo(e),new Hs(t)},mi.version="19.2.8",mi}var $h;function fm(){if($h)return pc.exports;$h=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(c){console.error(c)}}return s(),pc.exports=dm(),pc.exports}var hm=fm();const pm=["run_started","run_resumed","run_finished","run_error","run_titled","cost","budget_alert","budget_stop","usage_limit","mission_incomplete","settings_changed","message","steer","worker_started","worker_progress","worker_finished","worker_stalled","worker_looping","director_looping","service_exposed","auto_allowed","auto_denied","root_allowed","permission_request","permission_resolved","permission_timeout","question","question_answered","question_timeout","chat_message","chat_turn","chat_cost","chat_error","chat_cleared","chat_proposal_dismissed","chat_question","chat_answered","chat_question_timeout","mission_proposed","mission_started","models_changed"],Ac=new Set,Qs=new Set;let yi=null;function wp(){if(!yi){yi=new EventSource("/events"),yi.onopen=()=>Qs.forEach(s=>s(!0)),yi.onerror=()=>Qs.forEach(s=>s(!1));for(const s of pm)yi.addEventListener(s,c=>{const u=JSON.parse(c.data);Ac.forEach(o=>o(s,u))})}}function Ks(s){return wp(),Ac.add(s),()=>Ac.delete(s)}function vm(s){return wp(),Qs.add(s),()=>Qs.delete(s)}function zl(s){return s.costBasis==="priced"||s.costBasis==="free"||s.costBasis==="unpriced"?s.costBasis:s.metered===!1?"unpriced":"priced"}function zp(s){if(s)switch(s.kind){case"claude-code":return s.configDir;case"codex":return s.codexHome??"~/.codex";case"openai-compatible":return s.baseUrl;case"anthropic-api":return`$${s.apiKeyEnv}`}}const Hc={runStatus:"idle",mission:"",title:"",costBasis:"priced",usage:null,costUsd:0,budgetUsd:5,agents:[],entries:[],approvals:[],questions:[],missionDoc:null,services:[]};let Ye=0;function Tp(s,c,u){const o=[],f=(h,g,b)=>o.push({id:++Ye,ts:u,agent:s,kind:h,title:g,body:b});if(c.type==="system"&&c.subtype==="init")f("system","init",`model: ${c.model??"?"}`);else if(c.type==="assistant"){for(const h of c.message?.content??[])if(h.type==="text"&&h.text?.trim())f("text",s,h.text);else if(h.type==="tool_use"){const g=String(h.name).replace("mcp__foreman__","").replace("mcp__playwright__","");f("tool",g,JSON.stringify(h.input).slice(0,4e3))}}else if(c.type==="user"&&Array.isArray(c.message?.content)){for(const h of c.message.content)if(h.type==="tool_result"){const g=typeof h.content=="string"?h.content:(h.content??[]).map(b=>b.text??"").join("");f("result","result",String(g).slice(0,700))}}else c.type==="result"&&f(c.is_error?"error":"system",`result · ${c.subtype??""}`,String(c.result??"").slice(0,2500));return o}const Gh=s=>String(s??"").replace(/\s+/g," ").trim();function gm(s,c){if(s.kind==="system"&&s.title.startsWith("result ·")&&s.body){for(let u=c.length-1;u>=0&&u>=c.length-40;u--){const o=c[u];if(o.agent===s.agent&&o.kind==="text"){const f=Gh(o.body),h=Gh(s.body);return f.length>=40&&h.length>=40&&(f.startsWith(h)||h.startsWith(f))?{...s,body:""}:s}}return s}if(s.kind==="result"){const u=/^\[(worker-\d+) (finished|failed|done|started|resumed|stalled|interrupted)\]\s*/.exec(s.body);if(u){const o=s.body.slice(u[0].length).split(`
10
+ `).find(f=>f.trim())??"";return{...s,title:`${u[1]} ${u[2]}`,body:o.length>160?`${o.slice(0,159).trimEnd()}…`:o}}}return s}function mm(s,c){const u=c.ts??Date.now(),o=c.data;switch(c.event){case"run_started":return{...Hc,missionDoc:s.missionDoc,runStatus:"running",mission:o.mission,budgetUsd:o.budgetUsd,costBasis:zl(o),usage:o.usage??null,agents:[{id:"director",status:"running"}]};case"run_resumed":{const f=s.agents.filter(h=>h.id!=="director").map(h=>h.status==="running"?{...h,status:"interrupted"}:h);return{...s,runStatus:"running",mission:o.mission??s.mission,budgetUsd:o.budgetUsd??s.budgetUsd,costUsd:o.costUsd??s.costUsd,costBasis:o.costBasis||o.metered!==void 0?zl(o):s.costBasis,usage:o.usage??s.usage,agents:[{id:"director",status:"running"},...f],entries:[...s.entries,{id:++Ye,ts:u,agent:"system",kind:"system",title:"mission resumed",body:"Director session restored; re-verifying state against MISSION.md."}]}}case"run_finished":return{...s,runStatus:o.status||"done",costUsd:o.costUsd??s.costUsd,approvals:[],questions:[],agents:s.agents.map(f=>f.id==="director"?{...f,status:o.status||"done"}:f)};case"mission_incomplete":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:"system",kind:"error",title:"not done",body:[o.text,"",...(o.unmet??[]).map(f=>`▢ ${f}`)].join(`
11
+ `)}]};case"run_error":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:"system",kind:"error",title:"error",body:o.error}]};case"worker_stalled":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:String(o.id??"worker"),kind:"error",title:"worker stalled",body:String(o.text??"Worker produced no output and was stopped.")}]};case"worker_looping":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:String(o.id??"worker"),kind:"error",title:"worker looping",body:String(o.text??`Worker repeated the identical ${String(o.toolName??"tool")} call ${String(o.count??"?")} times and was stopped.`)}]};case"director_looping":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:"director",kind:"error",title:"director looping",body:String(o.text??`Director issued the identical ${String(o.toolName??"tool")} call ${String(o.count??"?")} times in a row — notified.`)}]};case"settings_changed":return{...s,budgetUsd:typeof o.budgetUsd=="number"?o.budgetUsd:s.budgetUsd,entries:[...s.entries,{id:++Ye,ts:u,agent:"system",kind:"steer",title:"settings changed",body:(o.changes??[]).join(`
12
+ `)}]};case"run_titled":return{...s,title:String(o.title??"")};case"cost":return{...s,costUsd:o.costUsd,budgetUsd:o.budgetUsd,usage:o.usage??s.usage,costBasis:zl(o)};case"message":{const f=o.agent==="director"&&o.msg?.session_id?{directorSessionId:o.msg.session_id}:{},h=Tp(o.agent,o.msg,u).map(g=>gm(g,s.entries));return h.length||f.directorSessionId?{...s,...f,entries:[...s.entries.slice(-1499),...h]}:s}case"steer":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:"you",kind:"steer",title:"steer",body:o.text,to:o.to,timing:o.timing}]};case"usage_limit":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:"system",kind:"error",title:"usage limit",body:o.text}]};case"models_changed":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:"system",kind:"system",title:"models changed",body:o.text}]};case"budget_alert":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:"system",kind:o.level==="exceeded"?"error":"system",title:"budget",body:o.text}]};case"service_exposed":return{...s,services:[...s.services.filter(f=>f.port!==o.port),{port:o.port,label:o.label,path:o.path,url:o.url,since:u}]};case"worker_started":{const f=s.agents.filter(g=>g.id!==o.id),h=s.agents.find(g=>g.id===o.id);return{...s,agents:[...f,{id:o.id,status:"running",task:o.task??h?.task}],entries:[...s.entries,{id:++Ye,ts:u,agent:o.id,kind:"system",title:o.resumed?"resumed":"spawned",body:o.task??""}]}}case"worker_progress":{const f=String(o.status??""),h=[f,...Array.isArray(o.done)&&o.done.length?[`done: ${o.done.join(", ")}`]:[],...o.next?[`next: ${String(o.next)}`]:[],...o.blocked?[`BLOCKED: ${String(o.blocked)}`]:[]].join(`
13
+ `);return{...s,agents:s.agents.map(g=>g.id===o.id?{...g,task:f||g.task}:g),entries:[...s.entries,{id:++Ye,ts:u,agent:String(o.id??"worker"),kind:"system",title:o.blocked?"progress · blocked":"progress",body:h}]}}case"worker_finished":return{...s,agents:s.agents.map(f=>f.id===o.id?{...f,status:o.status}:f)};case"permission_request":return s.approvals.some(f=>f.id===o.id)?s:{...s,approvals:[...s.approvals,{...o,since:u}],entries:[...s.entries,{id:++Ye,ts:u,agent:String(o.agent??"director"),kind:"system",title:"waiting on you",body:`${String(o.toolName??"tool")}: ${String(o.description??o.decisionReason??o.title??"needs your approval")}`}]};case"permission_resolved":{const f=s.approvals.find(h=>h.id===o.id);return f?{...s,approvals:s.approvals.filter(h=>h.id!==o.id),entries:[...s.entries,{id:++Ye,ts:u,agent:String(f.agent??"director"),kind:"system",title:"resolved",body:String(o.behavior??"resolved")}]}:s}case"question":return s.questions.some(f=>f.id===o.id)?s:{...s,questions:[...s.questions,{...o,since:u}],entries:[...s.entries,{id:++Ye,ts:u,agent:"director",kind:"system",title:"waiting on you",body:`question: ${String(o.question??"")}`}]};case"question_answered":return s.questions.find(h=>h.id===o.id)?{...s,questions:s.questions.filter(h=>h.id!==o.id),entries:[...s.entries,{id:++Ye,ts:u,agent:"director",kind:"system",title:"resolved",body:"answered"}]}:s;case"root_allowed":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:String(o.agent??"director"),kind:"system",title:"path allowed for run",body:String(o.path??"")}]};case"auto_denied":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:String(o.agent??"director"),kind:"system",title:"redirected to workspace",body:String(o.reason??"")}]};case"permission_timeout":case"question_timeout":{const f=c.event==="permission_timeout";if(!(f?s.approvals.find(b=>b.id===o.id):s.questions.find(b=>b.id===o.id)))return s;const g=Math.max(1,Math.round(Number(o.afterMs??0)/6e4));return{...s,approvals:f?s.approvals.filter(b=>b.id!==o.id):s.approvals,questions:f?s.questions:s.questions.filter(b=>b.id!==o.id),entries:[...s.entries,{id:++Ye,ts:u,agent:String(o.agent??"director"),kind:"error",title:f?"auto-denied (unattended)":"auto-answered (unattended)",body:f?`${String(o.toolName??"tool")} waited ${g} min with no answer and was denied; the agent was told to redo the work inside .foreman/work/.`:`The director's question waited ${g} min with no answer; it was told to decide itself and record the decision in MISSION.md.`}]}}default:return s}}function ym(s,c){switch(c.t){case"reset":return Hc;case"wire":return mm(s,c.e);case"missiondoc":return{...s,missionDoc:c.doc}}}function xm(s,c){const[u,o]=x.useReducer(ym,Hc),f=x.useRef(null);return x.useEffect(()=>{if(o({t:"reset"}),!s)return;let h=!1;f.current=[];const g=c?Ks((v,w)=>{if(w.runId!==s)return;const k={event:v,data:w.data};f.current?f.current.push(k):o({t:"wire",e:k})}):null;(async()=>{try{const v=await fetch(`/runs/${encodeURIComponent(s)}/events`).catch(()=>null);if(h||!v?.ok)return;const{events:w}=await v.json();if(h)return;for(const k of w)o({t:"wire",e:k})}finally{if(!h){for(const v of f.current??[])o({t:"wire",e:v});f.current=null}}})();const b=async()=>{const v=await fetch(`/missiondoc?run=${encodeURIComponent(s)}`).catch(()=>null);v?.ok&&!h&&o({t:"missiondoc",doc:(await v.json()).doc})};b();const y=c?setInterval(b,5e3):null;return()=>{h=!0,g?.(),y&&clearInterval(y)}},[s,c]),u}function bm(s,c){if(s==="message"){const u=c.msg;if(u?.type==="assistant")for(const o of u.message?.content??[]){if(o.type==="text"&&o.text?.trim())return`${c.agent}: ${o.text.trim()}`;if(o.type==="tool_use"){const f=String(o.name||"").replace(/^mcp__(foreman|playwright)__/,"");return`${c.agent} · ${f}`}}return null}return s==="worker_started"?`${c.id} ${c.resumed?"resumed":"spawned"}`:s==="worker_finished"?`${c.id} ${c.status}`:s==="worker_progress"?`${c.id}: ${c.blocked?`BLOCKED — ${c.blocked}`:c.status}`:s==="steer"?`you → ${c.to}: ${c.text}`:s==="budget_alert"?c.text:s==="question"?`director asks: ${c.question}`:null}function Sm(){const[s,c]=x.useState([]),[u,o]=x.useState(!1),[f,h]=x.useState({mode:"none",source:""}),[g,b]=x.useState({}),[y,v]=x.useState(null),[w,k]=x.useState(""),S=x.useCallback(async()=>{const H=await fetch("/projects").catch(()=>null);if(!H?.ok)return;const Q=await H.json();c(Q.projects),h({mode:Q.authMode??"none",source:Q.authSource??"",account:Q.authAccount??void 0}),v(Q.update?.latest?{latest:String(Q.update.latest),current:String(Q.version??"")}:null),k(String(Q.version??""))},[]);return x.useEffect(()=>{S();const H=setInterval(S,3e3),Q=Ks((C,_)=>{if(!_.chat&&(["run_started","run_resumed","run_finished","permission_request","permission_resolved","permission_timeout","question","question_answered","question_timeout"].includes(C)&&S(),_.projectId))if(C==="run_finished")b(V=>{const{[_.projectId]:$,...W}=V;return W});else{const V=bm(C,_.data);V&&b($=>({...$,[_.projectId]:V.slice(0,160)}))}}),F=vm(C=>{o(C),C&&S()});return()=>{clearInterval(H),Q(),F()}},[S]),{projects:s,connected:u,auth:f,refresh:S,activity:g,update:y,version:w}}function jm(s){const[c,u]=x.useState([]),o=x.useCallback(async()=>{const f=await fetch(`/runs?projectId=${encodeURIComponent(s)}`).catch(()=>null);f?.ok&&u((await f.json()).runs)},[s]);return x.useEffect(()=>(o(),Ks((h,g)=>{g.projectId===s&&(h==="run_started"||h==="run_resumed"||h==="run_finished")&&o()})),[s,o]),c}const Dc={entries:[],costUsd:0,proposal:null,thinking:!1,question:null,who:null};function km(s,c){return s.map(u=>`${u.question.replace(/[?:]\s*$/,"")} → ${c[u.question]||"(no answer)"}`).join(`
14
+ `)}function Mp(s,c){const u=c.ts??Date.now(),o=c.data;switch(c.event){case"chat_cleared":return Ep(s,{t:"reset"});case"chat_proposal_dismissed":return{...s,proposal:null};case"chat_message":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:"you",kind:"steer",title:"you",body:o.text}]};case"message":{const f=Tp("foreman",o.msg,u).filter(h=>h.kind==="text"||h.kind==="tool"&&!/ask_user/.test(h.title));return f.length?{...s,entries:[...s.entries,...f]}:s}case"mission_proposed":return{...s,proposal:o};case"mission_started":return{...s,proposal:null,entries:[...s.entries,{id:++Ye,ts:u,agent:"system",kind:"system",title:"mission started",body:o.mission}]};case"chat_cost":return{...s,costUsd:o.costUsd??s.costUsd};case"chat_turn":return{...s,thinking:o.state==="thinking",who:typeof o.model=="string"&&typeof o.provider=="string"?{model:o.model,provider:o.provider,costBasis:zl(o)}:s.who};case"chat_question":return Array.isArray(o.questions)&&o.questions.length?{...s,question:{id:String(o.id),questions:o.questions,askedAt:u}}:s;case"chat_answered":{const f=s.question,h=f&&f.id===o.id?f.questions:[],g=h.length?km(h,o.answers??{}):Object.entries(o.answers??{}).map(([b,y])=>`${b} → ${y}`).join(`
15
+ `);return{...s,question:s.question?.id===o.id?null:s.question,entries:g?[...s.entries,{id:++Ye,ts:u,agent:"you",kind:"steer",title:o.source?`you chose · via ${o.source}`:"you chose",body:g}]:s.entries}}case"chat_question_timeout":return{...s,question:s.question?.id===o.id?null:s.question,entries:[...s.entries,{id:++Ye,ts:u,agent:"system",kind:"error",title:"no answer (unattended)",body:`No answer after ${Math.round((o.afterMs??0)/6e4)} minutes — the planner is proceeding on its recommended options and will state the assumptions.`}]};case"chat_error":return{...s,entries:[...s.entries,{id:++Ye,ts:u,agent:"system",kind:"error",title:"planner",body:o.error}]};default:return s}}function Ep(s,c){switch(c.t){case"reset":return Dc;case"load":return c.view;case"dismiss":return{...s,proposal:null};case"wire":return Mp(s,c.e)}}function wm(s){const[c,u]=x.useState([]),[o,f]=x.useState(!1);return x.useEffect(()=>{if(s.length<2){u([]),f(!1);return}let h=!1;f(!0);const g=setTimeout(()=>{fetch(`/search?q=${encodeURIComponent(s)}`).then(b=>b.ok?b.json():{runs:[]}).then(b=>{h||(u(b.runs??[]),f(!1))}).catch(()=>{h||(u([]),f(!1))})},200);return()=>{h=!0,clearTimeout(g)}},[s]),{hits:c,busy:o}}const zm="_fleet";function _p(s){const[c,u]=x.useReducer(Ep,Dc),o=x.useRef(null),f=x.useCallback(async w=>{const k=await fetch(`/chat?projectId=${encodeURIComponent(w)}`).catch(()=>null);return k?.ok?await k.json():null},[]);x.useEffect(()=>{if(u({t:"reset"}),!s)return;let w=!1;o.current=[];const k=Ks((S,H)=>{if(!H.chat||H.projectId!==s)return;const Q={event:S,data:H.data};o.current?o.current.push(Q):u({t:"wire",e:Q})});return(async()=>{const S=await f(s);if(!w){if(S){let H={...Dc,costUsd:S.costUsd,proposal:S.proposal,thinking:S.thinking};for(const Q of S.events)H=Mp(H,Q);H={...H,question:S.question??null,who:S.who??H.who,thinking:S.thinking},u({t:"load",view:H})}for(const H of o.current??[])u({t:"wire",e:H});o.current=null}})(),()=>{w=!0,k()}},[s,f]);const h=x.useCallback(async w=>{if(!s)return"no project";const k=await Dt("/chat",{projectId:s,text:w});return k.ok?null:(await k.json().catch(()=>({}))).error??"could not reach the planner"},[s]),g=x.useCallback(async()=>{s&&await Dt("/chat/stop",{projectId:s}).catch(()=>{})},[s]),b=x.useCallback(async()=>{s&&(await fetch(`/chat?projectId=${encodeURIComponent(s)}`,{method:"DELETE"}).catch(()=>{}),u({t:"reset"}))},[s]),y=x.useCallback(async(w,k)=>{if(!s)return"no project";const S=await Dt("/chat/answer",{projectId:s,id:w,answers:k});return S.ok?null:(await S.json().catch(()=>({}))).error??"could not deliver the answer"},[s]),v=x.useCallback(()=>u({t:"dismiss"}),[]);return{...c,send:h,answer:y,clear:b,stop:g,dismissProposal:v}}function Tm(){const[s,c]=x.useState(null),[u,o]=x.useState(!1),[f,h]=x.useState(""),g=x.useCallback(async()=>{const v=await fetch("/notify").catch(()=>null);v?.ok&&c(await v.json())},[]);x.useEffect(()=>{g()},[g]),x.useEffect(()=>{if(!s?.telegram.linking)return;const v=setInterval(()=>{g()},3e3);return()=>clearInterval(v)},[s?.telegram.linking,g]);const b=x.useCallback(async v=>{o(!0),h("");try{const w=await v();w.ok||h((await w.json().catch(()=>({}))).error??`HTTP ${w.status}`)}catch(w){h(w instanceof Error?w.message:String(w))}finally{o(!1),await g()}},[g]),y=(v,w,k)=>fetch(w,{method:v,headers:k?{"content-type":"application/json"}:void 0,body:k?JSON.stringify(k):void 0});return{status:s,busy:u,error:f,refresh:g,onSaveToken:v=>{b(()=>y("PUT","/notify/telegram/token",{token:v}))},onClearToken:()=>{b(()=>y("DELETE","/notify/telegram/token"))},onLink:()=>{b(()=>y("POST","/notify/telegram/link"))},onUnlink:()=>{b(()=>y("DELETE","/notify/telegram/link"))},onTest:()=>{b(()=>y("POST","/notify/test"))},onSavePublicUrl:v=>{b(()=>y("PATCH","/notify/settings",{publicUrl:v}))}}}function Mm(){const s=()=>{const h=window.location.hash.match(/^#\/p\/([^/]+)(?:\/r\/([^/]+)(?:\/(files|runs))?)?/);return{projectId:h?decodeURIComponent(h[1]):null,runId:h?.[2]?decodeURIComponent(h[2]):null,tab:h?.[3]==="files"||h?.[3]==="runs"?h[3]:"mission"}},[c,u]=x.useState(s);x.useEffect(()=>{const h=()=>u(s());return window.addEventListener("hashchange",h),()=>window.removeEventListener("hashchange",h)},[]);const o=x.useCallback(h=>{window.location.hash=h?`#/p/${encodeURIComponent(h)}`:"#/"},[]),f=x.useCallback((h,g,b="mission")=>{window.location.hash=g?`#/p/${encodeURIComponent(h)}/r/${encodeURIComponent(g)}${b==="mission"?"":`/${b}`}`:`#/p/${encodeURIComponent(h)}`},[]);return{...c,go:o,goRun:f}}const Dt=(s,c)=>fetch(s,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(c)}),Fe={linkProject:(s,c,u)=>Dt("/projects",{folder:s,name:c,provider:u}),instances:()=>fetch("/instances"),updateProject:(s,c)=>fetch(`/projects/${encodeURIComponent(s)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(c)}),unlinkProject:s=>fetch(`/projects/${encodeURIComponent(s)}`,{method:"DELETE"}),run:(s,c,u,o={})=>Dt("/run",{projectId:s,mission:c,budgetUsd:u,directorModel:o.directorModel||void 0,workerModel:o.workerModel||void 0,directorProviderId:o.directorProviderId||void 0,workerProviderId:o.workerProviderId||void 0,browserTools:o.browserTools||void 0}),resume:(s,c={})=>Dt(`/runs/${encodeURIComponent(s)}/resume`,c),permission:(s,c,u)=>Dt("/permission",{id:s,behavior:c,message:u}),answer:(s,c)=>Dt("/answer",{id:s,text:c}),attach:async(s,c)=>{const u=await Promise.all(c.map(async o=>({name:o.name,type:o.type,data:await new Promise((f,h)=>{const g=new FileReader;g.onload=()=>f(String(g.result).split(",")[1]??""),g.onerror=()=>h(g.error),g.readAsDataURL(o)})})));return Dt("/attachments",{projectId:s,files:u})},forkPlan:(s,c)=>Dt("/chat/fork",{projectId:s,runId:c}),steer:(s,c)=>Dt("/steer",{runId:s,text:c}),interrupt:s=>Dt("/interrupt",{runId:s}),updateRun:(s,c)=>fetch("/run",{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({runId:s,...c})}).then(async u=>{if(!u.ok)throw new Error((await u.json().catch(()=>({}))).error||`HTTP ${u.status}`);return u.json()}),setProviderKey:(s,c)=>fetch(`/providers/${encodeURIComponent(s)}/key`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({key:c})}),clearProviderKey:s=>fetch(`/providers/${encodeURIComponent(s)}/key`,{method:"DELETE"}),browse:s=>fetch("/browse"+(s?`?path=${encodeURIComponent(s)}`:"")),mkdir:(s,c)=>Dt("/mkdir",{parent:s,name:c}),locate:s=>fetch(`/locate?name=${encodeURIComponent(s)}`)};async function Cp(s,c,u){if(!u.length)return c;const o=await Fe.attach(s,u),f=await o.json().catch(()=>({}));if(!o.ok)throw new Error(f.error||"could not save the attachments");const h=(f.files??[]).map(g=>g.path);return`${c}
16
+
17
+ Attached files (in the project folder — read them):
18
+ ${h.map(g=>`- ${g}`).join(`
19
+ `)}`}const Ap=(...s)=>s.filter((c,u,o)=>!!c&&c.trim()!==""&&o.indexOf(c)===u).join(" ").trim();const Em=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const _m=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(c,u,o)=>o?o.toUpperCase():u.toLowerCase());const Xh=s=>{const c=_m(s);return c.charAt(0).toUpperCase()+c.slice(1)};var yc={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Cm=s=>{for(const c in s)if(c.startsWith("aria-")||c==="role"||c==="title")return!0;return!1},Am=x.createContext({}),Dm=()=>x.useContext(Am),Rm=x.forwardRef(({color:s,size:c,strokeWidth:u,absoluteStrokeWidth:o,className:f="",children:h,iconNode:g,...b},y)=>{const{size:v=24,strokeWidth:w=2,absoluteStrokeWidth:k=!1,color:S="currentColor",className:H=""}=Dm()??{},Q=o??k?Number(u??w)*24/Number(c??v):u??w;return x.createElement("svg",{ref:y,...yc,width:c??v??yc.width,height:c??v??yc.height,stroke:s??S,strokeWidth:Q,className:Ap("lucide",H,f),...!h&&!Cm(b)&&{"aria-hidden":"true"},...b},[...g.map(([F,C])=>x.createElement(F,C)),...Array.isArray(h)?h:[h]])});const oe=(s,c)=>{const u=x.forwardRef(({className:o,...f},h)=>x.createElement(Rm,{ref:h,iconNode:c,className:Ap(`lucide-${Em(Xh(s))}`,`lucide-${s}`,o),...f}));return u.displayName=Xh(s),u};const Om=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Nm=oe("activity",Om);const Hm=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Um=oe("arrow-left",Hm);const Bm=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],qm=oe("arrow-up-down",Bm);const Lm=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Ym=oe("bell",Lm);const $m=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Gm=oe("bot",$m);const Xm=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],Qm=oe("braces",Xm);const Vm=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],Km=oe("bug",Vm);const Zm=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Wm=oe("check",Zm);const Jm=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Fm=oe("chevron-down",Jm);const Im=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Pm=oe("chevron-left",Im);const ey=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ty=oe("chevron-right",ey);const ny=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ly=oe("circle",ny);const ay=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],iy=oe("clock",ay);const sy=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],ry=oe("code",sy);const oy=[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]],cy=oe("coins",oy);const uy=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],dy=oe("corner-down-left",uy);const fy=[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]],hy=oe("corner-left-up",fy);const py=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],vy=oe("cpu",py);const gy=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],my=oe("eye",gy);const yy=[["path",{d:"M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z",key:"ukzhwg"}],["path",{d:"M14.487 7.858A1 1 0 0 1 14 7V2",key:"1klhew"}],["path",{d:"M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516",key:"rxaxab"}],["path",{d:"M8 18h1",key:"13wk12"}]],xy=oe("file-pen-line",yy);const by=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],Sy=oe("file-pen",by);const jy=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ky=oe("file-text",jy);const wy=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],zy=oe("file",wy);const Ty=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],My=oe("folder-open",Ty);const Ey=[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],_y=oe("folder-search",Ey);const Cy=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ay=oe("folder",Cy);const Dy=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Ry=oe("funnel",Dy);const Oy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Ny=oe("globe",Oy);const Hy=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Uy=oe("image",Hy);const By=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],qy=oe("layout-template",By);const Ly=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],Yy=oe("list-checks",Ly);const $y=[["path",{d:"M16 5H3",key:"m91uny"}],["path",{d:"M16 12H3",key:"1a2rj7"}],["path",{d:"M9 19H3",key:"s61nz1"}],["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M21 5v12a2 2 0 0 1-2 2h-6",key:"hey24a"}]],Gy=oe("list-end",$y);const Xy=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qy=oe("loader-circle",Xy);const Vy=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ky=oe("message-circle-question-mark",Vy);const Zy=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],Wy=oe("message-square-plus",Zy);const Jy=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Fy=oe("message-square",Jy);const Iy=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Py=oe("moon",Iy);const e0=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],t0=oe("octagon-alert",e0);const n0=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],l0=oe("paperclip",n0);const a0=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],i0=oe("pause",a0);const s0=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],r0=oe("pen-line",s0);const o0=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],c0=oe("plus",o0);const u0=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],d0=oe("power",u0);const f0=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],h0=oe("quote",f0);const p0=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],v0=oe("rotate-ccw-clock",p0);const g0=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],m0=oe("rotate-cw",g0);const y0=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],x0=oe("save",y0);const b0=[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],S0=oe("search-check",b0);const j0=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],k0=oe("search",j0);const w0=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],z0=oe("send-horizontal",w0);const T0=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],M0=oe("server",T0);const E0=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],_0=oe("settings",E0);const C0=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],A0=oe("shield-check",C0);const D0=[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]],R0=oe("shuffle",D0);const O0=[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],N0=oe("square-code",O0);const H0=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],U0=oe("sun",H0);const B0=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],q0=oe("terminal",B0);const L0=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],Y0=oe("text-align-start",L0);const $0=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],G0=oe("triangle-alert",$0);const X0=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],Q0=oe("unlink",X0);const V0=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],K0=oe("user-plus",V0);const Z0=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],W0=oe("user",Z0);const J0=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],F0=oe("users",J0);const I0=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],P0=oe("wifi-off",I0);const ex=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],tx=oe("wrench",ex);const nx=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lx=oe("x",nx);const ax=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]],ix=oe("zap",ax),Qh={Circle:ly,Activity:Nm,Check:Wm,X:lx,Pause:i0,WifiOff:P0,History:v0,TriangleAlert:G0,OctagonAlert:t0,RotateCw:m0,Bot:Gm,Plus:c0,CornerLeftUp:hy,ArrowLeft:Um,Folder:Ay,Bell:Ym,Unlink:Q0,Sun:U0,Moon:Py,Clock:iy,AlignLeft:Y0,Users:F0,ChevronDown:Fm,ChevronRight:ty,ChevronLeft:Pm,Braces:Qm,MessageCircleQuestion:Ky,ShieldCheck:A0,Coins:cy,LayoutTemplate:qy,Save:x0,Filter:Ry,Settings:_0,Paperclip:l0,File:zy,Image:Uy,Code:ry,SquareCode:N0,Quote:h0,PenLine:r0,Eye:my,Cpu:vy,LoaderCircle:Qy,MessageSquarePlus:Wy,SendHorizontal:z0,User:W0,Zap:ix,ListEnd:Gy,FilePen:Sy,FilePenLine:xy,FileText:ky,Terminal:q0,Search:k0,FolderSearch:_y,FolderOpen:My,Globe:Ny,ListChecks:Yy,UserPlus:K0,MessageSquare:Fy,CornerDownLeft:dy,Power:d0,Wrench:tx,Bug:Km,Shuffle:R0,SearchCheck:S0,ArrowUpDown:qm,Server:M0},Vh={idle:"Circle",running:"Activity",done:"Check",error:"X",interrupted:"Pause",disconnected:"WifiOff",readonly:"History",warning:"TriangleAlert",critical:"OctagonAlert",caution:"TriangleAlert",resume:"RotateCw",orchestration:"Bot",add:"Plus",parent:"CornerLeftUp",back:"ArrowLeft",folder:"Folder",needsYou:"Bell",unlink:"Unlink",sun:"Sun",moon:"Moon",provider:"Server",search:"Search",sort:"ArrowUpDown",timeline:"Clock",transcript:"AlignLeft",crew:"Users",chevronDown:"ChevronDown",chevronRight:"ChevronRight",chevronLeft:"ChevronLeft",raw:"Braces",question:"MessageCircleQuestion",approval:"ShieldCheck",check:"Check",close:"X",budget:"Coins",template:"LayoutTemplate",draft:"Save",filter:"Filter",settings:"Settings",attach:"Paperclip",file:"File",image:"Image",code:"Code",codeBlock:"SquareCode",quote:"Quote",write:"PenLine",preview:"Eye",model:"Cpu",loading:"LoaderCircle",steer:"MessageSquarePlus",send:"SendHorizontal",you:"User",now:"Zap",nextTurn:"ListEnd",Write:"FilePen",Edit:"FilePenLine",MultiEdit:"FilePenLine",Read:"FileText",Bash:"Terminal",Grep:"Search",Glob:"FolderSearch",LS:"FolderOpen",WebFetch:"Globe",WebSearch:"Globe",Task:"ListChecks",TodoWrite:"ListChecks",spawn_worker:"UserPlus",message_worker:"MessageSquare",ask_human:"MessageCircleQuestion",result:"CornerDownLeft",init:"Power",tool:"Wrench",Bug:"Bug",Shuffle:"Shuffle",SearchCheck:"SearchCheck"};function te({name:s,size:c=16,strokeWidth:u=1.75,color:o,label:f,style:h}){const g=Vh[s]||s,b=Qh[g]||Qh[Vh.tool];return a.jsx(b,{width:c,height:c,strokeWidth:u,color:o||"currentColor","aria-hidden":f?void 0:!0,"aria-label":f,role:f?"img":void 0,style:{flex:"0 0 auto",display:"block",...h}})}const Kh={idle:{color:"var(--ink-2)",icon:"idle",label:"idle"},running:{color:"var(--status-good)",icon:"running",label:"running"},done:{color:"var(--status-good)",icon:"done",label:"done"},error:{color:"var(--status-critical)",icon:"error",label:"error"},interrupted:{color:"var(--status-serious)",icon:"interrupted",label:"interrupted"},"needs-you":{color:"var(--status-warning)",icon:"needsYou",label:"needs you"}};function Tl({status:s,style:c}){const u=Kh[s]??Kh.idle;return a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:"var(--fs-sm)",color:"var(--ink-1)",padding:"2px 8px 2px 6px",borderRadius:"var(--r-pill)",background:"var(--bg-inset)",border:"1px solid var(--line)",whiteSpace:"nowrap",lineHeight:"16px",...c},children:[a.jsx(te,{name:u.icon,size:12,strokeWidth:2.25,color:u.color}),u.label]})}function sx({value:s,onChange:c,groups:u=[],placeholder:o="Search projects and runs…",busy:f=!1,style:h}){const g=x.useRef(null),[b,y]=x.useState(!1),[v,w]=x.useState(0),k=s.trim().length>0,S=u.flatMap(_=>_.items),H=b&&k&&(S.length>0||!f);x.useEffect(()=>{const _=V=>{const $=document.activeElement,W=$&&($.tagName==="INPUT"||$.tagName==="TEXTAREA"||$.isContentEditable),se=V.key==="/"&&!W&&!V.metaKey&&!V.ctrlKey&&!V.altKey,E=V.key.toLowerCase()==="k"&&(V.metaKey||V.ctrlKey)&&!V.altKey;(se||E)&&(V.preventDefault(),g.current?.focus(),g.current?.select())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[]),x.useEffect(()=>{w(0)},[s,S.length]);const Q=_=>{_.onPick?.(),c?.(""),g.current?.blur()},F=_=>{if(_.key==="Escape"){s?c?.(""):_.currentTarget.blur();return}!H||!S.length||(_.key==="ArrowDown"?(_.preventDefault(),w(V=>(V+1)%S.length)):_.key==="ArrowUp"?(_.preventDefault(),w(V=>(V-1+S.length)%S.length)):_.key==="Enter"&&(_.preventDefault(),Q(S[v]??S[0])))};let C=-1;return a.jsxs("div",{style:{position:"relative",flex:"0 1 26rem",minWidth:"12rem",...h},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",background:"var(--bg-card)",borderRadius:"var(--r-sm)",border:`1px solid ${b?"var(--brand)":"var(--line)"}`,padding:"4px var(--sp-2)",transition:"border-color var(--dur-fast) var(--ease)"},children:[a.jsx(te,{name:"search",size:14,color:"var(--ink-2)"}),a.jsx("input",{ref:g,value:s,type:"text",placeholder:o,"aria-label":"Search projects, runs and actions",role:"combobox","aria-expanded":H,onChange:_=>c?.(_.target.value),onFocus:()=>y(!0),onBlur:()=>setTimeout(()=>y(!1),120),onKeyDown:F,style:{flex:1,minWidth:0,border:"none",outline:"none",background:"transparent",color:"var(--ink-0)",font:"inherit",fontSize:"var(--fs-sm)",padding:0,boxShadow:"none"}}),k?a.jsx("button",{type:"button",onClick:()=>{c?.(""),g.current?.focus()},title:"Clear (Esc)","aria-label":"Clear search",style:{display:"inline-flex",background:"none",border:"none",padding:0,cursor:"pointer",color:"var(--ink-2)"},children:a.jsx(te,{name:"close",size:13})}):a.jsx("kbd",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",border:"1px solid var(--line)",borderRadius:3,padding:"0 4px",lineHeight:"15px",whiteSpace:"nowrap"},children:"⌘K"})]}),H&&a.jsxs("div",{role:"listbox",style:{position:"absolute",top:"calc(100% + 6px)",left:0,width:"max(100%, 34rem)",maxWidth:"calc(100vw - 2rem)",maxHeight:"60vh",overflowY:"auto",zIndex:30,background:"var(--bg-panel)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-md)",boxShadow:"0 12px 32px rgba(0,0,0,.35)",padding:"var(--sp-1) 0"},children:[S.length===0&&a.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-3)",fontSize:"var(--fs-sm)",color:"var(--ink-2)"},children:["Nothing matches “",s.trim(),"”."]}),u.filter(_=>_.items.length).map(_=>a.jsxs("div",{children:[a.jsxs("div",{style:{padding:"6px var(--sp-3) 2px",fontSize:"var(--fs-xs)",color:"var(--ink-2)",letterSpacing:".06em",textTransform:"uppercase"},children:[_.label,_.count!==void 0?` · ${_.count}`:""]}),_.items.map(V=>{C+=1;const $=C,W=$===v;return a.jsxs("button",{type:"button",role:"option","aria-selected":W,onMouseDown:se=>se.preventDefault(),onMouseEnter:()=>w($),onClick:()=>Q(V),style:{display:"grid",gridTemplateColumns:"auto minmax(0, 1fr) auto",alignItems:"center",gap:"var(--sp-2)",width:"100%",textAlign:"left",padding:"6px var(--sp-3)",border:"none",font:"inherit",background:W?"var(--bg-hover)":"transparent",color:"var(--ink-0)",cursor:"pointer"},children:[a.jsx(te,{name:V.icon??"folder",size:14,color:"var(--ink-2)"}),a.jsxs("span",{style:{minWidth:0,display:"flex",flexDirection:"column"},children:[a.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--fs-sm)"},children:V.title}),V.detail&&a.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:V.detail})]}),a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:[V.status&&a.jsx(Tl,{status:V.status}),V.meta]})]},V.id)})]},_.label))]})]})}const Zh={"api-key":{color:"var(--status-warning)",icon:"budget",label:"API key billing",hint:"Missions bill a metered API key, not a Claude subscription. Usage is charged per token."},subscription:{color:"var(--ink-2)",icon:"budget",label:"subscription",hint:"Missions run on the signed-in Claude subscription."},cloud:{color:"var(--ink-2)",icon:"budget",label:"cloud provider",hint:"Missions bill a cloud provider (Bedrock/Vertex)."},local:{color:"var(--ink-2)",icon:"model",label:"local model",hint:"Missions run on a model served from this machine. No per-token cost, so budgets are capped by turns and time."},provider:{color:"var(--status-warning)",icon:"budget",label:"external provider",hint:"Missions bill an endpoint Foreman does not price. Spend is real but its dollar figure is not shown."},none:{color:"var(--status-critical)",icon:"error",label:"no credentials",hint:"No credentials found — missions cannot run."}};function Dp({mode:s,source:c,account:u,compact:o,style:f}){const h=Zh[s]??Zh.none,g=u?.email,b=h.label,y=[h.hint,g&&u.org?`Account: ${g} (${u.org})`:g&&`Account: ${g}`,c&&`Source: ${c}`].filter(Boolean).join(`
20
+ `),v=s==="api-key"||s==="none"||s==="provider";return a.jsxs("span",{title:y,style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:o?"var(--fs-xs)":"var(--fs-sm)",color:"var(--ink-1)",padding:o?"1px 6px 1px 5px":"2px 8px 2px 6px",borderRadius:"var(--r-pill)",background:"var(--bg-inset)",border:`1px solid ${v?h.color:"var(--line)"}`,whiteSpace:"nowrap",lineHeight:"16px",...f},children:[a.jsx(te,{name:h.icon,size:12,strokeWidth:2.25,color:h.color}),o?b:`billing: ${b}`]})}function xi({children:s,title:c,onClick:u,tone:o}){const f=o==="warn"?"var(--status-warning)":o==="bad"?"var(--status-error)":"var(--ink-2)",h=a.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:6,color:f,whiteSpace:"nowrap",minWidth:0},children:s});return u?a.jsx("button",{type:"button",onClick:u,title:c,style:{background:"none",border:0,padding:"0 2px",margin:"0 -2px",font:"inherit",cursor:"pointer",display:"inline-flex",minWidth:0,borderRadius:3},children:h}):a.jsx("span",{title:c,style:{display:"inline-flex",minWidth:0},children:h})}const rx=({color:s})=>a.jsx("span",{"aria-hidden":!0,style:{width:7,height:7,borderRadius:"50%",background:s,flex:"0 0 auto"}}),Bs=()=>a.jsx("span",{"aria-hidden":!0,style:{width:1,height:12,background:"var(--line)",margin:"0 var(--sp-2)",flex:"0 0 auto"}}),qs=s=>String(s??"").replace(/^https?:\/\//,"").replace(/\/+$/,"");function ox({connected:s,localUrl:c,publicUrl:u,phone:o,auth:f,version:h,update:g,onOpenSettings:b,style:y}){const v=typeof u=="string"&&u.startsWith("https://"),w=u&&qs(u)!==qs(c)?u:null;return a.jsxs("footer",{style:{display:"flex",alignItems:"center",gap:0,flex:"0 0 auto",minHeight:24,padding:"2px var(--sp-4)",background:"var(--bg-panel)",borderTop:"1px solid var(--line)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums",overflow:"hidden",...y},children:[a.jsxs(xi,{title:s?"Live: this tab follows the server’s event stream":"Disconnected: the tab lost the server’s event stream and is reconnecting",tone:s?void 0:"bad",children:[a.jsx(rx,{color:s?"var(--status-success)":"var(--status-error)"}),s?"connected":"disconnected"]}),a.jsx(Bs,{}),a.jsxs(xi,{title:`Serving on ${c}${w?` and, on your tailnet, ${w}${v?" (HTTPS via tailscale serve)":" (plain HTTP — foreman doctor shows the one command for HTTPS)"}`:""}`,children:[a.jsx("span",{style:{fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis"},children:qs(c)}),w&&a.jsxs(a.Fragment,{children:[a.jsx("span",{"aria-hidden":!0,children:"·"}),a.jsx(te,{name:v?"approval":"provider",size:12,color:v?"var(--status-success)":"var(--ink-2)"}),a.jsx("span",{style:{fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis"},children:qs(w)})]})]}),o!==void 0&&a.jsxs(a.Fragment,{children:[a.jsx(Bs,{}),a.jsxs(xi,{onClick:()=>b?.("notifications"),title:o?`Telegram linked to ${o}. Approvals, questions and the front desk reach that chat. Click for Notifications.`:"No phone linked. Settings → Notifications links a Telegram chat: approvals, questions and the front desk on the move.",children:[a.jsx(te,{name:"needsYou",size:12}),o?`phone ${o}`:"no phone linked"]})]}),a.jsxs("span",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",minWidth:0},children:[f&&a.jsxs(a.Fragment,{children:[a.jsx(xi,{onClick:()=>b?.("provider"),title:"Who pays for missions by default. Click for Provider.",children:a.jsx(Dp,{mode:f.mode,source:f.source,account:f.account,compact:!0})}),a.jsx(Bs,{})]}),g&&a.jsxs(a.Fragment,{children:[a.jsxs(xi,{tone:"warn",title:`You run ${g.current}; ${g.latest} is on npm. In a terminal: foreman update — it refuses while a mission is live.`,children:[g.latest," available · ",a.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:"foreman update"})]}),a.jsx(Bs,{})]}),h&&a.jsxs("a",{href:"https://github.com/amenophis1er/foreman/releases",target:"_blank",rel:"noopener noreferrer",title:`Foreman ${h} — release notes`,style:{fontFamily:"var(--font-mono)",color:"var(--ink-2)",textDecoration:"none",whiteSpace:"nowrap"},children:["v",h]})]})]})}const cx=/\.(png|jpe?g|gif|webp|svg|heic)$/i,ux=/\.(js|jsx|ts|tsx|py|rb|go|rs|java|kt|swift|c|cc|cpp|h|css|html|json|ya?ml|toml|sh|sql|md)$/i;function dx(s){return s==null?"":s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(s<10240?1:0)} KB`:`${(s/1048576).toFixed(1)} MB`}function Rp({name:s,size:c,onRemove:u,style:o}){const[f,h]=x.useState(!1),g=cx.test(s)?"image":ux.test(s)?"code":"file";return a.jsxs("span",{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{display:"inline-flex",alignItems:"center",gap:6,maxWidth:260,height:24,padding:"0 4px 0 8px",background:"var(--bg-inset)",border:`1px solid ${f?"var(--line-strong)":"var(--line)"}`,borderRadius:"var(--r-sm)",fontSize:"var(--fs-sm)",color:"var(--ink-0)",...o},children:[a.jsx(te,{name:g,size:13,color:"var(--ink-2)"}),a.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}),c!=null&&a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",whiteSpace:"nowrap"},children:dx(c)}),u&&a.jsx("button",{type:"button",onClick:u,"aria-label":`Remove ${s}`,style:{display:"inline-flex",width:18,height:18,alignItems:"center",justifyContent:"center",background:"none",border:"none",borderRadius:3,padding:0,cursor:"pointer",color:"var(--ink-2)"},children:a.jsx(te,{name:"close",size:12})})]})}const fx={default:{background:"var(--bg-card)",border:"1px solid var(--line-strong)",color:"var(--ink-0)"},primary:{background:"var(--brand)",border:"1px solid var(--brand)",color:"var(--brand-ink)",fontWeight:"var(--fw-semibold)"},good:{background:"transparent",border:"1px solid var(--status-good)",color:"var(--ink-0)"},danger:{background:"transparent",border:"1px solid var(--status-critical)",color:"var(--ink-0)"},ghost:{background:"none",border:"1px solid transparent",color:"var(--ink-1)"}},hx={default:{borderColor:"var(--ink-2)"},primary:{filter:"brightness(1.08)"},good:{background:"color-mix(in srgb, var(--status-good) 14%, transparent)"},danger:{background:"color-mix(in srgb, var(--status-critical) 14%, transparent)"},ghost:{color:"var(--ink-0)",background:"var(--bg-hover)"}},px={default:{background:"var(--bg-inset)"},primary:{filter:"brightness(0.94)"},good:{background:"color-mix(in srgb, var(--status-good) 22%, transparent)"},danger:{background:"color-mix(in srgb, var(--status-critical) 22%, transparent)"},ghost:{background:"var(--bg-inset)"}},Wh={sm:{padding:"3px 8px",fontSize:"var(--fs-sm)",gap:5,icon:13},md:{padding:"6px 12px",fontSize:"var(--fs-md)",gap:6,icon:15}};function de({children:s,onClick:c,variant:u="default",size:o="md",icon:f,disabled:h,title:g,type:b="button",style:y}){const[v,w]=x.useState(!1),[k,S]=x.useState(!1),H=Wh[o]||Wh.md;return a.jsxs("button",{type:b,title:g,disabled:h,onClick:c,onMouseEnter:()=>w(!0),onMouseLeave:()=>{w(!1),S(!1)},onMouseDown:()=>S(!0),onMouseUp:()=>S(!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:H.gap,padding:H.padding,borderRadius:"var(--r-sm)",fontSize:H.fontSize,lineHeight:"var(--lh)",whiteSpace:"nowrap",cursor:h?"default":"pointer",transition:"background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease)",...fx[u],...h?{opacity:.5}:v?hx[u]:null,...!h&&k?px[u]:null,...y},children:[f&&a.jsx(te,{name:f,size:H.icon}),s]})}const xc=s=>`${s.name}:${s.size}`,Uc=22,Jh=Uc*3,Fh=Uc*10;function Rc({value:s,onChange:c,onSend:u,onStop:o,busy:f,disabled:h,disabledReason:g,placeholder:b,who:y,onChangeModel:v,autoFocus:w,style:k,hint:S,busyHint:H,attach:Q=!0}){const[F,C]=x.useState(""),[_,V]=x.useState(!1),[$,W]=x.useState([]),[se,E]=x.useState(!1),B=x.useRef(null),q=x.useRef(null),R=re=>{if(!Q)return;const ke=Array.from(re||[]);ke.length&&W(M=>{const L=new Set(M.map(xc));return[...M,...ke.filter(J=>!L.has(xc(J)))]})},ne=s??F,pe=c??C,fe=!h&&!f&&(ne.trim().length>0||$.length>0);x.useEffect(()=>{const re=B.current;re&&(re.style.height="auto",re.style.height=Math.max(Jh,Math.min(re.scrollHeight,Fh))+"px")},[ne]);const ye=()=>{fe&&(u?.(ne.trim()||($.length?"See the attached files.":""),$),pe(""),W([]))};return a.jsxs("div",{style:{flex:"0 0 auto",background:se?"var(--brand-wash)":"var(--bg-card)",border:`1px solid ${_||se?"var(--brand)":"var(--line-strong)"}`,borderRadius:"var(--r-md)",padding:"var(--sp-2) var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-2)",opacity:h?.6:1,transition:"border-color var(--dur-fast) var(--ease)",...k},onDragOver:re=>{h||(re.preventDefault(),E(!0))},onDragLeave:re=>{re.target===re.currentTarget&&E(!1)},onDrop:re=>{re.preventDefault(),E(!1),h||R(re.dataTransfer.files)},children:[a.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"flex-start"},children:[a.jsx("span",{className:f?"pulse":void 0,style:{marginTop:3,flex:"0 0 auto",display:"inline-flex"},children:a.jsx(te,{name:f?"loading":"steer",size:15,color:"var(--brand)"})}),a.jsx("textarea",{ref:B,rows:3,value:ne,disabled:h,autoFocus:w,placeholder:h?g||"Not available right now.":b||"Ask, think out loud, or describe what you want built…",onChange:re=>pe(re.target.value),onPaste:re=>{re.clipboardData?.files?.length&&(re.preventDefault(),R(re.clipboardData.files))},onFocus:()=>V(!0),onBlur:()=>V(!1),onKeyDown:re=>{(re.metaKey||re.ctrlKey)&&re.key==="Enter"&&(re.preventDefault(),ye())},style:{flex:1,minWidth:0,resize:"none",border:"none",outline:"none",boxShadow:"none",background:"transparent",borderRadius:"var(--r-sm)",color:"var(--ink-0)",font:"inherit",lineHeight:`${Uc}px`,padding:"2px 0",minHeight:Jh,maxHeight:Fh}})]}),$.length>0&&a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:$.map((re,ke)=>a.jsx(Rp,{name:re.name,size:re.size,onRemove:()=>W(M=>M.filter((L,J)=>J!==ke))},xc(re)))}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[a.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:y?`${y.model} via ${y.provider}`:void 0,children:[y&&a.jsxs("span",{style:{fontFamily:"var(--font-mono)",color:"var(--ink-1)"},role:v?"button":void 0,onClick:v,title:v?"Change the planner model in Settings → Models":void 0,...v?{style:{fontFamily:"var(--font-mono)",color:"var(--ink-1)",cursor:"pointer",textDecoration:"underline dotted",textUnderlineOffset:3}}:{},children:[y.model," · ",y.provider.split(" · ")[0],y.costBasis==="free"?" · free":y.costBasis==="unpriced"?" · unpriced":""," — "]}),f?H??"The foreman is looking…":S??"Reads the project, never changes it."]}),a.jsx("span",{style:{marginLeft:"auto"}}),Q&&a.jsx("input",{ref:q,type:"file",multiple:!0,style:{display:"none"},onChange:re=>{R(re.target.files),re.target.value=""}}),Q&&a.jsx(de,{size:"sm",variant:"ghost",icon:"attach",disabled:h,title:"Attach files — or drop them here, or paste an image",onClick:()=>q.current?.click(),children:"Attach"}),f&&o?a.jsx(de,{size:"sm",variant:"danger",icon:"close",onClick:o,title:"Stop the planner and discard the rest of this reply",children:"Stop"}):a.jsx(de,{size:"sm",icon:"send",onClick:ye,disabled:!fe,title:"⌘↵",children:"Send"})]})]})}function Bc({children:s,accent:c,tone:u="card",style:o,onClick:f,title:h}){const g=u==="panel"?"var(--bg-panel)":u==="inset"?"var(--bg-inset)":"var(--bg-card)";return a.jsx("div",{onClick:f,title:h,role:f?"button":void 0,style:{background:g,border:"1px solid var(--line)",borderLeft:c?`var(--accent-w) solid ${c}`:"1px solid var(--line)",borderRadius:"var(--r-sm)",padding:"var(--sp-3)",cursor:f?"pointer":void 0,...o},children:s})}function Vs(s){if(s==="director")return"var(--brand)";if(s==="you")return"var(--ink-0)";const c=/(\d+)/.exec(String(s||""));return`var(--agent-worker-${c?(parseInt(c[1],10)-1)%6+1:1})`}function an({agent:s,size:c="md",style:u}){const o=c==="sm"?"var(--dot-sm)":"var(--dot)";return a.jsx("span",{"aria-hidden":!0,style:{width:o,height:o,borderRadius:"var(--r-pill)",background:Vs(s),flex:"0 0 auto",...u}})}function Op(s){if(s==null)return null;if(typeof s=="object")return s;try{return JSON.parse(s)}catch{return null}}function Ih(s){if(!s)return"";const c=String(s).split("/");return c.length>3?"…/"+c.slice(-3).join("/"):s}function Np(s,c){if(!c)return"";switch(s){case"Write":case"Edit":case"MultiEdit":case"Read":return Ih(c.file_path||c.path);case"Bash":return c.command||"";case"Grep":return`${c.pattern??""}${c.path?" in "+Ih(c.path):""}`;case"Glob":return c.pattern||"";case"WebFetch":case"WebSearch":return c.url||c.query||"";case"spawn_worker":return`${c.id??"worker"} — ${(c.task||"").slice(0,80)}`;case"message_worker":return`${c.id??"worker"} — ${(c.message||"").slice(0,80)}`;case"ask_human":return c.question||"";default:{const u=Object.keys(c)[0];return u?`${u}: ${String(c[u]).slice(0,80)}`:""}}}function bc({text:s,tone:c,max:u=12}){const o=String(s??"").split(`
21
+ `),f=o.slice(0,u),h=c==="add"?"var(--diff-add-bg)":c==="del"?"var(--diff-del-bg)":"transparent",g=c==="add"?"+":c==="del"?"−":" ";return a.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",lineHeight:1.5},children:[f.map((b,y)=>a.jsxs("div",{style:{display:"flex",background:h,padding:"0 8px"},children:[a.jsx("span",{style:{width:14,flex:"0 0 auto",color:c==="add"?"var(--status-good)":c==="del"?"var(--status-critical)":"var(--ink-2)"},children:g}),a.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--ink-0)"},children:b})]},y)),o.length>u&&a.jsxs("div",{style:{padding:"2px 8px",color:"var(--ink-2)"},children:["… ",o.length-u," more lines"]})]})}function vx({tool:s,input:c}){if(!c)return null;if(s==="Write")return a.jsx(bc,{text:c.content,tone:"add"});const u=s==="MultiEdit"?c.edits||[]:[c];return a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:u.map((o,f)=>a.jsxs("div",{children:[a.jsx(bc,{text:o.old_string,tone:"del",max:8}),a.jsx(bc,{text:o.new_string,tone:"add",max:8})]},f))})}const gx=new Set(["spawn_worker","message_worker","ask_human"]);function Hp({tool:s="tool",input:c,body:u,defaultOpen:o=!1,style:f}){const h=c??Op(u),[g,b]=x.useState(o),[y,v]=x.useState(!1),w=gx.has(s),k=h&&(s==="Write"||s==="Edit"||s==="MultiEdit"),S=Np(s,h)||(typeof u=="string"?u.slice(0,120):"");return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,...f},children:[a.jsxs("button",{type:"button",onClick:()=>b(!g),title:g?"Collapse":"Expand",style:{display:"flex",alignItems:"center",gap:8,padding:0,background:"none",border:"none",cursor:"pointer",color:"var(--ink-0)",textAlign:"left",width:"100%",font:"inherit"},children:[a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,padding:"2px 8px 2px 6px",borderRadius:"var(--r-pill)",background:w?"var(--brand-wash-strong)":"var(--bg-inset)",border:`1px solid ${w?"var(--brand)":"var(--line)"}`,color:w?"var(--brand)":"var(--ink-1)",fontSize:"var(--fs-xs)",fontWeight:"var(--fw-semibold)",fontFamily:"var(--font-mono)",whiteSpace:"nowrap",lineHeight:"16px"},children:[a.jsx(te,{name:s,size:12,strokeWidth:2}),s]}),a.jsx("span",{style:{flex:1,minWidth:0,fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",color:"var(--ink-1)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:S}),a.jsx(te,{name:g?"chevronDown":"chevronRight",size:14,color:"var(--ink-2)"})]}),g&&a.jsxs("div",{style:{background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",overflow:"hidden"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderBottom:"1px solid var(--line)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[a.jsx("span",{children:k&&!y?"changes":"payload"}),a.jsx("span",{style:{flex:1}}),k&&a.jsxs("button",{type:"button",onClick:()=>v(!y),style:{display:"inline-flex",alignItems:"center",gap:4,background:"none",border:"none",color:"var(--ink-2)",cursor:"pointer",font:"inherit",padding:0},children:[a.jsx(te,{name:"raw",size:12}),y?"diff":"raw"]})]}),a.jsx("div",{style:{padding:"6px 0",maxHeight:260,overflow:"auto"},children:k&&!y?a.jsx(vx,{tool:s,input:h}):a.jsx("pre",{style:{margin:0,padding:"0 8px",fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--ink-0)"},children:h?JSON.stringify(h,null,2):String(u??"")})})]})]})}const mx=/(`[^`\n]+`|\*\*[^*\n]+\*\*|<[^<>\n]{1,80}>)/g;function Ls(s,c){return s.split(mx).filter(Boolean).map((u,o)=>u.startsWith("`")&&u.endsWith("`")&&u.length>2?a.jsx("code",{style:{fontFamily:"var(--font-mono)",fontSize:"0.92em",background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:4,padding:"0 5px"},children:u.slice(1,-1)},o):u.startsWith("**")&&u.endsWith("**")&&u.length>4?a.jsx("strong",{style:{fontWeight:"var(--fw-semibold)",color:"var(--ink-0)"},children:u.slice(2,-2)},o):c&&u.startsWith("<")&&u.endsWith(">")?a.jsx("span",{style:{background:"var(--brand-wash-strong)",border:"1px dashed var(--brand)",borderRadius:4,padding:"0 5px",color:"var(--ink-0)"},children:u.slice(1,-1)},o):u)}function yx(s){const c=String(s||"").replace(/\r\n?/g,`
22
+ `).split(`
23
+ `),u=[];let o=0;for(;o<c.length;){const f=c[o];if(/^```/.test(f)){const b=f.slice(3).trim(),y=[];for(o++;o<c.length&&!/^```/.test(c[o]);)y.push(c[o++]);o++,u.push({t:"code",lang:b,body:y.join(`
24
+ `)});continue}if(/^>\s?/.test(f)){const b=[];for(;o<c.length&&/^>\s?/.test(c[o]);)b.push(c[o++].replace(/^>\s?/,""));u.push({t:"quote",body:b});continue}if(/^\s*[-*]\s+/.test(f)){const b=[];for(;o<c.length&&/^\s*[-*]\s+/.test(c[o]);)b.push(c[o++].replace(/^\s*[-*]\s+/,""));u.push({t:"list",items:b});continue}const h=/^(#{1,3})\s+(.*)$/.exec(f);if(h){u.push({t:"h",level:h[1].length,body:h[2]}),o++;continue}if(!f.trim()){o++;continue}const g=[];for(;o<c.length&&c[o].trim()&&!/^(```|>|\s*[-*]\s|#{1,3}\s)/.test(c[o]);)g.push(c[o++]);u.push({t:"p",body:g})}return u}function qc({text:s,slots:c=!0,style:u}){const o=yx(s);return a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10,lineHeight:"var(--lh-prose)",color:"var(--ink-prose, var(--ink-0))",...u},children:o.map((f,h)=>f.t==="code"?a.jsxs("pre",{style:{margin:0,padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",lineHeight:"var(--lh)",overflowX:"auto",whiteSpace:"pre",position:"relative"},children:[f.lang&&a.jsx("span",{style:{position:"absolute",top:4,right:8,fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:f.lang}),f.body]},h):f.t==="quote"?a.jsx("blockquote",{style:{margin:0,padding:"2px 0 2px 12px",borderLeft:"2px solid var(--agent-worker)",color:"var(--ink-1)"},children:f.body.map((g,b)=>a.jsx("div",{children:Ls(g,c)},b))},h):f.t==="list"?a.jsx("ul",{style:{margin:0,paddingLeft:20},children:f.items.map((g,b)=>a.jsx("li",{children:Ls(g,c)},b))},h):f.t==="h"?a.jsx("div",{style:{fontWeight:"var(--fw-semibold)",fontSize:f.level===1?"var(--fs-lg)":"var(--fs-md)",color:"var(--ink-0)",marginTop:h?4:0},children:Ls(f.body,c)},h):a.jsx("p",{style:{margin:0},children:f.body.map((g,b)=>a.jsxs(Cn.Fragment,{children:[b>0&&a.jsx("br",{}),Ls(g,c)]},b))},h))})}const Up=new Set(["spawn_worker","message_worker","ask_human"]);function Lc({agent:s,title:c,kind:u="text",body:o,ts:f,to:h,timing:g,dense:b=!1,style:y}){const v=u==="tool";if(v&&b)return a.jsx(Sx,{agent:s,title:c,body:o,ts:f,style:y});if(u==="system"&&!o&&typeof c=="string"&&c.startsWith("result ·"))return a.jsx(bx,{agent:s,title:c,ts:f,style:y});const w=u==="steer",k=u==="result",S=u==="error"?"var(--status-critical)":w?"var(--ink-0)":u==="text"?Vs(s):void 0,H=f?new Date(f).toLocaleTimeString(void 0,{hour12:!1}):null,Q=v?String(c||"tool").replace(/^[^\w]+/,""):null,F=v?null:c;return a.jsxs(Bc,{accent:S,style:{padding:"var(--sp-2) var(--sp-3)",...k?{fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)"}:null,...u==="system"?{color:"var(--ink-1)",fontSize:"var(--fs-sm)"}:null,...y},children:[a.jsxs("div",{style:{fontSize:"var(--fs-xs)",color:u==="error"?"var(--status-critical)":"var(--ink-2)",marginBottom:4,display:"flex",alignItems:"center",gap:6,fontFamily:"var(--font-ui)"},children:[a.jsx(an,{agent:s,size:"sm"}),a.jsx("span",{children:s}),w&&h&&a.jsxs(a.Fragment,{children:[a.jsx(te,{name:"chevronRight",size:11}),a.jsx(an,{agent:h,size:"sm"}),a.jsx("span",{children:h})]}),w&&g&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"·"}),a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[a.jsx(te,{name:g==="now"?"now":"nextTurn",size:11}),g==="now"?"now":"next turn"]})]}),F&&F!==s&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"·"}),a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[u==="error"&&a.jsx(te,{name:"error",size:11,strokeWidth:2.25}),F]})]}),v&&Up.has(Q)&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"·"}),a.jsx("span",{style:{color:"var(--brand)"},children:"orchestration"})]}),H&&a.jsx("span",{style:{marginLeft:"auto",fontVariantNumeric:"tabular-nums"},children:H})]}),v?a.jsx(Hp,{tool:Q,body:o}):u==="text"&&typeof o=="string"?a.jsx(qc,{text:o}):a.jsx(xx,{body:o})]})}const Ph=12;function xx({body:s}){const[c,u]=x.useState(!1),o=typeof s=="string"?s:null,f=o?o.split(`
25
+ `):[];if(!(o!==null&&(f.length>Ph+4||o.length>1600)))return a.jsx("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s});const g=c?o:f.slice(0,Ph).join(`
26
+ `).slice(0,1600);return a.jsxs("div",{children:[a.jsxs("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[g,!c&&`
27
+ …`]}),a.jsx("button",{type:"button",onClick:()=>u(!c),style:{marginTop:4,padding:0,background:"none",border:"none",cursor:"pointer",font:"inherit",fontFamily:"var(--font-ui)",fontSize:"var(--fs-xs)",color:"var(--brand)"},children:c?"Show less":`Show all · ${f.length} lines`})]})}function bx({agent:s,title:c,ts:u,style:o}){const f=u?new Date(u).toLocaleTimeString(void 0,{hour12:!1}):null;return a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px var(--sp-2)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",whiteSpace:"nowrap",overflow:"hidden",...o},children:[a.jsx(an,{agent:s,size:"sm"}),a.jsx("span",{children:s}),a.jsx("span",{children:"·"}),a.jsx("span",{children:c.replace(/^result · /,"turn ended · ")}),f&&a.jsx("span",{style:{marginLeft:"auto",fontVariantNumeric:"tabular-nums"},children:f})]})}function Sx({agent:s,title:c,body:u,ts:o,style:f}){const h=String(c||"tool").replace(/^[^\w]+/,""),g=Np(h,Op(u))||(typeof u=="string"?u:""),b=String(g).replace(/\s+/g," ").slice(0,90),y=o?new Date(o).toLocaleTimeString(void 0,{hour12:!1}):null;return a.jsxs("div",{title:typeof u=="string"?u.slice(0,2e3):void 0,style:{display:"flex",alignItems:"center",gap:6,padding:"1px var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",whiteSpace:"nowrap",overflow:"hidden",minWidth:0,...f},children:[a.jsx(an,{agent:s,size:"sm"}),a.jsx(te,{name:h,size:12}),a.jsx("span",{style:{color:Up.has(h)?"var(--brand)":"var(--ink-1)",flex:"0 0 auto"},children:h}),a.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:b}),y&&a.jsx("span",{style:{marginLeft:"auto",fontVariantNumeric:"tabular-nums",flex:"0 0 auto"},children:y})]})}function Ml({icon:s,label:c,onClick:u,active:o,size:f="md",disabled:h,style:g}){const[b,y]=x.useState(!1),v=f==="sm"?26:32;return a.jsx("button",{type:"button",title:c,"aria-label":c,"aria-pressed":o,disabled:h,onClick:u,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),style:{width:v,height:v,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,borderRadius:"var(--r-sm)",cursor:h?"default":"pointer",background:o?"var(--bg-card)":b?"var(--bg-hover)":"transparent",border:`1px solid ${o?"var(--line-strong)":"transparent"}`,color:o||b?"var(--ink-0)":"var(--ink-1)",opacity:h?.5:1,transition:"background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease)",...g},children:a.jsx(te,{name:s,size:f==="sm"?14:16})})}function Zs(s){if(!s)return"";let c=String(s).replace(/^\/(Users|home)\/[^/]+/,"~");const u=c.split("/");return u.length>4&&(c=[u[0],u[1],"…",...u.slice(-2)].join("/")),c}function Bp({size:s=24,mono:c,style:u}){const o=c?"currentColor":"var(--brand)",f=c?"currentColor":"var(--agent-worker)";return a.jsxs("svg",{viewBox:"0 0 32 32",width:s,height:s,"aria-hidden":!0,style:{flex:"0 0 auto",display:"block",...u},children:[a.jsx("rect",{x:"5",y:"4",width:"6",height:"24",rx:"3",fill:o}),a.jsx("rect",{x:"5",y:"4",width:"22",height:"6",rx:"3",fill:o}),a.jsx("rect",{x:"5",y:"13",width:"15",height:"6",rx:"3",fill:f,opacity:c?.55:1})]})}function jx({size:s=22,tagline:c,mono:u,style:o}){return a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:Math.round(s*.4),...o},children:[a.jsx(Bp,{size:s,mono:u}),a.jsx("span",{style:{fontSize:Math.round(s*.82),fontWeight:"var(--fw-semibold)",letterSpacing:"-0.01em",color:u?"currentColor":"var(--ink-0)",lineHeight:1},children:"Foreman"}),c&&a.jsx("span",{style:{color:"var(--ink-2)",fontSize:"var(--fs-sm)",marginLeft:4},children:c})]})}function kx({folder:s}){const[c,u]=Cn.useState(!1),[o,f]=Cn.useState(!1),h=()=>{navigator.clipboard&&navigator.clipboard.writeText(s).catch(()=>{}),u(!0),setTimeout(()=>u(!1),1200)};return a.jsxs("button",{type:"button",onClick:h,title:c?"Copied":s,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{display:"inline-flex",alignItems:"center",gap:6,minWidth:0,maxWidth:420,padding:"3px 8px",borderRadius:999,border:"1px solid transparent",background:o?"var(--bg-inset, rgba(255,255,255,.06))":"transparent",color:c?"var(--ink-1)":"var(--ink-2)",cursor:"pointer",font:"inherit"},children:[a.jsx(te,{name:"folder",size:13}),a.jsx("span",{style:{fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c?"copied":Zs(s)})]})}function qp({mode:s="fleet",title:c,subtitle:u="mission control",folder:o,onBack:f,theme:h,onToggleTheme:g,onSettings:b,version:y,search:v,children:w,style:k}){const S=s==="fleet";return a.jsxs("header",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",padding:S?"var(--sp-3) var(--sp-5)":"var(--sp-2) var(--sp-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--line)",flex:"0 0 auto",minHeight:48,...k},children:[S?a.jsx(jx,{size:22,tagline:u}):a.jsxs("nav",{"aria-label":"Breadcrumb",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",minWidth:0},children:[a.jsx("button",{type:"button",onClick:f,title:"Back to the fleet","aria-label":"Back to the fleet",style:{background:"none",border:0,padding:0,cursor:"pointer",display:"inline-flex",alignItems:"center"},children:a.jsx(Bp,{size:22})}),a.jsx("button",{type:"button",onClick:f,style:{background:"none",border:0,padding:0,font:"inherit",color:"var(--ink-2)",cursor:"pointer"},children:"Fleet"}),a.jsx(te,{name:"chevronRight",size:14,color:"var(--ink-3, var(--ink-2))"}),a.jsx("span",{style:{fontWeight:"var(--fw-semibold)",whiteSpace:"nowrap"},children:c}),o&&a.jsx(kx,{folder:o})]}),v&&a.jsx("div",{style:{flex:"1 1 auto",display:"flex",justifyContent:"center",minWidth:0,padding:"0 var(--sp-3)"},children:v}),a.jsxs("div",{style:{marginLeft:v?0:"auto",display:"flex",alignItems:"center",gap:"var(--sp-3)",flexWrap:"wrap",justifyContent:"flex-end"},children:[w,g&&a.jsx(Ml,{icon:h==="light"?"moon":"sun",label:h==="light"?"Switch to dark theme":"Switch to light theme",onClick:g}),b&&a.jsx(Ml,{icon:"settings",label:"Settings",onClick:b}),y&&a.jsxs("a",{href:"https://github.com/amenophis1er/foreman/releases",target:"_blank",rel:"noopener noreferrer",title:`Foreman ${y} — release notes`,style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",textDecoration:"none",whiteSpace:"nowrap"},children:["v",y]})]})]})}function st({children:s}){return a.jsx("div",{style:{color:"var(--ink-2)",fontSize:"var(--fs-sm)"},children:s})}function ln({children:s,style:c}){return a.jsx("h2",{style:{margin:"0 0 var(--sp-2)",fontSize:"var(--fs-xs)",fontWeight:"var(--fw-semibold)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)",color:"var(--ink-2)",...c},children:s})}const ep={readonly:{icon:"readonly",color:"var(--status-warning)"},disconnected:{icon:"disconnected",color:"var(--status-serious)"},error:{icon:"error",color:"var(--status-critical)"},caution:{icon:"caution",color:"var(--status-serious)"}};function It({tone:s="readonly",children:c,inline:u,style:o}){const f=ep[s]??ep.readonly;return u?a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,color:f.color,fontSize:"var(--fs-sm)",...o},children:[a.jsx(te,{name:f.icon,size:13,strokeWidth:2}),c]}):a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"var(--sp-1) var(--sp-3)",background:"var(--bg-inset)",borderBottom:"1px solid var(--line)",fontSize:"var(--fs-sm)",color:"var(--ink-1)",...o},children:[a.jsx(te,{name:f.icon,size:14,color:f.color}),c]})}function Lp(s,c=Date.now()){const u=Math.max(0,Math.round((c-s)/1e3));if(u<60)return`${u}s`;const o=Math.floor(u/60);if(o<60)return`${o}m`;const f=Math.floor(o/60);return f<24?o%60?`${f}h ${o%60}m`:`${f}h`:`${Math.floor(f/24)}d`}const wx={permission:"approval",question:"director asks",planner:"the planner is asking",summary:"needs you"};function tp(s,c){return`${s} ${c}${s>1?"s":""}`}function zx({item:s,onPermission:c,onAnswer:u,onPlanner:o,onOpen:f}){const[h,g]=x.useState(!1),[b,y]=x.useState(""),[v,w]=x.useState(!1),[k,S]=x.useState("");x.useEffect(()=>{g(!1),y(""),w(!1),S("")},[s.id]);const H=async $=>{if(!h){g(!0),y("");try{const W=await $();W&&(y(W),g(!1))}catch(W){y(W instanceof Error?W.message:String(W)),g(!1)}}},Q=$=>s.kind==="planner"?H(()=>o(s,$)):H(()=>u(s,$)),F=()=>{const $=k.trim();$&&Q($)},C=Array.isArray(s.options)&&s.options.length>0,_=s.kind==="question"||s.kind==="planner",V=_&&(v||!C);return a.jsxs("div",{className:h?void 0:"pulse",style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)",padding:"var(--sp-3) var(--sp-4)",background:"var(--brand-wash-strong)",border:"1px solid var(--status-warning)",borderLeft:"var(--accent-w) solid var(--status-warning)",borderRadius:"var(--r-md)",opacity:h?.7:1,transition:"opacity var(--dur-fast) var(--ease)"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--sp-2)",minWidth:0,fontSize:"var(--fs-sm)"},children:[a.jsx(te,{name:s.kind==="permission"?"approval":s.kind==="summary"?"needsYou":"question",size:14,strokeWidth:2,color:"var(--status-warning)",style:{alignSelf:"center",flex:"0 0 auto"}}),a.jsx("span",{style:{fontWeight:"var(--fw-semibold)",color:"var(--ink-0)",flex:"0 0 auto"},children:s.projectName}),a.jsx("span",{style:{color:"var(--status-warning)",fontWeight:"var(--fw-medium)",flex:"0 0 auto"},children:wx[s.kind]??s.kind}),a.jsx("span",{title:s.text,style:{color:"var(--ink-0)",minWidth:0,flex:"1 1 auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.text}),typeof s.since=="number"&&a.jsxs("span",{style:{color:"var(--ink-2)",fontSize:"var(--fs-xs)",fontVariantNumeric:"tabular-nums",flex:"0 0 auto"},children:["waiting ",Lp(s.since)]})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[s.kind==="permission"&&a.jsxs(a.Fragment,{children:[a.jsx(de,{size:"sm",variant:"good",disabled:h,onClick:()=>{H(()=>c(s,"allow"))},children:"Allow"}),a.jsx(de,{size:"sm",variant:"danger",disabled:h,onClick:()=>{H(()=>c(s,"deny"))},children:"Deny"})]}),_&&C&&s.options.map(($,W)=>a.jsxs("button",{type:"button",disabled:h,onClick:()=>{Q($)},title:W===0?"Recommended":void 0,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"4px 10px",borderRadius:"var(--r-sm)",cursor:h?"default":"pointer",font:"inherit",fontSize:"var(--fs-sm)",textAlign:"left",maxWidth:360,background:"var(--bg-card)",border:"1px solid var(--line-strong)",color:"var(--ink-0)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[W===0&&a.jsx("span",{style:{color:"var(--status-warning)",fontSize:"var(--fs-xs)"},children:"★"}),$]},$)),_&&C&&!v&&a.jsx(de,{size:"sm",variant:"ghost",disabled:h,onClick:()=>w(!0),children:"type…"}),V&&a.jsxs("form",{onSubmit:$=>{$.preventDefault(),F()},style:{display:"flex",alignItems:"center",gap:6,flex:"1 1 16rem",minWidth:0},children:[a.jsx("input",{autoFocus:v,value:k,disabled:h,placeholder:s.kind==="planner"?"Answer the planner…":"Answer the director…",onChange:$=>S($.target.value),onKeyDown:$=>{$.key==="Escape"&&C&&(w(!1),S(""))},style:{flex:"1 1 auto",minWidth:0,font:"inherit",fontSize:"var(--fs-sm)",padding:"4px 8px",borderRadius:"var(--r-sm)",background:"var(--bg-card)",border:"1px solid var(--line-strong)",color:"var(--ink-0)",outline:"none"}}),a.jsx(de,{size:"sm",type:"submit",icon:"send",disabled:h||!k.trim(),children:"Send"})]}),a.jsx("span",{style:{marginLeft:"auto",flex:"0 0 auto"},children:a.jsx(de,{size:"sm",variant:"ghost",onClick:()=>f?.(s.projectId),title:"Open the project for the full context",children:"open"})})]}),b&&a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"var(--fs-xs)",color:"var(--text-danger)"},children:[a.jsx(te,{name:"caution",size:12,strokeWidth:2}),b]})]})}function Tx({items:s=[],onPermission:c,onAnswer:u,onPlanner:o,onOpen:f,style:h}){return s.length?a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)",...h},children:s.map(g=>a.jsx(zx,{item:g,onPermission:c,onAnswer:u,onPlanner:o,onOpen:f},`${g.projectId}:${g.kind}:${g.id??""}`))}):null}function Mx({approvals:s=0,questions:c=0,planner:u=!1}){const o=[];s>0&&o.push(tp(s,"approval"));const f=u?c-1:c;return f>0&&o.push(tp(f,"question")),u&&o.push("the planner is asking"),o.join(", ")}function Ex(s){const c=Math.max(0,Math.round(Number(s)||0)/1e3);if(c<60)return`${Math.round(c)}s`;const u=Math.round(c/60);return u<60?`${u}m`:`${Math.floor(u/60)}h ${String(u%60).padStart(2,"0")}m`}function El(s){return s>=1e6?`${(s/1e6).toFixed(1)}m`:s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}const _x=s=>s?s.inputTokens+s.outputTokens+s.cacheReadTokens+s.cacheWriteTokens:0,Cx="repeating-linear-gradient(-45deg, var(--line-strong) 0 3px, transparent 3px 7px)";function Yp({spent:s,budget:c,costBasis:u="priced",usage:o=null,turns:f,elapsedMs:h,detail:g=!1,style:b}){const y=typeof h=="number"&&h>0?` · ${Ex(h)}`:"";if(s=Number(s)||0,c=Number(c)||0,u!=="priced"){const S=u==="unpriced",H=_x(o);return a.jsxs("div",{title:S?"Real spend, on an account Foreman cannot price — no table for this endpoint, or a plan being drawn down. Check the provider for the bill; turns and tokens are all that is known here.":"Runs on hardware you already own, so nothing is billed per token. Turns and tokens are the only real units.",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",minWidth:170,...b},children:[a.jsx("div",{style:{flex:1,height:"var(--meter-h)",background:"var(--bg-inset)",borderRadius:2,overflow:"hidden",backgroundImage:S?Cx:void 0}}),a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:"var(--fs-sm)",color:"var(--ink-1)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:[g?`${El(o?.inputTokens??0)} in · ${El(o?.outputTokens??0)} out`:`${El(H)} tok`,typeof f=="number"?` · ${f} turn${f===1?"":"s"}`:"",y]})]})}const v=c>0?Math.min(s/c,1):0,w=v>=.9?"critical":v>=.7?"warning":"ok",k=w==="critical"?"var(--status-critical)":w==="warning"?"var(--status-warning)":"var(--brand)";return a.jsxs("div",{title:`$${s.toFixed(2)} spent of $${c.toFixed(2)} budget`,style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",minWidth:170,...b},children:[a.jsx("div",{style:{flex:1,height:"var(--meter-h)",background:"var(--bg-inset)",borderRadius:2,overflow:"hidden"},children:a.jsx("div",{style:{width:`${v*100}%`,height:"100%",background:k,transition:"width var(--dur-meter)"}})}),a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:"var(--fs-sm)",color:"var(--ink-1)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:[w!=="ok"&&a.jsx(te,{name:w,size:12,strokeWidth:2.25,color:k}),"$",s.toFixed(2)," / $",c.toFixed(0),y]})]})}function Ax({name:s,folder:c,title:u,mission:o,activity:f,costUsd:h,budgetUsd:g,costBasis:b,usage:y,turns:v,directorModel:w,workerModel:k,createdAt:S,onOpen:H,style:Q}){const[F,C]=x.useState(!1),_=[w,k].filter(Boolean);return a.jsxs("div",{role:"button",tabIndex:0,onClick:H,onKeyDown:V=>{(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),H?.())},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),style:{display:"grid",gridTemplateColumns:"minmax(9rem, 12rem) minmax(0, 1fr) minmax(11rem, 15rem) auto",gap:"var(--sp-4)",alignItems:"center",padding:"var(--sp-3) var(--sp-4)",cursor:"pointer",background:F?"var(--bg-hover)":"transparent",borderLeft:`var(--accent-w) solid ${F?"var(--brand)":"transparent"}`,transition:"background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease)",...Q},children:[a.jsxs("div",{style:{minWidth:0},children:[a.jsx("div",{style:{fontSize:"var(--fs-md)",fontWeight:"var(--fw-semibold)",color:"var(--ink-0)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}),a.jsx("div",{title:c,style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Zs(c)})]}),a.jsxs("div",{style:{minWidth:0},children:[a.jsx("div",{title:o,style:{fontSize:"var(--fs-md)",color:"var(--ink-0)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u||o}),f&&a.jsx("div",{className:"ticker",title:f,style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f},f)]}),a.jsx(Yp,{spent:h,budget:g,costBasis:b,usage:y,turns:v}),a.jsxs("div",{style:{textAlign:"right",fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:[_.length>0&&a.jsx("div",{title:"director · worker",style:{maxWidth:"16rem",overflow:"hidden",textOverflow:"ellipsis"},children:_.join(" · ")}),typeof S=="number"&&a.jsx("div",{children:Lp(S)})]})]})}function Dx(s){return new Date(s).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Sc(){return a.jsx("span",{style:{color:"var(--ink-2)",opacity:.6},children:"·"})}function Rx({name:s,folder:c,lastRun:u,onOpen:o,onUnlink:f,style:h}){const[g,b]=x.useState(!1),[y,v]=x.useState(!1),w=u?.usage?u.usage.inputTokens+u.usage.outputTokens:null;return a.jsxs("article",{role:"button",tabIndex:0,onClick:o,onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),o?.())},onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),style:{background:"var(--bg-card)",borderRadius:"var(--r-md)",cursor:"pointer",border:`1px solid ${g?"var(--line-strong)":"var(--line)"}`,padding:"var(--sp-3) var(--sp-4)",display:"flex",flexDirection:"column",gap:6,minWidth:0,transition:"border-color var(--dur-fast) var(--ease)",...h},children:[a.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--sp-2)",minWidth:0},children:[a.jsx("span",{style:{fontSize:"var(--fs-md)",fontWeight:"var(--fw-semibold)",color:"var(--ink-0)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}),a.jsx("span",{title:c,style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginLeft:"auto"},children:Zs(c)})]}),u?a.jsxs(a.Fragment,{children:[a.jsx("div",{title:u.mission,style:{fontSize:"var(--fs-sm)",color:"var(--ink-1)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.title||u.mission}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums"},children:[a.jsx(Tl,{status:u.status}),u.createdAt&&a.jsxs(a.Fragment,{children:[a.jsx(Sc,{}),Dx(u.createdAt)]}),u.costBasis==="priced"?a.jsxs(a.Fragment,{children:[a.jsx(Sc,{}),"$",(Number(u.costUsd)||0).toFixed(2)]}):w!==null?a.jsxs(a.Fragment,{children:[a.jsx(Sc,{}),El(w)," tok"]}):null]})]}):a.jsx("div",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-2)"},children:"No missions yet — open to compose one."}),a.jsx("div",{style:{display:"flex",justifyContent:"flex-end",height:14,marginTop:-2},children:a.jsxs("button",{type:"button",tabIndex:g?0:-1,onClick:k=>{k.stopPropagation(),f?.()},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),title:"Unlink project (run history is kept)",style:{display:"inline-flex",alignItems:"center",gap:4,background:"none",border:"none",cursor:"pointer",padding:0,font:"inherit",fontSize:"var(--fs-xs)",color:y?"var(--ink-0)":"var(--ink-2)",opacity:g?1:0,pointerEvents:g?"auto":"none",transition:"opacity var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease)"},children:[a.jsx(te,{name:"unlink",size:11}),"Unlink"]})})]})}function Ox({onClick:s,style:c}){const[u,o]=x.useState(!1);return a.jsxs("div",{role:"button",onClick:s,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{border:`1px dashed ${u?"var(--ink-2)":"var(--line-strong)"}`,borderRadius:"var(--r-md)",minHeight:"var(--card-min-h)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--sp-2)",cursor:"pointer",color:u?"var(--ink-0)":"var(--ink-1)",background:u?"var(--bg-hover)":"transparent",transition:"border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease)",...c},children:[a.jsx(te,{name:"add",size:22,strokeWidth:1.5}),a.jsx("span",{style:{fontSize:"var(--fs-sm)"},children:"Link a project"}),a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"or drop a folder anywhere"})]})}function Ws({width:s=480,children:c,onClose:u,dismissible:o=!0,style:f}){return a.jsx("div",{onClick:h=>{o&&h.target===h.currentTarget&&u?.()},style:{position:"fixed",inset:0,background:"var(--scrim)",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"},children:a.jsx("div",{style:{width:s,maxHeight:"70vh",display:"flex",flexDirection:"column",background:"var(--bg-panel)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-md)",overflow:"hidden",...f},children:c})})}function Yc({children:s,style:c}){return a.jsx("div",{style:{padding:"var(--sp-3)",borderBottom:"1px solid var(--line)",wordBreak:"break-all",...c},children:s})}function Js({children:s,style:c}){return a.jsx("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"center",padding:"var(--sp-3)",borderTop:"1px solid var(--line)",...c},children:s})}function Je({value:s,onChange:c,placeholder:u,type:o="text",min:f,max:h,step:g,width:b,mono:y,prefix:v,autoFocus:w,onKeyDown:k,style:S}){const H=a.jsx("input",{type:o,min:f,max:h,step:g,value:s,autoFocus:w,placeholder:u,onKeyDown:k,onChange:Q=>c?.(o==="number"?Number(Q.target.value):Q.target.value),style:{width:v?"100%":b??"100%",background:v?"transparent":"var(--bg-card)",border:v?"none":"1px solid var(--line-strong)",borderRadius:"var(--r-sm)",padding:v?"6px 9px 6px 0":"6px 9px",color:"var(--ink-0)",outline:v?"none":void 0,fontFamily:y?"var(--font-mono)":"var(--font-ui)",...v?null:S}});return v?a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",width:b??"100%",boxSizing:"border-box",background:"var(--bg-card)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-sm)",paddingLeft:9,...S},children:[a.jsx("span",{style:{color:"var(--ink-2)",marginRight:4,userSelect:"none"},children:v}),H]}):H}function np({children:s,icon:c,onClick:u}){const[o,f]=x.useState(!1);return a.jsxs("div",{role:"button",onClick:u,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{display:"flex",alignItems:"center",gap:8,padding:"7px 12px",cursor:"pointer",fontSize:"var(--fs-md)",background:o?"var(--bg-card)":"transparent",transition:"background var(--dur-fast) var(--ease)"},children:[a.jsx(te,{name:c,size:15,color:"var(--ink-1)"}),s]})}function Nx({path:s="…",parent:c,dirs:u=[],error:o,onNavigate:f,onCreate:h,onPick:g,onClose:b}){const[y,v]=x.useState(!1),[w,k]=x.useState("");return a.jsxs(Ws,{width:480,onClose:b,children:[a.jsx(Yc,{style:{font:"var(--fs-sm) var(--font-mono)",color:"var(--brand)"},children:s}),a.jsxs("div",{style:{overflowY:"auto",flex:1},children:[c&&a.jsx(np,{icon:"parent",onClick:()=>f?.(c),children:".."}),u.map(S=>a.jsx(np,{icon:"folder",onClick:()=>f?.(`${s}${s.endsWith("/")?"":"/"}${S}`),children:S},S)),u.length===0&&a.jsx("div",{style:{padding:"var(--sp-3)",color:"var(--ink-2)",fontSize:"var(--fs-sm)"},children:"No subfolders."})]}),y&&a.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"center",padding:"var(--sp-2) var(--sp-3)",borderTop:"1px solid var(--line)"},children:[a.jsx(Je,{autoFocus:!0,placeholder:"New folder name",value:w,onChange:k,onKeyDown:S=>{S.key==="Enter"&&h?.(w)},style:{flex:1}}),a.jsx(de,{variant:"good",onClick:()=>h?.(w),children:"Create"})]}),o&&a.jsx("div",{style:{padding:"4px var(--sp-3)"},children:a.jsx(It,{tone:"error",inline:!0,style:{fontSize:"var(--fs-xs)"},children:o})}),a.jsxs(Js,{children:[a.jsx(de,{icon:"add",onClick:()=>v(!y),title:"Create a subfolder here",children:"New folder"}),a.jsx("span",{style:{flex:1}}),a.jsx(de,{onClick:b,children:"Cancel"}),a.jsx(de,{variant:"primary",onClick:()=>g?.(s),children:"Select this folder"})]})]})}function Hx({name:s,matches:c,onPick:u,onClose:o}){const[f,h]=x.useState(null);return a.jsxs(Ws,{width:520,onClose:o,style:{maxHeight:"60vh"},children:[a.jsxs(Yc,{children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontWeight:"var(--fw-semibold)"},children:[a.jsx(te,{name:"folder",size:16,color:"var(--ink-1)"}),s]}),a.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",marginTop:2},children:"Browsers hide dropped folders' full paths — pick the matching location."})]}),a.jsxs("div",{style:{overflowY:"auto",flex:1},children:[c==null&&a.jsx("div",{style:{padding:"var(--sp-3)",color:"var(--ink-2)",fontSize:"var(--fs-sm)"},children:"Searching your home folder…"}),c?.map(g=>a.jsx("div",{role:"button",onClick:()=>u?.(g),onMouseEnter:()=>h(g),onMouseLeave:()=>h(null),style:{padding:"8px 12px",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",background:f===g?"var(--bg-card)":"transparent",transition:"background var(--dur-fast) var(--ease)"},children:g},g)),c?.length===0&&a.jsxs("div",{style:{padding:"var(--sp-3)",color:"var(--ink-2)",fontSize:"var(--fs-sm)"},children:["No folder named “",s,"” found under your home directory — use the folder picker instead."]})]}),a.jsx(Js,{style:{justifyContent:"flex-end"},children:a.jsx(de,{onClick:o,children:"Cancel"})})]})}function Ux({children:s="Drop a folder to link it"}){return a.jsxs("div",{style:{position:"absolute",inset:8,zIndex:5,pointerEvents:"none",border:"2px dashed var(--brand)",borderRadius:"var(--r-md)",background:"var(--brand-wash)",display:"flex",alignItems:"center",gap:10,justifyContent:"center",color:"var(--brand)",fontSize:"var(--fs-lg)"},children:[a.jsx(te,{name:"folder",size:20}),s]})}function Bx({title:s,body:c,confirmLabel:u="Confirm",tone:o="danger",icon:f,onConfirm:h,onCancel:g}){return a.jsxs(Ws,{width:420,onClose:g,children:[a.jsx(Yc,{children:a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontWeight:"var(--fw-semibold)"},children:[f&&a.jsx(te,{name:f,size:16,color:o==="danger"?"var(--status-critical)":"var(--ink-1)"}),s]})}),a.jsx("div",{style:{padding:"var(--sp-3)",fontSize:"var(--fs-md)",color:"var(--ink-1)",lineHeight:"var(--lh-prose)"},children:c}),a.jsxs(Js,{style:{justifyContent:"flex-end"},children:[a.jsx(de,{onClick:g,children:"Cancel"}),a.jsx(de,{variant:o,onClick:h,children:u})]})]})}const lp="foreman.fleet.desk";function qx(){const[s,c]=x.useState(()=>{try{return localStorage.getItem(lp)!=="closed"}catch{return!0}});return[s,()=>c(o=>{try{localStorage.setItem(lp,o?"closed":"open")}catch{}return!o})]}function Lx({onSettings:s,open:c,onToggle:u}){const o=_p(zm),[f,h]=x.useState(null),g=x.useRef(null),b=o.entries.filter(S=>S.kind!=="tool"),[y,v]=x.useState(!1),w=x.useRef(0);x.useEffect(()=>{c?(w.current=b.length,v(!1)):b.length>w.current&&!o.thinking&&v(!0)},[c,b.length,o.thinking]),x.useEffect(()=>{c&&g.current?.scrollIntoView({block:"end"})},[b.length,o.thinking,c]);const k=async S=>h(await o.send(S));return c?a.jsxs("aside",{style:{width:"clamp(22rem, 28vw, 30rem)",flex:"0 0 auto",minHeight:0,display:"flex",flexDirection:"column",borderLeft:"1px solid var(--line)",background:"var(--bg-panel)"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--line)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",flex:"0 0 auto"},children:[a.jsx("span",{style:{color:"var(--ink-0)",fontSize:"var(--fs-sm)",fontWeight:"var(--fw-semibold)"},children:"Front desk"}),a.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:"the same conversation as your phone"}),a.jsxs("span",{style:{marginLeft:"auto",display:"inline-flex",gap:"var(--sp-1)",alignItems:"center",flex:"0 0 auto"},children:[o.costUsd>0&&a.jsxs("span",{title:"What this conversation has cost. Not charged to any mission.",style:{fontVariantNumeric:"tabular-nums",marginRight:"var(--sp-1)"},children:["$",o.costUsd.toFixed(2)]}),b.length>0&&!o.thinking&&a.jsx(de,{variant:"ghost",size:"sm",onClick:()=>{o.clear()},title:"Forget this conversation; the next message starts fresh",children:"Forget"}),a.jsx(Ml,{icon:"chevronRight",label:"Fold the front desk away",onClick:u})]})]}),a.jsxs("div",{style:{flex:1,minHeight:0,overflowY:"auto",padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[b.length===0&&!o.thinking&&a.jsx(st,{children:"Ask how things are going, or say what you want started where. It knows every project, can open a planning conversation, propose a mission, or pass a note to a running director. It never starts a run or answers an approval for you."}),b.map(S=>a.jsx(Lc,{agent:S.agent,title:S.title,kind:S.kind,body:S.body,ts:S.ts},S.id)),a.jsx("div",{ref:g})]}),a.jsxs("div",{style:{flex:"0 0 auto",padding:"var(--sp-2) var(--sp-3) var(--sp-3)",borderTop:"1px solid var(--line)"},children:[a.jsx(Rc,{busy:o.thinking,who:o.who,placeholder:"How is everything going?",attach:!1,hint:"Knows the fleet. Never starts a run or answers for you.",busyHint:"The front desk is looking…",onSend:S=>{k(S)},onStop:()=>{o.stop()},onChangeModel:s}),f&&a.jsx(It,{tone:"error",inline:!0,style:{marginTop:4},children:f})]})]}):a.jsx("aside",{style:{flex:"0 0 auto",borderLeft:"1px solid var(--line)",background:"var(--bg-panel)",display:"flex",flexDirection:"column",alignItems:"center",padding:"var(--sp-2) 4px"},children:a.jsxs("button",{type:"button",onClick:u,title:o.thinking?"The front desk is replying — open it":y?"The front desk answered — open it":"Open the front desk (the same conversation as your phone)","aria-label":"Open the front desk",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8,background:"none",border:0,padding:"6px 4px",cursor:"pointer",color:"var(--ink-2)",borderRadius:"var(--r-sm)",position:"relative"},children:[a.jsx(te,{name:"chevronLeft",size:14}),a.jsx("span",{style:{writingMode:"vertical-rl",fontSize:"var(--fs-xs)",letterSpacing:".06em",textTransform:"uppercase"},children:"Front desk"}),(y||o.thinking)&&a.jsx("span",{"aria-hidden":!0,style:{position:"absolute",top:4,right:2,width:7,height:7,borderRadius:"50%",background:o.thinking?"var(--ink-2)":"var(--brand)"}})]})})}function Yx(s,c){const u=s.activeRun??s.lastRun;return[s.name,s.folder,u?.title,u?.mission].some(o=>o?.toLowerCase().includes(c))}function $x(s){const c=[];for(const u of s){if(Array.isArray(u.needs)){const h=[...u.needs].sort((g,b)=>(g.since??0)-(b.since??0));for(const g of h)c.push({...g,projectId:u.id,projectName:u.name});continue}const o=u.pendingPermissions||0,f=u.pendingQuestions||0;o+f!==0&&c.push({projectId:u.id,projectName:u.name,kind:"summary",text:Mx({approvals:o,questions:f,planner:!!u.plannerQuestion})})}return c}async function Gx(s){return s.ok?null:(await s.json().catch(()=>({}))).error??(s.status===404?"already answered or timed out":`HTTP ${s.status}`)}function Xx(s){const[c,u]=x.useState(!1),[o,f]=x.useState(null),[h,g]=x.useState(""),b=async v=>{g("");const w=await Fe.browse(v);w.ok&&f(await w.json())},y=async v=>{if(!o)return;g("");const w=await Fe.mkdir(o.path,v);w.ok?await b((await w.json().catch(()=>null))?.path??o.path):g((await w.json()).error)};return{open:c,show:()=>{u(!0),b()},close:()=>{u(!1),f(null)},props:o&&{path:o.path,parent:o.parent,dirs:o.dirs,error:h,onNavigate:v=>{b(v)},onCreate:v=>{y(v)},onPick:v=>{u(!1),f(null),s(v)}}}}const jc={display:"flex",flexDirection:"column",gap:"var(--sp-2)"};function Qx({projects:s,connected:c,activity:u,auth:o,onOpen:f,onOpenRun:h,refresh:g,theme:b,onToggleTheme:y,onSettings:v,query:w="",onQuery:k,search:S}){const[H,Q]=x.useState(!1),[F,C]=qx(),[_,V]=x.useState(null),[$,W]=x.useState(null),se=async m=>{const N=await Fe.linkProject(m);N.ok&&(g(),f((await N.json()).project.id))},E=Xx(m=>{se(m)}),B=w.trim().toLowerCase(),q=B?s.filter(m=>Yx(m,B)):s,R=$x(q),ne=q.filter(m=>m.activeRun).sort((m,N)=>(N.lastActivityAt??0)-(m.lastActivityAt??0)),pe=q.filter(m=>!m.activeRun),fe=s.filter(m=>m.activeRun).length,ye=s.reduce((m,N)=>m+(Array.isArray(N.needs)?N.needs.length:(N.pendingPermissions||0)+(N.pendingQuestions||0)),0),re=fe===0&&ye===0,ke=re&&s.length>0?"all quiet":[fe>0?`${fe} running`:null,ye>0?`${ye} needs you`:null].filter(Boolean).join(" · "),M=async m=>{m.preventDefault(),Q(!1);const N=m.dataTransfer.items[0]?.webkitGetAsEntry?.();if(!N?.isDirectory)return;V({name:N.name,matches:null});const Z=await Fe.locate(N.name);V({name:N.name,matches:Z.ok?(await Z.json()).matches:[]})},L=async m=>{const N=await Gx(await m);return g(),N},J=(m,N)=>L(Fe.permission(m.id,N)),ve=(m,N)=>L(Fe.answer(m.id,N)),Se=(m,N)=>L(fetch("/chat/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectId:m.projectId,id:m.id,answers:{[m.text]:N}})}));return a.jsxs("div",{style:{height:"100%",overflow:"hidden",position:"relative",display:"flex",flexDirection:"column"},onDragOver:m=>{m.preventDefault(),Q(!0)},onDragLeave:m=>{m.target===m.currentTarget&&Q(!1)},onDrop:m=>{M(m)},children:[H&&a.jsx(Ux,{}),a.jsxs(qp,{mode:"fleet",subtitle:"mission control",theme:b,onToggleTheme:y,onSettings:v,search:S,children:[!c&&a.jsx(It,{tone:"disconnected",inline:!0,children:"disconnected"}),ke&&a.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"2px 10px",borderRadius:"var(--r-pill)",border:`1px solid ${ye>0?"var(--status-warning)":re?"var(--line)":"var(--line-strong)"}`,background:ye>0?"var(--brand-wash)":"transparent",fontSize:"var(--fs-xs)",color:re?"var(--ink-3)":"var(--ink-1)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:ke}),s.length>0&&a.jsx(de,{variant:"primary",icon:"add",onClick:E.show,title:"Link a folder as a project (or drop one anywhere on this page)",children:"Link project"})]}),a.jsxs("div",{style:{flex:1,minHeight:0,display:"flex"},children:[a.jsxs("div",{style:{flex:1,minWidth:0,overflowY:"auto",display:"flex",flexDirection:"column"},children:[B&&a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",maxWidth:"var(--fleet-max)",margin:"0 auto",width:"100%",padding:"var(--sp-4) var(--sp-5) 0",boxSizing:"border-box",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[a.jsxs("span",{children:["Showing projects matching “",w.trim(),"” · ",a.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[q.length," of ",s.length]})]}),a.jsx(de,{variant:"ghost",size:"sm",onClick:()=>k?.(""),children:"Show all"})]}),s.length===0?a.jsxs("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--sp-3)",padding:"var(--sp-5)",textAlign:"center"},children:[a.jsx("div",{style:{width:"20rem",maxWidth:"100%"},children:a.jsx(Ox,{onClick:E.show})}),a.jsx(st,{children:"No projects linked yet — link a folder to give the director a job site."})]}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-5)",padding:"var(--sp-5)",maxWidth:"var(--fleet-max)",margin:"0 auto",width:"100%",boxSizing:"border-box"},children:[q.length===0&&a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[a.jsxs(st,{children:["No project matches “",w.trim(),"”. Runs that do are in the search box above."]}),a.jsx(de,{variant:"ghost",size:"sm",onClick:()=>k?.(""),children:"Show all"})]}),R.length===0&&ne.length===0&&q.length>0&&a.jsx(st,{children:"All quiet — nothing running, nothing waiting on you. Open a project to plan its next mission."}),R.length>0&&a.jsxs("section",{style:jc,children:[a.jsxs(ln,{children:["Needs you · ",R.length]}),a.jsx(Tx,{items:R,onPermission:J,onAnswer:ve,onPlanner:Se,onOpen:f})]}),ne.length>0&&a.jsxs("section",{style:jc,children:[a.jsxs(ln,{children:["Running · ",ne.length]}),a.jsx("div",{style:{background:"var(--bg-card)",border:"1px solid var(--line)",borderRadius:"var(--r-md)",overflow:"hidden"},children:ne.map((m,N)=>{const Z=m.activeRun;return a.jsx(Ax,{name:m.name,folder:m.folder,title:Z.title,mission:Z.mission,activity:u[m.id],costUsd:Z.costUsd,budgetUsd:Z.budgetUsd,costBasis:zl(Z),usage:Z.usage,turns:Z.turns,directorModel:Z.directorModel,workerModel:Z.workerModel,createdAt:Z.createdAt,onOpen:()=>f(m.id),style:N>0?{borderTop:"1px solid var(--line)"}:void 0},m.id)})})]}),pe.length>0&&a.jsxs("section",{style:jc,children:[a.jsxs(ln,{children:["Recent · ",pe.length]}),a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"var(--sp-3)"},children:pe.map(m=>a.jsx(Rx,{name:m.name,folder:m.folder,lastRun:m.lastRun&&m.lastRun.status!=="idle"&&m.lastRun.status!=="running"?m.lastRun:null,onOpen:()=>{const N=m.lastRun;N?.id&&h&&(N.status==="error"||N.status==="interrupted")?h(m.id,N.id):f(m.id)},onUnlink:()=>W(m)},m.id))})]})]})]}),s.length>0&&a.jsx(Lx,{onSettings:v,open:F,onToggle:C})]}),E.open&&E.props&&a.jsx(Nx,{...E.props,onClose:E.close}),_&&a.jsx(Hx,{name:_.name,matches:_.matches,onPick:m=>{V(null),se(m)},onClose:()=>V(null)}),$&&a.jsx(Bx,{title:`Unlink ${$.name}?`,body:"Foreman stops tracking this folder. Run history and its .foreman/ files stay on disk; you can link it again later.",confirmLabel:"Unlink",tone:"danger",icon:"unlink",onConfirm:()=>{const m=$.id;W(null),Fe.unlinkProject(m).then(g)},onCancel:()=>W(null)})]})}const Vx=15e3;function Kx(s,c){const[u,o]=x.useState(null),[f,h]=x.useState(!1),[g,b]=x.useState(null),[y,v]=x.useState(!1),[w,k]=x.useState(0),S=x.useCallback(()=>k(H=>H+1),[]);return x.useEffect(()=>{if(o(null),b(null),v(!1),!s){h(!1);return}let H=!1;h(!0);const Q=async()=>{const C=await fetch(`/runs/${encodeURIComponent(s)}/deck`).catch(()=>null);if(H)return;if(!C){b("Could not reach the server."),h(!1);return}if(C.status===404){v(!0),b(null),h(!1);return}if(!C.ok){const V=await C.json().catch(()=>({}));b(V.error||`HTTP ${C.status}`),h(!1);return}const _=await C.json().catch(()=>null);H||(_&&(o(_),v(!1),b(null)),h(!1))};Q();const F=c?setInterval(()=>{Q()},Vx):null;return()=>{H=!0,F&&clearInterval(F)}},[s,c,w]),{deck:u,loading:f,error:g,missing:y,refresh:S}}function Ys(s){return new Date(s).toLocaleTimeString(void 0,{hour12:!1})}const kc=[1,5,15,30,60,120,300,600,900,1800,3600,7200,21600].map(s=>s*1e3);function Zx(s,c){const u=c-s,o=kc.find(h=>u/h<=6)??kc[kc.length-1],f=[];for(let h=Math.ceil(s/o)*o;h<c;h+=o)f.push(h);return{marks:f,step:o}}function Wx({agents:s=[],entries:c=[],live:u,selected:o,onSelect:f,onTick:h,height:g=22,style:b}){if(!c.length)return null;const y=Math.min(...c.map(C=>C.ts)),v=Math.max(...c.map(C=>C.ts)),w=u?Math.min(Math.max(Date.now(),v),v+6e4):v,k=Math.max(w-y,1e3),S=C=>`${(C-y)/k*100}%`,H=C=>(C-y)/k*100,{marks:Q}=Zx(y,y+k),F=s.length?s.map(C=>C.id??C):[...new Set(c.map(C=>C.agent))];return a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"84px 1fr",rowGap:4,columnGap:10,fontSize:"var(--fs-xs)",color:"var(--ink-2)",...b},children:[F.map(C=>{const _=c.filter(E=>E.agent===C);if(!_.length)return null;const V=Math.min(..._.map(E=>E.ts)),$=s.find(E=>(E.id??E)===C)?.status,W=$==="running"&&u?w:Math.max(..._.map(E=>E.ts)),se=o&&o!==C;return a.jsxs(Cn.Fragment,{children:[a.jsxs("button",{type:"button",onClick:()=>f?.(C),title:`Filter transcript to ${C}`,style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",padding:0,cursor:f?"pointer":"default",color:se?"var(--ink-2)":"var(--ink-1)",font:"inherit",textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[a.jsx(an,{agent:C,size:"sm"}),C]}),a.jsxs("div",{style:{position:"relative",height:g,background:"var(--bg-inset)",borderRadius:4,opacity:se?.45:1,overflow:"hidden"},children:[Q.map(E=>a.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:S(E),top:0,bottom:0,width:1,background:"var(--line)",opacity:.9}},E)),a.jsx("div",{style:{position:"absolute",left:S(V),width:`calc(${S(W)} - ${S(V)})`,top:6,bottom:6,minWidth:3,background:Vs(C),opacity:.15,borderRadius:3}}),_.map(E=>{const B=a.jsx("span",{style:{display:"block",width:E.kind==="text"?3:2,height:E.kind==="text"?g-6:g-14,borderRadius:1,background:E.kind==="error"?"var(--status-critical)":E.kind==="tool"?"var(--ink-0)":Vs(C),boxShadow:"0 0 0 1px var(--bg-inset)"}}),q=`${Ys(E.ts)} · ${E.title||E.kind}`;return h?a.jsx("button",{type:"button",title:q,"aria-label":`Jump to ${q}`,onClick:()=>h(E),style:{position:"absolute",left:S(E.ts),top:0,bottom:0,width:9,marginLeft:-4,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer"},children:B},E.id??E.ts):a.jsx("span",{title:q,style:{position:"absolute",left:S(E.ts),top:E.kind==="text"?3:7,marginLeft:-1},children:B},E.id??E.ts)}),u&&$==="running"&&a.jsx("span",{className:"pulse",style:{position:"absolute",right:0,top:0,bottom:0,width:2,background:"var(--status-good)"}})]})]},C)}),a.jsx("span",{}),a.jsxs("div",{style:{position:"relative",height:16,fontVariantNumeric:"tabular-nums"},children:[a.jsx("span",{style:{position:"absolute",left:0,top:0},children:Ys(y)}),Q.map(C=>{const _=H(C);return _<12||_>88?null:a.jsx("span",{style:{position:"absolute",left:`${_}%`,top:0,transform:"translateX(-50%)",color:"var(--ink-3, var(--ink-2))"},children:Ys(C)},C)}),a.jsx("span",{style:{position:"absolute",right:0,top:0},children:u?"now":Ys(w)})]})]})}function Jx(s){const c=[];let u=!1;for(const o of String(s||"").split(`
28
+ `)){const f=/^#{1,6}\s+(.*)$/.exec(o.trim());if(f){u=/^DONE\s*WHEN/i.test(f[1]);continue}if(u)continue;const h=/^\s*[-*]\s*\[([ xX])\]\s*(.+)$/.exec(o);h&&c.push({done:h[1]!==" ",text:h[2].trim()})}return c}function Fx({doc:s,style:c}){const[u,o]=x.useState(!1),f=s?Jx(s):[],h=f.filter(g=>g.done).length;return a.jsxs("section",{style:c,children:[a.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--sp-2)"},children:[a.jsx(ln,{children:"Plan"}),f.length>0&&a.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums"},children:[h,"/",f.length]}),s&&a.jsxs("button",{type:"button",onClick:()=>o(!u),style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:4,background:"none",border:"none",cursor:"pointer",color:"var(--ink-2)",fontSize:"var(--fs-xs)",padding:0,font:"inherit"},children:[a.jsx(te,{name:"raw",size:12}),u?"board":"raw doc"]})]}),f.length>0&&!u&&a.jsx("div",{style:{height:3,background:"var(--bg-inset)",borderRadius:2,marginBottom:6,overflow:"hidden"},children:a.jsx("div",{style:{width:`${h/f.length*100}%`,height:"100%",background:"var(--status-good)",transition:"width var(--dur-meter)"}})}),!s&&a.jsx(st,{children:"MISSION.md not written yet."}),s&&!u&&f.map((g,b)=>a.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-2)",padding:"4px 0",fontSize:"var(--fs-sm)",color:g.done?"var(--ink-2)":"var(--ink-0)"},children:[a.jsx(te,{name:g.done?"done":"idle",size:14,strokeWidth:2,color:g.done?"var(--status-good)":"var(--ink-2)",style:{marginTop:2}}),a.jsx("span",{style:{textDecoration:g.done?"line-through":"none"},children:g.text})]},b)),s&&u&&a.jsx("pre",{style:{fontSize:"var(--fs-xs)",whiteSpace:"pre-wrap",color:"var(--ink-1)",background:"var(--bg-inset)",borderRadius:"var(--r-sm)",padding:"var(--sp-2)",maxHeight:320,overflowY:"auto",fontFamily:"var(--font-mono)",margin:0},children:s})]})}function al({label:s,hint:c,layout:u="inline",children:o,style:f}){return u==="stacked"?a.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:5,...f},children:[a.jsx("span",{style:{fontSize:"var(--fs-xs)",fontWeight:"var(--fw-semibold)",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--ink-2)"},children:s}),o,c&&a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:c})]}):a.jsxs("label",{title:c,style:{display:"flex",alignItems:"center",gap:6,color:"var(--ink-1)",fontSize:"var(--fs-sm)",...f},children:[s,o]})}const Ix=/(`[^`\n]+`|<[^<>\n]{1,80}>)/g;function Px(s){const c=[];let u=!1;for(const o of s.split(`
29
+ `)){if(/^```/.test(o)){c.push({text:o,kind:"fence",open:!u}),u=!u;continue}if(u){c.push({text:o,kind:"code"});continue}/^>\s?/.test(o)?c.push({text:o,kind:"quote"}):/^\s*[-*]\s+/.test(o)?c.push({text:o,kind:"list"}):/^#{1,3}\s/.test(o)?c.push({text:o,kind:"heading"}):c.push({text:o,kind:"text"})}return c}function $s(s){return s.split(Ix).filter(Boolean).map((c,u)=>c.length>2&&c.startsWith("`")&&c.endsWith("`")?a.jsxs("span",{style:{background:"var(--bg-inset)",boxShadow:"0 0 0 1px var(--line)",borderRadius:3,color:"var(--agent-worker)"},children:[a.jsx("span",{style:{color:"var(--ink-2)"},children:"`"}),c.slice(1,-1),a.jsx("span",{style:{color:"var(--ink-2)"},children:"`"})]},u):c.startsWith("<")&&c.endsWith(">")?a.jsx("span",{style:{background:"var(--brand-wash-strong)",boxShadow:"0 0 0 1px var(--brand)",borderRadius:3},children:c},u):c)}const bi="var(--sp-3)",e1=x.forwardRef(function({value:c,onChange:u,placeholder:o,minHeight:f=200,maxHeight:h=460,onKeyDown:g,onPaste:b,onFocus:y,onBlur:v,style:w},k){const S=x.useRef(null),H=x.useRef(null);x.useImperativeHandle(k,()=>S.current),x.useEffect(()=>{const _=S.current;_&&(_.style.height="0px",_.style.height=`${Math.max(_.scrollHeight,f)}px`,H.current!=null&&(_.setSelectionRange(H.current,H.current),H.current=null))},[c,f]);const Q=_=>{const V=_.target;let $=V.value,W=V.selectionStart;const se=_.nativeEvent?.inputType==="insertText"&&_.nativeEvent?.data==="`",E=$.slice(0,W),B=$.slice(W),q=E.lastIndexOf(`
30
+ `)+1;if(se&&E.slice(q)==="```"&&(B===""||B.startsWith(`
31
+ `))){const R=(E.match(/^```/gm)||[]).length%2===1;R&&(B.match(/^```/gm)||[]).length%2===0?($=`${E}
32
+
33
+ \`\`\`
34
+ ${B.replace(/^\n/,"")}`,W+=1):R||($=B.startsWith(`
35
+ `)?$:`${E}
36
+ ${B}`,W+=1),H.current=W}u?.($)},F=Px(c||""),C={margin:0,padding:bi,boxSizing:"border-box",width:"100%",font:"inherit",fontSize:"inherit",lineHeight:"var(--lh-prose)",whiteSpace:"pre-wrap",overflowWrap:"break-word",wordBreak:"break-word",tabSize:4};return a.jsxs("div",{style:{position:"relative",overflowY:"auto",maxHeight:h,...w},children:[a.jsxs("div",{"aria-hidden":!0,style:{...C,position:"absolute",inset:0,height:"auto",color:"var(--ink-0)",pointerEvents:"none"},children:[!c&&o&&a.jsx("div",{style:{color:"var(--ink-2)"},children:o}),c&&F.map((_,V)=>{const $=_.kind==="code"||_.kind==="fence";return a.jsx("div",{style:{...$?{background:"var(--bg-inset)",margin:`0 calc(-0.5 * ${bi})`,padding:`0 calc(0.5 * ${bi})`}:null,..._.kind==="fence"?{borderRadius:_.open?"6px 6px 0 0":"0 0 6px 6px"}:null,..._.kind==="quote"?{color:"var(--ink-1)",boxShadow:"inset 2px 0 0 var(--agent-worker)",margin:`0 calc(-1 * ${bi})`,padding:`0 ${bi}`}:null,..._.kind==="fence"?{color:"var(--ink-2)"}:null,..._.kind==="code"?{color:"var(--ink-1)"}:null},children:_.text===""?"​":_.kind==="fence"?a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"transparent"},children:"```"}),_.text.slice(3)]}):_.kind==="code"?_.text:_.kind==="list"?a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"var(--brand)"},children:/^\s*[-*]\s+/.exec(_.text)[0]}),$s(_.text.replace(/^\s*[-*]\s+/,""))]}):_.kind==="heading"?a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"var(--brand)"},children:/^#{1,3}\s/.exec(_.text)[0]}),$s(_.text.replace(/^#{1,3}\s/,""))]}):_.kind==="quote"?a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"var(--ink-2)"},children:/^>\s?/.exec(_.text)[0]}),$s(_.text.replace(/^>\s?/,""))]}):$s(_.text)},V)})]}),a.jsx("textarea",{ref:S,value:c,onChange:Q,spellCheck:!1,onKeyDown:g,onPaste:b,onFocus:y,onBlur:v,style:{...C,position:"relative",display:"block",minHeight:f,resize:"none",overflow:"hidden",background:"transparent",border:"none",outline:"none",color:"transparent",caretColor:"var(--ink-0)"}})]})}),t1=[{id:"fable",label:"Fable",model:"claude-fable-5",cost:4,note:"Frontier. Long-horizon planning and verification."},{id:"opus",label:"Opus",model:"claude-opus-5",cost:3,note:"Deep reasoning for hard refactors."},{id:"sonnet",label:"Sonnet",model:"claude-sonnet-5",cost:2,note:"Balanced. The usual worker."},{id:"haiku",label:"Haiku",model:"claude-haiku-4-5",cost:1,note:"Fast and cheap for reads and mechanical edits."}],ap={id:"",label:"Default",model:"inherits your Claude Code default",cost:0};function n1(s){const[c,u]=x.useState({models:null,loading:!!s,error:null});return x.useEffect(()=>{if(!s)return;let o=!0;return u(h=>({...h,loading:!0})),(typeof s=="string"?fetch(s).then(h=>{if(!h.ok)throw new Error(`${h.status} from ${s}`);return h.json()}).then(h=>h.models||h):Promise.resolve().then(s)).then(h=>o&&u({models:h,loading:!1,error:null})).catch(h=>o&&u({models:null,loading:!1,error:String(h&&h.message||h)})),()=>{o=!1}},[s]),c}function l1({cost:s}){return s?a.jsx("span",{"aria-label":`cost ${s} of 4`,style:{display:"inline-flex",gap:2},children:[1,2,3,4].map(c=>a.jsx("span",{style:{width:4,height:10,borderRadius:1,background:c<=s?"var(--ink-1)":"var(--line-strong)"}},c))}):a.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"—"})}function $p(s){return s&&s.providerLabel||"Anthropic"}function a1(s){const c=[];for(const u of s){const o=$p(u);let f=c.find(h=>h.label===o);f||(f={label:o,items:[]},c.push(f)),f.items.push(u)}return c}function Ft({align:s="left",block:c=!1,value:u="",onChange:o,models:f,loading:h,note:g,inheritNote:b,allowDefault:y=!0,disabled:v,style:w}){const[k,S]=x.useState(!1),[H,Q]=x.useState(null),[F,C]=x.useState(""),_=x.useRef(null),V=x.useRef(null),$=x.useRef(null),W=b?{...ap,model:b}:ap,se=f||t1,E=[...y?[W]:[],...se],B=E.find(L=>L.id===u)||(u?{id:u,label:u,model:u}:W),q=se.length>6,R=F.trim().toLowerCase(),ne=L=>!R||[L.label,L.model,L.id,L.providerLabel,L.note].some(J=>String(J??"").toLowerCase().includes(R)),pe=q&&R?se.filter(ne):se,fe=a1(pe),ye=fe.length>1;x.useEffect(()=>{if(!k)return;const L=ve=>{_.current&&!_.current.contains(ve.target)&&S(!1)},J=ve=>{ve.key==="Escape"&&S(!1)};return document.addEventListener("mousedown",L),document.addEventListener("keydown",J),()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",J)}},[k]),x.useEffect(()=>{if(!k||!V.current)return;const L=V.current.querySelector('[data-selected="true"]');L&&L.scrollIntoView({block:"nearest"})},[k]),x.useEffect(()=>{if(!k){C("");return}$.current?.focus()},[k]);const re=()=>{const L=fe[0]?.items[0];L&&(o?.(L.id,L),S(!1))},ke=$p(B),M=B.id&&ke!=="Anthropic";return a.jsxs("div",{ref:_,style:{position:"relative",display:c?"block":"inline-block",...c?{width:"100%"}:{},...w},children:[a.jsxs("button",{type:"button",disabled:v||h,onClick:()=>S(L=>!L),"aria-haspopup":"listbox","aria-expanded":k,style:{display:c?"flex":"inline-flex",alignItems:"center",gap:8,minWidth:150,padding:"6px 8px 6px 10px",...c?{width:"100%",boxSizing:"border-box"}:{},background:"var(--bg-card)",border:`1px solid ${k?"var(--ink-2)":"var(--line-strong)"}`,borderRadius:"var(--r-sm)",color:h?"var(--ink-2)":"var(--ink-0)",cursor:v||h?"default":"pointer",textAlign:"left",transition:"border-color var(--dur-fast) var(--ease)"},children:[a.jsx(te,{name:h?"loading":"model",size:14,color:"var(--ink-2)"}),a.jsxs("span",{style:{flex:1,display:"inline-flex",alignItems:"center",gap:6,minWidth:0},children:[a.jsx("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:h?"Fetching models…":B.label}),M&&a.jsx("span",{style:{flex:"0 0 auto",fontSize:"var(--fs-xs)",lineHeight:1,padding:"2px 5px",borderRadius:"var(--r-xs, 3px)",background:"var(--bg-hover)",color:"var(--ink-2)",border:"1px solid var(--line)"},children:ke})]}),a.jsx(te,{name:"chevronDown",size:14,color:"var(--ink-2)"})]}),k&&a.jsxs("div",{role:"listbox",style:{position:"absolute",top:"calc(100% + 4px)",zIndex:20,minWidth:300,...c?{left:0,right:0}:s==="right"?{right:0}:{left:0},background:"var(--bg-panel)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-sm)",boxShadow:"0 8px 24px rgba(0,0,0,0.28)",padding:4,display:"flex",flexDirection:"column"},children:[g&&a.jsx("div",{style:{padding:"6px 10px",fontSize:"var(--fs-xs)",color:"var(--ink-2)",borderBottom:E.length?"1px solid var(--line)":"none"},children:g}),q&&a.jsx("div",{style:{padding:6,borderBottom:"1px solid var(--line)"},children:a.jsx("input",{ref:$,value:F,onChange:L=>C(L.target.value),placeholder:`Filter ${se.length} models…`,"aria-label":"Filter models",onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),re())},style:{width:"100%",boxSizing:"border-box",padding:"5px 8px",font:"inherit",fontSize:"var(--fs-sm)",color:"var(--ink-0)",background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",outline:"none"}})}),a.jsxs("div",{ref:V,style:{maxHeight:360,overflowY:"auto",display:"flex",flexDirection:"column"},children:[q&&R&&pe.length===0&&a.jsxs("div",{style:{padding:"10px",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:["No model matches “",F.trim(),"”."]}),y&&!R&&a.jsx(ip,{m:W,selected:B.id===W.id,hover:H===W.id,onHover:Q,onClick:()=>{o?.(W.id,W),S(!1)}},W.id),fe.map(L=>a.jsxs(Cn.Fragment,{children:[ye&&a.jsxs("div",{style:{padding:"6px 8px 4px",marginTop:2,fontSize:"var(--fs-xs)",fontWeight:"var(--fw-semibold)",color:"var(--ink-2)",textTransform:"uppercase",letterSpacing:"0.04em",display:"flex",justifyContent:"space-between",position:"sticky",top:0,background:"var(--bg-panel)",zIndex:1},children:[a.jsx("span",{children:L.label}),a.jsx("span",{children:L.items.length})]}),L.items.map(J=>a.jsx(ip,{m:J,selected:B.id===J.id,hover:H===J.id,onHover:Q,onClick:()=>{o?.(J.id,J),S(!1)}},J.id))]},L.label))]})]})]})}function ip({m:s,selected:c,hover:u,onHover:o,onClick:f}){return a.jsxs("button",{type:"button",role:"option","aria-selected":c,"data-selected":c||void 0,onMouseEnter:()=>o(s.id),onMouseLeave:()=>o(null),onClick:f,style:{display:"grid",gridTemplateColumns:"14px 1fr auto",columnGap:10,alignItems:"start",textAlign:"left",padding:"7px 8px",border:"none",borderRadius:4,cursor:"pointer",color:"var(--ink-0)",background:u?"var(--bg-hover)":"transparent",width:"100%"},children:[a.jsx("span",{style:{paddingTop:2},children:c&&a.jsx(te,{name:"check",size:14,color:"var(--brand)"})}),a.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[a.jsxs("span",{style:{display:"flex",alignItems:"baseline",gap:8},children:[a.jsx("span",{style:{fontWeight:c?"var(--fw-semibold)":"inherit"},children:s.label}),a.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.model})]}),s.note&&a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:s.note})]}),a.jsx("span",{style:{paddingTop:3},children:a.jsx(l1,{cost:s.cost})})]})}Ft.useModels=n1;function Rt({checked:s=!1,onChange:c,disabled:u,label:o,size:f="md",style:h}){const[g,b]=x.useState(!1),y=f==="sm"?28:34,v=f==="sm"?16:20,w=v-4;return a.jsx("button",{type:"button",role:"switch","aria-checked":s,"aria-label":o,disabled:u,onClick:()=>c?.(!s),onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),style:{position:"relative",width:y,height:v,flex:"0 0 auto",padding:0,borderRadius:"var(--r-pill)",border:`1px solid ${s?"var(--brand)":g?"var(--ink-2)":"var(--line-strong)"}`,background:s?"var(--brand)":"var(--bg-inset)",cursor:u?"default":"pointer",opacity:u?.5:1,transition:"background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease)",...h},children:a.jsx("span",{"aria-hidden":!0,style:{position:"absolute",top:1,left:s?y-w-3:1,width:w,height:w,borderRadius:"var(--r-pill)",background:s?"var(--brand-ink)":"var(--ink-1)",transition:"left var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease)"}})})}const i1=`Describe the mission…
37
+
38
+ Say what "done" looks like, name constraints, and flag any decision the director should ask you about before implementing.`,s1=[{id:"bugfix",label:"Bug fix",icon:"Bug",budget:3,director:"",worker:"sonnet",brief:`Fix: <describe the bug and how to reproduce it>
39
+
40
+ Done when: the reproduction no longer fails and a regression test covers it.
41
+ Constraints: no unrelated refactors; keep the public API unchanged.
42
+ Ask me before: changing behaviour that other code depends on.`},{id:"tests",label:"Add tests",icon:"ListChecks",budget:4,director:"",worker:"haiku",brief:`Add tests for: <module or feature>
43
+
44
+ Done when: each public function has at least one happy-path and one edge-case test, and the suite passes.
45
+ Constraints: use the existing test runner and conventions; no new dependencies.
46
+ Ask me before: changing production code to make it testable.`},{id:"refactor",label:"Refactor",icon:"Shuffle",budget:6,director:"fable",worker:"sonnet",brief:`Refactor: <what, and why>
47
+
48
+ Done when: behaviour is unchanged (existing tests pass), the code is <goal, e.g. split into pure functions>, and nothing outside <scope> is touched.
49
+ Constraints: one concern per commit-sized step; keep diffs reviewable.
50
+ Ask me before: renaming anything exported.`},{id:"audit",label:"Audit",icon:"SearchCheck",budget:2,director:"",worker:"haiku",brief:`Audit: <area, e.g. error handling / security / accessibility>
51
+
52
+ Done when: a written report in .foreman/AUDIT.md lists findings ranked by severity with file:line references — no code changes.
53
+ Constraints: read-only; do not modify source files.
54
+ Ask me before: nothing — this mission only reads.`}];function r1(s){if(!s)return"";let c=s.replace(/^\/(Users|home)\/[^/]+/,"~");const u=c.split("/");return u.length>4&&(c=[u[0],u[1],"…",...u.slice(-2)].join("/")),c}function wc(s){return`foreman:draft:${s||"default"}`}const zc=s=>`${s.name}:${s.size}`;function sp({children:s}){return a.jsx("kbd",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:18,height:18,padding:"0 4px",boxSizing:"border-box",background:"var(--bg-inset)",border:"1px solid var(--line-strong)",borderRadius:4,color:"var(--ink-1)",fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",lineHeight:1},children:s})}function Tc({icon:s,label:c,active:u,onClick:o}){const[f,h]=x.useState(!1);return a.jsx("button",{type:"button",title:c,"aria-label":c,"aria-pressed":u,onClick:o,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:26,height:24,padding:0,background:u?"var(--bg-inset)":f?"var(--bg-hover)":"transparent",border:"none",borderRadius:4,color:u||f?"var(--ink-0)":"var(--ink-2)",cursor:"pointer"},children:a.jsx(te,{name:s,size:14})})}function rp({icon:s,label:c,active:u,onClick:o}){return a.jsxs("button",{type:"button",onClick:o,"aria-selected":u,role:"tab",style:{display:"inline-flex",alignItems:"center",gap:5,padding:"0 10px",height:32,background:"none",border:"none",borderBottom:`2px solid ${u?"var(--brand)":"transparent"}`,marginBottom:-1,color:u?"var(--ink-0)":"var(--ink-2)",fontSize:"var(--fs-sm)",fontWeight:u?"var(--fw-semibold)":"inherit",cursor:"pointer"},children:[a.jsx(te,{name:s,size:13}),c]})}function o1({folder:s,defaultBudgetUsd:c=5,error:u,busy:o,templates:f=s1,models:h,modelsLoading:g,modelsNote:b,modelsInheritNote:y,onStart:v,style:w}){const k=x.useMemo(()=>{try{return JSON.parse(localStorage.getItem(wc(s))||"null")}catch{return null}},[s]),[S,H]=x.useState(k?.mission??""),[Q,F]=x.useState(k?.budget??c),[C,_]=x.useState(k?.directorModel??""),[V,$]=x.useState(k?.workerModel??""),[W,se]=x.useState(k?.directorProviderId),[E,B]=x.useState(k?.workerProviderId),[q,R]=x.useState(k?.browserTools??!1),[ne,pe]=x.useState(k?"restored":null),[fe,ye]=x.useState("write"),[re,ke]=x.useState([]),[M,L]=x.useState(!1),[J,ve]=x.useState(!1),Se=x.useRef(null),m=x.useRef(null);x.useEffect(()=>{const K=setTimeout(()=>{try{(S.trim()||k)&&(localStorage.setItem(wc(s),JSON.stringify({mission:S,budget:Q,directorModel:C,workerModel:V,browserTools:q})),S.trim()&&pe("saved"))}catch{}},400);return()=>clearTimeout(K)},[S,Q,C,V,q,s]);const N=K=>{H(K.brief),F(K.budget),_(K.director),$(K.worker),ye("write")},Z=()=>{H(""),ke([]),pe(null);try{localStorage.removeItem(wc(s))}catch{}},P=K=>{const Be=Array.from(K||[]);Be.length&&ke(Le=>{const ee=new Set(Le.map(zc));return[...Le,...Be.filter(De=>!ee.has(zc(De)))]})},le=!o&&S.trim().length>0,ae=()=>{le&&v?.({mission:S.trim(),budget:Q,directorModel:C,workerModel:V,directorProviderId:W,workerProviderId:E,browserTools:q,attachments:re})},xe=K=>{const Be=Se.current;if(!Be){ye("write");return}const Le=Be.selectionStart??S.length,ee=Be.selectionEnd??Le,De=S.slice(Le,ee);let $e,vt;if(K==="code")$e=`\`${De||"code"}\``,vt=De?Le+$e.length:Le+1;else if(K==="quote")$e=(De||"quoted text").split(`
55
+ `).map(sl=>`> ${sl}`).join(`
56
+ `),vt=De?Le+$e.length:Le+2;else{const Ot=Le>0&&S[Le-1]!==`
57
+ `?`
58
+ `:"";$e=`${Ot}\`\`\`
59
+ ${De||""}
60
+ \`\`\`
61
+ `,vt=Le+Ot.length+4}const il=S.slice(0,Le)+$e+S.slice(ee);H(il),ye("write"),requestAnimationFrame(()=>{Be.focus();const Ot=De?vt:vt+(K==="code"?4:K==="quote"?11:0);Be.setSelectionRange(vt,Ot)})},I=M?"var(--brand)":J?"var(--ink-2)":"var(--line-strong)";return a.jsxs("div",{style:{maxWidth:"var(--composer-max)",margin:"var(--sp-5) auto",padding:"0 var(--sp-4)",display:"flex",flexDirection:"column",gap:"var(--sp-3)",...w},children:[a.jsxs("div",{style:{minWidth:0},children:[a.jsx("h2",{style:{margin:0,fontSize:"var(--fs-lg)"},children:"New mission"}),a.jsx("div",{title:s,style:{color:"var(--ink-2)",fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r1(s)})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:"var(--fs-xs)",color:"var(--ink-2)",marginRight:2},children:[a.jsx(te,{name:"template",size:12}),"Start from"]}),f.map(K=>a.jsx(de,{size:"sm",icon:K.icon,title:`Budget $${K.budget} · director ${K.director||"default"} · workers ${K.worker||"default"}`,onClick:()=>N(K),children:K.label},K.id))]}),a.jsxs("div",{onDragOver:K=>{K.preventDefault(),M||L(!0)},onDragLeave:K=>{K.currentTarget.contains(K.relatedTarget)||L(!1)},onDrop:K=>{K.preventDefault(),L(!1),P(K.dataTransfer.files)},style:{background:"var(--bg-card)",border:`1px solid ${I}`,borderRadius:"var(--r-md)",overflow:"hidden",boxShadow:M?"0 0 0 3px var(--brand-wash-strong)":"none",transition:"border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease)"},children:[a.jsxs("div",{role:"tablist",style:{display:"flex",alignItems:"center",gap:2,padding:"0 6px",borderBottom:"1px solid var(--line)",background:"var(--bg-panel)"},children:[a.jsx(rp,{icon:"write",label:"Write",active:fe==="write",onClick:()=>ye("write")}),a.jsx(rp,{icon:"preview",label:"Preview",active:fe==="preview",onClick:()=>ye("preview")}),a.jsx("span",{style:{flex:1}}),a.jsx(Tc,{icon:"quote",label:"Quote (> )",onClick:()=>xe("quote")}),a.jsx(Tc,{icon:"code",label:"Inline code (`)",onClick:()=>xe("code")}),a.jsx(Tc,{icon:"codeBlock",label:"Code block (```)",onClick:()=>xe("block")})]}),fe==="write"?a.jsx(e1,{ref:Se,value:S,onChange:H,placeholder:i1,minHeight:200,maxHeight:440,onKeyDown:K=>{(K.metaKey||K.ctrlKey)&&K.key==="Enter"&&(K.preventDefault(),ae())},onPaste:K=>{K.clipboardData?.files?.length&&(K.preventDefault(),P(K.clipboardData.files))},onFocus:()=>ve(!0),onBlur:()=>ve(!1)}):a.jsx("div",{style:{minHeight:200,maxHeight:440,overflowY:"auto",padding:"var(--sp-3)",boxSizing:"border-box"},children:S.trim()?a.jsx(qc,{text:S}):a.jsx("span",{style:{color:"var(--ink-2)"},children:"Nothing to preview yet."})}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",padding:"6px 8px",borderTop:"1px solid var(--line)",minHeight:36,boxSizing:"border-box"},children:[a.jsx("input",{ref:m,type:"file",multiple:!0,style:{display:"none"},onChange:K=>{P(K.target.files),K.target.value=""}}),a.jsx(de,{size:"sm",variant:"ghost",icon:"attach",title:"Attach files — or drop them on the editor, or paste an image",onClick:()=>m.current?.click(),children:"Attach"}),re.map((K,Be)=>a.jsx(Rp,{name:K.name,size:K.size,onRemove:()=>ke(Le=>Le.filter((ee,De)=>De!==Be))},zc(K))),a.jsx("span",{style:{flex:1}}),a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[ne&&a.jsxs(a.Fragment,{children:[a.jsx(te,{name:"draft",size:11}),ne==="restored"?"Draft restored":"Draft saved"]}),(S||re.length>0)&&a.jsx("button",{type:"button",onClick:Z,style:{background:"none",border:"none",padding:0,color:"var(--ink-2)",cursor:"pointer",font:"inherit",textDecoration:"underline"},children:"Clear"})]})]})]}),a.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-4)",flexWrap:"wrap"},children:[a.jsx(al,{layout:"stacked",label:"Budget cap",hint:"Hard stop; the run halts here.",children:a.jsx(Je,{type:"number",min:1,step:1,width:96,prefix:"$",value:Q,onChange:F})}),a.jsx(al,{layout:"stacked",label:"Director",hint:"Plans, delegates, verifies.",children:a.jsx(Ft,{value:C,models:h,loading:g,note:b,inheritNote:y,onChange:(K,Be)=>{_(K),se(Be?.providerId)}})}),a.jsx(al,{layout:"stacked",label:"Workers",hint:"Implement. Cheaper models cut cost.",children:a.jsx(Ft,{value:V,models:h,loading:g,note:b,inheritNote:y,onChange:(K,Be)=>{$(K),B(Be?.providerId)}})}),a.jsx(al,{label:"Browser",hint:"Headless Playwright for the agents — navigate, click, screenshot. Non-local URLs still ask you.",children:a.jsx(Rt,{checked:q,onChange:R,label:q?"on":"off"})})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"var(--sp-3)",flexWrap:"wrap"},children:[u&&a.jsx(It,{tone:"error",inline:!0,style:{marginRight:"auto"},children:u}),a.jsxs("span",{title:"Start the mission with Cmd+Enter from the editor",style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[a.jsx(sp,{children:"⌘"}),a.jsx(sp,{children:"↵"})]}),a.jsx(de,{variant:"primary",disabled:!le,onClick:ae,children:"Start mission"})]})]})}function c1({questions:s=[],askedAt:c,who:u,onAnswer:o,onFreeText:f,style:h}){const[g,b]=x.useState({}),[y,v]=x.useState(""),[w,k]=x.useState(0),[S,H]=x.useState(!1),Q=x.useRef(null),F=s.length===1&&!s[0]?.multi,C=s.every(B=>{const q=g[B.question];return Array.isArray(q)?q.length>0:!!q});x.useEffect(()=>{b({}),v(""),k(0),H(!1)},[s]);const _=x.useMemo(()=>{const B={};for(const q of s){const R=g[q.question];Array.isArray(R)?B[q.question]=R.join(", "):R&&(B[q.question]=R)}return B},[g,s]),V=B=>{S||(H(!0),o?.(B))},$=(B,q)=>{if(S)return;if(B.multi){b(ne=>{const pe=Array.isArray(ne[B.question])?ne[B.question]:[],fe=pe.includes(q)?pe.filter(ye=>ye!==q):[...pe,q];return{...ne,[B.question]:fe}});return}const R={...g,[B.question]:q};b(R),F&&V({[B.question]:q})},W=()=>{const B=y.trim();if(!B||S)return;const q=s[Math.min(w,s.length-1)],R={..._,[q.question]:B};if(s.length===1){H(!0),o?.(R);return}H(!0),o?.(R)},se=B=>{if(B.target.tagName==="TEXTAREA"){(B.metaKey||B.ctrlKey)&&B.key==="Enter"&&(B.preventDefault(),W());return}const q=s[w];if(q)if(/^[1-9]$/.test(B.key)){const R=q.options[Number(B.key)-1];R&&(B.preventDefault(),$(q,R.label))}else B.key==="ArrowDown"?(B.preventDefault(),k(R=>Math.min(s.length-1,R+1))):B.key==="ArrowUp"?(B.preventDefault(),k(R=>Math.max(0,R-1))):B.key==="Enter"&&!F&&C&&(B.preventDefault(),V(_))},E=c?Math.max(0,Math.round((Date.now()-c)/6e4)):0;return a.jsxs("div",{ref:Q,tabIndex:0,onKeyDown:se,style:{flex:"0 0 auto",outline:"none",background:"var(--bg-card)",border:"1px solid var(--brand)",borderRadius:"var(--r-md)",overflow:"hidden",opacity:S?.6:1,transition:"opacity var(--dur-fast) var(--ease)",...h},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--line)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[a.jsx(te,{name:"question",size:14,color:"var(--brand)"}),a.jsx("span",{style:{color:"var(--ink-1)",fontWeight:"var(--fw-semibold)"},children:"The foreman asks"}),a.jsx("span",{children:"· pick an answer, or type one"}),E>=1&&a.jsxs("span",{style:{marginLeft:"auto"},children:["waiting ",E,"m"]})]}),s.map((B,q)=>{const R=g[B.question],ne=Array.isArray(R)?R.length>0:!!R,pe=q===w;return a.jsxs("div",{onMouseEnter:()=>k(q),style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--line)",background:pe&&s.length>1?"var(--bg-inset)":"transparent"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:6,marginBottom:6,fontSize:"var(--fs-md)",color:"var(--ink-0)"},children:[s.length>1&&a.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:ne?"var(--status-ok, var(--brand))":"var(--ink-2)"},children:ne?"✓":`${q+1}.`}),a.jsx("span",{children:B.question}),B.multi&&a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"choose any"})]}),a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:B.options.map((fe,ye)=>{const re=Array.isArray(R)?R.includes(fe.label):R===fe.label;return a.jsxs("button",{type:"button",disabled:S,onClick:()=>$(B,fe.label),title:fe.hint||(ye===0?"Recommended":void 0),style:{display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:2,padding:"6px 10px",borderRadius:"var(--r-sm)",cursor:S?"default":"pointer",font:"inherit",textAlign:"left",maxWidth:360,background:re?"color-mix(in srgb, var(--brand) 16%, transparent)":"var(--bg-inset)",border:`1px solid ${re?"var(--brand)":"var(--line-strong)"}`,color:re?"var(--brand)":"var(--ink-0)",transition:"border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease)"},children:[a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"var(--fs-sm)"},children:[a.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",minWidth:14,color:re?"var(--brand)":"var(--ink-2)"},children:ye+1}),fe.label,ye===0&&a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontWeight:"var(--fw-normal)"},children:"· recommended"})]}),fe.hint&&a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",lineHeight:"var(--lh)"},children:fe.hint})]},fe.label)})})]},B.question)}),a.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:"var(--sp-2)",padding:"var(--sp-2) var(--sp-3)"},children:[a.jsx("textarea",{rows:1,value:y,disabled:S,placeholder:s.length>1?`Something else for question ${w+1}…`:"Something else…",onChange:B=>v(B.target.value),onFocus:()=>{},style:{flex:1,minWidth:0,resize:"none",border:"none",outline:"none",background:"transparent",color:"var(--ink-0)",font:"inherit",lineHeight:"var(--lh)",padding:"4px 0"}}),y.trim()?a.jsx(de,{size:"sm",icon:"send",onClick:W,disabled:S,title:"⌘↵",children:"Send"}):F?null:a.jsx(de,{size:"sm",variant:"primary",onClick:()=>V(_),disabled:S||!C,title:C?"Enter":"Answer every question first",children:"Send answers"})]}),u&&a.jsxs("div",{style:{padding:"0 var(--sp-3) var(--sp-2)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)"},children:[u.model," · ",String(u.provider).split(" · ")[0]]})]})}function u1({mission:s,doneWhen:c=[],budgetUsd:u=5,rationale:o,browser:f=!1,directorModel:h="",workerModel:g="",directorProviderId:b,workerProviderId:y,modelRationale:v,models:w,modelsLoading:k,modelsNote:S,modelsInheritNote:H,busy:Q,error:F,onStart:C,onDismiss:_,style:V}){const[$,W]=x.useState(s),[se,E]=x.useState(u),[B,q]=x.useState(!!f),[R,ne]=x.useState(h||""),[pe,fe]=x.useState(g||""),[ye,re]=x.useState(b),[ke,M]=x.useState(y),L=$!==s||Number(se)!==Number(u);return a.jsxs("section",{style:{background:"var(--bg-card)",border:"1px solid var(--brand)",borderRadius:"var(--r-md)",padding:"var(--sp-4)",display:"flex",flexDirection:"column",gap:"var(--sp-3)",...V},children:[a.jsxs("header",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[a.jsx(te,{name:"orchestration",size:16,color:"var(--brand)"}),a.jsx("span",{style:{fontSize:"var(--fs-lg)",fontWeight:"var(--fw-semibold)"},children:"Proposed mission"}),L&&a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"edited"})]}),o&&a.jsx("p",{style:{margin:0,fontSize:"var(--fs-sm)",color:"var(--ink-1)"},children:o}),a.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)"},children:"Brief"}),a.jsx("textarea",{value:$,onChange:J=>W(J.target.value),rows:6,style:{resize:"vertical",minHeight:"6rem",background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",padding:"var(--sp-2) var(--sp-3)",color:"var(--ink-0)",font:"inherit",lineHeight:"var(--lh-prose)",outline:"none"}})]}),c.length>0&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)"},children:"Done when"}),c.map((J,ve)=>a.jsxs("div",{style:{display:"flex",gap:8,alignItems:"flex-start",fontSize:"var(--fs-sm)",color:"var(--ink-1)"},children:[a.jsx("span",{style:{color:"var(--ink-2)",fontFamily:"var(--font-mono)",flex:"0 0 auto"},children:"▢"}),a.jsx("span",{children:J})]},ve))]}),v&&(h||g)&&a.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:6,fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[a.jsx(te,{name:"model",size:12}),a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--ink-1)"},children:"Suggested models —"})," ",v]})]}),a.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-4)",flexWrap:"wrap"},children:[a.jsx(al,{layout:"stacked",label:"Budget cap",hint:"Hard stop; the run halts here.",children:a.jsx(Je,{type:"number",prefix:"$",min:0,step:1,width:96,value:se,onChange:E})}),a.jsx(al,{layout:"stacked",label:"Director",hint:"Plans, delegates, verifies.",children:a.jsx(Ft,{value:R,models:w,loading:k,note:S,inheritNote:H,onChange:(J,ve)=>{ne(J),re(ve?.providerId)}})}),a.jsx(al,{layout:"stacked",label:"Workers",hint:"Implement. Cheaper models cut cost.",children:a.jsx(Ft,{value:pe,models:w,loading:k,note:S,inheritNote:H,onChange:(J,ve)=>{fe(J),M(ve?.providerId)}})}),a.jsx(al,{label:"Browser",hint:f?"The planner judged the criteria need a browser, so it starts on.":"Headless Playwright for the agents — navigate, click, screenshot. Non-local URLs still ask you.",children:a.jsx(Rt,{checked:B,onChange:q,label:B?"on":"off"})})]}),F&&a.jsx(It,{tone:"error",inline:!0,children:F}),a.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"var(--sp-2)"},children:[a.jsx(de,{variant:"ghost",onClick:_,disabled:Q,children:"Not this one"}),a.jsx(de,{variant:"primary",icon:"orchestration",disabled:Q||!$.trim(),title:"Starts the mission: a director plans it and workers do the work",onClick:()=>C?.({mission:$.trim(),budget:Number(se)||u,directorModel:R,workerModel:pe,directorProviderId:ye,workerProviderId:ke,browserTools:B}),children:Q?"Starting…":"Start mission"})]})]})}function _n({tabs:s,value:c,onChange:u,size:o="md",style:f}){return a.jsx("div",{role:"tablist",style:{display:"inline-flex",gap:2,padding:2,background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",...f},children:s.map(h=>a.jsx(d1,{tab:h,selected:h.value===c,size:o,onSelect:()=>u?.(h.value)},h.value))})}function d1({tab:s,selected:c,size:u,onSelect:o}){const[f,h]=x.useState(!1);return a.jsxs("button",{type:"button",role:"tab","aria-selected":c,onClick:o,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{display:"inline-flex",alignItems:"center",gap:6,padding:u==="sm"?"3px 8px":"5px 10px",borderRadius:4,border:"none",cursor:"pointer",fontSize:u==="sm"?"var(--fs-xs)":"var(--fs-sm)",fontWeight:c?"var(--fw-semibold)":"var(--fw-regular)",background:c?"var(--bg-card)":f?"var(--bg-hover)":"transparent",color:c?"var(--ink-0)":"var(--ink-1)",whiteSpace:"nowrap",boxShadow:c?"inset 0 0 0 1px var(--line-strong)":"none",transition:"background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease)"},children:[s.icon&&a.jsx(te,{name:s.icon,size:u==="sm"?12:14}),s.label,s.count>0&&a.jsx("span",{style:{fontSize:"var(--fs-xs)",padding:"0 5px",borderRadius:"var(--r-pill)",lineHeight:"16px",background:s.attention?"var(--status-warning)":"var(--line-strong)",color:s.attention?"var(--brand-ink)":"var(--ink-0)",fontWeight:"var(--fw-semibold)"},children:s.count})]})}const f1=[{value:"next",label:"Next turn",icon:"nextTurn"},{value:"now",label:"Now",icon:"now"}];function h1({agents:s=[],to:c,onTo:u,value:o,onChange:f,timing:h,onTiming:g,onSend:b,disabled:y,disabledReason:v,style:w}){const[k,S]=x.useState(""),[H,Q]=x.useState("director"),[F,C]=x.useState("next"),[_,V]=x.useState(!1),[$,W]=x.useState(!1),se=x.useRef(null),E=x.useRef(null),B=o??k,q=f??S,R=c??H,ne=u??Q,pe=h??F,fe=g??C,ye=s.filter(M=>M.status==="running"||M.id==="director"),re=!y&&B.trim().length>0;x.useEffect(()=>{const M=se.current;M&&(M.style.height="auto",M.style.height=Math.min(M.scrollHeight,132)+"px")},[B]),x.useEffect(()=>{if(!_)return;const M=L=>{E.current&&!E.current.contains(L.target)&&V(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[_]);const ke=()=>{re&&(b?.(B.trim(),{to:R,timing:pe}),q(""))};return a.jsxs("div",{ref:E,style:{position:"relative",flex:"0 0 auto",background:"var(--bg-card)",border:`1px solid ${$?"var(--brand)":"var(--line-strong)"}`,borderRadius:"var(--r-md)",padding:"var(--sp-2) var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-2)",opacity:y?.6:1,transition:"border-color var(--dur-fast) var(--ease)",...w},children:[a.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"flex-start"},children:[a.jsx(te,{name:"steer",size:15,color:"var(--brand)",style:{marginTop:3,flex:"0 0 auto"}}),a.jsx("textarea",{ref:se,rows:1,value:B,disabled:y,placeholder:y?v||"Nothing is running.":`Steer ${R}… a constraint, a correction, a hint. Not a question reply.`,onChange:M=>q(M.target.value),onFocus:()=>W(!0),onBlur:()=>W(!1),onKeyDown:M=>{(M.metaKey||M.ctrlKey)&&M.key==="Enter"&&(M.preventDefault(),ke())},style:{flex:1,minWidth:0,resize:"none",border:"none",outline:"none",background:"transparent",color:"var(--ink-0)",font:"inherit",lineHeight:"var(--lh)",padding:"2px 0",maxHeight:132}})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",flexWrap:"wrap"},children:[a.jsx(p1,{agent:R,open:_,onClick:()=>!y&&V(M=>!M),disabled:y}),a.jsx(_n,{size:"sm",tabs:f1,value:pe,onChange:fe}),a.jsx("span",{style:{marginLeft:"auto",fontSize:"var(--fs-xs)",color:"var(--ink-2)",whiteSpace:"nowrap"},children:pe==="now"?"Interrupts the current tool call":"Delivered before the next tool call"}),a.jsx(de,{size:"sm",icon:"send",onClick:ke,disabled:!re,title:"⌘↵",children:"Send"})]}),_&&a.jsx("div",{role:"listbox",style:{position:"absolute",left:"var(--sp-3)",bottom:"calc(100% - 4px)",zIndex:10,minWidth:220,background:"var(--bg-panel)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-sm)",boxShadow:"var(--shadow-pop, 0 8px 24px rgba(0,0,0,.35))",padding:4},children:ye.map(M=>a.jsx(v1,{agent:M,selected:M.id===R,onSelect:()=>{ne(M.id),V(!1),se.current?.focus()}},M.id))})]})}function p1({agent:s,open:c,onClick:u,disabled:o}){const[f,h]=x.useState(!1);return a.jsxs("button",{type:"button",onClick:u,disabled:o,"aria-haspopup":"listbox","aria-expanded":c,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"3px 8px 3px 6px",borderRadius:"var(--r-pill)",border:"1px solid var(--line)",cursor:o?"default":"pointer",background:c||f?"var(--bg-hover)":"var(--bg-inset)",color:"var(--ink-0)",font:"inherit",fontSize:"var(--fs-xs)"},children:[a.jsx("span",{style:{color:"var(--ink-2)"},children:"to"}),a.jsx(an,{agent:s,size:"sm"}),a.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:s}),a.jsx(te,{name:"chevronDown",size:12,color:"var(--ink-2)"})]})}function v1({agent:s,selected:c,onSelect:u}){const[o,f]=x.useState(!1);return a.jsxs("button",{type:"button",role:"option","aria-selected":c,onClick:u,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{display:"flex",alignItems:"center",gap:8,width:"100%",textAlign:"left",padding:"6px 8px",borderRadius:4,border:"none",cursor:"pointer",font:"inherit",background:o?"var(--bg-hover)":"transparent",color:"var(--ink-0)"},children:[a.jsx("span",{style:{width:12,display:"inline-flex",color:"var(--brand)"},children:c&&a.jsx(te,{name:"check",size:12,strokeWidth:2.5})}),a.jsx(an,{agent:s.id,size:"sm"}),a.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)"},children:s.id}),s.task&&a.jsx("span",{style:{marginLeft:"auto",fontSize:"var(--fs-xs)",color:"var(--ink-2)",maxWidth:140,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.task})]})}function g1({agents:s=[],filter:c,onFilter:u,style:o}){return a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",...o},children:[a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:"var(--fs-xs)",color:"var(--ink-2)",marginRight:2},children:[a.jsx(te,{name:"crew",size:12}),"Crew"]}),s.map(f=>{const h=c===f.id;return a.jsxs("button",{type:"button",onClick:()=>u?.(f.id),title:f.task||f.id,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"2px 8px 2px 6px",borderRadius:"var(--r-pill)",background:h?"var(--bg-card)":"var(--bg-inset)",border:`1px solid ${h?"var(--line-strong)":"var(--line)"}`,color:h?"var(--ink-0)":"var(--ink-1)",fontSize:"var(--fs-xs)",cursor:"pointer",font:"inherit",lineHeight:"16px"},children:[a.jsx(an,{agent:f.id,size:"sm"}),f.id,a.jsx(te,{name:f.status||"running",size:11,strokeWidth:2.25,color:f.status==="error"?"var(--status-critical)":f.status==="interrupted"?"var(--status-serious)":f.status==="idle"?"var(--ink-2)":"var(--status-good)"})]},f.id)})]})}function m1({mission:s,title:c,createdAt:u,costUsd:o=0,costBasis:f="priced",usage:h,status:g="done",selected:b,current:y,onSelect:v,style:w}){const[k,S]=x.useState(!1),H=Number(o)||0,Q=h?(h.inputTokens||0)+(h.outputTokens||0)+(h.cacheReadTokens||0)+(h.cacheWriteTokens||0):0,F=f==="priced"?`$${H.toFixed(2)}`:f==="unpriced"&&Q>0?`${El(Q)} tok`:null,C=u?new Date(u).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):null;return a.jsxs("div",{role:"button",title:s,onClick:v,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),style:{padding:"6px 10px",borderRadius:"var(--r-sm)",cursor:v?"pointer":"default",background:b?"var(--bg-card)":k&&v?"var(--bg-hover)":"transparent",border:b?"1px solid var(--line-strong)":"1px solid transparent",marginBottom:2,transition:"background var(--dur-fast) var(--ease)",...w},children:[a.jsx("div",{style:{fontSize:"var(--fs-sm)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",color:"var(--ink-0)",fontWeight:y?"var(--fw-semibold)":"var(--fw-regular)"},children:c||s}),a.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"center",marginTop:2,fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums"},children:[C&&a.jsx("span",{children:C}),F&&a.jsx("span",{title:f==="unpriced"?"This provider publishes no prices; tokens are what is known.":void 0,children:F}),a.jsx(Tl,{status:g})]})]})}function y1({agent:s,title:c,toolName:u,decisionReason:o,input:f,escapedPath:h,onAllow:g,onAlways:b,onDeny:y,style:v}){const w=u||(c||"").replace(/^Wants to use\s+/i,"")||"tool",k=h?{label:"Allow this path (run)",hint:`Allow ${h} for the rest of the run; other paths outside the folder will still ask`}:{label:"Always (run)",hint:"Allow this tool for the rest of the run"};return a.jsxs(Bc,{accent:"var(--brand)",style:{marginBottom:"var(--sp-2)",...v},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:"var(--fw-semibold)",color:"var(--brand)",fontSize:"var(--fs-sm)"},children:[a.jsx(te,{name:"approval",size:14,strokeWidth:2}),a.jsxs("span",{children:[s," wants to use ",w]})]}),o&&a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,color:"var(--status-serious)",fontSize:"var(--fs-xs)",marginTop:4},children:[a.jsx(te,{name:"caution",size:12,strokeWidth:2}),o]}),a.jsx(Hp,{tool:w,input:typeof f=="string"?void 0:f,body:typeof f=="string"?f:void 0,defaultOpen:!0,style:{margin:"var(--sp-2) 0"}}),a.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",flexWrap:"wrap",justifyContent:"flex-end"},children:[a.jsx(de,{variant:"good",onClick:g,children:"Allow"}),a.jsx(de,{variant:"good",onClick:b,title:k.hint,children:k.label}),a.jsx(de,{variant:"danger",onClick:y,children:"Deny"})]})]})}const x1=x.forwardRef(function({value:c,onChange:u,placeholder:o,size:f="mission",bare:h,onKeyDown:g,onPaste:b,onFocus:y,onBlur:v,style:w},k){const S=f==="mission";return a.jsx("textarea",{ref:k,value:c,placeholder:o,onKeyDown:g,onPaste:b,onFocus:y,onBlur:v,onChange:H=>u?.(H.target.value),style:{width:"100%",boxSizing:"border-box",display:"block",minHeight:S?180:void 0,height:S?void 0:56,resize:"vertical",background:h?"transparent":S?"var(--bg-card)":"var(--bg-inset)",border:h?"none":"1px solid var(--line-strong)",outline:h?"none":void 0,borderRadius:h?0:S?"var(--r-md)":"var(--r-sm)",padding:S?"var(--sp-3)":"var(--sp-2)",color:"var(--ink-0)",lineHeight:S?"var(--lh-prose)":"var(--lh)",...w}})});function b1({question:s,options:c=[],value:u,onChange:o,onAnswer:f,style:h}){const[g,b]=x.useState(""),y=u??g,v=o??b;return a.jsxs(Bc,{accent:"var(--brand)",style:{marginBottom:"var(--sp-2)",...h},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:"var(--fw-semibold)",color:"var(--brand)",fontSize:"var(--fs-sm)",marginBottom:4},children:[a.jsx(te,{name:"question",size:14,strokeWidth:2}),"Director asks:"]}),a.jsx("div",{style:{whiteSpace:"pre-wrap",fontSize:"var(--fs-md)"},children:s}),c.length>0&&a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,margin:"var(--sp-2) 0 0"},children:c.map((w,k)=>a.jsxs("button",{type:"button",onClick:()=>f?.(w),title:k===0?"Recommended":void 0,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 10px",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",fontSize:"var(--fs-sm)",background:"var(--bg-inset)",border:"1px solid var(--line-strong)",color:"var(--ink-0)"},children:[a.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:k+1}),w,k===0&&a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"· recommended"})]},w))}),a.jsx("div",{style:{margin:"var(--sp-2) 0"},children:a.jsx(x1,{size:"answer",value:y,onChange:v})}),a.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:a.jsx(de,{variant:"primary",onClick:()=>f?.(y),disabled:!String(y).trim(),children:"Answer"})})]})}function S1(s,c){if(!s)return"";const u=Math.max(0,Math.round((c-s)/1e3));return u<60?`${u}s`:u<3600?`${Math.floor(u/60)}m`:`${Math.floor(u/3600)}h ${Math.floor(u%3600/60)}m`}function op({since:s,now:c}){const u=S1(s,c);return u?a.jsxs("div",{style:{fontSize:"var(--fs-xs)",color:"var(--status-warning)",fontWeight:"var(--fw-semibold)",marginBottom:4},children:["waiting ",u]}):null}function j1({approvals:s=[],questions:c=[],now:u=Date.now(),running:o=!1,activity:f,onAllow:h,onAlways:g,onDeny:b,onAnswer:y,style:v}){const w=s.length+c.length;if(w===0&&!o||w===0&&!f)return null;const k={flex:"0 0 auto",padding:"var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--line)",...v};return w===0?a.jsxs("div",{role:"status",style:{...k,display:"flex",alignItems:"center",gap:"var(--sp-2)",background:"var(--bg-panel)",fontSize:"var(--fs-sm)",minWidth:0},children:[a.jsx(te,{name:"running",size:14,color:"var(--status-good)",strokeWidth:2}),f.agent&&a.jsx(an,{agent:f.agent,size:"sm"}),a.jsx("span",{style:{color:"var(--ink-0)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},title:f.line,children:f.line}),f.crew&&a.jsx("span",{style:{marginLeft:"auto",flex:"0 0 auto",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:f.crew})]}):a.jsxs("div",{role:"region","aria-label":"Needs you",style:{...k,background:"var(--brand-wash-strong)",borderTop:"2px solid var(--status-warning)",display:"flex",flexDirection:"column",gap:"var(--sp-2)",maxHeight:"55vh",overflowY:"auto"},children:[a.jsxs("div",{className:"pulse",style:{display:"flex",alignItems:"center",gap:6,fontSize:"var(--fs-xs)",color:"var(--status-warning)",fontWeight:"var(--fw-semibold)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)"},children:[a.jsx(te,{name:"needsYou",size:13,strokeWidth:2.25}),"Needs you — ",[s.length?`${s.length} approval${s.length===1?"":"s"}`:null,c.length?`${c.length} question${c.length===1?"":"s"}`:null].filter(Boolean).join(", ")]}),s.map(S=>a.jsxs("div",{children:[a.jsx(op,{since:S.since,now:u}),a.jsx(y1,{agent:S.agent,title:S.title,toolName:S.toolName,decisionReason:S.decisionReason,input:S.input,escapedPath:S.escapedPath,onAllow:()=>h?.(S.id),onAlways:()=>g?.(S.id),onDeny:()=>b?.(S.id)})]},S.id)),c.map(S=>a.jsxs("div",{children:[a.jsx(op,{since:S.since,now:u}),a.jsx(b1,{question:S.question,options:S.options,onAnswer:H=>y?.(S.id,H)})]},S.id))]})}function Gp(s){if(!s)return null;const c=String(s).split(`
62
+ `),u=c.findIndex(f=>/^#{1,6}\s*DONE\s*WHEN/i.test(f.trim()));if(u===-1)return null;const o=[];for(const f of c.slice(u+1)){if(/^#{1,6}\s/.test(f))break;const h=f.match(/^\s*[-*]\s*\[( |x|X)\]\s*(.*)$/);if(!h)continue;const g=h[2].trim().replace(/\*\*(.+?)\*\*/g,"$1").replace(/`([^`]*)`/g,"$1");o.push({text:g,done:h[1]!==" "})}return o.length?o:null}function k1(s){return s?`Done when · ${s.filter(c=>c.done).length} / ${s.length}`:"Done when"}function w1({doc:s,style:c}){const u=Gp(s),o=u?u.filter(f=>f.done).length:0;return a.jsxs("section",{style:c,children:[a.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--sp-2)",marginBottom:"var(--sp-2)",fontSize:"var(--fs-xs)",fontWeight:"var(--fw-semibold)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)",color:"var(--ink-2)"},children:[a.jsx("span",{children:"Done when"}),u&&a.jsxs("span",{style:{fontVariantNumeric:"tabular-nums",textTransform:"none",letterSpacing:0,color:o===u.length?"var(--status-good)":"var(--ink-1)"},children:[o," / ",u.length]})]}),!s&&a.jsx(st,{children:"MISSION.md not written yet."}),s&&!u&&a.jsx(st,{children:"No DONE WHEN section in the mission doc."}),u&&u.map((f,h)=>a.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-2)",padding:"3px 0",fontSize:"var(--fs-sm)",lineHeight:"var(--lh)",color:f.done?"var(--ink-2)":"var(--ink-0)"},children:[a.jsx(te,{name:f.done?"done":"idle",size:14,strokeWidth:2,color:f.done?"var(--status-good)":"var(--ink-2)",style:{marginTop:2}}),a.jsx("span",{style:{textDecoration:f.done?"line-through":"none"},children:f.text})]},h))]})}function z1({text:s,truncated:c,style:u}){const o=String(s||"").split(`
63
+ `);return a.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",lineHeight:"var(--lh)",background:"var(--bg-inset)",overflowX:"auto",...u},children:[o.map((f,h)=>{const g=f.startsWith("@@")||f.startsWith("diff ")||f.startsWith("index ")||f.startsWith("--- ")||f.startsWith("+++ "),b=!g&&f.startsWith("+"),y=!g&&f.startsWith("-");return a.jsx("div",{style:{padding:"0 var(--sp-2)",whiteSpace:"pre",background:b?"var(--diff-add-bg)":y?"var(--diff-del-bg)":"transparent",color:g?"var(--ink-2)":"var(--ink-0)"},children:f||" "},h)}),c&&a.jsx("div",{style:{padding:"2px var(--sp-2)",color:"var(--ink-2)",fontFamily:"var(--font-ui)"},children:"first 400 lines — the rest is in your working tree"})]})}const Mc=512*1024;function T1({artifact:s,url:c,previewUrl:u,onClose:o,index:f,count:h,onStep:g}){const b=/\.html?$/i.test(s?.path??""),[y,v]=x.useState("rendered"),w=typeof g=="function"&&typeof h=="number"&&h>1,k=w&&f>0?()=>g(f-1):null,S=w&&f<h-1?()=>g(f+1):null,[H,Q]=x.useState(null),[F,C]=x.useState(null),_=s?.kind,V=_==="diff",$=s?.path?.split("/").pop()??"",W=/\.md$/i.test($);if(x.useEffect(()=>{const q=R=>{R.key==="Escape"?o():R.key==="ArrowLeft"&&k?(R.preventDefault(),k()):R.key==="ArrowRight"&&S&&(R.preventDefault(),S())};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[o,k,S]),x.useEffect(()=>{if(Q(null),C(null),_!=="text"||!c)return;let q=!0;return fetch(c).then(async R=>{if(!R.ok)throw new Error(`HTTP ${R.status}`);const ne=await R.text();q&&Q(ne.length>Mc?`${ne.slice(0,Mc)}
64
+
65
+ [… ${ne.length-Mc} more characters — open in a new tab for the whole file]`:ne)}).catch(R=>{q&&C(String(R.message||R))}),()=>{q=!1}},[c,_]),!s)return null;const se=typeof s.size!="number"?null:s.size>=1024*1024?`${(s.size/1024/1024).toFixed(1)} MB`:s.size>=1024?`${(s.size/1024).toFixed(1)} KB`:`${s.size} B`;let E;return V&&s.binary&&c&&/\.(png|jpe?g|webp|gif|svg)$/i.test($)?E=a.jsx("img",{src:c,alt:s.path,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block",margin:"auto",background:"var(--bg-inset)"}}):V?E=s.binary?a.jsx("div",{style:{margin:"auto",color:"var(--ink-2)"},children:"Binary file — no diff to show."}):s.diff?a.jsx(z1,{text:s.diff,truncated:s.truncated,style:{minHeight:"100%"}}):a.jsx("div",{style:{margin:"auto",color:"var(--ink-2)"},children:"No diff recorded for this file."}):b&&u&&y==="rendered"?E=a.jsx("iframe",{title:s.path,src:u,sandbox:"allow-scripts",style:{width:"100%",height:"100%",border:"none",background:"#fff"}}):_==="image"?E=a.jsx("img",{src:c,alt:s.path,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block",margin:"auto",background:"var(--bg-inset)"}}):_==="pdf"?E=a.jsx("iframe",{title:s.path,src:c,style:{width:"100%",height:"100%",border:"none",background:"var(--bg-inset)"}}):_==="text"?E=F?a.jsxs("div",{style:{padding:"var(--sp-3)",color:"var(--status-critical)"},children:["Could not load it: ",F]}):H===null?a.jsx("div",{style:{padding:"var(--sp-3)",color:"var(--ink-2)"},children:"Loading…"}):W?a.jsx("div",{style:{padding:"var(--sp-3) var(--sp-4)",maxWidth:"72ch",margin:"0 auto"},children:a.jsx(qc,{text:H,slots:!1})}):a.jsx("pre",{style:{margin:0,padding:"var(--sp-3) var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--ink-0)",tabSize:2},children:H}):E=a.jsxs("div",{style:{margin:"auto",textAlign:"center",color:"var(--ink-2)",display:"flex",flexDirection:"column",gap:"var(--sp-2)",alignItems:"center"},children:[a.jsx(te,{name:"file",size:28,color:"var(--ink-3)"}),a.jsx("span",{children:"No preview for this kind of file."}),a.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--brand)"},children:["Download ",$]})]}),a.jsx("div",{role:"dialog","aria-modal":"true","aria-label":s.path,onClick:o,style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center",padding:"var(--sp-4)"},children:a.jsxs("div",{onClick:q=>q.stopPropagation(),style:{width:"min(1200px, 100%)",height:"min(900px, 100%)",display:"flex",flexDirection:"column",background:"var(--bg-card)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-md)",boxShadow:"0 24px 64px rgba(0,0,0,0.35)",overflow:"hidden"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"6px var(--sp-2) 6px var(--sp-3)",borderBottom:"1px solid var(--line)",background:"var(--bg-panel)",flex:"0 0 auto",minWidth:0},children:[a.jsx(te,{name:_==="image"?"Image":_==="text"?"transcript":"file",size:14,color:"var(--ink-2)"}),V&&s.status&&a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",flex:"0 0 auto"},children:s.status}),a.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:1},title:s.path,children:s.path}),V?a.jsxs("span",{style:{fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",fontVariantNumeric:"tabular-nums",flex:"0 0 auto"},children:[a.jsxs("span",{style:{color:"var(--status-good)"},children:["+",s.additions??0]})," ",a.jsxs("span",{style:{color:"var(--status-critical)"},children:["−",s.deletions??0]})]}):se&&a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums",flex:"0 0 auto"},children:se}),b&&u&&a.jsx(_n,{size:"sm",value:y,onChange:v,tabs:[{value:"rendered",label:"Rendered"},{value:"source",label:"Source"}]}),w&&a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:2,flex:"0 0 auto",marginLeft:"var(--sp-1)"},children:[a.jsx(Ml,{icon:"chevronLeft",label:"Previous (←)",onClick:k??void 0,disabled:!k,size:"sm"}),a.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums",minWidth:"4.5ch",textAlign:"center"},children:[f+1," / ",h]}),a.jsx(Ml,{icon:"chevronRight",label:"Next (→)",onClick:S??void 0,disabled:!S,size:"sm"})]}),c&&!V&&a.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none",flex:"0 0 auto"},children:a.jsx(de,{variant:"ghost",size:"sm",children:"Open in a new tab"})}),a.jsx(Ml,{icon:"close",label:"Close (Esc)",onClick:o,size:"sm"})]}),a.jsx("div",{style:{flex:1,minHeight:0,overflow:"auto",display:"flex",flexDirection:"column",background:_==="image"?"var(--bg-inset)":"var(--bg-card)"},children:E})]})})}const M1={added:"added",modified:"modified",deleted:"deleted",renamed:"renamed"},cp={added:"var(--status-good)",deleted:"var(--status-critical)",modified:"var(--ink-1)",renamed:"var(--ink-1)"};function Ec(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(s<10*1024?1:0)} KB`:`${(s/1024/1024).toFixed(1)} MB`}function up(s,c){const u=Math.max(0,Math.round((c-s)/1e3));return u<60?`${u}s ago`:u<3600?`${Math.floor(u/60)}m ago`:u<86400?`${Math.floor(u/3600)}h ago`:`${Math.floor(u/86400)}d ago`}function E1(s,c){return`/runs/${encodeURIComponent(s)}/preview/${c.split("/").map(encodeURIComponent).join("/")}`}function dp(s,c){return`/runs/${encodeURIComponent(s)}/artifact?path=${encodeURIComponent(c)}`}function fp({path:s,muted:c,strike:u}){const o=s.lastIndexOf("/"),f=o>=0?s.slice(0,o+1):"",h=o>=0?s.slice(o+1):s;return a.jsxs("span",{title:s,style:{fontFamily:"var(--font-mono)",display:"flex",minWidth:0,flex:1,color:c?"var(--ink-2)":"var(--ink-0)",textDecoration:u?"line-through":"none"},children:[f&&a.jsx("span",{style:{color:"var(--ink-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:"0 1 auto"},children:f}),a.jsx("span",{style:{whiteSpace:"nowrap",flex:"0 0 auto"},children:h})]})}const Xp={display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"4px 6px",width:"100%",fontSize:"var(--fs-sm)",color:"inherit",minWidth:0,background:"none",border:"none",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",textAlign:"left"};function hp({onClick:s,title:c,children:u}){const[o,f]=x.useState(!1);return a.jsx("button",{type:"button",onClick:s,title:c,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{...Xp,background:o?"var(--bg-hover)":"none"},children:u})}function _1({runId:s,deck:c,loading:u,error:o,missing:f,services:h=[],style:g}){const b=Date.now(),[y,v]=x.useState(null),w={display:"flex",flexDirection:"column",gap:"var(--sp-3)",...g};if(o)return a.jsx("div",{style:w,children:a.jsxs(st,{children:["Could not read the working tree: ",o]})});if(f||!c&&!u)return a.jsx("div",{style:w,children:a.jsx(st,{children:"No file record for this run — the server has no baseline for it."})});if(!c)return a.jsx("div",{style:w,children:a.jsx(st,{children:"Reading the working tree…"})});const{files:k,artifacts:S,totals:H}=c,Q=S.filter(E=>E.kind==="image"),F=S.filter(E=>E.kind!=="image"),C=[...k.map(E=>({...E,kind:"diff"})),...Q,...F],_=E=>v(E),V=E=>v(k.length+E),$=E=>v(k.length+Q.length+E),W=y===null?null:C[y]??null,se=c.baseline.kind==="git"&&c.baseline.head?`against ${String(c.baseline.head).slice(0,8)}`:c.baseline.kind==="snapshot"?"against a snapshot at run start":"no baseline";return a.jsxs("div",{style:w,children:[a.jsxs("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums",lineHeight:"var(--lh)"},children:[a.jsxs("span",{style:{color:"var(--ink-0)"},children:[H.files," changed · ",a.jsxs("span",{style:{color:"var(--status-good)"},children:["+",H.additions]})," ",a.jsxs("span",{style:{color:"var(--status-critical)"},children:["−",H.deletions]})," · ",S.length," artifact",S.length===1?"":"s"]})," ",a.jsx("span",{children:se}),c.note&&a.jsx("div",{style:{color:"var(--status-serious)"},children:c.note})]}),h.length>0&&a.jsxs("section",{children:[a.jsx(ln,{children:"Services"}),a.jsx("div",{style:{display:"flex",flexDirection:"column"},children:h.map(E=>a.jsxs("a",{href:E.path,target:"_blank",rel:"noopener noreferrer",title:`${E.label} — 127.0.0.1:${E.port} through Foreman`,style:{...Xp,textDecoration:"none"},children:[a.jsx(te,{name:"provider",size:12,color:"var(--status-good)"}),a.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--ink-0)"},children:E.label}),a.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)",flex:"0 0 auto"},children:[":",E.port]})]},E.port))})]}),a.jsxs("section",{children:[a.jsx(ln,{children:"Changed files"}),k.length===0&&a.jsx(st,{children:"Nothing changed in the folder yet."}),a.jsx("div",{style:{display:"flex",flexDirection:"column"},children:k.map((E,B)=>a.jsxs(hp,{onClick:()=>_(B),title:E.binary?`${E.path} — binary, no diff`:E.preexisting?`${E.path} — also dirty before the run`:`${E.path} — open the diff`,children:[a.jsx(te,{name:"file",size:12,color:"var(--ink-2)"}),a.jsx(fp,{path:E.path,muted:E.status==="deleted",strike:E.status==="deleted"}),a.jsx("span",{style:{fontSize:"var(--fs-xs)",padding:"0 5px",borderRadius:"var(--r-pill)",lineHeight:"15px",border:`1px solid ${cp[E.status]||"var(--line-strong)"}`,color:cp[E.status]||"var(--ink-1)",flex:"0 0 auto"},children:E.binary?"binary":M1[E.status]||E.status}),a.jsxs("span",{style:{fontVariantNumeric:"tabular-nums",fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",flex:"0 0 auto"},children:[a.jsxs("span",{style:{color:"var(--status-good)"},children:["+",E.additions]})," ",a.jsxs("span",{style:{color:"var(--status-critical)"},children:["−",E.deletions]})]})]},`${E.status}:${E.path}`))})]}),a.jsxs("section",{children:[a.jsx(ln,{children:"Artifacts"}),S.length===0&&a.jsx(st,{children:"No screenshots or work files yet."}),Q.length>0&&a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(88px, 1fr))",gap:6,marginBottom:F.length?"var(--sp-2)":0},children:Q.map((E,B)=>a.jsxs("button",{type:"button",onClick:()=>V(B),title:`${E.path} · ${Ec(E.size)} · ${up(E.mtimeMs,b)}`,style:{display:"block",padding:0,width:"100%",cursor:"pointer",font:"inherit",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",overflow:"hidden",background:"var(--bg-inset)",color:"inherit",textAlign:"left"},children:[a.jsx("img",{src:dp(s,E.path),alt:E.path,loading:"lazy",style:{display:"block",width:"100%",aspectRatio:"4 / 3",objectFit:"cover"}}),a.jsx("div",{style:{padding:"2px 5px",fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",color:"var(--ink-1)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E.path.split("/").pop()})]},E.path))}),a.jsx("div",{style:{display:"flex",flexDirection:"column"},children:F.map((E,B)=>a.jsxs(hp,{onClick:()=>$(B),title:`${E.path} · ${Ec(E.size)} · ${up(E.mtimeMs,b)}`,children:[a.jsx(te,{name:E.kind==="text"?"transcript":"file",size:12,color:"var(--ink-2)"}),a.jsx(fp,{path:E.path}),a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums",flex:"0 0 auto"},children:Ec(E.size)})]},E.path))})]}),W&&a.jsx(T1,{artifact:W,url:W.kind==="diff"&&!W.binary?void 0:dp(s,W.path),previewUrl:W.kind==="diff"?void 0:E1(s,W.path),onClose:()=>v(null),index:y,count:C.length,onStep:v})]})}function C1({effective:s={},overrides:c=[],onOpen:u,style:o}){const f=new Set(c),h=y=>typeof y=="number"?`${y}%`:"—",g=y=>typeof y=="number"?`$${y}`:"—",b=[["director",s.directorModel||"default","directorModel"],["workers",s.workerModel||"default","workerModel"],["planner",s.plannerModel||"sonnet","plannerModel"],["cap per run",g(s.budgetCap),"budgetCap"],["warn at",h(s.budgetWarnAt),"budgetWarnAt"],["at the cap",s.budgetHardStop===!1?"pause and ask":"hard stop","budgetHardStop"],["read-only tools",s.autoAllowReadOnly===!1?"ask":"auto-allow","autoAllowReadOnly"]];return a.jsxs("section",{style:{minWidth:0,...o},children:[a.jsx(ln,{children:"Settings"}),a.jsx("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr auto",columnGap:10,rowGap:2,fontSize:"var(--fs-xs)",alignItems:"baseline"},children:b.map(([y,v,w])=>a.jsxs(Cn.Fragment,{children:[a.jsx("span",{style:{color:"var(--ink-2)"},children:y}),a.jsx("span",{style:{fontFamily:"var(--font-mono)",color:"var(--ink-1)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},title:String(v),children:v}),a.jsx("span",{style:{color:"var(--brand)",fontSize:"var(--fs-xs)"},title:f.has(w)?"Set on this project; the rest inherit Global":void 0,children:f.has(w)?"override":""})]},w))}),u&&a.jsx(de,{variant:"ghost",size:"sm",icon:"settings",onClick:u,style:{marginTop:6},title:"Open this project's settings",children:"Change…"})]})}const A1=[{value:"default",label:"Server default"},{value:"claude-code",label:"Claude Code",icon:"model"},{value:"anthropic-api",label:"Anthropic API",icon:"budget"},{value:"codex",label:"Codex",icon:"Bash"},{value:"openai-compatible",label:"Custom endpoint",icon:"WebFetch"}];function D1(s){const c=`pr-${Math.random().toString(16).slice(2,10)}`;switch(s){case"claude-code":return{kind:s};case"anthropic-api":return{kind:s,id:c,apiKeyEnv:""};case"codex":return{kind:s,id:c};case"openai-compatible":return{kind:s,id:c,baseUrl:""};default:return null}}function pp(){return a.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",marginTop:4},children:"Names an environment variable on the server. A stored key below takes precedence; leave both empty and this endpoint needs no credential."})}function vp({providerId:s,hasKey:c,busy:u,error:o,onStore:f,onClear:h}){const[g,b]=x.useState(""),[y,v]=x.useState(!1);return!f||!s?null:a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",flexWrap:"wrap"},children:[a.jsx("span",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-1)"},children:c?"A key is stored for this provider.":"No key stored."}),c&&a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"It cannot be shown — only replaced or removed."}),a.jsxs("span",{style:{marginLeft:"auto",display:"inline-flex",gap:"var(--sp-2)"},children:[a.jsx(de,{size:"sm",variant:"ghost",onClick:()=>v(w=>!w),children:y?"Cancel":c?"Replace":"Add a key"}),c&&a.jsx(de,{size:"sm",variant:"danger",disabled:u,onClick:()=>h?.(s),children:"Remove"})]})]}),y&&a.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"center"},children:[a.jsx(Je,{mono:!0,type:"password",placeholder:"paste the key",value:g,onChange:b,autoFocus:!0,onKeyDown:w=>{w.key==="Enter"&&g.trim()&&(f(s,g.trim()),b(""),v(!1))}}),a.jsx(de,{size:"sm",variant:"good",disabled:u||!g.trim(),onClick:()=>{f(s,g.trim()),b(""),v(!1)},children:u?"Saving…":"Save key"})]}),o&&a.jsx(It,{tone:"error",inline:!0,children:o})]})}function Qt({label:s,children:c}){return a.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:4},children:[a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:s}),c]})}function R1({inst:s,selected:c,onClick:u}){const[o,f]=x.useState(!1);return a.jsxs("button",{type:"button",onClick:u,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{display:"flex",alignItems:"center",gap:8,textAlign:"left",width:"100%",padding:"6px 8px",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",background:c?"var(--brand-wash-strong)":o?"var(--bg-hover)":"transparent",border:`1px solid ${c?"var(--brand)":"var(--line)"}`},children:[a.jsx(te,{name:"model",size:13,color:c?"var(--brand)":"var(--ink-2)"}),a.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:s.configDir,children:Zs(s.configDir)}),a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:s.origin}),s.hasStoredLogin&&a.jsx("span",{title:"Has a stored login",style:{width:6,height:6,borderRadius:"var(--r-pill)",background:"var(--status-good)",flex:"0 0 auto"}})]})}function O1({value:s,onChange:c,instances:u,ollama:o,hasKey:f,keyBusy:h,keyError:g,onStoreKey:b,onClearKey:y,style:v}){const[w,k]=x.useState(!1),S=s?.kind??"default",H=C=>c({...s,...C}),Q=C=>c(D1(C)),F=S==="openai-compatible"&&o&&s.baseUrl===o.host;return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)",...v},children:[a.jsx(_n,{size:"sm",value:S,onChange:Q,tabs:A1}),S==="default"&&a.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"Runs on whatever the server itself authenticates as."}),S==="claude-code"&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[u?.length>0&&a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:u.map(C=>a.jsx(R1,{inst:C,selected:(s.configDir??"")===C.configDir,onClick:()=>H({configDir:C.configDir})},C.configDir))}),a.jsx(Qt,{label:"Config dir (blank inherits the server's own install)",children:a.jsx(Je,{mono:!0,placeholder:"~/.claude-work",value:s.configDir??"",onChange:C=>H({configDir:C||void 0})})}),w?a.jsx(Qt,{label:"Executable (blank uses the SDK's bundled one)",children:a.jsx(Je,{mono:!0,placeholder:"/usr/local/bin/claude",value:s.executable??"",onChange:C=>H({executable:C||void 0})})}):a.jsx("button",{type:"button",onClick:()=>k(!0),style:{alignSelf:"flex-start",background:"none",border:0,padding:0,font:"inherit",fontSize:"var(--fs-xs)",color:"var(--ink-2)",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:"Pin an executable too"}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[a.jsx(Rt,{checked:!!s.ownLogin,onChange:C=>H({ownLogin:C||void 0})}),a.jsx("span",{style:{fontSize:"var(--fs-sm)"},children:"Own login"})]}),a.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"Strips any inherited API key from this project's agents so this install's own stored subscription pays, instead of whatever the server process authenticates as."})]}),S==="anthropic-api"&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[a.jsx(vp,{providerId:s.id,hasKey:f,busy:h,error:g,onStore:b,onClear:y}),a.jsx(Qt,{label:"Environment variable (optional fallback)",children:a.jsx(Je,{mono:!0,placeholder:"ANTHROPIC_API_KEY_ALPHA",value:s.apiKeyEnv??"",onChange:C=>H({apiKeyEnv:C})})}),a.jsx(pp,{}),a.jsx(Qt,{label:"Model (blank uses the provider's default)",children:a.jsx(Je,{mono:!0,placeholder:"claude-sonnet-4-5",value:s.model??"",onChange:C=>H({model:C||void 0})})})]}),S==="codex"&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[a.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"Reads the login `codex login` already stored — Foreman never mints its own token."}),a.jsx(Qt,{label:"Codex home (blank is ~/.codex)",children:a.jsx(Je,{mono:!0,placeholder:"~/.codex",value:s.codexHome??"",onChange:C=>H({codexHome:C||void 0})})}),w?a.jsx(Qt,{label:"Upstream URL (blank is the public ChatGPT backend)",children:a.jsx(Je,{mono:!0,placeholder:"https://chatgpt.com/backend-api/codex",value:s.upstreamUrl??"",onChange:C=>H({upstreamUrl:C||void 0})})}):a.jsx("button",{type:"button",onClick:()=>k(!0),style:{alignSelf:"flex-start",background:"none",border:0,padding:0,font:"inherit",fontSize:"var(--fs-xs)",color:"var(--ink-2)",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:"Point at a different upstream"}),a.jsx(Qt,{label:"Model (blank uses Codex's own default)",children:a.jsx(Je,{mono:!0,placeholder:"gpt-5-codex",value:s.model??"",onChange:C=>H({model:C||void 0})})})]}),S==="openai-compatible"&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[o&&a.jsxs("button",{type:"button",onClick:()=>H({baseUrl:o.host,label:"Ollama"}),style:{display:"flex",alignItems:"center",gap:8,textAlign:"left",width:"100%",padding:"6px 8px",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",background:F?"var(--brand-wash-strong)":"transparent",border:`1px solid ${F?"var(--brand)":"var(--line)"}`},children:[a.jsx(te,{name:"Bash",size:13,color:F?"var(--brand)":"var(--ink-2)"}),a.jsx("span",{style:{fontSize:"var(--fs-sm)",flex:1},children:"Use local Ollama"}),a.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[o.host," · ",o.models.length," model",o.models.length===1?"":"s"]})]}),a.jsx(Qt,{label:"Base URL",children:a.jsx(Je,{mono:!0,placeholder:"http://127.0.0.1:11434",value:s.baseUrl??"",onChange:C=>H({baseUrl:C})})}),F&&o.models.length>0?a.jsx(Qt,{label:"Model (blank lets the run pick)",children:a.jsxs("select",{value:s.model??"",onChange:C=>H({model:C.target.value||void 0}),style:{font:"inherit",fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",padding:"6px 8px",borderRadius:"var(--r-sm)",border:"1px solid var(--line-strong)",background:"var(--bg-card)",color:"var(--ink-0)"},children:[a.jsx("option",{value:"",children:"— server picks —"}),o.models.map(C=>a.jsxs("option",{value:C.id,children:[C.id,C.remote?" (cloud)":""]},C.id))]})}):a.jsx(Qt,{label:"Model (blank lets the run pick)",children:a.jsx(Je,{mono:!0,placeholder:"llama3.1",value:s.model??"",onChange:C=>H({model:C||void 0})})}),a.jsx(Qt,{label:"Label (shown in place of the raw URL)",children:a.jsx(Je,{placeholder:"OpenRouter",value:s.label??"",onChange:C=>H({label:C||void 0})})}),a.jsx(Qt,{label:"Environment variable (blank when the endpoint needs no key)",children:a.jsx(Je,{mono:!0,placeholder:"OPENROUTER_API_KEY",value:s.apiKeyEnv??"",onChange:C=>H({apiKeyEnv:C||void 0})})}),!!s.apiKeyEnv&&a.jsx(pp,{}),a.jsx(vp,{providerId:s.id,hasKey:f,busy:h,error:g,onStore:b,onClear:y}),a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-sm)"},children:[a.jsx(Rt,{checked:s.needsKey===!0,onChange:C=>H({needsKey:C||void 0})}),"This endpoint requires a credential"]})]})]})}function N1({status:s,busy:c,error:u,onSaveToken:o,onClearToken:f,onLink:h,onUnlink:g,onTest:b,onSavePublicUrl:y,style:v}){const[w,k]=x.useState(""),[S,H]=x.useState(!1),[Q,F]=x.useState(null),C=s?.telegram,_=!!C?.hasToken,V=!!C?.chatId,$=C?.linking,W=Q??s?.publicUrl??"",se=Q!==null&&Q!==(s?.publicUrl??""),E=(B,q,R)=>a.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-3)",padding:"var(--sp-2) 0",borderTop:"1px solid var(--line)"},children:[a.jsxs("div",{style:{flex:"0 0 180px"},children:[a.jsx("div",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-0)"},children:B}),q&&a.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",lineHeight:"var(--lh)"},children:q})]}),a.jsx("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:6},children:R})]});return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)",marginTop:"var(--sp-3)",...v},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:"var(--fs-sm)",fontWeight:"var(--fw-semibold)"},children:[a.jsx(te,{name:"send",size:13,color:"var(--brand)"})," Telegram",a.jsxs("span",{style:{marginLeft:"auto",fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontWeight:"var(--fw-normal)"},children:[V?`linked · ${C.chatLabel||C.chatId}`:_?"token stored · not linked":"not set up",s?.delivered?` · ${s.delivered} sent`:"",s?.failures?` · ${s.failures} failed`:""]})]}),a.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",lineHeight:"var(--lh-prose)"},children:"Approvals, questions, stalls and finished missions arrive in a chat with your own bot, using the toggles above. Every ask still has its unattended default — this makes it less likely to be needed."}),u&&a.jsx(It,{tone:"error",inline:!0,children:u}),E("Bot token",a.jsxs(a.Fragment,{children:["Create a bot with ",a.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:"@BotFather"})," and paste its token. Stored write-only; Foreman can replace it but never show it."]}),_&&!S?a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-sm)"},children:[a.jsx("span",{style:{fontFamily:"var(--font-mono)",color:"var(--ink-1)"},children:C?.bot||"token stored"}),a.jsx(de,{size:"sm",variant:"ghost",onClick:()=>H(!0),disabled:c,children:"Replace"}),a.jsx(de,{size:"sm",variant:"ghost",onClick:f,disabled:c,children:"Remove"})]}):a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[a.jsx(Je,{mono:!0,type:"password",width:320,placeholder:"123456789:AA…",value:w,onChange:k}),a.jsx(de,{size:"sm",variant:"primary",disabled:c||!w.trim(),onClick:()=>{o?.(w.trim()),k(""),H(!1)},children:c?"Checking…":"Save"}),_&&a.jsx(de,{size:"sm",variant:"ghost",onClick:()=>H(!1),children:"Cancel"})]})),E("Linked chat","Send the one-time command to your bot from the chat that should receive messages. Only that chat is ever written to.",V?a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-sm)"},children:[a.jsx(te,{name:"check",size:13,color:"var(--status-ok, var(--brand))"}),a.jsxs("span",{children:[C.chatLabel||"linked"," ",a.jsx("span",{style:{color:"var(--ink-2)",fontFamily:"var(--font-mono)"},children:C.chatId})]}),a.jsx(de,{size:"sm",variant:"ghost",onClick:b,disabled:c,children:"Send test"}),a.jsx(de,{size:"sm",variant:"ghost",onClick:g,disabled:c,children:"Unlink"})]}):$?a.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)",alignItems:"flex-start"},children:[$.deepLink&&a.jsx("a",{href:$.deepLink,target:"_blank",rel:"noreferrer",title:"Open in Telegram",style:{flex:"0 0 auto",display:"block",padding:6,background:"#fff",borderRadius:"var(--r-sm)",border:"1px solid var(--line-strong)",lineHeight:0},children:a.jsx("img",{src:`/notify/telegram/qr.svg?c=${encodeURIComponent($.code)}`,alt:`QR: ${$.deepLink}`,width:132,height:132,style:{display:"block"}})}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,fontSize:"var(--fs-sm)",minWidth:0},children:[a.jsx("div",{children:"Scan with your phone, or send this to your bot:"}),a.jsxs("code",{style:{alignSelf:"flex-start",fontFamily:"var(--font-mono)",fontSize:"var(--fs-lg)",padding:"4px 10px",background:"var(--bg-inset)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-sm)"},children:["/start ",$.code]}),$.deepLink&&a.jsx("a",{href:$.deepLink,target:"_blank",rel:"noreferrer",style:{fontSize:"var(--fs-xs)",color:"var(--brand)",textDecoration:"none"},children:"Open in Telegram on this computer →"}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:"var(--fs-xs)",color:"var(--ink-2)",flexWrap:"wrap"},children:[a.jsx("span",{className:"pulse",style:{display:"inline-flex"},children:a.jsx(te,{name:"loading",size:12})}),"waiting… the code expires in 10 minutes",a.jsx(de,{size:"sm",variant:"ghost",onClick:h,disabled:c,children:"New code"})]})]})]}):a.jsx("div",{children:a.jsx(de,{size:"sm",variant:"primary",onClick:h,disabled:c||!_,title:_?"Shows a one-time code to send to your bot":"Store a bot token first",children:"Link a chat"})})),E("Foreman URL","Where links in messages point. A phone cannot open localhost — use a LAN or Tailscale address if you have one.",a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[a.jsx(Je,{mono:!0,width:320,value:W,onChange:F,placeholder:"http://localhost:4177"}),a.jsx(de,{size:"sm",disabled:c||!se,onClick:()=>{y?.(W),F(null)},children:"Save"})]}))]})}const _c=[{id:"provider",label:"Provider",icon:"provider"},{id:"models",label:"Models",icon:"model"},{id:"budget",label:"Budget",icon:"budget"},{id:"approvals",label:"Approvals",icon:"approval"},{id:"appearance",label:"Appearance",icon:"sun"},{id:"notifications",label:"Notifications",icon:"needsYou"},{id:"projects",label:"Projects",icon:"folder"}],Oc={directorModel:"opus",workerModel:"sonnet",plannerModel:"sonnet",budgetCap:5,budgetWarnAt:80,budgetHardStop:!0,autoAllowReadOnly:!0,alwaysSurvivesResume:!0,toolPolicy:{Bash:"allow",Write:"allow",Edit:"allow",WebFetch:"allow",spawn_worker:"allow"},theme:"light",textSize:"default",density:"comfortable",showTimestamps:!0,notifyNeedsYou:!0,notifyDone:!0,notifyBudget:!0,sound:!1,projectsRoot:"~/Projects",missionDir:".foreman",showHidden:!1},H1=[{value:"allow",label:"Allow"},{value:"ask",label:"Ask"},{value:"deny",label:"Deny"}],U1=["Bash","Write","Edit","WebFetch","spawn_worker"];function B1({instances:s=[],ollama:c,codex:u}){const o=[...s.map(f=>({icon:"orchestration",name:"Claude Code",detail:f.configDir,note:f.hasStoredLogin?"signed in":"no stored login"})),...c?[{icon:"model",name:"Ollama",detail:c.host,note:`${c.models.length} model${c.models.length===1?"":"s"}`}]:[],...u?[{icon:"provider",name:"Codex",detail:u.home,note:u.signedIn?"signed in":"not signed in"}]:[]];return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:[a.jsxs("div",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-1)",lineHeight:"var(--lh-prose)"},children:["A provider is chosen per project — open one and its tab appears beside",a.jsx("b",{style:{color:"var(--ink-0)"},children:" Global"})," above. These are what this machine can offer."]}),o.length===0&&a.jsx(st,{children:"Nothing detected. An Anthropic API key or any OpenAI-compatible endpoint still works."}),o.map((f,h)=>a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)"},children:[a.jsx(te,{name:f.icon,size:14,color:"var(--ink-2)"}),a.jsx("span",{style:{fontSize:"var(--fs-sm)",fontWeight:"var(--fw-medium)"},children:f.name}),a.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.detail}),a.jsx("span",{style:{marginLeft:"auto",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:f.note})]},h))]})}function q1({global:s,project:c,projectName:u,models:o,modelsLoading:f,modelsNote:h,provider:g,providerInstances:b,providerOllama:y,providerCodex:v,providerHasKey:w,providerKeyBusy:k,providerKeyError:S,onStoreProviderKey:H,onClearProviderKey:Q,notify:F,scope:C,onScope:_,section:V,onSection:$,onSave:W,onClose:se,onUnlink:E,style:B}){const[q,R]=x.useState(C??"global"),[ne,pe]=x.useState(V??"models"),fe=_?C:q,ye=_??R,re=$?V:ne,ke=$??pe,[M,L]=x.useState({...Oc,...s}),[J,ve]=x.useState({...c}),[Se,m]=x.useState(g??null),N=JSON.stringify(Se)!==JSON.stringify(g??null),Z=JSON.stringify(M)!==JSON.stringify({...Oc,...s})||JSON.stringify(J)!==JSON.stringify({...c})||N,P=fe==="project",le=ee=>P&&ee in J?J[ee]:M[ee],ae=(ee,De)=>P?ve($e=>({...$e,[ee]:De})):L($e=>({...$e,[ee]:De})),xe=ee=>P&&ee in J,I=ee=>ve(De=>{const $e={...De};return delete $e[ee],$e}),K=(ee,De,$e,vt)=>a.jsx(Gs,{label:De,hint:$e,overridden:xe(ee),inherits:P&&!xe(ee),onReset:()=>I(ee),children:vt}),Be={models:a.jsxs(a.Fragment,{children:[K("directorModel","Director","Plans, delegates, verifies. Opus by default; Fable for long-horizon work.",a.jsx(Ft,{align:"right",allowDefault:!1,models:o,loading:f,note:h,value:le("directorModel"),onChange:(ee,De)=>{ae("directorModel",ee),ae("directorProviderId",De?.providerId)}})),K("workerModel","Workers","Implement scoped tasks. Cheaper models cut cost sharply.",a.jsx(Ft,{align:"right",allowDefault:!1,models:o,loading:f,note:h,value:le("workerModel"),onChange:(ee,De)=>{ae("workerModel",ee),ae("workerProviderId",De?.providerId)}})),K("plannerModel","Planner","Talks the next mission through with you and reads the project. Conversation, not deep reasoning; Sonnet by default.",a.jsx(Ft,{align:"right",allowDefault:!1,models:o,loading:f,note:h,value:le("plannerModel"),onChange:ee=>ae("plannerModel",ee)})),!P&&K("fleetPlannerModel","Fleet planner","The front desk on your phone: knows every project, opens planning, proposes, steers. Fast tool calls matter more than depth; follows the planner when unset.",a.jsx(Ft,{align:"right",allowDefault:!1,models:o,loading:f,note:h,value:le("fleetPlannerModel")||le("plannerModel"),onChange:ee=>ae("fleetPlannerModel",ee)}))]}),budget:a.jsxs(a.Fragment,{children:[K("budgetCap","Default cap per run","The composer starts here; you can change it per mission.",a.jsx(Je,{type:"number",prefix:"$",min:0,step:1,width:110,value:le("budgetCap"),onChange:ee=>ae("budgetCap",ee)})),K("budgetWarnAt","Warn at","Meter turns amber and, if enabled, you get a notification.",a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[a.jsx(Je,{type:"number",min:10,max:100,step:5,width:80,value:le("budgetWarnAt"),onChange:ee=>ae("budgetWarnAt",ee)}),a.jsx("span",{style:{color:"var(--ink-2)"},children:"%"})]})),K("budgetHardStop","Hard stop at cap","Off: the run pauses and asks instead of stopping.",a.jsx(Rt,{checked:le("budgetHardStop"),onChange:ee=>ae("budgetHardStop",ee)}))]}),approvals:a.jsxs(a.Fragment,{children:[K("autoAllowReadOnly","Auto-allow read-only tools","Read, Grep, Glob, LS never prompt.",a.jsx(Rt,{checked:le("autoAllowReadOnly"),onChange:ee=>ae("autoAllowReadOnly",ee)})),K("alwaysSurvivesResume","“Always (run)” survives resume","Grants made during a run carry into a resumed run.",a.jsx(Rt,{checked:le("alwaysSurvivesResume"),onChange:ee=>ae("alwaysSurvivesResume",ee)})),a.jsx(Gs,{label:"Guarded tools",hint:"Policy per tool. “Ask” escalates to an approval card; writes outside the project folder always ask.",overridden:xe("toolPolicy"),inherits:P&&!xe("toolPolicy"),onReset:()=>I("toolPolicy"),stacked:!0,children:a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:U1.map(ee=>a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[a.jsx(te,{name:ee,size:14,color:"var(--ink-2)"}),a.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",flex:1},children:ee}),a.jsx(_n,{size:"sm",tabs:H1,value:le("toolPolicy")[ee]||"ask",onChange:De=>ae("toolPolicy",{...le("toolPolicy"),[ee]:De})})]},ee))})})]}),appearance:a.jsxs(a.Fragment,{children:[K("theme","Theme",null,a.jsx(_n,{size:"sm",value:le("theme"),onChange:ee=>ae("theme",ee),tabs:[{value:"system",label:"System"},{value:"dark",label:"Dark",icon:"moon"},{value:"light",label:"Light",icon:"sun"}]})),K("textSize","Text size","Scales the whole interface. Anything but Default overrides your browser’s own font size.",a.jsx(_n,{size:"sm",value:le("textSize"),onChange:ee=>ae("textSize",ee),tabs:[{value:"small",label:"Small"},{value:"default",label:"Default"},{value:"large",label:"Large"},{value:"larger",label:"Larger"}]})),K("density","Density","Compact tightens transcript rows and rail padding.",a.jsx(_n,{size:"sm",value:le("density"),onChange:ee=>ae("density",ee),tabs:[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}]})),K("showTimestamps","Timestamps in transcript",null,a.jsx(Rt,{checked:le("showTimestamps"),onChange:ee=>ae("showTimestamps",ee)}))]}),notifications:a.jsxs(a.Fragment,{children:[K("notifyNeedsYou","Needs you","An approval or question is waiting.",a.jsx(Rt,{checked:le("notifyNeedsYou"),onChange:ee=>ae("notifyNeedsYou",ee)})),K("notifyDone","Run finished","Done, errored or interrupted.",a.jsx(Rt,{checked:le("notifyDone"),onChange:ee=>ae("notifyDone",ee)})),K("notifyBudget","Budget warning","When spend crosses the warn threshold.",a.jsx(Rt,{checked:le("notifyBudget"),onChange:ee=>ae("notifyBudget",ee)})),K("sound","Sound",null,a.jsx(Rt,{checked:le("sound"),onChange:ee=>ae("sound",ee)})),!P&&F&&a.jsx(N1,{...F})]}),provider:P?a.jsx(Gs,{label:"Provider",hint:"Which engine runs this project's agents, who pays, and where requests go. Clearing it returns to the server default.",stacked:!0,children:a.jsx(O1,{value:Se,onChange:m,instances:b,ollama:y,hasKey:w,keyBusy:k,keyError:S,onStoreKey:H,onClearKey:Q})}):a.jsx(B1,{instances:b,ollama:y,codex:v}),projects:a.jsxs(a.Fragment,{children:[!P&&K("projectsRoot","Projects root","Where the folder picker opens.",a.jsx(Je,{mono:!0,width:260,value:le("projectsRoot"),onChange:ee=>ae("projectsRoot",ee)})),K("missionDir","Mission folder","Relative to the project. Holds MISSION.md and run history.",a.jsx(Je,{mono:!0,width:160,value:le("missionDir"),onChange:ee=>ae("missionDir",ee)})),!P&&K("showHidden","Show hidden folders in picker",null,a.jsx(Rt,{checked:le("showHidden"),onChange:ee=>ae("showHidden",ee)})),P&&a.jsx(Gs,{label:"Unlink this project",hint:"Removes it from the fleet. Files on disk are untouched.",danger:!0,children:a.jsx(de,{variant:"danger",size:"sm",icon:"unlink",onClick:E,children:"Unlink"})})]})},Le=_c.find(ee=>ee.id===re)||_c[0];return a.jsxs(Ws,{width:"51.25rem",onClose:se,dismissible:!1,style:{maxHeight:"82vh",height:"37.5rem",...B},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",padding:"var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--line)"},children:[a.jsx("span",{style:{fontSize:"var(--fs-lg)",fontWeight:"var(--fw-semibold)"},children:"Settings"}),a.jsx(_n,{size:"sm",value:fe,onChange:ye,tabs:[...u?[{value:"project",label:u,icon:"folder"}]:[],{value:"global",label:"Global"}]}),a.jsx(Ml,{icon:"close",label:"Close",onClick:se,style:{marginLeft:"auto"}})]}),a.jsxs("div",{style:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:"11.25rem 1fr"},children:[a.jsx("nav",{style:{background:"var(--bg-inset)",borderRight:"1px solid var(--line)",padding:"var(--sp-2)",display:"flex",flexDirection:"column",gap:2},children:_c.map(ee=>a.jsx($1,{s:ee,selected:ee.id===re,dot:P&&(Y1(ee.id,J)||ee.id==="provider"&&!!Se),onClick:()=>ke(ee.id)},ee.id))}),a.jsxs("div",{style:{minHeight:0,overflowY:"auto",padding:"var(--sp-3) var(--sp-5)"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--sp-2)",marginBottom:"var(--sp-2)"},children:[a.jsx("span",{style:{fontSize:"var(--fs-lg)",fontWeight:"var(--fw-semibold)"},children:Le.label}),P&&a.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:["Overrides for ",a.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:u}),". Rows without a change inherit global."]})]}),Be[Le.id]]})]}),a.jsxs(Js,{children:[a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:Z?"var(--status-warning)":"var(--ink-2)"},children:Z?"Unsaved changes":"Nothing to save"}),a.jsxs("span",{style:{marginLeft:"auto",display:"flex",gap:"var(--sp-2)"},children:[a.jsx(de,{onClick:se,children:"Cancel"}),a.jsx(de,{variant:"primary",disabled:!Z,onClick:()=>W?.({global:M,project:J,provider:N?Se:void 0}),children:"Save"})]})]})]})}const L1={models:["directorModel","workerModel","plannerModel","fleetPlannerModel","directorProviderId","workerProviderId"],budget:["budgetCap","budgetWarnAt","budgetHardStop"],approvals:["autoAllowReadOnly","alwaysSurvivesResume","toolPolicy"],appearance:["theme","density","showTimestamps"],notifications:["notifyNeedsYou","notifyDone","notifyBudget","sound"],projects:["missionDir"]};function Y1(s,c){return(L1[s]||[]).some(u=>u in c)}function $1({s,selected:c,dot:u,onClick:o}){const[f,h]=x.useState(!1);return a.jsxs("button",{type:"button",onClick:o,"aria-current":c||void 0,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:"var(--r-sm)",border:"none",textAlign:"left",cursor:"pointer",font:"inherit",color:c?"var(--ink-0)":"var(--ink-1)",fontWeight:c?"var(--fw-semibold)":"var(--fw-regular)",background:c?"var(--bg-card)":f?"var(--bg-hover)":"transparent",boxShadow:c?"inset 0 0 0 1px var(--line-strong)":"none"},children:[a.jsx(te,{name:s.icon,size:14,color:c?"var(--brand)":"var(--ink-2)"}),a.jsx("span",{style:{flex:1},children:s.label}),u&&a.jsx("span",{title:"Has project overrides",style:{width:6,height:6,borderRadius:"var(--r-pill)",background:"var(--brand)"}})]})}function Gs({label:s,hint:c,children:u,overridden:o,inherits:f,onReset:h,stacked:g,danger:b}){return a.jsxs("div",{style:{display:"grid",gridTemplateColumns:g?"1fr":"1fr auto",gap:g?10:"var(--sp-4)",alignItems:"center",padding:"var(--sp-3) 0",borderBottom:"1px solid var(--line)"},children:[a.jsxs("div",{style:{minWidth:0},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:b?"var(--status-critical)":"var(--ink-0)"},children:[a.jsx("span",{children:s}),f&&a.jsx(gp,{children:"global"}),o&&a.jsxs(a.Fragment,{children:[a.jsx(gp,{brand:!0,children:"override"}),a.jsx("button",{type:"button",onClick:h,style:{background:"none",border:0,padding:0,font:"inherit",fontSize:"var(--fs-xs)",color:"var(--ink-2)",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:"reset to global"})]})]}),c&&a.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",marginTop:2},children:c})]}),a.jsx("div",{style:{display:"flex",justifyContent:g?"stretch":"flex-end",minWidth:0},children:u})]})}function gp({children:s,brand:c}){return a.jsx("span",{style:{fontSize:"var(--fs-xs)",letterSpacing:"0.06em",textTransform:"uppercase",padding:"1px 6px",borderRadius:"var(--r-pill)",background:c?"var(--brand-wash-strong)":"var(--bg-inset)",color:c?"var(--brand)":"var(--ink-2)",border:`1px solid ${c?"transparent":"var(--line)"}`},children:s})}function mp({agent:s,status:c="running",task:u,selected:o,indent:f,last:h,onSelect:g,style:b}){const[y,v]=x.useState(!1);return a.jsxs("div",{style:{position:"relative",marginLeft:f?14:0},children:[f&&a.jsx("span",{"aria-hidden":!0,style:{position:"absolute",left:-8,top:0,bottom:h?"50%":0,borderLeft:"1px solid var(--line-strong)"}}),f&&a.jsx("span",{"aria-hidden":!0,style:{position:"absolute",left:-8,top:"50%",width:8,borderTop:"1px solid var(--line-strong)"}}),a.jsxs("div",{role:"button",title:u,onClick:()=>g?.(s),onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"6px 8px",borderRadius:"var(--r-sm)",cursor:"pointer",background:o?"var(--bg-card)":y?"var(--bg-hover)":"transparent",border:o?"1px solid var(--line-strong)":"1px solid transparent",transition:"background var(--dur-fast) var(--ease)",...b},children:[a.jsx(an,{agent:s}),a.jsx("span",{style:{flex:1,minWidth:0,fontSize:"var(--fs-md)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}),a.jsx(Tl,{status:c})]})]})}function G1({agents:s=[],filter:c,onFilter:u,sessionId:o,details:f,style:h}){const g=s.find(v=>v.id==="director"),b=s.filter(v=>v.id!=="director"),y={margin:"0 0 6px 0",fontSize:"var(--fs-xs)",color:"var(--ink-1)",lineHeight:"var(--lh)",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"};return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)",...h},children:[a.jsxs("section",{style:{minWidth:0},children:[a.jsx(ln,{children:"Crew"}),s.length===0&&a.jsx(st,{children:"No agents yet."}),g&&a.jsx(mp,{agent:"director",status:g.status,selected:c==="director",onSelect:u}),b.map((v,w)=>a.jsxs(Cn.Fragment,{children:[a.jsx(mp,{agent:v.id,status:v.status,task:v.task,indent:!0,last:w===b.length-1,selected:c===v.id,onSelect:u}),v.task&&a.jsx("div",{title:v.task,style:{...y,marginLeft:34},children:v.task})]},v.id)),c&&a.jsxs("div",{style:{marginTop:4,fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:["Transcript shows only ",a.jsx("b",{style:{color:"var(--ink-1)"},children:c})," — click again to clear."]})]}),a.jsxs("section",{style:{minWidth:0},children:[a.jsx(ln,{children:"Run"}),f??a.jsx(st,{children:"No run details."}),o&&a.jsxs("div",{style:{marginTop:6,fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)"},children:["director session ",String(o).slice(0,8)]})]})]})}function X1({director:s,worker:c,models:u,loading:o,note:f,busy:h,onResume:g,style:b}){const[y,v]=x.useState(!1),[w,k]=x.useState({id:s||"",providerId:void 0}),[S,H]=x.useState({id:c||"",providerId:void 0}),Q=x.useRef(null);x.useEffect(()=>{k({id:s||"",providerId:void 0}),H({id:c||"",providerId:void 0})},[s,c,y]),x.useEffect(()=>{if(!y)return;const V=W=>{Q.current&&!Q.current.contains(W.target)&&v(!1)},$=W=>{W.key==="Escape"&&v(!1)};return document.addEventListener("mousedown",V),document.addEventListener("keydown",$),()=>{document.removeEventListener("mousedown",V),document.removeEventListener("keydown",$)}},[y]);const F=w.id&&w.id!==s||S.id&&S.id!==c,C=()=>{g?.({...w.id&&w.id!==s?{directorModel:w.id,directorProviderId:w.providerId}:{},...S.id&&S.id!==c?{workerModel:S.id,workerProviderId:S.providerId}:{}}),v(!1)},_={fontSize:"var(--fs-xs)",color:"var(--ink-2)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)",marginBottom:4};return a.jsxs("div",{ref:Q,style:{position:"relative",display:"inline-flex",...b},children:[a.jsx(de,{variant:"good",icon:"resume",disabled:h,title:"Restore the director's session and continue this mission",onClick:()=>g?.({}),style:{borderTopRightRadius:0,borderBottomRightRadius:0},children:h?"Resuming…":"Resume"}),a.jsx(de,{variant:"good",disabled:h,"aria-label":"Resume on other models",title:"Resume on other models…",onClick:()=>v(!y),style:{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeft:"1px solid rgba(255,255,255,0.35)",paddingLeft:6,paddingRight:6},children:a.jsx(te,{name:"chevronDown",size:14})}),y&&a.jsxs("div",{role:"dialog","aria-label":"Resume on other models",style:{position:"absolute",top:"calc(100% + 6px)",right:0,zIndex:50,width:340,background:"var(--bg-card)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-md)",boxShadow:"0 12px 32px rgba(0,0,0,0.25)",padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:[a.jsx("div",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-1)",lineHeight:"var(--lh)"},children:"Same mission, other models. A new director starts a fresh session and reads the mission doc; workers change for the next spawns."}),a.jsxs("div",{children:[a.jsx("div",{style:_,children:"Director"}),a.jsx(Ft,{block:!0,allowDefault:!1,models:u,loading:o,note:f,value:w.id,onChange:(V,$)=>k({id:V,providerId:$?.providerId})})]}),a.jsxs("div",{children:[a.jsx("div",{style:_,children:"Workers"}),a.jsx(Ft,{block:!0,allowDefault:!1,models:u,loading:o,note:f,value:S.id,onChange:(V,$)=>H({id:V,providerId:$?.providerId})})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--sp-2)"},children:[a.jsx(de,{variant:"ghost",size:"sm",onClick:()=>v(!1),children:"Cancel"}),a.jsx(de,{variant:"good",size:"sm",icon:"resume",disabled:h||!F,onClick:C,title:F?"Resume with these models":"Pick a different model first — or use Resume as is",children:"Resume"})]})]})]})}function Q1(s,c){const u=zp(s.provider);return!s.provider||!u?c:s.provider.kind==="claude-code"?s.provider.ownLogin?`${u} (this project's own login)`:u:`${s.provider.kind} · ${u}`}function V1(s){const c=`(min-width: ${s}px)`,[u,o]=x.useState(()=>typeof window<"u"&&window.matchMedia(c).matches);return x.useEffect(()=>{const f=window.matchMedia(c),h=()=>o(f.matches);return h(),f.addEventListener("change",h),()=>f.removeEventListener("change",h)},[c]),u}const K1=1100;function Z1(s){const c=s.agents.filter(b=>b.status==="running"),u=c.filter(b=>b.id!=="director").length,o=c.length===0?"":[c.some(b=>b.id==="director")?"director":null,u?`${u} worker${u===1?"":"s"}`:null].filter(Boolean).join(" · ");let f=null;for(let b=s.entries.length-1;b>=0&&b>=s.entries.length-40;b--){const y=s.entries[b],v=y.kind==="system"&&y.title.startsWith("progress"),w=y.kind==="text"&&y.agent==="director";if(v||w){f=y;break}}if(!f){const b=c.find(y=>y.id!=="director"&&y.task);return b?{line:`${b.id}: ${b.task}`,agent:b.id,crew:o}:o?{line:"Crew is starting up",crew:o}:null}const h=f.body.split(`
66
+ `).find(b=>b.trim())??"";return{line:`${f.agent}: ${h.replace(/[*_`#>]/g,"").trim().slice(0,160)}`,agent:f.agent,crew:o}}function Si({label:s,open:c,onToggle:u,children:o}){return a.jsxs("div",{style:{border:"1px solid var(--line)",borderRadius:"var(--r-sm)",background:"var(--bg-panel)"},children:[a.jsxs("button",{type:"button",onClick:u,style:{display:"flex",alignItems:"center",gap:6,width:"100%",padding:"6px 10px",background:"none",border:"none",cursor:"pointer",font:"inherit",textAlign:"left",fontSize:"var(--fs-xs)",color:"var(--ink-2)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)"},children:[a.jsx(te,{name:c?"chevronDown":"chevronRight",size:12}),s]}),c&&a.jsx("div",{style:{padding:"0 10px 10px"},children:o})]})}const Qp={width:"100%",maxWidth:"var(--spine-max)",margin:"0 auto",display:"flex",flexDirection:"column",gap:"var(--sp-2)",boxSizing:"border-box"},yp="foreman.transcriptOrder",xp="foreman.timeline",Xs=s=>new Date(s).toLocaleDateString(void 0,{month:"short",day:"numeric"}),bp="foreman.railWidth",Cc=280,Sp=340;function W1(){const[s,c]=x.useState(()=>{try{return localStorage.getItem(yp)==="oldest"?"oldest":"newest"}catch{return"newest"}});return[s,u=>{c(u);try{localStorage.setItem(yp,u)}catch{}}]}function jp(s,c){return c==="newest"?0:s.scrollHeight}function J1({run:s,filter:c,jump:u,order:o,header:f}){const h=x.useRef(null),g=x.useRef(!0),[b,y]=x.useState(null),v=c?s.entries.filter(k=>k.agent===c):s.entries,w=o==="newest"?[...v].reverse():v;return x.useEffect(()=>{const k=h.current;k&&g.current&&(k.scrollTop=jp(k,o))},[w.length,o]),x.useEffect(()=>{g.current=!0;const k=h.current;k&&(k.scrollTop=jp(k,o))},[o]),x.useEffect(()=>{if(!u)return;g.current=!1;const k=requestAnimationFrame(()=>{document.getElementById(`entry-${u.id}`)?.scrollIntoView({behavior:"smooth",block:"center"}),y(u.id)}),S=setTimeout(()=>y(null),1600);return()=>{cancelAnimationFrame(k),clearTimeout(S)}},[u]),a.jsx("div",{ref:h,onScroll:k=>{const S=k.currentTarget;g.current=o==="newest"?S.scrollTop<60:S.scrollHeight-S.scrollTop-S.clientHeight<60},style:{overflowY:"auto",padding:"var(--sp-3)",minHeight:0,flex:1,display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:a.jsxs("div",{style:Qp,children:[f,w.length===0&&a.jsx(st,{children:"Transcript will appear here."}),w.map(k=>a.jsx("div",{id:`entry-${k.id}`,style:{scrollMarginTop:8,borderRadius:"var(--r-sm)",outline:b===k.id?"2px solid var(--brand)":"none",transition:"outline-color var(--dur-fast) var(--ease)"},children:a.jsx(Lc,{agent:k.agent,title:k.title,dense:!0,kind:k.kind,body:k.body,ts:k.ts,to:k.to,timing:k.timing})},k.id))]})})}function F1({chat:s,folder:c,starting:u,error:o,models:f,modelsLoading:h,modelsNote:g,modelsInheritNote:b,onStart:y,onCompose:v,hasRuns:w,projectId:k,onSettings:S}){const[H,Q]=x.useState(""),[F,C]=x.useState(""),[_,V]=x.useState(0),$=q=>{C(q),V(R=>R+1)},W=async(q,R=[])=>{Q("");try{await s.send(await Cp(k,q,R))}catch(ne){Q(ne.message)}},se=x.useRef(null),E=x.useRef(!0);return x.useEffect(()=>{const q=se.current;q&&E.current&&(q.scrollTop=q.scrollHeight)},[s.entries.length,s.proposal,s.thinking]),s.entries.length===0&&!s.thinking&&!s.question&&!s.proposal?a.jsx("div",{style:{flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column"},children:a.jsxs("div",{style:{margin:"auto",width:"100%",maxWidth:"var(--composer-max)",padding:"var(--sp-4) var(--sp-3)",boxSizing:"border-box",display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[a.jsxs("div",{style:{textAlign:"center",display:"flex",flexDirection:"column",gap:"var(--sp-1)"},children:[a.jsx("span",{style:{fontSize:"var(--fs-lg)",fontWeight:"var(--fw-semibold)"},children:"What should this project do next?"}),a.jsx("span",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-2)"},children:"Describe it, paste a spec or a screenshot, or pick a starter and edit it before sending."})]}),a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"var(--sp-2)"},children:[w?{t:"Review the last run",q:"Look at what the last mission built and verify it still holds. What would you fix or finish next?"}:{t:"Survey the project",q:"Read this project and tell me what it is, how it is built, and what state it is in."},{t:"Find risks worth a mission",q:"Audit this project for bugs, security holes and missing tests. Rank what you find and propose the one mission most worth running first."},{t:"Scope a feature",q:"I have a feature in mind. Ask me what you need to know to scope it, then draft the mission."},{t:"Plan a refactor",q:"Where is this codebase hardest to change? Propose one contained refactor with clear DONE WHEN criteria."}].map(q=>a.jsxs("button",{type:"button",onClick:()=>$(q.q),disabled:s.thinking,style:{textAlign:"left",padding:"8px 10px",background:"var(--bg-card)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",color:"inherit",display:"flex",flexDirection:"column",gap:2},children:[a.jsx("span",{style:{fontSize:"var(--fs-sm)",fontWeight:"var(--fw-semibold)",color:"var(--ink-0)"},children:q.t}),a.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",lineHeight:"var(--lh)"},children:q.q})]},q.t))}),a.jsx(Rc,{value:F,onChange:C,busy:s.thinking,who:s.who,onSend:(q,R)=>{W(q,R)},onStop:()=>{s.stop()},onChangeModel:S,autoFocus:!0},_),H&&a.jsx(It,{tone:"error",inline:!0,children:H}),a.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",textAlign:"center"},children:["Planning reads the project and never changes it — a mission does that.",w&&a.jsxs(a.Fragment,{children:[" To build on a finished run, open it and choose ",a.jsx("b",{style:{color:"var(--ink-1)"},children:"Plan the next step"}),"."]})]}),a.jsxs("button",{type:"button",onClick:v,style:{display:"flex",alignItems:"center",gap:6,padding:"6px 10px",width:"100%",boxSizing:"border-box",background:"none",border:"1px dashed var(--line-strong)",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",fontSize:"var(--fs-xs)",color:"var(--ink-2)",textAlign:"left"},children:[a.jsx(te,{name:"write",size:12}),"Or skip the talk: describe the mission and start it",a.jsx(te,{name:"chevronRight",size:12,style:{marginLeft:"auto"}})]})]})}):a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:se,onScroll:q=>{const R=q.currentTarget;E.current=R.scrollHeight-R.scrollTop-R.clientHeight<60},style:{flex:1,minHeight:0,overflowY:"auto",padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:a.jsxs("div",{style:Qp,children:[s.entries.map((q,R)=>{const ne=Xs(q.ts),pe=R>0?Xs(s.entries[R-1].ts):null;return a.jsxs(Cn.Fragment,{children:[ne!==pe&&(R>0||ne!==Xs(Date.now()))&&a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",margin:"4px 0"},children:[a.jsx("span",{style:{flex:1,borderTop:"1px solid var(--line)"}}),a.jsx("span",{children:ne===Xs(Date.now())?"today":ne}),a.jsx("span",{style:{flex:1,borderTop:"1px solid var(--line)"}})]}),a.jsx(Lc,{agent:q.agent,title:q.title,kind:q.kind,body:q.body,ts:q.ts})]},q.id)}),s.proposal&&a.jsx(u1,{mission:s.proposal.mission,doneWhen:s.proposal.doneWhen,budgetUsd:s.proposal.budgetUsd,rationale:s.proposal.rationale,browser:s.proposal.browser,directorModel:s.proposal.directorModel,workerModel:s.proposal.workerModel,directorProviderId:s.proposal.directorProviderId,workerProviderId:s.proposal.workerProviderId,modelRationale:s.proposal.modelRationale,models:f,modelsLoading:h,modelsNote:g,modelsInheritNote:b,busy:u,error:o,onStart:q=>y(q),onDismiss:s.dismissProposal})]})}),a.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-3) var(--sp-3)",flex:"0 0 auto",width:"100%",maxWidth:"var(--spine-max)",margin:"0 auto",boxSizing:"border-box"},children:[s.question?a.jsx(c1,{questions:s.question.questions,askedAt:s.question.askedAt,who:s.who,onAnswer:q=>{s.answer(s.question.id,q)},onFreeText:q=>{W(q)}}):a.jsx(Rc,{busy:s.thinking,who:s.who,onSend:(q,R)=>{W(q,R)},onStop:()=>{s.stop()},onChangeModel:S}),H&&a.jsx(It,{tone:"error",inline:!0,style:{marginTop:4},children:H}),(s.costUsd>0||s.entries.length>0)&&a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"4px 2px 0",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[s.costUsd>0&&a.jsxs("span",{title:"What this conversation has cost so far. Planning is not charged to any mission budget.",style:{fontVariantNumeric:"tabular-nums"},children:["conversation $",s.costUsd.toFixed(3)]}),a.jsx("span",{style:{flex:1}}),s.thinking&&a.jsx(de,{variant:"ghost",size:"sm",icon:"close",title:"Stop the planner and discard the rest of this reply",onClick:()=>{s.stop()},children:"Stop"}),s.entries.length>0&&a.jsx(de,{variant:"ghost",size:"sm",icon:"close",disabled:s.thinking,title:s.thinking?"The planner is replying — clear once it has answered.":"Forget this conversation and start a new one",onClick:()=>{s.clear()},children:s.thinking?"Clear (after this reply)":"Clear conversation"})]})]}),a.jsxs("button",{type:"button",onClick:v,style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:6,margin:"0 auto var(--sp-3)",padding:"6px 10px",width:"calc(100% - 2 * var(--sp-3))",maxWidth:"calc(var(--spine-max) - 2 * var(--sp-3))",boxSizing:"border-box",background:"none",border:"1px dashed var(--line-strong)",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",fontSize:"var(--fs-xs)",color:"var(--ink-2)",textAlign:"left"},children:[a.jsx(te,{name:"write",size:12}),"Or skip the talk: describe the mission and start it",a.jsx(te,{name:"chevronRight",size:12,style:{marginLeft:"auto"}})]})]})}function I1({r:s,live:c,liveCost:u,liveBasis:o,liveUsage:f,liveTurns:h,onChanged:g}){const[b,y]=x.useState(!1),[v,w]=x.useState(""),k=!!c&&s.status==="running",S=async V=>{y(!0),w("");try{await Fe.updateRun(s.id,V),g?.()}catch($){w($ instanceof Error?$.message:String($))}finally{y(!1)}},H=o??zl(s),Q=f??s.usage??null,F=h??s.turns,C=[["director",s.directorModel||"default"],["workers",s.workerModel||"default"],["budget",H==="priced"?`$${((u??s.costUsd)||0).toFixed(2)} / $${s.budgetUsd.toFixed(2)}`:`${El(Q?.inputTokens??0)} in · ${El(Q?.outputTokens??0)} out${typeof F=="number"?` · ${F} turn${F===1?"":"s"}`:""}`+(H==="unpriced"?" · cost not tracked":" · no per-token cost")]],_={color:"var(--ink-1)",fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};return a.jsxs("div",{style:{marginTop:8,fontSize:"var(--fs-xs)"},children:[a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:2},children:[C.map(([V,$])=>a.jsxs(Cn.Fragment,{children:[a.jsx("span",{style:{color:"var(--ink-2)"},children:V}),a.jsx("span",{style:_,children:$})]},V)),a.jsx("span",{style:{color:"var(--ink-2)"},children:"browser"}),k?a.jsx("button",{type:"button",disabled:b,onClick:()=>{S({browserTools:!s.browserTools})},title:s.browserTools?"Turn off. No worker spawned after this gets a browser.":"Turn on. Workers spawned after this get a headless browser; the director itself gains it when the run is resumed.",style:{..._,justifySelf:"start",background:"none",padding:0,border:"none",borderBottom:"1px dashed var(--line-strong)",cursor:b?"wait":"pointer",font:"inherit",fontFamily:"var(--font-mono)",color:"var(--ink-1)"},children:s.browserTools?"on":"off"}):a.jsx("span",{style:_,children:s.browserTools?"on":"off"}),s.resumes?a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"var(--ink-2)"},children:"resumes"}),a.jsx("span",{style:_,children:s.resumes})]}):null]}),v&&a.jsx("div",{style:{marginTop:4,color:"var(--status-critical)"},children:v})]})}function P1({p:s,models:c,modelsLoading:u,modelsNote:o,modelsInheritNote:f,routeRunId:h,onSelectRun:g,routeTab:b,onSelectTab:y,onBack:v,refreshFleet:w,auth:k,theme:S,onToggleTheme:H,onSettings:Q,settings:F,search:C}){const _=jm(s.id),V={...Oc,...F.global,...F.project??{}},$=Object.keys(F.project??{}),W=a.jsx(C1,{effective:V,overrides:$,onOpen:Q}),se=s.activeRun?.id??null,E=h,B=g;x.useEffect(()=>{se&&g(se)},[se]);const q=E!==null&&E===se,R=xm(E,q),ne=_.find(ie=>ie.id===E),pe=q&&R.runStatus==="running",[fe,ye]=x.useState(null),[re,ke]=x.useState(null),M=b,L=y,[J,ve]=x.useState(()=>{try{const ie=Number(localStorage.getItem(bp));return ie>=Cc?ie:Sp}catch{return Sp}}),Se=ie=>{const nt=Math.max(Cc,Math.floor(window.innerWidth*.5)),Kt=Math.min(nt,Math.max(Cc,Math.round(ie)));ve(Kt);try{localStorage.setItem(bp,String(Kt))}catch{}},m=ie=>{ie.preventDefault();const nt=ie.clientX,Kt=J,Rn=zi=>Se(Kt+(nt-zi.clientX)),Ta=()=>{window.removeEventListener("pointermove",Rn),window.removeEventListener("pointerup",Ta),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",Rn),window.addEventListener("pointerup",Ta)},N=ie=>{typeof ie.id=="number"&&(fe&&fe!==ie.agent&&ye(null),ke({id:ie.id,n:Date.now()}))},Z=ie=>ye(fe===ie?null:ie),[P,le]=x.useState(!1),[ae,xe]=W1(),[I,K]=x.useState(()=>{try{return localStorage.getItem(xp)!=="closed"}catch{return!0}}),Be=ie=>{K(ie);try{localStorage.setItem(xp,ie?"open":"closed")}catch{}},[Le,ee]=x.useState(!1),[De,$e]=x.useState(!1),[vt,il]=x.useState(!1),[Ot,sl]=x.useState(!1),[_l,An]=x.useState(""),[Cl,ji]=x.useState(!1),Fs=async ie=>{An(""),ji(!0);try{const nt=await Fe.forkPlan(s.id,ie);if(!nt.ok){An((await nt.json()).error);return}B(null)}finally{ji(!1)}},[ht,Sa]=x.useState(""),[ja,Al]=x.useState(!1),Dl=_p(se?null:s.id),[Is,ka]=x.useState(!1),sn=V1(K1),rn=Kx(E,pe),on=R.approvals.length+R.questions.length,[rt,Vt]=x.useState(()=>Date.now());x.useEffect(()=>{if(on===0&&!pe)return;Vt(Date.now());const ie=setInterval(()=>Vt(Date.now()),1e4);return()=>clearInterval(ie)},[on,pe]),x.useEffect(()=>{ye(null)},[E]);const gt=x.useMemo(()=>pe?Z1(R):null,[pe,R]),Ps=x.useMemo(()=>Gp(R.missionDoc),[R.missionDoc]),er=async(ie={})=>{if(!E)return;An(""),le(!0);const nt=await Fe.resume(E,ie).finally(()=>le(!1));nt.ok?w():An((await nt.json()).error)},ki=async ie=>{Sa(""),Al(!0);let nt=ie.mission;try{nt=await Cp(s.id,ie.mission,ie.attachments??[])}catch(Rn){Sa(Rn.message),Al(!1);return}const Kt=await Fe.run(s.id,nt,ie.budget,{directorModel:ie.directorModel,workerModel:ie.workerModel,directorProviderId:ie.directorProviderId,workerProviderId:ie.workerProviderId,browserTools:ie.browserTools}).finally(()=>Al(!1));Kt.ok?w():Sa((await Kt.json()).error)},Rl=!se&&E===null,Ol=!se&&E&&(ne?.status==="interrupted"||ne?.status==="error")&&ne?.directorSessionId,Nl=sn&&ne&&(ne.directorModel||ne.workerModel)?a.jsxs("span",{title:`director: ${ne.directorModel||"default"} · workers: ${ne.workerModel||"default"}`,style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:"var(--r-pill)",border:"1px solid var(--line)",background:"var(--bg-inset)",fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",color:"var(--ink-1)",maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[a.jsx(te,{name:"model",size:11}),ne.directorModel||"default"," · ",ne.workerModel||"default"]}):null,cn=ne&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0},children:[a.jsx("div",{style:{fontSize:"var(--fs-sm)",fontWeight:"var(--fw-semibold)",color:"var(--ink-0)",lineHeight:"var(--lh)"},title:ne.mission,children:ne.title||ne.mission.split(`
67
+ `).find(ie=>ie.trim())||"Untitled run"}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums",flexWrap:"wrap"},children:[a.jsx("span",{children:new Date(ne.createdAt).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),a.jsx(Tl,{status:q?R.runStatus:ne.status}),!q&&a.jsx("span",{children:"read-only"})]})]}),un=a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[_.length===0&&a.jsx(st,{children:"No runs yet."}),_.map(ie=>a.jsx(m1,{mission:ie.mission,title:ie.title,createdAt:ie.createdAt,costUsd:ie.costUsd,costBasis:zl(ie),usage:ie.usage,status:ie.status,selected:ie.id===E,current:ie.id===se,onSelect:ie.id===E?void 0:()=>B(ie.id)},ie.id))]}),Dn=(ie,nt)=>a.jsxs("aside",{style:{position:"relative",borderLeft:"1px solid var(--line)",background:"var(--bg-panel)",minHeight:0,minWidth:0,display:"flex",flexDirection:"column"},children:[a.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize the rail",title:"Drag to resize",onPointerDown:m,style:{position:"absolute",left:-4,top:0,bottom:0,width:8,cursor:"col-resize",zIndex:2}}),ie&&a.jsx("div",{style:{padding:"var(--sp-2) var(--sp-3) 0",flex:"0 0 auto"},children:ie}),a.jsx("div",{style:{minHeight:0,overflowY:"auto",padding:"var(--sp-3)"},children:nt})]}),wi=a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:[cn,a.jsx(w1,{doc:R.missionDoc}),a.jsx(Si,{label:"Mission doc",open:Le,onToggle:()=>ee(!Le),children:a.jsx(Fx,{doc:R.missionDoc??void 0})}),a.jsx(G1,{agents:R.agents,filter:fe,onFilter:Z,sessionId:R.directorSessionId,details:ne&&a.jsx(I1,{r:ne,live:q,liveCost:R.costUsd,liveBasis:R.costBasis,liveUsage:R.usage,liveTurns:ne.turns,onChanged:w})}),W]}),wa=E?a.jsx(_1,{runId:E,deck:rn.deck,loading:rn.loading,error:rn.error,missing:rn.missing,services:R.services}):null,Hl=rn.deck?rn.deck.totals.files+rn.deck.artifacts.length:0,rl=a.jsx(_n,{size:"sm",value:M,onChange:ie=>L(ie),tabs:[{value:"mission",label:"Mission"},{value:"files",label:"Files",count:Hl},{value:"runs",label:"Runs",count:_.length}]}),tr=a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:"0 0 auto",flexWrap:"wrap",padding:"6px var(--sp-3) 0",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[R.agents.length>1&&a.jsx(g1,{agents:R.agents,filter:fe,onFilter:Z}),a.jsx("span",{style:{flex:1}}),R.entries.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(de,{variant:"ghost",size:"sm",icon:"timeline",title:I?"Hide the timeline":"Show the swimlane timeline — click a tick to jump to its entry",onClick:()=>Be(!I),children:"Timeline"}),a.jsx(de,{variant:"ghost",size:"sm",icon:"sort",title:ae==="newest"?"Newest first — click to read oldest first":"Oldest first — click to read newest first",onClick:()=>xe(ae==="newest"?"oldest":"newest"),children:ae==="newest"?"Newest first":"Oldest first"})]})]}),za=a.jsxs("div",{style:{minHeight:0,minWidth:0,display:"flex",flexDirection:"column"},children:[tr,I&&R.entries.length>0&&a.jsx("div",{style:{padding:"6px var(--sp-3) 0",flex:"0 0 auto"},children:a.jsx("div",{style:{background:"var(--bg-panel)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",padding:"8px 10px"},children:a.jsx(Wx,{agents:R.agents,entries:R.entries,live:pe,selected:fe,onSelect:Z,onTick:N})})}),!sn&&a.jsxs("div",{style:{padding:"6px var(--sp-3) 0",flex:"0 0 auto",display:"flex",flexDirection:"column",gap:6},children:[a.jsx(Si,{label:k1(Ps),open:De,onToggle:()=>$e(!De),children:wi}),a.jsx(Si,{label:`Files · ${Hl}`,open:vt,onToggle:()=>il(!vt),children:wa}),a.jsx(Si,{label:`Runs · ${_.length}`,open:Ot,onToggle:()=>sl(!Ot),children:un})]}),a.jsx(J1,{run:R,filter:fe,jump:re,order:ae})]});return a.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[a.jsxs(qp,{mode:"project",title:s.name,folder:s.folder,onBack:v,theme:S,onToggleTheme:H,onSettings:Q,search:C,children:[_l&&a.jsx(It,{tone:"error",inline:!0,children:_l}),E&&(R.runStatus==="running"&&on>0?a.jsx("span",{title:`Waiting on you: ${R.approvals.length} approval(s), ${R.questions.length} question(s)`,children:a.jsx(Tl,{status:"needs-you"})}):a.jsx(Tl,{status:R.runStatus})),E&&a.jsx(Yp,{spent:R.costUsd,budget:R.budgetUsd,detail:!0,costBasis:R.costBasis,usage:R.usage,turns:ne?.turns,elapsedMs:ne?.createdAt?(pe?rt:ne.endedAt??rt)-ne.createdAt:void 0}),Nl,pe&&a.jsx(de,{variant:"danger",onClick:()=>{Fe.interrupt(E)},children:"Interrupt"}),Ol&&a.jsx(X1,{director:ne?.directorModel,worker:ne?.workerModel,models:c,loading:u,note:o,busy:P,onResume:ie=>{er(ie)}}),!se&&E&&ne&&ne.status!=="running"&&a.jsx(de,{variant:"good",icon:"write",disabled:Cl,title:"Start a new planning conversation that builds on what this mission did",onClick:()=>{Fs(E)},children:Cl?"Opening…":"Plan the next step"}),!se&&E&&a.jsx(de,{variant:"primary",onClick:()=>B(null),children:"New mission"})]}),E&&a.jsx(j1,{approvals:R.approvals,questions:R.questions,now:rt,running:pe,activity:gt,onAllow:ie=>{Fe.permission(ie,"allow")},onAlways:ie=>{Fe.permission(ie,"allow_always")},onDeny:ie=>{Fe.permission(ie,"deny")},onAnswer:(ie,nt)=>{Fe.answer(ie,nt)}}),E&&!q&&a.jsxs(It,{tone:"readonly",children:["Viewing a past run (read-only).",a.jsx(de,{variant:"ghost",size:"sm",icon:"back",style:{marginLeft:"var(--sp-2)"},onClick:()=>B(se??null),children:se?"Back to the live run":"Back to planning"})]}),Rl?a.jsxs("div",{style:{flex:1,minHeight:0,minWidth:0,display:sn?"grid":"flex",flexDirection:"column",gridTemplateColumns:sn?`minmax(0, 1fr) ${J}px`:void 0},children:[a.jsxs("div",{style:{minHeight:0,minWidth:0,display:"flex",flexDirection:"column"},children:[!sn&&_.length>0&&a.jsx("div",{style:{padding:"6px var(--sp-3) 0",flex:"0 0 auto"},children:a.jsx(Si,{label:`Runs · ${_.length}`,open:Ot,onToggle:()=>sl(!Ot),children:un})}),Is?a.jsxs("div",{style:{flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column"},children:[a.jsx("div",{style:{padding:"var(--sp-2) var(--sp-3) 0",flex:"0 0 auto"},children:a.jsx(de,{variant:"ghost",size:"sm",icon:"back",onClick:()=>ka(!1),children:"Back to the conversation"})}),a.jsxs("div",{style:{margin:"auto",width:"100%",padding:"var(--sp-4) 0 var(--sp-5)"},children:[a.jsx(o1,{folder:s.folder,defaultBudgetUsd:s.defaultBudgetUsd,error:ht,busy:ja,models:c,modelsLoading:u,modelsNote:o,modelsInheritNote:f,onStart:ie=>{ki(ie)},style:{background:"var(--bg-panel)",border:"1px solid var(--line)",borderRadius:"var(--r-md)",padding:"var(--sp-5)",margin:"0 auto",boxSizing:"border-box"}}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",flexWrap:"wrap",margin:"var(--sp-3) auto 0",maxWidth:"var(--composer-max)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[a.jsx(Dp,{mode:s.billingMode??k.mode,compact:!0,account:k.account,source:Q1(s,k.source)}),a.jsxs("span",{style:{fontFamily:"var(--font-mono)"},children:["runs on ",zp(s.provider)??"the server default instance"]})]})]})]}):a.jsx(a.Fragment,{children:a.jsx(F1,{chat:Dl,folder:s.folder,starting:ja,error:ht,models:c,modelsLoading:u,modelsNote:o,modelsInheritNote:f,onStart:ie=>{ki(ie)},onCompose:()=>ka(!0),hasRuns:_.length>0,projectId:s.id,onSettings:Q})})]}),sn&&Dn(null,a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[W,a.jsxs("section",{children:[a.jsxs("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)",padding:"0 0 6px"},children:["Runs · ",_.length]}),_.length>0?un:a.jsx(st,{children:"No runs yet — the first mission you start here will be the first."})]})]}))]}):a.jsxs("main",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",flexDirection:"column"},children:[sn?a.jsxs("div",{style:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:`minmax(0, 1fr) ${J}px`},children:[za,Dn(rl,M==="mission"?wi:M==="files"?wa:un)]}):a.jsx("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:za}),q&&a.jsx("div",{style:{padding:"var(--sp-2) var(--sp-3) var(--sp-3)",flex:"0 0 auto"},children:a.jsx(h1,{agents:[{id:"director",status:R.runStatus==="running"?"running":"done"}],to:"director",onTo:()=>{},timing:"next",onTiming:()=>{},disabled:R.runStatus!=="running",disabledReason:"Run finished — start a new mission.",onSend:ie=>{Fe.steer(E,ie)}})})]})]})}const kp={small:.88,default:1,large:1.15,larger:1.3};function eb(){const s=x.useCallback(c=>{const u=kp[c]??1;document.documentElement.style.setProperty("--ui-scale",String(u));try{localStorage.setItem("foreman:textSize",c)}catch{}},[]);return x.useEffect(()=>{let c=null;try{c=localStorage.getItem("foreman:textSize")}catch{}c&&c in kp&&s(c)},[s]),s}function tb(){const[s,c]=x.useState(()=>localStorage.getItem("foreman:theme")||"light");x.useEffect(()=>{document.documentElement.dataset.theme=s,localStorage.setItem("foreman:theme",s)},[s]);const u=x.useCallback(o=>{c(o==="system"?window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark":o)},[]);return[s,()=>c(o=>o==="dark"?"light":"dark"),u]}function nb(s){const[c,u]=x.useState({models:null,loading:!0});return x.useEffect(()=>{let o=!0;u(h=>({...h,loading:!0}));const f=s?`/models?projectId=${encodeURIComponent(s)}`:"/models";return fetch(f).then(h=>h.ok?h.json():null).then(h=>{if(o){if(!h)return u({models:null,loading:!1});u({models:h.models,loading:!1,note:h.reachable===!1?`Cannot reach ${h.endpoint??"this project’s endpoint"}.`:h.models?.length===0?"This endpoint has no models installed.":void 0,inheritNote:h.provider&&h.provider!=="claude-code"?"inherits this project’s provider default":void 0})}}).catch(()=>o&&u({models:null,loading:!1})),()=>{o=!1}},[s]),c}function lb(s){const[c,u]=x.useState({instances:[],ollama:null,codex:null});return x.useEffect(()=>{if(!s)return;let o=!0;return fetch("/instances").then(f=>f.ok?f.json():null).then(f=>{o&&f&&u({instances:f.instances??[],ollama:f.ollama??null,codex:f.codex??null})}).catch(()=>{}),()=>{o=!1}},[s]),c}function ab(){const{projects:s,connected:c,auth:u,refresh:o,activity:f,update:h,version:g}=Sm(),{projectId:b,runId:y,tab:v,go:w,goRun:k}=Mm(),[S,H,Q]=tb(),F=eb(),C=nb(b),[_,V]=x.useState({global:{},projects:{}}),[$,W]=x.useState(!1),[se,E]=x.useState("models"),B=I=>{I&&E(I),W(!0)},q=lb($);x.useEffect(()=>{fetch("/settings").then(I=>I.ok?I.json():null).then(I=>I&&V(I)).catch(()=>{})},[]);const R=b?s.find(I=>I.id===b):null,[ne,pe]=x.useState(!1),[fe,ye]=x.useState(""),re=async(I,K)=>{ye(""),pe(!0);const Be=await(K===null?Fe.clearProviderKey(I):Fe.setProviderKey(I,K)).finally(()=>pe(!1));Be.ok?o():ye((await Be.json().catch(()=>({}))).error??"could not save the key")},ke=async I=>{const K={global:I.global,projects:{..._.projects}};R&&(Object.keys(I.project).length?K.projects[R.id]=I.project:delete K.projects[R.id]),V(K),W(!1),I.global.theme&&Q(I.global.theme),I.global.textSize&&F(I.global.textSize),await fetch("/settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({global:I.global,projectId:R?.id,project:R?K.projects[R.id]??{}:void 0})}).catch(()=>{}),R&&I.provider!==void 0&&(await Fe.updateProject(R.id,{provider:I.provider}).catch(()=>{}),o())},[M,L]=x.useState(""),J=M.trim().toLowerCase(),ve=wm(J),Se=I=>new Date(I).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),m=J?s.filter(I=>[I.name,I.folder].some(K=>K.toLowerCase().includes(J))).slice(0,8):[],N=[{id:"act-fleet",title:"Fleet",detail:"The board: what needs you, what is running, what finished",icon:"back",keys:"fleet home board",onPick:()=>w(null)},{id:"act-settings",title:"Settings",detail:R?`Global, and ${R.name}'s overrides`:"Models, budget, approvals, notifications",icon:"settings",keys:"settings preferences models budget telegram",onPick:()=>W(!0)},...R?[{id:"act-plan",title:`Plan in ${R.name}`,detail:"Back to the planning conversation",icon:"steer",keys:"plan planner mission new",onPick:()=>w(R.id)}]:[]].filter(I=>J&&(I.title.toLowerCase().includes(J)||I.keys.includes(J))),Z=[{label:"Projects",items:m.map(I=>({id:`p-${I.id}`,title:I.name,detail:I.folder,icon:"folder",onPick:()=>w(I.id)}))},{label:"Runs",count:ve.hits.length>=30?30:void 0,items:ve.hits.map(I=>({id:`r-${I.id}`,title:I.title||I.mission,detail:`${I.projectName}${I.title?` · ${I.mission}`:""}`,icon:"idle",status:I.status,meta:`${Se(I.endedAt??I.createdAt)}${I.costBasis==="priced"?` · $${I.costUsd.toFixed(2)}`:""}`,onPick:()=>{I.projectId&&k(I.projectId,I.id)}}))},{label:"Actions",items:N}],P=a.jsx(sx,{value:M,onChange:L,groups:Z,busy:ve.busy}),le={theme:S,onToggleTheme:H,search:P,onSettings:()=>B(),auth:u},ae=Tm(),xe=ae.status?ae.status.telegram.chatId?ae.status.telegram.chatLabel??"linked":null:void 0;return a.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[a.jsx("div",{style:{flex:1,minHeight:0},children:R?a.jsx(P1,{p:R,models:C.models,modelsLoading:C.loading,modelsNote:C.note,modelsInheritNote:C.inheritNote,routeRunId:y,onSelectRun:I=>k(R.id,I),routeTab:v,onSelectTab:I=>y&&k(R.id,y,I),onBack:()=>w(null),refreshFleet:o,settings:{global:_.global,project:_.projects[R.id]},...le}):a.jsx(Qx,{projects:s,connected:c,activity:f,onOpen:I=>w(I),onOpenRun:(I,K)=>k(I,K),refresh:o,query:M,onQuery:L,...le})}),a.jsx(ox,{connected:c,localUrl:window.location.origin,publicUrl:ae.status?.publicUrl,phone:xe,auth:u,version:g,update:h,onOpenSettings:B}),$&&a.jsx(q1,{scope:R?"project":"global",section:se,onSection:E,global:_.global,project:R?_.projects[R.id]:void 0,projectName:R?.name,models:C.models,modelsLoading:C.loading,modelsNote:C.note,provider:R?.provider??null,providerInstances:q.instances,providerOllama:q.ollama,providerCodex:q.codex,providerHasKey:R?.providerHasKey,providerKeyBusy:ne,providerKeyError:fe,onStoreProviderKey:(I,K)=>{re(I,K)},onClearProviderKey:I=>{re(I,null)},notify:ae,onSave:I=>{ke(I)},onClose:()=>W(!1)})]})}hm.createRoot(document.getElementById("root")).render(a.jsx(x.StrictMode,{children:a.jsx(ab,{})}));