@openscout/scout 0.2.35 → 0.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/index-BcTyuj21.js +94 -0
- package/dist/client/assets/index-DAkydZKt.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/control-plane-client/assets/{index-OWiDN7qF.css → index-BA2r5hxl.css} +1 -1
- package/dist/control-plane-client/assets/index-RH3faelc.js +9 -0
- package/dist/control-plane-client/index.html +2 -2
- package/dist/main.mjs +8 -7
- package/dist/pair-supervisor.mjs +8 -7
- package/dist/scout-control-plane-web.mjs +8 -7
- package/dist/scout-web-server.mjs +8 -7
- package/package.json +3 -3
- package/dist/client/assets/index-DG46oklW.css +0 -1
- package/dist/client/assets/index-MjXd65eO.js +0 -90
- package/dist/control-plane-client/assets/index-DHW-M-8X.js +0 -9
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
function Ej(e,r){for(var a=0;a<r.length;a++){const i=r[a];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const u=Object.getOwnPropertyDescriptor(i,o);u&&Object.defineProperty(e,o,u.get?u:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function a(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(o){if(o.ep)return;o.ep=!0;const u=a(o);fetch(o.href,u)}})();function Pu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dm={exports:{}},so={};var nb;function Rj(){if(nb)return so;nb=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(i,o,u){var d=null;if(u!==void 0&&(d=""+u),o.key!==void 0&&(d=""+o.key),"key"in o){u={};for(var f in o)f!=="key"&&(u[f]=o[f])}else u=o;return o=u.ref,{$$typeof:e,type:i,key:d,ref:o!==void 0?o:null,props:u}}return so.Fragment=r,so.jsx=a,so.jsxs=a,so}var lb;function Mj(){return lb||(lb=1,dm.exports=Rj()),dm.exports}var l=Mj(),fm={exports:{}},at={};var rb;function zj(){if(rb)return at;rb=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.iterator;function j(_){return _===null||typeof _!="object"?null:(_=v&&_[v]||_["@@iterator"],typeof _=="function"?_:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,w={};function M(_,le,R){this.props=_,this.context=le,this.refs=w,this.updater=R||C}M.prototype.isReactComponent={},M.prototype.setState=function(_,le){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,le,"setState")},M.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function D(){}D.prototype=M.prototype;function H(_,le,R){this.props=_,this.context=le,this.refs=w,this.updater=R||C}var X=H.prototype=new D;X.constructor=H,E(X,M.prototype),X.isPureReactComponent=!0;var q=Array.isArray;function L(){}var B={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function Z(_,le,R){var pe=R.ref;return{$$typeof:e,type:_,key:le,ref:pe!==void 0?pe:null,props:R}}function O(_,le){return Z(_.type,le,_.props)}function P(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function Q(_){var le={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(R){return le[R]})}var oe=/\/+/g;function J(_,le){return typeof _=="object"&&_!==null&&_.key!=null?Q(""+_.key):le.toString(36)}function ee(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(L,L):(_.status="pending",_.then(function(le){_.status==="pending"&&(_.status="fulfilled",_.value=le)},function(le){_.status==="pending"&&(_.status="rejected",_.reason=le)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function N(_,le,R,pe,xe){var ce=typeof _;(ce==="undefined"||ce==="boolean")&&(_=null);var Re=!1;if(_===null)Re=!0;else switch(ce){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(_.$$typeof){case e:case r:Re=!0;break;case y:return Re=_._init,N(Re(_._payload),le,R,pe,xe)}}if(Re)return xe=xe(_),Re=pe===""?"."+J(_,0):pe,q(xe)?(R="",Re!=null&&(R=Re.replace(oe,"$&/")+"/"),N(xe,le,R,"",function(He){return He})):xe!=null&&(P(xe)&&(xe=O(xe,R+(xe.key==null||_&&_.key===xe.key?"":(""+xe.key).replace(oe,"$&/")+"/")+Re)),le.push(xe)),1;Re=0;var Te=pe===""?".":pe+":";if(q(_))for(var Ne=0;Ne<_.length;Ne++)pe=_[Ne],ce=Te+J(pe,Ne),Re+=N(pe,le,R,ce,xe);else if(Ne=j(_),typeof Ne=="function")for(_=Ne.call(_),Ne=0;!(pe=_.next()).done;)pe=pe.value,ce=Te+J(pe,Ne++),Re+=N(pe,le,R,ce,xe);else if(ce==="object"){if(typeof _.then=="function")return N(ee(_),le,R,pe,xe);throw le=String(_),Error("Objects are not valid as a React child (found: "+(le==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":le)+"). If you meant to render a collection of children, use an array instead.")}return Re}function Y(_,le,R){if(_==null)return _;var pe=[],xe=0;return N(_,pe,"","",function(ce){return le.call(R,ce,xe++)}),pe}function $(_){if(_._status===-1){var le=_._result;le=le(),le.then(function(R){(_._status===0||_._status===-1)&&(_._status=1,_._result=R)},function(R){(_._status===0||_._status===-1)&&(_._status=2,_._result=R)}),_._status===-1&&(_._status=0,_._result=le)}if(_._status===1)return _._result.default;throw _._result}var ye=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var le=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(le))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},T={map:Y,forEach:function(_,le,R){Y(_,function(){le.apply(this,arguments)},R)},count:function(_){var le=0;return Y(_,function(){le++}),le},toArray:function(_){return Y(_,function(le){return le})||[]},only:function(_){if(!P(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return at.Activity=b,at.Children=T,at.Component=M,at.Fragment=a,at.Profiler=o,at.PureComponent=H,at.StrictMode=i,at.Suspense=p,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,at.__COMPILER_RUNTIME={__proto__:null,c:function(_){return B.H.useMemoCache(_)}},at.cache=function(_){return function(){return _.apply(null,arguments)}},at.cacheSignal=function(){return null},at.cloneElement=function(_,le,R){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var pe=E({},_.props),xe=_.key;if(le!=null)for(ce in le.key!==void 0&&(xe=""+le.key),le)!F.call(le,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&le.ref===void 0||(pe[ce]=le[ce]);var ce=arguments.length-2;if(ce===1)pe.children=R;else if(1<ce){for(var Re=Array(ce),Te=0;Te<ce;Te++)Re[Te]=arguments[Te+2];pe.children=Re}return Z(_.type,xe,pe)},at.createContext=function(_){return _={$$typeof:d,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:u,_context:_},_},at.createElement=function(_,le,R){var pe,xe={},ce=null;if(le!=null)for(pe in le.key!==void 0&&(ce=""+le.key),le)F.call(le,pe)&&pe!=="key"&&pe!=="__self"&&pe!=="__source"&&(xe[pe]=le[pe]);var Re=arguments.length-2;if(Re===1)xe.children=R;else if(1<Re){for(var Te=Array(Re),Ne=0;Ne<Re;Ne++)Te[Ne]=arguments[Ne+2];xe.children=Te}if(_&&_.defaultProps)for(pe in Re=_.defaultProps,Re)xe[pe]===void 0&&(xe[pe]=Re[pe]);return Z(_,ce,xe)},at.createRef=function(){return{current:null}},at.forwardRef=function(_){return{$$typeof:f,render:_}},at.isValidElement=P,at.lazy=function(_){return{$$typeof:y,_payload:{_status:-1,_result:_},_init:$}},at.memo=function(_,le){return{$$typeof:h,type:_,compare:le===void 0?null:le}},at.startTransition=function(_){var le=B.T,R={};B.T=R;try{var pe=_(),xe=B.S;xe!==null&&xe(R,pe),typeof pe=="object"&&pe!==null&&typeof pe.then=="function"&&pe.then(L,ye)}catch(ce){ye(ce)}finally{le!==null&&R.types!==null&&(le.types=R.types),B.T=le}},at.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},at.use=function(_){return B.H.use(_)},at.useActionState=function(_,le,R){return B.H.useActionState(_,le,R)},at.useCallback=function(_,le){return B.H.useCallback(_,le)},at.useContext=function(_){return B.H.useContext(_)},at.useDebugValue=function(){},at.useDeferredValue=function(_,le){return B.H.useDeferredValue(_,le)},at.useEffect=function(_,le){return B.H.useEffect(_,le)},at.useEffectEvent=function(_){return B.H.useEffectEvent(_)},at.useId=function(){return B.H.useId()},at.useImperativeHandle=function(_,le,R){return B.H.useImperativeHandle(_,le,R)},at.useInsertionEffect=function(_,le){return B.H.useInsertionEffect(_,le)},at.useLayoutEffect=function(_,le){return B.H.useLayoutEffect(_,le)},at.useMemo=function(_,le){return B.H.useMemo(_,le)},at.useOptimistic=function(_,le){return B.H.useOptimistic(_,le)},at.useReducer=function(_,le,R){return B.H.useReducer(_,le,R)},at.useRef=function(_){return B.H.useRef(_)},at.useState=function(_){return B.H.useState(_)},at.useSyncExternalStore=function(_,le,R){return B.H.useSyncExternalStore(_,le,R)},at.useTransition=function(){return B.H.useTransition()},at.version="19.2.3",at}var ab;function bp(){return ab||(ab=1,fm.exports=zj()),fm.exports}var A=bp();const z=Pu(A),Uu=Ej({__proto__:null,default:z},[A]);var mm={exports:{}},oo={},pm={exports:{}},hm={};var ib;function Oj(){return ib||(ib=1,(function(e){function r(N,Y){var $=N.length;N.push(Y);e:for(;0<$;){var ye=$-1>>>1,T=N[ye];if(0<o(T,Y))N[ye]=Y,N[$]=T,$=ye;else break e}}function a(N){return N.length===0?null:N[0]}function i(N){if(N.length===0)return null;var Y=N[0],$=N.pop();if($!==Y){N[0]=$;e:for(var ye=0,T=N.length,_=T>>>1;ye<_;){var le=2*(ye+1)-1,R=N[le],pe=le+1,xe=N[pe];if(0>o(R,$))pe<T&&0>o(xe,R)?(N[ye]=xe,N[pe]=$,ye=pe):(N[ye]=R,N[le]=$,ye=le);else if(pe<T&&0>o(xe,$))N[ye]=xe,N[pe]=$,ye=pe;else break e}}return Y}function o(N,Y){var $=N.sortIndex-Y.sortIndex;return $!==0?$:N.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],h=[],y=1,b=null,v=3,j=!1,C=!1,E=!1,w=!1,M=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function X(N){for(var Y=a(h);Y!==null;){if(Y.callback===null)i(h);else if(Y.startTime<=N)i(h),Y.sortIndex=Y.expirationTime,r(p,Y);else break;Y=a(h)}}function q(N){if(E=!1,X(N),!C)if(a(p)!==null)C=!0,L||(L=!0,Q());else{var Y=a(h);Y!==null&&ee(q,Y.startTime-N)}}var L=!1,B=-1,F=5,Z=-1;function O(){return w?!0:!(e.unstable_now()-Z<F)}function P(){if(w=!1,L){var N=e.unstable_now();Z=N;var Y=!0;try{e:{C=!1,E&&(E=!1,D(B),B=-1),j=!0;var $=v;try{t:{for(X(N),b=a(p);b!==null&&!(b.expirationTime>N&&O());){var ye=b.callback;if(typeof ye=="function"){b.callback=null,v=b.priorityLevel;var T=ye(b.expirationTime<=N);if(N=e.unstable_now(),typeof T=="function"){b.callback=T,X(N),Y=!0;break t}b===a(p)&&i(p),X(N)}else i(p);b=a(p)}if(b!==null)Y=!0;else{var _=a(h);_!==null&&ee(q,_.startTime-N),Y=!1}}break e}finally{b=null,v=$,j=!1}Y=void 0}}finally{Y?Q():L=!1}}}var Q;if(typeof H=="function")Q=function(){H(P)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,J=oe.port2;oe.port1.onmessage=P,Q=function(){J.postMessage(null)}}else Q=function(){M(P,0)};function ee(N,Y){B=M(function(){N(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(N){N.callback=null},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(N){switch(v){case 1:case 2:case 3:var Y=3;break;default:Y=v}var $=v;v=Y;try{return N()}finally{v=$}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(N,Y){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var $=v;v=N;try{return Y()}finally{v=$}},e.unstable_scheduleCallback=function(N,Y,$){var ye=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?ye+$:ye):$=ye,N){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=$+T,N={id:y++,callback:Y,priorityLevel:N,startTime:$,expirationTime:T,sortIndex:-1},$>ye?(N.sortIndex=$,r(h,N),a(p)===null&&N===a(h)&&(E?(D(B),B=-1):E=!0,ee(q,$-ye))):(N.sortIndex=T,r(p,N),C||j||(C=!0,L||(L=!0,Q()))),N},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(N){var Y=v;return function(){var $=v;v=Y;try{return N.apply(this,arguments)}finally{v=$}}}})(hm)),hm}var sb;function Lj(){return sb||(sb=1,pm.exports=Oj()),pm.exports}var xm={exports:{}},zn={};var ob;function Dj(){if(ob)return zn;ob=1;var e=bp();function r(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(r(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(p,h,y){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:b==null?null:""+b,children:p,containerInfo:h,implementation:y}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return zn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,zn.createPortal=function(p,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return u(p,h,null,y)},zn.flushSync=function(p){var h=d.T,y=i.p;try{if(d.T=null,i.p=2,p)return p()}finally{d.T=h,i.p=y,i.d.f()}},zn.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(p,h))},zn.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},zn.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var y=h.as,b=f(y,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,j=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:j}):y==="script"&&i.d.X(p,{crossOrigin:b,integrity:v,fetchPriority:j,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},zn.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=f(h.as,h.crossOrigin);i.d.M(p,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(p)},zn.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,b=f(y,h.crossOrigin);i.d.L(p,y,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},zn.preloadModule=function(p,h){if(typeof p=="string")if(h){var y=f(h.as,h.crossOrigin);i.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(p)},zn.requestFormReset=function(p){i.d.r(p)},zn.unstable_batchedUpdates=function(p,h){return p(h)},zn.useFormState=function(p,h,y){return d.H.useFormState(p,h,y)},zn.useFormStatus=function(){return d.H.useHostTransitionStatus()},zn.version="19.2.3",zn}var cb;function i1(){if(cb)return xm.exports;cb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),xm.exports=Dj(),xm.exports}var ub;function _j(){if(ub)return oo;ub=1;var e=Lj(),r=bp(),a=i1();function i(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function f(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(u(t)!==t)throw Error(i(188))}function h(t){var n=t.alternate;if(!n){if(n=u(t),n===null)throw Error(i(188));return n!==t?null:t}for(var s=t,c=n;;){var m=s.return;if(m===null)break;var x=m.alternate;if(x===null){if(c=m.return,c!==null){s=c;continue}break}if(m.child===x.child){for(x=m.child;x;){if(x===s)return p(m),t;if(x===c)return p(m),n;x=x.sibling}throw Error(i(188))}if(s.return!==c.return)s=m,c=x;else{for(var k=!1,S=m.child;S;){if(S===s){k=!0,s=m,c=x;break}if(S===c){k=!0,c=m,s=x;break}S=S.sibling}if(!k){for(S=x.child;S;){if(S===s){k=!0,s=x,c=m;break}if(S===c){k=!0,c=x,s=m;break}S=S.sibling}if(!k)throw Error(i(189))}}if(s.alternate!==c)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?t:n}function y(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=y(t),n!==null)return n;t=t.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),H=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function Q(t){return t===null||typeof t!="object"?null:(t=P&&t[P]||t["@@iterator"],typeof t=="function"?t:null)}var oe=Symbol.for("react.client.reference");function J(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===oe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case M:return"Profiler";case w:return"StrictMode";case q:return"Suspense";case L:return"SuspenseList";case Z:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case C:return"Portal";case H:return t.displayName||"Context";case D:return(t._context.displayName||"Context")+".Consumer";case X:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case B:return n=t.displayName||null,n!==null?n:J(t.type)||"Memo";case F:n=t._payload,t=t._init;try{return J(t(n))}catch{}}return null}var ee=Array.isArray,N=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},ye=[],T=-1;function _(t){return{current:t}}function le(t){0>T||(t.current=ye[T],ye[T]=null,T--)}function R(t,n){T++,ye[T]=t.current,t.current=n}var pe=_(null),xe=_(null),ce=_(null),Re=_(null);function Te(t,n){switch(R(ce,n),R(xe,t),R(pe,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Sg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Sg(n),t=Cg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}le(pe),R(pe,t)}function Ne(){le(pe),le(xe),le(ce)}function He(t){t.memoizedState!==null&&R(Re,t);var n=pe.current,s=Cg(n,t.type);n!==s&&(R(xe,t),R(pe,s))}function Le(t){xe.current===t&&(le(pe),le(xe)),Re.current===t&&(le(Re),lo._currentValue=$)}var Ue,it;function tt(t){if(Ue===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);Ue=n&&n[1]||"",it=-1<s.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Ue+t+it}var st=!1;function ot(t,n){if(!t||st)return"";st=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(n){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(ie){var re=ie}Reflect.construct(t,[],he)}else{try{he.call()}catch(ie){re=ie}t.call(he.prototype)}}else{try{throw Error()}catch(ie){re=ie}(he=t())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(ie){if(ie&&re&&typeof ie.stack=="string")return[ie.stack,re.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),k=x[0],S=x[1];if(k&&S){var U=k.split(`
|
|
4
|
-
`),ne=S.split(`
|
|
5
|
-
`);for(m=c=0;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;for(;m<ne.length&&!ne[m].includes("DetermineComponentFrameRoot");)m++;if(c===U.length||m===ne.length)for(c=U.length-1,m=ne.length-1;1<=c&&0<=m&&U[c]!==ne[m];)m--;for(;1<=c&&0<=m;c--,m--)if(U[c]!==ne[m]){if(c!==1||m!==1)do if(c--,m--,0>m||U[c]!==ne[m]){var de=`
|
|
6
|
-
`+U[c].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=c&&0<=m);break}}}finally{st=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?tt(s):""}function bt(t,n){switch(t.tag){case 26:case 27:case 5:return tt(t.type);case 16:return tt("Lazy");case 13:return t.child!==n&&n!==null?tt("Suspense Fallback"):tt("Suspense");case 19:return tt("SuspenseList");case 0:case 15:return ot(t.type,!1);case 11:return ot(t.type.render,!1);case 1:return ot(t.type,!0);case 31:return tt("Activity");default:return""}}function Ye(t){try{var n="",s=null;do n+=bt(t,s),s=t,t=t.return;while(t);return n}catch(c){return`
|
|
7
|
-
Error generating stack: `+c.message+`
|
|
8
|
-
`+c.stack}}var Ge=Object.prototype.hasOwnProperty,We=e.unstable_scheduleCallback,we=e.unstable_cancelCallback,et=e.unstable_shouldYield,Se=e.unstable_requestPaint,Ze=e.unstable_now,mt=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,ge=e.unstable_UserBlockingPriority,Ce=e.unstable_NormalPriority,_e=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,Ae=e.log,ue=e.unstable_setDisableYieldValue,Ee=null,V=null;function me(t){if(typeof Ae=="function"&&ue(t),V&&typeof V.setStrictMode=="function")try{V.setStrictMode(Ee,t)}catch{}}var je=Math.clz32?Math.clz32:qe,Fe=Math.log,Je=Math.LN2;function qe(t){return t>>>=0,t===0?32:31-(Fe(t)/Je|0)|0}var St=256,Yt=262144,Vt=4194304;function Pt(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function yt(t,n,s){var c=t.pendingLanes;if(c===0)return 0;var m=0,x=t.suspendedLanes,k=t.pingedLanes;t=t.warmLanes;var S=c&134217727;return S!==0?(c=S&~x,c!==0?m=Pt(c):(k&=S,k!==0?m=Pt(k):s||(s=S&~t,s!==0&&(m=Pt(s))))):(S=c&~x,S!==0?m=Pt(S):k!==0?m=Pt(k):s||(s=c&~t,s!==0&&(m=Pt(s)))),m===0?0:n!==0&&n!==m&&(n&x)===0&&(x=m&-m,s=n&-n,x>=s||x===32&&(s&4194048)!==0)?n:m}function Wt(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function se(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Me(){var t=Vt;return Vt<<=1,(Vt&62914560)===0&&(Vt=4194304),t}function ze(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function nt(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Qt(t,n,s,c,m,x){var k=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var S=t.entanglements,U=t.expirationTimes,ne=t.hiddenUpdates;for(s=k&~s;0<s;){var de=31-je(s),he=1<<de;S[de]=0,U[de]=-1;var re=ne[de];if(re!==null)for(ne[de]=null,de=0;de<re.length;de++){var ie=re[de];ie!==null&&(ie.lane&=-536870913)}s&=~he}c!==0&&gn(t,c,0),x!==0&&m===0&&t.tag!==0&&(t.suspendedLanes|=x&~(k&~n))}function gn(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var c=31-je(n);t.entangledLanes|=n,t.entanglements[c]=t.entanglements[c]|1073741824|s&261930}function ha(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var c=31-je(s),m=1<<c;m&n|t[c]&n&&(t[c]|=n),s&=~m}}function Gl(t,n){var s=n&-n;return s=(s&42)!==0?1:xa(s),(s&(t.suspendedLanes|n))!==0?0:s}function xa(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function bn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Wa(){var t=Y.p;return t!==0?t:(t=window.event,t===void 0?32:Xg(t.type))}function ga(t,n){var s=Y.p;try{return Y.p=t,n()}finally{Y.p=s}}var Un=Math.random().toString(36).slice(2),$t="__reactFiber$"+Un,dn="__reactProps$"+Un,Ht="__reactContainer$"+Un,$l="__reactEvents$"+Un,Ml="__reactListeners$"+Un,Yl="__reactHandles$"+Un,ns="__reactResources$"+Un,Wn="__reactMarker$"+Un;function zl(t){delete t[$t],delete t[dn],delete t[$l],delete t[Ml],delete t[Yl]}function dl(t){var n=t[$t];if(n)return n;for(var s=t.parentNode;s;){if(n=s[Ht]||s[$t]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=Og(t);t!==null;){if(s=t[$t])return s;t=Og(t)}return n}t=s,s=t.parentNode}return null}function Ol(t){if(t=t[$t]||t[Ht]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function Sr(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(i(33))}function Ll(t){var n=t[ns];return n||(n=t[ns]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ft(t){t[Wn]=!0}var ba=new Set,ya={};function Dl(t,n){Ql(t,n),Ql(t+"Capture",n)}function Ql(t,n){for(ya[t]=n,t=0;t<n.length;t++)ba.add(n[t])}var Lo=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]*$"),ls={},Ja={};function rs(t){return Ge.call(Ja,t)?!0:Ge.call(ls,t)?!1:Lo.test(t)?Ja[t]=!0:(ls[t]=!0,!1)}function Xl(t,n,s){if(rs(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var c=n.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+s)}}function _l(t,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+s)}}function Hn(t,n,s,c){if(c===null)t.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,""+c)}}function Xt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ei(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ve(t,n,s){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,x=c.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return m.call(this)},set:function(k){s=""+k,x.call(this,k)}}),Object.defineProperty(t,n,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(k){s=""+k},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Ke(t){if(!t._valueTracker){var n=ei(t)?"checked":"value";t._valueTracker=ve(t,n,""+t[n])}}function zt(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),c="";return t&&(c=ei(t)?t.checked?"true":"false":t.value),t=c,t!==s?(n.setValue(t),!0):!1}function yn(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var ti=/[\n"\\]/g;function vn(t){return t.replace(ti,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Cr(t,n,s,c,m,x,k,S){t.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?t.type=k:t.removeAttribute("type"),n!=null?k==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Xt(n)):t.value!==""+Xt(n)&&(t.value=""+Xt(n)):k!=="submit"&&k!=="reset"||t.removeAttribute("value"),n!=null?Tr(t,k,Xt(n)):s!=null?Tr(t,k,Xt(s)):c!=null&&t.removeAttribute("value"),m==null&&x!=null&&(t.defaultChecked=!!x),m!=null&&(t.checked=m&&typeof m!="function"&&typeof m!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.name=""+Xt(S):t.removeAttribute("name")}function _n(t,n,s,c,m,x,k,S){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),n!=null||s!=null){if(!(x!=="submit"&&x!=="reset"||n!=null)){Ke(t);return}s=s!=null?""+Xt(s):"",n=n!=null?""+Xt(n):s,S||n===t.value||(t.value=n),t.defaultValue=n}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=S?t.checked:!!c,t.defaultChecked=!!c,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(t.name=k),Ke(t)}function Tr(t,n,s){n==="number"&&yn(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function va(t,n,s,c){if(t=t.options,n){n={};for(var m=0;m<s.length;m++)n["$"+s[m]]=!0;for(s=0;s<t.length;s++)m=n.hasOwnProperty("$"+t[s].value),t[s].selected!==m&&(t[s].selected=m),m&&c&&(t[s].defaultSelected=!0)}else{for(s=""+Xt(s),n=null,m=0;m<t.length;m++){if(t[m].value===s){t[m].selected=!0,c&&(t[m].defaultSelected=!0);return}n!==null||t[m].disabled||(n=t[m])}n!==null&&(n.selected=!0)}}function Zu(t,n,s){if(n!=null&&(n=""+Xt(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+Xt(s):""}function Do(t,n,s,c){if(n==null){if(c!=null){if(s!=null)throw Error(i(92));if(ee(c)){if(1<c.length)throw Error(i(93));c=c[0]}s=c}s==null&&(s=""),n=s}s=Xt(n),t.defaultValue=s,c=t.textContent,c===s&&c!==""&&c!==null&&(t.value=c),Ke(t)}function Kl(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var ih=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 Wu(t,n,s){var c=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":c?t.setProperty(n,s):typeof s!="number"||s===0||ih.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function _o(t,n,s){if(n!=null&&typeof n!="object")throw Error(i(62));if(t=t.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||n!=null&&n.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var m in n)c=n[m],n.hasOwnProperty(m)&&s[m]!==c&&Wu(t,m,c)}else for(var x in n)n.hasOwnProperty(x)&&Wu(t,x,n[x])}function as(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Ju=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"]]),ed=/^[\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 ni(t){return ed.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Nl(){}var is=null;function ss(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ar=null,Er=null;function Bo(t){var n=Ol(t);if(n&&(t=n.stateNode)){var s=t[dn]||null;e:switch(t=n.stateNode,n.type){case"input":if(Cr(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+vn(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var c=s[n];if(c!==t&&c.form===t.form){var m=c[dn]||null;if(!m)throw Error(i(90));Cr(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(n=0;n<s.length;n++)c=s[n],c.form===t.form&&zt(c)}break e;case"textarea":Zu(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&va(t,!!s.multiple,n,!1)}}}var Io=!1;function os(t,n,s){if(Io)return t(n,s);Io=!0;try{var c=t(n);return c}finally{if(Io=!1,(Ar!==null||Er!==null)&&(_c(),Ar&&(n=Ar,t=Er,Er=Ar=null,Bo(n),t)))for(n=0;n<t.length;n++)Bo(t[n])}}function Zl(t,n){var s=t.stateNode;if(s===null)return null;var c=s[dn]||null;if(c===null)return null;s=c[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(i(231,n,typeof s));return s}var Jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ka=!1;if(Jn)try{var Wl={};Object.defineProperty(Wl,"passive",{get:function(){ka=!0}}),window.addEventListener("test",Wl,Wl),window.removeEventListener("test",Wl,Wl)}catch{ka=!1}var En=null,Jl=null,li=null;function Po(){if(li)return li;var t,n=Jl,s=n.length,c,m="value"in En?En.value:En.textContent,x=m.length;for(t=0;t<s&&n[t]===m[t];t++);var k=s-t;for(c=1;c<=k&&n[s-c]===m[x-c];c++);return li=m.slice(t,1<c?1-c:void 0)}function cs(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function kn(){return!0}function ja(){return!1}function jn(t){function n(s,c,m,x,k){this._reactName=s,this._targetInst=m,this.type=c,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var S in t)t.hasOwnProperty(S)&&(s=t[S],this[S]=s?s(x):x[S]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?kn:ja,this.isPropagationStopped=ja,this}return b(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=kn)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=kn)},persist:function(){},isPersistent:kn}),n}var er={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rr=jn(er),Mr=b({},er,{view:0,detail:0}),Uo=jn(Mr),us,ds,Na,ri=b({},Mr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ps,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Na&&(Na&&t.type==="mousemove"?(us=t.screenX-Na.screenX,ds=t.screenY-Na.screenY):ds=us=0,Na=t),us)},movementY:function(t){return"movementY"in t?t.movementY:ds}}),Ho=jn(ri),td=b({},ri,{dataTransfer:0}),ai=jn(td),nd=b({},Mr,{relatedTarget:0}),fs=jn(nd),ld=b({},er,{animationName:0,elapsedTime:0,pseudoElement:0}),rd=jn(ld),ms=b({},er,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),ad=jn(ms),id=b({},er,{data:0}),ii=jn(id),sd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},od={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"},cd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ud(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=cd[t])?!!n[t]:!1}function ps(){return ud}var dd=b({},Mr,{key:function(t){if(t.key){var n=sd[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=cs(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?od[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ps,charCode:function(t){return t.type==="keypress"?cs(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?cs(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),fd=jn(dd),md=b({},ri,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fo=jn(md),pd=b({},Mr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ps}),hd=jn(pd),qo=b({},er,{propertyName:0,elapsedTime:0,pseudoElement:0}),xd=jn(qo),gd=b({},ri,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),bd=jn(gd),yd=b({},er,{newState:0,oldState:0}),vd=jn(yd),hs=[9,13,27,32],pn=Jn&&"CompositionEvent"in window,zr=null;Jn&&"documentMode"in document&&(zr=document.documentMode);var xs=Jn&&"TextEvent"in window&&!zr,Fn=Jn&&(!pn||zr&&8<zr&&11>=zr),gs=" ",el=!1;function tr(t,n){switch(t){case"keyup":return hs.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wa(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Or=!1;function kd(t,n){switch(t){case"compositionend":return wa(n);case"keypress":return n.which!==32?null:(el=!0,gs);case"textInput":return t=n.data,t===gs&&el?null:t;default:return null}}function jd(t,n){if(Or)return t==="compositionend"||!pn&&tr(t,n)?(t=Po(),li=Jl=En=null,Or=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Fn&&n.locale!=="ko"?null:n.data;default:return null}}var Nd={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 Vo(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Nd[t.type]:n==="textarea"}function Go(t,n,s,c){Ar?Er?Er.push(c):Er=[c]:Ar=c,n=qc(n,"onChange"),0<n.length&&(s=new Rr("onChange","change",null,s,c),t.push({event:s,listeners:n}))}var Sa=null,Ca=null;function sh(t){yg(t,0)}function si(t){var n=Sr(t);if(zt(n))return t}function $o(t,n){if(t==="change")return n}var Yo=!1;if(Jn){var bs;if(Jn){var ys="oninput"in document;if(!ys){var Qo=document.createElement("div");Qo.setAttribute("oninput","return;"),ys=typeof Qo.oninput=="function"}bs=ys}else bs=!1;Yo=bs&&(!document.documentMode||9<document.documentMode)}function Xo(){Sa&&(Sa.detachEvent("onpropertychange",Ko),Ca=Sa=null)}function Ko(t){if(t.propertyName==="value"&&si(Ca)){var n=[];Go(n,Ca,t,ss(t)),os(sh,n)}}function wd(t,n,s){t==="focusin"?(Xo(),Sa=n,Ca=s,Sa.attachEvent("onpropertychange",Ko)):t==="focusout"&&Xo()}function Sd(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return si(Ca)}function Cd(t,n){if(t==="click")return si(n)}function Td(t,n){if(t==="input"||t==="change")return si(n)}function Ad(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var qn=typeof Object.is=="function"?Object.is:Ad;function Ta(t,n){if(qn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),c=Object.keys(n);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var m=s[c];if(!Ge.call(n,m)||!qn(t[m],n[m]))return!1}return!0}function Bl(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Zo(t,n){var s=Bl(t);t=0;for(var c;s;){if(s.nodeType===3){if(c=t+s.textContent.length,t<=n&&c>=n)return{node:s,offset:n-t};t=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Bl(s)}}function vs(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?vs(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Wo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=yn(t.document);n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=yn(t.document)}return n}function oi(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var Ed=Jn&&"documentMode"in document&&11>=document.documentMode,Lr=null,ks=null,Aa=null,js=!1;function Jo(t,n,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;js||Lr==null||Lr!==yn(c)||(c=Lr,"selectionStart"in c&&oi(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Aa&&Ta(Aa,c)||(Aa=c,c=qc(ks,"onSelect"),0<c.length&&(n=new Rr("onSelect","select",null,n,s),t.push({event:n,listeners:c}),n.target=Lr)))}function wl(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var Dr={animationend:wl("Animation","AnimationEnd"),animationiteration:wl("Animation","AnimationIteration"),animationstart:wl("Animation","AnimationStart"),transitionrun:wl("Transition","TransitionRun"),transitionstart:wl("Transition","TransitionStart"),transitioncancel:wl("Transition","TransitionCancel"),transitionend:wl("Transition","TransitionEnd")},Ns={},ec={};Jn&&(ec=document.createElement("div").style,"AnimationEvent"in window||(delete Dr.animationend.animation,delete Dr.animationiteration.animation,delete Dr.animationstart.animation),"TransitionEvent"in window||delete Dr.transitionend.transition);function fl(t){if(Ns[t])return Ns[t];if(!Dr[t])return t;var n=Dr[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in ec)return Ns[t]=n[s];return t}var tc=fl("animationend"),nc=fl("animationiteration"),Ea=fl("animationstart"),Rd=fl("transitionrun"),ci=fl("transitionstart"),Md=fl("transitioncancel"),ui=fl("transitionend"),lc=new Map,ws="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(" ");ws.push("scrollEnd");function tl(t,n){lc.set(t,n),Dl(n,[t])}var Ra=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Rn=[],_r=0,Mn=0;function di(){for(var t=_r,n=Mn=_r=0;n<t;){var s=Rn[n];Rn[n++]=null;var c=Rn[n];Rn[n++]=null;var m=Rn[n];Rn[n++]=null;var x=Rn[n];if(Rn[n++]=null,c!==null&&m!==null){var k=c.pending;k===null?m.next=m:(m.next=k.next,k.next=m),c.pending=m}x!==0&&rc(s,m,x)}}function fi(t,n,s,c){Rn[_r++]=t,Rn[_r++]=n,Rn[_r++]=s,Rn[_r++]=c,Mn|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function ml(t,n,s,c){return fi(t,n,s,c),mi(t)}function nr(t,n){return fi(t,null,null,n),mi(t)}function rc(t,n,s){t.lanes|=s;var c=t.alternate;c!==null&&(c.lanes|=s);for(var m=!1,x=t.return;x!==null;)x.childLanes|=s,c=x.alternate,c!==null&&(c.childLanes|=s),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(m=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,m&&n!==null&&(m=31-je(s),t=x.hiddenUpdates,c=t[m],c===null?t[m]=[n]:c.push(n),n.lane=s|536870912),x):null}function mi(t){if(50<Ks)throw Ks=0,Df=null,Error(i(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Br={};function Ss(t,n,s,c){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bn(t,n,s,c){return new Ss(t,n,s,c)}function Cs(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Jt(t,n){var s=t.alternate;return s===null?(s=Bn(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function Ts(t,n){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,n=s.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function pl(t,n,s,c,m,x){var k=0;if(c=t,typeof t=="function")Cs(t)&&(k=1);else if(typeof t=="string")k=gj(t,s,pe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Z:return t=Bn(31,s,n,m),t.elementType=Z,t.lanes=x,t;case E:return lr(s.children,m,x,n);case w:k=8,m|=24;break;case M:return t=Bn(12,s,n,m|2),t.elementType=M,t.lanes=x,t;case q:return t=Bn(13,s,n,m),t.elementType=q,t.lanes=x,t;case L:return t=Bn(19,s,n,m),t.elementType=L,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case H:k=10;break e;case D:k=9;break e;case X:k=11;break e;case B:k=14;break e;case F:k=16,c=null;break e}k=29,s=Error(i(130,t===null?"null":typeof t,"")),c=null}return n=Bn(k,s,n,m),n.elementType=t,n.type=c,n.lanes=x,n}function lr(t,n,s,c){return t=Bn(7,t,c,n),t.lanes=s,t}function Ir(t,n,s){return t=Bn(6,t,null,n),t.lanes=s,t}function ac(t){var n=Bn(18,null,null,0);return n.stateNode=t,n}function As(t,n,s){return n=Bn(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Pr=new WeakMap;function Nn(t,n){if(typeof t=="object"&&t!==null){var s=Pr.get(t);return s!==void 0?s:(n={value:t,source:n,stack:Ye(n)},Pr.set(t,n),n)}return{value:t,source:n,stack:Ye(n)}}var rr=[],Ur=0,pi=null,Hr=0,wn=[],Vn=0,Sl=null,hl=1,nl="";function xl(t,n){rr[Ur++]=Hr,rr[Ur++]=pi,pi=t,Hr=n}function ic(t,n,s){wn[Vn++]=hl,wn[Vn++]=nl,wn[Vn++]=Sl,Sl=t;var c=hl;t=nl;var m=32-je(c)-1;c&=~(1<<m),s+=1;var x=32-je(n)+m;if(30<x){var k=m-m%5;x=(c&(1<<k)-1).toString(32),c>>=k,m-=k,hl=1<<32-je(n)+m|s<<m|c,nl=x+t}else hl=1<<x|s<<m|c,nl=t}function hi(t){t.return!==null&&(xl(t,1),ic(t,1,0))}function Es(t){for(;t===pi;)pi=rr[--Ur],rr[Ur]=null,Hr=rr[--Ur],rr[Ur]=null;for(;t===Sl;)Sl=wn[--Vn],wn[Vn]=null,nl=wn[--Vn],wn[Vn]=null,hl=wn[--Vn],wn[Vn]=null}function vt(t,n){wn[Vn++]=hl,wn[Vn++]=nl,wn[Vn++]=Sl,hl=n.id,nl=n.overflow,Sl=t}var nn=null,_t=null,ft=!1,I=null,W=!1,be=Error(i(519));function At(t){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Rs(Nn(n,t)),be}function xi(t){var n=t.stateNode,s=t.type,c=t.memoizedProps;switch(n[$t]=t,n[dn]=c,s){case"dialog":xt("cancel",n),xt("close",n);break;case"iframe":case"object":case"embed":xt("load",n);break;case"video":case"audio":for(s=0;s<Ws.length;s++)xt(Ws[s],n);break;case"source":xt("error",n);break;case"img":case"image":case"link":xt("error",n),xt("load",n);break;case"details":xt("toggle",n);break;case"input":xt("invalid",n),_n(n,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":xt("invalid",n);break;case"textarea":xt("invalid",n),Do(n,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||c.suppressHydrationWarning===!0||Ng(n.textContent,s)?(c.popover!=null&&(xt("beforetoggle",n),xt("toggle",n)),c.onScroll!=null&&xt("scroll",n),c.onScrollEnd!=null&&xt("scrollend",n),c.onClick!=null&&(n.onclick=Nl),n=!0):n=!1,n||At(t,!0)}function sc(t){for(nn=t.return;nn;)switch(nn.tag){case 5:case 31:case 13:W=!1;return;case 27:case 3:W=!0;return;default:nn=nn.return}}function gi(t){if(t!==nn)return!1;if(!ft)return sc(t),ft=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Kf(t.type,t.memoizedProps)),s=!s),s&&_t&&At(t),sc(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));_t=zg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));_t=zg(t)}else n===27?(n=_t,ta(t.type)?(t=tm,tm=null,_t=t):_t=n):_t=nn?bl(t.stateNode.nextSibling):null;return!0}function Ma(){_t=nn=null,ft=!1}function zd(){var t=I;return t!==null&&(Qn===null?Qn=t:Qn.push.apply(Qn,t),I=null),t}function Rs(t){I===null?I=[t]:I.push(t)}var Od=_(null),za=null,ar=null;function Fr(t,n,s){R(Od,n._currentValue),n._currentValue=s}function ir(t){t._currentValue=Od.current,le(Od)}function Ld(t,n,s){for(;t!==null;){var c=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),t===s)break;t=t.return}}function Dd(t,n,s,c){var m=t.child;for(m!==null&&(m.return=t);m!==null;){var x=m.dependencies;if(x!==null){var k=m.child;x=x.firstContext;e:for(;x!==null;){var S=x;x=m;for(var U=0;U<n.length;U++)if(S.context===n[U]){x.lanes|=s,S=x.alternate,S!==null&&(S.lanes|=s),Ld(x.return,s,t),c||(k=null);break e}x=S.next}}else if(m.tag===18){if(k=m.return,k===null)throw Error(i(341));k.lanes|=s,x=k.alternate,x!==null&&(x.lanes|=s),Ld(k,s,t),k=null}else k=m.child;if(k!==null)k.return=m;else for(k=m;k!==null;){if(k===t){k=null;break}if(m=k.sibling,m!==null){m.return=k.return,k=m;break}k=k.return}m=k}}function bi(t,n,s,c){t=null;for(var m=n,x=!1;m!==null;){if(!x){if((m.flags&524288)!==0)x=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var k=m.alternate;if(k===null)throw Error(i(387));if(k=k.memoizedProps,k!==null){var S=m.type;qn(m.pendingProps.value,k.value)||(t!==null?t.push(S):t=[S])}}else if(m===Re.current){if(k=m.alternate,k===null)throw Error(i(387));k.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(t!==null?t.push(lo):t=[lo])}m=m.return}t!==null&&Dd(n,t,s,c),n.flags|=262144}function oc(t){for(t=t.firstContext;t!==null;){if(!qn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Oa(t){za=t,ar=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Sn(t){return oh(za,t)}function cc(t,n){return za===null&&Oa(t),oh(t,n)}function oh(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},ar===null){if(t===null)throw Error(i(308));ar=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else ar=ar.next=n;return s}var mk=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,c){t.push(c)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},pk=e.unstable_scheduleCallback,hk=e.unstable_NormalPriority,ln={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _d(){return{controller:new mk,data:new Map,refCount:0}}function Ms(t){t.refCount--,t.refCount===0&&pk(hk,function(){t.controller.abort()})}var zs=null,Bd=0,yi=0,vi=null;function xk(t,n){if(zs===null){var s=zs=[];Bd=0,yi=Hf(),vi={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Bd++,n.then(ch,ch),n}function ch(){if(--Bd===0&&zs!==null){vi!==null&&(vi.status="fulfilled");var t=zs;zs=null,yi=0,vi=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function gk(t,n){var s=[],c={status:"pending",value:null,reason:null,then:function(m){s.push(m)}};return t.then(function(){c.status="fulfilled",c.value=n;for(var m=0;m<s.length;m++)(0,s[m])(n)},function(m){for(c.status="rejected",c.reason=m,m=0;m<s.length;m++)(0,s[m])(void 0)}),c}var uh=N.S;N.S=function(t,n){Yx=Ze(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&xk(t,n),uh!==null&&uh(t,n)};var La=_(null);function Id(){var t=La.current;return t!==null?t:Bt.pooledCache}function uc(t,n){n===null?R(La,La.current):R(La,n.pool)}function dh(){var t=Id();return t===null?null:{parent:ln._currentValue,pool:t}}var ki=Error(i(460)),Pd=Error(i(474)),dc=Error(i(542)),fc={then:function(){}};function fh(t){return t=t.status,t==="fulfilled"||t==="rejected"}function mh(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(Nl,Nl),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,hh(t),t;default:if(typeof n.status=="string")n.then(Nl,Nl);else{if(t=Bt,t!==null&&100<t.shellSuspendCounter)throw Error(i(482));t=n,t.status="pending",t.then(function(c){if(n.status==="pending"){var m=n;m.status="fulfilled",m.value=c}},function(c){if(n.status==="pending"){var m=n;m.status="rejected",m.reason=c}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,hh(t),t}throw _a=n,ki}}function Da(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(_a=s,ki):s}}var _a=null;function ph(){if(_a===null)throw Error(i(459));var t=_a;return _a=null,t}function hh(t){if(t===ki||t===dc)throw Error(i(483))}var ji=null,Os=0;function mc(t){var n=Os;return Os+=1,ji===null&&(ji=[]),mh(ji,t,n)}function Ls(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function pc(t,n){throw n.$$typeof===v?Error(i(525)):(t=Object.prototype.toString.call(n),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function xh(t){function n(K,G){if(t){var te=K.deletions;te===null?(K.deletions=[G],K.flags|=16):te.push(G)}}function s(K,G){if(!t)return null;for(;G!==null;)n(K,G),G=G.sibling;return null}function c(K){for(var G=new Map;K!==null;)K.key!==null?G.set(K.key,K):G.set(K.index,K),K=K.sibling;return G}function m(K,G){return K=Jt(K,G),K.index=0,K.sibling=null,K}function x(K,G,te){return K.index=te,t?(te=K.alternate,te!==null?(te=te.index,te<G?(K.flags|=67108866,G):te):(K.flags|=67108866,G)):(K.flags|=1048576,G)}function k(K){return t&&K.alternate===null&&(K.flags|=67108866),K}function S(K,G,te,fe){return G===null||G.tag!==6?(G=Ir(te,K.mode,fe),G.return=K,G):(G=m(G,te),G.return=K,G)}function U(K,G,te,fe){var Ve=te.type;return Ve===E?de(K,G,te.props.children,fe,te.key):G!==null&&(G.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===F&&Da(Ve)===G.type)?(G=m(G,te.props),Ls(G,te),G.return=K,G):(G=pl(te.type,te.key,te.props,null,K.mode,fe),Ls(G,te),G.return=K,G)}function ne(K,G,te,fe){return G===null||G.tag!==4||G.stateNode.containerInfo!==te.containerInfo||G.stateNode.implementation!==te.implementation?(G=As(te,K.mode,fe),G.return=K,G):(G=m(G,te.children||[]),G.return=K,G)}function de(K,G,te,fe,Ve){return G===null||G.tag!==7?(G=lr(te,K.mode,fe,Ve),G.return=K,G):(G=m(G,te),G.return=K,G)}function he(K,G,te){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Ir(""+G,K.mode,te),G.return=K,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case j:return te=pl(G.type,G.key,G.props,null,K.mode,te),Ls(te,G),te.return=K,te;case C:return G=As(G,K.mode,te),G.return=K,G;case F:return G=Da(G),he(K,G,te)}if(ee(G)||Q(G))return G=lr(G,K.mode,te,null),G.return=K,G;if(typeof G.then=="function")return he(K,mc(G),te);if(G.$$typeof===H)return he(K,cc(K,G),te);pc(K,G)}return null}function re(K,G,te,fe){var Ve=G!==null?G.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Ve!==null?null:S(K,G,""+te,fe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case j:return te.key===Ve?U(K,G,te,fe):null;case C:return te.key===Ve?ne(K,G,te,fe):null;case F:return te=Da(te),re(K,G,te,fe)}if(ee(te)||Q(te))return Ve!==null?null:de(K,G,te,fe,null);if(typeof te.then=="function")return re(K,G,mc(te),fe);if(te.$$typeof===H)return re(K,G,cc(K,te),fe);pc(K,te)}return null}function ie(K,G,te,fe,Ve){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return K=K.get(te)||null,S(G,K,""+fe,Ve);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case j:return K=K.get(fe.key===null?te:fe.key)||null,U(G,K,fe,Ve);case C:return K=K.get(fe.key===null?te:fe.key)||null,ne(G,K,fe,Ve);case F:return fe=Da(fe),ie(K,G,te,fe,Ve)}if(ee(fe)||Q(fe))return K=K.get(te)||null,de(G,K,fe,Ve,null);if(typeof fe.then=="function")return ie(K,G,te,mc(fe),Ve);if(fe.$$typeof===H)return ie(K,G,te,cc(G,fe),Ve);pc(G,fe)}return null}function Oe(K,G,te,fe){for(var Ve=null,Ct=null,Pe=G,ut=G=0,jt=null;Pe!==null&&ut<te.length;ut++){Pe.index>ut?(jt=Pe,Pe=null):jt=Pe.sibling;var Tt=re(K,Pe,te[ut],fe);if(Tt===null){Pe===null&&(Pe=jt);break}t&&Pe&&Tt.alternate===null&&n(K,Pe),G=x(Tt,G,ut),Ct===null?Ve=Tt:Ct.sibling=Tt,Ct=Tt,Pe=jt}if(ut===te.length)return s(K,Pe),ft&&xl(K,ut),Ve;if(Pe===null){for(;ut<te.length;ut++)Pe=he(K,te[ut],fe),Pe!==null&&(G=x(Pe,G,ut),Ct===null?Ve=Pe:Ct.sibling=Pe,Ct=Pe);return ft&&xl(K,ut),Ve}for(Pe=c(Pe);ut<te.length;ut++)jt=ie(Pe,K,ut,te[ut],fe),jt!==null&&(t&&jt.alternate!==null&&Pe.delete(jt.key===null?ut:jt.key),G=x(jt,G,ut),Ct===null?Ve=jt:Ct.sibling=jt,Ct=jt);return t&&Pe.forEach(function(ia){return n(K,ia)}),ft&&xl(K,ut),Ve}function Qe(K,G,te,fe){if(te==null)throw Error(i(151));for(var Ve=null,Ct=null,Pe=G,ut=G=0,jt=null,Tt=te.next();Pe!==null&&!Tt.done;ut++,Tt=te.next()){Pe.index>ut?(jt=Pe,Pe=null):jt=Pe.sibling;var ia=re(K,Pe,Tt.value,fe);if(ia===null){Pe===null&&(Pe=jt);break}t&&Pe&&ia.alternate===null&&n(K,Pe),G=x(ia,G,ut),Ct===null?Ve=ia:Ct.sibling=ia,Ct=ia,Pe=jt}if(Tt.done)return s(K,Pe),ft&&xl(K,ut),Ve;if(Pe===null){for(;!Tt.done;ut++,Tt=te.next())Tt=he(K,Tt.value,fe),Tt!==null&&(G=x(Tt,G,ut),Ct===null?Ve=Tt:Ct.sibling=Tt,Ct=Tt);return ft&&xl(K,ut),Ve}for(Pe=c(Pe);!Tt.done;ut++,Tt=te.next())Tt=ie(Pe,K,ut,Tt.value,fe),Tt!==null&&(t&&Tt.alternate!==null&&Pe.delete(Tt.key===null?ut:Tt.key),G=x(Tt,G,ut),Ct===null?Ve=Tt:Ct.sibling=Tt,Ct=Tt);return t&&Pe.forEach(function(Aj){return n(K,Aj)}),ft&&xl(K,ut),Ve}function Dt(K,G,te,fe){if(typeof te=="object"&&te!==null&&te.type===E&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case j:e:{for(var Ve=te.key;G!==null;){if(G.key===Ve){if(Ve=te.type,Ve===E){if(G.tag===7){s(K,G.sibling),fe=m(G,te.props.children),fe.return=K,K=fe;break e}}else if(G.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===F&&Da(Ve)===G.type){s(K,G.sibling),fe=m(G,te.props),Ls(fe,te),fe.return=K,K=fe;break e}s(K,G);break}else n(K,G);G=G.sibling}te.type===E?(fe=lr(te.props.children,K.mode,fe,te.key),fe.return=K,K=fe):(fe=pl(te.type,te.key,te.props,null,K.mode,fe),Ls(fe,te),fe.return=K,K=fe)}return k(K);case C:e:{for(Ve=te.key;G!==null;){if(G.key===Ve)if(G.tag===4&&G.stateNode.containerInfo===te.containerInfo&&G.stateNode.implementation===te.implementation){s(K,G.sibling),fe=m(G,te.children||[]),fe.return=K,K=fe;break e}else{s(K,G);break}else n(K,G);G=G.sibling}fe=As(te,K.mode,fe),fe.return=K,K=fe}return k(K);case F:return te=Da(te),Dt(K,G,te,fe)}if(ee(te))return Oe(K,G,te,fe);if(Q(te)){if(Ve=Q(te),typeof Ve!="function")throw Error(i(150));return te=Ve.call(te),Qe(K,G,te,fe)}if(typeof te.then=="function")return Dt(K,G,mc(te),fe);if(te.$$typeof===H)return Dt(K,G,cc(K,te),fe);pc(K,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,G!==null&&G.tag===6?(s(K,G.sibling),fe=m(G,te),fe.return=K,K=fe):(s(K,G),fe=Ir(te,K.mode,fe),fe.return=K,K=fe),k(K)):s(K,G)}return function(K,G,te,fe){try{Os=0;var Ve=Dt(K,G,te,fe);return ji=null,Ve}catch(Pe){if(Pe===ki||Pe===dc)throw Pe;var Ct=Bn(29,Pe,null,K.mode);return Ct.lanes=fe,Ct.return=K,Ct}}}var Ba=xh(!0),gh=xh(!1),qr=!1;function Ud(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Vr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Gr(t,n,s){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(Et&2)!==0){var m=c.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),c.pending=n,n=mi(t),rc(t,null,s),n}return fi(t,c,n,s),mi(t)}function Ds(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var c=n.lanes;c&=t.pendingLanes,s|=c,n.lanes=s,ha(t,s)}}function Fd(t,n){var s=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var m=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var k={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};x===null?m=x=k:x=x.next=k,s=s.next}while(s!==null);x===null?m=x=n:x=x.next=n}else m=x=n;s={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var qd=!1;function _s(){if(qd){var t=vi;if(t!==null)throw t}}function Bs(t,n,s,c){qd=!1;var m=t.updateQueue;qr=!1;var x=m.firstBaseUpdate,k=m.lastBaseUpdate,S=m.shared.pending;if(S!==null){m.shared.pending=null;var U=S,ne=U.next;U.next=null,k===null?x=ne:k.next=ne,k=U;var de=t.alternate;de!==null&&(de=de.updateQueue,S=de.lastBaseUpdate,S!==k&&(S===null?de.firstBaseUpdate=ne:S.next=ne,de.lastBaseUpdate=U))}if(x!==null){var he=m.baseState;k=0,de=ne=U=null,S=x;do{var re=S.lane&-536870913,ie=re!==S.lane;if(ie?(kt&re)===re:(c&re)===re){re!==0&&re===yi&&(qd=!0),de!==null&&(de=de.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Oe=t,Qe=S;re=n;var Dt=s;switch(Qe.tag){case 1:if(Oe=Qe.payload,typeof Oe=="function"){he=Oe.call(Dt,he,re);break e}he=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Qe.payload,re=typeof Oe=="function"?Oe.call(Dt,he,re):Oe,re==null)break e;he=b({},he,re);break e;case 2:qr=!0}}re=S.callback,re!==null&&(t.flags|=64,ie&&(t.flags|=8192),ie=m.callbacks,ie===null?m.callbacks=[re]:ie.push(re))}else ie={lane:re,tag:S.tag,payload:S.payload,callback:S.callback,next:null},de===null?(ne=de=ie,U=he):de=de.next=ie,k|=re;if(S=S.next,S===null){if(S=m.shared.pending,S===null)break;ie=S,S=ie.next,ie.next=null,m.lastBaseUpdate=ie,m.shared.pending=null}}while(!0);de===null&&(U=he),m.baseState=U,m.firstBaseUpdate=ne,m.lastBaseUpdate=de,x===null&&(m.shared.lanes=0),Kr|=k,t.lanes=k,t.memoizedState=he}}function bh(t,n){if(typeof t!="function")throw Error(i(191,t));t.call(n)}function yh(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)bh(s[t],n)}var Ni=_(null),hc=_(0);function vh(t,n){t=hr,R(hc,t),R(Ni,n),hr=t|n.baseLanes}function Vd(){R(hc,hr),R(Ni,Ni.current)}function Gd(){hr=hc.current,le(Ni),le(hc)}var ll=_(null),gl=null;function $r(t){var n=t.alternate;R(en,en.current&1),R(ll,t),gl===null&&(n===null||Ni.current!==null||n.memoizedState!==null)&&(gl=t)}function $d(t){R(en,en.current),R(ll,t),gl===null&&(gl=t)}function kh(t){t.tag===22?(R(en,en.current),R(ll,t),gl===null&&(gl=t)):Yr()}function Yr(){R(en,en.current),R(ll,ll.current)}function rl(t){le(ll),gl===t&&(gl=null),le(en)}var en=_(0);function xc(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Jf(s)||em(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var sr=0,ct=null,Ot=null,rn=null,gc=!1,wi=!1,Ia=!1,bc=0,Is=0,Si=null,bk=0;function Kt(){throw Error(i(321))}function Yd(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!qn(t[s],n[s]))return!1;return!0}function Qd(t,n,s,c,m,x){return sr=x,ct=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,N.H=t===null||t.memoizedState===null?rx:uf,Ia=!1,x=s(c,m),Ia=!1,wi&&(x=Nh(n,s,c,m)),jh(t),x}function jh(t){N.H=Hs;var n=Ot!==null&&Ot.next!==null;if(sr=0,rn=Ot=ct=null,gc=!1,Is=0,Si=null,n)throw Error(i(300));t===null||an||(t=t.dependencies,t!==null&&oc(t)&&(an=!0))}function Nh(t,n,s,c){ct=t;var m=0;do{if(wi&&(Si=null),Is=0,wi=!1,25<=m)throw Error(i(301));if(m+=1,rn=Ot=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}N.H=ax,x=n(s,c)}while(wi);return x}function yk(){var t=N.H,n=t.useState()[0];return n=typeof n.then=="function"?Ps(n):n,t=t.useState()[0],(Ot!==null?Ot.memoizedState:null)!==t&&(ct.flags|=1024),n}function Xd(){var t=bc!==0;return bc=0,t}function Kd(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function Zd(t){if(gc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}gc=!1}sr=0,rn=Ot=ct=null,wi=!1,Is=bc=0,Si=null}function In(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?ct.memoizedState=rn=t:rn=rn.next=t,rn}function tn(){if(Ot===null){var t=ct.alternate;t=t!==null?t.memoizedState:null}else t=Ot.next;var n=rn===null?ct.memoizedState:rn.next;if(n!==null)rn=n,Ot=t;else{if(t===null)throw ct.alternate===null?Error(i(467)):Error(i(310));Ot=t,t={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},rn===null?ct.memoizedState=rn=t:rn=rn.next=t}return rn}function yc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ps(t){var n=Is;return Is+=1,Si===null&&(Si=[]),t=mh(Si,t,n),n=ct,(rn===null?n.memoizedState:rn.next)===null&&(n=n.alternate,N.H=n===null||n.memoizedState===null?rx:uf),t}function vc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ps(t);if(t.$$typeof===H)return Sn(t)}throw Error(i(438,String(t)))}function Wd(t){var n=null,s=ct.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var c=ct.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(n={data:c.data.map(function(m){return m.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=yc(),ct.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),c=0;c<t;c++)s[c]=O;return n.index++,s}function or(t,n){return typeof n=="function"?n(t):n}function kc(t){var n=tn();return Jd(n,Ot,t)}function Jd(t,n,s){var c=t.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=s;var m=t.baseQueue,x=c.pending;if(x!==null){if(m!==null){var k=m.next;m.next=x.next,x.next=k}n.baseQueue=m=x,c.pending=null}if(x=t.baseState,m===null)t.memoizedState=x;else{n=m.next;var S=k=null,U=null,ne=n,de=!1;do{var he=ne.lane&-536870913;if(he!==ne.lane?(kt&he)===he:(sr&he)===he){var re=ne.revertLane;if(re===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),he===yi&&(de=!0);else if((sr&re)===re){ne=ne.next,re===yi&&(de=!0);continue}else he={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},U===null?(S=U=he,k=x):U=U.next=he,ct.lanes|=re,Kr|=re;he=ne.action,Ia&&s(x,he),x=ne.hasEagerState?ne.eagerState:s(x,he)}else re={lane:he,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},U===null?(S=U=re,k=x):U=U.next=re,ct.lanes|=he,Kr|=he;ne=ne.next}while(ne!==null&&ne!==n);if(U===null?k=x:U.next=S,!qn(x,t.memoizedState)&&(an=!0,de&&(s=vi,s!==null)))throw s;t.memoizedState=x,t.baseState=k,t.baseQueue=U,c.lastRenderedState=x}return m===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function ef(t){var n=tn(),s=n.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=t;var c=s.dispatch,m=s.pending,x=n.memoizedState;if(m!==null){s.pending=null;var k=m=m.next;do x=t(x,k.action),k=k.next;while(k!==m);qn(x,n.memoizedState)||(an=!0),n.memoizedState=x,n.baseQueue===null&&(n.baseState=x),s.lastRenderedState=x}return[x,c]}function wh(t,n,s){var c=ct,m=tn(),x=ft;if(x){if(s===void 0)throw Error(i(407));s=s()}else s=n();var k=!qn((Ot||m).memoizedState,s);if(k&&(m.memoizedState=s,an=!0),m=m.queue,lf(Th.bind(null,c,m,t),[t]),m.getSnapshot!==n||k||rn!==null&&rn.memoizedState.tag&1){if(c.flags|=2048,Ci(9,{destroy:void 0},Ch.bind(null,c,m,s,n),null),Bt===null)throw Error(i(349));x||(sr&127)!==0||Sh(c,n,s)}return s}function Sh(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=ct.updateQueue,n===null?(n=yc(),ct.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function Ch(t,n,s,c){n.value=s,n.getSnapshot=c,Ah(n)&&Eh(t)}function Th(t,n,s){return s(function(){Ah(n)&&Eh(t)})}function Ah(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!qn(t,s)}catch{return!0}}function Eh(t){var n=nr(t,2);n!==null&&Xn(n,t,2)}function tf(t){var n=In();if(typeof t=="function"){var s=t;if(t=s(),Ia){me(!0);try{s()}finally{me(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:t},n}function Rh(t,n,s,c){return t.baseState=s,Jd(t,Ot,typeof c=="function"?c:or)}function vk(t,n,s,c,m){if(wc(t))throw Error(i(485));if(t=n.action,t!==null){var x={payload:m,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){x.listeners.push(k)}};N.T!==null?s(!0):x.isTransition=!1,c(x),s=n.pending,s===null?(x.next=n.pending=x,Mh(n,x)):(x.next=s.next,n.pending=s.next=x)}}function Mh(t,n){var s=n.action,c=n.payload,m=t.state;if(n.isTransition){var x=N.T,k={};N.T=k;try{var S=s(m,c),U=N.S;U!==null&&U(k,S),zh(t,n,S)}catch(ne){nf(t,n,ne)}finally{x!==null&&k.types!==null&&(x.types=k.types),N.T=x}}else try{x=s(m,c),zh(t,n,x)}catch(ne){nf(t,n,ne)}}function zh(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Oh(t,n,c)},function(c){return nf(t,n,c)}):Oh(t,n,s)}function Oh(t,n,s){n.status="fulfilled",n.value=s,Lh(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,Mh(t,s)))}function nf(t,n,s){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do n.status="rejected",n.reason=s,Lh(n),n=n.next;while(n!==c)}t.action=null}function Lh(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Dh(t,n){return n}function _h(t,n){if(ft){var s=Bt.formState;if(s!==null){e:{var c=ct;if(ft){if(_t){t:{for(var m=_t,x=W;m.nodeType!==8;){if(!x){m=null;break t}if(m=bl(m.nextSibling),m===null){m=null;break t}}x=m.data,m=x==="F!"||x==="F"?m:null}if(m){_t=bl(m.nextSibling),c=m.data==="F!";break e}}At(c)}c=!1}c&&(n=s[0])}}return s=In(),s.memoizedState=s.baseState=n,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dh,lastRenderedState:n},s.queue=c,s=tx.bind(null,ct,c),c.dispatch=s,c=tf(!1),x=cf.bind(null,ct,!1,c.queue),c=In(),m={state:n,dispatch:null,action:t,pending:null},c.queue=m,s=vk.bind(null,ct,m,x,s),m.dispatch=s,c.memoizedState=t,[n,s,!1]}function Bh(t){var n=tn();return Ih(n,Ot,t)}function Ih(t,n,s){if(n=Jd(t,n,Dh)[0],t=kc(or)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var c=Ps(n)}catch(k){throw k===ki?dc:k}else c=n;n=tn();var m=n.queue,x=m.dispatch;return s!==n.memoizedState&&(ct.flags|=2048,Ci(9,{destroy:void 0},kk.bind(null,m,s),null)),[c,x,t]}function kk(t,n){t.action=n}function Ph(t){var n=tn(),s=Ot;if(s!==null)return Ih(n,s,t);tn(),n=n.memoizedState,s=tn();var c=s.queue.dispatch;return s.memoizedState=t,[n,c,!1]}function Ci(t,n,s,c){return t={tag:t,create:s,deps:c,inst:n,next:null},n=ct.updateQueue,n===null&&(n=yc(),ct.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(c=s.next,s.next=t,t.next=c,n.lastEffect=t),t}function Uh(){return tn().memoizedState}function jc(t,n,s,c){var m=In();ct.flags|=t,m.memoizedState=Ci(1|n,{destroy:void 0},s,c===void 0?null:c)}function Nc(t,n,s,c){var m=tn();c=c===void 0?null:c;var x=m.memoizedState.inst;Ot!==null&&c!==null&&Yd(c,Ot.memoizedState.deps)?m.memoizedState=Ci(n,x,s,c):(ct.flags|=t,m.memoizedState=Ci(1|n,x,s,c))}function Hh(t,n){jc(8390656,8,t,n)}function lf(t,n){Nc(2048,8,t,n)}function jk(t){ct.flags|=4;var n=ct.updateQueue;if(n===null)n=yc(),ct.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function Fh(t){var n=tn().memoizedState;return jk({ref:n,nextImpl:t}),function(){if((Et&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function qh(t,n){return Nc(4,2,t,n)}function Vh(t,n){return Nc(4,4,t,n)}function Gh(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function $h(t,n,s){s=s!=null?s.concat([t]):null,Nc(4,4,Gh.bind(null,n,t),s)}function rf(){}function Yh(t,n){var s=tn();n=n===void 0?null:n;var c=s.memoizedState;return n!==null&&Yd(n,c[1])?c[0]:(s.memoizedState=[t,n],t)}function Qh(t,n){var s=tn();n=n===void 0?null:n;var c=s.memoizedState;if(n!==null&&Yd(n,c[1]))return c[0];if(c=t(),Ia){me(!0);try{t()}finally{me(!1)}}return s.memoizedState=[c,n],c}function af(t,n,s){return s===void 0||(sr&1073741824)!==0&&(kt&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=Xx(),ct.lanes|=t,Kr|=t,s)}function Xh(t,n,s,c){return qn(s,n)?s:Ni.current!==null?(t=af(t,s,c),qn(t,n)||(an=!0),t):(sr&42)===0||(sr&1073741824)!==0&&(kt&261930)===0?(an=!0,t.memoizedState=s):(t=Xx(),ct.lanes|=t,Kr|=t,n)}function Kh(t,n,s,c,m){var x=Y.p;Y.p=x!==0&&8>x?x:8;var k=N.T,S={};N.T=S,cf(t,!1,n,s);try{var U=m(),ne=N.S;if(ne!==null&&ne(S,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var de=gk(U,c);Us(t,n,de,sl(t))}else Us(t,n,c,sl(t))}catch(he){Us(t,n,{then:function(){},status:"rejected",reason:he},sl())}finally{Y.p=x,k!==null&&S.types!==null&&(k.types=S.types),N.T=k}}function Nk(){}function sf(t,n,s,c){if(t.tag!==5)throw Error(i(476));var m=Zh(t).queue;Kh(t,m,n,$,s===null?Nk:function(){return Wh(t),s(c)})}function Zh(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:$},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Wh(t){var n=Zh(t);n.next===null&&(n=t.alternate.memoizedState),Us(t,n.next.queue,{},sl())}function of(){return Sn(lo)}function Jh(){return tn().memoizedState}function ex(){return tn().memoizedState}function wk(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=sl();t=Vr(s);var c=Gr(n,t,s);c!==null&&(Xn(c,n,s),Ds(c,n,s)),n={cache:_d()},t.payload=n;return}n=n.return}}function Sk(t,n,s){var c=sl();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},wc(t)?nx(n,s):(s=ml(t,n,s,c),s!==null&&(Xn(s,t,c),lx(s,n,c)))}function tx(t,n,s){var c=sl();Us(t,n,s,c)}function Us(t,n,s,c){var m={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(wc(t))nx(n,m);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=n.lastRenderedReducer,x!==null))try{var k=n.lastRenderedState,S=x(k,s);if(m.hasEagerState=!0,m.eagerState=S,qn(S,k))return fi(t,n,m,0),Bt===null&&di(),!1}catch{}if(s=ml(t,n,m,c),s!==null)return Xn(s,t,c),lx(s,n,c),!0}return!1}function cf(t,n,s,c){if(c={lane:2,revertLane:Hf(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},wc(t)){if(n)throw Error(i(479))}else n=ml(t,s,c,2),n!==null&&Xn(n,t,2)}function wc(t){var n=t.alternate;return t===ct||n!==null&&n===ct}function nx(t,n){wi=gc=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function lx(t,n,s){if((s&4194048)!==0){var c=n.lanes;c&=t.pendingLanes,s|=c,n.lanes=s,ha(t,s)}}var Hs={readContext:Sn,use:vc,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};Hs.useEffectEvent=Kt;var rx={readContext:Sn,use:vc,useCallback:function(t,n){return In().memoizedState=[t,n===void 0?null:n],t},useContext:Sn,useEffect:Hh,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,jc(4194308,4,Gh.bind(null,n,t),s)},useLayoutEffect:function(t,n){return jc(4194308,4,t,n)},useInsertionEffect:function(t,n){jc(4,2,t,n)},useMemo:function(t,n){var s=In();n=n===void 0?null:n;var c=t();if(Ia){me(!0);try{t()}finally{me(!1)}}return s.memoizedState=[c,n],c},useReducer:function(t,n,s){var c=In();if(s!==void 0){var m=s(n);if(Ia){me(!0);try{s(n)}finally{me(!1)}}}else m=n;return c.memoizedState=c.baseState=m,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:m},c.queue=t,t=t.dispatch=Sk.bind(null,ct,t),[c.memoizedState,t]},useRef:function(t){var n=In();return t={current:t},n.memoizedState=t},useState:function(t){t=tf(t);var n=t.queue,s=tx.bind(null,ct,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:rf,useDeferredValue:function(t,n){var s=In();return af(s,t,n)},useTransition:function(){var t=tf(!1);return t=Kh.bind(null,ct,t.queue,!0,!1),In().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var c=ct,m=In();if(ft){if(s===void 0)throw Error(i(407));s=s()}else{if(s=n(),Bt===null)throw Error(i(349));(kt&127)!==0||Sh(c,n,s)}m.memoizedState=s;var x={value:s,getSnapshot:n};return m.queue=x,Hh(Th.bind(null,c,x,t),[t]),c.flags|=2048,Ci(9,{destroy:void 0},Ch.bind(null,c,x,s,n),null),s},useId:function(){var t=In(),n=Bt.identifierPrefix;if(ft){var s=nl,c=hl;s=(c&~(1<<32-je(c)-1)).toString(32)+s,n="_"+n+"R_"+s,s=bc++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=bk++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:of,useFormState:_h,useActionState:_h,useOptimistic:function(t){var n=In();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=cf.bind(null,ct,!0,s),s.dispatch=n,[t,n]},useMemoCache:Wd,useCacheRefresh:function(){return In().memoizedState=wk.bind(null,ct)},useEffectEvent:function(t){var n=In(),s={impl:t};return n.memoizedState=s,function(){if((Et&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}},uf={readContext:Sn,use:vc,useCallback:Yh,useContext:Sn,useEffect:lf,useImperativeHandle:$h,useInsertionEffect:qh,useLayoutEffect:Vh,useMemo:Qh,useReducer:kc,useRef:Uh,useState:function(){return kc(or)},useDebugValue:rf,useDeferredValue:function(t,n){var s=tn();return Xh(s,Ot.memoizedState,t,n)},useTransition:function(){var t=kc(or)[0],n=tn().memoizedState;return[typeof t=="boolean"?t:Ps(t),n]},useSyncExternalStore:wh,useId:Jh,useHostTransitionStatus:of,useFormState:Bh,useActionState:Bh,useOptimistic:function(t,n){var s=tn();return Rh(s,Ot,t,n)},useMemoCache:Wd,useCacheRefresh:ex};uf.useEffectEvent=Fh;var ax={readContext:Sn,use:vc,useCallback:Yh,useContext:Sn,useEffect:lf,useImperativeHandle:$h,useInsertionEffect:qh,useLayoutEffect:Vh,useMemo:Qh,useReducer:ef,useRef:Uh,useState:function(){return ef(or)},useDebugValue:rf,useDeferredValue:function(t,n){var s=tn();return Ot===null?af(s,t,n):Xh(s,Ot.memoizedState,t,n)},useTransition:function(){var t=ef(or)[0],n=tn().memoizedState;return[typeof t=="boolean"?t:Ps(t),n]},useSyncExternalStore:wh,useId:Jh,useHostTransitionStatus:of,useFormState:Ph,useActionState:Ph,useOptimistic:function(t,n){var s=tn();return Ot!==null?Rh(s,Ot,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:Wd,useCacheRefresh:ex};ax.useEffectEvent=Fh;function df(t,n,s,c){n=t.memoizedState,s=s(c,n),s=s==null?n:b({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var ff={enqueueSetState:function(t,n,s){t=t._reactInternals;var c=sl(),m=Vr(c);m.payload=n,s!=null&&(m.callback=s),n=Gr(t,m,c),n!==null&&(Xn(n,t,c),Ds(n,t,c))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var c=sl(),m=Vr(c);m.tag=1,m.payload=n,s!=null&&(m.callback=s),n=Gr(t,m,c),n!==null&&(Xn(n,t,c),Ds(n,t,c))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=sl(),c=Vr(s);c.tag=2,n!=null&&(c.callback=n),n=Gr(t,c,s),n!==null&&(Xn(n,t,s),Ds(n,t,s))}};function ix(t,n,s,c,m,x,k){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,x,k):n.prototype&&n.prototype.isPureReactComponent?!Ta(s,c)||!Ta(m,x):!0}function sx(t,n,s,c){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,c),n.state!==t&&ff.enqueueReplaceState(n,n.state,null)}function Pa(t,n){var s=n;if("ref"in n){s={};for(var c in n)c!=="ref"&&(s[c]=n[c])}if(t=t.defaultProps){s===n&&(s=b({},s));for(var m in t)s[m]===void 0&&(s[m]=t[m])}return s}function ox(t){Ra(t)}function cx(t){console.error(t)}function ux(t){Ra(t)}function Sc(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(c){setTimeout(function(){throw c})}}function dx(t,n,s){try{var c=t.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function mf(t,n,s){return s=Vr(s),s.tag=3,s.payload={element:null},s.callback=function(){Sc(t,n)},s}function fx(t){return t=Vr(t),t.tag=3,t}function mx(t,n,s,c){var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var x=c.value;t.payload=function(){return m(x)},t.callback=function(){dx(n,s,c)}}var k=s.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(t.callback=function(){dx(n,s,c),typeof m!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var S=c.stack;this.componentDidCatch(c.value,{componentStack:S!==null?S:""})})}function Ck(t,n,s,c,m){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(n=s.alternate,n!==null&&bi(n,s,m,!0),s=ll.current,s!==null){switch(s.tag){case 31:case 13:return gl===null?Bc():s.alternate===null&&Zt===0&&(Zt=3),s.flags&=-257,s.flags|=65536,s.lanes=m,c===fc?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([c]):n.add(c),If(t,c,m)),!1;case 22:return s.flags|=65536,c===fc?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([c]):s.add(c)),If(t,c,m)),!1}throw Error(i(435,s.tag))}return If(t,c,m),Bc(),!1}if(ft)return n=ll.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=m,c!==be&&(t=Error(i(422),{cause:c}),Rs(Nn(t,s)))):(c!==be&&(n=Error(i(423),{cause:c}),Rs(Nn(n,s))),t=t.current.alternate,t.flags|=65536,m&=-m,t.lanes|=m,c=Nn(c,s),m=mf(t.stateNode,c,m),Fd(t,m),Zt!==4&&(Zt=2)),!1;var x=Error(i(520),{cause:c});if(x=Nn(x,s),Xs===null?Xs=[x]:Xs.push(x),Zt!==4&&(Zt=2),n===null)return!0;c=Nn(c,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=m&-m,s.lanes|=t,t=mf(s.stateNode,c,t),Fd(s,t),!1;case 1:if(n=s.type,x=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Zr===null||!Zr.has(x))))return s.flags|=65536,m&=-m,s.lanes|=m,m=fx(m),mx(m,t,s,c),Fd(s,m),!1}s=s.return}while(s!==null);return!1}var pf=Error(i(461)),an=!1;function Cn(t,n,s,c){n.child=t===null?gh(n,null,s,c):Ba(n,t.child,s,c)}function px(t,n,s,c,m){s=s.render;var x=n.ref;if("ref"in c){var k={};for(var S in c)S!=="ref"&&(k[S]=c[S])}else k=c;return Oa(n),c=Qd(t,n,s,k,x,m),S=Xd(),t!==null&&!an?(Kd(t,n,m),cr(t,n,m)):(ft&&S&&hi(n),n.flags|=1,Cn(t,n,c,m),n.child)}function hx(t,n,s,c,m){if(t===null){var x=s.type;return typeof x=="function"&&!Cs(x)&&x.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=x,xx(t,n,x,c,m)):(t=pl(s.type,null,c,n,n.mode,m),t.ref=n.ref,t.return=n,n.child=t)}if(x=t.child,!jf(t,m)){var k=x.memoizedProps;if(s=s.compare,s=s!==null?s:Ta,s(k,c)&&t.ref===n.ref)return cr(t,n,m)}return n.flags|=1,t=Jt(x,c),t.ref=n.ref,t.return=n,n.child=t}function xx(t,n,s,c,m){if(t!==null){var x=t.memoizedProps;if(Ta(x,c)&&t.ref===n.ref)if(an=!1,n.pendingProps=c=x,jf(t,m))(t.flags&131072)!==0&&(an=!0);else return n.lanes=t.lanes,cr(t,n,m)}return hf(t,n,s,c,m)}function gx(t,n,s,c){var m=c.children,x=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((n.flags&128)!==0){if(x=x!==null?x.baseLanes|s:s,t!==null){for(c=n.child=t.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~x}else c=0,n.child=null;return bx(t,n,x,s,c)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&uc(n,x!==null?x.cachePool:null),x!==null?vh(n,x):Vd(),kh(n);else return c=n.lanes=536870912,bx(t,n,x!==null?x.baseLanes|s:s,s,c)}else x!==null?(uc(n,x.cachePool),vh(n,x),Yr(),n.memoizedState=null):(t!==null&&uc(n,null),Vd(),Yr());return Cn(t,n,m,s),n.child}function Fs(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function bx(t,n,s,c,m){var x=Id();return x=x===null?null:{parent:ln._currentValue,pool:x},n.memoizedState={baseLanes:s,cachePool:x},t!==null&&uc(n,null),Vd(),kh(n),t!==null&&bi(t,n,c,!0),n.childLanes=m,null}function Cc(t,n){return n=Ac({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function yx(t,n,s){return Ba(n,t.child,null,s),t=Cc(n,n.pendingProps),t.flags|=2,rl(n),n.memoizedState=null,t}function Tk(t,n,s){var c=n.pendingProps,m=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(ft){if(c.mode==="hidden")return t=Cc(n,c),n.lanes=536870912,Fs(null,t);if($d(n),(t=_t)?(t=Mg(t,W),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Sl!==null?{id:hl,overflow:nl}:null,retryLane:536870912,hydrationErrors:null},s=ac(t),s.return=n,n.child=s,nn=n,_t=null)):t=null,t===null)throw At(n);return n.lanes=536870912,null}return Cc(n,c)}var x=t.memoizedState;if(x!==null){var k=x.dehydrated;if($d(n),m)if(n.flags&256)n.flags&=-257,n=yx(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(i(558));else if(an||bi(t,n,s,!1),m=(s&t.childLanes)!==0,an||m){if(c=Bt,c!==null&&(k=Gl(c,s),k!==0&&k!==x.retryLane))throw x.retryLane=k,nr(t,k),Xn(c,t,k),pf;Bc(),n=yx(t,n,s)}else t=x.treeContext,_t=bl(k.nextSibling),nn=n,ft=!0,I=null,W=!1,t!==null&&vt(n,t),n=Cc(n,c),n.flags|=4096;return n}return t=Jt(t.child,{mode:c.mode,children:c.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Tc(t,n){var s=n.ref;if(s===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(i(284));(t===null||t.ref!==s)&&(n.flags|=4194816)}}function hf(t,n,s,c,m){return Oa(n),s=Qd(t,n,s,c,void 0,m),c=Xd(),t!==null&&!an?(Kd(t,n,m),cr(t,n,m)):(ft&&c&&hi(n),n.flags|=1,Cn(t,n,s,m),n.child)}function vx(t,n,s,c,m,x){return Oa(n),n.updateQueue=null,s=Nh(n,c,s,m),jh(t),c=Xd(),t!==null&&!an?(Kd(t,n,x),cr(t,n,x)):(ft&&c&&hi(n),n.flags|=1,Cn(t,n,s,x),n.child)}function kx(t,n,s,c,m){if(Oa(n),n.stateNode===null){var x=Br,k=s.contextType;typeof k=="object"&&k!==null&&(x=Sn(k)),x=new s(c,x),n.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=ff,n.stateNode=x,x._reactInternals=n,x=n.stateNode,x.props=c,x.state=n.memoizedState,x.refs={},Ud(n),k=s.contextType,x.context=typeof k=="object"&&k!==null?Sn(k):Br,x.state=n.memoizedState,k=s.getDerivedStateFromProps,typeof k=="function"&&(df(n,s,k,c),x.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(k=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),k!==x.state&&ff.enqueueReplaceState(x,x.state,null),Bs(n,c,x,m),_s(),x.state=n.memoizedState),typeof x.componentDidMount=="function"&&(n.flags|=4194308),c=!0}else if(t===null){x=n.stateNode;var S=n.memoizedProps,U=Pa(s,S);x.props=U;var ne=x.context,de=s.contextType;k=Br,typeof de=="object"&&de!==null&&(k=Sn(de));var he=s.getDerivedStateFromProps;de=typeof he=="function"||typeof x.getSnapshotBeforeUpdate=="function",S=n.pendingProps!==S,de||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(S||ne!==k)&&sx(n,x,c,k),qr=!1;var re=n.memoizedState;x.state=re,Bs(n,c,x,m),_s(),ne=n.memoizedState,S||re!==ne||qr?(typeof he=="function"&&(df(n,s,he,c),ne=n.memoizedState),(U=qr||ix(n,s,U,c,re,ne,k))?(de||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(n.flags|=4194308)):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=ne),x.props=c,x.state=ne,x.context=k,c=U):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{x=n.stateNode,Hd(t,n),k=n.memoizedProps,de=Pa(s,k),x.props=de,he=n.pendingProps,re=x.context,ne=s.contextType,U=Br,typeof ne=="object"&&ne!==null&&(U=Sn(ne)),S=s.getDerivedStateFromProps,(ne=typeof S=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k!==he||re!==U)&&sx(n,x,c,U),qr=!1,re=n.memoizedState,x.state=re,Bs(n,c,x,m),_s();var ie=n.memoizedState;k!==he||re!==ie||qr||t!==null&&t.dependencies!==null&&oc(t.dependencies)?(typeof S=="function"&&(df(n,s,S,c),ie=n.memoizedState),(de=qr||ix(n,s,de,c,re,ie,U)||t!==null&&t.dependencies!==null&&oc(t.dependencies))?(ne||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,ie,U),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,ie,U)),typeof x.componentDidUpdate=="function"&&(n.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof x.componentDidUpdate!="function"||k===t.memoizedProps&&re===t.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===t.memoizedProps&&re===t.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=ie),x.props=c,x.state=ie,x.context=U,c=de):(typeof x.componentDidUpdate!="function"||k===t.memoizedProps&&re===t.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===t.memoizedProps&&re===t.memoizedState||(n.flags|=1024),c=!1)}return x=c,Tc(t,n),c=(n.flags&128)!==0,x||c?(x=n.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:x.render(),n.flags|=1,t!==null&&c?(n.child=Ba(n,t.child,null,m),n.child=Ba(n,null,s,m)):Cn(t,n,s,m),n.memoizedState=x.state,t=n.child):t=cr(t,n,m),t}function jx(t,n,s,c){return Ma(),n.flags|=256,Cn(t,n,s,c),n.child}var xf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gf(t){return{baseLanes:t,cachePool:dh()}}function bf(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=il),t}function Nx(t,n,s){var c=n.pendingProps,m=!1,x=(n.flags&128)!==0,k;if((k=x)||(k=t!==null&&t.memoizedState===null?!1:(en.current&2)!==0),k&&(m=!0,n.flags&=-129),k=(n.flags&32)!==0,n.flags&=-33,t===null){if(ft){if(m?$r(n):Yr(),(t=_t)?(t=Mg(t,W),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Sl!==null?{id:hl,overflow:nl}:null,retryLane:536870912,hydrationErrors:null},s=ac(t),s.return=n,n.child=s,nn=n,_t=null)):t=null,t===null)throw At(n);return em(t)?n.lanes=32:n.lanes=536870912,null}var S=c.children;return c=c.fallback,m?(Yr(),m=n.mode,S=Ac({mode:"hidden",children:S},m),c=lr(c,m,s,null),S.return=n,c.return=n,S.sibling=c,n.child=S,c=n.child,c.memoizedState=gf(s),c.childLanes=bf(t,k,s),n.memoizedState=xf,Fs(null,c)):($r(n),yf(n,S))}var U=t.memoizedState;if(U!==null&&(S=U.dehydrated,S!==null)){if(x)n.flags&256?($r(n),n.flags&=-257,n=vf(t,n,s)):n.memoizedState!==null?(Yr(),n.child=t.child,n.flags|=128,n=null):(Yr(),S=c.fallback,m=n.mode,c=Ac({mode:"visible",children:c.children},m),S=lr(S,m,s,null),S.flags|=2,c.return=n,S.return=n,c.sibling=S,n.child=c,Ba(n,t.child,null,s),c=n.child,c.memoizedState=gf(s),c.childLanes=bf(t,k,s),n.memoizedState=xf,n=Fs(null,c));else if($r(n),em(S)){if(k=S.nextSibling&&S.nextSibling.dataset,k)var ne=k.dgst;k=ne,c=Error(i(419)),c.stack="",c.digest=k,Rs({value:c,source:null,stack:null}),n=vf(t,n,s)}else if(an||bi(t,n,s,!1),k=(s&t.childLanes)!==0,an||k){if(k=Bt,k!==null&&(c=Gl(k,s),c!==0&&c!==U.retryLane))throw U.retryLane=c,nr(t,c),Xn(k,t,c),pf;Jf(S)||Bc(),n=vf(t,n,s)}else Jf(S)?(n.flags|=192,n.child=t.child,n=null):(t=U.treeContext,_t=bl(S.nextSibling),nn=n,ft=!0,I=null,W=!1,t!==null&&vt(n,t),n=yf(n,c.children),n.flags|=4096);return n}return m?(Yr(),S=c.fallback,m=n.mode,U=t.child,ne=U.sibling,c=Jt(U,{mode:"hidden",children:c.children}),c.subtreeFlags=U.subtreeFlags&65011712,ne!==null?S=Jt(ne,S):(S=lr(S,m,s,null),S.flags|=2),S.return=n,c.return=n,c.sibling=S,n.child=c,Fs(null,c),c=n.child,S=t.child.memoizedState,S===null?S=gf(s):(m=S.cachePool,m!==null?(U=ln._currentValue,m=m.parent!==U?{parent:U,pool:U}:m):m=dh(),S={baseLanes:S.baseLanes|s,cachePool:m}),c.memoizedState=S,c.childLanes=bf(t,k,s),n.memoizedState=xf,Fs(t.child,c)):($r(n),s=t.child,t=s.sibling,s=Jt(s,{mode:"visible",children:c.children}),s.return=n,s.sibling=null,t!==null&&(k=n.deletions,k===null?(n.deletions=[t],n.flags|=16):k.push(t)),n.child=s,n.memoizedState=null,s)}function yf(t,n){return n=Ac({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Ac(t,n){return t=Bn(22,t,null,n),t.lanes=0,t}function vf(t,n,s){return Ba(n,t.child,null,s),t=yf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function wx(t,n,s){t.lanes|=n;var c=t.alternate;c!==null&&(c.lanes|=n),Ld(t.return,n,s)}function kf(t,n,s,c,m,x){var k=t.memoizedState;k===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:m,treeForkCount:x}:(k.isBackwards=n,k.rendering=null,k.renderingStartTime=0,k.last=c,k.tail=s,k.tailMode=m,k.treeForkCount=x)}function Sx(t,n,s){var c=n.pendingProps,m=c.revealOrder,x=c.tail;c=c.children;var k=en.current,S=(k&2)!==0;if(S?(k=k&1|2,n.flags|=128):k&=1,R(en,k),Cn(t,n,c,s),c=ft?Hr:0,!S&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&wx(t,s,n);else if(t.tag===19)wx(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(m){case"forwards":for(s=n.child,m=null;s!==null;)t=s.alternate,t!==null&&xc(t)===null&&(m=s),s=s.sibling;s=m,s===null?(m=n.child,n.child=null):(m=s.sibling,s.sibling=null),kf(n,!1,m,s,x,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,m=n.child,n.child=null;m!==null;){if(t=m.alternate,t!==null&&xc(t)===null){n.child=m;break}t=m.sibling,m.sibling=s,s=m,m=t}kf(n,!0,s,null,x,c);break;case"together":kf(n,!1,null,null,void 0,c);break;default:n.memoizedState=null}return n.child}function cr(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),Kr|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(bi(t,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(i(153));if(n.child!==null){for(t=n.child,s=Jt(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=Jt(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function jf(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&oc(t)))}function Ak(t,n,s){switch(n.tag){case 3:Te(n,n.stateNode.containerInfo),Fr(n,ln,t.memoizedState.cache),Ma();break;case 27:case 5:He(n);break;case 4:Te(n,n.stateNode.containerInfo);break;case 10:Fr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,$d(n),null;break;case 13:var c=n.memoizedState;if(c!==null)return c.dehydrated!==null?($r(n),n.flags|=128,null):(s&n.child.childLanes)!==0?Nx(t,n,s):($r(n),t=cr(t,n,s),t!==null?t.sibling:null);$r(n);break;case 19:var m=(t.flags&128)!==0;if(c=(s&n.childLanes)!==0,c||(bi(t,n,s,!1),c=(s&n.childLanes)!==0),m){if(c)return Sx(t,n,s);n.flags|=128}if(m=n.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),R(en,en.current),c)break;return null;case 22:return n.lanes=0,gx(t,n,s,n.pendingProps);case 24:Fr(n,ln,t.memoizedState.cache)}return cr(t,n,s)}function Cx(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)an=!0;else{if(!jf(t,s)&&(n.flags&128)===0)return an=!1,Ak(t,n,s);an=(t.flags&131072)!==0}else an=!1,ft&&(n.flags&1048576)!==0&&ic(n,Hr,n.index);switch(n.lanes=0,n.tag){case 16:e:{var c=n.pendingProps;if(t=Da(n.elementType),n.type=t,typeof t=="function")Cs(t)?(c=Pa(t,c),n.tag=1,n=kx(null,n,t,c,s)):(n.tag=0,n=hf(null,n,t,c,s));else{if(t!=null){var m=t.$$typeof;if(m===X){n.tag=11,n=px(null,n,t,c,s);break e}else if(m===B){n.tag=14,n=hx(null,n,t,c,s);break e}}throw n=J(t)||t,Error(i(306,n,""))}}return n;case 0:return hf(t,n,n.type,n.pendingProps,s);case 1:return c=n.type,m=Pa(c,n.pendingProps),kx(t,n,c,m,s);case 3:e:{if(Te(n,n.stateNode.containerInfo),t===null)throw Error(i(387));c=n.pendingProps;var x=n.memoizedState;m=x.element,Hd(t,n),Bs(n,c,null,s);var k=n.memoizedState;if(c=k.cache,Fr(n,ln,c),c!==x.cache&&Dd(n,[ln],s,!0),_s(),c=k.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:k.cache},n.updateQueue.baseState=x,n.memoizedState=x,n.flags&256){n=jx(t,n,c,s);break e}else if(c!==m){m=Nn(Error(i(424)),n),Rs(m),n=jx(t,n,c,s);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,_t=bl(t.firstChild),nn=n,ft=!0,I=null,W=!0,s=gh(n,null,c,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ma(),c===m){n=cr(t,n,s);break e}Cn(t,n,c,s)}n=n.child}return n;case 26:return Tc(t,n),t===null?(s=Bg(n.type,null,n.pendingProps,null))?n.memoizedState=s:ft||(s=n.type,t=n.pendingProps,c=Vc(ce.current).createElement(s),c[$t]=n,c[dn]=t,Tn(c,s,t),Ft(c),n.stateNode=c):n.memoizedState=Bg(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return He(n),t===null&&ft&&(c=n.stateNode=Lg(n.type,n.pendingProps,ce.current),nn=n,W=!0,m=_t,ta(n.type)?(tm=m,_t=bl(c.firstChild)):_t=m),Cn(t,n,n.pendingProps.children,s),Tc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&ft&&((m=c=_t)&&(c=rj(c,n.type,n.pendingProps,W),c!==null?(n.stateNode=c,nn=n,_t=bl(c.firstChild),W=!1,m=!0):m=!1),m||At(n)),He(n),m=n.type,x=n.pendingProps,k=t!==null?t.memoizedProps:null,c=x.children,Kf(m,x)?c=null:k!==null&&Kf(m,k)&&(n.flags|=32),n.memoizedState!==null&&(m=Qd(t,n,yk,null,null,s),lo._currentValue=m),Tc(t,n),Cn(t,n,c,s),n.child;case 6:return t===null&&ft&&((t=s=_t)&&(s=aj(s,n.pendingProps,W),s!==null?(n.stateNode=s,nn=n,_t=null,t=!0):t=!1),t||At(n)),null;case 13:return Nx(t,n,s);case 4:return Te(n,n.stateNode.containerInfo),c=n.pendingProps,t===null?n.child=Ba(n,null,c,s):Cn(t,n,c,s),n.child;case 11:return px(t,n,n.type,n.pendingProps,s);case 7:return Cn(t,n,n.pendingProps,s),n.child;case 8:return Cn(t,n,n.pendingProps.children,s),n.child;case 12:return Cn(t,n,n.pendingProps.children,s),n.child;case 10:return c=n.pendingProps,Fr(n,n.type,c.value),Cn(t,n,c.children,s),n.child;case 9:return m=n.type._context,c=n.pendingProps.children,Oa(n),m=Sn(m),c=c(m),n.flags|=1,Cn(t,n,c,s),n.child;case 14:return hx(t,n,n.type,n.pendingProps,s);case 15:return xx(t,n,n.type,n.pendingProps,s);case 19:return Sx(t,n,s);case 31:return Tk(t,n,s);case 22:return gx(t,n,s,n.pendingProps);case 24:return Oa(n),c=Sn(ln),t===null?(m=Id(),m===null&&(m=Bt,x=_d(),m.pooledCache=x,x.refCount++,x!==null&&(m.pooledCacheLanes|=s),m=x),n.memoizedState={parent:c,cache:m},Ud(n),Fr(n,ln,m)):((t.lanes&s)!==0&&(Hd(t,n),Bs(n,null,null,s),_s()),m=t.memoizedState,x=n.memoizedState,m.parent!==c?(m={parent:c,cache:c},n.memoizedState=m,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=m),Fr(n,ln,c)):(c=x.cache,Fr(n,ln,c),c!==m.cache&&Dd(n,[ln],s,!0))),Cn(t,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function ur(t){t.flags|=4}function Nf(t,n,s,c,m){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(m&335544128)===m)if(t.stateNode.complete)t.flags|=8192;else if(Jx())t.flags|=8192;else throw _a=fc,Pd}else t.flags&=-16777217}function Tx(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Fg(n))if(Jx())t.flags|=8192;else throw _a=fc,Pd}function Ec(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Me():536870912,t.lanes|=n,Ri|=n)}function qs(t,n){if(!ft)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function qt(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,c=0;if(n)for(var m=t.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=t,m=m.sibling;else for(m=t.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=t,m=m.sibling;return t.subtreeFlags|=c,t.childLanes=s,n}function Ek(t,n,s){var c=n.pendingProps;switch(Es(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(n),null;case 1:return qt(n),null;case 3:return s=n.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),n.memoizedState.cache!==c&&(n.flags|=2048),ir(ln),Ne(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(gi(n)?ur(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,zd())),qt(n),null;case 26:var m=n.type,x=n.memoizedState;return t===null?(ur(n),x!==null?(qt(n),Tx(n,x)):(qt(n),Nf(n,m,null,c,s))):x?x!==t.memoizedState?(ur(n),qt(n),Tx(n,x)):(qt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==c&&ur(n),qt(n),Nf(n,m,t,c,s)),null;case 27:if(Le(n),s=ce.current,m=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&ur(n);else{if(!c){if(n.stateNode===null)throw Error(i(166));return qt(n),null}t=pe.current,gi(n)?xi(n):(t=Lg(m,c,s),n.stateNode=t,ur(n))}return qt(n),null;case 5:if(Le(n),m=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&ur(n);else{if(!c){if(n.stateNode===null)throw Error(i(166));return qt(n),null}if(x=pe.current,gi(n))xi(n);else{var k=Vc(ce.current);switch(x){case 1:x=k.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:x=k.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":x=k.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":x=k.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":x=k.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?k.createElement("select",{is:c.is}):k.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?k.createElement(m,{is:c.is}):k.createElement(m)}}x[$t]=n,x[dn]=c;e:for(k=n.child;k!==null;){if(k.tag===5||k.tag===6)x.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===n)break e;for(;k.sibling===null;){if(k.return===null||k.return===n)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}n.stateNode=x;e:switch(Tn(x,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&ur(n)}}return qt(n),Nf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==c&&ur(n);else{if(typeof c!="string"&&n.stateNode===null)throw Error(i(166));if(t=ce.current,gi(n)){if(t=n.stateNode,s=n.memoizedProps,c=null,m=nn,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}t[$t]=n,t=!!(t.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||Ng(t.nodeValue,s)),t||At(n,!0)}else t=Vc(t).createTextNode(c),t[$t]=n,n.stateNode=t}return qt(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(c=gi(n),s!==null){if(t===null){if(!c)throw Error(i(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(557));t[$t]=n}else Ma(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;qt(n),t=!1}else s=zd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(rl(n),n):(rl(n),null);if((n.flags&128)!==0)throw Error(i(558))}return qt(n),null;case 13:if(c=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(m=gi(n),c!==null&&c.dehydrated!==null){if(t===null){if(!m)throw Error(i(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(i(317));m[$t]=n}else Ma(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;qt(n),m=!1}else m=zd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=m),m=!0;if(!m)return n.flags&256?(rl(n),n):(rl(n),null)}return rl(n),(n.flags&128)!==0?(n.lanes=s,n):(s=c!==null,t=t!==null&&t.memoizedState!==null,s&&(c=n.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==m&&(c.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),Ec(n,n.updateQueue),qt(n),null);case 4:return Ne(),t===null&&Gf(n.stateNode.containerInfo),qt(n),null;case 10:return ir(n.type),qt(n),null;case 19:if(le(en),c=n.memoizedState,c===null)return qt(n),null;if(m=(n.flags&128)!==0,x=c.rendering,x===null)if(m)qs(c,!1);else{if(Zt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(x=xc(t),x!==null){for(n.flags|=128,qs(c,!1),t=x.updateQueue,n.updateQueue=t,Ec(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)Ts(s,t),s=s.sibling;return R(en,en.current&1|2),ft&&xl(n,c.treeForkCount),n.child}t=t.sibling}c.tail!==null&&Ze()>Lc&&(n.flags|=128,m=!0,qs(c,!1),n.lanes=4194304)}else{if(!m)if(t=xc(x),t!==null){if(n.flags|=128,m=!0,t=t.updateQueue,n.updateQueue=t,Ec(n,t),qs(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!ft)return qt(n),null}else 2*Ze()-c.renderingStartTime>Lc&&s!==536870912&&(n.flags|=128,m=!0,qs(c,!1),n.lanes=4194304);c.isBackwards?(x.sibling=n.child,n.child=x):(t=c.last,t!==null?t.sibling=x:n.child=x,c.last=x)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Ze(),t.sibling=null,s=en.current,R(en,m?s&1|2:s&1),ft&&xl(n,c.treeForkCount),t):(qt(n),null);case 22:case 23:return rl(n),Gd(),c=n.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(n.flags|=8192):c&&(n.flags|=8192),c?(s&536870912)!==0&&(n.flags&128)===0&&(qt(n),n.subtreeFlags&6&&(n.flags|=8192)):qt(n),s=n.updateQueue,s!==null&&Ec(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==s&&(n.flags|=2048),t!==null&&le(La),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),ir(ln),qt(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function Rk(t,n){switch(Es(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ir(ln),Ne(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Le(n),null;case 31:if(n.memoizedState!==null){if(rl(n),n.alternate===null)throw Error(i(340));Ma()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(rl(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Ma()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return le(en),null;case 4:return Ne(),null;case 10:return ir(n.type),null;case 22:case 23:return rl(n),Gd(),t!==null&&le(La),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ir(ln),null;case 25:return null;default:return null}}function Ax(t,n){switch(Es(n),n.tag){case 3:ir(ln),Ne();break;case 26:case 27:case 5:Le(n);break;case 4:Ne();break;case 31:n.memoizedState!==null&&rl(n);break;case 13:rl(n);break;case 19:le(en);break;case 10:ir(n.type);break;case 22:case 23:rl(n),Gd(),t!==null&&le(La);break;case 24:ir(ln)}}function Vs(t,n){try{var s=n.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var m=c.next;s=m;do{if((s.tag&t)===t){c=void 0;var x=s.create,k=s.inst;c=x(),k.destroy=c}s=s.next}while(s!==m)}}catch(S){Mt(n,n.return,S)}}function Qr(t,n,s){try{var c=n.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var x=m.next;c=x;do{if((c.tag&t)===t){var k=c.inst,S=k.destroy;if(S!==void 0){k.destroy=void 0,m=n;var U=s,ne=S;try{ne()}catch(de){Mt(m,U,de)}}}c=c.next}while(c!==x)}}catch(de){Mt(n,n.return,de)}}function Ex(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{yh(n,s)}catch(c){Mt(t,t.return,c)}}}function Rx(t,n,s){s.props=Pa(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(c){Mt(t,n,c)}}function Gs(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof s=="function"?t.refCleanup=s(c):s.current=c}}catch(m){Mt(t,n,m)}}function Il(t,n){var s=t.ref,c=t.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(m){Mt(t,n,m)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(m){Mt(t,n,m)}else s.current=null}function Mx(t){var n=t.type,s=t.memoizedProps,c=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(m){Mt(t,t.return,m)}}function wf(t,n,s){try{var c=t.stateNode;Wk(c,t.type,s,n),c[dn]=n}catch(m){Mt(t,t.return,m)}}function zx(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ta(t.type)||t.tag===4}function Sf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||zx(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ta(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Cf(t,n,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(t),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=Nl));else if(c!==4&&(c===27&&ta(t.type)&&(s=t.stateNode,n=null),t=t.child,t!==null))for(Cf(t,n,s),t=t.sibling;t!==null;)Cf(t,n,s),t=t.sibling}function Rc(t,n,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(c!==4&&(c===27&&ta(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(Rc(t,n,s),t=t.sibling;t!==null;)Rc(t,n,s),t=t.sibling}function Ox(t){var n=t.stateNode,s=t.memoizedProps;try{for(var c=t.type,m=n.attributes;m.length;)n.removeAttributeNode(m[0]);Tn(n,c,s),n[$t]=t,n[dn]=s}catch(x){Mt(t,t.return,x)}}var dr=!1,sn=!1,Tf=!1,Lx=typeof WeakSet=="function"?WeakSet:Set,hn=null;function Mk(t,n){if(t=t.containerInfo,Qf=Zc,t=Wo(t),oi(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var m=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{s.nodeType,x.nodeType}catch{s=null;break e}var k=0,S=-1,U=-1,ne=0,de=0,he=t,re=null;t:for(;;){for(var ie;he!==s||m!==0&&he.nodeType!==3||(S=k+m),he!==x||c!==0&&he.nodeType!==3||(U=k+c),he.nodeType===3&&(k+=he.nodeValue.length),(ie=he.firstChild)!==null;)re=he,he=ie;for(;;){if(he===t)break t;if(re===s&&++ne===m&&(S=k),re===x&&++de===c&&(U=k),(ie=he.nextSibling)!==null)break;he=re,re=he.parentNode}he=ie}s=S===-1||U===-1?null:{start:S,end:U}}else s=null}s=s||{start:0,end:0}}else s=null;for(Xf={focusedElem:t,selectionRange:s},Zc=!1,hn=n;hn!==null;)if(n=hn,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,hn=t;else for(;hn!==null;){switch(n=hn,x=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)m=t[s],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,s=n,m=x.memoizedProps,x=x.memoizedState,c=s.stateNode;try{var Oe=Pa(s.type,m);t=c.getSnapshotBeforeUpdate(Oe,x),c.__reactInternalSnapshotBeforeUpdate=t}catch(Qe){Mt(s,s.return,Qe)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,s=t.nodeType,s===9)Wf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Wf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(i(163))}if(t=n.sibling,t!==null){t.return=n.return,hn=t;break}hn=n.return}}function Dx(t,n,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:mr(t,s),c&4&&Vs(5,s);break;case 1:if(mr(t,s),c&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(k){Mt(s,s.return,k)}else{var m=Pa(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(m,n,t.__reactInternalSnapshotBeforeUpdate)}catch(k){Mt(s,s.return,k)}}c&64&&Ex(s),c&512&&Gs(s,s.return);break;case 3:if(mr(t,s),c&64&&(t=s.updateQueue,t!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{yh(t,n)}catch(k){Mt(s,s.return,k)}}break;case 27:n===null&&c&4&&Ox(s);case 26:case 5:mr(t,s),n===null&&c&4&&Mx(s),c&512&&Gs(s,s.return);break;case 12:mr(t,s);break;case 31:mr(t,s),c&4&&Ix(t,s);break;case 13:mr(t,s),c&4&&Px(t,s),c&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=Uk.bind(null,s),ij(t,s))));break;case 22:if(c=s.memoizedState!==null||dr,!c){n=n!==null&&n.memoizedState!==null||sn,m=dr;var x=sn;dr=c,(sn=n)&&!x?pr(t,s,(s.subtreeFlags&8772)!==0):mr(t,s),dr=m,sn=x}break;case 30:break;default:mr(t,s)}}function _x(t){var n=t.alternate;n!==null&&(t.alternate=null,_x(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&zl(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Gt=null,Gn=!1;function fr(t,n,s){for(s=s.child;s!==null;)Bx(t,n,s),s=s.sibling}function Bx(t,n,s){if(V&&typeof V.onCommitFiberUnmount=="function")try{V.onCommitFiberUnmount(Ee,s)}catch{}switch(s.tag){case 26:sn||Il(s,n),fr(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:sn||Il(s,n);var c=Gt,m=Gn;ta(s.type)&&(Gt=s.stateNode,Gn=!1),fr(t,n,s),eo(s.stateNode),Gt=c,Gn=m;break;case 5:sn||Il(s,n);case 6:if(c=Gt,m=Gn,Gt=null,fr(t,n,s),Gt=c,Gn=m,Gt!==null)if(Gn)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(s.stateNode)}catch(x){Mt(s,n,x)}else try{Gt.removeChild(s.stateNode)}catch(x){Mt(s,n,x)}break;case 18:Gt!==null&&(Gn?(t=Gt,Eg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Ii(t)):Eg(Gt,s.stateNode));break;case 4:c=Gt,m=Gn,Gt=s.stateNode.containerInfo,Gn=!0,fr(t,n,s),Gt=c,Gn=m;break;case 0:case 11:case 14:case 15:Qr(2,s,n),sn||Qr(4,s,n),fr(t,n,s);break;case 1:sn||(Il(s,n),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Rx(s,n,c)),fr(t,n,s);break;case 21:fr(t,n,s);break;case 22:sn=(c=sn)||s.memoizedState!==null,fr(t,n,s),sn=c;break;default:fr(t,n,s)}}function Ix(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ii(t)}catch(s){Mt(n,n.return,s)}}}function Px(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ii(t)}catch(s){Mt(n,n.return,s)}}function zk(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Lx),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Lx),n;default:throw Error(i(435,t.tag))}}function Mc(t,n){var s=zk(t);n.forEach(function(c){if(!s.has(c)){s.add(c);var m=Hk.bind(null,t,c);c.then(m,m)}})}function $n(t,n){var s=n.deletions;if(s!==null)for(var c=0;c<s.length;c++){var m=s[c],x=t,k=n,S=k;e:for(;S!==null;){switch(S.tag){case 27:if(ta(S.type)){Gt=S.stateNode,Gn=!1;break e}break;case 5:Gt=S.stateNode,Gn=!1;break e;case 3:case 4:Gt=S.stateNode.containerInfo,Gn=!0;break e}S=S.return}if(Gt===null)throw Error(i(160));Bx(x,k,m),Gt=null,Gn=!1,x=m.alternate,x!==null&&(x.return=null),m.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Ux(n,t),n=n.sibling}var Cl=null;function Ux(t,n){var s=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:$n(n,t),Yn(t),c&4&&(Qr(3,t,t.return),Vs(3,t),Qr(5,t,t.return));break;case 1:$n(n,t),Yn(t),c&512&&(sn||s===null||Il(s,s.return)),c&64&&dr&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var m=Cl;if($n(n,t),Yn(t),c&512&&(sn||s===null||Il(s,s.return)),c&4){var x=s!==null?s.memoizedState:null;if(c=t.memoizedState,s===null)if(c===null)if(t.stateNode===null){e:{c=t.type,s=t.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":x=m.getElementsByTagName("title")[0],(!x||x[Wn]||x[$t]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=m.createElement(c),m.head.insertBefore(x,m.querySelector("head > title"))),Tn(x,c,s),x[$t]=t,Ft(x),c=x;break e;case"link":var k=Ug("link","href",m).get(c+(s.href||""));if(k){for(var S=0;S<k.length;S++)if(x=k[S],x.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&x.getAttribute("rel")===(s.rel==null?null:s.rel)&&x.getAttribute("title")===(s.title==null?null:s.title)&&x.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){k.splice(S,1);break t}}x=m.createElement(c),Tn(x,c,s),m.head.appendChild(x);break;case"meta":if(k=Ug("meta","content",m).get(c+(s.content||""))){for(S=0;S<k.length;S++)if(x=k[S],x.getAttribute("content")===(s.content==null?null:""+s.content)&&x.getAttribute("name")===(s.name==null?null:s.name)&&x.getAttribute("property")===(s.property==null?null:s.property)&&x.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&x.getAttribute("charset")===(s.charSet==null?null:s.charSet)){k.splice(S,1);break t}}x=m.createElement(c),Tn(x,c,s),m.head.appendChild(x);break;default:throw Error(i(468,c))}x[$t]=t,Ft(x),c=x}t.stateNode=c}else Hg(m,t.type,t.stateNode);else t.stateNode=Pg(m,c,t.memoizedProps);else x!==c?(x===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):x.count--,c===null?Hg(m,t.type,t.stateNode):Pg(m,c,t.memoizedProps)):c===null&&t.stateNode!==null&&wf(t,t.memoizedProps,s.memoizedProps)}break;case 27:$n(n,t),Yn(t),c&512&&(sn||s===null||Il(s,s.return)),s!==null&&c&4&&wf(t,t.memoizedProps,s.memoizedProps);break;case 5:if($n(n,t),Yn(t),c&512&&(sn||s===null||Il(s,s.return)),t.flags&32){m=t.stateNode;try{Kl(m,"")}catch(Oe){Mt(t,t.return,Oe)}}c&4&&t.stateNode!=null&&(m=t.memoizedProps,wf(t,m,s!==null?s.memoizedProps:m)),c&1024&&(Tf=!0);break;case 6:if($n(n,t),Yn(t),c&4){if(t.stateNode===null)throw Error(i(162));c=t.memoizedProps,s=t.stateNode;try{s.nodeValue=c}catch(Oe){Mt(t,t.return,Oe)}}break;case 3:if(Yc=null,m=Cl,Cl=Gc(n.containerInfo),$n(n,t),Cl=m,Yn(t),c&4&&s!==null&&s.memoizedState.isDehydrated)try{Ii(n.containerInfo)}catch(Oe){Mt(t,t.return,Oe)}Tf&&(Tf=!1,Hx(t));break;case 4:c=Cl,Cl=Gc(t.stateNode.containerInfo),$n(n,t),Yn(t),Cl=c;break;case 12:$n(n,t),Yn(t);break;case 31:$n(n,t),Yn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Mc(t,c)));break;case 13:$n(n,t),Yn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Oc=Ze()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Mc(t,c)));break;case 22:m=t.memoizedState!==null;var U=s!==null&&s.memoizedState!==null,ne=dr,de=sn;if(dr=ne||m,sn=de||U,$n(n,t),sn=de,dr=ne,Yn(t),c&8192)e:for(n=t.stateNode,n._visibility=m?n._visibility&-2:n._visibility|1,m&&(s===null||U||dr||sn||Ua(t)),s=null,n=t;;){if(n.tag===5||n.tag===26){if(s===null){U=s=n;try{if(x=U.stateNode,m)k=x.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{S=U.stateNode;var he=U.memoizedProps.style,re=he!=null&&he.hasOwnProperty("display")?he.display:null;S.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Oe){Mt(U,U.return,Oe)}}}else if(n.tag===6){if(s===null){U=n;try{U.stateNode.nodeValue=m?"":U.memoizedProps}catch(Oe){Mt(U,U.return,Oe)}}}else if(n.tag===18){if(s===null){U=n;try{var ie=U.stateNode;m?Rg(ie,!0):Rg(U.stateNode,!1)}catch(Oe){Mt(U,U.return,Oe)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}c&4&&(c=t.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,Mc(t,s))));break;case 19:$n(n,t),Yn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Mc(t,c)));break;case 30:break;case 21:break;default:$n(n,t),Yn(t)}}function Yn(t){var n=t.flags;if(n&2){try{for(var s,c=t.return;c!==null;){if(zx(c)){s=c;break}c=c.return}if(s==null)throw Error(i(160));switch(s.tag){case 27:var m=s.stateNode,x=Sf(t);Rc(t,x,m);break;case 5:var k=s.stateNode;s.flags&32&&(Kl(k,""),s.flags&=-33);var S=Sf(t);Rc(t,S,k);break;case 3:case 4:var U=s.stateNode.containerInfo,ne=Sf(t);Cf(t,ne,U);break;default:throw Error(i(161))}}catch(de){Mt(t,t.return,de)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Hx(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Hx(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function mr(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Dx(t,n.alternate,n),n=n.sibling}function Ua(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Qr(4,n,n.return),Ua(n);break;case 1:Il(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&Rx(n,n.return,s),Ua(n);break;case 27:eo(n.stateNode);case 26:case 5:Il(n,n.return),Ua(n);break;case 22:n.memoizedState===null&&Ua(n);break;case 30:Ua(n);break;default:Ua(n)}t=t.sibling}}function pr(t,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var c=n.alternate,m=t,x=n,k=x.flags;switch(x.tag){case 0:case 11:case 15:pr(m,x,s),Vs(4,x);break;case 1:if(pr(m,x,s),c=x,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ne){Mt(c,c.return,ne)}if(c=x,m=c.updateQueue,m!==null){var S=c.stateNode;try{var U=m.shared.hiddenCallbacks;if(U!==null)for(m.shared.hiddenCallbacks=null,m=0;m<U.length;m++)bh(U[m],S)}catch(ne){Mt(c,c.return,ne)}}s&&k&64&&Ex(x),Gs(x,x.return);break;case 27:Ox(x);case 26:case 5:pr(m,x,s),s&&c===null&&k&4&&Mx(x),Gs(x,x.return);break;case 12:pr(m,x,s);break;case 31:pr(m,x,s),s&&k&4&&Ix(m,x);break;case 13:pr(m,x,s),s&&k&4&&Px(m,x);break;case 22:x.memoizedState===null&&pr(m,x,s),Gs(x,x.return);break;case 30:break;default:pr(m,x,s)}n=n.sibling}}function Af(t,n){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Ms(s))}function Ef(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ms(t))}function Tl(t,n,s,c){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Fx(t,n,s,c),n=n.sibling}function Fx(t,n,s,c){var m=n.flags;switch(n.tag){case 0:case 11:case 15:Tl(t,n,s,c),m&2048&&Vs(9,n);break;case 1:Tl(t,n,s,c);break;case 3:Tl(t,n,s,c),m&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ms(t)));break;case 12:if(m&2048){Tl(t,n,s,c),t=n.stateNode;try{var x=n.memoizedProps,k=x.id,S=x.onPostCommit;typeof S=="function"&&S(k,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(U){Mt(n,n.return,U)}}else Tl(t,n,s,c);break;case 31:Tl(t,n,s,c);break;case 13:Tl(t,n,s,c);break;case 23:break;case 22:x=n.stateNode,k=n.alternate,n.memoizedState!==null?x._visibility&2?Tl(t,n,s,c):$s(t,n):x._visibility&2?Tl(t,n,s,c):(x._visibility|=2,Ti(t,n,s,c,(n.subtreeFlags&10256)!==0||!1)),m&2048&&Af(k,n);break;case 24:Tl(t,n,s,c),m&2048&&Ef(n.alternate,n);break;default:Tl(t,n,s,c)}}function Ti(t,n,s,c,m){for(m=m&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var x=t,k=n,S=s,U=c,ne=k.flags;switch(k.tag){case 0:case 11:case 15:Ti(x,k,S,U,m),Vs(8,k);break;case 23:break;case 22:var de=k.stateNode;k.memoizedState!==null?de._visibility&2?Ti(x,k,S,U,m):$s(x,k):(de._visibility|=2,Ti(x,k,S,U,m)),m&&ne&2048&&Af(k.alternate,k);break;case 24:Ti(x,k,S,U,m),m&&ne&2048&&Ef(k.alternate,k);break;default:Ti(x,k,S,U,m)}n=n.sibling}}function $s(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,c=n,m=c.flags;switch(c.tag){case 22:$s(s,c),m&2048&&Af(c.alternate,c);break;case 24:$s(s,c),m&2048&&Ef(c.alternate,c);break;default:$s(s,c)}n=n.sibling}}var Ys=8192;function Ai(t,n,s){if(t.subtreeFlags&Ys)for(t=t.child;t!==null;)qx(t,n,s),t=t.sibling}function qx(t,n,s){switch(t.tag){case 26:Ai(t,n,s),t.flags&Ys&&t.memoizedState!==null&&bj(s,Cl,t.memoizedState,t.memoizedProps);break;case 5:Ai(t,n,s);break;case 3:case 4:var c=Cl;Cl=Gc(t.stateNode.containerInfo),Ai(t,n,s),Cl=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=Ys,Ys=16777216,Ai(t,n,s),Ys=c):Ai(t,n,s));break;default:Ai(t,n,s)}}function Vx(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Qs(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];hn=c,$x(c,t)}Vx(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Gx(t),t=t.sibling}function Gx(t){switch(t.tag){case 0:case 11:case 15:Qs(t),t.flags&2048&&Qr(9,t,t.return);break;case 3:Qs(t);break;case 12:Qs(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,zc(t)):Qs(t);break;default:Qs(t)}}function zc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];hn=c,$x(c,t)}Vx(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Qr(8,n,n.return),zc(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,zc(n));break;default:zc(n)}t=t.sibling}}function $x(t,n){for(;hn!==null;){var s=hn;switch(s.tag){case 0:case 11:case 15:Qr(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ms(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,hn=c;else e:for(s=t;hn!==null;){c=hn;var m=c.sibling,x=c.return;if(_x(c),c===s){hn=null;break e}if(m!==null){m.return=x,hn=m;break e}hn=x}}}var Ok={getCacheForType:function(t){var n=Sn(ln),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return Sn(ln).controller.signal}},Lk=typeof WeakMap=="function"?WeakMap:Map,Et=0,Bt=null,ht=null,kt=0,Rt=0,al=null,Xr=!1,Ei=!1,Rf=!1,hr=0,Zt=0,Kr=0,Ha=0,Mf=0,il=0,Ri=0,Xs=null,Qn=null,zf=!1,Oc=0,Yx=0,Lc=1/0,Dc=null,Zr=null,fn=0,Wr=null,Mi=null,xr=0,Of=0,Lf=null,Qx=null,Ks=0,Df=null;function sl(){return(Et&2)!==0&&kt!==0?kt&-kt:N.T!==null?Hf():Wa()}function Xx(){if(il===0)if((kt&536870912)===0||ft){var t=Yt;Yt<<=1,(Yt&3932160)===0&&(Yt=262144),il=t}else il=536870912;return t=ll.current,t!==null&&(t.flags|=32),il}function Xn(t,n,s){(t===Bt&&(Rt===2||Rt===9)||t.cancelPendingCommit!==null)&&(zi(t,0),Jr(t,kt,il,!1)),nt(t,s),((Et&2)===0||t!==Bt)&&(t===Bt&&((Et&2)===0&&(Ha|=s),Zt===4&&Jr(t,kt,il,!1)),Pl(t))}function Kx(t,n,s){if((Et&6)!==0)throw Error(i(327));var c=!s&&(n&127)===0&&(n&t.expiredLanes)===0||Wt(t,n),m=c?Bk(t,n):Bf(t,n,!0),x=c;do{if(m===0){Ei&&!c&&Jr(t,n,0,!1);break}else{if(s=t.current.alternate,x&&!Dk(s)){m=Bf(t,n,!1),x=!1;continue}if(m===2){if(x=n,t.errorRecoveryDisabledLanes&x)var k=0;else k=t.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){n=k;e:{var S=t;m=Xs;var U=S.current.memoizedState.isDehydrated;if(U&&(zi(S,k).flags|=256),k=Bf(S,k,!1),k!==2){if(Rf&&!U){S.errorRecoveryDisabledLanes|=x,Ha|=x,m=4;break e}x=Qn,Qn=m,x!==null&&(Qn===null?Qn=x:Qn.push.apply(Qn,x))}m=k}if(x=!1,m!==2)continue}}if(m===1){zi(t,0),Jr(t,n,0,!0);break}e:{switch(c=t,x=m,x){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:Jr(c,n,il,!Xr);break e;case 2:Qn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(m=Oc+300-Ze(),10<m)){if(Jr(c,n,il,!Xr),yt(c,0,!0)!==0)break e;xr=n,c.timeoutHandle=Tg(Zx.bind(null,c,s,Qn,Dc,zf,n,il,Ha,Ri,Xr,x,"Throttled",-0,0),m);break e}Zx(c,s,Qn,Dc,zf,n,il,Ha,Ri,Xr,x,null,-0,0)}}break}while(!0);Pl(t)}function Zx(t,n,s,c,m,x,k,S,U,ne,de,he,re,ie){if(t.timeoutHandle=-1,he=n.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Nl},qx(n,x,he);var Oe=(x&62914560)===x?Oc-Ze():(x&4194048)===x?Yx-Ze():0;if(Oe=yj(he,Oe),Oe!==null){xr=x,t.cancelPendingCommit=Oe(ag.bind(null,t,n,x,s,c,m,k,S,U,de,he,null,re,ie)),Jr(t,x,k,!ne);return}}ag(t,n,x,s,c,m,k,S,U)}function Dk(t){for(var n=t;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var m=s[c],x=m.getSnapshot;m=m.value;try{if(!qn(x(),m))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Jr(t,n,s,c){n&=~Mf,n&=~Ha,t.suspendedLanes|=n,t.pingedLanes&=~n,c&&(t.warmLanes|=n),c=t.expirationTimes;for(var m=n;0<m;){var x=31-je(m),k=1<<x;c[x]=-1,m&=~k}s!==0&&gn(t,s,n)}function _c(){return(Et&6)===0?(Zs(0),!1):!0}function _f(){if(ht!==null){if(Rt===0)var t=ht.return;else t=ht,ar=za=null,Zd(t),ji=null,Os=0,t=ht;for(;t!==null;)Ax(t.alternate,t),t=t.return;ht=null}}function zi(t,n){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,tj(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),xr=0,_f(),Bt=t,ht=s=Jt(t.current,null),kt=n,Rt=0,al=null,Xr=!1,Ei=Wt(t,n),Rf=!1,Ri=il=Mf=Ha=Kr=Zt=0,Qn=Xs=null,zf=!1,(n&8)!==0&&(n|=n&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=n;0<c;){var m=31-je(c),x=1<<m;n|=t[m],c&=~x}return hr=n,di(),s}function Wx(t,n){ct=null,N.H=Hs,n===ki||n===dc?(n=ph(),Rt=3):n===Pd?(n=ph(),Rt=4):Rt=n===pf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,al=n,ht===null&&(Zt=1,Sc(t,Nn(n,t.current)))}function Jx(){var t=ll.current;return t===null?!0:(kt&4194048)===kt?gl===null:(kt&62914560)===kt||(kt&536870912)!==0?t===gl:!1}function eg(){var t=N.H;return N.H=Hs,t===null?Hs:t}function tg(){var t=N.A;return N.A=Ok,t}function Bc(){Zt=4,Xr||(kt&4194048)!==kt&&ll.current!==null||(Ei=!0),(Kr&134217727)===0&&(Ha&134217727)===0||Bt===null||Jr(Bt,kt,il,!1)}function Bf(t,n,s){var c=Et;Et|=2;var m=eg(),x=tg();(Bt!==t||kt!==n)&&(Dc=null,zi(t,n)),n=!1;var k=Zt;e:do try{if(Rt!==0&&ht!==null){var S=ht,U=al;switch(Rt){case 8:_f(),k=6;break e;case 3:case 2:case 9:case 6:ll.current===null&&(n=!0);var ne=Rt;if(Rt=0,al=null,Oi(t,S,U,ne),s&&Ei){k=0;break e}break;default:ne=Rt,Rt=0,al=null,Oi(t,S,U,ne)}}_k(),k=Zt;break}catch(de){Wx(t,de)}while(!0);return n&&t.shellSuspendCounter++,ar=za=null,Et=c,N.H=m,N.A=x,ht===null&&(Bt=null,kt=0,di()),k}function _k(){for(;ht!==null;)ng(ht)}function Bk(t,n){var s=Et;Et|=2;var c=eg(),m=tg();Bt!==t||kt!==n?(Dc=null,Lc=Ze()+500,zi(t,n)):Ei=Wt(t,n);e:do try{if(Rt!==0&&ht!==null){n=ht;var x=al;t:switch(Rt){case 1:Rt=0,al=null,Oi(t,n,x,1);break;case 2:case 9:if(fh(x)){Rt=0,al=null,lg(n);break}n=function(){Rt!==2&&Rt!==9||Bt!==t||(Rt=7),Pl(t)},x.then(n,n);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:fh(x)?(Rt=0,al=null,lg(n)):(Rt=0,al=null,Oi(t,n,x,7));break;case 5:var k=null;switch(ht.tag){case 26:k=ht.memoizedState;case 5:case 27:var S=ht;if(k?Fg(k):S.stateNode.complete){Rt=0,al=null;var U=S.sibling;if(U!==null)ht=U;else{var ne=S.return;ne!==null?(ht=ne,Ic(ne)):ht=null}break t}}Rt=0,al=null,Oi(t,n,x,5);break;case 6:Rt=0,al=null,Oi(t,n,x,6);break;case 8:_f(),Zt=6;break e;default:throw Error(i(462))}}Ik();break}catch(de){Wx(t,de)}while(!0);return ar=za=null,N.H=c,N.A=m,Et=s,ht!==null?0:(Bt=null,kt=0,di(),Zt)}function Ik(){for(;ht!==null&&!et();)ng(ht)}function ng(t){var n=Cx(t.alternate,t,hr);t.memoizedProps=t.pendingProps,n===null?Ic(t):ht=n}function lg(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=vx(s,n,n.pendingProps,n.type,void 0,kt);break;case 11:n=vx(s,n,n.pendingProps,n.type.render,n.ref,kt);break;case 5:Zd(n);default:Ax(s,n),n=ht=Ts(n,hr),n=Cx(s,n,hr)}t.memoizedProps=t.pendingProps,n===null?Ic(t):ht=n}function Oi(t,n,s,c){ar=za=null,Zd(n),ji=null,Os=0;var m=n.return;try{if(Ck(t,m,n,s,kt)){Zt=1,Sc(t,Nn(s,t.current)),ht=null;return}}catch(x){if(m!==null)throw ht=m,x;Zt=1,Sc(t,Nn(s,t.current)),ht=null;return}n.flags&32768?(ft||c===1?t=!0:Ei||(kt&536870912)!==0?t=!1:(Xr=t=!0,(c===2||c===9||c===3||c===6)&&(c=ll.current,c!==null&&c.tag===13&&(c.flags|=16384))),rg(n,t)):Ic(n)}function Ic(t){var n=t;do{if((n.flags&32768)!==0){rg(n,Xr);return}t=n.return;var s=Ek(n.alternate,n,hr);if(s!==null){ht=s;return}if(n=n.sibling,n!==null){ht=n;return}ht=n=t}while(n!==null);Zt===0&&(Zt=5)}function rg(t,n){do{var s=Rk(t.alternate,t);if(s!==null){s.flags&=32767,ht=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){ht=t;return}ht=t=s}while(t!==null);Zt=6,ht=null}function ag(t,n,s,c,m,x,k,S,U){t.cancelPendingCommit=null;do Pc();while(fn!==0);if((Et&6)!==0)throw Error(i(327));if(n!==null){if(n===t.current)throw Error(i(177));if(x=n.lanes|n.childLanes,x|=Mn,Qt(t,s,x,k,S,U),t===Bt&&(ht=Bt=null,kt=0),Mi=n,Wr=t,xr=s,Of=x,Lf=m,Qx=c,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Fk(Ce,function(){return ug(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||c){c=N.T,N.T=null,m=Y.p,Y.p=2,k=Et,Et|=4;try{Mk(t,n,s)}finally{Et=k,Y.p=m,N.T=c}}fn=1,ig(),sg(),og()}}function ig(){if(fn===1){fn=0;var t=Wr,n=Mi,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=N.T,N.T=null;var c=Y.p;Y.p=2;var m=Et;Et|=4;try{Ux(n,t);var x=Xf,k=Wo(t.containerInfo),S=x.focusedElem,U=x.selectionRange;if(k!==S&&S&&S.ownerDocument&&vs(S.ownerDocument.documentElement,S)){if(U!==null&&oi(S)){var ne=U.start,de=U.end;if(de===void 0&&(de=ne),"selectionStart"in S)S.selectionStart=ne,S.selectionEnd=Math.min(de,S.value.length);else{var he=S.ownerDocument||document,re=he&&he.defaultView||window;if(re.getSelection){var ie=re.getSelection(),Oe=S.textContent.length,Qe=Math.min(U.start,Oe),Dt=U.end===void 0?Qe:Math.min(U.end,Oe);!ie.extend&&Qe>Dt&&(k=Dt,Dt=Qe,Qe=k);var K=Zo(S,Qe),G=Zo(S,Dt);if(K&&G&&(ie.rangeCount!==1||ie.anchorNode!==K.node||ie.anchorOffset!==K.offset||ie.focusNode!==G.node||ie.focusOffset!==G.offset)){var te=he.createRange();te.setStart(K.node,K.offset),ie.removeAllRanges(),Qe>Dt?(ie.addRange(te),ie.extend(G.node,G.offset)):(te.setEnd(G.node,G.offset),ie.addRange(te))}}}}for(he=[],ie=S;ie=ie.parentNode;)ie.nodeType===1&&he.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<he.length;S++){var fe=he[S];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Zc=!!Qf,Xf=Qf=null}finally{Et=m,Y.p=c,N.T=s}}t.current=n,fn=2}}function sg(){if(fn===2){fn=0;var t=Wr,n=Mi,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=N.T,N.T=null;var c=Y.p;Y.p=2;var m=Et;Et|=4;try{Dx(t,n.alternate,n)}finally{Et=m,Y.p=c,N.T=s}}fn=3}}function og(){if(fn===4||fn===3){fn=0,Se();var t=Wr,n=Mi,s=xr,c=Qx;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?fn=5:(fn=0,Mi=Wr=null,cg(t,t.pendingLanes));var m=t.pendingLanes;if(m===0&&(Zr=null),bn(s),n=n.stateNode,V&&typeof V.onCommitFiberRoot=="function")try{V.onCommitFiberRoot(Ee,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=N.T,m=Y.p,Y.p=2,N.T=null;try{for(var x=t.onRecoverableError,k=0;k<c.length;k++){var S=c[k];x(S.value,{componentStack:S.stack})}}finally{N.T=n,Y.p=m}}(xr&3)!==0&&Pc(),Pl(t),m=t.pendingLanes,(s&261930)!==0&&(m&42)!==0?t===Df?Ks++:(Ks=0,Df=t):Ks=0,Zs(0)}}function cg(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Ms(n)))}function Pc(){return ig(),sg(),og(),ug()}function ug(){if(fn!==5)return!1;var t=Wr,n=Of;Of=0;var s=bn(xr),c=N.T,m=Y.p;try{Y.p=32>s?32:s,N.T=null,s=Lf,Lf=null;var x=Wr,k=xr;if(fn=0,Mi=Wr=null,xr=0,(Et&6)!==0)throw Error(i(331));var S=Et;if(Et|=4,Gx(x.current),Fx(x,x.current,k,s),Et=S,Zs(0,!1),V&&typeof V.onPostCommitFiberRoot=="function")try{V.onPostCommitFiberRoot(Ee,x)}catch{}return!0}finally{Y.p=m,N.T=c,cg(t,n)}}function dg(t,n,s){n=Nn(s,n),n=mf(t.stateNode,n,2),t=Gr(t,n,2),t!==null&&(nt(t,2),Pl(t))}function Mt(t,n,s){if(t.tag===3)dg(t,t,s);else for(;n!==null;){if(n.tag===3){dg(n,t,s);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Zr===null||!Zr.has(c))){t=Nn(s,t),s=fx(2),c=Gr(n,s,2),c!==null&&(mx(s,c,n,t),nt(c,2),Pl(c));break}}n=n.return}}function If(t,n,s){var c=t.pingCache;if(c===null){c=t.pingCache=new Lk;var m=new Set;c.set(n,m)}else m=c.get(n),m===void 0&&(m=new Set,c.set(n,m));m.has(s)||(Rf=!0,m.add(s),t=Pk.bind(null,t,n,s),n.then(t,t))}function Pk(t,n,s){var c=t.pingCache;c!==null&&c.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Bt===t&&(kt&s)===s&&(Zt===4||Zt===3&&(kt&62914560)===kt&&300>Ze()-Oc?(Et&2)===0&&zi(t,0):Mf|=s,Ri===kt&&(Ri=0)),Pl(t)}function fg(t,n){n===0&&(n=Me()),t=nr(t,n),t!==null&&(nt(t,n),Pl(t))}function Uk(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),fg(t,s)}function Hk(t,n){var s=0;switch(t.tag){case 31:case 13:var c=t.stateNode,m=t.memoizedState;m!==null&&(s=m.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(n),fg(t,s)}function Fk(t,n){return We(t,n)}var Uc=null,Li=null,Pf=!1,Hc=!1,Uf=!1,ea=0;function Pl(t){t!==Li&&t.next===null&&(Li===null?Uc=Li=t:Li=Li.next=t),Hc=!0,Pf||(Pf=!0,Vk())}function Zs(t,n){if(!Uf&&Hc){Uf=!0;do for(var s=!1,c=Uc;c!==null;){if(t!==0){var m=c.pendingLanes;if(m===0)var x=0;else{var k=c.suspendedLanes,S=c.pingedLanes;x=(1<<31-je(42|t)+1)-1,x&=m&~(k&~S),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(s=!0,xg(c,x))}else x=kt,x=yt(c,c===Bt?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||Wt(c,x)||(s=!0,xg(c,x));c=c.next}while(s);Uf=!1}}function qk(){mg()}function mg(){Hc=Pf=!1;var t=0;ea!==0&&ej()&&(t=ea);for(var n=Ze(),s=null,c=Uc;c!==null;){var m=c.next,x=pg(c,n);x===0?(c.next=null,s===null?Uc=m:s.next=m,m===null&&(Li=s)):(s=c,(t!==0||(x&3)!==0)&&(Hc=!0)),c=m}fn!==0&&fn!==5||Zs(t),ea!==0&&(ea=0)}function pg(t,n){for(var s=t.suspendedLanes,c=t.pingedLanes,m=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var k=31-je(x),S=1<<k,U=m[k];U===-1?((S&s)===0||(S&c)!==0)&&(m[k]=se(S,n)):U<=n&&(t.expiredLanes|=S),x&=~S}if(n=Bt,s=kt,s=yt(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,s===0||t===n&&(Rt===2||Rt===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&we(c),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||Wt(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(c!==null&&we(c),bn(s)){case 2:case 8:s=ge;break;case 32:s=Ce;break;case 268435456:s=Xe;break;default:s=Ce}return c=hg.bind(null,t),s=We(s,c),t.callbackPriority=n,t.callbackNode=s,n}return c!==null&&c!==null&&we(c),t.callbackPriority=2,t.callbackNode=null,2}function hg(t,n){if(fn!==0&&fn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Pc()&&t.callbackNode!==s)return null;var c=kt;return c=yt(t,t===Bt?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Kx(t,c,n),pg(t,Ze()),t.callbackNode!=null&&t.callbackNode===s?hg.bind(null,t):null)}function xg(t,n){if(Pc())return null;Kx(t,n,!0)}function Vk(){nj(function(){(Et&6)!==0?We(ae,qk):mg()})}function Hf(){if(ea===0){var t=yi;t===0&&(t=St,St<<=1,(St&261888)===0&&(St=256)),ea=t}return ea}function gg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ni(""+t)}function bg(t,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,t.id&&s.setAttribute("form",t.id),n.parentNode.insertBefore(s,n),t=new FormData(t),s.parentNode.removeChild(s),t}function Gk(t,n,s,c,m){if(n==="submit"&&s&&s.stateNode===m){var x=gg((m[dn]||null).action),k=c.submitter;k&&(n=(n=k[dn]||null)?gg(n.formAction):k.getAttribute("formAction"),n!==null&&(x=n,k=null));var S=new Rr("action","action",null,c,m);t.push({event:S,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ea!==0){var U=k?bg(m,k):new FormData(m);sf(s,{pending:!0,data:U,method:m.method,action:x},null,U)}}else typeof x=="function"&&(S.preventDefault(),U=k?bg(m,k):new FormData(m),sf(s,{pending:!0,data:U,method:m.method,action:x},x,U))},currentTarget:m}]})}}for(var Ff=0;Ff<ws.length;Ff++){var qf=ws[Ff],$k=qf.toLowerCase(),Yk=qf[0].toUpperCase()+qf.slice(1);tl($k,"on"+Yk)}tl(tc,"onAnimationEnd"),tl(nc,"onAnimationIteration"),tl(Ea,"onAnimationStart"),tl("dblclick","onDoubleClick"),tl("focusin","onFocus"),tl("focusout","onBlur"),tl(Rd,"onTransitionRun"),tl(ci,"onTransitionStart"),tl(Md,"onTransitionCancel"),tl(ui,"onTransitionEnd"),Ql("onMouseEnter",["mouseout","mouseover"]),Ql("onMouseLeave",["mouseout","mouseover"]),Ql("onPointerEnter",["pointerout","pointerover"]),Ql("onPointerLeave",["pointerout","pointerover"]),Dl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Dl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Dl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Dl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Dl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Dl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ws="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(" "),Qk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ws));function yg(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var c=t[s],m=c.event;c=c.listeners;e:{var x=void 0;if(n)for(var k=c.length-1;0<=k;k--){var S=c[k],U=S.instance,ne=S.currentTarget;if(S=S.listener,U!==x&&m.isPropagationStopped())break e;x=S,m.currentTarget=ne;try{x(m)}catch(de){Ra(de)}m.currentTarget=null,x=U}else for(k=0;k<c.length;k++){if(S=c[k],U=S.instance,ne=S.currentTarget,S=S.listener,U!==x&&m.isPropagationStopped())break e;x=S,m.currentTarget=ne;try{x(m)}catch(de){Ra(de)}m.currentTarget=null,x=U}}}}function xt(t,n){var s=n[$l];s===void 0&&(s=n[$l]=new Set);var c=t+"__bubble";s.has(c)||(vg(n,t,2,!1),s.add(c))}function Vf(t,n,s){var c=0;n&&(c|=4),vg(s,t,c,n)}var Fc="_reactListening"+Math.random().toString(36).slice(2);function Gf(t){if(!t[Fc]){t[Fc]=!0,ba.forEach(function(s){s!=="selectionchange"&&(Qk.has(s)||Vf(s,!1,t),Vf(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Fc]||(n[Fc]=!0,Vf("selectionchange",!1,n))}}function vg(t,n,s,c){switch(Xg(n)){case 2:var m=jj;break;case 8:m=Nj;break;default:m=im}s=m.bind(null,n,s,t),m=void 0,!ka||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(m=!0),c?m!==void 0?t.addEventListener(n,s,{capture:!0,passive:m}):t.addEventListener(n,s,!0):m!==void 0?t.addEventListener(n,s,{passive:m}):t.addEventListener(n,s,!1)}function $f(t,n,s,c,m){var x=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var k=c.tag;if(k===3||k===4){var S=c.stateNode.containerInfo;if(S===m)break;if(k===4)for(k=c.return;k!==null;){var U=k.tag;if((U===3||U===4)&&k.stateNode.containerInfo===m)return;k=k.return}for(;S!==null;){if(k=dl(S),k===null)return;if(U=k.tag,U===5||U===6||U===26||U===27){c=x=k;continue e}S=S.parentNode}}c=c.return}os(function(){var ne=x,de=ss(s),he=[];e:{var re=lc.get(t);if(re!==void 0){var ie=Rr,Oe=t;switch(t){case"keypress":if(cs(s)===0)break e;case"keydown":case"keyup":ie=fd;break;case"focusin":Oe="focus",ie=fs;break;case"focusout":Oe="blur",ie=fs;break;case"beforeblur":case"afterblur":ie=fs;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Ho;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=ai;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=hd;break;case tc:case nc:case Ea:ie=rd;break;case ui:ie=xd;break;case"scroll":case"scrollend":ie=Uo;break;case"wheel":ie=bd;break;case"copy":case"cut":case"paste":ie=ad;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Fo;break;case"toggle":case"beforetoggle":ie=vd}var Qe=(n&4)!==0,Dt=!Qe&&(t==="scroll"||t==="scrollend"),K=Qe?re!==null?re+"Capture":null:re;Qe=[];for(var G=ne,te;G!==null;){var fe=G;if(te=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||te===null||K===null||(fe=Zl(G,K),fe!=null&&Qe.push(Js(G,fe,te))),Dt)break;G=G.return}0<Qe.length&&(re=new ie(re,Oe,null,s,de),he.push({event:re,listeners:Qe}))}}if((n&7)===0){e:{if(re=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",re&&s!==is&&(Oe=s.relatedTarget||s.fromElement)&&(dl(Oe)||Oe[Ht]))break e;if((ie||re)&&(re=de.window===de?de:(re=de.ownerDocument)?re.defaultView||re.parentWindow:window,ie?(Oe=s.relatedTarget||s.toElement,ie=ne,Oe=Oe?dl(Oe):null,Oe!==null&&(Dt=u(Oe),Qe=Oe.tag,Oe!==Dt||Qe!==5&&Qe!==27&&Qe!==6)&&(Oe=null)):(ie=null,Oe=ne),ie!==Oe)){if(Qe=Ho,fe="onMouseLeave",K="onMouseEnter",G="mouse",(t==="pointerout"||t==="pointerover")&&(Qe=Fo,fe="onPointerLeave",K="onPointerEnter",G="pointer"),Dt=ie==null?re:Sr(ie),te=Oe==null?re:Sr(Oe),re=new Qe(fe,G+"leave",ie,s,de),re.target=Dt,re.relatedTarget=te,fe=null,dl(de)===ne&&(Qe=new Qe(K,G+"enter",Oe,s,de),Qe.target=te,Qe.relatedTarget=Dt,fe=Qe),Dt=fe,ie&&Oe)t:{for(Qe=Xk,K=ie,G=Oe,te=0,fe=K;fe;fe=Qe(fe))te++;fe=0;for(var Ve=G;Ve;Ve=Qe(Ve))fe++;for(;0<te-fe;)K=Qe(K),te--;for(;0<fe-te;)G=Qe(G),fe--;for(;te--;){if(K===G||G!==null&&K===G.alternate){Qe=K;break t}K=Qe(K),G=Qe(G)}Qe=null}else Qe=null;ie!==null&&kg(he,re,ie,Qe,!1),Oe!==null&&Dt!==null&&kg(he,Dt,Oe,Qe,!0)}}e:{if(re=ne?Sr(ne):window,ie=re.nodeName&&re.nodeName.toLowerCase(),ie==="select"||ie==="input"&&re.type==="file")var Ct=$o;else if(Vo(re))if(Yo)Ct=Td;else{Ct=Sd;var Pe=wd}else ie=re.nodeName,!ie||ie.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ne&&as(ne.elementType)&&(Ct=$o):Ct=Cd;if(Ct&&(Ct=Ct(t,ne))){Go(he,Ct,s,de);break e}Pe&&Pe(t,re,ne),t==="focusout"&&ne&&re.type==="number"&&ne.memoizedProps.value!=null&&Tr(re,"number",re.value)}switch(Pe=ne?Sr(ne):window,t){case"focusin":(Vo(Pe)||Pe.contentEditable==="true")&&(Lr=Pe,ks=ne,Aa=null);break;case"focusout":Aa=ks=Lr=null;break;case"mousedown":js=!0;break;case"contextmenu":case"mouseup":case"dragend":js=!1,Jo(he,s,de);break;case"selectionchange":if(Ed)break;case"keydown":case"keyup":Jo(he,s,de)}var ut;if(pn)e:{switch(t){case"compositionstart":var jt="onCompositionStart";break e;case"compositionend":jt="onCompositionEnd";break e;case"compositionupdate":jt="onCompositionUpdate";break e}jt=void 0}else Or?tr(t,s)&&(jt="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(jt="onCompositionStart");jt&&(Fn&&s.locale!=="ko"&&(Or||jt!=="onCompositionStart"?jt==="onCompositionEnd"&&Or&&(ut=Po()):(En=de,Jl="value"in En?En.value:En.textContent,Or=!0)),Pe=qc(ne,jt),0<Pe.length&&(jt=new ii(jt,t,null,s,de),he.push({event:jt,listeners:Pe}),ut?jt.data=ut:(ut=wa(s),ut!==null&&(jt.data=ut)))),(ut=xs?kd(t,s):jd(t,s))&&(jt=qc(ne,"onBeforeInput"),0<jt.length&&(Pe=new ii("onBeforeInput","beforeinput",null,s,de),he.push({event:Pe,listeners:jt}),Pe.data=ut)),Gk(he,t,ne,s,de)}yg(he,n)})}function Js(t,n,s){return{instance:t,listener:n,currentTarget:s}}function qc(t,n){for(var s=n+"Capture",c=[];t!==null;){var m=t,x=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||x===null||(m=Zl(t,s),m!=null&&c.unshift(Js(t,m,x)),m=Zl(t,n),m!=null&&c.push(Js(t,m,x))),t.tag===3)return c;t=t.return}return[]}function Xk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function kg(t,n,s,c,m){for(var x=n._reactName,k=[];s!==null&&s!==c;){var S=s,U=S.alternate,ne=S.stateNode;if(S=S.tag,U!==null&&U===c)break;S!==5&&S!==26&&S!==27||ne===null||(U=ne,m?(ne=Zl(s,x),ne!=null&&k.unshift(Js(s,ne,U))):m||(ne=Zl(s,x),ne!=null&&k.push(Js(s,ne,U)))),s=s.return}k.length!==0&&t.push({event:n,listeners:k})}var Kk=/\r\n?/g,Zk=/\u0000|\uFFFD/g;function jg(t){return(typeof t=="string"?t:""+t).replace(Kk,`
|
|
9
|
-
`).replace(Zk,"")}function Ng(t,n){return n=jg(n),jg(t)===n}function Lt(t,n,s,c,m,x){switch(s){case"children":typeof c=="string"?n==="body"||n==="textarea"&&c===""||Kl(t,c):(typeof c=="number"||typeof c=="bigint")&&n!=="body"&&Kl(t,""+c);break;case"className":_l(t,"class",c);break;case"tabIndex":_l(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":_l(t,s,c);break;case"style":_o(t,c,x);break;case"data":if(n!=="object"){_l(t,"data",c);break}case"src":case"href":if(c===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=ni(""+c),t.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(s==="formAction"?(n!=="input"&&Lt(t,n,"name",m.name,m,null),Lt(t,n,"formEncType",m.formEncType,m,null),Lt(t,n,"formMethod",m.formMethod,m,null),Lt(t,n,"formTarget",m.formTarget,m,null)):(Lt(t,n,"encType",m.encType,m,null),Lt(t,n,"method",m.method,m,null),Lt(t,n,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=ni(""+c),t.setAttribute(s,c);break;case"onClick":c!=null&&(t.onclick=Nl);break;case"onScroll":c!=null&&xt("scroll",t);break;case"onScrollEnd":c!=null&&xt("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(i(60));t.innerHTML=s}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}s=ni(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""+c):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":c===!0?t.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,c):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(s,c):t.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(s):t.setAttribute(s,c);break;case"popover":xt("beforetoggle",t),xt("toggle",t),Xl(t,"popover",c);break;case"xlinkActuate":Hn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Hn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Hn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Hn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Hn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Hn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Hn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Hn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Hn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Xl(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Ju.get(s)||s,Xl(t,s,c))}}function Yf(t,n,s,c,m,x){switch(s){case"style":_o(t,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(i(60));t.innerHTML=s}}break;case"children":typeof c=="string"?Kl(t,c):(typeof c=="number"||typeof c=="bigint")&&Kl(t,""+c);break;case"onScroll":c!=null&&xt("scroll",t);break;case"onScrollEnd":c!=null&&xt("scrollend",t);break;case"onClick":c!=null&&(t.onclick=Nl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ya.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(m=s.endsWith("Capture"),n=s.slice(2,m?s.length-7:void 0),x=t[dn]||null,x=x!=null?x[s]:null,typeof x=="function"&&t.removeEventListener(n,x,m),typeof c=="function")){typeof x!="function"&&x!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(n,c,m);break e}s in t?t[s]=c:c===!0?t.setAttribute(s,""):Xl(t,s,c)}}}function Tn(t,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xt("error",t),xt("load",t);var c=!1,m=!1,x;for(x in s)if(s.hasOwnProperty(x)){var k=s[x];if(k!=null)switch(x){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Lt(t,n,x,k,s,null)}}m&&Lt(t,n,"srcSet",s.srcSet,s,null),c&&Lt(t,n,"src",s.src,s,null);return;case"input":xt("invalid",t);var S=x=k=m=null,U=null,ne=null;for(c in s)if(s.hasOwnProperty(c)){var de=s[c];if(de!=null)switch(c){case"name":m=de;break;case"type":k=de;break;case"checked":U=de;break;case"defaultChecked":ne=de;break;case"value":x=de;break;case"defaultValue":S=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(i(137,n));break;default:Lt(t,n,c,de,s,null)}}_n(t,x,S,U,ne,k,m,!1);return;case"select":xt("invalid",t),c=k=x=null;for(m in s)if(s.hasOwnProperty(m)&&(S=s[m],S!=null))switch(m){case"value":x=S;break;case"defaultValue":k=S;break;case"multiple":c=S;default:Lt(t,n,m,S,s,null)}n=x,s=k,t.multiple=!!c,n!=null?va(t,!!c,n,!1):s!=null&&va(t,!!c,s,!0);return;case"textarea":xt("invalid",t),x=m=c=null;for(k in s)if(s.hasOwnProperty(k)&&(S=s[k],S!=null))switch(k){case"value":c=S;break;case"defaultValue":m=S;break;case"children":x=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:Lt(t,n,k,S,s,null)}Do(t,c,m,x);return;case"option":for(U in s)s.hasOwnProperty(U)&&(c=s[U],c!=null)&&(U==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":Lt(t,n,U,c,s,null));return;case"dialog":xt("beforetoggle",t),xt("toggle",t),xt("cancel",t),xt("close",t);break;case"iframe":case"object":xt("load",t);break;case"video":case"audio":for(c=0;c<Ws.length;c++)xt(Ws[c],t);break;case"image":xt("error",t),xt("load",t);break;case"details":xt("toggle",t);break;case"embed":case"source":case"link":xt("error",t),xt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in s)if(s.hasOwnProperty(ne)&&(c=s[ne],c!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Lt(t,n,ne,c,s,null)}return;default:if(as(n)){for(de in s)s.hasOwnProperty(de)&&(c=s[de],c!==void 0&&Yf(t,n,de,c,s,void 0));return}}for(S in s)s.hasOwnProperty(S)&&(c=s[S],c!=null&&Lt(t,n,S,c,s,null))}function Wk(t,n,s,c){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,x=null,k=null,S=null,U=null,ne=null,de=null;for(ie in s){var he=s[ie];if(s.hasOwnProperty(ie)&&he!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":U=he;default:c.hasOwnProperty(ie)||Lt(t,n,ie,null,c,he)}}for(var re in c){var ie=c[re];if(he=s[re],c.hasOwnProperty(re)&&(ie!=null||he!=null))switch(re){case"type":x=ie;break;case"name":m=ie;break;case"checked":ne=ie;break;case"defaultChecked":de=ie;break;case"value":k=ie;break;case"defaultValue":S=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,n));break;default:ie!==he&&Lt(t,n,re,ie,c,he)}}Cr(t,k,S,U,ne,de,x,m);return;case"select":ie=k=S=re=null;for(x in s)if(U=s[x],s.hasOwnProperty(x)&&U!=null)switch(x){case"value":break;case"multiple":ie=U;default:c.hasOwnProperty(x)||Lt(t,n,x,null,c,U)}for(m in c)if(x=c[m],U=s[m],c.hasOwnProperty(m)&&(x!=null||U!=null))switch(m){case"value":re=x;break;case"defaultValue":S=x;break;case"multiple":k=x;default:x!==U&&Lt(t,n,m,x,c,U)}n=S,s=k,c=ie,re!=null?va(t,!!s,re,!1):!!c!=!!s&&(n!=null?va(t,!!s,n,!0):va(t,!!s,s?[]:"",!1));return;case"textarea":ie=re=null;for(S in s)if(m=s[S],s.hasOwnProperty(S)&&m!=null&&!c.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Lt(t,n,S,null,c,m)}for(k in c)if(m=c[k],x=s[k],c.hasOwnProperty(k)&&(m!=null||x!=null))switch(k){case"value":re=m;break;case"defaultValue":ie=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(i(91));break;default:m!==x&&Lt(t,n,k,m,c,x)}Zu(t,re,ie);return;case"option":for(var Oe in s)re=s[Oe],s.hasOwnProperty(Oe)&&re!=null&&!c.hasOwnProperty(Oe)&&(Oe==="selected"?t.selected=!1:Lt(t,n,Oe,null,c,re));for(U in c)re=c[U],ie=s[U],c.hasOwnProperty(U)&&re!==ie&&(re!=null||ie!=null)&&(U==="selected"?t.selected=re&&typeof re!="function"&&typeof re!="symbol":Lt(t,n,U,re,c,ie));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 Qe in s)re=s[Qe],s.hasOwnProperty(Qe)&&re!=null&&!c.hasOwnProperty(Qe)&&Lt(t,n,Qe,null,c,re);for(ne in c)if(re=c[ne],ie=s[ne],c.hasOwnProperty(ne)&&re!==ie&&(re!=null||ie!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(i(137,n));break;default:Lt(t,n,ne,re,c,ie)}return;default:if(as(n)){for(var Dt in s)re=s[Dt],s.hasOwnProperty(Dt)&&re!==void 0&&!c.hasOwnProperty(Dt)&&Yf(t,n,Dt,void 0,c,re);for(de in c)re=c[de],ie=s[de],!c.hasOwnProperty(de)||re===ie||re===void 0&&ie===void 0||Yf(t,n,de,re,c,ie);return}}for(var K in s)re=s[K],s.hasOwnProperty(K)&&re!=null&&!c.hasOwnProperty(K)&&Lt(t,n,K,null,c,re);for(he in c)re=c[he],ie=s[he],!c.hasOwnProperty(he)||re===ie||re==null&&ie==null||Lt(t,n,he,re,c,ie)}function wg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Jk(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var m=s[c],x=m.transferSize,k=m.initiatorType,S=m.duration;if(x&&S&&wg(k)){for(k=0,S=m.responseEnd,c+=1;c<s.length;c++){var U=s[c],ne=U.startTime;if(ne>S)break;var de=U.transferSize,he=U.initiatorType;de&&wg(he)&&(U=U.responseEnd,k+=de*(U<S?1:(S-ne)/(U-ne)))}if(--c,n+=8*(x+k)/(m.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Qf=null,Xf=null;function Vc(t){return t.nodeType===9?t:t.ownerDocument}function Sg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Cg(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Kf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Zf=null;function ej(){var t=window.event;return t&&t.type==="popstate"?t===Zf?!1:(Zf=t,!0):(Zf=null,!1)}var Tg=typeof setTimeout=="function"?setTimeout:void 0,tj=typeof clearTimeout=="function"?clearTimeout:void 0,Ag=typeof Promise=="function"?Promise:void 0,nj=typeof queueMicrotask=="function"?queueMicrotask:typeof Ag<"u"?function(t){return Ag.resolve(null).then(t).catch(lj)}:Tg;function lj(t){setTimeout(function(){throw t})}function ta(t){return t==="head"}function Eg(t,n){var s=n,c=0;do{var m=s.nextSibling;if(t.removeChild(s),m&&m.nodeType===8)if(s=m.data,s==="/$"||s==="/&"){if(c===0){t.removeChild(m),Ii(n);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")eo(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,eo(s);for(var x=s.firstChild;x;){var k=x.nextSibling,S=x.nodeName;x[Wn]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&x.rel.toLowerCase()==="stylesheet"||s.removeChild(x),x=k}}else s==="body"&&eo(t.ownerDocument.body);s=m}while(s);Ii(n)}function Rg(t,n){var s=t;t=0;do{var c=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=c}while(s)}function Wf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Wf(s),zl(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function rj(t,n,s,c){for(;t.nodeType===1;){var m=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[Wn])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==m.rel||t.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||t.getAttribute("title")!==(m.title==null?null:m.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(m.src==null?null:m.src)||t.getAttribute("type")!==(m.type==null?null:m.type)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var x=m.name==null?null:""+m.name;if(m.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=bl(t.nextSibling),t===null)break}return null}function aj(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=bl(t.nextSibling),t===null))return null;return t}function Mg(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=bl(t.nextSibling),t===null))return null;return t}function Jf(t){return t.data==="$?"||t.data==="$~"}function em(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function ij(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var c=function(){n(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function bl(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var tm=null;function zg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(n===0)return bl(t.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}t=t.nextSibling}return null}function Og(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return t;n--}else s!=="/$"&&s!=="/&"||n++}t=t.previousSibling}return null}function Lg(t,n,s){switch(n=Vc(s),t){case"html":if(t=n.documentElement,!t)throw Error(i(452));return t;case"head":if(t=n.head,!t)throw Error(i(453));return t;case"body":if(t=n.body,!t)throw Error(i(454));return t;default:throw Error(i(451))}}function eo(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);zl(t)}var yl=new Map,Dg=new Set;function Gc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var gr=Y.d;Y.d={f:sj,r:oj,D:cj,C:uj,L:dj,m:fj,X:pj,S:mj,M:hj};function sj(){var t=gr.f(),n=_c();return t||n}function oj(t){var n=Ol(t);n!==null&&n.tag===5&&n.type==="form"?Wh(n):gr.r(t)}var Di=typeof document>"u"?null:document;function _g(t,n,s){var c=Di;if(c&&typeof n=="string"&&n){var m=vn(n);m='link[rel="'+t+'"][href="'+m+'"]',typeof s=="string"&&(m+='[crossorigin="'+s+'"]'),Dg.has(m)||(Dg.add(m),t={rel:t,crossOrigin:s,href:n},c.querySelector(m)===null&&(n=c.createElement("link"),Tn(n,"link",t),Ft(n),c.head.appendChild(n)))}}function cj(t){gr.D(t),_g("dns-prefetch",t,null)}function uj(t,n){gr.C(t,n),_g("preconnect",t,n)}function dj(t,n,s){gr.L(t,n,s);var c=Di;if(c&&t&&n){var m='link[rel="preload"][as="'+vn(n)+'"]';n==="image"&&s&&s.imageSrcSet?(m+='[imagesrcset="'+vn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(m+='[imagesizes="'+vn(s.imageSizes)+'"]')):m+='[href="'+vn(t)+'"]';var x=m;switch(n){case"style":x=_i(t);break;case"script":x=Bi(t)}yl.has(x)||(t=b({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),yl.set(x,t),c.querySelector(m)!==null||n==="style"&&c.querySelector(to(x))||n==="script"&&c.querySelector(no(x))||(n=c.createElement("link"),Tn(n,"link",t),Ft(n),c.head.appendChild(n)))}}function fj(t,n){gr.m(t,n);var s=Di;if(s&&t){var c=n&&typeof n.as=="string"?n.as:"script",m='link[rel="modulepreload"][as="'+vn(c)+'"][href="'+vn(t)+'"]',x=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Bi(t)}if(!yl.has(x)&&(t=b({rel:"modulepreload",href:t},n),yl.set(x,t),s.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(no(x)))return}c=s.createElement("link"),Tn(c,"link",t),Ft(c),s.head.appendChild(c)}}}function mj(t,n,s){gr.S(t,n,s);var c=Di;if(c&&t){var m=Ll(c).hoistableStyles,x=_i(t);n=n||"default";var k=m.get(x);if(!k){var S={loading:0,preload:null};if(k=c.querySelector(to(x)))S.loading=5;else{t=b({rel:"stylesheet",href:t,"data-precedence":n},s),(s=yl.get(x))&&nm(t,s);var U=k=c.createElement("link");Ft(U),Tn(U,"link",t),U._p=new Promise(function(ne,de){U.onload=ne,U.onerror=de}),U.addEventListener("load",function(){S.loading|=1}),U.addEventListener("error",function(){S.loading|=2}),S.loading|=4,$c(k,n,c)}k={type:"stylesheet",instance:k,count:1,state:S},m.set(x,k)}}}function pj(t,n){gr.X(t,n);var s=Di;if(s&&t){var c=Ll(s).hoistableScripts,m=Bi(t),x=c.get(m);x||(x=s.querySelector(no(m)),x||(t=b({src:t,async:!0},n),(n=yl.get(m))&&lm(t,n),x=s.createElement("script"),Ft(x),Tn(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function hj(t,n){gr.M(t,n);var s=Di;if(s&&t){var c=Ll(s).hoistableScripts,m=Bi(t),x=c.get(m);x||(x=s.querySelector(no(m)),x||(t=b({src:t,async:!0,type:"module"},n),(n=yl.get(m))&&lm(t,n),x=s.createElement("script"),Ft(x),Tn(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function Bg(t,n,s,c){var m=(m=ce.current)?Gc(m):null;if(!m)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=_i(s.href),s=Ll(m).hoistableStyles,c=s.get(n),c||(c={type:"style",instance:null,count:0,state:null},s.set(n,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=_i(s.href);var x=Ll(m).hoistableStyles,k=x.get(t);if(k||(m=m.ownerDocument||m,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,k),(x=m.querySelector(to(t)))&&!x._p&&(k.instance=x,k.state.loading=5),yl.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},yl.set(t,s),x||xj(m,t,s,k.state))),n&&c===null)throw Error(i(528,""));return k}if(n&&c!==null)throw Error(i(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Bi(s),s=Ll(m).hoistableScripts,c=s.get(n),c||(c={type:"script",instance:null,count:0,state:null},s.set(n,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function _i(t){return'href="'+vn(t)+'"'}function to(t){return'link[rel="stylesheet"]['+t+"]"}function Ig(t){return b({},t,{"data-precedence":t.precedence,precedence:null})}function xj(t,n,s,c){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?c.loading=1:(n=t.createElement("link"),c.preload=n,n.addEventListener("load",function(){return c.loading|=1}),n.addEventListener("error",function(){return c.loading|=2}),Tn(n,"link",s),Ft(n),t.head.appendChild(n))}function Bi(t){return'[src="'+vn(t)+'"]'}function no(t){return"script[async]"+t}function Pg(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var c=t.querySelector('style[data-href~="'+vn(s.href)+'"]');if(c)return n.instance=c,Ft(c),c;var m=b({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),Ft(c),Tn(c,"style",m),$c(c,s.precedence,t),n.instance=c;case"stylesheet":m=_i(s.href);var x=t.querySelector(to(m));if(x)return n.state.loading|=4,n.instance=x,Ft(x),x;c=Ig(s),(m=yl.get(m))&&nm(c,m),x=(t.ownerDocument||t).createElement("link"),Ft(x);var k=x;return k._p=new Promise(function(S,U){k.onload=S,k.onerror=U}),Tn(x,"link",c),n.state.loading|=4,$c(x,s.precedence,t),n.instance=x;case"script":return x=Bi(s.src),(m=t.querySelector(no(x)))?(n.instance=m,Ft(m),m):(c=s,(m=yl.get(x))&&(c=b({},s),lm(c,m)),t=t.ownerDocument||t,m=t.createElement("script"),Ft(m),Tn(m,"link",c),t.head.appendChild(m),n.instance=m);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(c=n.instance,n.state.loading|=4,$c(c,s.precedence,t));return n.instance}function $c(t,n,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,x=m,k=0;k<c.length;k++){var S=c[k];if(S.dataset.precedence===n)x=S;else if(x!==m)break}x?x.parentNode.insertBefore(t,x.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(t,n.firstChild))}function nm(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function lm(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Yc=null;function Ug(t,n,s){if(Yc===null){var c=new Map,m=Yc=new Map;m.set(s,c)}else m=Yc,c=m.get(s),c||(c=new Map,m.set(s,c));if(c.has(t))return c;for(c.set(t,null),s=s.getElementsByTagName(t),m=0;m<s.length;m++){var x=s[m];if(!(x[Wn]||x[$t]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var k=x.getAttribute(n)||"";k=t+k;var S=c.get(k);S?S.push(x):c.set(k,[x])}}return c}function Hg(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function gj(t,n,s){if(s===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Fg(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function bj(t,n,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var m=_i(c.href),x=n.querySelector(to(m));if(x){n=x._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Qc.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=x,Ft(x);return}x=n.ownerDocument||n,c=Ig(c),(m=yl.get(m))&&nm(c,m),x=x.createElement("link"),Ft(x);var k=x;k._p=new Promise(function(S,U){k.onload=S,k.onerror=U}),Tn(x,"link",c),s.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Qc.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var rm=0;function yj(t,n){return t.stylesheets&&t.count===0&&Kc(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var c=setTimeout(function(){if(t.stylesheets&&Kc(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+n);0<t.imgBytes&&rm===0&&(rm=62500*Jk());var m=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Kc(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>rm?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function Qc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Xc=null;function Kc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Xc=new Map,n.forEach(vj,t),Xc=null,Qc.call(t))}function vj(t,n){if(!(n.state.loading&4)){var s=Xc.get(t);if(s)var c=s.get(null);else{s=new Map,Xc.set(t,s);for(var m=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<m.length;x++){var k=m[x];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(s.set(k.dataset.precedence,k),c=k)}c&&s.set(null,c)}m=n.instance,k=m.getAttribute("data-precedence"),x=s.get(k)||c,x===c&&s.set(null,m),s.set(k,m),this.count++,c=Qc.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),x?x.parentNode.insertBefore(m,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(m,t.firstChild)),n.state.loading|=4}}var lo={$$typeof:H,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function kj(t,n,s,c,m,x,k,S,U){this.tag=1,this.containerInfo=t,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=ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ze(0),this.hiddenUpdates=ze(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=x,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function qg(t,n,s,c,m,x,k,S,U,ne,de,he){return t=new kj(t,n,s,k,U,ne,de,he,S),n=1,x===!0&&(n|=24),x=Bn(3,null,null,n),t.current=x,x.stateNode=t,n=_d(),n.refCount++,t.pooledCache=n,n.refCount++,x.memoizedState={element:c,isDehydrated:s,cache:n},Ud(x),t}function Vg(t){return t?(t=Br,t):Br}function Gg(t,n,s,c,m,x){m=Vg(m),c.context===null?c.context=m:c.pendingContext=m,c=Vr(n),c.payload={element:s},x=x===void 0?null:x,x!==null&&(c.callback=x),s=Gr(t,c,n),s!==null&&(Xn(s,t,n),Ds(s,t,n))}function $g(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function am(t,n){$g(t,n),(t=t.alternate)&&$g(t,n)}function Yg(t){if(t.tag===13||t.tag===31){var n=nr(t,67108864);n!==null&&Xn(n,t,67108864),am(t,67108864)}}function Qg(t){if(t.tag===13||t.tag===31){var n=sl();n=xa(n);var s=nr(t,n);s!==null&&Xn(s,t,n),am(t,n)}}var Zc=!0;function jj(t,n,s,c){var m=N.T;N.T=null;var x=Y.p;try{Y.p=2,im(t,n,s,c)}finally{Y.p=x,N.T=m}}function Nj(t,n,s,c){var m=N.T;N.T=null;var x=Y.p;try{Y.p=8,im(t,n,s,c)}finally{Y.p=x,N.T=m}}function im(t,n,s,c){if(Zc){var m=sm(c);if(m===null)$f(t,n,c,Wc,s),Kg(t,c);else if(Sj(m,t,n,s,c))c.stopPropagation();else if(Kg(t,c),n&4&&-1<wj.indexOf(t)){for(;m!==null;){var x=Ol(m);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var k=Pt(x.pendingLanes);if(k!==0){var S=x;for(S.pendingLanes|=2,S.entangledLanes|=2;k;){var U=1<<31-je(k);S.entanglements[1]|=U,k&=~U}Pl(x),(Et&6)===0&&(Lc=Ze()+500,Zs(0))}}break;case 31:case 13:S=nr(x,2),S!==null&&Xn(S,x,2),_c(),am(x,2)}if(x=sm(c),x===null&&$f(t,n,c,Wc,s),x===m)break;m=x}m!==null&&c.stopPropagation()}else $f(t,n,c,null,s)}}function sm(t){return t=ss(t),om(t)}var Wc=null;function om(t){if(Wc=null,t=dl(t),t!==null){var n=u(t);if(n===null)t=null;else{var s=n.tag;if(s===13){if(t=d(n),t!==null)return t;t=null}else if(s===31){if(t=f(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Wc=t,null}function Xg(t){switch(t){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(mt()){case ae:return 2;case ge:return 8;case Ce:case _e:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var cm=!1,na=null,la=null,ra=null,ro=new Map,ao=new Map,aa=[],wj="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 Kg(t,n){switch(t){case"focusin":case"focusout":na=null;break;case"dragenter":case"dragleave":la=null;break;case"mouseover":case"mouseout":ra=null;break;case"pointerover":case"pointerout":ro.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":ao.delete(n.pointerId)}}function io(t,n,s,c,m,x){return t===null||t.nativeEvent!==x?(t={blockedOn:n,domEventName:s,eventSystemFlags:c,nativeEvent:x,targetContainers:[m]},n!==null&&(n=Ol(n),n!==null&&Yg(n)),t):(t.eventSystemFlags|=c,n=t.targetContainers,m!==null&&n.indexOf(m)===-1&&n.push(m),t)}function Sj(t,n,s,c,m){switch(n){case"focusin":return na=io(na,t,n,s,c,m),!0;case"dragenter":return la=io(la,t,n,s,c,m),!0;case"mouseover":return ra=io(ra,t,n,s,c,m),!0;case"pointerover":var x=m.pointerId;return ro.set(x,io(ro.get(x)||null,t,n,s,c,m)),!0;case"gotpointercapture":return x=m.pointerId,ao.set(x,io(ao.get(x)||null,t,n,s,c,m)),!0}return!1}function Zg(t){var n=dl(t.target);if(n!==null){var s=u(n);if(s!==null){if(n=s.tag,n===13){if(n=d(s),n!==null){t.blockedOn=n,ga(t.priority,function(){Qg(s)});return}}else if(n===31){if(n=f(s),n!==null){t.blockedOn=n,ga(t.priority,function(){Qg(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Jc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=sm(t.nativeEvent);if(s===null){s=t.nativeEvent;var c=new s.constructor(s.type,s);is=c,s.target.dispatchEvent(c),is=null}else return n=Ol(s),n!==null&&Yg(n),t.blockedOn=s,!1;n.shift()}return!0}function Wg(t,n,s){Jc(t)&&s.delete(n)}function Cj(){cm=!1,na!==null&&Jc(na)&&(na=null),la!==null&&Jc(la)&&(la=null),ra!==null&&Jc(ra)&&(ra=null),ro.forEach(Wg),ao.forEach(Wg)}function eu(t,n){t.blockedOn===n&&(t.blockedOn=null,cm||(cm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Cj)))}var tu=null;function Jg(t){tu!==t&&(tu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){tu===t&&(tu=null);for(var n=0;n<t.length;n+=3){var s=t[n],c=t[n+1],m=t[n+2];if(typeof c!="function"){if(om(c||s)===null)continue;break}var x=Ol(s);x!==null&&(t.splice(n,3),n-=3,sf(x,{pending:!0,data:m,method:s.method,action:c},c,m))}}))}function Ii(t){function n(U){return eu(U,t)}na!==null&&eu(na,t),la!==null&&eu(la,t),ra!==null&&eu(ra,t),ro.forEach(n),ao.forEach(n);for(var s=0;s<aa.length;s++){var c=aa[s];c.blockedOn===t&&(c.blockedOn=null)}for(;0<aa.length&&(s=aa[0],s.blockedOn===null);)Zg(s),s.blockedOn===null&&aa.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var m=s[c],x=s[c+1],k=m[dn]||null;if(typeof x=="function")k||Jg(s);else if(k){var S=null;if(x&&x.hasAttribute("formAction")){if(m=x,k=x[dn]||null)S=k.formAction;else if(om(m)!==null)continue}else S=k.action;typeof S=="function"?s[c+1]=S:(s.splice(c,3),c-=3),Jg(s)}}}function eb(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(k){return m=k})},focusReset:"manual",scroll:"manual"})}function n(){m!==null&&(m(),m=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),m!==null&&(m(),m=null)}}}function um(t){this._internalRoot=t}nu.prototype.render=um.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(i(409));var s=n.current,c=sl();Gg(s,c,t,n,null,null)},nu.prototype.unmount=um.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Gg(t.current,2,null,t,null,null),_c(),n[Ht]=null}};function nu(t){this._internalRoot=t}nu.prototype.unstable_scheduleHydration=function(t){if(t){var n=Wa();t={blockedOn:null,target:t,priority:n};for(var s=0;s<aa.length&&n!==0&&n<aa[s].priority;s++);aa.splice(s,0,t),s===0&&Zg(t)}};var tb=r.version;if(tb!=="19.2.3")throw Error(i(527,tb,"19.2.3"));Y.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=h(n),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var Tj={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lu.isDisabled&&lu.supportsFiber)try{Ee=lu.inject(Tj),V=lu}catch{}}return oo.createRoot=function(t,n){if(!o(t))throw Error(i(299));var s=!1,c="",m=ox,x=cx,k=ux;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(m=n.onUncaughtError),n.onCaughtError!==void 0&&(x=n.onCaughtError),n.onRecoverableError!==void 0&&(k=n.onRecoverableError)),n=qg(t,1,!1,null,null,s,c,null,m,x,k,eb),t[Ht]=n.current,Gf(t),new um(n)},oo.hydrateRoot=function(t,n,s){if(!o(t))throw Error(i(299));var c=!1,m="",x=ox,k=cx,S=ux,U=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(k=s.onCaughtError),s.onRecoverableError!==void 0&&(S=s.onRecoverableError),s.formState!==void 0&&(U=s.formState)),n=qg(t,1,!0,n,s??null,c,m,U,x,k,S,eb),n.context=Vg(null),s=n.current,c=sl(),c=xa(c),m=Vr(c),m.callback=null,Gr(s,m,c),s=c,n.current.lanes=s,nt(n,s),Pl(n),t[Ht]=n.current,Gf(t),new nu(n)},oo.version="19.2.3",oo}var db;function Bj(){if(db)return mm.exports;db=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),mm.exports=_j(),mm.exports}var fb=Bj(),s1=i1();const Ij=Pu(s1);function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},jo.apply(this,arguments)}var Ga;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ga||(Ga={}));const mb="popstate";function Pj(e){e===void 0&&(e={});function r(i,o){let{pathname:u,search:d,hash:f}=i.location;return Qm("",{pathname:u,search:d,hash:f},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function a(i,o){return typeof o=="string"?o:o1(o)}return Fj(r,a,null,e)}function Fl(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}function Uj(e,r){{typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Hj(){return Math.random().toString(36).substr(2,8)}function pb(e,r){return{usr:e.state,key:e.key,idx:r}}function Qm(e,r,a,i){return a===void 0&&(a=null),jo({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof r=="string"?Hu(r):r,{state:a,key:r&&r.key||i||Hj()})}function o1(e){let{pathname:r="/",search:a="",hash:i=""}=e;return a&&a!=="?"&&(r+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(r+=i.charAt(0)==="#"?i:"#"+i),r}function Hu(e){let r={};if(e){let a=e.indexOf("#");a>=0&&(r.hash=e.substr(a),e=e.substr(0,a));let i=e.indexOf("?");i>=0&&(r.search=e.substr(i),e=e.substr(0,i)),e&&(r.pathname=e)}return r}function Fj(e,r,a,i){i===void 0&&(i={});let{window:o=document.defaultView,v5Compat:u=!1}=i,d=o.history,f=Ga.Pop,p=null,h=y();h==null&&(h=0,d.replaceState(jo({},d.state,{idx:h}),""));function y(){return(d.state||{idx:null}).idx}function b(){f=Ga.Pop;let w=y(),M=w==null?null:w-h;h=w,p&&p({action:f,location:E.location,delta:M})}function v(w,M){f=Ga.Push;let D=Qm(E.location,w,M);h=y()+1;let H=pb(D,h),X=E.createHref(D);try{d.pushState(H,"",X)}catch(q){if(q instanceof DOMException&&q.name==="DataCloneError")throw q;o.location.assign(X)}u&&p&&p({action:f,location:E.location,delta:1})}function j(w,M){f=Ga.Replace;let D=Qm(E.location,w,M);h=y();let H=pb(D,h),X=E.createHref(D);d.replaceState(H,"",X),u&&p&&p({action:f,location:E.location,delta:0})}function C(w){let M=o.location.origin!=="null"?o.location.origin:o.location.href,D=typeof w=="string"?w:o1(w);return D=D.replace(/ $/,"%20"),Fl(M,"No window.location.(origin|href) available to create URL for href: "+D),new URL(D,M)}let E={get action(){return f},get location(){return e(o,d)},listen(w){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(mb,b),p=w,()=>{o.removeEventListener(mb,b),p=null}},createHref(w){return r(o,w)},createURL:C,encodeLocation(w){let M=C(w);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:v,replace:j,go(w){return d.go(w)}};return E}var hb;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(hb||(hb={}));function qj(e,r){if(r==="/")return e;if(!e.toLowerCase().startsWith(r.toLowerCase()))return null;let a=r.endsWith("/")?r.length-1:r.length,i=e.charAt(a);return i&&i!=="/"?null:e.slice(a)||"/"}const Vj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gj=e=>Vj.test(e);function $j(e,r){r===void 0&&(r="/");let{pathname:a,search:i="",hash:o=""}=typeof e=="string"?Hu(e):e,u;if(a)if(Gj(a))u=a;else{if(a.includes("//")){let d=a;a=a.replace(/\/\/+/g,"/"),Uj(!1,"Pathnames cannot have embedded double slashes - normalizing "+(d+" -> "+a))}a.startsWith("/")?u=xb(a.substring(1),"/"):u=xb(a,r)}else u=r;return{pathname:u,search:Zj(i),hash:Wj(o)}}function xb(e,r){let a=r.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function gm(e,r,a,i){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+r+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+a+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Yj(e){return e.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function Qj(e,r){let a=Yj(e);return r?a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase):a.map(i=>i.pathnameBase)}function Xj(e,r,a,i){i===void 0&&(i=!1);let o;typeof e=="string"?o=Hu(e):(o=jo({},e),Fl(!o.pathname||!o.pathname.includes("?"),gm("?","pathname","search",o)),Fl(!o.pathname||!o.pathname.includes("#"),gm("#","pathname","hash",o)),Fl(!o.search||!o.search.includes("#"),gm("#","search","hash",o)));let u=e===""||o.pathname==="",d=u?"/":o.pathname,f;if(d==null)f=a;else{let b=r.length-1;if(!i&&d.startsWith("..")){let v=d.split("/");for(;v[0]==="..";)v.shift(),b-=1;o.pathname=v.join("/")}f=b>=0?r[b]:"/"}let p=$j(o,f),h=d&&d!=="/"&&d.endsWith("/"),y=(u||d===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(h||y)&&(p.pathname+="/"),p}const Kj=e=>e.join("/").replace(/\/\/+/g,"/"),Zj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Wj=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,c1=["post","put","patch","delete"];new Set(c1);const Jj=["get",...c1];new Set(Jj);function Au(){return Au=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},Au.apply(this,arguments)}const u1=A.createContext(null),yp=A.createContext(null),vp=A.createContext(null),kp=A.createContext({outlet:null,matches:[],isDataRoute:!1});function jp(){return A.useContext(vp)!=null}function d1(){return jp()||Fl(!1),A.useContext(vp).location}function f1(e){A.useContext(yp).static||A.useLayoutEffect(e)}function eN(){let{isDataRoute:e}=A.useContext(kp);return e?aN():tN()}function tN(){jp()||Fl(!1);let e=A.useContext(u1),{basename:r,future:a,navigator:i}=A.useContext(yp),{matches:o}=A.useContext(kp),{pathname:u}=d1(),d=JSON.stringify(Qj(o,a.v7_relativeSplatPath)),f=A.useRef(!1);return f1(()=>{f.current=!0}),A.useCallback(function(h,y){if(y===void 0&&(y={}),!f.current)return;if(typeof h=="number"){i.go(h);return}let b=Xj(h,JSON.parse(d),u,y.relative==="path");e==null&&r!=="/"&&(b.pathname=b.pathname==="/"?r:Kj([r,b.pathname])),(y.replace?i.replace:i.push)(b,y.state,y)},[r,i,d,u,e])}var m1=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(m1||{}),p1=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(p1||{});function nN(e){let r=A.useContext(u1);return r||Fl(!1),r}function lN(e){let r=A.useContext(kp);return r||Fl(!1),r}function rN(e){let r=lN(),a=r.matches[r.matches.length-1];return a.route.id||Fl(!1),a.route.id}function aN(){let{router:e}=nN(m1.UseNavigateStable),r=rN(p1.UseNavigateStable),a=A.useRef(!1);return f1(()=>{a.current=!0}),A.useCallback(function(o,u){u===void 0&&(u={}),a.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Au({fromRouteId:r},u)))},[e,r])}function iN(e,r){e?.v7_startTransition,e?.v7_relativeSplatPath}function sN(e){let{basename:r="/",children:a=null,location:i,navigationType:o=Ga.Pop,navigator:u,static:d=!1,future:f}=e;jp()&&Fl(!1);let p=r.replace(/^\/*/,"/"),h=A.useMemo(()=>({basename:p,navigator:u,static:d,future:Au({v7_relativeSplatPath:!1},f)}),[p,f,u,d]);typeof i=="string"&&(i=Hu(i));let{pathname:y="/",search:b="",hash:v="",state:j=null,key:C="default"}=i,E=A.useMemo(()=>{let w=qj(y,p);return w==null?null:{location:{pathname:w,search:b,hash:v,state:j,key:C},navigationType:o}},[p,y,b,v,j,C,o]);return E==null?null:A.createElement(yp.Provider,{value:h},A.createElement(vp.Provider,{children:a,value:E}))}new Promise(()=>{});const oN="6";try{window.__reactRouterVersion=oN}catch{}const cN="startTransition",gb=Uu[cN];function uN(e){let{basename:r,children:a,future:i,window:o}=e,u=A.useRef();u.current==null&&(u.current=Pj({window:o,v5Compat:!0}));let d=u.current,[f,p]=A.useState({action:d.action,location:d.location}),{v7_startTransition:h}=i||{},y=A.useCallback(b=>{h&&gb?gb(()=>p(b)):p(b)},[p,h]);return A.useLayoutEffect(()=>d.listen(y),[d,y]),A.useEffect(()=>iN(i),[i]),A.createElement(sN,{basename:r,children:a,location:f.location,navigationType:f.action,navigator:d,future:i})}var bb;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(bb||(bb={}));var yb;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(yb||(yb={}));const h1=(...e)=>e.filter((r,a,i)=>!!r&&r.trim()!==""&&i.indexOf(r)===a).join(" ").trim();const dN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const fN=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,a,i)=>i?i.toUpperCase():a.toLowerCase());const vb=e=>{const r=fN(e);return r.charAt(0).toUpperCase()+r.slice(1)};var mN={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 pN=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1};const hN=A.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:o="",children:u,iconNode:d,...f},p)=>A.createElement("svg",{ref:p,...mN,width:r,height:r,stroke:e,strokeWidth:i?Number(a)*24/Number(r):a,className:h1("lucide",o),...!u&&!pN(f)&&{"aria-hidden":"true"},...f},[...d.map(([h,y])=>A.createElement(h,y)),...Array.isArray(u)?u:[u]]));const Ie=(e,r)=>{const a=A.forwardRef(({className:i,...o},u)=>A.createElement(hN,{ref:u,iconNode:r,className:h1(`lucide-${dN(vb(e))}`,`lucide-${e}`,i),...o}));return a.displayName=vb(e),a};const xN=[["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"}]],Xm=Ie("activity",xN);const gN=[["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"}]],bN=Ie("arrow-up-down",gN);const yN=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Np=Ie("at-sign",yN);const vN=[["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"}]],kN=Ie("bell",vN);const jN=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],x1=Ie("book-open",jN);const NN=[["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"}]],$i=Ie("bot",NN);const wN=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],SN=Ie("calendar",wN);const CN=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],Eu=Ie("check-check",CN);const TN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Yi=Ie("check",TN);const AN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ql=Ie("chevron-right",AN);const EN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],wp=Ie("circle-alert",EN);const RN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],g1=Ie("circle-check",RN);const MN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],zN=Ie("circle",MN);const ON=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Zi=Ie("clock",ON);const LN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Nr=Ie("copy",LN);const DN=[["path",{d:"M20 20v-7a4 4 0 0 0-4-4H4",key:"1nkjon"}],["path",{d:"M9 14 4 9l5-5",key:"102s5s"}]],_N=Ie("corner-up-left",DN);const BN=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],IN=Ie("database",BN);const PN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],UN=Ie("external-link",PN);const HN=[["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"}]],b1=Ie("eye",HN);const FN=[["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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],No=Ie("file-braces",FN);const qN=[["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"}]],Sp=Ie("file-text",qN);const VN=[["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"}]],da=Ie("folder-open",VN);const GN=[["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"}]],$N=Ie("funnel",GN);const YN=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],y1=Ie("git-branch",YN);const QN=[["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"}]],v1=Ie("globe",QN);const XN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],KN=Ie("grid-3x3",XN);const ZN=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],WN=Ie("hard-drive",ZN);const JN=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],e2=Ie("hash",JN);const t2=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],k1=Ie("key",t2);const n2=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],l2=Ie("laptop",n2);const r2=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Cp=Ie("layout-grid",r2);const a2=[["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"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],i2=Ie("list-todo",a2);const s2=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],j1=Ie("list",s2);const o2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],N1=Ie("loader-circle",o2);const c2=[["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"}]],Al=Ie("message-square",c2);const u2=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],d2=Ie("mic",u2);const f2=[["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"}]],w1=Ie("moon",f2);const m2=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],S1=Ie("network",m2);const p2=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],h2=Ie("palette",p2);const x2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],g2=Ie("panel-left-close",x2);const b2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],y2=Ie("panel-left-open",b2);const v2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],kb=Ie("plus",v2);const k2=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],j2=Ie("radar",k2);const N2=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Km=Ie("radio",N2);const w2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],xn=Ie("refresh-cw",w2);const S2=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],C2=Ie("reply",S2);const T2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],wo=Ie("search",T2);const A2=[["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"}]],C1=Ie("send-horizontal",A2);const E2=[["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"}]],Tp=Ie("server",E2);const R2=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],T1=Ie("settings-2",R2);const M2=[["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"}]],$a=Ie("settings",M2);const z2=[["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"}]],A1=Ie("shield",z2);const O2=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],L2=Ie("smartphone",O2);const D2=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],jb=Ie("star",D2);const _2=[["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"}]],E1=Ie("sun",_2);const B2=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],I2=Ie("tag",B2);const P2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],U2=Ie("target",P2);const H2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],go=Ie("terminal",H2);const F2=[["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"}]],q2=Ie("triangle-alert",F2);const V2=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],Nb=Ie("workflow",V2);const G2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],kl=Ie("x",G2);const $2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],R1=Ie("zap",$2);var Va=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(Va||{});const Y2=[0,1],M1=[1,0],z1=[2,3],O1=[3,2],Q2={L:Y2,M:M1,Q:z1,H:O1},X2=/^\d*$/,K2=/^[A-Z0-9 $%*+./:-]*$/,bm="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",Ap=1,Ep=40,wb=3,Z2=3,ru=40,W2=10,L1=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],D1=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class J2{constructor(r,a,i,o){if(this.version=r,this.ecc=a,r<Ap||r>Ep)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=r*4+17;const u=Array.from({length:this.size}).fill(!1);for(let f=0;f<this.size;f++)this.modules.push(u.slice()),this.types.push(u.map(()=>0));this.drawFunctionPatterns();const d=this.addEccAndInterleave(i);if(this.drawCodewords(d),o===-1){let f=1e9;for(let p=0;p<8;p++){this.applyMask(p),this.drawFormatBits(p);const h=this.getPenaltyScore();h<f&&(o=p,f=h),this.applyMask(p)}}this.mask=o,this.applyMask(o),this.drawFormatBits(o)}size;mask;modules=[];types=[];getModule(r,a){return r>=0&&r<this.size&&a>=0&&a<this.size&&this.modules[a][r]}drawFunctionPatterns(){for(let i=0;i<this.size;i++)this.setFunctionModule(6,i,i%2===0,Va.Timing),this.setFunctionModule(i,6,i%2===0,Va.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const r=this.getAlignmentPatternPositions(),a=r.length;for(let i=0;i<a;i++)for(let o=0;o<a;o++)i===0&&o===0||i===0&&o===a-1||i===a-1&&o===0||this.drawAlignmentPattern(r[i],r[o]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(r){const a=this.ecc[1]<<3|r;let i=a;for(let u=0;u<10;u++)i=i<<1^(i>>>9)*1335;const o=(a<<10|i)^21522;for(let u=0;u<=5;u++)this.setFunctionModule(8,u,br(o,u));this.setFunctionModule(8,7,br(o,6)),this.setFunctionModule(8,8,br(o,7)),this.setFunctionModule(7,8,br(o,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,br(o,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,br(o,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,br(o,u));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let r=this.version;for(let i=0;i<12;i++)r=r<<1^(r>>>11)*7973;const a=this.version<<12|r;for(let i=0;i<18;i++){const o=br(a,i),u=this.size-11+i%3,d=Math.floor(i/3);this.setFunctionModule(u,d,o),this.setFunctionModule(d,u,o)}}drawFinderPattern(r,a){for(let i=-4;i<=4;i++)for(let o=-4;o<=4;o++){const u=Math.max(Math.abs(o),Math.abs(i)),d=r+o,f=a+i;d>=0&&d<this.size&&f>=0&&f<this.size&&this.setFunctionModule(d,f,u!==2&&u!==4,Va.Position)}}drawAlignmentPattern(r,a){for(let i=-2;i<=2;i++)for(let o=-2;o<=2;o++)this.setFunctionModule(r+o,a+i,Math.max(Math.abs(o),Math.abs(i))!==1,Va.Alignment)}setFunctionModule(r,a,i,o=Va.Function){this.modules[a][r]=i,this.types[a][r]=o}addEccAndInterleave(r){const a=this.version,i=this.ecc;if(r.length!==vu(a,i))throw new RangeError("Invalid argument");const o=D1[i[0]][a],u=L1[i[0]][a],d=Math.floor(Zm(a)/8),f=o-d%o,p=Math.floor(d/o),h=[],y=ow(u);for(let v=0,j=0;v<o;v++){const C=r.slice(j,j+p-u+(v<f?0:1));j+=C.length;const E=cw(C,y);v<f&&C.push(0),h.push(C.concat(E))}const b=[];for(let v=0;v<h[0].length;v++)h.forEach((j,C)=>{(v!==p-u||C>=f)&&b.push(j[v])});return b}drawCodewords(r){if(r.length!==Math.floor(Zm(this.version)/8))throw new RangeError("Invalid argument");let a=0;for(let i=this.size-1;i>=1;i-=2){i===6&&(i=5);for(let o=0;o<this.size;o++)for(let u=0;u<2;u++){const d=i-u,p=(i+1&2)===0?this.size-1-o:o;!this.types[p][d]&&a<r.length*8&&(this.modules[p][d]=br(r[a>>>3],7-(a&7)),a++)}}}applyMask(r){if(r<0||r>7)throw new RangeError("Mask value out of range");for(let a=0;a<this.size;a++)for(let i=0;i<this.size;i++){let o;switch(r){case 0:o=(i+a)%2===0;break;case 1:o=a%2===0;break;case 2:o=i%3===0;break;case 3:o=(i+a)%3===0;break;case 4:o=(Math.floor(i/3)+Math.floor(a/2))%2===0;break;case 5:o=i*a%2+i*a%3===0;break;case 6:o=(i*a%2+i*a%3)%2===0;break;case 7:o=((i+a)%2+i*a%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[a][i]&&o&&(this.modules[a][i]=!this.modules[a][i])}}getPenaltyScore(){let r=0;for(let u=0;u<this.size;u++){let d=!1,f=0;const p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[u][h]===d?(f++,f===5?r+=wb:f>5&&r++):(this.finderPenaltyAddHistory(f,p),d||(r+=this.finderPenaltyCountPatterns(p)*ru),d=this.modules[u][h],f=1);r+=this.finderPenaltyTerminateAndCount(d,f,p)*ru}for(let u=0;u<this.size;u++){let d=!1,f=0;const p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][u]===d?(f++,f===5?r+=wb:f>5&&r++):(this.finderPenaltyAddHistory(f,p),d||(r+=this.finderPenaltyCountPatterns(p)*ru),d=this.modules[h][u],f=1);r+=this.finderPenaltyTerminateAndCount(d,f,p)*ru}for(let u=0;u<this.size-1;u++)for(let d=0;d<this.size-1;d++){const f=this.modules[u][d];f===this.modules[u][d+1]&&f===this.modules[u+1][d]&&f===this.modules[u+1][d+1]&&(r+=Z2)}let a=0;for(const u of this.modules)a=u.reduce((d,f)=>d+(f?1:0),a);const i=this.size*this.size,o=Math.ceil(Math.abs(a*20-i*10)/i)-1;return r+=o*W2,r}getAlignmentPatternPositions(){if(this.version===1)return[];{const r=Math.floor(this.version/7)+2,a=this.version===32?26:Math.ceil((this.version*4+4)/(r*2-2))*2,i=[6];for(let o=this.size-7;i.length<r;o-=a)i.splice(1,0,o);return i}}finderPenaltyCountPatterns(r){const a=r[1],i=a>0&&r[2]===a&&r[3]===a*3&&r[4]===a&&r[5]===a;return(i&&r[0]>=a*4&&r[6]>=a?1:0)+(i&&r[6]>=a*4&&r[0]>=a?1:0)}finderPenaltyTerminateAndCount(r,a,i){return r&&(this.finderPenaltyAddHistory(a,i),a=0),a+=this.size,this.finderPenaltyAddHistory(a,i),this.finderPenaltyCountPatterns(i)}finderPenaltyAddHistory(r,a){a[0]===0&&(r+=this.size),a.pop(),a.unshift(r)}}function kr(e,r,a){if(r<0||r>31||e>>>r)throw new RangeError("Value out of range");for(let i=r-1;i>=0;i--)a.push(e>>>i&1)}function br(e,r){return(e>>>r&1)!==0}class Rp{constructor(r,a,i){if(this.mode=r,this.numChars=a,this.bitData=i,a<0)throw new RangeError("Invalid argument");this.bitData=i.slice()}getData(){return this.bitData.slice()}}const ew=[1,10,12,14],tw=[2,9,11,13],nw=[4,8,16,16];function _1(e,r){return e[Math.floor((r+7)/17)+1]}function B1(e){const r=[];for(const a of e)kr(a,8,r);return new Rp(nw,e.length,r)}function lw(e){if(!I1(e))throw new RangeError("String contains non-numeric characters");const r=[];for(let a=0;a<e.length;){const i=Math.min(e.length-a,3);kr(Number.parseInt(e.substring(a,a+i),10),i*3+1,r),a+=i}return new Rp(ew,e.length,r)}function rw(e){if(!P1(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");const r=[];let a;for(a=0;a+2<=e.length;a+=2){let i=bm.indexOf(e.charAt(a))*45;i+=bm.indexOf(e.charAt(a+1)),kr(i,11,r)}return a<e.length&&kr(bm.indexOf(e.charAt(a)),6,r),new Rp(tw,e.length,r)}function aw(e){return e===""?[]:I1(e)?[lw(e)]:P1(e)?[rw(e)]:[B1(sw(e))]}function I1(e){return X2.test(e)}function P1(e){return K2.test(e)}function iw(e,r){let a=0;for(const i of e){const o=_1(i.mode,r);if(i.numChars>=1<<o)return Number.POSITIVE_INFINITY;a+=4+o+i.bitData.length}return a}function sw(e){e=encodeURI(e);const r=[];for(let a=0;a<e.length;a++)e.charAt(a)!=="%"?r.push(e.charCodeAt(a)):(r.push(Number.parseInt(e.substring(a+1,a+3),16)),a+=2);return r}function Zm(e){if(e<Ap||e>Ep)throw new RangeError("Version number out of range");let r=(16*e+128)*e+64;if(e>=2){const a=Math.floor(e/7)+2;r-=(25*a-10)*a-55,e>=7&&(r-=36)}return r}function vu(e,r){return Math.floor(Zm(e)/8)-L1[r[0]][e]*D1[r[0]][e]}function ow(e){if(e<1||e>255)throw new RangeError("Degree out of range");const r=[];for(let i=0;i<e-1;i++)r.push(0);r.push(1);let a=1;for(let i=0;i<e;i++){for(let o=0;o<r.length;o++)r[o]=Wm(r[o],a),o+1<r.length&&(r[o]^=r[o+1]);a=Wm(a,2)}return r}function cw(e,r){const a=r.map(i=>0);for(const i of e){const o=i^a.shift();a.push(0),r.forEach((u,d)=>a[d]^=Wm(u,o))}return a}function Wm(e,r){if(e>>>8||r>>>8)throw new RangeError("Byte out of range");let a=0;for(let i=7;i>=0;i--)a=a<<1^(a>>>7)*285,a^=(r>>>i&1)*e;return a}function uw(e,r,a=1,i=40,o=-1,u=!0){if(!(Ap<=a&&a<=i&&i<=Ep)||o<-1||o>7)throw new RangeError("Invalid value");let d,f;for(d=a;;d++){const b=vu(d,r)*8,v=iw(e,d);if(v<=b){f=v;break}if(d>=i)throw new RangeError("Data too long")}for(const b of[M1,z1,O1])u&&f<=vu(d,b)*8&&(r=b);const p=[];for(const b of e){kr(b.mode[0],4,p),kr(b.numChars,_1(b.mode,d),p);for(const v of b.getData())p.push(v)}const h=vu(d,r)*8;kr(0,Math.min(4,h-p.length),p),kr(0,(8-p.length%8)%8,p);for(let b=236;p.length<h;b^=253)kr(b,8,p);const y=Array.from({length:Math.ceil(p.length/8)},()=>0);return p.forEach((b,v)=>y[v>>>3]|=b<<7-(v&7)),new J2(d,r,y,o)}function dw(e,r){const{ecc:a="L",boostEcc:i=!1,minVersion:o=1,maxVersion:u=40,maskPattern:d=-1,border:f=1}=r||{},p=typeof e=="string"?aw(e):Array.isArray(e)?[B1(e)]:void 0;if(!p)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);const h=uw(p,Q2[a],o,u,d,i),y=fw({version:h.version,maskPattern:h.mask,size:h.size,data:h.modules,types:h.types},f);return r?.invert&&(y.data=y.data.map(b=>b.map(v=>!v))),r?.onEncoded?.(y),y}function fw(e,r=1){if(!r)return e;const{size:a}=e,i=a+r*2;e.size=i,e.data.forEach(u=>{for(let d=0;d<r;d++)u.unshift(!1),u.push(!1)});for(let u=0;u<r;u++)e.data.unshift(Array.from({length:i},d=>!1)),e.data.push(Array.from({length:i},d=>!1));const o=Va.Border;e.types.forEach(u=>{for(let d=0;d<r;d++)u.unshift(o),u.push(o)});for(let u=0;u<r;u++)e.types.unshift(Array.from({length:i},d=>o)),e.types.push(Array.from({length:i},d=>o));return e}function Sb(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function mw(e,r={}){const a=dw(e,r),{pixelSize:i=10,whiteColor:o="white",blackColor:u="black"}=r,d=a.size*i,f=a.size*i;let p=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${f} ${d}">`;const h=[];for(let y=0;y<a.size;y++)for(let b=0;b<a.size;b++){const v=b*i,j=y*i;a.data[y][b]&&h.push(`M${v},${j}h${i}v${i}h-${i}z`)}return p+=`<rect fill="${Sb(o)}" width="${f}" height="${d}"/>`,p+=`<path fill="${Sb(u)}" d="${h.join("")}"/>`,p+="</svg>",p}const on={border:"var(--os-border)",termBg:"var(--os-terminal-bg)",termFg:"var(--os-terminal-fg)",accent:"var(--os-accent)",accentBg:"var(--os-accent-bg)",ink:"var(--os-ink)",muted:"var(--os-muted)"};function U1({title:e,pathLabel:r,body:a,truncated:i=!1,lineCount:o,missing:u=!1,loading:d=!1,searchQuery:f="",updatedAtLabel:p,minHeight:h=240,maxHeight:y,onRevealPath:b}){const v=A.useMemo(()=>{if(!a)return"";const j=f.trim().toLowerCase();return j?a.split(`
|
|
10
|
-
`).filter(C=>C.toLowerCase().includes(j)).join(`
|
|
11
|
-
`):a},[a,f]);return l.jsxs("div",{className:"border rounded-xl overflow-hidden",style:{borderColor:on.border},children:[l.jsxs("div",{className:"px-4 h-9 border-b flex items-center justify-between gap-4",style:{borderBottomColor:on.border,backgroundColor:"var(--os-surface)"},children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-[11px] font-mono truncate",style:{color:on.ink},children:[l.jsx("span",{className:"font-semibold uppercase tracking-widest text-[9px] shrink-0",style:{color:on.muted},children:e}),r?l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:on.border},children:"·"}),b?l.jsx("button",{type:"button",className:"truncate underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:{color:on.muted},onClick:()=>b(r),children:r}):l.jsx("span",{className:"truncate",style:{color:on.muted},children:r})]}):null]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0 text-[10px] font-mono",style:{color:on.muted},children:[p?l.jsx("span",{children:p}):null,o!=null?l.jsx("span",{children:i?`${o} lines`:`${o} lines`}):null]})]}),d?l.jsx("div",{className:"flex items-center justify-center",style:{minHeight:h,backgroundColor:on.termBg},children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"flex gap-1",children:[l.jsx("span",{className:"os-thinking-dot",style:{color:on.accent}}),l.jsx("span",{className:"os-thinking-dot",style:{color:on.accent}}),l.jsx("span",{className:"os-thinking-dot",style:{color:on.accent}})]}),l.jsx("span",{className:"text-[12px]",style:{color:on.muted},children:"Loading…"})]})}):u?l.jsxs("div",{className:"flex flex-col items-center justify-center px-6 text-center",style:{minHeight:h,backgroundColor:on.termBg},children:[l.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-3",style:{backgroundColor:on.accentBg},children:l.jsx(No,{size:20,style:{color:on.accent}})}),l.jsx("div",{className:"text-[13px] font-medium mb-1",style:{color:on.ink},children:"No log file yet"}),l.jsxs("div",{className:"text-[12px] max-w-xs",style:{color:on.muted},children:[e," has not written a log yet. This will update as soon as output lands."]})]}):l.jsx("pre",{className:"overflow-auto p-4 text-[11px] leading-[1.55] whitespace-pre-wrap break-words",style:{backgroundColor:on.termBg,color:on.termFg,minHeight:h,maxHeight:y??void 0},children:v||(f.trim()?"No lines match the filter.":"(empty log)")})]})}function Cb(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function Mp(...e){return r=>{let a=!1;const i=e.map(o=>{const u=Cb(o,r);return!a&&typeof u=="function"&&(a=!0),u});if(a)return()=>{for(let o=0;o<i.length;o++){const u=i[o];typeof u=="function"?u():Cb(e[o],null)}}}}function fa(...e){return A.useCallback(Mp(...e),e)}var pw=Symbol.for("react.lazy"),Ru=Uu[" use ".trim().toString()];function hw(e){return typeof e=="object"&&e!==null&&"then"in e}function H1(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===pw&&"_payload"in e&&hw(e._payload)}function xw(e){const r=gw(e),a=A.forwardRef((i,o)=>{let{children:u,...d}=i;H1(u)&&typeof Ru=="function"&&(u=Ru(u._payload));const f=A.Children.toArray(u),p=f.find(yw);if(p){const h=p.props.children,y=f.map(b=>b===p?A.Children.count(h)>1?A.Children.only(null):A.isValidElement(h)?h.props.children:null:b);return l.jsx(r,{...d,ref:o,children:A.isValidElement(h)?A.cloneElement(h,void 0,y):null})}return l.jsx(r,{...d,ref:o,children:u})});return a.displayName=`${e}.Slot`,a}var F1=xw("Slot");function gw(e){const r=A.forwardRef((a,i)=>{let{children:o,...u}=a;if(H1(o)&&typeof Ru=="function"&&(o=Ru(o._payload)),A.isValidElement(o)){const d=kw(o),f=vw(u,o.props);return o.type!==A.Fragment&&(f.ref=i?Mp(i,d):d),A.cloneElement(o,f)}return A.Children.count(o)>1?A.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var bw=Symbol("radix.slottable");function yw(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bw}function vw(e,r){const a={...r};for(const i in r){const o=e[i],u=r[i];/^on[A-Z]/.test(i)?o&&u?a[i]=(...f)=>{const p=u(...f);return o(...f),p}:o&&(a[i]=o):i==="style"?a[i]={...o,...u}:i==="className"&&(a[i]=[o,u].filter(Boolean).join(" "))}return{...e,...a}}function kw(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function q1(e){var r,a,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(r=0;r<o;r++)e[r]&&(a=q1(e[r]))&&(i&&(i+=" "),i+=a)}else for(a in e)e[a]&&(i&&(i+=" "),i+=a);return i}function V1(){for(var e,r,a=0,i="",o=arguments.length;a<o;a++)(e=arguments[a])&&(r=q1(e))&&(i&&(i+=" "),i+=r);return i}const Tb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ab=V1,G1=(e,r)=>a=>{var i;if(r?.variants==null)return Ab(e,a?.class,a?.className);const{variants:o,defaultVariants:u}=r,d=Object.keys(o).map(h=>{const y=a?.[h],b=u?.[h];if(y===null)return null;const v=Tb(y)||Tb(b);return o[h][v]}),f=a&&Object.entries(a).reduce((h,y)=>{let[b,v]=y;return v===void 0||(h[b]=v),h},{}),p=r==null||(i=r.compoundVariants)===null||i===void 0?void 0:i.reduce((h,y)=>{let{class:b,className:v,...j}=y;return Object.entries(j).every(C=>{let[E,w]=C;return Array.isArray(w)?w.includes({...u,...f}[E]):{...u,...f}[E]===w})?[...h,b,v]:h},[]);return Ab(e,d,p,a?.class,a?.className)},jw=(e,r)=>{const a=new Array(e.length+r.length);for(let i=0;i<e.length;i++)a[i]=e[i];for(let i=0;i<r.length;i++)a[e.length+i]=r[i];return a},Nw=(e,r)=>({classGroupId:e,validator:r}),$1=(e=new Map,r=null,a)=>({nextPart:e,validators:r,classGroupId:a}),Mu="-",Eb=[],ww="arbitrary..",Sw=e=>{const r=Tw(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return Cw(d);const f=d.split(Mu),p=f[0]===""&&f.length>1?1:0;return Y1(f,p,r)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=i[d],h=a[d];return p?h?jw(h,p):p:h||Eb}return a[d]||Eb}}},Y1=(e,r,a)=>{if(e.length-r===0)return a.classGroupId;const o=e[r],u=a.nextPart.get(o);if(u){const h=Y1(e,r+1,u);if(h)return h}const d=a.validators;if(d===null)return;const f=r===0?e.join(Mu):e.slice(r).join(Mu),p=d.length;for(let h=0;h<p;h++){const y=d[h];if(y.validator(f))return y.classGroupId}},Cw=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=e.slice(1,-1),a=r.indexOf(":"),i=r.slice(0,a);return i?ww+i:void 0})(),Tw=e=>{const{theme:r,classGroups:a}=e;return Aw(a,r)},Aw=(e,r)=>{const a=$1();for(const i in e){const o=e[i];zp(o,a,i,r)}return a},zp=(e,r,a,i)=>{const o=e.length;for(let u=0;u<o;u++){const d=e[u];Ew(d,r,a,i)}},Ew=(e,r,a,i)=>{if(typeof e=="string"){Rw(e,r,a);return}if(typeof e=="function"){Mw(e,r,a,i);return}zw(e,r,a,i)},Rw=(e,r,a)=>{const i=e===""?r:Q1(r,e);i.classGroupId=a},Mw=(e,r,a,i)=>{if(Ow(e)){zp(e(i),r,a,i);return}r.validators===null&&(r.validators=[]),r.validators.push(Nw(a,e))},zw=(e,r,a,i)=>{const o=Object.entries(e),u=o.length;for(let d=0;d<u;d++){const[f,p]=o[d];zp(p,Q1(r,f),a,i)}},Q1=(e,r)=>{let a=e;const i=r.split(Mu),o=i.length;for(let u=0;u<o;u++){const d=i[u];let f=a.nextPart.get(d);f||(f=$1(),a.nextPart.set(d,f)),a=f}return a},Ow=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Lw=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,a=Object.create(null),i=Object.create(null);const o=(u,d)=>{a[u]=d,r++,r>e&&(r=0,i=a,a=Object.create(null))};return{get(u){let d=a[u];if(d!==void 0)return d;if((d=i[u])!==void 0)return o(u,d),d},set(u,d){u in a?a[u]=d:o(u,d)}}},Jm="!",Rb=":",Dw=[],Mb=(e,r,a,i,o)=>({modifiers:e,hasImportantModifier:r,baseClassName:a,maybePostfixModifierPosition:i,isExternal:o}),_w=e=>{const{prefix:r,experimentalParseClassName:a}=e;let i=o=>{const u=[];let d=0,f=0,p=0,h;const y=o.length;for(let E=0;E<y;E++){const w=o[E];if(d===0&&f===0){if(w===Rb){u.push(o.slice(p,E)),p=E+1;continue}if(w==="/"){h=E;continue}}w==="["?d++:w==="]"?d--:w==="("?f++:w===")"&&f--}const b=u.length===0?o:o.slice(p);let v=b,j=!1;b.endsWith(Jm)?(v=b.slice(0,-1),j=!0):b.startsWith(Jm)&&(v=b.slice(1),j=!0);const C=h&&h>p?h-p:void 0;return Mb(u,j,v,C)};if(r){const o=r+Rb,u=i;i=d=>d.startsWith(o)?u(d.slice(o.length)):Mb(Dw,!1,d,void 0,!0)}if(a){const o=i;i=u=>a({className:u,parseClassName:o})}return i},Bw=e=>{const r=new Map;return e.orderSensitiveModifiers.forEach((a,i)=>{r.set(a,1e6+i)}),a=>{const i=[];let o=[];for(let u=0;u<a.length;u++){const d=a[u],f=d[0]==="[",p=r.has(d);f||p?(o.length>0&&(o.sort(),i.push(...o),o=[]),i.push(d)):o.push(d)}return o.length>0&&(o.sort(),i.push(...o)),i}},Iw=e=>({cache:Lw(e.cacheSize),parseClassName:_w(e),sortModifiers:Bw(e),...Sw(e)}),Pw=/\s+/,Uw=(e,r)=>{const{parseClassName:a,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:u}=r,d=[],f=e.trim().split(Pw);let p="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:b,modifiers:v,hasImportantModifier:j,baseClassName:C,maybePostfixModifierPosition:E}=a(y);if(b){p=y+(p.length>0?" "+p:p);continue}let w=!!E,M=i(w?C.substring(0,E):C);if(!M){if(!w){p=y+(p.length>0?" "+p:p);continue}if(M=i(C),!M){p=y+(p.length>0?" "+p:p);continue}w=!1}const D=v.length===0?"":v.length===1?v[0]:u(v).join(":"),H=j?D+Jm:D,X=H+M;if(d.indexOf(X)>-1)continue;d.push(X);const q=o(M,w);for(let L=0;L<q.length;++L){const B=q[L];d.push(H+B)}p=y+(p.length>0?" "+p:p)}return p},Hw=(...e)=>{let r=0,a,i,o="";for(;r<e.length;)(a=e[r++])&&(i=X1(a))&&(o&&(o+=" "),o+=i);return o},X1=e=>{if(typeof e=="string")return e;let r,a="";for(let i=0;i<e.length;i++)e[i]&&(r=X1(e[i]))&&(a&&(a+=" "),a+=r);return a},Fw=(e,...r)=>{let a,i,o,u;const d=p=>{const h=r.reduce((y,b)=>b(y),e());return a=Iw(h),i=a.cache.get,o=a.cache.set,u=f,f(p)},f=p=>{const h=i(p);if(h)return h;const y=Uw(p,a);return o(p,y),y};return u=d,(...p)=>u(Hw(...p))},qw=[],mn=e=>{const r=a=>a[e]||qw;return r.isThemeGetter=!0,r},K1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Z1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Vw=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Gw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$w=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Yw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Xw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sa=e=>Vw.test(e),pt=e=>!!e&&!Number.isNaN(Number(e)),oa=e=>!!e&&Number.isInteger(Number(e)),ym=e=>e.endsWith("%")&&pt(e.slice(0,-1)),yr=e=>Gw.test(e),W1=()=>!0,Kw=e=>$w.test(e)&&!Yw.test(e),Op=()=>!1,Zw=e=>Qw.test(e),Ww=e=>Xw.test(e),Jw=e=>!De(e)&&!Be(e),eS=e=>ma(e,tv,Op),De=e=>K1.test(e),Fa=e=>ma(e,nv,Kw),zb=e=>ma(e,oS,pt),tS=e=>ma(e,rv,W1),nS=e=>ma(e,lv,Op),Ob=e=>ma(e,J1,Op),lS=e=>ma(e,ev,Ww),au=e=>ma(e,av,Zw),Be=e=>Z1.test(e),co=e=>Xa(e,nv),rS=e=>Xa(e,lv),Lb=e=>Xa(e,J1),aS=e=>Xa(e,tv),iS=e=>Xa(e,ev),iu=e=>Xa(e,av,!0),sS=e=>Xa(e,rv,!0),ma=(e,r,a)=>{const i=K1.exec(e);return i?i[1]?r(i[1]):a(i[2]):!1},Xa=(e,r,a=!1)=>{const i=Z1.exec(e);return i?i[1]?r(i[1]):a:!1},J1=e=>e==="position"||e==="percentage",ev=e=>e==="image"||e==="url",tv=e=>e==="length"||e==="size"||e==="bg-size",nv=e=>e==="length",oS=e=>e==="number",lv=e=>e==="family-name",rv=e=>e==="number"||e==="weight",av=e=>e==="shadow",cS=()=>{const e=mn("color"),r=mn("font"),a=mn("text"),i=mn("font-weight"),o=mn("tracking"),u=mn("leading"),d=mn("breakpoint"),f=mn("container"),p=mn("spacing"),h=mn("radius"),y=mn("shadow"),b=mn("inset-shadow"),v=mn("text-shadow"),j=mn("drop-shadow"),C=mn("blur"),E=mn("perspective"),w=mn("aspect"),M=mn("ease"),D=mn("animate"),H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],q=()=>[...X(),Be,De],L=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],F=()=>[Be,De,p],Z=()=>[sa,"full","auto",...F()],O=()=>[oa,"none","subgrid",Be,De],P=()=>["auto",{span:["full",oa,Be,De]},oa,Be,De],Q=()=>[oa,"auto",Be,De],oe=()=>["auto","min","max","fr",Be,De],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...F()],Y=()=>[sa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],$=()=>[sa,"screen","full","dvw","lvw","svw","min","max","fit",...F()],ye=()=>[sa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],T=()=>[e,Be,De],_=()=>[...X(),Lb,Ob,{position:[Be,De]}],le=()=>["no-repeat",{repeat:["","x","y","space","round"]}],R=()=>["auto","cover","contain",aS,eS,{size:[Be,De]}],pe=()=>[ym,co,Fa],xe=()=>["","none","full",h,Be,De],ce=()=>["",pt,co,Fa],Re=()=>["solid","dashed","dotted","double"],Te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ne=()=>[pt,ym,Lb,Ob],He=()=>["","none",C,Be,De],Le=()=>["none",pt,Be,De],Ue=()=>["none",pt,Be,De],it=()=>[pt,Be,De],tt=()=>[sa,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yr],breakpoint:[yr],color:[W1],container:[yr],"drop-shadow":[yr],ease:["in","out","in-out"],font:[Jw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yr],shadow:[yr],spacing:["px",pt],text:[yr],"text-shadow":[yr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sa,De,Be,w]}],container:["container"],columns:[{columns:[pt,De,Be,f]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:q()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[oa,"auto",Be,De]}],basis:[{basis:[sa,"full","auto",f,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pt,sa,"auto","initial","none",De]}],grow:[{grow:["",pt,Be,De]}],shrink:[{shrink:["",pt,Be,De]}],order:[{order:[oa,"first","last","none",Be,De]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":oe()}],"auto-rows":[{"auto-rows":oe()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pbs:[{pbs:F()}],pbe:[{pbe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...ye()]}],"min-block-size":[{"min-block":["auto",...ye()]}],"max-block-size":[{"max-block":["none",...ye()]}],w:[{w:[f,"screen",...Y()]}],"min-w":[{"min-w":[f,"screen","none",...Y()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",a,co,Fa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,sS,tS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ym,De]}],"font-family":[{font:[rS,nS,r]}],"font-features":[{"font-features":[De]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Be,De]}],"line-clamp":[{"line-clamp":[pt,"none",Be,zb]}],leading:[{leading:[u,...F()]}],"list-image":[{"list-image":["none",Be,De]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,De]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Re(),"wavy"]}],"text-decoration-thickness":[{decoration:[pt,"from-font","auto",Be,Fa]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[pt,"auto",Be,De]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,De]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Be,De]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},oa,Be,De],radial:["",Be,De],conic:[oa,Be,De]},iS,lS]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:pe()}],"gradient-via-pos":[{via:pe()}],"gradient-to-pos":[{to:pe()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:xe()}],"rounded-s":[{"rounded-s":xe()}],"rounded-e":[{"rounded-e":xe()}],"rounded-t":[{"rounded-t":xe()}],"rounded-r":[{"rounded-r":xe()}],"rounded-b":[{"rounded-b":xe()}],"rounded-l":[{"rounded-l":xe()}],"rounded-ss":[{"rounded-ss":xe()}],"rounded-se":[{"rounded-se":xe()}],"rounded-ee":[{"rounded-ee":xe()}],"rounded-es":[{"rounded-es":xe()}],"rounded-tl":[{"rounded-tl":xe()}],"rounded-tr":[{"rounded-tr":xe()}],"rounded-br":[{"rounded-br":xe()}],"rounded-bl":[{"rounded-bl":xe()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Re(),"hidden","none"]}],"divide-style":[{divide:[...Re(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...Re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pt,Be,De]}],"outline-w":[{outline:["",pt,co,Fa]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",y,iu,au]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",b,iu,au]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[pt,Fa]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",v,iu,au]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[pt,Be,De]}],"mix-blend":[{"mix-blend":[...Te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[pt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ne()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":Ne()}],"mask-image-t-to-pos":[{"mask-t-to":Ne()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":Ne()}],"mask-image-r-to-pos":[{"mask-r-to":Ne()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":Ne()}],"mask-image-b-to-pos":[{"mask-b-to":Ne()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":Ne()}],"mask-image-l-to-pos":[{"mask-l-to":Ne()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":Ne()}],"mask-image-x-to-pos":[{"mask-x-to":Ne()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":Ne()}],"mask-image-y-to-pos":[{"mask-y-to":Ne()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[Be,De]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ne()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":X()}],"mask-image-conic-pos":[{"mask-conic":[pt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ne()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Be,De]}],filter:[{filter:["","none",Be,De]}],blur:[{blur:He()}],brightness:[{brightness:[pt,Be,De]}],contrast:[{contrast:[pt,Be,De]}],"drop-shadow":[{"drop-shadow":["","none",j,iu,au]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",pt,Be,De]}],"hue-rotate":[{"hue-rotate":[pt,Be,De]}],invert:[{invert:["",pt,Be,De]}],saturate:[{saturate:[pt,Be,De]}],sepia:[{sepia:["",pt,Be,De]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,De]}],"backdrop-blur":[{"backdrop-blur":He()}],"backdrop-brightness":[{"backdrop-brightness":[pt,Be,De]}],"backdrop-contrast":[{"backdrop-contrast":[pt,Be,De]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pt,Be,De]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pt,Be,De]}],"backdrop-invert":[{"backdrop-invert":["",pt,Be,De]}],"backdrop-opacity":[{"backdrop-opacity":[pt,Be,De]}],"backdrop-saturate":[{"backdrop-saturate":[pt,Be,De]}],"backdrop-sepia":[{"backdrop-sepia":["",pt,Be,De]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,De]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pt,"initial",Be,De]}],ease:[{ease:["linear","initial",M,Be,De]}],delay:[{delay:[pt,Be,De]}],animate:[{animate:["none",D,Be,De]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,Be,De]}],"perspective-origin":[{"perspective-origin":q()}],rotate:[{rotate:Le()}],"rotate-x":[{"rotate-x":Le()}],"rotate-y":[{"rotate-y":Le()}],"rotate-z":[{"rotate-z":Le()}],scale:[{scale:Ue()}],"scale-x":[{"scale-x":Ue()}],"scale-y":[{"scale-y":Ue()}],"scale-z":[{"scale-z":Ue()}],"scale-3d":["scale-3d"],skew:[{skew:it()}],"skew-x":[{"skew-x":it()}],"skew-y":[{"skew-y":it()}],transform:[{transform:[Be,De,"","none","gpu","cpu"]}],"transform-origin":[{origin:q()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:tt()}],"translate-x":[{"translate-x":tt()}],"translate-y":[{"translate-y":tt()}],"translate-z":[{"translate-z":tt()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Be,De]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mbs":[{"scroll-mbs":F()}],"scroll-mbe":[{"scroll-mbe":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pbs":[{"scroll-pbs":F()}],"scroll-pbe":[{"scroll-pbe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Be,De]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[pt,co,Fa,zb]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},uS=Fw(cS);function An(...e){return uS(V1(e))}const dS=G1("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Nt({className:e,variant:r,size:a,asChild:i=!1,...o}){const u=i?F1:"button";return l.jsx(u,{"data-slot":"button",className:An(dS({variant:r,size:a,className:e})),...o})}function jr(e,r,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return r?.(o)}}function fS(e,r){const a=A.createContext(r),i=u=>{const{children:d,...f}=u,p=A.useMemo(()=>f,Object.values(f));return l.jsx(a.Provider,{value:p,children:d})};i.displayName=e+"Provider";function o(u){const d=A.useContext(a);if(d)return d;if(r!==void 0)return r;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[i,o]}function iv(e,r=[]){let a=[];function i(u,d){const f=A.createContext(d),p=a.length;a=[...a,d];const h=b=>{const{scope:v,children:j,...C}=b,E=v?.[e]?.[p]||f,w=A.useMemo(()=>C,Object.values(C));return l.jsx(E.Provider,{value:w,children:j})};h.displayName=u+"Provider";function y(b,v){const j=v?.[e]?.[p]||f,C=A.useContext(j);if(C)return C;if(d!==void 0)return d;throw new Error(`\`${b}\` must be used within \`${u}\``)}return[h,y]}const o=()=>{const u=a.map(d=>A.createContext(d));return function(f){const p=f?.[e]||u;return A.useMemo(()=>({[`__scope${e}`]:{...f,[e]:p}}),[f,p])}};return o.scopeName=e,[i,mS(o,...r)]}function mS(...e){const r=e[0];if(e.length===1)return r;const a=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const d=i.reduce((f,{useScope:p,scopeName:h})=>{const b=p(u)[`__scope${h}`];return{...f,...b}},{});return A.useMemo(()=>({[`__scope${r.scopeName}`]:d}),[d])}};return a.scopeName=r.scopeName,a}var Wi=globalThis?.document?A.useLayoutEffect:()=>{},pS=Uu[" useInsertionEffect ".trim().toString()]||Wi;function sv({prop:e,defaultProp:r,onChange:a=()=>{},caller:i}){const[o,u,d]=hS({defaultProp:r,onChange:a}),f=e!==void 0,p=f?e:o;{const y=A.useRef(e!==void 0);A.useEffect(()=>{const b=y.current;b!==f&&console.warn(`${i} is changing from ${b?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,i])}const h=A.useCallback(y=>{if(f){const b=xS(y)?y(e):y;b!==e&&d.current?.(b)}else u(y)},[f,e,u,d]);return[p,h]}function hS({defaultProp:e,onChange:r}){const[a,i]=A.useState(e),o=A.useRef(a),u=A.useRef(r);return pS(()=>{u.current=r},[r]),A.useEffect(()=>{o.current!==a&&(u.current?.(a),o.current=a)},[a,o]),[a,i,u]}function xS(e){return typeof e=="function"}function ov(e){const r=gS(e),a=A.forwardRef((i,o)=>{const{children:u,...d}=i,f=A.Children.toArray(u),p=f.find(yS);if(p){const h=p.props.children,y=f.map(b=>b===p?A.Children.count(h)>1?A.Children.only(null):A.isValidElement(h)?h.props.children:null:b);return l.jsx(r,{...d,ref:o,children:A.isValidElement(h)?A.cloneElement(h,void 0,y):null})}return l.jsx(r,{...d,ref:o,children:u})});return a.displayName=`${e}.Slot`,a}function gS(e){const r=A.forwardRef((a,i)=>{const{children:o,...u}=a;if(A.isValidElement(o)){const d=kS(o),f=vS(u,o.props);return o.type!==A.Fragment&&(f.ref=i?Mp(i,d):d),A.cloneElement(o,f)}return A.Children.count(o)>1?A.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var bS=Symbol("radix.slottable");function yS(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bS}function vS(e,r){const a={...r};for(const i in r){const o=e[i],u=r[i];/^on[A-Z]/.test(i)?o&&u?a[i]=(...f)=>{const p=u(...f);return o(...f),p}:o&&(a[i]=o):i==="style"?a[i]={...o,...u}:i==="className"&&(a[i]=[o,u].filter(Boolean).join(" "))}return{...e,...a}}function kS(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var jS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],jl=jS.reduce((e,r)=>{const a=ov(`Primitive.${r}`),i=A.forwardRef((o,u)=>{const{asChild:d,...f}=o,p=d?a:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(p,{...f,ref:u})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{});function NS(e,r){e&&s1.flushSync(()=>e.dispatchEvent(r))}function wS(e,r){return A.useReducer((a,i)=>r[a][i]??a,e)}var Eo=e=>{const{present:r,children:a}=e,i=SS(r),o=typeof a=="function"?a({present:i.isPresent}):A.Children.only(a),u=fa(i.ref,CS(o));return typeof a=="function"||i.isPresent?A.cloneElement(o,{ref:u}):null};Eo.displayName="Presence";function SS(e){const[r,a]=A.useState(),i=A.useRef(null),o=A.useRef(e),u=A.useRef("none"),d=e?"mounted":"unmounted",[f,p]=wS(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const h=su(i.current);u.current=f==="mounted"?h:"none"},[f]),Wi(()=>{const h=i.current,y=o.current;if(y!==e){const v=u.current,j=su(h);e?p("MOUNT"):j==="none"||h?.display==="none"?p("UNMOUNT"):p(y&&v!==j?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,p]),Wi(()=>{if(r){let h;const y=r.ownerDocument.defaultView??window,b=j=>{const E=su(i.current).includes(CSS.escape(j.animationName));if(j.target===r&&E&&(p("ANIMATION_END"),!o.current)){const w=r.style.animationFillMode;r.style.animationFillMode="forwards",h=y.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=w)})}},v=j=>{j.target===r&&(u.current=su(i.current))};return r.addEventListener("animationstart",v),r.addEventListener("animationcancel",b),r.addEventListener("animationend",b),()=>{y.clearTimeout(h),r.removeEventListener("animationstart",v),r.removeEventListener("animationcancel",b),r.removeEventListener("animationend",b)}}else p("ANIMATION_END")},[r,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:A.useCallback(h=>{i.current=h?getComputedStyle(h):null,a(h)},[])}}function su(e){return e?.animationName||"none"}function CS(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var TS=Uu[" useId ".trim().toString()]||(()=>{}),AS=0;function ku(e){const[r,a]=A.useState(TS());return Wi(()=>{a(i=>i??String(AS++))},[e]),e||(r?`radix-${r}`:"")}var Fu="Collapsible",[ES]=iv(Fu),[RS,Lp]=ES(Fu),cv=A.forwardRef((e,r)=>{const{__scopeCollapsible:a,open:i,defaultOpen:o,disabled:u,onOpenChange:d,...f}=e,[p,h]=sv({prop:i,defaultProp:o??!1,onChange:d,caller:Fu});return l.jsx(RS,{scope:a,disabled:u,contentId:ku(),open:p,onOpenToggle:A.useCallback(()=>h(y=>!y),[h]),children:l.jsx(jl.div,{"data-state":_p(p),"data-disabled":u?"":void 0,...f,ref:r})})});cv.displayName=Fu;var uv="CollapsibleTrigger",dv=A.forwardRef((e,r)=>{const{__scopeCollapsible:a,...i}=e,o=Lp(uv,a);return l.jsx(jl.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":_p(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...i,ref:r,onClick:jr(e.onClick,o.onOpenToggle)})});dv.displayName=uv;var Dp="CollapsibleContent",fv=A.forwardRef((e,r)=>{const{forceMount:a,...i}=e,o=Lp(Dp,e.__scopeCollapsible);return l.jsx(Eo,{present:a||o.open,children:({present:u})=>l.jsx(MS,{...i,ref:r,present:u})})});fv.displayName=Dp;var MS=A.forwardRef((e,r)=>{const{__scopeCollapsible:a,present:i,children:o,...u}=e,d=Lp(Dp,a),[f,p]=A.useState(i),h=A.useRef(null),y=fa(r,h),b=A.useRef(0),v=b.current,j=A.useRef(0),C=j.current,E=d.open||f,w=A.useRef(E),M=A.useRef(void 0);return A.useEffect(()=>{const D=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(D)},[]),Wi(()=>{const D=h.current;if(D){M.current=M.current||{transitionDuration:D.style.transitionDuration,animationName:D.style.animationName},D.style.transitionDuration="0s",D.style.animationName="none";const H=D.getBoundingClientRect();b.current=H.height,j.current=H.width,w.current||(D.style.transitionDuration=M.current.transitionDuration,D.style.animationName=M.current.animationName),p(i)}},[d.open,i]),l.jsx(jl.div,{"data-state":_p(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!E,...u,ref:y,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...e.style},children:E&&o})});function _p(e){return e?"open":"closed"}var zS=cv;function ju({...e}){return l.jsx(zS,{"data-slot":"collapsible",...e})}function Nu({...e}){return l.jsx(dv,{"data-slot":"collapsible-trigger",...e})}function wu({...e}){return l.jsx(fv,{"data-slot":"collapsible-content",...e})}const Db=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function un({className:e,fps:r=12,...a}){const[i,o]=A.useState(0);return A.useEffect(()=>{const u=setInterval(()=>{o(d=>(d+1)%Db.length)},1e3/r);return()=>clearInterval(u)},[r]),l.jsx("span",{role:"status","aria-label":"Loading",className:An("inline-block font-mono",e),...a,children:Db[i]})}const g={bg:"var(--os-bg)",surface:"var(--os-surface)",border:"var(--os-border)",ink:"var(--os-ink)",muted:"var(--os-muted)",accent:"var(--os-accent)",accentBg:"var(--os-accent-bg)",accentBorder:"var(--os-accent-border)",tagBg:"var(--os-tag-bg)",logoBg:"var(--os-logo-bg)",logoBorder:"var(--os-logo-border)",termBg:"var(--os-terminal-bg)",termFg:"var(--os-terminal-fg)",markBg:"var(--os-mark-bg)",markFg:"var(--os-mark-fg)",radiusXs:"var(--os-radius-xs)",radiusSm:"var(--os-radius-sm)",radiusMd:"var(--os-radius-md)",radiusLg:"var(--os-radius-lg)",radiusXl:"var(--os-radius-xl)",shadowXs:"var(--os-shadow-xs)",shadowSm:"var(--os-shadow-sm)",shadowMd:"var(--os-shadow-md)",shadowLg:"var(--os-shadow-lg)"};function OS({pairingControlPending:e,pairingApprovalPendingId:r,pairingConfigFeedback:a,pairingConfigPending:i,pairingError:o,pairingLoading:u,pairingState:d,onControlPairing:f,onDecideApproval:p,onOpenFeedback:h,onOpenFullLogs:y,onUpdateConfig:b,onRefresh:v,onRevealPath:j}){const[C,E]=A.useState(null),[w,M]=A.useState(""),[D,H]=A.useState(""),[X,q]=A.useState(!1),[L,B]=A.useState(!1),[F,Z]=A.useState(()=>Date.now()),[O,P]=A.useState(!1),[Q,oe]=A.useState(!1),[J,ee]=A.useState(!1),N=A.useRef(null),Y=A.useRef(null),$=A.useMemo(()=>{const we=d?.pairing?.qrValue;return we?mw(we,{border:2,ecc:"M",pixelSize:O?12:6,blackColor:"#111111",whiteColor:"#ffffff"}):null},[d?.pairing?.qrValue,O]),ye=d?.pairing?Math.max(0,Math.floor((d.pairing.expiresAt-F)/1e3)):null,T=!!d?.isRunning,_=d?.trustedPeers??[],le=d?.pendingApprovals??[],R=_.find(we=>we.fingerprint===d?.connectedPeerFingerprint)??null,pe=d?.status==="paired"&&!!d?.connectedPeerFingerprint,xe=d?.pairing?.relay??d?.relay??null,ce=d?.status==="paired"||d?.status==="connected"||d?.status==="connecting"?{label:"Relay Active",backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:d?.status==="error"||d?.status==="closed"?{label:"Attention",backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#be123c"}:{label:"Ready",backgroundColor:"#eff6ff",borderColor:"#bfdbfe",color:"#1d4ed8"},Re=d?.status==="paired"?{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:d?.status==="error"||d?.status==="closed"?{backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#be123c"}:{backgroundColor:"#eff6ff",borderColor:"#bfdbfe",color:"#1d4ed8"},Te={backgroundColor:"#ffffff",borderColor:"rgba(15, 23, 42, 0.08)",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.04)"},Ne={backgroundColor:"#f7f8fb",borderColor:"rgba(15, 23, 42, 0.08)"},He={backgroundColor:"#fbfbfd",borderColor:"rgba(15, 23, 42, 0.06)"},Le=d?.commandLabel??"scout pair",Ue=pe?"Device Connected":d?.pairing?"Pairing Ready":d?.status==="error"||d?.status==="closed"?d.statusLabel:T?d?.statusLabel??"Running":"Ready to Start",it=o??(pe?`${vm(R)} is connected through the pairing relay.`:null)??d?.statusDetail??"Start Pairing to launch a local pairing relay, generate a fresh QR code, and wait for your phone to connect.",tt=[["Expires In",ye!==null?_b(ye):"—"],["Secure Mode",d?.secure?"Yes":"No"],["Active Sessions",`${d?.sessionCount??0}`],["Trusted Peers",`${d?.trustedPeerCount??0}`],["Last Updated",d?.lastUpdatedLabel??"—"]],st=[["Relay",xe??"Not set"],["Client ID",d?.identityFingerprint??"Not created"],["Room",d?.pairing?.room??"Pending"],["Connected Device",pe?vm(R):"None"]],ot=l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[10px] font-medium",style:ce,children:[l.jsx("span",{className:`block h-1.5 w-1.5 rounded-full ${T?"bg-emerald-500":d?.status==="error"?"bg-rose-500":"bg-zinc-400"}`}),ce.label]}),l.jsx("button",{type:"button",onClick:h,className:"text-[12px] font-medium transition-opacity hover:opacity-70",style:{color:g.muted},children:"Feedback"}),l.jsx("button",{type:"button",onClick:()=>{ee(!0),window.setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth",block:"start"})},0)},className:"text-[12px] font-medium transition-opacity hover:opacity-70",style:{color:g.muted},children:"Logs"}),l.jsx("button",{type:"button",onClick:()=>{oe(!0),window.setTimeout(()=>{Y.current?.scrollIntoView({behavior:"smooth",block:"start"})},0)},className:"text-[12px] font-medium transition-opacity hover:opacity-70",style:{color:g.muted},children:"Advanced"})]}),bt=z.useCallback(async(we,et)=>{try{await navigator.clipboard.writeText(et),E(we),window.setTimeout(()=>{E(Se=>Se===we?null:Se)},1200)}catch{E(null)}},[]),Ye=z.useCallback(async()=>{try{await b({relay:w,workspaceRoot:D||null}),B(!1),q(!1)}catch{}},[b,w,D]);A.useEffect(()=>{L||(M(d?.configuredRelay??""),H(d?.workspaceRoot??""))},[L,d?.configuredRelay,d?.workspaceRoot]);const Ge=A.useRef(f);A.useEffect(()=>{Ge.current=f},[f]);const We=A.useRef(!1);return A.useEffect(()=>{if(!d?.pairing?.expiresAt)return;We.current=!1,Z(Date.now());const we=window.setInterval(()=>{const et=Date.now();Z(et),!We.current&&et>=d.pairing.expiresAt&&(We.current=!0,Ge.current("restart"))},1e3);return()=>{window.clearInterval(we)}},[d?.pairing?.expiresAt]),l.jsx("div",{className:"flex flex-1 overflow-hidden os-fade-in",style:{backgroundColor:g.bg},children:l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsx("div",{className:"px-8 py-10",style:{backgroundColor:"#FAFAFA"},children:l.jsxs("div",{className:"mx-auto flex max-w-[980px] flex-col gap-8",children:[l.jsxs("div",{className:"sticky top-0 z-10 -mx-8 flex items-center justify-between gap-6 border-b px-8 py-4 backdrop-blur",style:{borderBottomColor:g.border,backgroundColor:"rgba(250,250,250,0.92)"},children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg",style:{backgroundColor:"#4f46e5",color:"#ffffff"},children:l.jsx(Xm,{size:15,strokeWidth:1.6})}),l.jsx("div",{className:"text-[18px] font-medium tracking-tight",style:{color:g.ink},children:"Pairing Relay"})]}),l.jsx("div",{className:"flex items-center gap-4",children:ot})]}),l.jsxs("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1.45fr)_320px] items-start",children:[l.jsxs("div",{className:"flex flex-col gap-5",children:[l.jsxs("section",{className:"rounded-[20px] border p-5",style:Te,children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:"inline-flex items-center gap-2 text-[17px] font-medium tracking-tight",style:{color:g.ink},children:[l.jsx(Tp,{size:15,style:{color:"#9ca3af"},strokeWidth:1.5}),"Pairing Status"]}),l.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-[11px] font-normal uppercase tracking-wide",style:Re,children:[!T&&(d?.status==="error"||d?.status==="closed")?l.jsx(wp,{size:13,strokeWidth:1.5}):null,Ue]})]}),l.jsx("p",{className:"mt-3 text-[15px] leading-[1.75] font-light",style:{color:g.muted},children:it}),d?.statusDetail&&(d.status==="error"||d.status==="closed")?l.jsx("div",{className:"mt-4 rounded-2xl border px-4 py-3 text-[12px] leading-[1.7] font-mono whitespace-pre-wrap break-words",style:{backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#9f1239"},children:d.statusDetail}):null]}),l.jsxs(Nt,{type:"button",variant:"outline",size:"sm",onClick:v,disabled:e||u,children:[l.jsx(xn,{size:14}),"Refresh"]})]}),l.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-5",children:tt.map(([we,et])=>l.jsxs("div",{className:"rounded-2xl border px-3 py-3",style:Ne,children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-[0.16em]",style:{color:g.muted},children:we}),l.jsx("div",{className:"mt-2 text-[14px] font-medium tracking-tight",style:{color:g.ink},children:et})]},we))})]}),l.jsxs("section",{className:"rounded-[20px] border p-5",style:Te,children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[15px] font-medium tracking-tight",style:{color:g.ink},children:"Bridge Details"}),l.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:g.muted},children:"Relay identity, room state, workspace binding, and control actions."})]}),l.jsxs(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>{oe(!0),window.setTimeout(()=>{Y.current?.scrollIntoView({behavior:"smooth",block:"start"})},0)},children:[l.jsx($a,{size:14}),"Advanced"]})]}),l.jsxs("div",{className:"mt-4 overflow-hidden rounded-xl border",style:He,children:[st.map(([we,et],Se)=>l.jsxs("div",{className:"grid gap-2 px-3 py-2.5 md:grid-cols-[112px_minmax(0,1fr)] md:items-start",style:Se===0?void 0:{borderTop:`1px solid ${g.border}`},children:[l.jsxs("div",{className:"text-[9px] font-mono uppercase tracking-[0.16em]",style:{color:g.muted},children:[we,":"]}),l.jsx("div",{className:"text-[12px] leading-[1.5] break-words",style:{color:g.ink},children:et})]},we)),l.jsxs("div",{className:"grid gap-2 px-3 py-2.5 md:grid-cols-[112px_minmax(0,1fr)_auto] md:items-center",style:{borderTop:`1px solid ${g.border}`},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-[0.16em]",style:{color:g.muted},children:"Workspace:"}),X?l.jsx("input",{type:"text",value:D,onChange:we=>{H(we.target.value),B(!0)},placeholder:"/Users/arach/dev/openscout",className:"w-full rounded-lg border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):l.jsx("div",{className:"text-[12px] leading-[1.5] break-words",style:{color:g.ink},children:d?.workspaceRoot||"Not set"}),l.jsx("div",{className:"flex items-center gap-2 md:justify-end",children:X?l.jsxs(l.Fragment,{children:[l.jsx(Nt,{type:"button",size:"sm",onClick:()=>{Ye()},disabled:i,children:"Save"}),l.jsx(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>{H(d?.workspaceRoot??""),B(!1),q(!1)},disabled:i,children:"Cancel"})]}):l.jsx("button",{type:"button",onClick:()=>{H(d?.workspaceRoot??""),q(!0)},className:"text-[12px] font-medium transition-opacity hover:opacity-70",style:{color:g.muted},children:"[edit]"})})]}),a?l.jsx("div",{className:"px-4 py-3 text-[11px] leading-[1.6]",style:{borderTop:`1px solid ${g.border}`,color:g.ink},children:a}):null]}),l.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-2",children:[l.jsx(Nt,{type:"button",size:"sm",onClick:()=>f(T?"stop":"start"),disabled:e,children:T?"Stop Pairing":"Start Pairing"}),T?l.jsx(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>f("restart"),disabled:e,children:"Restart"}):null]})]}),l.jsxs("section",{className:"rounded-[20px] border p-5",style:Te,children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[15px] font-medium tracking-tight",style:{color:g.ink},children:"Pending Approvals"}),l.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:g.muted},children:"One normalized approval queue for any pairing adapter that can pause and wait."})]}),l.jsxs("span",{className:"rounded-full border px-2.5 py-1 text-[10px] font-medium whitespace-nowrap",style:le.length>0?{backgroundColor:"#fff7ed",borderColor:"#fed7aa",color:"#c2410c"}:{backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"},children:[le.length," queued"]})]}),le.length>0?l.jsx("div",{className:"mt-4 flex flex-col gap-3",children:le.map(we=>{const et=`${we.sessionId}:${we.turnId}:${we.blockId}`,Se=r===`${et}:approve`,Ze=r===`${et}:deny`;return l.jsxs("div",{className:"rounded-2xl border px-4 py-4",style:Ne,children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("span",{className:"rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.12em]",style:we.risk==="high"?{backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#be123c"}:we.risk==="medium"?{backgroundColor:"#fff7ed",borderColor:"#fed7aa",color:"#c2410c"}:{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"},children:[we.risk," risk"]}),l.jsx("span",{className:"text-[11px] font-medium",style:{color:g.ink},children:we.title}),l.jsx("span",{className:"text-[11px]",style:{color:g.muted},children:we.sessionName})]}),l.jsx("div",{className:"mt-3 text-[13px] leading-[1.6]",style:{color:g.ink},children:we.description}),we.detail&&we.detail!==we.description?l.jsx("div",{className:"mt-3 rounded-xl border px-3 py-2 text-[11px] font-mono break-words",style:{backgroundColor:"#ffffff",borderColor:g.border,color:g.ink},children:we.detail}):null,l.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[l.jsxs(Nt,{type:"button",size:"sm",onClick:()=>p(we,"approve"),disabled:!!r,children:[Se?l.jsx(un,{className:"text-[12px]"}):l.jsx(Yi,{size:14}),"Approve"]}),l.jsxs(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>p(we,"deny"),disabled:!!r,children:[Ze?l.jsx(un,{className:"text-[12px]"}):l.jsx(kl,{size:14}),"Deny"]})]})]},et)})}):l.jsx("div",{className:"mt-4 rounded-2xl border px-4 py-4 text-[12px] leading-[1.7]",style:Ne,children:"No approvals are waiting right now. When an adapter emits `awaiting_approval`, it will appear here."})]})]}),l.jsx("div",{children:$?l.jsxs("section",{className:"rounded-[20px] border p-5",style:Te,children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[15px] font-medium tracking-tight",style:{color:g.ink},children:"Scan QR Code"}),l.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:g.muted},children:"Point Pairing on your phone at this code."})]}),l.jsx("span",{className:"rounded-full border px-2.5 py-1 text-[10px] font-medium whitespace-nowrap",style:{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"},children:"Ready to Pair"})]}),l.jsx("div",{className:"mt-5 rounded-[22px] border p-4",style:{backgroundColor:"#ffffff",borderColor:"rgba(15, 23, 42, 0.08)"},children:l.jsx("div",{"aria-label":"Pairing pairing QR code",className:`mx-auto w-full ${O?"max-w-[480px]":"max-w-[248px]"}`,dangerouslySetInnerHTML:{__html:$}})}),l.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3 text-[11px] leading-[1.65] font-light",style:{color:g.muted},children:[l.jsx("div",{className:"flex items-center gap-2",children:ye===0?l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"#be123c"},children:"Expired"}),l.jsxs(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>f("restart"),disabled:e||u,className:"flex items-center gap-1",children:[l.jsx(xn,{size:11}),"Refresh"]})]}):l.jsxs(l.Fragment,{children:["Refreshes in ",l.jsx("span",{style:{color:g.ink},children:ye!==null?_b(ye):"—"})]})}),l.jsx(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>P(we=>!we),children:O?"Compact QR":"Larger QR"})]})]}):l.jsxs("section",{className:"rounded-[20px] border bg-[rgba(250,250,250,0.65)] p-5",style:Te,children:[l.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em] mb-3",style:{color:g.muted},children:"CLI Equivalent"}),l.jsxs("div",{className:"rounded-2xl border px-3 py-3 flex items-center gap-3",style:Ne,children:[l.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",style:{color:g.ink},children:Le}),l.jsx(Nt,{type:"button",variant:"outline",size:"icon-sm",onClick:()=>{bt("command",Le)},children:C==="command"?l.jsx(Yi,{size:14}):l.jsx(Nr,{size:14})})]}),l.jsx("div",{className:"mt-4 text-[11px] leading-[1.6] font-light",style:{color:g.muted},children:l.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[l.jsx(k1,{size:13,strokeWidth:1.5}),"Same backend as the command line, with QR rotation and log access."]})})]})})]}),l.jsxs("section",{className:"rounded-[20px] border p-5",style:Te,children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[15px] font-medium tracking-tight",style:{color:g.ink},children:"Trusted Devices"}),l.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:g.muted},children:"Saved phone identities that have paired with this bridge."})]}),l.jsxs("span",{className:"rounded-full border px-2.5 py-1 text-[10px] font-medium whitespace-nowrap",style:pe?{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:{backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"},children:[_.length," saved"]})]}),_.length>0?l.jsxs("div",{className:"mt-4 overflow-hidden rounded-xl border",style:He,children:[l.jsxs("div",{className:"hidden gap-3 px-4 py-2 text-[9px] font-mono uppercase tracking-[0.16em] md:grid md:grid-cols-[minmax(0,1.8fr)_140px_140px_140px]",style:{color:g.muted},children:[l.jsx("div",{children:"Device"}),l.jsx("div",{children:"Status"}),l.jsx("div",{children:"Last Seen"}),l.jsx("div",{children:"Paired"})]}),_.map((we,et)=>{const Se=we.fingerprint===d?.connectedPeerFingerprint;return l.jsxs("div",{className:"grid gap-3 px-4 py-3 md:grid-cols-[minmax(0,1.8fr)_140px_140px_140px] md:items-center",style:et===0?void 0:{borderTop:`1px solid ${g.border}`},children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[13px] font-medium tracking-tight",style:{color:g.ink},children:vm(we)}),l.jsx("div",{className:"mt-1 truncate text-[11px] font-mono",style:{color:g.muted},children:LS(we.publicKey)})]}),l.jsx("div",{children:l.jsx("span",{className:"inline-flex rounded-full border px-2 py-1 text-[10px] font-medium whitespace-nowrap",style:Se?{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:{backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"},children:Se?"Connected now":"Trusted"})}),l.jsx("div",{className:"text-[12px]",style:{color:g.ink},children:we.lastSeenLabel??"Unknown"}),l.jsx("div",{className:"text-[12px]",style:{color:g.ink},children:we.pairedAtLabel??"Unknown"})]},we.publicKey)})]}):l.jsx("div",{className:"mt-4 rounded-2xl border px-4 py-4 text-[12px] leading-[1.7]",style:Ne,children:"No trusted devices yet. Start Pairing and scan the QR code from your phone to add one."})]}),l.jsxs("div",{className:`grid gap-5 items-start ${Q?"lg:grid-cols-[minmax(0,1.5fr)_320px]":"lg:grid-cols-1"}`,children:[l.jsx("section",{id:"pairing-live-logs",ref:N,children:l.jsx(ju,{open:J,onOpenChange:ee,children:l.jsxs("div",{className:"rounded-[20px] border overflow-hidden",style:Te,children:[l.jsx(Nu,{asChild:!0,children:l.jsxs("button",{type:"button",className:"w-full px-5 py-4 border-b flex items-center justify-between gap-3 text-left hover:opacity-95 transition-opacity",style:{borderBottomColor:J?g.border:"transparent",backgroundColor:"#ffffff"},children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"inline-flex items-center gap-2 text-[15px] font-medium tracking-tight",style:{color:g.ink},children:[l.jsx(go,{size:15,style:{color:"#9ca3af"},strokeWidth:1.5}),"Pairing Logs"]}),l.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:g.muted},children:J?"Live bridge output and runtime diagnostics.":"Hidden by default. Expand only when debugging pairing."})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[d?.logUpdatedAtLabel?l.jsx("span",{className:"text-[10px] font-mono",style:{color:g.muted},children:d.logUpdatedAtLabel}):null,l.jsx(ql,{size:14,className:"transition-transform duration-150",style:{color:g.muted,transform:J?"rotate(90deg)":void 0}})]})]})}),l.jsxs(wu,{children:[l.jsxs("div",{className:"px-5 pt-4 flex items-center justify-between gap-3",children:[l.jsx("div",{className:"text-[11px] font-light",style:{color:g.muted},children:"Open the full Logs view if you want the broader app and relay log catalog."}),l.jsx(Nt,{type:"button",variant:"outline",size:"sm",onClick:y,children:"Open Full Logs"})]}),l.jsx("div",{className:"px-5 pb-5 pt-4",children:l.jsx(U1,{title:"Pairing",pathLabel:d?.logPath??null,body:d?.logTail??null,truncated:d?.logTruncated,missing:d?.logMissing,loading:!d,updatedAtLabel:d?.logUpdatedAtLabel,maxHeight:320,minHeight:160,onRevealPath:j})})]})]})})}),Q?l.jsxs("section",{id:"pairing-settings-card",ref:Y,className:"rounded-[20px] border overflow-hidden",style:Te,children:[l.jsxs("div",{className:"px-5 py-4 border-b flex items-center justify-between gap-3",style:{borderBottomColor:g.border},children:[l.jsxs("div",{children:[l.jsxs("div",{className:"inline-flex items-center gap-2 text-[15px] font-medium tracking-tight",style:{color:g.ink},children:[l.jsx($a,{size:15,style:{color:"#9ca3af"},strokeWidth:1.5}),"Advanced Settings"]}),l.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:g.muted},children:"You usually do not need these. Pairing can auto-launch a local relay for pairing."})]}),l.jsxs(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>{bt("config",d?.configPath??"")},disabled:!d?.configPath,children:[C==="config"?l.jsx(Yi,{size:14}):l.jsx(Nr,{size:14}),"Config Path"]})]}),l.jsxs("div",{className:"divide-y",style:{borderColor:g.border},children:[l.jsx("div",{className:"px-5 py-4 space-y-3",children:tt.map(([we,et])=>l.jsxs("div",{className:"flex items-center justify-between gap-3 text-[12px]",children:[l.jsx("span",{className:"font-light",style:{color:g.muted},children:we==="Secure Mode"?l.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l.jsx(A1,{size:13,strokeWidth:1.5}),we]}):we==="Last Updated"?l.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l.jsx(Zi,{size:13,strokeWidth:1.5}),we]}):we}),l.jsx("span",{className:"text-right break-words font-normal",style:{color:g.ink},children:et})]},we))}),l.jsxs("div",{className:"px-5 py-4 space-y-4",children:[l.jsxs("label",{className:"block",children:[l.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em] mb-2",style:{color:g.muted},children:"Custom Pairing Relay URL"}),l.jsx("input",{type:"text",value:w,onChange:we=>{M(we.target.value),B(!0)},placeholder:"Leave blank to auto-select a local relay",className:"w-full rounded-xl border px-3 py-2 text-[13px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}})]}),l.jsxs("label",{className:"block",children:[l.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em] mb-2",style:{color:g.muted},children:"Workspace Root"}),l.jsx("input",{type:"text",value:D,onChange:we=>{H(we.target.value),B(!0)},placeholder:"/Users/arach/dev/openscout",className:"w-full rounded-xl border px-3 py-2 text-[13px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}})]}),l.jsx("div",{className:"flex flex-wrap items-center gap-2",children:l.jsx(Nt,{type:"button",size:"sm",onClick:()=>{Ye()},disabled:i,children:"Save"})}),a?l.jsx("div",{className:"text-[11px] leading-[1.6]",style:{color:g.ink},children:a}):null]})]})]}):null]})]})})})})}function vm(e){return e?e.name??`Device ${e.fingerprint}`:"Unknown device"}function LS(e){return e.length<=16?e:`${e.slice(0,8)}...${e.slice(-8)}`}function DS(e,r,a){return a?{label:"Error",backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#be123c"}:r&&!e?{label:"Loading",backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"}:e?.status==="paired"&&e.connectedPeerFingerprint?{label:"Connected",backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:e?.isRunning&&e?.pairing?{label:"Waiting",backgroundColor:"#eff6ff",borderColor:"#bfdbfe",color:"#1d4ed8"}:(e?.trustedPeerCount??0)>0?{label:`${e.trustedPeerCount} trusted`,backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"}:null}function _S({active:e,surface:r}){return r==="relay"?l.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center text-[9px] font-mono font-bold",style:e?{backgroundColor:g.ink,color:"#fff"}:{backgroundColor:g.surface,color:g.ink,boxShadow:`inset 0 0 0 1px ${g.border}`},children:">_"}):l.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center",style:e?{backgroundColor:g.accentBg,boxShadow:`inset 0 0 0 1px ${g.accentBorder}`}:{backgroundColor:g.tagBg,boxShadow:`inset 0 0 0 1px ${g.border}`},children:l.jsx("span",{className:"block w-1.5 h-1.5 rounded-full",style:{backgroundColor:e?g.accent:g.muted}})})}function _b(e){if(e<60)return`${e}s`;const r=Math.floor(e/60),a=e%60;if(r<60)return a>0?`${r}m ${a}s`:`${r}m`;const i=Math.floor(r/60),o=r%60;return o>0?`${i}h ${o}m`:`${i}h`}function BS(e,r){return e.find(a=>a.participants.some(i=>i.id===r))?.id??null}function Bp(e,r){const a=r?e.participants.filter(i=>i.id!==r):e.participants;return a.length>0?a:e.participants}function ep(e,r){return Bp(e,r).map(a=>a.title).join(", ")}function tp(e,r){const a=e.sourceKind==="private"?"Private thread":"Targeted relay traffic",i=e.participants.map(u=>u.title).join(" ↔ ");if(!r)return`${a} · ${i}`;const o=Bp(e,r).map(u=>u.title).join(", ");return e.latestAuthorName?`${a} · ${o} · Last from ${e.latestAuthorName}`:`${a} · ${i}`}function mv(e){return e==="project"?"Relay Agent":e==="system"?"System":"Built-in Role"}function IS(e){return e==="active"?"active":"all"}function PS(e){return e==="code"?"code":e==="session"?"session":e==="alpha"?"a-z":"chat"}function Bb(e){return e.threadCount>0||e.reachable||!!(e.lastChatAt||e.lastCodeChangeAt||e.lastSessionAt)}function Ib(e,r){return r==="code"?e.lastCodeChangeAt??0:r==="session"?e.lastSessionAt??0:e.lastChatAt??0}function Pb(e,r,a){if(a==="alpha")return e.title.localeCompare(r.title);const i=Ib(r,a)-Ib(e,a);return i!==0?i:r.threadCount-e.threadCount||e.title.localeCompare(r.title)}function US(e,r){return r==="chat"&&e.lastChatLabel?`${e.subtitle} · chat ${e.lastChatLabel}`:r==="code"&&e.lastCodeChangeLabel?`${e.subtitle} · code ${e.lastCodeChangeLabel}`:r==="session"&&e.lastSessionLabel?`${e.subtitle} · session ${e.lastSessionLabel}`:e.subtitle}function On(e){return e.replace(/\r\n/g,`
|
|
12
|
-
`).trim()}function Ub(e){return e?JSON.stringify({cwd:On(e.runtime.cwd),harness:e.runtime.harness,sessionId:On(e.runtime.sessionId),systemPrompt:On(e.systemPrompt),launchArgsText:On(e.toolUse.launchArgsText),capabilitiesText:On(e.capabilitiesText)}):""}function Hb(e){return e?JSON.stringify({operatorName:On(e.operatorName),onboardingContextRoot:On(e.onboardingContextRoot),workspaceRoots:e.workspaceRoots.map(r=>On(r)),includeCurrentRepo:e.includeCurrentRepo,defaultHarness:e.defaultHarness,defaultCapabilities:e.defaultCapabilities.map(r=>On(r)),sessionPrefix:On(e.sessionPrefix),telegram:{enabled:e.telegram.enabled,mode:e.telegram.mode,botToken:On(e.telegram.botToken),secretToken:On(e.telegram.secretToken),apiBaseUrl:On(e.telegram.apiBaseUrl),userName:On(e.telegram.userName),defaultConversationId:On(e.telegram.defaultConversationId),ownerNodeId:On(e.telegram.ownerNodeId)}}):""}function HS(e){return Array.from(new Set(e.split(/[\n,]/g).map(r=>r.trim()).filter(Boolean)))}function Fb(e){return e||null}function Ka(e){return e?e.replace(/^\/Users\/[^/]+/,"~").replace(/^\/home\/[^/]+/,"~"):null}function FS(e){return e?e.trim().toLowerCase()!=="operator":!1}function pv(e){return e.state==="working"?e.activeTask??e.statusDetail??e.subtitle:e.statusDetail?`${e.subtitle} · ${e.statusDetail}`:e.subtitle}function Ro(e){return e==="working"?"bg-[var(--os-accent)] os-presence-pulse":e==="available"?"bg-emerald-500":"bg-zinc-400/50"}function qS(e){switch(e){case"replied":return{color:"#059669"};case"working":return{color:"var(--os-accent)"};case"seen":return{color:"var(--os-accent)"};case"delivered":return{color:"#64748b"};default:return{color:"var(--os-muted)"}}}function VS(e){const r=e.trim();return!(!r||r.includes(`
|
|
13
|
-
`)||/```|`|\[[^\]]+\]\([^)]+\)|^>\s|^#{1,6}\s|^\s*[-*+]\s|^\s*\d+\.\s|\|/.test(r))}function hv(e){return!e.isDirectConversation&&!e.isSystem&&!e.isVoice&&e.messageClass!=="status"&&(!e.normalizedChannel||e.normalizedChannel==="shared")}function xv(e){return e.isSystem}function gv(e){return e.isVoice}function bv(e){return!e.isVoice}function yv(e){return!e.isVoice&&!e.isSystem&&(e.isDirectConversation||e.recipients.length>0||e.messageClass==="status")}function vv(e){return!e.isDirectConversation&&!e.isSystem&&!e.isVoice&&e.messageClass!=="status"&&e.recipients.length>0}function Vi(e,r){return e.filter(r).length}function qb(e){if(!e)return[];const r=new Map(e.views.map(i=>[i.id,i])),a=new Map(e.channels.map(i=>[i.id,i]));return[r.get("all-traffic")??{kind:"filter",id:"all-traffic",title:"All Traffic",subtitle:"Every non-voice message across the workspace.",count:Vi(e.messages,bv)},r.get("coordination")??{kind:"filter",id:"coordination",title:"Coordination",subtitle:"Targeted messages, direct threads, and task handoffs.",count:Vi(e.messages,yv)},r.get("mentions")??{kind:"filter",id:"mentions",title:"Mentions",subtitle:"Focused view over shared-channel targeted messages.",count:Vi(e.messages,vv)},a.get("system")??{kind:"channel",id:"system",title:"# system",subtitle:"Infrastructure, lifecycle, and broker state events.",count:Vi(e.messages,xv)},a.get("voice")??{kind:"channel",id:"voice",title:"# voice",subtitle:"Voice-related chat, transcripts, and spoken updates.",count:Vi(e.messages,gv)}]}function GS(e){return e?[e.channels.find(a=>a.id==="shared")??{kind:"channel",id:"shared",title:"# shared-channel",subtitle:"Broadcast updates and shared context.",count:Vi(e.messages,hv)}]:[]}function $S(e,r,a,i){return a==="channel"?e.channels.find(o=>o.id===i)??null:a==="filter"?r.find(o=>o.id===i)??null:e.directs.find(o=>o.id===i)??null}function YS(e,r,a){return r==="direct"?e.filter(i=>i.isDirectConversation&&(i.authorId===a||i.recipients.includes(a))):r==="filter"&&a==="all-traffic"?e.filter(bv):r==="filter"&&a==="coordination"?e.filter(yv):r==="filter"&&a==="mentions"?e.filter(vv):r==="channel"&&a==="voice"?e.filter(gv):r==="channel"&&a==="system"?e.filter(xv):e.filter(hv)}function Ip(e){return e.replace(/^[@#]\s*/,"")}function kv(e){return e>1e10?e:e*1e3}function QS(e){return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"}).format(new Date(kv(e)))}function XS(e){return new Intl.DateTimeFormat("en-US",{weekday:"short",month:"short",day:"numeric"}).format(new Date(kv(e))).toUpperCase()}function KS(e){return new Intl.DateTimeFormat([],{hour:"numeric",minute:"2-digit"}).format(e)}function cl(e){const r=["#3b82f6","#14b8a6","#fb923c","#f43f5e","#8b5cf6","#10b981"];let a=0;for(const i of e)a+=i.charCodeAt(0);return r[a%r.length]}function ZS(e,r){const a=r?.operatorName?.trim();if(a)return a;const i=e?.operatorId??"operator",o=e?.messages??[];for(let u=o.length-1;u>=0;u-=1){const d=o[u];if(d?.authorId===i&&d.authorName.trim())return d.authorName.trim()}return r?.operatorNameDefault??"Operator"}function Vb(e){const r=e.match(/@[a-z0-9][\w.-]*(?:@[a-z0-9][\w.-]*)?(?:#[a-z0-9][\w.-]*)?/gi)??[];return Array.from(new Set(r.map(a=>a.slice(1))))}function jv(e){return e.trim().toLowerCase()}function WS(e,r){const a=Math.max(0,Math.min(r,e.length));let i=a-1;for(;i>=0&&/[\w.@#-]/.test(e[i]??"");)i-=1;const o=i+1;return e[o]!=="@"||i>=0&&!/[\s([{,]/.test(e[i]??"")?null:{start:o,end:a,query:jv(e.slice(o+1,a))}}function JS(e,r,a){const i=e.mentionToken.replace(/^@/,"").toLowerCase(),o=e.title.toLowerCase(),u=jv(r);let d=0;return e.agentId===a&&(d+=100),u?(i===u?d+=120:i.startsWith(u)?d+=80:o.startsWith(u)?d+=72:e.searchText.includes(u)&&(d+=28),e.state==="working"?d+=8:e.state==="available"&&(d+=4),d):(e.state==="working"?d+=10:e.state==="available"&&(d+=6),d)}function eC(e,r){return e==="direct"?r==="scout"?"dm.scout.primary":`dm.operator.${r}`:e==="channel"&&r==="voice"?"channel.voice":e==="channel"&&r==="system"?"channel.system":"channel.shared"}function So(e){const r=e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase();return`m:${r.slice(-7)||r.slice(0,7)||"message"}`}function tC(e){const r=e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase();return r.slice(-4)||r.slice(0,4)||"ref"}function Nv(e){return`message:${e}`}function km(e){return`message-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function zu(e,r=88){const a=e.replace(/\s+/g," ").trim();return a.length<=r?a:`${a.slice(0,Math.max(0,r-1)).trimEnd()}…`}function Gb(){return{color:g.ink,backgroundColor:g.accentBg,boxShadow:"inset 0 0 0 1px rgba(0,102,255,0.16)"}}function lt(e){return e instanceof Error?e.message:"Action failed."}function Co(e){const r=A.useRef(e);return A.useEffect(()=>{r.current=e}),A.useMemo(()=>(...a)=>r.current?.(...a),[])}function nC(e,r=globalThis?.document){const a=Co(e);A.useEffect(()=>{const i=o=>{o.key==="Escape"&&a(o)};return r.addEventListener("keydown",i,{capture:!0}),()=>r.removeEventListener("keydown",i,{capture:!0})},[a,r])}var lC="DismissableLayer",np="dismissableLayer.update",rC="dismissableLayer.pointerDownOutside",aC="dismissableLayer.focusOutside",$b,wv=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sv=A.forwardRef((e,r)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...p}=e,h=A.useContext(wv),[y,b]=A.useState(null),v=y?.ownerDocument??globalThis?.document,[,j]=A.useState({}),C=fa(r,B=>b(B)),E=Array.from(h.layers),[w]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),M=E.indexOf(w),D=y?E.indexOf(y):-1,H=h.layersWithOutsidePointerEventsDisabled.size>0,X=D>=M,q=oC(B=>{const F=B.target,Z=[...h.branches].some(O=>O.contains(F));!X||Z||(o?.(B),d?.(B),B.defaultPrevented||f?.())},v),L=cC(B=>{const F=B.target;[...h.branches].some(O=>O.contains(F))||(u?.(B),d?.(B),B.defaultPrevented||f?.())},v);return nC(B=>{D===h.layers.size-1&&(i?.(B),!B.defaultPrevented&&f&&(B.preventDefault(),f()))},v),A.useEffect(()=>{if(y)return a&&(h.layersWithOutsidePointerEventsDisabled.size===0&&($b=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),Yb(),()=>{a&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=$b)}},[y,v,a,h]),A.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),Yb())},[y,h]),A.useEffect(()=>{const B=()=>j({});return document.addEventListener(np,B),()=>document.removeEventListener(np,B)},[]),l.jsx(jl.div,{...p,ref:C,style:{pointerEvents:H?X?"auto":"none":void 0,...e.style},onFocusCapture:jr(e.onFocusCapture,L.onFocusCapture),onBlurCapture:jr(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:jr(e.onPointerDownCapture,q.onPointerDownCapture)})});Sv.displayName=lC;var iC="DismissableLayerBranch",sC=A.forwardRef((e,r)=>{const a=A.useContext(wv),i=A.useRef(null),o=fa(r,i);return A.useEffect(()=>{const u=i.current;if(u)return a.branches.add(u),()=>{a.branches.delete(u)}},[a.branches]),l.jsx(jl.div,{...e,ref:o})});sC.displayName=iC;function oC(e,r=globalThis?.document){const a=Co(e),i=A.useRef(!1),o=A.useRef(()=>{});return A.useEffect(()=>{const u=f=>{if(f.target&&!i.current){let p=function(){Cv(rC,a,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(r.removeEventListener("click",o.current),o.current=p,r.addEventListener("click",o.current,{once:!0})):p()}else r.removeEventListener("click",o.current);i.current=!1},d=window.setTimeout(()=>{r.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),r.removeEventListener("pointerdown",u),r.removeEventListener("click",o.current)}},[r,a]),{onPointerDownCapture:()=>i.current=!0}}function cC(e,r=globalThis?.document){const a=Co(e),i=A.useRef(!1);return A.useEffect(()=>{const o=u=>{u.target&&!i.current&&Cv(aC,a,{originalEvent:u},{discrete:!1})};return r.addEventListener("focusin",o),()=>r.removeEventListener("focusin",o)},[r,a]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Yb(){const e=new CustomEvent(np);document.dispatchEvent(e)}function Cv(e,r,a,{discrete:i}){const o=a.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});r&&o.addEventListener(e,r,{once:!0}),i?NS(o,u):o.dispatchEvent(u)}var jm="focusScope.autoFocusOnMount",Nm="focusScope.autoFocusOnUnmount",Qb={bubbles:!1,cancelable:!0},uC="FocusScope",Tv=A.forwardRef((e,r)=>{const{loop:a=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:u,...d}=e,[f,p]=A.useState(null),h=Co(o),y=Co(u),b=A.useRef(null),v=fa(r,E=>p(E)),j=A.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;A.useEffect(()=>{if(i){let E=function(H){if(j.paused||!f)return;const X=H.target;f.contains(X)?b.current=X:ua(b.current,{select:!0})},w=function(H){if(j.paused||!f)return;const X=H.relatedTarget;X!==null&&(f.contains(X)||ua(b.current,{select:!0}))},M=function(H){if(document.activeElement===document.body)for(const q of H)q.removedNodes.length>0&&ua(f)};document.addEventListener("focusin",E),document.addEventListener("focusout",w);const D=new MutationObserver(M);return f&&D.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",w),D.disconnect()}}},[i,f,j.paused]),A.useEffect(()=>{if(f){Kb.add(j);const E=document.activeElement;if(!f.contains(E)){const M=new CustomEvent(jm,Qb);f.addEventListener(jm,h),f.dispatchEvent(M),M.defaultPrevented||(dC(xC(Av(f)),{select:!0}),document.activeElement===E&&ua(f))}return()=>{f.removeEventListener(jm,h),setTimeout(()=>{const M=new CustomEvent(Nm,Qb);f.addEventListener(Nm,y),f.dispatchEvent(M),M.defaultPrevented||ua(E??document.body,{select:!0}),f.removeEventListener(Nm,y),Kb.remove(j)},0)}}},[f,h,y,j]);const C=A.useCallback(E=>{if(!a&&!i||j.paused)return;const w=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,M=document.activeElement;if(w&&M){const D=E.currentTarget,[H,X]=fC(D);H&&X?!E.shiftKey&&M===X?(E.preventDefault(),a&&ua(H,{select:!0})):E.shiftKey&&M===H&&(E.preventDefault(),a&&ua(X,{select:!0})):M===D&&E.preventDefault()}},[a,i,j.paused]);return l.jsx(jl.div,{tabIndex:-1,...d,ref:v,onKeyDown:C})});Tv.displayName=uC;function dC(e,{select:r=!1}={}){const a=document.activeElement;for(const i of e)if(ua(i,{select:r}),document.activeElement!==a)return}function fC(e){const r=Av(e),a=Xb(r,e),i=Xb(r.reverse(),e);return[a,i]}function Av(e){const r=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)r.push(a.currentNode);return r}function Xb(e,r){for(const a of e)if(!mC(a,{upTo:r}))return a}function mC(e,{upTo:r}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(r!==void 0&&e===r)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function pC(e){return e instanceof HTMLInputElement&&"select"in e}function ua(e,{select:r=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&pC(e)&&r&&e.select()}}var Kb=hC();function hC(){let e=[];return{add(r){const a=e[0];r!==a&&a?.pause(),e=Zb(e,r),e.unshift(r)},remove(r){e=Zb(e,r),e[0]?.resume()}}}function Zb(e,r){const a=[...e],i=a.indexOf(r);return i!==-1&&a.splice(i,1),a}function xC(e){return e.filter(r=>r.tagName!=="A")}var gC="Portal",Ev=A.forwardRef((e,r)=>{const{container:a,...i}=e,[o,u]=A.useState(!1);Wi(()=>u(!0),[]);const d=a||o&&globalThis?.document?.body;return d?Ij.createPortal(l.jsx(jl.div,{...i,ref:r}),d):null});Ev.displayName=gC;var wm=0;function bC(){A.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Wb()),document.body.insertAdjacentElement("beforeend",e[1]??Wb()),wm++,()=>{wm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),wm--}},[])}function Wb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Hl=function(){return Hl=Object.assign||function(r){for(var a,i=1,o=arguments.length;i<o;i++){a=arguments[i];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(r[u]=a[u])}return r},Hl.apply(this,arguments)};function Rv(e,r){var a={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&r.indexOf(i)<0&&(a[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)r.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(a[i[o]]=e[i[o]]);return a}function yC(e,r,a){if(a||arguments.length===2)for(var i=0,o=r.length,u;i<o;i++)(u||!(i in r))&&(u||(u=Array.prototype.slice.call(r,0,i)),u[i]=r[i]);return e.concat(u||Array.prototype.slice.call(r))}var Su="right-scroll-bar-position",Cu="width-before-scroll-bar",vC="with-scroll-bars-hidden",kC="--removed-body-scroll-bar-size";function Sm(e,r){return typeof e=="function"?e(r):e&&(e.current=r),e}function jC(e,r){var a=A.useState(function(){return{value:e,callback:r,facade:{get current(){return a.value},set current(i){var o=a.value;o!==i&&(a.value=i,a.callback(i,o))}}}})[0];return a.callback=r,a.facade}var NC=typeof window<"u"?A.useLayoutEffect:A.useEffect,Jb=new WeakMap;function wC(e,r){var a=jC(null,function(i){return e.forEach(function(o){return Sm(o,i)})});return NC(function(){var i=Jb.get(a);if(i){var o=new Set(i),u=new Set(e),d=a.current;o.forEach(function(f){u.has(f)||Sm(f,null)}),u.forEach(function(f){o.has(f)||Sm(f,d)})}Jb.set(a,e)},[e]),a}function SC(e){return e}function CC(e,r){r===void 0&&(r=SC);var a=[],i=!1,o={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(u){var d=r(u,i);return a.push(d),function(){a=a.filter(function(f){return f!==d})}},assignSyncMedium:function(u){for(i=!0;a.length;){var d=a;a=[],d.forEach(u)}a={push:function(f){return u(f)},filter:function(){return a}}},assignMedium:function(u){i=!0;var d=[];if(a.length){var f=a;a=[],f.forEach(u),d=a}var p=function(){var y=d;d=[],y.forEach(u)},h=function(){return Promise.resolve().then(p)};h(),a={push:function(y){d.push(y),h()},filter:function(y){return d=d.filter(y),a}}}};return o}function TC(e){e===void 0&&(e={});var r=CC(null);return r.options=Hl({async:!0,ssr:!1},e),r}var Mv=function(e){var r=e.sideCar,a=Rv(e,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=r.read();if(!i)throw new Error("Sidecar medium not found");return A.createElement(i,Hl({},a))};Mv.isSideCarExport=!0;function AC(e,r){return e.useMedium(r),Mv}var zv=TC(),Cm=function(){},qu=A.forwardRef(function(e,r){var a=A.useRef(null),i=A.useState({onScrollCapture:Cm,onWheelCapture:Cm,onTouchMoveCapture:Cm}),o=i[0],u=i[1],d=e.forwardProps,f=e.children,p=e.className,h=e.removeScrollBar,y=e.enabled,b=e.shards,v=e.sideCar,j=e.noRelative,C=e.noIsolation,E=e.inert,w=e.allowPinchZoom,M=e.as,D=M===void 0?"div":M,H=e.gapMode,X=Rv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),q=v,L=wC([a,r]),B=Hl(Hl({},X),o);return A.createElement(A.Fragment,null,y&&A.createElement(q,{sideCar:zv,removeScrollBar:h,shards:b,noRelative:j,noIsolation:C,inert:E,setCallbacks:u,allowPinchZoom:!!w,lockRef:a,gapMode:H}),d?A.cloneElement(A.Children.only(f),Hl(Hl({},B),{ref:L})):A.createElement(D,Hl({},B,{className:p,ref:L}),f))});qu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qu.classNames={fullWidth:Cu,zeroRight:Su};var EC=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function RC(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var r=EC();return r&&e.setAttribute("nonce",r),e}function MC(e,r){e.styleSheet?e.styleSheet.cssText=r:e.appendChild(document.createTextNode(r))}function zC(e){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(e)}var OC=function(){var e=0,r=null;return{add:function(a){e==0&&(r=RC())&&(MC(r,a),zC(r)),e++},remove:function(){e--,!e&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},LC=function(){var e=OC();return function(r,a){A.useEffect(function(){return e.add(r),function(){e.remove()}},[r&&a])}},Ov=function(){var e=LC(),r=function(a){var i=a.styles,o=a.dynamic;return e(i,o),null};return r},DC={left:0,top:0,right:0,gap:0},Tm=function(e){return parseInt(e||"",10)||0},_C=function(e){var r=window.getComputedStyle(document.body),a=r[e==="padding"?"paddingLeft":"marginLeft"],i=r[e==="padding"?"paddingTop":"marginTop"],o=r[e==="padding"?"paddingRight":"marginRight"];return[Tm(a),Tm(i),Tm(o)]},BC=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return DC;var r=_C(e),a=document.documentElement.clientWidth,i=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,i-a+r[2]-r[0])}},IC=Ov(),Qi="data-scroll-locked",PC=function(e,r,a,i){var o=e.left,u=e.top,d=e.right,f=e.gap;return a===void 0&&(a="margin"),`
|
|
14
|
-
.`.concat(vC,` {
|
|
15
|
-
overflow: hidden `).concat(i,`;
|
|
16
|
-
padding-right: `).concat(f,"px ").concat(i,`;
|
|
17
|
-
}
|
|
18
|
-
body[`).concat(Qi,`] {
|
|
19
|
-
overflow: hidden `).concat(i,`;
|
|
20
|
-
overscroll-behavior: contain;
|
|
21
|
-
`).concat([r&&"position: relative ".concat(i,";"),a==="margin"&&`
|
|
22
|
-
padding-left: `.concat(o,`px;
|
|
23
|
-
padding-top: `).concat(u,`px;
|
|
24
|
-
padding-right: `).concat(d,`px;
|
|
25
|
-
margin-left:0;
|
|
26
|
-
margin-top:0;
|
|
27
|
-
margin-right: `).concat(f,"px ").concat(i,`;
|
|
28
|
-
`),a==="padding"&&"padding-right: ".concat(f,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.`).concat(Su,` {
|
|
32
|
-
right: `).concat(f,"px ").concat(i,`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.`).concat(Cu,` {
|
|
36
|
-
margin-right: `).concat(f,"px ").concat(i,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(Su," .").concat(Su,` {
|
|
40
|
-
right: 0 `).concat(i,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.`).concat(Cu," .").concat(Cu,` {
|
|
44
|
-
margin-right: 0 `).concat(i,`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
body[`).concat(Qi,`] {
|
|
48
|
-
`).concat(kC,": ").concat(f,`px;
|
|
49
|
-
}
|
|
50
|
-
`)},ey=function(){var e=parseInt(document.body.getAttribute(Qi)||"0",10);return isFinite(e)?e:0},UC=function(){A.useEffect(function(){return document.body.setAttribute(Qi,(ey()+1).toString()),function(){var e=ey()-1;e<=0?document.body.removeAttribute(Qi):document.body.setAttribute(Qi,e.toString())}},[])},HC=function(e){var r=e.noRelative,a=e.noImportant,i=e.gapMode,o=i===void 0?"margin":i;UC();var u=A.useMemo(function(){return BC(o)},[o]);return A.createElement(IC,{styles:PC(u,!r,o,a?"":"!important")})},lp=!1;if(typeof window<"u")try{var ou=Object.defineProperty({},"passive",{get:function(){return lp=!0,!0}});window.addEventListener("test",ou,ou),window.removeEventListener("test",ou,ou)}catch{lp=!1}var Pi=lp?{passive:!1}:!1,FC=function(e){return e.tagName==="TEXTAREA"},Lv=function(e,r){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[r]!=="hidden"&&!(a.overflowY===a.overflowX&&!FC(e)&&a[r]==="visible")},qC=function(e){return Lv(e,"overflowY")},VC=function(e){return Lv(e,"overflowX")},ty=function(e,r){var a=r.ownerDocument,i=r;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var o=Dv(e,i);if(o){var u=_v(e,i),d=u[1],f=u[2];if(d>f)return!0}i=i.parentNode}while(i&&i!==a.body);return!1},GC=function(e){var r=e.scrollTop,a=e.scrollHeight,i=e.clientHeight;return[r,a,i]},$C=function(e){var r=e.scrollLeft,a=e.scrollWidth,i=e.clientWidth;return[r,a,i]},Dv=function(e,r){return e==="v"?qC(r):VC(r)},_v=function(e,r){return e==="v"?GC(r):$C(r)},YC=function(e,r){return e==="h"&&r==="rtl"?-1:1},QC=function(e,r,a,i,o){var u=YC(e,window.getComputedStyle(r).direction),d=u*i,f=a.target,p=r.contains(f),h=!1,y=d>0,b=0,v=0;do{if(!f)break;var j=_v(e,f),C=j[0],E=j[1],w=j[2],M=E-w-u*C;(C||M)&&Dv(e,f)&&(b+=M,v+=C);var D=f.parentNode;f=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!p&&f!==document.body||p&&(r.contains(f)||r===f));return(y&&Math.abs(b)<1||!y&&Math.abs(v)<1)&&(h=!0),h},cu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ny=function(e){return[e.deltaX,e.deltaY]},ly=function(e){return e&&"current"in e?e.current:e},XC=function(e,r){return e[0]===r[0]&&e[1]===r[1]},KC=function(e){return`
|
|
51
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
52
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
53
|
-
`)},ZC=0,Ui=[];function WC(e){var r=A.useRef([]),a=A.useRef([0,0]),i=A.useRef(),o=A.useState(ZC++)[0],u=A.useState(Ov)[0],d=A.useRef(e);A.useEffect(function(){d.current=e},[e]),A.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var E=yC([e.lockRef.current],(e.shards||[]).map(ly),!0).filter(Boolean);return E.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),E.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var f=A.useCallback(function(E,w){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!d.current.allowPinchZoom;var M=cu(E),D=a.current,H="deltaX"in E?E.deltaX:D[0]-M[0],X="deltaY"in E?E.deltaY:D[1]-M[1],q,L=E.target,B=Math.abs(H)>Math.abs(X)?"h":"v";if("touches"in E&&B==="h"&&L.type==="range")return!1;var F=window.getSelection(),Z=F&&F.anchorNode,O=Z?Z===L||Z.contains(L):!1;if(O)return!1;var P=ty(B,L);if(!P)return!0;if(P?q=B:(q=B==="v"?"h":"v",P=ty(B,L)),!P)return!1;if(!i.current&&"changedTouches"in E&&(H||X)&&(i.current=q),!q)return!0;var Q=i.current||q;return QC(Q,w,E,Q==="h"?H:X)},[]),p=A.useCallback(function(E){var w=E;if(!(!Ui.length||Ui[Ui.length-1]!==u)){var M="deltaY"in w?ny(w):cu(w),D=r.current.filter(function(q){return q.name===w.type&&(q.target===w.target||w.target===q.shadowParent)&&XC(q.delta,M)})[0];if(D&&D.should){w.cancelable&&w.preventDefault();return}if(!D){var H=(d.current.shards||[]).map(ly).filter(Boolean).filter(function(q){return q.contains(w.target)}),X=H.length>0?f(w,H[0]):!d.current.noIsolation;X&&w.cancelable&&w.preventDefault()}}},[]),h=A.useCallback(function(E,w,M,D){var H={name:E,delta:w,target:M,should:D,shadowParent:JC(M)};r.current.push(H),setTimeout(function(){r.current=r.current.filter(function(X){return X!==H})},1)},[]),y=A.useCallback(function(E){a.current=cu(E),i.current=void 0},[]),b=A.useCallback(function(E){h(E.type,ny(E),E.target,f(E,e.lockRef.current))},[]),v=A.useCallback(function(E){h(E.type,cu(E),E.target,f(E,e.lockRef.current))},[]);A.useEffect(function(){return Ui.push(u),e.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:v}),document.addEventListener("wheel",p,Pi),document.addEventListener("touchmove",p,Pi),document.addEventListener("touchstart",y,Pi),function(){Ui=Ui.filter(function(E){return E!==u}),document.removeEventListener("wheel",p,Pi),document.removeEventListener("touchmove",p,Pi),document.removeEventListener("touchstart",y,Pi)}},[]);var j=e.removeScrollBar,C=e.inert;return A.createElement(A.Fragment,null,C?A.createElement(u,{styles:KC(o)}):null,j?A.createElement(HC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function JC(e){for(var r=null;e!==null;)e instanceof ShadowRoot&&(r=e.host,e=e.host),e=e.parentNode;return r}const eT=AC(zv,WC);var Bv=A.forwardRef(function(e,r){return A.createElement(qu,Hl({},e,{ref:r,sideCar:eT}))});Bv.classNames=qu.classNames;var tT=function(e){if(typeof document>"u")return null;var r=Array.isArray(e)?e[0]:e;return r.ownerDocument.body},Hi=new WeakMap,uu=new WeakMap,du={},Am=0,Iv=function(e){return e&&(e.host||Iv(e.parentNode))},nT=function(e,r){return r.map(function(a){if(e.contains(a))return a;var i=Iv(a);return i&&e.contains(i)?i:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},lT=function(e,r,a,i){var o=nT(r,Array.isArray(e)?e:[e]);du[a]||(du[a]=new WeakMap);var u=du[a],d=[],f=new Set,p=new Set(o),h=function(b){!b||f.has(b)||(f.add(b),h(b.parentNode))};o.forEach(h);var y=function(b){!b||p.has(b)||Array.prototype.forEach.call(b.children,function(v){if(f.has(v))y(v);else try{var j=v.getAttribute(i),C=j!==null&&j!=="false",E=(Hi.get(v)||0)+1,w=(u.get(v)||0)+1;Hi.set(v,E),u.set(v,w),d.push(v),E===1&&C&&uu.set(v,!0),w===1&&v.setAttribute(a,"true"),C||v.setAttribute(i,"true")}catch(M){console.error("aria-hidden: cannot operate on ",v,M)}})};return y(r),f.clear(),Am++,function(){d.forEach(function(b){var v=Hi.get(b)-1,j=u.get(b)-1;Hi.set(b,v),u.set(b,j),v||(uu.has(b)||b.removeAttribute(i),uu.delete(b)),j||b.removeAttribute(a)}),Am--,Am||(Hi=new WeakMap,Hi=new WeakMap,uu=new WeakMap,du={})}},rT=function(e,r,a){a===void 0&&(a="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),o=tT(e);return o?(i.push.apply(i,Array.from(o.querySelectorAll("[aria-live], script"))),lT(i,o,a,"aria-hidden")):function(){return null}},Vu="Dialog",[Pv]=iv(Vu),[aT,Rl]=Pv(Vu),Uv=e=>{const{__scopeDialog:r,children:a,open:i,defaultOpen:o,onOpenChange:u,modal:d=!0}=e,f=A.useRef(null),p=A.useRef(null),[h,y]=sv({prop:i,defaultProp:o??!1,onChange:u,caller:Vu});return l.jsx(aT,{scope:r,triggerRef:f,contentRef:p,contentId:ku(),titleId:ku(),descriptionId:ku(),open:h,onOpenChange:y,onOpenToggle:A.useCallback(()=>y(b=>!b),[y]),modal:d,children:a})};Uv.displayName=Vu;var Hv="DialogTrigger",iT=A.forwardRef((e,r)=>{const{__scopeDialog:a,...i}=e,o=Rl(Hv,a),u=fa(r,o.triggerRef);return l.jsx(jl.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Hp(o.open),...i,ref:u,onClick:jr(e.onClick,o.onOpenToggle)})});iT.displayName=Hv;var Pp="DialogPortal",[sT,Fv]=Pv(Pp,{forceMount:void 0}),qv=e=>{const{__scopeDialog:r,forceMount:a,children:i,container:o}=e,u=Rl(Pp,r);return l.jsx(sT,{scope:r,forceMount:a,children:A.Children.map(i,d=>l.jsx(Eo,{present:a||u.open,children:l.jsx(Ev,{asChild:!0,container:o,children:d})}))})};qv.displayName=Pp;var Ou="DialogOverlay",Vv=A.forwardRef((e,r)=>{const a=Fv(Ou,e.__scopeDialog),{forceMount:i=a.forceMount,...o}=e,u=Rl(Ou,e.__scopeDialog);return u.modal?l.jsx(Eo,{present:i||u.open,children:l.jsx(cT,{...o,ref:r})}):null});Vv.displayName=Ou;var oT=ov("DialogOverlay.RemoveScroll"),cT=A.forwardRef((e,r)=>{const{__scopeDialog:a,...i}=e,o=Rl(Ou,a);return l.jsx(Bv,{as:oT,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(jl.div,{"data-state":Hp(o.open),...i,ref:r,style:{pointerEvents:"auto",...i.style}})})}),Ya="DialogContent",Gv=A.forwardRef((e,r)=>{const a=Fv(Ya,e.__scopeDialog),{forceMount:i=a.forceMount,...o}=e,u=Rl(Ya,e.__scopeDialog);return l.jsx(Eo,{present:i||u.open,children:u.modal?l.jsx(uT,{...o,ref:r}):l.jsx(dT,{...o,ref:r})})});Gv.displayName=Ya;var uT=A.forwardRef((e,r)=>{const a=Rl(Ya,e.__scopeDialog),i=A.useRef(null),o=fa(r,a.contentRef,i);return A.useEffect(()=>{const u=i.current;if(u)return rT(u)},[]),l.jsx($v,{...e,ref:o,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:jr(e.onCloseAutoFocus,u=>{u.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:jr(e.onPointerDownOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&u.preventDefault()}),onFocusOutside:jr(e.onFocusOutside,u=>u.preventDefault())})}),dT=A.forwardRef((e,r)=>{const a=Rl(Ya,e.__scopeDialog),i=A.useRef(!1),o=A.useRef(!1);return l.jsx($v,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),u.defaultPrevented||(i.current||a.triggerRef.current?.focus(),u.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),u.defaultPrevented||(i.current=!0,u.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const d=u.target;a.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.current&&u.preventDefault()}})}),$v=A.forwardRef((e,r)=>{const{__scopeDialog:a,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:u,...d}=e,f=Rl(Ya,a),p=A.useRef(null),h=fa(r,p);return bC(),l.jsxs(l.Fragment,{children:[l.jsx(Tv,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:u,children:l.jsx(Sv,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Hp(f.open),...d,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(fT,{titleId:f.titleId}),l.jsx(pT,{contentRef:p,descriptionId:f.descriptionId})]})]})}),Up="DialogTitle",Yv=A.forwardRef((e,r)=>{const{__scopeDialog:a,...i}=e,o=Rl(Up,a);return l.jsx(jl.h2,{id:o.titleId,...i,ref:r})});Yv.displayName=Up;var Qv="DialogDescription",Xv=A.forwardRef((e,r)=>{const{__scopeDialog:a,...i}=e,o=Rl(Qv,a);return l.jsx(jl.p,{id:o.descriptionId,...i,ref:r})});Xv.displayName=Qv;var Kv="DialogClose",Zv=A.forwardRef((e,r)=>{const{__scopeDialog:a,...i}=e,o=Rl(Kv,a);return l.jsx(jl.button,{type:"button",...i,ref:r,onClick:jr(e.onClick,()=>o.onOpenChange(!1))})});Zv.displayName=Kv;function Hp(e){return e?"open":"closed"}var Wv="DialogTitleWarning",[Ez,Jv]=fS(Wv,{contentName:Ya,titleName:Up,docsSlug:"dialog"}),fT=({titleId:e})=>{const r=Jv(Wv),a=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
|
|
54
|
-
|
|
55
|
-
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
56
|
-
|
|
57
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return A.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},mT="DialogDescriptionWarning",pT=({contentRef:e,descriptionId:r})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Jv(mT).contentName}}.`;return A.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");r&&o&&(document.getElementById(r)||console.warn(i))},[i,e,r]),null},hT=Uv,xT=qv,gT=Vv,bT=Gv,yT=Yv,vT=Xv,kT=Zv;function e0({...e}){return l.jsx(hT,{"data-slot":"dialog",...e})}function jT({...e}){return l.jsx(xT,{"data-slot":"dialog-portal",...e})}function NT({className:e,...r}){return l.jsx(gT,{"data-slot":"dialog-overlay",className:An("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function t0({className:e,children:r,showCloseButton:a=!0,...i}){return l.jsxs(jT,{"data-slot":"dialog-portal",children:[l.jsx(NT,{}),l.jsxs(bT,{"data-slot":"dialog-content",className:An("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...i,children:[r,a&&l.jsxs(kT,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[l.jsx(kl,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function n0({className:e,...r}){return l.jsx("div",{"data-slot":"dialog-header",className:An("flex flex-col gap-2 text-center sm:text-left",e),...r})}function wT({className:e,...r}){return l.jsx("div",{"data-slot":"dialog-footer",className:An("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r})}function l0({className:e,...r}){return l.jsx(yT,{"data-slot":"dialog-title",className:An("text-lg leading-none font-semibold",e),...r})}function r0({className:e,...r}){return l.jsx(vT,{"data-slot":"dialog-description",className:An("text-muted-foreground text-sm",e),...r})}function rp({className:e,type:r,...a}){return l.jsx("input",{type:r,"data-slot":"input",className:An("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}function ST({className:e,...r}){return l.jsx("textarea",{"data-slot":"textarea",className:An("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...r})}function ap(e){return e==="codex"?"codex":"claude"}function Em(e,r){const a=e.find(i=>i.root===r?.onboardingContextRoot)??e[0]??null;return{projectPath:a?.root??r?.onboardingContextRoot??"",agentName:"",harness:ap(a?.defaultHarness??r?.defaultHarness)}}function CT(e,r){return e.length!==r.length?!1:e.every((a,i)=>{const o=r[i];return a.publicKey===o?.publicKey&&a.fingerprint===o?.fingerprint&&a.name===o?.name&&a.pairedAt===o?.pairedAt&&a.pairedAtLabel===o?.pairedAtLabel&&a.lastSeen===o?.lastSeen&&a.lastSeenLabel===o?.lastSeenLabel})}function TT(e,r){return e.length!==r.length?!1:e.every((a,i)=>{const o=r[i];return a.sessionId===o?.sessionId&&a.turnId===o?.turnId&&a.blockId===o?.blockId&&a.version===o?.version&&a.risk===o?.risk&&a.title===o?.title&&a.description===o?.description&&a.detail===o?.detail&&a.actionKind===o?.actionKind&&a.actionStatus===o?.actionStatus})}function AT(e,r){return e===r?!0:!e||!r?e===r:e.status===r.status&&e.statusLabel===r.statusLabel&&e.statusDetail===r.statusDetail&&e.connectedPeerFingerprint===r.connectedPeerFingerprint&&e.isRunning===r.isRunning&&e.commandLabel===r.commandLabel&&e.configPath===r.configPath&&e.identityPath===r.identityPath&&e.trustedPeersPath===r.trustedPeersPath&&e.logPath===r.logPath&&e.relay===r.relay&&e.configuredRelay===r.configuredRelay&&e.secure===r.secure&&e.workspaceRoot===r.workspaceRoot&&e.sessionCount===r.sessionCount&&e.identityFingerprint===r.identityFingerprint&&e.trustedPeerCount===r.trustedPeerCount&&CT(e.trustedPeers,r.trustedPeers)&&TT(e.pendingApprovals,r.pendingApprovals)&&e.logTail===r.logTail&&e.logUpdatedAtLabel===r.logUpdatedAtLabel&&e.logMissing===r.logMissing&&e.logTruncated===r.logTruncated&&e.pairing?.relay===r.pairing?.relay&&e.pairing?.room===r.pairing?.room&&e.pairing?.publicKey===r.pairing?.publicKey&&e.pairing?.expiresAt===r.pairing?.expiresAt&&e.pairing?.qrValue===r.pairing?.qrValue&&e.pairing?.qrArt===r.pairing?.qrArt}function ET({open:e,selectedInterAgent:r,visibleAgentSession:a,agentSessionPending:i,agentSessionLoading:o,agentSessionFeedback:u,agentSessionCopied:d,agentSessionPeekViewportRef:f,handlePeekAgentSessionScroll:p,handleCopyAgentSessionCommand:h,handleOpenAgentSession:y,closeAgentSessionPeek:b,renderLocalPathValue:v,s:j}){return!e||!r?null:l.jsx("div",{className:"fixed inset-0 z-40 flex items-center justify-center p-6",style:{backgroundColor:"rgba(244, 240, 232, 0.72)",backdropFilter:"blur(6px)"},onClick:b,children:l.jsxs("div",{className:"w-full max-w-5xl h-[78vh] border rounded-2xl overflow-hidden flex flex-col",style:{backgroundColor:g.surface,borderColor:g.border,boxShadow:"0 24px 72px rgba(15, 23, 42, 0.16)"},onClick:C=>C.stopPropagation(),children:[l.jsxs("div",{className:"px-4 h-14 border-b flex items-center justify-between gap-3 shrink-0",style:{borderBottomColor:g.border},children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"text-[15px] font-semibold tracking-tight truncate",style:j.inkText,children:["Peek · ",r.title]}),l.jsx("div",{className:"text-[11px] truncate mt-0.5",style:j.mutedText,children:i?"Checking tmux pane and runtime logs for the selected agent.":a?.subtitle??"No live session output available yet."})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a?.commandLabel?l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:h,children:d?"Copied":"Copy Attach"}):null,a&&a.mode!=="none"?l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:y,children:a.mode==="tmux"?"Open TMUX":"Open Logs"}):null,l.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:b,children:[l.jsx(kl,{size:12}),"Close"]})]})]}),l.jsxs("div",{className:"px-4 py-2 border-b flex items-center gap-2 flex-wrap text-[10px] shrink-0",style:{borderBottomColor:g.border,color:g.muted},children:[l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:a?.mode==="tmux"?j.activePill:j.tagBadge,children:i?"Loading":a?.mode==="tmux"?"TMUX":a?.mode==="logs"?"Logs":"Unavailable"}),a?.harness??r.harness?l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:j.tagBadge,children:a?.harness??r.harness}):null,a?.transport??r.transport?l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:j.tagBadge,children:a?.transport??r.transport}):null,a?.sessionId??r.sessionId?l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:j.tagBadge,children:a?.sessionId??r.sessionId}):null,a?.updatedAtLabel?l.jsxs("span",{children:["Updated ",a.updatedAtLabel]}):null,typeof a?.lineCount=="number"&&a.lineCount>0?l.jsxs("span",{children:[a.lineCount," lines"]}):null,a?.truncated?l.jsx("span",{children:"Tail only"}):null,l.jsx("span",{children:"Refreshing live while open"})]}),l.jsx("div",{className:"flex-1 overflow-hidden",style:{backgroundColor:g.bg},children:o&&!a?l.jsx("div",{className:"px-4 py-8 text-[12px]",style:j.mutedText,children:"Loading live session…"}):a?.body?l.jsx("pre",{ref:C=>{f.current=C},onScroll:p,className:"h-full px-4 py-4 text-[11px] leading-[1.58] overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words",style:{color:g.ink,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:a.body}):l.jsx("div",{className:"px-4 py-8 text-[12px] leading-[1.65]",style:j.mutedText,children:i?"Checking for a live tmux pane first, then falling back to canonical runtime logs.":a?.subtitle??"No session output available yet."})}),l.jsxs("div",{className:"px-4 h-10 border-t flex items-center justify-between gap-3 shrink-0 text-[10px]",style:{borderTopColor:g.border,color:g.muted},children:[l.jsx("div",{className:"truncate min-w-0",children:v(a?.pathLabel??Ka(r.cwd??r.projectRoot)??"No stable session path yet.",{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"})}),u?l.jsx("div",{style:j.inkText,children:u}):null]})]})})}function RT({open:e,setOpen:r,agentableProjects:a,createAgentDraft:i,setCreateAgentDraft:o,createAgentDefaults:u,createAgentSubmitting:d,createAgentFeedback:f,setCreateAgentFeedback:p,handleBrowseCreateAgentProject:h,handleCreateAgent:y,availableAgentHarnesses:b,s:v}){return l.jsx(e0,{open:e,onOpenChange:r,children:l.jsxs(t0,{className:"sm:max-w-xl",children:[l.jsxs(n0,{children:[l.jsx(l0,{children:"New Agent"}),l.jsx(r0,{children:"Pick a project, choose a harness, and start a local relay agent without leaving the homepage."})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-[11px] font-mono uppercase tracking-widest",style:v.mutedText,children:"Project"}),l.jsxs("select",{className:"w-full rounded-lg border px-3 py-2.5 text-[13px] outline-none",style:{borderColor:g.border,backgroundColor:g.surface,color:g.ink},value:a.find(j=>j.root===i.projectPath)?.id??"",onChange:j=>{const C=a.find(E=>E.id===j.target.value)??null;C&&(o(E=>({...E,projectPath:C.root,harness:ap(C.defaultHarness||E.harness)})),p(null))},children:[l.jsx("option",{value:"",children:"Select a discovered project"}),a.map(j=>l.jsxs("option",{value:j.id,children:[j.title," · ",Ka(j.root)??j.root]},j.id))]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-[11px] font-mono uppercase tracking-widest",style:v.mutedText,children:"Path"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(rp,{value:i.projectPath,onChange:j=>{o(C=>({...C,projectPath:j.target.value})),p(null)},placeholder:u.projectPath||"/path/to/project",className:"h-10"}),l.jsxs(Nt,{type:"button",variant:"outline",className:"shrink-0",onClick:h,children:[l.jsx(da,{size:14}),"Browse"]})]})]}),l.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-[1fr_160px]",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-[11px] font-mono uppercase tracking-widest",style:v.mutedText,children:"Agent Name"}),l.jsx(rp,{value:i.agentName,onChange:j=>{o(C=>({...C,agentName:j.target.value})),p(null)},placeholder:"Optional. Defaults to the project name.",className:"h-10"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-[11px] font-mono uppercase tracking-widest",style:v.mutedText,children:"Harness"}),l.jsx("select",{className:"w-full rounded-lg border px-3 py-2.5 text-[13px] outline-none",style:{borderColor:g.border,backgroundColor:g.surface,color:g.ink},value:i.harness,onChange:j=>{o(C=>({...C,harness:ap(j.target.value)})),p(null)},children:b.map(j=>l.jsx("option",{value:j,children:j},j))})]})]}),l.jsx("div",{className:"rounded-lg border px-3 py-3 text-[12px] leading-[1.6]",style:{borderColor:g.border,backgroundColor:g.surface,color:g.muted},children:"Scout will create the relay-agent config if needed, start the session, then refresh the desktop shell so the new agent appears immediately."}),f?l.jsx("div",{className:"text-[12px] leading-[1.6]",style:{color:"#b91c1c"},children:f}):null]}),l.jsxs(wT,{children:[l.jsx(Nt,{type:"button",variant:"outline",onClick:()=>r(!1),disabled:d,children:"Cancel"}),l.jsx(Nt,{type:"button",onClick:y,disabled:d||!i.projectPath.trim(),children:d?l.jsxs(l.Fragment,{children:[l.jsx(un,{className:"mr-2"}),"Starting…"]}):l.jsxs(l.Fragment,{children:[l.jsx($i,{size:14}),"Create Agent"]})})]})]})})}function MT({open:e,handleFeedbackDialogOpenChange:r,feedbackDraft:a,setFeedbackDraft:i,feedbackSubmission:o,feedbackActionPending:u,feedbackBundleLoading:d,feedbackBundle:f,feedbackBundleError:p,feedbackActionMessage:h,handleSubmitFeedbackReport:y,handleRefreshFeedbackBundle:b,handleRepairSetup:v,handleCopyFeedbackBundle:j,s:C}){return l.jsx(e0,{open:e,onOpenChange:r,children:l.jsxs(t0,{className:"sm:max-w-3xl",children:[l.jsxs(n0,{children:[l.jsx(l0,{children:"Feedback"}),l.jsx(r0,{children:"Submit feedback directly, copy a support bundle, inspect the local Scout environment, or repair onboarding and background services without leaving the current screen."})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("div",{className:"text-[12px] font-medium",style:C.inkText,children:"What should we look at?"}),l.jsx(ST,{value:a,onChange:E=>i(E.target.value),placeholder:"Describe the issue, what you expected, and what Scout did instead.",className:"min-h-24 resize-y",disabled:u==="submit"}),o?l.jsxs("div",{className:"text-[11px] leading-[1.5]",style:C.mutedText,children:["Latest submission: ",l.jsx("a",{href:o.adminUrl,target:"_blank",rel:"noreferrer",className:"underline",children:o.key})]}):null]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs(Nt,{type:"button",onClick:y,disabled:d||u!==null,children:[u==="submit"?l.jsx(un,{className:"mr-2"}):l.jsx(C1,{size:14}),"Submit Feedback"]}),l.jsxs(Nt,{type:"button",variant:"outline",onClick:b,disabled:d||u!==null,children:[u==="refresh"?l.jsx(un,{className:"mr-2"}):l.jsx(xn,{size:14}),"Refresh"]}),l.jsxs(Nt,{type:"button",variant:"outline",onClick:v,disabled:d||u!==null,children:[u==="repair"?l.jsx(un,{className:"mr-2"}):l.jsx(T1,{size:14}),"Repair Setup"]}),l.jsxs(Nt,{type:"button",onClick:j,disabled:d||u!==null||!f?.text,children:[u==="copy"?l.jsx(un,{className:"mr-2"}):l.jsx(Nr,{size:14}),"Copy Support Bundle"]})]}),h?l.jsx("div",{className:"text-[12px] leading-[1.6]",style:C.inkText,children:h}):null,p?l.jsx("div",{className:"text-[12px] leading-[1.6]",style:{color:"#b91c1c"},children:p}):null,l.jsxs("div",{className:"max-h-[60vh] space-y-3 overflow-y-auto pr-1",style:{scrollbarGutter:"stable both-edges"},children:[d&&!f?l.jsxs("div",{className:"flex items-center gap-2 text-[12px]",style:C.mutedText,children:[l.jsx(un,{className:"text-[14px]"}),"Loading support details…"]}):null,f?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"rounded-lg border px-3 py-2.5 text-[11px] leading-[1.6]",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsx("span",{className:"font-mono uppercase tracking-widest",style:C.mutedText,children:"Generated"}),l.jsx("div",{className:"mt-1",style:C.inkText,children:f.generatedAtLabel})]}),f.sections.map(E=>l.jsxs("section",{className:"rounded-xl border",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsx("div",{className:"border-b px-4 py-3",style:{borderBottomColor:g.border},children:l.jsx("h3",{className:"text-[12px] font-semibold tracking-tight",style:C.inkText,children:E.title})}),l.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:E.entries.map(w=>l.jsxs("div",{className:"grid grid-cols-1 gap-1 px-4 py-3 text-[12px] leading-[1.6] sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3",children:[l.jsx("div",{className:"font-mono uppercase tracking-widest",style:C.mutedText,children:w.label}),l.jsx("div",{className:"break-words",style:C.inkText,children:w.value})]},`${E.id}-${w.label}`))})]},E.id))]}):null]})]})]})})}function zT({children:e,dark:r,setDark:a,C:i,s:o,productSurface:u,setProductSurface:d,activeView:f,setActiveView:p,desktopFeatures:h,pairingSurfaceBadge:y,openRelayDiagnostics:b,relayStatusTitle:v,relayRuntimeBooting:j,relayStatusDotClassName:C,relayStatusLabel:E,runtime:w,headerAgentCount:M,appReloadPending:D,handleReloadApp:H,handleQuitApp:X,navViews:q,collapsibleViews:L,isCollapsed:B,setIsCollapsed:F,pairingSurfaceProps:Z,isAgentSessionPeekOpen:O,selectedInterAgent:P,visibleAgentSession:Q,agentSessionPending:oe,agentSessionLoading:J,agentSessionFeedback:ee,agentSessionCopied:N,agentSessionPeekViewportRef:Y,handlePeekAgentSessionScroll:$,closeAgentSessionPeek:ye,handleCopyAgentSessionCommand:T,handleOpenAgentSession:_,renderLocalPathValue:le,isCreateAgentDialogOpen:R,setIsCreateAgentDialogOpen:pe,agentableProjects:xe,createAgentDraft:ce,setCreateAgentDraft:Re,createAgentDefaults:Te,createAgentSubmitting:Ne,createAgentFeedback:He,setCreateAgentFeedback:Le,handleBrowseCreateAgentProject:Ue,handleCreateAgent:it,availableAgentHarnesses:tt,isFeedbackDialogOpen:st,handleFeedbackDialogOpenChange:ot,feedbackDraft:bt,setFeedbackDraft:Ye,feedbackSubmission:Ge,feedbackActionPending:We,feedbackBundleLoading:we,feedbackBundle:et,feedbackBundleError:Se,feedbackActionMessage:Ze,handleSubmitFeedbackReport:mt,handleRefreshFeedbackBundle:ae,handleRepairSetup:ge,handleCopyFeedbackBundle:Ce,openFeedbackDialog:_e,openKnowledgeBase:Xe,logsAttentionLevel:Ae,logsButtonTitle:ue,footerTimeLabel:Ee}){return l.jsxs("div",{className:`flex flex-col h-screen w-full font-sans overflow-hidden${r?" dark":""}`,style:o.root,children:[l.jsxs("div",{className:"scout-window-bar h-12 border-b flex items-center px-3 shrink-0 z-10 gap-3",style:o.topBar,children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{type:"button",className:"w-5 h-5 rounded-md flex items-center justify-center transition-colors hover:bg-[var(--os-hover)]",style:{WebkitAppRegion:"no-drag",color:i.muted},onClick:X,"aria-label":"Quit",title:"Quit",children:l.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:l.jsx("path",{d:"M1 1l6 6M7 1l-6 6"})})}),l.jsx("div",{className:"flex items-center gap-1.5 ml-2",children:[["relay","Relay",h.relay],["pairing","Pairing",h.pairing]].filter(([,,V])=>V).map(([V,me])=>{const je=u===V,Fe=V==="pairing"?y:null;return l.jsxs("button",{type:"button",onClick:()=>d(V),className:"flex items-center gap-2 rounded-lg border px-2.5 py-1 text-[12px] font-semibold tracking-tight transition-colors",style:je?{backgroundColor:i.surface,borderColor:i.border,color:i.ink,boxShadow:"0 1px 0 rgba(0,0,0,0.04)"}:{backgroundColor:i.bg,borderColor:i.border,color:i.muted},children:[l.jsx(_S,{surface:V,active:je}),l.jsx("span",{children:me}),Fe?l.jsx("span",{className:"rounded-full border px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.08em]",style:{backgroundColor:Fe.backgroundColor,borderColor:Fe.borderColor,color:Fe.color},children:Fe.label}):null]},V)})})]}),l.jsx("div",{className:"flex-1 self-stretch min-w-[120px] rounded-md cursor-grab active:cursor-grabbing","aria-hidden":"true"}),l.jsxs("div",{className:"flex items-center gap-5 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-3 font-mono text-[9px] uppercase tracking-wider",style:o.mutedText,children:[l.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1.5 rounded-full border px-2 py-1 transition-opacity hover:opacity-80",style:{borderColor:i.border},title:v,children:["Relay",j?l.jsx(un,{className:"text-[11px]",style:{color:i.muted},"aria-label":"Syncing relay status"}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${C}`}),l.jsx("span",{className:"font-medium",style:o.inkText,children:E})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:["Agents ",l.jsx("span",{className:"font-medium",style:o.inkText,children:M})]})]}),l.jsxs("div",{className:"flex items-center gap-2",style:o.mutedText,children:[l.jsx("button",{onClick:()=>a(V=>!V),className:"p-1 rounded transition-colors hover:opacity-70",title:r?"Switch to light mode":"Switch to dark mode",children:r?l.jsx(E1,{size:14}):l.jsx(w1,{size:14})}),l.jsx("button",{className:"hover:opacity-70 transition-opacity",onClick:H,title:D?"Reloading…":"Reload app",disabled:D,children:D?l.jsx(un,{className:"text-[14px]"}):l.jsx(xn,{size:14})})]})]})]}),u==="relay"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-1 overflow-hidden os-fade-in",children:[l.jsxs("div",{className:"w-12 border-r flex flex-col items-center py-2 gap-3 shrink-0 z-10",style:o.navBar,children:[l.jsx("div",{className:"flex flex-col gap-1 w-full px-2 mt-2",style:o.mutedText,children:q.map(({id:V,icon:me,title:je,badgeCount:Fe})=>l.jsxs("button",{onClick:()=>p(V),title:je,className:"relative p-1.5 rounded flex items-center justify-center transition-colors",style:f===V?o.activePill:void 0,children:[me,Fe?l.jsx("span",{className:"absolute -top-1 -right-1 min-w-[16px] h-4 px-1 rounded-full text-[9px] font-mono flex items-center justify-center",style:{backgroundColor:"#f97316",color:"#fff7ed"},children:Fe>9?"9+":Fe}):null]},V))}),l.jsxs("div",{className:"mt-auto flex flex-col gap-1 items-center w-full px-2",children:[L.has(f)?l.jsx("button",{onClick:()=>F(V=>!V),className:"p-1.5 rounded flex items-center justify-center transition-opacity hover:opacity-70",style:o.mutedText,title:B?"Expand Sidebar":"Collapse Sidebar",children:B?l.jsx(y2,{size:16,strokeWidth:1.5}):l.jsx(g2,{size:16,strokeWidth:1.5})}):null,h.settings?l.jsx("button",{className:"p-1.5 rounded flex items-center justify-center transition-colors",style:f==="settings"?o.activePill:o.mutedText,title:"Settings",onClick:()=>p("settings"),children:l.jsx($a,{size:16,strokeWidth:1.5})}):null]})]}),e]}),l.jsx(ET,{open:O,selectedInterAgent:P,visibleAgentSession:Q,agentSessionPending:oe,agentSessionLoading:J,agentSessionFeedback:ee,agentSessionCopied:N,agentSessionPeekViewportRef:Y,handlePeekAgentSessionScroll:$,handleCopyAgentSessionCommand:T,handleOpenAgentSession:_,closeAgentSessionPeek:ye,renderLocalPathValue:le,s:o})]}):l.jsx(OS,{...Z}),l.jsx(RT,{open:R,setOpen:pe,agentableProjects:xe,createAgentDraft:ce,setCreateAgentDraft:Re,createAgentDefaults:Te,createAgentSubmitting:Ne,createAgentFeedback:He,setCreateAgentFeedback:Le,handleBrowseCreateAgentProject:Ue,handleCreateAgent:it,availableAgentHarnesses:tt,s:o}),l.jsx(MT,{open:st,handleFeedbackDialogOpenChange:ot,feedbackDraft:bt,setFeedbackDraft:Ye,feedbackSubmission:Ge,feedbackActionPending:We,feedbackBundleLoading:we,feedbackBundle:et,feedbackBundleError:Se,feedbackActionMessage:Ze,handleSubmitFeedbackReport:mt,handleRefreshFeedbackBundle:ae,handleRepairSetup:ge,handleCopyFeedbackBundle:Ce,s:o}),l.jsxs("div",{className:"h-6 border-t flex items-center justify-between px-3 shrink-0 text-[9px] font-mono uppercase tracking-widest",style:{backgroundColor:i.bg,borderTopColor:i.border,color:i.muted},children:[l.jsx("div",{className:"flex items-center gap-4",children:l.jsxs("button",{type:"button",onClick:()=>{d("relay"),p("overview")},className:"flex items-center gap-1 hover:opacity-70 cursor-pointer transition-opacity",children:[l.jsx(Cp,{size:9})," Home"]})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("button",{type:"button",onClick:_e,className:"flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:opacity-80",style:st?o.activePill:o.mutedText,title:"Feedback",children:[l.jsx(Al,{size:9}),l.jsx("span",{children:"Feedback"})]}),l.jsxs("button",{type:"button",onClick:Xe,className:"flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:opacity-80",style:f==="help"?o.activePill:o.mutedText,title:"Help",children:[l.jsx(x1,{size:9}),l.jsx("span",{children:"Help"})]}),l.jsxs("button",{onClick:()=>{d("relay"),p("logs")},className:"flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:opacity-80",style:f==="logs"?o.activePill:o.mutedText,title:ue,children:[l.jsx(No,{size:9}),l.jsx("span",{children:"Logs"}),Ae?l.jsx("span",{className:`block w-1.5 h-1.5 rounded-full ${Ae==="error"?"bg-rose-500":"bg-amber-500"}`}):null]}),l.jsx("span",{className:"w-px h-3",style:{backgroundColor:i.border}}),l.jsx("span",{style:o.inkText,children:Ee})]})]})]})}function OT(e,r){return e==="working"?r.activePill:e==="available"?{backgroundColor:"rgba(34, 197, 94, 0.12)",color:"#166534"}:r.tagBadge}function LT({C:e,s:r,bootLoader:a,homeAgents:i,activity:o,shellError:u,onRefresh:d,onOpenAgent:f,colorForIdentity:p}){const h=z.useMemo(()=>i.slice(0,8),[i]),y=z.useMemo(()=>o.slice(0,18),[o]),b=z.useCallback(async(v,j)=>{if(v.stopPropagation(),!(typeof navigator>"u"||!navigator.clipboard?.writeText))try{await navigator.clipboard.writeText(j)}catch{}},[]);return l.jsx("div",{className:"flex-1 flex overflow-hidden",children:l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("div",{className:"w-full px-8 py-8",children:[l.jsxs("div",{className:"flex items-center justify-between mb-8",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-[22px] font-semibold tracking-tight",style:r.inkText,children:"Home"}),l.jsx("p",{className:"text-[12px] mt-1 leading-[1.6]",style:r.mutedText,children:"Recent agents and the latest relay activity."})]}),l.jsx("button",{onClick:d,className:"os-btn flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-[12px] transition-colors",style:{color:e.muted},title:"Refresh",children:l.jsx(xn,{size:13})})]}),l.jsxs("section",{className:"mb-8",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h2",{className:"text-[16px] font-semibold",style:r.inkText,children:"Recent Agents"}),i.length>h.length?l.jsxs("div",{className:"text-[11px]",style:r.mutedText,children:["Top ",h.length," by recent activity"]}):null]}),h.length>0?l.jsx("div",{className:"-mx-2 overflow-x-auto px-2 pb-2",children:l.jsx("div",{className:"flex gap-3 min-w-max",children:h.map(v=>l.jsx("button",{type:"button",onClick:()=>f(v.id),className:"w-[220px] shrink-0 text-left rounded-xl border px-4 py-3 transition-colors hover:opacity-90",style:{borderColor:e.border,backgroundColor:e.surface},children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-full text-white flex items-center justify-center text-[12px] font-bold shrink-0",style:{backgroundColor:p(v.id)},title:v.title,children:v.title.charAt(0).toUpperCase()}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("div",{className:"text-[13px] font-semibold truncate",style:r.inkText,children:v.title}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded-full",style:OT(v.state,r),children:v.statusLabel})]}),v.role?l.jsx("div",{className:"text-[11px] mt-1 truncate",style:r.mutedText,children:v.role}):null,v.statusDetail?l.jsx("div",{className:"text-[11px] mt-2 line-clamp-2",style:r.mutedText,children:v.statusDetail}):v.summary?l.jsx("div",{className:"text-[11px] mt-2 line-clamp-2",style:r.mutedText,children:v.summary}):null,v.timestampLabel?l.jsxs("div",{className:"text-[10px] mt-2 uppercase tracking-[0.12em]",style:r.mutedText,children:["Active ",v.timestampLabel]}):null]})]})},v.id))})}):l.jsx("div",{className:"rounded-xl border px-4 py-6 text-[13px]",style:{borderColor:e.border,color:e.muted},children:"No agents are visible yet."})]}),l.jsxs("section",{children:[l.jsx("div",{className:"flex items-center justify-between mb-4",children:l.jsx("h2",{className:"text-[16px] font-semibold",style:r.inkText,children:"Activity Stream"})}),a?l.jsx("div",{className:"min-h-[20rem] flex items-center justify-center rounded-xl border px-6 py-8",style:{borderColor:e.border,backgroundColor:e.surface},children:a}):y.length>0?l.jsx("div",{className:"divide-y rounded-xl border overflow-hidden",style:{borderColor:e.border},children:y.map(v=>l.jsxs("div",{className:"group relative flex items-start gap-4 px-4 py-4",style:{backgroundColor:e.surface},children:[l.jsx("button",{type:"button",className:"relative shrink-0 mt-0.5",onClick:()=>f(v.actorId),title:v.actorName,children:l.jsx("div",{className:"w-9 h-9 rounded-full text-white flex items-center justify-center text-[12px] font-bold",style:{backgroundColor:p(v.actorId)},children:v.actorName.slice(0,1).toUpperCase()})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[l.jsx("button",{type:"button",className:"text-[13px] font-semibold transition-opacity hover:opacity-75",style:r.inkText,onClick:()=>f(v.actorId),title:`Open ${v.actorName}`,children:v.actorName}),v.kind==="system"?l.jsx("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full",style:r.tagBadge,children:"system"}):v.channel?l.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full",style:r.tagBadge,children:["#",v.channel]}):null,l.jsx("span",{className:"flex-1"}),l.jsxs("span",{className:"text-[11px] flex items-center gap-1",style:r.mutedText,children:[l.jsx(Zi,{size:10}),v.timestampLabel]})]}),l.jsx("div",{className:"text-[13px] leading-[1.65]",style:r.mutedText,children:v.detail??v.title})]}),v.detail?l.jsx("div",{className:"absolute right-3 top-3 flex items-center gap-0.5 rounded-lg border p-1 opacity-0 group-hover:opacity-100 transition-opacity",style:{backgroundColor:e.bg,borderColor:e.border},children:l.jsx("button",{onClick:j=>{b(j,v.detail??"")},className:"p-1 rounded hover:opacity-70",style:{color:e.muted},title:"Copy",children:l.jsx(Nr,{size:12})})}):null]},v.id))}):l.jsx("div",{className:"py-16 text-center border rounded-xl",style:{borderColor:e.border},children:l.jsx("div",{className:"text-[13px]",style:r.mutedText,children:"Waiting for recent activity..."})})]}),u?l.jsx("div",{className:"mt-6 rounded-xl border px-4 py-3",style:{borderColor:e.border,backgroundColor:e.surface},children:l.jsxs("div",{className:"flex items-center gap-2 text-[12px]",style:r.mutedText,children:[l.jsx(kl,{size:12}),l.jsx("span",{children:u})]})}):null]})})})}function DT({activeView:e,overviewViewProps:r,inbox:a,activity:i}){return e==="overview"?l.jsx(LT,{...r}):e==="inbox"?l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:a.styles.surface,children:[l.jsxs("div",{className:"border-b shrink-0 px-6 py-5",style:{borderBottomColor:g.border},children:[l.jsx("div",{className:"flex items-start justify-between gap-6",children:l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-2",style:a.styles.mutedText,children:"Inbox"}),l.jsx("h1",{className:"text-[28px] font-semibold tracking-tight",style:a.styles.inkText,children:"Things You Asked Scout To Tell You About"}),l.jsx("p",{className:"text-[13px] mt-2 max-w-3xl leading-[1.65]",style:a.styles.mutedText,children:"Notifications are opt-in. This surface is reserved for approvals, failed asks, and other subscribed updates that are actually worth surfacing."})]})}),l.jsx("div",{className:"grid grid-cols-4 gap-3 mt-5",children:[{label:"Needs You",value:`${a.inboxAlertCount}`,detail:`${a.pendingApprovalsCount} approvals · ${a.inboxFailedTaskCount} failed asks`},{label:"Approvals",value:`${a.pendingApprovalsCount}`,detail:"Inline pairing actions"},{label:"Failures",value:`${a.inboxFailedTaskCount}`,detail:"Failed asks from plans"},{label:"Policy",value:"Opt-in",detail:"Progress and watchlists stay elsewhere"}].map(o=>l.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:a.styles.mutedText,children:o.label}),l.jsx("div",{className:"text-[24px] font-semibold mt-2",style:a.styles.inkText,children:o.value}),l.jsx("div",{className:"text-[11px] mt-1",style:a.styles.mutedText,children:o.detail})]},o.label))})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:l.jsxs("div",{className:"grid grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)] gap-4",children:[l.jsxs("section",{className:"border rounded-xl overflow-hidden min-w-0",style:{...a.styles.surface,borderColor:g.border},children:[l.jsxs("div",{className:"px-4 py-3 border-b flex items-center justify-between gap-3",style:{borderBottomColor:g.border},children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:a.styles.mutedText,children:"Needs You"}),l.jsx("div",{className:"text-[11px] mt-1",style:a.styles.mutedText,children:"Approvals and failed asks that are worth interrupting for."})]}),l.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:a.inboxAlertCount>0?a.styles.activePill:a.styles.tagBadge,children:[a.inboxAlertCount," items"]})]}),l.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:a.inboxAwaitingYouItems.length>0?a.inboxAwaitingYouItems.map(o=>l.jsx("div",{className:"px-4 py-4",style:{backgroundColor:g.surface},children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:o.tone==="critical"?{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"}:o.tone==="warning"?{backgroundColor:"rgba(251, 191, 36, 0.16)",color:"#92400e"}:a.styles.activePill,children:o.kind}),l.jsx("span",{className:"text-[9px] font-mono",style:a.styles.mutedText,children:o.meta})]}),l.jsx("div",{className:"text-[13px] font-medium mt-2 leading-[1.5]",style:a.styles.inkText,children:o.title}),l.jsx("div",{className:"text-[11px] mt-1 leading-[1.6]",style:a.styles.mutedText,children:o.summary}),o.detail&&o.detail!==o.summary?l.jsx("div",{className:"mt-2 rounded-lg border px-3 py-2 text-[11px] leading-[1.6]",style:{borderColor:g.border,backgroundColor:g.bg,color:g.muted},children:o.detail}):null]}),l.jsxs("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[l.jsx("button",{type:"button",onClick:o.onAction,className:"text-[10px] font-medium hover:opacity-80",style:{color:g.accent},children:o.actionLabel}),o.onSecondaryAction&&o.secondaryActionLabel?l.jsx("button",{type:"button",onClick:o.onSecondaryAction,className:"text-[10px] font-medium hover:opacity-80",style:a.styles.mutedText,children:o.secondaryActionLabel}):null]})]})},o.id)):l.jsx("div",{className:"px-4 py-10 text-[12px] text-center",style:a.styles.mutedText,children:"Nothing urgent right now."})})]}),l.jsx("div",{className:"space-y-4 min-w-0",children:l.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...a.styles.surface,borderColor:g.border},children:[l.jsxs("div",{className:"px-4 py-3 border-b",style:{borderBottomColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:a.styles.mutedText,children:"Notes"}),l.jsx("div",{className:"text-[11px] mt-1",style:a.styles.mutedText,children:"This is UI-only for now, backed by existing desktop state instead of durable broker attention events."})]}),l.jsx("div",{className:"px-4 py-4 text-[11px] leading-[1.7]",style:a.styles.mutedText,children:"Inbox is currently limited to approvals and failed asks. Agent progress, stale/problem states, and cleanup flows stay in other parts of Scout."})]})})]})})]})}):e!=="activity"?null:l.jsxs(l.Fragment,{children:[!i.isCollapsed&&l.jsxs("div",{style:{width:i.sidebarWidth,...i.styles.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[l.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:i.onResizeStart}),l.jsxs("div",{className:"px-4 py-3 border-b",style:{borderBottomColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:i.styles.mutedText,children:"Activity Monitor"}),l.jsx("div",{className:"text-[13px] font-semibold tracking-tight mt-1",style:i.styles.inkText,children:"System-wide watch"}),l.jsx("div",{className:"text-[11px] leading-[1.5] mt-1",style:i.styles.mutedText,children:"Asks, blockers, runtime signals, and recent coordination across Scout."})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-4",children:[l.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsx("div",{className:"text-[9px] font-mono tracking-widest uppercase mb-3",style:i.styles.mutedText,children:"Right Now"}),l.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{label:"Running",value:`${i.plansState?.runningTaskCount??0}`},{label:"Watchlist",value:`${i.plansState?.findingCount??0}`},{label:"Agents",value:`${i.runtime?.agentCount??0}`},{label:"Nodes",value:`${i.machinesState?.onlineCount??0}`}].map(o=>l.jsxs("div",{className:"rounded-lg border px-3 py-2",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:i.styles.mutedText,children:o.label}),l.jsx("div",{className:"text-[18px] font-semibold mt-1",style:i.styles.inkText,children:o.value})]},o.label))})]}),l.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsx("div",{className:"text-[9px] font-mono tracking-widest uppercase mb-2",style:i.styles.mutedText,children:"Lead Task"}),i.activityLeadTask?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-[12px] font-medium leading-[1.5]",style:i.styles.inkText,children:i.activityLeadTask.title}),l.jsxs("div",{className:"text-[10px] mt-1 leading-[1.5]",style:i.styles.mutedText,children:[i.activityLeadTask.targetAgentName," · ",i.activityLeadTask.statusLabel," · ",i.activityLeadTask.ageLabel??i.activityLeadTask.updatedAtLabel??"now"]}),i.activityLeadTask.statusDetail?l.jsx("div",{className:"text-[11px] mt-2 leading-[1.55]",style:i.styles.mutedText,children:i.activityLeadTask.statusDetail}):null,l.jsxs("button",{type:"button",onClick:()=>i.onOpenAgentProfile(i.activityLeadTask.targetAgentId),className:"mt-3 text-[10px] font-medium hover:opacity-80",style:{color:g.accent},children:["Open ",i.activityLeadTask.targetAgentName]})]}):l.jsx("div",{className:"text-[11px] leading-[1.5]",style:i.styles.mutedText,children:"No active asks are visible yet."})]}),l.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsx("div",{className:"text-[9px] font-mono tracking-widest uppercase mb-2",style:i.styles.mutedText,children:"View Model"}),l.jsxs("div",{className:"space-y-2 text-[11px] leading-[1.5]",style:i.styles.mutedText,children:[l.jsx("div",{children:"Task-first rows, not micro chat."}),l.jsx("div",{children:"Watchlist surfaces blockers and stale work."}),l.jsx("div",{children:"Runtime stays visible without becoming the main story."})]})]})]})]}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:i.styles.surface,children:[l.jsxs("div",{className:"border-b shrink-0 px-6 py-5",style:{borderBottomColor:g.border},children:[l.jsxs("div",{className:"flex items-start justify-between gap-6",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-2",style:i.styles.mutedText,children:"Activity Monitor"}),l.jsx("h1",{className:"text-[28px] font-semibold tracking-tight",style:i.styles.inkText,children:"Everything Scout Is Coordinating"}),l.jsx("p",{className:"text-[13px] mt-2 max-w-3xl leading-[1.65]",style:i.styles.mutedText,children:"A system-wide operational picture of asks, handoffs, runtime signals, human interventions, and recent coordination. This is the control-room view, not just the mesh view."})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsxs("button",{type:"button",onClick:i.onRefresh,className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},children:[l.jsx(xn,{size:14}),"Refresh"]}),l.jsxs("button",{type:"button",onClick:i.onOpenPlans,className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},children:[l.jsx(Sp,{size:14}),"Open Plans"]}),l.jsxs("button",{type:"button",onClick:i.onOpenMessages,className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},children:[l.jsx(Al,{size:14}),"Open Messages"]})]})]}),l.jsx("div",{className:"grid grid-cols-4 gap-3 mt-5",children:[{label:"Work In Flight",value:`${i.plansState?.runningTaskCount??0}`,detail:`${i.plansState?.taskCount??0} total asks`},{label:"Watchlist",value:`${i.plansState?.findingCount??0}`,detail:`${i.plansState?.errorCount??0} errors · ${i.plansState?.warningCount??0} warnings`},{label:"Live Runtime",value:`${i.activityEndpoints.filter(o=>o.endpoint.state==="running").length}`,detail:`${i.runtime?.tmuxSessionCount??0} sessions visible`},{label:"Recent Coordination",value:`${i.activityRecentMessages.length}`,detail:`${i.runtime?.messageCount??0} broker messages captured`}].map(o=>l.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:i.styles.mutedText,children:o.label}),l.jsx("div",{className:"text-[24px] font-semibold mt-2",style:i.styles.inkText,children:o.value}),l.jsx("div",{className:"text-[11px] mt-1",style:i.styles.mutedText,children:o.detail})]},o.label))})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:l.jsxs("div",{className:"grid grid-cols-[minmax(0,1.15fr)_minmax(320px,0.85fr)] gap-4",children:[l.jsxs("div",{className:"space-y-4 min-w-0",children:[l.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...i.styles.surface,borderColor:g.border},children:[l.jsxs("div",{className:"px-4 py-3 border-b flex items-center justify-between gap-3",style:{borderBottomColor:g.border},children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:i.styles.mutedText,children:"Work Feed"}),l.jsx("div",{className:"text-[11px] mt-1",style:i.styles.mutedText,children:"Task-level asks and routed work, newest first."})]}),l.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:i.styles.activePill,children:[i.activityTasks.length," rows"]})]}),l.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:i.activityTasks.length>0?i.activityTasks.map(o=>l.jsx("div",{className:"px-4 py-4",style:{backgroundColor:g.surface},children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:o.status==="running"?i.styles.activePill:o.status==="failed"?{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"}:o.status==="completed"?{backgroundColor:"rgba(34, 197, 94, 0.12)",color:"#166534"}:i.styles.tagBadge,children:o.statusLabel}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:i.styles.tagBadge,children:o.targetAgentName}),o.project?l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:i.styles.tagBadge,children:o.project}):null]}),l.jsx("div",{className:"text-[13px] font-medium mt-2 leading-[1.5]",style:i.styles.inkText,children:o.title}),o.statusDetail?l.jsx("div",{className:"text-[11px] mt-1 leading-[1.6]",style:i.styles.mutedText,children:o.statusDetail}):null,o.replyPreview?l.jsx("div",{className:"mt-2 rounded-lg border px-3 py-2 text-[11px] leading-[1.6]",style:{borderColor:g.border,backgroundColor:g.bg,color:g.muted},children:o.replyPreview}):null]}),l.jsxs("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[l.jsx("span",{className:"text-[10px] font-mono",style:i.styles.mutedText,children:o.ageLabel??o.updatedAtLabel??o.createdAtLabel}),l.jsx("button",{type:"button",onClick:()=>i.onOpenAgentProfile(o.targetAgentId),className:"text-[10px] font-medium hover:opacity-80",style:{color:g.accent},children:"Open"})]})]})},o.id)):l.jsx("div",{className:"px-4 py-10 text-[12px] text-center",style:i.styles.mutedText,children:"No task-level activity has been indexed yet."})})]}),l.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...i.styles.surface,borderColor:g.border},children:[l.jsx("div",{className:"px-4 py-3 border-b flex items-center justify-between gap-3",style:{borderBottomColor:g.border},children:l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:i.styles.mutedText,children:"Recent Coordination"}),l.jsx("div",{className:"text-[11px] mt-1",style:i.styles.mutedText,children:"The latest human, bridge, and agent interactions crossing the system."})]})}),l.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:i.activityRecentMessages.length>0?i.activityRecentMessages.map(o=>{const u=i.interAgentAgentLookup.get(o.authorId)??null,d=o.recipients.filter(f=>f!==o.authorId).slice(0,2).join(", ");return l.jsxs("div",{className:"px-4 py-3 flex items-start gap-3",style:{backgroundColor:g.surface},children:[l.jsx("div",{className:"w-8 h-8 rounded-lg text-white flex items-center justify-center text-[10px] font-bold shrink-0",style:{backgroundColor:o.avatarColor},children:o.avatarLabel}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-[12px] font-medium",style:i.styles.inkText,children:o.authorName}),o.messageClass?l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:o.messageClass==="status"?i.styles.activePill:i.styles.tagBadge,children:o.messageClass}):null,d?l.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:i.styles.tagBadge,children:["to ",d]}):null,l.jsx("span",{className:"text-[9px] font-mono",style:i.styles.mutedText,children:o.timestampLabel})]}),l.jsx("div",{className:"text-[11px] mt-1 leading-[1.6]",style:i.styles.mutedText,children:zu(o.body,220)})]}),u?l.jsx("button",{type:"button",onClick:()=>i.onOpenAgentProfile(u.id),className:"text-[10px] font-medium shrink-0 hover:opacity-80",style:{color:g.accent},children:"Open"}):null]},o.id)}):l.jsx("div",{className:"px-4 py-10 text-[12px] text-center",style:i.styles.mutedText,children:"No coordination history has been captured yet."})})]})]}),l.jsxs("div",{className:"space-y-4 min-w-0",children:[l.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...i.styles.surface,borderColor:g.border},children:[l.jsxs("div",{className:"px-4 py-3 border-b flex items-center justify-between gap-3",style:{borderBottomColor:g.border},children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:i.styles.mutedText,children:"Watchlist"}),l.jsx("div",{className:"text-[11px] mt-1",style:i.styles.mutedText,children:"Errors and warnings that may need cleanup or intervention."})]}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:i.activityFindings.some(o=>o.severity==="error")?{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"}:i.styles.tagBadge,children:i.activityFindings.length})]}),l.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:i.activityFindings.length>0?i.activityFindings.map(o=>l.jsxs("div",{className:"px-4 py-3",style:{backgroundColor:g.surface},children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsx("div",{className:"text-[12px] font-medium",style:i.styles.inkText,children:o.title}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded shrink-0",style:o.severity==="error"?{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"}:{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#b45309"},children:o.severity})]}),l.jsx("div",{className:"text-[11px] mt-1 leading-[1.55]",style:i.styles.mutedText,children:o.summary}),o.detail?l.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:i.styles.mutedText,children:o.detail}):null]},o.id)):l.jsx("div",{className:"px-4 py-10 text-[12px] text-center",style:i.styles.mutedText,children:"No blockers are visible right now."})})]}),l.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...i.styles.surface,borderColor:g.border},children:[l.jsxs("div",{className:"px-4 py-3 border-b",style:{borderBottomColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:i.styles.mutedText,children:"Runtime Signals"}),l.jsx("div",{className:"text-[11px] mt-1",style:i.styles.mutedText,children:"Active and waiting endpoints across the current mesh."})]}),l.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:i.activityEndpoints.length>0?i.activityEndpoints.map(o=>l.jsxs("div",{className:"px-4 py-3 flex items-start justify-between gap-3",style:{backgroundColor:g.surface},children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-[12px] font-medium",style:i.styles.inkText,children:o.endpoint.agentName}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:o.endpoint.state==="running"?i.styles.activePill:o.endpoint.state==="waiting"?{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#b45309"}:i.styles.tagBadge,children:o.endpoint.stateLabel})]}),l.jsxs("div",{className:"text-[10px] mt-1",style:i.styles.mutedText,children:[o.machineTitle," · ",o.endpoint.transport??"runtime"," · ",o.endpoint.project??"no project"]}),o.endpoint.activeTask?l.jsx("div",{className:"text-[11px] mt-2 leading-[1.55]",style:i.styles.mutedText,children:o.endpoint.activeTask}):null]}),l.jsx("button",{type:"button",onClick:()=>i.onOpenAgentProfile(o.endpoint.agentId),className:"text-[10px] font-medium shrink-0 hover:opacity-80",style:{color:g.accent},children:"Open"})]},o.endpoint.id)):l.jsx("div",{className:"px-4 py-10 text-[12px] text-center",style:i.styles.mutedText,children:"No runtime endpoints are visible yet."})})]}),l.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...i.styles.surface,borderColor:g.border},children:[l.jsxs("div",{className:"px-4 py-3 border-b",style:{borderBottomColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:i.styles.mutedText,children:"Recent Sessions"}),l.jsx("div",{className:"text-[11px] mt-1",style:i.styles.mutedText,children:"Fresh session history from local workspaces and harnesses."})]}),l.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:i.overviewSessions.length>0?i.overviewSessions.map(o=>l.jsx("button",{type:"button",onClick:()=>i.onOpenSessionDetail(o),className:"w-full text-left px-4 py-3 transition-opacity hover:opacity-90",style:{backgroundColor:g.surface},children:l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[12px] font-medium truncate",style:i.styles.inkText,children:o.title}),l.jsxs("div",{className:"text-[10px] mt-1",style:i.styles.mutedText,children:[o.project," · ",o.agent]})]}),l.jsx("span",{className:"text-[10px] font-mono shrink-0",style:i.styles.mutedText,children:i.formatDate(o.lastModified)})]})},o.id)):l.jsx("div",{className:"px-4 py-10 text-[12px] text-center",style:i.styles.mutedText,children:"No session history is available yet."})})]})]})]})}),l.jsx("div",{className:"h-7 border-t flex items-center px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:l.jsx("span",{className:"text-[9px] font-mono",style:i.styles.mutedText,children:"System-wide activity view: tasks first, watchlist second, runtime and coordination side by side"})})]})]})}function _T(e){return e.isLocal?l2:e.capabilities.includes("broker")?Tp:v1}function ry(e,r){switch(e){case"online":return{backgroundColor:"rgba(16, 185, 129, 0.12)",color:"#059669"};case"degraded":return{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"};case"offline":return{backgroundColor:r.tagBg,color:r.muted}}}function BT(e,r){switch(e){case"running":return{backgroundColor:"rgba(59, 130, 246, 0.12)",color:"#2563eb"};case"idle":return{backgroundColor:"rgba(16, 185, 129, 0.12)",color:"#059669"};case"waiting":return{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"};case"offline":return{backgroundColor:r.tagBg,color:r.muted}}}function IT({machinesState:e,C:r,s:a,isCollapsed:i,sidebarWidth:o,onResizeStart:u,onOpenRelayAgent:d,onRefresh:f,identityColor:p}){const[h,y]=A.useState(e.machines[0]?.id??null);A.useEffect(()=>{if(!e.machines.length){y(null);return}(!h||!e.machines.some(v=>v.id===h))&&y(e.machines[0]?.id??null)},[e.machines,h]);const b=A.useMemo(()=>e.machines.find(v=>v.id===h)??e.machines[0]??null,[e.machines,h]);return l.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[i?null:l.jsxs("div",{style:{width:o,...a.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[l.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:u}),l.jsxs("div",{className:"px-4 h-14 flex items-center justify-between border-b",style:{borderBottomColor:r.border},children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:a.inkText,children:"Machines"}),l.jsxs("div",{className:"text-[10px] font-mono mt-0.5",style:a.mutedText,children:[e.onlineCount,"/",e.totalMachines," online"]})]}),l.jsx("button",{className:"p-1.5 rounded transition-opacity hover:opacity-70",style:a.mutedText,onClick:f,children:l.jsx(xn,{size:14})})]}),l.jsx("div",{className:"p-3 border-b grid grid-cols-3 gap-2",style:{borderColor:r.border},children:[{label:"Nodes",value:e.totalMachines,icon:Tp},{label:"Live",value:e.onlineCount,icon:Xm},{label:"Warn",value:e.degradedCount,icon:Nb}].map(v=>l.jsxs("div",{className:"text-center p-2 rounded",style:{backgroundColor:r.surface},children:[l.jsx(v.icon,{size:14,className:"mx-auto mb-1",style:a.mutedText}),l.jsx("div",{className:"text-sm font-bold",style:a.inkText,children:v.value}),l.jsx("div",{className:"text-[8px] font-mono uppercase",style:a.mutedText,children:v.label})]},v.label))}),l.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:l.jsx("div",{className:"space-y-1",children:e.machines.map(v=>{const j=_T(v),C=v.id===b?.id;return l.jsx("button",{onClick:()=>y(v.id),className:"os-row w-full text-left p-3 rounded-lg transition-all",style:C?{backgroundColor:r.surface,borderColor:r.border,border:`1px solid ${r.border}`}:void 0,children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center",style:{backgroundColor:r.tagBg},children:l.jsx(j,{size:18,style:v.status==="offline"?a.mutedText:a.inkText})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("div",{className:"text-[12px] font-medium truncate",style:a.inkText,children:v.title}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:ry(v.status,r),children:v.statusLabel})]}),l.jsxs("div",{className:"text-[10px] leading-[1.5]",style:a.mutedText,children:[v.endpointCount," endpoints",v.lastSeenLabel?` · seen ${v.lastSeenLabel}`:""]})]})]})},v.id)})})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i&&e.machines.length>0?l.jsx("div",{className:"px-6 py-4 border-b flex items-center gap-2 overflow-x-auto",style:{borderColor:r.border},children:e.machines.map(v=>l.jsx("button",{onClick:()=>y(v.id),className:"os-btn border rounded-lg px-3 py-2 text-[11px] font-medium whitespace-nowrap",style:v.id===b?.id?a.activeItem:{...a.surface,borderColor:r.border,color:r.ink},children:v.title},v.id))}):null,b?l.jsxs("div",{className:"px-8 py-8 space-y-6",children:[l.jsxs("div",{className:"flex items-start justify-between gap-6",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:a.mutedText,children:"Node Detail"}),l.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[l.jsx("h1",{className:"text-[26px] font-semibold tracking-tight",style:a.inkText,children:b.title}),l.jsx("span",{className:"text-[10px] font-mono uppercase px-2 py-1 rounded",style:ry(b.status,r),children:b.statusLabel})]}),l.jsxs("div",{className:"text-[13px] leading-[1.7] max-w-2xl",style:a.mutedText,children:[b.statusDetail,b.hostName?` Host: ${b.hostName}.`:"",b.brokerUrl?` Broker: ${b.brokerUrl}.`:""]})]}),l.jsxs("button",{onClick:f,className:"os-btn border px-3 py-2 rounded-lg text-[12px] font-medium shadow-sm flex items-center gap-2",style:{...a.surface,borderColor:r.border,color:r.ink},children:[l.jsx(xn,{size:14}),"Refresh"]})]}),l.jsx("div",{className:"grid grid-cols-4 gap-4",children:[{label:"Reachable",value:b.reachableEndpointCount,icon:Xm},{label:"Running",value:b.workingEndpointCount,icon:Nb},{label:"Projects",value:b.projectCount,icon:v1},{label:"Endpoints",value:b.endpointCount,icon:go}].map(v=>l.jsxs("div",{className:"border rounded-xl p-4",style:{...a.surface,borderColor:r.border},children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",style:a.mutedText,children:[l.jsx(v.icon,{size:14}),l.jsx("span",{className:"text-[10px] font-mono uppercase tracking-widest",children:v.label})]}),l.jsx("div",{className:"text-[22px] font-semibold",style:a.inkText,children:v.value})]},v.label))}),l.jsxs("div",{className:"grid grid-cols-[minmax(0,1.2fr)_minmax(320px,0.8fr)] gap-6",children:[l.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{borderColor:r.border},children:[l.jsx("div",{className:"px-4 py-3 border-b flex items-center justify-between",style:{...a.surface,borderBottomColor:r.border},children:l.jsxs("div",{children:[l.jsx("div",{className:"text-[13px] font-semibold",style:a.inkText,children:"Runtime Endpoints"}),l.jsx("div",{className:"text-[10px] font-mono mt-1",style:a.mutedText,children:"Relay agents and sessions attached to this node"})]})}),l.jsx("div",{className:"divide-y",style:{borderColor:r.border},children:b.endpoints.length>0?b.endpoints.map(v=>l.jsxs("div",{className:"px-4 py-4",style:a.surface,children:[l.jsxs("div",{className:"flex items-start justify-between gap-4 mb-3",children:[l.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[l.jsx("div",{className:"w-8 h-8 rounded-lg text-white flex items-center justify-center text-[11px] font-bold shrink-0",style:{backgroundColor:p(v.agentId)},children:v.agentName.charAt(0).toUpperCase()}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("div",{className:"text-[13px] font-medium truncate",style:a.inkText,children:v.agentName}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:BT(v.state,r),children:v.stateLabel})]}),l.jsxs("div",{className:"text-[11px] leading-[1.6]",style:a.mutedText,children:[v.project??"No project root",v.projectRoot?` · ${v.projectRoot}`:""]})]})]}),l.jsxs("button",{onClick:()=>d(v.agentId),className:"text-[11px] font-medium flex items-center gap-1 shrink-0",style:{color:r.accent},children:["Open Relay ",l.jsx(ql,{size:12})]})]}),l.jsxs("div",{className:"grid grid-cols-4 gap-3 text-[11px]",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"Harness"}),l.jsx("div",{style:a.inkText,children:v.harness??"Unknown"})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"Transport"}),l.jsx("div",{style:a.inkText,children:v.transport??"Unknown"})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"Session"}),l.jsx("div",{style:a.inkText,children:v.sessionId??"Not reported"})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"Activity"}),l.jsx("div",{style:a.inkText,children:v.lastActiveLabel??"Not reported"})]})]}),v.activeTask?l.jsx("div",{className:"mt-3 text-[11px] leading-[1.6] border rounded-lg px-3 py-2",style:{borderColor:r.border,color:r.muted,backgroundColor:r.bg},children:v.activeTask}):null]},v.id)):l.jsx("div",{className:"px-4 py-8 text-[12px] text-center",style:{...a.surface,color:r.muted},children:"No registered endpoints on this node yet."})})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("section",{className:"border rounded-xl p-5",style:{...a.surface,borderColor:r.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:a.mutedText,children:"Machine Profile"}),l.jsx("div",{className:"space-y-3 text-[12px]",children:[["Scope",b.advertiseScope??"Not reported"],["Registered",b.registeredAtLabel??"Not reported"],["Seen",b.lastSeenLabel??"Not reported"],["Labels",b.labels.length?b.labels.join(", "):"None"]].map(([v,j])=>l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:v}),l.jsx("div",{style:a.inkText,children:j})]},v))})]}),l.jsxs("section",{className:"border rounded-xl p-5",style:{...a.surface,borderColor:r.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:a.mutedText,children:"Projects"}),b.projectRoots.length>0?l.jsx("div",{className:"space-y-2",children:b.projectRoots.map(v=>l.jsxs("div",{className:"flex items-center gap-2 text-[12px]",style:a.inkText,children:[l.jsx(WN,{size:12,style:a.mutedText}),l.jsx("span",{className:"truncate",children:v})]},v))}):l.jsx("div",{className:"text-[12px]",style:a.mutedText,children:"No project roots reported for this node yet."})]})]})]})]}):l.jsx("div",{className:"h-full flex items-center justify-center px-8 text-center",children:l.jsxs("div",{children:[l.jsx("div",{className:"text-[15px] font-medium mb-2",style:a.inkText,children:"No machines visible"}),l.jsx("div",{className:"text-[12px]",style:a.mutedText,children:"Start the broker and register a node to inspect servers and workstations here."})]})})]})]})}function PT(e,r){switch(e.status){case"running":return{icon:N1,pill:{backgroundColor:"rgba(59, 130, 246, 0.12)",color:"#2563eb"}};case"completed":return{icon:g1,pill:{backgroundColor:"rgba(16, 185, 129, 0.12)",color:"#059669"}};case"failed":return{icon:wp,pill:{backgroundColor:"rgba(239, 68, 68, 0.12)",color:"#dc2626"}};case"queued":return{icon:zN,pill:{backgroundColor:r.tagBg,color:r.muted}}}}function UT(e,r){switch(e.status){case"completed":return{backgroundColor:"rgba(16, 185, 129, 0.12)",color:"#059669"};case"in-progress":return{backgroundColor:"rgba(59, 130, 246, 0.12)",color:"#2563eb"};case"awaiting-review":return{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"};case"paused":return{backgroundColor:"rgba(148, 163, 184, 0.18)",color:"#475569"};case"draft":return{backgroundColor:r.tagBg,color:r.muted}}}function HT(e,r){return e.severity==="error"?{backgroundColor:"rgba(239, 68, 68, 0.12)",color:"#dc2626"}:{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"}}function FT({plansState:e,C:r,s:a,isCollapsed:i,sidebarWidth:o,onResizeStart:u,onOpenRelayAgent:d,onRefresh:f,identityColor:p}){const[h,y]=A.useState("tasks"),[b,v]=A.useState("all"),j=A.useMemo(()=>Array.from(new Set(e.tasks.map(w=>w.targetAgentName))).sort(),[e.tasks]),C=A.useMemo(()=>b==="all"?e.tasks:e.tasks.filter(w=>w.targetAgentName===b),[e.tasks,b]),E=A.useMemo(()=>b==="all"?e.plans:e.plans.filter(w=>w.agent===b||w.agentId===b.toLowerCase()),[e.plans,b]);return l.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[i?null:l.jsxs("div",{style:{width:o,...a.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[l.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:u}),l.jsxs("div",{className:"px-4 h-14 flex items-center justify-between border-b",style:{borderBottomColor:r.border},children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:a.inkText,children:"Plans & Tasks"}),l.jsxs("div",{className:"text-[10px] font-mono mt-0.5",style:a.mutedText,children:[e.taskCount," asks · ",e.planCount," plans"]})]}),l.jsx("button",{className:"p-1.5 rounded transition-opacity hover:opacity-70",style:a.mutedText,onClick:f,children:l.jsx(xn,{size:14})})]}),l.jsx("div",{className:"p-3 border-b grid grid-cols-2 gap-2",style:{borderColor:r.border},children:[{label:"Running",value:e.runningTaskCount},{label:"Plans",value:e.planCount},{label:"Findings",value:e.findingCount},{label:"Workspaces",value:e.workspaceCount}].map(w=>l.jsxs("div",{className:"p-2 rounded",style:{backgroundColor:r.surface},children:[l.jsx("div",{className:"text-[8px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:w.label}),l.jsx("div",{className:"text-[16px] font-semibold",style:a.inkText,children:w.value})]},w.label))}),l.jsx("div",{className:"px-3 pt-3",children:l.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{mode:"tasks",label:"Tasks",icon:i2},{mode:"plans",label:"Plans",icon:da}].map(w=>{const M=w.icon;return l.jsxs("button",{onClick:()=>y(w.mode),className:"border rounded-lg px-3 py-2 text-[11px] font-medium flex items-center gap-2 justify-center",style:h===w.mode?a.activeItem:{...a.surface,borderColor:r.border,color:r.ink},children:[l.jsx(M,{size:12}),w.label]},w.mode)})})}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[l.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-2 px-2",style:a.mutedText,children:"Agents"}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("button",{onClick:()=>v("all"),className:"w-full text-left px-3 py-2 rounded-lg text-[12px] font-medium",style:b==="all"?a.activeItem:a.mutedText,children:"All Agents"}),j.map(w=>l.jsxs("button",{onClick:()=>v(w),className:"w-full text-left px-3 py-2 rounded-lg text-[12px] font-medium flex items-center gap-2",style:b===w?a.activeItem:a.mutedText,children:[l.jsx("div",{className:"w-5 h-5 rounded text-white flex items-center justify-center text-[9px] font-bold",style:{backgroundColor:p(w)},children:w.charAt(0).toUpperCase()}),l.jsx("span",{className:"truncate",children:w})]},w))]})]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i?l.jsx("div",{className:"px-6 py-4 border-b flex items-center gap-2 overflow-x-auto",style:{borderColor:r.border},children:[["tasks","Tasks"],["plans","Plans"]].map(([w,M])=>l.jsx("button",{onClick:()=>y(w),className:"os-btn border rounded-lg px-3 py-2 text-[11px] font-medium whitespace-nowrap",style:h===w?a.activeItem:{...a.surface,borderColor:r.border,color:r.ink},children:M},w))}):null,l.jsxs("div",{className:"px-8 py-8 space-y-6",children:[l.jsxs("div",{className:"flex items-start justify-between gap-6",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:a.mutedText,children:"Control Plane Queue"}),l.jsx("h1",{className:"text-[26px] font-semibold tracking-tight mb-2",style:a.inkText,children:h==="tasks"?"Recent Agent Asks":"Workspace Plans"}),l.jsx("div",{className:"text-[13px] leading-[1.7] max-w-2xl",style:a.mutedText,children:h==="tasks"?"These are the operator asks currently flowing through Relay, resolved against live reply and status signals.":"Plan files are loaded from registered agent workspaces under plans/ or .openscout/plans/ so each project can keep its own roadmap."})]}),l.jsxs("button",{onClick:f,className:"os-btn border px-3 py-2 rounded-lg text-[12px] font-medium shadow-sm flex items-center gap-2",style:{...a.surface,borderColor:r.border,color:r.ink},children:[l.jsx(xn,{size:14}),"Refresh"]})]}),l.jsx("div",{className:"grid grid-cols-4 gap-4",children:[{label:"Running",value:e.runningTaskCount,icon:N1},{label:"Completed",value:e.completedTaskCount,icon:g1},{label:"Findings",value:e.findingCount,icon:q2},{label:"Plans",value:e.planCount,icon:U2}].map(w=>l.jsxs("div",{className:"border rounded-xl p-4",style:{...a.surface,borderColor:r.border},children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",style:a.mutedText,children:[l.jsx(w.icon,{size:14,className:w.label==="Running"?"animate-spin":""}),l.jsx("span",{className:"text-[10px] font-mono uppercase tracking-widest",children:w.label})]}),l.jsx("div",{className:"text-[22px] font-semibold",style:a.inkText,children:w.value})]},w.label))}),h==="tasks"?l.jsxs("div",{className:"space-y-4",children:[e.findings.length>0?l.jsxs("div",{className:"border rounded-xl p-5",style:{...a.surface,borderColor:r.border},children:[l.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-2",style:a.mutedText,children:"Reconciliation"}),l.jsx("div",{className:"text-[13px] leading-[1.7]",style:a.mutedText,children:"Open expectations that look stale, blocked, or otherwise at risk of being dropped."})]}),l.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono shrink-0",children:[l.jsxs("span",{className:"px-1.5 py-0.5 rounded",style:{backgroundColor:"rgba(239, 68, 68, 0.12)",color:"#dc2626"},children:[e.errorCount," errors"]}),l.jsxs("span",{className:"px-1.5 py-0.5 rounded",style:{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"},children:[e.warningCount," warnings"]})]})]}),l.jsx("div",{className:"space-y-3",children:e.findings.map(w=>l.jsx("div",{className:"border rounded-lg p-4",style:{borderColor:r.border,backgroundColor:r.bg},children:l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[l.jsx("div",{className:"text-[14px] font-semibold",style:a.inkText,children:w.title}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:HT(w),children:w.severity})]}),l.jsx("div",{className:"text-[12px] leading-[1.7]",style:a.mutedText,children:w.summary}),w.detail?l.jsx("div",{className:"mt-2 text-[11px] leading-[1.6]",style:a.mutedText,children:w.detail}):null,l.jsxs("div",{className:"mt-3 flex items-center gap-3 text-[10px] flex-wrap",style:a.mutedText,children:[w.requesterName?l.jsx("span",{children:w.requesterName}):null,w.targetAgentName?l.jsx("span",{children:w.targetAgentName}):null,w.ageLabel?l.jsx("span",{children:w.ageLabel}):null,w.updatedAtLabel?l.jsxs("span",{children:["Updated ",w.updatedAtLabel]}):null]})]}),w.targetAgentId?l.jsxs("button",{onClick:()=>d(w.targetAgentId),className:"text-[11px] font-medium flex items-center gap-1 shrink-0",style:{color:r.accent},children:["Open Relay ",l.jsx(ql,{size:12})]}):null]})},w.id))})]}):null,C.length>0?C.map(w=>{const M=PT(w,r),D=M.icon;return l.jsx("div",{className:"border rounded-xl p-5",style:{...a.surface,borderColor:r.border},children:l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[l.jsx("div",{className:"mt-0.5",style:{color:M.pill.color},children:l.jsx(D,{size:18,className:w.status==="running"?"animate-spin":""})}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[l.jsx("div",{className:"text-[15px] font-semibold",style:a.inkText,children:w.title}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:M.pill,children:w.statusLabel})]}),l.jsxs("div",{className:"flex items-center gap-3 text-[11px] flex-wrap mb-3",style:a.mutedText,children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("div",{className:"w-5 h-5 rounded text-white flex items-center justify-center text-[9px] font-bold",style:{backgroundColor:p(w.targetAgentId)},children:w.targetAgentName.charAt(0).toUpperCase()}),l.jsx("span",{children:w.targetAgentName})]}),w.project?l.jsx("span",{className:"font-mono",children:w.project}):null,l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Zi,{size:10}),w.ageLabel]})]}),l.jsx("div",{className:"text-[12px] leading-[1.7]",style:a.mutedText,children:w.statusDetail}),w.replyPreview?l.jsx("div",{className:"mt-3 border rounded-lg px-3 py-2 text-[12px] leading-[1.7]",style:{borderColor:r.border,backgroundColor:r.bg,color:r.muted},children:w.replyPreview}):null,w.projectRoot?l.jsx("div",{className:"mt-3 text-[10px] font-mono",style:a.mutedText,children:w.projectRoot}):null]})]}),l.jsxs("button",{onClick:()=>d(w.targetAgentId),className:"text-[11px] font-medium flex items-center gap-1 shrink-0",style:{color:r.accent},children:["Open Relay ",l.jsx(ql,{size:12})]})]})},w.id)}):l.jsx("div",{className:"border rounded-xl p-8 text-center",style:{...a.surface,borderColor:r.border,color:r.muted},children:"No task-like asks are visible yet."})]}):l.jsx("div",{className:"grid grid-cols-2 gap-5",children:E.length>0?E.map(w=>l.jsxs("div",{className:"border rounded-xl p-5",style:{...a.surface,borderColor:r.border},children:[l.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[15px] font-semibold mb-1",style:a.inkText,children:w.title}),l.jsxs("div",{className:"text-[11px] flex items-center gap-2 flex-wrap",style:a.mutedText,children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(y1,{size:10}),w.agentId]}),l.jsx("span",{children:w.workspaceName})]})]}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded shrink-0",style:UT(w,r),children:w.status})]}),l.jsx("div",{className:"text-[12px] leading-[1.7] mb-4",style:a.mutedText,children:w.summary}),l.jsxs("div",{className:"mb-4",children:[l.jsxs("div",{className:"flex items-center justify-between text-[10px] font-mono uppercase tracking-widest mb-2",style:a.mutedText,children:[l.jsx("span",{children:"Progress"}),l.jsxs("span",{children:[w.stepsCompleted,"/",w.stepsTotal||0]})]}),l.jsx("div",{className:"h-2 rounded-full overflow-hidden",style:{backgroundColor:r.border},children:l.jsx("div",{className:"h-full rounded-full",style:{width:`${w.progressPercent}%`,backgroundColor:r.accent}})})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3 text-[11px]",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"Updated"}),l.jsx("div",{style:a.inkText,children:w.updatedAtLabel})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"File"}),l.jsx("div",{style:a.inkText,children:w.path})]})]}),w.tags.length>0?l.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:w.tags.map(M=>l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:a.tagBadge,children:M},M))}):null]},`${w.workspacePath}:${w.path}`)):l.jsxs("div",{className:"col-span-2 border rounded-xl p-8 text-center",style:{...a.surface,borderColor:r.border,color:r.muted},children:[l.jsx("div",{className:"text-[14px] font-medium mb-2",style:a.inkText,children:"No plan files found"}),l.jsxs("div",{className:"text-[12px] leading-[1.7]",children:["Add Markdown plans under ",l.jsx("span",{className:"font-mono",children:"plans/"})," or ",l.jsx("span",{className:"font-mono",children:".openscout/plans/"})," in a registered agent workspace and they will appear here."]})]})})]})]})]})}function qT({activeView:e,machinesViewProps:r,plansViewProps:a,search:i}){return e==="machines"?l.jsx(IT,{...r}):e==="plans"?l.jsx(FT,{...a}):e!=="search"?null:l.jsxs(l.Fragment,{children:[!i.isCollapsed&&l.jsxs("div",{style:{width:i.sidebarWidth,...i.styles.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[l.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:i.onResizeStart}),l.jsx("div",{className:"px-3 py-2.5 flex items-center justify-between border-b",style:{borderBottomColor:g.border},children:l.jsxs("div",{children:[l.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:i.styles.inkText,children:"Search"}),l.jsx("div",{className:"text-[10px] font-mono mt-0.5",style:i.styles.mutedText,children:"Full-text search"})]})}),l.jsxs("div",{className:"flex-1 overflow-y-auto py-2",children:[l.jsxs("div",{className:"mb-3 px-1.5",children:[l.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:i.styles.mutedText,children:"Scope"}),l.jsxs("div",{className:"flex flex-col gap-px",children:[l.jsxs("button",{className:"flex items-center gap-2 px-1.5 py-1 shadow-sm border rounded text-[12px]",style:i.styles.activeItem,children:[l.jsx(Cp,{size:12,style:{color:g.accent}}),l.jsx("span",{className:"font-medium flex-1 truncate text-left",children:"All Sessions"})]}),[["Content Only",l.jsx(Sp,{size:12})],["Tags Only",l.jsx(I2,{size:12})]].map(([o,u])=>l.jsxs("button",{className:"flex items-center gap-2 px-1.5 py-1 rounded text-[12px] hover:opacity-80 transition-opacity",style:i.styles.mutedText,children:[u,l.jsx("span",{className:"font-medium flex-1 truncate text-left",children:o})]},o))]})]}),l.jsxs("div",{className:"mb-3 px-1.5",children:[l.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:i.styles.mutedText,children:"Time Range"}),l.jsxs("div",{className:"flex flex-col gap-px",children:[l.jsxs("button",{className:"flex items-center gap-2 px-1.5 py-1 shadow-sm border rounded text-[12px]",style:i.styles.activeItem,children:[l.jsx(SN,{size:12,style:{color:g.accent}}),l.jsx("span",{className:"font-medium flex-1 truncate text-left",children:"All Time"})]}),["Last 7 Days","Last 30 Days"].map(o=>l.jsxs("button",{className:"flex items-center gap-2 px-1.5 py-1 rounded text-[12px] hover:opacity-80 transition-opacity",style:i.styles.mutedText,children:[l.jsx(Zi,{size:12}),l.jsx("span",{className:"font-medium flex-1 truncate text-left",children:o})]},o))]})]}),l.jsxs("div",{className:"mb-3 px-1.5",children:[l.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:i.styles.mutedText,children:"Agents"}),l.jsx("div",{className:"flex flex-col gap-px",children:i.availableAgentNames.map(o=>l.jsxs("label",{className:"flex items-center gap-2 px-1.5 py-1 rounded text-[12px] hover:opacity-80 transition-opacity cursor-pointer",style:i.styles.mutedText,children:[l.jsx("input",{type:"checkbox",defaultChecked:!0,className:"w-3 h-3 rounded"}),l.jsx("div",{className:"w-3 h-3 rounded text-white flex items-center justify-center text-[7px] font-bold",style:{backgroundColor:cl(o)},children:o.charAt(0)}),l.jsx("span",{className:"font-medium flex-1 truncate text-left",children:o})]},o))})]}),l.jsxs("div",{className:"px-1.5",children:[l.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:i.styles.mutedText,children:"Quick Filters"}),l.jsx("div",{className:"flex flex-wrap gap-1 px-1.5",children:["code-review","debugging","docs","architecture","performance","testing"].map(o=>l.jsx("button",{className:"text-[9px] font-mono border px-1.5 py-0.5 rounded hover:opacity-70 transition-opacity",style:i.styles.tagBadge,children:o},o))})]})]})]}),l.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:i.styles.surface,children:[l.jsxs("div",{className:"border-b shrink-0 p-4",style:{...i.styles.surface,borderBottomColor:g.border},children:[l.jsxs("div",{className:"flex items-center gap-3 border rounded-lg px-3 py-2 transition-all focus-within:ring-1",style:{backgroundColor:g.bg,borderColor:g.border},children:[l.jsx(wo,{size:16,className:"shrink-0",style:i.styles.mutedText}),l.jsx("input",{type:"text",placeholder:"Search across all sessions, messages, and metadata...",value:i.searchQuery,onChange:o=>i.setSearchQuery(o.target.value),className:"flex-1 bg-transparent border-none outline-none text-[13px]",style:{color:g.ink}}),i.searchQuery&&l.jsx("button",{onClick:()=>i.setSearchQuery(""),className:"p-1 hover:opacity-70",style:i.styles.mutedText,children:l.jsx(kl,{size:14})})]}),l.jsxs("div",{className:"flex items-center justify-between mt-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono",style:i.styles.mutedText,children:[l.jsx("span",{children:"Press"}),l.jsx("kbd",{className:"px-1.5 py-0.5 rounded border text-[10px] font-medium",style:i.styles.kbd,children:"Enter"}),l.jsx("span",{children:"to search"})]}),l.jsx("div",{className:"text-[10px] font-mono",style:i.styles.mutedText,children:i.searchQuery?`${i.filteredSessions.length} results`:`${i.stats.totalSessions} sessions indexed`})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:i.searchQuery?i.filteredSessions.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[l.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:l.jsx(wo,{size:24,style:{color:g.accent}})}),l.jsx("h3",{className:"text-[15px] font-medium mb-1",style:i.styles.inkText,children:"No results found"}),l.jsx("p",{className:"text-[13px] max-w-sm",style:i.styles.mutedText,children:"Try different keywords or adjust your filters"})]}):l.jsx("div",{style:{borderColor:g.border},className:"divide-y",children:i.filteredSessions.map(o=>l.jsxs("div",{className:"px-4 py-4 cursor-pointer transition-opacity hover:opacity-90",style:{borderBottomColor:g.border},onClick:()=>i.onOpenSession(o),children:[l.jsxs("div",{className:"flex items-start justify-between mb-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-5 h-5 rounded text-white flex items-center justify-center text-[9px] font-bold",style:{backgroundColor:cl(o.agent)},children:o.agent.charAt(0)}),l.jsx("span",{className:"text-[13px] font-medium",style:i.styles.inkText,children:o.title})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[l.jsx("span",{className:"text-[9px] font-mono border px-1.5 py-0.5 rounded",style:i.styles.tagBadge,children:o.project}),l.jsx("span",{className:"text-[10px] font-mono",style:i.styles.mutedText,children:i.formatDate(o.lastModified)})]})]}),l.jsx("div",{className:"text-[12px] mb-2 pl-7 leading-relaxed",style:i.styles.mutedText,children:o.preview.split(new RegExp(`(${i.searchQuery})`,"gi")).map((u,d)=>u.toLowerCase()===i.searchQuery.toLowerCase()?l.jsx("mark",{className:"px-0.5 rounded",style:{backgroundColor:g.markBg,color:g.markFg},children:u},d):l.jsx("span",{children:u},d))}),l.jsxs("div",{className:"flex items-center gap-3 pl-7",children:[l.jsxs("span",{className:"text-[10px]",style:i.styles.mutedText,children:[o.messageCount," messages"]}),o.tokens?l.jsxs("span",{className:"text-[10px]",style:i.styles.mutedText,children:[(o.tokens/1e3).toFixed(1),"k tokens"]}):null,o.model?l.jsx("span",{className:"text-[9px] font-mono text-indigo-400 bg-indigo-950/30 px-1.5 py-0.5 rounded",children:o.model}):null]}),o.tags&&o.tags.length>0?l.jsx("div",{className:"flex items-center gap-1.5 mt-2 pl-7",children:o.tags.map(u=>l.jsx("span",{className:"text-[9px] font-mono border px-1.5 py-0.5 rounded",style:u.toLowerCase().includes(i.searchQuery.toLowerCase())?{backgroundColor:g.markBg,borderColor:g.border,color:g.markFg}:i.styles.tagBadge,children:u},u))}):null]},o.id))}):l.jsxs("div",{className:"p-6",children:[l.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-3",style:i.styles.mutedText,children:"Recent Searches"}),l.jsx("div",{className:"flex flex-col gap-2",children:["authentication refactor","database migration","API performance"].map((o,u)=>l.jsxs("button",{onClick:()=>i.setSearchQuery(o),className:"flex items-center gap-2 text-left text-[12px] hover:opacity-70 transition-opacity",style:i.styles.mutedText,children:[l.jsx(Zi,{size:12}),l.jsx("span",{children:o})]},u))}),l.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-3 mt-8",style:i.styles.mutedText,children:"Popular Tags"}),l.jsx("div",{className:"flex flex-wrap gap-2",children:["code-review","auth","security","database","migration","api","performance","testing","docs"].map(o=>l.jsxs("button",{onClick:()=>i.setSearchQuery(o),className:"text-[11px] font-mono border px-2 py-1 rounded hover:opacity-70 transition-opacity",style:i.styles.tagBadge,children:["#",o]},o))}),l.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-3 mt-8",style:i.styles.mutedText,children:"Search Tips"}),l.jsx("div",{className:"text-[12px] space-y-2",style:i.styles.mutedText,children:[["project:openscout-core","Search within a project"],["agent:claude","Filter by agent"],["tag:security","Search by tag"],['"exact phrase"',"Match exact phrase"]].map(([o,u])=>l.jsxs("p",{children:[l.jsx("code",{className:"border rounded px-1 font-mono text-[10px]",style:i.styles.tagBadge,children:o})," -- ",u]},o))})]})}),l.jsxs("div",{className:"h-7 border-t flex items-center justify-between px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:[l.jsxs("span",{className:"text-[9px] font-mono",style:i.styles.mutedText,children:["Indexed: ",i.stats.totalSessions," sessions / ",i.stats.totalMessages," messages"]}),l.jsx("span",{className:"text-[9px] font-mono uppercase tracking-widest",style:i.styles.mutedText,children:"Index Ready"})]})]})]})}function VT({styles:e,selectedInterAgent:r,availableAgents:a,isAgentConfigEditing:i,hasEditableAgentConfig:o,agentConfigLoading:u,agentConfigSaving:d,agentConfigRestarting:f,visibleAgentConfig:p,agentConfigFeedback:h,agentCapabilitiesPreview:y,agentRuntimePathRef:b,onOpenAgents:v,onOpenAgentProfile:j,onOpenAgentThread:C,onUpdateAgentConfigDraft:E,renderLocalPathValue:w,interAgentProfileKindLabel:M,onSelectAgent:D}){const H=r?.id??null,X=l.jsxs("section",{className:"border rounded-xl p-3",style:{...e.surface,borderColor:g.border},children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 px-2 pt-2 mb-2",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Agent List"}),l.jsx("div",{className:"text-[11px] mt-1",style:e.mutedText,children:a.length>0?"Pick the agent you want to configure.":"No agents available yet."})]}),a.length>0?l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded shrink-0",style:e.tagBadge,children:a.length}):null]}),l.jsx("div",{className:"flex flex-col gap-1",children:a.length>0?a.map(q=>{const L=q.id===H;return l.jsx("button",{type:"button",className:"rounded-lg border px-3 py-2 text-left transition-opacity hover:opacity-90",style:{borderColor:L?g.accent:g.border,backgroundColor:L?g.surface:g.bg},onClick:()=>D(q.id),children:l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[12px] font-medium truncate",style:e.inkText,children:q.title}),l.jsxs("div",{className:"text-[10px] mt-0.5 truncate",style:e.mutedText,children:[M(q.profileKind)," · ",q.statusDetail??q.summary??"No status reported."]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[L?l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:e.activePill,children:"Selected"}):null,l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:q.state==="working"?e.activePill:e.tagBadge,children:q.statusLabel})]})]})},q.id)}):l.jsx("div",{className:"px-3 py-6 text-[11px] text-center",style:e.mutedText,children:"No agents available yet."})}),l.jsx("div",{className:"mt-3 px-2 pb-2",children:l.jsx("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:v,children:"Open Agents"})})]});return r?l.jsxs("div",{className:"space-y-4 min-w-0",children:[l.jsx("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Selected Agent"}),l.jsx("div",{className:"text-[18px] font-semibold tracking-tight mt-1.5",style:e.inkText,children:r.title}),l.jsxs("div",{className:"text-[12px] mt-2 leading-[1.6]",style:e.mutedText,children:[M(r.profileKind)," · ",r.statusDetail??r.summary??"No status reported."]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>C(r.id),children:"Message"}),l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>j(r.id),children:"Show in Agents"})]})]})}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)] gap-4",children:[l.jsxs("div",{className:"space-y-4 min-w-0",children:[l.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Runtime"}),u?l.jsx("div",{className:"text-[11px]",style:e.mutedText,children:"Loading runtime…"}):i?l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Path"}),l.jsx("input",{ref:b,value:p?.runtime.cwd??"",onChange:q=>{E(L=>({...L,runtime:{...L.runtime,cwd:q.target.value}}))},readOnly:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Harness"}),l.jsx("select",{value:p?.runtime.harness??"",onChange:q=>{E(L=>({...L,runtime:{...L.runtime,harness:q.target.value}}))},disabled:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink},children:p?.availableHarnesses.map(q=>l.jsx("option",{value:q,children:q},q))})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Session"}),l.jsx("input",{value:p?.runtime.sessionId??"",onChange:q=>{E(L=>({...L,runtime:{...L.runtime,sessionId:q.target.value}}))},readOnly:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Mode"}),l.jsxs("select",{value:p?.runtime.transport==="tmux"?"interactive":"async",onChange:q=>{E(L=>({...L,runtime:{...L.runtime,transport:q.target.value==="interactive"?"tmux":"claude_stream_json"}}))},disabled:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink},children:[l.jsx("option",{value:"async",children:"Async"}),l.jsx("option",{value:"interactive",children:"Interactive (PTY)"})]})]})]})]}):l.jsx("dl",{children:[["Path",p?.runtime.cwd??r.projectRoot??r.cwd??"Not reported"],["Harness",p?.runtime.harness??r.harness??"Not reported"],["Session",p?.runtime.sessionId??r.sessionId??"Not reported"],["Mode",(p?.runtime.transport??r.transport)==="tmux"?"Interactive (PTY)":"Async"],["Wake policy",p?.runtime.wakePolicy||r.wakePolicy||"Not reported"],["Live runtime",r.projectRoot??r.cwd??"Not reported"]].map(([q,L])=>l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-baseline sm:justify-between gap-1 py-2.5 border-b last:border-b-0",style:{borderColor:g.border},children:[l.jsx("dt",{className:"text-[9px] font-mono uppercase tracking-widest shrink-0 sm:w-[7.5rem]",style:e.mutedText,children:q}),l.jsx("dd",{className:"text-[11px] leading-[1.45] break-words min-w-0 text-left sm:text-right sm:max-w-[70%]",children:l.jsx("span",{style:e.inkText,children:q==="Path"||q==="Live runtime"?w(String(L),{className:"text-left sm:text-right underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"}):L})})]},q))})]}),l.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Tool Use"}),i?l.jsx("textarea",{value:p?.toolUse.launchArgsText??"",onChange:q=>{E(L=>({...L,toolUse:{...L.toolUse,launchArgsText:q.target.value}}))},readOnly:!o||d||f,className:"w-full min-h-[132px] rounded-lg border px-3 py-3 text-[11px] font-mono leading-[1.5] resize-y bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):l.jsx("div",{className:"rounded-lg border px-3 py-3 text-[11px] font-mono leading-[1.55] whitespace-pre-wrap break-words min-h-[88px]",style:{borderColor:g.border,color:g.ink},children:p?GT(p.toolUse.launchArgsText)||"No launch args configured.":"Launch args load on demand when editing this agent."})]}),l.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Capabilities"}),i?l.jsx("input",{value:p?.capabilitiesText??"",onChange:q=>{E(L=>({...L,capabilitiesText:q.target.value}))},readOnly:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):null,y.length>0?l.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:y.map(q=>l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:e.tagBadge,children:q},q))}):l.jsx("div",{className:"text-[11px]",style:e.mutedText,children:"No capabilities configured."}),h?l.jsx("div",{className:"text-[11px] mt-2 leading-[1.5]",style:e.inkText,children:h}):null]})]}),l.jsx("div",{className:"space-y-4 min-w-0",children:X})]})]}):l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,0.95fr)_minmax(320px,1.05fr)] gap-4 min-w-0",children:[l.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:{color:g.accent},children:"Agent Settings"}),l.jsx("div",{className:"text-[18px] font-semibold tracking-tight",style:e.inkText,children:"Select an agent"}),l.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:e.mutedText,children:"Agent configuration lives here now. Pick an agent from the list to edit its runtime, tools, and capabilities."})]}),l.jsx("div",{className:"space-y-4 min-w-0",children:X})]})}function GT(e){return e.replace(/\r\n/g,`
|
|
58
|
-
`).trim()}function $T({styles:e,showTelegram:r,showVoice:a,visibleAppSettings:i,isAppSettingsEditing:o,appSettingsSaving:u,appSettingsFeedback:d,onUpdateAppSettingsDraft:f,brokerInspector:p,brokerControlPending:h,brokerControlFeedback:y,onBrokerControl:b,relayServiceInspectorRef:v,relayRuntimeBooting:j,relayRuntimeHealthLabel:C,runtime:E,reachableRelayAgentCount:w,voiceCaptureTitle:M,voiceRepliesEnabled:D,onSetVoiceRepliesEnabled:H,renderLocalPathValue:X}){return l.jsx("div",{className:"max-w-3xl space-y-5",children:l.jsxs("div",{className:"space-y-5 min-w-0",children:[r?l.jsxs("section",{className:"border rounded-lg p-4",style:{...e.surface,borderColor:g.border},children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Telegram Bridge"}),l.jsx("span",{className:"text-[8px] font-mono uppercase tracking-wider px-1 py-px rounded-sm",style:i?.telegram.running?e.activePill:e.tagBadge,children:i?.telegram.running?"Running":i?.telegram.enabled?"Stopped":"Disabled"})]}),l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[l.jsx("span",{className:"text-[11px]",style:e.mutedText,children:"Enabled"}),l.jsx("input",{type:"checkbox",checked:i?.telegram.enabled??!1,disabled:!o||u,onChange:q=>{f(L=>({...L,telegram:{...L.telegram,enabled:q.target.checked}}))}})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Mode"}),o?l.jsxs("select",{value:i?.telegram.mode??"polling",onChange:q=>{f(L=>({...L,telegram:{...L.telegram,mode:q.target.value}}))},disabled:u,className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink},children:[l.jsx("option",{value:"polling",children:"polling"}),l.jsx("option",{value:"auto",children:"auto"}),l.jsx("option",{value:"webhook",children:"webhook"})]}):l.jsx("div",{className:"text-[12px] font-medium",style:e.inkText,children:i?.telegram.mode??"polling"})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Telegram Target"}),o?l.jsx("input",{value:i?.telegram.defaultConversationId??"dm.scout.primary",onChange:q=>{f(L=>({...L,telegram:{...L.telegram,defaultConversationId:q.target.value}}))},readOnly:u,className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):l.jsx("div",{className:"text-[13px] font-medium",style:e.inkText,children:i?.telegram.defaultConversationId??"dm.scout.primary"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Bot Username"}),o?l.jsx("input",{value:i?.telegram.userName??"",onChange:q=>{f(L=>({...L,telegram:{...L.telegram,userName:q.target.value}}))},readOnly:u,className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):l.jsx("div",{className:"text-[12px] font-medium break-words",style:e.inkText,children:i?.telegram.userName||"Not set"})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Owner Node"}),o?l.jsx("input",{value:i?.telegram.ownerNodeId??"",onChange:q=>{f(L=>({...L,telegram:{...L.telegram,ownerNodeId:q.target.value}}))},readOnly:u,placeholder:"Automatic",className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):l.jsx("div",{className:"text-[12px] font-medium break-words",style:e.inkText,children:i?.telegram.ownerNodeId||"Automatic"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Bot Token"}),o?l.jsx("input",{type:"password",value:i?.telegram.botToken??"",onChange:q=>{f(L=>({...L,telegram:{...L.telegram,botToken:q.target.value}}))},readOnly:u,placeholder:"Telegram bot token",className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):l.jsx("div",{className:"text-[11px]",style:e.inkText,children:i?.telegram.botToken?"Configured":"Not set"})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Webhook Secret"}),o?l.jsx("input",{type:"password",value:i?.telegram.secretToken??"",onChange:q=>{f(L=>({...L,telegram:{...L.telegram,secretToken:q.target.value}}))},readOnly:u,placeholder:"Optional",className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):l.jsx("div",{className:"text-[11px]",style:e.inkText,children:i?.telegram.secretToken?"Configured":"Not set"})]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"API Base URL"}),o?l.jsx("input",{value:i?.telegram.apiBaseUrl??"",onChange:q=>{f(L=>({...L,telegram:{...L.telegram,apiBaseUrl:q.target.value}}))},readOnly:u,className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):l.jsx("div",{className:"text-[12px] font-medium break-words",style:e.inkText,children:i?.telegram.apiBaseUrl||"Default Telegram API"})]}),d?l.jsx("div",{className:"text-[11px] leading-[1.5]",style:e.inkText,children:d}):null]})]}):null,l.jsxs("section",{ref:v,className:"border rounded-lg overflow-hidden",style:{...e.surface,borderColor:g.border},children:[p?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"p-4",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Relay Service"}),l.jsx("span",{className:"text-[8px] font-mono uppercase tracking-wider px-1 py-px rounded-sm",style:p.reachable?e.activePill:e.tagBadge,children:p.statusLabel})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Nt,{type:"button",variant:p.reachable?"outline":"default",size:"sm",onClick:()=>b(p.reachable?"restart":"start"),disabled:h,children:p.reachable?"Restart":"Start"}),l.jsx(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>b("stop"),disabled:h||!p.loaded,children:"Stop"})]})]}),l.jsx("div",{className:"text-[11px] mb-4 leading-[1.5]",style:e.mutedText,children:p.statusDetail??"Service status not reported yet."}),l.jsx("div",{className:"grid grid-cols-3 gap-x-4 gap-y-3",children:[["Relay URL",p.url],["Version",p.version??"Not reported"],["Mode",p.mode],["Service Label",p.label],["PID",p.pid??"Not reported"],["Last Restart",p.lastRestartLabel??"Not reported"],["Launch State",p.launchdState??"Not reported"],["Mesh",p.meshId??"Not reported"],["Last Exit",p.lastExitStatus??"Not reported"]].map(([q,L])=>l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:q}),l.jsx("div",{className:"text-[11px] leading-[1.45] break-words",style:e.inkText,children:L})]},q))}),p.processCommand?l.jsxs("div",{className:"mt-3 pt-3 border-t",style:{borderTopColor:g.border},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Process"}),l.jsx("div",{className:"text-[10px] font-mono leading-[1.45] break-all",style:e.mutedText,children:p.processCommand})]}):null,y?l.jsx("div",{className:"mt-3 pt-3 border-t text-[11px] leading-[1.45]",style:{borderTopColor:g.border,color:g.ink},children:y}):null]}),l.jsx("div",{className:"border-t",style:{borderTopColor:g.border}})]}):null,l.jsxs("div",{className:"px-4 py-3",style:{backgroundColor:g.bg},children:[l.jsxs("div",{className:"flex items-center gap-2.5 mb-2.5",children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Runtime"}),l.jsx("span",{className:"text-[8px] font-mono uppercase tracking-wider px-1 py-px rounded-sm",style:j||E?.brokerHealthy?e.activePill:e.tagBadge,children:C})]}),l.jsx("div",{className:"grid grid-cols-4 gap-x-4 gap-y-2.5",children:[["Node ID",j?"Syncing…":E?.nodeId??"Not reported"],["Agents",`${E?.agentCount??0}`],["Conversations",`${E?.conversationCount??0}`],["Flights",`${E?.flightCount??0}`],["Latest Relay",j?"Syncing…":E?.latestRelayLabel??"Not reported"],["Updated",j?"Syncing…":E?.updatedAtLabel??"Not reported"]].map(([q,L])=>l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:q}),l.jsx("div",{className:"text-[11px] leading-[1.45] break-words",style:e.inkText,children:L})]},q))})]})]}),p?l.jsxs("section",{className:"border rounded-lg p-4",style:{...e.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-3",style:e.mutedText,children:"Relay Paths"}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[["Support",p.supportDirectory],["Control Home",p.controlHome],["LaunchAgent",p.launchAgentPath],["Stdout Log",p.stdoutLogPath],["Stderr Log",p.stderrLogPath]].map(([q,L])=>l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:q}),l.jsx("div",{className:"text-[10px] font-mono leading-[1.45] truncate",style:e.mutedText,children:X(String(L),{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"})})]},q))}),p.lastLogLine?l.jsxs("div",{className:"mt-3 pt-3 border-t",style:{borderTopColor:g.border},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Last Service Log"}),l.jsx("div",{className:"text-[10px] font-mono leading-[1.45] break-words",style:e.mutedText,children:p.lastLogLine})]}):null]}):null,p&&(p.troubleshooting.length>0||p.feedbackSummary)?l.jsxs("section",{className:"border rounded-lg p-4",style:{...e.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-3",style:e.mutedText,children:"Diagnostics"}),p.troubleshooting.length>0?l.jsx("div",{className:"space-y-2 mb-4",children:p.troubleshooting.map(q=>l.jsx("div",{className:"text-[11px] leading-[1.5]",style:e.inkText,children:q},q))}):null,p.feedbackSummary?l.jsx("div",{className:"rounded-md border px-3 py-3 text-[10px] font-mono leading-[1.55] whitespace-pre-wrap break-words",style:{borderColor:g.border,color:g.ink},children:p.feedbackSummary}):null]}):null,a?l.jsxs("section",{className:"border rounded-lg p-4",style:{...e.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-3",style:e.mutedText,children:"Voice & Delivery"}),l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Capture"}),l.jsx("div",{className:"text-[11px]",style:e.inkText,children:M})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Reachable Directs"}),l.jsx("div",{className:"text-[11px]",style:e.inkText,children:w})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Replies"}),l.jsx("button",{className:"os-toolbar-button text-[10px] font-medium px-2 py-0.5 rounded-md",style:{color:g.ink},onClick:()=>{H(!D)},children:D?"Disable":"Enable"})]})]})]}):null]})})}const YT=G1("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Lu({className:e,variant:r,asChild:a=!1,...i}){const o=a?F1:"span";return l.jsx(o,{"data-slot":"badge",className:An(YT({variant:r}),e),...i})}function QT({styles:e,selectedWorkspaceProject:r,selectedWorkspaceAgent:a,workspaceExplorerQuery:i,setWorkspaceExplorerQuery:o,workspaceExplorerFilter:u,setWorkspaceExplorerFilter:d,workspaceExplorerViewMode:f,setWorkspaceExplorerViewMode:p,workspaceExplorerItems:h,workspaceExplorerBoundCount:y,workspaceExplorerDiscoveredCount:b,filteredWorkspaceExplorerItems:v,workspaceInventoryLoaded:j,workspaceInventoryLoading:C,canRefreshWorkspaceInventory:E,onboardingCommandPending:w,appSettingsLoading:M,appSettingsSaving:D,appSettingsDirty:H,appSettingsFeedback:X,showDoctorOutput:q,doctorOutput:L,projectRetirementPendingRoot:B,onRefreshWorkspaceDiscovery:F,onLoadWorkspaceInventory:Z,onAddWorkspace:O,onInspectWorkspace:P,onOpenWorkspace:Q,onRetireWorkspace:oe,onOpenAgentProfile:J,onOpenAgentSettings:ee,renderLocalPathValue:N}){return l.jsxs("div",{className:"max-w-6xl px-8 py-6 space-y-4",children:[l.jsx("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:{color:g.accent},children:"Workspace Discovery"}),l.jsx("div",{className:"text-[18px] font-semibold tracking-tight",style:e.inkText,children:"Workspace Explorer"}),l.jsx("div",{className:"text-[12px] mt-1 leading-[1.6]",style:e.mutedText,children:"Discover local projects, inspect harness readiness, and jump into the bound agent when one already exists."})]}),l.jsxs("div",{className:"hidden xl:flex items-center gap-2 shrink-0",children:[l.jsxs(Nt,{variant:"outline",size:"sm",className:"gap-2",onClick:F,disabled:!!w||M||D||H,children:[w==="doctor"?l.jsx(un,{className:"text-[14px]"}):l.jsx(xn,{className:"h-4 w-4"}),w==="doctor"?"Scanning…":"Refresh"]}),l.jsxs(Nt,{size:"sm",className:"gap-2",onClick:O,children:[l.jsx(kb,{className:"h-4 w-4"}),"Add Workspace"]})]})]})}),l.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...e.surface,borderColor:g.border},children:[l.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:g.border,backgroundColor:"color-mix(in srgb, var(--os-bg) 82%, transparent)"},children:l.jsxs("div",{className:"flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",children:[l.jsxs("div",{className:"flex flex-1 flex-col gap-3 xl:flex-row xl:items-center",children:[l.jsxs("div",{className:"relative w-full xl:w-80",children:[l.jsx(wo,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2",style:{color:g.muted}}),l.jsx(rp,{placeholder:"Search workspaces...",value:i,onChange:Y=>o(Y.target.value),className:"pl-9"})]}),l.jsx("div",{className:"flex items-center gap-1 rounded-lg border p-1",style:{borderColor:g.border,backgroundColor:g.bg},children:[["all","All",h.length],["bound","Bound",y],["discovered","Discovered",b]].map(([Y,$,ye])=>{const T=u===Y;return l.jsx("button",{type:"button",className:"rounded-md px-3 py-1.5 text-[12px] font-medium transition-colors",style:{backgroundColor:T?g.surface:"transparent",color:T?g.ink:g.muted,boxShadow:T?g.shadowXs:"none"},onClick:()=>d(Y),children:l.jsxs("span",{className:"flex items-center gap-1.5",children:[Y==="bound"?l.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}):null,$,l.jsx("span",{style:{color:g.muted},children:ye})]})},Y)})})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("button",{type:"button",className:"rounded-md p-1.5 transition-colors",style:{backgroundColor:f==="grid"?g.surface:"transparent",color:f==="grid"?g.ink:g.muted},onClick:()=>p("grid"),title:"Grid view",children:l.jsx(KN,{className:"h-4 w-4"})}),l.jsx("button",{type:"button",className:"rounded-md p-1.5 transition-colors",style:{backgroundColor:f==="list"?g.surface:"transparent",color:f==="list"?g.ink:g.muted},onClick:()=>p("list"),title:"List view",children:l.jsx(j1,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"xl:hidden flex items-center gap-2",children:[l.jsxs(Nt,{variant:"outline",size:"sm",className:"gap-2",onClick:F,disabled:!!w||M||D||H,children:[w==="doctor"?l.jsx(un,{className:"text-[14px]"}):l.jsx(xn,{className:"h-4 w-4"}),"Refresh"]}),l.jsxs(Nt,{size:"sm",className:"gap-2",onClick:O,children:[l.jsx(kb,{className:"h-4 w-4"}),"Add"]})]})]})]})}),l.jsx("div",{className:"p-6",children:j?v.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed px-6 py-12 text-center",style:{borderColor:g.border},children:[l.jsx(da,{className:"h-8 w-8 mb-3",style:{color:g.muted,opacity:.5}}),l.jsx("div",{className:"text-[13px] font-medium mb-1",style:e.inkText,children:"No workspaces found"}),l.jsx("div",{className:"text-[11px] mb-4 max-w-md leading-[1.6]",style:e.mutedText,children:i?"Try a different search term or filter.":"Add scan directories in General settings, then refresh to discover workspaces."}),l.jsxs(Nt,{variant:"outline",className:"gap-2",onClick:F,disabled:!!w||M||D||H,children:[w==="doctor"?l.jsx(un,{className:"text-[14px]"}):l.jsx(xn,{className:"h-4 w-4"}),"Scan Workspaces"]})]}):f==="grid"?l.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-3",children:v.map(Y=>l.jsx(XT,{item:Y,isSelected:r?.id===Y.project.id,onSelect:()=>P(Y.project),onPrimaryAction:()=>Q(Y.project),onSecondaryAction:()=>oe(Y.project),secondaryActionPending:B===Y.project.root},Y.project.id))}):l.jsx(KT,{items:v,selectedWorkspaceId:r?.id??null,onSelectWorkspace:P,onPrimaryAction:Q,onSecondaryAction:oe,projectRetirementPendingRoot:B}):l.jsxs("div",{className:"flex flex-col items-stretch rounded-xl border border-dashed px-6 py-10 text-center",style:{borderColor:g.border},"aria-busy":C,children:[l.jsxs("div",{className:"flex flex-col items-center max-w-lg mx-auto",children:[C?l.jsx(un,{className:"text-[28px] mb-3",style:{color:g.muted,opacity:.7}}):l.jsx(da,{className:"h-8 w-8 mb-3",style:{color:g.muted,opacity:.5}}),l.jsx("div",{className:"text-[13px] font-medium mb-1",style:e.inkText,children:C?"Loading workspaces…":"Workspace inventory is not loaded yet"}),l.jsx("div",{className:"text-[11px] mb-5 max-w-md leading-[1.6]",style:e.mutedText,children:"Scan folders and project manifests are read when you load this list. Use General to edit scan roots first if discovery looks empty."}),l.jsxs(Nt,{variant:"default",size:"sm",className:"gap-2",onClick:Z,disabled:C||!E,children:[C?l.jsx(un,{className:"text-[14px]"}):l.jsx(xn,{className:"h-4 w-4"}),"Load Workspaces"]})]}),C?l.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-3 mt-8 w-full",children:[0,1,2].map(Y=>l.jsx("div",{className:"h-[88px] rounded-xl border animate-pulse",style:{borderColor:g.border,backgroundColor:"color-mix(in srgb, var(--os-bg) 70%, transparent)"}},`ws-skel-${Y}`))}):null]})})]}),X?l.jsx("div",{className:"text-[11px] leading-[1.5]",style:e.inkText,children:X}):null,q?l.jsxs("div",{className:"space-y-2",children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Scan Results"}),L]}):null,r?l.jsxs(l.Fragment,{children:[l.jsx("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Workspace Details"}),l.jsx("div",{className:"text-[18px] font-semibold tracking-tight mt-1.5",style:e.inkText,children:r.title}),l.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:e.mutedText,children:a?"Bound workspace with an existing agent.":"Discovered workspace. No bound agent is attached yet."})]}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50 shrink-0",style:{color:g.ink},onClick:()=>oe(r),disabled:!!B,children:B===r.root?"Retiring…":"Retire Workspace"})]})}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)] gap-4",children:[l.jsxs("section",{className:"border rounded-xl p-5 min-w-0",style:{...e.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Workspace Summary"}),l.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[["Workspace",r.projectName],["Agent ID",r.definitionId],["Root",r.root],["Source Root",r.sourceRoot],["Relative Path",r.relativePath],["Default Harness",r.defaultHarness],["Registration",r.registrationKind],["Manifest",r.projectConfigPath??"Not created"]].map(([Y,$])=>l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:Y}),l.jsx("div",{className:"text-[11px] leading-[1.45] break-words",style:e.inkText,children:Y==="Root"||Y==="Source Root"||Y==="Manifest"?N(String($),{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"}):$})]},Y))})]}),l.jsxs("div",{className:"space-y-4 min-w-0",children:[a?l.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Bound Agent"}),l.jsx("div",{className:"text-[14px] font-medium",style:e.inkText,children:a.title}),l.jsxs("div",{className:"text-[11px] mt-1 leading-[1.6]",style:e.mutedText,children:[a.profileKind," · ",a.statusDetail??a.summary??"No status reported."]}),l.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[l.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:()=>J(a.id),children:"Open Agent"}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:()=>ee(a.id),children:"Edit Agent"})]})]}):null,l.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Harness Evidence"}),l.jsx("div",{className:"space-y-2",children:r.harnesses.map(Y=>l.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsx("div",{className:"text-[12px] font-medium",style:e.inkText,children:Y.harness}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:Y.readinessState==="ready"?e.activePill:e.tagBadge,children:Y.source})]}),l.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:e.mutedText,children:Y.detail}),Y.readinessDetail?l.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:e.mutedText,children:Y.readinessDetail}):null]},`${Y.harness}-${Y.source}`))})]})]})]})]}):l.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[13px] font-medium mb-1",style:e.inkText,children:"Select a workspace"}),l.jsx("div",{className:"text-[12px] leading-[1.6]",style:e.mutedText,children:"Choose a workspace above to inspect its project details, harness evidence, and any bound agent."})]})]})}const vr={ink:{color:g.ink},muted:{color:g.muted}};function XT({item:e,isSelected:r,onSelect:a,onPrimaryAction:i,onSecondaryAction:o,secondaryActionPending:u}){const{project:d,isBound:f,primaryHarness:p,pathLabel:h,branchLabel:y,activityLabel:b,statusLabel:v}=e,j=d.title.trim().charAt(0).toUpperCase()||"W",C=f?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":d.registrationKind==="configured"?"border-amber-500/20 bg-amber-500/10 text-amber-700":"border-border bg-secondary text-secondary-foreground";return l.jsxs("div",{className:An("os-card rounded-xl border p-4 cursor-pointer",r?"ring-1 ring-[color:var(--os-accent)]":""),style:{borderColor:r?g.accent:g.border,backgroundColor:g.surface,boxShadow:r?g.shadowSm:void 0},onClick:a,children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:An("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-[12px] font-semibold",f?"bg-emerald-500/10 text-emerald-700":"bg-secondary text-secondary-foreground"),children:j}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"text-[13px] font-semibold leading-tight tracking-tight",style:vr.ink,children:d.title}),l.jsx("div",{className:"mt-0.5 truncate text-[10px] font-mono",style:vr.muted,children:h})]})]}),l.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[l.jsx(Lu,{variant:"outline",className:"font-mono text-[10px] capitalize",children:p}),l.jsxs(Lu,{className:An("text-[10px]",C),children:[f?l.jsx(R1,{className:"h-3 w-3"}):null,v]})]}),l.jsxs("div",{className:"mt-3 flex items-center gap-3 text-[10px]",style:vr.muted,children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(y1,{className:"h-3 w-3"}),y]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Zi,{className:"h-3 w-3"}),b]})]}),l.jsx("div",{className:"mt-3 border-t pt-3",style:{borderColor:g.border},children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Nt,{variant:f?"outline":"default",size:"sm",className:"flex-1 text-[11px]",onClick:E=>{E.stopPropagation(),i()},children:f?"Open Agent":"Inspect"}),l.jsx(Nt,{variant:"ghost",size:"sm",className:"text-[11px]",onClick:E=>{E.stopPropagation(),o()},disabled:u,children:u?"Retiring…":"Retire"})]})})]})}function KT({items:e,selectedWorkspaceId:r,onSelectWorkspace:a,onPrimaryAction:i,onSecondaryAction:o,projectRetirementPendingRoot:u}){return l.jsx("div",{className:"overflow-hidden rounded-2xl border",style:{borderColor:g.border,backgroundColor:g.surface},children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{style:{backgroundColor:"color-mix(in srgb, var(--os-bg) 82%, transparent)"},children:[l.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-mono uppercase tracking-widest",style:vr.muted,children:"Workspace"}),l.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-mono uppercase tracking-widest",style:vr.muted,children:"Harness"}),l.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-mono uppercase tracking-widest",style:vr.muted,children:"Status"}),l.jsx("th",{className:"px-4 py-3 text-right text-[10px] font-mono uppercase tracking-widest",style:vr.muted,children:"Actions"})]})}),l.jsx("tbody",{children:e.map(d=>{const f=r===d.project.id;return l.jsxs("tr",{className:"border-t",style:{borderColor:g.border,backgroundColor:f?"color-mix(in srgb, var(--os-surface) 80%, white)":"transparent"},children:[l.jsx("td",{className:"px-4 py-3",children:l.jsxs("button",{type:"button",onClick:()=>a(d.project),className:"flex min-w-0 items-center gap-3 text-left",children:[l.jsx("div",{className:An("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-xs font-semibold",d.isBound?"bg-emerald-500/10 text-emerald-700":"bg-secondary text-secondary-foreground"),children:d.project.title.trim().charAt(0).toUpperCase()||"W"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"truncate text-[13px] font-medium",style:vr.ink,children:d.project.title}),l.jsx("div",{className:"truncate text-[11px]",style:vr.muted,children:d.pathLabel})]})]})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Lu,{variant:"outline",className:"font-mono text-[11px] capitalize",children:d.primaryHarness})}),l.jsx("td",{className:"px-4 py-3",children:l.jsxs(Lu,{className:An("text-[11px]",d.isBound?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":d.project.registrationKind==="configured"?"border-amber-500/20 bg-amber-500/10 text-amber-700":"border-border bg-secondary text-secondary-foreground"),children:[d.isBound?l.jsx(R1,{className:"h-3 w-3"}):null,d.statusLabel]})}),l.jsx("td",{className:"px-4 py-3",children:l.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[l.jsx(Nt,{variant:d.isBound?"outline":"default",size:"sm",onClick:()=>i(d.project),children:d.isBound?"Open":"Inspect"}),l.jsx(Nt,{variant:"ghost",size:"icon-sm",onClick:()=>o(d.project),disabled:u===d.project.root,children:l.jsx(T1,{className:"h-4 w-4"})})]})})]},d.project.id)})})]})})}function ZT({activeView:e,help:r,settings:a}){if(e==="help")return l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("div",{className:"max-w-5xl px-8 py-6",children:[l.jsxs("div",{className:"flex items-start justify-between gap-6 mb-5",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1.5",style:{color:g.accent},children:"Help"}),l.jsx("h1",{className:"text-[22px] font-semibold tracking-tight",style:r.styles.inkText,children:"Knowledge Base"}),l.jsx("p",{className:"text-[12px] mt-1.5 max-w-2xl leading-[1.6]",style:r.styles.mutedText,children:"Core Scout terms and the main CLI commands you can use here or in Terminal."})]}),l.jsx("div",{className:"flex items-center gap-2 shrink-0",children:l.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md",style:{color:g.ink},onClick:r.onOpenGeneralSettings,children:[l.jsx($a,{size:12}),"General"]})})]}),l.jsxs("div",{className:"space-y-5",children:[l.jsxs("section",{className:"border rounded-xl p-5",style:{...r.styles.surface,borderColor:g.border},children:[l.jsx("div",{className:"flex items-start justify-between gap-4 mb-5",children:l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Vocabulary"}),l.jsx("div",{className:"text-[14px] font-medium mt-1",style:r.styles.inkText,children:"What Scout means by each term"})]})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[["Project Path","A folder Scout scans recursively to discover repos, project roots, and harness evidence."],["Context Root","The directory where Scout saves `.openscout/project.json` for the current local context."],["Harness","The assistant family a project prefers by default, such as `claude` or `codex`."],["Runtime","The installed local program or persistent session Scout uses to launch a chosen harness."]].map(([u,d])=>l.jsxs("article",{className:"rounded-xl border px-4 py-3.5",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:u}),l.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:r.styles.inkText,children:d})]},u))})]}),l.jsxs("section",{className:"border rounded-xl p-5",style:{...r.styles.surface,borderColor:g.border},children:[l.jsx("div",{className:"flex items-start justify-between gap-4 mb-5",children:l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"CLI Basics"}),l.jsx("div",{className:"text-[14px] font-medium mt-1",style:r.styles.inkText,children:"The same commands the app runs for you"}),l.jsx("div",{className:"text-[12px] mt-1 leading-[1.6] max-w-2xl",style:r.styles.mutedText,children:"Run them from here for guidance, or copy them into your shell when you want the direct Scout workflow."})]})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[{command:"setup",title:"Setup",detail:"Writes a local `.openscout/project.json` for the chosen context."},{command:"doctor",title:"Doctor",detail:"Checks broker health and whether Scout can discover workspaces from your scan roots."},{command:"runtimes",title:"Runtimes",detail:"Shows whether Claude and Codex are installed, authenticated, and ready."}].map(u=>l.jsxs("article",{className:"rounded-xl border px-4 py-3.5",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:u.title}),l.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:r.styles.inkText,children:u.detail}),l.jsx("div",{className:"text-[10px] font-mono mt-3 break-all",style:r.styles.mutedText,children:r.buildOnboardingCommandLine(u.command)}),l.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[l.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md",style:{color:g.ink},onClick:()=>{r.onCopyOnboardingCommand(u.command)},children:[r.onboardingCopiedCommand===u.command?l.jsx(Yi,{size:12}):l.jsx(Nr,{size:12}),"Copy"]}),l.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>{r.onRunOnboardingCommand(u.command)},disabled:!!r.onboardingCommandPending,children:[l.jsx(go,{size:12}),"Run"]})]})]},u.command))})]})]})]})});if(e!=="settings")return null;const i=a.profile,o=i.visibleAppSettings;return l.jsxs("div",{className:"flex-1 flex overflow-hidden",style:a.styles.surface,children:[l.jsxs("div",{className:"w-56 border-r flex flex-col shrink-0",style:{backgroundColor:g.bg,borderColor:g.border},children:[l.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:g.border},children:l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Settings"})}),l.jsx("div",{className:"px-2 py-2 flex flex-col gap-0.5 flex-1",children:a.settingsSections.map(u=>{const d=a.settingsSection===u.id;return l.jsxs("button",{onClick:()=>a.onSetSettingsSection(u.id),className:"flex items-center gap-2.5 px-3 py-2 rounded-lg text-left transition-colors",style:d?{backgroundColor:g.surface,borderColor:g.border,color:g.ink,boxShadow:g.shadowXs}:a.styles.mutedText,children:[l.jsx("span",{style:{color:d?g.accent:g.muted},children:u.icon}),l.jsx("span",{className:"text-[12px] font-medium",style:d?a.styles.inkText:void 0,children:u.label}),d?l.jsx(ql,{size:12,className:"ml-auto",style:a.styles.mutedText}):null]},u.id)})}),l.jsx("div",{className:"px-3 py-3 border-t",style:{borderColor:g.border},children:l.jsxs("button",{type:"button",onClick:a.onOpenFeedbackDialog,className:"flex items-center gap-2 px-3 py-2 w-full rounded-lg transition-colors hover:opacity-70",style:a.styles.mutedText,children:[l.jsx(Al,{size:13,style:{color:g.muted}}),l.jsx("span",{className:"text-[12px] font-medium",children:"Feedback"})]})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("div",{className:"max-w-6xl px-8 py-6",children:[l.jsxs("div",{className:"flex items-start justify-between gap-6 mb-5",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:{color:g.accent},children:"Settings"}),l.jsx("h1",{className:"text-[18px] font-semibold tracking-tight",style:a.styles.inkText,children:a.activeSettingsMeta.label}),l.jsx("p",{className:"text-[11px] mt-1 max-w-2xl leading-[1.6]",style:a.styles.mutedText,children:a.activeSettingsMeta.description})]}),l.jsx("div",{className:"flex items-center gap-2 shrink-0",children:a.headerActions})]}),a.settingsSection==="profile"?l.jsx("div",{className:"max-w-3xl",children:l.jsxs("div",{className:"space-y-5 min-w-0",children:[o?.onboarding?.needed?l.jsxs("section",{className:"border rounded-xl p-5",style:{...a.styles.surface,borderColor:g.border},children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:a.styles.mutedText,children:"Onboarding"}),l.jsx("div",{className:"text-[13px] font-medium mt-1",style:a.styles.inkText,children:o.onboarding.title}),l.jsx("div",{className:"text-[11px] mt-1 leading-[1.5]",style:a.styles.mutedText,children:o.onboarding.detail})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:i.handleRestartOnboarding,children:[l.jsx(xn,{size:12}),"Restart onboarding"]}),l.jsx("span",{className:"text-[9px] font-mono uppercase tracking-wider px-1.5 py-0.5 rounded",style:a.styles.tagBadge,children:`${i.activeOnboardingStepIndex+1}/${i.onboardingWizardSteps.length}`})]})]}),l.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,220px)_minmax(0,1fr)]",children:[l.jsx("div",{className:"space-y-2",children:i.onboardingWizardSteps.map((u,d)=>{const f=i.onboardingWizardStep===u.id,p=d<i.activeOnboardingStepIndex;return l.jsx("button",{type:"button",className:"w-full rounded-lg border px-3 py-2 text-left transition-opacity hover:opacity-90",style:{borderColor:f?g.accent:g.border,backgroundColor:f?g.accentBg:g.surface,color:f?g.accent:g.ink},onClick:()=>i.setOnboardingWizardStep(u.id),children:l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest",children:u.title}),l.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:f?{color:g.accent}:a.styles.mutedText,children:u.detail})]}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:p?a.styles.activePill:a.styles.tagBadge,children:p?"done":d+1})]})},u.id)})}),l.jsxs("div",{className:"rounded-xl border p-4",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest",style:{color:g.accent},children:i.activeOnboardingStep.title}),l.jsx("div",{className:"text-[13px] font-medium mt-1",style:a.styles.inkText,children:i.activeOnboardingStep.detail}),l.jsx("div",{className:"text-[11px] mt-2 leading-[1.6]",style:a.styles.mutedText,children:i.activeOnboardingStep.helper}),i.activeOnboardingStep.id==="welcome"?l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Before you start"}),l.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:a.styles.mutedText,children:"Scout discovers workspaces from scan folders, stores local config under a context root, and needs a default harness before it can broker local runs."})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[["Source roots",(o.workspaceRoots??[]).join(", ")||"None yet"],["Context root",o.onboardingContextRoot||"Not set"],["Default harness",o.defaultHarness??"Not set"],["Operator",o.operatorName||o.operatorNameDefault]].map(([u,d])=>l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.styles.mutedText,children:u}),l.jsx("div",{className:"text-[11px] leading-[1.45]",style:a.styles.inkText,children:d})]},u))})]}):i.activeOnboardingStep.id==="source-roots"?l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Project scan folders"}),l.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:a.styles.mutedText,children:"Scout recursively scans these folders to find repos, manifests, and harness evidence."})]}),l.jsx("div",{className:"space-y-2",children:(o.workspaceRoots??[]).map((u,d)=>l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("input",{value:u,onChange:f=>i.handleSetSourceRootAt(d,f.target.value),readOnly:!i.isAppSettingsEditing||i.appSettingsSaving,className:"flex-1 rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none font-mono",style:{borderColor:g.border,color:g.ink},placeholder:d===0?"~/dev":"Add another scan folder"}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1.5 rounded-md",style:{color:g.ink},onClick:()=>i.handleBrowseForSourceRoot(d),disabled:!i.isAppSettingsEditing||i.appSettingsSaving,children:"Finder"}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[12px] font-medium w-7 h-7 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>i.handleRemoveSourceRootRow(d),disabled:!i.isAppSettingsEditing||i.appSettingsSaving||(o.workspaceRoots??[]).length<=1&&!u,"aria-label":`Remove source root ${d+1}`,children:"-"})]},`onboarding-source-root-${d}`))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[l.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleBeginGeneralEdit(),i.handleAddSourceRootRow()},disabled:i.appSettingsSaving,children:[l.jsx("span",{className:"text-[12px] leading-none",children:"+"}),"Add path"]}),l.jsx("span",{className:"text-[10px]",style:a.styles.mutedText,children:"or"}),i.sourceRootPathSuggestions.map(u=>l.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-mono px-2 py-1 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleBeginGeneralEdit(),i.handleAddSourceRootSuggestion(u)},disabled:i.appSettingsSaving,children:u},u))]}),l.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.styles.mutedText,children:"Context root"}),i.isAppSettingsEditing?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-1.5 max-w-md",children:[l.jsx("input",{value:o.onboardingContextRoot??"",onChange:u=>i.handleSetOnboardingContextRoot(u.target.value),readOnly:i.appSettingsSaving,className:"flex-1 rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none font-mono",style:{borderColor:g.border,color:g.ink},placeholder:"Choose where .openscout should live"}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1.5 rounded-md",style:{color:g.ink},onClick:i.handleBrowseForOnboardingContextRoot,disabled:i.appSettingsSaving,children:"Finder"})]}),l.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:"Project manifest will be saved here."})]}):l.jsx("div",{className:"text-[11px] leading-[1.45]",style:a.styles.inkText,children:o.onboardingContextRoot||"Not set"})]})]}):i.activeOnboardingStep.id==="harness"?l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(k1,{size:14,style:{color:g.accent}}),l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Harness vs runtime"})]}),l.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:"The harness is the assistant family (e.g. Claude, Codex). The runtime is the local program that launches it."})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:["claude","codex"].map(u=>{const d=(o.runtimeCatalog??[]).find(p=>p.name===u)??null,f=o.defaultHarness===u;return l.jsx("button",{className:"text-left rounded-lg border px-3 py-3 transition-opacity hover:opacity-90 disabled:opacity-60",style:{borderColor:g.border,backgroundColor:f?g.bg:g.surface},disabled:!i.isAppSettingsEditing||i.appSettingsSaving,onClick:()=>{i.setAppSettingsDraft(p=>p&&{...p,defaultHarness:u}),i.setAppSettingsFeedback(null)},children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[12px] font-medium capitalize",style:a.styles.inkText,children:u}),l.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:a.styles.mutedText,children:u==="claude"?"Use Claude as the default responder for new project agents.":"Use Codex as the default responder for new project agents."}),l.jsxs("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:["Runtime: ",d?.label??u," · ",d?.readinessDetail??"Not reported yet."]})]}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:f?a.styles.activePill:a.styles.tagBadge,children:f?"selected":"available"})]})},u)})})]}):i.activeOnboardingStep.id==="confirm"?l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Confirm this context"}),l.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:a.styles.mutedText,children:"Review your scan folders and context root before continuing."}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-3",children:[["Source roots",(o.workspaceRoots??[]).join(", ")||"None yet"],["Default harness",o.defaultHarness??"Not set"],["Relay context root",o.onboardingContextRoot||"Not set"],["Operator",o.operatorName||o.operatorNameDefault]].map(([u,d])=>l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.styles.mutedText,children:u}),l.jsx("div",{className:"text-[11px] leading-[1.45]",style:a.styles.inkText,children:d})]},u))})]}),l.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[i.isAppSettingsEditing?null:l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:i.handleStartAppSettingsEdit,disabled:i.appSettingsLoading||i.appSettingsSaving,children:"Edit Inputs"}),l.jsx("div",{className:"text-[10px] leading-[1.5]",style:a.styles.mutedText,children:i.appSettingsDirty?"Next confirms and saves these choices locally.":"Everything here is already saved locally."})]})]}):i.activeOnboardingStep.id==="setup"?l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(No,{size:14,style:{color:g.accent}}),l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Create the local project manifest"})]}),l.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:"Initialize the project manifest at your context root."}),l.jsx("div",{className:"text-[11px] font-mono mt-3 break-all",style:a.styles.inkText,children:i.buildOnboardingCommandLine("setup")}),l.jsxs("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:["Project config path:"," ",i.renderLocalPathValue(o.currentProjectConfigPath??(o.onboardingContextRoot?`${o.onboardingContextRoot}/.openscout/project.json`:"Not created yet."),{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:a.styles.mutedText})]})]}),l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleRunOnboardingCommand("setup")},disabled:!!i.onboardingCommandPending||i.appSettingsLoading||i.appSettingsDirty,children:i.onboardingCommandPending==="setup"?"Running Setup…":"Run Setup"})]}):i.activeOnboardingStep.id==="doctor"?l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(A1,{size:14,style:{color:g.accent}}),l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Review the current inventory"})]}),l.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:"Check broker connectivity, source roots, and discovered projects."}),l.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.styles.mutedText,children:"Projects"}),l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:o.projectInventory.length})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.styles.mutedText,children:"Broker"}),l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:o.broker.reachable?"Reachable":"Unavailable"})]})]}),l.jsx("div",{className:"text-[11px] font-mono mt-3 break-all",style:a.styles.inkText,children:"scout doctor"})]}),l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleRunOnboardingCommand("doctor")},disabled:!!i.onboardingCommandPending||i.appSettingsLoading||!i.onboardingHasProjectConfig,children:i.onboardingCommandPending==="doctor"?"Running Doctor…":"Run Doctor"})]}):l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(go,{size:14,style:{color:g.accent}}),l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Check runtime readiness"})]}),l.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:"Verify each harness runtime is installed and ready."}),l.jsx("div",{className:"grid grid-cols-1 gap-2 mt-3",children:(o.runtimeCatalog??[]).map(u=>l.jsx("div",{className:"rounded-lg border px-3 py-2.5",style:{borderColor:g.border,backgroundColor:g.bg},children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[11px] font-medium",style:a.styles.inkText,children:u.label}),l.jsx("div",{className:"text-[10px] mt-1 leading-[1.4]",style:a.styles.mutedText,children:u.readinessDetail})]}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:u.readinessState==="ready"?a.styles.activePill:a.styles.tagBadge,children:u.readinessState})]})},u.name))}),l.jsxs("div",{className:"text-[10px] mt-3 leading-[1.5]",style:a.styles.mutedText,children:["Default harness: ",o.defaultHarness,". ",i.onboardingRuntimeMatch?`${i.onboardingRuntimeMatch.label} currently reports ${i.onboardingRuntimeMatch.readinessState}.`:"No matching runtime is reported yet."]}),l.jsx("div",{className:"text-[11px] font-mono mt-3 break-all",style:a.styles.inkText,children:"scout runtimes"})]}),l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleRunOnboardingCommand("runtimes")},disabled:!!i.onboardingCommandPending||i.appSettingsLoading,children:i.onboardingCommandPending==="runtimes"?"Running Runtimes…":"Run Runtimes"})]}),l.jsxs("div",{className:"flex items-center justify-between gap-3 mt-5 pt-4 border-t",style:{borderColor:g.border},children:[l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>i.moveOnboardingWizard(-1),disabled:!i.canGoToPreviousOnboardingStep,children:"Back"}),l.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:g.ink},onClick:i.handleOnboardingContinue,disabled:!i.canGoToNextOnboardingStep||i.appSettingsSaving||i.appSettingsLoading,children:[i.activeOnboardingStep.id==="confirm"?i.appSettingsSaving?"Confirming…":"Confirm":"Next",i.activeOnboardingStep.id==="confirm"?null:l.jsx(ql,{size:12})]})]})]})]}),l.jsxs("div",{className:"rounded-lg border px-3 py-3 mt-4",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-2",style:a.styles.mutedText,children:"CLI Equivalent"}),l.jsx("div",{className:"space-y-1",children:o.onboarding.commands.map(u=>l.jsx("div",{className:"text-[11px] font-mono break-all",style:a.styles.inkText,children:u},u))}),l.jsx("div",{className:"text-[10px] mt-3 leading-[1.5]",style:a.styles.mutedText,children:"Each wizard step runs the corresponding CLI command above."})]}),i.appSettingsFeedback?l.jsx("div",{className:"text-[11px] mt-3 leading-[1.5]",style:a.styles.inkText,children:i.appSettingsFeedback}):null,i.onboardingCommandResult?l.jsxs("div",{className:"rounded-lg border px-3 py-3 mt-4",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.styles.mutedText,children:"Last Command"}),l.jsx("div",{className:"text-[11px] font-mono break-all",style:a.styles.inkText,children:i.onboardingCommandResult.commandLine}),l.jsxs("div",{className:"text-[10px] mt-1",style:a.styles.mutedText,children:["cwd:"," ",i.renderLocalPathValue(i.onboardingCommandResult.cwd,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:a.styles.mutedText})]})]}),l.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:i.onboardingCommandResult.exitCode===0?a.styles.activePill:a.styles.tagBadge,children:["exit ",i.onboardingCommandResult.exitCode]})]}),l.jsx("pre",{className:"mt-3 text-[10px] leading-[1.45] whitespace-pre-wrap break-words overflow-x-auto",style:{color:g.ink},children:i.onboardingCommandResult.output})]}):null]}):null,i.appSettingsLoading&&!o?l.jsx("div",{className:"text-[11px]",style:a.styles.mutedText,children:"Loading settings…"}):l.jsxs("div",{className:"space-y-5",children:[l.jsxs("section",{className:"border rounded-lg overflow-hidden",style:{...a.styles.surface,borderColor:g.border},children:[l.jsx("div",{className:"p-4 border-b",style:{borderColor:g.border},children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Scout CLI"}),l.jsx("div",{className:"text-[14px] font-medium mt-1",style:a.styles.inkText,children:"Use the same commands here and in Terminal"}),l.jsx("div",{className:"text-[11px] mt-1 leading-[1.6] max-w-2xl",style:a.styles.mutedText,children:"General is for local Scout setup. Workspace discovery lives in Workspace Explorer so this screen can stay fast."})]}),l.jsx("div",{className:"flex items-center gap-2 shrink-0",children:l.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md",style:{color:g.ink},onClick:i.openKnowledgeBase,children:[l.jsx(x1,{size:12}),"Knowledge Base"]})})]})}),l.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-3 p-4",children:[{command:"setup",title:"scout setup",detail:"Create or refresh the local project manifest for this context."},{command:"doctor",title:"scout doctor",detail:"Check broker health, scan roots, and discovery readiness."},{command:"runtimes",title:"scout runtimes",detail:"Verify Claude and Codex runtimes are installed and ready."}].map(u=>l.jsxs("article",{className:"rounded-xl border px-4 py-4",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[11px] font-mono font-medium",style:{color:g.accent},children:u.title}),l.jsx("div",{className:"text-[11px] mt-2 leading-[1.6]",style:a.styles.mutedText,children:u.detail}),l.jsx("div",{className:"text-[10px] font-mono mt-3 break-all",style:a.styles.inkText,children:i.buildOnboardingCommandLine(u.command)}),l.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[l.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleRunOnboardingCommand(u.command)},disabled:!!i.onboardingCommandPending||i.appSettingsLoading||i.appSettingsSaving||u.command==="doctor"&&i.appSettingsDirty,children:[l.jsx(go,{size:12}),"Run"]}),l.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md",style:{color:g.ink},onClick:()=>{i.handleCopyOnboardingCommand(u.command)},children:[i.onboardingCopiedCommand===u.command?l.jsx(Yi,{size:12}):l.jsx(Nr,{size:12}),"Copy"]})]})]},u.command))})]}),l.jsx("section",{className:"border rounded-lg overflow-hidden",style:{...a.styles.surface,borderColor:g.border},children:l.jsxs("div",{className:"divide-y",style:{borderColor:g.border},children:[l.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-center gap-3",children:[l.jsxs("div",{className:"sm:w-1/3",children:[l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Display Name"}),l.jsx("div",{className:"text-[10px] mt-0.5",style:a.styles.mutedText,children:"Used across Scout and Relay."})]}),l.jsx("div",{className:"sm:w-2/3",children:l.jsx("input",{ref:i.settingsOperatorNameRef,value:i.isAppSettingsEditing?o?.operatorName??"":o?.operatorName??o?.operatorNameDefault??"",onChange:u=>{i.setAppSettingsDraft(d=>d&&{...d,operatorName:u.target.value}),i.setAppSettingsFeedback(null)},readOnly:!i.isAppSettingsEditing||i.appSettingsSaving,placeholder:i.appSettings?.operatorNameDefault??"Operator",className:"w-full max-w-md rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}})})]}),l.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-start gap-3",children:[l.jsxs("div",{className:"sm:w-1/3",children:[l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Default Harness"}),l.jsx("div",{className:"text-[10px] mt-0.5",style:a.styles.mutedText,children:"Fallback assistant family."})]}),l.jsx("div",{className:"sm:w-2/3",children:l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[["claude","codex"].map(u=>{const d=o?.defaultHarness===u,f=(o?.runtimeCatalog??[]).find(p=>p.name===u);return l.jsxs("button",{type:"button",className:"rounded-md border px-3 py-1.5 text-[12px] font-medium capitalize transition-colors disabled:opacity-60 flex items-center gap-1.5",style:{borderColor:d?g.accentBorder:g.border,backgroundColor:d?g.accentBg:g.bg,color:d?g.accent:g.ink},disabled:!i.isAppSettingsEditing||i.appSettingsSaving,onClick:()=>{i.setAppSettingsDraft(p=>p&&{...p,defaultHarness:u}),i.setAppSettingsFeedback(null)},children:[u,f?l.jsx("span",{className:"text-[8px] font-mono uppercase tracking-wider px-1 py-px rounded-sm",style:f.readinessState==="ready"?a.styles.activePill:a.styles.tagBadge,children:f.readinessState}):null]},u)}),l.jsx("button",{type:"button",className:"rounded-md border border-dashed w-8 h-8 flex items-center justify-center text-[14px] transition-colors disabled:opacity-40",style:{borderColor:g.border,color:g.muted},disabled:!i.isAppSettingsEditing||i.appSettingsSaving,title:"Add runtime",children:"+"})]})})]}),l.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-start gap-3",children:[l.jsxs("div",{className:"sm:w-1/3",children:[l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Context Root"}),l.jsx("div",{className:"text-[10px] mt-0.5",style:a.styles.mutedText,children:"Where Scout stores workspace config."})]}),l.jsxs("div",{className:"sm:w-2/3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 max-w-md mb-2",children:[l.jsx("input",{value:o?.onboardingContextRoot??"",onChange:u=>i.handleSetOnboardingContextRoot(u.target.value),readOnly:!i.isAppSettingsEditing||i.appSettingsSaving,className:"flex-1 rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none font-mono",style:{borderColor:g.border,color:g.ink},placeholder:"Choose where .openscout should live"}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1.5 rounded-md",style:{color:g.ink},onClick:i.handleBrowseForOnboardingContextRoot,disabled:!i.isAppSettingsEditing||i.appSettingsSaving,children:"Finder"})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:o?.includeCurrentRepo??!0,disabled:!i.isAppSettingsEditing||i.appSettingsSaving,onChange:u=>{i.setAppSettingsDraft(d=>d&&{...d,includeCurrentRepo:u.target.checked}),i.setAppSettingsFeedback(null)}}),l.jsx("span",{className:"text-[10px]",style:a.styles.inkText,children:"Include root in discovery"})]}),o?.currentProjectConfigPath?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"hidden sm:block w-px h-3",style:{backgroundColor:g.border}}),l.jsx("span",{className:"text-[9px] font-mono truncate",style:a.styles.mutedText,title:o.currentProjectConfigPath,children:i.renderLocalPathValue(o.currentProjectConfigPath,{compact:!0,className:"text-left hover:opacity-80 transition-opacity",style:a.styles.mutedText})})]}):null]})]})]}),l.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-start gap-3",children:[l.jsxs("div",{className:"sm:w-1/3",children:[l.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Scan Folders"}),l.jsx("div",{className:"text-[10px] mt-0.5",style:a.styles.mutedText,children:"Parent directories for repos."})]}),l.jsxs("div",{className:"sm:w-2/3",children:[l.jsxs("div",{className:"space-y-1.5",children:[(o?.workspaceRoots??[]).map((u,d)=>l.jsxs("div",{className:"flex items-center gap-1.5 max-w-md",children:[l.jsx("input",{value:u,onChange:f=>i.handleSetSourceRootAt(d,f.target.value),readOnly:!i.isAppSettingsEditing||i.appSettingsSaving,className:"flex-1 rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none font-mono",style:{borderColor:g.border,color:g.ink},placeholder:d===0?"~/dev":"Add another path"}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1.5 rounded-md",style:{color:g.ink},onClick:()=>i.handleBrowseForSourceRoot(d),disabled:!i.isAppSettingsEditing||i.appSettingsSaving,children:"Finder"}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[12px] font-medium w-7 h-7 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>i.handleRemoveSourceRootRow(d),disabled:!i.isAppSettingsEditing||i.appSettingsSaving||(o?.workspaceRoots??[]).length<=1&&!u,"aria-label":`Remove project path ${d+1}`,children:"-"})]},`general-source-root-${d}`)),(o?.workspaceRoots?.length??0)===0?l.jsx("div",{className:"rounded-md border border-dashed px-2.5 py-2.5 text-[11px] leading-[1.5] max-w-md",style:{borderColor:g.border,color:g.muted},children:"No scan folders configured. Add one to discover projects."}):null]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-2",children:[l.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleBeginGeneralEdit(),i.handleAddSourceRootRow()},disabled:i.appSettingsSaving,children:[l.jsx("span",{className:"text-[12px] leading-none",children:"+"}),"Add path"]}),l.jsx("span",{className:"text-[10px]",style:a.styles.mutedText,children:"or"}),i.sourceRootPathSuggestions.map(u=>l.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-mono px-2 py-1 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleBeginGeneralEdit(),i.handleAddSourceRootSuggestion(u)},disabled:i.appSettingsSaving,children:u},u))]})]})]})]})}),i.appSettingsFeedback?l.jsx("div",{className:"text-[11px] leading-[1.5]",style:a.styles.inkText,children:i.appSettingsFeedback}):null,i.onboardingCommandResult?.command==="doctor"?l.jsxs("div",{className:"space-y-2",children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:a.styles.mutedText,children:"Doctor Output"}),i.renderOnboardingCommandShell("doctor",i.buildOnboardingCommandLine("doctor"),i.onboardingCommandPending==="doctor")]}):null]})]})}):a.settingsSection==="agents"?l.jsx(VT,{...a.agentSettingsViewProps}):a.settingsSection==="workspaces"?l.jsx(QT,{...a.workspaceExplorerViewProps}):a.settingsSection==="communication"?l.jsx($T,{...a.communicationSettingsViewProps}):a.settingsSection==="database"?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("section",{className:"border rounded-xl p-5",style:{...a.database.styles.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Session Index"}),l.jsx("div",{className:"grid grid-cols-3 gap-3",children:[["Sessions",`${a.database.stats.totalSessions}`],["Messages",`${a.database.stats.totalMessages}`],["Projects",`${a.database.stats.projects}`],["Tokens",`${Math.round(a.database.stats.totalTokens/1e3)}k`],["Runtime Messages",`${a.database.runtime?.messageCount??0}`],["tmux Sessions",`${a.database.runtime?.tmuxSessionCount??0}`]].map(([u,d])=>l.jsxs("div",{className:"rounded-lg border px-3 py-2.5",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.database.styles.mutedText,children:u}),l.jsx("div",{className:"text-[16px] font-semibold",style:a.database.styles.inkText,children:d})]},u))})]}),l.jsxs("section",{className:"border rounded-xl p-5",style:{...a.database.styles.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Storage"}),l.jsxs("div",{className:"space-y-3",children:[a.database.visibleAppSettings?.controlPlaneSqlitePath?l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[12px] font-medium",style:a.database.styles.inkText,children:"Control plane database"}),l.jsx("div",{className:"text-[11px] font-mono mt-1 truncate",style:a.database.styles.mutedText,children:a.database.renderLocalPathValue(a.database.visibleAppSettings.controlPlaneSqlitePath,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity truncate",style:a.database.styles.mutedText})})]}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[11px] font-medium px-3 py-1.5 rounded-lg border shrink-0",style:{color:g.ink,borderColor:g.border},onClick:()=>a.database.onRevealPath(a.database.visibleAppSettings.controlPlaneSqlitePath),children:"Reveal in Finder"})]}):null,a.database.visibleAppSettings?.settingsPath?l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[12px] font-medium",style:a.database.styles.inkText,children:"Settings"}),l.jsx("div",{className:"text-[11px] font-mono mt-1 truncate",style:a.database.styles.mutedText,children:a.database.renderLocalPathValue(a.database.visibleAppSettings.settingsPath,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity truncate",style:a.database.styles.mutedText})})]}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[11px] font-medium px-3 py-1.5 rounded-lg border shrink-0",style:{color:g.ink,borderColor:g.border},onClick:()=>a.database.onRevealPath(a.database.visibleAppSettings.settingsPath),children:"Reveal in Finder"})]}):null,a.database.visibleAppSettings?.supportDirectory?l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[12px] font-medium",style:a.database.styles.inkText,children:"Support directory"}),l.jsx("div",{className:"text-[11px] font-mono mt-1 truncate",style:a.database.styles.mutedText,children:a.database.renderLocalPathValue(a.database.visibleAppSettings.supportDirectory,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity truncate",style:a.database.styles.mutedText})})]}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[11px] font-medium px-3 py-1.5 rounded-lg border shrink-0",style:{color:g.ink,borderColor:g.border},onClick:()=>a.database.onRevealPath(a.database.visibleAppSettings.supportDirectory),children:"Reveal in Finder"})]}):null]})]})]}):l.jsxs("div",{className:"grid grid-cols-[minmax(0,1.05fr)_minmax(320px,0.85fr)] gap-4",children:[l.jsxs("section",{className:"border rounded-xl p-5",style:{...a.appearance.styles.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Color Mode"}),l.jsx("div",{className:"flex gap-3 mb-5",children:[{id:"light",label:"Light"},{id:"dark",label:"Dark"}].map(u=>{const d=u.id===(a.appearance.dark?"dark":"light");return l.jsxs("button",{onClick:()=>a.appearance.setDark(u.id==="dark"),className:"flex-1 border rounded-xl px-4 py-4 text-left",style:{borderColor:d?g.accent:g.border,backgroundColor:d?g.bg:g.surface},children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",style:{color:d?g.accent:g.muted},children:[u.id==="dark"?l.jsx(w1,{size:15}):l.jsx(E1,{size:15}),l.jsx("span",{className:"text-[12px] font-medium",style:d?{color:g.accent}:a.appearance.styles.inkText,children:u.label})]}),l.jsx("div",{className:"text-[11px] leading-[1.5]",style:a.appearance.styles.mutedText,children:u.id==="dark"?"Deep shell contrast for low-light work.":"Warm neutral shell with higher paper-like contrast."})]},u.id)})}),l.jsx("div",{className:"border rounded-xl px-4 py-4",style:{borderColor:g.border,backgroundColor:g.bg},children:l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:{color:g.accent},children:"Annotations"}),l.jsx("div",{className:"text-[12px] leading-[1.6]",style:a.appearance.styles.mutedText,children:"Show routing and provenance tags in timelines."})]}),l.jsx("button",{onClick:()=>a.appearance.setShowAnnotations(u=>!u),className:"os-toolbar-button text-[11px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:a.appearance.showAnnotations?"Hide annotations":"Show annotations"})]})})]}),l.jsxs("div",{className:"space-y-4 min-w-0",children:[l.jsxs("section",{className:"border rounded-xl p-5",style:{...a.appearance.styles.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Current Surface"}),l.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[["Mode",a.appearance.dark?"Dark":"Light"],["Annotations",a.appearance.showAnnotations?"Visible":"Hidden"],["Sidebar",a.appearance.isCollapsed?"Collapsed":"Expanded"],["Section",a.appearance.activeSettingsLabel]].map(([u,d])=>l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.appearance.styles.mutedText,children:u}),l.jsx("div",{className:"text-[12px]",style:a.appearance.styles.inkText,children:d})]},u))})]}),l.jsxs("section",{className:"border rounded-xl p-5",style:{...a.appearance.styles.surface,borderColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Coming Soon"}),l.jsx("div",{className:"text-[12px] leading-[1.6]",style:a.appearance.styles.mutedText,children:"Theme, density, and typography controls."})]})]})]})]})})]})}function WT({command:e,commandLine:r,running:a,commandResult:i,visibleAppSettings:o,onboardingCopiedCommand:u,onboardingCommandPending:d,onboardingContextRoot:f,onCopyOnboardingCommand:p,onRunOnboardingCommand:h}){const y=i&&i.exitCode===0,b=i&&i.exitCode!==0;return l.jsxs("div",{className:"space-y-2",children:[y&&(()=>{const v=o?.projectInventory?.length??0,j=o?.broker?.reachable,C=(o?.runtimeCatalog??[]).filter(M=>M.readinessState==="ready").length,E=(o?.runtimeCatalog??[]).length,w=[];return(e==="setup"||e==="doctor")&&(w.push(j?"Broker running":"Broker installed"),v>0&&w.push(`${v} project${v===1?"":"s"} discovered`)),e==="runtimes"&&E>0&&w.push(`${C} of ${E} runtime${E===1?"":"s"} ready`),l.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{backgroundColor:"rgba(34,197,94,0.08)",borderColor:"rgba(34,197,94,0.25)"},children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[l.jsx(Eu,{size:14,style:{color:"#16a34a"}}),l.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#16a34a"},children:"Done"})]}),w.length>0?l.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:w.map(M=>l.jsx("span",{className:"text-[11px]",style:{color:"#16a34a",opacity:.85},children:M},M))}):null]})})(),b?l.jsx("div",{className:"rounded-xl border overflow-hidden",style:{backgroundColor:"rgba(239,68,68,0.06)",borderColor:"rgba(239,68,68,0.25)"},children:l.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[l.jsx(wp,{size:15,className:"shrink-0 mt-0.5",style:{color:"#dc2626"}}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"text-[12px] font-semibold",style:{color:"#dc2626"},children:["Command failed (exit ",i.exitCode,")"]}),l.jsx("div",{className:"text-[11px] mt-1 leading-[1.5]",style:{color:"#dc2626",opacity:.8},children:"Check the output below for details, then try again or run the command in Terminal for more context."})]}),l.jsx("button",{type:"button",className:"shrink-0 text-[11px] font-medium px-3 py-1.5 rounded-lg border transition-opacity hover:opacity-80",style:{borderColor:"rgba(239,68,68,0.35)",color:"#dc2626",backgroundColor:"rgba(239,68,68,0.08)"},onClick:()=>{h(e)},disabled:!!d,children:"Try again"})]})}):null,l.jsxs("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:"rgba(15, 23, 42, 0.12)",backgroundColor:g.termBg},children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 px-3.5 py-2 border-b",style:{borderBottomColor:"rgba(255,255,255,0.06)",backgroundColor:"rgba(255,255,255,0.03)"},children:[l.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-[5px]",children:[l.jsx("span",{className:"w-[7px] h-[7px] rounded-full bg-[#ff5f57]"}),l.jsx("span",{className:"w-[7px] h-[7px] rounded-full bg-[#febc2e]"}),l.jsx("span",{className:"w-[7px] h-[7px] rounded-full bg-[#28c840]"})]}),l.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em]",style:{color:"rgba(255,255,255,0.38)"},children:"Terminal"})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a?l.jsx("span",{className:"text-[10px] font-mono px-2 py-1 rounded animate-pulse",style:{backgroundColor:"rgba(45,212,191,0.18)",color:"#99f6e4"},children:"Running…"}):null,l.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded-md border px-2.5 py-1.5 text-[11px] font-medium transition-opacity hover:opacity-85",style:{borderColor:"rgba(255,255,255,0.12)",color:"rgba(255,255,255,0.82)",backgroundColor:"rgba(255,255,255,0.04)"},onClick:()=>{p(e)},children:[u===e?l.jsx(Eu,{size:12}):l.jsx(Nr,{size:12}),u===e?"Copied":"Copy"]})]})]}),l.jsx("div",{className:"px-4 py-3",children:l.jsxs("div",{className:"text-[13px] leading-[1.7] font-mono break-all",style:{color:g.termFg},children:[l.jsx("span",{style:{color:"rgba(153,246,228,0.80)"},children:"$"})," ",r]})}),a||i?l.jsxs("div",{className:"border-t px-4 py-3",style:{borderTopColor:"rgba(255,255,255,0.06)",backgroundColor:"rgba(0,0,0,0.08)"},children:[l.jsxs("div",{className:"text-[10px] font-mono mb-2",style:{color:"rgba(255,255,255,0.35)"},children:["cwd: ",i?.cwd??(f||"…")]}),l.jsx("pre",{className:"text-[11px] leading-[1.6] whitespace-pre-wrap break-words overflow-x-auto font-mono",style:{color:b?"rgba(252,165,165,0.85)":g.termFg,maxHeight:"16rem",overflowY:"auto"},children:a?"… waiting for output":i?.output})]}):l.jsx("div",{className:"px-4 py-4 border-t",style:{borderTopColor:"rgba(255,255,255,0.06)"},children:l.jsx("div",{className:"text-[11px] font-mono",style:{color:"rgba(255,255,255,0.35)"},children:"Output will appear here after you run the command."})})]})]})}function JT({activeOnboardingStep:e,visibleAppSettings:r,appSettingsSaving:a,appSettingsLoading:i,appSettingsDirty:o,onboardingCommandPending:u,onboardingHasProjectConfig:d,sourceRootPathSuggestions:f,settingsOperatorNameRef:p,setAppSettingsDraft:h,setAppSettingsFeedback:y,setIsAppSettingsEditing:b,handleAddSourceRootRow:v,handleSetSourceRootAt:j,handleBrowseForSourceRoot:C,handleRemoveSourceRootRow:E,handleSetOnboardingContextRoot:w,handleBrowseForOnboardingContextRoot:M,handleAddSourceRootSuggestion:D,handleRunOnboardingCommand:H,buildOnboardingCommandLine:X,renderOnboardingCommandShell:q,renderLocalPathValue:L,styles:B,availableHarnesses:F}){if(e.id==="welcome")return l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"text-[32px] font-bold tracking-tight leading-[1.15]",style:B.inkText,children:"Welcome to Scout"}),l.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:B.mutedText,children:"What should we call you?"})]}),l.jsxs("div",{className:"rounded-xl border px-6 py-6",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest mb-4",style:{color:g.accent},children:"Your name"}),l.jsx("input",{ref:p,value:r.operatorName??"",onChange:O=>{h(P=>P&&{...P,operatorName:O.target.value}),y(null),b(!0)},readOnly:a,placeholder:r.operatorNameDefault||"Operator",className:"w-full border-b-2 border-t-0 border-l-0 border-r-0 px-0 py-3 text-[24px] font-semibold leading-[1.3] bg-transparent outline-none transition-colors focus:border-[var(--os-accent)]",style:{borderBottomColor:g.border,color:g.ink}}),l.jsx("div",{className:"text-[12px] mt-4 leading-[1.6]",style:B.mutedText,children:"Prefilled from your machine."})]})]});if(e.id==="source-roots")return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:B.inkText,children:"Scan folders and context root"}),l.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:B.mutedText,children:"Choose the parent folders Scout should scan for repos, then choose the one directory where this Scout context should live."})]}),l.jsxs("div",{className:"rounded-xl border px-5 py-5",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[l.jsx("div",{className:"text-[11px] font-mono uppercase tracking-widest",style:B.mutedText,children:"Source Roots"}),l.jsxs("button",{type:"button",className:"os-toolbar-button inline-flex items-center gap-1 text-[12px] font-medium px-3 py-1.5 rounded-lg border disabled:opacity-50",style:{color:g.ink,borderColor:g.border},onClick:v,disabled:a,children:[l.jsx("span",{className:"text-[14px] leading-none",children:"+"}),"Add path"]})]}),l.jsx("div",{className:"text-[12px] mb-3 leading-[1.6]",style:B.mutedText,children:"These are scan inputs. Scout looks through the repos underneath them, but listing a folder here does not make it the place where Scout saves this context."}),l.jsxs("div",{className:"space-y-3",children:[(r.workspaceRoots??[]).map((O,P)=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{value:O,onChange:Q=>j(P,Q.target.value),readOnly:a,className:"flex-1 rounded-lg border px-4 py-3 text-[15px] font-mono leading-[1.5] bg-transparent outline-none transition-colors focus:border-[var(--os-accent)]",style:{borderColor:g.border,color:g.ink},placeholder:P===0?"~/dev":"Add another source root"}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[12px] font-medium px-3 py-3 rounded-lg border disabled:opacity-50 shrink-0",style:{color:g.ink,borderColor:g.border},onClick:()=>C(P),disabled:a,children:"Finder"}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[14px] font-medium w-10 h-10 rounded-lg border disabled:opacity-50 shrink-0",style:{color:g.ink,borderColor:g.border},onClick:()=>E(P),disabled:a||(r.workspaceRoots??[]).length<=1&&!O,"aria-label":`Remove source root ${P+1}`,children:"-"})]},`immersive-source-root-${P}`)),(r.workspaceRoots??[]).length===0?l.jsx("div",{className:"rounded-lg border border-dashed px-4 py-4 text-[12px] leading-[1.6]",style:{borderColor:g.border,color:g.muted},children:"No scan folders yet. Add a path above to tell Scout where to look for repos and projects."}):null]}),l.jsxs("div",{className:"mt-5 pt-5 border-t",style:{borderTopColor:g.border},children:[l.jsx("div",{className:"text-[11px] font-mono uppercase tracking-widest mb-3",style:B.mutedText,children:"Relay Context Root"}),l.jsxs("div",{className:"text-[12px] leading-[1.6] mb-3",style:B.mutedText,children:["This is different from the scan folders above. Scout will save this context here by writing ",l.jsx("code",{className:"font-mono text-[11px] px-1.5 py-0.5 rounded",style:{backgroundColor:g.bg},children:".openscout/project.json"})," inside this directory."]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{value:r.onboardingContextRoot??"",onChange:O=>w(O.target.value),readOnly:a,className:"flex-1 rounded-lg border px-4 py-3 text-[15px] font-mono leading-[1.5] bg-transparent outline-none transition-colors focus:border-[var(--os-accent)]",style:{borderColor:g.border,color:g.ink},placeholder:"Choose where .openscout should live"}),l.jsx("button",{type:"button",className:"os-toolbar-button text-[12px] font-medium px-3 py-3 rounded-lg border disabled:opacity-50 shrink-0",style:{color:g.ink,borderColor:g.border},onClick:M,disabled:a,children:"Finder"})]})]}),l.jsxs("div",{className:"text-[12px] mt-3 leading-[1.6]",style:B.mutedText,children:["Usually something like ",l.jsx("code",{className:"font-mono text-[11px] px-1.5 py-0.5 rounded",style:{backgroundColor:g.bg},children:"~/dev"})," or ",l.jsx("code",{className:"font-mono text-[11px] px-1.5 py-0.5 rounded",style:{backgroundColor:g.bg},children:"~/src"}),"."]}),l.jsx("div",{className:"flex flex-wrap gap-2 mt-4",children:f.map(O=>l.jsx("button",{className:"os-toolbar-button text-[12px] font-mono font-medium px-3 py-1.5 rounded-lg border disabled:opacity-50",style:{color:g.ink,borderColor:g.border},onClick:()=>D(O),disabled:a,children:O},O))})]})]});if(e.id==="harness")return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:B.inkText,children:"Default harness"}),l.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:B.mutedText,children:"Which assistant should answer new project turns by default?"})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:F.map(O=>{const P=(r.runtimeCatalog??[]).find(oe=>oe.name===O)??null,Q=r.defaultHarness===O;return l.jsx("button",{className:"os-card text-left rounded-xl border px-5 py-5 disabled:opacity-60",style:{borderColor:Q?g.accent:g.border,backgroundColor:Q?g.accentBg:g.surface,boxShadow:Q?`0 0 0 1px ${g.accent}`:"none"},disabled:a,onClick:()=>{h(oe=>oe&&{...oe,defaultHarness:O}),y(null)},children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[18px] font-semibold capitalize tracking-tight",style:B.inkText,children:O}),l.jsx("div",{className:"text-[13px] mt-2 leading-[1.6]",style:B.mutedText,children:O==="claude"?"Anthropic Claude Code — agentic coding via local CLI session.":"OpenAI Codex — agentic coding via cloud sandbox."}),l.jsxs("div",{className:"text-[12px] mt-4 leading-[1.6]",style:B.mutedText,children:["Runtime: ",P?.label??O," · ",P?.readinessDetail??"Not reported yet."]})]}),l.jsx("span",{className:"text-[10px] font-mono px-2.5 py-1 rounded-full shrink-0",style:Q?B.activePill:B.tagBadge,children:Q?"selected":"available"})]})},O)})})]});if(e.id==="confirm")return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:B.inkText,children:"Confirm this context"}),l.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:B.mutedText,children:"Review which folders Scout will scan and where it will save this context before continuing."})]}),l.jsx("div",{className:"rounded-xl border px-5 py-5",style:{borderColor:g.border,backgroundColor:g.surface},children:l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[["Operator",r.operatorName||r.operatorNameDefault],["Source roots",(r.workspaceRoots??[]).join(", ")||"None yet"],["Default harness",r.defaultHarness??"Not set"],["Relay context root",r.onboardingContextRoot||"Not set"]].map(([O,P])=>l.jsxs("div",{className:"rounded-lg px-4 py-3",style:{backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest mb-2",style:{color:g.accent},children:O}),l.jsx("div",{className:"text-[15px] font-medium leading-[1.5]",style:B.inkText,children:O==="Relay context root"?L(String(P),{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"}):P})]},O))})}),o?l.jsx("div",{className:"text-[12px] leading-[1.6]",style:B.mutedText,children:"Unsaved changes."}):null]});if(e.id==="setup"){const O=X("setup"),P=u==="setup",Q=r.currentProjectConfigPath??(r.onboardingContextRoot?`${r.onboardingContextRoot}/.openscout/project.json`:"Not created yet.");return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:B.inkText,children:"Setup"}),l.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:B.mutedText,children:"Create the local project manifest."})]}),q("setup",O,P),l.jsxs("div",{className:"rounded-xl border px-5 py-5",style:{borderColor:g.border,backgroundColor:g.surface},children:[l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[["1. Context root",r.onboardingContextRoot||"Not set"],["2. Manifest","Writes `.openscout/project.json` at that root to anchor this context."],["3. Discovery","Uses that context plus scanned folders to build inventory and routing."]].map(([oe,J])=>l.jsxs("div",{className:"rounded-lg border px-4 py-4",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[11px] font-mono font-medium tracking-wide",style:{color:g.accent},children:oe}),l.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:B.mutedText,children:J})]},oe))}),l.jsx("div",{className:"text-[12px] font-mono mt-5 leading-[1.6] break-all",style:B.mutedText,children:typeof Q=="string"?L(Q,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:B.mutedText}):Q})]}),l.jsx("button",{className:"os-btn-primary flex items-center gap-2 text-[13px] font-semibold px-5 py-2.5 rounded-lg disabled:opacity-40 transition-all",style:{backgroundColor:g.accent,color:"#fff"},onClick:()=>{H("setup")},disabled:!!u||i||o,children:P?"Running Setup…":"Run Setup"})]})}if(e.id==="doctor"){const O=X("doctor"),P=u==="doctor",Q=r.broker.reachable,oe=r.projectInventory.length,J=[{label:"Broker",value:Q?"Reachable":"Unavailable",ok:Q,fix:Q?null:"Re-run setup to install and start the broker service."},{label:"Projects",value:`${oe} found`,ok:oe>0,fix:oe===0?"Add workspace roots in Settings → General, then refresh Workspaces.":null},{label:"Context root",value:r.currentProjectConfigPath?"Configured":"Missing",ok:!!r.currentProjectConfigPath,fix:r.currentProjectConfigPath?null:"Run setup again from the previous step."}],ee=J.some(N=>!N.ok);return l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:B.inkText,children:"Doctor"}),l.jsx("div",{className:"text-[14px] leading-[1.6]",style:B.mutedText,children:"Verify broker health, project discovery, and relay context."})]}),l.jsx("div",{className:"grid grid-cols-3 gap-3",children:J.map(N=>l.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{borderColor:N.ok?"rgba(34,197,94,0.25)":"rgba(239,68,68,0.25)",backgroundColor:N.ok?"rgba(34,197,94,0.05)":"rgba(239,68,68,0.05)"},children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[l.jsx("span",{style:{color:N.ok?"#16a34a":"#dc2626",fontSize:13},children:N.ok?"✓":"✗"}),l.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest",style:{color:N.ok?"#16a34a":"#dc2626"},children:N.label})]}),l.jsx("div",{className:"text-[13px] font-medium",style:B.inkText,children:N.value}),N.fix?l.jsx("div",{className:"text-[11px] mt-1.5 leading-[1.5]",style:{color:"#dc2626",opacity:.8},children:N.fix}):null]},N.label))}),q("doctor",O,P),l.jsx("button",{className:"os-btn-primary flex items-center gap-2 text-[13px] font-semibold px-5 py-2.5 rounded-lg disabled:opacity-40 transition-all",style:{backgroundColor:ee?"#dc2626":g.accent,color:"#fff"},onClick:()=>{H("doctor")},disabled:!!u||i||!d,children:P?"Running Doctor…":ee?"Run Doctor to diagnose":"Run Doctor"})]})}const Z=X("runtimes");return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:B.inkText,children:"Runtimes"}),l.jsx("div",{className:"text-[14px] leading-[1.6]",style:B.mutedText,children:"Verify each harness has a working local runtime."})]}),(r.runtimeCatalog??[]).length>0?l.jsx("div",{className:"grid grid-cols-1 gap-2",children:(r.runtimeCatalog??[]).map(O=>{const P=O.readinessState==="ready";return l.jsxs("div",{className:"rounded-xl border px-4 py-3 flex items-start justify-between gap-3",style:{borderColor:P?"rgba(34,197,94,0.25)":"rgba(239,68,68,0.25)",backgroundColor:P?"rgba(34,197,94,0.05)":"rgba(239,68,68,0.05)"},children:[l.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[l.jsx("span",{className:"mt-0.5 text-[14px]",style:{color:P?"#16a34a":"#dc2626"},children:P?"✓":"✗"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[13px] font-semibold",style:B.inkText,children:O.label}),l.jsx("div",{className:"text-[11px] mt-0.5 leading-[1.5]",style:P?B.mutedText:{color:"#dc2626",opacity:.85},children:O.readinessDetail}),!P&&O.readinessState==="missing"?l.jsx("div",{className:"text-[10px] font-mono mt-1.5 px-2 py-1 rounded inline-block",style:{backgroundColor:"rgba(239,68,68,0.08)",color:"#dc2626"},children:O.name==="claude"?"brew install claude":O.name==="codex"?"npm install -g @openai/codex":`install ${O.name}`}):null,!P&&O.readinessState==="configured"?l.jsx("div",{className:"text-[10px] font-mono mt-1.5 px-2 py-1 rounded inline-block",style:{backgroundColor:"rgba(239,68,68,0.08)",color:"#dc2626"},children:O.name==="claude"?"claude login":O.name==="codex"?"codex login":`${O.name} login`}):null]})]}),l.jsx("span",{className:"text-[10px] font-mono px-2.5 py-1 rounded-full shrink-0",style:P?B.activePill:{backgroundColor:"rgba(239,68,68,0.12)",color:"#dc2626"},children:O.readinessState})]},O.name)})}):null,q("runtimes",Z,u==="runtimes"),l.jsx("button",{className:"os-btn-primary flex items-center gap-2 text-[13px] font-semibold px-5 py-2.5 rounded-lg disabled:opacity-40 transition-all",style:{backgroundColor:g.accent,color:"#fff"},onClick:()=>{H("runtimes")},disabled:!!u||i,children:u==="runtimes"?"Running Runtimes…":"Run Runtimes"})]})}function e3(e,r){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const t3=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,n3=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l3={};function ay(e,r){return(l3.jsx?n3:t3).test(e)}const r3=/[ \t\n\f\r]/g;function a3(e){return typeof e=="object"?e.type==="text"?iy(e.value):!1:iy(e)}function iy(e){return e.replace(r3,"")===""}class Mo{constructor(r,a,i){this.normal=a,this.property=r,i&&(this.space=i)}}Mo.prototype.normal={};Mo.prototype.property={};Mo.prototype.space=void 0;function a0(e,r){const a={},i={};for(const o of e)Object.assign(a,o.property),Object.assign(i,o.normal);return new Mo(a,i,r)}function ip(e){return e.toLowerCase()}class Zn{constructor(r,a){this.attribute=a,this.property=r}}Zn.prototype.attribute="";Zn.prototype.booleanish=!1;Zn.prototype.boolean=!1;Zn.prototype.commaOrSpaceSeparated=!1;Zn.prototype.commaSeparated=!1;Zn.prototype.defined=!1;Zn.prototype.mustUseProperty=!1;Zn.prototype.number=!1;Zn.prototype.overloadedBoolean=!1;Zn.prototype.property="";Zn.prototype.spaceSeparated=!1;Zn.prototype.space=void 0;let i3=0;const dt=Za(),cn=Za(),sp=Za(),ke=Za(),Ut=Za(),Xi=Za(),ol=Za();function Za(){return 2**++i3}const op=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:cn,commaOrSpaceSeparated:ol,commaSeparated:Xi,number:ke,overloadedBoolean:sp,spaceSeparated:Ut},Symbol.toStringTag,{value:"Module"})),Rm=Object.keys(op);class Fp extends Zn{constructor(r,a,i,o){let u=-1;if(super(r,a),sy(this,"space",o),typeof i=="number")for(;++u<Rm.length;){const d=Rm[u];sy(this,Rm[u],(i&op[d])===op[d])}}}Fp.prototype.defined=!0;function sy(e,r,a){a&&(e[r]=a)}function es(e){const r={},a={};for(const[i,o]of Object.entries(e.properties)){const u=new Fp(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(u.mustUseProperty=!0),r[i]=u,a[ip(i)]=i,a[ip(u.attribute)]=i}return new Mo(r,a,e.space)}const i0=es({properties:{ariaActiveDescendant:null,ariaAtomic:cn,ariaAutoComplete:null,ariaBusy:cn,ariaChecked:cn,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:Ut,ariaCurrent:null,ariaDescribedBy:Ut,ariaDetails:null,ariaDisabled:cn,ariaDropEffect:Ut,ariaErrorMessage:null,ariaExpanded:cn,ariaFlowTo:Ut,ariaGrabbed:cn,ariaHasPopup:null,ariaHidden:cn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ut,ariaLevel:ke,ariaLive:null,ariaModal:cn,ariaMultiLine:cn,ariaMultiSelectable:cn,ariaOrientation:null,ariaOwns:Ut,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:cn,ariaReadOnly:cn,ariaRelevant:null,ariaRequired:cn,ariaRoleDescription:Ut,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:cn,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function s0(e,r){return r in e?e[r]:r}function o0(e,r){return s0(e,r.toLowerCase())}const s3=es({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xi,acceptCharset:Ut,accessKey:Ut,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:Ut,autoFocus:dt,autoPlay:dt,blocking:Ut,capture:null,charSet:null,checked:dt,cite:null,className:Ut,cols:ke,colSpan:null,content:null,contentEditable:cn,controls:dt,controlsList:Ut,coords:ke|Xi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:sp,draggable:cn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:Ut,height:ke,hidden:sp,high:ke,href:null,hrefLang:null,htmlFor:Ut,httpEquiv:Ut,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:Ut,itemRef:Ut,itemScope:dt,itemType:Ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:dt,optimum:ke,pattern:null,ping:Ut,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:Ut,required:dt,reversed:dt,rows:ke,rowSpan:ke,sandbox:Ut,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:cn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:cn,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ut,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:cn,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:o0}),o3=es({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ol,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Ut,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Xi,g2:Xi,glyphName:Xi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:ol,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ke,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ol,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ol,rev:ol,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ol,requiredFeatures:ol,requiredFonts:ol,requiredFormats:ol,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:ol,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ol,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ol,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:s0}),c0=es({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,r){return"xlink:"+r.slice(5).toLowerCase()}}),u0=es({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:o0}),d0=es({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,r){return"xml:"+r.slice(3).toLowerCase()}}),c3={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},u3=/[A-Z]/g,oy=/-[a-z]/g,d3=/^data[-\w.:]+$/i;function f3(e,r){const a=ip(r);let i=r,o=Zn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&d3.test(r)){if(r.charAt(4)==="-"){const u=r.slice(5).replace(oy,p3);i="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=r.slice(4);if(!oy.test(u)){let d=u.replace(u3,m3);d.charAt(0)!=="-"&&(d="-"+d),r="data"+d}}o=Fp}return new o(i,r)}function m3(e){return"-"+e.toLowerCase()}function p3(e){return e.charAt(1).toUpperCase()}const h3=a0([i0,s3,c0,u0,d0],"html"),qp=a0([i0,o3,c0,u0,d0],"svg");function x3(e){return e.join(" ").trim()}var Fi={},Mm,cy;function g3(){if(cy)return Mm;cy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,a=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,p=`
|
|
59
|
-
`,h="/",y="*",b="",v="comment",j="declaration";function C(w,M){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];M=M||{};var D=1,H=1;function X(J){var ee=J.match(r);ee&&(D+=ee.length);var N=J.lastIndexOf(p);H=~N?J.length-N:H+J.length}function q(){var J={line:D,column:H};return function(ee){return ee.position=new L(J),Z(),ee}}function L(J){this.start=J,this.end={line:D,column:H},this.source=M.source}L.prototype.content=w;function B(J){var ee=new Error(M.source+":"+D+":"+H+": "+J);if(ee.reason=J,ee.filename=M.source,ee.line=D,ee.column=H,ee.source=w,!M.silent)throw ee}function F(J){var ee=J.exec(w);if(ee){var N=ee[0];return X(N),w=w.slice(N.length),ee}}function Z(){F(a)}function O(J){var ee;for(J=J||[];ee=P();)ee!==!1&&J.push(ee);return J}function P(){var J=q();if(!(h!=w.charAt(0)||y!=w.charAt(1))){for(var ee=2;b!=w.charAt(ee)&&(y!=w.charAt(ee)||h!=w.charAt(ee+1));)++ee;if(ee+=2,b===w.charAt(ee-1))return B("End of comment missing");var N=w.slice(2,ee-2);return H+=2,X(N),w=w.slice(ee),H+=2,J({type:v,comment:N})}}function Q(){var J=q(),ee=F(i);if(ee){if(P(),!F(o))return B("property missing ':'");var N=F(u),Y=J({type:j,property:E(ee[0].replace(e,b)),value:N?E(N[0].replace(e,b)):b});return F(d),Y}}function oe(){var J=[];O(J);for(var ee;ee=Q();)ee!==!1&&(J.push(ee),O(J));return J}return Z(),oe()}function E(w){return w?w.replace(f,b):b}return Mm=C,Mm}var uy;function b3(){if(uy)return Fi;uy=1;var e=Fi&&Fi.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.default=a;const r=e(g3());function a(i,o){let u=null;if(!i||typeof i!="string")return u;const d=(0,r.default)(i),f=typeof o=="function";return d.forEach(p=>{if(p.type!=="declaration")return;const{property:h,value:y}=p;f?o(h,y,p):y&&(u=u||{},u[h]=y)}),u}return Fi}var uo={},dy;function y3(){if(dy)return uo;dy=1,Object.defineProperty(uo,"__esModule",{value:!0}),uo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(h){return!h||a.test(h)||e.test(h)},d=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},p=function(h,y){return y===void 0&&(y={}),u(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(o,f):h=h.replace(i,f),h.replace(r,d))};return uo.camelCase=p,uo}var fo,fy;function v3(){if(fy)return fo;fy=1;var e=fo&&fo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},r=e(b3()),a=y3();function i(o,u){var d={};return!o||typeof o!="string"||(0,r.default)(o,function(f,p){f&&p&&(d[(0,a.camelCase)(f,u)]=p)}),d}return i.default=i,fo=i,fo}var k3=v3();const j3=Pu(k3),f0=m0("end"),Vp=m0("start");function m0(e){return r;function r(a){const i=a&&a.position&&a.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function N3(e){const r=Vp(e),a=f0(e);if(r&&a)return{start:r,end:a}}function bo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?my(e.position):"start"in e||"end"in e?my(e):"line"in e||"column"in e?cp(e):""}function cp(e){return py(e&&e.line)+":"+py(e&&e.column)}function my(e){return cp(e&&e.start)+"-"+cp(e&&e.end)}function py(e){return e&&typeof e=="number"?e:1}class Dn extends Error{constructor(r,a,i){super(),typeof a=="string"&&(i=a,a=void 0);let o="",u={},d=!1;if(a&&("line"in a&&"column"in a?u={place:a}:"start"in a&&"end"in a?u={place:a}:"type"in a?u={ancestors:[a],place:a.position}:u={...a}),typeof r=="string"?o=r:!u.cause&&r&&(d=!0,o=r.message,u.cause=r),!u.ruleId&&!u.source&&typeof i=="string"){const p=i.indexOf(":");p===-1?u.ruleId=i:(u.source=i.slice(0,p),u.ruleId=i.slice(p+1))}if(!u.place&&u.ancestors&&u.ancestors){const p=u.ancestors[u.ancestors.length-1];p&&(u.place=p.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=bo(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=d&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dn.prototype.file="";Dn.prototype.name="";Dn.prototype.reason="";Dn.prototype.message="";Dn.prototype.stack="";Dn.prototype.column=void 0;Dn.prototype.line=void 0;Dn.prototype.ancestors=void 0;Dn.prototype.cause=void 0;Dn.prototype.fatal=void 0;Dn.prototype.place=void 0;Dn.prototype.ruleId=void 0;Dn.prototype.source=void 0;const Gp={}.hasOwnProperty,w3=new Map,S3=/[A-Z]/g,C3=new Set(["table","tbody","thead","tfoot","tr"]),T3=new Set(["td","th"]),p0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function A3(e,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=r.filePath||void 0;let i;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=_3(a,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=D3(a,r.jsx,r.jsxs)}const o={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:i,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?qp:h3,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},u=h0(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function h0(e,r,a){if(r.type==="element")return E3(e,r,a);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return R3(e,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return z3(e,r,a);if(r.type==="mdxjsEsm")return M3(e,r);if(r.type==="root")return O3(e,r,a);if(r.type==="text")return L3(e,r)}function E3(e,r,a){const i=e.schema;let o=i;r.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=qp,e.schema=o),e.ancestors.push(r);const u=g0(e,r.tagName,!1),d=B3(e,r);let f=Yp(e,r);return C3.has(r.tagName)&&(f=f.filter(function(p){return typeof p=="string"?!a3(p):!0})),x0(e,d,u,r),$p(d,f),e.ancestors.pop(),e.schema=i,e.create(r,u,d,a)}function R3(e,r){if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}To(e,r.position)}function M3(e,r){if(r.data&&r.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(r.data.estree);To(e,r.position)}function z3(e,r,a){const i=e.schema;let o=i;r.name==="svg"&&i.space==="html"&&(o=qp,e.schema=o),e.ancestors.push(r);const u=r.name===null?e.Fragment:g0(e,r.name,!0),d=I3(e,r),f=Yp(e,r);return x0(e,d,u,r),$p(d,f),e.ancestors.pop(),e.schema=i,e.create(r,u,d,a)}function O3(e,r,a){const i={};return $p(i,Yp(e,r)),e.create(r,e.Fragment,i,a)}function L3(e,r){return r.value}function x0(e,r,a,i){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(r.node=i)}function $p(e,r){if(r.length>0){const a=r.length>1?r:r[0];a&&(e.children=a)}}function D3(e,r,a){return i;function i(o,u,d,f){const h=Array.isArray(d.children)?a:r;return f?h(u,d,f):h(u,d)}}function _3(e,r){return a;function a(i,o,u,d){const f=Array.isArray(u.children),p=Vp(i);return r(o,u,d,f,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function B3(e,r){const a={};let i,o;for(o in r.properties)if(o!=="children"&&Gp.call(r.properties,o)){const u=P3(e,o,r.properties[o]);if(u){const[d,f]=u;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&T3.has(r.tagName)?i=f:a[d]=f}}if(i){const u=a.style||(a.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return a}function I3(e,r){const a={};for(const i of r.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const u=i.data.estree.body[0];u.type;const d=u.expression;d.type;const f=d.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else To(e,r.position);else{const o=i.name;let u;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const f=i.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else To(e,r.position);else u=i.value===null?!0:i.value;a[o]=u}return a}function Yp(e,r){const a=[];let i=-1;const o=e.passKeys?new Map:w3;for(;++i<r.children.length;){const u=r.children[i];let d;if(e.passKeys){const p=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(p){const h=o.get(p)||0;d=p+"-"+h,o.set(p,h+1)}}const f=h0(e,u,d);f!==void 0&&a.push(f)}return a}function P3(e,r,a){const i=f3(e.schema,r);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=i.commaSeparated?e3(a):x3(a)),i.property==="style"){let o=typeof a=="object"?a:U3(e,String(a));return e.stylePropertyNameCase==="css"&&(o=H3(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?c3[i.property]||i.property:i.attribute,a]}}function U3(e,r){try{return j3(r,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const i=a,o=new Dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=p0+"#cannot-parse-style-attribute",o}}function g0(e,r,a){let i;if(!a)i={type:"Literal",value:r};else if(r.includes(".")){const o=r.split(".");let u=-1,d;for(;++u<o.length;){const f=ay(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}i=d}else i=ay(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(i.type==="Literal"){const o=i.value;return Gp.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);To(e)}function To(e,r){const a=new Dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=p0+"#cannot-handle-mdx-estrees-without-createevaluater",a}function H3(e){const r={};let a;for(a in e)Gp.call(e,a)&&(r[F3(a)]=e[a]);return r}function F3(e){let r=e.replace(S3,q3);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function q3(e){return"-"+e.toLowerCase()}const zm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},V3={};function Qp(e,r){const a=V3,i=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return b0(e,i,o)}function b0(e,r,a){if(G3(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(r&&"alt"in e&&e.alt)return e.alt;if("children"in e)return hy(e.children,r,a)}return Array.isArray(e)?hy(e,r,a):""}function hy(e,r,a){const i=[];let o=-1;for(;++o<e.length;)i[o]=b0(e[o],r,a);return i.join("")}function G3(e){return!!(e&&typeof e=="object")}const xy=document.createElement("i");function Xp(e){const r="&"+e+";";xy.innerHTML=r;const a=xy.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===r?!1:a}function ul(e,r,a,i){const o=e.length;let u=0,d;if(r<0?r=-r>o?0:o+r:r=r>o?o:r,a=a>0?a:0,i.length<1e4)d=Array.from(i),d.unshift(r,a),e.splice(...d);else for(a&&e.splice(r,a);u<i.length;)d=i.slice(u,u+1e4),d.unshift(r,0),e.splice(...d),u+=1e4,r+=1e4}function vl(e,r){return e.length>0?(ul(e,e.length,0,r),e):r}const gy={}.hasOwnProperty;function y0(e){const r={};let a=-1;for(;++a<e.length;)$3(r,e[a]);return r}function $3(e,r){let a;for(a in r){const o=(gy.call(e,a)?e[a]:void 0)||(e[a]={}),u=r[a];let d;if(u)for(d in u){gy.call(o,d)||(o[d]=[]);const f=u[d];Y3(o[d],Array.isArray(f)?f:f?[f]:[])}}}function Y3(e,r){let a=-1;const i=[];for(;++a<r.length;)(r[a].add==="after"?e:i).push(r[a]);ul(e,0,0,i)}function v0(e,r){const a=Number.parseInt(e,r);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function El(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pn=pa(/[A-Za-z]/),Ln=pa(/[\dA-Za-z]/),Q3=pa(/[#-'*+\--9=?A-Z^-~]/);function Du(e){return e!==null&&(e<32||e===127)}const up=pa(/\d/),X3=pa(/[\dA-Fa-f]/),K3=pa(/[!-/:-@[-`{-~]/);function $e(e){return e!==null&&e<-2}function It(e){return e!==null&&(e<0||e===32)}function gt(e){return e===-2||e===-1||e===32}const Gu=pa(new RegExp("\\p{P}|\\p{S}","u")),Qa=pa(/\s/);function pa(e){return r;function r(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function ts(e){const r=[];let a=-1,i=0,o=0;for(;++a<e.length;){const u=e.charCodeAt(a);let d="";if(u===37&&Ln(e.charCodeAt(a+1))&&Ln(e.charCodeAt(a+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(d=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(a+1);u<56320&&f>56319&&f<57344?(d=String.fromCharCode(u,f),o=1):d="�"}else d=String.fromCharCode(u);d&&(r.push(e.slice(i,a),encodeURIComponent(d)),i=a+o+1,d=""),o&&(a+=o,o=0)}return r.join("")+e.slice(i)}function wt(e,r,a,i){const o=i?i-1:Number.POSITIVE_INFINITY;let u=0;return d;function d(p){return gt(p)?(e.enter(a),f(p)):r(p)}function f(p){return gt(p)&&u++<o?(e.consume(p),f):(e.exit(a),r(p))}}const Z3={tokenize:W3};function W3(e){const r=e.attempt(this.parser.constructs.contentInitial,i,o);let a;return r;function i(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),wt(e,r,"linePrefix")}function o(f){return e.enter("paragraph"),u(f)}function u(f){const p=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return $e(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),d)}}const J3={tokenize:e5},by={tokenize:t5};function e5(e){const r=this,a=[];let i=0,o,u,d;return f;function f(H){if(i<a.length){const X=a[i];return r.containerState=X[1],e.attempt(X[0].continuation,p,h)(H)}return h(H)}function p(H){if(i++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,o&&D();const X=r.events.length;let q=X,L;for(;q--;)if(r.events[q][0]==="exit"&&r.events[q][1].type==="chunkFlow"){L=r.events[q][1].end;break}M(i);let B=X;for(;B<r.events.length;)r.events[B][1].end={...L},B++;return ul(r.events,q+1,0,r.events.slice(X)),r.events.length=B,h(H)}return f(H)}function h(H){if(i===a.length){if(!o)return v(H);if(o.currentConstruct&&o.currentConstruct.concrete)return C(H);r.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return r.containerState={},e.check(by,y,b)(H)}function y(H){return o&&D(),M(i),v(H)}function b(H){return r.parser.lazy[r.now().line]=i!==a.length,d=r.now().offset,C(H)}function v(H){return r.containerState={},e.attempt(by,j,C)(H)}function j(H){return i++,a.push([r.currentConstruct,r.containerState]),v(H)}function C(H){if(H===null){o&&D(),M(0),e.consume(H);return}return o=o||r.parser.flow(r.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),E(H)}function E(H){if(H===null){w(e.exit("chunkFlow"),!0),M(0),e.consume(H);return}return $e(H)?(e.consume(H),w(e.exit("chunkFlow")),i=0,r.interrupt=void 0,f):(e.consume(H),E)}function w(H,X){const q=r.sliceStream(H);if(X&&q.push(null),H.previous=u,u&&(u.next=H),u=H,o.defineSkip(H.start),o.write(q),r.parser.lazy[H.start.line]){let L=o.events.length;for(;L--;)if(o.events[L][1].start.offset<d&&(!o.events[L][1].end||o.events[L][1].end.offset>d))return;const B=r.events.length;let F=B,Z,O;for(;F--;)if(r.events[F][0]==="exit"&&r.events[F][1].type==="chunkFlow"){if(Z){O=r.events[F][1].end;break}Z=!0}for(M(i),L=B;L<r.events.length;)r.events[L][1].end={...O},L++;ul(r.events,F+1,0,r.events.slice(B)),r.events.length=L}}function M(H){let X=a.length;for(;X-- >H;){const q=a[X];r.containerState=q[1],q[0].exit.call(r,e)}a.length=H}function D(){o.write([null]),u=void 0,o=void 0,r.containerState._closeFlow=void 0}}function t5(e,r,a){return wt(e,e.attempt(this.parser.constructs.document,r,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ji(e){if(e===null||It(e)||Qa(e))return 1;if(Gu(e))return 2}function $u(e,r,a){const i=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!i.includes(u)&&(r=u(r,a),i.push(u))}return r}const dp={name:"attention",resolveAll:n5,tokenize:l5};function n5(e,r){let a=-1,i,o,u,d,f,p,h,y;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(i=a;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&r.sliceSerialize(e[i][1]).charCodeAt(0)===r.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[i][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;p=e[i][1].end.offset-e[i][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const b={...e[i][1].end},v={...e[a][1].start};yy(b,-p),yy(v,p),d={type:p>1?"strongSequence":"emphasisSequence",start:b,end:{...e[i][1].end}},f={type:p>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:v},u={type:p>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[a][1].start}},o={type:p>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[i][1].end={...d.start},e[a][1].start={...f.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=vl(h,[["enter",e[i][1],r],["exit",e[i][1],r]])),h=vl(h,[["enter",o,r],["enter",d,r],["exit",d,r],["enter",u,r]]),h=vl(h,$u(r.parser.constructs.insideSpan.null,e.slice(i+1,a),r)),h=vl(h,[["exit",u,r],["enter",f,r],["exit",f,r],["exit",o,r]]),e[a][1].end.offset-e[a][1].start.offset?(y=2,h=vl(h,[["enter",e[a][1],r],["exit",e[a][1],r]])):y=0,ul(e,i-1,a-i+3,h),a=i+h.length-y-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function l5(e,r){const a=this.parser.constructs.attentionMarkers.null,i=this.previous,o=Ji(i);let u;return d;function d(p){return u=p,e.enter("attentionSequence"),f(p)}function f(p){if(p===u)return e.consume(p),f;const h=e.exit("attentionSequence"),y=Ji(p),b=!y||y===2&&o||a.includes(p),v=!o||o===2&&y||a.includes(i);return h._open=!!(u===42?b:b&&(o||!v)),h._close=!!(u===42?v:v&&(y||!b)),r(p)}}function yy(e,r){e.column+=r,e.offset+=r,e._bufferIndex+=r}const r5={name:"autolink",tokenize:a5};function a5(e,r,a){let i=0;return o;function o(j){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(j),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(j){return Pn(j)?(e.consume(j),d):j===64?a(j):h(j)}function d(j){return j===43||j===45||j===46||Ln(j)?(i=1,f(j)):h(j)}function f(j){return j===58?(e.consume(j),i=0,p):(j===43||j===45||j===46||Ln(j))&&i++<32?(e.consume(j),f):(i=0,h(j))}function p(j){return j===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(j),e.exit("autolinkMarker"),e.exit("autolink"),r):j===null||j===32||j===60||Du(j)?a(j):(e.consume(j),p)}function h(j){return j===64?(e.consume(j),y):Q3(j)?(e.consume(j),h):a(j)}function y(j){return Ln(j)?b(j):a(j)}function b(j){return j===46?(e.consume(j),i=0,y):j===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(j),e.exit("autolinkMarker"),e.exit("autolink"),r):v(j)}function v(j){if((j===45||Ln(j))&&i++<63){const C=j===45?v:b;return e.consume(j),C}return a(j)}}const zo={partial:!0,tokenize:i5};function i5(e,r,a){return i;function i(u){return gt(u)?wt(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||$e(u)?r(u):a(u)}}const k0={continuation:{tokenize:o5},exit:c5,name:"blockQuote",tokenize:s5};function s5(e,r,a){const i=this;return o;function o(d){if(d===62){const f=i.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),u}return a(d)}function u(d){return gt(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),r):(e.exit("blockQuotePrefix"),r(d))}}function o5(e,r,a){const i=this;return o;function o(d){return gt(d)?wt(e,u,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(k0,r,a)(d)}}function c5(e){e.exit("blockQuote")}const j0={name:"characterEscape",tokenize:u5};function u5(e,r,a){return i;function i(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return K3(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),r):a(u)}}const N0={name:"characterReference",tokenize:d5};function d5(e,r,a){const i=this;let o=0,u,d;return f;function f(b){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),p}function p(b){return b===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(b),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),u=31,d=Ln,y(b))}function h(b){return b===88||b===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(b),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=X3,y):(e.enter("characterReferenceValue"),u=7,d=up,y(b))}function y(b){if(b===59&&o){const v=e.exit("characterReferenceValue");return d===Ln&&!Xp(i.sliceSerialize(v))?a(b):(e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),e.exit("characterReference"),r)}return d(b)&&o++<u?(e.consume(b),y):a(b)}}const vy={partial:!0,tokenize:m5},ky={concrete:!0,name:"codeFenced",tokenize:f5};function f5(e,r,a){const i=this,o={partial:!0,tokenize:q};let u=0,d=0,f;return p;function p(L){return h(L)}function h(L){const B=i.events[i.events.length-1];return u=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,f=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(L)}function y(L){return L===f?(d++,e.consume(L),y):d<3?a(L):(e.exit("codeFencedFenceSequence"),gt(L)?wt(e,b,"whitespace")(L):b(L))}function b(L){return L===null||$e(L)?(e.exit("codeFencedFence"),i.interrupt?r(L):e.check(vy,E,X)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(L))}function v(L){return L===null||$e(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),b(L)):gt(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),wt(e,j,"whitespace")(L)):L===96&&L===f?a(L):(e.consume(L),v)}function j(L){return L===null||$e(L)?b(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(L))}function C(L){return L===null||$e(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),b(L)):L===96&&L===f?a(L):(e.consume(L),C)}function E(L){return e.attempt(o,X,w)(L)}function w(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),M}function M(L){return u>0&>(L)?wt(e,D,"linePrefix",u+1)(L):D(L)}function D(L){return L===null||$e(L)?e.check(vy,E,X)(L):(e.enter("codeFlowValue"),H(L))}function H(L){return L===null||$e(L)?(e.exit("codeFlowValue"),D(L)):(e.consume(L),H)}function X(L){return e.exit("codeFenced"),r(L)}function q(L,B,F){let Z=0;return O;function O(ee){return L.enter("lineEnding"),L.consume(ee),L.exit("lineEnding"),P}function P(ee){return L.enter("codeFencedFence"),gt(ee)?wt(L,Q,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):Q(ee)}function Q(ee){return ee===f?(L.enter("codeFencedFenceSequence"),oe(ee)):F(ee)}function oe(ee){return ee===f?(Z++,L.consume(ee),oe):Z>=d?(L.exit("codeFencedFenceSequence"),gt(ee)?wt(L,J,"whitespace")(ee):J(ee)):F(ee)}function J(ee){return ee===null||$e(ee)?(L.exit("codeFencedFence"),B(ee)):F(ee)}}}function m5(e,r,a){const i=this;return o;function o(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u)}function u(d){return i.parser.lazy[i.now().line]?a(d):r(d)}}const Om={name:"codeIndented",tokenize:h5},p5={partial:!0,tokenize:x5};function h5(e,r,a){const i=this;return o;function o(h){return e.enter("codeIndented"),wt(e,u,"linePrefix",5)(h)}function u(h){const y=i.events[i.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?d(h):a(h)}function d(h){return h===null?p(h):$e(h)?e.attempt(p5,d,p)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||$e(h)?(e.exit("codeFlowValue"),d(h)):(e.consume(h),f)}function p(h){return e.exit("codeIndented"),r(h)}}function x5(e,r,a){const i=this;return o;function o(d){return i.parser.lazy[i.now().line]?a(d):$e(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):wt(e,u,"linePrefix",5)(d)}function u(d){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?r(d):$e(d)?o(d):a(d)}}const g5={name:"codeText",previous:y5,resolve:b5,tokenize:v5};function b5(e){let r=e.length-4,a=3,i,o;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[r][1].type==="lineEnding"||e[r][1].type==="space")){for(i=a;++i<r;)if(e[i][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[r][1].type="codeTextPadding",a+=2,r-=2;break}}for(i=a-1,r++;++i<=r;)o===void 0?i!==r&&e[i][1].type!=="lineEnding"&&(o=i):(i===r||e[i][1].type==="lineEnding")&&(e[o][1].type="codeTextData",i!==o+2&&(e[o][1].end=e[i-1][1].end,e.splice(o+2,i-o-2),r-=i-o-2,i=o+2),o=void 0);return e}function y5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function v5(e,r,a){let i=0,o,u;return d;function d(b){return e.enter("codeText"),e.enter("codeTextSequence"),f(b)}function f(b){return b===96?(e.consume(b),i++,f):(e.exit("codeTextSequence"),p(b))}function p(b){return b===null?a(b):b===32?(e.enter("space"),e.consume(b),e.exit("space"),p):b===96?(u=e.enter("codeTextSequence"),o=0,y(b)):$e(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("codeTextData"),h(b))}function h(b){return b===null||b===32||b===96||$e(b)?(e.exit("codeTextData"),p(b)):(e.consume(b),h)}function y(b){return b===96?(e.consume(b),o++,y):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),r(b)):(u.type="codeTextData",h(b))}}class k5{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,a){const i=a??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(r,i):r>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(r,a,i){const o=a||0;this.setCursor(Math.trunc(r));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&mo(this.left,i),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),mo(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),mo(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const a=this.left.splice(r,Number.POSITIVE_INFINITY);mo(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);mo(this.left,a.reverse())}}}function mo(e,r){let a=0;if(r.length<1e4)e.push(...r);else for(;a<r.length;)e.push(...r.slice(a,a+1e4)),a+=1e4}function w0(e){const r={};let a=-1,i,o,u,d,f,p,h;const y=new k5(e);for(;++a<y.length;){for(;a in r;)a=r[a];if(i=y.get(a),a&&i[1].type==="chunkFlow"&&y.get(a-1)[1].type==="listItemPrefix"&&(p=i[1]._tokenizer.events,u=0,u<p.length&&p[u][1].type==="lineEndingBlank"&&(u+=2),u<p.length&&p[u][1].type==="content"))for(;++u<p.length&&p[u][1].type!=="content";)p[u][1].type==="chunkText"&&(p[u][1]._isInFirstContentOfListItem=!0,u++);if(i[0]==="enter")i[1].contentType&&(Object.assign(r,j5(y,a)),a=r[a],h=!0);else if(i[1]._container){for(u=a,o=void 0;u--;)if(d=y.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(o&&(y.get(o)[1].type="lineEndingBlank"),d[1].type="lineEnding",o=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;o&&(i[1].end={...y.get(o)[1].start},f=y.slice(o,a),f.unshift(i),y.splice(o,a-o+1,f))}}return ul(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function j5(e,r){const a=e.get(r)[1],i=e.get(r)[2];let o=r-1;const u=[];let d=a._tokenizer;d||(d=i.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,p=[],h={};let y,b,v=-1,j=a,C=0,E=0;const w=[E];for(;j;){for(;e.get(++o)[1]!==j;);u.push(o),j._tokenizer||(y=i.sliceStream(j),j.next||y.push(null),b&&d.defineSkip(j.start),j._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(y),j._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),b=j,j=j.next}for(j=a;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(E=v+1,w.push(E),j._tokenizer=void 0,j.previous=void 0,j=j.next);for(d.events=[],j?(j._tokenizer=void 0,j.previous=void 0):w.pop(),v=w.length;v--;){const M=f.slice(w[v],w[v+1]),D=u.pop();p.push([D,D+M.length-1]),e.splice(D,2,M)}for(p.reverse(),v=-1;++v<p.length;)h[C+p[v][0]]=C+p[v][1],C+=p[v][1]-p[v][0]-1;return h}const N5={resolve:S5,tokenize:C5},w5={partial:!0,tokenize:T5};function S5(e){return w0(e),e}function C5(e,r){let a;return i;function i(f){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?u(f):$e(f)?e.check(w5,d,u)(f):(e.consume(f),o)}function u(f){return e.exit("chunkContent"),e.exit("content"),r(f)}function d(f){return e.consume(f),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function T5(e,r,a){const i=this;return o;function o(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),wt(e,u,"linePrefix")}function u(d){if(d===null||$e(d))return a(d);const f=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?r(d):e.interrupt(i.parser.constructs.flow,a,r)(d)}}function S0(e,r,a,i,o,u,d,f,p){const h=p||Number.POSITIVE_INFINITY;let y=0;return b;function b(M){return M===60?(e.enter(i),e.enter(o),e.enter(u),e.consume(M),e.exit(u),v):M===null||M===32||M===41||Du(M)?a(M):(e.enter(i),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(M))}function v(M){return M===62?(e.enter(u),e.consume(M),e.exit(u),e.exit(o),e.exit(i),r):(e.enter(f),e.enter("chunkString",{contentType:"string"}),j(M))}function j(M){return M===62?(e.exit("chunkString"),e.exit(f),v(M)):M===null||M===60||$e(M)?a(M):(e.consume(M),M===92?C:j)}function C(M){return M===60||M===62||M===92?(e.consume(M),j):j(M)}function E(M){return!y&&(M===null||M===41||It(M))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(i),r(M)):y<h&&M===40?(e.consume(M),y++,E):M===41?(e.consume(M),y--,E):M===null||M===32||M===40||Du(M)?a(M):(e.consume(M),M===92?w:E)}function w(M){return M===40||M===41||M===92?(e.consume(M),E):E(M)}}function C0(e,r,a,i,o,u){const d=this;let f=0,p;return h;function h(j){return e.enter(i),e.enter(o),e.consume(j),e.exit(o),e.enter(u),y}function y(j){return f>999||j===null||j===91||j===93&&!p||j===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?a(j):j===93?(e.exit(u),e.enter(o),e.consume(j),e.exit(o),e.exit(i),r):$e(j)?(e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),b(j))}function b(j){return j===null||j===91||j===93||$e(j)||f++>999?(e.exit("chunkString"),y(j)):(e.consume(j),p||(p=!gt(j)),j===92?v:b)}function v(j){return j===91||j===92||j===93?(e.consume(j),f++,b):b(j)}}function T0(e,r,a,i,o,u){let d;return f;function f(v){return v===34||v===39||v===40?(e.enter(i),e.enter(o),e.consume(v),e.exit(o),d=v===40?41:v,p):a(v)}function p(v){return v===d?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),r):(e.enter(u),h(v))}function h(v){return v===d?(e.exit(u),p(d)):v===null?a(v):$e(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),wt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===d||v===null||$e(v)?(e.exit("chunkString"),h(v)):(e.consume(v),v===92?b:y)}function b(v){return v===d||v===92?(e.consume(v),y):y(v)}}function yo(e,r){let a;return i;function i(o){return $e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a=!0,i):gt(o)?wt(e,i,a?"linePrefix":"lineSuffix")(o):r(o)}}const A5={name:"definition",tokenize:R5},E5={partial:!0,tokenize:M5};function R5(e,r,a){const i=this;let o;return u;function u(j){return e.enter("definition"),d(j)}function d(j){return C0.call(i,e,f,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(j)}function f(j){return o=El(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),j===58?(e.enter("definitionMarker"),e.consume(j),e.exit("definitionMarker"),p):a(j)}function p(j){return It(j)?yo(e,h)(j):h(j)}function h(j){return S0(e,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(j)}function y(j){return e.attempt(E5,b,b)(j)}function b(j){return gt(j)?wt(e,v,"whitespace")(j):v(j)}function v(j){return j===null||$e(j)?(e.exit("definition"),i.parser.defined.push(o),r(j)):a(j)}}function M5(e,r,a){return i;function i(f){return It(f)?yo(e,o)(f):a(f)}function o(f){return T0(e,u,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return gt(f)?wt(e,d,"whitespace")(f):d(f)}function d(f){return f===null||$e(f)?r(f):a(f)}}const z5={name:"hardBreakEscape",tokenize:O5};function O5(e,r,a){return i;function i(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return $e(u)?(e.exit("hardBreakEscape"),r(u)):a(u)}}const L5={name:"headingAtx",resolve:D5,tokenize:_5};function D5(e,r){let a=e.length-2,i=3,o,u;return e[i][1].type==="whitespace"&&(i+=2),a-2>i&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(i===a-1||a-4>i&&e[a-2][1].type==="whitespace")&&(a-=i+1===a?2:4),a>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[a][1].end},u={type:"chunkText",start:e[i][1].start,end:e[a][1].end,contentType:"text"},ul(e,i,a-i+1,[["enter",o,r],["enter",u,r],["exit",u,r],["exit",o,r]])),e}function _5(e,r,a){let i=0;return o;function o(y){return e.enter("atxHeading"),u(y)}function u(y){return e.enter("atxHeadingSequence"),d(y)}function d(y){return y===35&&i++<6?(e.consume(y),d):y===null||It(y)?(e.exit("atxHeadingSequence"),f(y)):a(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),p(y)):y===null||$e(y)?(e.exit("atxHeading"),r(y)):gt(y)?wt(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function p(y){return y===35?(e.consume(y),p):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||It(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const B5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],jy=["pre","script","style","textarea"],I5={concrete:!0,name:"htmlFlow",resolveTo:H5,tokenize:F5},P5={partial:!0,tokenize:V5},U5={partial:!0,tokenize:q5};function H5(e){let r=e.length;for(;r--&&!(e[r][0]==="enter"&&e[r][1].type==="htmlFlow"););return r>1&&e[r-2][1].type==="linePrefix"&&(e[r][1].start=e[r-2][1].start,e[r+1][1].start=e[r-2][1].start,e.splice(r-2,2)),e}function F5(e,r,a){const i=this;let o,u,d,f,p;return h;function h(R){return y(R)}function y(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),b}function b(R){return R===33?(e.consume(R),v):R===47?(e.consume(R),u=!0,E):R===63?(e.consume(R),o=3,i.interrupt?r:T):Pn(R)?(e.consume(R),d=String.fromCharCode(R),w):a(R)}function v(R){return R===45?(e.consume(R),o=2,j):R===91?(e.consume(R),o=5,f=0,C):Pn(R)?(e.consume(R),o=4,i.interrupt?r:T):a(R)}function j(R){return R===45?(e.consume(R),i.interrupt?r:T):a(R)}function C(R){const pe="CDATA[";return R===pe.charCodeAt(f++)?(e.consume(R),f===pe.length?i.interrupt?r:Q:C):a(R)}function E(R){return Pn(R)?(e.consume(R),d=String.fromCharCode(R),w):a(R)}function w(R){if(R===null||R===47||R===62||It(R)){const pe=R===47,xe=d.toLowerCase();return!pe&&!u&&jy.includes(xe)?(o=1,i.interrupt?r(R):Q(R)):B5.includes(d.toLowerCase())?(o=6,pe?(e.consume(R),M):i.interrupt?r(R):Q(R)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?a(R):u?D(R):H(R))}return R===45||Ln(R)?(e.consume(R),d+=String.fromCharCode(R),w):a(R)}function M(R){return R===62?(e.consume(R),i.interrupt?r:Q):a(R)}function D(R){return gt(R)?(e.consume(R),D):O(R)}function H(R){return R===47?(e.consume(R),O):R===58||R===95||Pn(R)?(e.consume(R),X):gt(R)?(e.consume(R),H):O(R)}function X(R){return R===45||R===46||R===58||R===95||Ln(R)?(e.consume(R),X):q(R)}function q(R){return R===61?(e.consume(R),L):gt(R)?(e.consume(R),q):H(R)}function L(R){return R===null||R===60||R===61||R===62||R===96?a(R):R===34||R===39?(e.consume(R),p=R,B):gt(R)?(e.consume(R),L):F(R)}function B(R){return R===p?(e.consume(R),p=null,Z):R===null||$e(R)?a(R):(e.consume(R),B)}function F(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||It(R)?q(R):(e.consume(R),F)}function Z(R){return R===47||R===62||gt(R)?H(R):a(R)}function O(R){return R===62?(e.consume(R),P):a(R)}function P(R){return R===null||$e(R)?Q(R):gt(R)?(e.consume(R),P):a(R)}function Q(R){return R===45&&o===2?(e.consume(R),N):R===60&&o===1?(e.consume(R),Y):R===62&&o===4?(e.consume(R),_):R===63&&o===3?(e.consume(R),T):R===93&&o===5?(e.consume(R),ye):$e(R)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(P5,le,oe)(R)):R===null||$e(R)?(e.exit("htmlFlowData"),oe(R)):(e.consume(R),Q)}function oe(R){return e.check(U5,J,le)(R)}function J(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),ee}function ee(R){return R===null||$e(R)?oe(R):(e.enter("htmlFlowData"),Q(R))}function N(R){return R===45?(e.consume(R),T):Q(R)}function Y(R){return R===47?(e.consume(R),d="",$):Q(R)}function $(R){if(R===62){const pe=d.toLowerCase();return jy.includes(pe)?(e.consume(R),_):Q(R)}return Pn(R)&&d.length<8?(e.consume(R),d+=String.fromCharCode(R),$):Q(R)}function ye(R){return R===93?(e.consume(R),T):Q(R)}function T(R){return R===62?(e.consume(R),_):R===45&&o===2?(e.consume(R),T):Q(R)}function _(R){return R===null||$e(R)?(e.exit("htmlFlowData"),le(R)):(e.consume(R),_)}function le(R){return e.exit("htmlFlow"),r(R)}}function q5(e,r,a){const i=this;return o;function o(d){return $e(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):a(d)}function u(d){return i.parser.lazy[i.now().line]?a(d):r(d)}}function V5(e,r,a){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(zo,r,a)}}const G5={name:"htmlText",tokenize:$5};function $5(e,r,a){const i=this;let o,u,d;return f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),p}function p(T){return T===33?(e.consume(T),h):T===47?(e.consume(T),q):T===63?(e.consume(T),H):Pn(T)?(e.consume(T),F):a(T)}function h(T){return T===45?(e.consume(T),y):T===91?(e.consume(T),u=0,C):Pn(T)?(e.consume(T),D):a(T)}function y(T){return T===45?(e.consume(T),j):a(T)}function b(T){return T===null?a(T):T===45?(e.consume(T),v):$e(T)?(d=b,Y(T)):(e.consume(T),b)}function v(T){return T===45?(e.consume(T),j):b(T)}function j(T){return T===62?N(T):T===45?v(T):b(T)}function C(T){const _="CDATA[";return T===_.charCodeAt(u++)?(e.consume(T),u===_.length?E:C):a(T)}function E(T){return T===null?a(T):T===93?(e.consume(T),w):$e(T)?(d=E,Y(T)):(e.consume(T),E)}function w(T){return T===93?(e.consume(T),M):E(T)}function M(T){return T===62?N(T):T===93?(e.consume(T),M):E(T)}function D(T){return T===null||T===62?N(T):$e(T)?(d=D,Y(T)):(e.consume(T),D)}function H(T){return T===null?a(T):T===63?(e.consume(T),X):$e(T)?(d=H,Y(T)):(e.consume(T),H)}function X(T){return T===62?N(T):H(T)}function q(T){return Pn(T)?(e.consume(T),L):a(T)}function L(T){return T===45||Ln(T)?(e.consume(T),L):B(T)}function B(T){return $e(T)?(d=B,Y(T)):gt(T)?(e.consume(T),B):N(T)}function F(T){return T===45||Ln(T)?(e.consume(T),F):T===47||T===62||It(T)?Z(T):a(T)}function Z(T){return T===47?(e.consume(T),N):T===58||T===95||Pn(T)?(e.consume(T),O):$e(T)?(d=Z,Y(T)):gt(T)?(e.consume(T),Z):N(T)}function O(T){return T===45||T===46||T===58||T===95||Ln(T)?(e.consume(T),O):P(T)}function P(T){return T===61?(e.consume(T),Q):$e(T)?(d=P,Y(T)):gt(T)?(e.consume(T),P):Z(T)}function Q(T){return T===null||T===60||T===61||T===62||T===96?a(T):T===34||T===39?(e.consume(T),o=T,oe):$e(T)?(d=Q,Y(T)):gt(T)?(e.consume(T),Q):(e.consume(T),J)}function oe(T){return T===o?(e.consume(T),o=void 0,ee):T===null?a(T):$e(T)?(d=oe,Y(T)):(e.consume(T),oe)}function J(T){return T===null||T===34||T===39||T===60||T===61||T===96?a(T):T===47||T===62||It(T)?Z(T):(e.consume(T),J)}function ee(T){return T===47||T===62||It(T)?Z(T):a(T)}function N(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),r):a(T)}function Y(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),$}function $(T){return gt(T)?wt(e,ye,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):ye(T)}function ye(T){return e.enter("htmlTextData"),d(T)}}const Kp={name:"labelEnd",resolveAll:K5,resolveTo:Z5,tokenize:W5},Y5={tokenize:J5},Q5={tokenize:eA},X5={tokenize:tA};function K5(e){let r=-1;const a=[];for(;++r<e.length;){const i=e[r][1];if(a.push(e[r]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const o=i.type==="labelImage"?4:2;i.type="data",r+=o}}return e.length!==a.length&&ul(e,0,e.length,a),e}function Z5(e,r){let a=e.length,i=0,o,u,d,f;for(;a--;)if(o=e[a][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[a][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(d){if(e[a][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=a,o.type!=="labelLink")){i=2;break}}else o.type==="labelEnd"&&(d=a);const p={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[u][1].start},end:{...e[d][1].end}},y={type:"labelText",start:{...e[u+i+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",p,r],["enter",h,r]],f=vl(f,e.slice(u+1,u+i+3)),f=vl(f,[["enter",y,r]]),f=vl(f,$u(r.parser.constructs.insideSpan.null,e.slice(u+i+4,d-3),r)),f=vl(f,[["exit",y,r],e[d-2],e[d-1],["exit",h,r]]),f=vl(f,e.slice(d+1)),f=vl(f,[["exit",p,r]]),ul(e,u,e.length,f),e}function W5(e,r,a){const i=this;let o=i.events.length,u,d;for(;o--;)if((i.events[o][1].type==="labelImage"||i.events[o][1].type==="labelLink")&&!i.events[o][1]._balanced){u=i.events[o][1];break}return f;function f(v){return u?u._inactive?b(v):(d=i.parser.defined.includes(El(i.sliceSerialize({start:u.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),p):a(v)}function p(v){return v===40?e.attempt(Y5,y,d?y:b)(v):v===91?e.attempt(Q5,y,d?h:b)(v):d?y(v):b(v)}function h(v){return e.attempt(X5,y,b)(v)}function y(v){return r(v)}function b(v){return u._balanced=!0,a(v)}}function J5(e,r,a){return i;function i(b){return e.enter("resource"),e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),o}function o(b){return It(b)?yo(e,u)(b):u(b)}function u(b){return b===41?y(b):S0(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function d(b){return It(b)?yo(e,p)(b):y(b)}function f(b){return a(b)}function p(b){return b===34||b===39||b===40?T0(e,h,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):y(b)}function h(b){return It(b)?yo(e,y)(b):y(b)}function y(b){return b===41?(e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),e.exit("resource"),r):a(b)}}function eA(e,r,a){const i=this;return o;function o(f){return C0.call(i,e,u,d,"reference","referenceMarker","referenceString")(f)}function u(f){return i.parser.defined.includes(El(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?r(f):a(f)}function d(f){return a(f)}}function tA(e,r,a){return i;function i(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),r):a(u)}}const nA={name:"labelStartImage",resolveAll:Kp.resolveAll,tokenize:lA};function lA(e,r,a){const i=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):a(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?a(f):r(f)}}const rA={name:"labelStartLink",resolveAll:Kp.resolveAll,tokenize:aA};function aA(e,r,a){const i=this;return o;function o(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),u}function u(d){return d===94&&"_hiddenFootnoteSupport"in i.parser.constructs?a(d):r(d)}}const Lm={name:"lineEnding",tokenize:iA};function iA(e,r){return a;function a(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),wt(e,r,"linePrefix")}}const Tu={name:"thematicBreak",tokenize:sA};function sA(e,r,a){let i=0,o;return u;function u(h){return e.enter("thematicBreak"),d(h)}function d(h){return o=h,f(h)}function f(h){return h===o?(e.enter("thematicBreakSequence"),p(h)):i>=3&&(h===null||$e(h))?(e.exit("thematicBreak"),r(h)):a(h)}function p(h){return h===o?(e.consume(h),i++,p):(e.exit("thematicBreakSequence"),gt(h)?wt(e,f,"whitespace")(h):f(h))}}const Kn={continuation:{tokenize:dA},exit:mA,name:"list",tokenize:uA},oA={partial:!0,tokenize:pA},cA={partial:!0,tokenize:fA};function uA(e,r,a){const i=this,o=i.events[i.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return f;function f(j){const C=i.containerState.type||(j===42||j===43||j===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!i.containerState.marker||j===i.containerState.marker:up(j)){if(i.containerState.type||(i.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),j===42||j===45?e.check(Tu,a,h)(j):h(j);if(!i.interrupt||j===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(j)}return a(j)}function p(j){return up(j)&&++d<10?(e.consume(j),p):(!i.interrupt||d<2)&&(i.containerState.marker?j===i.containerState.marker:j===41||j===46)?(e.exit("listItemValue"),h(j)):a(j)}function h(j){return e.enter("listItemMarker"),e.consume(j),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||j,e.check(zo,i.interrupt?a:y,e.attempt(oA,v,b))}function y(j){return i.containerState.initialBlankLine=!0,u++,v(j)}function b(j){return gt(j)?(e.enter("listItemPrefixWhitespace"),e.consume(j),e.exit("listItemPrefixWhitespace"),v):a(j)}function v(j){return i.containerState.size=u+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,r(j)}}function dA(e,r,a){const i=this;return i.containerState._closeFlow=void 0,e.check(zo,o,u);function o(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,wt(e,r,"listItemIndent",i.containerState.size+1)(f)}function u(f){return i.containerState.furtherBlankLines||!gt(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,d(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(cA,r,d)(f))}function d(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,wt(e,e.attempt(Kn,r,a),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function fA(e,r,a){const i=this;return wt(e,o,"listItemIndent",i.containerState.size+1);function o(u){const d=i.events[i.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===i.containerState.size?r(u):a(u)}}function mA(e){e.exit(this.containerState.type)}function pA(e,r,a){const i=this;return wt(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const d=i.events[i.events.length-1];return!gt(u)&&d&&d[1].type==="listItemPrefixWhitespace"?r(u):a(u)}}const Ny={name:"setextUnderline",resolveTo:hA,tokenize:xA};function hA(e,r){let a=e.length,i,o,u;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){i=a;break}e[a][1].type==="paragraph"&&(o=a)}else e[a][1].type==="content"&&e.splice(a,1),!u&&e[a][1].type==="definition"&&(u=a);const d={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",d,r]),e.splice(u+1,0,["exit",e[i][1],r]),e[i][1].end={...e[u][1].end}):e[i][1]=d,e.push(["exit",d,r]),e}function xA(e,r,a){const i=this;let o;return u;function u(h){let y=i.events.length,b;for(;y--;)if(i.events[y][1].type!=="lineEnding"&&i.events[y][1].type!=="linePrefix"&&i.events[y][1].type!=="content"){b=i.events[y][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||b)?(e.enter("setextHeadingLine"),o=h,d(h)):a(h)}function d(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===o?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),gt(h)?wt(e,p,"lineSuffix")(h):p(h))}function p(h){return h===null||$e(h)?(e.exit("setextHeadingLine"),r(h)):a(h)}}const gA={tokenize:bA};function bA(e){const r=this,a=e.attempt(zo,i,e.attempt(this.parser.constructs.flowInitial,o,wt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(N5,o)),"linePrefix")));return a;function i(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),r.currentConstruct=void 0,a}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),r.currentConstruct=void 0,a}}const yA={resolveAll:E0()},vA=A0("string"),kA=A0("text");function A0(e){return{resolveAll:E0(e==="text"?jA:void 0),tokenize:r};function r(a){const i=this,o=this.parser.constructs[e],u=a.attempt(o,d,f);return d;function d(y){return h(y)?u(y):f(y)}function f(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return h(y)?(a.exit("data"),u(y)):(a.consume(y),p)}function h(y){if(y===null)return!0;const b=o[y];let v=-1;if(b)for(;++v<b.length;){const j=b[v];if(!j.previous||j.previous.call(i,i.previous))return!0}return!1}}}function E0(e){return r;function r(a,i){let o=-1,u;for(;++o<=a.length;)u===void 0?a[o]&&a[o][1].type==="data"&&(u=o,o++):(!a[o]||a[o][1].type!=="data")&&(o!==u+2&&(a[u][1].end=a[o-1][1].end,a.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(a,i):a}}function jA(e,r){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const i=e[a-1][1],o=r.sliceStream(i);let u=o.length,d=-1,f=0,p;for(;u--;){const h=o[u];if(typeof h=="string"){for(d=h.length;h.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(h===-2)p=!0,f++;else if(h!==-1){u++;break}}if(r._contentTypeTextTrailing&&a===e.length&&(f=0),f){const h={type:a===e.length||p||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?d:i.start._bufferIndex+d,_index:i.start._index+u,line:i.end.line,column:i.end.column-f,offset:i.end.offset-f},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(a,0,["enter",h,r],["exit",h,r]),a+=2)}a++}return e}const NA={42:Kn,43:Kn,45:Kn,48:Kn,49:Kn,50:Kn,51:Kn,52:Kn,53:Kn,54:Kn,55:Kn,56:Kn,57:Kn,62:k0},wA={91:A5},SA={[-2]:Om,[-1]:Om,32:Om},CA={35:L5,42:Tu,45:[Ny,Tu],60:I5,61:Ny,95:Tu,96:ky,126:ky},TA={38:N0,92:j0},AA={[-5]:Lm,[-4]:Lm,[-3]:Lm,33:nA,38:N0,42:dp,60:[r5,G5],91:rA,92:[z5,j0],93:Kp,95:dp,96:g5},EA={null:[dp,yA]},RA={null:[42,95]},MA={null:[]},zA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:RA,contentInitial:wA,disable:MA,document:NA,flow:CA,flowInitial:SA,insideSpan:EA,string:TA,text:AA},Symbol.toStringTag,{value:"Module"}));function OA(e,r,a){let i={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const o={},u=[];let d=[],f=[];const p={attempt:B(q),check:B(L),consume:D,enter:H,exit:X,interrupt:B(L,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:C,parser:e,previous:null,sliceSerialize:v,sliceStream:j,write:b};let y=r.tokenize.call(h,p);return r.resolveAll&&u.push(r),h;function b(P){return d=vl(d,P),w(),d[d.length-1]!==null?[]:(F(r,0),h.events=$u(u,h.events,h),h.events)}function v(P,Q){return DA(j(P),Q)}function j(P){return LA(d,P)}function C(){const{_bufferIndex:P,_index:Q,line:oe,column:J,offset:ee}=i;return{_bufferIndex:P,_index:Q,line:oe,column:J,offset:ee}}function E(P){o[P.line]=P.column,O()}function w(){let P;for(;i._index<d.length;){const Q=d[i._index];if(typeof Q=="string")for(P=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===P&&i._bufferIndex<Q.length;)M(Q.charCodeAt(i._bufferIndex));else M(Q)}}function M(P){y=y(P)}function D(P){$e(P)?(i.line++,i.column=1,i.offset+=P===-3?2:1,O()):P!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===d[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=P}function H(P,Q){const oe=Q||{};return oe.type=P,oe.start=C(),h.events.push(["enter",oe,h]),f.push(oe),oe}function X(P){const Q=f.pop();return Q.end=C(),h.events.push(["exit",Q,h]),Q}function q(P,Q){F(P,Q.from)}function L(P,Q){Q.restore()}function B(P,Q){return oe;function oe(J,ee,N){let Y,$,ye,T;return Array.isArray(J)?le(J):"tokenize"in J?le([J]):_(J);function _(ce){return Re;function Re(Te){const Ne=Te!==null&&ce[Te],He=Te!==null&&ce.null,Le=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(He)?He:He?[He]:[]];return le(Le)(Te)}}function le(ce){return Y=ce,$=0,ce.length===0?N:R(ce[$])}function R(ce){return Re;function Re(Te){return T=Z(),ye=ce,ce.partial||(h.currentConstruct=ce),ce.name&&h.parser.constructs.disable.null.includes(ce.name)?xe():ce.tokenize.call(Q?Object.assign(Object.create(h),Q):h,p,pe,xe)(Te)}}function pe(ce){return P(ye,T),ee}function xe(ce){return T.restore(),++$<Y.length?R(Y[$]):N}}}function F(P,Q){P.resolveAll&&!u.includes(P)&&u.push(P),P.resolve&&ul(h.events,Q,h.events.length-Q,P.resolve(h.events.slice(Q),h)),P.resolveTo&&(h.events=P.resolveTo(h.events,h))}function Z(){const P=C(),Q=h.previous,oe=h.currentConstruct,J=h.events.length,ee=Array.from(f);return{from:J,restore:N};function N(){i=P,h.previous=Q,h.currentConstruct=oe,h.events.length=J,f=ee,O()}}function O(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function LA(e,r){const a=r.start._index,i=r.start._bufferIndex,o=r.end._index,u=r.end._bufferIndex;let d;if(a===o)d=[e[a].slice(i,u)];else{if(d=e.slice(a,o),i>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(i):d.shift()}u>0&&d.push(e[o].slice(0,u))}return d}function DA(e,r){let a=-1;const i=[];let o;for(;++a<e.length;){const u=e[a];let d;if(typeof u=="string")d=u;else switch(u){case-5:{d="\r";break}case-4:{d=`
|
|
60
|
-
`;break}case-3:{d=`\r
|
|
61
|
-
`;break}case-2:{d=r?" ":" ";break}case-1:{if(!r&&o)continue;d=" ";break}default:d=String.fromCharCode(u)}o=u===-2,i.push(d)}return i.join("")}function _A(e){const i={constructs:y0([zA,...(e||{}).extensions||[]]),content:o(Z3),defined:[],document:o(J3),flow:o(gA),lazy:{},string:o(vA),text:o(kA)};return i;function o(u){return d;function d(f){return OA(i,u,f)}}}function BA(e){for(;!w0(e););return e}const wy=/[\0\t\n\r]/g;function IA(){let e=1,r="",a=!0,i;return o;function o(u,d,f){const p=[];let h,y,b,v,j;for(u=r+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u)),b=0,r="",a&&(u.charCodeAt(0)===65279&&b++,a=void 0);b<u.length;){if(wy.lastIndex=b,h=wy.exec(u),v=h&&h.index!==void 0?h.index:u.length,j=u.charCodeAt(v),!h){r=u.slice(b);break}if(j===10&&b===v&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),b<v&&(p.push(u.slice(b,v)),e+=v-b),j){case 0:{p.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,p.push(-2);e++<y;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:i=!0,e=1}b=v+1}return f&&(i&&p.push(-5),r&&p.push(r),p.push(null)),p}}const PA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function UA(e){return e.replace(PA,HA)}function HA(e,r,a){if(r)return r;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),u=o===120||o===88;return v0(a.slice(u?2:1),u?16:10)}return Xp(a)||e}const R0={}.hasOwnProperty;function FA(e,r,a){return r&&typeof r=="object"&&(a=r,r=void 0),qA(a)(BA(_A(a).document().write(IA()(e,r,!0))))}function qA(e){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Ge),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:u(st),blockQuote:u(He),characterEscape:Z,characterReference:Z,codeFenced:u(Le),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:u(Le,d),codeText:u(Ue,d),codeTextData:Z,data:Z,codeFlowValue:Z,definition:u(it),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:u(tt),hardBreakEscape:u(ot),hardBreakTrailing:u(ot),htmlFlow:u(bt,d),htmlFlowData:Z,htmlText:u(bt,d),htmlTextData:Z,image:u(Ye),label:d,link:u(Ge),listItem:u(we),listItemValue:v,listOrdered:u(We,b),listUnordered:u(We),paragraph:u(et),reference:R,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:u(st),strong:u(Se),thematicBreak:u(mt)},exit:{atxHeading:p(),atxHeadingSequence:q,autolink:p(),autolinkEmail:Ne,autolinkProtocol:Te,blockQuote:p(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:xe,characterReferenceMarkerNumeric:xe,characterReferenceValue:ce,characterReference:Re,codeFenced:p(w),codeFencedFence:E,codeFencedFenceInfo:j,codeFencedFenceMeta:C,codeFlowValue:O,codeIndented:p(M),codeText:p(ee),codeTextData:O,data:O,definition:p(),definitionDestinationString:X,definitionLabelString:D,definitionTitleString:H,emphasis:p(),hardBreakEscape:p(Q),hardBreakTrailing:p(Q),htmlFlow:p(oe),htmlFlowData:O,htmlText:p(J),htmlTextData:O,image:p(Y),label:ye,labelText:$,lineEnding:P,link:p(N),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:pe,resourceDestinationString:T,resourceTitleString:_,resource:le,setextHeading:p(F),setextHeadingLineSequence:B,setextHeadingText:L,strong:p(),thematicBreak:p()}};M0(r,(e||{}).mdastExtensions||[]);const a={};return i;function i(ae){let ge={type:"root",children:[]};const Ce={stack:[ge],tokenStack:[],config:r,enter:f,exit:h,buffer:d,resume:y,data:a},_e=[];let Xe=-1;for(;++Xe<ae.length;)if(ae[Xe][1].type==="listOrdered"||ae[Xe][1].type==="listUnordered")if(ae[Xe][0]==="enter")_e.push(Xe);else{const Ae=_e.pop();Xe=o(ae,Ae,Xe)}for(Xe=-1;++Xe<ae.length;){const Ae=r[ae[Xe][0]];R0.call(Ae,ae[Xe][1].type)&&Ae[ae[Xe][1].type].call(Object.assign({sliceSerialize:ae[Xe][2].sliceSerialize},Ce),ae[Xe][1])}if(Ce.tokenStack.length>0){const Ae=Ce.tokenStack[Ce.tokenStack.length-1];(Ae[1]||Sy).call(Ce,void 0,Ae[0])}for(ge.position={start:ca(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:ca(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<r.transforms.length;)ge=r.transforms[Xe](ge)||ge;return ge}function o(ae,ge,Ce){let _e=ge-1,Xe=-1,Ae=!1,ue,Ee,V,me;for(;++_e<=Ce;){const je=ae[_e];switch(je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{je[0]==="enter"?Xe++:Xe--,me=void 0;break}case"lineEndingBlank":{je[0]==="enter"&&(ue&&!me&&!Xe&&!V&&(V=_e),me=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:me=void 0}if(!Xe&&je[0]==="enter"&&je[1].type==="listItemPrefix"||Xe===-1&&je[0]==="exit"&&(je[1].type==="listUnordered"||je[1].type==="listOrdered")){if(ue){let Fe=_e;for(Ee=void 0;Fe--;){const Je=ae[Fe];if(Je[1].type==="lineEnding"||Je[1].type==="lineEndingBlank"){if(Je[0]==="exit")continue;Ee&&(ae[Ee][1].type="lineEndingBlank",Ae=!0),Je[1].type="lineEnding",Ee=Fe}else if(!(Je[1].type==="linePrefix"||Je[1].type==="blockQuotePrefix"||Je[1].type==="blockQuotePrefixWhitespace"||Je[1].type==="blockQuoteMarker"||Je[1].type==="listItemIndent"))break}V&&(!Ee||V<Ee)&&(ue._spread=!0),ue.end=Object.assign({},Ee?ae[Ee][1].start:je[1].end),ae.splice(Ee||_e,0,["exit",ue,je[2]]),_e++,Ce++}if(je[1].type==="listItemPrefix"){const Fe={type:"listItem",_spread:!1,start:Object.assign({},je[1].start),end:void 0};ue=Fe,ae.splice(_e,0,["enter",Fe,je[2]]),_e++,Ce++,V=void 0,me=!0}}}return ae[ge][1]._spread=Ae,Ce}function u(ae,ge){return Ce;function Ce(_e){f.call(this,ae(_e),_e),ge&&ge.call(this,_e)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(ae,ge,Ce){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([ge,Ce||void 0]),ae.position={start:ca(ge.start),end:void 0}}function p(ae){return ge;function ge(Ce){ae&&ae.call(this,Ce),h.call(this,Ce)}}function h(ae,ge){const Ce=this.stack.pop(),_e=this.tokenStack.pop();if(_e)_e[0].type!==ae.type&&(ge?ge.call(this,ae,_e[0]):(_e[1]||Sy).call(this,ae,_e[0]));else throw new Error("Cannot close `"+ae.type+"` ("+bo({start:ae.start,end:ae.end})+"): it’s not open");Ce.position.end=ca(ae.end)}function y(){return Qp(this.stack.pop())}function b(){this.data.expectingFirstListItemValue=!0}function v(ae){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function j(){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=ae}function C(){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=ae}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function M(){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ae.replace(/(\r?\n|\r)$/g,"")}function D(ae){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=ge,Ce.identifier=El(this.sliceSerialize(ae)).toLowerCase()}function H(){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ae}function X(){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ae}function q(ae){const ge=this.stack[this.stack.length-1];if(!ge.depth){const Ce=this.sliceSerialize(ae).length;ge.depth=Ce}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function B(ae){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(ae){const Ce=this.stack[this.stack.length-1].children;let _e=Ce[Ce.length-1];(!_e||_e.type!=="text")&&(_e=Ze(),_e.position={start:ca(ae.start),end:void 0},Ce.push(_e)),this.stack.push(_e)}function O(ae){const ge=this.stack.pop();ge.value+=this.sliceSerialize(ae),ge.position.end=ca(ae.end)}function P(ae){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ce=ge.children[ge.children.length-1];Ce.position.end=ca(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(ge.type)&&(Z.call(this,ae),O.call(this,ae))}function Q(){this.data.atHardBreak=!0}function oe(){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ae}function J(){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ae}function ee(){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ae}function N(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ge,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function Y(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ge,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function $(ae){const ge=this.sliceSerialize(ae),Ce=this.stack[this.stack.length-2];Ce.label=UA(ge),Ce.identifier=El(ge).toLowerCase()}function ye(){const ae=this.stack[this.stack.length-1],ge=this.resume(),Ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ce.type==="link"){const _e=ae.children;Ce.children=_e}else Ce.alt=ge}function T(){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ae}function _(){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ae}function le(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function pe(ae){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=ge,Ce.identifier=El(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function xe(ae){this.data.characterReferenceType=ae.type}function ce(ae){const ge=this.sliceSerialize(ae),Ce=this.data.characterReferenceType;let _e;Ce?(_e=v0(ge,Ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):_e=Xp(ge);const Xe=this.stack[this.stack.length-1];Xe.value+=_e}function Re(ae){const ge=this.stack.pop();ge.position.end=ca(ae.end)}function Te(ae){O.call(this,ae);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(ae)}function Ne(ae){O.call(this,ae);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(ae)}function He(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function Ue(){return{type:"inlineCode",value:""}}function it(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function tt(){return{type:"emphasis",children:[]}}function st(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function bt(){return{type:"html",value:""}}function Ye(){return{type:"image",title:null,url:"",alt:null}}function Ge(){return{type:"link",title:null,url:"",children:[]}}function We(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function we(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function et(){return{type:"paragraph",children:[]}}function Se(){return{type:"strong",children:[]}}function Ze(){return{type:"text",value:""}}function mt(){return{type:"thematicBreak"}}}function ca(e){return{line:e.line,column:e.column,offset:e.offset}}function M0(e,r){let a=-1;for(;++a<r.length;){const i=r[a];Array.isArray(i)?M0(e,i):VA(e,i)}}function VA(e,r){let a;for(a in r)if(R0.call(r,a))switch(a){case"canContainEols":{const i=r[a];i&&e[a].push(...i);break}case"transforms":{const i=r[a];i&&e[a].push(...i);break}case"enter":case"exit":{const i=r[a];i&&Object.assign(e[a],i);break}}}function Sy(e,r){throw e?new Error("Cannot close `"+e.type+"` ("+bo({start:e.start,end:e.end})+"): a different token (`"+r.type+"`, "+bo({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+bo({start:r.start,end:r.end})+") is still open")}function GA(e){const r=this;r.parser=a;function a(i){return FA(i,{...r.data("settings"),...e,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function $A(e,r){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(r),!0)};return e.patch(r,a),e.applyData(r,a)}function YA(e,r){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(r,a),[e.applyData(r,a),{type:"text",value:`
|
|
62
|
-
`}]}function QA(e,r){const a=r.value?r.value+`
|
|
63
|
-
`:"",i={},o=r.lang?r.lang.split(/\s+/):[];o.length>0&&(i.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:i,children:[{type:"text",value:a}]};return r.meta&&(u.data={meta:r.meta}),e.patch(r,u),u=e.applyData(r,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(r,u),u}function XA(e,r){const a={type:"element",tagName:"del",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function KA(e,r){const a={type:"element",tagName:"em",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function ZA(e,r){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(r.identifier).toUpperCase(),o=ts(i.toLowerCase()),u=e.footnoteOrder.indexOf(i);let d,f=e.footnoteCounts.get(i);f===void 0?(f=0,e.footnoteOrder.push(i),d=e.footnoteOrder.length):d=u+1,f+=1,e.footnoteCounts.set(i,f);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(r,p);const h={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(r,h),e.applyData(r,h)}function WA(e,r){const a={type:"element",tagName:"h"+r.depth,properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function JA(e,r){if(e.options.allowDangerousHtml){const a={type:"raw",value:r.value};return e.patch(r,a),e.applyData(r,a)}}function z0(e,r){const a=r.referenceType;let i="]";if(a==="collapsed"?i+="[]":a==="full"&&(i+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+i}];const o=e.all(r),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const d=o[o.length-1];return d&&d.type==="text"?d.value+=i:o.push({type:"text",value:i}),o}function e4(e,r){const a=String(r.identifier).toUpperCase(),i=e.definitionById.get(a);if(!i)return z0(e,r);const o={src:ts(i.url||""),alt:r.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(r,u),e.applyData(r,u)}function t4(e,r){const a={src:ts(r.url)};r.alt!==null&&r.alt!==void 0&&(a.alt=r.alt),r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(r,i),e.applyData(r,i)}function n4(e,r){const a={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};e.patch(r,a);const i={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(r,i),e.applyData(r,i)}function l4(e,r){const a=String(r.identifier).toUpperCase(),i=e.definitionById.get(a);if(!i)return z0(e,r);const o={href:ts(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const u={type:"element",tagName:"a",properties:o,children:e.all(r)};return e.patch(r,u),e.applyData(r,u)}function r4(e,r){const a={href:ts(r.url)};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"a",properties:a,children:e.all(r)};return e.patch(r,i),e.applyData(r,i)}function a4(e,r,a){const i=e.all(r),o=a?i4(a):O0(r),u={},d=[];if(typeof r.checked=="boolean"){const y=i[0];let b;y&&y.type==="element"&&y.tagName==="p"?b=y:(b={type:"element",tagName:"p",properties:{},children:[]},i.unshift(b)),b.children.length>0&&b.children.unshift({type:"text",value:" "}),b.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<i.length;){const y=i[f];(o||f!==0||y.type!=="element"||y.tagName!=="p")&&d.push({type:"text",value:`
|
|
64
|
-
`}),y.type==="element"&&y.tagName==="p"&&!o?d.push(...y.children):d.push(y)}const p=i[i.length-1];p&&(o||p.type!=="element"||p.tagName!=="p")&&d.push({type:"text",value:`
|
|
65
|
-
`});const h={type:"element",tagName:"li",properties:u,children:d};return e.patch(r,h),e.applyData(r,h)}function i4(e){let r=!1;if(e.type==="list"){r=e.spread||!1;const a=e.children;let i=-1;for(;!r&&++i<a.length;)r=O0(a[i])}return r}function O0(e){const r=e.spread;return r??e.children.length>1}function s4(e,r){const a={},i=e.all(r);let o=-1;for(typeof r.start=="number"&&r.start!==1&&(a.start=r.start);++o<i.length;){const d=i[o];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const u={type:"element",tagName:r.ordered?"ol":"ul",properties:a,children:e.wrap(i,!0)};return e.patch(r,u),e.applyData(r,u)}function o4(e,r){const a={type:"element",tagName:"p",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function c4(e,r){const a={type:"root",children:e.wrap(e.all(r))};return e.patch(r,a),e.applyData(r,a)}function u4(e,r){const a={type:"element",tagName:"strong",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function d4(e,r){const a=e.all(r),i=a.shift(),o=[];if(i){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(r.children[0],d),o.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},f=Vp(r.children[1]),p=f0(r.children[r.children.length-1]);f&&p&&(d.position={start:f,end:p}),o.push(d)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(r,u),e.applyData(r,u)}function f4(e,r,a){const i=a?a.children:void 0,u=(i?i.indexOf(r):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,f=d?d.length:r.children.length;let p=-1;const h=[];for(;++p<f;){const b=r.children[p],v={},j=d?d[p]:void 0;j&&(v.align=j);let C={type:"element",tagName:u,properties:v,children:[]};b&&(C.children=e.all(b),e.patch(b,C),C=e.applyData(b,C)),h.push(C)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(r,y),e.applyData(r,y)}function m4(e,r){const a={type:"element",tagName:"td",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}const Cy=9,Ty=32;function p4(e){const r=String(e),a=/\r?\n|\r/g;let i=a.exec(r),o=0;const u=[];for(;i;)u.push(Ay(r.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=a.exec(r);return u.push(Ay(r.slice(o),o>0,!1)),u.join("")}function Ay(e,r,a){let i=0,o=e.length;if(r){let u=e.codePointAt(i);for(;u===Cy||u===Ty;)i++,u=e.codePointAt(i)}if(a){let u=e.codePointAt(o-1);for(;u===Cy||u===Ty;)o--,u=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function h4(e,r){const a={type:"text",value:p4(String(r.value))};return e.patch(r,a),e.applyData(r,a)}function x4(e,r){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(r,a),e.applyData(r,a)}const g4={blockquote:$A,break:YA,code:QA,delete:XA,emphasis:KA,footnoteReference:ZA,heading:WA,html:JA,imageReference:e4,image:t4,inlineCode:n4,linkReference:l4,link:r4,listItem:a4,list:s4,paragraph:o4,root:c4,strong:u4,table:d4,tableCell:m4,tableRow:f4,text:h4,thematicBreak:x4,toml:fu,yaml:fu,definition:fu,footnoteDefinition:fu};function fu(){}const L0=-1,Yu=0,vo=1,_u=2,Zp=3,Wp=4,Jp=5,eh=6,D0=7,_0=8,Ey=typeof self=="object"?self:globalThis,b4=(e,r)=>{const a=(o,u)=>(e.set(u,o),o),i=o=>{if(e.has(o))return e.get(o);const[u,d]=r[o];switch(u){case Yu:case L0:return a(d,o);case vo:{const f=a([],o);for(const p of d)f.push(i(p));return f}case _u:{const f=a({},o);for(const[p,h]of d)f[i(p)]=i(h);return f}case Zp:return a(new Date(d),o);case Wp:{const{source:f,flags:p}=d;return a(new RegExp(f,p),o)}case Jp:{const f=a(new Map,o);for(const[p,h]of d)f.set(i(p),i(h));return f}case eh:{const f=a(new Set,o);for(const p of d)f.add(i(p));return f}case D0:{const{name:f,message:p}=d;return a(new Ey[f](p),o)}case _0:return a(BigInt(d),o);case"BigInt":return a(Object(BigInt(d)),o);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return a(new DataView(f),d)}}return a(new Ey[u](d),o)};return i},Ry=e=>b4(new Map,e)(0),qi="",{toString:y4}={},{keys:v4}=Object,po=e=>{const r=typeof e;if(r!=="object"||!e)return[Yu,r];const a=y4.call(e).slice(8,-1);switch(a){case"Array":return[vo,qi];case"Object":return[_u,qi];case"Date":return[Zp,qi];case"RegExp":return[Wp,qi];case"Map":return[Jp,qi];case"Set":return[eh,qi];case"DataView":return[vo,a]}return a.includes("Array")?[vo,a]:a.includes("Error")?[D0,a]:[_u,a]},mu=([e,r])=>e===Yu&&(r==="function"||r==="symbol"),k4=(e,r,a,i)=>{const o=(d,f)=>{const p=i.push(d)-1;return a.set(f,p),p},u=d=>{if(a.has(d))return a.get(d);let[f,p]=po(d);switch(f){case Yu:{let y=d;switch(p){case"bigint":f=_0,y=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return o([L0],d)}return o([f,y],d)}case vo:{if(p){let v=d;return p==="DataView"?v=new Uint8Array(d.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(d)),o([p,[...v]],d)}const y=[],b=o([f,y],d);for(const v of d)y.push(u(v));return b}case _u:{if(p)switch(p){case"BigInt":return o([p,d.toString()],d);case"Boolean":case"Number":case"String":return o([p,d.valueOf()],d)}if(r&&"toJSON"in d)return u(d.toJSON());const y=[],b=o([f,y],d);for(const v of v4(d))(e||!mu(po(d[v])))&&y.push([u(v),u(d[v])]);return b}case Zp:return o([f,d.toISOString()],d);case Wp:{const{source:y,flags:b}=d;return o([f,{source:y,flags:b}],d)}case Jp:{const y=[],b=o([f,y],d);for(const[v,j]of d)(e||!(mu(po(v))||mu(po(j))))&&y.push([u(v),u(j)]);return b}case eh:{const y=[],b=o([f,y],d);for(const v of d)(e||!mu(po(v)))&&y.push(u(v));return b}}const{message:h}=d;return o([f,{name:p,message:h}],d)};return u},My=(e,{json:r,lossy:a}={})=>{const i=[];return k4(!(r||a),!!r,new Map,i)(e),i},Bu=typeof structuredClone=="function"?(e,r)=>r&&("json"in r||"lossy"in r)?Ry(My(e,r)):structuredClone(e):(e,r)=>Ry(My(e,r));function j4(e,r){const a=[{type:"text",value:"↩"}];return r>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),a}function N4(e,r){return"Back to reference "+(e+1)+(r>1?"-"+r:"")}function w4(e){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||j4,i=e.options.footnoteBackLabel||N4,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let p=-1;for(;++p<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[p]);if(!h)continue;const y=e.all(h),b=String(h.identifier).toUpperCase(),v=ts(b.toLowerCase());let j=0;const C=[],E=e.footnoteCounts.get(b);for(;E!==void 0&&++j<=E;){C.length>0&&C.push({type:"text",value:" "});let D=typeof a=="string"?a:a(p,j);typeof D=="string"&&(D={type:"text",value:D}),C.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+v+(j>1?"-"+j:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(p,j),className:["data-footnote-backref"]},children:Array.isArray(D)?D:[D]})}const w=y[y.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const D=w.children[w.children.length-1];D&&D.type==="text"?D.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...C)}else y.push(...C);const M={type:"element",tagName:"li",properties:{id:r+"fn-"+v},children:e.wrap(y,!0)};e.patch(h,M),f.push(M)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Bu(d),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
66
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
67
|
-
`}]}}const Qu=(function(e){if(e==null)return A4;if(typeof e=="function")return Xu(e);if(typeof e=="object")return Array.isArray(e)?S4(e):C4(e);if(typeof e=="string")return T4(e);throw new Error("Expected function, string, or object as test")});function S4(e){const r=[];let a=-1;for(;++a<e.length;)r[a]=Qu(e[a]);return Xu(i);function i(...o){let u=-1;for(;++u<r.length;)if(r[u].apply(this,o))return!0;return!1}}function C4(e){const r=e;return Xu(a);function a(i){const o=i;let u;for(u in e)if(o[u]!==r[u])return!1;return!0}}function T4(e){return Xu(r);function r(a){return a&&a.type===e}}function Xu(e){return r;function r(a,i,o){return!!(E4(a)&&e.call(this,a,typeof i=="number"?i:void 0,o||void 0))}}function A4(){return!0}function E4(e){return e!==null&&typeof e=="object"&&"type"in e}const B0=[],R4=!0,fp=!1,M4="skip";function I0(e,r,a,i){let o;typeof r=="function"&&typeof a!="function"?(i=a,a=r):o=r;const u=Qu(o),d=i?-1:1;f(e,void 0,[])();function f(p,h,y){const b=p&&typeof p=="object"?p:{};if(typeof b.type=="string"){const j=typeof b.tagName=="string"?b.tagName:typeof b.name=="string"?b.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(p.type+(j?"<"+j+">":""))+")"})}return v;function v(){let j=B0,C,E,w;if((!r||u(p,h,y[y.length-1]||void 0))&&(j=z4(a(p,y)),j[0]===fp))return j;if("children"in p&&p.children){const M=p;if(M.children&&j[0]!==M4)for(E=(i?M.children.length:-1)+d,w=y.concat(M);E>-1&&E<M.children.length;){const D=M.children[E];if(C=f(D,E,w)(),C[0]===fp)return C;E=typeof C[1]=="number"?C[1]:E+d}}return j}}}function z4(e){return Array.isArray(e)?e:typeof e=="number"?[R4,e]:e==null?B0:[e]}function th(e,r,a,i){let o,u,d;typeof r=="function"&&typeof a!="function"?(u=void 0,d=r,o=a):(u=r,d=a,o=i),I0(e,u,f,o);function f(p,h){const y=h[h.length-1],b=y?y.children.indexOf(p):void 0;return d(p,b,y)}}const mp={}.hasOwnProperty,O4={};function L4(e,r){const a=r||O4,i=new Map,o=new Map,u=new Map,d={...g4,...a.handlers},f={all:h,applyData:_4,definitionById:i,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:d,one:p,options:a,patch:D4,wrap:I4};return th(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const b=y.type==="definition"?i:o,v=String(y.identifier).toUpperCase();b.has(v)||b.set(v,y)}}),f;function p(y,b){const v=y.type,j=f.handlers[v];if(mp.call(f.handlers,v)&&j)return j(f,y,b);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in y){const{children:E,...w}=y,M=Bu(w);return M.children=f.all(y),M}return Bu(y)}return(f.options.unknownHandler||B4)(f,y,b)}function h(y){const b=[];if("children"in y){const v=y.children;let j=-1;for(;++j<v.length;){const C=f.one(v[j],y);if(C){if(j&&v[j-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=zy(C.value)),!Array.isArray(C)&&C.type==="element")){const E=C.children[0];E&&E.type==="text"&&(E.value=zy(E.value))}Array.isArray(C)?b.push(...C):b.push(C)}}}return b}}function D4(e,r){e.position&&(r.position=N3(e))}function _4(e,r){let a=r;if(e&&e.data){const i=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof i=="string")if(a.type==="element")a.tagName=i;else{const d="children"in a?a.children:[a];a={type:"element",tagName:i,properties:{},children:d}}a.type==="element"&&u&&Object.assign(a.properties,Bu(u)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function B4(e,r){const a=r.data||{},i="value"in r&&!(mp.call(a,"hProperties")||mp.call(a,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:e.all(r)};return e.patch(r,i),e.applyData(r,i)}function I4(e,r){const a=[];let i=-1;for(r&&a.push({type:"text",value:`
|
|
68
|
-
`});++i<e.length;)i&&a.push({type:"text",value:`
|
|
69
|
-
`}),a.push(e[i]);return r&&e.length>0&&a.push({type:"text",value:`
|
|
70
|
-
`}),a}function zy(e){let r=0,a=e.charCodeAt(r);for(;a===9||a===32;)r++,a=e.charCodeAt(r);return e.slice(r)}function Oy(e,r){const a=L4(e,r),i=a.one(e,void 0),o=w4(a),u=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
|
|
71
|
-
`},o),u}function P4(e,r){return e&&"run"in e?async function(a,i){const o=Oy(a,{file:i,...r});await e.run(o,i)}:function(a,i){return Oy(a,{file:i,...e||r})}}function Ly(e){if(e)throw e}var Dm,Dy;function U4(){if(Dy)return Dm;Dy=1;var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,a=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},u=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var y=e.call(h,"constructor"),b=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!b)return!1;var v;for(v in h);return typeof v>"u"||e.call(h,v)},d=function(h,y){a&&y.name==="__proto__"?a(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(i)return i(h,y).value}else return;return h[y]};return Dm=function p(){var h,y,b,v,j,C,E=arguments[0],w=1,M=arguments.length,D=!1;for(typeof E=="boolean"&&(D=E,E=arguments[1]||{},w=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});w<M;++w)if(h=arguments[w],h!=null)for(y in h)b=f(E,y),v=f(h,y),E!==v&&(D&&v&&(u(v)||(j=o(v)))?(j?(j=!1,C=b&&o(b)?b:[]):C=b&&u(b)?b:{},d(E,{name:y,newValue:p(D,C,v)})):typeof v<"u"&&d(E,{name:y,newValue:v}));return E},Dm}var H4=U4();const _m=Pu(H4);function pp(e){if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function F4(){const e=[],r={run:a,use:i};return r;function a(...o){let u=-1;const d=o.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...o);function f(p,...h){const y=e[++u];let b=-1;if(p){d(p);return}for(;++b<o.length;)(h[b]===null||h[b]===void 0)&&(h[b]=o[b]);o=h,y?q4(y,f)(...h):d(null,...h)}}function i(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),r}}function q4(e,r){let a;return i;function i(...d){const f=e.length>d.length;let p;f&&d.push(o);try{p=e.apply(this,d)}catch(h){const y=h;if(f&&a)throw y;return o(y)}f||(p&&p.then&&typeof p.then=="function"?p.then(u,o):p instanceof Error?o(p):u(p))}function o(d,...f){a||(a=!0,r(d,...f))}function u(d){o(null,d)}}const Ul={basename:V4,dirname:G4,extname:$4,join:Y4,sep:"/"};function V4(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Oo(e);let a=0,i=-1,o=e.length,u;if(r===void 0||r.length===0||r.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else i<0&&(u=!0,i=o+1);return i<0?"":e.slice(a,i)}if(r===e)return"";let d=-1,f=r.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else d<0&&(u=!0,d=o+1),f>-1&&(e.codePointAt(o)===r.codePointAt(f--)?f<0&&(i=o):(f=-1,i=d));return a===i?i=d:i<0&&(i=e.length),e.slice(a,i)}function G4(e){if(Oo(e),e.length===0)return".";let r=-1,a=e.length,i;for(;--a;)if(e.codePointAt(a)===47){if(i){r=a;break}}else i||(i=!0);return r<0?e.codePointAt(0)===47?"/":".":r===1&&e.codePointAt(0)===47?"//":e.slice(0,r)}function $4(e){Oo(e);let r=e.length,a=-1,i=0,o=-1,u=0,d;for(;r--;){const f=e.codePointAt(r);if(f===47){if(d){i=r+1;break}continue}a<0&&(d=!0,a=r+1),f===46?o<0?o=r:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||a<0||u===0||u===1&&o===a-1&&o===i+1?"":e.slice(o,a)}function Y4(...e){let r=-1,a;for(;++r<e.length;)Oo(e[r]),e[r]&&(a=a===void 0?e[r]:a+"/"+e[r]);return a===void 0?".":Q4(a)}function Q4(e){Oo(e);const r=e.codePointAt(0)===47;let a=X4(e,!r);return a.length===0&&!r&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),r?"/"+a:a}function X4(e,r){let a="",i=0,o=-1,u=0,d=-1,f,p;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(o===d-1||u===1))if(o!==d-1&&u===2){if(a.length<2||i!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",i=0):(a=a.slice(0,p),i=a.length-1-a.lastIndexOf("/")),o=d,u=0;continue}}else if(a.length>0){a="",i=0,o=d,u=0;continue}}r&&(a=a.length>0?a+"/..":"..",i=2)}else a.length>0?a+="/"+e.slice(o+1,d):a=e.slice(o+1,d),i=d-o-1;o=d,u=0}else f===46&&u>-1?u++:u=-1}return a}function Oo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const K4={cwd:Z4};function Z4(){return"/"}function hp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function W4(e){if(typeof e=="string")e=new URL(e);else if(!hp(e)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(e.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return J4(e)}function J4(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const r=e.pathname;let a=-1;for(;++a<r.length;)if(r.codePointAt(a)===37&&r.codePointAt(a+1)===50){const i=r.codePointAt(a+2);if(i===70||i===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(r)}const Bm=["history","path","basename","stem","extname","dirname"];class P0{constructor(r){let a;r?hp(r)?a={path:r}:typeof r=="string"||eE(r)?a={value:r}:a=r:a={},this.cwd="cwd"in a?"":K4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Bm.length;){const u=Bm[i];u in a&&a[u]!==void 0&&a[u]!==null&&(this[u]=u==="history"?[...a[u]]:a[u])}let o;for(o in a)Bm.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?Ul.basename(this.path):void 0}set basename(r){Pm(r,"basename"),Im(r,"basename"),this.path=Ul.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?Ul.dirname(this.path):void 0}set dirname(r){_y(this.basename,"dirname"),this.path=Ul.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?Ul.extname(this.path):void 0}set extname(r){if(Im(r,"extname"),_y(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ul.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){hp(r)&&(r=W4(r)),Pm(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?Ul.basename(this.path,this.extname):void 0}set stem(r){Pm(r,"stem"),Im(r,"stem"),this.path=Ul.join(this.dirname||"",r+(this.extname||""))}fail(r,a,i){const o=this.message(r,a,i);throw o.fatal=!0,o}info(r,a,i){const o=this.message(r,a,i);return o.fatal=void 0,o}message(r,a,i){const o=new Dn(r,a,i);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function Im(e,r){if(e&&e.includes(Ul.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+Ul.sep+"`")}function Pm(e,r){if(!e)throw new Error("`"+r+"` cannot be empty")}function _y(e,r){if(!e)throw new Error("Setting `"+r+"` requires `path` to be set too")}function eE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tE=(function(e){const i=this.constructor.prototype,o=i[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,i),u}),nE={}.hasOwnProperty;class nh extends tE{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=F4()}copy(){const r=new nh;let a=-1;for(;++a<this.attachers.length;){const i=this.attachers[a];r.use(...i)}return r.data(_m(!0,{},this.namespace)),r}data(r,a){return typeof r=="string"?arguments.length===2?(Fm("data",this.frozen),this.namespace[r]=a,this):nE.call(this.namespace,r)&&this.namespace[r]||void 0:r?(Fm("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const o=a.call(r,...i);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const a=pu(r),i=this.parser||this.Parser;return Um("parse",i),i(String(a),a)}process(r,a){const i=this;return this.freeze(),Um("process",this.parser||this.Parser),Hm("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(u,d){const f=pu(r),p=i.parse(f);i.run(p,f,function(y,b,v){if(y||!b||!v)return h(y);const j=b,C=i.stringify(j,v);aE(C)?v.value=C:v.result=C,h(y,v)});function h(y,b){y||!b?d(y):u?u(b):a(void 0,b)}}}processSync(r){let a=!1,i;return this.freeze(),Um("processSync",this.parser||this.Parser),Hm("processSync",this.compiler||this.Compiler),this.process(r,o),Iy("processSync","process",a),i;function o(u,d){a=!0,Ly(u),i=d}}run(r,a,i){By(r),this.freeze();const o=this.transformers;return!i&&typeof a=="function"&&(i=a,a=void 0),i?u(void 0,i):new Promise(u);function u(d,f){const p=pu(a);o.run(r,p,h);function h(y,b,v){const j=b||r;y?f(y):d?d(j):i(void 0,j,v)}}}runSync(r,a){let i=!1,o;return this.run(r,a,u),Iy("runSync","run",i),o;function u(d,f){Ly(d),o=f,i=!0}}stringify(r,a){this.freeze();const i=pu(a),o=this.compiler||this.Compiler;return Hm("stringify",o),By(r),o(r,i)}use(r,...a){const i=this.attachers,o=this.namespace;if(Fm("use",this.frozen),r!=null)if(typeof r=="function")p(r,a);else if(typeof r=="object")Array.isArray(r)?f(r):d(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function u(h){if(typeof h=="function")p(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...b]=h;p(y,b)}else d(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function d(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(o.settings=_m(!0,o.settings,h.settings))}function f(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const b=h[y];u(b)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function p(h,y){let b=-1,v=-1;for(;++b<i.length;)if(i[b][0]===h){v=b;break}if(v===-1)i.push([h,...y]);else if(y.length>0){let[j,...C]=y;const E=i[v][1];pp(E)&&pp(j)&&(j=_m(!0,E,j)),i[v]=[h,j,...C]}}}}const lE=new nh().freeze();function Um(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Hm(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Fm(e,r){if(r)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function By(e){if(!pp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Iy(e,r,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+r+"` instead")}function pu(e){return rE(e)?e:new P0(e)}function rE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function aE(e){return typeof e=="string"||iE(e)}function iE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Py=[],Uy={allowDangerousHtml:!0},oE=/^(https?|ircs?|mailto|xmpp)$/i,cE=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function uE(e){const r=dE(e),a=fE(e);return mE(r.runSync(r.parse(a),a),e)}function dE(e){const r=e.rehypePlugins||Py,a=e.remarkPlugins||Py,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Uy}:Uy;return lE().use(GA).use(a).use(P4,i).use(r)}function fE(e){const r=e.children||"",a=new P0;return typeof r=="string"&&(a.value=r),a}function mE(e,r){const a=r.allowedElements,i=r.allowElement,o=r.components,u=r.disallowedElements,d=r.skipHtml,f=r.unwrapDisallowed,p=r.urlTransform||pE;for(const y of cE)Object.hasOwn(r,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+sE+y.id,void 0);return th(e,h),A3(e,{Fragment:l.Fragment,components:o,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function h(y,b,v){if(y.type==="raw"&&v&&typeof b=="number")return d?v.children.splice(b,1):v.children[b]={type:"text",value:y.value},b;if(y.type==="element"){let j;for(j in zm)if(Object.hasOwn(zm,j)&&Object.hasOwn(y.properties,j)){const C=y.properties[j],E=zm[j];(E===null||E.includes(y.tagName))&&(y.properties[j]=p(String(C||""),j,y))}}if(y.type==="element"){let j=a?!a.includes(y.tagName):u?u.includes(y.tagName):!1;if(!j&&i&&typeof b=="number"&&(j=!i(y,b,v)),j&&v&&typeof b=="number")return f&&y.children?v.children.splice(b,1,...y.children):v.children.splice(b,1),b}}}function pE(e){const r=e.indexOf(":"),a=e.indexOf("?"),i=e.indexOf("#"),o=e.indexOf("/");return r===-1||o!==-1&&r>o||a!==-1&&r>a||i!==-1&&r>i||oE.test(e.slice(0,r))?e:""}function Hy(e,r){const a=String(e);if(typeof r!="string")throw new TypeError("Expected character");let i=0,o=a.indexOf(r);for(;o!==-1;)i++,o=a.indexOf(r,o+r.length);return i}function hE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function xE(e,r,a){const o=Qu((a||{}).ignore||[]),u=gE(r);let d=-1;for(;++d<u.length;)I0(e,"text",f);function f(h,y){let b=-1,v;for(;++b<y.length;){const j=y[b],C=v?v.children:void 0;if(o(j,C?C.indexOf(j):void 0,v))return;v=j}if(v)return p(h,y)}function p(h,y){const b=y[y.length-1],v=u[d][0],j=u[d][1];let C=0;const w=b.children.indexOf(h);let M=!1,D=[];v.lastIndex=0;let H=v.exec(h.value);for(;H;){const X=H.index,q={index:H.index,input:H.input,stack:[...y,h]};let L=j(...H,q);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?v.lastIndex=X+1:(C!==X&&D.push({type:"text",value:h.value.slice(C,X)}),Array.isArray(L)?D.push(...L):L&&D.push(L),C=X+H[0].length,M=!0),!v.global)break;H=v.exec(h.value)}return M?(C<h.value.length&&D.push({type:"text",value:h.value.slice(C)}),b.children.splice(w,1,...D)):D=[h],w+D.length}}function gE(e){const r=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<a.length;){const o=a[i];r.push([bE(o[0]),yE(o[1])])}return r}function bE(e){return typeof e=="string"?new RegExp(hE(e),"g"):e}function yE(e){return typeof e=="function"?e:function(){return e}}const qm="phrasing",Vm=["autolink","link","image","label"];function vE(){return{transforms:[TE],enter:{literalAutolink:jE,literalAutolinkEmail:Gm,literalAutolinkHttp:Gm,literalAutolinkWww:Gm},exit:{literalAutolink:CE,literalAutolinkEmail:SE,literalAutolinkHttp:NE,literalAutolinkWww:wE}}}function kE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:qm,notInConstruct:Vm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:qm,notInConstruct:Vm},{character:":",before:"[ps]",after:"\\/",inConstruct:qm,notInConstruct:Vm}]}}function jE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Gm(e){this.config.enter.autolinkProtocol.call(this,e)}function NE(e){this.config.exit.autolinkProtocol.call(this,e)}function wE(e){this.config.exit.data.call(this,e);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(e)}function SE(e){this.config.exit.autolinkEmail.call(this,e)}function CE(e){this.exit(e)}function TE(e){xE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,AE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),EE]],{ignore:["link","linkReference"]})}function AE(e,r,a,i,o){let u="";if(!U0(o)||(/^w/i.test(r)&&(a=r+a,r="",u="http://"),!RE(a)))return!1;const d=ME(a+i);if(!d[0])return!1;const f={type:"link",title:null,url:u+r+d[0],children:[{type:"text",value:r+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function EE(e,r,a,i){return!U0(i,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+a,children:[{type:"text",value:r+"@"+a}]}}function RE(e){const r=e.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function ME(e){const r=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!r)return[e,void 0];e=e.slice(0,r.index);let a=r[0],i=a.indexOf(")");const o=Hy(e,"(");let u=Hy(e,")");for(;i!==-1&&o>u;)e+=a.slice(0,i+1),a=a.slice(i+1),i=a.indexOf(")"),u++;return[e,a]}function U0(e,r){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Qa(a)||Gu(a))&&(!r||a!==47)}H0.peek=UE;function zE(){this.buffer()}function OE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function LE(){this.buffer()}function DE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function _E(e){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=El(this.sliceSerialize(e)).toLowerCase(),a.label=r}function BE(e){this.exit(e)}function IE(e){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=El(this.sliceSerialize(e)).toLowerCase(),a.label=r}function PE(e){this.exit(e)}function UE(){return"["}function H0(e,r,a,i){const o=a.createTracker(i);let u=o.move("[^");const d=a.enter("footnoteReference"),f=a.enter("reference");return u+=o.move(a.safe(a.associationId(e),{after:"]",before:u})),f(),d(),u+=o.move("]"),u}function HE(){return{enter:{gfmFootnoteCallString:zE,gfmFootnoteCall:OE,gfmFootnoteDefinitionLabelString:LE,gfmFootnoteDefinition:DE},exit:{gfmFootnoteCallString:_E,gfmFootnoteCall:BE,gfmFootnoteDefinitionLabelString:IE,gfmFootnoteDefinition:PE}}}function FE(e){let r=!1;return e&&e.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:a,footnoteReference:H0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(i,o,u,d){const f=u.createTracker(d);let p=f.move("[^");const h=u.enter("footnoteDefinition"),y=u.enter("label");return p+=f.move(u.safe(u.associationId(i),{before:p,after:"]"})),y(),p+=f.move("]:"),i.children&&i.children.length>0&&(f.shift(4),p+=f.move((r?`
|
|
72
|
-
`:" ")+u.indentLines(u.containerFlow(i,f.current()),r?F0:qE))),h(),p}}function qE(e,r,a){return r===0?e:F0(e,r,a)}function F0(e,r,a){return(a?"":" ")+e}const VE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];q0.peek=XE;function GE(){return{canContainEols:["delete"],enter:{strikethrough:YE},exit:{strikethrough:QE}}}function $E(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:VE}],handlers:{delete:q0}}}function YE(e){this.enter({type:"delete",children:[]},e)}function QE(e){this.exit(e)}function q0(e,r,a,i){const o=a.createTracker(i),u=a.enter("strikethrough");let d=o.move("~~");return d+=a.containerPhrasing(e,{...o.current(),before:d,after:"~"}),d+=o.move("~~"),u(),d}function XE(){return"~"}function KE(e){return e.length}function ZE(e,r){const a=r||{},i=(a.align||[]).concat(),o=a.stringLength||KE,u=[],d=[],f=[],p=[];let h=0,y=-1;for(;++y<e.length;){const E=[],w=[];let M=-1;for(e[y].length>h&&(h=e[y].length);++M<e[y].length;){const D=WE(e[y][M]);if(a.alignDelimiters!==!1){const H=o(D);w[M]=H,(p[M]===void 0||H>p[M])&&(p[M]=H)}E.push(D)}d[y]=E,f[y]=w}let b=-1;if(typeof i=="object"&&"length"in i)for(;++b<h;)u[b]=Fy(i[b]);else{const E=Fy(i);for(;++b<h;)u[b]=E}b=-1;const v=[],j=[];for(;++b<h;){const E=u[b];let w="",M="";E===99?(w=":",M=":"):E===108?w=":":E===114&&(M=":");let D=a.alignDelimiters===!1?1:Math.max(1,p[b]-w.length-M.length);const H=w+"-".repeat(D)+M;a.alignDelimiters!==!1&&(D=w.length+D+M.length,D>p[b]&&(p[b]=D),j[b]=D),v[b]=H}d.splice(1,0,v),f.splice(1,0,j),y=-1;const C=[];for(;++y<d.length;){const E=d[y],w=f[y];b=-1;const M=[];for(;++b<h;){const D=E[b]||"";let H="",X="";if(a.alignDelimiters!==!1){const q=p[b]-(w[b]||0),L=u[b];L===114?H=" ".repeat(q):L===99?q%2?(H=" ".repeat(q/2+.5),X=" ".repeat(q/2-.5)):(H=" ".repeat(q/2),X=H):X=" ".repeat(q)}a.delimiterStart!==!1&&!b&&M.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&D==="")&&(a.delimiterStart!==!1||b)&&M.push(" "),a.alignDelimiters!==!1&&M.push(H),M.push(D),a.alignDelimiters!==!1&&M.push(X),a.padding!==!1&&M.push(" "),(a.delimiterEnd!==!1||b!==h-1)&&M.push("|")}C.push(a.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return C.join(`
|
|
73
|
-
`)}function WE(e){return e==null?"":String(e)}function Fy(e){const r=typeof e=="string"?e.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function JE(e,r,a,i){const o=a.enter("blockquote"),u=a.createTracker(i);u.move("> "),u.shift(2);const d=a.indentLines(a.containerFlow(e,u.current()),eR);return o(),d}function eR(e,r,a){return">"+(a?"":" ")+e}function tR(e,r){return qy(e,r.inConstruct,!0)&&!qy(e,r.notInConstruct,!1)}function qy(e,r,a){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return a;let i=-1;for(;++i<r.length;)if(e.includes(r[i]))return!0;return!1}function Vy(e,r,a,i){let o=-1;for(;++o<a.unsafe.length;)if(a.unsafe[o].character===`
|
|
74
|
-
`&&tR(a.stack,a.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
75
|
-
`}function nR(e,r){const a=String(e);let i=a.indexOf(r),o=i,u=0,d=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===o?++u>d&&(d=u):u=1,o=i+r.length,i=a.indexOf(r,o);return d}function lR(e,r){return!!(r.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function rR(e){const r=e.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function aR(e,r,a,i){const o=rR(a),u=e.value||"",d=o==="`"?"GraveAccent":"Tilde";if(lR(e,a)){const b=a.enter("codeIndented"),v=a.indentLines(u,iR);return b(),v}const f=a.createTracker(i),p=o.repeat(Math.max(nR(u,o)+1,3)),h=a.enter("codeFenced");let y=f.move(p);if(e.lang){const b=a.enter(`codeFencedLang${d}`);y+=f.move(a.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),b()}if(e.lang&&e.meta){const b=a.enter(`codeFencedMeta${d}`);y+=f.move(" "),y+=f.move(a.safe(e.meta,{before:y,after:`
|
|
76
|
-
`,encode:["`"],...f.current()})),b()}return y+=f.move(`
|
|
77
|
-
`),u&&(y+=f.move(u+`
|
|
78
|
-
`)),y+=f.move(p),h(),y}function iR(e,r,a){return(a?"":" ")+e}function lh(e){const r=e.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function sR(e,r,a,i){const o=lh(a),u=o==='"'?"Quote":"Apostrophe",d=a.enter("definition");let f=a.enter("label");const p=a.createTracker(i);let h=p.move("[");return h+=p.move(a.safe(a.associationId(e),{before:h,after:"]",...p.current()})),h+=p.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(a.safe(e.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(f=a.enter("destinationRaw"),h+=p.move(a.safe(e.url,{before:h,after:e.title?" ":`
|
|
79
|
-
`,...p.current()}))),f(),e.title&&(f=a.enter(`title${u}`),h+=p.move(" "+o),h+=p.move(a.safe(e.title,{before:h,after:o,...p.current()})),h+=p.move(o),f()),d(),h}function oR(e){const r=e.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function Ao(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Iu(e,r,a){const i=Ji(e),o=Ji(r);return i===void 0?o===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}V0.peek=cR;function V0(e,r,a,i){const o=oR(a),u=a.enter("emphasis"),d=a.createTracker(i),f=d.move(o);let p=d.move(a.containerPhrasing(e,{after:o,before:f,...d.current()}));const h=p.charCodeAt(0),y=Iu(i.before.charCodeAt(i.before.length-1),h,o);y.inside&&(p=Ao(h)+p.slice(1));const b=p.charCodeAt(p.length-1),v=Iu(i.after.charCodeAt(0),b,o);v.inside&&(p=p.slice(0,-1)+Ao(b));const j=d.move(o);return u(),a.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},f+p+j}function cR(e,r,a){return a.options.emphasis||"*"}function uR(e,r){let a=!1;return th(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return a=!0,fp}),!!((!e.depth||e.depth<3)&&Qp(e)&&(r.options.setext||a))}function dR(e,r,a,i){const o=Math.max(Math.min(6,e.depth||1),1),u=a.createTracker(i);if(uR(e,a)){const y=a.enter("headingSetext"),b=a.enter("phrasing"),v=a.containerPhrasing(e,{...u.current(),before:`
|
|
80
|
-
`,after:`
|
|
81
|
-
`});return b(),y(),v+`
|
|
82
|
-
`+(o===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
83
|
-
`))+1))}const d="#".repeat(o),f=a.enter("headingAtx"),p=a.enter("phrasing");u.move(d+" ");let h=a.containerPhrasing(e,{before:"# ",after:`
|
|
84
|
-
`,...u.current()});return/^[\t ]/.test(h)&&(h=Ao(h.charCodeAt(0))+h.slice(1)),h=h?d+" "+h:d,a.options.closeAtx&&(h+=" "+d),p(),f(),h}G0.peek=fR;function G0(e){return e.value||""}function fR(){return"<"}$0.peek=mR;function $0(e,r,a,i){const o=lh(a),u=o==='"'?"Quote":"Apostrophe",d=a.enter("image");let f=a.enter("label");const p=a.createTracker(i);let h=p.move("![");return h+=p.move(a.safe(e.alt,{before:h,after:"]",...p.current()})),h+=p.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(a.safe(e.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(f=a.enter("destinationRaw"),h+=p.move(a.safe(e.url,{before:h,after:e.title?" ":")",...p.current()}))),f(),e.title&&(f=a.enter(`title${u}`),h+=p.move(" "+o),h+=p.move(a.safe(e.title,{before:h,after:o,...p.current()})),h+=p.move(o),f()),h+=p.move(")"),d(),h}function mR(){return"!"}Y0.peek=pR;function Y0(e,r,a,i){const o=e.referenceType,u=a.enter("imageReference");let d=a.enter("label");const f=a.createTracker(i);let p=f.move("![");const h=a.safe(e.alt,{before:p,after:"]",...f.current()});p+=f.move(h+"]["),d();const y=a.stack;a.stack=[],d=a.enter("reference");const b=a.safe(a.associationId(e),{before:p,after:"]",...f.current()});return d(),a.stack=y,u(),o==="full"||!h||h!==b?p+=f.move(b+"]"):o==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function pR(){return"!"}Q0.peek=hR;function Q0(e,r,a){let i=e.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++u<a.unsafe.length;){const d=a.unsafe[u],f=a.compilePattern(d);let p;if(d.atBreak)for(;p=f.exec(i);){let h=p.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(p.index+1)}}return o+i+o}function hR(){return"`"}function X0(e,r){const a=Qp(e);return!!(!r.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}K0.peek=xR;function K0(e,r,a,i){const o=lh(a),u=o==='"'?"Quote":"Apostrophe",d=a.createTracker(i);let f,p;if(X0(e,a)){const y=a.stack;a.stack=[],f=a.enter("autolink");let b=d.move("<");return b+=d.move(a.containerPhrasing(e,{before:b,after:">",...d.current()})),b+=d.move(">"),f(),a.stack=y,b}f=a.enter("link"),p=a.enter("label");let h=d.move("[");return h+=d.move(a.containerPhrasing(e,{before:h,after:"](",...d.current()})),h+=d.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(a.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(p=a.enter("destinationRaw"),h+=d.move(a.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),p(),e.title&&(p=a.enter(`title${u}`),h+=d.move(" "+o),h+=d.move(a.safe(e.title,{before:h,after:o,...d.current()})),h+=d.move(o),p()),h+=d.move(")"),f(),h}function xR(e,r,a){return X0(e,a)?"<":"["}Z0.peek=gR;function Z0(e,r,a,i){const o=e.referenceType,u=a.enter("linkReference");let d=a.enter("label");const f=a.createTracker(i);let p=f.move("[");const h=a.containerPhrasing(e,{before:p,after:"]",...f.current()});p+=f.move(h+"]["),d();const y=a.stack;a.stack=[],d=a.enter("reference");const b=a.safe(a.associationId(e),{before:p,after:"]",...f.current()});return d(),a.stack=y,u(),o==="full"||!h||h!==b?p+=f.move(b+"]"):o==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function gR(){return"["}function rh(e){const r=e.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function bR(e){const r=rh(e),a=e.options.bulletOther;if(!a)return r==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+a+"`) to be different");return a}function yR(e){const r=e.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function W0(e){const r=e.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function vR(e,r,a,i){const o=a.enter("list"),u=a.bulletCurrent;let d=e.ordered?yR(a):rh(a);const f=e.ordered?d==="."?")":".":bR(a);let p=r&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),W0(a)===d&&y){let b=-1;for(;++b<e.children.length;){const v=e.children[b];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(d=f),a.bulletCurrent=d;const h=a.containerFlow(e,i);return a.bulletLastUsed=d,a.bulletCurrent=u,o(),h}function kR(e){const r=e.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function jR(e,r,a,i){const o=kR(a);let u=a.bulletCurrent||rh(a);r&&r.type==="list"&&r.ordered&&(u=(typeof r.start=="number"&&r.start>-1?r.start:1)+(a.options.incrementListMarker===!1?0:r.children.indexOf(e))+u);let d=u.length+1;(o==="tab"||o==="mixed"&&(r&&r.type==="list"&&r.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=a.createTracker(i);f.move(u+" ".repeat(d-u.length)),f.shift(d);const p=a.enter("listItem"),h=a.indentLines(a.containerFlow(e,f.current()),y);return p(),h;function y(b,v,j){return v?(j?"":" ".repeat(d))+b:(j?u:u+" ".repeat(d-u.length))+b}}function NR(e,r,a,i){const o=a.enter("paragraph"),u=a.enter("phrasing"),d=a.containerPhrasing(e,i);return u(),o(),d}const wR=Qu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function SR(e,r,a,i){return(e.children.some(function(d){return wR(d)})?a.containerPhrasing:a.containerFlow).call(a,e,i)}function CR(e){const r=e.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}J0.peek=TR;function J0(e,r,a,i){const o=CR(a),u=a.enter("strong"),d=a.createTracker(i),f=d.move(o+o);let p=d.move(a.containerPhrasing(e,{after:o,before:f,...d.current()}));const h=p.charCodeAt(0),y=Iu(i.before.charCodeAt(i.before.length-1),h,o);y.inside&&(p=Ao(h)+p.slice(1));const b=p.charCodeAt(p.length-1),v=Iu(i.after.charCodeAt(0),b,o);v.inside&&(p=p.slice(0,-1)+Ao(b));const j=d.move(o+o);return u(),a.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},f+p+j}function TR(e,r,a){return a.options.strong||"*"}function AR(e,r,a,i){return a.safe(e.value,i)}function ER(e){const r=e.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function RR(e,r,a){const i=(W0(a)+(a.options.ruleSpaces?" ":"")).repeat(ER(a));return a.options.ruleSpaces?i.slice(0,-1):i}const ek={blockquote:JE,break:Vy,code:aR,definition:sR,emphasis:V0,hardBreak:Vy,heading:dR,html:G0,image:$0,imageReference:Y0,inlineCode:Q0,link:K0,linkReference:Z0,list:vR,listItem:jR,paragraph:NR,root:SR,strong:J0,text:AR,thematicBreak:RR};function MR(){return{enter:{table:zR,tableData:Gy,tableHeader:Gy,tableRow:LR},exit:{codeText:DR,table:OR,tableData:$m,tableHeader:$m,tableRow:$m}}}function zR(e){const r=e._align;this.enter({type:"table",align:r.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function OR(e){this.exit(e),this.data.inTable=void 0}function LR(e){this.enter({type:"tableRow",children:[]},e)}function $m(e){this.exit(e)}function Gy(e){this.enter({type:"tableCell",children:[]},e)}function DR(e){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,_R));const a=this.stack[this.stack.length-1];a.type,a.value=r,this.exit(e)}function _R(e,r){return r==="|"?r:e}function BR(e){const r=e||{},a=r.tableCellPadding,i=r.tablePipeAlign,o=r.stringLength,u=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
85
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:d,tableCell:p,tableRow:f}};function d(j,C,E,w){return h(y(j,E,w),j.align)}function f(j,C,E,w){const M=b(j,E,w),D=h([M]);return D.slice(0,D.indexOf(`
|
|
86
|
-
`))}function p(j,C,E,w){const M=E.enter("tableCell"),D=E.enter("phrasing"),H=E.containerPhrasing(j,{...w,before:u,after:u});return D(),M(),H}function h(j,C){return ZE(j,{align:C,alignDelimiters:i,padding:a,stringLength:o})}function y(j,C,E){const w=j.children;let M=-1;const D=[],H=C.enter("table");for(;++M<w.length;)D[M]=b(w[M],C,E);return H(),D}function b(j,C,E){const w=j.children;let M=-1;const D=[],H=C.enter("tableRow");for(;++M<w.length;)D[M]=p(w[M],j,C,E);return H(),D}function v(j,C,E){let w=ek.inlineCode(j,C,E);return E.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function IR(){return{exit:{taskListCheckValueChecked:$y,taskListCheckValueUnchecked:$y,paragraph:UR}}}function PR(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:HR}}}function $y(e){const r=this.stack[this.stack.length-2];r.type,r.checked=e.type==="taskListCheckValueChecked"}function UR(e){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const i=a.children[0];if(i&&i.type==="text"){const o=r.children;let u=-1,d;for(;++u<o.length;){const f=o[u];if(f.type==="paragraph"){d=f;break}}d===a&&(i.value=i.value.slice(1),i.value.length===0?a.children.shift():a.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,a.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function HR(e,r,a,i){const o=e.children[0],u=typeof e.checked=="boolean"&&o&&o.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=a.createTracker(i);u&&f.move(d);let p=ek.listItem(e,r,a,{...i,...f.current()});return u&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),p;function h(y){return y+d}}function FR(){return[vE(),HE(),GE(),MR(),IR()]}function qR(e){return{extensions:[kE(),FE(e),$E(),BR(e),PR()]}}const VR={tokenize:KR,partial:!0},tk={tokenize:ZR,partial:!0},nk={tokenize:WR,partial:!0},lk={tokenize:JR,partial:!0},GR={tokenize:eM,partial:!0},rk={name:"wwwAutolink",tokenize:QR,previous:ik},ak={name:"protocolAutolink",tokenize:XR,previous:sk},wr={name:"emailAutolink",tokenize:YR,previous:ok},Vl={};function $R(){return{text:Vl}}let qa=48;for(;qa<123;)Vl[qa]=wr,qa++,qa===58?qa=65:qa===91&&(qa=97);Vl[43]=wr;Vl[45]=wr;Vl[46]=wr;Vl[95]=wr;Vl[72]=[wr,ak];Vl[104]=[wr,ak];Vl[87]=[wr,rk];Vl[119]=[wr,rk];function YR(e,r,a){const i=this;let o,u;return d;function d(b){return!xp(b)||!ok.call(i,i.previous)||ah(i.events)?a(b):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(b))}function f(b){return xp(b)?(e.consume(b),f):b===64?(e.consume(b),p):a(b)}function p(b){return b===46?e.check(GR,y,h)(b):b===45||b===95||Ln(b)?(u=!0,e.consume(b),p):y(b)}function h(b){return e.consume(b),o=!0,p}function y(b){return u&&o&&Pn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),r(b)):a(b)}}function QR(e,r,a){const i=this;return o;function o(d){return d!==87&&d!==119||!ik.call(i,i.previous)||ah(i.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(VR,e.attempt(tk,e.attempt(nk,u),a),a)(d))}function u(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),r(d)}}function XR(e,r,a){const i=this;let o="",u=!1;return d;function d(b){return(b===72||b===104)&&sk.call(i,i.previous)&&!ah(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(b),e.consume(b),f):a(b)}function f(b){if(Pn(b)&&o.length<5)return o+=String.fromCodePoint(b),e.consume(b),f;if(b===58){const v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(b),p}return a(b)}function p(b){return b===47?(e.consume(b),u?h:(u=!0,p)):a(b)}function h(b){return b===null||Du(b)||It(b)||Qa(b)||Gu(b)?a(b):e.attempt(tk,e.attempt(nk,y),a)(b)}function y(b){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),r(b)}}function KR(e,r,a){let i=0;return o;function o(d){return(d===87||d===119)&&i<3?(i++,e.consume(d),o):d===46&&i===3?(e.consume(d),u):a(d)}function u(d){return d===null?a(d):r(d)}}function ZR(e,r,a){let i,o,u;return d;function d(h){return h===46||h===95?e.check(lk,p,f)(h):h===null||It(h)||Qa(h)||h!==45&&Gu(h)?p(h):(u=!0,e.consume(h),d)}function f(h){return h===95?i=!0:(o=i,i=void 0),e.consume(h),d}function p(h){return o||i||!u?a(h):r(h)}}function WR(e,r){let a=0,i=0;return o;function o(d){return d===40?(a++,e.consume(d),o):d===41&&i<a?u(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(lk,r,u)(d):d===null||It(d)||Qa(d)?r(d):(e.consume(d),o)}function u(d){return d===41&&i++,e.consume(d),o}}function JR(e,r,a){return i;function i(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),i):f===38?(e.consume(f),u):f===93?(e.consume(f),o):f===60||f===null||It(f)||Qa(f)?r(f):a(f)}function o(f){return f===null||f===40||f===91||It(f)||Qa(f)?r(f):i(f)}function u(f){return Pn(f)?d(f):a(f)}function d(f){return f===59?(e.consume(f),i):Pn(f)?(e.consume(f),d):a(f)}}function eM(e,r,a){return i;function i(u){return e.consume(u),o}function o(u){return Ln(u)?a(u):r(u)}}function ik(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||It(e)}function sk(e){return!Pn(e)}function ok(e){return!(e===47||xp(e))}function xp(e){return e===43||e===45||e===46||e===95||Ln(e)}function ah(e){let r=e.length,a=!1;for(;r--;){const i=e[r][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){a=!0;break}if(i._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const tM={tokenize:cM,partial:!0};function nM(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:iM,continuation:{tokenize:sM},exit:oM}},text:{91:{name:"gfmFootnoteCall",tokenize:aM},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lM,resolveTo:rM}}}}function lM(e,r,a){const i=this;let o=i.events.length;const u=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let d;for(;o--;){const p=i.events[o][1];if(p.type==="labelImage"){d=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return f;function f(p){if(!d||!d._balanced)return a(p);const h=El(i.sliceSerialize({start:d.end,end:i.now()}));return h.codePointAt(0)!==94||!u.includes(h.slice(1))?a(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),r(p))}}function rM(e,r){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[a+1],e[a+2],["enter",i,r],e[a+3],e[a+4],["enter",o,r],["exit",o,r],["enter",u,r],["enter",d,r],["exit",d,r],["exit",u,r],e[e.length-2],e[e.length-1],["exit",i,r]];return e.splice(a,e.length-a+1,...f),e}function aM(e,r,a){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u=0,d;return f;function f(b){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),p}function p(b){return b!==94?a(b):(e.enter("gfmFootnoteCallMarker"),e.consume(b),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(b){if(u>999||b===93&&!d||b===null||b===91||It(b))return a(b);if(b===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return o.includes(El(i.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),r):a(b)}return It(b)||(d=!0),u++,e.consume(b),b===92?y:h}function y(b){return b===91||b===92||b===93?(e.consume(b),u++,h):h(b)}}function iM(e,r,a){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u,d=0,f;return p;function p(C){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(C){return C===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):a(C)}function y(C){if(d>999||C===93&&!f||C===null||C===91||It(C))return a(C);if(C===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return u=El(i.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return It(C)||(f=!0),d++,e.consume(C),C===92?b:y}function b(C){return C===91||C===92||C===93?(e.consume(C),d++,y):y(C)}function v(C){return C===58?(e.enter("definitionMarker"),e.consume(C),e.exit("definitionMarker"),o.includes(u)||o.push(u),wt(e,j,"gfmFootnoteDefinitionWhitespace")):a(C)}function j(C){return r(C)}}function sM(e,r,a){return e.check(zo,r,e.attempt(tM,r,a))}function oM(e){e.exit("gfmFootnoteDefinition")}function cM(e,r,a){const i=this;return wt(e,o,"gfmFootnoteDefinitionIndent",5);function o(u){const d=i.events[i.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?r(u):a(u)}}function uM(e){let a=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:u,resolveAll:o};return a==null&&(a=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function o(d,f){let p=-1;for(;++p<d.length;)if(d[p][0]==="enter"&&d[p][1].type==="strikethroughSequenceTemporary"&&d[p][1]._close){let h=p;for(;h--;)if(d[h][0]==="exit"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._open&&d[p][1].end.offset-d[p][1].start.offset===d[h][1].end.offset-d[h][1].start.offset){d[p][1].type="strikethroughSequence",d[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},d[h][1].start),end:Object.assign({},d[p][1].end)},b={type:"strikethroughText",start:Object.assign({},d[h][1].end),end:Object.assign({},d[p][1].start)},v=[["enter",y,f],["enter",d[h][1],f],["exit",d[h][1],f],["enter",b,f]],j=f.parser.constructs.insideSpan.null;j&&ul(v,v.length,0,$u(j,d.slice(h+1,p),f)),ul(v,v.length,0,[["exit",b,f],["enter",d[p][1],f],["exit",d[p][1],f],["exit",y,f]]),ul(d,h-1,p-h+3,v),p=h+v.length-2;break}}for(p=-1;++p<d.length;)d[p][1].type==="strikethroughSequenceTemporary"&&(d[p][1].type="data");return d}function u(d,f,p){const h=this.previous,y=this.events;let b=0;return v;function v(C){return h===126&&y[y.length-1][1].type!=="characterEscape"?p(C):(d.enter("strikethroughSequenceTemporary"),j(C))}function j(C){const E=Ji(h);if(C===126)return b>1?p(C):(d.consume(C),b++,j);if(b<2&&!a)return p(C);const w=d.exit("strikethroughSequenceTemporary"),M=Ji(C);return w._open=!M||M===2&&!!E,w._close=!E||E===2&&!!M,f(C)}}}class dM{constructor(){this.map=[]}add(r,a,i){fM(this,r,a,i)}consume(r){if(this.map.sort(function(u,d){return u[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const i=[];for(;a>0;)a-=1,i.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];i.push(r.slice()),r.length=0;let o=i.pop();for(;o;){for(const u of o)r.push(u);o=i.pop()}this.map.length=0}}function fM(e,r,a,i){let o=0;if(!(a===0&&i.length===0)){for(;o<e.map.length;){if(e.map[o][0]===r){e.map[o][1]+=a,e.map[o][2].push(...i);return}o+=1}e.map.push([r,a,i])}}function mM(e,r){let a=!1;const i=[];for(;r<e.length;){const o=e[r];if(a){if(o[0]==="enter")o[1].type==="tableContent"&&i.push(e[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[r-1][1].type==="tableDelimiterMarker"){const u=i.length-1;i[u]=i[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(a=!0);r+=1}return i}function pM(){return{flow:{null:{name:"table",tokenize:hM,resolveAll:xM}}}}function hM(e,r,a){const i=this;let o=0,u=0,d;return f;function f(O){let P=i.events.length-1;for(;P>-1;){const J=i.events[P][1].type;if(J==="lineEnding"||J==="linePrefix")P--;else break}const Q=P>-1?i.events[P][1].type:null,oe=Q==="tableHead"||Q==="tableRow"?L:p;return oe===L&&i.parser.lazy[i.now().line]?a(O):oe(O)}function p(O){return e.enter("tableHead"),e.enter("tableRow"),h(O)}function h(O){return O===124||(d=!0,u+=1),y(O)}function y(O){return O===null?a(O):$e(O)?u>1?(u=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),j):a(O):gt(O)?wt(e,y,"whitespace")(O):(u+=1,d&&(d=!1,o+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),d=!0,y):(e.enter("data"),b(O)))}function b(O){return O===null||O===124||It(O)?(e.exit("data"),y(O)):(e.consume(O),O===92?v:b)}function v(O){return O===92||O===124?(e.consume(O),b):b(O)}function j(O){return i.interrupt=!1,i.parser.lazy[i.now().line]?a(O):(e.enter("tableDelimiterRow"),d=!1,gt(O)?wt(e,C,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):C(O))}function C(O){return O===45||O===58?w(O):O===124?(d=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),E):q(O)}function E(O){return gt(O)?wt(e,w,"whitespace")(O):w(O)}function w(O){return O===58?(u+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),M):O===45?(u+=1,M(O)):O===null||$e(O)?X(O):q(O)}function M(O){return O===45?(e.enter("tableDelimiterFiller"),D(O)):q(O)}function D(O){return O===45?(e.consume(O),D):O===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),H):(e.exit("tableDelimiterFiller"),H(O))}function H(O){return gt(O)?wt(e,X,"whitespace")(O):X(O)}function X(O){return O===124?C(O):O===null||$e(O)?!d||o!==u?q(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),r(O)):q(O)}function q(O){return a(O)}function L(O){return e.enter("tableRow"),B(O)}function B(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),B):O===null||$e(O)?(e.exit("tableRow"),r(O)):gt(O)?wt(e,B,"whitespace")(O):(e.enter("data"),F(O))}function F(O){return O===null||O===124||It(O)?(e.exit("data"),B(O)):(e.consume(O),O===92?Z:F)}function Z(O){return O===92||O===124?(e.consume(O),F):F(O)}}function xM(e,r){let a=-1,i=!0,o=0,u=[0,0,0,0],d=[0,0,0,0],f=!1,p=0,h,y,b;const v=new dM;for(;++a<e.length;){const j=e[a],C=j[1];j[0]==="enter"?C.type==="tableHead"?(f=!1,p!==0&&(Yy(v,r,p,h,y),y=void 0,p=0),h={type:"table",start:Object.assign({},C.start),end:Object.assign({},C.end)},v.add(a,0,[["enter",h,r]])):C.type==="tableRow"||C.type==="tableDelimiterRow"?(i=!0,b=void 0,u=[0,0,0,0],d=[0,a+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},C.start),end:Object.assign({},C.end)},v.add(a,0,[["enter",y,r]])),o=C.type==="tableDelimiterRow"?2:y?3:1):o&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")?(i=!1,d[2]===0&&(u[1]!==0&&(d[0]=d[1],b=hu(v,r,u,o,void 0,b),u=[0,0,0,0]),d[2]=a)):C.type==="tableCellDivider"&&(i?i=!1:(u[1]!==0&&(d[0]=d[1],b=hu(v,r,u,o,void 0,b)),u=d,d=[u[1],a,0,0])):C.type==="tableHead"?(f=!0,p=a):C.type==="tableRow"||C.type==="tableDelimiterRow"?(p=a,u[1]!==0?(d[0]=d[1],b=hu(v,r,u,o,a,b)):d[1]!==0&&(b=hu(v,r,d,o,a,b)),o=0):o&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")&&(d[3]=a)}for(p!==0&&Yy(v,r,p,h,y),v.consume(r.events),a=-1;++a<r.events.length;){const j=r.events[a];j[0]==="enter"&&j[1].type==="table"&&(j[1]._align=mM(r.events,a))}return e}function hu(e,r,a,i,o,u){const d=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",f="tableContent";a[0]!==0&&(u.end=Object.assign({},Gi(r.events,a[0])),e.add(a[0],0,[["exit",u,r]]));const p=Gi(r.events,a[1]);if(u={type:d,start:Object.assign({},p),end:Object.assign({},p)},e.add(a[1],0,[["enter",u,r]]),a[2]!==0){const h=Gi(r.events,a[2]),y=Gi(r.events,a[3]),b={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(a[2],0,[["enter",b,r]]),i!==2){const v=r.events[a[2]],j=r.events[a[3]];if(v[1].end=Object.assign({},j[1].end),v[1].type="chunkText",v[1].contentType="text",a[3]>a[2]+1){const C=a[2]+1,E=a[3]-a[2]-1;e.add(C,E,[])}}e.add(a[3]+1,0,[["exit",b,r]])}return o!==void 0&&(u.end=Object.assign({},Gi(r.events,o)),e.add(o,0,[["exit",u,r]]),u=void 0),u}function Yy(e,r,a,i,o){const u=[],d=Gi(r.events,a);o&&(o.end=Object.assign({},d),u.push(["exit",o,r])),i.end=Object.assign({},d),u.push(["exit",i,r]),e.add(a+1,0,u)}function Gi(e,r){const a=e[r],i=a[0]==="enter"?"start":"end";return a[1][i]}const gM={name:"tasklistCheck",tokenize:yM};function bM(){return{text:{91:gM}}}function yM(e,r,a){const i=this;return o;function o(p){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?a(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),u)}function u(p){return It(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),d):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),d):a(p)}function d(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):a(p)}function f(p){return $e(p)?r(p):gt(p)?e.check({tokenize:vM},r,a)(p):a(p)}}function vM(e,r,a){return wt(e,i,"whitespace");function i(o){return o===null?a(o):r(o)}}function kM(e){return y0([$R(),nM(),uM(e),pM(),bM()])}const jM={};function NM(e){const r=this,a=e||jM,i=r.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),u=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),d=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(kM(a)),u.push(FR()),d.push(qR(a))}function wM({thread:e}){return e.state==="available"?null:e.state==="working"?l.jsx("span",{className:"inline-flex items-center gap-1 shrink-0",style:{color:g.muted},children:l.jsx(Ku,{})}):l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[9px] font-mono tracking-wide shrink-0",style:{color:g.muted},children:[l.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${Ro(e.state)}`}),l.jsx("span",{children:e.statusLabel})]})}function Ku({className:e=""}){return l.jsxs("span",{className:`inline-flex items-center gap-1 ${e}`,"aria-hidden":"true",children:[l.jsx("span",{className:"os-thinking-dot"}),l.jsx("span",{className:"os-thinking-dot"}),l.jsx("span",{className:"os-thinking-dot"})]})}function ko({messages:e,showAnnotations:r,showStatusMessages:a,inkStyle:i,mutedStyle:o,tagStyle:u,annotStyle:d,agentLookup:f,directThreadLookup:p,onOpenAgentProfile:h,onOpenAgentChat:y,onNudgeMessage:b}){const[v,j]=A.useState(null),[C,E]=A.useState(null),[w,M]=A.useState(null),D=[];let H="",X=0;const q=A.useMemo(()=>a?e:e.filter(P=>P.messageClass!=="status"),[e,a]),L=A.useMemo(()=>new Map(q.map(P=>[P.id,P])),[q]),B=A.useMemo(()=>{let P=null;for(const Q of q)Q.isOperator&&Q.isDirectConversation&&Q.receipt&&(P=Q.id);return P},[q]);A.useEffect(()=>{if(!v)return;const P=window.setTimeout(()=>{j(Q=>Q===v?null:Q)},1400);return()=>window.clearTimeout(P)},[v]),A.useEffect(()=>{if(!C)return;const P=window.setTimeout(()=>{E(Q=>Q===C?null:Q)},1400);return()=>window.clearTimeout(P)},[C]),A.useEffect(()=>{if(!w)return;const P=window.setTimeout(()=>{M(Q=>Q===w?null:Q)},2200);return()=>window.clearTimeout(P)},[w]);const F=z.useCallback(async P=>{try{await uk(So(P)),j(P)}catch{j(null)}},[]),Z=z.useCallback(P=>{b?.(P),E(P.id)},[b]),O=z.useCallback(P=>{if(typeof document>"u")return;const Q=document.getElementById(km(P));Q&&(Q.scrollIntoView({block:"center",behavior:"smooth"}),M(P))},[]);for(;X<q.length;){const P=q[X],Q=FS(P.authorRole)?P.authorRole:null,oe=P.isOperator?null:f.get(P.authorId)??null,J=oe?p.get(oe.id)??null:null;if(P.dayLabel!==H&&(D.push(l.jsxs("div",{className:"flex items-center gap-3 mb-5 mt-2",children:[l.jsx("div",{className:"flex-1 h-px",style:{backgroundColor:g.border}}),l.jsx("div",{className:"px-2 font-mono text-[9px] tracking-widest uppercase shrink-0",style:o,children:P.dayLabel}),l.jsx("div",{className:"flex-1 h-px",style:{backgroundColor:g.border}})]},`day-${P.dayLabel}`)),H=P.dayLabel),P.isSystem||P.messageClass==="status"){D.push(l.jsxs("div",{className:"flex gap-3 mb-3 group rounded-lg px-2 py-2 -mx-2 bg-[var(--os-hover)]",children:[l.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center text-[9px] font-semibold shrink-0 mt-0.5",style:{backgroundColor:P.avatarColor,color:"white",opacity:.85},children:P.avatarLabel}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"flex items-baseline justify-between mb-0.5",children:l.jsx("div",{className:"flex items-baseline gap-2",children:oe?l.jsx(Xy,{agent:oe,directThread:J,visibleRole:Q,timestampLabel:P.timestampLabel,inkStyle:i,mutedStyle:o,tagStyle:u,onOpenProfile:h,onOpenChat:y}):l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"font-semibold text-[12px]",style:i,children:P.authorName}),l.jsx("span",{className:"text-[9px] font-mono",style:o,children:P.timestampLabel})]})})}),l.jsxs("div",{id:km(P.id),className:"group/message relative text-[12px] leading-relaxed rounded-lg px-2 py-1.5 pr-12 -mx-2",style:w===P.id?Gb():i,children:[l.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 border rounded font-mono text-[10px] w-fit",style:u,children:[l.jsx(un,{className:"text-[10px]"}),l.jsxs("span",{children:[l.jsx("span",{style:o,children:"TASK //"})," ",P.body]}),l.jsx("span",{className:"ml-2 px-1 rounded",style:{backgroundColor:"rgba(99,102,241,0.12)",color:"var(--os-accent)"},children:"IN PROGRESS"})]}),l.jsx(Qy,{message:P,copied:v===P.id,nudged:C===P.id,canNudge:!!(b&&!P.isOperator),mutedStyle:o,onCopyRef:F,onNudge:()=>Z(P)})]})]})]},P.id)),X+=1;continue}const ee=[P];let N=X+1;for(;N<q.length&&q[N].authorId===P.authorId&&q[N].dayLabel===P.dayLabel&&!q[N].isSystem&&q[N].messageClass!=="status";)ee.push(q[N]),N+=1;const Y=!!oe;D.push(l.jsxs("div",{className:An("flex gap-3 mb-4 group rounded-lg px-2 py-2 -mx-2",Y&&"bg-[var(--os-hover)]"),children:[l.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center text-[9px] font-semibold shrink-0 mt-0.5",style:{backgroundColor:P.avatarColor,color:"white",opacity:.85},children:P.avatarLabel}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-baseline justify-between mb-1",children:[l.jsx("div",{className:"flex items-baseline gap-2",children:oe?l.jsx(Xy,{agent:oe,directThread:J,visibleRole:Q,timestampLabel:P.timestampLabel,inkStyle:i,mutedStyle:o,tagStyle:u,onOpenProfile:h,onOpenChat:y}):l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"font-semibold text-[12px]",style:i,children:P.authorName}),Q?l.jsx("span",{className:"text-[9px] font-mono border px-1 py-0.5 rounded",style:u,children:Q}):null,l.jsx("span",{className:"text-[9px] font-mono",style:o,children:P.timestampLabel})]})}),r&&(P.routingSummary||P.provenanceSummary)?l.jsxs("div",{className:"flex items-center gap-1",children:[P.routingSummary?l.jsx("span",{className:"text-[9px] font-mono border px-1 rounded",style:d,children:P.routingSummary}):null,P.provenanceSummary?l.jsx("span",{className:"text-[9px] font-mono border px-1 rounded",style:d,children:P.provenanceSummary}):null]}):null]}),l.jsx("div",{className:"flex flex-col gap-2 mt-0.5",children:ee.map($=>{const ye=$.replyToMessageId?L.get($.replyToMessageId)??null:null,T=!!($.receipt&&(!$.isOperator||!$.isDirectConversation||B===$.id)),_=T&&VS($.body);return l.jsxs("div",{id:km($.id),className:"group/message relative text-[12px] leading-relaxed rounded-lg px-2 py-1.5 pr-12 -mx-2",style:w===$.id?Gb():i,children:[$.replyToMessageId?ye?l.jsx(Ky,{messageId:$.replyToMessageId,preview:zu(ye.body,64),mutedStyle:o,onJump:()=>O($.replyToMessageId)}):l.jsx(Ky,{messageId:$.replyToMessageId,mutedStyle:o}):null,_&&$.receipt?l.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[l.jsx("span",{className:"min-w-0 max-w-full whitespace-pre-wrap break-words",style:i,children:$.body}),l.jsx(Zy,{receipt:$.receipt,mutedStyle:o,inline:!0})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex flex-col gap-2",children:EM($.body,i,o,u)}),T&&$.receipt?l.jsx(Zy,{receipt:$.receipt,mutedStyle:o}):null]}),r&&($.routingSummary||$.provenanceSummary||$.provenanceDetail)?l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-1.5",children:[$.routingSummary?l.jsx("span",{className:"text-[9px] font-mono border px-1 rounded",style:d,children:$.routingSummary}):null,$.provenanceSummary?l.jsx("span",{className:"text-[9px] font-mono border px-1 rounded",style:d,children:$.provenanceSummary}):null,$.provenanceDetail?l.jsx("span",{className:"text-[9px]",style:o,children:$.provenanceDetail}):null]}):null,l.jsx(Qy,{message:$,copied:v===$.id,nudged:C===$.id,canNudge:!!(b&&!$.isOperator),mutedStyle:o,onCopyRef:F,onNudge:()=>Z($)})]},$.id)})})]})]},P.id)),X=N}return l.jsx(l.Fragment,{children:D})}function Qy({message:e,copied:r,nudged:a,canNudge:i,mutedStyle:o,onCopyRef:u,onNudge:d}){return l.jsxs("div",{className:"absolute top-1.5 right-2 flex items-center gap-2 opacity-0 pointer-events-none transition-opacity group-hover/message:opacity-100 group-hover/message:pointer-events-auto group-focus-within/message:opacity-100 group-focus-within/message:pointer-events-auto",children:[i?l.jsx("button",{type:"button",onClick:d,className:"text-[9px] font-mono lowercase tracking-wide transition-colors hover:opacity-80",style:a?{color:g.accent}:o,title:`Follow up with ${e.authorName}`,children:a?"drafted":"nudge"}):null,l.jsx("button",{type:"button",onClick:()=>{u(e.id)},className:"text-[9px] font-mono lowercase tracking-wide transition-colors hover:opacity-80",style:r?{color:g.accent}:o,title:Nv(e.id),children:r?"copied":tC(e.id)})]})}function Xy({agent:e,directThread:r,visibleRole:a,timestampLabel:i,inkStyle:o,mutedStyle:u,tagStyle:d,onOpenProfile:f,onOpenChat:p}){const h=y=>{if(y.preventDefault(),y.stopPropagation(),y.metaKey||y.ctrlKey){p(e.id);return}f(e.id)};return l.jsxs("div",{className:"relative group/agent inline-flex items-baseline gap-2 min-w-0",children:[l.jsxs("button",{type:"button",onClick:h,className:"inline-flex items-baseline gap-2 min-w-0 text-left hover:opacity-90 transition-opacity",title:"Click for overview. Cmd-click to open direct chat.",children:[l.jsx("span",{className:"font-semibold text-[12px] truncate",style:o,children:e.title}),a?l.jsx("span",{className:"text-[9px] font-mono border px-1 py-0.5 rounded shrink-0",style:d,children:a}):null]}),l.jsx("span",{className:"text-[9px] font-mono shrink-0",style:u,children:i}),l.jsx(CM,{agent:e,directThread:r,mutedStyle:u,onOpenProfile:f,onOpenChat:p})]})}function SM({agent:e,directThread:r=null,variant:a="hero",mutedStyle:i={color:g.muted},borderColor:o=g.bg,actions:u=null}){const d=a==="hover",f=Fb(e.role),p=Fb(e.summary),h=r?.statusDetail??e.statusDetail??p??"Available as a local relay channel.";return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsxs("div",{className:"relative shrink-0",children:[l.jsx("div",{className:`${d?"w-8 h-8 text-[11px]":"w-10 h-10 text-[13px]"} rounded text-white flex items-center justify-center font-bold ${e.reachable?"":"opacity-40 grayscale"}`,style:{backgroundColor:cl(e.id)},children:e.title.charAt(0).toUpperCase()}),l.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-2 h-2 rounded-full ${Ro(e.state)}`,style:{border:`1px solid ${o}`}})]}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("div",{className:d?"text-[12px] font-semibold truncate":"text-[15px] font-semibold tracking-tight",style:{color:g.ink},children:e.title}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:{backgroundColor:g.tagBg,color:g.muted},children:mv(e.profileKind)})]}),d?l.jsx("div",{className:"text-[10px] mt-1",style:i,children:h}):l.jsxs(l.Fragment,{children:[f?l.jsx("div",{className:"text-[11px] mt-1",style:{color:g.ink},children:f}):null,p?l.jsx("div",{className:"text-[12px] leading-[1.55] mt-2",style:{color:g.muted},children:p}):null]}),l.jsx("div",{className:`text-[10px] ${d?"mt-2 flex flex-wrap gap-x-3 gap-y-1":"mt-3 flex items-center gap-2 flex-wrap"}`,style:i,children:d?l.jsxs(l.Fragment,{children:[l.jsx("span",{children:e.harness??"runtime"}),l.jsx("span",{children:Ka(e.projectRoot??e.cwd)??"no path"}),e.lastChatLabel?l.jsxs("span",{children:["last chat ",e.lastChatLabel]}):null]}):l.jsxs(l.Fragment,{children:[l.jsx("span",{children:e.lastChatLabel?`Last chat ${e.lastChatLabel}`:"No direct chat yet."}),e.lastSessionLabel?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-1 h-1 rounded-full",style:{backgroundColor:g.border}}),l.jsxs("span",{children:["Last session ",e.lastSessionLabel]})]}):null]})})]})]}),u?l.jsx("div",{className:"mt-3 flex items-center gap-2",children:u}):null]})}function ho({children:e,icon:r,tone:a="neutral",...i}){return l.jsxs(Nt,{type:"button",variant:"outline",size:"sm",className:"h-8 rounded-xl px-3 text-[10px] font-medium shadow-none",style:a==="primary"?{backgroundColor:g.accentBg,borderColor:g.accentBorder,color:g.accent}:{backgroundColor:g.surface,borderColor:g.border,color:g.ink},...i,children:[r,e]})}function CM({agent:e,directThread:r,mutedStyle:a,onOpenProfile:i,onOpenChat:o}){return l.jsx("div",{className:"absolute left-0 top-full z-30 mt-2 w-72 rounded-xl border p-3 shadow-lg opacity-0 pointer-events-none translate-y-1 transition-all duration-150 group-hover/agent:opacity-100 group-hover/agent:pointer-events-auto group-hover/agent:translate-y-0 group-focus-within/agent:opacity-100 group-focus-within/agent:pointer-events-auto group-focus-within/agent:translate-y-0",style:{borderColor:g.border,backgroundColor:g.surface},children:l.jsx(SM,{agent:e,directThread:r,variant:"hover",mutedStyle:a,borderColor:g.surface,actions:l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:u=>{u.preventDefault(),u.stopPropagation(),o(e.id)},children:"Message"}),l.jsx("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:u=>{u.preventDefault(),u.stopPropagation(),i(e.id)},children:"Overview"}),l.jsx("span",{className:"ml-auto text-[9px] font-mono",style:a,children:"Cmd-click to DM"})]})})})}function Ky({messageId:e,preview:r,mutedStyle:a,onJump:i}){return l.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-[9px] leading-none min-w-0",style:{...a,opacity:.7},children:[l.jsx(_N,{size:9,className:"shrink-0"}),i?l.jsx("button",{type:"button",onClick:i,className:"hover:underline underline-offset-2 truncate min-w-0",title:Nv(e),children:r||So(e)}):l.jsx("span",{className:"font-mono shrink-0",children:So(e)})]})}function Zy({receipt:e,mutedStyle:r,inline:a=!1}){const i=qS(e.state);return l.jsxs("div",{className:`${a?"":"mt-1.5 "}inline-flex items-center gap-1.5 text-[10px] leading-none shrink-0`,style:{...r,color:i.color},title:e.detail??e.label,children:[l.jsx(TM,{state:e.state}),l.jsx("span",{className:"font-mono uppercase tracking-[0.14em]",children:e.label}),e.state==="replied"&&e.detail?l.jsx("span",{style:r,children:e.detail}):null]})}function TM({state:e}){switch(e){case"replied":return l.jsx(C2,{size:11});case"working":return l.jsx(Ku,{className:"text-[var(--os-accent)]"});case"seen":return l.jsx(Eu,{size:11});case"delivered":return l.jsx(Eu,{size:11});default:return l.jsx(Yi,{size:11})}}function Ki({size:e=16,strokeWidth:r=1.35,style:a}){return l.jsx(S1,{size:e,strokeWidth:r,className:"shrink-0",style:a,"aria-hidden":"true"})}function ck({id:e,active:r,size:a=12}){const i=r?{color:g.accent}:void 0;return e==="voice"?l.jsx(Km,{size:a,className:"os-row-icon shrink-0",style:i}):e==="system"?l.jsx($a,{size:a,className:"os-row-icon shrink-0",style:i}):e==="mentions"?l.jsx(Np,{size:a,className:"os-row-icon shrink-0",style:i}):e==="coordination"?l.jsx(Al,{size:a,className:"os-row-icon shrink-0",style:i}):e==="all-traffic"?l.jsx(j2,{size:a,className:"os-row-icon shrink-0",style:i}):l.jsx(e2,{size:a,className:"os-row-icon shrink-0",style:i})}function AM({relayState:e,appSettings:r,destinationKind:a,destinationId:i,body:o,replyToMessageId:u,clientMessageId:d}){const f=Date.now(),p=e?.operatorId??"operator",h=ZS(e,r),y=a==="direct"?Array.from(new Set([i,...Vb(o)])):Vb(o),b=a==="channel"?i:a==="direct"?null:"shared",v=a==="channel"&&i==="voice",j=a==="channel"&&i==="system";return{id:`pending-${d}`,clientMessageId:d,conversationId:eC(a,i),createdAt:f,replyToMessageId:u,authorId:p,authorName:h,authorRole:null,body:o,timestampLabel:QS(f),dayLabel:XS(f),normalizedChannel:b,recipients:y,isDirectConversation:a==="direct",isSystem:j,isVoice:v,messageClass:j?"system":"agent",routingSummary:y.length>0?`Targets ${y.join(", ")}`:null,provenanceSummary:"via desktop · sending",provenanceDetail:null,isOperator:!0,avatarLabel:h.slice(0,1).toUpperCase()||"A",avatarColor:cl(p),receipt:{state:"sent",label:"Sending…",detail:null}}}function EM(e,r,a,i){const o={"--os-markdown-ink":String(r.color??g.ink),"--os-markdown-muted":String(a.color??g.muted),"--os-markdown-link":g.accent,"--os-markdown-border":g.border,"--os-markdown-surface":String(i.backgroundColor??g.tagBg),"--os-markdown-inline-border":String(i.borderColor??g.border),"--os-markdown-code-bg":g.termBg,"--os-markdown-code-fg":g.termFg};return l.jsx("div",{className:"os-markdown",style:o,children:l.jsx(uE,{remarkPlugins:[NM],components:{a:({href:u,children:d})=>l.jsx("a",{href:u,target:"_blank",rel:"noreferrer",children:d}),blockquote:({children:u})=>l.jsx("blockquote",{children:u}),code:({className:u,children:d,...f})=>{const p=/language-([\w-]+)/.exec(u??"")?.[1],h=String(d).replace(/\n$/,"");return!p&&!h.includes(`
|
|
87
|
-
`)?l.jsx("code",{className:"os-markdown-inline-code",...f,children:h}):l.jsxs("div",{className:"os-markdown-code-block",children:[l.jsx("div",{className:"os-markdown-code-header",children:l.jsx("span",{children:p??"code"})}),l.jsx("pre",{className:"os-markdown-pre",children:l.jsx("code",{className:u,...f,children:h})})]})},h1:({children:u})=>l.jsx("h1",{children:u}),h2:({children:u})=>l.jsx("h2",{children:u}),h3:({children:u})=>l.jsx("h3",{children:u}),hr:()=>l.jsx("hr",{}),pre:({children:u})=>l.jsx(l.Fragment,{children:u}),table:({children:u})=>l.jsx("div",{className:"os-markdown-table-wrap",children:l.jsx("table",{children:u})})},children:e})})}async function uk(e){if(typeof navigator<"u"&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}if(typeof document<"u"){const r=document.createElement("textarea");r.value=e,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();const a=document.execCommand("copy");if(document.body.removeChild(r),a)return}throw new Error("Clipboard unavailable.")}function RM(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`client-${crypto.randomUUID()}`:`client-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Wy({title:e,subtitle:r,layout:a,roster:i}){return a.isCollapsed?null:l.jsxs("div",{style:{width:a.sidebarWidth,...a.styles.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[l.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:a.onResizeStart}),l.jsxs("div",{className:"px-4 h-14 flex items-center justify-between border-b",style:{borderBottomColor:g.border},children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:a.styles.inkText,children:e}),l.jsx("div",{className:"text-[10px] font-mono mt-0.5",style:a.styles.mutedText,children:r})]}),l.jsx("button",{className:"p-1.5 rounded transition-opacity hover:opacity-70",style:a.styles.mutedText,onClick:i.onRefresh,children:l.jsx(xn,{size:14})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto py-3",children:l.jsxs("div",{className:"mb-3 px-2",children:[l.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1.5 px-2",style:a.styles.mutedText,children:"Roster"}),l.jsxs("div",{className:"flex items-center justify-end gap-2 px-2 mb-2 relative",children:[l.jsxs("div",{className:"relative",children:[l.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] px-2 py-1 rounded",style:{color:g.ink},onClick:()=>i.setAgentRosterMenu(o=>o==="filter"?null:"filter"),title:"Filter roster",children:[l.jsx($N,{size:11}),l.jsx("span",{style:a.styles.mutedText,children:IS(i.agentRosterFilter)})]}),i.agentRosterMenu==="filter"?l.jsx("div",{className:"absolute right-0 top-full mt-1 w-36 rounded-lg border shadow-sm z-20",style:{backgroundColor:g.surface,borderColor:g.border},children:[["all","All Agents"],["active","Active Only"]].map(([o,u])=>l.jsx("button",{className:"w-full text-left px-3 py-2 text-[11px] transition-opacity hover:opacity-80",style:o===i.agentRosterFilter?a.styles.activeItem:a.styles.inkText,onClick:()=>{i.setAgentRosterFilter(o),i.setAgentRosterMenu(null)},children:u},o))}):null]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] px-2 py-1 rounded",style:{color:g.ink},onClick:()=>i.setAgentRosterMenu(o=>o==="sort"?null:"sort"),title:"Sort roster",children:[l.jsx(bN,{size:11}),l.jsx("span",{style:a.styles.mutedText,children:PS(i.agentRosterSort)})]}),i.agentRosterMenu==="sort"?l.jsx("div",{className:"absolute right-0 top-full mt-1 w-36 rounded-lg border shadow-sm z-20",style:{backgroundColor:g.surface,borderColor:g.border},children:[["chat","Recent Chat"],["code","Code Changes"],["session","Dev Sessions"],["alpha","A-Z"]].map(([o,u])=>l.jsx("button",{className:"w-full text-left px-3 py-2 text-[11px] transition-opacity hover:opacity-80",style:o===i.agentRosterSort?a.styles.activeItem:a.styles.inkText,onClick:()=>{i.setAgentRosterSort(o),i.setAgentRosterMenu(null)},children:u},o))}):null]})]}),l.jsx("div",{className:"flex flex-col gap-px",children:i.rosterInterAgentAgents.length>0?i.rosterInterAgentAgents.map(o=>{const u=i.selectedInterAgentId===o.id;return l.jsxs("button",{onClick:()=>i.onSelectInterAgent(o.id),className:"flex items-center gap-2 px-2 py-2 rounded text-[12px] transition-opacity w-full text-left",style:u?a.styles.activeItem:a.styles.mutedText,children:[l.jsxs("div",{className:"relative shrink-0",children:[l.jsx("div",{className:`w-6 h-6 rounded text-white flex items-center justify-center text-[9px] font-bold ${o.reachable?"":"opacity-40 grayscale"}`,style:{backgroundColor:cl(o.id)},children:o.title.charAt(0).toUpperCase()}),l.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-1.5 h-1.5 rounded-full ${Ro(o.state)}`,style:{border:`1px solid ${g.bg}`}})]}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"font-medium truncate",style:a.styles.inkText,children:[o.title,(i.rosterAgentTitleCounts.get(o.title)??0)>1&&o.branch?l.jsx("span",{className:"font-normal ml-1 text-[10px]",style:a.styles.mutedText,children:o.branch}):null]}),l.jsx("div",{className:"text-[10px] truncate",style:a.styles.mutedText,children:US(o,i.agentRosterSort)})]}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:u?a.styles.activePill:a.styles.tagBadge,children:o.threadCount})]},o.id)}):l.jsx("div",{className:"px-3 py-8 text-[12px] text-center",style:a.styles.mutedText,children:"No agents match this view yet."})})]})})]})}function MM({activeView:e,layout:r,roster:a,agents:i,logs:o,interAgent:u,sessions:d}){if(e==="agents"){const f=a.rosterInterAgentAgents.length===a.interAgentAgents.length?`${a.interAgentAgents.length} agents`:`${a.rosterInterAgentAgents.length} visible · ${a.interAgentAgents.length} total`;return l.jsxs(l.Fragment,{children:[l.jsx(Wy,{title:"Agents",subtitle:f,layout:r,roster:a}),l.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:r.styles.surface,children:[l.jsx("div",{className:"border-b px-4 py-3 shrink-0",style:{...r.styles.surface,borderBottomColor:g.border},children:i.selectedInterAgent?l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[l.jsxs("div",{className:"relative shrink-0",children:[l.jsx("div",{className:`w-9 h-9 rounded-xl text-[13px] text-white flex items-center justify-center font-bold ${i.selectedInterAgent.reachable?"":"opacity-40 grayscale"}`,style:{backgroundColor:cl(i.selectedInterAgent.id)},children:i.selectedInterAgent.title.charAt(0).toUpperCase()}),l.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full ${Ro(i.selectedInterAgent.state)}`,style:{border:`1px solid ${g.surface}`}})]}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"text-[15px] font-semibold tracking-tight truncate",style:r.styles.inkText,children:i.selectedInterAgent.title}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:i.selectedInterAgent.state==="working"?r.styles.activePill:r.styles.tagBadge,children:i.selectedInterAgent.statusLabel})]}),l.jsx("div",{className:"text-[11px] mt-0.5 truncate max-w-2xl",style:r.styles.mutedText,children:i.selectedInterAgent.statusDetail??i.selectedInterAgent.summary??null})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[l.jsx(ho,{icon:l.jsx(Al,{size:13}),tone:i.selectedInterAgentDirectThread?"primary":"neutral",onClick:()=>i.onOpenAgentThread(i.selectedInterAgent.id,{focusComposer:!0}),children:i.selectedInterAgentChatActionLabel}),l.jsx(ho,{icon:l.jsx(b1,{size:13}),onClick:i.onPeekAgentSession,children:"Peek"}),l.jsx(ho,{icon:l.jsx($a,{size:13}),onClick:()=>i.onOpenAgentSettings(i.selectedInterAgent.id,i.selectedInterAgent.profileKind==="project"),children:i.selectedInterAgent.profileKind==="project"?"Configure":"Settings"})]})]}):l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx($i,{size:14,style:r.styles.mutedText}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[13px] font-semibold tracking-tight truncate",style:r.styles.inkText,children:"Agents"}),l.jsx("div",{className:"text-[10px] truncate mt-0.5",style:r.styles.mutedText,children:"Select an agent to inspect its operational snapshot and recent threads."})]})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-4",children:i.selectedInterAgent?l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...r.styles.surface,borderColor:g.border},children:[l.jsxs("div",{className:"px-4 py-3 border-b flex items-center justify-between gap-3",style:{backgroundColor:g.surface,borderBottomColor:g.border},children:[l.jsx("div",{className:"min-w-0",children:l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Live Session"})}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[i.visibleAgentSession?.commandLabel?l.jsx(ho,{icon:l.jsx(Nr,{size:13}),onClick:i.onCopyAgentSessionCommand,children:i.agentSessionCopied?"Copied":"Copy"}):null,i.visibleAgentSession&&i.visibleAgentSession.mode!=="none"?l.jsx(ho,{icon:l.jsx(da,{size:13}),onClick:i.onOpenAgentSession,children:i.visibleAgentSession.mode==="tmux"?"Open TMUX":"Open Logs"}):null]})]}),l.jsx("div",{className:"px-4 py-4 max-h-[320px] overflow-y-auto",style:{backgroundColor:g.bg},children:i.selectedInterAgentActivityMessages.length>0?l.jsx(ko,{messages:i.selectedInterAgentActivityMessages.slice(-8),showAnnotations:!1,showStatusMessages:!1,inkStyle:r.styles.inkText,mutedStyle:r.styles.mutedText,tagStyle:r.styles.tagBadge,annotStyle:r.styles.annotBadge,agentLookup:i.interAgentAgentLookup,directThreadLookup:i.relayDirectLookup,onOpenAgentProfile:i.onOpenAgentProfile,onOpenAgentChat:(p,h)=>i.onOpenAgentThread(p,{draft:h,focusComposer:!0}),onNudgeMessage:i.onNudgeMessage}):l.jsx("div",{className:"text-[11px] leading-[1.6]",style:r.styles.mutedText,children:"No messages yet. Use the broker to send this agent a task."})}),l.jsxs(ju,{open:i.agentSessionLogsExpanded,onOpenChange:i.setAgentSessionLogsExpanded,children:[l.jsx(Nu,{asChild:!0,children:l.jsx("button",{className:"w-full px-4 py-2 border-t flex items-center justify-between gap-2 text-[10px] hover:opacity-90 transition-opacity text-left",style:{borderTopColor:g.border,backgroundColor:g.bg,color:g.muted},children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ql,{size:10,className:"transition-transform duration-150",style:{transform:i.agentSessionLogsExpanded?"rotate(90deg)":void 0}}),l.jsx("span",{className:"font-mono uppercase tracking-wider",children:"Logs"}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:i.visibleAgentSession?.mode==="tmux"?r.styles.activePill:r.styles.tagBadge,children:i.agentSessionPending?"Loading":i.visibleAgentSession?.mode==="tmux"?"TMUX":i.visibleAgentSession?.mode==="logs"?"Logs":"Unavailable"}),i.visibleAgentSession?.updatedAtLabel?l.jsxs("span",{children:["Updated ",i.visibleAgentSession.updatedAtLabel]}):null]})})}),l.jsxs(wu,{children:[l.jsx("div",{style:{backgroundColor:g.termBg},children:i.agentSessionLoading&&!i.visibleAgentSession?l.jsx("div",{className:"px-4 py-8 text-[11px] font-mono",style:{color:g.termFg},children:"Loading live session…"}):i.visibleAgentSession?.body?l.jsx("pre",{ref:p=>{i.agentSessionInlineViewportRef.current=p},onScroll:i.onInlineAgentSessionScroll,className:"px-4 py-4 text-[11px] leading-[1.6] overflow-x-auto whitespace-pre-wrap break-words max-h-[400px] overflow-y-auto",style:{color:g.termFg,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:i.visibleAgentSession.body}):l.jsx("div",{className:"px-4 py-8 text-[11px] leading-[1.65] font-mono",style:{color:g.termFg},children:i.agentSessionPending?"Checking for a live tmux pane first, then falling back to canonical runtime logs.":i.visibleAgentSession?.subtitle??"No session output available yet."})}),l.jsxs("div",{className:"px-4 h-10 border-t flex items-center justify-between gap-3 text-[10px]",style:{borderTopColor:g.border,backgroundColor:g.bg,color:g.muted},children:[l.jsx("div",{className:"truncate min-w-0 font-mono",children:i.renderLocalPathValue(i.visibleAgentSession?.pathLabel??Ka(i.selectedInterAgent.cwd??i.selectedInterAgent.projectRoot)??"No stable session path yet.",{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"})}),i.agentSessionFeedback?l.jsx("div",{className:"shrink-0",style:r.styles.inkText,children:i.agentSessionFeedback}):null]})]})]})]}),l.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...r.styles.surface,borderColor:g.border},children:[l.jsxs("div",{className:"px-4 py-3 border-b flex items-center justify-between gap-3",style:{borderBottomColor:g.border,backgroundColor:g.surface},children:[l.jsx("div",{className:"min-w-0",children:l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Recent Activity"})}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0 flex-wrap justify-end",children:[l.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:r.styles.tagBadge,children:[i.selectedInterAgentActivityMessages.length," events"]}),i.selectedInterAgentInboundTasks.length>0?l.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:r.styles.activePill,children:[i.selectedInterAgentInboundTasks.length," asks"]}):null,i.selectedInterAgentOutboundFindings.length>0?l.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"},children:[i.selectedInterAgentOutboundFindings.length," waiting"]}):null]})]}),i.selectedInterAgentFindings.length>0?l.jsx("div",{className:"px-4 py-3 border-b flex flex-col gap-2",style:{borderBottomColor:g.border,backgroundColor:g.bg},children:i.selectedInterAgentFindings.slice(0,2).map(p=>l.jsxs("div",{className:"rounded-lg border px-3 py-2",style:{borderColor:p.severity==="error"?"rgba(248, 113, 113, 0.28)":"rgba(245, 158, 11, 0.28)",backgroundColor:p.severity==="error"?"rgba(248, 113, 113, 0.08)":"rgba(245, 158, 11, 0.08)"},children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsx("div",{className:"text-[11px] font-medium",style:r.styles.inkText,children:p.title}),l.jsx("span",{className:"text-[9px] font-mono uppercase",style:r.styles.mutedText,children:p.ageLabel??p.updatedAtLabel??"Open"})]}),l.jsx("div",{className:"text-[11px] mt-1",style:r.styles.mutedText,children:p.summary})]},p.id))}):null,l.jsxs("div",{className:"px-4 py-4 max-h-[280px] overflow-y-auto",style:{backgroundColor:g.bg},children:[i.selectedInterAgentActivityMessages.length>0?l.jsx(ko,{messages:i.agentActivityExpanded?i.selectedInterAgentActivityMessages:i.selectedInterAgentActivityMessages.slice(-5),showAnnotations:!0,showStatusMessages:!0,inkStyle:r.styles.inkText,mutedStyle:r.styles.mutedText,tagStyle:r.styles.tagBadge,annotStyle:r.styles.annotBadge,agentLookup:i.interAgentAgentLookup,directThreadLookup:i.relayDirectLookup,onOpenAgentProfile:i.onOpenAgentProfile,onOpenAgentChat:(p,h)=>i.onOpenAgentThread(p,{draft:h,focusComposer:!0}),onNudgeMessage:i.onNudgeMessage}):l.jsx("div",{className:"text-[11px] leading-[1.6]",style:r.styles.mutedText,children:"No broker-visible activity for this agent yet."}),i.selectedInterAgentActivityMessages.length>5&&!i.agentActivityExpanded?l.jsxs("button",{className:"w-full text-center py-2 text-[11px] font-medium hover:opacity-80 transition-opacity",style:{color:g.accent},onClick:()=>i.setAgentActivityExpanded(!0),children:["Show all ",i.selectedInterAgentActivityMessages.length," events"]}):null]})]}),l.jsx(ju,{open:i.agentThreadsExpanded,onOpenChange:i.setAgentThreadsExpanded,children:l.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...r.styles.surface,borderColor:g.border},children:[l.jsx(Nu,{asChild:!0,children:l.jsx("button",{className:"w-full px-4 py-3 flex items-center justify-between gap-3 hover:opacity-90 transition-opacity text-left",style:{backgroundColor:g.surface},children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ql,{size:12,className:"transition-transform duration-150",style:{color:g.muted,transform:i.agentThreadsExpanded?"rotate(90deg)":void 0}}),l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Open Threads"}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:r.styles.tagBadge,children:i.visibleInterAgentThreads.length+1})]})})}),l.jsx(wu,{children:l.jsxs("div",{className:"px-4 py-3 border-t flex flex-col gap-3",style:{borderTopColor:g.border},children:[l.jsxs("div",{className:"border rounded-lg px-3 py-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[13px] font-medium truncate",style:r.styles.inkText,children:"Direct Line"}),l.jsxs("div",{className:"text-[10px] truncate mt-1",style:r.styles.mutedText,children:["You and ",i.selectedInterAgent.title]})]}),l.jsx("span",{className:"text-[10px] font-mono shrink-0",style:r.styles.mutedText,children:i.selectedInterAgentDirectThread?.timestampLabel??i.selectedInterAgent.lastChatLabel??""})]}),l.jsx("div",{className:"text-[12px] leading-[1.55] mt-3",style:r.styles.mutedText,children:i.selectedAgentDirectLinePreview}),l.jsxs("div",{className:"flex items-center justify-between gap-3 mt-3",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:r.styles.activePill,children:"Direct"}),l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:r.styles.tagBadge,children:i.selectedInterAgent.statusLabel})]}),l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded shrink-0",style:{color:g.ink},onClick:()=>i.onOpenAgentThread(i.selectedInterAgent.id,{focusComposer:!0}),children:i.selectedInterAgentChatActionLabel})]})]}),i.visibleInterAgentThreads.length>0?l.jsx("div",{className:"flex flex-col gap-3",children:i.visibleInterAgentThreads.map(p=>l.jsxs("div",{className:"border rounded-lg px-3 py-3",style:{borderColor:g.border,backgroundColor:i.selectedInterAgentThreadId===p.id?g.bg:g.surface},children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[13px] font-medium truncate",style:r.styles.inkText,children:ep(p,i.selectedInterAgent.id)}),l.jsx("div",{className:"text-[10px] truncate mt-1",style:r.styles.mutedText,children:tp(p,i.selectedInterAgent.id)})]}),l.jsx("span",{className:"text-[10px] font-mono shrink-0",style:r.styles.mutedText,children:p.timestampLabel??""})]}),l.jsx("div",{className:"text-[12px] leading-[1.55] mt-3",style:r.styles.mutedText,children:p.preview??"No message preview yet."}),l.jsxs("div",{className:"flex items-center justify-between gap-3 mt-3",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:p.sourceKind==="private"?r.styles.tagBadge:r.styles.activePill,children:p.sourceKind==="private"?"Private":"Targeted"}),l.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:r.styles.tagBadge,children:[p.messageCount," msgs"]})]}),l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>i.onOpenThreadInTrafficView(p.id),children:"Open"})]})]},p.id))}):l.jsx("div",{className:"flex flex-col items-start gap-3",children:l.jsx("div",{className:"text-[11px] leading-[1.5]",style:r.styles.mutedText,children:"No other active channels for this agent yet."})})]})})]})}),l.jsx(ju,{open:i.agentSnapshotExpanded,onOpenChange:i.setAgentSnapshotExpanded,children:l.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...r.styles.surface,borderColor:g.border},children:[l.jsx(Nu,{asChild:!0,children:l.jsxs("button",{className:"w-full px-4 py-3 flex items-center gap-2 hover:opacity-90 transition-opacity text-left",style:{backgroundColor:g.surface},children:[l.jsx(ql,{size:12,className:"transition-transform duration-150",style:{color:g.muted,transform:i.agentSnapshotExpanded?"rotate(90deg)":void 0}}),l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Operational Snapshot"})]})}),l.jsx(wu,{children:l.jsx("div",{className:"px-4 py-3 border-t",style:{borderTopColor:g.border},children:l.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[["Harness",i.visibleAgentConfig?.runtime.harness??i.selectedInterAgent.harness??"Not reported"],["Session",i.visibleAgentConfig?.runtime.sessionId??i.selectedInterAgent.sessionId??"Not reported"],["Transport",i.visibleAgentConfig?.runtime.transport??i.selectedInterAgent.transport??"Not reported"],["Wake Policy",i.visibleAgentConfig?.runtime.wakePolicy||i.selectedInterAgent.wakePolicy||"Not reported"],["Last Chat",i.selectedInterAgent.lastChatLabel??"Not reported"],["Last Dev Session",i.selectedInterAgent.lastSessionLabel??"Not reported"],["Last Code Change",i.selectedInterAgent.lastCodeChangeLabel??"Not reported"]].map(([p,h])=>l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.styles.mutedText,children:p}),l.jsx("div",{className:"text-[11px] leading-[1.45] break-words",style:r.styles.inkText,children:h})]},p))})})})]})})]}):l.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[l.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:l.jsx($i,{size:24,style:{color:g.accent}})}),l.jsx("h3",{className:"text-[15px] font-medium mb-1",style:r.styles.inkText,children:"No agent selected"}),l.jsx("p",{className:"text-[13px] max-w-sm",style:r.styles.mutedText,children:"Pick an agent from the left rail to inspect its profile, runtime binding, and recent communication."})]})})]})]})}if(e==="logs")return l.jsxs(l.Fragment,{children:[!r.isCollapsed&&l.jsxs("div",{style:{width:r.sidebarWidth,...r.styles.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[l.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:r.onResizeStart}),l.jsx("div",{className:"px-4 h-14 flex items-center border-b",style:{borderBottomColor:g.border},children:l.jsxs("div",{children:[l.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:r.styles.inkText,children:"Logs"}),l.jsxs("div",{className:"text-[10px] font-mono mt-0.5",style:r.styles.mutedText,children:[o.logSources.length," sources"]})]})}),l.jsx("div",{className:"px-3 py-3 border-b",style:{borderBottomColor:g.border},children:l.jsx("input",{type:"text",value:o.logSourceQuery,onChange:f=>o.setLogSourceQuery(f.target.value),placeholder:"Filter sources…",className:"w-full rounded-lg border px-3 py-2 text-[11px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}})}),l.jsx("div",{className:"flex-1 overflow-y-auto py-3",children:o.logSources.length===0?l.jsxs("div",{className:"px-4 py-6 text-center",children:[l.jsxs("div",{className:"flex justify-center gap-1 mb-2",children:[l.jsx("span",{className:"os-thinking-dot",style:{color:g.accent}}),l.jsx("span",{className:"os-thinking-dot",style:{color:g.accent}}),l.jsx("span",{className:"os-thinking-dot",style:{color:g.accent}})]}),l.jsx("div",{className:"text-[11px]",style:r.styles.mutedText,children:"Loading sources…"})]}):["runtime","app","agents"].map(f=>{const p=o.filteredLogSources.filter(y=>y.group===f);if(p.length===0)return null;const h=f==="runtime"?"Runtime":f==="app"?"App":"Agents";return l.jsxs("div",{className:"mb-3 px-2",children:[l.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1.5 px-2",style:r.styles.mutedText,children:h}),l.jsx("div",{className:"flex flex-col gap-px",children:p.map(y=>{const b=o.selectedLogSourceId===y.id;return l.jsxs("button",{onClick:()=>{o.setSelectedLogSourceId(y.id),o.setLogSearchQuery("")},className:"w-full text-left px-2 py-2 rounded transition-opacity hover:opacity-90",style:b?r.styles.activeItem:r.styles.mutedText,children:[l.jsx("div",{className:"text-[12px] font-medium truncate",style:r.styles.inkText,children:y.title}),l.jsx("div",{className:"text-[10px] truncate mt-0.5",style:r.styles.mutedText,children:y.subtitle})]},y.id)})})]},f)})})]}),l.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:r.styles.surface,children:[l.jsx("div",{className:"border-b flex items-center justify-between px-4 h-14 shrink-0 gap-4",style:{...r.styles.surface,borderBottomColor:g.border},children:l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(No,{size:14,style:r.styles.mutedText}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[13px] font-semibold tracking-tight truncate",style:r.styles.inkText,children:o.selectedLogSource?.title??"Logs"}),l.jsx("div",{className:"text-[10px] truncate mt-0.5",style:r.styles.mutedText,children:o.logContent?.updatedAtLabel?`${o.selectedLogSource?.subtitle??"Log tail"} · Updated ${o.logContent.updatedAtLabel}`:o.selectedLogSource?.subtitle??"Relay runtime, app, and relay agent logs."})]})]})}),l.jsxs("div",{className:"border-b px-4 py-3 flex items-center gap-3",style:{borderBottomColor:g.border},children:[l.jsx("input",{type:"text",value:o.logSearchQuery,onChange:f=>o.setLogSearchQuery(f.target.value),placeholder:"Filter visible lines…",className:"flex-1 rounded-lg border px-3 py-2 text-[11px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}),l.jsx("div",{className:"text-[10px] font-mono shrink-0",style:r.styles.mutedText,children:o.logContent?o.logContent.truncated?`Tail ${o.logContent.lineCount} lines`:`${o.logContent.lineCount} lines`:"No file"})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4",children:[o.selectedLogSource?l.jsx(U1,{title:o.selectedLogSource.title,pathLabel:o.logContent?.pathLabel??o.selectedLogSource.pathLabel,body:o.logContent?.body??null,truncated:o.logContent?.truncated,lineCount:o.logContent?.lineCount,missing:o.logContent?.missing,loading:o.logsLoading,searchQuery:o.logSearchQuery,updatedAtLabel:o.logContent?.updatedAtLabel,minHeight:360}):l.jsx("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:o.logCatalog?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:l.jsx(No,{size:24,style:{color:g.accent}})}),l.jsx("h3",{className:"text-[15px] font-medium mb-1",style:r.styles.inkText,children:"No log selected"}),l.jsx("p",{className:"text-[13px] max-w-sm",style:r.styles.mutedText,children:"Pick a relay runtime, app, or relay agent source from the left rail."})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex justify-center gap-1 mb-3",children:[l.jsx("span",{className:"os-thinking-dot",style:{color:g.accent}}),l.jsx("span",{className:"os-thinking-dot",style:{color:g.accent}}),l.jsx("span",{className:"os-thinking-dot",style:{color:g.accent}})]}),l.jsx("p",{className:"text-[13px]",style:r.styles.mutedText,children:"Loading log sources…"})]})}),o.logsFeedback?l.jsx("div",{className:"text-[11px] leading-[1.5] mt-3",style:r.styles.inkText,children:o.logsFeedback}):null]}),l.jsx("div",{className:"h-7 border-t flex items-center justify-between px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:l.jsx("span",{className:"text-[9px] font-mono",style:r.styles.mutedText,children:"Canonical relay runtime, app, and relay agent log tails"})})]})]});if(e==="inter-agent"){const f=a.rosterInterAgentAgents.length===a.interAgentAgents.length?a.interAgentStateSubtitle:`${a.rosterInterAgentAgents.length} visible · ${a.interAgentStateSubtitle}`;return l.jsxs(l.Fragment,{children:[l.jsx(Wy,{title:a.interAgentStateTitle,subtitle:f,layout:r,roster:a}),l.jsxs("div",{className:"w-[336px] border-r shrink-0 overflow-hidden flex flex-col",style:{...r.styles.surface,borderRightColor:g.border},children:[l.jsxs("div",{className:"px-4 h-14 border-b flex flex-col justify-center",style:{borderBottomColor:g.border},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:r.styles.mutedText,children:"Agent Threads"}),l.jsx("div",{className:"text-[12px] mt-1",style:r.styles.inkText,children:u.selectedInterAgent?`${u.selectedInterAgent.title} · ${u.visibleInterAgentThreads.length} thread${u.visibleInterAgentThreads.length===1?"":"s"}`:"Select an agent"})]}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:u.selectedInterAgent&&u.visibleInterAgentThreads.length>0?l.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:u.visibleInterAgentThreads.map(p=>{const h=u.selectedInterAgentThreadId===p.id;return l.jsxs("button",{onClick:()=>u.setSelectedInterAgentThreadId(p.id),className:"w-full text-left px-4 py-3.5 transition-opacity hover:opacity-90",style:h?{backgroundColor:g.bg}:void 0,children:[l.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1.5",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[12px] font-medium truncate",style:r.styles.inkText,children:ep(p,u.selectedInterAgent.id)}),l.jsx("div",{className:"mt-1",children:l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:p.sourceKind==="private"?r.styles.tagBadge:r.styles.activePill,children:p.sourceKind==="private"?"Private":"Relay"})})]}),l.jsx("span",{className:"text-[10px] font-mono shrink-0",style:r.styles.mutedText,children:p.timestampLabel??""})]}),l.jsx("div",{className:"text-[10px] mb-1.5 truncate",style:r.styles.mutedText,children:tp(p,u.selectedInterAgent.id)}),l.jsx("div",{className:"text-[12px] leading-[1.45] line-clamp-2",style:r.styles.mutedText,children:p.preview??"No message preview yet."})]},p.id)})}):l.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center",children:l.jsxs("div",{children:[l.jsx("div",{className:"w-14 h-14 rounded-full mx-auto mb-4 flex items-center justify-center",style:{backgroundColor:g.accentBg},children:l.jsx(Ki,{size:22,style:{color:g.accent}})}),l.jsx("div",{className:"text-[14px] font-medium mb-1",style:r.styles.inkText,children:"No agent threads"}),l.jsx("div",{className:"text-[12px]",style:r.styles.mutedText,children:u.selectedInterAgent?`No inter-agent traffic for ${u.selectedInterAgent.title} yet.`:"Pick an agent to inspect its thread network."})]})})})]}),l.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:r.styles.surface,children:[l.jsxs("div",{className:"border-b flex items-center justify-between px-4 h-14 shrink-0 gap-4",style:{...r.styles.surface,borderBottomColor:g.border},children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(Ki,{size:14,style:r.styles.mutedText}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx("h2",{className:"text-[13px] font-semibold tracking-tight truncate",style:r.styles.inkText,children:u.interAgentThreadTitle}),u.selectedInterAgentThread?l.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded shrink-0",style:u.selectedInterAgentThread.sourceKind==="private"?r.styles.tagBadge:r.styles.activePill,children:u.selectedInterAgentThread.sourceKind==="private"?"Private":"Relay"}):null,u.selectedInterAgentThread?l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:r.styles.tagBadge,children:u.selectedInterAgentThread.messageCount}):null]}),l.jsx("div",{className:"text-[10px] truncate mt-0.5",style:r.styles.mutedText,children:u.selectedInterAgentThreadSubtitle})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[u.selectedRelayDirectThread?l.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>u.onOpenAgentProfile(u.selectedRelayDirectThread.id),children:[l.jsx($i,{size:11}),l.jsx("span",{children:"Agent"})]}):null,l.jsxs("button",{onClick:()=>u.setShowAnnotations(!u.showAnnotations),className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:u.showAnnotations?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},children:["Annotations ",l.jsx("span",{className:"font-mono uppercase",children:u.showAnnotations?"On":"Off"})]}),u.interAgentMessageTarget?l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>u.openAgentDirectMessage(u.interAgentMessageTarget.id),title:`Open direct chat with ${u.interAgentMessageTarget.title}`,children:"Message"}):null,u.interAgentConfigureTarget?l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>u.onOpenAgentSettings(u.interAgentConfigureTarget.id,u.interAgentConfigureTarget.profileKind==="project"),title:u.interAgentConfigureTarget.profileKind==="project"?`Configure ${u.interAgentConfigureTarget.title}`:`Open ${u.interAgentConfigureTarget.title} profile`,children:u.interAgentConfigureLabel}):null]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-3 pb-6",children:u.selectedInterAgent?u.selectedInterAgentThread?u.visibleInterAgentMessages.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[l.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:l.jsx(Al,{size:24,style:{color:g.accent}})}),l.jsx("h3",{className:"text-[15px] font-medium mb-1",style:r.styles.inkText,children:"Thread is quiet"}),l.jsx("p",{className:"text-[13px] max-w-sm",style:r.styles.mutedText,children:"This agent thread exists, but there are no visible messages in it yet."})]}):l.jsx("div",{className:"flex flex-col gap-1",children:l.jsx(ko,{messages:u.visibleInterAgentMessages,showAnnotations:u.showAnnotations,showStatusMessages:!1,inkStyle:r.styles.inkText,mutedStyle:r.styles.mutedText,tagStyle:r.styles.tagBadge,annotStyle:r.styles.annotBadge,agentLookup:u.interAgentAgentLookup,directThreadLookup:u.relayDirectLookup,onOpenAgentProfile:u.onOpenAgentProfile,onOpenAgentChat:u.openAgentDirectMessage,onNudgeMessage:u.onNudgeMessage})}):l.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[l.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:l.jsx(Al,{size:24,style:{color:g.accent}})}),l.jsx("h3",{className:"text-[15px] font-medium mb-1",style:r.styles.inkText,children:"No thread selected"}),l.jsxs("p",{className:"text-[13px] max-w-sm",style:r.styles.mutedText,children:["Pick one of ",u.selectedInterAgent.title,"'s agent threads to read it."]})]}):l.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[l.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:l.jsx(Ki,{size:24,style:{color:g.accent}})}),l.jsx("h3",{className:"text-[15px] font-medium mb-1",style:r.styles.inkText,children:"No agent selected"}),l.jsx("p",{className:"text-[13px] max-w-sm",style:r.styles.mutedText,children:"Choose an agent from the left rail to inspect their traffic with other agents."})]})}),l.jsx("div",{className:"h-7 border-t flex items-center px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:l.jsx("span",{className:"text-[9px] font-mono",style:r.styles.mutedText,children:"Read-only monitor over inter-agent traffic"})})]})]})}return e!=="sessions"?null:l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:r.styles.surface,children:[l.jsxs("div",{className:"h-10 border-b flex items-center justify-between px-4 shrink-0",style:{...r.styles.surface,borderBottomColor:g.border},children:[l.jsxs("div",{className:"flex items-center gap-4 min-w-0 flex-1",children:[l.jsxs("div",{className:"min-w-0 shrink-0",children:[l.jsx("div",{className:"text-[13px] font-semibold tracking-tight",style:r.styles.inkText,children:"Sessions"}),l.jsx("div",{className:"text-[10px] font-mono mt-0.5",style:r.styles.mutedText,children:d.searchQuery?`${d.filteredSessions.length} results`:`${d.stats.totalSessions} total`})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[l.jsx(wo,{size:14,style:r.styles.mutedText}),l.jsx("input",{type:"text",placeholder:"Search sessions by title, content, tags, or agent...",value:d.searchQuery,onChange:f=>d.setSearchQuery(f.target.value),className:"flex-1 bg-transparent border-none outline-none text-[12px]",style:{color:g.ink}}),d.searchQuery?l.jsx("button",{onClick:()=>d.setSearchQuery(""),className:"hover:opacity-70",style:r.styles.mutedText,children:l.jsx(kl,{size:14})}):null]})]}),l.jsx("div",{className:"flex items-center gap-2 shrink-0",children:l.jsx("button",{className:"p-1.5 rounded transition-opacity hover:opacity-70",style:r.styles.mutedText,onClick:d.onRefresh,children:l.jsx(xn,{size:14})})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:d.loadingSessions?l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsxs("div",{className:"flex flex-col items-center gap-3",children:[l.jsx(un,{className:"text-[28px]",style:{color:g.accent}}),l.jsx("span",{className:"text-[13px]",style:r.styles.mutedText,children:"Loading broker workspace…"})]})}):d.filteredSessions.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[l.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:l.jsx(da,{size:24,style:{color:g.accent}})}),l.jsx("h3",{className:"text-[15px] font-medium mb-1",style:r.styles.inkText,children:"No sessions found"}),l.jsx("p",{className:"text-[13px] max-w-sm",style:r.styles.mutedText,children:d.searchQuery?"Try adjusting your search query":"No conversations are in the broker yet."})]}):l.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:d.filteredSessions.map(f=>l.jsxs("button",{onClick:()=>d.setSelectedSession(f),draggable:!0,onDragStart:()=>{d.setDraggedSessionId(f.id),d.setDraggedPhoneSection(null)},onDragEnd:()=>{d.setDraggedSessionId(null),d.setDraggedPhoneSection(null)},className:"w-full text-left px-4 py-3 transition-opacity hover:opacity-90",style:d.selectedSession?.id===f.id?{backgroundColor:g.bg}:void 0,children:[l.jsxs("div",{className:"flex items-start justify-between mb-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-5 h-5 rounded text-white flex items-center justify-center text-[9px] font-bold",style:{backgroundColor:cl(f.agent)},children:f.agent.charAt(0)}),l.jsx("span",{className:"text-[13px] font-medium line-clamp-1",style:r.styles.inkText,children:f.title}),d.phonePreparationState.favorites.includes(f.id)?l.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[9px] font-medium",style:{backgroundColor:g.accentBg,color:g.accent},children:[l.jsx(jb,{size:9}),"Fav"]}):null,!d.phonePreparationState.favorites.includes(f.id)&&d.phonePreparationState.quickHits.includes(f.id)?l.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[9px] font-medium",style:{backgroundColor:g.tagBg,color:g.ink},children:[l.jsx(L2,{size:9}),"My List"]}):null]}),l.jsx("span",{className:"text-[10px] font-mono shrink-0 ml-2",style:r.styles.mutedText,children:d.formatDate(f.lastModified)})]}),l.jsxs("div",{className:"flex items-center gap-2 mb-1.5 pl-7",children:[l.jsx("span",{className:"text-[10px] font-mono",style:r.styles.mutedText,children:f.project}),l.jsx("span",{className:"w-px h-3",style:{backgroundColor:g.border}}),l.jsxs("span",{className:"text-[10px]",style:r.styles.mutedText,children:[f.messageCount," messages"]}),f.tokens?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-px h-3",style:{backgroundColor:g.border}}),l.jsxs("span",{className:"text-[10px]",style:r.styles.mutedText,children:[(f.tokens/1e3).toFixed(1),"k tokens"]})]}):null]}),l.jsx("p",{className:"text-[12px] line-clamp-1 pl-7",style:r.styles.mutedText,children:f.preview}),f.tags&&f.tags.length>0?l.jsxs("div",{className:"flex items-center gap-1.5 mt-2 pl-7",children:[f.tags.slice(0,3).map(p=>l.jsx("span",{className:"text-[9px] font-mono border px-1.5 py-0.5 rounded",style:r.styles.tagBadge,children:p},p)),f.tags.length>3?l.jsxs("span",{className:"text-[9px]",style:r.styles.mutedText,children:["+",f.tags.length-3]}):null]}):null]},f.id))})}),l.jsxs("div",{className:"h-7 border-t flex items-center justify-between px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:[l.jsx("span",{className:"text-[9px] font-mono",style:r.styles.mutedText,children:"Drag sessions into My List or click one for quick actions."}),l.jsx("span",{className:"text-[9px] font-mono uppercase tracking-widest",style:r.styles.mutedText,children:"Index Ready"})]})]}),l.jsxs("div",{className:"w-80 border-l shrink-0 overflow-y-auto flex flex-col",style:{...r.styles.surface,borderLeftColor:g.border},children:[l.jsx("div",{className:"px-4 py-3 border-b",style:{borderBottomColor:g.border},children:l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:r.styles.mutedText,children:"My List"}),l.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:"My List first, then browse and search."})]}),l.jsx("button",{type:"button",onClick:d.onClearPhoneQuickHits,disabled:d.phonePreparationSaving||d.phonePreparationState.quickHits.length===0,className:"rounded px-2 py-1 text-[10px] font-medium transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:g.bg,color:g.ink,border:`1px solid ${g.border}`},children:"Clear"})]})}),l.jsx("div",{className:"p-4 flex-1 flex flex-col gap-4",children:d.phonePreparationLoading?l.jsxs("div",{className:"flex items-center gap-2 text-[12px]",style:r.styles.mutedText,children:[l.jsx(un,{className:"text-[12px]"}),"Loading list…"]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"rounded-lg border p-3",style:{borderColor:g.border,backgroundColor:g.bg},onDragOver:f=>f.preventDefault(),onDrop:f=>{f.preventDefault(),d.onDropIntoFavorites()},children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(jb,{size:12,style:{color:g.accent}}),l.jsx("div",{className:"text-[11px] font-semibold",style:r.styles.inkText,children:"Favorites"})]}),l.jsx("div",{className:"text-[10px] font-mono",style:r.styles.mutedText,children:d.favoritePhoneSessions.length})]}),d.favoritePhoneSessions.length===0?l.jsx("div",{className:"rounded border border-dashed px-3 py-4 text-[11px]",style:{borderColor:g.border,color:g.muted},children:"Drop sessions here to keep them pinned in your list."}):l.jsx("div",{className:"flex flex-col gap-2",children:d.favoritePhoneSessions.map(f=>l.jsx("div",{draggable:!0,onDragStart:()=>{d.setDraggedSessionId(f.id),d.setDraggedPhoneSection("favorites")},onDragEnd:()=>{d.setDraggedSessionId(null),d.setDraggedPhoneSection(null)},className:"rounded border px-3 py-2",style:{borderColor:g.border,backgroundColor:g.surface},children:l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[12px] font-medium line-clamp-1",style:r.styles.inkText,children:f.title}),l.jsxs("div",{className:"text-[10px] mt-1",style:r.styles.mutedText,children:[f.project," · ",d.formatDate(f.lastModified)]})]}),l.jsx("button",{type:"button",onClick:()=>d.onRemoveSessionFromPhoneSection(f.id,"favorites"),className:"text-[10px] hover:opacity-70",style:r.styles.mutedText,children:l.jsx(kl,{size:12})})]})},`favorite-${f.id}`))})]}),l.jsxs("div",{className:"rounded-lg border p-3",style:{borderColor:g.border,backgroundColor:g.bg},onDragOver:f=>f.preventDefault(),onDrop:f=>{f.preventDefault(),d.onDropIntoQuickHits()},children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(j1,{size:12,style:{color:g.accent}}),l.jsx("div",{className:"text-[11px] font-semibold",style:r.styles.inkText,children:"My List"})]}),l.jsx("div",{className:"text-[10px] font-mono",style:r.styles.mutedText,children:d.quickHitPhoneSessions.length})]}),d.quickHitPhoneSessions.length===0?l.jsx("div",{className:"rounded border border-dashed px-3 py-4 text-[11px]",style:{borderColor:g.border,color:g.muted},children:"Drag sessions here and order them however you want."}):l.jsx("div",{className:"flex flex-col gap-2",children:d.quickHitPhoneSessions.map((f,p)=>l.jsx("div",{draggable:!0,onDragStart:()=>{d.setDraggedSessionId(f.id),d.setDraggedPhoneSection("quickHits")},onDragEnd:()=>{d.setDraggedSessionId(null),d.setDraggedPhoneSection(null)},onDragOver:h=>h.preventDefault(),onDrop:h=>{h.preventDefault(),d.onDropIntoQuickHits(p)},className:"rounded border px-3 py-2",style:{borderColor:g.border,backgroundColor:g.surface},children:l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"text-[11px] font-mono mb-1",style:r.styles.mutedText,children:["#",p+1]}),l.jsx("div",{className:"text-[12px] font-medium line-clamp-1",style:r.styles.inkText,children:f.title}),l.jsxs("div",{className:"text-[10px] mt-1",style:r.styles.mutedText,children:[f.project," · ",d.formatDate(f.lastModified)]})]}),l.jsx("button",{type:"button",onClick:()=>d.onRemoveSessionFromPhoneSection(f.id,"quickHits"),className:"text-[10px] hover:opacity-70",style:r.styles.mutedText,children:l.jsx(kl,{size:12})})]})},`quick-hit-${f.id}`))})]}),d.phonePreparationFeedback?l.jsx("div",{className:"rounded border px-3 py-2 text-[11px]",style:{borderColor:g.border,backgroundColor:g.surface,color:g.ink},children:d.phonePreparationFeedback}):null,l.jsxs("div",{className:"rounded-lg border p-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-2",style:r.styles.mutedText,children:"Selected Session"}),d.selectedSession?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx("div",{className:"w-8 h-8 rounded text-white flex items-center justify-center text-[12px] font-bold",style:{backgroundColor:cl(d.selectedSession.agent)},children:d.selectedSession.agent.charAt(0)}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[12px] font-medium line-clamp-1",style:r.styles.inkText,children:d.selectedSession.title}),l.jsxs("div",{className:"text-[10px]",style:r.styles.mutedText,children:[d.selectedSession.project," · ",d.selectedSession.messageCount," messages"]})]})]}),l.jsx("p",{className:"text-[11px] leading-relaxed mb-3",style:r.styles.mutedText,children:d.selectedSession.preview}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{type:"button",onClick:()=>d.onAddSessionToPhoneSection(d.selectedSession.id,"favorites"),disabled:d.phonePreparationSaving||d.phonePreparationState.favorites.includes(d.selectedSession.id),className:"flex-1 rounded px-3 py-2 text-[11px] font-medium transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:g.accentBg,color:g.accent},children:d.phonePreparationState.favorites.includes(d.selectedSession.id)?"Pinned":"Add to Favorites"}),l.jsx("button",{type:"button",onClick:()=>d.onAddSessionToPhoneSection(d.selectedSession.id,"quickHits"),disabled:d.phonePreparationSaving||d.phonePreparationState.quickHits.includes(d.selectedSession.id)||d.phonePreparationState.favorites.includes(d.selectedSession.id),className:"flex-1 rounded px-3 py-2 text-[11px] font-medium transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:g.surface,color:g.ink,border:`1px solid ${g.border}`},children:d.phonePreparationState.quickHits.includes(d.selectedSession.id)||d.phonePreparationState.favorites.includes(d.selectedSession.id)?"Already Added":"Add to My List"})]})]}):l.jsx("div",{className:"text-[11px]",style:r.styles.mutedText,children:"Select a session to pin it or add it to My List."})]})]})})]})]})}const xu=[{label:"Connecting relay service"},{label:"Loading agent availability"},{label:"Loading activity history"}];function zM(e){return e===0?420:195+Math.min(e,5)*12}const OM="11rem",Jy="w-[3.25rem]";function LM({color:e}){const r="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8";return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 14 32 4",preserveAspectRatio:"none",className:"h-[6px] w-[3.25rem] shrink-0 overflow-visible",style:{color:e},"aria-hidden":!0,children:[l.jsx("path",{opacity:.8,fill:"currentColor",d:"M2 14 V18 H6 V14z",children:l.jsx("animateTransform",{attributeName:"transform",type:"translate",values:"0 0; 24 0; 0 0",dur:"2s",begin:"0s",repeatCount:"indefinite",keySplines:r,calcMode:"spline"})}),l.jsx("path",{opacity:.5,fill:"currentColor",d:"M0 14 V18 H8 V14z",children:l.jsx("animateTransform",{attributeName:"transform",type:"translate",values:"0 0; 24 0; 0 0",dur:"2s",begin:"0.1s",repeatCount:"indefinite",keySplines:r,calcMode:"spline"})}),l.jsx("path",{opacity:.25,fill:"currentColor",d:"M0 14 V18 H8 V14z",children:l.jsx("animateTransform",{attributeName:"transform",type:"translate",values:"0 0; 24 0; 0 0",dur:"2s",begin:"0.2s",repeatCount:"indefinite",keySplines:r,calcMode:"spline"})})]})}function e1({dark:e,C:r,s:a}){const[i,o]=z.useState(0);z.useEffect(()=>{if(i>=xu.length)return;const y=zM(i),b=setTimeout(()=>o(v=>v+1),y);return()=>clearTimeout(b)},[i]);const u=i>=xu.length,d=e?"rgba(241,245,249,0.92)":"rgba(15,23,42,0.82)",f=e?"rgba(255,255,255,0.08)":"rgba(15,23,42,0.06)",p=e?"rgba(255,255,255,0.14)":"rgba(15,23,42,0.08)",h=e?"rgba(255,255,255,0.05)":"rgba(15,23,42,0.035)";return l.jsxs("div",{className:"w-full max-w-[440px] os-fade-up",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsx("img",{src:"/scout-icon.png",alt:"Scout",className:"w-9 h-9 rounded-lg shrink-0",style:{boxShadow:`0 2px 8px ${e?"rgba(0,0,0,0.4)":"rgba(15,23,42,0.08)"}`}}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[15px] font-semibold tracking-tight",style:a.inkText,children:"Scout"}),l.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em]",style:a.mutedText,children:"Initializing"})]})]}),l.jsx("div",{className:"rounded-lg border overflow-hidden font-mono text-[11px] leading-[1.7] flex flex-col",style:{borderColor:r.border,backgroundColor:r.termBg,color:r.termFg,minHeight:OM},children:l.jsx("div",{className:"flex flex-col flex-1 px-4 py-3 min-h-0",children:l.jsx("div",{className:"space-y-2 shrink-0",children:xu.map((y,b)=>{const v=b<i,j=b===i-1&&!u;return l.jsxs("div",{className:"os-boot-line flex items-center justify-between gap-3 min-h-[1.9em] rounded-md px-2",style:{backgroundColor:v?e?"rgba(255,255,255,0.04)":"rgba(15,23,42,0.035)":"transparent",opacity:v?1:.38},children:[l.jsx("div",{className:"min-w-0 flex items-center gap-3",children:l.jsx("span",{className:"os-boot-line-text min-w-0 truncate",style:{color:r.termFg,opacity:j?1:v?.72:.45},children:y.label})}),l.jsx("div",{className:"shrink-0 min-w-[1.25rem] flex justify-end",children:v?l.jsx("span",{className:"os-boot-prompt inline-flex h-5 min-w-5 items-center justify-center rounded-full border px-1.5 text-[12px] font-semibold leading-none",style:{color:j?r.accent:d,backgroundColor:j?h:f,borderColor:j?"transparent":p,opacity:j?1:.95},"aria-hidden":!0,children:j?"…":"✓"}):null})]},y.label)})})})}),l.jsxs("div",{className:"relative mt-5 h-5",children:[l.jsxs("div",{className:"os-boot-footer-track absolute inset-x-3 top-0 bottom-0 flex items-center gap-3 min-w-0",style:{opacity:u?0:1,transform:u?"translateY(2px)":"translateY(0)",pointerEvents:u?"none":"auto"},children:[l.jsx("div",{className:`${Jy} shrink-0`,"aria-hidden":!0}),l.jsxs("span",{className:"text-[10px] font-mono tabular-nums tracking-tight leading-none",style:a.mutedText,children:[i," of ",xu.length]})]}),l.jsxs("div",{className:"os-boot-footer-track absolute inset-x-3 top-0 bottom-0 flex items-center gap-3 min-w-0",style:{opacity:u?1:0,transform:u?"translateY(0)":"translateY(-2px)",pointerEvents:u?"auto":"none"},children:[l.jsxs("div",{className:`os-boot-footer-lead ${Jy} shrink-0 flex items-center justify-center`,"aria-hidden":!0,children:[l.jsx("div",{className:"os-boot-wait-wave-wrap",children:l.jsx(LM,{color:r.accent})}),l.jsx("div",{className:"os-boot-wait-static-row",children:[.8,.5,.25].map((y,b)=>l.jsx("span",{className:"w-[3px] h-1 rounded-[1px]",style:{backgroundColor:r.accent,opacity:y}},b))})]}),l.jsx("span",{className:"text-[10px] font-mono tracking-tight leading-none truncate",style:a.mutedText,children:"Finishing up"})]})]})]})}const rt={getAppInfo:"scout:get-app-info",getServicesState:"scout:get-services-state",getHomeState:"scout:get-home-state",getMessagesWorkspaceState:"scout:get-messages-workspace-state",getRelayShellPatch:"scout:get-relay-shell-patch",getShellState:"scout:get-shell-state",refreshRelayShellPatch:"scout:refresh-relay-shell-patch",refreshShellState:"scout:refresh-shell-state",getAppSettings:"scout:get-app-settings",refreshSettingsInventory:"scout:refresh-settings-inventory",updateAppSettings:"scout:update-app-settings",retireProject:"scout:retire-project",restoreProject:"scout:restore-project",runOnboardingCommand:"scout:run-onboarding-command",skipOnboarding:"scout:skip-onboarding",restartOnboarding:"scout:restart-onboarding",getAgentConfig:"scout:get-agent-config",updateAgentConfig:"scout:update-agent-config",createAgent:"scout:create-agent",pickDirectory:"scout:pick-directory",reloadApp:"scout:reload-app",quitApp:"scout:quit-app",revealPath:"scout:reveal-path",getPhonePreparation:"scout:get-phone-preparation",updatePhonePreparation:"scout:update-phone-preparation",getPairingState:"scout:get-pairing-state",refreshPairingState:"scout:refresh-pairing-state",controlPairingService:"scout:control-pairing-service",updatePairingConfig:"scout:update-pairing-config",decidePairingApproval:"scout:decide-pairing-approval",restartAgent:"scout:restart-agent",sendRelayMessage:"scout:send-relay-message",controlBroker:"scout:control-broker",getKeepAliveState:"scout:get-keep-alive-state",acquireKeepAliveLease:"scout:acquire-keep-alive-lease",releaseKeepAliveLease:"scout:release-keep-alive-lease",getAgentSession:"scout:get-agent-session",openAgentSession:"scout:open-agent-session",toggleVoiceCapture:"scout:toggle-voice-capture",setVoiceRepliesEnabled:"scout:set-voice-replies-enabled",getLogCatalog:"scout:get-log-catalog",getBrokerInspector:"scout:get-broker-inspector",getFeedbackBundle:"scout:get-feedback-bundle",submitFeedbackReport:"scout:submit-feedback-report",readLogSource:"scout:read-log-source"};function DM(e){return{isDesktop:!0,getAppInfo:()=>e(rt.getAppInfo),getServicesState:()=>e(rt.getServicesState),getHomeState:()=>e(rt.getHomeState),getMessagesWorkspaceState:()=>e(rt.getMessagesWorkspaceState),getRelayShellPatch:()=>e(rt.getRelayShellPatch),getShellState:()=>e(rt.getShellState),refreshRelayShellPatch:()=>e(rt.refreshRelayShellPatch),refreshShellState:()=>e(rt.refreshShellState),getAppSettings:()=>e(rt.getAppSettings),refreshSettingsInventory:()=>e(rt.refreshSettingsInventory),updateAppSettings:r=>e(rt.updateAppSettings,r),retireProject:r=>e(rt.retireProject,r),restoreProject:r=>e(rt.restoreProject,r),runOnboardingCommand:r=>e(rt.runOnboardingCommand,r),skipOnboarding:()=>e(rt.skipOnboarding),restartOnboarding:()=>e(rt.restartOnboarding),getAgentConfig:r=>e(rt.getAgentConfig,r),updateAgentConfig:r=>e(rt.updateAgentConfig,r),createAgent:r=>e(rt.createAgent,r),pickDirectory:()=>e(rt.pickDirectory),reloadApp:()=>e(rt.reloadApp),quitApp:()=>e(rt.quitApp),revealPath:r=>e(rt.revealPath,r),getPhonePreparation:()=>e(rt.getPhonePreparation),updatePhonePreparation:r=>e(rt.updatePhonePreparation,r),getPairingState:()=>e(rt.getPairingState),refreshPairingState:()=>e(rt.refreshPairingState),controlPairingService:r=>e(rt.controlPairingService,r),updatePairingConfig:r=>e(rt.updatePairingConfig,r),decidePairingApproval:r=>e(rt.decidePairingApproval,r),restartAgent:r=>e(rt.restartAgent,r),sendRelayMessage:r=>e(rt.sendRelayMessage,r),controlBroker:r=>e(rt.controlBroker,r),getKeepAliveState:()=>e(rt.getKeepAliveState),acquireKeepAliveLease:r=>e(rt.acquireKeepAliveLease,r),releaseKeepAliveLease:r=>e(rt.releaseKeepAliveLease,r),getAgentSession:r=>e(rt.getAgentSession,r),openAgentSession:r=>e(rt.openAgentSession,r),toggleVoiceCapture:()=>e(rt.toggleVoiceCapture),setVoiceRepliesEnabled:r=>e(rt.setVoiceRepliesEnabled,r),getLogCatalog:()=>e(rt.getLogCatalog),getBrokerInspector:()=>e(rt.getBrokerInspector),getFeedbackBundle:()=>e(rt.getFeedbackBundle),submitFeedbackReport:r=>e(rt.submitFeedbackReport,r),readLogSource:r=>e(rt.readLogSource,r)}}const _M={"scout:get-app-info":{method:"GET",path:"/api/app"},"scout:get-services-state":{method:"GET",path:"/api/services"},"scout:get-home-state":{method:"GET",path:"/api/home"},"scout:get-messages-workspace-state":{method:"GET",path:"/api/messages-workspace"},"scout:get-relay-shell-patch":{method:"GET",path:"/api/relay-shell-patch"},"scout:get-shell-state":{method:"GET",path:"/api/shell-state"},"scout:refresh-relay-shell-patch":{method:"GET",path:"/api/relay-shell-patch/refresh"},"scout:refresh-shell-state":{method:"GET",path:"/api/shell-state/refresh"},"scout:get-app-settings":{method:"GET",path:"/api/app-settings"},"scout:refresh-settings-inventory":{method:"GET",path:"/api/app-settings/refresh"},"scout:update-app-settings":{method:"POST",path:"/api/app-settings"},"scout:retire-project":{method:"POST",path:"/api/retire-project"},"scout:restore-project":{method:"POST",path:"/api/restore-project"},"scout:run-onboarding-command":{method:"POST",path:"/api/onboarding/run"},"scout:skip-onboarding":{method:"POST",path:"/api/onboarding/skip"},"scout:restart-onboarding":{method:"POST",path:"/api/onboarding/restart"},"scout:get-agent-config":{method:"GET",path:e=>`/api/agent-config/${e[0]}`},"scout:update-agent-config":{method:"POST",path:"/api/agent-config"},"scout:create-agent":{method:"POST",path:"/api/agent/create"},"scout:pick-directory":{method:"GET",path:"/api/pick-directory"},"scout:quit-app":{method:"POST",path:"/api/quit"},"scout:reveal-path":{method:"POST",path:"/api/reveal-path"},"scout:get-phone-preparation":{method:"GET",path:"/api/phone-preparation"},"scout:update-phone-preparation":{method:"POST",path:"/api/phone-preparation"},"scout:get-pairing-state":{method:"GET",path:"/api/pairing-state"},"scout:refresh-pairing-state":{method:"GET",path:"/api/pairing-state/refresh"},"scout:control-pairing-service":{method:"POST",path:"/api/pairing/control"},"scout:update-pairing-config":{method:"POST",path:"/api/pairing/config"},"scout:restart-agent":{method:"POST",path:"/api/agent/restart"},"scout:send-relay-message":{method:"POST",path:"/api/relay/send"},"scout:control-broker":{method:"POST",path:"/api/broker/control"},"scout:get-keep-alive-state":{method:"GET",path:"/api/keep-alive"},"scout:acquire-keep-alive-lease":{method:"POST",path:"/api/keep-alive/acquire"},"scout:release-keep-alive-lease":{method:"POST",path:"/api/keep-alive/release"},"scout:get-agent-session":{method:"GET",path:e=>`/api/agent-session/${e[0]}`},"scout:open-agent-session":{method:"POST",path:e=>`/api/agent-session/${e[0]}/open`},"scout:toggle-voice-capture":{method:"POST",path:"/api/voice/toggle-capture"},"scout:set-voice-replies-enabled":{method:"POST",path:"/api/voice/replies"},"scout:get-log-catalog":{method:"GET",path:"/api/log-catalog"},"scout:get-broker-inspector":{method:"GET",path:"/api/broker-inspector"},"scout:get-feedback-bundle":{method:"GET",path:"/api/feedback-bundle"},"scout:submit-feedback-report":{method:"POST",path:"/api/feedback-report"},"scout:read-log-source":{method:"POST",path:"/api/log-source"}};function BM(){return typeof window<"u"&&window.location.origin?window.location.origin:"http://localhost:3200"}async function t1(e,r){const a=await e.text();if(!e.ok){let i=a.trim()||`HTTP ${e.status}`;if(a.length>0)try{const o=JSON.parse(a);typeof o.error=="string"&&o.error.trim()&&(i=o.detail?`${o.error}: ${o.detail}`:o.error)}catch{}throw new Error(`${r} → ${i}`)}if(!a.length)return null;try{return JSON.parse(a)}catch{throw new Error(`${r} → response is not JSON`)}}async function IM(e,...r){if(e==="scout:reload-app")return typeof window<"u"&&window.location.reload(),!0;const a=_M[e];if(!a)return console.warn(`[web-bridge] unknown channel: ${e}`),null;const i=BM(),o=typeof a.path=="function"?a.path(r):a.path,u=`${i}${o}`;if(a.method==="GET"){const p=await fetch(u);return t1(p,u)}const d=r[0]!==void 0?r[0]:{},f=await fetch(u,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(d)});return t1(f,u)}function PM(){return{...DM(IM),isDesktop:!1}}let Ym=null;function UM(){return typeof window>"u"?null:window.scoutDesktop?window.scoutDesktop:(Ym||(Ym=PM()),Ym)}function HM({activeView:e,selectedMessagesThread:r,selectedRelayKind:a,selectedRelayId:i,selectedInterAgentId:o}){return e==="messages"?r?.kind==="relay"&&a==="direct"?i:null:e==="agents"?o:null}function n1(e){return{runtime:{cwd:e.runtime.cwd,harness:e.runtime.harness,sessionId:e.runtime.sessionId,transport:e.runtime.transport},systemPrompt:e.systemPrompt,toolUse:{launchArgsText:e.toolUse.launchArgsText},capabilitiesText:e.capabilitiesText}}function FM({activeView:e,scoutDesktop:r,surfaceCaps:a,interAgentState:i,interAgentAgents:o,interAgentThreads:u,relayState:d,selectedMessagesThread:f,selectedMessagesDetailAgentId:p,selectedRelayKind:h,selectedRelayId:y,agentableProjects:b,visibleAppSettings:v,isAppSettingsEditing:j,appSettingsDirty:C,setAppSettings:E,setAppSettingsDraft:w,setActiveView:M,setSettingsSection:D,setSettingsAgentId:H,setShellState:X,setShellError:q,setRelayFeedback:L}){const[B,F]=z.useState(null),[Z,O]=z.useState(null),[P,Q]=z.useState("all"),[oe,J]=z.useState("chat"),[ee,N]=z.useState(!1),[Y,$]=z.useState(!1),[ye,T]=z.useState(!1),[_,le]=z.useState(!1),[R,pe]=z.useState(null),[xe,ce]=z.useState(null),[Re,Te]=z.useState(null),[Ne,He]=z.useState(!1),[Le,Ue]=z.useState(!1),[it,tt]=z.useState(!1),[st,ot]=z.useState(null),[bt,Ye]=z.useState(null),[Ge,We]=z.useState(!1),[we,et]=z.useState(!1),[Se,Ze]=z.useState(()=>Em(b,v)),[mt,ae]=z.useState(!1),[ge,Ce]=z.useState(null),[_e,Xe]=z.useState(null),[Ae,ue]=z.useState(!1),[Ee,V]=z.useState(null),[me,je]=z.useState(!1),[Fe,Je]=z.useState(0),[qe,St]=z.useState(!1),Yt=z.useRef(null),Vt=z.useRef(null),Pt=z.useRef(null),yt=z.useRef(!0),Wt=z.useRef(!0),se=z.useMemo(()=>[...o.filter(Ke=>P==="all"?!0:Bb(Ke))].sort((Ke,zt)=>Pb(Ke,zt,oe)),[P,oe,o]),Me=z.useMemo(()=>{const ve=new Map;for(const Ke of se)ve.set(Ke.title,(ve.get(Ke.title)??0)+1);return ve},[se]),ze=z.useMemo(()=>o.find(ve=>ve.id===B)??null,[o,B]),nt=z.useMemo(()=>u.filter(ve=>ve.participants.some(Ke=>Ke.id===B)),[u,B]),Qt=z.useMemo(()=>nt.find(ve=>ve.id===Z)??null,[Z,nt]),gn=z.useMemo(()=>ze?d?.directs.find(ve=>ve.id===ze.id)??null:null,[d,ze]),ha=gn?.preview||gn?.timestampLabel?"Open Chat":"Start Chat",Gl=gn?.preview||gn?.timestampLabel?pv(gn):ze?`${ze.title} is ready for a direct message.`:"Direct line available.",xa=z.useMemo(()=>Em(b,v),[b,v]),bn=B&&(Re??xe)?.agentId===B?Re??xe:null,Wa=!!(xe?.editable&&bn),ga=z.useCallback(ve=>{Te(Ke=>Ke&&ve(Ke)),ot(null)},[]),Un=z.useMemo(()=>Ub(Re)!==Ub(xe),[Re,xe]),$t=z.useMemo(()=>{const ve=HS(bn?.capabilitiesText??"");return ve.length>0?ve:ze?.capabilities??[]},[ze?.capabilities,bn?.capabilitiesText]),dn=Ge&&Un?"Save + Restart":"Restart Agent",Ht=z.useMemo(()=>HM({activeView:e,selectedMessagesThread:f,selectedRelayKind:h,selectedRelayId:y,selectedInterAgentId:B}),[e,B,f,y,h]),$l=!!(B&&r?.getAgentConfig&&e==="settings"&&Ge),Ml=!!(Ht&&r?.getAgentSession&&(qe||_)),Yl=_e?.agentId===p||_e?.agentId===B?_e:null,ns=Ae&&!Yl;z.useEffect(()=>{if(!i)return;const ve=i.agents,Ke=ve.filter(_n=>P==="all"?!0:Bb(_n)).sort((_n,Tr)=>Pb(_n,Tr,oe)),zt=e==="agents"||e==="inter-agent"?Ke:ve;if(!zt.length){F(null),O(null);return}const yn=zt.find(_n=>_n.threadCount>0)?.id??zt[0]?.id??null,ti=zt.some(_n=>_n.id===B)?B:yn;ti!==B&&F(ti);const vn=i.threads.filter(_n=>_n.participants.some(Tr=>Tr.id===ti)),Cr=vn.some(_n=>_n.id===Z)?Z:vn[0]?.id??null;Cr!==Z&&O(Cr)},[e,P,oe,i,B,Z]),z.useEffect(()=>{if(!B){ce(null),Te(null),ot(null),He(!1),N(!1),$(!1),T(!1);return}if(!$l){He(!1);return}const ve=r;if(!ve?.getAgentConfig){He(!1);return}let Ke=!1;return(async()=>{He(!0);try{const yn=await ve.getAgentConfig(B);if(Ke)return;ce(yn),Te(yn),ot(null),(!bt||bt!==B)&&We(!1)}catch(yn){if(Ke)return;ce(null),Te(null),ot(lt(yn)),We(!1)}finally{Ke||He(!1)}})(),()=>{Ke=!0}},[bt,r,B,$l]),z.useEffect(()=>{if(!Ht){Xe(null),V(null),je(!1),ue(!1);return}if(!Ml){ue(!1);return}const ve=r;if(!ve?.getAgentSession){ue(!1);return}let Ke=!1;return(async()=>{ue(!0);try{const yn=await ve.getAgentSession(Ht);if(Ke)return;Xe(yn),V(null)}catch(yn){if(Ke)return;Xe(null),V(lt(yn))}finally{Ke||ue(!1)}})(),()=>{Ke=!0}},[Fe,Ht,r,Ml]),z.useEffect(()=>{V(null),je(!1)},[Ht]),z.useEffect(()=>{e!=="agents"&&e!=="messages"&&St(!1)},[e]),z.useEffect(()=>{if(!qe)return;const ve=Ke=>{Ke.key==="Escape"&&St(!1)};return window.addEventListener("keydown",ve),()=>window.removeEventListener("keydown",ve)},[qe]);const Wn=z.useCallback(ve=>ve?ve.scrollHeight-ve.scrollTop-ve.clientHeight<=48:!0,[]),zl=z.useCallback(ve=>{ve&&(ve.scrollTop=ve.scrollHeight)},[]);z.useEffect(()=>{yt.current=!0,Wt.current=!0},[qe,B]),z.useEffect(()=>{if(!Ht||!Ml)return;const ve=window.setInterval(()=>{Je(Ke=>Ke+1)},qe?1600:2500);return()=>{window.clearInterval(ve)}},[Ht,qe,Ml]),z.useEffect(()=>{if(!me)return;const ve=window.setTimeout(()=>{je(!1)},1500);return()=>{window.clearTimeout(ve)}},[me]),z.useEffect(()=>{if(e!=="settings"||!bt||B!==bt||Ne)return;const ve=Yt.current;if(!ve)return;const Ke=window.requestAnimationFrame(()=>{if(ve.scrollIntoView({block:"center",behavior:"smooth"}),ve.focus(),"value"in ve&&typeof ve.value=="string"){const zt=ve.value.length;ve.setSelectionRange?.(zt,zt)}Ye(zt=>zt===bt?null:zt)});return()=>{window.cancelAnimationFrame(Ke)}},[e,bt,B,Re,Ne]),z.useEffect(()=>{e!=="agents"||!Ge||(We(!1),Ye(null))},[e,Ge]),z.useEffect(()=>{if(!Yl?.body)return;const ve=window.requestAnimationFrame(()=>{yt.current&&zl(Vt.current),qe&&Wt.current&&zl(Pt.current)});return()=>window.cancelAnimationFrame(ve)},[qe,zl,Yl?.agentId,Yl?.body,Yl?.updatedAtLabel]);const dl=z.useCallback(ve=>{F(ve),O(BS(u,ve))},[u]),Ol=z.useCallback((ve,Ke=!1)=>{dl(ve),D("agents"),H(ve),M("settings"),We(Ke),Ye(Ke?ve:null)},[dl,M,H,D]),Sr=z.useCallback(()=>{We(!1),Ye(null)},[]),Ll=z.useCallback(()=>{F(null),O(null),We(!1),Ye(null),ot(null)},[]),Ft=z.useCallback(()=>{Ze(Em(b,v)),Ce(null),et(!0)},[b,v]),ba=z.useCallback(()=>{(async()=>{try{if(!a?.canPickDirectory||!r?.pickDirectory)return;const ve=await r.pickDirectory();if(!ve)return;Ze(Ke=>({...Ke,projectPath:ve})),Ce(null)}catch(ve){Ce(lt(ve))}})()},[r,a]),ya=z.useCallback(()=>{(async()=>{if(!r?.createAgent){Ce("Desktop bridge is unavailable.");return}const ve=Se.projectPath.trim();if(!ve){Ce("Choose a project path first.");return}ae(!0),Ce(null);try{const Ke=await r.createAgent({projectPath:ve,agentName:Se.agentName.trim()||null,harness:Se.harness});if(X(Ke.shellState),q(null),L(`Created ${Ke.agentId}.`),F(Ke.agentId),O(null),M("agents"),et(!1),r.refreshSettingsInventory)try{const zt=await r.refreshSettingsInventory();E(zt),(!j||!C)&&w(zt)}catch{}}catch(Ke){Ce(lt(Ke))}finally{ae(!1)}})()},[C,Se,j,r,M,E,w,L,q,X]),Dl=z.useCallback(()=>{M("settings"),D("agents"),B&&H(B),We(!0),B&&Ye(B)},[B,M,H,D]),Ql=z.useCallback(()=>{Te(xe),ot(null),We(!1)},[xe]),Lo=z.useCallback(async()=>{if(!(!B||!bn||!r?.updateAgentConfig)){Ue(!0);try{const ve=await r.updateAgentConfig({agentId:B,...n1(bn)});ce(ve),Te(ve),ot("Agent settings saved."),We(!1)}catch(ve){ot(lt(ve))}finally{Ue(!1)}}},[r,B,bn]),ls=z.useCallback(async()=>{if(!(!B||!bn||!r?.restartAgent)){tt(!0);try{let ve=bn;Un&&r.updateAgentConfig&&(Ue(!0),ve=await r.updateAgentConfig({agentId:B,...n1(bn)}),ce(ve),Te(ve),Ue(!1));const Ke=await r.restartAgent({agentId:B,previousSessionId:ze?.sessionId??xe?.runtime.sessionId??null});X(Ke),q(null),ot(`${ze?.title??"Agent"} restarted.`),We(!1)}catch(ve){ot(lt(ve))}finally{Ue(!1),tt(!1)}}},[xe,Un,r,ze,B,q,X,bn]),Ja=z.useCallback(async()=>{if(!(!a?.canOpenNativeSession||!Ht||!r?.openAgentSession))try{await r.openAgentSession(Ht),V(_e?.mode==="tmux"?"Opening tmux session in Terminal.":"Opening session logs.")}catch(ve){V(lt(ve))}},[_e?.mode,Ht,r,a]),rs=z.useCallback(async()=>{if(_e?.commandLabel)try{await uk(_e.commandLabel),je(!0),V("Attach command copied.")}catch(ve){V(lt(ve))}},[_e]),Xl=z.useCallback(()=>{Je(ve=>ve+1)},[]),_l=z.useCallback(()=>{V(null),St(!0),Xl()},[Xl]),Hn=z.useCallback(()=>{St(!1)},[]),Xt=z.useCallback(ve=>{yt.current=Wn(ve.currentTarget)},[Wn]),ei=z.useCallback(ve=>{Wt.current=Wn(ve.currentTarget)},[Wn]);return{selectedInterAgentId:B,selectedInterAgentThreadId:Z,setSelectedInterAgentThreadId:O,agentRosterFilter:P,setAgentRosterFilter:Q,agentRosterSort:oe,setAgentRosterSort:J,agentThreadsExpanded:ee,setAgentThreadsExpanded:N,agentSnapshotExpanded:Y,setAgentSnapshotExpanded:$,agentActivityExpanded:ye,setAgentActivityExpanded:T,agentSessionLogsExpanded:_,setAgentSessionLogsExpanded:le,agentRosterMenu:R,setAgentRosterMenu:pe,selectedInterAgent:ze,rosterInterAgentAgents:se,rosterAgentTitleCounts:Me,visibleInterAgentThreads:nt,selectedInterAgentDirectThread:gn,selectedInterAgentThread:Qt,selectedInterAgentChatActionLabel:ha,selectedAgentDirectLinePreview:Gl,isAgentConfigEditing:Ge,visibleAgentConfig:bn,hasEditableAgentConfig:Wa,agentConfigLoading:Ne,agentConfigSaving:Le,agentConfigRestarting:it,agentConfigFeedback:st,agentCapabilitiesPreview:$t,agentRuntimePathRef:Yt,updateAgentConfigDraft:ga,agentConfigDirty:Un,agentRestartActionLabel:dn,handleSelectInterAgent:dl,handleOpenAgentSettings:Ol,deactivateAgentConfigEdit:Sr,resetAgentInspector:Ll,handleStartAgentConfigEdit:Dl,handleCancelAgentConfigEdit:Ql,handleSaveAgentConfig:Lo,handleRestartAgent:ls,isCreateAgentDialogOpen:we,setIsCreateAgentDialogOpen:et,createAgentDraft:Se,setCreateAgentDraft:Ze,createAgentDefaults:xa,createAgentSubmitting:mt,createAgentFeedback:ge,setCreateAgentFeedback:Ce,handleOpenCreateAgentDialog:Ft,handleBrowseCreateAgentProject:ba,handleCreateAgent:ya,visibleAgentSession:Yl,agentSessionPending:ns,agentSessionLoading:Ae,agentSessionFeedback:Ee,agentSessionCopied:me,isAgentSessionPeekOpen:qe,closeAgentSessionPeek:Hn,agentSessionInlineViewportRef:Vt,handleInlineAgentSessionScroll:Xt,agentSessionPeekViewportRef:Pt,handlePeekAgentSessionScroll:ei,handleOpenAgentSession:Ja,handleCopyAgentSessionCommand:rs,handlePeekAgentSession:_l,refreshAgentSession:Xl}}async function qM(e){if(typeof navigator<"u"&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}if(typeof document<"u"){const r=document.createElement("textarea");r.value=e,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();const a=document.execCommand("copy");if(document.body.removeChild(r),a)return}throw new Error("Clipboard unavailable.")}function VM({activeView:e,settingsSection:r,scoutDesktop:a,surfaceCaps:i,pendingBrokerInspectorFocus:o,setPendingBrokerInspectorFocus:u,relayServiceInspectorRef:d,loadShellState:f,setShellState:p,setShellError:h,applyRestartedOnboardingSettings:y,commitPairingState:b,pairingState:v,setAppSettingsFeedback:j,setRelayFeedback:C,setPairingError:E,setPairingConfigFeedback:w}){const[M,D]=z.useState(null),[H,X]=z.useState(null),[q,L]=z.useState(null),[B,F]=z.useState(null),[Z,O]=z.useState(!1),[P,Q]=z.useState(null),[oe,J]=z.useState(!1),[ee,N]=z.useState(null),[Y,$]=z.useState(!1),[ye,T]=z.useState(null),[_,le]=z.useState(""),[R,pe]=z.useState(null),[xe,ce]=z.useState(null),[Re,Te]=z.useState(null),[Ne,He]=z.useState(!1),[Le,Ue]=z.useState(null),[it,tt]=z.useState(""),[st,ot]=z.useState(""),[bt,Ye]=z.useState(0),Ge=M?.sources??[],We=z.useMemo(()=>{const ue=st.trim().toLowerCase();return ue?Ge.filter(Ee=>Ee.title.toLowerCase().includes(ue)||Ee.subtitle.toLowerCase().includes(ue)):Ge},[st,Ge]),we=Ge.find(ue=>ue.id===H)??null,et=z.useCallback(()=>{Ye(ue=>ue+1)},[]),Se=z.useCallback(()=>{J(!0),Te(null)},[]),Ze=z.useCallback(ue=>{J(ue),ue||Te(null)},[]),mt=z.useCallback(async()=>{if(!a?.getBrokerInspector)return F(null),null;try{const ue=await a.getBrokerInspector();return F(ue),ue}catch{return F(null),null}},[a]),ae=z.useCallback(async ue=>{if(!a?.getFeedbackBundle)return T("Feedback diagnostics are unavailable in this build."),null;ue?.showSpinner&&$(!0);try{const Ee=await a.getFeedbackBundle();return N(Ee),T(null),Ee}catch(Ee){return T(lt(Ee)),null}finally{ue?.showSpinner&&$(!1)}},[a]);z.useEffect(()=>{if(e!=="logs")return;if(!a?.getLogCatalog){D(null),Ue("Logs are unavailable in the current desktop bridge. Restart the app so the latest desktop bridge is loaded.");return}let ue=!1;return(async()=>{try{const V=await a.getLogCatalog();if(ue)return;D(V),X(me=>me&&V.sources.some(je=>je.id===me)?me:V.defaultSourceId??V.sources[0]?.id??null),V.sources.length===0&&Ue("No log sources available.")}catch(V){ue||Ue(lt(V))}})(),()=>{ue=!0}},[e,a]),z.useEffect(()=>{if(e!=="logs"||!H)return;if(!a?.readLogSource){L(null);return}let ue=!1;return(!q||q.sourceId!==H)&&He(!0),Ue(null),(async()=>{try{const V=await a.readLogSource({sourceId:H,tailLines:500});if(ue)return;L(V),Ue(null)}catch(V){ue||(L(null),Ue(lt(V)))}finally{ue||He(!1)}})(),()=>{ue=!0}},[e,bt,a,H]),z.useEffect(()=>{e!=="settings"||r!=="communication"||mt()},[e,bt,mt,r]),z.useEffect(()=>{if(!o||e!=="settings"||r!=="communication")return;const ue=window.setTimeout(()=>{d.current?.scrollIntoView({behavior:"smooth",block:"start"}),u(!1)},40);return()=>{window.clearTimeout(ue)}},[e,o,d,r,B]),z.useEffect(()=>{if(e!=="logs")return;const ue=window.setInterval(()=>{Ye(Ee=>Ee+1)},2500);return()=>{window.clearInterval(ue)}},[e]),z.useEffect(()=>{oe&&ae({showSpinner:!0})},[oe,ae]);const ge=z.useCallback(async ue=>{if(!(!i?.canManageBroker||!a?.controlBroker)){O(!0),Q(null);try{const Ee=await a.controlBroker(ue);p(Ee),h(null),await mt(),Q(ue==="start"?"Relay started.":ue==="stop"?"Relay stopped.":"Relay restarted.")}catch(Ee){Q(lt(Ee))}finally{O(!1)}}},[mt,a,h,p,i]),Ce=z.useCallback(()=>{(async()=>{ce("refresh"),Te(null);try{await ae({showSpinner:!0}),Te("Support details refreshed.")}finally{ce(null)}})()},[ae]),_e=z.useCallback(()=>{(async()=>{if(!ee?.text){Te("Support bundle is still loading.");return}ce("copy"),Te(null);try{await qM(ee.text),Te("Support bundle copied.")}catch(ue){Te(lt(ue))}finally{ce(null)}})()},[ee?.text]),Xe=z.useCallback(()=>{(async()=>{if(!a?.submitFeedbackReport){Te("Feedback submission is unavailable in this build.");return}const ue=_.trim();if(!ue){Te("Add a short description before submitting.");return}ce("submit"),Te(null);try{const Ee=await a.submitFeedbackReport({message:ue});pe(Ee),le(""),Te(`Feedback submitted as ${Ee.key}.`)}catch(Ee){Te(lt(Ee))}finally{ce(null)}})()},[_,a]),Ae=z.useCallback(()=>{(async()=>{const ue=[];ce("repair"),Te(null);try{if(a?.restartOnboarding){const Ee=await a.restartOnboarding();y(Ee)}else ue.push("Onboarding reset unavailable.");if(j(null),C(null),E(null),w(null),Q(null),Ue(null),i?.canManageBroker&&a?.controlBroker)try{const Ee=await a.controlBroker(B?.installed?"restart":"start");p(Ee),h(null)}catch(Ee){ue.push(`Relay: ${lt(Ee)}`)}if(a?.controlPairingService)try{const Ee=await a.controlPairingService(v?.isRunning?"restart":"start");b(Ee)}catch(Ee){ue.push(`Pairing: ${lt(Ee)}`)}try{await mt()}catch(Ee){ue.push(`Broker diagnostics: ${lt(Ee)}`)}if(a?.refreshPairingState)try{const Ee=await a.refreshPairingState();b(Ee)}catch(Ee){ue.push(`Pairing refresh: ${lt(Ee)}`)}await f(!1),await ae(),Te(ue.length>0?`Repair finished with notes: ${ue.join(" · ")}`:"Setup repaired. Onboarding was reset and local services were refreshed.")}catch(Ee){Te(lt(Ee))}finally{ce(null)}})()},[y,B?.installed,b,ae,f,v?.isRunning,mt,a,j,w,E,C,h,p,i]);return{logCatalog:M,logSources:Ge,filteredLogSources:We,selectedLogSourceId:H,setSelectedLogSourceId:X,selectedLogSource:we,logContent:q,brokerInspector:B,brokerControlPending:Z,brokerControlFeedback:P,isFeedbackDialogOpen:oe,feedbackBundle:ee,feedbackBundleLoading:Y,feedbackBundleError:ye,feedbackDraft:_,setFeedbackDraft:le,feedbackSubmission:R,feedbackActionPending:xe,feedbackActionMessage:Re,logsLoading:Ne,logsFeedback:Le,logSearchQuery:it,setLogSearchQuery:tt,logSourceQuery:st,setLogSourceQuery:ot,refreshLogs:et,refreshBrokerInspector:mt,openFeedbackDialog:Se,handleFeedbackDialogOpenChange:Ze,handleBrokerControl:ge,handleRefreshFeedbackBundle:Ce,handleCopyFeedbackBundle:_e,handleSubmitFeedbackReport:Xe,handleRepairSetup:Ae}}function GM({pairingEnabled:e,scoutDesktop:r,setRelayFeedback:a}){const[i,o]=z.useState(null),[u,d]=z.useState(!1),[f,p]=z.useState(null),[h,y]=z.useState(!1),[b,v]=z.useState(!1),[j,C]=z.useState(null),[E,w]=z.useState(null),M=z.useRef(null),D=z.useRef(0);z.useEffect(()=>{M.current=i},[i]),z.useEffect(()=>{e||(o(null),d(!1),p(null),y(!1),v(!1),C(null),w(null))},[e]);const H=z.useCallback(Z=>{o(O=>AT(O,Z)?O:Z)},[]),X=z.useCallback(async(Z,O)=>{if(!e||!Z)return null;const P=++D.current;O?.showLoading&&d(!0);try{const Q=await Z();return D.current!==P||(H(Q),p(null)),Q}catch(Q){if(D.current===P&&p(lt(Q)),O?.throwOnError)throw Q;return null}finally{O?.showLoading&&D.current===P&&d(!1)}},[H,e]);z.useEffect(()=>{if(!e||!r?.getPairingState)return;X(()=>r.getPairingState(),{showLoading:M.current===null});const Z=window.setInterval(()=>{X(()=>r.getPairingState())},5e3);return()=>{window.clearInterval(Z)}},[e,r,X]);const q=z.useCallback(async()=>e?r?.refreshPairingState?X(()=>r.refreshPairingState(),{throwOnError:!0}):X(r?.getPairingState?()=>r.getPairingState():void 0,{throwOnError:!0}):null,[e,r,X]),L=z.useCallback(async Z=>{if(r?.controlPairingService){y(!0);try{const O=await r.controlPairingService(Z);H(O),p(null),a(Z==="start"?"Pairing started.":Z==="stop"?"Pairing stopped.":"Pairing restarted.")}catch(O){p(lt(O))}finally{y(!1)}}},[H,r,a]),B=z.useCallback(async Z=>{if(r?.updatePairingConfig){v(!0),w(null);try{const O=await r.updatePairingConfig(Z);H(O),p(null),w("Pairing settings saved.")}catch(O){const P=lt(O);throw w(P),O}finally{v(!1)}}},[H,r]),F=z.useCallback(async(Z,O)=>{if(!r?.decidePairingApproval)return;const P=`${Z.sessionId}:${Z.turnId}:${Z.blockId}:${O}`;C(P);try{const Q=await r.decidePairingApproval({sessionId:Z.sessionId,turnId:Z.turnId,blockId:Z.blockId,version:Z.version,decision:O});H(Q),p(null),a(O==="approve"?"Approval sent.":"Action denied.")}catch(Q){p(lt(Q))}finally{C(Q=>Q===P?null:Q)}},[H,r,a]);return{pairingState:i,pairingLoading:u,pairingError:f,setPairingError:p,pairingControlPending:h,pairingConfigPending:b,pairingApprovalPendingId:j,pairingConfigFeedback:E,setPairingConfigFeedback:w,pendingApprovals:i?.pendingApprovals??[],commitPairingState:H,refreshPairingState:q,handlePairingControl:L,handleUpdatePairingConfig:B,handleDecidePairingApproval:F}}const l1={favorites:[],quickHits:[],preparedAt:null};function $M({activeView:e,scoutDesktop:r,sessions:a}){const[i,o]=z.useState(null),[u,d]=z.useState(!1),[f,p]=z.useState(!1),[h,y]=z.useState(null),[b,v]=z.useState(null),[j,C]=z.useState(null),E=z.useRef(null),w=z.useRef(0);z.useEffect(()=>{E.current=i},[i]),z.useEffect(()=>{if(e!=="sessions"||!r?.getPhonePreparation)return;let J=!1;return(async()=>{d(!0);try{const N=await r.getPhonePreparation();if(J)return;o(N),y(null)}catch(N){if(J)return;o(null),y(lt(N))}finally{J||d(!1)}})(),()=>{J=!0}},[e,r]);const M=i??l1,D=z.useMemo(()=>new Map(a.map(J=>[J.id,J])),[a]),H=z.useMemo(()=>[...a].sort((J,ee)=>new Date(ee.lastModified).getTime()-new Date(J.lastModified).getTime()||ee.messageCount-J.messageCount||J.title.localeCompare(ee.title)),[a]),X=z.useMemo(()=>M.favorites.map(J=>D.get(J)).filter(J=>!!J),[M.favorites,D]),q=z.useMemo(()=>M.quickHits.filter(J=>!M.favorites.includes(J)).map(J=>D.get(J)).filter(J=>!!J),[M.favorites,M.quickHits,D]),L=z.useCallback(async(J,ee)=>{if(!r?.updatePhonePreparation){y("Phone preparation is unavailable in this build.");return}const N=++w.current,Y=E.current;o(J),p(!0);try{const $=await r.updatePhonePreparation(J);if(w.current!==N)return;o($),ee?y(ee):ee===null&&y(null)}catch($){if(w.current!==N)return;o(Y),y(lt($))}finally{w.current===N&&(p(!1),v(null),C(null))}},[r]),B=z.useCallback((J,ee)=>{const N=J(E.current??l1);L(N,ee)},[L]),F=z.useCallback(()=>{const J=M.favorites.filter(N=>D.has(N)),ee=H.map(N=>N.id).filter(N=>!J.includes(N)).slice(0,8);L({favorites:J,quickHits:ee,preparedAt:Date.now()},`Prepared ${J.length+ee.length} phone picks.`)},[L,M.favorites,H,D]),Z=z.useCallback(()=>{B(J=>({...J,quickHits:[],preparedAt:Date.now()}),"Cleared My List. Favorites stayed pinned.")},[B]),O=z.useCallback((J,ee)=>{B(N=>ee==="favorites"?{favorites:N.favorites.includes(J)?N.favorites:[...N.favorites,J],quickHits:N.quickHits.filter(Y=>Y!==J),preparedAt:Date.now()}:N.favorites.includes(J)||N.quickHits.includes(J)?{...N,preparedAt:Date.now()}:{...N,quickHits:[...N.quickHits,J],preparedAt:Date.now()},ee==="favorites"?"Pinned for phone.":"Added to My List.")},[B]),P=z.useCallback((J,ee)=>{B(N=>({favorites:ee==="favorites"?N.favorites.filter(Y=>Y!==J):N.favorites,quickHits:ee==="quickHits"?N.quickHits.filter(Y=>Y!==J):N.quickHits,preparedAt:Date.now()}),ee==="favorites"?"Removed from phone favorites.":"Removed from My List.")},[B]),Q=z.useCallback(()=>{b&&O(b,"favorites")},[b,O]),oe=z.useCallback(J=>{b&&B(ee=>{if(ee.favorites.includes(b))return{...ee,preparedAt:Date.now()};const N=ee.quickHits.filter($=>$!==b),Y=typeof J=="number"?Math.max(0,Math.min(J,N.length)):N.length;return N.splice(Y,0,b),{...ee,quickHits:N,preparedAt:Date.now()}},j==="quickHits"?"Reordered My List.":"Added to My List.")},[j,b,B]);return{phonePreparationState:M,phonePreparationLoading:u,phonePreparationSaving:f,phonePreparationFeedback:h,setDraggedSessionId:v,setDraggedPhoneSection:C,favoritePhoneSessions:X,quickHitPhoneSessions:q,handlePreparePhone:F,handleClearPhoneQuickHits:Z,handleDropIntoFavorites:Q,handleDropIntoQuickHits:oe,handleRemoveSessionFromPhoneSection:P,handleAddSessionToPhoneSection:O}}function YM({activeView:e,setActiveView:r,desktopFeatures:a,styles:i,colorTheme:o,sidebarWidth:u,messagesDetailWidth:d,isCollapsed:f,onResizeStart:p,onMessagesDetailResizeStart:h,stats:y,runtime:b,shellState:v,shellError:j,plansState:C,machinesState:E,messagesState:w,interAgentState:M,interAgentAgents:D,interAgentAgentLookup:H,relayDirectLookup:X,homeAgents:q,homeActivity:L,activityRecentMessages:B,activityTasks:F,activityLeadTask:Z,activityFindings:O,activityEndpoints:P,overviewSessions:Q,inboxAlertCount:oe,pendingApprovalsCount:J,inboxFailedTaskCount:ee,inboxAwaitingYouItems:N,availableAgentNames:Y,searchQuery:$,setSearchQuery:ye,filteredSessions:T,selectedSession:_,setSelectedSession:le,isLoadingMessagesWorkspace:R,isLoadingShell:pe,showAnnotations:xe,setShowAnnotations:ce,messagesDetailOpen:Re,setMessagesDetailOpen:Te,messagesDetailTab:Ne,setMessagesDetailTab:He,formatDate:Le,onRefreshShell:Ue,openAgentProfile:it,openSessionDetail:tt,handleSelectSearchSession:st,handleToggleVoiceCapture:ot,handleSetVoiceRepliesEnabled:bt,selectMessageThread:Ye,renderLocalPathValue:Ge,selectedInterAgentActivityMessages:We,selectedInterAgentInboundTasks:we,selectedInterAgentOutboundFindings:et,selectedInterAgentFindings:Se,interAgentThreadTitle:Ze,selectedInterAgentThreadSubtitle:mt,interAgentConfigureTarget:ae,interAgentConfigureLabel:ge,interAgentMessageTarget:Ce,visibleInterAgentMessages:_e,relayVoiceState:Xe,messagesController:Ae,agentController:ue,diagnosticsController:Ee,phonePreparationController:V,overviewBootLoader:me}){const je={sidebar:i.sidebar,surface:i.surface,inkText:i.inkText,mutedText:i.mutedText,tagBadge:i.tagBadge,activePill:i.activePill},Fe=w??{title:"Messages",subtitle:R||pe?"Loading relay workspace":j??"Broker unavailable",lastUpdatedLabel:b?.updatedAtLabel??null,threads:[]};return{overviewInboxActivityViewProps:{activeView:e,overviewViewProps:{C:o,s:i,bootLoader:me,homeAgents:q,activity:L,shellError:j,onRefresh:Ue,onOpenAgent:it,colorForIdentity:cl},inbox:{isCollapsed:f,sidebarWidth:u,onResizeStart:p,styles:je,inboxAlertCount:oe,pendingApprovalsCount:J,inboxFailedTaskCount:ee,inboxAwaitingYouItems:N},activity:{isCollapsed:f,sidebarWidth:u,onResizeStart:p,styles:je,plansState:C,machinesState:E,runtime:b,activityLeadTask:Z,activityTasks:F,activityFindings:O,activityEndpoints:P,activityRecentMessages:B,interAgentAgentLookup:H,overviewSessions:Q,formatDate:Le,onRefresh:Ue,onOpenPlans:()=>r("plans"),onOpenMessages:()=>r("messages"),onOpenAgentProfile:it,onOpenSessionDetail:tt}},opsViewsProps:{activeView:e,machinesViewProps:{machinesState:E??{title:"Machines",subtitle:"Broker unavailable",totalMachines:0,onlineCount:0,degradedCount:0,offlineCount:0,lastUpdatedLabel:null,machines:[]},C:o,s:i,isCollapsed:f,sidebarWidth:u,onResizeStart:p,onOpenRelayAgent:Ae.openDirectConversation,onRefresh:Ue,identityColor:cl},plansViewProps:{plansState:C??{title:"Plans",subtitle:"No broker snapshot yet",taskCount:0,runningTaskCount:0,failedTaskCount:0,completedTaskCount:0,findingCount:0,warningCount:0,errorCount:0,planCount:0,workspaceCount:0,lastUpdatedLabel:null,tasks:[],findings:[],plans:[]},C:o,s:i,isCollapsed:f,sidebarWidth:u,onResizeStart:p,onOpenRelayAgent:Ae.openDirectConversation,onRefresh:Ue,identityColor:cl},search:{isCollapsed:f,sidebarWidth:u,onResizeStart:p,styles:{sidebar:i.sidebar,surface:i.surface,inkText:i.inkText,mutedText:i.mutedText,tagBadge:i.tagBadge,activeItem:i.activeItem,kbd:i.kbd},availableAgentNames:Y,searchQuery:$,setSearchQuery:ye,filteredSessions:T,stats:{totalSessions:y.totalSessions,totalMessages:y.totalMessages},formatDate:Le,onOpenSession:st}},agentViewsProps:{activeView:e,layout:{isCollapsed:f,sidebarWidth:u,onResizeStart:p,styles:{sidebar:i.sidebar,surface:i.surface,inkText:i.inkText,mutedText:i.mutedText,tagBadge:i.tagBadge,activePill:i.activePill,activeItem:i.activeItem,annotBadge:i.annotBadge}},roster:{interAgentStateTitle:M?.title??"Inter-Agent",interAgentStateSubtitle:M?.subtitle??"Agent-to-agent traffic",rosterInterAgentAgents:ue.rosterInterAgentAgents,interAgentAgents:D,selectedInterAgentId:ue.selectedInterAgentId,onSelectInterAgent:ue.handleSelectInterAgent,agentRosterMenu:ue.agentRosterMenu,setAgentRosterMenu:ue.setAgentRosterMenu,agentRosterFilter:ue.agentRosterFilter,setAgentRosterFilter:ue.setAgentRosterFilter,agentRosterSort:ue.agentRosterSort,setAgentRosterSort:ue.setAgentRosterSort,rosterAgentTitleCounts:ue.rosterAgentTitleCounts,onRefresh:Ue},agents:{selectedInterAgent:ue.selectedInterAgent,selectedInterAgentDirectThread:ue.selectedInterAgentDirectThread,selectedInterAgentChatActionLabel:ue.selectedInterAgentChatActionLabel,onOpenAgentThread:Ae.openDirectConversation,onPeekAgentSession:ue.handlePeekAgentSession,onOpenAgentSettings:ue.handleOpenAgentSettings,visibleAgentSession:ue.visibleAgentSession,agentSessionPending:ue.agentSessionPending,agentSessionLoading:ue.agentSessionLoading,agentSessionFeedback:ue.agentSessionFeedback,agentSessionCopied:ue.agentSessionCopied,onCopyAgentSessionCommand:()=>{ue.handleCopyAgentSessionCommand()},onOpenAgentSession:()=>{ue.handleOpenAgentSession()},agentSessionLogsExpanded:ue.agentSessionLogsExpanded,setAgentSessionLogsExpanded:ue.setAgentSessionLogsExpanded,agentSessionInlineViewportRef:ue.agentSessionInlineViewportRef,onInlineAgentSessionScroll:ue.handleInlineAgentSessionScroll,renderLocalPathValue:Ge,selectedInterAgentActivityMessages:We,interAgentAgentLookup:H,relayDirectLookup:X,onOpenAgentProfile:it,onNudgeMessage:Ae.nudgeMessage,selectedInterAgentInboundTasks:we,selectedInterAgentOutboundFindings:et,selectedInterAgentFindings:Se,agentActivityExpanded:ue.agentActivityExpanded,setAgentActivityExpanded:ue.setAgentActivityExpanded,agentThreadsExpanded:ue.agentThreadsExpanded,setAgentThreadsExpanded:ue.setAgentThreadsExpanded,visibleInterAgentThreads:ue.visibleInterAgentThreads,selectedInterAgentThreadId:ue.selectedInterAgentThreadId,onOpenThreadInTrafficView:Je=>{ue.setSelectedInterAgentThreadId(Je),r("inter-agent")},selectedAgentDirectLinePreview:ue.selectedAgentDirectLinePreview,agentSnapshotExpanded:ue.agentSnapshotExpanded,setAgentSnapshotExpanded:ue.setAgentSnapshotExpanded,visibleAgentConfig:ue.visibleAgentConfig},logs:{logSources:Ee.logSources,filteredLogSources:Ee.filteredLogSources,selectedLogSourceId:Ee.selectedLogSourceId,setSelectedLogSourceId:Ee.setSelectedLogSourceId,selectedLogSource:Ee.selectedLogSource,logCatalog:Ee.logCatalog,logContent:Ee.logContent,logsLoading:Ee.logsLoading,logsFeedback:Ee.logsFeedback,logSearchQuery:Ee.logSearchQuery,setLogSearchQuery:Ee.setLogSearchQuery,logSourceQuery:Ee.logSourceQuery,setLogSourceQuery:Ee.setLogSourceQuery},interAgent:{selectedInterAgent:ue.selectedInterAgent,visibleInterAgentThreads:ue.visibleInterAgentThreads,selectedInterAgentThreadId:ue.selectedInterAgentThreadId,setSelectedInterAgentThreadId:ue.setSelectedInterAgentThreadId,interAgentThreadTitle:Ze,selectedInterAgentThread:ue.selectedInterAgentThread,selectedInterAgentThreadSubtitle:mt,selectedRelayDirectThread:Ae.selectedDirectConversation,showAnnotations:xe,setShowAnnotations:ce,interAgentMessageTarget:Ce,openAgentDirectMessage:Ae.openAgentDirectMessage,interAgentConfigureTarget:ae,onOpenAgentSettings:ue.handleOpenAgentSettings,interAgentConfigureLabel:ge,visibleInterAgentMessages:_e,interAgentAgentLookup:H,relayDirectLookup:X,onOpenAgentProfile:it,onNudgeMessage:Ae.nudgeMessage},sessions:{searchQuery:$,setSearchQuery:ye,filteredSessions:T,stats:{totalSessions:y.totalSessions},onRefresh:Ue,loadingSessions:pe&&!v,selectedSession:_,setSelectedSession:le,phonePreparationState:V.phonePreparationState,phonePreparationLoading:V.phonePreparationLoading,phonePreparationSaving:V.phonePreparationSaving,phonePreparationFeedback:V.phonePreparationFeedback,setDraggedSessionId:V.setDraggedSessionId,setDraggedPhoneSection:V.setDraggedPhoneSection,favoritePhoneSessions:V.favoritePhoneSessions,quickHitPhoneSessions:V.quickHitPhoneSessions,formatDate:Le,onClearPhoneQuickHits:V.handleClearPhoneQuickHits,onDropIntoFavorites:V.handleDropIntoFavorites,onDropIntoQuickHits:V.handleDropIntoQuickHits,onRemoveSessionFromPhoneSection:V.handleRemoveSessionFromPhoneSection,onAddSessionToPhoneSection:V.handleAddSessionToPhoneSection}},messagesRelayViewProps:{activeView:e,layout:{sidebarWidth:u,messagesDetailWidth:d,isCollapsed:f,onResizeStart:p,onMessagesDetailResizeStart:h,styles:{sidebar:i.sidebar,surface:i.surface,inkText:i.inkText,mutedText:i.mutedText,tagBadge:i.tagBadge,annotBadge:i.annotBadge,activeItem:i.activeItem,activePill:i.activePill,kbd:i.kbd}},threading:{messagesState:Fe,messageThreads:Ae.messageThreads,selectedMessagesThread:Ae.selectedMessagesThread,onSelectMessageThread:Ye,showAnnotations:xe,setShowAnnotations:ce,onRefresh:Ue,loadingWorkspace:(R||pe)&&!w,selectedMessagesInternalThread:Ae.selectedMessagesInternalThread,selectedMessagesInternalMessages:Ae.selectedMessagesInternalMessages,selectedMessagesInternalTarget:Ae.selectedMessagesInternalTarget,selectedMessagesDetailAgentId:Ae.selectedMessagesDetailAgentId,selectedMessagesDetailAgent:Ae.selectedMessagesDetailAgent,selectedMessagesSessions:Ae.selectedMessagesSessions,selectedSession:_,setSelectedSession:le,formatDate:Le,interAgentAgents:D,interAgentAgentLookup:H,relayDirectLookup:X,openAgentProfile:it,openAgentDirectMessage:Ae.openAgentDirectMessage,onNudgeMessage:Ae.nudgeMessage,messagesDetailOpen:Re,setMessagesDetailOpen:Te,messagesDetailTab:Ne,setMessagesDetailTab:He},composer:{selectedRelayKind:Ae.selectedConversationKind,selectedRelayId:Ae.selectedConversationId,relayThreadTitle:Ae.currentConversationTitle,relayThreadSubtitle:Ae.currentConversationSubtitle,relayThreadCount:Ae.currentConversationCount,selectedRelayDirectThread:Ae.selectedDirectConversation,relayVoiceState:Xe,visibleRelayMessages:Ae.visibleConversationMessages,relayTimelineViewportRef:Ae.timelineViewportRef,onRelayTimelineScroll:Ae.handleConversationTimelineScroll,relayReplyTarget:Ae.replyTarget,setRelayReplyTarget:Ae.setReplyTarget,relayContextReferences:Ae.contextReferences,relayContextMessageIds:Ae.contextMessageIds,setRelayContextMessageIds:Ae.setContextMessageIds,relayComposerRef:Ae.composerRef,relayDraft:Ae.composerDraft,setRelayDraft:Ae.setComposerDraft,relaySending:Ae.composerSending,relayFeedback:Ae.messagesFeedback,relayComposerSelectionStart:Ae.composerSelectionStart,setRelayComposerSelectionStart:Ae.setComposerSelectionStart,mergedRelayMessages:Ae.mergedConversationMessages,relayMentionMenuOpen:Ae.mentionMenuOpen,relayMentionSuggestions:Ae.mentionSuggestions,relayMentionSelectionIndex:Ae.mentionSelectionIndex,setRelayMentionSelectionIndex:Ae.setMentionSelectionIndex,relayMentionDuplicateTitleCounts:Ae.mentionDuplicateTitleCounts,applyRelayMentionSuggestion:Ae.applyMentionSuggestion,onRelaySend:()=>{Ae.sendMessage()},onToggleVoiceCapture:ot,onSetVoiceRepliesEnabled:Je=>{bt(Je)}},agentSession:{visibleAgentSession:ue.visibleAgentSession,agentSessionPending:ue.agentSessionPending,agentSessionFeedback:ue.agentSessionFeedback,agentSessionCopied:ue.agentSessionCopied,onCopyAgentSessionCommand:()=>{ue.handleCopyAgentSessionCommand()},onOpenAgentSession:()=>{ue.handleOpenAgentSession()},onPeekAgentSession:ue.handlePeekAgentSession,onOpenAgentSettings:ue.handleOpenAgentSettings,desktopVoiceEnabled:a.voice}}}}function QM({activeView:e,setActiveView:r,settingsSection:a,setSettingsSection:i,settingsAgentId:o,setSettingsAgentId:u,settingsSections:d,activeSettingsMeta:f,desktopFeatures:p,stats:h,runtime:y,relayState:b,relayRuntimeBooting:v,relayRuntimeHealthLabel:j,reachableRelayAgentCount:C,dark:E,setDark:w,showAnnotations:M,setShowAnnotations:D,isCollapsed:H,styles:X,scoutDesktop:q,surfaceCaps:L,interAgentAgents:B,openKnowledgeBase:F,openAgentProfile:Z,openDirectConversation:O,renderOnboardingCommandShell:P,renderLocalPathValue:Q,settingsOperatorNameRef:oe,relayServiceInspectorRef:J,handleSetVoiceRepliesEnabled:ee,settingsController:N,diagnosticsController:Y,agentController:$}){const[ye,T]=z.useState(null),[_,le]=z.useState(""),[R,pe]=z.useState("all"),[xe,ce]=z.useState("grid"),Re=z.useMemo(()=>N.agentableProjects.find(Se=>Se.id===ye)??null,[ye,N.agentableProjects]),Te=Re,Ne=z.useMemo(()=>Te?B.find(Se=>Se.id===Te.id||Se.id===Te.definitionId)??null:null,[B,Te]),He=z.useMemo(()=>N.agentableProjects.map(Se=>{const Ze=B.find(ge=>ge.id===Se.id||ge.id===Se.definitionId)??null,mt=!!Ze||Se.registrationKind==="configured",ae=Se.harnesses[0]?.harness??Se.defaultHarness;return{project:Se,linkedAgent:Ze,isBound:mt,primaryHarness:ae,pathLabel:Ka(Se.root)??Se.root,branchLabel:"local",activityLabel:Ze?.timestampLabel??"Workspace",statusLabel:mt?"Bound":Se.registrationKind==="configured"?"Ready":"Discovered"}}),[B,N.agentableProjects]),Le=z.useMemo(()=>{const Se=_.trim().toLowerCase();return He.filter(({project:Ze,isBound:mt,primaryHarness:ae})=>(R==="all"?!0:R==="bound"?mt:!mt)?Se?[Ze.title,Ze.projectName,Ze.root,Ze.relativePath,ae].some(Ce=>Ce.toLowerCase().includes(Se)):!0:!1)},[R,He,_]),Ue=z.useMemo(()=>He.filter(Se=>Se.isBound).length,[He]),it=z.useMemo(()=>He.filter(Se=>!Se.isBound).length,[He]),tt=z.useMemo(()=>o?B.find(Se=>Se.id===o)??null:null,[B,o]),st=$.selectedInterAgent?.id===o,ot=st?$.selectedInterAgent:tt,bt=z.useCallback(Se=>{i(Se),u(null)},[u,i]);z.useEffect(()=>{ye&&(N.agentableProjects.some(Se=>Se.id===ye)||T(null))},[ye,N.agentableProjects]);const Ye=z.useCallback(Se=>{T(Se.id),$.resetAgentInspector()},[$]),Ge=z.useCallback(Se=>{if(Se.registrationKind==="configured"){Z(Se.id);return}Ye(Se)},[Ye,Z]),We=z.useCallback(()=>{r("settings"),i("profile"),N.handleBeginGeneralEdit(),N.setAppSettingsFeedback("Add a scan folder below, then go back to Workspaces and refresh to discover workspaces.")},[r,i,N]),we=z.useCallback(Se=>{N.handleRetireProject(Se.root,Se.title).then(Ze=>{!Ze||Re?.root!==Se.root||(T(null),$.resetAgentInspector())})},[$,Re?.root,N]),et=a==="profile"?l.jsxs(l.Fragment,{children:[N.isAppSettingsEditing?l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>N.handleCancelAppSettingsEdit(),disabled:N.appSettingsSaving,children:"Cancel"}),l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{N.handleSaveAppSettings()},disabled:!N.appSettingsDirty||N.appSettingsSaving||N.appSettingsLoading,children:N.appSettingsSaving?"Saving…":"Save General"})]}):l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>N.handleStartAppSettingsEdit(),disabled:N.appSettingsLoading||!N.visibleAppSettings,children:"Edit General"}),l.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:N.handleRestartOnboarding,disabled:N.appSettingsLoading||!N.visibleAppSettings,children:[l.jsx(xn,{size:12}),"Restart onboarding"]})]}):a==="communication"?N.isAppSettingsEditing?l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>N.handleCancelAppSettingsEdit(),disabled:N.appSettingsSaving,children:"Cancel"}),l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{N.handleSaveAppSettings()},disabled:!N.appSettingsDirty||N.appSettingsSaving||N.appSettingsLoading,children:N.appSettingsSaving?"Saving…":p.telegram?"Save Telegram":"Save Communication"})]}):l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>N.handleStartAppSettingsEdit(),disabled:N.appSettingsLoading||!N.visibleAppSettings,children:p.telegram?"Edit Telegram":"Edit Communication"}):a==="agents"?l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>r("agents"),children:"Open Agents"}),ot&&st&&$.hasEditableAgentConfig?$.isAgentConfigEditing?l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>$.handleCancelAgentConfigEdit(),disabled:$.agentConfigSaving||$.agentConfigRestarting,children:"Cancel"}),l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{$.handleSaveAgentConfig()},disabled:!$.agentConfigDirty||$.agentConfigLoading||$.agentConfigSaving||$.agentConfigRestarting,children:$.agentConfigSaving?"Saving…":"Save Changes"})]}):l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>$.handleStartAgentConfigEdit(),disabled:!o||$.agentConfigLoading||$.agentConfigRestarting,children:"Edit Agent"}):null,ot&&st&&$.hasEditableAgentConfig?l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{$.handleRestartAgent()},disabled:$.agentConfigLoading||$.agentConfigRestarting||!$.visibleAgentConfig,children:$.agentConfigRestarting?"Restarting…":$.agentRestartActionLabel}):null]}):a==="database"?l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>r("sessions"),children:"Browse Sessions"}):null;return{activeView:e,help:{styles:X,buildOnboardingCommandLine:N.buildOnboardingCommandLine,onboardingCopiedCommand:N.onboardingCopiedCommand,onboardingCommandPending:N.onboardingCommandPending,onCopyOnboardingCommand:N.handleCopyOnboardingCommand,onRunOnboardingCommand:N.handleRunOnboardingCommand,onOpenGeneralSettings:()=>{r("settings"),i("profile")}},settings:{styles:X,settingsSection:a,settingsSections:d,activeSettingsMeta:f,onSetSettingsSection:bt,onOpenFeedbackDialog:Y.openFeedbackDialog,headerActions:et,profile:{styles:X,visibleAppSettings:N.visibleAppSettings,appSettings:N.appSettings,isAppSettingsEditing:N.isAppSettingsEditing,appSettingsSaving:N.appSettingsSaving,appSettingsLoading:N.appSettingsLoading,appSettingsDirty:N.appSettingsDirty,appSettingsFeedback:N.appSettingsFeedback,settingsOperatorNameRef:oe,onboardingWizardStep:N.onboardingWizardStep,setOnboardingWizardStep:N.setOnboardingWizardStep,activeOnboardingStepIndex:N.onboardingWizardIndex,activeOnboardingStep:N.activeOnboardingStep,onboardingWizardSteps:N.onboardingWizardSteps,sourceRootPathSuggestions:N.SOURCE_ROOT_PATH_SUGGESTIONS,onboardingRuntimeMatch:N.onboardingRuntimeMatch,onboardingHasProjectConfig:N.onboardingHasProjectConfig,onboardingCopiedCommand:N.onboardingCopiedCommand,onboardingCommandPending:N.onboardingCommandPending,onboardingCommandResult:N.onboardingCommandResult,canGoToPreviousOnboardingStep:N.canGoToPreviousOnboardingStep,canGoToNextOnboardingStep:N.canGoToNextOnboardingStep,moveOnboardingWizard:N.moveOnboardingWizard,handleOnboardingContinue:N.handleOnboardingContinue,handleRestartOnboarding:N.handleRestartOnboarding,handleStartAppSettingsEdit:N.handleStartAppSettingsEdit,handleBeginGeneralEdit:N.handleBeginGeneralEdit,handleSetSourceRootAt:N.handleSetSourceRootAt,handleBrowseForSourceRoot:N.handleBrowseForSourceRoot,handleRemoveSourceRootRow:N.handleRemoveSourceRootRow,handleAddSourceRootRow:N.handleAddSourceRootRow,handleAddSourceRootSuggestion:N.handleAddSourceRootSuggestion,handleSetOnboardingContextRoot:N.handleSetOnboardingContextRoot,handleBrowseForOnboardingContextRoot:N.handleBrowseForOnboardingContextRoot,setAppSettingsDraft:N.setAppSettingsDraft,setAppSettingsFeedback:N.setAppSettingsFeedback,buildOnboardingCommandLine:N.buildOnboardingCommandLine,handleCopyOnboardingCommand:N.handleCopyOnboardingCommand,handleRunOnboardingCommand:N.handleRunOnboardingCommand,renderOnboardingCommandShell:P,renderLocalPathValue:Q,openKnowledgeBase:F},agentSettingsViewProps:{styles:X,selectedInterAgent:ot,availableAgents:$.rosterInterAgentAgents,isAgentConfigEditing:st?$.isAgentConfigEditing:!1,hasEditableAgentConfig:st?$.hasEditableAgentConfig:!1,agentConfigLoading:o?!st||$.agentConfigLoading:!1,agentConfigSaving:st?$.agentConfigSaving:!1,agentConfigRestarting:st?$.agentConfigRestarting:!1,visibleAgentConfig:st?$.visibleAgentConfig:null,agentConfigFeedback:st?$.agentConfigFeedback:null,agentCapabilitiesPreview:st?$.agentCapabilitiesPreview:[],agentRuntimePathRef:$.agentRuntimePathRef,onOpenAgents:()=>r("agents"),onOpenAgentProfile:Z,onOpenAgentThread:Se=>O(Se,{focusComposer:!0}),onUpdateAgentConfigDraft:$.updateAgentConfigDraft,renderLocalPathValue:Q,interAgentProfileKindLabel:mv,onSelectAgent:Se=>{u(Se),$.handleSelectInterAgent(Se)}},workspaceExplorerViewProps:{styles:X,selectedWorkspaceProject:Te,selectedWorkspaceAgent:Ne,workspaceExplorerQuery:_,setWorkspaceExplorerQuery:le,workspaceExplorerFilter:R,setWorkspaceExplorerFilter:pe,workspaceExplorerViewMode:xe,setWorkspaceExplorerViewMode:ce,workspaceExplorerItems:He,workspaceExplorerBoundCount:Ue,workspaceExplorerDiscoveredCount:it,filteredWorkspaceExplorerItems:Le,workspaceInventoryLoaded:N.workspaceInventoryLoaded,workspaceInventoryLoading:N.workspaceInventoryLoading,canRefreshWorkspaceInventory:N.canRefreshWorkspaceInventory,onboardingCommandPending:N.onboardingCommandPending,appSettingsLoading:N.appSettingsLoading,appSettingsSaving:N.appSettingsSaving,appSettingsDirty:N.appSettingsDirty,appSettingsFeedback:N.appSettingsFeedback,showDoctorOutput:N.showDoctorOutput,doctorOutput:P("doctor",N.buildOnboardingCommandLine("doctor"),N.onboardingCommandPending==="doctor"),projectRetirementPendingRoot:N.projectRetirementPendingRoot,onRefreshWorkspaceDiscovery:()=>{N.handleRunOnboardingCommand("doctor")},onLoadWorkspaceInventory:N.handleLoadWorkspaceInventory,onAddWorkspace:We,onInspectWorkspace:Ye,onOpenWorkspace:Ge,onRetireWorkspace:we,onOpenAgentProfile:Z,onOpenAgentSettings:Se=>$.handleOpenAgentSettings(Se,!0),renderLocalPathValue:Q},communicationSettingsViewProps:{styles:X,showTelegram:p.telegram,showVoice:p.voice,visibleAppSettings:N.visibleAppSettings,isAppSettingsEditing:N.isAppSettingsEditing,appSettingsSaving:N.appSettingsSaving,appSettingsFeedback:N.appSettingsFeedback,onUpdateAppSettingsDraft:N.updateAppSettingsDraft,brokerInspector:Y.brokerInspector,brokerControlPending:Y.brokerControlPending,brokerControlFeedback:Y.brokerControlFeedback,onBrokerControl:Se=>{Y.handleBrokerControl(Se)},relayServiceInspectorRef:J,relayRuntimeBooting:v,relayRuntimeHealthLabel:j,runtime:y,reachableRelayAgentCount:C,voiceCaptureTitle:b?.voice.captureTitle??"Not reported",voiceRepliesEnabled:b?.voice.repliesEnabled??!1,onSetVoiceRepliesEnabled:Se=>{ee(Se)},renderLocalPathValue:Q},database:{styles:X,stats:h,runtime:y,visibleAppSettings:N.visibleAppSettings,renderLocalPathValue:Q,onRevealPath:Se=>{L?.canRevealPath&&q?.revealPath?.(Se)}},appearance:{styles:X,dark:E,setDark:w,showAnnotations:M,setShowAnnotations:D,isCollapsed:H,activeSettingsLabel:f.label}}}}const XM=["~/dev","~/src","~/code"],xo=["welcome","source-roots","harness","confirm","setup","doctor","runtimes"];function KM({activeView:e,settingsSection:r,scoutDesktop:a,shellState:i,surfaceCaps:o,completeOnboardingIntoRelay:u,loadShellState:d}){const[f,p]=z.useState(null),[h,y]=z.useState(null),[b,v]=z.useState(!1),[j,C]=z.useState(!1),[E,w]=z.useState(!1),[M,D]=z.useState(null),[H,X]=z.useState(!1),[q,L]=z.useState(null),[B,F]=z.useState("welcome"),[Z,O]=z.useState(null),[P,Q]=z.useState(null),[oe,J]=z.useState({}),[ee,N]=z.useState(null),[Y,$]=z.useState("checking"),ye=H?h??f:f,T=ye?.projectInventory??[],_=ye?.hiddenProjects??[],le=z.useMemo(()=>Hb(h)!==Hb(f),[h,f]),R=!!ye?.workspaceInventoryLoaded,pe=!!(f&&a?.refreshSettingsInventory),xe=!!(Z==="doctor"||oe.doctor||P?.command==="doctor"),ce=ye?.onboardingContextRoot??ye?.workspaceRoots?.[0]??null,Re=!!ye?.currentProjectConfigPath,Te=(ye?.runtimeCatalog??[]).find(se=>se.name===ye?.defaultHarness)??null,Ne=z.useMemo(()=>new Map((ye?.onboarding.steps??[]).map(se=>[se.id,se.complete])),[ye?.onboarding.steps]),He=z.useMemo(()=>[{id:"welcome",number:"01",title:"Say hi",detail:"Tell Scout what to call you before the rest of setup begins.",complete:Ne.get("welcome")??!1},{id:"source-roots",number:"02",title:"Choose folders to scan",detail:"Pick the parent folders Scout should scan for repos, then choose where this Scout context should live.",complete:Ne.get("source-roots")??!1},{id:"harness",number:"03",title:"Choose a default harness",detail:"This is the assistant family Scout should prefer when a project does not pin one of its own.",complete:Ne.get("harness")??!1},{id:"confirm",number:"04",title:"Confirm this context",detail:"Review which folders Scout will scan and where it will save this context before moving into the command steps.",complete:Ne.get("confirm")??!1},{id:"setup",number:"05",title:"Run setup",detail:"See how Scout writes `.openscout/project.json` at your chosen context root and uses it as this context anchor.",complete:Ne.get("setup")??!1},{id:"doctor",number:"06",title:"Run doctor",detail:"See how Scout combines broker health, scanned folders, and context manifests into one inventory view.",complete:Ne.get("doctor")??!1},{id:"runtimes",number:"07",title:"Run runtimes",detail:"Check whether Claude or Codex is installed, signed in, and ready for broker-owned sessions.",complete:Ne.get("runtimes")??!1}],[Ne]),Le=Math.max(0,xo.indexOf(B)),Ue=He[Le]??He[0],it=Le>0,tt=Le<He.length-1,st=Y==="active"&&!!ye?.onboarding,ot=Y!=="done",bt=z.useCallback((se,Me)=>se?{...Me,operatorName:se.operatorName,onboardingContextRoot:se.onboardingContextRoot,workspaceRoots:se.workspaceRoots,includeCurrentRepo:se.includeCurrentRepo,defaultHarness:se.defaultHarness,defaultTransport:se.defaultTransport,defaultCapabilities:se.defaultCapabilities,sessionPrefix:se.sessionPrefix,telegram:se.telegram}:Me,[]),Ye=z.useCallback(se=>{p(se),y(se),se.workspaceInventoryLoaded&&C(!1)},[]),Ge=z.useCallback(se=>{p(se),y(Me=>H?Me:se),se.workspaceInventoryLoaded&&C(!1)},[H]),We=z.useCallback(se=>{p(se),y(Me=>H?bt(Me,se):se),se.workspaceInventoryLoaded&&C(!1)},[H,bt]),we=z.useCallback(se=>{Ye(se),F("welcome"),Q(null),N(null),X(!0),$("active")},[Ye]),et=z.useCallback(se=>{const Me=ce?` --context-root ${ce}`:"",ze=se==="setup"?(ye?.workspaceRoots??[]).map(nt=>` --source-root ${nt}`).join(""):"";return`scout ${se}${Me}${ze}`},[ce,ye?.workspaceRoots]),Se=z.useCallback(async se=>{if(!a?.getAppSettings)return null;const Me=se?.preferInventory&&a.refreshSettingsInventory?await a.refreshSettingsInventory():await a.getAppSettings();return Ge(Me),Me},[a,Ge]);z.useEffect(()=>{if(!(e==="settings"||e==="help"||Y==="active")||!a?.getAppSettings)return;let Me=!1;return(async()=>{v(!0);try{const nt=await a.getAppSettings();if(Me)return;Ye(nt),Y==="active"&&nt.onboarding.needed?(D(null),X(!0),F(Qt=>Qt||"welcome")):(D(null),X(!1)),Y==="active"&&!nt.onboarding.needed&&(u(i),$("done"))}catch(nt){if(Me)return;p(null),y(null),D(lt(nt)),X(!1),Y!=="done"&&$("done")}finally{Me||v(!1)}})(),()=>{Me=!0}},[e,u,Ye,a,i,Y]),z.useEffect(()=>{let se=!1;return a?.getAppSettings?((async()=>{try{const ze=await a.getAppSettings();if(se)return;p(nt=>nt??ze),y(nt=>nt??ze),ze.onboarding.needed?(D(null),X(!0),F("welcome"),$("active")):$("done")}catch{se||$("done")}})(),()=>{se=!0}):($("done"),()=>{se=!0})},[a]),z.useEffect(()=>{if(e!=="settings"||r!=="workspaces"||!a?.refreshSettingsInventory||!f||f.workspaceInventoryLoaded||j)return;let se=!1;return(async()=>{C(!0);try{const ze=await a.refreshSettingsInventory();se||We(ze)}catch(ze){se||D(lt(ze))}finally{se||C(!1)}})(),()=>{se=!0}},[e,f,We,a,r,j]);const Ze=z.useCallback(()=>{y(f),D(null),X(!0),f?.onboarding.needed&&F("welcome")},[f]),mt=z.useCallback(()=>{y(f),D(null),X(!1)},[f]),ae=z.useCallback(se=>{y(Me=>Me&&se(Me)),D(null)},[]),ge=z.useCallback(async()=>{if(!h||!a?.updateAppSettings)return!1;w(!0);try{const se=await a.updateAppSettings({operatorName:h.operatorName,onboardingContextRoot:h.onboardingContextRoot,workspaceRootsText:h.workspaceRoots.join(`
|
|
88
|
-
`),includeCurrentRepo:h.includeCurrentRepo,defaultHarness:h.defaultHarness,defaultCapabilitiesText:h.defaultCapabilities.join(`
|
|
89
|
-
`),sessionPrefix:h.sessionPrefix,telegram:{enabled:h.telegram.enabled,mode:h.telegram.mode,botToken:h.telegram.botToken,secretToken:h.telegram.secretToken,apiBaseUrl:h.telegram.apiBaseUrl,userName:h.telegram.userName,defaultConversationId:h.telegram.defaultConversationId,ownerNodeId:h.telegram.ownerNodeId}});return Ye(se),D("Settings saved."),X(se.onboarding.needed),$(Me=>Me==="active"?se.onboarding.needed?"active":"done":Me),await d(!1),!0}catch(se){return D(lt(se)),!1}finally{w(!1)}},[h,d,Ye,a]),Ce=z.useCallback(se=>{F(Me=>{const ze=xo.indexOf(Me);if(ze<0)return xo[0];const nt=Math.min(xo.length-1,Math.max(0,ze+se));return xo[nt]})},[]),_e=z.useCallback(async se=>{if(!o?.canProvisionRuntime||!a?.runOnboardingCommand)return D(o&&!o.canProvisionRuntime?"Setup and doctor commands must be run from the Scout CLI (`scout setup`, `scout doctor`) on this host.":null),null;O(se),D(null);try{const Me=(h??f)?.workspaceRoots??[],ze=await a.runOnboardingCommand({command:se,contextRoot:(h??f)?.onboardingContextRoot??Me[0],sourceRoots:se==="setup"?Me:void 0});if(Q(ze),J(nt=>({...nt,[se]:ze})),D(ze.exitCode!==0?`${se} exited with status ${ze.exitCode}. Review the output below before continuing.`:null),a.getAppSettings){const nt=(se==="doctor"||se==="setup")&&a.refreshSettingsInventory?await a.refreshSettingsInventory():await a.getAppSettings();Ye(nt),X(nt.onboarding.needed);const Qt=await d(!1);nt.onboarding.needed?se==="runtimes"&&ze.exitCode===0&&!Qt?.runtime?.brokerReachable?(F("doctor"),D("Relay is still offline. Run doctor again and make sure the broker is reachable before onboarding can finish.")):ze.exitCode===0&&setTimeout(()=>{Ce(1)},1800):u(Qt),$(gn=>gn==="active"?nt.onboarding.needed?"active":"done":gn)}return ze}catch(Me){return D(lt(Me)),null}finally{O(null)}},[f,h,u,d,Ce,a,o]),Xe=z.useCallback(async(se,Me)=>{if(!o?.canEditFilesystem)return D("Project retirement is not available in this host. Use the Scout CLI or desktop app."),!1;if(!a?.retireProject)return D("Project retirement is unavailable in this build."),!1;L(se);try{const ze=await a.retireProject(se);return We(ze),await d(!1),D(`Retired ${Me}. It is hidden from discovery until restored.`),!0}catch(ze){return D(lt(ze)),!1}finally{L(null)}},[We,d,a,o]),Ae=z.useCallback(async se=>{if(!o?.canEditFilesystem)return D("Project restore is not available in this host. Use the Scout CLI or desktop app."),!1;if(!a?.restoreProject)return D("Project restore is unavailable in this build."),!1;L(se.root);try{const Me=await a.restoreProject(se.root);return We(Me),await d(!1),D(`Restored ${se.title}. Scout will discover it again.`),!0}catch(Me){return D(lt(Me)),!1}finally{L(null)}},[We,d,a,o]),ue=z.useCallback(()=>{(async()=>{try{if(!a?.restartOnboarding)return;const se=await a.restartOnboarding();we(se),D("Onboarding restarted.")}catch(se){D(lt(se))}})()},[we,a]),Ee=z.useCallback(se=>{y(Me=>{const ze=Me??f;if(!ze)return Me;const nt=Array.from(new Set([...ze.workspaceRoots,se]));return{...ze,onboardingContextRoot:ze.onboardingContextRoot||se,workspaceRoots:nt}}),D("Project paths updated. Save General to persist the change."),X(!0)},[f]),V=z.useCallback(()=>{H||(y(f),D(null),X(!0))},[f,H]),me=z.useCallback((se,Me)=>{y(ze=>{const nt=ze??f;if(!nt)return ze;const Qt=[...nt.workspaceRoots];for(;Qt.length<=se;)Qt.push("");return Qt[se]=Me,{...nt,onboardingContextRoot:se===0&&(!nt.onboardingContextRoot||nt.onboardingContextRoot===nt.workspaceRoots[0])?Me:nt.onboardingContextRoot,workspaceRoots:Qt}}),D(null),X(!0)},[f]),je=z.useCallback(()=>{y(se=>{const Me=se??f;return Me?{...Me,workspaceRoots:[...Me.workspaceRoots,""]}:se}),D("Project paths updated. Save General to persist the change."),X(!0)},[f]),Fe=z.useCallback(se=>{y(Me=>{const ze=Me??f;if(!ze)return Me;const nt=ze.workspaceRoots[se]??"",Qt=ze.workspaceRoots.filter((ha,Gl)=>Gl!==se),gn=se===0&&(!ze.onboardingContextRoot||ze.onboardingContextRoot===nt)?Qt[0]??"":ze.onboardingContextRoot;return{...ze,onboardingContextRoot:gn,workspaceRoots:Qt}}),D("Project paths updated. Save General to persist the change."),X(!0)},[f]),Je=z.useCallback(se=>{(async()=>{try{if(!o?.canPickDirectory||!a?.pickDirectory)return;const Me=await a.pickDirectory();if(!Me)return;me(se,Me),D("Project paths updated. Save General to persist the change.")}catch(Me){D(lt(Me))}})()},[me,a,o]),qe=z.useCallback(se=>{y(Me=>{const ze=Me??f;return ze?{...ze,onboardingContextRoot:se}:Me}),D(null),X(!0)},[f]),St=z.useCallback(()=>{(async()=>{try{if(!o?.canPickDirectory||!a?.pickDirectory)return;const se=await a.pickDirectory();if(!se)return;qe(se)}catch(se){D(lt(se))}})()},[qe,a,o]),Yt=z.useCallback(()=>{(async()=>{try{if(a?.skipOnboarding){const se=await a.skipOnboarding();Ye(se)}$("done"),D(null),X(!1)}catch(se){D(lt(se))}})()},[Ye,a]),Vt=z.useCallback(()=>{(async()=>{if(Ue.id!=="confirm"){Ce(1);return}if(!le){Ce(1);return}await ge()&&Ce(1)})()},[Ue.id,le,ge,Ce]);z.useEffect(()=>{const se=Ue.id;if(se!=="setup"&&se!=="doctor"&&se!=="runtimes"||Z||oe[se]||!ye||b||se==="doctor"&&!Re)return;const Me=setTimeout(()=>{_e(se)},600);return()=>clearTimeout(Me)},[Ue.id,b,_e,oe,Z,Re,ye]);const Pt=z.useCallback(()=>{if(tt){Ce(1);return}Yt()},[tt,Yt,Ce]),yt=z.useCallback(async se=>{const Me=et(se);await navigator.clipboard.writeText(Me),N(se),window.setTimeout(()=>{N(ze=>ze===se?null:ze)},1500)},[et]),Wt=z.useCallback(()=>{a?.refreshSettingsInventory&&(C(!0),a.refreshSettingsInventory().then(se=>{We(se)}).catch(se=>{D(lt(se))}).finally(()=>{C(!1)}))},[We,a]);return{SOURCE_ROOT_PATH_SUGGESTIONS:XM,appSettings:f,setAppSettings:p,appSettingsDraft:h,appSettingsLoading:b,workspaceInventoryLoading:j,appSettingsSaving:E,appSettingsFeedback:M,setAppSettingsFeedback:D,setAppSettingsDraft:y,isAppSettingsEditing:H,onboardingWizardStep:B,setOnboardingWizardStep:F,onboardingCommandPending:Z,onboardingCommandResult:P,onboardingCommandHistory:oe,onboardingCopiedCommand:ee,startupOnboardingState:Y,setStartupOnboardingState:$,setIsAppSettingsEditing:X,setOnboardingCommandResult:Q,setOnboardingCopiedCommand:N,visibleAppSettings:ye,agentableProjects:T,hiddenProjects:_,appSettingsDirty:le,projectRetirementPendingRoot:q,workspaceInventoryLoaded:R,canRefreshWorkspaceInventory:pe,showDoctorOutput:xe,onboardingContextRoot:ce,onboardingHasProjectConfig:Re,onboardingRuntimeMatch:Te,onboardingWizardSteps:He,onboardingWizardIndex:Le,activeOnboardingStep:Ue,canGoToPreviousOnboardingStep:it,canGoToNextOnboardingStep:tt,startupOnboardingVisible:st,startupOnboardingBlocking:ot,buildOnboardingCommandLine:et,replaceAppSettings:Ye,syncRefreshedAppSettings:Ge,applyNextAppSettings:We,applyRestartedOnboardingSettings:we,refreshVisibleAppSettings:Se,handleStartAppSettingsEdit:Ze,handleCancelAppSettingsEdit:mt,updateAppSettingsDraft:ae,handleSaveAppSettings:ge,moveOnboardingWizard:Ce,handleRunOnboardingCommand:_e,handleRetireProject:Xe,handleRestoreProject:Ae,handleRestartOnboarding:ue,handleAddSourceRootSuggestion:Ee,handleBeginGeneralEdit:V,handleSetSourceRootAt:me,handleAddSourceRootRow:je,handleRemoveSourceRootRow:Fe,handleBrowseForSourceRoot:Je,handleSetOnboardingContextRoot:qe,handleBrowseForOnboardingContextRoot:St,dismissStartupOnboarding:Yt,handleOnboardingContinue:Vt,skipCurrentOnboardingStep:Pt,handleCopyOnboardingCommand:yt,handleLoadWorkspaceInventory:Wt}}function ZM({sidebarWidth:e,messagesDetailWidth:r,isCollapsed:a,onResizeStart:i,onMessagesDetailResizeStart:o,styles:u,messagesState:d,messageThreads:f,selectedMessagesThread:p,onSelectMessageThread:h,showAnnotations:y,setShowAnnotations:b,onRefresh:v,loadingWorkspace:j,selectedMessagesInternalThread:C,selectedMessagesInternalMessages:E,selectedMessagesInternalTarget:w,selectedMessagesDetailAgentId:M,selectedMessagesDetailAgent:D,selectedMessagesSessions:H,selectedSession:X,setSelectedSession:q,formatDate:L,interAgentAgents:B,interAgentAgentLookup:F,relayDirectLookup:Z,openAgentProfile:O,openAgentDirectMessage:P,onNudgeMessage:Q,messagesDetailOpen:oe,setMessagesDetailOpen:J,messagesDetailTab:ee,setMessagesDetailTab:N,selectedRelayKind:Y,selectedRelayId:$,relayThreadTitle:ye,relayThreadSubtitle:T,relayThreadCount:_,selectedRelayDirectThread:le,relayVoiceState:R,visibleRelayMessages:pe,relayTimelineViewportRef:xe,onRelayTimelineScroll:ce,relayReplyTarget:Re,setRelayReplyTarget:Te,relayContextReferences:Ne,relayContextMessageIds:He,setRelayContextMessageIds:Le,relayComposerRef:Ue,relayDraft:it,setRelayDraft:tt,relaySending:st,relayFeedback:ot,relayComposerSelectionStart:bt,setRelayComposerSelectionStart:Ye,mergedRelayMessages:Ge,relayMentionMenuOpen:We,relayMentionSuggestions:we,relayMentionSelectionIndex:et,setRelayMentionSelectionIndex:Se,relayMentionDuplicateTitleCounts:Ze,applyRelayMentionSuggestion:mt,onRelaySend:ae,onToggleVoiceCapture:ge,onSetVoiceRepliesEnabled:Ce,visibleAgentSession:_e,agentSessionPending:Xe,agentSessionFeedback:Ae,agentSessionCopied:ue,onCopyAgentSessionCommand:Ee,onOpenAgentSession:V,onPeekAgentSession:me,onOpenAgentSettings:je,desktopVoiceEnabled:Fe}){return l.jsxs(l.Fragment,{children:[a?null:l.jsx(WM,{sidebarWidth:e,styles:u,messagesState:d,messageThreads:f,selectedMessagesThread:p,onResizeStart:i,onSelectMessageThread:h}),l.jsx("div",{className:"flex-1 flex flex-col relative min-w-0",style:u.surface,children:p?.kind==="internal"?l.jsx(JM,{styles:u,selectedMessagesThread:p,selectedMessagesInternalThread:C,selectedMessagesInternalMessages:E,selectedMessagesInternalTarget:w,showAnnotations:y,setShowAnnotations:b,setMessagesDetailOpen:J,messagesDetailOpen:oe,onRefresh:v,interAgentAgentLookup:F,relayDirectLookup:Z,openAgentProfile:O,openAgentDirectMessage:P,onNudgeMessage:Q}):l.jsx(ez,{styles:u,selectedRelayKind:Y,selectedRelayId:$,relayThreadTitle:ye,relayThreadSubtitle:T,relayThreadCount:_,selectedRelayDirectThread:le,relayVoiceState:R,visibleRelayMessages:pe,relayTimelineViewportRef:xe,onRelayTimelineScroll:ce,relayReplyTarget:Re,setRelayReplyTarget:Te,relayContextReferences:Ne,relayContextMessageIds:He,setRelayContextMessageIds:Le,relayComposerRef:Ue,relayDraft:it,setRelayDraft:tt,relaySending:st,relayFeedback:ot,relayComposerSelectionStart:bt,setRelayComposerSelectionStart:Ye,mergedRelayMessages:Ge,relayMentionMenuOpen:We,relayMentionSuggestions:we,relayMentionSelectionIndex:et,setRelayMentionSelectionIndex:Se,relayMentionDuplicateTitleCounts:Ze,applyRelayMentionSuggestion:mt,showAnnotations:y,setShowAnnotations:b,setMessagesDetailOpen:J,messagesDetailOpen:oe,onRefresh:v,loadingWorkspace:j,onRelaySend:ae,onToggleVoiceCapture:ge,onSetVoiceRepliesEnabled:Ce,interAgentAgentLookup:F,relayDirectLookup:Z,openAgentProfile:O,openAgentDirectMessage:P,onNudgeMessage:Q,desktopVoiceEnabled:Fe})}),oe&&p?l.jsx(nz,{styles:u,messagesDetailWidth:r,selectedMessagesThread:p,selectedMessagesInternalThread:C,selectedMessagesDetailAgentId:M,selectedMessagesDetailAgent:D,selectedMessagesSessions:H,selectedSession:X,setSelectedSession:q,formatDate:L,interAgentAgents:B,messagesDetailTab:ee,setMessagesDetailTab:N,setMessagesDetailOpen:J,onResizeStart:o,openAgentProfile:O,openAgentDirectMessage:P,visibleAgentSession:_e,agentSessionPending:Xe,agentSessionFeedback:Ae,agentSessionCopied:ue,onCopyAgentSessionCommand:Ee,onOpenAgentSession:V,onPeekAgentSession:me,onOpenAgentSettings:je}):null]})}function WM({sidebarWidth:e,styles:r,messagesState:a,messageThreads:i,selectedMessagesThread:o,onResizeStart:u,onSelectMessageThread:d}){return l.jsxs("div",{style:{width:e,...r.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[l.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:u}),l.jsx("div",{className:"px-3 py-2.5 flex items-center justify-between",children:l.jsxs("div",{children:[l.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:r.inkText,children:a?.title??"Messages"}),l.jsx("div",{className:"text-[10px] font-mono mt-0.5",style:r.mutedText,children:a?.subtitle??"Broker unavailable"})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:[["inbox","Inbox"],["channels","Channels"],["agents","Agents"],["internal","Internal"]].map(([f,p])=>{const h=i.filter(y=>y.group===f);return h.length===0?null:l.jsxs("div",{className:"mb-3 px-1.5",children:[l.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:r.mutedText,children:p}),l.jsx("div",{className:"flex flex-col gap-px",children:h.map(y=>{const b=o?.id===y.id,v=y.kind==="relay"&&y.relayDestinationKind==="direct";return l.jsxs("button",{className:`os-rail-row flex items-center gap-2 px-1.5 py-1 rounded cursor-pointer w-full text-left${b?" os-rail-row-active":""}`,style:b?r.activeItem:r.mutedText,onClick:()=>d(y),children:[y.kind==="internal"?l.jsx("div",{className:"w-4 h-4 shrink-0 flex items-center justify-center",children:l.jsx(Ki,{size:12,style:b?{color:g.accent}:r.mutedText})}):v?l.jsxs("div",{className:"relative shrink-0",children:[l.jsx("div",{className:`os-rail-avatar w-4 h-4 rounded text-white flex items-center justify-center font-bold text-[8px] ${y.reachable?"":"opacity-40 grayscale"}`,style:{backgroundColor:cl(y.relayDestinationId??y.id)},children:y.title.charAt(0).toUpperCase()}),y.state?l.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-1.5 h-1.5 rounded-full ${Ro(y.state)}`,style:{border:`1px solid ${g.bg}`}}):null]}):l.jsx(ck,{id:y.relayDestinationId??y.id,active:b}),l.jsxs("div",{className:`flex-1 min-w-0 ${y.reachable?"":"opacity-50"}`,children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("div",{className:"font-medium text-[12px] truncate",children:Ip(y.title)}),y.state==="working"?l.jsx(Ku,{className:"text-[var(--os-accent)]"}):null]}),l.jsx("div",{className:"text-[10px] truncate",style:r.mutedText,children:y.preview??y.subtitle??""})]}),typeof y.count=="number"&&y.count>0?l.jsx("span",{className:"os-row-count text-[9px] font-mono px-1 rounded",style:b?r.activePill:r.tagBadge,children:y.count}):null]},y.id)})})]},f)})})]})}function JM({styles:e,selectedMessagesThread:r,selectedMessagesInternalThread:a,selectedMessagesInternalMessages:i,selectedMessagesInternalTarget:o,showAnnotations:u,setShowAnnotations:d,setMessagesDetailOpen:f,messagesDetailOpen:p,onRefresh:h,interAgentAgentLookup:y,relayDirectLookup:b,openAgentProfile:v,openAgentDirectMessage:j,onNudgeMessage:C}){return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"border-b flex items-center justify-between px-4 py-2 shrink-0 gap-4",style:{...e.surface,borderBottomColor:g.border},children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(Ki,{size:14,style:e.mutedText}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx("h2",{className:"text-[13px] font-semibold tracking-tight truncate",style:e.inkText,children:a?.title??r.title??"Internal"}),a?l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:e.tagBadge,children:a.messageCount}):null]}),l.jsx("div",{className:"text-[10px] truncate mt-0.5",style:e.mutedText,children:a?.subtitle??r.subtitle??"Agent-to-agent coordination"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[o?l.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>j(o.id),children:[l.jsx(Al,{size:11}),l.jsx("span",{children:"Message Agent"})]}):null,l.jsxs("button",{onClick:()=>d(!u),className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:u?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},children:["Annotations ",l.jsx("span",{className:"font-mono uppercase",children:u?"On":"Off"})]}),l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>{h()},children:"Sync"}),l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:p?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},onClick:()=>f(E=>!E),children:"Details"})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-3 pb-6",children:i.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[l.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:l.jsx(Ki,{size:24,style:{color:g.accent}})}),l.jsx("h3",{className:"text-[15px] font-medium mb-1",style:e.inkText,children:"No internal traffic yet"}),l.jsx("p",{className:"text-[13px] max-w-sm",style:e.mutedText,children:"This thread exists, but no visible agent-to-agent messages have been captured yet."})]}):l.jsx("div",{className:"flex flex-col gap-1",children:l.jsx(ko,{messages:i,showAnnotations:u,showStatusMessages:!1,inkStyle:e.inkText,mutedStyle:e.mutedText,tagStyle:e.tagBadge,annotStyle:e.annotBadge,agentLookup:y,directThreadLookup:b,onOpenAgentProfile:v,onOpenAgentChat:j,onNudgeMessage:C})})}),l.jsx("div",{className:"px-4 py-3 shrink-0",style:e.surface,children:l.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Internal Thread"}),l.jsx("div",{className:"text-[11px] mt-1 leading-[1.6]",style:e.mutedText,children:"Internal coordination is read-only here. Open a direct conversation with an agent if you want to intervene."}),o?l.jsxs("button",{type:"button",onClick:()=>j(o.id),className:"mt-3 os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:[l.jsx(Np,{size:11}),"Open Direct Message"]}):null]})}),l.jsx("div",{className:"h-7 border-t flex items-center px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:l.jsx("span",{className:"text-[9px] font-mono",style:e.mutedText,children:"Read-only internal coordination thread inside Messages"})})]})}function ez({styles:e,selectedRelayKind:r,selectedRelayId:a,relayThreadTitle:i,relayThreadSubtitle:o,relayThreadCount:u,selectedRelayDirectThread:d,relayVoiceState:f,visibleRelayMessages:p,relayTimelineViewportRef:h,onRelayTimelineScroll:y,relayReplyTarget:b,setRelayReplyTarget:v,relayContextReferences:j,relayContextMessageIds:C,setRelayContextMessageIds:E,relayComposerRef:w,relayDraft:M,setRelayDraft:D,relaySending:H,relayFeedback:X,relayComposerSelectionStart:q,setRelayComposerSelectionStart:L,mergedRelayMessages:B,relayMentionMenuOpen:F,relayMentionSuggestions:Z,relayMentionSelectionIndex:O,setRelayMentionSelectionIndex:P,relayMentionDuplicateTitleCounts:Q,applyRelayMentionSuggestion:oe,showAnnotations:J,setShowAnnotations:ee,setMessagesDetailOpen:N,messagesDetailOpen:Y,onRefresh:$,loadingWorkspace:ye,onRelaySend:T,onToggleVoiceCapture:_,onSetVoiceRepliesEnabled:le,interAgentAgentLookup:R,relayDirectLookup:pe,openAgentProfile:xe,openAgentDirectMessage:ce,onNudgeMessage:Re,desktopVoiceEnabled:Te}){const Ne=p.at(-1)?.createdAt??null,[He,Le]=z.useState(()=>Date.now());z.useEffect(()=>{if(d?.state!=="working")return;Le(Date.now());const Ge=window.setInterval(()=>{Le(Date.now())},15e3);return()=>window.clearInterval(Ge)},[Ne,d?.activeTask,d?.id,d?.state,d?.statusDetail]);const Ue=d?.state==="working"&&Ne?Math.max(0,He-Ne):0,it=Ue>0?lz(Ue):null,tt=Ue>=9e4,st=d?.activeTask??d?.statusDetail??o??"Agent is still working.",ot=!ye&&p.length===0&&r==="direct",bt=ye?"Loading relay workspace":ot?"Waiting for first relay message":"No relay traffic yet",Ye=ye?"Fetching threads, messages, and agent state for this workspace.":ot?d?.activeTask??d?.statusDetail??"This direct lane is open. Send a message or wait for the agent to speak first.":"Send a message into this lane to wake an agent or start a broker-backed conversation.";return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"border-b flex items-center justify-between px-4 py-2 shrink-0 gap-4",style:{...e.surface,borderBottomColor:g.border},children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx("div",{className:"shrink-0",children:r==="direct"?l.jsx(Np,{size:14,style:e.mutedText}):l.jsx(ck,{id:a,active:!1,size:14})}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx("h2",{className:"text-[13px] font-semibold tracking-tight truncate",style:e.inkText,children:i}),u?l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:e.tagBadge,children:u}):null,d?l.jsx(wM,{thread:d}):null]}),o?l.jsx("div",{className:"text-[10px] truncate mt-0.5",style:e.mutedText,children:o}):null]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[d?l.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>xe(d.id),children:[l.jsx($i,{size:11}),l.jsx("span",{children:"Agent"})]}):null,l.jsxs("button",{onClick:()=>ee(!J),className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:J?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},children:["Annotations ",l.jsx("span",{className:"font-mono uppercase",children:J?"On":"Off"})]}),Te?l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:f?.isCapturing?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},onClick:()=>{_()},title:f?.detail??void 0,children:[f?.captureTitle??"Capture"," ",l.jsx("span",{className:"font-mono uppercase",style:{color:g.accent},children:f?.captureState??"Off"})]}),l.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:f?.repliesEnabled?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},onClick:()=>{le(!(f?.repliesEnabled??!1))},title:f?.detail??void 0,children:["Playback ",l.jsx("span",{className:"font-mono uppercase",style:{color:g.accent},children:f?.speaking?"Speaking":f?.repliesEnabled?"On":"Off"})]})]}):null,l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>{$()},children:"Sync"}),l.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:Y?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},onClick:()=>N(Ge=>!Ge),children:"Details"})]})]}),l.jsx("div",{ref:h,className:"flex-1 overflow-y-auto px-4 py-3 pb-6",onScroll:y,children:p.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[l.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:ye||ot?l.jsx(un,{className:"text-[22px]",style:{color:g.accent}}):l.jsx(Al,{size:24,style:{color:g.accent}})}),l.jsx("h3",{className:"text-[15px] font-medium mb-1",style:e.inkText,children:bt}),l.jsx("p",{className:"text-[13px] max-w-sm",style:e.mutedText,children:Ye})]}):l.jsx("div",{className:"flex flex-col gap-1",children:l.jsx(ko,{messages:p,showAnnotations:J,showStatusMessages:r==="channel"&&a==="system",inkStyle:e.inkText,mutedStyle:e.mutedText,tagStyle:e.tagBadge,annotStyle:e.annotBadge,agentLookup:R,directThreadLookup:pe,onOpenAgentProfile:xe,onOpenAgentChat:ce,onNudgeMessage:Re})})}),d?.state==="working"?l.jsx("div",{className:"px-4 pb-1 shrink-0",style:e.surface,children:l.jsx("div",{className:"rounded-xl border px-3 py-2.5 flex items-start justify-between gap-3",style:{borderColor:tt?"rgba(245,158,11,0.32)":g.border,backgroundColor:tt?"rgba(245,158,11,0.08)":g.bg},children:l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(Ku,{className:"text-[var(--os-accent)] shrink-0"}),l.jsx("span",{className:"text-[11px] font-medium truncate",style:e.inkText,children:tt?"Still working":"Working"}),it?l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:tt?{color:"#b45309",backgroundColor:"rgba(245,158,11,0.14)"}:e.tagBadge,children:tt?`No update for ${it}`:`${it} ago`}):null]}),l.jsx("div",{className:"text-[10px] mt-1 truncate",style:e.mutedText,children:st})]})})}):null,l.jsx(tz,{styles:e,selectedRelayKind:r,selectedRelayId:a,relayVoiceState:f,relayReplyTarget:b,setRelayReplyTarget:v,relayContextReferences:j,relayContextMessageIds:C,setRelayContextMessageIds:E,relayComposerRef:w,relayDraft:M,setRelayDraft:D,relaySending:H,relayComposerSelectionStart:q,setRelayComposerSelectionStart:L,mergedRelayMessages:B,relayMentionMenuOpen:F,relayMentionSuggestions:Z,relayMentionSelectionIndex:O,setRelayMentionSelectionIndex:P,relayMentionDuplicateTitleCounts:Q,applyRelayMentionSuggestion:oe,onRelaySend:T,desktopVoiceEnabled:Te}),l.jsxs("div",{className:"h-7 border-t flex items-center justify-between px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:[l.jsxs("div",{className:"flex items-center gap-3 text-[9px] font-mono",style:e.mutedText,children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{style:e.inkText,children:"@"})," mention agents"]}),F?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-px h-3",style:{backgroundColor:g.border}}),l.jsx("span",{children:"↑↓ select · ↵ or Tab insert"})]}):null,l.jsx("span",{className:"w-px h-3",style:{backgroundColor:g.border}}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("kbd",{className:"font-sans px-1 py-0.5 rounded border text-[9px] font-medium leading-none shadow-sm",style:e.kbd,children:"Cmd+Enter"})," send"]}),X?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-px h-3",style:{backgroundColor:g.border}}),l.jsx("span",{children:X})]}):null]}),l.jsx("div",{className:"flex items-center gap-2 text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:d?.state==="offline"?l.jsx("span",{children:d.statusLabel}):null})]})]})}function tz({styles:e,selectedRelayKind:r,selectedRelayId:a,relayVoiceState:i,relayReplyTarget:o,setRelayReplyTarget:u,relayContextReferences:d,relayContextMessageIds:f,setRelayContextMessageIds:p,relayComposerRef:h,relayDraft:y,setRelayDraft:b,relaySending:v,relayComposerSelectionStart:j,setRelayComposerSelectionStart:C,mergedRelayMessages:E,relayMentionMenuOpen:w,relayMentionSuggestions:M,relayMentionSelectionIndex:D,setRelayMentionSelectionIndex:H,relayMentionDuplicateTitleCounts:X,applyRelayMentionSuggestion:q,onRelaySend:L,desktopVoiceEnabled:B}){return l.jsxs("div",{className:"px-4 py-3 shrink-0",style:e.surface,children:[o?l.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3 rounded-lg border px-3 py-2",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:["Replying to ",o.authorName," · ",So(o.messageId)]}),l.jsx("div",{className:"text-[11px] truncate mt-1",style:e.mutedText,children:o.preview})]}),l.jsx("button",{type:"button",onClick:()=>u(null),className:"shrink-0 rounded p-1 transition-opacity hover:opacity-70",style:e.mutedText,title:"Clear reply context",children:l.jsx(kl,{size:12})})]}):null,d.length>0?l.jsx("div",{className:"mb-2 space-y-2",children:d.map(F=>l.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border px-3 py-2",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:["Context · ",F.authorName," · ",So(F.messageId)]}),l.jsx("div",{className:"text-[11px] truncate mt-1",style:e.mutedText,children:F.preview})]}),l.jsx("button",{type:"button",onClick:()=>p(Z=>Z.filter(O=>O!==F.messageId)),className:"shrink-0 rounded p-1 transition-opacity hover:opacity-70",style:e.mutedText,title:"Clear referenced context",children:l.jsx(kl,{size:12})})]},F.messageId))}):null,l.jsxs("div",{className:"relative",children:[w?l.jsxs("div",{className:"absolute inset-x-0 bottom-full mb-2 rounded-xl border shadow-lg overflow-hidden z-20",style:{backgroundColor:g.surface,borderColor:g.border,boxShadow:g.shadowLg},children:[l.jsx("div",{className:"px-3 py-2 border-b text-[9px] font-mono uppercase tracking-widest",style:{...e.mutedText,borderColor:g.border},children:"Mention an agent"}),l.jsx("div",{className:"max-h-64 overflow-y-auto",children:M.map((F,Z)=>{const O=Z===D,P=az(F),Q=iz(F),oe=(X.get(F.title)??0)>1,J=oe||!!F.harness||!!Q,ee=!!(Q&&Q!==P);return l.jsxs("button",{type:"button",className:"w-full flex items-start justify-between gap-3 px-3 py-2.5 text-left transition-colors",style:{backgroundColor:O?g.bg:"transparent",color:g.ink},onMouseDown:N=>{N.preventDefault(),q(F)},children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-wrap",children:[l.jsx("span",{className:"text-[11px] font-medium truncate",children:F.title}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:F.statusLabel}),J&&P?l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:P}):null,F.harness?l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:F.harness}):null,ee&&Q?l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:Q}):null]}),l.jsxs("div",{className:"text-[10px] mt-1 truncate",style:e.mutedText,children:[F.mentionToken,oe&&F.subtitle?` · ${Ka(F.subtitle)??F.subtitle}`:""]})]}),l.jsx("span",{className:"text-[9px] font-mono shrink-0",style:e.mutedText,children:O?"↵":""})]},F.agentId)})})]}):null,l.jsxs("div",{className:"border rounded flex items-center px-2 py-1 transition-all focus-within:ring-1",style:{backgroundColor:g.bg,borderColor:g.border},children:[l.jsx("textarea",{ref:h,className:"flex-1 bg-transparent outline-none resize-none h-[20px] min-h-[20px] max-h-[80px] text-[12px] leading-tight py-0.5",style:{color:g.ink},placeholder:rz(r,a),rows:1,value:y,onChange:F=>{const Z=fz(F.currentTarget.value,E,f);b(Z.body),C(F.currentTarget.selectionStart??Z.body.length),Z.nextReferenceMessageIds!==f&&p(Z.nextReferenceMessageIds)},onClick:F=>C(F.currentTarget.selectionStart??y.length),onKeyUp:F=>C(F.currentTarget.selectionStart??y.length),onSelect:F=>C(F.currentTarget.selectionStart??y.length),onKeyDown:F=>{if(w){if(F.key==="ArrowDown"){F.preventDefault(),H(Z=>M.length===0?0:(Z+1)%M.length);return}if(F.key==="ArrowUp"){F.preventDefault(),H(Z=>M.length===0?0:(Z-1+M.length)%M.length);return}if(F.key==="Enter"&&!F.metaKey&&!F.ctrlKey&&!F.shiftKey||F.key==="Tab"){F.preventDefault();const Z=M[D]??M[0];Z&&q(Z);return}if(F.key==="Escape"){F.preventDefault(),C(y.length);return}}(F.metaKey||F.ctrlKey)&&F.key==="Enter"&&(F.preventDefault(),L())}}),l.jsxs("div",{className:"shrink-0 flex items-center gap-1 ml-2",children:[B?l.jsx("button",{className:"p-1 opacity-50 cursor-default transition-opacity",style:e.mutedText,title:i?.detail??"Voice unavailable on this desktop host",children:l.jsx(d2,{size:12})}):null,l.jsx("button",{type:"button",className:"shrink-0 flex h-[26px] w-[26px] items-center justify-center rounded-md border transition-opacity hover:opacity-85 disabled:opacity-30 disabled:cursor-not-allowed",style:{borderColor:g.border,backgroundColor:g.surface,color:g.ink},onClick:()=>{L()},disabled:v||!y.trim(),title:"Send","aria-label":"Send message",children:l.jsx(C1,{size:14})})]})]})]})]})}function nz({styles:e,messagesDetailWidth:r,selectedMessagesThread:a,selectedMessagesInternalThread:i,selectedMessagesDetailAgentId:o,selectedMessagesDetailAgent:u,selectedMessagesSessions:d,selectedSession:f,setSelectedSession:p,formatDate:h,interAgentAgents:y,messagesDetailTab:b,setMessagesDetailTab:v,setMessagesDetailOpen:j,onResizeStart:C,openAgentProfile:E,openAgentDirectMessage:w,visibleAgentSession:M,agentSessionPending:D,agentSessionFeedback:H,agentSessionCopied:X,onCopyAgentSessionCommand:q,onOpenAgentSession:L,onPeekAgentSession:B,onOpenAgentSettings:F}){return l.jsxs("div",{className:"relative border-l shrink-0 overflow-y-auto flex flex-col",style:{width:r,...e.surface,borderLeftColor:g.border},children:[l.jsx("div",{className:"absolute left-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:C}),l.jsxs("div",{className:"px-4 py-3 border-b",style:{borderBottomColor:g.border},children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Thread Details"}),l.jsx("div",{className:"text-[13px] font-semibold mt-1 truncate",style:e.inkText,children:a.kind==="internal"?i?.title??a.title:Ip(a.title)}),l.jsx("div",{className:"text-[10px] mt-1 line-clamp-2",style:e.mutedText,children:a.preview??a.subtitle??"Context for the selected thread."})]}),l.jsxs("button",{type:"button",onClick:()=>j(!1),className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded shrink-0",style:{color:g.ink},title:"Hide details",children:[l.jsx(kl,{size:11}),l.jsx("span",{children:"Hide"})]})]}),l.jsx("div",{className:"flex items-center gap-1 mt-3",children:[["overview","Overview"],["live","Live"],["history","History"]].filter(([Z])=>Z!=="live"||!!o).map(([Z,O])=>l.jsx("button",{type:"button",className:"rounded-md px-2.5 py-1.5 text-[11px] font-medium transition-colors",style:b===Z?e.activeItem:e.mutedText,onClick:()=>v(Z),children:O},Z))})]}),l.jsxs("div",{className:"p-4 flex-1 space-y-4",children:[b==="overview"?l.jsxs(l.Fragment,{children:[u?l.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-lg text-white flex items-center justify-center text-[13px] font-bold",style:{backgroundColor:cl(u.id)},children:u.title.charAt(0).toUpperCase()}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"text-[13px] font-semibold truncate",style:e.inkText,children:u.title}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:u.state==="working"?e.activePill:e.tagBadge,children:u.statusLabel})]}),l.jsx("div",{className:"text-[10px] mt-1 line-clamp-2",style:e.mutedText,children:u.summary??u.statusDetail??"No summary yet."})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-3 text-[10px]",children:[l.jsxs("div",{children:[l.jsx("div",{style:e.mutedText,children:"Harness"}),l.jsx("div",{style:e.inkText,children:u.harness??"Unknown"})]}),l.jsxs("div",{children:[l.jsx("div",{style:e.mutedText,children:"Threads"}),l.jsx("div",{style:e.inkText,children:u.threadCount})]}),l.jsxs("div",{children:[l.jsx("div",{style:e.mutedText,children:"Workspace"}),l.jsx("div",{className:"truncate",style:e.inkText,children:u.projectRoot??u.cwd??"Unbound"})]}),l.jsxs("div",{children:[l.jsx("div",{style:e.mutedText,children:"Last Chat"}),l.jsx("div",{style:e.inkText,children:u.lastChatLabel??"No recent chat"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[l.jsxs("button",{type:"button",onClick:()=>w(u.id),className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:[l.jsx(Al,{size:11}),"Message"]}),l.jsxs("button",{type:"button",onClick:()=>{v("live"),B()},className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:[l.jsx(b1,{size:11}),"Peek"]}),l.jsxs("button",{type:"button",onClick:()=>F(u.id,u.profileKind==="project"),className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:[l.jsx($a,{size:11}),"Settings"]})]})]}):null,a.kind==="internal"&&i?l.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Participants"}),l.jsx("div",{className:"flex flex-col gap-2 mt-3",children:i.participants.map(Z=>l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[12px] font-medium truncate",style:e.inkText,children:Z.title}),l.jsx("div",{className:"text-[10px] truncate",style:e.mutedText,children:Z.role??Z.id})]}),y.some(O=>O.id===Z.id)?l.jsx("button",{type:"button",onClick:()=>E(Z.id),className:"text-[10px] font-medium hover:opacity-80",style:{color:g.accent},children:"Open"}):null]},Z.id))})]}):null]}):null,b==="live"?l.jsxs("section",{className:"rounded-xl border overflow-hidden",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsxs("div",{className:"px-3 py-3 border-b flex items-center justify-between gap-2",style:{borderBottomColor:g.border},children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Live Session"}),l.jsx("div",{className:"text-[11px] mt-1",style:e.mutedText,children:"Runtime, tmux, or log tail for the selected agent."})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[M?.commandLabel?l.jsxs("button",{type:"button",onClick:()=>{q()},className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:[l.jsx(Nr,{size:11}),X?"Copied":"Copy"]}):null,o?l.jsxs("button",{type:"button",onClick:()=>{L()},className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:[l.jsx(UN,{size:11}),"Open"]}):null]})]}),l.jsx("div",{className:"p-3",children:D?l.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:e.mutedText,children:[l.jsx(un,{className:"text-[12px]"}),"Loading live session…"]}):M?.body?l.jsx("pre",{className:"max-h-[280px] overflow-y-auto text-[11px] leading-[1.55] whitespace-pre-wrap break-words font-mono",style:{color:g.termFg,backgroundColor:g.termBg,padding:"12px",borderRadius:g.radiusMd},children:M.body}):l.jsx("div",{className:"text-[11px] leading-[1.6]",style:e.mutedText,children:H??"No live session output is available for this thread yet."})})]}):null,b==="history"?l.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Recent History"}),l.jsx("div",{className:"text-[11px] mt-1",style:e.mutedText,children:"Recent sessions tied to this thread or agent."})]}),f?l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:"selected"}):null]}),l.jsx("div",{className:"mt-3 flex flex-col gap-2",children:d.length>0?d.slice(0,8).map(Z=>l.jsx("button",{type:"button",onClick:()=>p(Z),className:"w-full rounded-lg border px-3 py-3 text-left transition-opacity hover:opacity-90",style:{borderColor:g.border,backgroundColor:f?.id===Z.id?g.surface:g.bg},children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[12px] font-medium truncate",style:e.inkText,children:Z.title}),l.jsxs("div",{className:"text-[10px] mt-1",style:e.mutedText,children:[Z.project," · ",Z.messageCount," messages"]}),l.jsx("div",{className:"text-[10px] mt-2 line-clamp-2",style:e.mutedText,children:Z.preview})]}),l.jsx("span",{className:"text-[10px] font-mono shrink-0",style:e.mutedText,children:h(Z.lastModified)})]})},Z.id)):l.jsx("div",{className:"text-[11px] leading-[1.6]",style:e.mutedText,children:"No recent session history is linked to this thread yet."})})]}):null,f?l.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[l.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Selected Session"}),l.jsx("div",{className:"text-[12px] font-medium mt-2",style:e.inkText,children:f.title}),l.jsxs("div",{className:"text-[10px] mt-1",style:e.mutedText,children:[f.project," · ",f.agent]}),l.jsx("div",{className:"text-[11px] mt-2 leading-[1.6]",style:e.mutedText,children:f.preview})]}):null]})]})}function lz(e){const r=Math.floor(e/6e4);return r>=1?`${r}m`:`${Math.max(1,Math.floor(e/1e3))}s`}function rz(e,r){return e==="direct"?"Message direct thread...":e==="filter"&&r==="coordination"?"Message #shared-channel or @agent...":e==="channel"&&r==="voice"?"Message #voice...":e==="channel"&&r==="system"?"Message #system...":"Message #shared-channel..."}function az(e){return sz(e.subtitle)??e.workspaceQualifier??null}function iz(e){const r=e.branch?.trim();return r&&r!=="HEAD"?r:e.workspaceQualifier?.trim()||null}function sz(e){if(!e)return null;const r=e.replace(/[\\/]+$/,"");return r?r.split(/[\\/]/).filter(Boolean).at(-1)??null:null}function dk(){return/\b(?:message:[a-zA-Z0-9._:-]+|m:[a-z0-9]{4,12})\b/gi}function oz(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function cz(e,r){const a=e.trim().toLowerCase();if(!a)return null;if(a.startsWith("message:")){const u=e.slice(e.indexOf(":")+1).trim();return r.find(d=>d.id===u)??null}if(!a.startsWith("m:"))return null;const i=a.slice(2);if(!i)return null;const o=r.filter(u=>oz(u.id).endsWith(i));return o.length===1?o[0]:null}function uz(e,r){if(r.length===0)return e;const a=new Set(r.map(o=>o.toLowerCase()));return e.replace(dk(),o=>a.has(o.toLowerCase())?" ":o).split(/\r?\n/g).map(o=>o.replace(/[ \t]{2,}/g," ").trim()).filter((o,u,d)=>o.length>0||u>0&&u<d.length-1).join(`
|
|
90
|
-
`).trim()}function dz(e,r){return e.length!==r.length?!1:e.every((a,i)=>a===r[i])}function fz(e,r,a){const i=e.match(dk())??[];if(i.length===0)return{body:e,nextReferenceMessageIds:a};const o=[...a],u=[];for(const f of i){const p=cz(f,r);p&&(u.push(f),o.includes(p.id)||o.push(p.id))}return{body:uz(e,u),nextReferenceMessageIds:dz(o,a)?a:o}}function mz({activeView:e,layout:r,threading:a,composer:i,agentSession:o}){return e!=="messages"&&e!=="relay"?null:l.jsx(ZM,{...r,...a,...i,...o})}function pz({activeView:e,scoutDesktop:r,voiceEnabled:a,relayState:i,messagesState:o,interAgentAgents:u,interAgentThreads:d,sessions:f,appSettings:p,setActiveView:h,applyRelayWorkspacePatch:y}){const[b,v]=z.useState("channel"),[j,C]=z.useState("shared"),[E,w]=z.useState(null),[M,D]=z.useState(""),[H,X]=z.useState(!1),[q,L]=z.useState(0),[B,F]=z.useState(0),[Z,O]=z.useState(null),[P,Q]=z.useState(!0),[oe,J]=z.useState(null),[ee,N]=z.useState([]),[Y,$]=z.useState([]),[ye,T]=z.useState(0),_=z.useRef(null),le=z.useRef(null),R=o?.threads??[],pe=z.useMemo(()=>R.find(V=>V.id===E)??null,[R,E]),xe=z.useMemo(()=>pe?.interAgentThreadId?d.find(V=>V.id===pe.interAgentThreadId)??null:null,[d,pe]),ce=z.useMemo(()=>{if(!xe)return null;const V=xe.participants.map(je=>je.id),me=i?.directs.find(je=>V.includes(je.id))?.id??null;return me?u.find(je=>je.id===me)??null:null},[u,i,xe]),Re=pe?.kind==="relay"&&b==="direct"?j:ce?.id??null;z.useEffect(()=>{if(!i)return;const V=qb(i),me=GS(i),je=[...V.map(Je=>`${Je.kind}:${Je.id}`),...me.map(Je=>`${Je.kind}:${Je.id}`),...i.directs.map(Je=>`${Je.kind}:${Je.id}`)],Fe=`${b}:${j}`;je.includes(Fe)||(v("channel"),C("shared"))},[i,j,b]),z.useEffect(()=>{const V=_.current;if(!V)return;const me=120;V.style.height="0px";const je=Math.min(V.scrollHeight,me);V.style.height=`${je}px`,V.style.overflowY=V.scrollHeight>me?"auto":"hidden"},[M]),z.useEffect(()=>{if(e!=="relay"&&e!=="messages"||ye===0)return;const V=_.current;if(!V)return;const me=window.requestAnimationFrame(()=>{V.focus();const je=V.value.length;V.setSelectionRange?.(je,je)});return()=>{window.cancelAnimationFrame(me)}},[e,ye]),z.useEffect(()=>{oe&&(b!=="direct"||j!==oe.authorId)&&J(null)},[oe,j,b]),z.useEffect(()=>{if(!i?.messages.length)return;const V=new Set(i.messages.map(me=>me.clientMessageId).filter(me=>!!me));V.size&&$(me=>me.filter(je=>!V.has(je.clientMessageId)))},[i]);const Te=z.useMemo(()=>qb(i).filter(V=>a||!(V.kind==="channel"&&V.id==="voice")),[i,a]),Ne=i&&b==="direct"?i.directs.find(V=>V.id===j)??null:null,He=i?$S(i,Te,b,j):null,Le=z.useMemo(()=>{const V=i?.messages??[];if(!Y.length)return V;const me=new Set(V.map(Fe=>Fe.clientMessageId).filter(Fe=>!!Fe)),je=Y.filter(Fe=>!me.has(Fe.clientMessageId)).map(Fe=>Fe.message);return je.length?[...V,...je].sort((Fe,Je)=>Fe.createdAt-Je.createdAt||Fe.id.localeCompare(Je.id)):V},[Y,i]),Ue=z.useMemo(()=>YS(Le,b,j),[Le,j,b]),it=z.useMemo(()=>new Map(Le.map(V=>[V.id,V])),[Le]),tt=z.useMemo(()=>ee.map(V=>it.get(V)).filter(V=>!!V).map(V=>({messageId:V.id,authorName:V.authorName,preview:zu(V.body,96)})),[ee,it]),st=Ip(He?.title??"# shared-channel"),ot=Ne?pv(Ne):He?.subtitle??null,bt=He&&"count"in He&&He.count>0?He.count:null,Ye=Ue.at(-1)??null,Ge=z.useMemo(()=>u.flatMap(V=>{const me=V.selector??V.defaultSelector;return me?[{agentId:V.id,title:V.title,subtitle:V.projectRoot??V.cwd??V.subtitle??null,mentionToken:me,definitionId:V.definitionId,workspaceQualifier:V.workspaceQualifier,branch:V.branch,harness:V.harness,state:V.state,statusLabel:V.statusLabel,searchText:[V.title,V.id,V.definitionId??"",me,V.selector??"",V.defaultSelector??"",V.workspaceQualifier??"",V.branch??"",V.harness??"",V.projectRoot??"",V.cwd??""].join(" ").toLowerCase()}]:[]}).sort((V,me)=>V.title.localeCompare(me.title)),[u]);z.useEffect(()=>{Q(!0);const V=le.current;V&&window.requestAnimationFrame(()=>{V.scrollTo({top:V.scrollHeight,behavior:"auto"})})},[j,b]),z.useEffect(()=>{if(!P)return;const V=le.current;V&&window.requestAnimationFrame(()=>{V.scrollTo({top:V.scrollHeight,behavior:"smooth"})})},[Ye?.body,Ye?.id,Ye?.receipt?.state,Ne?.activeTask,Ne?.state,P]);const We=z.useCallback(V=>{const me=V.currentTarget,je=me.scrollHeight-me.scrollTop-me.clientHeight;Q(je<=48)},[]),we=z.useMemo(()=>WS(M,q),[M,q]),et=z.useMemo(()=>{if(!we)return[];const V=b==="direct"?j:null;return Ge.map(me=>({candidate:me,score:JS(me,we.query,V)})).filter(({score:me})=>me>0).sort((me,je)=>je.score-me.score||me.candidate.title.localeCompare(je.candidate.title)).slice(0,8).map(({candidate:me})=>me)},[we,Ge,j,b]),Se=z.useMemo(()=>Ge.reduce((V,me)=>(V.set(me.title,(V.get(me.title)??0)+1),V),new Map),[Ge]),Ze=et.length>0;z.useEffect(()=>{if(!Ze){F(0);return}F(V=>Math.min(V,et.length-1))},[Ze,et.length]);const mt=z.useMemo(()=>{if(!xe)return[];const V=new Set(xe.messageIds);return Le.filter(me=>V.has(me.id))},[Le,xe]),ae=Re?u.find(V=>V.id===Re)??null:null,ge=z.useMemo(()=>{if(ae)return f.filter(V=>V.project===ae.id||V.agent===ae.title);if(xe){const V=new Set(xe.participants.map(je=>je.id)),me=new Set(xe.participants.map(je=>je.title));return f.filter(je=>V.has(je.project)||me.has(je.agent))}return pe?.relayDestinationKind==="channel"&&pe.relayDestinationId?f.filter(V=>V.tags?.includes(pe.relayDestinationId??"")??!1):f.slice(0,8)},[ae,xe,pe,f]),Ce=z.useCallback((V,me)=>{v(V),C(me),w(o?.threads.find(je=>je.relayDestinationKind===V&&je.relayDestinationId===me)?.id??null),h("messages")},[o,h]),_e=z.useCallback(V=>{if(!we)return;const me=M.slice(we.end),je=me.startsWith(" ")||me.length===0?"":" ",Fe=`${M.slice(0,we.start)}${V.mentionToken}${je}${me}`,Je=we.start+V.mentionToken.length+je.length;D(Fe),L(Je),F(0),window.requestAnimationFrame(()=>{const qe=_.current;qe&&(qe.focus(),qe.setSelectionRange(Je,Je))})},[we,M]),Xe=z.useCallback(async()=>{const V=M.trim();if(!V||H||!r?.sendRelayMessage)return;const me=M,je=oe,Fe=ee,Je=RM(),qe=oe?.messageId??ee[0]??null,St=AM({relayState:i,appSettings:p,destinationKind:b,destinationId:j,body:V,replyToMessageId:qe,clientMessageId:Je});X(!0),O("Sending…"),$(Yt=>[...Yt,{clientMessageId:Je,message:St}]),D(""),J(null),N([]);try{const Yt=await r.sendRelayMessage({destinationKind:b,destinationId:j,body:V,replyToMessageId:qe,referenceMessageIds:ee,clientMessageId:Je});y(Yt),$(Vt=>Vt.map(Pt=>Pt.clientMessageId===Je?{...Pt,message:{...Pt.message,receipt:Pt.message.receipt?{...Pt.message.receipt,label:"Sent",detail:null}:{state:"sent",label:"Sent",detail:null}}}:Pt)),O("Sent.")}catch(Yt){$(Vt=>Vt.filter(Pt=>Pt.clientMessageId!==Je)),D(me),J(je),N(Fe),O(lt(Yt))}finally{X(!1)}},[p,M,H,ee,i,oe,r,j,b,y]),Ae=z.useCallback((V,me)=>{Ce("direct",V),N([]),J(me?.replyToMessage?{messageId:me.replyToMessage.id,authorId:me.replyToMessage.authorId,authorName:me.replyToMessage.authorName,preview:zu(me.replyToMessage.body,96)}:null),typeof me?.draft=="string"&&D(me.draft),me?.focusComposer&&T(je=>je+1)},[Ce]),ue=z.useCallback(V=>{V.isOperator||(Ae(V.authorId,{replyToMessage:V,draft:"Following up on this.",focusComposer:!0}),O(`Drafting a follow-up to ${V.authorName}.`))},[Ae]),Ee=z.useCallback((V,me)=>{Ae(V,{draft:me??null,focusComposer:!0})},[Ae]);return{selectedConversationKind:b,setSelectedConversationKind:v,selectedConversationId:j,setSelectedConversationId:C,selectedMessageThreadId:E,setSelectedMessageThreadId:w,selectedMessagesThread:pe,selectedMessagesInternalThread:xe,selectedMessagesInternalTarget:ce,selectedMessagesDetailAgentId:Re,selectedMessagesDetailAgent:ae,selectedMessagesInternalMessages:mt,selectedMessagesSessions:ge,composerDraft:M,setComposerDraft:D,composerSending:H,composerSelectionStart:q,setComposerSelectionStart:L,mentionSelectionIndex:B,setMentionSelectionIndex:F,messagesFeedback:Z,setMessagesFeedback:O,replyTarget:oe,setReplyTarget:J,contextMessageIds:ee,setContextMessageIds:N,composerRef:_,timelineViewportRef:le,mergedConversationMessages:Le,visibleConversationMessages:Ue,currentConversationTitle:st,currentConversationSubtitle:ot,currentConversationCount:bt,selectedDirectConversation:Ne,contextReferences:tt,mentionMenuOpen:Ze,mentionSuggestions:et,mentionDuplicateTitleCounts:Se,handleConversationTimelineScroll:We,openConversation:Ce,applyMentionSuggestion:_e,sendMessage:Xe,openDirectConversation:Ae,nudgeMessage:ue,openAgentDirectMessage:Ee,messageThreads:R}}const hz=["profile","knowledge","agents","workspaces","communication","database","appearance"];function xz(e){return hz.includes(e)}function gz(e,r){const a=r?.agentId?.trim();return e==="agents"&&a?`/settings/agents/${encodeURIComponent(a)}`:`/settings/${e}`}function bz(e){if(e==="/settings"||e==="/settings/")return{section:"profile",agentId:null};if(!e.startsWith("/settings/"))return null;const r=e.slice(10).split("/").filter(Boolean),a=r[0]??"";if(!a)return{section:"profile",agentId:null};if(!xz(a))return null;if(a!=="agents")return r.length===1?{section:a,agentId:null}:null;if(r.length===1)return{section:"agents",agentId:null};if(r.length===2)try{return{section:"agents",agentId:decodeURIComponent(r[1]??"")||null}}catch{return null}return null}const yz=["overview","inbox","activity","machines","plans","sessions","search","messages","relay","inter-agent","agents","logs","settings","help"];function vz(e){return e!==null&&yz.includes(e)}function kz(e){if(e==="/")return"overview";const r=e.slice(1).split("/")[0]??"";return!r||r==="pairing"||r==="settings"?null:vz(r)?r:null}function jz(e,r,a,i){return e==="pairing"?"/pairing":r==="settings"?gz(a,{agentId:i}):r==="overview"?"/":`/${r}`}const Nz={enableAll:!1,overview:!0,inbox:!0,relay:!0,pairing:!0,interAgent:!0,agents:!0,settings:!0,logs:!0,activity:!1,machines:!1,plans:!1,sessions:!0,search:!0,phonePreparation:!1,telegram:!1,voice:!1,monitor:!1},r1=["claude","codex"],fk="scout.desktop.home-cache.v1";function wz(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(fk);return e?JSON.parse(e):null}catch{return null}}function Sz(e){if(!(typeof window>"u"))try{window.localStorage.setItem(fk,JSON.stringify({...e,savedAt:Date.now()}))}catch{}}function gu(e,r,a){const i={label:e,durationMs:Math.round(performance.now()-r),recordedAt:Date.now(),detail:a};return console.info(`[scout] ${e}`,{durationMs:i.durationMs,...a}),i}function bu(e,r){const a={...e};return r&&(a.Total=`${r.totalMs}ms`,r.steps.forEach(i=>{a[i.label]=`${i.durationMs}ms`})),Object.keys(a).length>0?a:void 0}function yu(e){return{runtime:e.runtime,messages:e.messages,sessions:e.sessions,relay:e.relay,interAgent:e.interAgent,performance:e.performance??null}}function Cz(e,r){return{...r,planCount:e.planCount,workspaceCount:e.workspaceCount,plans:e.plans,subtitle:`${r.taskCount} asks · ${r.findingCount} findings · ${e.planCount} plans · ${e.workspaceCount} workspaces`}}function Tz(){const e=UM(),[r,a]=A.useState(240),[i,o]=A.useState(340),[u,d]=A.useState(!1),[f,p]=A.useState("relay"),[h,y]=A.useState("overview"),[b,v]=A.useState(""),[j,C]=A.useState(null),[E,w]=A.useState(null),[M,D]=A.useState(!0),[H,X]=A.useState("overview"),[q,L]=A.useState(null),[B,F]=A.useState(null),[Z,O]=A.useState(null),[P,Q]=A.useState(null),[oe,J]=A.useState(null),[ee,N]=A.useState({services:null,home:null,workspace:null}),[Y,$]=A.useState(!1),[ye,T]=A.useState(!0),[_,le]=A.useState(!1),[R,pe]=A.useState(!1),[xe,ce]=A.useState(null),[Re,Te]=A.useState(!1),[Ne,He]=A.useState(!1),[Le,Ue]=A.useState("profile"),[it,tt]=A.useState(null),st=A.useRef(null),ot=A.useRef(null),bt=A.useRef(!1),Ye=eN(),Ge=d1();A.useLayoutEffect(()=>{if(!Ge.pathname.startsWith("/settings"))return;const I=bz(Ge.pathname);if(I){p("relay"),y("settings"),Ue(I.section),tt(I.agentId);return}Ye("/settings/profile",{replace:!0})},[Ge.pathname,Ye]),A.useLayoutEffect(()=>{if(Ge.pathname.startsWith("/settings"))return;if(Ge.pathname==="/pairing"){p("pairing"),y(W=>W==="settings"?"overview":W);return}const I=kz(Ge.pathname);if(I){p("relay"),y(I);return}Ye("/",{replace:!0})},[Ge.pathname,Ye]),A.useEffect(()=>{const I=jz(f,h,Le,it);Ge.pathname!==I&&Ye(I,{replace:!0})},[h,Ge.pathname,Ye,f,it,Le]);const We=z.useCallback(()=>{p("relay"),y("help"),Ht(null)},[]),[we,et]=A.useState(!1),[Se,Ze]=A.useState(!1),[mt,ae]=A.useState(!1),ge=A.useRef(null),Ce=A.useRef(null),_e=A.useRef(null),Xe=A.useRef(!1),Ae=A.useRef(!1),ue=A.useRef(!1),Ee=A.useRef(!1),V=f==="relay"&&(h==="messages"||h==="relay"),me=V?P?.sessions??oe?.sessions??[]:oe?.sessions??[],je=oe?.machines??null,Fe=oe?.plans??null,Je=V?P?.messages??oe?.messages??null:oe?.messages??null,qe=V?P?.runtime??oe?.runtime??null:oe?.runtime??null,St=V?P?.relay??oe?.relay??null:oe?.relay??null,Yt=V?P?.interAgent??oe?.interAgent??null:oe?.interAgent??null,Vt=Yt?.agents??[],Pt=Yt?.threads??[],yt=q?.features??oe?.appInfo.features??Nz,Wt=q?.capabilities??oe?.appInfo.capabilities;A.useEffect(()=>{st.current=B},[B]),A.useEffect(()=>{ot.current=Z},[Z]);const se=z.useCallback((I,W)=>{Sz({homeState:I,servicesState:W})},[]),Me=z.useCallback(async()=>{if(!e?.getServicesState||Ae.current)return null;const I=performance.now();$(!0),Ae.current=!0;try{const W=await e.getServicesState();return O(W),se(st.current,W),N(be=>({...be,services:gu("services-state",I,bu({serviceCount:W.services.length},W.performance))})),W}catch(W){return ce(lt(W)),null}finally{Ae.current=!1,$(!1)}},[se,e]),ze=z.useCallback(async(I=!1)=>{if(!e?.getHomeState)return ce("Desktop bridge is unavailable."),T(!1),null;if(Xe.current)return null;I&&T(!0);const W=performance.now();Xe.current=!0;try{const be=await e.getHomeState();return F(be),ce(null),se(be,ot.current),N(At=>({...At,home:gu("home-state",W,bu({agents:be.agents.length,activity:be.activity.length},be.performance))})),be}catch(be){return ce(lt(be)),null}finally{Xe.current=!1,T(!1)}},[se,e]),nt=z.useCallback(async(I=!1)=>{if(!e?.getMessagesWorkspaceState)return ce("Desktop bridge is unavailable."),le(!1),null;if(ue.current)return null;I&&le(!0),ue.current=!0;const W=performance.now();try{const be=await e.getMessagesWorkspaceState();return Q(be),ce(null),N(At=>({...At,workspace:gu("messages-workspace",W,bu({threads:be.messages.threads.length,messages:be.relay.messages.length,agents:be.interAgent.agents.length,sessions:be.sessions.length},be.performance))})),be}catch(be){return ce(lt(be)),null}finally{ue.current=!1,le(!1)}},[e]),Qt=z.useCallback(async(I=!1)=>{if(!e?.getShellState)return ce("Desktop bridge is unavailable."),pe(!1),null;if(Ee.current)return null;I&&pe(!0),Ee.current=!0;const W=performance.now();try{const be=await e.getShellState();return J(be),ce(null),N(At=>({...At,workspace:gu("relay-workspace",W,bu({messages:be.relay.messages.length,agents:be.interAgent.agents.length,sessions:be.sessions.length},be.performance))})),be}catch(be){return ce(lt(be)),null}finally{Ee.current=!1,pe(!1)}},[e]),gn=z.useCallback(I=>{J(W=>W&&{...W,...I,relay:{...I.relay,voice:W.relay.voice},plans:Cz(W.plans,I.plans)}),Q(W=>W&&{...W,...yu(I),relay:{...I.relay,voice:W.relay.voice}})},[]);A.useEffect(()=>{if(!e?.getAppInfo)return;let I=!1;return(async()=>{try{const be=await e.getAppInfo();I||L(be)}catch{I||L(null)}})(),()=>{I=!0}},[e]),A.useEffect(()=>{if(e?.onOpenKnowledgeBase)return e.onOpenKnowledgeBase(We)},[We,e]);const ha=z.useCallback(I=>{const W=I?.runtime?.brokerReachable??Z?.services.find(be=>be.id==="broker")?.reachable??!1;if(p("relay"),W){y("messages"),Jn("channel"),Wl("shared"),kn("Relay is running."),Ht(null);return}y("settings"),Ue("communication"),et(!0),Ht("Relay is not running yet. Finish onboarding by starting the broker from Communication.")},[Z]),Gl=KM({activeView:h,settingsSection:Le,scoutDesktop:e,shellState:oe,surfaceCaps:Wt,completeOnboardingIntoRelay:ha,loadShellState:Qt}),{SOURCE_ROOT_PATH_SUGGESTIONS:xa,appSettings:bn,setAppSettings:Wa,appSettingsLoading:ga,workspaceInventoryLoading:Un,appSettingsSaving:$t,appSettingsFeedback:dn,setAppSettingsFeedback:Ht,setAppSettingsDraft:$l,isAppSettingsEditing:Ml,onboardingWizardStep:Yl,setOnboardingWizardStep:ns,onboardingCommandPending:Wn,onboardingCommandResult:zl,onboardingCommandHistory:dl,onboardingCopiedCommand:Ol,startupOnboardingState:Sr,setIsAppSettingsEditing:Ll,visibleAppSettings:Ft,agentableProjects:ba,appSettingsDirty:ya,projectRetirementPendingRoot:Dl,workspaceInventoryLoaded:Ql,canRefreshWorkspaceInventory:Lo,showDoctorOutput:ls,onboardingContextRoot:Ja,onboardingHasProjectConfig:rs,onboardingRuntimeMatch:Xl,onboardingWizardSteps:_l,onboardingWizardIndex:Hn,activeOnboardingStep:Xt,canGoToPreviousOnboardingStep:ei,canGoToNextOnboardingStep:ve,startupOnboardingVisible:Ke,startupOnboardingBlocking:zt,buildOnboardingCommandLine:yn,applyNextAppSettings:ti,applyRestartedOnboardingSettings:vn,refreshVisibleAppSettings:Cr,handleStartAppSettingsEdit:_n,handleCancelAppSettingsEdit:Tr,updateAppSettingsDraft:va,handleSaveAppSettings:Zu,moveOnboardingWizard:Do,handleRunOnboardingCommand:Kl,handleRestoreProject:ih,handleRestartOnboarding:Wu,handleAddSourceRootSuggestion:_o,handleSetSourceRootAt:as,handleAddSourceRootRow:Ju,handleRemoveSourceRootRow:ed,handleBrowseForSourceRoot:ni,handleSetOnboardingContextRoot:Nl,handleBrowseForOnboardingContextRoot:is,dismissStartupOnboarding:ss,handleOnboardingContinue:Ar,skipCurrentOnboardingStep:Er,handleCopyOnboardingCommand:Bo,handleLoadWorkspaceInventory:Io}=Gl,os=pz({activeView:h,scoutDesktop:e,voiceEnabled:yt.voice,relayState:St,messagesState:Je,interAgentAgents:Vt,interAgentThreads:Pt,sessions:me,appSettings:bn,setActiveView:y,applyRelayWorkspacePatch:gn}),{selectedConversationKind:Zl,setSelectedConversationKind:Jn,selectedConversationId:ka,setSelectedConversationId:Wl,selectedMessageThreadId:En,setSelectedMessageThreadId:Jl,selectedMessagesThread:li,selectedMessagesDetailAgentId:Po,messagesFeedback:cs,setMessagesFeedback:kn,mergedConversationMessages:ja,openConversation:jn,openDirectConversation:er}=os,{pairingState:Rr,pairingLoading:Mr,pairingError:Uo,setPairingError:us,pairingControlPending:ds,pairingConfigPending:Na,pairingApprovalPendingId:ri,pairingConfigFeedback:Ho,setPairingConfigFeedback:td,pendingApprovals:ai,commitPairingState:nd,refreshPairingState:fs,handlePairingControl:ld,handleUpdatePairingConfig:rd,handleDecidePairingApproval:ms}=GM({pairingEnabled:yt.pairing,scoutDesktop:e,setRelayFeedback:kn}),ad=DS(Rr,Mr,Uo),id=$M({activeView:h,scoutDesktop:e,sessions:me}),ii=VM({activeView:h,settingsSection:Le,scoutDesktop:e,surfaceCaps:Wt,pendingBrokerInspectorFocus:we,setPendingBrokerInspectorFocus:et,relayServiceInspectorRef:_e,loadShellState:Qt,setShellState:J,setShellError:ce,applyRestartedOnboardingSettings:vn,commitPairingState:nd,pairingState:Rr,setAppSettingsFeedback:Ht,setRelayFeedback:kn,setPairingError:us,setPairingConfigFeedback:td}),{isFeedbackDialogOpen:sd,feedbackBundle:od,feedbackBundleLoading:cd,feedbackBundleError:ud,feedbackDraft:ps,setFeedbackDraft:dd,feedbackSubmission:fd,feedbackActionPending:md,feedbackActionMessage:Fo,refreshLogs:pd,refreshBrokerInspector:hd,openFeedbackDialog:qo,handleFeedbackDialogOpenChange:xd,handleRefreshFeedbackBundle:gd,handleCopyFeedbackBundle:bd,handleSubmitFeedbackReport:yd,handleRepairSetup:vd}=ii,hs=FM({activeView:h,scoutDesktop:e,surfaceCaps:Wt,interAgentState:Yt,interAgentAgents:Vt,interAgentThreads:Pt,relayState:St,selectedMessagesThread:li,selectedMessagesDetailAgentId:Po,selectedRelayKind:Zl,selectedRelayId:ka,agentableProjects:ba,visibleAppSettings:Ft,isAppSettingsEditing:Ml,appSettingsDirty:ya,setAppSettings:Wa,setAppSettingsDraft:$l,setActiveView:y,setSettingsSection:Ue,setSettingsAgentId:tt,setShellState:J,setShellError:ce,setRelayFeedback:kn}),{selectedInterAgentId:pn,selectedInterAgentThreadId:zr,setSelectedInterAgentThreadId:xs,selectedInterAgent:Fn,visibleInterAgentThreads:gs,selectedInterAgentThread:el,handleSelectInterAgent:tr,deactivateAgentConfigEdit:wa,isCreateAgentDialogOpen:Or,setIsCreateAgentDialogOpen:kd,createAgentDraft:jd,setCreateAgentDraft:Nd,createAgentDefaults:Vo,createAgentSubmitting:Go,createAgentFeedback:Sa,setCreateAgentFeedback:Ca,handleOpenCreateAgentDialog:sh,handleBrowseCreateAgentProject:si,handleCreateAgent:$o,visibleAgentSession:Yo,agentSessionPending:bs,agentSessionLoading:ys,agentSessionFeedback:Qo,agentSessionCopied:Xo,isAgentSessionPeekOpen:Ko,closeAgentSessionPeek:wd,agentSessionPeekViewportRef:Sd,handlePeekAgentSessionScroll:Cd,handleOpenAgentSession:Td,handleCopyAgentSessionCommand:Ad,handlePeekAgentSession:qn,refreshAgentSession:Ta}=hs;A.useEffect(()=>{if(!(h!=="settings"||Le!=="agents")){if(!it){wa();return}pn!==it&&tr(it)}},[h,wa,tr,pn,it,Le]);const Bl=f==="relay"&&(h==="inbox"||h==="activity"||h==="machines"||h==="plans"||h==="sessions"||h==="search"||h==="inter-agent"||h==="agents"||h==="logs"||h==="settings"&&(Le==="agents"||Le==="communication"||Le==="database")),Zo=f==="relay"&&(h==="inbox"||h==="activity"||h==="messages"||h==="relay"||h==="agents"||h==="inter-agent"||h==="sessions"||h==="search");A.useEffect(()=>{if(bt.current||!e)return;bt.current=!0;const I=wz();I?.servicesState&&O(I.servicesState),I?.homeState&&(F(I.homeState),T(!1)),Me(),ze(!I?.homeState)},[ze,Me,e]),A.useEffect(()=>{if(!(zt||!V||P)){if(oe){Q(yu(oe));return}nt(!0)}},[nt,V,P,oe,zt]),A.useEffect(()=>{zt||!Bl||oe||Qt(!0)},[Qt,Bl,oe,zt]),A.useEffect(()=>{const I=Je?.threads??[];if(I.length===0){En!==null&&Jl(null);return}if(En&&I.some(be=>be.id===En))return;const W=I.find(be=>be.relayDestinationKind===Zl&&be.relayDestinationId===ka)??I.find(be=>be.interAgentThreadId===zr)??I[0];W&&W.id!==En&&Jl(W.id)},[Je,ka,Zl,zr,En,Jl]),A.useEffect(()=>{En&&(D(!0),X("overview"))},[En]),A.useEffect(()=>{if(h!=="settings"||!Ml)return;const I=Ce.current;if(!I)return;const W=window.requestAnimationFrame(()=>{I.focus(),I.select()});return()=>{window.cancelAnimationFrame(W)}},[h,Ml]);const vs=A.useMemo(()=>{const I=new Map;return me.forEach(W=>{const be=I.get(W.project);!be||new Date(W.lastModified)>new Date(be.lastModified)?I.set(W.project,{count:(be?.count||0)+1,lastModified:W.lastModified}):be&&I.set(W.project,{...be,count:be.count+1})}),Array.from(I.entries()).map(([W,be])=>({name:W,...be}))},[me]),Wo=A.useMemo(()=>{let I=me;if(j&&(I=I.filter(W=>W.project===j)),b){const W=b.toLowerCase();I=I.filter(be=>be.title.toLowerCase().includes(W)||be.preview.toLowerCase().includes(W)||be.tags?.some(At=>At.toLowerCase().includes(W))||be.agent.toLowerCase().includes(W)||be.project.toLowerCase().includes(W))}return I.sort((W,be)=>new Date(be.lastModified).getTime()-new Date(W.lastModified).getTime())},[me,b,j]),oi=A.useMemo(()=>({totalSessions:me.length,totalMessages:me.reduce((I,W)=>I+W.messageCount,0),totalTokens:me.reduce((I,W)=>I+(W.tokens||0),0),projects:vs.length}),[me,vs]),Ed=A.useMemo(()=>Array.from(new Set(me.map(I=>I.agent))).sort(),[me]),Lr=A.useMemo(()=>new Map(Vt.map(I=>[I.id,I])),[Vt]),ks=A.useMemo(()=>new Map((St?.directs??[]).map(I=>[I.id,I])),[St]),Aa=A.useMemo(()=>{if(!St||!el)return[];const I=new Set(el.messageIds);return St.messages.filter(W=>I.has(W.id))},[St,el]),js=A.useMemo(()=>{if(!Fn)return[];const I=new Set(gs.filter(W=>W.sourceKind==="private").flatMap(W=>W.messageIds));return ja.filter(W=>I.has(W.id)||W.authorId===Fn.id).slice(-60)},[ja,Fn,gs]),Jo=A.useMemo(()=>Fe?.tasks.filter(I=>I.targetAgentId===pn)??[],[Fe,pn]),wl=A.useMemo(()=>Fe?.findings.filter(I=>I.targetAgentId===pn||I.requesterId===pn)??[],[Fe,pn]),Dr=A.useMemo(()=>wl.filter(I=>I.requesterId===pn),[wl,pn]),Ns=el?ep(el,pn):Fn?`${Fn.title}'s agent threads`:"Inter-Agent",ec=el?tp(el,pn):Fn?.statusDetail??"Select an agent to inspect private threads between agents.",fl=A.useMemo(()=>{if(el){const I=Bp(el,pn);if(I.length===1)return Vt.find(W=>W.id===I[0]?.id)??Fn}return Fn},[el,pn,Vt,Fn]),tc=fl?fl.profileKind==="project"?"Configure":"Profile":null,nc=fl??Fn,Ea=z.useCallback((I,W)=>{if(!I)return null;const be=W?.compact?Ka(I)??I:I;return be.includes("/")||be.startsWith("~/")||be.startsWith(".openscout")?l.jsx("button",{type:"button",className:W?.className??"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:W?.style??{color:g.ink},onClick:xi=>{xi.preventDefault(),!(!Wt?.canRevealPath||!e?.revealPath)&&e.revealPath(I).catch(sc=>{Ht(lt(sc))})},title:"Open in Finder",children:be}):l.jsx(l.Fragment,{children:be})},[e,Wt]),Rd=A.useMemo(()=>[...me].sort((I,W)=>new Date(W.lastModified).getTime()-new Date(I.lastModified).getTime()).slice(0,5),[me]);A.useEffect(()=>{qe&&O(I=>{if(!I)return I;const W={...I,updatedAtLabel:qe.updatedAtLabel??I.updatedAtLabel,services:I.services.map(be=>be.id==="broker"?{...be,status:qe.brokerReachable?qe.brokerHealthy?"running":"degraded":"offline",statusLabel:qe.brokerReachable?qe.brokerHealthy?"Running":"Degraded":"Offline",healthy:qe.brokerHealthy,reachable:qe.brokerReachable,detail:qe.brokerLabel,updatedAtLabel:qe.updatedAtLabel??be.updatedAtLabel,url:qe.brokerUrl,nodeId:qe.nodeId}:be.id==="helper"?{...be,status:qe.helperRunning?"running":"offline",statusLabel:qe.helperRunning?"Running":"Offline",healthy:qe.helperRunning,reachable:qe.helperRunning,detail:qe.helperDetail,updatedAtLabel:qe.updatedAtLabel??be.updatedAtLabel}:be)};return se(B,W),W})},[B,se,qe]),A.useEffect(()=>{if(!St)return;const I={title:"Home",subtitle:`${St.directs.length} agents · ${St.messages.filter(W=>!W.isVoice).length} recent updates`,updatedAtLabel:St.lastUpdatedLabel??qe?.updatedAtLabel??null,agents:St.directs.slice(0,24).map(W=>({id:W.id,title:W.title,role:null,summary:W.preview,projectRoot:null,state:W.state,reachable:W.reachable,statusLabel:W.statusLabel,statusDetail:W.statusDetail,activeTask:W.activeTask,timestampLabel:W.timestampLabel})),activity:St.messages.filter(W=>!W.isVoice).sort((W,be)=>be.createdAt-W.createdAt).slice(0,24).map(W=>({id:W.id,kind:W.isSystem?"system":"message",actorId:W.authorId,actorName:W.authorName,title:W.authorName,detail:W.body,conversationId:W.conversationId,channel:W.normalizedChannel,timestamp:W.createdAt,timestampLabel:W.timestampLabel})),recentSessions:[...me].sort((W,be)=>new Date(be.lastModified).getTime()-new Date(W.lastModified).getTime()).slice(0,6)};F(I),se(I,Z)},[se,St,qe?.updatedAtLabel,Z,me]);const ci=B?.agents??[],Md=B?.activity??[],ui=A.useMemo(()=>[...Fe?.tasks??[]].sort((I,W)=>W.createdAt-I.createdAt).slice(0,18),[Fe]),lc=A.useMemo(()=>[...Fe?.findings??[]].slice(0,10),[Fe]),ws=A.useMemo(()=>(je?.machines??[]).flatMap(I=>I.endpoints.map(W=>({machineId:I.id,machineTitle:I.title,machineStatus:I.status,endpoint:W}))).sort((I,W)=>{const be=At=>{switch(At){case"running":return 0;case"waiting":return 1;case"idle":return 2;default:return 3}};return be(I.endpoint.state)-be(W.endpoint.state)||I.endpoint.agentName.localeCompare(W.endpoint.agentName)}).slice(0,14),[je]),tl=A.useMemo(()=>[...ja].filter(I=>!I.isVoice).slice(-18).reverse(),[ja]),Ra=A.useMemo(()=>(Fe?.tasks??[]).filter(I=>I.status==="failed").length,[Fe]),Rn=ai.length+Ra,_r=ui.find(I=>I.status==="running")??ui[0]??null,Mn=Z?.services.find(I=>I.id==="broker")??null,di=ci.filter(I=>I.reachable).length,fi=ci.length>0?ci.length:qe?.agentCount??0,ml=!zt&&ye&&!Z&&!B&&!xe,nr=ml?"Syncing…":Mn?.statusLabel??(qe?.brokerReachable?"Running":"Offline"),rc=ml?"Checking relay health.":Mn?.detail?`Relay diagnostics · ${Mn.detail}`:Mn?.reachable||qe?.brokerReachable?"Open Relay diagnostics":"Relay is offline. Open diagnostics.",mi=ml?"bg-sky-500 animate-pulse":Mn?.status==="running"||qe?.brokerReachable?"bg-emerald-500":Mn?.status==="degraded"?"bg-amber-500":"bg-slate-400",Br=ml?"Syncing":Mn?.healthy||qe?.brokerHealthy?"Healthy":Mn?.reachable||qe?.brokerReachable?"Reachable":"Offline",Ss=A.useMemo(()=>xe||St?.voice.captureState==="error"?"error":ml?null:Mn&&(!Mn.reachable||!Mn.healthy)||qe&&(!qe.brokerReachable||!qe.brokerHealthy)?"warning":null,[Mn,ml,St?.voice.captureState,qe,xe]),Bn=Ss==="error"?"Logs · attention required":Ss==="warning"?"Logs · check runtime warnings":"Logs",Cs=KS(new Date),Jt=[];yt.overview&&Jt.push({id:"overview",icon:l.jsx(Cp,{size:16,strokeWidth:1.5}),title:"Overview"}),yt.inbox&&Jt.push({id:"inbox",icon:l.jsx(kN,{size:16,strokeWidth:1.5}),title:"Inbox",badgeCount:Rn>0?Rn:void 0}),yt.relay&&Jt.push({id:"messages",icon:l.jsx(Al,{size:16,strokeWidth:1.5}),title:"Messages"}),yt.activity&&Jt.push({id:"activity",icon:l.jsx(Km,{size:16,strokeWidth:1.5}),title:"Activity Monitor"}),yt.machines&&Jt.push({id:"machines",icon:l.jsx(S1,{size:16,strokeWidth:1.5}),title:"Machines"}),yt.plans&&Jt.push({id:"plans",icon:l.jsx(Sp,{size:16,strokeWidth:1.5}),title:"Plans"}),yt.search&&Jt.push({id:"search",icon:l.jsx(wo,{size:16,strokeWidth:1.5}),title:"Search"});const Ts=new Set(Jt.map(I=>I.id).filter(I=>I!=="overview"));yt.logs&&Ts.add("logs");const pl=[{id:"profile",label:"General",description:"Local Scout defaults, CLI setup commands, and workspace scanning roots.",icon:l.jsx(da,{size:15})},{id:"agents",label:"Agents",description:"Select an agent, then edit its runtime, capabilities, and restart controls.",icon:l.jsx($i,{size:15})},{id:"workspaces",label:"Workspaces",description:"Workspace discovery, repo bindings, and harness readiness.",icon:l.jsx(da,{size:15})},{id:"communication",label:"Communication",description:"Broker, relay delivery, and live runtime status.",icon:l.jsx(Km,{size:15})}];yt.sessions&&pl.push({id:"database",label:"Database",description:"Session indexing and storage.",icon:l.jsx(IN,{size:15})}),yt.enableAll&&pl.push({id:"appearance",label:"Appearance",description:"Visual preferences and display options.",icon:l.jsx(h2,{size:15})});const lr=pl.find(I=>I.id===Le)??pl[0];A.useEffect(()=>{if(f!=="relay")return;new Set([...Jt.map(W=>W.id),...yt.relay?["relay","inter-agent","agents"]:[],...yt.sessions?["sessions"]:[],...yt.settings?["settings"]:[],...yt.logs?["logs"]:[]]).has(h)||y(yt.relay?"messages":"overview")},[h,yt.logs,yt.relay,yt.sessions,yt.settings,Jt,f]),A.useEffect(()=>{pl.some(I=>I.id===Le)||Ue("profile")},[Le,pl]);const Ir=z.useCallback((I,W)=>{I.preventDefault(),ge.current=W,document.addEventListener("mousemove",Pr),document.addEventListener("mouseup",Nn)},[]),ac=z.useCallback(I=>{Ir(I,"left-sidebar")},[Ir]),As=z.useCallback(I=>{Ir(I,"right-sidebar")},[Ir]),Pr=z.useCallback(I=>{if(ge.current==="left-sidebar"){const W=I.clientX-48;W>160&&W<400&&a(W);return}if(ge.current==="right-sidebar"){const W=window.innerWidth-I.clientX;W>280&&W<520&&o(W)}},[]),Nn=z.useCallback(()=>{ge.current=null,document.removeEventListener("mousemove",Pr),document.removeEventListener("mouseup",Nn)},[Pr]);A.useEffect(()=>()=>{document.removeEventListener("mousemove",Pr),document.removeEventListener("mouseup",Nn)},[Pr,Nn]);const rr=async()=>{Te(!0),kn("Refreshing…");try{if(f==="pairing"&&yt.pairing&&(e?.refreshPairingState||e?.getPairingState)){await fs()&&kn("Pairing refreshed.");return}if(h==="overview")await Promise.all([Me(),ze(!B)]);else if(Zo&&e?.refreshRelayShellPatch){const I=await e.refreshRelayShellPatch();gn(I),ce(null)}else if(V)await nt(!0);else if(Bl&&e?.refreshShellState){const I=await e.refreshShellState();J(I),ce(null)}else Bl&&await Qt(!0);(h==="settings"||h==="help")&&await Cr({preferInventory:h==="settings"&&Le==="workspaces"}),h==="settings"&&Le==="communication"&&await hd(),h==="logs"&&pd(),h==="agents"&&pn&&Ta(),kn("Refreshed.")}catch(I){kn(lt(I))}finally{Te(!1)}},Ur=z.useCallback(()=>{if(!(typeof window>"u")){if(He(!0),e?.reloadApp){e.reloadApp();return}window.location.reload()}},[e]),pi=z.useCallback(()=>{p("relay"),y("settings"),Ue("communication"),et(!0)},[]),Hr=z.useCallback(()=>{(async()=>{try{if(!Wt?.canQuitHost)return;e?.quitApp&&await e.quitApp()}catch(I){Ht(lt(I))}})()},[e,Wt]),wn=z.useCallback(I=>{tr(I),wa(),D(!0),X("overview"),jn("direct",I)},[wa,tr,jn]),Vn=async()=>{if(!e?.toggleVoiceCapture){ce("Desktop bridge is unavailable.");return}try{const I=await e.toggleVoiceCapture();J(I),Q(W=>W&&yu(I)),ce(null),kn(I.relay.voice.isCapturing?"Voice capture started.":"Voice capture stopped.")}catch(I){kn(lt(I))}},Sl=async I=>{if(!e?.setVoiceRepliesEnabled){ce("Desktop bridge is unavailable.");return}try{const W=await e.setVoiceRepliesEnabled(I);J(W),Q(be=>be&&yu(W)),ce(null),kn(I?"Playback enabled.":"Playback disabled.")}catch(W){kn(lt(W))}},hl=I=>{w(I),D(!0),X("history");const W=Je?.threads.find(be=>be.relayDestinationKind==="direct"&&be.relayDestinationId===I.project)??null;W&&hi(W),C(null),y("messages")},nl=A.useMemo(()=>(Fe?.tasks??[]).filter(I=>I.status==="failed").slice(0,10).map(I=>({id:`task-failed:${I.id}`,kind:"task",tone:"critical",title:I.title,summary:`${I.targetAgentName} reported a failed ask.`,detail:I.statusDetail??I.replyPreview??I.body,meta:[I.project,I.updatedAtLabel,I.ageLabel].filter(Boolean).join(" · ")||I.createdAtLabel,actionLabel:"Open Agent",onAction:()=>wn(I.targetAgentId)})),[wn,Fe]),xl=A.useMemo(()=>ai.map(I=>({id:`approval:${I.sessionId}:${I.turnId}:${I.blockId}`,kind:"approval",tone:I.risk==="high"?"critical":I.risk==="medium"?"warning":"info",title:I.title,summary:I.description,detail:I.detail,meta:`${I.sessionName} · ${I.risk} risk`,actionLabel:"Open Pairing",onAction:()=>{p("pairing")},onSecondaryAction:()=>{ms(I,"approve")},secondaryActionLabel:"Approve"})),[ms,ai]),ic=A.useMemo(()=>[...xl,...nl].sort((I,W)=>{const be=At=>At==="critical"?0:At==="warning"?1:2;return be(I.tone)-be(W.tone)||I.title.localeCompare(W.title)}),[xl,nl]),hi=z.useCallback(I=>{if(Jl(I.id),I.kind==="relay"&&I.relayDestinationKind&&I.relayDestinationId){Jn(I.relayDestinationKind),Wl(I.relayDestinationId);return}if(!I.interAgentThreadId)return;xs(I.interAgentThreadId);const be=(Pt.find(At=>At.id===I.interAgentThreadId)??null)?.participants.find(At=>Vt.some(xi=>xi.id===At.id))?.id??null;be&&(tr(be),xs(I.interAgentThreadId))},[tr,Vt,Pt,Wl,Jn,xs,Jl]),Es=I=>{const W=new Date(I);return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][W.getUTCMonth()]} ${W.getUTCDate()}`},vt={root:{backgroundColor:g.bg,color:g.ink},surface:{backgroundColor:g.surface},border:{borderColor:g.border},topBar:{backgroundColor:g.surface,borderBottomColor:g.border},navBar:{backgroundColor:g.bg,borderRightColor:g.border},sidebar:{backgroundColor:g.bg,borderRightColor:g.border},sectionLabel:{color:g.muted},inkText:{color:g.ink},mutedText:{color:g.muted},tagBadge:{backgroundColor:g.tagBg,borderColor:g.border,color:g.muted},activePill:{backgroundColor:g.accentBg,color:g.accent},activeItem:{backgroundColor:g.surface,borderColor:g.border,color:g.ink},kbd:{backgroundColor:g.surface,borderColor:g.border,color:g.ink},hoverBg:"hover:bg-[var(--os-hover)]",annotBadge:{backgroundColor:g.tagBg,borderColor:g.border,color:g.muted}},nn=(I,W,be)=>{const At=dl[I]??(zl?.command===I?zl:null);return l.jsx(WT,{command:I,commandLine:W,running:be,commandResult:At,visibleAppSettings:Ft,onboardingCopiedCommand:Ol,onboardingCommandPending:Wn,onboardingContextRoot:Ja,onCopyOnboardingCommand:Bo,onRunOnboardingCommand:Kl})},_t=QM({activeView:h,setActiveView:y,settingsSection:Le,setSettingsSection:Ue,settingsAgentId:it,setSettingsAgentId:tt,settingsSections:pl,activeSettingsMeta:lr,desktopFeatures:yt,stats:oi,runtime:qe,relayState:St,relayRuntimeBooting:ml,relayRuntimeHealthLabel:Br,reachableRelayAgentCount:di,dark:mt,setDark:ae,showAnnotations:Se,setShowAnnotations:Ze,isCollapsed:u,styles:{surface:vt.surface,inkText:vt.inkText,mutedText:vt.mutedText,tagBadge:vt.tagBadge,activePill:vt.activePill},scoutDesktop:e,surfaceCaps:Wt,interAgentAgents:Vt,openKnowledgeBase:We,openAgentProfile:wn,openDirectConversation:er,renderOnboardingCommandShell:nn,renderLocalPathValue:Ea,settingsOperatorNameRef:Ce,relayServiceInspectorRef:_e,handleSetVoiceRepliesEnabled:Sl,settingsController:Gl,diagnosticsController:ii,agentController:hs}),ft=YM({activeView:h,setActiveView:y,desktopFeatures:yt,styles:{sidebar:vt.sidebar,surface:vt.surface,inkText:vt.inkText,mutedText:vt.mutedText,tagBadge:vt.tagBadge,activePill:vt.activePill,activeItem:vt.activeItem,annotBadge:vt.annotBadge,kbd:vt.kbd},colorTheme:g,sidebarWidth:r,messagesDetailWidth:i,isCollapsed:u,onResizeStart:ac,onMessagesDetailResizeStart:As,stats:oi,runtime:qe,shellState:oe,shellError:xe,plansState:Fe,machinesState:je,messagesState:Je,interAgentState:Yt,interAgentAgents:Vt,interAgentAgentLookup:Lr,relayDirectLookup:ks,homeAgents:ci,homeActivity:Md,activityRecentMessages:tl,activityTasks:ui,activityLeadTask:_r,activityFindings:lc,activityEndpoints:ws,overviewSessions:Rd,inboxAlertCount:Rn,pendingApprovalsCount:ai.length,inboxFailedTaskCount:Ra,inboxAwaitingYouItems:ic,availableAgentNames:Ed,searchQuery:b,setSearchQuery:v,filteredSessions:Wo,selectedSession:E,setSelectedSession:w,isLoadingMessagesWorkspace:_,isLoadingShell:R,showAnnotations:Se,setShowAnnotations:Ze,messagesDetailOpen:M,setMessagesDetailOpen:D,messagesDetailTab:H,setMessagesDetailTab:X,formatDate:Es,onRefreshShell:()=>{rr()},openAgentProfile:wn,openSessionDetail:hl,handleSelectSearchSession:I=>{w(I),y("sessions")},handleToggleVoiceCapture:()=>{Vn()},handleSetVoiceRepliesEnabled:I=>{Sl(I)},selectMessageThread:hi,renderLocalPathValue:Ea,selectedInterAgentActivityMessages:js,selectedInterAgentInboundTasks:Jo,selectedInterAgentOutboundFindings:Dr,selectedInterAgentFindings:wl,interAgentThreadTitle:Ns,selectedInterAgentThreadSubtitle:ec,interAgentConfigureTarget:fl,interAgentConfigureLabel:tc,interAgentMessageTarget:nc,visibleInterAgentMessages:Aa,relayVoiceState:St?.voice,messagesController:os,agentController:hs,diagnosticsController:ii,phonePreparationController:id,overviewBootLoader:!zt&&ye&&!B&&!xe?l.jsx(e1,{dark:mt,C:g,s:vt}):null});return zt?l.jsx("div",{className:`min-h-screen w-full font-sans${mt?" dark":""}`,style:{backgroundColor:g.bg,color:g.ink},children:l.jsxs("div",{className:"relative min-h-screen flex items-center justify-center px-6 py-10",children:[l.jsx("div",{className:"absolute top-6 left-6 z-10",children:l.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded-full border px-3 py-1.5 text-[12px] transition-opacity hover:opacity-80",style:{borderColor:g.border,color:g.muted},onClick:Hr,children:[l.jsx(kl,{size:12}),"Quit"]})}),Ke&&Ft?l.jsx("div",{className:"w-full max-w-[820px] os-scale-in",children:l.jsxs("div",{className:"rounded-2xl border overflow-hidden",style:{borderColor:g.border,backgroundColor:g.surface,boxShadow:`0 24px 80px ${mt?"rgba(0,0,0,0.4)":"rgba(15,23,42,0.08)"}`},children:[l.jsxs("div",{className:"px-8 pt-8 pb-6 border-b cursor-grab active:cursor-grabbing",style:{borderBottomColor:g.border,WebkitAppRegion:"drag"},children:[l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsx("div",{className:"text-[11px] font-mono uppercase tracking-[0.22em]",style:vt.mutedText,children:"Scout Setup"}),l.jsx("button",{className:"text-[12px] transition-opacity hover:opacity-70",style:{...vt.mutedText,WebkitAppRegion:"no-drag"},onClick:ss,children:"Skip onboarding"})]}),l.jsx("div",{className:"flex items-center gap-1.5 mt-6",children:_l.map((I,W)=>{const be=W<Hn,At=W===Hn;return l.jsx("div",{className:"h-1 flex-1 rounded-full transition-all duration-300",style:{backgroundColor:be||At?g.accent:mt?"rgba(255,255,255,0.06)":"rgba(15,23,42,0.06)",opacity:At?.6:1}},I.id)})}),l.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[l.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full",style:{backgroundColor:g.accentBg,color:g.accent},children:[Xt.number,"/",_l.length]}),l.jsx("span",{className:"text-[12px] font-medium",style:vt.mutedText,children:Xt.title})]})]}),l.jsxs("div",{className:"px-8 py-8 os-fade-up",children:[l.jsx(JT,{activeOnboardingStep:Xt,visibleAppSettings:Ft,appSettingsSaving:$t,appSettingsLoading:ga,appSettingsDirty:ya,onboardingCommandPending:Wn,onboardingHasProjectConfig:rs,sourceRootPathSuggestions:xa,settingsOperatorNameRef:Ce,setAppSettingsDraft:$l,setAppSettingsFeedback:Ht,setIsAppSettingsEditing:Ll,handleAddSourceRootRow:Ju,handleSetSourceRootAt:as,handleBrowseForSourceRoot:ni,handleRemoveSourceRootRow:ed,handleSetOnboardingContextRoot:Nl,handleBrowseForOnboardingContextRoot:is,handleAddSourceRootSuggestion:_o,handleRunOnboardingCommand:Kl,buildOnboardingCommandLine:yn,renderOnboardingCommandShell:nn,renderLocalPathValue:Ea,styles:{inkText:vt.inkText,mutedText:vt.mutedText,activePill:vt.activePill,tagBadge:vt.tagBadge},availableHarnesses:r1}),dn?l.jsx("div",{className:"text-[13px] mt-6 leading-[1.6] os-fade-in",style:vt.inkText,children:dn}):null]},Xt.id),l.jsxs("div",{className:"px-8 py-5 border-t flex items-center justify-between gap-4",style:{borderTopColor:g.border,backgroundColor:g.bg},children:[l.jsx("button",{className:"os-btn flex items-center gap-1 text-[12px] font-medium px-4 py-2.5 rounded-lg border disabled:opacity-40 transition-all",style:{color:g.muted,borderColor:g.border,backgroundColor:"transparent"},onClick:()=>Do(-1),disabled:!ei,children:"Back"}),l.jsxs("div",{className:"text-[11px] font-mono text-center",style:vt.mutedText,children:[Xt.number," of ",_l.length]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{className:"os-btn flex items-center gap-1 text-[12px] font-medium px-4 py-2.5 rounded-lg transition-all",style:{color:g.muted},onClick:Er,children:ve?"Skip step":"Finish later"}),l.jsxs("button",{className:"os-btn-primary flex items-center gap-1 text-[12px] font-semibold px-5 py-2.5 rounded-lg disabled:opacity-40 transition-all",style:{backgroundColor:g.accent,color:"#fff"},onClick:Ar,disabled:!ve||$t||ga,children:[Xt.id==="confirm"?$t?"Confirming…":"Confirm":"Continue",Xt.id==="confirm"?null:l.jsx(ql,{size:12})]})]})]})]})}):l.jsx(e1,{dark:mt,C:g,s:vt})]})}):l.jsxs(l.Fragment,{children:[l.jsx(zT,{dark:mt,setDark:ae,C:g,s:vt,productSurface:f,setProductSurface:p,activeView:h,setActiveView:y,desktopFeatures:yt,pairingSurfaceBadge:ad,openRelayDiagnostics:pi,relayStatusTitle:rc,relayRuntimeBooting:ml,relayStatusDotClassName:mi,relayStatusLabel:nr,runtime:qe,headerAgentCount:fi,appReloadPending:Ne,handleReloadApp:Ur,handleQuitApp:Hr,navViews:Jt,collapsibleViews:Ts,isCollapsed:u,setIsCollapsed:d,pairingSurfaceProps:{pairingControlPending:ds,pairingConfigFeedback:Ho,pairingConfigPending:Na,pairingError:Uo,pairingLoading:Mr,pairingState:Rr,onControlPairing:ld,onDecideApproval:ms,onOpenFullLogs:()=>{p("relay"),y("logs")},onOpenFeedback:qo,pairingApprovalPendingId:ri,onUpdateConfig:rd,onRefresh:()=>{rr()},onRevealPath:I=>{Wt?.canRevealPath&&e?.revealPath?.(I)}},isAgentSessionPeekOpen:Ko,selectedInterAgent:Fn,visibleAgentSession:Yo,agentSessionPending:bs,agentSessionLoading:ys,agentSessionFeedback:Qo,agentSessionCopied:Xo,agentSessionPeekViewportRef:Sd,handlePeekAgentSessionScroll:Cd,closeAgentSessionPeek:wd,handleCopyAgentSessionCommand:()=>{Ad()},handleOpenAgentSession:()=>{Td()},renderLocalPathValue:Ea,isCreateAgentDialogOpen:Or,setIsCreateAgentDialogOpen:kd,agentableProjects:ba,createAgentDraft:jd,setCreateAgentDraft:Nd,createAgentDefaults:Vo,createAgentSubmitting:Go,createAgentFeedback:Sa,setCreateAgentFeedback:Ca,handleBrowseCreateAgentProject:si,handleCreateAgent:$o,availableAgentHarnesses:r1,isFeedbackDialogOpen:sd,handleFeedbackDialogOpenChange:xd,feedbackDraft:ps,setFeedbackDraft:dd,feedbackSubmission:fd,feedbackActionPending:md,feedbackBundleLoading:cd,feedbackBundle:od,feedbackBundleError:ud,feedbackActionMessage:Fo,handleSubmitFeedbackReport:()=>{yd()},handleRefreshFeedbackBundle:()=>{gd()},handleRepairSetup:()=>{vd()},handleCopyFeedbackBundle:()=>{bd()},openFeedbackDialog:qo,openKnowledgeBase:We,logsAttentionLevel:Ss,logsButtonTitle:Bn,footerTimeLabel:Cs,children:f==="relay"?l.jsxs(l.Fragment,{children:[l.jsx(DT,{...ft.overviewInboxActivityViewProps}),l.jsx(qT,{...ft.opsViewsProps}),l.jsx(ZT,{..._t}),l.jsx(MM,{...ft.agentViewsProps}),l.jsx(mz,{...ft.messagesRelayViewProps})]}):null}),l.jsx("div",{className:"pointer-events-none fixed right-4 top-20 z-40",children:l.jsxs("div",{className:"w-[220px] rounded-2xl border px-4 py-3 shadow-[0_18px_48px_rgba(15,23,42,0.12)]",style:{backgroundColor:mt?"rgba(17, 24, 39, 0.9)":"rgba(255,255,255,0.92)",borderColor:g.border,backdropFilter:"blur(10px)"},children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.16em]",style:vt.mutedText,children:"Dev Load Times"}),l.jsx("div",{className:"text-[10px]",style:vt.mutedText,children:"live"})]}),l.jsx("div",{className:"mt-3 space-y-2",children:[{key:"services",title:"Relay health",metric:ee.services,loading:Y,idleLabel:"—",idleDetail:"No measurement yet"},{key:"home",title:"Home data",metric:ee.home,loading:ye,idleLabel:"—",idleDetail:"No measurement yet"},{key:"workspace",title:"Workspace",metric:ee.workspace,loading:V?_:Bl&&R,idleLabel:V||Bl?"—":"deferred",idleDetail:V||Bl?"No measurement yet":"Loads only on workspace-heavy surfaces"}].map(I=>l.jsxs("div",{className:"rounded-xl border px-3 py-2",style:{borderColor:g.border,backgroundColor:mt?"rgba(255,255,255,0.03)":"rgba(15,23,42,0.025)"},children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsx("div",{className:"text-[11px] font-medium",style:vt.inkText,children:I.title}),l.jsx("div",{className:"text-[11px] font-mono",style:I.loading?{color:g.accent}:vt.inkText,children:I.loading?"loading…":I.metric?`${I.metric.durationMs}ms`:I.idleLabel})]}),l.jsx("div",{className:"mt-1 text-[10px] leading-[1.5]",style:vt.mutedText,children:I.metric?`${I.metric.label} · ${new Date(I.metric.recordedAt).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",second:"2-digit"})}`:I.idleDetail}),I.metric?.detail?l.jsx("div",{className:"mt-2 space-y-1",children:Object.entries(I.metric.detail).slice(0,8).map(([W,be])=>l.jsxs("div",{className:"flex items-center justify-between gap-3 text-[10px]",style:vt.mutedText,children:[l.jsx("span",{className:"truncate",children:W}),l.jsx("span",{className:"font-mono shrink-0",style:vt.inkText,children:String(be)})]},W))}):null]},I.key))})]})})]})}const gp=document.getElementById("root");if(!gp)throw new Error("Root element was not found.");const a1=l.jsx(A.StrictMode,{children:l.jsx(uN,{children:l.jsx(Tz,{})})}),Az=typeof window<"u"&&Object.prototype.hasOwnProperty.call(window,"__INITIAL_STATE__");Az?fb.hydrateRoot(gp,a1):fb.createRoot(gp).render(a1);
|