gossipcat 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,81 @@
1
+ var Eg=Object.defineProperty;var wg=(s,r,u)=>r in s?Eg(s,r,{enumerable:!0,configurable:!0,writable:!0,value:u}):s[r]=u;var Mt=(s,r,u)=>wg(s,typeof r!="symbol"?r+"":r,u);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const p of f.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function u(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(d){if(d.ep)return;d.ep=!0;const f=u(d);fetch(d.href,f)}})();function Tg(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Yo={exports:{}},Ps={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var lh;function Ag(){if(lh)return Ps;lh=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function u(o,d,f){var p=null;if(f!==void 0&&(p=""+f),d.key!==void 0&&(p=""+d.key),"key"in d){f={};for(var h in d)h!=="key"&&(f[h]=d[h])}else f=d;return d=f.ref,{$$typeof:s,type:o,key:p,ref:d!==void 0?d:null,props:f}}return Ps.Fragment=r,Ps.jsx=u,Ps.jsxs=u,Ps}var sh;function Mg(){return sh||(sh=1,Yo.exports=Ag()),Yo.exports}var a=Mg(),Xo={exports:{}},Te={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var ih;function Cg(){if(ih)return Te;ih=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),p=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),_=Symbol.iterator;function B(j){return j===null||typeof j!="object"?null:(j=_&&j[_]||j["@@iterator"],typeof j=="function"?j:null)}var U={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,T={};function F(j,H,le){this.props=j,this.context=H,this.refs=T,this.updater=le||U}F.prototype.isReactComponent={},F.prototype.setState=function(j,H){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,H,"setState")},F.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function Y(){}Y.prototype=F.prototype;function ae(j,H,le){this.props=j,this.context=H,this.refs=T,this.updater=le||U}var V=ae.prototype=new Y;V.constructor=ae,A(V,F.prototype),V.isPureReactComponent=!0;var E=Array.isArray;function G(){}var C={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function te(j,H,le){var W=le.ref;return{$$typeof:s,type:j,key:H,ref:W!==void 0?W:null,props:le}}function P(j,H){return te(j.type,H,j.props)}function he(j){return typeof j=="object"&&j!==null&&j.$$typeof===s}function ne(j){var H={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(le){return H[le]})}var ue=/\/+/g;function ye(j,H){return typeof j=="object"&&j!==null&&j.key!=null?ne(""+j.key):H.toString(36)}function O(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(G,G):(j.status="pending",j.then(function(H){j.status==="pending"&&(j.status="fulfilled",j.value=H)},function(H){j.status==="pending"&&(j.status="rejected",j.reason=H)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function M(j,H,le,W,q){var de=typeof j;(de==="undefined"||de==="boolean")&&(j=null);var xe=!1;if(j===null)xe=!0;else switch(de){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(j.$$typeof){case s:case r:xe=!0;break;case b:return xe=j._init,M(xe(j._payload),H,le,W,q)}}if(xe)return q=q(j),xe=W===""?"."+ye(j,0):W,E(q)?(le="",xe!=null&&(le=xe.replace(ue,"$&/")+"/"),M(q,H,le,"",function(it){return it})):q!=null&&(he(q)&&(q=P(q,le+(q.key==null||j&&j.key===q.key?"":(""+q.key).replace(ue,"$&/")+"/")+xe)),H.push(q)),1;xe=0;var Ie=W===""?".":W+":";if(E(j))for(var Re=0;Re<j.length;Re++)W=j[Re],de=Ie+ye(W,Re),xe+=M(W,H,le,de,q);else if(Re=B(j),typeof Re=="function")for(j=Re.call(j),Re=0;!(W=j.next()).done;)W=W.value,de=Ie+ye(W,Re++),xe+=M(W,H,le,de,q);else if(de==="object"){if(typeof j.then=="function")return M(O(j),H,le,W,q);throw H=String(j),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return xe}function I(j,H,le){if(j==null)return j;var W=[],q=0;return M(j,W,"","",function(de){return H.call(le,de,q++)}),W}function ee(j){if(j._status===-1){var H=j._result;H=H(),H.then(function(le){(j._status===0||j._status===-1)&&(j._status=1,j._result=le)},function(le){(j._status===0||j._status===-1)&&(j._status=2,j._result=le)}),j._status===-1&&(j._status=0,j._result=H)}if(j._status===1)return j._result.default;throw j._result}var oe=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},me={map:I,forEach:function(j,H,le){I(j,function(){H.apply(this,arguments)},le)},count:function(j){var H=0;return I(j,function(){H++}),H},toArray:function(j){return I(j,function(H){return H})||[]},only:function(j){if(!he(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return Te.Activity=y,Te.Children=me,Te.Component=F,Te.Fragment=u,Te.Profiler=d,Te.PureComponent=ae,Te.StrictMode=o,Te.Suspense=x,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,Te.__COMPILER_RUNTIME={__proto__:null,c:function(j){return C.H.useMemoCache(j)}},Te.cache=function(j){return function(){return j.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(j,H,le){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var W=A({},j.props),q=j.key;if(H!=null)for(de in H.key!==void 0&&(q=""+H.key),H)!K.call(H,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&H.ref===void 0||(W[de]=H[de]);var de=arguments.length-2;if(de===1)W.children=le;else if(1<de){for(var xe=Array(de),Ie=0;Ie<de;Ie++)xe[Ie]=arguments[Ie+2];W.children=xe}return te(j.type,q,W)},Te.createContext=function(j){return j={$$typeof:p,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:f,_context:j},j},Te.createElement=function(j,H,le){var W,q={},de=null;if(H!=null)for(W in H.key!==void 0&&(de=""+H.key),H)K.call(H,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(q[W]=H[W]);var xe=arguments.length-2;if(xe===1)q.children=le;else if(1<xe){for(var Ie=Array(xe),Re=0;Re<xe;Re++)Ie[Re]=arguments[Re+2];q.children=Ie}if(j&&j.defaultProps)for(W in xe=j.defaultProps,xe)q[W]===void 0&&(q[W]=xe[W]);return te(j,de,q)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(j){return{$$typeof:h,render:j}},Te.isValidElement=he,Te.lazy=function(j){return{$$typeof:b,_payload:{_status:-1,_result:j},_init:ee}},Te.memo=function(j,H){return{$$typeof:g,type:j,compare:H===void 0?null:H}},Te.startTransition=function(j){var H=C.T,le={};C.T=le;try{var W=j(),q=C.S;q!==null&&q(le,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(G,oe)}catch(de){oe(de)}finally{H!==null&&le.types!==null&&(H.types=le.types),C.T=H}},Te.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},Te.use=function(j){return C.H.use(j)},Te.useActionState=function(j,H,le){return C.H.useActionState(j,H,le)},Te.useCallback=function(j,H){return C.H.useCallback(j,H)},Te.useContext=function(j){return C.H.useContext(j)},Te.useDebugValue=function(){},Te.useDeferredValue=function(j,H){return C.H.useDeferredValue(j,H)},Te.useEffect=function(j,H){return C.H.useEffect(j,H)},Te.useEffectEvent=function(j){return C.H.useEffectEvent(j)},Te.useId=function(){return C.H.useId()},Te.useImperativeHandle=function(j,H,le){return C.H.useImperativeHandle(j,H,le)},Te.useInsertionEffect=function(j,H){return C.H.useInsertionEffect(j,H)},Te.useLayoutEffect=function(j,H){return C.H.useLayoutEffect(j,H)},Te.useMemo=function(j,H){return C.H.useMemo(j,H)},Te.useOptimistic=function(j,H){return C.H.useOptimistic(j,H)},Te.useReducer=function(j,H,le){return C.H.useReducer(j,H,le)},Te.useRef=function(j){return C.H.useRef(j)},Te.useState=function(j){return C.H.useState(j)},Te.useSyncExternalStore=function(j,H,le){return C.H.useSyncExternalStore(j,H,le)},Te.useTransition=function(){return C.H.useTransition()},Te.version="19.2.6",Te}var rh;function yu(){return rh||(rh=1,Xo.exports=Cg()),Xo.exports}var S=yu(),Vo={exports:{}},ei={},Ko={exports:{}},Zo={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var ch;function Rg(){return ch||(ch=1,(function(s){function r(M,I){var ee=M.length;M.push(I);e:for(;0<ee;){var oe=ee-1>>>1,me=M[oe];if(0<d(me,I))M[oe]=I,M[ee]=me,ee=oe;else break e}}function u(M){return M.length===0?null:M[0]}function o(M){if(M.length===0)return null;var I=M[0],ee=M.pop();if(ee!==I){M[0]=ee;e:for(var oe=0,me=M.length,j=me>>>1;oe<j;){var H=2*(oe+1)-1,le=M[H],W=H+1,q=M[W];if(0>d(le,ee))W<me&&0>d(q,le)?(M[oe]=q,M[W]=ee,oe=W):(M[oe]=le,M[H]=ee,oe=H);else if(W<me&&0>d(q,ee))M[oe]=q,M[W]=ee,oe=W;else break e}}return I}function d(M,I){var ee=M.sortIndex-I.sortIndex;return ee!==0?ee:M.id-I.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var p=Date,h=p.now();s.unstable_now=function(){return p.now()-h}}var x=[],g=[],b=1,y=null,_=3,B=!1,U=!1,A=!1,T=!1,F=typeof setTimeout=="function"?setTimeout:null,Y=typeof clearTimeout=="function"?clearTimeout:null,ae=typeof setImmediate<"u"?setImmediate:null;function V(M){for(var I=u(g);I!==null;){if(I.callback===null)o(g);else if(I.startTime<=M)o(g),I.sortIndex=I.expirationTime,r(x,I);else break;I=u(g)}}function E(M){if(A=!1,V(M),!U)if(u(x)!==null)U=!0,G||(G=!0,ne());else{var I=u(g);I!==null&&O(E,I.startTime-M)}}var G=!1,C=-1,K=5,te=-1;function P(){return T?!0:!(s.unstable_now()-te<K)}function he(){if(T=!1,G){var M=s.unstable_now();te=M;var I=!0;try{e:{U=!1,A&&(A=!1,Y(C),C=-1),B=!0;var ee=_;try{t:{for(V(M),y=u(x);y!==null&&!(y.expirationTime>M&&P());){var oe=y.callback;if(typeof oe=="function"){y.callback=null,_=y.priorityLevel;var me=oe(y.expirationTime<=M);if(M=s.unstable_now(),typeof me=="function"){y.callback=me,V(M),I=!0;break t}y===u(x)&&o(x),V(M)}else o(x);y=u(x)}if(y!==null)I=!0;else{var j=u(g);j!==null&&O(E,j.startTime-M),I=!1}}break e}finally{y=null,_=ee,B=!1}I=void 0}}finally{I?ne():G=!1}}}var ne;if(typeof ae=="function")ne=function(){ae(he)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,ye=ue.port2;ue.port1.onmessage=he,ne=function(){ye.postMessage(null)}}else ne=function(){F(he,0)};function O(M,I){C=F(function(){M(s.unstable_now())},I)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(M){M.callback=null},s.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<M?Math.floor(1e3/M):5},s.unstable_getCurrentPriorityLevel=function(){return _},s.unstable_next=function(M){switch(_){case 1:case 2:case 3:var I=3;break;default:I=_}var ee=_;_=I;try{return M()}finally{_=ee}},s.unstable_requestPaint=function(){T=!0},s.unstable_runWithPriority=function(M,I){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var ee=_;_=M;try{return I()}finally{_=ee}},s.unstable_scheduleCallback=function(M,I,ee){var oe=s.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?oe+ee:oe):ee=oe,M){case 1:var me=-1;break;case 2:me=250;break;case 5:me=1073741823;break;case 4:me=1e4;break;default:me=5e3}return me=ee+me,M={id:b++,callback:I,priorityLevel:M,startTime:ee,expirationTime:me,sortIndex:-1},ee>oe?(M.sortIndex=ee,r(g,M),u(x)===null&&M===u(g)&&(A?(Y(C),C=-1):A=!0,O(E,ee-oe))):(M.sortIndex=me,r(x,M),U||B||(U=!0,G||(G=!0,ne()))),M},s.unstable_shouldYield=P,s.unstable_wrapCallback=function(M){var I=_;return function(){var ee=_;_=I;try{return M.apply(this,arguments)}finally{_=ee}}}})(Zo)),Zo}var oh;function Og(){return oh||(oh=1,Ko.exports=Rg()),Ko.exports}var Qo={exports:{}},$t={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var uh;function Dg(){if(uh)return $t;uh=1;var s=yu();function r(x){var g="https://react.dev/errors/"+x;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+x+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var o={d:{f:u,r:function(){throw Error(r(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(x,g,b){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:y==null?null:""+y,children:x,containerInfo:g,implementation:b}}var p=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(x,g){if(x==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return $t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,$t.createPortal=function(x,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(r(299));return f(x,g,null,b)},$t.flushSync=function(x){var g=p.T,b=o.p;try{if(p.T=null,o.p=2,x)return x()}finally{p.T=g,o.p=b,o.d.f()}},$t.preconnect=function(x,g){typeof x=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,o.d.C(x,g))},$t.prefetchDNS=function(x){typeof x=="string"&&o.d.D(x)},$t.preinit=function(x,g){if(typeof x=="string"&&g&&typeof g.as=="string"){var b=g.as,y=h(b,g.crossOrigin),_=typeof g.integrity=="string"?g.integrity:void 0,B=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?o.d.S(x,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:y,integrity:_,fetchPriority:B}):b==="script"&&o.d.X(x,{crossOrigin:y,integrity:_,fetchPriority:B,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},$t.preinitModule=function(x,g){if(typeof x=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=h(g.as,g.crossOrigin);o.d.M(x,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&o.d.M(x)},$t.preload=function(x,g){if(typeof x=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,y=h(b,g.crossOrigin);o.d.L(x,b,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},$t.preloadModule=function(x,g){if(typeof x=="string")if(g){var b=h(g.as,g.crossOrigin);o.d.m(x,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else o.d.m(x)},$t.requestFormReset=function(x){o.d.r(x)},$t.unstable_batchedUpdates=function(x,g){return x(g)},$t.useFormState=function(x,g,b){return p.H.useFormState(x,g,b)},$t.useFormStatus=function(){return p.H.useHostTransitionStatus()},$t.version="19.2.6",$t}var dh;function zg(){if(dh)return Qo.exports;dh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),Qo.exports=Dg(),Qo.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var fh;function Lg(){if(fh)return ei;fh=1;var s=Og(),r=yu(),u=zg();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(e){if(f(e)!==e)throw Error(o(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var c=i.alternate;if(c===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===c.child){for(c=i.child;c;){if(c===n)return x(i),e;if(c===l)return x(i),t;c=c.sibling}throw Error(o(188))}if(n.return!==l.return)n=i,l=c;else{for(var m=!1,v=i.child;v;){if(v===n){m=!0,n=i,l=c;break}if(v===l){m=!0,l=i,n=c;break}v=v.sibling}if(!m){for(v=c.child;v;){if(v===n){m=!0,n=c,l=i;break}if(v===l){m=!0,l=c,n=i;break}v=v.sibling}if(!m)throw Error(o(189))}}if(n.alternate!==l)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,_=Symbol.for("react.element"),B=Symbol.for("react.transitional.element"),U=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),Y=Symbol.for("react.consumer"),ae=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),he=Symbol.iterator;function ne(e){return e===null||typeof e!="object"?null:(e=he&&e[he]||e["@@iterator"],typeof e=="function"?e:null)}var ue=Symbol.for("react.client.reference");function ye(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case F:return"Profiler";case T:return"StrictMode";case E:return"Suspense";case G:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case U:return"Portal";case ae:return e.displayName||"Context";case Y:return(e._context.displayName||"Context")+".Consumer";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case C:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var O=Array.isArray,M=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},oe=[],me=-1;function j(e){return{current:e}}function H(e){0>me||(e.current=oe[me],oe[me]=null,me--)}function le(e,t){me++,oe[me]=e.current,e.current=t}var W=j(null),q=j(null),de=j(null),xe=j(null);function Ie(e,t){switch(le(de,t),le(q,e),le(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wm(t),e=Tm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(W),le(W,e)}function Re(){H(W),H(q),H(de)}function it(e){e.memoizedState!==null&&le(xe,e);var t=W.current,n=Tm(t,e.type);t!==n&&(le(q,e),le(W,n))}function Vt(e){q.current===e&&(H(W),H(q)),xe.current===e&&(H(xe),Qs._currentValue=ee)}var Lt,Cn;function qt(e){if(Lt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Lt=t&&t[1]||"",Cn=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Lt+e+Cn}var Ye=!1;function wn(e,t){if(!e||Ye)return"";Ye=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch($){var L=$}Reflect.construct(e,[],J)}else{try{J.call()}catch($){L=$}e.call(J.prototype)}}else{try{throw Error()}catch($){L=$}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch($){if($&&L&&typeof $.stack=="string")return[$.stack,L.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=l.DetermineComponentFrameRoot(),m=c[0],v=c[1];if(m&&v){var N=m.split(`
44
+ `),z=v.split(`
45
+ `);for(i=l=0;l<N.length&&!N[l].includes("DetermineComponentFrameRoot");)l++;for(;i<z.length&&!z[i].includes("DetermineComponentFrameRoot");)i++;if(l===N.length||i===z.length)for(l=N.length-1,i=z.length-1;1<=l&&0<=i&&N[l]!==z[i];)i--;for(;1<=l&&0<=i;l--,i--)if(N[l]!==z[i]){if(l!==1||i!==1)do if(l--,i--,0>i||N[l]!==z[i]){var X=`
46
+ `+N[l].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=l&&0<=i);break}}}finally{Ye=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?qt(n):""}function hn(e,t){switch(e.tag){case 26:case 27:case 5:return qt(e.type);case 16:return qt("Lazy");case 13:return e.child!==t&&t!==null?qt("Suspense Fallback"):qt("Suspense");case 19:return qt("SuspenseList");case 0:case 15:return wn(e.type,!1);case 11:return wn(e.type.render,!1);case 1:return wn(e.type,!0);case 31:return qt("Activity");default:return""}}function Rn(e){try{var t="",n=null;do t+=hn(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
47
+ Error generating stack: `+l.message+`
48
+ `+l.stack}}var ie=Object.prototype.hasOwnProperty,we=s.unstable_scheduleCallback,$e=s.unstable_cancelCallback,mt=s.unstable_shouldYield,Kt=s.unstable_requestPaint,nt=s.unstable_now,Tt=s.unstable_getCurrentPriorityLevel,pn=s.unstable_ImmediatePriority,xn=s.unstable_UserBlockingPriority,qa=s.unstable_NormalPriority,Br=s.unstable_LowPriority,ci=s.unstable_IdlePriority,Hr=s.log,$r=s.unstable_setDisableYieldValue,Ga=null,Ut=null;function On(e){if(typeof Hr=="function"&&$r(e),Ut&&typeof Ut.setStrictMode=="function")try{Ut.setStrictMode(Ga,e)}catch{}}var Gt=Math.clz32?Math.clz32:oi,qr=Math.log,ss=Math.LN2;function oi(e){return e>>>=0,e===0?32:31-(qr(e)/ss|0)|0}var Ia=256,xl=262144,Ya=4194304;function Zt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function k(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,c=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var v=l&134217727;return v!==0?(l=v&~c,l!==0?i=Zt(l):(m&=v,m!==0?i=Zt(m):n||(n=v&~e,n!==0&&(i=Zt(n))))):(v=l&~c,v!==0?i=Zt(v):m!==0?i=Zt(m):n||(n=l&~e,n!==0&&(i=Zt(n)))),i===0?0:t!==0&&t!==i&&(t&c)===0&&(c=i&-i,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:i}function Z(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ce(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ee(){var e=Ya;return Ya<<=1,(Ya&62914560)===0&&(Ya=4194304),e}function at(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Pe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ge(e,t,n,l,i,c){var m=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var v=e.entanglements,N=e.expirationTimes,z=e.hiddenUpdates;for(n=m&~n;0<n;){var X=31-Gt(n),J=1<<X;v[X]=0,N[X]=-1;var L=z[X];if(L!==null)for(z[X]=null,X=0;X<L.length;X++){var $=L[X];$!==null&&($.lane&=-536870913)}n&=~J}l!==0&&fe(e,l,0),c!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=c&~(m&~t))}function fe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Gt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function ke(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-Gt(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function ht(e,t){var n=t&-t;return n=(n&42)!==0?1:rt(n),(n&(e.suspendedLanes|t))!==0?0:n}function rt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function In(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function gl(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:Jm(e.type))}function vl(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var Dn=Math.random().toString(36).slice(2),pt="__reactFiber$"+Dn,Bt="__reactProps$"+Dn,da="__reactContainer$"+Dn,is="__reactEvents$"+Dn,ui="__reactListeners$"+Dn,bl="__reactHandles$"+Dn,di="__reactResources$"+Dn,Xa="__reactMarker$"+Dn;function rs(e){delete e[pt],delete e[Bt],delete e[is],delete e[ui],delete e[bl]}function It(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[da]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zm(e);e!==null;){if(n=e[pt])return n;e=zm(e)}return t}e=n,n=e.parentNode}return null}function Yn(e){if(e=e[pt]||e[da]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function fa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function ma(e){var t=e[di];return t||(t=e[di]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[Xa]=!0}var fi=new Set,Va={};function Xn(e,t){se(e,t),se(e+"Capture",t)}function se(e,t){for(Va[e]=t,e=0;e<t.length;e++)fi.add(t[e])}var Ne=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]*$"),Oe={},Ve={};function xt(e){return ie.call(Ve,e)?!0:ie.call(Oe,e)?!1:Ne.test(e)?Ve[e]=!0:(Oe[e]=!0,!1)}function Ht(e,t,n){if(xt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function an(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Qt(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function tt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ln(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mi(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var i=l.get,c=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(m){n=""+m,c.call(this,m)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yl(e){if(!e._valueTracker){var t=ln(e)?"checked":"value";e._valueTracker=mi(e,t,""+e[t])}}function cs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=ln(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Nl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Gr=/[\n"\\]/g;function Ft(e){return e.replace(Gr,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function os(e,t,n,l,i,c,m,v){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+tt(t)):e.value!==""+tt(t)&&(e.value=""+tt(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?jl(e,m,tt(t)):n!=null?jl(e,m,tt(n)):l!=null&&e.removeAttribute("value"),i==null&&c!=null&&(e.defaultChecked=!!c),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+tt(v):e.removeAttribute("name")}function Ka(e,t,n,l,i,c,m,v){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){yl(e);return}n=n!=null?""+tt(n):"",t=t!=null?""+tt(t):n,v||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=v?e.checked:!!l,e.defaultChecked=!!l,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),yl(e)}function jl(e,t,n){t==="number"&&Nl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ct(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&l&&(e[n].defaultSelected=!0)}else{for(n=""+tt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function hi(e,t,n){if(t!=null&&(t=""+tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+tt(n):""}function Sl(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if(O(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=tt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),yl(e)}function _e(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pi=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 Nt(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||pi.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ke(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&Nt(e,i,l)}else for(var c in t)t.hasOwnProperty(c)&&Nt(e,c,t[c])}function ha(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Vn=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"]]),us=/^[\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 pa(e){return us.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function re(){}var ve=null;function Ae(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Le=null,ot=null;function gn(e){var t=Yn(e);if(t&&(e=t.stateNode)){var n=e[Bt]||null;e:switch(e=t.stateNode,t.type){case"input":if(os(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Ft(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[Bt]||null;if(!i)throw Error(o(90));os(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&cs(l)}break e;case"textarea":hi(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ct(e,!!n.multiple,t,!1)}}}var ds=!1;function xi(e,t,n){if(ds)return e(t,n);ds=!0;try{var l=e(t);return l}finally{if(ds=!1,(Le!==null||ot!==null)&&(ar(),Le&&(t=Le,e=ot,ot=Le=null,gn(t),e)))for(t=0;t<e.length;t++)gn(e[t])}}function fs(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Bt]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var Kn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ir=!1;if(Kn)try{var ms={};Object.defineProperty(ms,"passive",{get:function(){Ir=!0}}),window.addEventListener("test",ms,ms),window.removeEventListener("test",ms,ms)}catch{Ir=!1}var xa=null,Yr=null,gi=null;function wu(){if(gi)return gi;var e,t=Yr,n=t.length,l,i="value"in xa?xa.value:xa.textContent,c=i.length;for(e=0;e<n&&t[e]===i[e];e++);var m=n-e;for(l=1;l<=m&&t[n-l]===i[c-l];l++);return gi=i.slice(e,1<l?1-l:void 0)}function vi(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bi(){return!0}function Tu(){return!1}function Jt(e){function t(n,l,i,c,m){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=c,this.target=m,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(n=e[v],this[v]=n?n(c):c[v]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?bi:Tu,this.isPropagationStopped=Tu,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=bi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=bi)},persist:function(){},isPersistent:bi}),t}var Za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yi=Jt(Za),hs=y({},Za,{view:0,detail:0}),_p=Jt(hs),Xr,Vr,ps,Ni=y({},hs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ps&&(ps&&e.type==="mousemove"?(Xr=e.screenX-ps.screenX,Vr=e.screenY-ps.screenY):Vr=Xr=0,ps=e),Xr)},movementY:function(e){return"movementY"in e?e.movementY:Vr}}),Au=Jt(Ni),kp=y({},Ni,{dataTransfer:0}),Ep=Jt(kp),wp=y({},hs,{relatedTarget:0}),Kr=Jt(wp),Tp=y({},Za,{animationName:0,elapsedTime:0,pseudoElement:0}),Ap=Jt(Tp),Mp=y({},Za,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Cp=Jt(Mp),Rp=y({},Za,{data:0}),Mu=Jt(Rp),Op={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dp={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"},zp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Lp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zp[e])?!!t[e]:!1}function Zr(){return Lp}var Up=y({},hs,{key:function(e){if(e.key){var t=Op[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=vi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Dp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zr,charCode:function(e){return e.type==="keypress"?vi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Bp=Jt(Up),Hp=y({},Ni,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cu=Jt(Hp),$p=y({},hs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zr}),qp=Jt($p),Gp=y({},Za,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ip=Jt(Gp),Yp=y({},Ni,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Xp=Jt(Yp),Vp=y({},Za,{newState:0,oldState:0}),Kp=Jt(Vp),Zp=[9,13,27,32],Qr=Kn&&"CompositionEvent"in window,xs=null;Kn&&"documentMode"in document&&(xs=document.documentMode);var Qp=Kn&&"TextEvent"in window&&!xs,Ru=Kn&&(!Qr||xs&&8<xs&&11>=xs),Ou=" ",Du=!1;function zu(e,t){switch(e){case"keyup":return Zp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _l=!1;function Fp(e,t){switch(e){case"compositionend":return Lu(t);case"keypress":return t.which!==32?null:(Du=!0,Ou);case"textInput":return e=t.data,e===Ou&&Du?null:e;default:return null}}function Jp(e,t){if(_l)return e==="compositionend"||!Qr&&zu(e,t)?(e=wu(),gi=Yr=xa=null,_l=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ru&&t.locale!=="ko"?null:t.data;default:return null}}var Wp={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 Uu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Wp[e.type]:t==="textarea"}function Bu(e,t,n,l){Le?ot?ot.push(l):ot=[l]:Le=l,t=ur(t,"onChange"),0<t.length&&(n=new yi("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var gs=null,vs=null;function Pp(e){Nm(e,0)}function ji(e){var t=fa(e);if(cs(t))return e}function Hu(e,t){if(e==="change")return t}var $u=!1;if(Kn){var Fr;if(Kn){var Jr="oninput"in document;if(!Jr){var qu=document.createElement("div");qu.setAttribute("oninput","return;"),Jr=typeof qu.oninput=="function"}Fr=Jr}else Fr=!1;$u=Fr&&(!document.documentMode||9<document.documentMode)}function Gu(){gs&&(gs.detachEvent("onpropertychange",Iu),vs=gs=null)}function Iu(e){if(e.propertyName==="value"&&ji(vs)){var t=[];Bu(t,vs,e,Ae(e)),xi(Pp,t)}}function ex(e,t,n){e==="focusin"?(Gu(),gs=t,vs=n,gs.attachEvent("onpropertychange",Iu)):e==="focusout"&&Gu()}function tx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ji(vs)}function nx(e,t){if(e==="click")return ji(t)}function ax(e,t){if(e==="input"||e==="change")return ji(t)}function lx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sn=typeof Object.is=="function"?Object.is:lx;function bs(e,t){if(sn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var i=n[l];if(!ie.call(t,i)||!sn(e[i],t[i]))return!1}return!0}function Yu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xu(e,t){var n=Yu(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Yu(n)}}function Vu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ku(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nl(e.document)}return t}function Wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var sx=Kn&&"documentMode"in document&&11>=document.documentMode,kl=null,Pr=null,ys=null,ec=!1;function Zu(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ec||kl==null||kl!==Nl(l)||(l=kl,"selectionStart"in l&&Wr(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ys&&bs(ys,l)||(ys=l,l=ur(Pr,"onSelect"),0<l.length&&(t=new yi("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=kl)))}function Qa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var El={animationend:Qa("Animation","AnimationEnd"),animationiteration:Qa("Animation","AnimationIteration"),animationstart:Qa("Animation","AnimationStart"),transitionrun:Qa("Transition","TransitionRun"),transitionstart:Qa("Transition","TransitionStart"),transitioncancel:Qa("Transition","TransitionCancel"),transitionend:Qa("Transition","TransitionEnd")},tc={},Qu={};Kn&&(Qu=document.createElement("div").style,"AnimationEvent"in window||(delete El.animationend.animation,delete El.animationiteration.animation,delete El.animationstart.animation),"TransitionEvent"in window||delete El.transitionend.transition);function Fa(e){if(tc[e])return tc[e];if(!El[e])return e;var t=El[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qu)return tc[e]=t[n];return e}var Fu=Fa("animationend"),Ju=Fa("animationiteration"),Wu=Fa("animationstart"),ix=Fa("transitionrun"),rx=Fa("transitionstart"),cx=Fa("transitioncancel"),Pu=Fa("transitionend"),ed=new Map,nc="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(" ");nc.push("scrollEnd");function Tn(e,t){ed.set(e,t),Xn(t,[e])}var Si=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},vn=[],wl=0,ac=0;function _i(){for(var e=wl,t=ac=wl=0;t<e;){var n=vn[t];vn[t++]=null;var l=vn[t];vn[t++]=null;var i=vn[t];vn[t++]=null;var c=vn[t];if(vn[t++]=null,l!==null&&i!==null){var m=l.pending;m===null?i.next=i:(i.next=m.next,m.next=i),l.pending=i}c!==0&&td(n,i,c)}}function ki(e,t,n,l){vn[wl++]=e,vn[wl++]=t,vn[wl++]=n,vn[wl++]=l,ac|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function lc(e,t,n,l){return ki(e,t,n,l),Ei(e)}function Ja(e,t){return ki(e,null,null,t),Ei(e)}function td(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,c=e.return;c!==null;)c.childLanes|=n,l=c.alternate,l!==null&&(l.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(i=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,i&&t!==null&&(i=31-Gt(n),e=c.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),c):null}function Ei(e){if(50<Gs)throw Gs=0,ho=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Tl={};function ox(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rn(e,t,n,l){return new ox(e,t,n,l)}function sc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zn(e,t){var n=e.alternate;return n===null?(n=rn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function nd(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function wi(e,t,n,l,i,c){var m=0;if(l=e,typeof e=="function")sc(e)&&(m=1);else if(typeof e=="string")m=hg(e,n,W.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=rn(31,n,t,i),e.elementType=te,e.lanes=c,e;case A:return Wa(n.children,i,c,t);case T:m=8,i|=24;break;case F:return e=rn(12,n,t,i|2),e.elementType=F,e.lanes=c,e;case E:return e=rn(13,n,t,i),e.elementType=E,e.lanes=c,e;case G:return e=rn(19,n,t,i),e.elementType=G,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ae:m=10;break e;case Y:m=9;break e;case V:m=11;break e;case C:m=14;break e;case K:m=16,l=null;break e}m=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=rn(m,n,t,i),t.elementType=e,t.type=l,t.lanes=c,t}function Wa(e,t,n,l){return e=rn(7,e,l,t),e.lanes=n,e}function ic(e,t,n){return e=rn(6,e,null,t),e.lanes=n,e}function ad(e){var t=rn(18,null,null,0);return t.stateNode=e,t}function rc(e,t,n){return t=rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ld=new WeakMap;function bn(e,t){if(typeof e=="object"&&e!==null){var n=ld.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Rn(t)},ld.set(e,t),t)}return{value:e,source:t,stack:Rn(t)}}var Al=[],Ml=0,Ti=null,Ns=0,yn=[],Nn=0,ga=null,zn=1,Ln="";function Qn(e,t){Al[Ml++]=Ns,Al[Ml++]=Ti,Ti=e,Ns=t}function sd(e,t,n){yn[Nn++]=zn,yn[Nn++]=Ln,yn[Nn++]=ga,ga=e;var l=zn;e=Ln;var i=32-Gt(l)-1;l&=~(1<<i),n+=1;var c=32-Gt(t)+i;if(30<c){var m=i-i%5;c=(l&(1<<m)-1).toString(32),l>>=m,i-=m,zn=1<<32-Gt(t)+i|n<<i|l,Ln=c+e}else zn=1<<c|n<<i|l,Ln=e}function cc(e){e.return!==null&&(Qn(e,1),sd(e,1,0))}function oc(e){for(;e===Ti;)Ti=Al[--Ml],Al[Ml]=null,Ns=Al[--Ml],Al[Ml]=null;for(;e===ga;)ga=yn[--Nn],yn[Nn]=null,Ln=yn[--Nn],yn[Nn]=null,zn=yn[--Nn],yn[Nn]=null}function id(e,t){yn[Nn++]=zn,yn[Nn++]=Ln,yn[Nn++]=ga,zn=t.id,Ln=t.overflow,ga=e}var Rt=null,lt=null,He=!1,va=null,jn=!1,uc=Error(o(519));function ba(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw js(bn(t,e)),uc}function rd(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[pt]=e,t[Bt]=l,n){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(n=0;n<Ys.length;n++)ze(Ys[n],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),Ka(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),Sl(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||km(t.textContent,n)?(l.popover!=null&&(ze("beforetoggle",t),ze("toggle",t)),l.onScroll!=null&&ze("scroll",t),l.onScrollEnd!=null&&ze("scrollend",t),l.onClick!=null&&(t.onclick=re),t=!0):t=!1,t||ba(e,!0)}function cd(e){for(Rt=e.return;Rt;)switch(Rt.tag){case 5:case 31:case 13:jn=!1;return;case 27:case 3:jn=!0;return;default:Rt=Rt.return}}function Cl(e){if(e!==Rt)return!1;if(!He)return cd(e),He=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Ao(e.type,e.memoizedProps)),n=!n),n&&lt&&ba(e),cd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));lt=Dm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));lt=Dm(e)}else t===27?(t=lt,Oa(e.type)?(e=Do,Do=null,lt=e):lt=t):lt=Rt?_n(e.stateNode.nextSibling):null;return!0}function Pa(){lt=Rt=null,He=!1}function dc(){var e=va;return e!==null&&(tn===null?tn=e:tn.push.apply(tn,e),va=null),e}function js(e){va===null?va=[e]:va.push(e)}var fc=j(null),el=null,Fn=null;function ya(e,t,n){le(fc,t._currentValue),t._currentValue=n}function Jn(e){e._currentValue=fc.current,H(fc)}function mc(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function hc(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var c=i.dependencies;if(c!==null){var m=i.child;c=c.firstContext;e:for(;c!==null;){var v=c;c=i;for(var N=0;N<t.length;N++)if(v.context===t[N]){c.lanes|=n,v=c.alternate,v!==null&&(v.lanes|=n),mc(c.return,n,e),l||(m=null);break e}c=v.next}}else if(i.tag===18){if(m=i.return,m===null)throw Error(o(341));m.lanes|=n,c=m.alternate,c!==null&&(c.lanes|=n),mc(m,n,e),m=null}else m=i.child;if(m!==null)m.return=i;else for(m=i;m!==null;){if(m===e){m=null;break}if(i=m.sibling,i!==null){i.return=m.return,m=i;break}m=m.return}i=m}}function Rl(e,t,n,l){e=null;for(var i=t,c=!1;i!==null;){if(!c){if((i.flags&524288)!==0)c=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var m=i.alternate;if(m===null)throw Error(o(387));if(m=m.memoizedProps,m!==null){var v=i.type;sn(i.pendingProps.value,m.value)||(e!==null?e.push(v):e=[v])}}else if(i===xe.current){if(m=i.alternate,m===null)throw Error(o(387));m.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Qs):e=[Qs])}i=i.return}e!==null&&hc(t,e,n,l),t.flags|=262144}function Ai(e){for(e=e.firstContext;e!==null;){if(!sn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function tl(e){el=e,Fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ot(e){return od(el,e)}function Mi(e,t){return el===null&&tl(e),od(e,t)}function od(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Fn===null){if(e===null)throw Error(o(308));Fn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fn=Fn.next=t;return n}var ux=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},dx=s.unstable_scheduleCallback,fx=s.unstable_NormalPriority,jt={$$typeof:ae,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pc(){return{controller:new ux,data:new Map,refCount:0}}function Ss(e){e.refCount--,e.refCount===0&&dx(fx,function(){e.controller.abort()})}var _s=null,xc=0,Ol=0,Dl=null;function mx(e,t){if(_s===null){var n=_s=[];xc=0,Ol=yo(),Dl={status:"pending",value:void 0,then:function(l){n.push(l)}}}return xc++,t.then(ud,ud),t}function ud(){if(--xc===0&&_s!==null){Dl!==null&&(Dl.status="fulfilled");var e=_s;_s=null,Ol=0,Dl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function hx(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),l}var dd=M.S;M.S=function(e,t){Qf=nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&mx(e,t),dd!==null&&dd(e,t)};var nl=j(null);function gc(){var e=nl.current;return e!==null?e:et.pooledCache}function Ci(e,t){t===null?le(nl,nl.current):le(nl,t.pool)}function fd(){var e=gc();return e===null?null:{parent:jt._currentValue,pool:e}}var zl=Error(o(460)),vc=Error(o(474)),Ri=Error(o(542)),Oi={then:function(){}};function md(e){return e=e.status,e==="fulfilled"||e==="rejected"}function hd(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(re,re),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xd(e),e;default:if(typeof t.status=="string")t.then(re,re);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xd(e),e}throw ll=t,zl}}function al(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ll=n,zl):n}}var ll=null;function pd(){if(ll===null)throw Error(o(459));var e=ll;return ll=null,e}function xd(e){if(e===zl||e===Ri)throw Error(o(483))}var Ll=null,ks=0;function Di(e){var t=ks;return ks+=1,Ll===null&&(Ll=[]),hd(Ll,e,t)}function Es(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function zi(e,t){throw t.$$typeof===_?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function gd(e){function t(R,w){if(e){var D=R.deletions;D===null?(R.deletions=[w],R.flags|=16):D.push(w)}}function n(R,w){if(!e)return null;for(;w!==null;)t(R,w),w=w.sibling;return null}function l(R){for(var w=new Map;R!==null;)R.key!==null?w.set(R.key,R):w.set(R.index,R),R=R.sibling;return w}function i(R,w){return R=Zn(R,w),R.index=0,R.sibling=null,R}function c(R,w,D){return R.index=D,e?(D=R.alternate,D!==null?(D=D.index,D<w?(R.flags|=67108866,w):D):(R.flags|=67108866,w)):(R.flags|=1048576,w)}function m(R){return e&&R.alternate===null&&(R.flags|=67108866),R}function v(R,w,D,Q){return w===null||w.tag!==6?(w=ic(D,R.mode,Q),w.return=R,w):(w=i(w,D),w.return=R,w)}function N(R,w,D,Q){var je=D.type;return je===A?X(R,w,D.props.children,Q,D.key):w!==null&&(w.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&al(je)===w.type)?(w=i(w,D.props),Es(w,D),w.return=R,w):(w=wi(D.type,D.key,D.props,null,R.mode,Q),Es(w,D),w.return=R,w)}function z(R,w,D,Q){return w===null||w.tag!==4||w.stateNode.containerInfo!==D.containerInfo||w.stateNode.implementation!==D.implementation?(w=rc(D,R.mode,Q),w.return=R,w):(w=i(w,D.children||[]),w.return=R,w)}function X(R,w,D,Q,je){return w===null||w.tag!==7?(w=Wa(D,R.mode,Q,je),w.return=R,w):(w=i(w,D),w.return=R,w)}function J(R,w,D){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=ic(""+w,R.mode,D),w.return=R,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case B:return D=wi(w.type,w.key,w.props,null,R.mode,D),Es(D,w),D.return=R,D;case U:return w=rc(w,R.mode,D),w.return=R,w;case K:return w=al(w),J(R,w,D)}if(O(w)||ne(w))return w=Wa(w,R.mode,D,null),w.return=R,w;if(typeof w.then=="function")return J(R,Di(w),D);if(w.$$typeof===ae)return J(R,Mi(R,w),D);zi(R,w)}return null}function L(R,w,D,Q){var je=w!==null?w.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return je!==null?null:v(R,w,""+D,Q);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case B:return D.key===je?N(R,w,D,Q):null;case U:return D.key===je?z(R,w,D,Q):null;case K:return D=al(D),L(R,w,D,Q)}if(O(D)||ne(D))return je!==null?null:X(R,w,D,Q,null);if(typeof D.then=="function")return L(R,w,Di(D),Q);if(D.$$typeof===ae)return L(R,w,Mi(R,D),Q);zi(R,D)}return null}function $(R,w,D,Q,je){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return R=R.get(D)||null,v(w,R,""+Q,je);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case B:return R=R.get(Q.key===null?D:Q.key)||null,N(w,R,Q,je);case U:return R=R.get(Q.key===null?D:Q.key)||null,z(w,R,Q,je);case K:return Q=al(Q),$(R,w,D,Q,je)}if(O(Q)||ne(Q))return R=R.get(D)||null,X(w,R,Q,je,null);if(typeof Q.then=="function")return $(R,w,D,Di(Q),je);if(Q.$$typeof===ae)return $(R,w,D,Mi(w,Q),je);zi(w,Q)}return null}function pe(R,w,D,Q){for(var je=null,qe=null,be=w,Ce=w=0,Be=null;be!==null&&Ce<D.length;Ce++){be.index>Ce?(Be=be,be=null):Be=be.sibling;var Ge=L(R,be,D[Ce],Q);if(Ge===null){be===null&&(be=Be);break}e&&be&&Ge.alternate===null&&t(R,be),w=c(Ge,w,Ce),qe===null?je=Ge:qe.sibling=Ge,qe=Ge,be=Be}if(Ce===D.length)return n(R,be),He&&Qn(R,Ce),je;if(be===null){for(;Ce<D.length;Ce++)be=J(R,D[Ce],Q),be!==null&&(w=c(be,w,Ce),qe===null?je=be:qe.sibling=be,qe=be);return He&&Qn(R,Ce),je}for(be=l(be);Ce<D.length;Ce++)Be=$(be,R,Ce,D[Ce],Q),Be!==null&&(e&&Be.alternate!==null&&be.delete(Be.key===null?Ce:Be.key),w=c(Be,w,Ce),qe===null?je=Be:qe.sibling=Be,qe=Be);return e&&be.forEach(function(Ba){return t(R,Ba)}),He&&Qn(R,Ce),je}function Se(R,w,D,Q){if(D==null)throw Error(o(151));for(var je=null,qe=null,be=w,Ce=w=0,Be=null,Ge=D.next();be!==null&&!Ge.done;Ce++,Ge=D.next()){be.index>Ce?(Be=be,be=null):Be=be.sibling;var Ba=L(R,be,Ge.value,Q);if(Ba===null){be===null&&(be=Be);break}e&&be&&Ba.alternate===null&&t(R,be),w=c(Ba,w,Ce),qe===null?je=Ba:qe.sibling=Ba,qe=Ba,be=Be}if(Ge.done)return n(R,be),He&&Qn(R,Ce),je;if(be===null){for(;!Ge.done;Ce++,Ge=D.next())Ge=J(R,Ge.value,Q),Ge!==null&&(w=c(Ge,w,Ce),qe===null?je=Ge:qe.sibling=Ge,qe=Ge);return He&&Qn(R,Ce),je}for(be=l(be);!Ge.done;Ce++,Ge=D.next())Ge=$(be,R,Ce,Ge.value,Q),Ge!==null&&(e&&Ge.alternate!==null&&be.delete(Ge.key===null?Ce:Ge.key),w=c(Ge,w,Ce),qe===null?je=Ge:qe.sibling=Ge,qe=Ge);return e&&be.forEach(function(kg){return t(R,kg)}),He&&Qn(R,Ce),je}function We(R,w,D,Q){if(typeof D=="object"&&D!==null&&D.type===A&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case B:e:{for(var je=D.key;w!==null;){if(w.key===je){if(je=D.type,je===A){if(w.tag===7){n(R,w.sibling),Q=i(w,D.props.children),Q.return=R,R=Q;break e}}else if(w.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&al(je)===w.type){n(R,w.sibling),Q=i(w,D.props),Es(Q,D),Q.return=R,R=Q;break e}n(R,w);break}else t(R,w);w=w.sibling}D.type===A?(Q=Wa(D.props.children,R.mode,Q,D.key),Q.return=R,R=Q):(Q=wi(D.type,D.key,D.props,null,R.mode,Q),Es(Q,D),Q.return=R,R=Q)}return m(R);case U:e:{for(je=D.key;w!==null;){if(w.key===je)if(w.tag===4&&w.stateNode.containerInfo===D.containerInfo&&w.stateNode.implementation===D.implementation){n(R,w.sibling),Q=i(w,D.children||[]),Q.return=R,R=Q;break e}else{n(R,w);break}else t(R,w);w=w.sibling}Q=rc(D,R.mode,Q),Q.return=R,R=Q}return m(R);case K:return D=al(D),We(R,w,D,Q)}if(O(D))return pe(R,w,D,Q);if(ne(D)){if(je=ne(D),typeof je!="function")throw Error(o(150));return D=je.call(D),Se(R,w,D,Q)}if(typeof D.then=="function")return We(R,w,Di(D),Q);if(D.$$typeof===ae)return We(R,w,Mi(R,D),Q);zi(R,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,w!==null&&w.tag===6?(n(R,w.sibling),Q=i(w,D),Q.return=R,R=Q):(n(R,w),Q=ic(D,R.mode,Q),Q.return=R,R=Q),m(R)):n(R,w)}return function(R,w,D,Q){try{ks=0;var je=We(R,w,D,Q);return Ll=null,je}catch(be){if(be===zl||be===Ri)throw be;var qe=rn(29,be,null,R.mode);return qe.lanes=Q,qe.return=R,qe}finally{}}}var sl=gd(!0),vd=gd(!1),Na=!1;function bc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Sa(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Xe&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=Ei(e),td(e,null,n),t}return ki(e,l,t,n),Ei(e)}function ws(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,ke(e,n)}}function Nc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?i=c=m:c=c.next=m,n=n.next}while(n!==null);c===null?i=c=t:c=c.next=t}else i=c=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var jc=!1;function Ts(){if(jc){var e=Dl;if(e!==null)throw e}}function As(e,t,n,l){jc=!1;var i=e.updateQueue;Na=!1;var c=i.firstBaseUpdate,m=i.lastBaseUpdate,v=i.shared.pending;if(v!==null){i.shared.pending=null;var N=v,z=N.next;N.next=null,m===null?c=z:m.next=z,m=N;var X=e.alternate;X!==null&&(X=X.updateQueue,v=X.lastBaseUpdate,v!==m&&(v===null?X.firstBaseUpdate=z:v.next=z,X.lastBaseUpdate=N))}if(c!==null){var J=i.baseState;m=0,X=z=N=null,v=c;do{var L=v.lane&-536870913,$=L!==v.lane;if($?(Ue&L)===L:(l&L)===L){L!==0&&L===Ol&&(jc=!0),X!==null&&(X=X.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var pe=e,Se=v;L=t;var We=n;switch(Se.tag){case 1:if(pe=Se.payload,typeof pe=="function"){J=pe.call(We,J,L);break e}J=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Se.payload,L=typeof pe=="function"?pe.call(We,J,L):pe,L==null)break e;J=y({},J,L);break e;case 2:Na=!0}}L=v.callback,L!==null&&(e.flags|=64,$&&(e.flags|=8192),$=i.callbacks,$===null?i.callbacks=[L]:$.push(L))}else $={lane:L,tag:v.tag,payload:v.payload,callback:v.callback,next:null},X===null?(z=X=$,N=J):X=X.next=$,m|=L;if(v=v.next,v===null){if(v=i.shared.pending,v===null)break;$=v,v=$.next,$.next=null,i.lastBaseUpdate=$,i.shared.pending=null}}while(!0);X===null&&(N=J),i.baseState=N,i.firstBaseUpdate=z,i.lastBaseUpdate=X,c===null&&(i.shared.lanes=0),Ta|=m,e.lanes=m,e.memoizedState=J}}function bd(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function yd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bd(n[e],t)}var Ul=j(null),Li=j(0);function Nd(e,t){e=ia,le(Li,e),le(Ul,t),ia=e|t.baseLanes}function Sc(){le(Li,ia),le(Ul,Ul.current)}function _c(){ia=Li.current,H(Ul),H(Li)}var cn=j(null),Sn=null;function _a(e){var t=e.alternate;le(gt,gt.current&1),le(cn,e),Sn===null&&(t===null||Ul.current!==null||t.memoizedState!==null)&&(Sn=e)}function kc(e){le(gt,gt.current),le(cn,e),Sn===null&&(Sn=e)}function jd(e){e.tag===22?(le(gt,gt.current),le(cn,e),Sn===null&&(Sn=e)):ka()}function ka(){le(gt,gt.current),le(cn,cn.current)}function on(e){H(cn),Sn===e&&(Sn=null),H(gt)}var gt=j(0);function Ui(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ro(n)||Oo(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wn=0,Me=null,Fe=null,St=null,Bi=!1,Bl=!1,il=!1,Hi=0,Ms=0,Hl=null,px=0;function dt(){throw Error(o(321))}function Ec(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sn(e[n],t[n]))return!1;return!0}function wc(e,t,n,l,i,c){return Wn=c,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?sf:Gc,il=!1,c=n(l,i),il=!1,Bl&&(c=_d(t,n,l,i)),Sd(e),c}function Sd(e){M.H=Os;var t=Fe!==null&&Fe.next!==null;if(Wn=0,St=Fe=Me=null,Bi=!1,Ms=0,Hl=null,t)throw Error(o(300));e===null||_t||(e=e.dependencies,e!==null&&Ai(e)&&(_t=!0))}function _d(e,t,n,l){Me=e;var i=0;do{if(Bl&&(Hl=null),Ms=0,Bl=!1,25<=i)throw Error(o(301));if(i+=1,St=Fe=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}M.H=rf,c=t(n,l)}while(Bl);return c}function xx(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?Cs(t):t,e=e.useState()[0],(Fe!==null?Fe.memoizedState:null)!==e&&(Me.flags|=1024),t}function Tc(){var e=Hi!==0;return Hi=0,e}function Ac(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Mc(e){if(Bi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bi=!1}Wn=0,St=Fe=Me=null,Bl=!1,Ms=Hi=0,Hl=null}function Yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?Me.memoizedState=St=e:St=St.next=e,St}function vt(){if(Fe===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=St===null?Me.memoizedState:St.next;if(t!==null)St=t,Fe=e;else{if(e===null)throw Me.alternate===null?Error(o(467)):Error(o(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},St===null?Me.memoizedState=St=e:St=St.next=e}return St}function $i(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Cs(e){var t=Ms;return Ms+=1,Hl===null&&(Hl=[]),e=hd(Hl,e,t),t=Me,(St===null?t.memoizedState:St.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?sf:Gc),e}function qi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Cs(e);if(e.$$typeof===ae)return Ot(e)}throw Error(o(438,String(e)))}function Cc(e){var t=null,n=Me.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Me.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=$i(),Me.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=P;return t.index++,n}function Pn(e,t){return typeof t=="function"?t(e):t}function Gi(e){var t=vt();return Rc(t,Fe,e)}function Rc(e,t,n){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=n;var i=e.baseQueue,c=l.pending;if(c!==null){if(i!==null){var m=i.next;i.next=c.next,c.next=m}t.baseQueue=i=c,l.pending=null}if(c=e.baseState,i===null)e.memoizedState=c;else{t=i.next;var v=m=null,N=null,z=t,X=!1;do{var J=z.lane&-536870913;if(J!==z.lane?(Ue&J)===J:(Wn&J)===J){var L=z.revertLane;if(L===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),J===Ol&&(X=!0);else if((Wn&L)===L){z=z.next,L===Ol&&(X=!0);continue}else J={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},N===null?(v=N=J,m=c):N=N.next=J,Me.lanes|=L,Ta|=L;J=z.action,il&&n(c,J),c=z.hasEagerState?z.eagerState:n(c,J)}else L={lane:J,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},N===null?(v=N=L,m=c):N=N.next=L,Me.lanes|=J,Ta|=J;z=z.next}while(z!==null&&z!==t);if(N===null?m=c:N.next=v,!sn(c,e.memoizedState)&&(_t=!0,X&&(n=Dl,n!==null)))throw n;e.memoizedState=c,e.baseState=m,e.baseQueue=N,l.lastRenderedState=c}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Oc(e){var t=vt(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,c=t.memoizedState;if(i!==null){n.pending=null;var m=i=i.next;do c=e(c,m.action),m=m.next;while(m!==i);sn(c,t.memoizedState)||(_t=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,l]}function kd(e,t,n){var l=Me,i=vt(),c=He;if(c){if(n===void 0)throw Error(o(407));n=n()}else n=t();var m=!sn((Fe||i).memoizedState,n);if(m&&(i.memoizedState=n,_t=!0),i=i.queue,Lc(Td.bind(null,l,i,e),[e]),i.getSnapshot!==t||m||St!==null&&St.memoizedState.tag&1){if(l.flags|=2048,$l(9,{destroy:void 0},wd.bind(null,l,i,n,t),null),et===null)throw Error(o(349));c||(Wn&127)!==0||Ed(l,t,n)}return n}function Ed(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Me.updateQueue,t===null?(t=$i(),Me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function wd(e,t,n,l){t.value=n,t.getSnapshot=l,Ad(t)&&Md(e)}function Td(e,t,n){return n(function(){Ad(t)&&Md(e)})}function Ad(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sn(e,n)}catch{return!0}}function Md(e){var t=Ja(e,2);t!==null&&nn(t,e,2)}function Dc(e){var t=Yt();if(typeof e=="function"){var n=e;if(e=n(),il){On(!0);try{n()}finally{On(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:e},t}function Cd(e,t,n,l){return e.baseState=n,Rc(e,Fe,typeof l=="function"?l:Pn)}function gx(e,t,n,l,i){if(Xi(e))throw Error(o(485));if(e=t.action,e!==null){var c={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){c.listeners.push(m)}};M.T!==null?n(!0):c.isTransition=!1,l(c),n=t.pending,n===null?(c.next=t.pending=c,Rd(t,c)):(c.next=n.next,t.pending=n.next=c)}}function Rd(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var c=M.T,m={};M.T=m;try{var v=n(i,l),N=M.S;N!==null&&N(m,v),Od(e,t,v)}catch(z){zc(e,t,z)}finally{c!==null&&m.types!==null&&(c.types=m.types),M.T=c}}else try{c=n(i,l),Od(e,t,c)}catch(z){zc(e,t,z)}}function Od(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Dd(e,t,l)},function(l){return zc(e,t,l)}):Dd(e,t,n)}function Dd(e,t,n){t.status="fulfilled",t.value=n,zd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Rd(e,n)))}function zc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,zd(t),t=t.next;while(t!==l)}e.action=null}function zd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ld(e,t){return t}function Ud(e,t){if(He){var n=et.formState;if(n!==null){e:{var l=Me;if(He){if(lt){t:{for(var i=lt,c=jn;i.nodeType!==8;){if(!c){i=null;break t}if(i=_n(i.nextSibling),i===null){i=null;break t}}c=i.data,i=c==="F!"||c==="F"?i:null}if(i){lt=_n(i.nextSibling),l=i.data==="F!";break e}}ba(l)}l=!1}l&&(t=n[0])}}return n=Yt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ld,lastRenderedState:t},n.queue=l,n=nf.bind(null,Me,l),l.dispatch=n,l=Dc(!1),c=qc.bind(null,Me,!1,l.queue),l=Yt(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=gx.bind(null,Me,i,c,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function Bd(e){var t=vt();return Hd(t,Fe,e)}function Hd(e,t,n){if(t=Rc(e,t,Ld)[0],e=Gi(Pn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Cs(t)}catch(m){throw m===zl?Ri:m}else l=t;t=vt();var i=t.queue,c=i.dispatch;return n!==t.memoizedState&&(Me.flags|=2048,$l(9,{destroy:void 0},vx.bind(null,i,n),null)),[l,c,e]}function vx(e,t){e.action=t}function $d(e){var t=vt(),n=Fe;if(n!==null)return Hd(t,n,e);vt(),t=t.memoizedState,n=vt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function $l(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Me.updateQueue,t===null&&(t=$i(),Me.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function qd(){return vt().memoizedState}function Ii(e,t,n,l){var i=Yt();Me.flags|=e,i.memoizedState=$l(1|t,{destroy:void 0},n,l===void 0?null:l)}function Yi(e,t,n,l){var i=vt();l=l===void 0?null:l;var c=i.memoizedState.inst;Fe!==null&&l!==null&&Ec(l,Fe.memoizedState.deps)?i.memoizedState=$l(t,c,n,l):(Me.flags|=e,i.memoizedState=$l(1|t,c,n,l))}function Gd(e,t){Ii(8390656,8,e,t)}function Lc(e,t){Yi(2048,8,e,t)}function bx(e){Me.flags|=4;var t=Me.updateQueue;if(t===null)t=$i(),Me.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Id(e){var t=vt().memoizedState;return bx({ref:t,nextImpl:e}),function(){if((Xe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Yd(e,t){return Yi(4,2,e,t)}function Xd(e,t){return Yi(4,4,e,t)}function Vd(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Kd(e,t,n){n=n!=null?n.concat([e]):null,Yi(4,4,Vd.bind(null,t,e),n)}function Uc(){}function Zd(e,t){var n=vt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Ec(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Qd(e,t){var n=vt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Ec(t,l[1]))return l[0];if(l=e(),il){On(!0);try{e()}finally{On(!1)}}return n.memoizedState=[l,t],l}function Bc(e,t,n){return n===void 0||(Wn&1073741824)!==0&&(Ue&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Jf(),Me.lanes|=e,Ta|=e,n)}function Fd(e,t,n,l){return sn(n,t)?n:Ul.current!==null?(e=Bc(e,n,l),sn(e,t)||(_t=!0),e):(Wn&42)===0||(Wn&1073741824)!==0&&(Ue&261930)===0?(_t=!0,e.memoizedState=n):(e=Jf(),Me.lanes|=e,Ta|=e,t)}function Jd(e,t,n,l,i){var c=I.p;I.p=c!==0&&8>c?c:8;var m=M.T,v={};M.T=v,qc(e,!1,t,n);try{var N=i(),z=M.S;if(z!==null&&z(v,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var X=hx(N,l);Rs(e,t,X,fn(e))}else Rs(e,t,l,fn(e))}catch(J){Rs(e,t,{then:function(){},status:"rejected",reason:J},fn())}finally{I.p=c,m!==null&&v.types!==null&&(m.types=v.types),M.T=m}}function yx(){}function Hc(e,t,n,l){if(e.tag!==5)throw Error(o(476));var i=Wd(e).queue;Jd(e,i,t,ee,n===null?yx:function(){return Pd(e),n(l)})}function Wd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:ee},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Pd(e){var t=Wd(e);t.next===null&&(t=e.alternate.memoizedState),Rs(e,t.next.queue,{},fn())}function $c(){return Ot(Qs)}function ef(){return vt().memoizedState}function tf(){return vt().memoizedState}function Nx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fn();e=ja(n);var l=Sa(t,e,n);l!==null&&(nn(l,t,n),ws(l,t,n)),t={cache:pc()},e.payload=t;return}t=t.return}}function jx(e,t,n){var l=fn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Xi(e)?af(t,n):(n=lc(e,t,n,l),n!==null&&(nn(n,e,l),lf(n,t,l)))}function nf(e,t,n){var l=fn();Rs(e,t,n,l)}function Rs(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xi(e))af(t,i);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var m=t.lastRenderedState,v=c(m,n);if(i.hasEagerState=!0,i.eagerState=v,sn(v,m))return ki(e,t,i,0),et===null&&_i(),!1}catch{}finally{}if(n=lc(e,t,i,l),n!==null)return nn(n,e,l),lf(n,t,l),!0}return!1}function qc(e,t,n,l){if(l={lane:2,revertLane:yo(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Xi(e)){if(t)throw Error(o(479))}else t=lc(e,n,l,2),t!==null&&nn(t,e,2)}function Xi(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function af(e,t){Bl=Bi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lf(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,ke(e,n)}}var Os={readContext:Ot,use:qi,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt,useHostTransitionStatus:dt,useFormState:dt,useActionState:dt,useOptimistic:dt,useMemoCache:dt,useCacheRefresh:dt};Os.useEffectEvent=dt;var sf={readContext:Ot,use:qi,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:Ot,useEffect:Gd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ii(4194308,4,Vd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ii(4194308,4,e,t)},useInsertionEffect:function(e,t){Ii(4,2,e,t)},useMemo:function(e,t){var n=Yt();t=t===void 0?null:t;var l=e();if(il){On(!0);try{e()}finally{On(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Yt();if(n!==void 0){var i=n(t);if(il){On(!0);try{n(t)}finally{On(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=jx.bind(null,Me,e),[l.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:function(e){e=Dc(e);var t=e.queue,n=nf.bind(null,Me,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Uc,useDeferredValue:function(e,t){var n=Yt();return Bc(n,e,t)},useTransition:function(){var e=Dc(!1);return e=Jd.bind(null,Me,e.queue,!0,!1),Yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Me,i=Yt();if(He){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),et===null)throw Error(o(349));(Ue&127)!==0||Ed(l,t,n)}i.memoizedState=n;var c={value:n,getSnapshot:t};return i.queue=c,Gd(Td.bind(null,l,c,e),[e]),l.flags|=2048,$l(9,{destroy:void 0},wd.bind(null,l,c,n,t),null),n},useId:function(){var e=Yt(),t=et.identifierPrefix;if(He){var n=Ln,l=zn;n=(l&~(1<<32-Gt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Hi++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=px++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:$c,useFormState:Ud,useActionState:Ud,useOptimistic:function(e){var t=Yt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=qc.bind(null,Me,!0,n),n.dispatch=t,[e,t]},useMemoCache:Cc,useCacheRefresh:function(){return Yt().memoizedState=Nx.bind(null,Me)},useEffectEvent:function(e){var t=Yt(),n={impl:e};return t.memoizedState=n,function(){if((Xe&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Gc={readContext:Ot,use:qi,useCallback:Zd,useContext:Ot,useEffect:Lc,useImperativeHandle:Kd,useInsertionEffect:Yd,useLayoutEffect:Xd,useMemo:Qd,useReducer:Gi,useRef:qd,useState:function(){return Gi(Pn)},useDebugValue:Uc,useDeferredValue:function(e,t){var n=vt();return Fd(n,Fe.memoizedState,e,t)},useTransition:function(){var e=Gi(Pn)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Cs(e),t]},useSyncExternalStore:kd,useId:ef,useHostTransitionStatus:$c,useFormState:Bd,useActionState:Bd,useOptimistic:function(e,t){var n=vt();return Cd(n,Fe,e,t)},useMemoCache:Cc,useCacheRefresh:tf};Gc.useEffectEvent=Id;var rf={readContext:Ot,use:qi,useCallback:Zd,useContext:Ot,useEffect:Lc,useImperativeHandle:Kd,useInsertionEffect:Yd,useLayoutEffect:Xd,useMemo:Qd,useReducer:Oc,useRef:qd,useState:function(){return Oc(Pn)},useDebugValue:Uc,useDeferredValue:function(e,t){var n=vt();return Fe===null?Bc(n,e,t):Fd(n,Fe.memoizedState,e,t)},useTransition:function(){var e=Oc(Pn)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Cs(e),t]},useSyncExternalStore:kd,useId:ef,useHostTransitionStatus:$c,useFormState:$d,useActionState:$d,useOptimistic:function(e,t){var n=vt();return Fe!==null?Cd(n,Fe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Cc,useCacheRefresh:tf};rf.useEffectEvent=Id;function Ic(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:y({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Yc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=fn(),i=ja(l);i.payload=t,n!=null&&(i.callback=n),t=Sa(e,i,l),t!==null&&(nn(t,e,l),ws(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=fn(),i=ja(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Sa(e,i,l),t!==null&&(nn(t,e,l),ws(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fn(),l=ja(n);l.tag=2,t!=null&&(l.callback=t),t=Sa(e,l,n),t!==null&&(nn(t,e,n),ws(t,e,n))}};function cf(e,t,n,l,i,c,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,m):t.prototype&&t.prototype.isPureReactComponent?!bs(n,l)||!bs(i,c):!0}function of(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Yc.enqueueReplaceState(t,t.state,null)}function rl(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=y({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function uf(e){Si(e)}function df(e){console.error(e)}function ff(e){Si(e)}function Vi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function mf(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Xc(e,t,n){return n=ja(n),n.tag=3,n.payload={element:null},n.callback=function(){Vi(e,t)},n}function hf(e){return e=ja(e),e.tag=3,e}function pf(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var c=l.value;e.payload=function(){return i(c)},e.callback=function(){mf(t,n,l)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){mf(t,n,l),typeof i!="function"&&(Aa===null?Aa=new Set([this]):Aa.add(this));var v=l.stack;this.componentDidCatch(l.value,{componentStack:v!==null?v:""})})}function Sx(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Rl(t,n,i,!0),n=cn.current,n!==null){switch(n.tag){case 31:case 13:return Sn===null?lr():n.alternate===null&&ft===0&&(ft=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===Oi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),go(e,l,i)),!1;case 22:return n.flags|=65536,l===Oi?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),go(e,l,i)),!1}throw Error(o(435,n.tag))}return go(e,l,i),lr(),!1}if(He)return t=cn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==uc&&(e=Error(o(422),{cause:l}),js(bn(e,n)))):(l!==uc&&(t=Error(o(423),{cause:l}),js(bn(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=bn(l,n),i=Xc(e.stateNode,l,i),Nc(e,i),ft!==4&&(ft=2)),!1;var c=Error(o(520),{cause:l});if(c=bn(c,n),qs===null?qs=[c]:qs.push(c),ft!==4&&(ft=2),t===null)return!0;l=bn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Xc(n.stateNode,l,e),Nc(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Aa===null||!Aa.has(c))))return n.flags|=65536,i&=-i,n.lanes|=i,i=hf(i),pf(i,e,n,l),Nc(n,i),!1}n=n.return}while(n!==null);return!1}var Vc=Error(o(461)),_t=!1;function Dt(e,t,n,l){t.child=e===null?vd(t,null,n,l):sl(t,e.child,n,l)}function xf(e,t,n,l,i){n=n.render;var c=t.ref;if("ref"in l){var m={};for(var v in l)v!=="ref"&&(m[v]=l[v])}else m=l;return tl(t),l=wc(e,t,n,m,c,i),v=Tc(),e!==null&&!_t?(Ac(e,t,i),ea(e,t,i)):(He&&v&&cc(t),t.flags|=1,Dt(e,t,l,i),t.child)}function gf(e,t,n,l,i){if(e===null){var c=n.type;return typeof c=="function"&&!sc(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,vf(e,t,c,l,i)):(e=wi(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!eo(e,i)){var m=c.memoizedProps;if(n=n.compare,n=n!==null?n:bs,n(m,l)&&e.ref===t.ref)return ea(e,t,i)}return t.flags|=1,e=Zn(c,l),e.ref=t.ref,e.return=t,t.child=e}function vf(e,t,n,l,i){if(e!==null){var c=e.memoizedProps;if(bs(c,l)&&e.ref===t.ref)if(_t=!1,t.pendingProps=l=c,eo(e,i))(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,ea(e,t,i)}return Kc(e,t,n,l,i)}function bf(e,t,n,l){var i=l.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~c}else l=0,t.child=null;return yf(e,t,c,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ci(t,c!==null?c.cachePool:null),c!==null?Nd(t,c):Sc(),jd(t);else return l=t.lanes=536870912,yf(e,t,c!==null?c.baseLanes|n:n,n,l)}else c!==null?(Ci(t,c.cachePool),Nd(t,c),ka(),t.memoizedState=null):(e!==null&&Ci(t,null),Sc(),ka());return Dt(e,t,i,n),t.child}function Ds(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function yf(e,t,n,l,i){var c=gc();return c=c===null?null:{parent:jt._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&Ci(t,null),Sc(),jd(t),e!==null&&Rl(e,t,l,!0),t.childLanes=i,null}function Ki(e,t){return t=Qi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Nf(e,t,n){return sl(t,e.child,null,n),e=Ki(t,t.pendingProps),e.flags|=2,on(t),t.memoizedState=null,e}function _x(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(l.mode==="hidden")return e=Ki(t,l),t.lanes=536870912,Ds(null,e);if(kc(t),(e=lt)?(e=Om(e,jn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ga!==null?{id:zn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},n=ad(e),n.return=t,t.child=n,Rt=t,lt=null)):e=null,e===null)throw ba(t);return t.lanes=536870912,null}return Ki(t,l)}var c=e.memoizedState;if(c!==null){var m=c.dehydrated;if(kc(t),i)if(t.flags&256)t.flags&=-257,t=Nf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(_t||Rl(e,t,n,!1),i=(n&e.childLanes)!==0,_t||i){if(l=et,l!==null&&(m=ht(l,n),m!==0&&m!==c.retryLane))throw c.retryLane=m,Ja(e,m),nn(l,e,m),Vc;lr(),t=Nf(e,t,n)}else e=c.treeContext,lt=_n(m.nextSibling),Rt=t,He=!0,va=null,jn=!1,e!==null&&id(t,e),t=Ki(t,l),t.flags|=4096;return t}return e=Zn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Zi(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Kc(e,t,n,l,i){return tl(t),n=wc(e,t,n,l,void 0,i),l=Tc(),e!==null&&!_t?(Ac(e,t,i),ea(e,t,i)):(He&&l&&cc(t),t.flags|=1,Dt(e,t,n,i),t.child)}function jf(e,t,n,l,i,c){return tl(t),t.updateQueue=null,n=_d(t,l,n,i),Sd(e),l=Tc(),e!==null&&!_t?(Ac(e,t,c),ea(e,t,c)):(He&&l&&cc(t),t.flags|=1,Dt(e,t,n,c),t.child)}function Sf(e,t,n,l,i){if(tl(t),t.stateNode===null){var c=Tl,m=n.contextType;typeof m=="object"&&m!==null&&(c=Ot(m)),c=new n(l,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Yc,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=l,c.state=t.memoizedState,c.refs={},bc(t),m=n.contextType,c.context=typeof m=="object"&&m!==null?Ot(m):Tl,c.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(Ic(t,n,m,l),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(m=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),m!==c.state&&Yc.enqueueReplaceState(c,c.state,null),As(t,l,c,i),Ts(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){c=t.stateNode;var v=t.memoizedProps,N=rl(n,v);c.props=N;var z=c.context,X=n.contextType;m=Tl,typeof X=="object"&&X!==null&&(m=Ot(X));var J=n.getDerivedStateFromProps;X=typeof J=="function"||typeof c.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,X||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(v||z!==m)&&of(t,c,l,m),Na=!1;var L=t.memoizedState;c.state=L,As(t,l,c,i),Ts(),z=t.memoizedState,v||L!==z||Na?(typeof J=="function"&&(Ic(t,n,J,l),z=t.memoizedState),(N=Na||cf(t,n,N,l,L,z,m))?(X||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=z),c.props=l,c.state=z,c.context=m,l=N):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{c=t.stateNode,yc(e,t),m=t.memoizedProps,X=rl(n,m),c.props=X,J=t.pendingProps,L=c.context,z=n.contextType,N=Tl,typeof z=="object"&&z!==null&&(N=Ot(z)),v=n.getDerivedStateFromProps,(z=typeof v=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(m!==J||L!==N)&&of(t,c,l,N),Na=!1,L=t.memoizedState,c.state=L,As(t,l,c,i),Ts();var $=t.memoizedState;m!==J||L!==$||Na||e!==null&&e.dependencies!==null&&Ai(e.dependencies)?(typeof v=="function"&&(Ic(t,n,v,l),$=t.memoizedState),(X=Na||cf(t,n,X,l,L,$,N)||e!==null&&e.dependencies!==null&&Ai(e.dependencies))?(z||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,$,N),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,$,N)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||m===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=$),c.props=l,c.state=$,c.context=N,l=X):(typeof c.componentDidUpdate!="function"||m===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),l=!1)}return c=l,Zi(e,t),l=(t.flags&128)!==0,c||l?(c=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&l?(t.child=sl(t,e.child,null,i),t.child=sl(t,null,n,i)):Dt(e,t,n,i),t.memoizedState=c.state,e=t.child):e=ea(e,t,i),e}function _f(e,t,n,l){return Pa(),t.flags|=256,Dt(e,t,n,l),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:fd()}}function Fc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=dn),e}function kf(e,t,n){var l=t.pendingProps,i=!1,c=(t.flags&128)!==0,m;if((m=c)||(m=e!==null&&e.memoizedState===null?!1:(gt.current&2)!==0),m&&(i=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(i?_a(t):ka(),(e=lt)?(e=Om(e,jn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ga!==null?{id:zn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},n=ad(e),n.return=t,t.child=n,Rt=t,lt=null)):e=null,e===null)throw ba(t);return Oo(e)?t.lanes=32:t.lanes=536870912,null}var v=l.children;return l=l.fallback,i?(ka(),i=t.mode,v=Qi({mode:"hidden",children:v},i),l=Wa(l,i,n,null),v.return=t,l.return=t,v.sibling=l,t.child=v,l=t.child,l.memoizedState=Qc(n),l.childLanes=Fc(e,m,n),t.memoizedState=Zc,Ds(null,l)):(_a(t),Jc(t,v))}var N=e.memoizedState;if(N!==null&&(v=N.dehydrated,v!==null)){if(c)t.flags&256?(_a(t),t.flags&=-257,t=Wc(e,t,n)):t.memoizedState!==null?(ka(),t.child=e.child,t.flags|=128,t=null):(ka(),v=l.fallback,i=t.mode,l=Qi({mode:"visible",children:l.children},i),v=Wa(v,i,n,null),v.flags|=2,l.return=t,v.return=t,l.sibling=v,t.child=l,sl(t,e.child,null,n),l=t.child,l.memoizedState=Qc(n),l.childLanes=Fc(e,m,n),t.memoizedState=Zc,t=Ds(null,l));else if(_a(t),Oo(v)){if(m=v.nextSibling&&v.nextSibling.dataset,m)var z=m.dgst;m=z,l=Error(o(419)),l.stack="",l.digest=m,js({value:l,source:null,stack:null}),t=Wc(e,t,n)}else if(_t||Rl(e,t,n,!1),m=(n&e.childLanes)!==0,_t||m){if(m=et,m!==null&&(l=ht(m,n),l!==0&&l!==N.retryLane))throw N.retryLane=l,Ja(e,l),nn(m,e,l),Vc;Ro(v)||lr(),t=Wc(e,t,n)}else Ro(v)?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,lt=_n(v.nextSibling),Rt=t,He=!0,va=null,jn=!1,e!==null&&id(t,e),t=Jc(t,l.children),t.flags|=4096);return t}return i?(ka(),v=l.fallback,i=t.mode,N=e.child,z=N.sibling,l=Zn(N,{mode:"hidden",children:l.children}),l.subtreeFlags=N.subtreeFlags&65011712,z!==null?v=Zn(z,v):(v=Wa(v,i,n,null),v.flags|=2),v.return=t,l.return=t,l.sibling=v,t.child=l,Ds(null,l),l=t.child,v=e.child.memoizedState,v===null?v=Qc(n):(i=v.cachePool,i!==null?(N=jt._currentValue,i=i.parent!==N?{parent:N,pool:N}:i):i=fd(),v={baseLanes:v.baseLanes|n,cachePool:i}),l.memoizedState=v,l.childLanes=Fc(e,m,n),t.memoizedState=Zc,Ds(e.child,l)):(_a(t),n=e.child,e=n.sibling,n=Zn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function Jc(e,t){return t=Qi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Qi(e,t){return e=rn(22,e,null,t),e.lanes=0,e}function Wc(e,t,n){return sl(t,e.child,null,n),e=Jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ef(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),mc(e.return,t,n)}function Pc(e,t,n,l,i,c){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:c}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=n,m.tailMode=i,m.treeForkCount=c)}function wf(e,t,n){var l=t.pendingProps,i=l.revealOrder,c=l.tail;l=l.children;var m=gt.current,v=(m&2)!==0;if(v?(m=m&1|2,t.flags|=128):m&=1,le(gt,m),Dt(e,t,l,n),l=He?Ns:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ef(e,n,t);else if(e.tag===19)Ef(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ui(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Pc(t,!1,i,n,c,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ui(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Pc(t,!0,n,null,c,l);break;case"together":Pc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ea(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ta|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Rl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=Zn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Zn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function eo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ai(e)))}function kx(e,t,n){switch(t.tag){case 3:Ie(t,t.stateNode.containerInfo),ya(t,jt,e.memoizedState.cache),Pa();break;case 27:case 5:it(t);break;case 4:Ie(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,kc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(_a(t),t.flags|=128,null):(n&t.child.childLanes)!==0?kf(e,t,n):(_a(t),e=ea(e,t,n),e!==null?e.sibling:null);_a(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Rl(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return wf(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),le(gt,gt.current),l)break;return null;case 22:return t.lanes=0,bf(e,t,n,t.pendingProps);case 24:ya(t,jt,e.memoizedState.cache)}return ea(e,t,n)}function Tf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!eo(e,n)&&(t.flags&128)===0)return _t=!1,kx(e,t,n);_t=(e.flags&131072)!==0}else _t=!1,He&&(t.flags&1048576)!==0&&sd(t,Ns,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=al(t.elementType),t.type=e,typeof e=="function")sc(e)?(l=rl(e,l),t.tag=1,t=Sf(null,t,e,l,n)):(t.tag=0,t=Kc(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===V){t.tag=11,t=xf(null,t,e,l,n);break e}else if(i===C){t.tag=14,t=gf(null,t,e,l,n);break e}}throw t=ye(e)||e,Error(o(306,t,""))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=rl(l,t.pendingProps),Sf(e,t,l,i,n);case 3:e:{if(Ie(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var c=t.memoizedState;i=c.element,yc(e,t),As(t,l,null,n);var m=t.memoizedState;if(l=m.cache,ya(t,jt,l),l!==c.cache&&hc(t,[jt],n,!0),Ts(),l=m.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=_f(e,t,l,n);break e}else if(l!==i){i=bn(Error(o(424)),t),js(i),t=_f(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(lt=_n(e.firstChild),Rt=t,He=!0,va=null,jn=!0,n=vd(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pa(),l===i){t=ea(e,t,n);break e}Dt(e,t,l,n)}t=t.child}return t;case 26:return Zi(e,t),e===null?(n=Hm(t.type,null,t.pendingProps,null))?t.memoizedState=n:He||(n=t.type,e=t.pendingProps,l=dr(de.current).createElement(n),l[pt]=t,l[Bt]=e,zt(l,n,e),yt(l),t.stateNode=l):t.memoizedState=Hm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return it(t),e===null&&He&&(l=t.stateNode=Lm(t.type,t.pendingProps,de.current),Rt=t,jn=!0,i=lt,Oa(t.type)?(Do=i,lt=_n(l.firstChild)):lt=i),Dt(e,t,t.pendingProps.children,n),Zi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((i=l=lt)&&(l=tg(l,t.type,t.pendingProps,jn),l!==null?(t.stateNode=l,Rt=t,lt=_n(l.firstChild),jn=!1,i=!0):i=!1),i||ba(t)),it(t),i=t.type,c=t.pendingProps,m=e!==null?e.memoizedProps:null,l=c.children,Ao(i,c)?l=null:m!==null&&Ao(i,m)&&(t.flags|=32),t.memoizedState!==null&&(i=wc(e,t,xx,null,null,n),Qs._currentValue=i),Zi(e,t),Dt(e,t,l,n),t.child;case 6:return e===null&&He&&((e=n=lt)&&(n=ng(n,t.pendingProps,jn),n!==null?(t.stateNode=n,Rt=t,lt=null,e=!0):e=!1),e||ba(t)),null;case 13:return kf(e,t,n);case 4:return Ie(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=sl(t,null,l,n):Dt(e,t,l,n),t.child;case 11:return xf(e,t,t.type,t.pendingProps,n);case 7:return Dt(e,t,t.pendingProps,n),t.child;case 8:return Dt(e,t,t.pendingProps.children,n),t.child;case 12:return Dt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,ya(t,t.type,l.value),Dt(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,tl(t),i=Ot(i),l=l(i),t.flags|=1,Dt(e,t,l,n),t.child;case 14:return gf(e,t,t.type,t.pendingProps,n);case 15:return vf(e,t,t.type,t.pendingProps,n);case 19:return wf(e,t,n);case 31:return _x(e,t,n);case 22:return bf(e,t,n,t.pendingProps);case 24:return tl(t),l=Ot(jt),e===null?(i=gc(),i===null&&(i=et,c=pc(),i.pooledCache=c,c.refCount++,c!==null&&(i.pooledCacheLanes|=n),i=c),t.memoizedState={parent:l,cache:i},bc(t),ya(t,jt,i)):((e.lanes&n)!==0&&(yc(e,t),As(t,null,null,n),Ts()),i=e.memoizedState,c=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ya(t,jt,l)):(l=c.cache,ya(t,jt,l),l!==i.cache&&hc(t,[jt],n,!0))),Dt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ta(e){e.flags|=4}function to(e,t,n,l,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(tm())e.flags|=8192;else throw ll=Oi,vc}else e.flags&=-16777217}function Af(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t))if(tm())e.flags|=8192;else throw ll=Oi,vc}function Fi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ee():536870912,e.lanes|=t,Yl|=t)}function zs(e,t){if(!He)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function st(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags&65011712,l|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Ex(e,t,n){var l=t.pendingProps;switch(oc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return st(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Jn(jt),Re(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Cl(t)?ta(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,dc())),st(t),null;case 26:var i=t.type,c=t.memoizedState;return e===null?(ta(t),c!==null?(st(t),Af(t,c)):(st(t),to(t,i,null,l,n))):c?c!==e.memoizedState?(ta(t),st(t),Af(t,c)):(st(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&ta(t),st(t),to(t,i,e,l,n)),null;case 27:if(Vt(t),n=de.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ta(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return st(t),null}e=W.current,Cl(t)?rd(t):(e=Lm(i,l,n),t.stateNode=e,ta(t))}return st(t),null;case 5:if(Vt(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ta(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return st(t),null}if(c=W.current,Cl(t))rd(t);else{var m=dr(de.current);switch(c){case 1:c=m.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:c=m.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":c=m.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":c=m.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":c=m.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?m.createElement("select",{is:l.is}):m.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?m.createElement(i,{is:l.is}):m.createElement(i)}}c[pt]=t,c[Bt]=l;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)c.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=c;e:switch(zt(c,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ta(t)}}return st(t),to(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&ta(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=de.current,Cl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=Rt,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||km(e.nodeValue,n)),e||ba(t,!0)}else e=dr(e).createTextNode(l),e[pt]=t,t.stateNode=e}return st(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Cl(t),n!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[pt]=t}else Pa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),e=!1}else n=dc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(on(t),t):(on(t),null);if((t.flags&128)!==0)throw Error(o(558))}return st(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Cl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(o(317));i[pt]=t}else Pa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),i=!1}else i=dc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(on(t),t):(on(t),null)}return on(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),c=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(c=l.memoizedState.cachePool.pool),c!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fi(t,t.updateQueue),st(t),null);case 4:return Re(),e===null&&_o(t.stateNode.containerInfo),st(t),null;case 10:return Jn(t.type),st(t),null;case 19:if(H(gt),l=t.memoizedState,l===null)return st(t),null;if(i=(t.flags&128)!==0,c=l.rendering,c===null)if(i)zs(l,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Ui(e),c!==null){for(t.flags|=128,zs(l,!1),e=c.updateQueue,t.updateQueue=e,Fi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)nd(n,e),n=n.sibling;return le(gt,gt.current&1|2),He&&Qn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&nt()>tr&&(t.flags|=128,i=!0,zs(l,!1),t.lanes=4194304)}else{if(!i)if(e=Ui(c),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Fi(t,e),zs(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!He)return st(t),null}else 2*nt()-l.renderingStartTime>tr&&n!==536870912&&(t.flags|=128,i=!0,zs(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(e=l.last,e!==null?e.sibling=c:t.child=c,l.last=c)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=nt(),e.sibling=null,n=gt.current,le(gt,i?n&1|2:n&1),He&&Qn(t,l.treeForkCount),e):(st(t),null);case 22:case 23:return on(t),_c(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),n=t.updateQueue,n!==null&&Fi(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&H(nl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Jn(jt),st(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function wx(e,t){switch(oc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jn(jt),Re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Vt(t),null;case 31:if(t.memoizedState!==null){if(on(t),t.alternate===null)throw Error(o(340));Pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(on(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(gt),null;case 4:return Re(),null;case 10:return Jn(t.type),null;case 22:case 23:return on(t),_c(),e!==null&&H(nl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Jn(jt),null;case 25:return null;default:return null}}function Mf(e,t){switch(oc(t),t.tag){case 3:Jn(jt),Re();break;case 26:case 27:case 5:Vt(t);break;case 4:Re();break;case 31:t.memoizedState!==null&&on(t);break;case 13:on(t);break;case 19:H(gt);break;case 10:Jn(t.type);break;case 22:case 23:on(t),_c(),e!==null&&H(nl);break;case 24:Jn(jt)}}function Ls(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var c=n.create,m=n.inst;l=c(),m.destroy=l}n=n.next}while(n!==i)}}catch(v){Qe(t,t.return,v)}}function Ea(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var c=i.next;l=c;do{if((l.tag&e)===e){var m=l.inst,v=m.destroy;if(v!==void 0){m.destroy=void 0,i=t;var N=n,z=v;try{z()}catch(X){Qe(i,N,X)}}}l=l.next}while(l!==c)}}catch(X){Qe(t,t.return,X)}}function Cf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{yd(t,n)}catch(l){Qe(e,e.return,l)}}}function Rf(e,t,n){n.props=rl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Qe(e,t,l)}}function Us(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(i){Qe(e,t,i)}}function Un(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){Qe(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Qe(e,t,i)}else n.current=null}function Of(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(i){Qe(e,e.return,i)}}function no(e,t,n){try{var l=e.stateNode;Qx(l,e.type,n,t),l[Bt]=t}catch(i){Qe(e,e.return,i)}}function Df(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Oa(e.type)||e.tag===4}function ao(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Df(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Oa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function lo(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=re));else if(l!==4&&(l===27&&Oa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(lo(e,t,n),e=e.sibling;e!==null;)lo(e,t,n),e=e.sibling}function Ji(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&Oa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ji(e,t,n),e=e.sibling;e!==null;)Ji(e,t,n),e=e.sibling}function zf(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zt(t,l,n),t[pt]=e,t[Bt]=n}catch(c){Qe(e,e.return,c)}}var na=!1,kt=!1,so=!1,Lf=typeof WeakSet=="function"?WeakSet:Set,At=null;function Tx(e,t){if(e=e.containerInfo,wo=vr,e=Ku(e),Wr(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var i=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var m=0,v=-1,N=-1,z=0,X=0,J=e,L=null;t:for(;;){for(var $;J!==n||i!==0&&J.nodeType!==3||(v=m+i),J!==c||l!==0&&J.nodeType!==3||(N=m+l),J.nodeType===3&&(m+=J.nodeValue.length),($=J.firstChild)!==null;)L=J,J=$;for(;;){if(J===e)break t;if(L===n&&++z===i&&(v=m),L===c&&++X===l&&(N=m),($=J.nextSibling)!==null)break;J=L,L=J.parentNode}J=$}n=v===-1||N===-1?null:{start:v,end:N}}else n=null}n=n||{start:0,end:0}}else n=null;for(To={focusedElem:e,selectionRange:n},vr=!1,At=t;At!==null;)if(t=At,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,At=e;else for(;At!==null;){switch(t=At,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,n=t,i=c.memoizedProps,c=c.memoizedState,l=n.stateNode;try{var pe=rl(n.type,i);e=l.getSnapshotBeforeUpdate(pe,c),l.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Qe(n,n.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Co(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Co(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,At=e;break}At=t.return}}function Uf(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:la(e,n),l&4&&Ls(5,n);break;case 1:if(la(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){Qe(n,n.return,m)}else{var i=rl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){Qe(n,n.return,m)}}l&64&&Cf(n),l&512&&Us(n,n.return);break;case 3:if(la(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{yd(e,t)}catch(m){Qe(n,n.return,m)}}break;case 27:t===null&&l&4&&zf(n);case 26:case 5:la(e,n),t===null&&l&4&&Of(n),l&512&&Us(n,n.return);break;case 12:la(e,n);break;case 31:la(e,n),l&4&&$f(e,n);break;case 13:la(e,n),l&4&&qf(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ux.bind(null,n),ag(e,n))));break;case 22:if(l=n.memoizedState!==null||na,!l){t=t!==null&&t.memoizedState!==null||kt,i=na;var c=kt;na=l,(kt=t)&&!c?sa(e,n,(n.subtreeFlags&8772)!==0):la(e,n),na=i,kt=c}break;case 30:break;default:la(e,n)}}function Bf(e){var t=e.alternate;t!==null&&(e.alternate=null,Bf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&rs(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ct=null,Wt=!1;function aa(e,t,n){for(n=n.child;n!==null;)Hf(e,t,n),n=n.sibling}function Hf(e,t,n){if(Ut&&typeof Ut.onCommitFiberUnmount=="function")try{Ut.onCommitFiberUnmount(Ga,n)}catch{}switch(n.tag){case 26:kt||Un(n,t),aa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:kt||Un(n,t);var l=ct,i=Wt;Oa(n.type)&&(ct=n.stateNode,Wt=!1),aa(e,t,n),Vs(n.stateNode),ct=l,Wt=i;break;case 5:kt||Un(n,t);case 6:if(l=ct,i=Wt,ct=null,aa(e,t,n),ct=l,Wt=i,ct!==null)if(Wt)try{(ct.nodeType===9?ct.body:ct.nodeName==="HTML"?ct.ownerDocument.body:ct).removeChild(n.stateNode)}catch(c){Qe(n,t,c)}else try{ct.removeChild(n.stateNode)}catch(c){Qe(n,t,c)}break;case 18:ct!==null&&(Wt?(e=ct,Cm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Wl(e)):Cm(ct,n.stateNode));break;case 4:l=ct,i=Wt,ct=n.stateNode.containerInfo,Wt=!0,aa(e,t,n),ct=l,Wt=i;break;case 0:case 11:case 14:case 15:Ea(2,n,t),kt||Ea(4,n,t),aa(e,t,n);break;case 1:kt||(Un(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Rf(n,t,l)),aa(e,t,n);break;case 21:aa(e,t,n);break;case 22:kt=(l=kt)||n.memoizedState!==null,aa(e,t,n),kt=l;break;default:aa(e,t,n)}}function $f(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wl(e)}catch(n){Qe(t,t.return,n)}}}function qf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wl(e)}catch(n){Qe(t,t.return,n)}}function Ax(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Lf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Lf),t;default:throw Error(o(435,e.tag))}}function Wi(e,t){var n=Ax(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=Bx.bind(null,e,l);l.then(i,i)}})}function Pt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],c=e,m=t,v=m;e:for(;v!==null;){switch(v.tag){case 27:if(Oa(v.type)){ct=v.stateNode,Wt=!1;break e}break;case 5:ct=v.stateNode,Wt=!1;break e;case 3:case 4:ct=v.stateNode.containerInfo,Wt=!0;break e}v=v.return}if(ct===null)throw Error(o(160));Hf(c,m,i),ct=null,Wt=!1,c=i.alternate,c!==null&&(c.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Gf(t,e),t=t.sibling}var An=null;function Gf(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Pt(t,e),en(e),l&4&&(Ea(3,e,e.return),Ls(3,e),Ea(5,e,e.return));break;case 1:Pt(t,e),en(e),l&512&&(kt||n===null||Un(n,n.return)),l&64&&na&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var i=An;if(Pt(t,e),en(e),l&512&&(kt||n===null||Un(n,n.return)),l&4){var c=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(l){case"title":c=i.getElementsByTagName("title")[0],(!c||c[Xa]||c[pt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=i.createElement(l),i.head.insertBefore(c,i.querySelector("head > title"))),zt(c,l,n),c[pt]=e,yt(c),l=c;break e;case"link":var m=Gm("link","href",i).get(l+(n.href||""));if(m){for(var v=0;v<m.length;v++)if(c=m[v],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){m.splice(v,1);break t}}c=i.createElement(l),zt(c,l,n),i.head.appendChild(c);break;case"meta":if(m=Gm("meta","content",i).get(l+(n.content||""))){for(v=0;v<m.length;v++)if(c=m[v],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){m.splice(v,1);break t}}c=i.createElement(l),zt(c,l,n),i.head.appendChild(c);break;default:throw Error(o(468,l))}c[pt]=e,yt(c),l=c}e.stateNode=l}else Im(i,e.type,e.stateNode);else e.stateNode=qm(i,l,e.memoizedProps);else c!==l?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,l===null?Im(i,e.type,e.stateNode):qm(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&no(e,e.memoizedProps,n.memoizedProps)}break;case 27:Pt(t,e),en(e),l&512&&(kt||n===null||Un(n,n.return)),n!==null&&l&4&&no(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Pt(t,e),en(e),l&512&&(kt||n===null||Un(n,n.return)),e.flags&32){i=e.stateNode;try{_e(i,"")}catch(pe){Qe(e,e.return,pe)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,no(e,i,n!==null?n.memoizedProps:i)),l&1024&&(so=!0);break;case 6:if(Pt(t,e),en(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(pe){Qe(e,e.return,pe)}}break;case 3:if(hr=null,i=An,An=fr(t.containerInfo),Pt(t,e),An=i,en(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Wl(t.containerInfo)}catch(pe){Qe(e,e.return,pe)}so&&(so=!1,If(e));break;case 4:l=An,An=fr(e.stateNode.containerInfo),Pt(t,e),en(e),An=l;break;case 12:Pt(t,e),en(e);break;case 31:Pt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Wi(e,l)));break;case 13:Pt(t,e),en(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(er=nt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Wi(e,l)));break;case 22:i=e.memoizedState!==null;var N=n!==null&&n.memoizedState!==null,z=na,X=kt;if(na=z||i,kt=X||N,Pt(t,e),kt=X,na=z,en(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||N||na||kt||cl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){N=n=t;try{if(c=N.stateNode,i)m=c.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none";else{v=N.stateNode;var J=N.memoizedProps.style,L=J!=null&&J.hasOwnProperty("display")?J.display:null;v.style.display=L==null||typeof L=="boolean"?"":(""+L).trim()}}catch(pe){Qe(N,N.return,pe)}}}else if(t.tag===6){if(n===null){N=t;try{N.stateNode.nodeValue=i?"":N.memoizedProps}catch(pe){Qe(N,N.return,pe)}}}else if(t.tag===18){if(n===null){N=t;try{var $=N.stateNode;i?Rm($,!0):Rm(N.stateNode,!1)}catch(pe){Qe(N,N.return,pe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,Wi(e,n))));break;case 19:Pt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Wi(e,l)));break;case 30:break;case 21:break;default:Pt(t,e),en(e)}}function en(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Df(l)){n=l;break}l=l.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var i=n.stateNode,c=ao(e);Ji(e,c,i);break;case 5:var m=n.stateNode;n.flags&32&&(_e(m,""),n.flags&=-33);var v=ao(e);Ji(e,v,m);break;case 3:case 4:var N=n.stateNode.containerInfo,z=ao(e);lo(e,z,N);break;default:throw Error(o(161))}}catch(X){Qe(e,e.return,X)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function If(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;If(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function la(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Uf(e,t.alternate,t),t=t.sibling}function cl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ea(4,t,t.return),cl(t);break;case 1:Un(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Rf(t,t.return,n),cl(t);break;case 27:Vs(t.stateNode);case 26:case 5:Un(t,t.return),cl(t);break;case 22:t.memoizedState===null&&cl(t);break;case 30:cl(t);break;default:cl(t)}e=e.sibling}}function sa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,c=t,m=c.flags;switch(c.tag){case 0:case 11:case 15:sa(i,c,n),Ls(4,c);break;case 1:if(sa(i,c,n),l=c,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(z){Qe(l,l.return,z)}if(l=c,i=l.updateQueue,i!==null){var v=l.stateNode;try{var N=i.shared.hiddenCallbacks;if(N!==null)for(i.shared.hiddenCallbacks=null,i=0;i<N.length;i++)bd(N[i],v)}catch(z){Qe(l,l.return,z)}}n&&m&64&&Cf(c),Us(c,c.return);break;case 27:zf(c);case 26:case 5:sa(i,c,n),n&&l===null&&m&4&&Of(c),Us(c,c.return);break;case 12:sa(i,c,n);break;case 31:sa(i,c,n),n&&m&4&&$f(i,c);break;case 13:sa(i,c,n),n&&m&4&&qf(i,c);break;case 22:c.memoizedState===null&&sa(i,c,n),Us(c,c.return);break;case 30:break;default:sa(i,c,n)}t=t.sibling}}function io(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ss(n))}function ro(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ss(e))}function Mn(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Yf(e,t,n,l),t=t.sibling}function Yf(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Mn(e,t,n,l),i&2048&&Ls(9,t);break;case 1:Mn(e,t,n,l);break;case 3:Mn(e,t,n,l),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ss(e)));break;case 12:if(i&2048){Mn(e,t,n,l),e=t.stateNode;try{var c=t.memoizedProps,m=c.id,v=c.onPostCommit;typeof v=="function"&&v(m,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){Qe(t,t.return,N)}}else Mn(e,t,n,l);break;case 31:Mn(e,t,n,l);break;case 13:Mn(e,t,n,l);break;case 23:break;case 22:c=t.stateNode,m=t.alternate,t.memoizedState!==null?c._visibility&2?Mn(e,t,n,l):Bs(e,t):c._visibility&2?Mn(e,t,n,l):(c._visibility|=2,ql(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&io(m,t);break;case 24:Mn(e,t,n,l),i&2048&&ro(t.alternate,t);break;default:Mn(e,t,n,l)}}function ql(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,m=t,v=n,N=l,z=m.flags;switch(m.tag){case 0:case 11:case 15:ql(c,m,v,N,i),Ls(8,m);break;case 23:break;case 22:var X=m.stateNode;m.memoizedState!==null?X._visibility&2?ql(c,m,v,N,i):Bs(c,m):(X._visibility|=2,ql(c,m,v,N,i)),i&&z&2048&&io(m.alternate,m);break;case 24:ql(c,m,v,N,i),i&&z&2048&&ro(m.alternate,m);break;default:ql(c,m,v,N,i)}t=t.sibling}}function Bs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,i=l.flags;switch(l.tag){case 22:Bs(n,l),i&2048&&io(l.alternate,l);break;case 24:Bs(n,l),i&2048&&ro(l.alternate,l);break;default:Bs(n,l)}t=t.sibling}}var Hs=8192;function Gl(e,t,n){if(e.subtreeFlags&Hs)for(e=e.child;e!==null;)Xf(e,t,n),e=e.sibling}function Xf(e,t,n){switch(e.tag){case 26:Gl(e,t,n),e.flags&Hs&&e.memoizedState!==null&&pg(n,An,e.memoizedState,e.memoizedProps);break;case 5:Gl(e,t,n);break;case 3:case 4:var l=An;An=fr(e.stateNode.containerInfo),Gl(e,t,n),An=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Hs,Hs=16777216,Gl(e,t,n),Hs=l):Gl(e,t,n));break;default:Gl(e,t,n)}}function Vf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function $s(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];At=l,Zf(l,e)}Vf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Kf(e),e=e.sibling}function Kf(e){switch(e.tag){case 0:case 11:case 15:$s(e),e.flags&2048&&Ea(9,e,e.return);break;case 3:$s(e);break;case 12:$s(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pi(e)):$s(e);break;default:$s(e)}}function Pi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];At=l,Zf(l,e)}Vf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ea(8,t,t.return),Pi(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pi(t));break;default:Pi(t)}e=e.sibling}}function Zf(e,t){for(;At!==null;){var n=At;switch(n.tag){case 0:case 11:case 15:Ea(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ss(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,At=l;else e:for(n=e;At!==null;){l=At;var i=l.sibling,c=l.return;if(Bf(l),l===n){At=null;break e}if(i!==null){i.return=c,At=i;break e}At=c}}}var Mx={getCacheForType:function(e){var t=Ot(jt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ot(jt).controller.signal}},Cx=typeof WeakMap=="function"?WeakMap:Map,Xe=0,et=null,De=null,Ue=0,Ze=0,un=null,wa=!1,Il=!1,co=!1,ia=0,ft=0,Ta=0,ol=0,oo=0,dn=0,Yl=0,qs=null,tn=null,uo=!1,er=0,Qf=0,tr=1/0,nr=null,Aa=null,Et=0,Ma=null,Xl=null,ra=0,fo=0,mo=null,Ff=null,Gs=0,ho=null;function fn(){return(Xe&2)!==0&&Ue!==0?Ue&-Ue:M.T!==null?yo():gl()}function Jf(){if(dn===0)if((Ue&536870912)===0||He){var e=xl;xl<<=1,(xl&3932160)===0&&(xl=262144),dn=e}else dn=536870912;return e=cn.current,e!==null&&(e.flags|=32),dn}function nn(e,t,n){(e===et&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)&&(Vl(e,0),Ca(e,Ue,dn,!1)),Pe(e,n),((Xe&2)===0||e!==et)&&(e===et&&((Xe&2)===0&&(ol|=n),ft===4&&Ca(e,Ue,dn,!1)),Bn(e))}function Wf(e,t,n){if((Xe&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Z(e,t),i=l?Dx(e,t):xo(e,t,!0),c=l;do{if(i===0){Il&&!l&&Ca(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!Rx(n)){i=xo(e,t,!1),c=!1;continue}if(i===2){if(c=t,e.errorRecoveryDisabledLanes&c)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var v=e;i=qs;var N=v.current.memoizedState.isDehydrated;if(N&&(Vl(v,m).flags|=256),m=xo(v,m,!1),m!==2){if(co&&!N){v.errorRecoveryDisabledLanes|=c,ol|=c,i=4;break e}c=tn,tn=i,c!==null&&(tn===null?tn=c:tn.push.apply(tn,c))}i=m}if(c=!1,i!==2)continue}}if(i===1){Vl(e,0),Ca(e,t,0,!0);break}e:{switch(l=e,c=i,c){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Ca(l,t,dn,!wa);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=er+300-nt(),10<i)){if(Ca(l,t,dn,!wa),k(l,0,!0)!==0)break e;ra=t,l.timeoutHandle=Am(Pf.bind(null,l,n,tn,nr,uo,t,dn,ol,Yl,wa,c,"Throttled",-0,0),i);break e}Pf(l,n,tn,nr,uo,t,dn,ol,Yl,wa,c,null,-0,0)}}break}while(!0);Bn(e)}function Pf(e,t,n,l,i,c,m,v,N,z,X,J,L,$){if(e.timeoutHandle=-1,J=t.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:re},Xf(t,c,J);var pe=(c&62914560)===c?er-nt():(c&4194048)===c?Qf-nt():0;if(pe=xg(J,pe),pe!==null){ra=c,e.cancelPendingCommit=pe(rm.bind(null,e,t,c,n,l,i,m,v,N,X,J,null,L,$)),Ca(e,c,m,!z);return}}rm(e,t,c,n,l,i,m,v,N)}function Rx(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var i=n[l],c=i.getSnapshot;i=i.value;try{if(!sn(c(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ca(e,t,n,l){t&=~oo,t&=~ol,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var c=31-Gt(i),m=1<<c;l[c]=-1,i&=~m}n!==0&&fe(e,n,t)}function ar(){return(Xe&6)===0?(Is(0),!1):!0}function po(){if(De!==null){if(Ze===0)var e=De.return;else e=De,Fn=el=null,Mc(e),Ll=null,ks=0,e=De;for(;e!==null;)Mf(e.alternate,e),e=e.return;De=null}}function Vl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Wx(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ra=0,po(),et=e,De=n=Zn(e.current,null),Ue=t,Ze=0,un=null,wa=!1,Il=Z(e,t),co=!1,Yl=dn=oo=ol=Ta=ft=0,tn=qs=null,uo=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var i=31-Gt(l),c=1<<i;t|=e[i],l&=~c}return ia=t,_i(),n}function em(e,t){Me=null,M.H=Os,t===zl||t===Ri?(t=pd(),Ze=3):t===vc?(t=pd(),Ze=4):Ze=t===Vc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,un=t,De===null&&(ft=1,Vi(e,bn(t,e.current)))}function tm(){var e=cn.current;return e===null?!0:(Ue&4194048)===Ue?Sn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?e===Sn:!1}function nm(){var e=M.H;return M.H=Os,e===null?Os:e}function am(){var e=M.A;return M.A=Mx,e}function lr(){ft=4,wa||(Ue&4194048)!==Ue&&cn.current!==null||(Il=!0),(Ta&134217727)===0&&(ol&134217727)===0||et===null||Ca(et,Ue,dn,!1)}function xo(e,t,n){var l=Xe;Xe|=2;var i=nm(),c=am();(et!==e||Ue!==t)&&(nr=null,Vl(e,t)),t=!1;var m=ft;e:do try{if(Ze!==0&&De!==null){var v=De,N=un;switch(Ze){case 8:po(),m=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(t=!0);var z=Ze;if(Ze=0,un=null,Kl(e,v,N,z),n&&Il){m=0;break e}break;default:z=Ze,Ze=0,un=null,Kl(e,v,N,z)}}Ox(),m=ft;break}catch(X){em(e,X)}while(!0);return t&&e.shellSuspendCounter++,Fn=el=null,Xe=l,M.H=i,M.A=c,De===null&&(et=null,Ue=0,_i()),m}function Ox(){for(;De!==null;)lm(De)}function Dx(e,t){var n=Xe;Xe|=2;var l=nm(),i=am();et!==e||Ue!==t?(nr=null,tr=nt()+500,Vl(e,t)):Il=Z(e,t);e:do try{if(Ze!==0&&De!==null){t=De;var c=un;t:switch(Ze){case 1:Ze=0,un=null,Kl(e,t,c,1);break;case 2:case 9:if(md(c)){Ze=0,un=null,sm(t);break}t=function(){Ze!==2&&Ze!==9||et!==e||(Ze=7),Bn(e)},c.then(t,t);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:md(c)?(Ze=0,un=null,sm(t)):(Ze=0,un=null,Kl(e,t,c,7));break;case 5:var m=null;switch(De.tag){case 26:m=De.memoizedState;case 5:case 27:var v=De;if(m?Ym(m):v.stateNode.complete){Ze=0,un=null;var N=v.sibling;if(N!==null)De=N;else{var z=v.return;z!==null?(De=z,sr(z)):De=null}break t}}Ze=0,un=null,Kl(e,t,c,5);break;case 6:Ze=0,un=null,Kl(e,t,c,6);break;case 8:po(),ft=6;break e;default:throw Error(o(462))}}zx();break}catch(X){em(e,X)}while(!0);return Fn=el=null,M.H=l,M.A=i,Xe=n,De!==null?0:(et=null,Ue=0,_i(),ft)}function zx(){for(;De!==null&&!mt();)lm(De)}function lm(e){var t=Tf(e.alternate,e,ia);e.memoizedProps=e.pendingProps,t===null?sr(e):De=t}function sm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=jf(n,t,t.pendingProps,t.type,void 0,Ue);break;case 11:t=jf(n,t,t.pendingProps,t.type.render,t.ref,Ue);break;case 5:Mc(t);default:Mf(n,t),t=De=nd(t,ia),t=Tf(n,t,ia)}e.memoizedProps=e.pendingProps,t===null?sr(e):De=t}function Kl(e,t,n,l){Fn=el=null,Mc(t),Ll=null,ks=0;var i=t.return;try{if(Sx(e,i,t,n,Ue)){ft=1,Vi(e,bn(n,e.current)),De=null;return}}catch(c){if(i!==null)throw De=i,c;ft=1,Vi(e,bn(n,e.current)),De=null;return}t.flags&32768?(He||l===1?e=!0:Il||(Ue&536870912)!==0?e=!1:(wa=e=!0,(l===2||l===9||l===3||l===6)&&(l=cn.current,l!==null&&l.tag===13&&(l.flags|=16384))),im(t,e)):sr(t)}function sr(e){var t=e;do{if((t.flags&32768)!==0){im(t,wa);return}e=t.return;var n=Ex(t.alternate,t,ia);if(n!==null){De=n;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);ft===0&&(ft=5)}function im(e,t){do{var n=wx(e.alternate,e);if(n!==null){n.flags&=32767,De=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){De=e;return}De=e=n}while(e!==null);ft=6,De=null}function rm(e,t,n,l,i,c,m,v,N){e.cancelPendingCommit=null;do ir();while(Et!==0);if((Xe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(c=t.lanes|t.childLanes,c|=ac,ge(e,n,c,m,v,N),e===et&&(De=et=null,Ue=0),Xl=t,Ma=e,ra=n,fo=c,mo=i,Ff=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Hx(qa,function(){return fm(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=M.T,M.T=null,i=I.p,I.p=2,m=Xe,Xe|=4;try{Tx(e,t,n)}finally{Xe=m,I.p=i,M.T=l}}Et=1,cm(),om(),um()}}function cm(){if(Et===1){Et=0;var e=Ma,t=Xl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=M.T,M.T=null;var l=I.p;I.p=2;var i=Xe;Xe|=4;try{Gf(t,e);var c=To,m=Ku(e.containerInfo),v=c.focusedElem,N=c.selectionRange;if(m!==v&&v&&v.ownerDocument&&Vu(v.ownerDocument.documentElement,v)){if(N!==null&&Wr(v)){var z=N.start,X=N.end;if(X===void 0&&(X=z),"selectionStart"in v)v.selectionStart=z,v.selectionEnd=Math.min(X,v.value.length);else{var J=v.ownerDocument||document,L=J&&J.defaultView||window;if(L.getSelection){var $=L.getSelection(),pe=v.textContent.length,Se=Math.min(N.start,pe),We=N.end===void 0?Se:Math.min(N.end,pe);!$.extend&&Se>We&&(m=We,We=Se,Se=m);var R=Xu(v,Se),w=Xu(v,We);if(R&&w&&($.rangeCount!==1||$.anchorNode!==R.node||$.anchorOffset!==R.offset||$.focusNode!==w.node||$.focusOffset!==w.offset)){var D=J.createRange();D.setStart(R.node,R.offset),$.removeAllRanges(),Se>We?($.addRange(D),$.extend(w.node,w.offset)):(D.setEnd(w.node,w.offset),$.addRange(D))}}}}for(J=[],$=v;$=$.parentNode;)$.nodeType===1&&J.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<J.length;v++){var Q=J[v];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}vr=!!wo,To=wo=null}finally{Xe=i,I.p=l,M.T=n}}e.current=t,Et=2}}function om(){if(Et===2){Et=0;var e=Ma,t=Xl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=M.T,M.T=null;var l=I.p;I.p=2;var i=Xe;Xe|=4;try{Uf(e,t.alternate,t)}finally{Xe=i,I.p=l,M.T=n}}Et=3}}function um(){if(Et===4||Et===3){Et=0,Kt();var e=Ma,t=Xl,n=ra,l=Ff;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Et=5:(Et=0,Xl=Ma=null,dm(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Aa=null),In(n),t=t.stateNode,Ut&&typeof Ut.onCommitFiberRoot=="function")try{Ut.onCommitFiberRoot(Ga,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=M.T,i=I.p,I.p=2,M.T=null;try{for(var c=e.onRecoverableError,m=0;m<l.length;m++){var v=l[m];c(v.value,{componentStack:v.stack})}}finally{M.T=t,I.p=i}}(ra&3)!==0&&ir(),Bn(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===ho?Gs++:(Gs=0,ho=e):Gs=0,Is(0)}}function dm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ss(t)))}function ir(){return cm(),om(),um(),fm()}function fm(){if(Et!==5)return!1;var e=Ma,t=fo;fo=0;var n=In(ra),l=M.T,i=I.p;try{I.p=32>n?32:n,M.T=null,n=mo,mo=null;var c=Ma,m=ra;if(Et=0,Xl=Ma=null,ra=0,(Xe&6)!==0)throw Error(o(331));var v=Xe;if(Xe|=4,Kf(c.current),Yf(c,c.current,m,n),Xe=v,Is(0,!1),Ut&&typeof Ut.onPostCommitFiberRoot=="function")try{Ut.onPostCommitFiberRoot(Ga,c)}catch{}return!0}finally{I.p=i,M.T=l,dm(e,t)}}function mm(e,t,n){t=bn(n,t),t=Xc(e.stateNode,t,2),e=Sa(e,t,2),e!==null&&(Pe(e,2),Bn(e))}function Qe(e,t,n){if(e.tag===3)mm(e,e,n);else for(;t!==null;){if(t.tag===3){mm(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Aa===null||!Aa.has(l))){e=bn(n,e),n=hf(2),l=Sa(t,n,2),l!==null&&(pf(n,l,t,e),Pe(l,2),Bn(l));break}}t=t.return}}function go(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Cx;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(co=!0,i.add(n),e=Lx.bind(null,e,t,n),t.then(e,e))}function Lx(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,et===e&&(Ue&n)===n&&(ft===4||ft===3&&(Ue&62914560)===Ue&&300>nt()-er?(Xe&2)===0&&Vl(e,0):oo|=n,Yl===Ue&&(Yl=0)),Bn(e)}function hm(e,t){t===0&&(t=Ee()),e=Ja(e,t),e!==null&&(Pe(e,t),Bn(e))}function Ux(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hm(e,n)}function Bx(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),hm(e,n)}function Hx(e,t){return we(e,t)}var rr=null,Zl=null,vo=!1,cr=!1,bo=!1,Ra=0;function Bn(e){e!==Zl&&e.next===null&&(Zl===null?rr=Zl=e:Zl=Zl.next=e),cr=!0,vo||(vo=!0,qx())}function Is(e,t){if(!bo&&cr){bo=!0;do for(var n=!1,l=rr;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var c=0;else{var m=l.suspendedLanes,v=l.pingedLanes;c=(1<<31-Gt(42|e)+1)-1,c&=i&~(m&~v),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,vm(l,c))}else c=Ue,c=k(l,l===et?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||Z(l,c)||(n=!0,vm(l,c));l=l.next}while(n);bo=!1}}function $x(){pm()}function pm(){cr=vo=!1;var e=0;Ra!==0&&Jx()&&(e=Ra);for(var t=nt(),n=null,l=rr;l!==null;){var i=l.next,c=xm(l,t);c===0?(l.next=null,n===null?rr=i:n.next=i,i===null&&(Zl=n)):(n=l,(e!==0||(c&3)!==0)&&(cr=!0)),l=i}Et!==0&&Et!==5||Is(e),Ra!==0&&(Ra=0)}function xm(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var m=31-Gt(c),v=1<<m,N=i[m];N===-1?((v&n)===0||(v&l)!==0)&&(i[m]=ce(v,t)):N<=t&&(e.expiredLanes|=v),c&=~v}if(t=et,n=Ue,n=k(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&$e(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Z(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&$e(l),In(n)){case 2:case 8:n=xn;break;case 32:n=qa;break;case 268435456:n=ci;break;default:n=qa}return l=gm.bind(null,e),n=we(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&$e(l),e.callbackPriority=2,e.callbackNode=null,2}function gm(e,t){if(Et!==0&&Et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ir()&&e.callbackNode!==n)return null;var l=Ue;return l=k(e,e===et?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Wf(e,l,t),xm(e,nt()),e.callbackNode!=null&&e.callbackNode===n?gm.bind(null,e):null)}function vm(e,t){if(ir())return null;Wf(e,t,!0)}function qx(){Px(function(){(Xe&6)!==0?we(pn,$x):pm()})}function yo(){if(Ra===0){var e=Ol;e===0&&(e=Ia,Ia<<=1,(Ia&261888)===0&&(Ia=256)),Ra=e}return Ra}function bm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:pa(""+e)}function ym(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Gx(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var c=bm((i[Bt]||null).action),m=l.submitter;m&&(t=(t=m[Bt]||null)?bm(t.formAction):m.getAttribute("formAction"),t!==null&&(c=t,m=null));var v=new yi("action","action",null,l,i);e.push({event:v,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ra!==0){var N=m?ym(i,m):new FormData(i);Hc(n,{pending:!0,data:N,method:i.method,action:c},null,N)}}else typeof c=="function"&&(v.preventDefault(),N=m?ym(i,m):new FormData(i),Hc(n,{pending:!0,data:N,method:i.method,action:c},c,N))},currentTarget:i}]})}}for(var No=0;No<nc.length;No++){var jo=nc[No],Ix=jo.toLowerCase(),Yx=jo[0].toUpperCase()+jo.slice(1);Tn(Ix,"on"+Yx)}Tn(Fu,"onAnimationEnd"),Tn(Ju,"onAnimationIteration"),Tn(Wu,"onAnimationStart"),Tn("dblclick","onDoubleClick"),Tn("focusin","onFocus"),Tn("focusout","onBlur"),Tn(ix,"onTransitionRun"),Tn(rx,"onTransitionStart"),Tn(cx,"onTransitionCancel"),Tn(Pu,"onTransitionEnd"),se("onMouseEnter",["mouseout","mouseover"]),se("onMouseLeave",["mouseout","mouseover"]),se("onPointerEnter",["pointerout","pointerover"]),se("onPointerLeave",["pointerout","pointerover"]),Xn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ys="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(" "),Xx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ys));function Nm(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],i=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var m=l.length-1;0<=m;m--){var v=l[m],N=v.instance,z=v.currentTarget;if(v=v.listener,N!==c&&i.isPropagationStopped())break e;c=v,i.currentTarget=z;try{c(i)}catch(X){Si(X)}i.currentTarget=null,c=N}else for(m=0;m<l.length;m++){if(v=l[m],N=v.instance,z=v.currentTarget,v=v.listener,N!==c&&i.isPropagationStopped())break e;c=v,i.currentTarget=z;try{c(i)}catch(X){Si(X)}i.currentTarget=null,c=N}}}}function ze(e,t){var n=t[is];n===void 0&&(n=t[is]=new Set);var l=e+"__bubble";n.has(l)||(jm(t,e,2,!1),n.add(l))}function So(e,t,n){var l=0;t&&(l|=4),jm(n,e,l,t)}var or="_reactListening"+Math.random().toString(36).slice(2);function _o(e){if(!e[or]){e[or]=!0,fi.forEach(function(n){n!=="selectionchange"&&(Xx.has(n)||So(n,!1,e),So(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[or]||(t[or]=!0,So("selectionchange",!1,t))}}function jm(e,t,n,l){switch(Jm(t)){case 2:var i=bg;break;case 8:i=yg;break;default:i=Ho}n=i.bind(null,t,n,e),i=void 0,!Ir||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function ko(e,t,n,l,i){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var m=l.tag;if(m===3||m===4){var v=l.stateNode.containerInfo;if(v===i)break;if(m===4)for(m=l.return;m!==null;){var N=m.tag;if((N===3||N===4)&&m.stateNode.containerInfo===i)return;m=m.return}for(;v!==null;){if(m=It(v),m===null)return;if(N=m.tag,N===5||N===6||N===26||N===27){l=c=m;continue e}v=v.parentNode}}l=l.return}xi(function(){var z=c,X=Ae(n),J=[];e:{var L=ed.get(e);if(L!==void 0){var $=yi,pe=e;switch(e){case"keypress":if(vi(n)===0)break e;case"keydown":case"keyup":$=Bp;break;case"focusin":pe="focus",$=Kr;break;case"focusout":pe="blur",$=Kr;break;case"beforeblur":case"afterblur":$=Kr;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=Au;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=Ep;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=qp;break;case Fu:case Ju:case Wu:$=Ap;break;case Pu:$=Ip;break;case"scroll":case"scrollend":$=_p;break;case"wheel":$=Xp;break;case"copy":case"cut":case"paste":$=Cp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=Cu;break;case"toggle":case"beforetoggle":$=Kp}var Se=(t&4)!==0,We=!Se&&(e==="scroll"||e==="scrollend"),R=Se?L!==null?L+"Capture":null:L;Se=[];for(var w=z,D;w!==null;){var Q=w;if(D=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||D===null||R===null||(Q=fs(w,R),Q!=null&&Se.push(Xs(w,Q,D))),We)break;w=w.return}0<Se.length&&(L=new $(L,pe,null,n,X),J.push({event:L,listeners:Se}))}}if((t&7)===0){e:{if(L=e==="mouseover"||e==="pointerover",$=e==="mouseout"||e==="pointerout",L&&n!==ve&&(pe=n.relatedTarget||n.fromElement)&&(It(pe)||pe[da]))break e;if(($||L)&&(L=X.window===X?X:(L=X.ownerDocument)?L.defaultView||L.parentWindow:window,$?(pe=n.relatedTarget||n.toElement,$=z,pe=pe?It(pe):null,pe!==null&&(We=f(pe),Se=pe.tag,pe!==We||Se!==5&&Se!==27&&Se!==6)&&(pe=null)):($=null,pe=z),$!==pe)){if(Se=Au,Q="onMouseLeave",R="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Cu,Q="onPointerLeave",R="onPointerEnter",w="pointer"),We=$==null?L:fa($),D=pe==null?L:fa(pe),L=new Se(Q,w+"leave",$,n,X),L.target=We,L.relatedTarget=D,Q=null,It(X)===z&&(Se=new Se(R,w+"enter",pe,n,X),Se.target=D,Se.relatedTarget=We,Q=Se),We=Q,$&&pe)t:{for(Se=Vx,R=$,w=pe,D=0,Q=R;Q;Q=Se(Q))D++;Q=0;for(var je=w;je;je=Se(je))Q++;for(;0<D-Q;)R=Se(R),D--;for(;0<Q-D;)w=Se(w),Q--;for(;D--;){if(R===w||w!==null&&R===w.alternate){Se=R;break t}R=Se(R),w=Se(w)}Se=null}else Se=null;$!==null&&Sm(J,L,$,Se,!1),pe!==null&&We!==null&&Sm(J,We,pe,Se,!0)}}e:{if(L=z?fa(z):window,$=L.nodeName&&L.nodeName.toLowerCase(),$==="select"||$==="input"&&L.type==="file")var qe=Hu;else if(Uu(L))if($u)qe=ax;else{qe=tx;var be=ex}else $=L.nodeName,!$||$.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?z&&ha(z.elementType)&&(qe=Hu):qe=nx;if(qe&&(qe=qe(e,z))){Bu(J,qe,n,X);break e}be&&be(e,L,z),e==="focusout"&&z&&L.type==="number"&&z.memoizedProps.value!=null&&jl(L,"number",L.value)}switch(be=z?fa(z):window,e){case"focusin":(Uu(be)||be.contentEditable==="true")&&(kl=be,Pr=z,ys=null);break;case"focusout":ys=Pr=kl=null;break;case"mousedown":ec=!0;break;case"contextmenu":case"mouseup":case"dragend":ec=!1,Zu(J,n,X);break;case"selectionchange":if(sx)break;case"keydown":case"keyup":Zu(J,n,X)}var Ce;if(Qr)e:{switch(e){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else _l?zu(e,n)&&(Be="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Be="onCompositionStart");Be&&(Ru&&n.locale!=="ko"&&(_l||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&_l&&(Ce=wu()):(xa=X,Yr="value"in xa?xa.value:xa.textContent,_l=!0)),be=ur(z,Be),0<be.length&&(Be=new Mu(Be,e,null,n,X),J.push({event:Be,listeners:be}),Ce?Be.data=Ce:(Ce=Lu(n),Ce!==null&&(Be.data=Ce)))),(Ce=Qp?Fp(e,n):Jp(e,n))&&(Be=ur(z,"onBeforeInput"),0<Be.length&&(be=new Mu("onBeforeInput","beforeinput",null,n,X),J.push({event:be,listeners:Be}),be.data=Ce)),Gx(J,e,z,n,X)}Nm(J,t)})}function Xs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ur(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,c=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||c===null||(i=fs(e,n),i!=null&&l.unshift(Xs(e,i,c)),i=fs(e,t),i!=null&&l.push(Xs(e,i,c))),e.tag===3)return l;e=e.return}return[]}function Vx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Sm(e,t,n,l,i){for(var c=t._reactName,m=[];n!==null&&n!==l;){var v=n,N=v.alternate,z=v.stateNode;if(v=v.tag,N!==null&&N===l)break;v!==5&&v!==26&&v!==27||z===null||(N=z,i?(z=fs(n,c),z!=null&&m.unshift(Xs(n,z,N))):i||(z=fs(n,c),z!=null&&m.push(Xs(n,z,N)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var Kx=/\r\n?/g,Zx=/\u0000|\uFFFD/g;function _m(e){return(typeof e=="string"?e:""+e).replace(Kx,`
49
+ `).replace(Zx,"")}function km(e,t){return t=_m(t),_m(e)===t}function Je(e,t,n,l,i,c){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||_e(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&_e(e,""+l);break;case"className":an(e,"class",l);break;case"tabIndex":an(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":an(e,n,l);break;case"style":Ke(e,l,c);break;case"data":if(t!=="object"){an(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=pa(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(n==="formAction"?(t!=="input"&&Je(e,t,"name",i.name,i,null),Je(e,t,"formEncType",i.formEncType,i,null),Je(e,t,"formMethod",i.formMethod,i,null),Je(e,t,"formTarget",i.formTarget,i,null)):(Je(e,t,"encType",i.encType,i,null),Je(e,t,"method",i.method,i,null),Je(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=pa(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=re);break;case"onScroll":l!=null&&ze("scroll",e);break;case"onScrollEnd":l!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=pa(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":ze("beforetoggle",e),ze("toggle",e),Ht(e,"popover",l);break;case"xlinkActuate":Qt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Qt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Qt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Qt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Qt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Qt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ht(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Vn.get(n)||n,Ht(e,n,l))}}function Eo(e,t,n,l,i,c){switch(n){case"style":Ke(e,l,c);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof l=="string"?_e(e,l):(typeof l=="number"||typeof l=="bigint")&&_e(e,""+l);break;case"onScroll":l!=null&&ze("scroll",e);break;case"onScrollEnd":l!=null&&ze("scrollend",e);break;case"onClick":l!=null&&(e.onclick=re);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Va.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),c=e[Bt]||null,c=c!=null?c[n]:null,typeof c=="function"&&e.removeEventListener(t,c,i),typeof l=="function")){typeof c!="function"&&c!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,i);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):Ht(e,n,l)}}}function zt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var l=!1,i=!1,c;for(c in n)if(n.hasOwnProperty(c)){var m=n[c];if(m!=null)switch(c){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Je(e,t,c,m,n,null)}}i&&Je(e,t,"srcSet",n.srcSet,n,null),l&&Je(e,t,"src",n.src,n,null);return;case"input":ze("invalid",e);var v=c=m=i=null,N=null,z=null;for(l in n)if(n.hasOwnProperty(l)){var X=n[l];if(X!=null)switch(l){case"name":i=X;break;case"type":m=X;break;case"checked":N=X;break;case"defaultChecked":z=X;break;case"value":c=X;break;case"defaultValue":v=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(o(137,t));break;default:Je(e,t,l,X,n,null)}}Ka(e,c,v,N,z,m,i,!1);return;case"select":ze("invalid",e),l=m=c=null;for(i in n)if(n.hasOwnProperty(i)&&(v=n[i],v!=null))switch(i){case"value":c=v;break;case"defaultValue":m=v;break;case"multiple":l=v;default:Je(e,t,i,v,n,null)}t=c,n=m,e.multiple=!!l,t!=null?Ct(e,!!l,t,!1):n!=null&&Ct(e,!!l,n,!0);return;case"textarea":ze("invalid",e),c=i=l=null;for(m in n)if(n.hasOwnProperty(m)&&(v=n[m],v!=null))switch(m){case"value":l=v;break;case"defaultValue":i=v;break;case"children":c=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(o(91));break;default:Je(e,t,m,v,n,null)}Sl(e,l,i,c);return;case"option":for(N in n)if(n.hasOwnProperty(N)&&(l=n[N],l!=null))switch(N){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Je(e,t,N,l,n,null)}return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(l=0;l<Ys.length;l++)ze(Ys[l],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in n)if(n.hasOwnProperty(z)&&(l=n[z],l!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Je(e,t,z,l,n,null)}return;default:if(ha(t)){for(X in n)n.hasOwnProperty(X)&&(l=n[X],l!==void 0&&Eo(e,t,X,l,n,void 0));return}}for(v in n)n.hasOwnProperty(v)&&(l=n[v],l!=null&&Je(e,t,v,l,n,null))}function Qx(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,c=null,m=null,v=null,N=null,z=null,X=null;for($ in n){var J=n[$];if(n.hasOwnProperty($)&&J!=null)switch($){case"checked":break;case"value":break;case"defaultValue":N=J;default:l.hasOwnProperty($)||Je(e,t,$,null,l,J)}}for(var L in l){var $=l[L];if(J=n[L],l.hasOwnProperty(L)&&($!=null||J!=null))switch(L){case"type":c=$;break;case"name":i=$;break;case"checked":z=$;break;case"defaultChecked":X=$;break;case"value":m=$;break;case"defaultValue":v=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(o(137,t));break;default:$!==J&&Je(e,t,L,$,l,J)}}os(e,m,v,N,z,X,c,i);return;case"select":$=m=v=L=null;for(c in n)if(N=n[c],n.hasOwnProperty(c)&&N!=null)switch(c){case"value":break;case"multiple":$=N;default:l.hasOwnProperty(c)||Je(e,t,c,null,l,N)}for(i in l)if(c=l[i],N=n[i],l.hasOwnProperty(i)&&(c!=null||N!=null))switch(i){case"value":L=c;break;case"defaultValue":v=c;break;case"multiple":m=c;default:c!==N&&Je(e,t,i,c,l,N)}t=v,n=m,l=$,L!=null?Ct(e,!!n,L,!1):!!l!=!!n&&(t!=null?Ct(e,!!n,t,!0):Ct(e,!!n,n?[]:"",!1));return;case"textarea":$=L=null;for(v in n)if(i=n[v],n.hasOwnProperty(v)&&i!=null&&!l.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Je(e,t,v,null,l,i)}for(m in l)if(i=l[m],c=n[m],l.hasOwnProperty(m)&&(i!=null||c!=null))switch(m){case"value":L=i;break;case"defaultValue":$=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(o(91));break;default:i!==c&&Je(e,t,m,i,l,c)}hi(e,L,$);return;case"option":for(var pe in n)if(L=n[pe],n.hasOwnProperty(pe)&&L!=null&&!l.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:Je(e,t,pe,null,l,L)}for(N in l)if(L=l[N],$=n[N],l.hasOwnProperty(N)&&L!==$&&(L!=null||$!=null))switch(N){case"selected":e.selected=L&&typeof L!="function"&&typeof L!="symbol";break;default:Je(e,t,N,L,l,$)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Se in n)L=n[Se],n.hasOwnProperty(Se)&&L!=null&&!l.hasOwnProperty(Se)&&Je(e,t,Se,null,l,L);for(z in l)if(L=l[z],$=n[z],l.hasOwnProperty(z)&&L!==$&&(L!=null||$!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(o(137,t));break;default:Je(e,t,z,L,l,$)}return;default:if(ha(t)){for(var We in n)L=n[We],n.hasOwnProperty(We)&&L!==void 0&&!l.hasOwnProperty(We)&&Eo(e,t,We,void 0,l,L);for(X in l)L=l[X],$=n[X],!l.hasOwnProperty(X)||L===$||L===void 0&&$===void 0||Eo(e,t,X,L,l,$);return}}for(var R in n)L=n[R],n.hasOwnProperty(R)&&L!=null&&!l.hasOwnProperty(R)&&Je(e,t,R,null,l,L);for(J in l)L=l[J],$=n[J],!l.hasOwnProperty(J)||L===$||L==null&&$==null||Je(e,t,J,L,l,$)}function Em(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Fx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var i=n[l],c=i.transferSize,m=i.initiatorType,v=i.duration;if(c&&v&&Em(m)){for(m=0,v=i.responseEnd,l+=1;l<n.length;l++){var N=n[l],z=N.startTime;if(z>v)break;var X=N.transferSize,J=N.initiatorType;X&&Em(J)&&(N=N.responseEnd,m+=X*(N<v?1:(v-z)/(N-z)))}if(--l,t+=8*(c+m)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var wo=null,To=null;function dr(e){return e.nodeType===9?e:e.ownerDocument}function wm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Tm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Ao(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Mo=null;function Jx(){var e=window.event;return e&&e.type==="popstate"?e===Mo?!1:(Mo=e,!0):(Mo=null,!1)}var Am=typeof setTimeout=="function"?setTimeout:void 0,Wx=typeof clearTimeout=="function"?clearTimeout:void 0,Mm=typeof Promise=="function"?Promise:void 0,Px=typeof queueMicrotask=="function"?queueMicrotask:typeof Mm<"u"?function(e){return Mm.resolve(null).then(e).catch(eg)}:Am;function eg(e){setTimeout(function(){throw e})}function Oa(e){return e==="head"}function Cm(e,t){var n=t,l=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(i),Wl(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Vs(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Vs(n);for(var c=n.firstChild;c;){var m=c.nextSibling,v=c.nodeName;c[Xa]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=m}}else n==="body"&&Vs(e.ownerDocument.body);n=i}while(n);Wl(t)}function Rm(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Co(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Co(n),rs(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function tg(e,t,n,l){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Xa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=_n(e.nextSibling),e===null)break}return null}function ng(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=_n(e.nextSibling),e===null))return null;return e}function Om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=_n(e.nextSibling),e===null))return null;return e}function Ro(e){return e.data==="$?"||e.data==="$~"}function Oo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ag(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function _n(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Do=null;function Dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return _n(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function zm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Lm(e,t,n){switch(t=dr(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Vs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);rs(e)}var kn=new Map,Um=new Set;function fr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ca=I.d;I.d={f:lg,r:sg,D:ig,C:rg,L:cg,m:og,X:dg,S:ug,M:fg};function lg(){var e=ca.f(),t=ar();return e||t}function sg(e){var t=Yn(e);t!==null&&t.tag===5&&t.type==="form"?Pd(t):ca.r(e)}var Ql=typeof document>"u"?null:document;function Bm(e,t,n){var l=Ql;if(l&&typeof t=="string"&&t){var i=Ft(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),Um.has(i)||(Um.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),zt(t,"link",e),yt(t),l.head.appendChild(t)))}}function ig(e){ca.D(e),Bm("dns-prefetch",e,null)}function rg(e,t){ca.C(e,t),Bm("preconnect",e,t)}function cg(e,t,n){ca.L(e,t,n);var l=Ql;if(l&&e&&t){var i='link[rel="preload"][as="'+Ft(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Ft(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Ft(n.imageSizes)+'"]')):i+='[href="'+Ft(e)+'"]';var c=i;switch(t){case"style":c=Fl(e);break;case"script":c=Jl(e)}kn.has(c)||(e=y({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),kn.set(c,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(Ks(c))||t==="script"&&l.querySelector(Zs(c))||(t=l.createElement("link"),zt(t,"link",e),yt(t),l.head.appendChild(t)))}}function og(e,t){ca.m(e,t);var n=Ql;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Ft(l)+'"][href="'+Ft(e)+'"]',c=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Jl(e)}if(!kn.has(c)&&(e=y({rel:"modulepreload",href:e},t),kn.set(c,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Zs(c)))return}l=n.createElement("link"),zt(l,"link",e),yt(l),n.head.appendChild(l)}}}function ug(e,t,n){ca.S(e,t,n);var l=Ql;if(l&&e){var i=ma(l).hoistableStyles,c=Fl(e);t=t||"default";var m=i.get(c);if(!m){var v={loading:0,preload:null};if(m=l.querySelector(Ks(c)))v.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},n),(n=kn.get(c))&&zo(e,n);var N=m=l.createElement("link");yt(N),zt(N,"link",e),N._p=new Promise(function(z,X){N.onload=z,N.onerror=X}),N.addEventListener("load",function(){v.loading|=1}),N.addEventListener("error",function(){v.loading|=2}),v.loading|=4,mr(m,t,l)}m={type:"stylesheet",instance:m,count:1,state:v},i.set(c,m)}}}function dg(e,t){ca.X(e,t);var n=Ql;if(n&&e){var l=ma(n).hoistableScripts,i=Jl(e),c=l.get(i);c||(c=n.querySelector(Zs(i)),c||(e=y({src:e,async:!0},t),(t=kn.get(i))&&Lo(e,t),c=n.createElement("script"),yt(c),zt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(i,c))}}function fg(e,t){ca.M(e,t);var n=Ql;if(n&&e){var l=ma(n).hoistableScripts,i=Jl(e),c=l.get(i);c||(c=n.querySelector(Zs(i)),c||(e=y({src:e,async:!0,type:"module"},t),(t=kn.get(i))&&Lo(e,t),c=n.createElement("script"),yt(c),zt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(i,c))}}function Hm(e,t,n,l){var i=(i=de.current)?fr(i):null;if(!i)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Fl(n.href),n=ma(i).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Fl(n.href);var c=ma(i).hoistableStyles,m=c.get(e);if(m||(i=i.ownerDocument||i,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,m),(c=i.querySelector(Ks(e)))&&!c._p&&(m.instance=c,m.state.loading=5),kn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},kn.set(e,n),c||mg(i,e,n,m.state))),t&&l===null)throw Error(o(528,""));return m}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Jl(n),n=ma(i).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Fl(e){return'href="'+Ft(e)+'"'}function Ks(e){return'link[rel="stylesheet"]['+e+"]"}function $m(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function mg(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),zt(t,"link",n),yt(t),e.head.appendChild(t))}function Jl(e){return'[src="'+Ft(e)+'"]'}function Zs(e){return"script[async]"+e}function qm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Ft(n.href)+'"]');if(l)return t.instance=l,yt(l),l;var i=y({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),yt(l),zt(l,"style",i),mr(l,n.precedence,e),t.instance=l;case"stylesheet":i=Fl(n.href);var c=e.querySelector(Ks(i));if(c)return t.state.loading|=4,t.instance=c,yt(c),c;l=$m(n),(i=kn.get(i))&&zo(l,i),c=(e.ownerDocument||e).createElement("link"),yt(c);var m=c;return m._p=new Promise(function(v,N){m.onload=v,m.onerror=N}),zt(c,"link",l),t.state.loading|=4,mr(c,n.precedence,e),t.instance=c;case"script":return c=Jl(n.src),(i=e.querySelector(Zs(c)))?(t.instance=i,yt(i),i):(l=n,(i=kn.get(c))&&(l=y({},n),Lo(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),yt(i),zt(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,mr(l,n.precedence,e));return t.instance}function mr(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,c=i,m=0;m<l.length;m++){var v=l[m];if(v.dataset.precedence===t)c=v;else if(c!==i)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function zo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Lo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var hr=null;function Gm(e,t,n){if(hr===null){var l=new Map,i=hr=new Map;i.set(n,l)}else i=hr,l=i.get(n),l||(l=new Map,i.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var c=n[i];if(!(c[Xa]||c[pt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var m=c.getAttribute(t)||"";m=e+m;var v=l.get(m);v?v.push(c):l.set(m,[c])}}return l}function Im(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function hg(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ym(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function pg(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Fl(l.href),c=t.querySelector(Ks(i));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=pr.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,yt(c);return}c=t.ownerDocument||t,l=$m(l),(i=kn.get(i))&&zo(l,i),c=c.createElement("link"),yt(c);var m=c;m._p=new Promise(function(v,N){m.onload=v,m.onerror=N}),zt(c,"link",l),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=pr.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Uo=0;function xg(e,t){return e.stylesheets&&e.count===0&&gr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&gr(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Uo===0&&(Uo=62500*Fx());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&gr(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Uo?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function pr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var xr=null;function gr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,xr=new Map,t.forEach(gg,e),xr=null,pr.call(e))}function gg(e,t){if(!(t.state.loading&4)){var n=xr.get(e);if(n)var l=n.get(null);else{n=new Map,xr.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<i.length;c++){var m=i[c];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),l=m)}l&&n.set(null,l)}i=t.instance,m=i.getAttribute("data-precedence"),c=n.get(m)||l,c===l&&n.set(null,i),n.set(m,i),this.count++,l=pr.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),c?c.parentNode.insertBefore(i,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qs={$$typeof:ae,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function vg(e,t,n,l,i,c,m,v,N){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=c,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function Xm(e,t,n,l,i,c,m,v,N,z,X,J){return e=new vg(e,t,n,m,N,z,X,J,v),t=1,c===!0&&(t|=24),c=rn(3,null,null,t),e.current=c,c.stateNode=e,t=pc(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:l,isDehydrated:n,cache:t},bc(c),e}function Vm(e){return e?(e=Tl,e):Tl}function Km(e,t,n,l,i,c){i=Vm(i),l.context===null?l.context=i:l.pendingContext=i,l=ja(t),l.payload={element:n},c=c===void 0?null:c,c!==null&&(l.callback=c),n=Sa(e,l,t),n!==null&&(nn(n,e,t),ws(n,e,t))}function Zm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Bo(e,t){Zm(e,t),(e=e.alternate)&&Zm(e,t)}function Qm(e){if(e.tag===13||e.tag===31){var t=Ja(e,67108864);t!==null&&nn(t,e,67108864),Bo(e,67108864)}}function Fm(e){if(e.tag===13||e.tag===31){var t=fn();t=rt(t);var n=Ja(e,t);n!==null&&nn(n,e,t),Bo(e,t)}}var vr=!0;function bg(e,t,n,l){var i=M.T;M.T=null;var c=I.p;try{I.p=2,Ho(e,t,n,l)}finally{I.p=c,M.T=i}}function yg(e,t,n,l){var i=M.T;M.T=null;var c=I.p;try{I.p=8,Ho(e,t,n,l)}finally{I.p=c,M.T=i}}function Ho(e,t,n,l){if(vr){var i=$o(l);if(i===null)ko(e,t,l,br,n),Wm(e,l);else if(jg(i,e,t,n,l))l.stopPropagation();else if(Wm(e,l),t&4&&-1<Ng.indexOf(e)){for(;i!==null;){var c=Yn(i);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var m=Zt(c.pendingLanes);if(m!==0){var v=c;for(v.pendingLanes|=2,v.entangledLanes|=2;m;){var N=1<<31-Gt(m);v.entanglements[1]|=N,m&=~N}Bn(c),(Xe&6)===0&&(tr=nt()+500,Is(0))}}break;case 31:case 13:v=Ja(c,2),v!==null&&nn(v,c,2),ar(),Bo(c,2)}if(c=$o(l),c===null&&ko(e,t,l,br,n),c===i)break;i=c}i!==null&&l.stopPropagation()}else ko(e,t,l,null,n)}}function $o(e){return e=Ae(e),qo(e)}var br=null;function qo(e){if(br=null,e=It(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=p(t),e!==null)return e;e=null}else if(n===31){if(e=h(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return br=e,null}function Jm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Tt()){case pn:return 2;case xn:return 8;case qa:case Br:return 32;case ci:return 268435456;default:return 32}default:return 32}}var Go=!1,Da=null,za=null,La=null,Fs=new Map,Js=new Map,Ua=[],Ng="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 Wm(e,t){switch(e){case"focusin":case"focusout":Da=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":La=null;break;case"pointerover":case"pointerout":Fs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Js.delete(t.pointerId)}}function Ws(e,t,n,l,i,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:c,targetContainers:[i]},t!==null&&(t=Yn(t),t!==null&&Qm(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function jg(e,t,n,l,i){switch(t){case"focusin":return Da=Ws(Da,e,t,n,l,i),!0;case"dragenter":return za=Ws(za,e,t,n,l,i),!0;case"mouseover":return La=Ws(La,e,t,n,l,i),!0;case"pointerover":var c=i.pointerId;return Fs.set(c,Ws(Fs.get(c)||null,e,t,n,l,i)),!0;case"gotpointercapture":return c=i.pointerId,Js.set(c,Ws(Js.get(c)||null,e,t,n,l,i)),!0}return!1}function Pm(e){var t=It(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=p(n),t!==null){e.blockedOn=t,vl(e.priority,function(){Fm(n)});return}}else if(t===31){if(t=h(n),t!==null){e.blockedOn=t,vl(e.priority,function(){Fm(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function yr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=$o(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);ve=l,n.target.dispatchEvent(l),ve=null}else return t=Yn(n),t!==null&&Qm(t),e.blockedOn=n,!1;t.shift()}return!0}function eh(e,t,n){yr(e)&&n.delete(t)}function Sg(){Go=!1,Da!==null&&yr(Da)&&(Da=null),za!==null&&yr(za)&&(za=null),La!==null&&yr(La)&&(La=null),Fs.forEach(eh),Js.forEach(eh)}function Nr(e,t){e.blockedOn===t&&(e.blockedOn=null,Go||(Go=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Sg)))}var jr=null;function th(e){jr!==e&&(jr=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){jr===e&&(jr=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(qo(l||n)===null)continue;break}var c=Yn(n);c!==null&&(e.splice(t,3),t-=3,Hc(c,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function Wl(e){function t(N){return Nr(N,e)}Da!==null&&Nr(Da,e),za!==null&&Nr(za,e),La!==null&&Nr(La,e),Fs.forEach(t),Js.forEach(t);for(var n=0;n<Ua.length;n++){var l=Ua[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ua.length&&(n=Ua[0],n.blockedOn===null);)Pm(n),n.blockedOn===null&&Ua.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],c=n[l+1],m=i[Bt]||null;if(typeof c=="function")m||th(n);else if(m){var v=null;if(c&&c.hasAttribute("formAction")){if(i=c,m=c[Bt]||null)v=m.formAction;else if(qo(i)!==null)continue}else v=m.action;typeof v=="function"?n[l+1]=v:(n.splice(l,3),l-=3),th(n)}}}function nh(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(m){return i=m})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function Io(e){this._internalRoot=e}Sr.prototype.render=Io.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=fn();Km(n,l,e,t,null,null)},Sr.prototype.unmount=Io.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Km(e.current,2,null,e,null,null),ar(),t[da]=null}};function Sr(e){this._internalRoot=e}Sr.prototype.unstable_scheduleHydration=function(e){if(e){var t=gl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ua.length&&t!==0&&t<Ua[n].priority;n++);Ua.splice(n,0,e),n===0&&Pm(e)}};var ah=r.version;if(ah!=="19.2.6")throw Error(o(527,ah,"19.2.6"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var _g={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _r=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_r.isDisabled&&_r.supportsFiber)try{Ga=_r.inject(_g),Ut=_r}catch{}}return ei.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,l="",i=uf,c=df,m=ff;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=Xm(e,1,!1,null,null,n,l,null,i,c,m,nh),e[da]=t.current,_o(e),new Io(t)},ei.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var l=!1,i="",c=uf,m=df,v=ff,N=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError),n.formState!==void 0&&(N=n.formState)),t=Xm(e,1,!0,t,n??null,l,i,N,c,m,v,nh),t.context=Vm(null),n=t.current,l=fn(),l=rt(l),i=ja(l),i.callback=null,Sa(n,i,l),n=l,t.current.lanes=n,Pe(t,n),Bn(t),e[da]=t.current,_o(e),new Sr(t)},ei.version="19.2.6",ei}var mh;function Ug(){if(mh)return Vo.exports;mh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),Vo.exports=Lg(),Vo.exports}var Bg=Ug();const fl="/dashboard";function hh(){const s=window.location.pathname;return s===fl||s===fl+"/"?"/":s.startsWith(fl+"/")?s.slice(fl.length):s||"/"}function ua(s){return s==="/"||s===""?fl+"/":fl+(s.startsWith("/")?s:"/"+s)}function ns(s){const r=ua(s);r!==window.location.pathname+window.location.search&&window.history.pushState({},"",r),window.dispatchEvent(new Event("dashboard:navigate"))}typeof document<"u"&&!window.__dashboardRouterInstalled&&(window.__dashboardRouterInstalled=!0,document.addEventListener("click",s=>{var o,d;if(s.defaultPrevented||s.button!==0||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey)return;const r=(d=(o=s.target)==null?void 0:o.closest)==null?void 0:d.call(o,"a");if(!r)return;const u=r.getAttribute("href");u&&(r.hasAttribute("target")||r.hasAttribute("download")||u.startsWith(fl)&&(s.preventDefault(),u!==window.location.pathname+window.location.search&&window.history.pushState({},"",u),window.dispatchEvent(new Event("dashboard:navigate"))))}),window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("dashboard:navigate"))}));function Gh(){const[s,r]=S.useState(hh());return S.useEffect(()=>{const u=()=>r(hh());return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),s}var Fo,ph;function Hg(){if(ph)return Fo;ph=1;function s(k){return k instanceof Map?k.clear=k.delete=k.set=function(){throw new Error("map is read-only")}:k instanceof Set&&(k.add=k.clear=k.delete=function(){throw new Error("set is read-only")}),Object.freeze(k),Object.getOwnPropertyNames(k).forEach(Z=>{const ce=k[Z],Ee=typeof ce;(Ee==="object"||Ee==="function")&&!Object.isFrozen(ce)&&s(ce)}),k}class r{constructor(Z){Z.data===void 0&&(Z.data={}),this.data=Z.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function u(k){return k.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function o(k,...Z){const ce=Object.create(null);for(const Ee in k)ce[Ee]=k[Ee];return Z.forEach(function(Ee){for(const at in Ee)ce[at]=Ee[at]}),ce}const d="</span>",f=k=>!!k.scope,p=(k,{prefix:Z})=>{if(k.startsWith("language:"))return k.replace("language:","language-");if(k.includes(".")){const ce=k.split(".");return[`${Z}${ce.shift()}`,...ce.map((Ee,at)=>`${Ee}${"_".repeat(at+1)}`)].join(" ")}return`${Z}${k}`};class h{constructor(Z,ce){this.buffer="",this.classPrefix=ce.classPrefix,Z.walk(this)}addText(Z){this.buffer+=u(Z)}openNode(Z){if(!f(Z))return;const ce=p(Z.scope,{prefix:this.classPrefix});this.span(ce)}closeNode(Z){f(Z)&&(this.buffer+=d)}value(){return this.buffer}span(Z){this.buffer+=`<span class="${Z}">`}}const x=(k={})=>{const Z={children:[]};return Object.assign(Z,k),Z};class g{constructor(){this.rootNode=x(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Z){this.top.children.push(Z)}openNode(Z){const ce=x({scope:Z});this.add(ce),this.stack.push(ce)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Z){return this.constructor._walk(Z,this.rootNode)}static _walk(Z,ce){return typeof ce=="string"?Z.addText(ce):ce.children&&(Z.openNode(ce),ce.children.forEach(Ee=>this._walk(Z,Ee)),Z.closeNode(ce)),Z}static _collapse(Z){typeof Z!="string"&&Z.children&&(Z.children.every(ce=>typeof ce=="string")?Z.children=[Z.children.join("")]:Z.children.forEach(ce=>{g._collapse(ce)}))}}class b extends g{constructor(Z){super(),this.options=Z}addText(Z){Z!==""&&this.add(Z)}startScope(Z){this.openNode(Z)}endScope(){this.closeNode()}__addSublanguage(Z,ce){const Ee=Z.root;ce&&(Ee.scope=`language:${ce}`),this.add(Ee)}toHTML(){return new h(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function y(k){return k?typeof k=="string"?k:k.source:null}function _(k){return A("(?=",k,")")}function B(k){return A("(?:",k,")*")}function U(k){return A("(?:",k,")?")}function A(...k){return k.map(ce=>y(ce)).join("")}function T(k){const Z=k[k.length-1];return typeof Z=="object"&&Z.constructor===Object?(k.splice(k.length-1,1),Z):{}}function F(...k){return"("+(T(k).capture?"":"?:")+k.map(Ee=>y(Ee)).join("|")+")"}function Y(k){return new RegExp(k.toString()+"|").exec("").length-1}function ae(k,Z){const ce=k&&k.exec(Z);return ce&&ce.index===0}const V=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function E(k,{joinWith:Z}){let ce=0;return k.map(Ee=>{ce+=1;const at=ce;let Pe=y(Ee),ge="";for(;Pe.length>0;){const fe=V.exec(Pe);if(!fe){ge+=Pe;break}ge+=Pe.substring(0,fe.index),Pe=Pe.substring(fe.index+fe[0].length),fe[0][0]==="\\"&&fe[1]?ge+="\\"+String(Number(fe[1])+at):(ge+=fe[0],fe[0]==="("&&ce++)}return ge}).map(Ee=>`(${Ee})`).join(Z)}const G=/\b\B/,C="[a-zA-Z]\\w*",K="[a-zA-Z_]\\w*",te="\\b\\d+(\\.\\d+)?",P="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",he="\\b(0b[01]+)",ne="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ue=(k={})=>{const Z=/^#![ ]*\//;return k.binary&&(k.begin=A(Z,/.*\b/,k.binary,/\b.*/)),o({scope:"meta",begin:Z,end:/$/,relevance:0,"on:begin":(ce,Ee)=>{ce.index!==0&&Ee.ignoreMatch()}},k)},ye={begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ye]},M={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ye]},I={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ee=function(k,Z,ce={}){const Ee=o({scope:"comment",begin:k,end:Z,contains:[]},ce);Ee.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const at=F("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ee.contains.push({begin:A(/[ ]+/,"(",at,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ee},oe=ee("//","$"),me=ee("/\\*","\\*/"),j=ee("#","$"),H={scope:"number",begin:te,relevance:0},le={scope:"number",begin:P,relevance:0},W={scope:"number",begin:he,relevance:0},q={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ye,{begin:/\[/,end:/\]/,relevance:0,contains:[ye]}]},de={scope:"title",begin:C,relevance:0},xe={scope:"title",begin:K,relevance:0},Ie={begin:"\\.\\s*"+K,relevance:0};var it=Object.freeze({__proto__:null,APOS_STRING_MODE:O,BACKSLASH_ESCAPE:ye,BINARY_NUMBER_MODE:W,BINARY_NUMBER_RE:he,COMMENT:ee,C_BLOCK_COMMENT_MODE:me,C_LINE_COMMENT_MODE:oe,C_NUMBER_MODE:le,C_NUMBER_RE:P,END_SAME_AS_BEGIN:function(k){return Object.assign(k,{"on:begin":(Z,ce)=>{ce.data._beginMatch=Z[1]},"on:end":(Z,ce)=>{ce.data._beginMatch!==Z[1]&&ce.ignoreMatch()}})},HASH_COMMENT_MODE:j,IDENT_RE:C,MATCH_NOTHING_RE:G,METHOD_GUARD:Ie,NUMBER_MODE:H,NUMBER_RE:te,PHRASAL_WORDS_MODE:I,QUOTE_STRING_MODE:M,REGEXP_MODE:q,RE_STARTERS_RE:ne,SHEBANG:ue,TITLE_MODE:de,UNDERSCORE_IDENT_RE:K,UNDERSCORE_TITLE_MODE:xe});function Vt(k,Z){k.input[k.index-1]==="."&&Z.ignoreMatch()}function Lt(k,Z){k.className!==void 0&&(k.scope=k.className,delete k.className)}function Cn(k,Z){Z&&k.beginKeywords&&(k.begin="\\b("+k.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",k.__beforeBegin=Vt,k.keywords=k.keywords||k.beginKeywords,delete k.beginKeywords,k.relevance===void 0&&(k.relevance=0))}function qt(k,Z){Array.isArray(k.illegal)&&(k.illegal=F(...k.illegal))}function Ye(k,Z){if(k.match){if(k.begin||k.end)throw new Error("begin & end are not supported with match");k.begin=k.match,delete k.match}}function wn(k,Z){k.relevance===void 0&&(k.relevance=1)}const hn=(k,Z)=>{if(!k.beforeMatch)return;if(k.starts)throw new Error("beforeMatch cannot be used with starts");const ce=Object.assign({},k);Object.keys(k).forEach(Ee=>{delete k[Ee]}),k.keywords=ce.keywords,k.begin=A(ce.beforeMatch,_(ce.begin)),k.starts={relevance:0,contains:[Object.assign(ce,{endsParent:!0})]},k.relevance=0,delete ce.beforeMatch},Rn=["of","and","for","in","not","or","if","then","parent","list","value"],ie="keyword";function we(k,Z,ce=ie){const Ee=Object.create(null);return typeof k=="string"?at(ce,k.split(" ")):Array.isArray(k)?at(ce,k):Object.keys(k).forEach(function(Pe){Object.assign(Ee,we(k[Pe],Z,Pe))}),Ee;function at(Pe,ge){Z&&(ge=ge.map(fe=>fe.toLowerCase())),ge.forEach(function(fe){const ke=fe.split("|");Ee[ke[0]]=[Pe,$e(ke[0],ke[1])]})}}function $e(k,Z){return Z?Number(Z):mt(k)?0:1}function mt(k){return Rn.includes(k.toLowerCase())}const Kt={},nt=k=>{console.error(k)},Tt=(k,...Z)=>{console.log(`WARN: ${k}`,...Z)},pn=(k,Z)=>{Kt[`${k}/${Z}`]||(console.log(`Deprecated as of ${k}. ${Z}`),Kt[`${k}/${Z}`]=!0)},xn=new Error;function qa(k,Z,{key:ce}){let Ee=0;const at=k[ce],Pe={},ge={};for(let fe=1;fe<=Z.length;fe++)ge[fe+Ee]=at[fe],Pe[fe+Ee]=!0,Ee+=Y(Z[fe-1]);k[ce]=ge,k[ce]._emit=Pe,k[ce]._multi=!0}function Br(k){if(Array.isArray(k.begin)){if(k.skip||k.excludeBegin||k.returnBegin)throw nt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),xn;if(typeof k.beginScope!="object"||k.beginScope===null)throw nt("beginScope must be object"),xn;qa(k,k.begin,{key:"beginScope"}),k.begin=E(k.begin,{joinWith:""})}}function ci(k){if(Array.isArray(k.end)){if(k.skip||k.excludeEnd||k.returnEnd)throw nt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),xn;if(typeof k.endScope!="object"||k.endScope===null)throw nt("endScope must be object"),xn;qa(k,k.end,{key:"endScope"}),k.end=E(k.end,{joinWith:""})}}function Hr(k){k.scope&&typeof k.scope=="object"&&k.scope!==null&&(k.beginScope=k.scope,delete k.scope)}function $r(k){Hr(k),typeof k.beginScope=="string"&&(k.beginScope={_wrap:k.beginScope}),typeof k.endScope=="string"&&(k.endScope={_wrap:k.endScope}),Br(k),ci(k)}function Ga(k){function Z(ge,fe){return new RegExp(y(ge),"m"+(k.case_insensitive?"i":"")+(k.unicodeRegex?"u":"")+(fe?"g":""))}class ce{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(fe,ke){ke.position=this.position++,this.matchIndexes[this.matchAt]=ke,this.regexes.push([ke,fe]),this.matchAt+=Y(fe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const fe=this.regexes.map(ke=>ke[1]);this.matcherRe=Z(E(fe,{joinWith:"|"}),!0),this.lastIndex=0}exec(fe){this.matcherRe.lastIndex=this.lastIndex;const ke=this.matcherRe.exec(fe);if(!ke)return null;const ht=ke.findIndex((In,gl)=>gl>0&&In!==void 0),rt=this.matchIndexes[ht];return ke.splice(0,ht),Object.assign(ke,rt)}}class Ee{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(fe){if(this.multiRegexes[fe])return this.multiRegexes[fe];const ke=new ce;return this.rules.slice(fe).forEach(([ht,rt])=>ke.addRule(ht,rt)),ke.compile(),this.multiRegexes[fe]=ke,ke}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(fe,ke){this.rules.push([fe,ke]),ke.type==="begin"&&this.count++}exec(fe){const ke=this.getMatcher(this.regexIndex);ke.lastIndex=this.lastIndex;let ht=ke.exec(fe);if(this.resumingScanAtSamePosition()&&!(ht&&ht.index===this.lastIndex)){const rt=this.getMatcher(0);rt.lastIndex=this.lastIndex+1,ht=rt.exec(fe)}return ht&&(this.regexIndex+=ht.position+1,this.regexIndex===this.count&&this.considerAll()),ht}}function at(ge){const fe=new Ee;return ge.contains.forEach(ke=>fe.addRule(ke.begin,{rule:ke,type:"begin"})),ge.terminatorEnd&&fe.addRule(ge.terminatorEnd,{type:"end"}),ge.illegal&&fe.addRule(ge.illegal,{type:"illegal"}),fe}function Pe(ge,fe){const ke=ge;if(ge.isCompiled)return ke;[Lt,Ye,$r,hn].forEach(rt=>rt(ge,fe)),k.compilerExtensions.forEach(rt=>rt(ge,fe)),ge.__beforeBegin=null,[Cn,qt,wn].forEach(rt=>rt(ge,fe)),ge.isCompiled=!0;let ht=null;return typeof ge.keywords=="object"&&ge.keywords.$pattern&&(ge.keywords=Object.assign({},ge.keywords),ht=ge.keywords.$pattern,delete ge.keywords.$pattern),ht=ht||/\w+/,ge.keywords&&(ge.keywords=we(ge.keywords,k.case_insensitive)),ke.keywordPatternRe=Z(ht,!0),fe&&(ge.begin||(ge.begin=/\B|\b/),ke.beginRe=Z(ke.begin),!ge.end&&!ge.endsWithParent&&(ge.end=/\B|\b/),ge.end&&(ke.endRe=Z(ke.end)),ke.terminatorEnd=y(ke.end)||"",ge.endsWithParent&&fe.terminatorEnd&&(ke.terminatorEnd+=(ge.end?"|":"")+fe.terminatorEnd)),ge.illegal&&(ke.illegalRe=Z(ge.illegal)),ge.contains||(ge.contains=[]),ge.contains=[].concat(...ge.contains.map(function(rt){return On(rt==="self"?ge:rt)})),ge.contains.forEach(function(rt){Pe(rt,ke)}),ge.starts&&Pe(ge.starts,fe),ke.matcher=at(ke),ke}if(k.compilerExtensions||(k.compilerExtensions=[]),k.contains&&k.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return k.classNameAliases=o(k.classNameAliases||{}),Pe(k)}function Ut(k){return k?k.endsWithParent||Ut(k.starts):!1}function On(k){return k.variants&&!k.cachedVariants&&(k.cachedVariants=k.variants.map(function(Z){return o(k,{variants:null},Z)})),k.cachedVariants?k.cachedVariants:Ut(k)?o(k,{starts:k.starts?o(k.starts):null}):Object.isFrozen(k)?o(k):k}var Gt="11.11.1";class qr extends Error{constructor(Z,ce){super(Z),this.name="HTMLInjectionError",this.html=ce}}const ss=u,oi=o,Ia=Symbol("nomatch"),xl=7,Ya=function(k){const Z=Object.create(null),ce=Object.create(null),Ee=[];let at=!0;const Pe="Could not find the language '{}', did you forget to load/include a language module?",ge={disableAutodetect:!0,name:"Plain text",contains:[]};let fe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function ke(se){return fe.noHighlightRe.test(se)}function ht(se){let Ne=se.className+" ";Ne+=se.parentNode?se.parentNode.className:"";const Oe=fe.languageDetectRe.exec(Ne);if(Oe){const Ve=It(Oe[1]);return Ve||(Tt(Pe.replace("{}",Oe[1])),Tt("Falling back to no-highlight mode for this block.",se)),Ve?Oe[1]:"no-highlight"}return Ne.split(/\s+/).find(Ve=>ke(Ve)||It(Ve))}function rt(se,Ne,Oe){let Ve="",xt="";typeof Ne=="object"?(Ve=se,Oe=Ne.ignoreIllegals,xt=Ne.language):(pn("10.7.0","highlight(lang, code, ...args) has been deprecated."),pn("10.7.0",`Please use highlight(code, options) instead.
50
+ https://github.com/highlightjs/highlight.js/issues/2277`),xt=se,Ve=Ne),Oe===void 0&&(Oe=!0);const Ht={code:Ve,language:xt};Va("before:highlight",Ht);const an=Ht.result?Ht.result:In(Ht.language,Ht.code,Oe);return an.code=Ht.code,Va("after:highlight",an),an}function In(se,Ne,Oe,Ve){const xt=Object.create(null);function Ht(re,ve){return re.keywords[ve]}function an(){if(!_e.keywords){Nt.addText(Ke);return}let re=0;_e.keywordPatternRe.lastIndex=0;let ve=_e.keywordPatternRe.exec(Ke),Ae="";for(;ve;){Ae+=Ke.substring(re,ve.index);const Le=Ct.case_insensitive?ve[0].toLowerCase():ve[0],ot=Ht(_e,Le);if(ot){const[gn,ds]=ot;if(Nt.addText(Ae),Ae="",xt[Le]=(xt[Le]||0)+1,xt[Le]<=xl&&(ha+=ds),gn.startsWith("_"))Ae+=ve[0];else{const xi=Ct.classNameAliases[gn]||gn;ln(ve[0],xi)}}else Ae+=ve[0];re=_e.keywordPatternRe.lastIndex,ve=_e.keywordPatternRe.exec(Ke)}Ae+=Ke.substring(re),Nt.addText(Ae)}function Qt(){if(Ke==="")return;let re=null;if(typeof _e.subLanguage=="string"){if(!Z[_e.subLanguage]){Nt.addText(Ke);return}re=In(_e.subLanguage,Ke,!0,pi[_e.subLanguage]),pi[_e.subLanguage]=re._top}else re=vl(Ke,_e.subLanguage.length?_e.subLanguage:null);_e.relevance>0&&(ha+=re.relevance),Nt.__addSublanguage(re._emitter,re.language)}function tt(){_e.subLanguage!=null?Qt():an(),Ke=""}function ln(re,ve){re!==""&&(Nt.startScope(ve),Nt.addText(re),Nt.endScope())}function mi(re,ve){let Ae=1;const Le=ve.length-1;for(;Ae<=Le;){if(!re._emit[Ae]){Ae++;continue}const ot=Ct.classNameAliases[re[Ae]]||re[Ae],gn=ve[Ae];ot?ln(gn,ot):(Ke=gn,an(),Ke=""),Ae++}}function yl(re,ve){return re.scope&&typeof re.scope=="string"&&Nt.openNode(Ct.classNameAliases[re.scope]||re.scope),re.beginScope&&(re.beginScope._wrap?(ln(Ke,Ct.classNameAliases[re.beginScope._wrap]||re.beginScope._wrap),Ke=""):re.beginScope._multi&&(mi(re.beginScope,ve),Ke="")),_e=Object.create(re,{parent:{value:_e}}),_e}function cs(re,ve,Ae){let Le=ae(re.endRe,Ae);if(Le){if(re["on:end"]){const ot=new r(re);re["on:end"](ve,ot),ot.isMatchIgnored&&(Le=!1)}if(Le){for(;re.endsParent&&re.parent;)re=re.parent;return re}}if(re.endsWithParent)return cs(re.parent,ve,Ae)}function Nl(re){return _e.matcher.regexIndex===0?(Ke+=re[0],1):(pa=!0,0)}function Gr(re){const ve=re[0],Ae=re.rule,Le=new r(Ae),ot=[Ae.__beforeBegin,Ae["on:begin"]];for(const gn of ot)if(gn&&(gn(re,Le),Le.isMatchIgnored))return Nl(ve);return Ae.skip?Ke+=ve:(Ae.excludeBegin&&(Ke+=ve),tt(),!Ae.returnBegin&&!Ae.excludeBegin&&(Ke=ve)),yl(Ae,re),Ae.returnBegin?0:ve.length}function Ft(re){const ve=re[0],Ae=Ne.substring(re.index),Le=cs(_e,re,Ae);if(!Le)return Ia;const ot=_e;_e.endScope&&_e.endScope._wrap?(tt(),ln(ve,_e.endScope._wrap)):_e.endScope&&_e.endScope._multi?(tt(),mi(_e.endScope,re)):ot.skip?Ke+=ve:(ot.returnEnd||ot.excludeEnd||(Ke+=ve),tt(),ot.excludeEnd&&(Ke=ve));do _e.scope&&Nt.closeNode(),!_e.skip&&!_e.subLanguage&&(ha+=_e.relevance),_e=_e.parent;while(_e!==Le.parent);return Le.starts&&yl(Le.starts,re),ot.returnEnd?0:ve.length}function os(){const re=[];for(let ve=_e;ve!==Ct;ve=ve.parent)ve.scope&&re.unshift(ve.scope);re.forEach(ve=>Nt.openNode(ve))}let Ka={};function jl(re,ve){const Ae=ve&&ve[0];if(Ke+=re,Ae==null)return tt(),0;if(Ka.type==="begin"&&ve.type==="end"&&Ka.index===ve.index&&Ae===""){if(Ke+=Ne.slice(ve.index,ve.index+1),!at){const Le=new Error(`0 width match regex (${se})`);throw Le.languageName=se,Le.badRule=Ka.rule,Le}return 1}if(Ka=ve,ve.type==="begin")return Gr(ve);if(ve.type==="illegal"&&!Oe){const Le=new Error('Illegal lexeme "'+Ae+'" for mode "'+(_e.scope||"<unnamed>")+'"');throw Le.mode=_e,Le}else if(ve.type==="end"){const Le=Ft(ve);if(Le!==Ia)return Le}if(ve.type==="illegal"&&Ae==="")return Ke+=`
51
+ `,1;if(us>1e5&&us>ve.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ke+=Ae,Ae.length}const Ct=It(se);if(!Ct)throw nt(Pe.replace("{}",se)),new Error('Unknown language: "'+se+'"');const hi=Ga(Ct);let Sl="",_e=Ve||hi;const pi={},Nt=new fe.__emitter(fe);os();let Ke="",ha=0,Vn=0,us=0,pa=!1;try{if(Ct.__emitTokens)Ct.__emitTokens(Ne,Nt);else{for(_e.matcher.considerAll();;){us++,pa?pa=!1:_e.matcher.considerAll(),_e.matcher.lastIndex=Vn;const re=_e.matcher.exec(Ne);if(!re)break;const ve=Ne.substring(Vn,re.index),Ae=jl(ve,re);Vn=re.index+Ae}jl(Ne.substring(Vn))}return Nt.finalize(),Sl=Nt.toHTML(),{language:se,value:Sl,relevance:ha,illegal:!1,_emitter:Nt,_top:_e}}catch(re){if(re.message&&re.message.includes("Illegal"))return{language:se,value:ss(Ne),illegal:!0,relevance:0,_illegalBy:{message:re.message,index:Vn,context:Ne.slice(Vn-100,Vn+100),mode:re.mode,resultSoFar:Sl},_emitter:Nt};if(at)return{language:se,value:ss(Ne),illegal:!1,relevance:0,errorRaised:re,_emitter:Nt,_top:_e};throw re}}function gl(se){const Ne={value:ss(se),illegal:!1,relevance:0,_top:ge,_emitter:new fe.__emitter(fe)};return Ne._emitter.addText(se),Ne}function vl(se,Ne){Ne=Ne||fe.languages||Object.keys(Z);const Oe=gl(se),Ve=Ne.filter(It).filter(fa).map(tt=>In(tt,se,!1));Ve.unshift(Oe);const xt=Ve.sort((tt,ln)=>{if(tt.relevance!==ln.relevance)return ln.relevance-tt.relevance;if(tt.language&&ln.language){if(It(tt.language).supersetOf===ln.language)return 1;if(It(ln.language).supersetOf===tt.language)return-1}return 0}),[Ht,an]=xt,Qt=Ht;return Qt.secondBest=an,Qt}function Dn(se,Ne,Oe){const Ve=Ne&&ce[Ne]||Oe;se.classList.add("hljs"),se.classList.add(`language-${Ve}`)}function pt(se){let Ne=null;const Oe=ht(se);if(ke(Oe))return;if(Va("before:highlightElement",{el:se,language:Oe}),se.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",se);return}if(se.children.length>0&&(fe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(se)),fe.throwUnescapedHTML))throw new qr("One of your code blocks includes unescaped HTML.",se.innerHTML);Ne=se;const Ve=Ne.textContent,xt=Oe?rt(Ve,{language:Oe,ignoreIllegals:!0}):vl(Ve);se.innerHTML=xt.value,se.dataset.highlighted="yes",Dn(se,Oe,xt.language),se.result={language:xt.language,re:xt.relevance,relevance:xt.relevance},xt.secondBest&&(se.secondBest={language:xt.secondBest.language,relevance:xt.secondBest.relevance}),Va("after:highlightElement",{el:se,result:xt,text:Ve})}function Bt(se){fe=oi(fe,se)}const da=()=>{bl(),pn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function is(){bl(),pn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ui=!1;function bl(){function se(){bl()}if(document.readyState==="loading"){ui||window.addEventListener("DOMContentLoaded",se,!1),ui=!0;return}document.querySelectorAll(fe.cssSelector).forEach(pt)}function di(se,Ne){let Oe=null;try{Oe=Ne(k)}catch(Ve){if(nt("Language definition for '{}' could not be registered.".replace("{}",se)),at)nt(Ve);else throw Ve;Oe=ge}Oe.name||(Oe.name=se),Z[se]=Oe,Oe.rawDefinition=Ne.bind(null,k),Oe.aliases&&Yn(Oe.aliases,{languageName:se})}function Xa(se){delete Z[se];for(const Ne of Object.keys(ce))ce[Ne]===se&&delete ce[Ne]}function rs(){return Object.keys(Z)}function It(se){return se=(se||"").toLowerCase(),Z[se]||Z[ce[se]]}function Yn(se,{languageName:Ne}){typeof se=="string"&&(se=[se]),se.forEach(Oe=>{ce[Oe.toLowerCase()]=Ne})}function fa(se){const Ne=It(se);return Ne&&!Ne.disableAutodetect}function ma(se){se["before:highlightBlock"]&&!se["before:highlightElement"]&&(se["before:highlightElement"]=Ne=>{se["before:highlightBlock"](Object.assign({block:Ne.el},Ne))}),se["after:highlightBlock"]&&!se["after:highlightElement"]&&(se["after:highlightElement"]=Ne=>{se["after:highlightBlock"](Object.assign({block:Ne.el},Ne))})}function yt(se){ma(se),Ee.push(se)}function fi(se){const Ne=Ee.indexOf(se);Ne!==-1&&Ee.splice(Ne,1)}function Va(se,Ne){const Oe=se;Ee.forEach(function(Ve){Ve[Oe]&&Ve[Oe](Ne)})}function Xn(se){return pn("10.7.0","highlightBlock will be removed entirely in v12.0"),pn("10.7.0","Please use highlightElement now."),pt(se)}Object.assign(k,{highlight:rt,highlightAuto:vl,highlightAll:bl,highlightElement:pt,highlightBlock:Xn,configure:Bt,initHighlighting:da,initHighlightingOnLoad:is,registerLanguage:di,unregisterLanguage:Xa,listLanguages:rs,getLanguage:It,registerAliases:Yn,autoDetection:fa,inherit:oi,addPlugin:yt,removePlugin:fi}),k.debugMode=function(){at=!1},k.safeMode=function(){at=!0},k.versionString=Gt,k.regex={concat:A,lookahead:_,either:F,optional:U,anyNumberOfTimes:B};for(const se in it)typeof it[se]=="object"&&s(it[se]);return Object.assign(k,it),k},Zt=Ya({});return Zt.newInstance=()=>Ya({}),Fo=Zt,Zt.HighlightJS=Zt,Zt.default=Zt,Fo}var $g=Hg();const mn=Tg($g);function qg(s){const r=s.regex,u={},o={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[u]}]};Object.assign(u,{className:"variable",variants:[{begin:r.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},o]});const d={className:"subst",begin:/\$\(/,end:/\)/,contains:[s.BACKSLASH_ESCAPE]},f=s.inherit(s.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),p={begin:/<<-?\s*(?=\w+)/,starts:{contains:[s.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},h={className:"string",begin:/"/,end:/"/,contains:[s.BACKSLASH_ESCAPE,u,d]};d.contains.push(h);const x={match:/\\"/},g={className:"string",begin:/'/,end:/'/},b={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},s.NUMBER_MODE,u]},_=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],B=s.SHEBANG({binary:`(${_.join("|")})`,relevance:10}),U={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[s.inherit(s.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},A=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],T=["true","false"],F={match:/(\/[a-z._-]+)+/},Y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],ae=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],V=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],E=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:A,literal:T,built_in:[...Y,...ae,"set","shopt",...V,...E]},contains:[B,s.SHEBANG(),U,y,f,p,F,h,x,g,b,u]}}const Gg=s=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:s.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:s.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ig=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Yg=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Xg=[...Ig,...Yg],Vg=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Kg=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Zg=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Qg=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Fg(s){const r=s.regex,u=Gg(s),o={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},d="and or not only",f=/@-?\w[\w]*(-\w+)*/,p="[a-zA-Z-][a-zA-Z0-9_-]*",h=[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[u.BLOCK_COMMENT,o,u.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+p,relevance:0},u.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Kg.join("|")+")"},{begin:":(:)?("+Zg.join("|")+")"}]},u.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Qg.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[u.BLOCK_COMMENT,u.HEXCOLOR,u.IMPORTANT,u.CSS_NUMBER_MODE,...h,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...h,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},u.FUNCTION_DISPATCH]},{begin:r.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:f},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:d,attribute:Vg.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...h,u.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Xg.join("|")+")\\b"}]}}function Jg(s){const r=s.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:r.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:r.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Wg(s){const f={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:f,illegal:"</",contains:[s.C_LINE_COMMENT_MODE,s.C_BLOCK_COMMENT_MODE,{className:"string",variants:[s.QUOTE_STRING_MODE,s.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[s.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:f,illegal:/["']/}]}]}}const xh="[A-Za-z$_][0-9A-Za-z$_]*",Pg=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ev=["true","false","null","undefined","NaN","Infinity"],Ih=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Yh=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Xh=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],tv=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],nv=[].concat(Xh,Ih,Yh);function av(s){const r=s.regex,u=(ee,{after:oe})=>{const me="</"+ee[0].slice(1);return ee.input.indexOf(me,oe)!==-1},o=xh,d={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,p={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ee,oe)=>{const me=ee[0].length+ee.index,j=ee.input[me];if(j==="<"||j===","){oe.ignoreMatch();return}j===">"&&(u(ee,{after:me})||oe.ignoreMatch());let H;const le=ee.input.substring(me);if(H=le.match(/^\s*=/)){oe.ignoreMatch();return}if((H=le.match(/^\s+extends\s+/))&&H.index===0){oe.ignoreMatch();return}}},h={$pattern:xh,keyword:Pg,literal:ev,built_in:nv,"variable.language":tv},x="[0-9](_?[0-9])*",g=`\\.(${x})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${x})\\b`},{begin:`\\b(${b})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},_={className:"subst",begin:"\\$\\{",end:"\\}",keywords:h,contains:[]},B={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,_],subLanguage:"xml"}},U={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,_],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,_],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[s.BACKSLASH_ESCAPE,_]},Y={className:"comment",variants:[s.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),s.C_BLOCK_COMMENT_MODE,s.C_LINE_COMMENT_MODE]},ae=[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,B,U,A,T,{match:/\$\d+/},y];_.contains=ae.concat({begin:/\{/,end:/\}/,keywords:h,contains:["self"].concat(ae)});const V=[].concat(Y,_.contains),E=V.concat([{begin:/(\s*)\(/,end:/\)/,keywords:h,contains:["self"].concat(V)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:E},C={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,r.concat(o,"(",r.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ih,...Yh]}},te={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},he={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ne(ee){return r.concat("(?!",ee.join("|"),")")}const ue={match:r.concat(/\b/,ne([...Xh,"super","import"].map(ee=>`${ee}\\s*\\(`)),o,r.lookahead(/\s*\(/)),className:"title.function",relevance:0},ye={begin:r.concat(/\./,r.lookahead(r.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},O={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+s.UNDERSCORE_IDENT_RE+")\\s*=>",I={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:h,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[s.SHEBANG({label:"shebang",binary:"node",relevance:5}),te,s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,B,U,A,T,Y,{match:/\$\d+/},y,K,{scope:"attr",match:o+r.lookahead(":"),relevance:0},I,{begin:"("+s.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[Y,s.REGEXP_MODE,{className:"function",begin:M,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:s.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:d.begin,end:d.end},{match:f},{begin:p.begin,"on:begin":p.isTrulyOpeningTag,end:p.end}],subLanguage:"xml",contains:[{begin:p.begin,end:p.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+s.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,s.inherit(s.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},ye,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},ue,he,C,O,{match:/\$[(.]/}]}}function lv(s){const r={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},u={match:/[{}[\],:]/,className:"punctuation",relevance:0},o=["true","false","null"],d={scope:"literal",beginKeywords:o.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:o},contains:[r,u,s.QUOTE_STRING_MODE,d,s.C_NUMBER_MODE,s.C_LINE_COMMENT_MODE,s.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function sv(s){const r=s.regex,u=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),o=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],h={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:o,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},x={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:h,illegal:/#/},b={begin:/\{\{/,relevance:0},y={className:"string",contains:[s.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[s.BACKSLASH_ESCAPE,x],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[s.BACKSLASH_ESCAPE,x],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[s.BACKSLASH_ESCAPE,x,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[s.BACKSLASH_ESCAPE,x,b,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[s.BACKSLASH_ESCAPE,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[s.BACKSLASH_ESCAPE,b,g]},s.APOS_STRING_MODE,s.QUOTE_STRING_MODE]},_="[0-9](_?[0-9])*",B=`(\\b(${_}))?\\.(${_})|\\b(${_})\\.`,U=`\\b|${o.join("|")}`,A={className:"number",relevance:0,variants:[{begin:`(\\b(${_})|(${B}))[eE][+-]?(${_})[jJ]?(?=${U})`},{begin:`(${B})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${U})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${U})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${U})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${U})`},{begin:`\\b(${_})[jJ](?=${U})`}]},T={className:"comment",begin:r.lookahead(/# type:/),end:/$/,keywords:h,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},F={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:["self",x,A,y,s.HASH_COMMENT_MODE]}]};return g.contains=[y,A,x],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:h,illegal:/(<\/|\?)|=>/,contains:[x,A,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,T,s.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,u],scope:{1:"keyword",3:"title.function"},contains:[F]},{variants:[{match:[/\bclass/,/\s+/,u,/\s*/,/\(\s*/,u,/\s*\)/]},{match:[/\bclass/,/\s+/,u]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[A,F,y]}]}}function iv(s){const r=s.regex,u=s.COMMENT("--","$"),o={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},d={begin:/"/,end:/"/,contains:[{match:/""/}]},f=["true","false","unknown"],p=["double precision","large object","with timezone","without timezone"],h=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],x=["add","asc","collation","desc","final","first","last","view"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],b=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],y=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],_=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],B=b,U=[...g,...x].filter(E=>!b.includes(E)),A={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},T={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},F={match:r.concat(/\b/,r.either(...B),/\s*\(/),relevance:0,keywords:{built_in:B}};function Y(E){return r.concat(/\b/,r.either(...E.map(G=>G.replace(/\s+/,"\\s+"))),/\b/)}const ae={scope:"keyword",match:Y(_),relevance:0};function V(E,{exceptions:G,when:C}={}){const K=C;return G=G||[],E.map(te=>te.match(/\|\d+$/)||G.includes(te)?te:K(te)?`${te}|0`:te)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:V(U,{when:E=>E.length<3}),literal:f,type:h,built_in:y},contains:[{scope:"type",match:Y(p)},ae,F,A,o,d,s.C_NUMBER_MODE,s.C_BLOCK_COMMENT_MODE,u,T]}}const Or="[A-Za-z$_][0-9A-Za-z$_]*",Vh=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Kh=["true","false","null","undefined","NaN","Infinity"],Zh=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Qh=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Fh=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Jh=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Wh=[].concat(Fh,Zh,Qh);function rv(s){const r=s.regex,u=(ee,{after:oe})=>{const me="</"+ee[0].slice(1);return ee.input.indexOf(me,oe)!==-1},o=Or,d={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,p={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ee,oe)=>{const me=ee[0].length+ee.index,j=ee.input[me];if(j==="<"||j===","){oe.ignoreMatch();return}j===">"&&(u(ee,{after:me})||oe.ignoreMatch());let H;const le=ee.input.substring(me);if(H=le.match(/^\s*=/)){oe.ignoreMatch();return}if((H=le.match(/^\s+extends\s+/))&&H.index===0){oe.ignoreMatch();return}}},h={$pattern:Or,keyword:Vh,literal:Kh,built_in:Wh,"variable.language":Jh},x="[0-9](_?[0-9])*",g=`\\.(${x})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${x})\\b`},{begin:`\\b(${b})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},_={className:"subst",begin:"\\$\\{",end:"\\}",keywords:h,contains:[]},B={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,_],subLanguage:"xml"}},U={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,_],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,_],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[s.BACKSLASH_ESCAPE,_]},Y={className:"comment",variants:[s.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),s.C_BLOCK_COMMENT_MODE,s.C_LINE_COMMENT_MODE]},ae=[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,B,U,A,T,{match:/\$\d+/},y];_.contains=ae.concat({begin:/\{/,end:/\}/,keywords:h,contains:["self"].concat(ae)});const V=[].concat(Y,_.contains),E=V.concat([{begin:/(\s*)\(/,end:/\)/,keywords:h,contains:["self"].concat(V)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:E},C={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,r.concat(o,"(",r.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Zh,...Qh]}},te={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},he={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ne(ee){return r.concat("(?!",ee.join("|"),")")}const ue={match:r.concat(/\b/,ne([...Fh,"super","import"].map(ee=>`${ee}\\s*\\(`)),o,r.lookahead(/\s*\(/)),className:"title.function",relevance:0},ye={begin:r.concat(/\./,r.lookahead(r.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},O={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+s.UNDERSCORE_IDENT_RE+")\\s*=>",I={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:h,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[s.SHEBANG({label:"shebang",binary:"node",relevance:5}),te,s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,B,U,A,T,Y,{match:/\$\d+/},y,K,{scope:"attr",match:o+r.lookahead(":"),relevance:0},I,{begin:"("+s.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[Y,s.REGEXP_MODE,{className:"function",begin:M,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:s.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:d.begin,end:d.end},{match:f},{begin:p.begin,"on:begin":p.isTrulyOpeningTag,end:p.end}],subLanguage:"xml",contains:[{begin:p.begin,end:p.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+s.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,s.inherit(s.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},ye,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},ue,he,C,O,{match:/\$[(.]/}]}}function cv(s){const r=s.regex,u=rv(s),o=Or,d=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,s.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},p={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:d},contains:[u.exports.CLASS_REFERENCE]},h={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},x=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:Or,keyword:Vh.concat(x),literal:Kh,built_in:Wh.concat(d),"variable.language":Jh},b={className:"meta",begin:"@"+o},y=(A,T,F)=>{const Y=A.contains.findIndex(ae=>ae.label===T);if(Y===-1)throw new Error("can not find mode to replace");A.contains.splice(Y,1,F)};Object.assign(u.keywords,g),u.exports.PARAMS_CONTAINS.push(b);const _=u.contains.find(A=>A.scope==="attr"),B=Object.assign({},_,{match:r.concat(o,r.lookahead(/\s*\?:/))});u.exports.PARAMS_CONTAINS.push([u.exports.CLASS_REFERENCE,_,B]),u.contains=u.contains.concat([b,f,p,B]),y(u,"shebang",s.SHEBANG()),y(u,"use_strict",h);const U=u.contains.find(A=>A.label==="func.def");return U.relevance=0,Object.assign(u,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),u}function ov(s){const r=s.regex,u=r.concat(/[\p{L}_]/u,r.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),o=/[\p{L}0-9._:-]+/u,d={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},f={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},p=s.inherit(f,{begin:/\(/,end:/\)/}),h=s.inherit(s.APOS_STRING_MODE,{className:"string"}),x=s.inherit(s.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:o,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[d]},{begin:/'/,end:/'/,contains:[d]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[f,x,h,p,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[f,p,x,h]}]}]},s.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},d,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[x]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:r.concat(/</,r.lookahead(r.concat(u,r.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:u,relevance:0,starts:g}]},{className:"tag",begin:r.concat(/<\//,r.lookahead(r.concat(u,/>/))),contains:[{className:"name",begin:u,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function uv(s){const r="true false yes no null",u="[\\w#;/?:@&=+$,.~*'()[\\]]+",o={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},d={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},f={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},p={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[s.BACKSLASH_ESCAPE,d]},h=s.inherit(p,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),_={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},B={end:",",endsWithParent:!0,excludeEnd:!0,keywords:r,relevance:0},U={begin:/\{/,end:/\}/,contains:[B],illegal:"\\n",relevance:0},A={begin:"\\[",end:"\\]",contains:[B],illegal:"\\n",relevance:0},T=[o,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+u},{className:"type",begin:"!<"+u+">"},{className:"type",begin:"!"+u},{className:"type",begin:"!!"+u},{className:"meta",begin:"&"+s.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+s.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},s.HASH_COMMENT_MODE,{beginKeywords:r,keywords:{literal:r}},_,{className:"number",begin:s.C_NUMBER_RE+"\\b",relevance:0},U,A,f,p],F=[...T];return F.pop(),F.push(h),B.contains=F,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:T}}mn.registerLanguage("typescript",cv);mn.registerLanguage("javascript",av);mn.registerLanguage("json",lv);mn.registerLanguage("bash",qg);mn.registerLanguage("diff",Jg);mn.registerLanguage("css",Fg);mn.registerLanguage("xml",ov);mn.registerLanguage("python",sv);mn.registerLanguage("go",Wg);mn.registerLanguage("yaml",uv);mn.registerLanguage("sql",iv);const dv={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",sh:"bash",shell:"bash",html:"xml",yml:"yaml"};function gh(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Ph(s){if(!s)return"";const r=s.toLowerCase().replace(/[^a-z0-9+-]/g,"");return dv[r]??r}function fv(s,r){const u=Ph(r);if(u&&mn.getLanguage(u))try{return mn.highlight(s,{language:u,ignoreIllegals:!0}).value}catch{return gh(s)}return gh(s)}function mv(s){let r=s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");r=r.replace(/```(\w*)[^\n]*\n([\s\S]*?)^```/gm,(f,p,h)=>`<pre class="md-code-block"><code>${h.trimEnd()}</code></pre>`),r=r.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),r=r.replace(/\*\*([^*\n]+)\*\*/g,"<strong>$1</strong>"),r=r.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const u=r.split(`
52
+ `),o=[];let d=!1;for(let f=0;f<u.length;f++){const p=u[f],h=p.match(/^###\s+(.+)$/),x=p.match(/^##\s+(.+)$/),g=p.match(/^#\s+(.+)$/);if(h){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${h[1]}</h3>`);continue}if(x){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${x[1]}</h2>`);continue}if(g){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${g[1]}</h1>`);continue}const b=p.match(/^(\s*)[*-]\s+(.+)$/);if(b){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${b[2]}</li>`);continue}if(p.trim()===""){d&&(o.push("</ul>"),d=!1),o.push("");continue}d&&(o.push("</ul>"),d=!1),o.push(p)}return d&&o.push("</ul>"),o.join(`
53
+ `)}const li="\0",hv=new RegExp(li,"g"),pv=new RegExp(`${li}HLJS(\\d+)${li}`,"g");function ii(s){const r=[];let u=s.replace(hv,"");u=u.replace(/```(\w*)[^\n]*\n([\s\S]*?)^```/gm,(h,x,g)=>{const b=r.length;return r.push({lang:x,body:g}),`${li}HLJS${b}${li}`});let o=u.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");o=o.replace(/^\[(FINDING|SUGGESTION|INSIGHT)\]\s*/i,""),o=o.replace(/&lt;agent_finding[^&]*&gt;/g,""),o=o.replace(/&lt;\/agent_finding&gt;/g,""),o=o.replace(/&lt;cite\s+tag=&quot;file&quot;&gt;([^&]+)&lt;\/cite&gt;/g,'<code class="cite-file">$1</code>'),o=o.replace(/&lt;cite\s+tag=&quot;fn&quot;&gt;([^&]+)&lt;\/cite&gt;/g,'<code class="cite-fn">$1</code>'),o=o.replace(/&lt;fn&gt;([^&]+)&lt;\/fn&gt;/g,'<code class="cite-fn">$1</code>'),o=o.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),o=o.replace(/\*\*([^*\n]+)\*\*/g,'<strong class="font-semibold text-foreground">$1</strong>'),o=o.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const d=o.split(`
54
+ `),f=[];let p=!1;for(const h of d){const x=h.match(/^###\s+(.+)$/),g=h.match(/^##\s+(.+)$/),b=h.match(/^#\s+(.+)$/);if(x){p&&(f.push("</ul>"),p=!1),f.push(`<h3 class="md-h3">${x[1]}</h3>`);continue}if(g){p&&(f.push("</ul>"),p=!1),f.push(`<h2 class="md-h2">${g[1]}</h2>`);continue}if(b){p&&(f.push("</ul>"),p=!1),f.push(`<h1 class="md-h1">${b[1]}</h1>`);continue}const y=h.match(/^(\s*)[*-]\s+(.+)$/);if(y){p||(f.push('<ul class="md-list">'),p=!0),f.push(`<li>${y[2]}</li>`);continue}if(h.trim()===""){p&&(f.push("</ul>"),p=!1),f.push("");continue}p&&(f.push("</ul>"),p=!1),f.push(h)}return p&&f.push("</ul>"),o=f.join(`
55
+ `),o=o.replace(pv,(h,x)=>{const g=r[Number(x)];if(!g)return"";const b=Ph(g.lang),y=b?` language-${b}`:"",_=fv(g.body.replace(/\n$/,""),g.lang);return`<pre class="md-code-block"><code class="hljs${y}">${_}</code></pre>`}),o}function wt(s){const r=Date.now(),u=typeof s=="string"?new Date(s).getTime():s,o=Math.max(0,Math.floor((r-u)/1e3));return o<60?"just now":o<3600?Math.floor(o/60)+"m ago":o<86400?Math.floor(o/3600)+"h ago":Math.floor(o/86400)+"d ago"}function xv(s){if(!s)return"—";const r=Math.round(s/1e3);return r<60?r+"s":Math.floor(r/60)+"m "+r%60+"s"}function uu(s){const r=s.split("-").filter(Boolean);return r.length>=2?(r[0][0]+r[1][0]).toUpperCase():(r[0]||s).slice(0,2).toUpperCase()}const vh=["#3F8B86","#8C5E97","#B47A2A","#2F7D5B","#A53A4A","#6B6862","#C8A45A"],bh={"sonnet-reviewer":"#8C5E97","sonnet-designer":"#C8A45A","sonnet-implementer":"#A53A4A","opus-implementer":"#C97056","gemini-reviewer":"#3F8B86","gemini-tester":"#2F7D5B","haiku-researcher":"#6B7A85"};function qn(s){if(bh[s])return bh[s];let r=0;for(let u=0;u<s.length;u++)r=r*31+s.charCodeAt(u)>>>0;return vh[r%vh.length]}function ls({title:s,hint:r,compact:u=!1}){return a.jsxs("div",{className:`text-center ${u?"py-3":"py-6"}`,children:[a.jsx("div",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:s}),r&&a.jsx("div",{className:"mt-1 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:r})]})}function gv(s){return s==null||s<=0?"—":s<1e3?`${s}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${(s/6e4).toFixed(1)}m`}function ul({value:s,unit:r,label:u,valueClass:o="",valueColor:d,pulse:f,tooltip:p}){return a.jsxs("div",{className:"flex flex-col items-center py-4 px-3 text-center","data-tooltip":p,children:[a.jsxs("div",{className:"flex items-baseline gap-1",children:[f&&a.jsxs("span",{className:"relative mr-1 inline-flex h-2 w-2",children:[a.jsx("span",{className:"absolute inline-flex h-2 w-2 animate-ping rounded-full bg-unverified/60"}),a.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-unverified"})]}),a.jsx("span",{className:`font-mono text-2xl font-medium leading-none tracking-[-0.025em] ${o}`,style:d?{color:d}:void 0,children:s}),r&&a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--ink-3)"},children:r})]}),a.jsx("div",{className:"h-section mt-1.5",style:{color:"var(--ink-3)",fontSize:"10px"},children:u})]})}function vv({overview:s,activeTasks:r,mode:u="dense",showActivity:o}){const d=s.relayCount+s.nativeCount,f=s.tasksCompleted+s.tasksFailed>0?Math.round(s.tasksCompleted/(s.tasksCompleted+s.tasksFailed)*100):null,p=s.totalFindings>0?Math.round(s.confirmedFindings/s.totalFindings*100):0,h=u==="calm",x=o??!h,g=h&&d===0;return a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3.5 py-3",children:[a.jsx("div",{className:"h-section",children:"System Pulse"}),a.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[10px] text-confirmed",children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-confirmed"}),"LIVE"]})]}),g?a.jsx(ls,{title:"No agents registered yet",hint:"Run `gossip_setup` or see docs/ to get started."}):h?a.jsxs("div",{className:"grid grid-cols-3 border-b border-border",children:[a.jsx("div",{className:"border-r border-border",children:a.jsx(ul,{value:s.agentsOnline,label:"Agents Working",valueColor:s.agentsOnline>0?"var(--ok)":"var(--text)"})}),a.jsx("div",{className:"border-r border-border",children:a.jsx(ul,{value:r,label:"Active Tasks",valueClass:r>0?"text-unverified":"",valueColor:r>0?void 0:"var(--ink-3)",pulse:r>0})}),a.jsx(ul,{value:`${p}%`,label:"Confirmed",valueClass:p>=50?"text-confirmed":p>0?"text-unverified":"",valueColor:p===0?"var(--ink-3)":void 0})]}):a.jsxs("div",{className:"border-b border-border",children:[a.jsxs("div",{className:"relative grid grid-cols-2",children:[a.jsx("span",{className:"pointer-events-none absolute left-0 right-0 top-1/2 h-px bg-border"}),a.jsx("span",{className:"pointer-events-none absolute bottom-0 left-1/2 top-0 w-px bg-border"}),a.jsxs("div",{className:"flex flex-col items-stretch justify-center gap-1.5 px-4 py-3",children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"h-section",style:{color:"var(--ink-3)",fontSize:"10px"},"data-tooltip":"Agents currently executing a task",children:"Dispatched"}),a.jsx("span",{className:"font-mono text-base font-bold leading-none",style:{color:s.agentsOnline>0?"var(--ok)":"var(--text)"},children:s.agentsOnline})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"h-section",style:{color:"var(--ink-3)",fontSize:"10px"},"data-tooltip":"Relay agents with an active WebSocket connection",children:"Connected"}),a.jsx("span",{className:`font-mono text-base font-bold leading-none ${s.relayConnected>0?"text-confirmed":""}`,style:s.relayConnected>0?void 0:{color:"var(--ink-3)"},children:s.relayConnected})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"h-section",style:{color:"var(--ink-3)",fontSize:"10px"},"data-tooltip":"Total agents in gossipcat config",children:"Registered"}),a.jsx("span",{className:"font-mono text-base font-bold leading-none",style:{color:"var(--ink-3)"},children:d})]})]}),a.jsx(ul,{value:r,label:"Active Tasks",valueClass:r>0?"text-unverified":"",valueColor:r>0?void 0:"var(--ink-3)",pulse:r>0}),a.jsx(ul,{value:s.consensusRuns,label:"Consensus",valueColor:"var(--text)"}),a.jsx(ul,{value:`${p}%`,label:"Confirmed",valueClass:"text-confirmed"})]}),a.jsx("a",{href:ua("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"block cursor-pointer border-t border-border transition-colors hover:bg-accent/10","aria-label":"View actionable findings on Signals page",children:a.jsx(ul,{value:s.actionableFindings,label:"Actionable",valueClass:s.actionableFindings>0?"text-unverified":"",tooltip:"Findings still open and need operator review (disagreements + hallucinations + new findings)"})})]}),!h&&a.jsxs("div",{className:"px-3.5 py-3",children:[a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"tasks completed"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:s.tasksCompleted})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"signals total"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:s.totalSignals})]}),s.tasksFailed>0&&a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"tasks failed"}),a.jsx("span",{className:"font-semibold text-bad tabular-nums",children:s.tasksFailed})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"avg duration"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:gv(s.avgDurationMs)})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"success rate"}),a.jsx("span",{className:`font-semibold tabular-nums ${f!==null&&f>=95?"text-confirmed":f!==null&&f>=80?"text-unverified":f!==null?"text-bad":""}`,style:f===null?{color:"var(--ink-3)"}:void 0,children:f===null?"—":`${f}%`})]})]}),x&&a.jsx(bv,{hourly:s.hourlyActivity||[]}),s.lastConsensusTimestamp&&a.jsxs("div",{className:"border-t border-border px-3.5 py-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--ink-3) 60%, transparent)"},children:["last consensus ",wt(s.lastConsensusTimestamp)]})]})}function bv({hourly:s}){const r=s.length===12?s:new Array(12).fill(0),u=Math.max(1,...r);return a.jsxs("div",{className:"border-t border-border px-3.5 py-3",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:[a.jsx("div",{className:"h-section mb-2",style:{color:"color-mix(in oklch, var(--ink-3) 60%, transparent)",fontSize:"11px"},children:"Activity Last 12h"}),a.jsx("div",{className:"flex h-6 items-end gap-0.5",children:r.map((o,d)=>{const f=11-d,p=o/u*100,h=d===11,x=f===0?"last hour":`${f}h ago`;return a.jsx("div",{className:`relative flex-1 cursor-pointer rounded-sm transition-opacity hover:opacity-100 ${o===0?"opacity-0":h?"bg-chart opacity-90":"bg-chart opacity-40"}`,style:{height:o===0?"0%":`${Math.max(8,p)}%`},"data-tooltip":`${x}
56
+ ${o} task${o===1?"":"s"}`,"data-tooltip-pos":"bottom"},d)})}),a.jsxs("div",{className:"mt-1 flex justify-between font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--ink-3) 40%, transparent)"},children:[a.jsx("span",{children:"12h ago"}),a.jsx("span",{children:"now"})]})]})}const Gn=24;function yv(s,r){const u=new Map;for(const o of r)u.set(o.id,new Array(Gn).fill(0));for(const o of(s==null?void 0:s.agents)??[]){const d=u.get(o.id);if(!d)continue;const f=o.buckets??[];for(let p=0;p<Gn;p++)d[p]=f[p]??0}return u}function Nv(s,r){if(r<=0||s<=0)return 0;const u=s/r;return u<.18?1:u<.4?2:u<.68?3:4}const jv={0:.18,1:.35,2:.55,3:.78,4:1};function Sv({agents:s,activity:r,loading:u=!1,error:o=null}){const d=S.useMemo(()=>yv(r,s),[r,s]),f=S.useMemo(()=>{const h=new Map;for(const[x,g]of d)h.set(x,g.reduce((b,y)=>b+y,0));return h},[d]),p=S.useMemo(()=>{let h=0;for(const x of f.values())h+=x;return h},[f]);if(u&&s.length===0)return a.jsx(kr,{error:null,fleetTotal:null,children:Array.from({length:4}).map((h,x)=>a.jsx(_v,{},x))});if(s.length===0)return a.jsx(kr,{error:o,fleetTotal:null,children:a.jsxs("div",{className:"px-5 py-6 font-mono text-xs",style:{color:"var(--ink-3)"},children:["No agents registered yet — run ",a.jsx("code",{className:"rounded bg-[var(--surface-sunk)] px-1.5 py-0.5",children:"gossip_setup"})," to spin up the fleet."]})});if(p===0){const h=r==null?"Activity data unavailable — relay may be disconnected. Showing idle rows from the agent registry.":"No active dispatches — fleet idle.";return a.jsxs(kr,{error:o,fleetTotal:0,children:[s.map(x=>a.jsx(kv,{agent:x},x.id)),a.jsx("div",{className:"px-5 py-3 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:h})]})}return a.jsx(kr,{error:o,fleetTotal:p,children:s.map(h=>{const x=d.get(h.id)??new Array(Gn).fill(0),g=Math.max(0,...x),b=f.get(h.id)??0,y=p>0?Math.round(b/p*100):0,_=qn(h.id);return a.jsxs("div",{className:"grid items-center gap-3 border-b border-border px-5 py-2 last:border-b-0",style:{gridTemplateColumns:"160px 1fr 110px"},children:[a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[12px]",style:{color:"var(--ink)"},children:[a.jsx("span",{className:"inline-block h-2 w-2 flex-shrink-0 rounded-full",style:{background:_}}),a.jsx("span",{className:"truncate",children:h.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${Gn}, 1fr)`},role:"img","aria-label":`${h.id} 24h activity — ${b} signals`,children:x.map((B,U)=>{const A=Nv(B,g);return a.jsx("div",{className:"rounded-sm",title:`hour ${U}: ${B} signal${B===1?"":"s"}`,style:{background:A===0?"var(--surface-sunk)":_,opacity:jv[A]}},U)})}),a.jsxs("div",{className:"text-right font-mono text-[12px] tabular-nums",style:{color:"var(--ink)"},children:[b,a.jsxs("span",{className:"ml-1.5 text-[11px]",style:{color:"var(--ink-3)"},children:[y,"%"]})]})]},h.id)})})}function kr({children:s,error:r,fleetTotal:u}){return a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[a.jsxs("div",{className:"grid items-end gap-3 border-b border-border px-5 py-3",style:{gridTemplateColumns:"160px 1fr 110px"},children:[a.jsx("div",{className:"h-section",children:"Agent · 24h activity"}),a.jsx("div",{className:"grid font-mono text-[9px]",style:{gridTemplateColumns:`repeat(${Gn}, 1fr)`,color:"var(--ink-3)"},children:Array.from({length:Gn}).map((o,d)=>a.jsx("span",{className:"text-center",children:d%2===0?String(d).padStart(2,"0"):""},d))}),a.jsx("div",{className:"flex items-center justify-end gap-2",children:r?a.jsx("span",{className:"rounded-sm border px-2 py-0.5 font-mono text-[10px]",style:{borderColor:"var(--danger)",background:"color-mix(in oklch, var(--danger) 12%, transparent)",color:"var(--danger)"},children:r}):u!==null?a.jsxs("div",{className:"h-section",style:{color:"var(--ink-3)"},children:["Signals · 24h ",a.jsx("span",{className:"ml-1.5 tabular-nums",style:{color:"var(--ink)"},children:u})]}):null})]}),s]})}function _v(){return a.jsxs("div",{className:"grid items-center gap-3 border-b border-border px-5 py-2 last:border-b-0",style:{gridTemplateColumns:"160px 1fr 110px"},children:[a.jsx("div",{className:"h-3 w-32 rounded",style:{background:"var(--border)",opacity:.4}}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${Gn}, 1fr)`},children:Array.from({length:Gn}).map((s,r)=>a.jsx("div",{className:"rounded-sm",style:{background:"var(--border)",opacity:.4}},r))}),a.jsx("div",{className:"ml-auto h-3 w-12 rounded",style:{background:"var(--border)",opacity:.4}})]})}function kv({agent:s}){const r=qn(s.id);return a.jsxs("div",{className:"grid items-center gap-3 border-b border-border px-5 py-2 last:border-b-0",style:{gridTemplateColumns:"160px 1fr 110px"},children:[a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[12px]",style:{color:"var(--ink-3)"},children:[a.jsx("span",{className:"inline-block h-2 w-2 flex-shrink-0 rounded-full",style:{background:r,opacity:.5}}),a.jsx("span",{className:"truncate",children:s.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${Gn}, 1fr)`},children:Array.from({length:Gn}).map((u,o)=>a.jsx("div",{className:"rounded-sm",style:{background:"var(--surface-sunk)",opacity:.4}},o))}),a.jsx("div",{className:"text-right font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"—"})]})}const Nu="/dashboard/api",ep="unauthorized";function Ev(s){return s instanceof Error&&s.message.includes(ep)}const Dr=3e4;function tp(s){return`timeout after ${s/1e3}s`}function ju(s){if(typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function")return{signal:AbortSignal.timeout(s),cleanup:()=>{}};const r=new AbortController,u=setTimeout(()=>r.abort(new Error(tp(s))),s);return{signal:r.signal,cleanup:()=>clearTimeout(u)}}async function ut(s,r){const{signal:u,cleanup:o}=ju(Dr);try{const d=await fetch(`${Nu}/${s}`,{credentials:"include",...r,signal:u});if(d.status===401)throw new Error(ep);if(!d.ok)throw new Error(`API error: ${d.status}`);return d.json()}catch(d){throw d instanceof Error&&(d.name==="AbortError"||d.name==="TimeoutError")?new Error(tp(Dr)):d}finally{o()}}async function wv(s){const{signal:r,cleanup:u}=ju(Dr);try{const o=await fetch(`${Nu}/auth`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:s}),signal:r});return o.ok?await du()?{ok:!0}:{ok:!1,kind:"no_cookie"}:o.status===401||o.status===403?{ok:!1,kind:"bad_key"}:{ok:!1,kind:"network"}}catch{return{ok:!1,kind:"network"}}finally{u()}}async function du(){const{signal:s,cleanup:r}=ju(Dr);try{return(await fetch(`${Nu}/auth/check`,{credentials:"include",signal:s})).ok}catch{return!1}finally{r()}}const Tv=7200*1e3;function Av(s){const r=Date.now()-new Date(s).getTime();return r<0?"0s":r<6e4?`${Math.floor(r/1e3)}s`:r<36e5?`${Math.floor(r/6e4)}m ${Math.floor(r%6e4/1e3)}s`:`${Math.floor(r/36e5)}h ${Math.floor(r%36e5/6e4)}m`}function Mv({onCountChange:s}){const[r,u]=S.useState([]),[,o]=S.useState(0);S.useEffect(()=>{let h=!1;const x=async()=>{var b;try{const y=await ut("active-tasks");h||(u(y.tasks||[]),s==null||s(((b=y.tasks)==null?void 0:b.length)||0))}catch{}};x();const g=setInterval(x,5e3);return()=>{h=!0,clearInterval(g)}},[s]),S.useEffect(()=>{if(r.length===0)return;const h=setInterval(()=>o(x=>x+1),1e3);return()=>clearInterval(h)},[r.length]);const d=Date.now(),f=r.filter(h=>d-new Date(h.startedAt).getTime()<Tv),p=r.length-f.length;return f.length===0?p===0?null:a.jsx("div",{className:"rounded-lg border border-border px-4 py-2.5",style:{background:"color-mix(in oklch, var(--surface-elev) 60%, transparent)"},children:a.jsxs("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:[p," stale task",p===1?"":"s"," — likely orphaned (>2h since last update)"]})}):a.jsxs("div",{className:"rounded-lg border border-border px-4 py-2.5",style:{background:"color-mix(in oklch, var(--surface-elev) 60%, transparent)"},children:[a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-confirmed"}),a.jsx("span",{className:"h-section",children:"Live"}),a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--text-dim)"},children:[f.length," active"]}),p>0&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:["· ",p," stale"]})]}),a.jsx("div",{className:"max-h-40 space-y-1 overflow-y-auto",children:f.map(h=>a.jsxs("div",{className:"grid items-center gap-3",style:{gridTemplateColumns:"minmax(120px, auto) 1fr auto"},children:[a.jsx("span",{className:"font-mono text-[11px] font-semibold truncate",style:{color:"var(--text)"},children:h.agentId}),a.jsx("span",{className:"min-w-0 truncate text-[11px]",style:{color:"var(--text-dim)"},children:h.task}),a.jsx("span",{className:"font-mono text-[11px] whitespace-nowrap tabular-nums",style:{color:"var(--text-dim)"},children:Av(h.startedAt)})]},h.taskId))})]})}function Cv(s,r,u,o){const d=Math.max(0,Math.min(.9999,o)),f=-Math.PI/2,p=f+d*2*Math.PI,h=s+u*Math.cos(f),x=r+u*Math.sin(f),g=s+u*Math.cos(p),b=r+u*Math.sin(p),y=d>.5?1:0;return`M ${h.toFixed(2)} ${x.toFixed(2)} A ${u} ${u} 0 ${y} 1 ${g.toFixed(2)} ${b.toFixed(2)}`}function Rv(s,r,u){return`M ${s} ${r-u} A ${u} ${u} 0 1 1 ${s} ${r+u} A ${u} ${u} 0 1 1 ${s} ${r-u}`}function Ov({accuracy:s,size:r=90,color:u="var(--ink)"}){const o=Number.isFinite(s)?Math.max(0,Math.min(1,s)):0,d=r/2,f=r/2,p=r*.089,h=(r-p)/2-2,x=Math.round(o*100),g=Math.round(r*.22);return a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[a.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":`Accuracy ${x}%`,children:[a.jsx("path",{d:Rv(d,f,h),fill:"none",stroke:"var(--ink)",strokeOpacity:.08,strokeWidth:p,strokeLinecap:"round"}),o>0&&a.jsx("path",{d:Cv(d,f,h,o),fill:"none",stroke:u,strokeWidth:p,strokeLinecap:"round"}),a.jsxs("text",{x:d,y:f,textAnchor:"middle",dominantBaseline:"middle",dy:"0.08em",fill:"var(--ink)",style:{fontSize:g,fontFamily:"'Fraunces', serif",fontVariantNumeric:"tabular-nums",fontWeight:700},children:[x,"%"]})]}),a.jsx("span",{style:{fontSize:10,color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},children:"accuracy"})]})}const yh={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--idle)"},Nh=["critical","high","medium","low"];function Dv({counts:s,height:r=10}){const u=s??{critical:0,high:0,medium:0,low:0},o=u.critical+u.high+u.medium+u.low,d=`critical: ${u.critical}, high: ${u.high}, medium: ${u.medium}, low: ${u.low}`;return o===0?a.jsx("div",{role:"img","aria-label":`Severity distribution: no findings yet (${d})`,title:`${d} (no findings yet)`,style:{display:"flex",height:r,borderRadius:r/2,overflow:"hidden",gap:2,border:"1px solid color-mix(in oklch, var(--border) 60%, transparent)",width:"100%"},children:Nh.map(f=>a.jsx("div",{style:{flex:1,background:yh[f],opacity:.4}},f))}):a.jsx("div",{role:"img","aria-label":`Severity distribution — ${d}`,title:d,style:{display:"flex",height:r,borderRadius:r/2,overflow:"hidden",width:"100%"},children:Nh.map(f=>{const p=u[f];if(p===0)return null;const h=p/o*100;return a.jsx("div",{style:{width:`${h.toFixed(2)}%`,background:yh[f],flexShrink:0}},f)})})}function zv(s){return s.map(r=>r.signals)}function Lv(s,r,u){if(s.length===0)return{line:`M 0 ${u} L ${r} ${u}`,area:""};if(s.length===1){const x=u/2;return{line:`M 0 ${x} L ${r} ${x}`,area:`M 0 ${u} L 0 ${x} L ${r} ${x} L ${r} ${u} Z`}}const o=Math.max(...s,1),d=r/(s.length-1),f=s.map((x,g)=>{const b=(g*d).toFixed(2),y=(u-x/o*u).toFixed(2);return`${b},${y}`}),p=`M ${f.join(" L ")}`,h=`M 0,${u} L ${f.join(" L ")} L ${((s.length-1)*d).toFixed(2)},${u} Z`;return{line:p,area:h}}const Uv=5,fu=999;function Bv(s){if(s.length<2)return null;const r=Math.floor(s.length/2),u=s.slice(0,r),o=s.slice(s.length-r),d=b=>b.reduce((y,_)=>y+_.signals,0),f=d(u),p=d(o);if(f<Uv)return null;const h=f/u.length,x=p/o.length,g=Math.round((x-h)/h*100);return Math.max(-fu,Math.min(fu,g))}function np({points:s,width:r=80,height:u=20,reducedMotion:o=!1,color:d="var(--c1)"}){const f=S.useMemo(()=>zv(s),[s]),{line:p,area:h}=S.useMemo(()=>Lv(f,r,u),[f,r,u]),x=S.useMemo(()=>Bv(s),[s]),g=f.length===0||f.every(b=>b===0);return a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[a.jsxs("svg",{width:"100%",height:u,viewBox:`0 0 ${r} ${u}`,preserveAspectRatio:"none","aria-hidden":"true",style:{overflow:"visible",flex:1,minWidth:0},children:[!o&&!g&&h&&a.jsx("path",{d:h,fill:d,fillOpacity:.3}),a.jsx("path",{d:p,fill:"none",stroke:g?"var(--idle)":d,strokeOpacity:g?.3:1,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),x!==null&&!g&&a.jsxs("span",{title:"7d dispatch volume change — neutral indicator, not a quality metric",style:{fontSize:10,fontFamily:"Geist, Inter, sans-serif",fontVariantNumeric:"tabular-nums",fontWeight:600,color:"var(--ink-3)",flexShrink:0},children:[x>=0?"+":"",x,"%",Math.abs(x)>=fu?"+":""]})]})}function Su(s){var r,u;return((r=s.bench)==null?void 0:r.state)==="benched"?"benched":s.circuitOpen?"struggling":((u=s.bench)==null?void 0:u.state)==="kept-for-coverage"?"kept-for-coverage":null}function Hv(s){var r;return((r=s.scores.bench)==null?void 0:r.state)==="benched"||s.scores.circuitOpen}function mu(s){return`${Math.round(s*100)}%`}function $v(s){var r,u,o;return s.accuracy>=.7&&((r=s.bench)==null?void 0:r.state)==="none"?{label:"healthy",dotColor:"var(--ok)",tooltip:`Accuracy ${Math.round(s.accuracy*100)}% — above 70% baseline.`}:{label:"needs skills",dotColor:"var(--warn)",tooltip:((u=s.bench)==null?void 0:u.state)!=="none"?`Benched (${((o=s.bench)==null?void 0:o.reason)??"auto"})`:`Accuracy ${Math.round(s.accuracy*100)}% — below 70% baseline.`}}function jh({label:s,value:r,color:u,tooltip:o}){const d=Number.isFinite(r)?Math.max(0,Math.min(1,r)):0;return a.jsxs("div",{className:"grid items-center gap-2",style:{gridTemplateColumns:"56px 1fr 32px"},children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":o,children:s}),a.jsx("div",{className:"h-2 overflow-hidden rounded-full",style:{background:"color-mix(in oklch, var(--ink) 8%, transparent)"},children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.round(d*100)}%`,background:u}})}),a.jsx("span",{className:"text-right tabular-nums",style:{fontFamily:"Geist, Inter, sans-serif",fontSize:11,color:"var(--ink-2)"},children:mu(d)})]})}function qv({agent:s,severityCounts:r,trendPoints:u}){var h;const o=s.scores,d=(h=s.lastTask)!=null&&h.timestamp?wt(s.lastTask.timestamp):"",f=qn(s.id),p=$v(o);return a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(s.id)}`,className:"group relative block rounded-lg border border-border p-3 transition-all hover:-translate-y-0.5 hover:border-[color-mix(in_oklch,var(--ink)_30%,transparent)]",style:{background:"var(--surface-elev)"},children:[a.jsx("div",{style:{position:"absolute",top:10,right:12,zIndex:1},children:a.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-sm border border-border/60 px-2 py-0.5",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)",color:"var(--ink-2)",fontFamily:"Geist, Inter, sans-serif",fontSize:11,fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":p.tooltip,"data-tooltip-pos":"bottom",children:[a.jsx("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:"50%",background:p.dotColor,flexShrink:0}}),p.label]})}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"100px 1fr",gap:12,alignItems:"stretch"},children:[a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:8,paddingBottom:2},children:[a.jsx(Ov,{accuracy:o.accuracy,size:90,color:f}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,width:"100%"},children:[a.jsx(Dv,{counts:r}),a.jsx("span",{style:{fontSize:10,color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},children:"severity mix"})]})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[a.jsx("div",{style:{display:"flex",alignItems:"center",gap:8},children:a.jsx("div",{style:{minWidth:0,flex:1},children:a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,flexWrap:"wrap"},children:[a.jsx("span",{className:"truncate",style:{fontFamily:"Geist, Inter, sans-serif",fontSize:14,fontWeight:600,color:"var(--ink)",minWidth:0,flex:1},children:s.id}),(()=>{const x=Su(o);return x==="benched"?a.jsx("span",{className:"shrink-0 rounded-sm bg-bad/10 px-1 py-0.5 font-mono text-[8px] font-bold text-bad","aria-label":`Benched (${o.bench.reason??"auto"}). Excluded from dispatch until recovery.`,"data-tooltip":`Benched (${o.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"BENCHED"}):x==="struggling"?a.jsx("span",{className:"shrink-0 rounded-sm bg-unverified/10 px-1 py-0.5 font-mono text-[8px] font-bold text-unverified","aria-label":"Struggling: consecutive failures tripped the circuit breaker.","data-tooltip":"Struggling: consecutive failures tripped the circuit breaker.",children:"STRUGGLING"}):x==="kept-for-coverage"?a.jsx("span",{className:"shrink-0 rounded-sm border border-unverified/40 bg-unverified/10 px-1 py-0.5 font-mono text-[8px] font-bold text-unverified","aria-label":`Would bench (${o.bench.reason??"rule"}), but kept as sole provider of a category.`,"data-tooltip":`Would bench (${o.bench.reason??"rule"}), but kept as sole provider of a category.`,children:"KEPT"}):null})()]})})}),a.jsxs("div",{className:"rounded-md border border-border/30 px-2 py-2 space-y-1.5",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)"},children:[a.jsx(jh,{label:"unique",value:o.uniqueness,color:f,tooltip:`Uniqueness ${mu(o.uniqueness)}
57
+ Findings others missed.`}),a.jsx(jh,{label:"impact",value:o.impactScore,color:f,tooltip:`Impact ${mu(o.impactScore)}
58
+ Severity-weighted findings.`})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[u&&u.length>0&&a.jsx("div",{style:{width:"100%"},children:a.jsx(np,{points:u,width:240,height:28,color:f})}),a.jsxs("div",{style:{fontFamily:"Geist, Inter, sans-serif",fontSize:11,color:"var(--ink-3)",display:"flex",alignItems:"center",gap:4},children:[a.jsxs("span",{className:"tabular-nums",children:[o.signals," signals"]}),d&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{children:d})]})]})]})]})]})]})}function Gv({agents:s,highlightedAgentId:r,severityMap:u,trendByAgent:o}){const d=[...s].sort((h,x)=>{var B,U,A,T;const g=((B=h.lastTask)==null?void 0:B.timestamp)??"",b=((U=x.lastTask)==null?void 0:U.timestamp)??"";if(g!==b)return b.localeCompare(g);const y=((A=h.scores)==null?void 0:A.signals)||0,_=((T=x.scores)==null?void 0:T.signals)||0;return y!==_?_-y:h.id.localeCompare(x.id)}),f=d.slice(0,4),p=d.length>4;return a.jsxs("section",{children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Team ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:s.length})]}),p&&a.jsx("a",{href:"/dashboard/team",className:"text-xs transition hover:[color:var(--accent)]",style:{color:"var(--text-dim)"},children:"view all"})]}),a.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:f.map(h=>{const x=h.id===r;return a.jsx("div",{style:{borderRadius:"0.5rem",outline:x?"2px solid var(--border-strong)":void 0,transition:"outline-color 200ms cubic-bezier(0.4,0,0.2,1)"},children:a.jsx(qv,{agent:h,severityCounts:u==null?void 0:u.get(h.id),trendPoints:o==null?void 0:o.get(h.id)})},h.id)})})]})}const Iv=8;function Yv(s){const r=s.toLowerCase();return r==="completed"||r==="done"||r==="success"||r==="succeeded"?"completed":r==="running"||r==="active"||r==="in_progress"||r==="pending"?"running":r==="failed"||r==="error"||r==="errored"||r==="timeout"||r==="timed_out"?"failed":r==="cancelled"||r==="canceled"||r==="queued"||r==="waiting"?"cancelled":"unknown"}const Xv={completed:{label:"Done",iconBox:"bg-confirmed/10 border-confirmed/30",text:"text-confirmed",pulse:!1},running:{label:"Running",iconBox:"bg-unverified/10 border-unverified/30",text:"text-unverified",pulse:!0},failed:{label:"Failed",iconBox:"bg-destructive/10 border-destructive/30",text:"text-destructive",pulse:!1},cancelled:{label:"Cancelled",iconBox:"border-muted-foreground/25",text:"",textStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"},pulse:!1},unknown:{label:"Unknown",iconBox:"border-muted-foreground/25",text:"",textStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"},pulse:!1}},Vv={completed:a.jsx("polyline",{points:"5 12 10 17 19 7"}),running:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.45"})]}),failed:a.jsxs(a.Fragment,{children:[a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]}),cancelled:a.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),unknown:a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .9-1 1.7"}),a.jsx("line",{x1:"12",y1:"16.5",x2:"12",y2:"16.5"})]})};function Kv(s){return s.length>8?s.slice(0,8):s}function Zv(s){return s.endsWith("-implementer")?{label:"IMPL",cls:"text-unique"}:s.endsWith("-reviewer")?{label:"REVIEW",cls:"text-chart"}:s.endsWith("-tester")?{label:"TEST",cls:"text-unique"}:s.endsWith("-researcher")?{label:"RESEARCH",cls:"",clsStyle:{color:"var(--text-dim)"}}:s.endsWith("-designer")?{label:"DESIGN",cls:"text-chart"}:null}function Qv({tasks:s,limit:r=Iv}){const u=s.items.slice(0,r),o=s.items.length>r;return a.jsxs("section",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Tasks ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:s.total})]}),o&&a.jsx("a",{href:"/dashboard/tasks",className:"font-mono text-xs transition",style:{color:"var(--text-dim)"},children:"view all"})]}),a.jsx("div",{className:"flex-1 rounded-md border border-border/40",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:u.length===0?a.jsx(ls,{title:"No tasks yet",hint:"Dispatch with gossip_run to populate this view."}):u.map((d,f)=>{const p=Yv(d.status),h=Xv[p],x=Zv(d.agentId);return a.jsxs("div",{className:`flex items-start gap-3 px-3.5 py-2.5 hover:bg-accent/20 transition-colors ${f>0?"border-t border-border/20":""}`,children:[a.jsx("span",{className:`mt-0.5 flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-full border ${h.iconBox} ${h.text} ${h.pulse?"animate-pulse":""}`,style:h.textStyle,"aria-label":`Status: ${h.label}`,"data-tooltip":h.label,children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:Vv[p]})}),a.jsx("span",{className:"mt-0.5 shrink-0 rounded border border-border/40 px-1.5 py-0.5 font-mono text-[10px] font-semibold",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)",color:"var(--text-dim)"},"data-tooltip":d.taskId,children:Kv(d.taskId)}),x&&a.jsx("span",{className:`shrink-0 rounded-sm border border-border/40 px-1 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider ${x.cls}`,style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",...x.clsStyle},"data-tooltip":d.agentId,children:x.label}),a.jsx("span",{className:"min-w-0 flex-1 line-clamp-2 font-inter text-[11px] leading-snug",style:{color:"var(--text)"},children:d.task}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px] font-normal",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:d.agentId}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:wt(d.timestamp)})]},d.taskId)})})]})}function _u({message:s,className:r}){return a.jsxs("span",{role:"alert",className:`inline-flex items-center gap-1 rounded-sm px-2 py-0.5 font-mono text-[10px] ${r??""}`,style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 12%, transparent)",border:"1px solid color-mix(in oklch, var(--bad) 30%, transparent)"},children:[a.jsx("span",{"aria-hidden":!0,style:{fontWeight:700},children:"!"}),a.jsxs("span",{children:["error · ",s]})]})}const Fv={agreement:"confirmed",consensus_verified:"confirmed",unique_confirmed:"unique",unique_unconfirmed:"unique?",disagreement:"disputed",hallucination_caught:"hallucination",new_finding:"new",unverified:"unverified"},Jv={agreement:"var(--ok)",consensus_verified:"var(--ok)",disagreement:"var(--bad)",hallucination_caught:"var(--bad)",unique_confirmed:"var(--unique)",unique_unconfirmed:"var(--warn)",new_finding:"var(--unique)",unverified:"var(--info)"},Wv={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--ink-3)"};function Pv(s,r){return s?s.length>r?s.slice(0,r-1)+"…":s:""}function eb(s){return s.split(/(`[^`]+`)/g).map((u,o)=>u.startsWith("`")&&u.endsWith("`")&&u.length>2?a.jsx("code",{style:{background:"color-mix(in oklch, var(--ink) 6%, transparent)",padding:"0 4px",borderRadius:3,fontFamily:"var(--font-mono)",fontSize:12,color:"var(--ink)"},children:u.slice(1,-1)},o):a.jsx("span",{children:u},o))}function tb(){const[s,r]=S.useState(null),[u,o]=S.useState(null);S.useEffect(()=>{ut("signals?limit=7").then(f=>r(f.items??[])).catch(f=>o(String((f==null?void 0:f.message)??f)))},[]);const d=s?s.filter(f=>Date.now()-Date.parse(f.timestamp)<36e5).length:0;return a.jsxs("section",{children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h3",{className:"h-section",children:"Signal stream"}),a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--info)",visibility:d===0?"hidden":"visible"},children:["+",d," in last hour"]})]}),a.jsx("button",{type:"button",onClick:()=>ns("/signals"),className:"font-mono text-[11px] hover:underline",style:{color:"var(--text-dim)"},children:"all signals →"}),u&&a.jsx(_u,{message:u,className:"ml-2"})]}),a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[!u&&s===null&&a.jsx("div",{"aria-busy":"true",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border",children:[a.jsx("th",{className:"py-2 pl-4 pr-3",style:{width:80},children:a.jsx("div",{className:"h-2 w-8 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("th",{className:"py-2 pr-3",style:{width:160},children:a.jsx("div",{className:"h-2 w-12 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("th",{className:"py-2 pr-3",style:{width:180},children:a.jsx("div",{className:"h-2 w-10 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("th",{className:"py-2 pr-4",children:a.jsx("div",{className:"h-2 w-14 rounded",style:{background:"var(--border)",opacity:.4}})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((f,p)=>a.jsxs("tr",{className:"border-b border-border/40 last:border-b-0",children:[a.jsx("td",{className:"py-2.5 pl-4 pr-3",children:a.jsx("div",{className:"h-2.5 w-10 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{style:{width:3,height:14,background:"var(--border)",opacity:.4,borderRadius:1,flexShrink:0}}),a.jsx("div",{className:"h-2.5 w-14 rounded",style:{background:"var(--border)",opacity:.4}})]})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsx("div",{className:"h-2.5 w-24 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("td",{className:"py-2.5 pr-4",children:a.jsx("div",{className:"h-2.5 rounded",style:{background:"var(--border)",opacity:.4,width:"75%"}})})]},p))})]})}),!u&&s&&s.length===0&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"no signals recorded"}),u&&(!s||s.length===0)&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"no cached signals to display"}),s&&s.length>0&&a.jsxs("table",{className:"w-full",style:u?{opacity:.5}:void 0,children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border",children:[a.jsx("th",{className:"h-section py-2 pl-4 pr-3 text-left",style:{fontSize:10,width:80},children:"time"}),a.jsx("th",{className:"h-section py-2 pr-3 text-left",style:{fontSize:10,width:160},children:"verdict"}),a.jsx("th",{className:"h-section py-2 pr-3 text-left",style:{fontSize:10,width:180},children:"agent"}),a.jsx("th",{className:"h-section py-2 pr-4 text-left",style:{fontSize:10},children:"finding"})]})}),a.jsx("tbody",{children:s.map((f,p)=>{const h=f.severity?Wv[f.severity]:"transparent",x=Jv[f.signal]??"var(--ink-2)",g=Fv[f.signal]??f.signal;return a.jsxs("tr",{className:"border-b border-border/40 last:border-b-0",children:[a.jsx("td",{className:"py-2.5 pl-4 pr-3 align-middle font-mono text-[12px] tabular-nums",style:{color:"var(--text-dim)"},children:wt(f.timestamp)}),a.jsx("td",{className:"py-2.5 pr-3 align-middle",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{role:"img","aria-label":f.severity?`severity: ${f.severity}`:"severity: unspecified",style:{display:"inline-block",width:3,height:14,background:h,borderRadius:1,flexShrink:0},title:f.severity??""}),a.jsx("span",{className:"h-section truncate",style:{color:x,fontSize:11},title:g,children:g})]})}),a.jsx("td",{className:"py-2.5 pr-3 align-middle font-mono text-[12px]",style:{color:"var(--text-dim)"},children:a.jsx("span",{className:"truncate",children:f.agentId})}),a.jsx("td",{className:"py-2.5 pr-4 align-middle text-[12px]",style:{color:"var(--text)",lineHeight:1.45},children:eb(Pv(f.evidence??"",120))})]},`${f.timestamp}-${p}`)})})]})]})]})}const Jo=[{key:"passed",label:"passed",color:"var(--ok)"},{key:"pending",label:"pending",color:"var(--info)"},{key:"insufficient_evidence",label:"insufficient",color:"var(--idle)"},{key:"inconclusive",label:"inconclusive",color:"var(--warn)"},{key:"silent_skill",label:"silent",color:"var(--ink-3)"},{key:"failed",label:"failed",color:"var(--bad)"}];function nb({overview:s}){const r=s==null?void 0:s.skillVerdictSummary,u=r?Jo.reduce((o,d)=>o+(r[d.key]??0),0):0;return a.jsxs("section",{className:"rounded-lg border border-border p-4",style:{background:"var(--surface-elev)"},children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"h-section",children:"Skill Verdicts"}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:[u," total"]})]}),!r||u===0?a.jsx("p",{className:"font-mono text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:"no skill verdicts yet"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mb-3 flex h-2 w-full gap-px overflow-hidden rounded-sm",style:{background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"},children:Jo.map(o=>{const d=r[o.key]??0;if(d===0)return null;const f=d/u*100;return a.jsx("div",{style:{width:`${f}%`,background:o.color},title:`${o.label}: ${d}`},o.key)})}),a.jsx("ul",{className:"grid grid-cols-3 gap-x-4 gap-y-1.5 font-mono text-[11px]",children:Jo.map(o=>{const d=r[o.key]??0,f=d===0;return a.jsxs("li",{className:`flex items-center gap-1.5 ${f?"opacity-40":""}`,children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:o.color}}),a.jsx("span",{style:{color:"var(--text-dim)"},children:o.label}),a.jsx("span",{className:"ml-auto tabular-nums",style:f?{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"}:{color:o.color},children:d})]},o.key)})})]})]})}const dl=1,ai=2,ab=5;function lb({curve:s,threshold:r,stroke:u,width:o=140,height:d=30}){const f=S.useMemo(()=>ib(s),[s]),p=f.reduce((_,B)=>_+B.length,0);if(s.length===0||p<ab)return a.jsx(sb,{width:o,height:d,threshold:r});const h=o-dl*2,x=d-ai*2,g=ai+(1-hu(r))*x,b=_=>s.length<=1?dl+h/2:dl+_/(s.length-1)*h,y=_=>ai+(1-hu(_))*x;return a.jsxs("svg",{width:o,height:d,viewBox:`0 0 ${o} ${d}`,"aria-hidden":!0,style:{display:"block"},children:[a.jsx("line",{x1:dl,x2:o-dl,y1:g,y2:g,stroke:"var(--ink-4)",strokeWidth:1,strokeDasharray:"2 3",opacity:.7}),f.map((_,B)=>{if(_.length===1){const{idx:A,value:T}=_[0];return a.jsx("circle",{className:"skill-spark-curve",cx:b(A),cy:y(T),r:1.4,fill:u},B)}const U=_.map((A,T)=>`${T===0?"M":"L"} ${b(A.idx).toFixed(2)} ${y(A.value).toFixed(2)}`).join(" ");return a.jsx("path",{className:"skill-spark-curve",d:U,fill:"none",stroke:u,strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},B)})]})}function sb({width:s,height:r,threshold:u}){const o=r-ai*2,d=u!==void 0?ai+(1-hu(u))*o:r/2;return a.jsx("svg",{width:s,height:r,viewBox:`0 0 ${s} ${r}`,"aria-hidden":!0,style:{display:"block"},children:a.jsx("line",{x1:dl,x2:s-dl,y1:d,y2:d,stroke:"var(--ok)",strokeWidth:1,strokeDasharray:"2 2",opacity:.4})})}function ib(s){const r=[];let u=[];for(let o=0;o<s.length;o++){const d=s[o].value;if(d==null||!Number.isFinite(d)){u.length>0&&(r.push(u),u=[]);continue}u.push({idx:o,value:d})}return u.length>0&&r.push(u),r}function hu(s){return!Number.isFinite(s)||s<0?0:s>1?1:s}const ap={passed:"var(--ok)",pending:"var(--info)",insufficient_evidence:"var(--idle)",inconclusive:"var(--warn)",silent_skill:"var(--ink-3)",failed:"var(--bad)",flagged_for_manual_review:"var(--warn)"},rb={passed:"passed",pending:"pending",insufficient_evidence:"insufficient",inconclusive:"inconclusive",silent_skill:"silent",failed:"failed",flagged_for_manual_review:"flagged"},Sh={failed:0,flagged_for_manual_review:1,inconclusive:2,insufficient_evidence:3,passed:4,pending:5,silent_skill:6},cb="var(--ink-3)";function Cr(s){return s!=null&&s in ap}function ob({skills:s,loading:r,error:u}){const{known:o,unknown:d,total:f,transitions:p}=S.useMemo(()=>ub(s==null?void 0:s.effectiveness),[s]);return a.jsxs("section",{className:"space-y-2",children:[a.jsxs("header",{className:"flex items-baseline justify-between",children:[a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsx("h3",{className:"h-section",children:"skill graduation"}),a.jsx("span",{className:"font-mono text-[11px] tabular-nums font-medium",style:{color:"var(--ink)",fontFamily:"'JetBrains Mono', monospace"},children:f}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:["skills · ",p," transitions /24h"]})]}),a.jsx("a",{href:ua("/"),className:"text-[11px] transition hover:underline",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:"skill detail →"}),u&&a.jsx(_u,{message:u,className:"ml-2"})]}),a.jsxs("div",{className:"rounded-lg border p-4",style:{background:"var(--surface-sunk)",borderColor:"var(--border)"},children:[a.jsx("p",{className:"mb-3 text-[11px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:"Top: frozen verdict + stored basis. Bottom: live 7d activity. Dashed line = graduation threshold."}),r&&!s&&a.jsx(fb,{}),!r&&f===0&&!u&&a.jsx("p",{className:"text-[12px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:"No skills bound yet — agents need at least one dispatch with a skill match."}),f>0&&a.jsx("ul",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6",style:u?{opacity:.5}:void 0,children:o.map(h=>a.jsx(kh,{entry:h},_h(h)))}),d.length>0&&a.jsxs("details",{className:"mt-4 group",children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 select-none",style:{color:"var(--ink-3)"},children:[a.jsx("span",{"aria-hidden":!0,className:"chevron inline-block transition-transform",style:{fontSize:"10px",lineHeight:1},children:"▶"}),a.jsxs("span",{className:"text-[11px]",style:{fontVariant:"small-caps",letterSpacing:"0.04em",fontFamily:"Geist, var(--font-sans)",fontWeight:600},children:[d.length," unknown"]})]}),a.jsx("ul",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6",children:d.map(h=>a.jsx(kh,{entry:h},_h(h)))}),a.jsx("style",{children:`
59
+ details[open] > summary > .chevron { transform: rotate(90deg); }
60
+ `})]})]})]})}function _h(s){return`${s.agentId}::${s.skill}`}function ub(s){if(!s)return{known:[],unknown:[],total:0,transitions:0};const r=[],u=[];let o=0;for(const d of s)if(Cr(d.status)?r.push(d):u.push(d),d.curve.length>=2){const f=d.curve.slice(-2),p=f.filter(x=>x.value!=null&&x.value>=d.threshold).length,h=f.filter(x=>x.value!=null&&x.value<d.threshold).length;p>=1&&h>=1&&o++}return r.sort((d,f)=>{const p=Cr(d.status)?Sh[d.status]:99,h=Cr(f.status)?Sh[f.status]:99;return p!==h?p-h:d.skill.localeCompare(f.skill)}),u.sort((d,f)=>d.skill.localeCompare(f.skill)),{known:r,unknown:u,total:r.length+u.length,transitions:o}}function kh({entry:s}){const r=Cr(s.status)?s.status:null,u=r?ap[r]:cb,o=r?rb[r]:s.status??"unknown",d=typeof s.storedEffectiveness=="number"?s.storedEffectiveness:null,f=d!==null?Math.round(d*100):null,p=s.verdictAt?db(s.verdictAt):null,h=s.liveRecovered===!0;return a.jsxs("li",{className:"flex flex-col rounded-lg border",style:{background:"var(--surface-elev)",borderColor:"var(--border)"},title:`${s.agentId} · ${s.skill} · ${o} · N=${s.n}`,children:[a.jsxs("div",{className:"flex flex-col gap-1.5 rounded-t-lg px-2.5 pt-2.5 pb-2",style:{borderBottom:"1px solid var(--border)"},children:[a.jsx("div",{className:"truncate text-[12px] font-medium leading-tight",style:{color:"var(--ink)",fontFamily:"Geist, var(--font-sans)"},children:s.skill}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{"aria-hidden":!0,className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:qn(s.agentId)}}),a.jsx("span",{className:"truncate text-[10px]",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},children:s.agentId})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[a.jsx("span",{className:"inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold",style:{color:u,background:`color-mix(in oklch, ${u} 12%, transparent)`,border:`1px solid color-mix(in oklch, ${u} 25%, transparent)`,fontVariant:"small-caps",letterSpacing:"0.04em",fontFamily:"Geist, var(--font-sans)"},children:o}),h&&a.jsx("span",{className:"inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{color:"var(--ok)",background:"var(--ok-soft)",border:"1px solid color-mix(in oklch, var(--ok) 25%, transparent)",fontFamily:"Geist, var(--font-sans)",letterSpacing:"0.02em"},title:"Live 7d signals show recovery above threshold — but the stored verdict is frozen. Re-test to graduate.",children:"recovered · re-test pending"})]}),(f!==null||p)&&a.jsxs("div",{className:"flex items-baseline gap-1.5 flex-wrap",children:[f!==null&&a.jsxs("span",{className:"text-[10px] tabular-nums",style:{color:f<0&&(r==="failed"||r==="flagged_for_manual_review")?"var(--bad)":f>0?"var(--ok)":"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:`Stored effectiveness delta: ${f>0?"+":""}${f}pp (basis for this verdict)`,children:[f>0?"+":"",f,"pp"]}),f!==null&&a.jsxs("span",{className:"text-[10px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:["vs ",s.threshold.toFixed(2)]}),p&&a.jsx("span",{className:"text-[10px] tabular-nums",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:`Verdict as of: ${s.verdictAt}`,children:p})]})]}),a.jsxs("div",{className:"flex flex-col gap-1 px-2.5 pt-1.5 pb-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[10px]",style:{color:"var(--ink-3)",fontVariant:"small-caps",letterSpacing:"0.04em",fontFamily:"Geist, var(--font-sans)",fontWeight:600},children:"live 7d"}),a.jsxs("span",{className:"text-[10px] tabular-nums",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:"Total post-bind signals in the 7d window",children:["N=",a.jsx("span",{style:{color:"var(--ink)"},children:s.n})]})]}),a.jsx(lb,{curve:s.curve,threshold:s.threshold,stroke:qn(s.agentId),width:120,height:28})]})]})}function db(s){try{const r=new Date(s);if(!Number.isFinite(r.getTime()))return null;const u=new Date,o=r.getFullYear()===u.getFullYear(),d=r.toLocaleString("en-US",{month:"short"}),f=r.getDate();return o?`${d} ${f}`:`${d} ${f} '${String(r.getFullYear()).slice(-2)}`}catch{return null}}function fb(){return a.jsx("ul",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6","aria-hidden":!0,children:Array.from({length:6}).map((s,r)=>a.jsxs("li",{className:"flex flex-col rounded-lg border",style:{borderColor:"var(--border)",background:"var(--surface-elev)",minHeight:"120px"},children:[a.jsxs("div",{className:"flex flex-col gap-1.5 px-2.5 pt-2.5 pb-2",style:{borderBottom:"1px solid var(--border)"},children:[a.jsx("span",{className:"h-3 w-3/4 rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}}),a.jsx("span",{className:"h-2 w-1/3 rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}}),a.jsx("span",{className:"h-2.5 w-1/2 rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}}),a.jsx("span",{className:"h-5 w-16 rounded-full",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}})]}),a.jsxs("div",{className:"flex flex-col gap-1 px-2.5 pt-1.5 pb-2.5",children:[a.jsx("span",{className:"h-2.5 w-10 rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}}),a.jsx("span",{className:"h-7 w-full rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}})]})]},r))})}function mb(s){let r=0;for(let u=0;u<s.length;u++)r=(r<<5)-r+s.charCodeAt(u)|0;return Math.abs(r)}class hb{constructor(r){Mt(this,"s");this.s=r}next(){return this.s=this.s*1103515245+12345&2147483647,this.s%1e4/1e4}range(r,u){return r+this.next()*(u-r)}}function Xt(s,r){const u=parseInt(s.slice(1,3),16),o=parseInt(s.slice(3,5),16),d=parseInt(s.slice(5,7),16);return`rgba(${u},${o},${d},${Math.max(0,Math.min(1,r))})`}function pb(s){const r=Math.max(0,s);return Math.min(1.4,Math.pow(r/2e3,.55))}class xb{constructor(r,u,o,d,f,p,h=.5){Mt(this,"ctx");Mt(this,"size");Mt(this,"accuracy");Mt(this,"uniqueness");Mt(this,"impact");Mt(this,"colorHex");Mt(this,"time",0);Mt(this,"variant");Mt(this,"scale");Mt(this,"exp");Mt(this,"particles",[]);Mt(this,"baseRotation");Mt(this,"armSeeds");Mt(this,"binaryCenters");Mt(this,"jetAxis");Mt(this,"tailAngle");const x=r.getContext("2d");if(!x)throw new Error("Canvas 2D context unavailable");this.ctx=x,this.size=r.width/2,this.accuracy=Math.max(0,Math.min(1,d)),this.uniqueness=Math.max(0,Math.min(1,f)),this.impact=Math.max(0,Math.min(1,h)),this.colorHex=p;const g=mb(u);this.variant=g%12;const b=new hb(g),y=pb(o);this.exp=y,this.scale=.2+y*.95;const _=Math.max(3,Math.round(4+y*180));this._buildVariant(b,_),this.baseRotation=b.next()*Math.PI*2}_buildVariant(r,u){const o=this.variant;if(o===0){this.armSeeds=[];for(let f=0;f<2;f++)this.armSeeds.push(r.next()*Math.PI*2);for(let f=0;f<u;f++){const p=f%2,h=r.next(),x=this.armSeeds[p]+h*Math.PI*2.4,g=r.range(-.04,.04)*Math.PI*2,b=x+g,y=(.08+h*.38)*this.size*this.scale;this.particles.push(this._mkParticle(r,y,b,1,1))}}else if(o===1)for(let d=0;d<u;d++){const f=r.range(.34,.42)*this.size*this.scale,p=r.next()*Math.PI*2;this.particles.push(this._mkParticle(r,f,p,1,1))}else if(o===2){const d=[.16,.28,.42];for(let f=0;f<u;f++){const p=f%3,h=(d[p]+r.range(-.015,.015))*this.size*this.scale,x=r.next()*Math.PI*2;this.particles.push(this._mkParticle(r,h,x,1,1))}}else if(o===3){const d=.18*this.size*this.scale;this.binaryCenters=[{x:-d,y:0},{x:d,y:0}];for(let f=0;f<u;f++){const p=f%2,h=r.range(.04,.22)*this.size*this.scale,x=r.next()*Math.PI*2,g=this._mkParticle(r,h,x,1,1);g.binaryCore=p,g.angularVelocity*=p===0?1:-1,this.particles.push(g)}}else if(o===4)for(let d=0;d<u;d++){const f=r.range(.05,.32)*this.size*this.scale,p=r.next()*Math.PI*2,h=r.range(.7,1.3),x=r.range(.7,1.3),g=this._mkParticle(r,f,p,h,x);g.orbitTilt=r.range(0,Math.PI),this.particles.push(g)}else if(o===5){this.jetAxis=r.next()*Math.PI*2;const d=Math.floor(u*.7),f=u-d;for(let p=0;p<d;p++){const h=p%2===0?1:-1,x=r.next(),g=r.range(-.18,.18),b=this._mkParticle(r,x*.44*this.size*this.scale,0,1,1);b.jetSide=h,b.jetProgress=x,b.jetSpread=g,b.jetSpeed=r.range(.15,.35)*.001,b.size=r.range(.6,1.4),this.particles.push(b)}for(let p=0;p<f;p++){const h=r.range(.35,.42)*this.size*this.scale,x=r.next()*Math.PI*2,g=this._mkParticle(r,h,x,1,1);g.isDisk=!0,g.brightness*=.35,this.particles.push(g)}}else if(o===6)for(let d=0;d<u;d++){const f=r.next()*Math.PI*2,p=r.range(.05,.45)*this.size*this.scale,h=this._mkParticle(r,p,f,1,1);h.isNebula=!0,h.driftAngle=r.next()*Math.PI*2,h.driftSpeed=r.range(6e-4,.0014),h.driftPhase=r.next()*Math.PI*2,h.size=r.range(.8,2.2),h.brightness*=.6,this.particles.push(h)}else if(o===7){this.tailAngle=r.next()*Math.PI*2;const d=.1*this.size*this.scale,f=Math.floor(u*.3);for(let h=0;h<f;h++){const x=r.range(0,d),g=r.next()*Math.PI*2,b=this._mkParticle(r,x,g,1,1);b.size=r.range(.8,1.8),this.particles.push(b)}const p=u-f;for(let h=0;h<p;h++){const x=r.next(),g=d+x*.26*this.size*this.scale,b=(1-x*.5)*r.range(-.05,.05)*this.size*this.scale,y=this._mkParticle(r,0,0,1,1);y.isComet=!0,y.cometTailDist=g,y.cometPerp=b,y.cometT=x,y.brightness*=1-x*.6,y.size=(1-x*.5)*r.range(.6,1.2),this.particles.push(y)}}else if(o===8)for(let d=0;d<u;d++){const f=d%3,p=r.range(.3,.42)*this.size*this.scale,h=r.next()*Math.PI*2,x=this._mkParticle(r,p,h,1,1);x.gyroPlane=f,x.gyroAxis=f===0?"z":f===1?"x":"y",this.particles.push(x)}else if(o===9)for(let d=0;d<u;d++){const f=r.range(.06,.42)*this.size*this.scale,h=f/(.42*this.size*this.scale)*4*Math.PI+r.range(-.2,.2),x=this._mkParticle(r,f,h,1,1);x.isMaelstrom=!0,this.particles.push(x)}else if(o===10)for(let d=0;d<u;d++){const f=d/u,p=r.range(.35,.4)*this.size*this.scale,h=f*Math.PI*2+r.range(-.03,.03),x=this._mkParticle(r,p,h,1,1);x.ouroT=f,this.particles.push(x)}else for(let d=0;d<u;d++){const f=d%2,p=r.next(),h=this._mkParticle(r,0,0,1,1);h.isHelix=!0,h.helixStrand=f,h.helixT=p,h.helixSpeed=r.range(.3,.6)*.001,this.particles.push(h)}}_mkParticle(r,u,o,d,f){const p=8e-4+(.42*this.size-u)*4e-5,h=r.next()*Math.PI*2,x=r.range(.05,.3)*this.size;return{baseRadius:u,angle:o,angularVelocity:p*(r.next()>.5?1:.85),size:r.range(.5,1.8),brightness:r.range(.4,1),wobblePhase:r.next()*Math.PI*2,wobbleSpeed:r.range(.5,1.2),ellipX:d,ellipY:f,orbitTilt:0,binaryCore:0,chaosX:Math.cos(h)*x,chaosY:Math.sin(h)*x,chaosDriftPhase:r.next()*Math.PI*2,chaosDriftSpeed:r.range(3e-4,8e-4)}}update(r){this.time+=r}draw(){const{ctx:r,size:u,time:o,accuracy:d,uniqueness:f,impact:p,colorHex:h,variant:x}=this,g=u/2,b=u/2;r.clearRect(0,0,u,u);const y=.4+this.exp*.6,_=d*y,B=f*y,U=p*y,A=.2+_*.8,T=.3+U*1.9,F=B,Y=Math.min(1,Math.max(0,(this.exp-.15)*1.8)),ae=1-Y,V=r.createRadialGradient(g,b,0,g,b,u*.45);if(V.addColorStop(0,Xt(h,.05*A)),V.addColorStop(.4,Xt(h,.015)),V.addColorStop(1,"transparent"),r.fillStyle=V,r.fillRect(0,0,u,u),x===0&&this.armSeeds){const E=o*5e-4*T;for(const G of this.armSeeds){const C=G+E;r.beginPath();for(let K=0;K<1;K+=.02){const te=C+K*Math.PI*2.4,P=(.08+K*.38)*u*this.scale,he=g+Math.cos(te)*P,ne=b+Math.sin(te)*P;K===0?r.moveTo(he,ne):r.lineTo(he,ne)}r.strokeStyle=Xt(h,.12*A),r.lineWidth=1,r.stroke()}}for(const E of this.particles){const G=Math.sin(o*E.wobbleSpeed*.001+E.wobblePhase)*1.2,C=E.baseRadius+G,K=E.angle+o*E.angularVelocity*T;let te,P;if(x===3&&this.binaryCenters){const ne=this.binaryCenters[E.binaryCore];te=g+ne.x+Math.cos(K)*C,P=b+ne.y+Math.sin(K)*C}else if(x===4){const ne=Math.cos(E.orbitTilt),ue=Math.sin(E.orbitTilt),ye=Math.cos(K)*C*E.ellipX,O=Math.sin(K)*C*E.ellipY;te=g+ye*ne-O*ue,P=b+ye*ue+O*ne}else if(x===5&&E.jetSide!==void 0&&!E.isDisk&&this.jetAxis!==void 0){const ne=(E.jetProgress+o*E.jetSpeed*T)%1,ue=ne*.44*u*this.scale,ye=this.jetAxis+Math.PI/2;te=g+Math.cos(this.jetAxis)*ue*E.jetSide+Math.cos(ye)*E.jetSpread*ue,P=b+Math.sin(this.jetAxis)*ue*E.jetSide+Math.sin(ye)*E.jetSpread*ue,E._fadeMul=Math.sin(ne*Math.PI)*.9+.1}else if(x===6&&E.isNebula){const ne=o*E.driftSpeed*T,ue=Math.sin(ne+E.driftPhase)*2;te=g+Math.cos(E.angle+ne*.3)*C+Math.cos(E.driftAngle)*ue,P=b+Math.sin(E.angle+ne*.3)*C+Math.sin(E.driftAngle)*ue}else if(x===7&&E.isComet&&this.tailAngle!==void 0){const ne=(E.cometT+o*3e-4*T)%1,ue=E.cometTailDist+ne*.06*u*this.scale,ye=this.tailAngle+Math.PI/2;te=g+Math.cos(this.tailAngle)*ue+Math.cos(ye)*E.cometPerp,P=b+Math.sin(this.tailAngle)*ue+Math.sin(ye)*E.cometPerp}else if(x===8&&E.gyroAxis){const ne=o*1e-4*T;E.gyroAxis==="z"?(te=g+Math.cos(K)*C,P=b+Math.sin(K)*C*.3):E.gyroAxis==="x"?(te=g+Math.cos(K)*C*.3+Math.sin(ne)*C*.1,P=b+Math.sin(K)*C):(te=g+Math.sin(K+ne)*C*.6,P=b+Math.cos(K+ne)*C*.8)}else if(x===9){const ne=(o*5e-4*T+E.wobblePhase)%1,ue=C*(1-ne*.85);te=g+Math.cos(K)*ue,P=b+Math.sin(K)*ue,E._fadeMul=1-ne}else if(x===10&&E.ouroT!==void 0){const ne=(E.ouroT+o*3e-4*T)%1,ue=ne*Math.PI*2;te=g+Math.cos(ue)*C,P=b+Math.sin(ue)*C;const ye=Math.cos(ne*Math.PI*2)*.5+.5;E._fadeMul=.3+ye*.9}else if(x===11&&E.helixT!==void 0){const ne=(E.helixT+o*E.helixSpeed*T)%1,ue=(ne-.5)*.65*u*this.scale,ye=E.helixStrand===0?0:Math.PI,O=.15*u*this.scale,M=Math.sin(ne*Math.PI*3+ye)*O;te=g+M,P=b+ue,E._fadeMul=.4+(Math.cos(ne*Math.PI*3+ye)+1)/2*.6}else te=g+Math.cos(K)*C*E.ellipX,P=b+Math.sin(K)*C*E.ellipY;if(ae>.01){const ne=o*E.chaosDriftSpeed,ue=Math.cos(ne+E.chaosDriftPhase)*2,ye=Math.sin(ne*1.13+E.chaosDriftPhase)*2,O=g+E.chaosX+ue,M=b+E.chaosY+ye;te=O*ae+te*Y,P=M*ae+P*Y}const he=E._fadeMul!==void 0?E._fadeMul:1;if(x<=4&&Y>.5){const ne=2+Math.floor(p*3);for(let ue=0;ue<ne;ue++){const ye=E.angularVelocity*T*(ue+1)*80,O=K-ye;let M,I;if(x===3&&this.binaryCenters){const oe=this.binaryCenters[E.binaryCore];M=g+oe.x+Math.cos(O)*C,I=b+oe.y+Math.sin(O)*C}else if(x===4){const oe=Math.cos(E.orbitTilt),me=Math.sin(E.orbitTilt),j=Math.cos(O)*C*E.ellipX,H=Math.sin(O)*C*E.ellipY;M=g+j*oe-H*me,I=b+j*me+H*oe}else M=g+Math.cos(O)*C*E.ellipX,I=b+Math.sin(O)*C*E.ellipY;const ee=(1-ue/ne)*.3*E.brightness*A*Y;r.beginPath(),r.arc(M,I,E.size*(1-ue*.25),0,Math.PI*2),r.fillStyle=Xt(h,ee),r.fill()}}else if(x===6&&E.isNebula){const ne=E.size*3,ue=r.createRadialGradient(te,P,0,te,P,ne);ue.addColorStop(0,Xt(h,E.brightness*A*.4)),ue.addColorStop(1,"transparent"),r.fillStyle=ue,r.beginPath(),r.arc(te,P,ne,0,Math.PI*2),r.fill()}r.beginPath(),r.arc(te,P,E.size,0,Math.PI*2),r.fillStyle=Xt(h,E.brightness*A*he),r.fill()}if(F>.05)for(let G=0;G<3;G++){const C=(o*7e-4*F+G*.33)%1;if(C>.5)continue;const K=(G*1.618*Math.PI+o*1e-4)%(Math.PI*2),te=u*.5*(1-C*1.6);if(te<3)continue;const P=g+Math.cos(K)*te,he=b+Math.sin(K)*te,ne=C<.2?C/.2:1-(C-.2)/.3,ue=5+(1-C)*4,ye=r.createRadialGradient(P,he,0,P,he,ue);ye.addColorStop(0,Xt("#ffffff",ne*.95)),ye.addColorStop(.3,Xt(h,ne*.7)),ye.addColorStop(1,"transparent"),r.fillStyle=ye,r.beginPath(),r.arc(P,he,ue,0,Math.PI*2),r.fill()}if(x!==3){const E=.9+.1*Math.sin(o*.003),G=(1+this.exp*9+d*2)*this.scale,C=Math.min(G*(3+p*2),u*.4),K=r.createRadialGradient(g,b,0,g,b,C);K.addColorStop(0,Xt("#ffffff",.95*E*A)),K.addColorStop(.2,Xt(h,.75*E*A)),K.addColorStop(.5,Xt(h,.2*A)),K.addColorStop(1,"transparent"),r.fillStyle=K,r.beginPath(),r.arc(g,b,C,0,Math.PI*2),r.fill(),r.beginPath(),r.arc(g,b,G*E,0,Math.PI*2),r.fillStyle=Xt("#ffffff",.95),r.fill()}else if(this.binaryCenters)for(const E of this.binaryCenters){const G=g+E.x,C=b+E.y,K=(.8+this.exp*5+d*1.5)*this.scale,te=Math.min(K*3.5,u*.22),P=r.createRadialGradient(G,C,0,G,C,te);P.addColorStop(0,Xt("#ffffff",.9*A)),P.addColorStop(.3,Xt(h,.6*A)),P.addColorStop(1,"transparent"),r.fillStyle=P,r.beginPath(),r.arc(G,C,te,0,Math.PI*2),r.fill(),r.beginPath(),r.arc(G,C,K,0,Math.PI*2),r.fillStyle=Xt("#ffffff",.9),r.fill()}}}const pl=globalThis,Pl=new Set;let hl=0,es=0;const gb=100;function lp(s){const r=es===0?16:Math.min(gb,Math.max(0,s-es));es=s;for(const u of Pl)try{u(r)}catch(o){console.error("[AnimationScheduler] subscriber threw, continuing",o)}Pl.size>0?hl=pl.requestAnimationFrame(lp):(hl=0,es=0)}function vb(){hl===0&&(es=0,hl=pl.requestAnimationFrame(lp))}function bb(){hl!==0&&(pl.cancelAnimationFrame&&pl.cancelAnimationFrame(hl),hl=0,es=0)}function yb(){return pl.matchMedia?pl.matchMedia("(prefers-reduced-motion: reduce)").matches:!1}function sp(s){if(!pl.requestAnimationFrame)return()=>{};if(yb())return()=>{};Pl.add(s),Pl.size===1&&vb();let r=!1;return function(){r||(r=!0,Pl.delete(s),Pl.size===0&&bb())}}function ri({agentId:s,size:r=64,animate:u=!0,signals:o=0,accuracy:d=.5,uniqueness:f=.5,impact:p=.5}){const h=S.useRef(null),x=S.useRef(null),g=S.useRef(!0),b=S.useRef(u);return b.current=u,S.useEffect(()=>{const y=h.current;if(!y)return;y.width=r*2,y.height=r*2;const _=y.getContext("2d");if(!_)return;_.scale(2,2);const B=qn(s),U=new xb(y,s,o,d,f,B,p);x.current=U,U.draw();const A=sp(T=>{g.current&&b.current&&(U.update(T),U.draw())});return()=>{A(),x.current=null}},[s,r,o,d,f,p]),S.useEffect(()=>{const y=h.current;if(!y)return;const _=new IntersectionObserver(([B])=>{g.current=B.isIntersecting},{threshold:.1});return _.observe(y),()=>_.disconnect()},[]),a.jsx("canvas",{ref:h,"aria-hidden":"true",className:"shrink-0",style:{width:r,height:r,borderRadius:"50%"}})}function Nb(s){return s.hallucinationsCaught>0?"catch":s.disputed>0?"mixed":s.confirmed>0?"trust":null}function jb(s){return Math.max(1,Math.min(2.5,1+s*.15))}function si(s,r){return s<=r?`${s}::${r}`:`${r}::${s}`}const Sb=new Set(["agreement","unique_confirmed","impl_peer_approved"]),_b=new Set(["disagreement","impl_peer_rejected"]),kb=new Set(["hallucination_caught"]);function Eb(s){const r=new Map,u=new Map;for(const o of s)if(!o.retracted)for(const d of o.signals){if(!d.counterpartId||!d.agentId)continue;const f=Sb.has(d.signal),p=_b.has(d.signal),h=kb.has(d.signal);if(!f&&!p&&!h)continue;const x=si(d.agentId,d.counterpartId);let g=r.get(x);g||(g={rounds:0,confirmed:0,disputed:0,hallucinationsCaught:0,lastInteraction:o.timestamp},r.set(x,g)),f&&(g.confirmed+=1),p&&(g.disputed+=1),h&&(g.hallucinationsCaught+=1);let b=u.get(x);b||(b=new Set,u.set(x,b)),b.has(o.taskId)||(b.add(o.taskId),g.rounds+=1),o.timestamp>g.lastInteraction&&(g.lastInteraction=o.timestamp)}return r}function Rr(s){return s>=2e3?84:s>=800?72:s>=200?60:48}function wb(s,r,u){var b;const o={x:r/2,y:u/2},f=Math.max(80,Math.min(r,u)/2-24),p=new Map;if(s.length===0)return p;const h=[...s].sort((y,_)=>{var A,T;const B=((A=_.scores)==null?void 0:A.accuracy)??0,U=((T=y.scores)==null?void 0:T.accuracy)??0;return B!==U?U-B:y.id.localeCompare(_.id)}),x=h.length,g=Math.PI*(3-Math.sqrt(5));for(let y=0;y<x;y++){const _=h[y],B=Tb(((b=_.scores)==null?void 0:b.accuracy)??0,0,1),U=Math.max(f*.22,(1-B)*f),A=-Math.PI/2+y*g;p.set(_.id,{x:o.x+U*Math.cos(A),y:o.y+U*Math.sin(A),role:"fleet",angle:A})}return p}function Tb(s,r,u){return Math.min(Math.max(s,r),u)}function Eh(s){let r=s>>>0;return()=>{r=r+1831565813>>>0;let u=r;return u=Math.imul(u^u>>>15,u|1),u^=u+Math.imul(u^u>>>7,u|61),((u^u>>>14)>>>0)/4294967296}}function Ab({width:s,height:r,agentPositions:u}){const o=S.useRef(null),d=S.useRef([]),f=S.useRef([]);S.useEffect(()=>{if(s<=0||r<=0)return;const h=Eh(7311),x=170;d.current=Array.from({length:x},()=>{const g=h();let b,y;return g<.07?(b=2+h()*.6,y=.75+h()*.25):g<.32?(b=1.2+h()*.4,y=.45+h()*.35):(b=.5+h()*.4,y=.25+h()*.3),{x:h()*s,y:h()*r,baseR:b,r:b,baseO:y,o:y,consumed:null,phase:h()*Math.PI*2,twinkleHz:.25+h()*1.4}})},[s,r]),S.useEffect(()=>{if(s<=0||r<=0)return;const h=Eh(919),x=60,g=90,b=1.5,y=1.8;let _=0;const U=sp(A=>{const T=A/1e3;_+=T;const F=d.current,Y=f.current;for(let ae=0;ae<F.length;ae++){const V=F[ae];if(V.consumed===null)for(let G=0;G<u.length;G++){const C=u[G].x-V.x,K=u[G].y-V.y;if(C*C+K*K<x*x){V.consumed=G;break}}if(V.consumed===null){const G=.8+.35*Math.sin(_*V.twinkleHz*Math.PI*2+V.phase);V.o=Math.min(1,V.baseO*G)}if(V.consumed!==null){const G=u[V.consumed];if(G){const C=G.x-V.x,K=G.y-V.y,te=Math.sqrt(C*C+K*K)||1,P=Math.min(te,g*T);V.x+=C/te*P,V.y+=K/te*P,V.o=Math.max(0,V.o-b*T),V.r=Math.max(0,V.r-y*T)}if(V.o<=.01||V.r<=.1){let C=0,K=0,te=!1;for(let P=0;P<8;P++){C=h()*s,K=h()*r,te=!0;for(const he of u){const ne=he.x-C,ue=he.y-K;if(ne*ne+ue*ue<x*x*1.5){te=!1;break}}if(te)break}V.x=C,V.y=K,V.r=V.baseR,V.o=V.baseO,V.consumed=null}}const E=Y[ae];E&&(E.setAttribute("cx",String(V.x)),E.setAttribute("cy",String(V.y)),E.setAttribute("r",String(V.r)),E.setAttribute("opacity",String(V.o)))}});return()=>U()},[s,r,u]);const p=d.current;return a.jsx("svg",{ref:o,width:"100%",height:r,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:p.map((h,x)=>a.jsx("circle",{ref:g=>{f.current[x]=g},cx:h.x,cy:h.y,r:h.r,fill:"#F2EDE3",opacity:h.o},x))})}function Mb({variant:s}){const r=(()=>{switch(s){case 1:return a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M 19 24 L 25 24",stroke:"#F2EDE3",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"34",cy:"24",r:"1.5",fill:"#F2EDE3"}),a.jsx("path",{d:"M 20 31 Q 28 36 36 31",stroke:"#F2EDE3",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"})]});case 2:return a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"22",cy:"23",r:"1.6",fill:"#F2EDE3"}),a.jsx("circle",{cx:"34",cy:"23",r:"1.6",fill:"#F2EDE3"}),a.jsx("path",{d:"M 19 30 Q 28 38 37 30 Q 28 33 19 30 Z",fill:"#F2EDE3",opacity:"0.92"})]});case 3:return a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"22",cy:"24",r:"1.4",fill:"#F2EDE3"}),a.jsx("circle",{cx:"34",cy:"24",r:"1.4",fill:"#F2EDE3"}),a.jsx("path",{d:"M 22 30 Q 26 33 28 30 Q 30 33 34 30",stroke:"#F2EDE3",strokeWidth:"1.4",strokeLinecap:"round",fill:"none"})]});default:return a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"22",cy:"24",r:"1.5",fill:"#F2EDE3"}),a.jsx("circle",{cx:"34",cy:"24",r:"1.5",fill:"#F2EDE3"}),a.jsx("path",{d:"M 20 31 Q 28 36 36 31",stroke:"#F2EDE3",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"})]})}})();return a.jsx("svg",{width:"56",height:"56",viewBox:"0 0 56 56",style:{position:"absolute",top:0,left:0,animation:"orch-smile-pop 900ms ease-out forwards",pointerEvents:"none"},"aria-hidden":!0,children:r})}function Cb(){return a.jsx("svg",{width:"56",height:"56",viewBox:"0 0 56 56",style:{position:"absolute",top:0,left:0,animation:"orch-ripple 700ms ease-out forwards",pointerEvents:"none"},"aria-hidden":!0,children:a.jsx("circle",{cx:"28",cy:"28",r:"9",fill:"none",stroke:"var(--accent)",strokeWidth:"1.2"})})}function Rb({width:s,height:r,hideLabels:u=!1}){const o=s/2,d=r/2,p=Math.max(80,Math.min(s,r)/2-40),h=[{r:p,accLabel:"0%"},{r:p*.75,accLabel:"25%"},{r:p*.5,accLabel:"50%"},{r:p*.25,accLabel:"75%"}];return a.jsx("svg",{width:"100%",height:r,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:h.map(({r:x,accLabel:g})=>a.jsxs("g",{children:[a.jsx("circle",{cx:o,cy:d,r:x,fill:"none",stroke:"var(--border-strong)",strokeDasharray:"2 4",opacity:.5}),!u&&a.jsx("text",{x:o+6,y:d-x-4,fontFamily:"var(--font-mono)",fontSize:"9",fill:"var(--ink-3)",letterSpacing:"0.06em",children:g})]},g))})}function Ob(s,r,u,o,d){const f={x:o/2,y:d/2},p=new Map;p.set(s,{x:f.x,y:f.y,role:"center"});const h=[];for(const B of r){if(B===s)continue;const U=u.get(si(s,B));U&&h.push({id:B,rel:U})}const x=Math.max(1,...h.map(B=>B.rel.rounds)),g=Math.max(120,Math.min(o,d)*.2),b=Math.min(o,d)*.42,y=h.slice().sort((B,U)=>B.id.localeCompare(U.id)),_=y.length;for(let B=0;B<_;B++){const{id:U,rel:A}=y[B],T=B/Math.max(1,_)*Math.PI*2-Math.PI/2,F=A.rounds/x,Y=b-F*(b-g);p.set(U,{x:f.x+Y*Math.cos(T),y:f.y+Y*Math.sin(T),role:"peer"})}for(const B of r)p.has(B)||p.set(B,{x:f.x,y:f.y,role:"hidden"});return p}function Db({agents:s,peerRelationships:r,selectedAgentId:u,onSelectAgent:o,height:d=420}){if(s.length===0)return a.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border",style:{height:d,background:"var(--stage-bg)",borderColor:"var(--border)",color:"var(--stage-text-dim)"},children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"mb-2 h-section",children:"No agents configured"}),a.jsxs("div",{className:"font-mono text-xs",children:["Run ",a.jsx("code",{children:"gossip_setup"})," to spin up the fleet."]})]})});if(s.length===1){const f=s[0];return a.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border",style:{height:d,background:"var(--stage-bg)",borderColor:"var(--border)"},children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"inline-block",children:a.jsx(ri,{agentId:f.id,signals:f.scores.signals,accuracy:f.scores.accuracy,uniqueness:f.scores.uniqueness,impact:f.scores.impactScore,size:Rr(f.scores.signals)})}),a.jsx("div",{className:"mt-3 font-mono text-xs",style:{color:"var(--stage-text-dim)"},children:"Dispatch a task to see the network form."})]})})}return a.jsx(zb,{agents:s,peerRelationships:r,selectedAgentId:u,onSelectAgent:o,height:d})}function zb({agents:s,peerRelationships:r,selectedAgentId:u,onSelectAgent:o,height:d=420}){const f=S.useRef(null),[p,h]=S.useState(800),[x,g]=S.useState(d),[b,y]=S.useState(0);S.useEffect(()=>{const T=f.current;if(!T)return;const F=new ResizeObserver(([Y])=>{const ae=Y.contentRect.width,V=Y.contentRect.height;ae>0&&h(ae),V>0&&g(V)});return F.observe(T),()=>F.disconnect()},[]);const _=S.useMemo(()=>{const T=s.map(F=>F.id);return u&&T.includes(u)?Ob(u,T,r,p,x):wb(s,p,x)},[s,r,u,p,x]),B=S.useMemo(()=>{if(!u)return[];const T=_.get(u);if(!T)return[];const F=[];for(const ae of s){if(ae.id===u)continue;const V=_.get(ae.id);if(!V||V.role!=="peer")continue;const E=r.get(si(u,ae.id));if(!E)continue;const G=Nb(E);G&&F.push({peerId:ae.id,x1:T.x,y1:T.y,x2:V.x,y2:V.y,cls:G,width:jb(E.rounds),rounds:E.rounds})}const Y={mixed:0,trust:1,catch:2};return F.sort((ae,V)=>Y[ae.cls]-Y[V.cls]),F},[s,r,u,_]),U=u?B.length:0,A=S.useMemo(()=>{const T=[];for(const F of s){const Y=_.get(F.id);Y&&T.push({x:Y.x,y:Y.y})}return T},[s,_]);return a.jsxs("div",{ref:f,className:"relative overflow-hidden rounded-lg border",style:{minHeight:d,height:"100%",background:"#14120F",borderColor:"#2B2823","--stage-bg":"#14120F","--stage-text-dim":"#B8B0A1","--stage-grid":"rgba(255,255,255,0.03)"},onClick:()=>o(null),children:[a.jsx(Ab,{width:p,height:x,agentPositions:A}),a.jsx(Rb,{width:p,height:x,hideLabels:!!u}),a.jsx("div",{className:"absolute z-10 flex items-center gap-2 h-section",style:{top:10,left:12,pointerEvents:"none",color:"var(--stage-text-dim)",background:"color-mix(in oklch, var(--stage-bg) 70%, transparent)",padding:"2px 6px",borderRadius:"3px"},children:u?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Focus"}),a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{style:{color:"#F2EDE3"},children:u}),a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{style:{color:"#F2EDE3"},children:U}),a.jsxs("span",{style:{opacity:.7},children:["peer",U===1?"":"s"]})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Fleet"}),a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{style:{color:"#F2EDE3"},children:s.length}),a.jsx("span",{style:{opacity:.7},children:"agents"}),a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{style:{opacity:.7},children:"click an avatar to focus"})]})}),!u&&a.jsx("div",{className:"absolute z-10 h-section",style:{bottom:12,right:12,fontSize:"10px",color:"var(--stage-text-dim)",background:"color-mix(in oklch, var(--stage-bg) 70%, transparent)",padding:"2px 6px",borderRadius:"3px",pointerEvents:"none"},children:"closer to center = higher accuracy"}),a.jsx("svg",{width:"100%",height:x,style:{position:"absolute",inset:0,pointerEvents:"none"},children:B.map(T=>{const F=s.find(M=>M.id===u),Y=s.find(M=>M.id===T.peerId);if(!F||!Y)return null;const ae=Rr(F.scores.signals)/2,V=Rr(Y.scores.signals)/2,E=T.x2-T.x1,G=T.y2-T.y1,C=Math.max(1,Math.hypot(E,G)),K=E/C,te=G/C,P=T.x1+K*ae,he=T.y1+te*ae,ne=T.x2-K*V,ue=T.y2-te*V,ye=T.cls==="trust"?"var(--success)":T.cls==="mixed"?"var(--warn)":"var(--danger)",O=T.cls==="mixed"?"8,2":void 0;return a.jsx("line",{x1:P,y1:he,x2:ne,y2:ue,stroke:ye,strokeWidth:T.width,strokeDasharray:O,strokeLinecap:"round",style:{opacity:.55,transition:"opacity 200ms cubic-bezier(0.4,0,0.2,1)"}},T.peerId)})}),u&&a.jsxs("div",{className:"absolute z-10 flex flex-col gap-1 rounded font-mono text-[10px]",style:{bottom:10,left:12,color:"var(--stage-text-dim)",pointerEvents:"none"},children:[a.jsx(Wo,{stroke:"var(--success)",label:"Trust"}),a.jsx(Wo,{stroke:"var(--warn)",label:"Mixed",dash:"8,2"}),a.jsx(Wo,{stroke:"var(--danger)",label:"Caught"})]}),!u&&x>0&&a.jsxs("div",{className:"absolute z-[1] -translate-x-1/2 -translate-y-1/2",style:{left:p/2,top:x/2,cursor:"pointer"},onClick:T=>{T.stopPropagation(),y(F=>F+1)},title:b>=10?"♥":b>=5?"ok ok":"orchestrator",children:[a.jsxs("svg",{width:"56",height:"56",viewBox:"0 0 56 56",style:{display:"block",pointerEvents:"none"},"aria-hidden":!0,children:[a.jsx("circle",{cx:"28",cy:"28",r:"26",fill:"none",stroke:"var(--border-strong)",strokeWidth:"0.6",opacity:"0.35"}),a.jsx("circle",{cx:"28",cy:"28",r:"22",fill:"none",stroke:"var(--border-strong)",strokeWidth:"0.4",opacity:"0.25"}),a.jsx("circle",{cx:"28",cy:"28",r:"12",fill:"none",stroke:"#F2EDE3",strokeWidth:"1.1",opacity:"0.75"}),a.jsx("circle",{cx:"28",cy:"28",r:"9",fill:"#000"}),a.jsx("circle",{cx:"28",cy:"28",r:"9",fill:"none",stroke:"var(--border-strong)",strokeWidth:"0.5",opacity:"0.6"})]}),b>0&&a.jsx(Mb,{variant:(b-1)%4},b),b>0&&a.jsx(Cb,{},`ripple-${b}`),a.jsx("div",{className:"font-mono",style:{position:"absolute",top:"calc(100% + 4px)",left:"50%",transform:"translateX(-50%)",fontSize:"9px",letterSpacing:"0.18em",textTransform:"uppercase",color:b>=10?"var(--accent)":"var(--stage-text-dim)",whiteSpace:"nowrap",opacity:.7,pointerEvents:"none",transition:"color 400ms ease-out"},children:b>=10?"♥ orchestrator ♥":"orchestrator"})]}),s.map(T=>{const F=_.get(T.id);if(!F)return null;const Y=Rr(T.scores.signals),ae=F.role==="center",V=F.role==="hidden",E=F.role==="peer",G=V?0:1,C=ae?"#F2EDE3":"var(--stage-text-dim)",K=F.angle??Math.PI/2,te=Y/2+14,P=Math.cos(K)*te,he=Math.sin(K)*te,ne=Math.abs(Math.cos(K))>.7?Math.cos(K)>0?"left":"right":"center";return a.jsxs("button",{type:"button",onClick:ue=>{ue.stopPropagation(),o(T.id)},className:"absolute -translate-x-1/2 -translate-y-1/2",style:{left:F.x,top:F.y,opacity:G,pointerEvents:V?"none":"auto",border:"none",background:"transparent",padding:0,cursor:"pointer",transition:"left 320ms cubic-bezier(0.4,0,0.2,1), top 320ms cubic-bezier(0.4,0,0.2,1), opacity 200ms cubic-bezier(0.4,0,0.2,1)"},"aria-label":`Select agent ${T.id}`,title:T.id,children:[a.jsx("div",{className:"rounded-full",style:{width:Y,height:Y,boxShadow:ae?"0 0 0 1.5px rgba(242, 237, 227, 0.45), 0 0 0 6px color-mix(in oklch, var(--border-strong) 18%, transparent), 0 0 28px -4px color-mix(in oklch, var(--border-strong) 35%, transparent)":void 0,transition:"box-shadow 200ms cubic-bezier(0.4,0,0.2,1)"},children:a.jsx(ri,{agentId:T.id,signals:T.scores.signals,accuracy:T.scores.accuracy,uniqueness:T.scores.uniqueness,impact:T.scores.impactScore,size:Y})}),a.jsx("div",{className:"absolute font-mono text-[10px] font-bold tracking-wider",style:{left:"50%",top:"50%",transform:`translate(calc(-50% + ${P}px), calc(-50% + ${he}px))${ne==="left"?" translateX(calc(50% + 4px))":ne==="right"?" translateX(calc(-50% - 4px))":""}`,color:C,textAlign:ne==="right"?"right":ne==="left"?"left":"center",whiteSpace:"nowrap",pointerEvents:"none",transition:"color 200ms cubic-bezier(0.4,0,0.2,1), transform 320ms cubic-bezier(0.4,0,0.2,1)"},children:T.id}),E&&a.jsx("div",{className:"font-mono text-[9px]",style:{color:"var(--stage-text-dim)",textAlign:"center",whiteSpace:"nowrap",marginTop:2},children:(()=>{const ue=r.get(si(u??"",T.id));return ue?`${ue.rounds} round${ue.rounds===1?"":"s"}`:""})()})]},T.id)})]})}function Wo({stroke:s,label:r,dash:u}){return a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("svg",{width:"22",height:"6",style:{display:"block"},children:a.jsx("line",{x1:"0",y1:"3",x2:"22",y2:"3",stroke:s,strokeWidth:"1.5",strokeDasharray:u})}),a.jsx("span",{children:r})]})}function wh(s){const r=new URLSearchParams(s).get("agent");return r&&r.length>0?r:null}function Lb(s,r,u){const o=new URLSearchParams(r);u===null?o.delete("agent"):o.set("agent",u);const d=o.toString();return d.length>0?`${s}?${d}`:s}function ip(s){const r=globalThis;if(typeof r.window>"u")return;const u=r.window,o=Lb(u.location.pathname,u.location.search,s);o!==u.location.pathname+u.location.search&&(u.history.pushState({},"",o),u.dispatchEvent(new Event("dashboard:navigate")))}function Ub({selectedAgent:s,agents:r,peerRelationships:u,height:o=420}){return a.jsx("aside",{className:"flex-shrink-0 overflow-y-auto rounded-lg border",style:{width:320,minHeight:o,background:"var(--surface-elev)",borderColor:"var(--border)"},"aria-label":s?`Agent detail: ${s.id}`:"Fleet summary",children:s?a.jsx($b,{agent:s,peerRelationships:u,agents:r}):a.jsx(Bb,{agents:r,peerRelationships:u})})}function Bb({agents:s,peerRelationships:r}){const u=[...s].filter(f=>f.scores.signals>0).sort((f,p)=>p.scores.accuracy-f.scores.accuracy).slice(0,3),o=[];for(const[f,p]of r.entries())if(p.hallucinationsCaught>0){const[h,x]=f.split("::");o.push({pair:[h,x],catches:p.hallucinationsCaught,ts:p.lastInteraction})}o.sort((f,p)=>new Date(p.ts).getTime()-new Date(f.ts).getTime());const d=o.slice(0,5);return a.jsxs("div",{className:"flex h-full flex-col p-4",children:[a.jsx("div",{className:"mb-2 h-section",children:"Fleet at a glance"}),a.jsx("p",{className:"mb-4 font-mono text-[12px]",style:{color:"var(--ink-4)"},children:"Click a node to see detail."}),a.jsx(Th,{label:"Top performers",tone:"success",children:u.length===0?a.jsx(pu,{text:"No agent has logged a signal yet."}):u.map(f=>a.jsxs("button",{type:"button",onClick:()=>ip(f.id),className:"group flex w-full items-center gap-2 rounded px-2 py-2 text-left transition hover:[background:color-mix(in_oklch,var(--accent)_8%,transparent)]",style:{cursor:"pointer"},children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-mono text-[12px] font-semibold",style:{color:"var(--text)"},children:f.id}),a.jsxs("div",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[Math.round(f.scores.accuracy*100),"% accuracy · ",f.scores.signals," signals"]})]}),a.jsx("span",{className:"opacity-0 transition group-hover:opacity-100 font-mono text-[11px]",style:{color:"var(--accent)"},children:"→"})]},f.id))}),a.jsx(Th,{label:"Recent hallucination catches",tone:"danger",children:d.length===0?a.jsx(pu,{text:"No catches in the active window."}):d.map(f=>a.jsxs("div",{className:"rounded px-2 py-2",children:[a.jsxs("div",{className:"font-mono text-[12px]",style:{color:"var(--text)"},children:[a.jsx("span",{style:{color:"var(--danger)"},children:"◆"})," ",f.pair[0]," ↔ ",f.pair[1]]}),a.jsxs("div",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[f.catches," caught · ",Hb(f.ts)]})]},`${f.pair[0]}::${f.pair[1]}`))})]})}function Th({label:s,tone:r,children:u}){const o=r==="success"?"var(--success)":r==="danger"?"var(--danger)":"var(--ink-4)";return a.jsxs("section",{className:"mb-4",children:[a.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5 h-section",children:[a.jsx("span",{style:{width:4,height:4,borderRadius:"50%",background:o,display:"inline-block",flexShrink:0}}),s]}),a.jsx("div",{className:"space-y-1",children:u})]})}function pu({text:s}){return a.jsx("div",{className:"px-2 py-1.5 font-mono text-[11px]",style:{color:"var(--ink-4)"},children:s})}function Hb(s){const r=new Date(s).getTime(),u=Date.now(),o=Math.max(0,Math.floor((u-r)/1e3));return o<60?`${o}s ago`:o<3600?`${Math.floor(o/60)}m ago`:o<86400?`${Math.floor(o/3600)}h ago`:`${Math.floor(o/86400)}d ago`}function $b({agent:s,peerRelationships:r,agents:u}){const o=s.scores.bench.state==="benched"?{label:"BENCHED",color:"var(--danger)"}:s.native?{label:"READY",color:"var(--success)"}:s.online?{label:"ONLINE",color:"var(--success)"}:{label:"OFFLINE",color:"var(--ink-3)"},d=[];for(const p of u){if(p.id===s.id)continue;const h=r.get(si(s.id,p.id));if(!h)continue;const x=h.confirmed+h.disputed+h.hallucinationsCaught;d.push({other:p.id,rel:h,total:x})}d.sort((p,h)=>h.total-p.total);const f=d.slice(0,3);return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"flex items-center gap-1.5 px-4 py-2 h-section",style:{color:o.color,borderBottom:"1px solid var(--border)",background:`color-mix(in oklch, ${o.color} 6%, transparent)`},children:[a.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:o.color,display:"inline-block"}}),o.label]}),a.jsxs("div",{className:"flex items-center gap-3 px-4 pt-4",children:[a.jsx(ri,{agentId:s.id,signals:s.scores.signals,accuracy:s.scores.accuracy,uniqueness:s.scores.uniqueness,impact:s.scores.impactScore,size:48}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-mono text-[14px] font-semibold",style:{color:"var(--ink)"},children:s.id}),a.jsx("div",{className:"truncate font-mono text-[11px]",style:{color:"var(--ink-3)"},children:s.model})]})]}),a.jsxs("div",{className:"mx-4 mt-4 grid grid-cols-2 gap-2",children:[a.jsx(Er,{label:"Accuracy",value:`${Math.round(s.scores.accuracy*100)}%`}),a.jsx(Er,{label:"Reliability",value:s.scores.taskCompletionRate==null?"—":`${Math.round(s.scores.taskCompletionRate*100)}%`}),a.jsx(Er,{label:"Signals",value:s.scores.signals.toLocaleString()}),a.jsx(Er,{label:"Impact",value:`${Math.round(s.scores.impactScore*100)}%`})]}),a.jsxs("div",{className:"mt-4 px-4",children:[a.jsx("div",{className:"mb-1.5 h-section",children:"Top peers"}),f.length===0?a.jsx(pu,{text:"No cross-review history yet."}):a.jsx("div",{className:"space-y-1",children:f.map(({other:p,rel:h})=>a.jsxs("div",{className:"rounded px-2 py-1.5",style:{background:"color-mix(in oklch, var(--surface) 50%, transparent)"},children:[a.jsx("div",{className:"truncate font-mono text-[12px]",style:{color:"var(--ink)"},children:p}),a.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[h.confirmed>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--success)"},children:"✓"})," ",h.confirmed]}),h.disputed>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--warn)"},children:"≠"})," ",h.disputed]}),h.hallucinationsCaught>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--danger)"},children:"◆"})," ",h.hallucinationsCaught]}),a.jsxs("span",{style:{opacity:.6},children:["· ",h.rounds," rounds"]})]})]},p))})]}),s.skills.length>0&&a.jsxs("div",{className:"mt-4 px-4",children:[a.jsxs("div",{className:"mb-1.5 h-section",children:["Skills ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:s.skills.length})]}),a.jsx("div",{className:"flex flex-wrap gap-1",children:s.skills.slice(0,6).map(p=>a.jsx("span",{className:"rounded-sm border px-1.5 py-0.5 font-mono text-[11px]",style:{borderColor:"var(--border)",color:"var(--ink-3)"},children:p},p))})]}),a.jsxs("div",{className:"mt-auto flex flex-col gap-1.5 border-t p-3",style:{borderColor:"var(--border)"},children:[a.jsx(Po,{label:"Open dispatch log",kbd:"⏎",href:`/agent/${encodeURIComponent(s.id)}`}),a.jsx(Po,{label:"View skill graph",kbd:"G",href:`/agent/${encodeURIComponent(s.id)}#skills`,disabled:s.skills.length===0}),a.jsx(Po,{label:"Dispatch consensus",kbd:"⌘D",href:"#",disabled:!0})]})]})}function Er({label:s,value:r}){return a.jsxs("div",{className:"rounded px-2 py-1.5",style:{background:"color-mix(in oklch, var(--surface) 50%, transparent)"},children:[a.jsx("div",{className:"h-section",children:s}),a.jsx("div",{className:"mt-0.5 font-mono text-[16px] font-medium tabular-nums",style:{color:"var(--text)"},children:r})]})}function Po({label:s,kbd:r,href:u,disabled:o}){return a.jsxs("a",{href:o?void 0:`/dashboard${u}`,"aria-disabled":o,tabIndex:o?-1:void 0,className:"flex items-center justify-between rounded px-2 py-2 font-mono text-[12px] transition",style:{background:o?"transparent":"color-mix(in oklch, var(--surface) 50%, transparent)",color:o?"var(--ink-4)":"var(--text)",pointerEvents:o?"none":"auto",opacity:o?.5:1},children:[a.jsx("span",{children:s}),a.jsx("kbd",{className:"rounded border px-1 py-0.5 font-mono text-[10px]",style:{borderColor:"var(--border)",background:"var(--surface-sunk)",color:"var(--ink-3)"},children:r})]})}let En=null,wr=3e3,eu=null;const xu=new Set;function rp(){if((En==null?void 0:En.readyState)===WebSocket.OPEN||(En==null?void 0:En.readyState)===WebSocket.CONNECTING)return;const s=location.protocol==="https:"?"wss:":"ws:";En=new WebSocket(`${s}//${location.host}/dashboard/ws`),En.onopen=()=>{wr=3e3},En.onmessage=r=>{try{const u=JSON.parse(r.data);xu.forEach(o=>o(u))}catch{}},En.onclose=()=>{En=null,eu&&clearTimeout(eu),eu=setTimeout(()=>{wr=Math.min(wr*1.5,3e4),rp()},wr)},En.onerror=()=>{}}function cp(s){return xu.add(s),()=>xu.delete(s)}function op(s){const r=S.useRef(s);r.current=s,S.useEffect(()=>(rp(),cp(u=>r.current(u))),[])}const qb=6e4;function Gb(){const[s,r]=S.useState(null),[u,o]=S.useState(null),d=S.useRef(null),f=()=>{r(null),o(null),d.current!=null&&(window.clearTimeout(d.current),d.current=null)};if(op(h=>{if(h.type==="task_dispatched"){r(h.taskId),o(h.agentId),d.current!=null&&window.clearTimeout(d.current),d.current=window.setTimeout(f,qb);return}if(h.type==="consensus_complete"||h.type==="task_completed"||h.type==="task_failed"){if(h.taskId!==s)return;f()}}),S.useEffect(()=>()=>f(),[]),s===null)return null;const p=s.slice(0,8);return a.jsxs("div",{role:"status","aria-live":"polite",className:"flex items-center gap-3 rounded-md border px-3 py-2 font-mono text-[11px]",style:{background:"color-mix(in oklch, var(--info) 8%, transparent)",borderColor:"color-mix(in oklch, var(--info) 30%, transparent)",color:"var(--text)",animation:"beat-pulse-narrative calc(var(--beat) * 2) ease-in-out infinite"},children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{background:"var(--info)",boxShadow:"0 0 6px var(--info)"}}),a.jsx("span",{style:{color:"var(--text-dim)"},children:"Round in flight"}),a.jsx("span",{className:"font-bold",style:{color:"var(--info)"},children:p}),u&&a.jsxs("span",{style:{color:"var(--text-dim)"},children:["→ ",a.jsx("span",{style:{color:"var(--text)"},children:u})]}),a.jsx("button",{type:"button",onClick:()=>{const h=document.getElementById("consensus-rounds-section");h&&h.scrollIntoView({behavior:"smooth",block:"start"})},className:"ml-auto rounded px-1.5 py-0.5 font-mono text-[10px] transition hover:[background:color-mix(in_oklch,var(--info)_12%,transparent)]",style:{color:"var(--ink-3)",cursor:"pointer"},children:"watch ↓"})]})}const ml=24,Ib={"1h":36e5,"24h":24*36e5,"7d":168*36e5,"30d":720*36e5};function up(s){return Ib[s]}function Yb(s,r,u){const o=up(r),d=o/ml,f=u-o,p=new Array(ml).fill(0);for(const h of s){const x=new Date(h).getTime();if(!Number.isFinite(x)||x<f||x>u)continue;const g=x-f;let b=Math.floor(g/d);b>=ml&&(b=ml-1),p[b]+=1}return p}const Xb=["1h","24h","7d","30d"],Vb={"1h":"1h ago","24h":"24h ago","7d":"7d ago","30d":"30d ago"};function Kb({runs:s,range:r,onRangeChange:u,height:o=52}){const[d,f]=S.useState(()=>Date.now());S.useEffect(()=>{const x=up(r)/ml,g=window.setInterval(()=>f(Date.now()),x);return()=>window.clearInterval(g)},[r]);const p=S.useMemo(()=>{var g;const x=[];for(const b of s){const y=((g=b.signals)==null?void 0:g.length)??0;for(let _=0;_<y;_++)x.push(b.timestamp)}return Yb(x,r,d)},[s,r,d]),h=Math.max(1,...p);return a.jsxs("div",{className:"rounded-md border px-3 py-2",style:{background:"var(--surface-elev)",borderColor:"var(--border)"},children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsx("div",{className:"h-section",children:"Signal volume"}),a.jsx("div",{className:"flex gap-1",children:Xb.map(x=>{const g=x===r;return a.jsx("button",{type:"button",onClick:()=>u(x),"aria-pressed":g,className:"rounded px-2 py-0.5 font-mono text-[10px] transition",style:{background:g?"var(--surface-sunk)":"transparent",color:g?"var(--text)":"var(--text-dim)",border:"1px solid",borderColor:g?"var(--border-strong)":"transparent"},children:x},x)})})]}),a.jsxs("svg",{viewBox:`0 0 ${ml} 1`,preserveAspectRatio:"none",style:{width:"100%",height:o,color:"var(--c1)",display:"block"},children:[a.jsx("rect",{x:0,y:.985,width:ml,height:.015,fill:"var(--ink)",opacity:.08}),p.map((x,g)=>{const b=x===0?0:x/h,y=1-b;return a.jsx("rect",{x:g+.15,y,width:.7,height:Math.max(b,x>0?.04:0),rx:.06,ry:.06,fill:"currentColor",opacity:x===0?0:.9},g)})]}),a.jsxs("div",{className:"mt-1 flex items-center justify-between font-mono text-[10px] tabular-nums",style:{color:"var(--ink-3)"},children:[a.jsx("span",{children:Vb[r]}),a.jsx("span",{children:"now"})]})]})}function Zb(s){const r=[];for(const[u,o]of s.entries())r.push(`${u}:${o.rounds}:${o.confirmed}:${o.disputed}:${o.hallucinationsCaught}`);return r.sort(),r.join("|")}function Qb(s){const r=S.useRef(""),u=S.useRef(new Map);return S.useMemo(()=>{const o=Eb(s??[]),d=Zb(o);return d===r.current?u.current:(r.current=d,u.current=o,o)},[s])}function Fb(s){const r=[];for(const[u,o]of s.entries())r.push(`${u}:${o.critical}:${o.high}:${o.medium}:${o.low}`);return r.sort(),r.join("|")}function dp(s){const r=S.useRef(""),u=S.useRef(new Map);return S.useMemo(()=>{const o=new Map;if(s)for(const f of s){const p=[...f.confirmed??[],...f.disputed??[],...f.unique??[],...f.unverified??[]];for(const h of p){const x=h.originalAgentId;if(!x)continue;const g=o.get(x)??{critical:0,high:0,medium:0,low:0},b=h.severity??"low";b==="critical"?g.critical+=1:b==="high"?g.high+=1:b==="medium"?g.medium+=1:g.low+=1,o.set(x,g)}}const d=Fb(o);return d===r.current?u.current:(r.current=d,u.current=o,o)},[s])}function Jb(){const[s,r]=S.useState(()=>typeof window>"u"?null:wh(window.location.search));return S.useEffect(()=>{const u=()=>{const o=typeof window>"u"?null:wh(window.location.search);r(d=>d===o?d:o)};return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),[s,ip]}const Wb=["1h","24h","7d","30d"];function Pb(s){return typeof s=="string"&&Wb.includes(s)}function tu(s){const r=new URLSearchParams(s).get("range");return Pb(r)?r:null}function e0(s,r,u){const o=new URLSearchParams(r);u===null?o.delete("range"):o.set("range",u);const d=o.toString();return d.length>0?`${s}?${d}`:s}function Ah(s){const r=globalThis;if(!r.window)return;const u=r.window,o=e0(u.location.pathname,u.location.search,s);o!==u.location.pathname+u.location.search&&(u.history.pushState({},"",o),u.dispatchEvent(new Event("dashboard:navigate")))}function t0(){const[s,r]=S.useState(()=>typeof window>"u"?"7d":tu(window.location.search)??"7d");return S.useEffect(()=>{typeof window<"u"&&tu(window.location.search)===null&&Ah(s);const u=()=>{const o=typeof window>"u"?"7d":tu(window.location.search)??"7d";r(d=>d===o?d:o)};return window.addEventListener("dashboard:navigate",u),()=>window.removeEventListener("dashboard:navigate",u)},[]),[s,Ah]}const n0=new Set(["textbox","combobox","listbox","spinbutton","searchbox"]);function a0(s){if(!(s instanceof Element))return!1;const r=s.tagName;if(r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||s.isContentEditable===!0)return!0;const u=s.getAttribute("role");return u!==null&&n0.has(u)}function l0(s){S.useEffect(()=>{if(!s)return;function r(u){a0(u.target)||(u.metaKey||u.ctrlKey)&&(u.key==="d"||u.key==="D")||u.metaKey||u.ctrlKey||u.altKey||(u.key==="Enter"?(u.preventDefault(),ns("/agent/"+encodeURIComponent(s))):(u.key==="g"||u.key==="G")&&(u.preventDefault(),ns("/agent/"+encodeURIComponent(s)+"#skills")))}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[s])}function s0(s){const r=globalThis.window,u=r!=null?r.location.search:"";return new URLSearchParams(u).get("graph")==="0"}function i0({overview:s,agents:r,tasks:u,consensus:o,consensusReports:d,fleetTrend:f,signalActivity:p,skills:h,activeTaskCount:x,setActiveTaskCount:g}){const b=s.actionableFindings,y=s0(),_=Qb(o==null?void 0:o.runs),B=dp(d==null?void 0:d.reports),U=S.useMemo(()=>{const C=new Map;if(f){for(const K of f.points){const te=C.get(K.agentId)??[];te.push(K),C.set(K.agentId,te)}for(const K of C.values())K.sort((te,P)=>te.day.localeCompare(P.day))}return C},[f]),[A,T]=Jb(),[F,Y]=t0();l0(A);const ae=r&&A?r.find(C=>C.id===A)??null:null,[V,E]=S.useState(!y);function G(){const C=!V;E(C);const K=new URL(window.location.href);C?K.searchParams.delete("graph"):K.searchParams.set("graph","0"),window.history.replaceState(null,"",K.toString())}return a.jsxs("div",{className:"mx-auto max-w-6xl space-y-6",children:[a.jsxs("header",{children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[a.jsx("h1",{className:"h-route h-route--lg",children:"Overview"}),a.jsxs("div",{className:"flex items-baseline gap-4",children:[b>0&&a.jsxs("a",{href:ua("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"font-mono text-[11px] transition hover:underline",style:{color:"var(--warn)"},"data-tooltip":"Findings open for operator review",children:[b," actionable →"]}),r&&a.jsx("button",{type:"button",onClick:G,className:"font-mono text-[10px] transition hover:underline",style:{color:"var(--text-dim)"},children:V?"[hide graph]":"[show graph]"})]})]}),a.jsx("p",{className:"mt-1 font-mono text-[13px]",style:{color:"var(--text-dim)"},children:"What your agents are doing right now."})]}),V&&r&&a.jsxs("div",{className:"space-y-3",children:[a.jsx(Gb,{}),a.jsxs("div",{className:"flex items-stretch gap-3",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsx(Db,{agents:r,peerRelationships:_,selectedAgentId:A,onSelectAgent:T})}),a.jsx(Ub,{selectedAgent:ae,agents:r,peerRelationships:_})]}),o&&a.jsx(Kb,{runs:o.runs,range:F,onRangeChange:Y})]}),a.jsx(vv,{overview:s,activeTasks:x,mode:"calm"}),a.jsx(Mv,{onCountChange:g}),r&&a.jsx(Sv,{agents:r,activity:p}),a.jsx(tb,{}),u&&a.jsx(Qv,{tasks:u,limit:3}),r&&a.jsx(Gv,{agents:r,highlightedAgentId:V?A:null,severityMap:B,trendByAgent:U}),a.jsx(nb,{overview:s}),a.jsx(ob,{skills:h??null})]})}const as={confirmed:"var(--ok)",disputed:"var(--bad)",unverified:"var(--info)",unique:"var(--ink-3)"},Lr={confirmed:"confirmed",disputed:"disputed",unverified:"unverified",unique:"unique"},ku={sonnet:"Sonnet",gemini:"Gemini",opus:"Opus",haiku:"Haiku",other:"Other"},ts=["confirmed","disputed","unverified","unique"],r0=.01;function c0({consensusId:s,data:r,onError:u}){const[o,d]=S.useState(r?{kind:"full",data:r}:s?{kind:"loading"}:{kind:"empty"});return S.useEffect(()=>{if(r)return;let f=!1;return d(p=>p.kind==="error"?p:{kind:"loading"}),fetch(`/dashboard/api/consensus-flow?consensusId=${encodeURIComponent(s)}`).then(async p=>{const h=await p.json().catch(()=>({}));if(!p.ok){const x=typeof(h==null?void 0:h.error)=="string"?h.error:`HTTP ${p.status}`;throw new Error(x)}return h}).then(p=>{f||d({kind:"full",data:p})}).catch(p=>{f||(d(h=>({kind:"error",error:p.message,stale:h.kind==="full"?h.data:void 0})),u==null||u(p))}),()=>{f=!0}},[s,r,u]),o.kind==="loading"?a.jsx(h0,{}):o.kind==="empty"?a.jsx(p0,{}):o.kind==="error"?a.jsx(x0,{error:o.error,stale:o.stale}):a.jsx(fp,{data:o.data})}function fp({data:s}){return a.jsxs("div",{className:"rounded-md border p-5",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:[a.jsxs("header",{className:"mb-4 flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"h-section",style:{color:"var(--ink)"},children:"Consensus flow"}),a.jsxs("p",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[s.summary.totalFindings," findings across ",s.agentCount," agents"]})]}),s.coverageDegraded&&a.jsx(o0,{degraded:s.coverageDegraded})]}),a.jsx("div",{className:"hidden lg:block",children:a.jsx(u0,{data:s})}),a.jsx("div",{className:"block lg:hidden",children:a.jsx(f0,{data:s})}),a.jsx(m0,{data:s})]})}function o0({degraded:s}){return a.jsx("span",{className:"rounded-sm px-1.5 py-0.5 font-mono text-[10px]",style:{background:"var(--warn-soft)",color:"var(--warn)",border:"1px solid var(--warn)"},"data-tooltip":`Coverage degraded: expected ${s.expected}, received ${s.received}. Dropped: ${s.droppedAgents.join(", ")||"none"}`,children:"coverage degraded"})}const Eu=720,zr=320,oa=120,gu=0,vu=(Eu-oa)/2,Mh=Eu-oa,nu=8;function u0({data:s}){const r=S.useMemo(()=>d0(s),[s]),u=S.useMemo(()=>r.edges,[r.edges]),o=g0();return a.jsxs("div",{className:"overflow-x-auto",children:[a.jsxs("svg",{viewBox:`0 0 ${Eu} ${zr}`,width:"100%",height:zr,role:"img","aria-label":`Consensus flow: ${s.summary.confirmed} confirmed, ${s.summary.disputed} disputed, ${s.summary.unverified} unverified, ${s.summary.unique} unique of ${s.summary.totalFindings} findings across ${s.agentCount} agents`,style:{display:"block"},children:[a.jsx("g",{children:u.map((d,f)=>a.jsx("path",{d:d.path,fill:d.color,fillOpacity:.55,stroke:"none",style:o?void 0:{animation:`consensus-flow-ribbon-in 480ms ease-out ${f*40}ms both`},children:a.jsx("title",{children:d.tooltip})},`${d.fromFamily}-${d.toVerdict}`))}),a.jsx("g",{children:r.left.map(d=>a.jsxs("g",{children:[a.jsx("rect",{x:gu,y:d.y,width:oa,height:d.h,fill:"var(--ink-4)",fillOpacity:.18}),a.jsxs("text",{x:gu+oa-6,y:d.y+d.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)"},children:[ku[d.family]," · ",d.agentCount]})]},d.family))}),a.jsx("g",{children:r.right.map(d=>a.jsxs("g",{children:[a.jsx("rect",{x:vu,y:d.y,width:oa,height:d.h,fill:as[d.verdict],fillOpacity:.16}),a.jsxs("text",{x:vu+oa/2,y:d.y+d.h/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:[Lr[d.verdict]," · ",d.count]})]},d.verdict))}),a.jsx("g",{children:r.right.map(d=>{const f=s.summary.totalFindings>0?Math.round(d.count/s.summary.totalFindings*100):0;return a.jsxs("g",{children:[a.jsx("rect",{x:Mh,y:d.y,width:oa,height:d.h,fill:as[d.verdict],fillOpacity:.32}),a.jsxs("text",{x:Mh+oa-6,y:d.y+d.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)"},children:[d.count," · ",f,"%"]})]},d.verdict)})})]}),a.jsx("style",{children:`
61
+ @keyframes consensus-flow-ribbon-in {
62
+ from { opacity: 0; }
63
+ to { opacity: 1; }
64
+ }
65
+ @media (prefers-reduced-motion: reduce) {
66
+ svg * { animation: none !important; }
67
+ }
68
+ `})]})}function d0(s){const r=s.summary.totalFindings,u=zr-nu*2,o=new Map;for(const U of s.familyToOutcome)o.set(U.from.family,(o.get(U.from.family)??0)+U.to.count);const d=s.modelFamilyToFindings.reduce((U,A)=>U+(o.get(A.family)??0),0)||1;let f=nu;const p=s.modelFamilyToFindings.map(U=>{const A=o.get(U.family)??0,T=Math.max(20,A/d*u),F={family:U.family,y:f,h:T,agentCount:U.agentCount};return f+=T,F}),h=24;let x=nu;const g=ts.map(U=>{const A=s.summary[U],T=r>0?A/r:0,F=Math.max(h,T*u),Y={verdict:U,y:x,h:F,count:A};return x+=F,Y}),b=new Map,y=new Map,_=[],B=[...s.familyToOutcome].sort((U,A)=>U.from.family!==A.from.family?U.from.family.localeCompare(A.from.family):ts.indexOf(U.to.verdict)-ts.indexOf(A.to.verdict));for(const U of B){const A=p.find(ee=>ee.family===U.from.family),T=g.find(ee=>ee.verdict===U.to.verdict);if(!A||!T)continue;const F=o.get(U.from.family)??0,Y=F>0?U.to.count/F*A.h:0,ae=T.count||1,V=U.to.count/ae*T.h,E=b.get(U.from.family)??0,G=y.get(U.to.verdict)??0;if(b.set(U.from.family,E+Y),y.set(U.to.verdict,G+V),U.weight<r0)continue;const C=A.y+E,K=C+Y,te=T.y+G,P=te+V,he=gu+oa,ne=vu,ue=he+(ne-he)*.5,ye=ne-(ne-he)*.5,O=`M ${he} ${C} C ${ue} ${C}, ${ye} ${te}, ${ne} ${te} L ${ne} ${P} C ${ye} ${P}, ${ue} ${K}, ${he} ${K} Z`,M=s.modelFamilyToFindings.find(ee=>ee.family===U.from.family),I=(M==null?void 0:M.agentCount)??0;_.push({path:O,color:as[U.to.verdict],tooltip:`${I} ${ku[U.from.family]} agent${I===1?"":"s"} → ${U.to.count} ${Lr[U.to.verdict]} finding${U.to.count===1?"":"s"} (${Math.round(U.weight*100)}%)`,fromFamily:U.from.family,toVerdict:U.to.verdict})}return{left:p,right:g,edges:_}}function f0({data:s}){const r=s.summary.totalFindings||1;return a.jsxs("div",{className:"space-y-4",children:[a.jsx(au,{label:"Model families",items:s.modelFamilyToFindings.map(u=>({key:u.family,label:`${ku[u.family]} (${u.agentCount})`,value:u.agentCount,color:"var(--ink-4)"}))}),a.jsx(au,{label:"Findings reviewed",items:ts.map(u=>({key:u,label:`${Lr[u]} (${s.summary[u]})`,value:s.summary[u],color:as[u]}))}),a.jsx(au,{label:"Outcome verdicts",items:ts.map(u=>({key:u,label:`${s.summary[u]} · ${Math.round(s.summary[u]/r*100)}%`,value:s.summary[u],color:as[u]}))})]})}function au({label:s,items:r}){const u=r.reduce((o,d)=>o+d.value,0)||1;return a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[10px]",style:{color:"var(--ink-3)",fontFamily:"var(--font-sans)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:s}),a.jsx("div",{className:"flex h-6 overflow-hidden rounded-sm border",style:{borderColor:"var(--border)"},children:r.map(o=>{const d=o.value/u*100;return d<.5?null:a.jsx("div",{title:o.label,style:{width:`${d}%`,background:o.color,opacity:.7,color:"var(--surface)",fontFamily:"var(--font-mono)",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",overflow:"hidden"},children:d>12?o.label:""},o.key)})})]})}function m0({data:s}){return a.jsxs("div",{className:"mt-4 flex flex-wrap gap-x-4 gap-y-1 border-t pt-3 font-mono text-[10px]",style:{borderColor:"var(--border)",color:"var(--ink-3)"},children:[ts.map(r=>a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-sm",style:{background:as[r]}}),Lr[r]," · ",s.summary[r]]},r)),s.summary.newFindings>0&&a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-sm",style:{background:"var(--warn)"}}),"new · ",s.summary.newFindings]})]})}function h0(){return a.jsxs("div",{className:"rounded-md border p-5",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},"aria-busy":"true","aria-label":"Loading consensus flow",children:[a.jsxs("div",{className:"mb-4 space-y-2",children:[a.jsx("div",{className:"h-3 w-32 animate-pulse rounded-sm",style:{background:"var(--border)"}}),a.jsx("div",{className:"h-2 w-48 animate-pulse rounded-sm",style:{background:"var(--border)"}})]}),a.jsx("div",{className:"grid grid-cols-3 gap-3",style:{height:zr},children:[0,1,2].map(s=>a.jsx("div",{className:"flex flex-col gap-2",children:[0,1,2,3].map(r=>a.jsx("div",{className:"flex-1 animate-pulse rounded-sm",style:{background:"var(--border)",opacity:.6}},r))},s))}),a.jsx("style",{children:`
69
+ @media (prefers-reduced-motion: reduce) {
70
+ .animate-pulse { animation: none !important; }
71
+ }
72
+ `})]})}function p0(){return a.jsx("div",{className:"rounded-md border p-10 text-center",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:a.jsx("p",{className:"font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"No consensus rounds yet — dispatch your first review to see the consensus flow."})})}function x0({error:s,stale:r}){return a.jsxs("div",{className:"relative rounded-md border p-5",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:[a.jsx("div",{className:"absolute right-3 top-3",children:a.jsxs("span",{className:"rounded-sm px-1.5 py-0.5 font-mono text-[10px]",style:{background:"var(--bad-soft)",color:"var(--bad)",border:"1px solid var(--bad)"},title:s,children:["error · ",s]})}),r?a.jsx("div",{style:{opacity:.5,pointerEvents:"none"},children:a.jsx(fp,{data:r})}):a.jsx("p",{className:"py-10 text-center font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"Failed to load consensus flow."})]})}function g0(){const[s,r]=S.useState(!1);return S.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const u=window.matchMedia("(prefers-reduced-motion: reduce)");r(u.matches);const o=d=>r(d.matches);return u.addEventListener("change",o),()=>u.removeEventListener("change",o)},[]),s}function v0({consensusId:s}){return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("nav",{className:"mb-2 flex items-center gap-2 font-mono text-[11px]",style:{color:"var(--ink-3)"},"aria-label":"Breadcrumb",children:[a.jsx("a",{href:ua("/"),className:"hover:underline",style:{color:"var(--ink-3)"},children:"Overview"}),a.jsx("span",{"aria-hidden":"true",children:"›"}),a.jsx("span",{style:{color:"var(--ink)"},children:s})]}),a.jsx("h1",{className:"h-route",children:"Consensus flow"}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px]",style:{color:"var(--ink-3)"},children:"Model families on the left, findings reviewed in the middle, verdicts on the right."})]}),a.jsx(c0,{consensusId:s})]})}function b0({onLogin:s,error:r}){const[u,o]=S.useState(""),[d,f]=S.useState(!1),p=async x=>{if(x.preventDefault(),!(!u.trim()||d)){f(!0);try{await s(u.trim())}finally{f(!1)}}},h=r==="bad_key"?"Invalid key. Check your terminal for the correct key.":r==="network"?"Connection error — relay may be offline.":r==="no_cookie"?"Your browser did not store the session cookie. Disable private/incognito mode or allow cookies for this site, then try again.":null;return a.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--surface)"},children:a.jsxs("div",{className:"w-full max-w-sm rounded-xl border [border-color:var(--border)] p-8 text-center",style:{background:"var(--surface-elev)"},children:[a.jsx("div",{className:"crt-logo mx-auto mb-4",style:{width:"fit-content"},children:a.jsx("img",{src:"/dashboard/assets/gossip-mini.png",alt:"gossipcat",className:"crt-logo-img h-56 w-56 object-contain",style:{filter:"drop-shadow(0 0 28px var(--accent))"}})}),a.jsx("p",{className:"mb-1 font-semibold",style:{fontFamily:"'Geist', var(--font-sans)",fontSize:26,lineHeight:1.1,letterSpacing:"-0.02em",color:"var(--ink)",textShadow:"0 0 24px var(--accent)"},children:"Gossipcat"}),a.jsx("p",{className:"mb-6 text-[13px]",style:{color:"var(--ink-3)"},children:"Authenticate to access the dashboard"}),a.jsxs("form",{onSubmit:p,children:[a.jsx("input",{type:"password",value:u,onChange:x=>o(x.target.value),placeholder:"Dashboard key",autoFocus:!0,disabled:d,className:"w-full rounded-lg border [border-color:var(--border)] px-4 py-3 font-mono text-sm outline-none focus:[border-color:var(--ink-3)] focus:ring-2 focus:[--tw-ring-color:color-mix(in_oklch,var(--ink-3)_20%,transparent)] disabled:opacity-50",style:{background:"var(--surface)",color:"var(--ink)"}}),a.jsx("button",{type:"submit",disabled:d,className:"mt-4 w-full rounded-lg px-4 py-3 text-sm font-semibold transition hover:opacity-90 disabled:opacity-60",style:{background:"var(--accent)",color:"#fff"},children:d?"Unlocking…":"Unlock"})]}),h&&a.jsx("p",{className:"mt-3 text-sm",style:{color:"var(--bad)"},children:h})]})})}const mp="dashboard:theme",y0=["light","dark"];function N0(s){return s==="light"||s==="dark"?s:s==="editorial"?"light":s==="default"?"dark":null}function j0(s,r){const u=N0(s);return u!==null?u:r?"dark":"light"}function S0(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function _0(){if(typeof window>"u")return"light";let s=null;try{s=window.localStorage.getItem(mp)}catch{}return j0(s,S0())}function k0(){const[s,r]=S.useState(_0);S.useEffect(()=>{typeof document>"u"||(s==="light"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=s)},[s]);function u(d){if(y0.includes(d)&&(r(d),typeof window<"u"))try{window.localStorage.setItem(mp,d)}catch{}}return{theme:s,setTheme:u,toggle:()=>{u(s==="light"?"dark":"light")}}}const E0=[{term:"Consensus Round",definition:"A structured multi-agent review session. Each agent independently reviews the target code or output, then all agents cross-review each other's findings. The result is a set of findings tagged by how many agents agreed. The /debates URL in the dashboard lists all past consensus rounds.",seeAlso:"Finding, Signal"},{term:"Finding",definition:"A verifiable claim about a specific line of code, always cited with a file path and line number. Agents emit findings during a consensus round. A finding that cannot be located in the code is a hallucination.",seeAlso:"Insight, Hallucination"},{term:"Insight",definition:"An observation that does not point to a specific code location. Insights are informational — they cannot be confirmed or disputed by other agents and are excluded from accuracy scoring.",seeAlso:"Finding"},{term:"Signal",definition:"A scored event recorded against an agent, such as agreement, hallucination_caught, or unique_confirmed. Each signal adjusts the agent's accuracy and dispatch weight over time. Signals are the primary feedback mechanism that drives agent improvement.",seeAlso:"Accuracy (Adjusted), Dispatch Weight"},{term:"Hallucination",definition:"A fabricated finding: the cited file and line exist, but the code does not support the claim the agent made. Caught during cross-review by a peer agent. Each hallucination lowers the emitting agent's accuracy score.",seeAlso:"Finding, Signal"},{term:"Confirmed / Disputed / Unverified / Unique",definition:"The four statuses assigned to a finding after cross-review. Confirmed = two or more agents independently verified it. Disputed = at least one agent found contradictory evidence. Unverified = peer agents could not check it (no code anchor, out of scope). Unique = only one agent surfaced it; not yet confirmed or denied.",seeAlso:"Consensus Round"},{term:"Dispatch Weight",definition:"How likely an agent is to be selected for the next task. Ranges from 0.3 (rarely dispatched) to 2.0 (strongly preferred). Updated after every task based on accuracy and uniqueness signals. Visible on the Team page.",seeAlso:"Accuracy (Adjusted), Uniqueness"},{term:"Accuracy (Adjusted)",definition:"The fraction of an agent's findings that survived cross-review, with a penalty applied for hallucinations. Category Competency on the agent page shows the raw per-category ratio without the penalty; the Metrics section shows the penalized aggregate used for dispatch decisions.",seeAlso:"Hallucination, Dispatch Weight"},{term:"Uniqueness",definition:"How often this agent surfaces findings that no other agent in the same round found. High uniqueness with low accuracy is a useful combination: always include such agents in a consensus round, but never send them solo.",seeAlso:"Accuracy (Adjusted), Consensus Round"},{term:"Reliability",definition:"Task completion rate — the fraction of dispatched tasks that finished without a pipeline error or timeout. Distinct from accuracy, which measures finding correctness.",seeAlso:"Accuracy (Adjusted)"},{term:"Impact",definition:"A severity-weighted score for an agent's findings. Critical and high findings contribute more than medium or low ones. Impact reflects not just how many findings an agent produces, but how serious those findings tend to be.",seeAlso:"Finding"},{term:"Benched / Struggling / Kept for coverage",definition:"Circuit-breaker states that limit dispatch when an agent underperforms. Benched = fully excluded from dispatch (chronic = sustained low accuracy; burst = recent failure streak). Struggling = consecutive failures tripped the breaker; agent is deprioritized until it recovers. Kept for coverage = the agent would be benched, but it is the only agent with a required skill category, so it stays in the pool.",seeAlso:"Dispatch Weight, Skill"},{term:"Skill",definition:"A markdown file injected into an agent's prompt for a specific task category (e.g. input_validation, trust_boundaries). Skills are generated from an agent's actual failure history and override generic defaults. A skill graduates from pending to passed or failed after 120 post-bind signals.",seeAlso:"bound_at"},{term:"bound_at",definition:"The timestamp when a skill was attached to an agent. This anchors the effectiveness window: only signals recorded after bound_at count toward the skill's graduation verdict.",seeAlso:"Skill"},{term:"Invalid Output Types",definition:"Agent finding tags with a type= attribute outside the allowed set (finding, suggestion, insight). The pipeline silently rejects these — they never reach the consensus round or the dashboard. The count is tracked so skill development can address systematic format drift.",seeAlso:"Finding"},{term:"Process Violation",definition:"A guardrail breach detected outside normal code review. Examples: an agent pushed a commit directly to master bypassing the PR process, or an agent wrote to a file outside its declared scope. Process violations are logged separately from code findings."}],w0={background:"var(--surface-elev)",borderRadius:"16px",boxShadow:"var(--shadow-overlay)",border:"1px solid var(--border)",color:"var(--text)",fontFamily:"var(--font-sans)"};function T0({open:s,onClose:r}){const u=S.useRef(null);return S.useEffect(()=>{if(!s)return;const o=requestAnimationFrame(()=>{var f;(f=u.current)==null||f.focus()}),d=f=>{f.key==="Escape"&&r()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{cancelAnimationFrame(o),document.removeEventListener("keydown",d),document.body.style.overflow=""}},[s,r]),s?a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-6 backdrop-blur-sm",style:{background:"color-mix(in oklch, var(--surface) 80%, transparent)"},onClick:r,role:"presentation",children:a.jsxs("div",{className:"relative flex max-h-[calc(100vh-48px)] w-full max-w-2xl flex-col overflow-hidden",style:w0,role:"dialog","aria-modal":"true","aria-labelledby":"glossary-title",onClick:o=>o.stopPropagation(),children:[a.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border/60 px-5 py-3.5",children:[a.jsx("h2",{id:"glossary-title",className:"font-mono text-sm font-semibold",style:{color:"var(--text)"},children:"Gossipcat Glossary"}),a.jsx("button",{ref:u,onClick:r,"aria-label":"Close glossary",className:"flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded border border-border/40 font-mono text-xs transition hover:[color:var(--text)] hover:[background:var(--surface-sunk)]",style:{background:"var(--surface-elev)",color:"var(--text-dim)"},children:"×"})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:a.jsx("dl",{className:"space-y-5",children:E0.map(({term:o,definition:d,seeAlso:f})=>a.jsxs("div",{className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)"},children:[a.jsx("dt",{className:"h-section",children:o}),a.jsx("dd",{className:"mt-1.5 font-mono text-xs leading-relaxed",style:{color:"color-mix(in oklch, var(--text) 80%, transparent)"},children:d}),f&&a.jsxs("dd",{className:"mt-1.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:["See also: ",f]})]},o))})}),a.jsx("div",{className:"shrink-0 border-t border-border/60 px-5 py-3",children:a.jsx("a",{href:"https://github.com/gossipcat-ai/gossipcat-ai/blob/master/docs/HANDBOOK.md",target:"_blank",rel:"noopener noreferrer",className:"font-mono text-xs transition hover:underline",style:{color:"var(--accent)"},children:"Read the full HANDBOOK →"})})]})}):null}const A0=[{to:"/",label:"Dashboard",match:s=>s==="/"||s==="/overview"},{to:"/chat",label:"Chat",match:s=>s==="/chat"},{to:"/team",label:"Team",match:s=>s==="/team"||s.startsWith("/agent/")},{to:"/debates",label:"Consensus Rounds",match:s=>s==="/debates"},{to:"/tasks",label:"Tasks",match:s=>s==="/tasks"},{to:"/signals",label:"Signals",match:s=>s==="/signals"},{to:"/logs",label:"Logs",match:s=>s==="/logs"}];function lu(){const[s,r]=S.useState(!1),u=Gh(),{theme:o,toggle:d}=k0();return a.jsxs("nav",{className:"relative flex items-center justify-between border-b border-border px-6 py-3.5",children:[a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs("a",{href:ua("/"),className:"flex items-center gap-3 leading-none",children:[a.jsx("img",{src:"/dashboard/assets/gossip-mini.png",alt:"",className:"h-10 w-10 object-contain"}),a.jsx("span",{className:"text-[17px] font-bold",style:{color:"var(--accent)"},children:"gossipcat"})]}),a.jsx("div",{className:"flex gap-1",children:A0.map(f=>{const p=f.match(u);return a.jsx("a",{href:ua(f.to),className:`rounded-md px-3.5 py-1.5 font-mono text-[13px] transition ${p?"font-semibold":"hover:bg-accent/10"}`,style:p?{background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"var(--accent)"}:{color:"var(--ink-3)"},children:f.label},f.to)})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{"aria-hidden":"true",title:"Search — coming soon",style:{display:"inline-flex",alignItems:"center",gap:"8px",height:"32px",padding:"0 12px",minWidth:"220px",background:"var(--surface-elev)",border:"1px solid var(--border)",borderRadius:"8px",color:"var(--ink-3)",fontFamily:"var(--font-sans)",fontSize:"13px",cursor:"default"},children:[a.jsx("span",{style:{opacity:.7},children:"Search…"}),a.jsx("kbd",{style:{marginLeft:"auto",padding:"1px 6px",borderRadius:"4px",background:"var(--surface-sunk)",border:"1px solid var(--border)",fontFamily:"var(--font-mono)",fontSize:"11px",color:"var(--ink-3)"},children:"⌘K"})]}),a.jsx("button",{type:"button",onClick:d,title:`Switch to ${o==="light"?"dark":"light"} theme`,"aria-label":`Switch to ${o==="light"?"dark":"light"} theme`,style:{width:"32px",height:"32px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"var(--surface-elev)",border:"1px solid var(--border)",borderRadius:"8px",color:"var(--ink)",cursor:"pointer",fontSize:"16px",lineHeight:1},children:o==="light"?"◐":"◑"}),a.jsx("button",{type:"button",onClick:()=>r(!0),"aria-label":"Open glossary",title:"Glossary",style:{width:"32px",height:"32px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"var(--surface-elev)",border:"1px solid var(--border)",borderRadius:"8px",color:"var(--ink)",cursor:"pointer",lineHeight:1},children:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),a.jsx("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"})]})})]}),a.jsx(T0,{open:s,onClose:()=>r(!1)})]})}const M0={completed:{label:"COMPLETED",cls:"text-confirmed bg-confirmed/10"},failed:{label:"FAILED",cls:"text-destructive bg-destructive/10"},cancelled:{label:"CANCELLED",cls:"",clsStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"}},running:{label:"RUNNING",cls:"text-unverified bg-unverified/10 animate-pulse"}};function hp({task:s,onClose:r}){if(S.useEffect(()=>{if(!s)return;const d=f=>{f.key==="Escape"&&r()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[s,r]),!s)return null;const u=M0[s.status],o=(s.inputTokens||0)+(s.outputTokens||0);return a.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-6 backdrop-blur-sm",style:{background:"color-mix(in oklch, var(--surface) 80%, transparent)"},onClick:r,children:a.jsxs("div",{className:"relative mt-12 w-full max-w-3xl rounded-lg border border-border",style:{background:"var(--surface-elev)",boxShadow:"var(--shadow-overlay)"},onClick:d=>d.stopPropagation(),children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-border/60 px-5 py-4",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${u.cls}`,style:u.clsStyle,children:u.label}),a.jsx("span",{className:"warn-badge shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",children:s.taskId.slice(0,8)}),a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(s.agentId)}`,className:"truncate font-mono text-xs transition",style:{color:"var(--text-dim)"},children:s.agentId})]}),a.jsxs("div",{className:"mt-2 flex flex-wrap gap-3 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("span",{children:wt(s.timestamp)}),s.duration!=null&&a.jsxs("span",{children:["· ",xv(s.duration)]}),o>0&&a.jsxs("span",{children:["· ",o.toLocaleString()," tokens (",(s.inputTokens||0).toLocaleString()," in / ",(s.outputTokens||0).toLocaleString()," out)"]})]})]}),a.jsx("button",{onClick:r,className:"shrink-0 rounded-md border border-border/40 px-2 py-1 font-mono text-xs transition hover:bg-accent/10",style:{background:"var(--surface-elev)",color:"var(--text-dim)"},"aria-label":"Close",children:"✕"})]}),a.jsxs("div",{className:"max-h-[calc(100vh-220px)] space-y-5 overflow-y-auto px-5 py-4",children:[a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 h-section",children:"Task"}),a.jsx("div",{className:"task-md rounded-md border border-border/40 p-3 text-xs leading-relaxed overflow-x-auto",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",color:"color-mix(in oklch, var(--text) 90%, transparent)"},dangerouslySetInnerHTML:{__html:mv(s.task)}})]}),s.result?a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 h-section",children:"Result"}),a.jsx("div",{className:"finding-md rounded-md border border-border/40 p-3 font-mono text-xs leading-relaxed whitespace-pre-wrap [&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:text-[var(--cite-fn)] [&_.inline-code]:rounded [&_.inline-code]:bg-[color-mix(in_oklch,var(--surface-sunk)_40%,transparent)] [&_.inline-code]:px-1 [&_.inline-code-block]:my-2 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:bg-[color-mix(in_oklch,var(--surface-sunk)_30%,transparent)] [&_.inline-code-block]:p-2",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",color:"color-mix(in oklch, var(--text) 90%, transparent)"},dangerouslySetInnerHTML:{__html:ii(s.result)}})]}):a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 h-section",children:"Result"}),a.jsx("div",{className:"rounded-md border border-border/40 p-3 text-center font-mono text-xs",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",color:"var(--text-dim)"},children:s.status==="running"?"Task is still running...":"No result recorded."})]})]})]})})}function bu(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}const su=5,iu={agreement:{label:"CONFIRMED",filter:"confirmed",cls:"text-confirmed bg-confirmed/10"},consensus_verified:{label:"CONFIRMED",filter:"confirmed",cls:"text-confirmed bg-confirmed/10"},disagreement:{label:"DISPUTED",filter:"disputed",cls:"text-disputed bg-disputed/10"},hallucination_caught:{label:"DISPUTED",filter:"disputed",cls:"text-disputed bg-disputed/10"},unverified:{label:"UNVERIFIED",filter:"unverified",cls:"text-unverified bg-unverified/10"},unique_confirmed:{label:"UNIQUE",filter:"unique",cls:"text-unique bg-unique/10"},unique_unconfirmed:{label:"UNIQUE?",filter:"unique",cls:"text-unverified bg-unverified/10"},new_finding:{label:"NEW",filter:"unique",cls:"text-unique bg-unique/10"}},Ch=[{key:"all",label:"All",cls:"border-border/40 hover:border-border/60",activeCls:"border-border",activeStyle:{color:"var(--text)",background:"var(--surface-sunk)"},inactiveStyle:{color:"var(--text-dim)"}},{key:"confirmed",label:"Confirmed",cls:"text-confirmed/50 border-confirmed/20 hover:border-confirmed/40",activeCls:"text-confirmed bg-confirmed/10 border-confirmed/40"},{key:"unique",label:"Unique",cls:"text-unique/50 border-unique/20 hover:border-unique/40",activeCls:"text-unique bg-unique/10 border-unique/40"},{key:"disputed",label:"Disputed",cls:"text-disputed/50 border-disputed/20 hover:border-disputed/40",activeCls:"text-disputed bg-disputed/10 border-disputed/40"},{key:"unverified",label:"Unverified",cls:"text-unverified/50 border-unverified/20 hover:border-unverified/40",activeCls:"text-unverified bg-unverified/10 border-unverified/40"},{key:"insight",label:"Insight",cls:"text-insight/60 border-insight/20 hover:border-insight/40",activeCls:"text-insight bg-insight/10 border-insight/40",tooltip:"Observations without a specific file:line anchor. Not scored — cannot be confirmed or disputed by peers."}],C0=[{key:"all",label:"All",cls:"border-border/40 hover:border-border/60",activeCls:"border-border",activeStyle:{color:"var(--text)",background:"var(--surface-sunk)"},inactiveStyle:{color:"var(--text-dim)"}},{key:"critical",label:"Critical",cls:"text-bad/50 border-bad/20 hover:border-bad/40",activeCls:"text-bad bg-bad/10 border-bad/40"},{key:"high",label:"High",cls:"text-severity-high/50 border-severity-high/20 hover:border-severity-high/40",activeCls:"text-severity-high bg-severity-high/10 border-severity-high/40"},{key:"medium",label:"Medium",cls:"text-severity-medium/50 border-severity-medium/20 hover:border-severity-medium/40",activeCls:"text-severity-medium bg-severity-medium/10 border-severity-medium/40"},{key:"low",label:"Low",cls:"border-border/40 hover:border-border/60",activeCls:"border-border",activeStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},inactiveStyle:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"}}],R0={critical:"text-bad bg-bad/10",high:"text-severity-high bg-severity-high/10",medium:"text-severity-medium bg-severity-medium/10",low:""},O0={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},D0="[&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-[var(--cite-fn)] [&_.inline-code]:rounded [&_.inline-code]:[background:var(--surface-sunk)] [&_.inline-code]:px-1 [&_.inline-code]:py-0.5 [&_.inline-code]:font-mono [&_.inline-code]:text-[11px] [&_.inline-code]:[color:color-mix(in_oklch,var(--text)_80%,transparent)] [&_.inline-code-block]:my-1.5 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:[background:color-mix(in_oklch,var(--surface-sunk)_70%,transparent)] [&_.inline-code-block]:p-2 [&_.inline-code-block]:font-mono [&_.inline-code-block]:text-[11px] [&_.inline-code-block]:[color:color-mix(in_oklch,var(--text)_70%,transparent)] [&_.inline-code-block]:overflow-x-auto",z0={HTML_ENTITY_ENCODED_TAGS:"HTML-entity-encoded <agent_finding> tags — parser saw 0 tags",HTML_ENTITY_MIXED_PAYLOAD:"Mixed raw + HTML-entity-encoded tags — some findings dropped",SCHEMA_DRIFT_PHASE2_VERDICT_TOKENS:"Schema drift — Phase-2 consensus verdict types emitted (confirmed/disputed/unique/verdict)",SCHEMA_DRIFT_INVENTED_TYPE_TOKENS:"Schema drift — invented <agent_finding> type names (valid: finding | suggestion | insight)",SCHEMA_DRIFT_NESTED_SUBTAGS:'Schema drift — nested <type>...</type> subtags instead of type="..." attribute'};function L0({f:s,reviewInfo:r,diagnostics:u}){const o=s.tag==="confirmed"?"text-confirmed bg-confirmed/10 border-confirmed/20":s.tag==="disputed"?"text-disputed bg-disputed/10 border-disputed/20":s.tag==="unverified"?"text-unverified bg-unverified/10 border-unverified/20":"text-unique bg-unique/10 border-unique/20",d=s.severity&&R0[s.severity]||"",f=s.severity==="low"?O0:void 0,p=s.findingType==="suggestion"?"SUGGESTION":s.findingType==="insight"?"INSIGHT":null,h=s.findingType==="suggestion"?"text-info bg-info/10":s.findingType==="insight"?"text-text-dim bg-text-dim/10":"",x=s.finding.match(/<cite\s+tag="file">([^<]+)<\/cite>/),g=x?x[1]:null;return a.jsxs("div",{className:"rounded-md border border-border/40 hover:border-border/60 transition-colors px-4 py-3.5",style:{background:"color-mix(in oklch, var(--surface-elev) 30%, transparent)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${o}`,children:s.tag.toUpperCase()}),s.severity&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${d}`,style:f,children:s.severity.toUpperCase()}),p&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${h}`,children:p}),g&&a.jsx("span",{className:"bg-info/10 px-2 py-1 font-mono text-[10px] text-info border border-info/15 rounded",children:g}),a.jsx("span",{className:"ml-auto font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:s.originalAgentId}),s.confirmedBy&&s.confirmedBy.length>0&&(()=>{const b=[...new Set(s.confirmedBy)];return a.jsxs("span",{className:"cursor-help rounded px-1 py-0.5 font-mono text-[10px] text-confirmed/50 transition hover:bg-confirmed/10","data-tooltip":`Verified by:
73
+ ${b.join(", ")}`,"data-tooltip-pos":"left",children:["+",b.length," ✓"]})})(),s.disputedBy&&s.disputedBy.length>0&&a.jsxs("span",{className:"cursor-help rounded px-1 py-0.5 font-mono text-[10px] text-disputed/50 transition hover:bg-disputed/10","data-tooltip":`Disputed by:
74
+ ${s.disputedBy.map(b=>b.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[s.disputedBy.length," ⚡"]}),s.unverifiedBy&&s.unverifiedBy.length>0&&a.jsxs("span",{className:"cursor-help rounded px-1 py-0.5 font-mono text-[10px] text-unverified/50 transition hover:bg-unverified/10","data-tooltip":`Unverified by:
75
+ ${s.unverifiedBy.map(b=>b.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[s.unverifiedBy.length," ◇"]})]}),u&&u.length>0&&a.jsx("div",{className:"mt-1.5 mb-1 space-y-1",children:u.map((b,y)=>a.jsxs("div",{className:"rounded border border-unverified/20 bg-unverified/5 px-2.5 py-1.5","data-diagnostic-code":b.code,children:[a.jsxs("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-unverified/80",children:["⚠ ",b.code]}),a.jsx("div",{className:"mt-0.5 text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},dangerouslySetInnerHTML:{__html:bu(z0[b.code])+" — "+bu(b.message)}})]},y))}),s.disputedBy&&s.disputedBy.length>0&&a.jsx("div",{className:"mt-1.5 mb-1 rounded border border-disputed/10 bg-disputed/5 px-2.5 py-1.5",children:s.disputedBy.map((b,y)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"font-mono font-bold text-disputed/70",children:b.agentId}),a.jsxs("span",{style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[" — ",b.reason||b.evidence||"No reason given"]})]},y))}),a.jsx("div",{className:`finding-md font-inter text-xs leading-relaxed ${D0}`,style:{color:"var(--text-dim)"},dangerouslySetInnerHTML:{__html:ii(s.finding)}}),r&&a.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[r.reviewers.map(b=>a.jsx("span",{title:b,className:"inline-flex h-5 w-5 items-center justify-center rounded-full font-mono text-[8px] font-bold text-background opacity-70",style:{backgroundColor:qn(b)},children:uu(b)},b)),a.jsxs("span",{className:`rounded px-1.5 py-0.5 font-mono text-[9px] font-bold ${r.assigned>=r.targetK?"text-confirmed/70 bg-confirmed/5":"text-unverified/70 bg-unverified/5"}`,children:[r.assigned>=r.targetK?"✓":"⚠"," ",r.assigned,"/",r.targetK]})]})]})}function U0({consensus:s,reports:r,showAll:u=!1,hideHeader:o=!1,filteredRuns:d}){const f=d??s.runs,p=u?f:f.slice(0,su);!u&&f.length>su;const[h,x]=S.useState(null),[g,b]=S.useState("all"),[y,_]=S.useState("all"),[B,U]=S.useState(1),[A,T]=S.useState([]),[F,Y]=S.useState(0),[ae,V]=S.useState(!1),[E,G]=S.useState({});S.useEffect(()=>{if(!u&&(r!=null&&r.reports)&&(T(r.reports),Y(r.totalReports??r.reports.length),U(1)),r!=null&&r.roundRetractions){const O={};for(const M of r.roundRetractions)O[M.consensus_id]={reason:M.reason,retracted_at:M.retracted_at};G(O)}},[r,u]),S.useEffect(()=>{if(!u)return;let O=!1;return(async()=>{var M;try{const I=await ut("consensus-reports?page=1&pageSize=200");if(O)return;if(T(I.reports||[]),Y(I.totalReports??(((M=I.reports)==null?void 0:M.length)||0)),U(1),I.roundRetractions){const ee={};for(const oe of I.roundRetractions)ee[oe.consensus_id]={reason:oe.reason,retracted_at:oe.retracted_at};G(ee)}}catch{}})(),()=>{O=!0}},[u]);const C=A.slice().sort((O,M)=>M.timestamp.localeCompare(O.timestamp)),K=10,[te,P]=S.useState(0),he=Math.max(1,Math.ceil(C.length/K)),ne=Math.min(te,he-1),ue=u?C.slice(ne*K,(ne+1)*K):C.slice(0,su),ye=O=>{const M=new Date,I=new Date(O),ee=me=>new Date(me.getFullYear(),me.getMonth(),me.getDate()).getTime(),oe=Math.round((ee(M)-ee(I))/864e5);return oe<=0?"Today":oe===1?"Yesterday":oe<7?`${oe} days ago`:oe<30?`${Math.floor(oe/7)} weeks ago`:I.toISOString().slice(0,10)};return a.jsxs("section",{children:[!o&&a.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Consensus Rounds ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:s.totalRuns??s.runs.length})]}),!u&&a.jsx("a",{href:"/dashboard/debates",className:"font-mono text-xs transition",style:{color:"var(--text-dim)"},children:"view all"})]}),ue.length>0?a.jsxs("div",{className:"space-y-2",children:[ue.map((O,M)=>{const I=M>0?ue[M-1]:null,ee=u?ye(O.timestamp):null,oe=u&&I?ye(I.timestamp):null,me=u&&ee!==oe,j={};if(O.crossReviewAssignments||O.crossReviewCoverage){const ie={};if(O.crossReviewAssignments)for(const[we,$e]of Object.entries(O.crossReviewAssignments))for(const mt of $e)(ie[mt]??(ie[mt]=[])).push(we);if(O.crossReviewCoverage)for(const we of O.crossReviewCoverage)j[we.findingId]={reviewers:ie[we.findingId]||[],assigned:we.assigned,targetK:we.targetK};else for(const[we,$e]of Object.entries(ie))j[we]={reviewers:$e,assigned:$e.length,targetK:$e.length}}const H=[...O.confirmed,...O.disputed,...O.unverified,...O.unique,...O.insights||[]],le=g==="all"?H:g==="insight"?H.filter(ie=>ie.findingType==="insight"||ie.findingType==="suggestion"):H.filter(ie=>ie.tag===g),W=y==="all"?le:le.filter(ie=>ie.severity===y),q=h===O.id,de=(()=>{const ie=new Set;return we=>{var Kt;const $e=(Kt=O.authorDiagnostics)==null?void 0:Kt[we.originalAgentId];if(!$e||$e.length===0)return;const mt=$e.filter(nt=>{const Tt=`${we.originalAgentId}:${nt.code}`;return ie.has(Tt)?!1:(ie.add(Tt),!0)});return mt.length>0?mt:void 0}})(),xe=H.length||1,Ie=O.confirmed.length,Re=O.disputed.length,it=O.unverified.length,Vt=O.unique.length,Lt=(O.insights||[]).length,Cn=(()=>{if(xe===0)return"border-l-border/40";const ie=Ie/xe,we=Re/xe;return ie>=.5?"border-l-confirmed/60":we>=.4?"border-l-disputed/60":"border-l-unverified/50"})(),qt=[{count:Ie,textCls:"text-confirmed",label:"confirmed"},{count:Re,textCls:"text-disputed",label:"disputed"},{count:it,textCls:"text-unverified",label:"unverified"},{count:Vt,textCls:"text-unique",label:"unique"},{count:Lt,textCls:"text-zinc-400",label:"insights"}].filter(ie=>ie.count>0),Ye=[...new Set(H.map(ie=>ie.originalAgentId).filter(Boolean))],wn=Ye.slice(0,5),hn=E[O.id],Rn=!!hn;return a.jsxs("div",{children:[me&&a.jsxs("div",{className:`mb-2 flex items-center gap-3 ${M>0?"mt-4":""}`,children:[a.jsx("span",{className:"h-section",children:ee}),a.jsx("div",{className:"h-px flex-1 bg-border/30"})]}),a.jsxs("div",{className:`group rounded-md border-l-2 border border-border/40 transition-all duration-150
76
+ ${Cn}
77
+ ${Rn?"opacity-60 line-through decoration-disputed/40":""}
78
+ ${q?"border-r-border/60 border-t-border/60 border-b-border/60":"hover:border-r-border/60 hover:border-t-border/60 hover:border-b-border/60 hover:-translate-y-px"}`,style:{background:q?"var(--surface-elev)":"color-mix(in oklch, var(--surface-elev) 50%, transparent)"},"data-retracted":Rn?"true":void 0,children:[Rn&&a.jsxs("div",{className:"no-underline rounded-t-md border-b border-disputed/30 bg-disputed/10 px-3 py-2 font-mono text-[11px] text-disputed",style:{textDecoration:"none"},children:[a.jsx("span",{className:"font-bold",children:"⚠ RETRACTED"}),hn.retracted_at&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",hn.retracted_at.slice(0,10)]}),hn.reason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",hn.reason]})]}),a.jsxs("button",{className:"flex w-full items-start gap-3 px-3 py-2.5 text-left","aria-expanded":q,onClick:()=>{const ie=!q;x(ie?O.id:null),ie&&(b("all"),_("all"))},children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-sm font-bold",style:{color:"var(--text)"},children:H.length}),a.jsx("span",{className:"text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:"findings"}),a.jsx("span",{className:"text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 30%, transparent)"},children:"·"}),a.jsxs("span",{className:"text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[O.rounds,"r"]}),wn.length>0&&a.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[wn.map(ie=>a.jsx("span",{title:ie,className:"inline-flex h-4 w-4 items-center justify-center rounded-full font-mono text-[8px] font-bold",style:{color:"var(--surface)",backgroundColor:qn(ie)},children:uu(ie)},ie)),Ye.length>5&&a.jsxs("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["+",Ye.length-5]})]}),a.jsx("span",{className:"shrink-0 rounded border border-border/30 px-1.5 py-0.5 font-mono text-[10px] font-semibold",style:{background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)",color:"var(--text-dim)"},title:O.id,children:O.id.slice(0,8)}),O.zeroTagAgents&&O.zeroTagAgents.length>0&&(()=>{const ie=O.zeroTagAgents,we=O.zeroTagOverflow??0,$e=ie.length+we,mt=we>0?`${ie.join(", ")} (+${we} more)`:ie.join(", ");return a.jsxs("span",{className:"shrink-0 rounded border border-unverified/20 bg-unverified/5 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-unverified",title:`Zero-tag agents — emitted no parseable <agent_finding> tags (likely paraphrased relay or HTML-entity encoding). See HANDBOOK invariant #12. Agents: ${mt}`,children:[$e," zero-tag"]})})(),O.droppedFindingsByType&&Object.keys(O.droppedFindingsByType).length>0&&(()=>{const ie=Object.entries(O.droppedFindingsByType),we=ie.reduce((mt,[,Kt])=>mt+Kt,0),$e=ie.map(([mt,Kt])=>`${mt}:${Kt}`).join(", ");return a.jsxs("span",{className:"shrink-0 rounded border border-unverified/20 bg-unverified/5 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-unverified",title:`Silently dropped <agent_finding> tags with invalid type=: ${$e}. These never reach the dashboard, scores, or signals.`,children:[we," dropped"]})})(),O.warnings&&O.warnings.length>0&&(()=>{const ie=new Map;for(const we of O.warnings){const $e=ie.get(we.code)??[];$e.push(we.agentId?`${we.agentId}: ${we.message}`:we.message),ie.set(we.code,$e)}return Array.from(ie.entries()).map(([we,$e])=>a.jsxs("span",{className:"shrink-0 rounded border border-warn/30 bg-warn/10 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-warn",title:$e.join(`
79
+ `),children:[we,$e.length>1?` ×${$e.length}`:""]},we))})(),a.jsx("span",{className:"ml-auto font-mono text-[10px] shrink-0",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:wt(O.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex items-center gap-3",children:qt.map(ie=>a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${ie.textCls}`,children:[ie.count," ",ie.label]},ie.label))}),O.topic&&a.jsxs("div",{className:"mt-1.5 flex items-start gap-2",children:[a.jsx("span",{className:"shrink-0 rounded border border-border/30 px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Topic"}),a.jsx("span",{className:"font-inter text-[11px] leading-relaxed",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:O.topic})]})]}),a.jsx("span",{className:`mt-1 shrink-0 font-mono text-[10px] transition-transform duration-150 ${q?"rotate-90":""}`,style:{color:q?"color-mix(in oklch, var(--ink) 60%, transparent)":"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:"▸"})]}),q&&a.jsxs("div",{className:"border-t border-border/20 px-4 pb-4 pt-3",children:[a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Type:"}),Ch.map(ie=>a.jsx("button",{onClick:()=>b(ie.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${g===ie.key?ie.activeCls:ie.cls}`,style:g===ie.key?ie.activeStyle:ie.inactiveStyle,...ie.tooltip?{"data-tooltip":ie.tooltip}:{},children:ie.label},ie.key))]}),a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Severity:"}),C0.map(ie=>a.jsx("button",{onClick:()=>_(ie.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${y===ie.key?ie.activeCls:ie.cls}`,style:y===ie.key?ie.activeStyle:ie.inactiveStyle,children:ie.label},ie.key))]}),(O.warnings??[]).filter(ie=>ie.code==="coverage_degraded").map((ie,we)=>a.jsx("div",{className:"mb-3 rounded-md border border-warn/30 bg-warn/10 px-3 py-2",children:a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-warn",children:["⚠ ",ie.message]})},`cd-${we}`)),O.zeroTagAgents&&O.zeroTagAgents.length>0&&a.jsxs("div",{className:"mb-3 rounded-md border border-unverified/20 bg-unverified/8 px-3 py-2",children:[a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-unverified",children:["⚠ Zero-tag agents — ",O.zeroTagAgents.length+(O.zeroTagOverflow??0)," agent",O.zeroTagAgents.length+(O.zeroTagOverflow??0)===1?"":"s"," emitted no parseable <agent_finding> tags"]}),a.jsxs("p",{className:"mt-0.5 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:[O.zeroTagAgents.join(", "),O.zeroTagOverflow&&O.zeroTagOverflow>0?` (+${O.zeroTagOverflow} more)`:""]}),a.jsx("p",{className:"mt-1 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Likely a paraphrased relay or HTML-entity-encoded tags. See HANDBOOK invariant #12."})]}),(()=>{const ie=(O.warnings??[]).filter($e=>$e.code==="cross_review_skipped");if(ie.length===0)return null;const we=ie.map($e=>$e.agentId).filter(Boolean);return a.jsxs("div",{className:"mb-3 rounded-md border border-warn/30 bg-warn/10 px-3 py-2",children:[a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-warn",children:["⚠ Cross-review skipped: ",ie.length," relay agent",ie.length===1?"":"s"," failed Phase 2"]}),we.length>0&&a.jsx("p",{className:"mt-0.5 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:we.join(", ")})]})})(),(O.crossReviewAssignments||O.crossReviewCoverage)&&(()=>{const ie=O.crossReviewAssignments||{},we=Object.entries(ie),$e=O.crossReviewCoverage||[],mt=$e.length,Kt=$e.filter(Tt=>Tt.assigned<Tt.targetK),nt=(O.warnings??[]).some(Tt=>Tt.code==="partial_review");return a.jsxs("details",{className:"mb-3 rounded-md border border-border/30",style:{background:"color-mix(in oklch, var(--surface-elev) 30%, transparent)"},children:[a.jsxs("summary",{className:"flex cursor-pointer items-center gap-2 px-3 py-2 h-section select-none",children:["Cross-Review Assignments",nt&&a.jsx("span",{className:"rounded border border-warn/20 bg-warn/10 px-1.5 py-0.5 font-mono text-[9px] font-bold normal-case tracking-normal text-warn",children:"partial"}),a.jsxs("span",{className:"ml-auto font-mono text-[9px] font-normal normal-case tracking-normal",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[we.length," reviewers · ",mt," findings"]})]}),a.jsxs("div",{className:"border-t border-border/20 px-3 pb-3 pt-2 space-y-2",children:[we.map(([Tt,pn])=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{title:Tt,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full font-mono text-[8px] font-bold",style:{color:"var(--surface)",backgroundColor:qn(Tt)},children:uu(Tt)}),a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:Tt}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["(",pn.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1 ml-1",children:pn.map(xn=>a.jsx("span",{className:"rounded px-1.5 py-0.5 font-mono text-[9px]",style:{background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)",color:"var(--text-dim)"},children:xn.length>12?xn.slice(0,12)+"…":xn},xn))})]},Tt)),mt>0&&a.jsx("div",{className:"mt-1 pt-1.5 border-t border-border/15",children:Kt.length>0?a.jsxs("span",{className:"rounded border border-unverified/15 bg-unverified/5 px-2 py-1 font-mono text-[10px] font-semibold text-unverified",children:["⚠ ",Kt.length," of ",mt," findings under-reviewed"]}):a.jsxs("span",{className:"font-mono text-[10px] font-semibold text-confirmed/60",children:["✓ All ",mt," findings fully covered"]})})]})]})})(),a.jsx("div",{className:"space-y-3",children:W.length===0?a.jsx("div",{className:"py-4 text-center text-xs",style:{color:"var(--text-dim)"},children:"No findings match this filter."}):W.map((ie,we)=>a.jsx(L0,{f:ie,reviewInfo:ie.id?j[ie.id]:void 0,diagnostics:de(ie)},we))})]})]})]},O.id)}),u&&he>1&&a.jsxs("div",{className:"flex items-center justify-center gap-3 pt-4 font-mono text-[11px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{onClick:()=>P(O=>Math.max(0,O-1)),disabled:ne===0,className:"rounded-sm border border-border/40 px-3 py-1 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{children:["Page ",ne+1," of ",he]}),a.jsx("button",{onClick:()=>P(O=>Math.min(he-1,O+1)),disabled:ne>=he-1,className:"rounded-sm border border-border/40 px-3 py-1 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]}):p.length===0?a.jsx(ls,{title:"No consensus runs yet",hint:"Dispatch a consensus round with gossip_dispatch to populate this view."}):a.jsx("div",{className:"space-y-2",children:p.map((O,M)=>{const I=O.counts,ee=(I.agreement||0)+(I.disagreement||0)+(I.hallucination||0)+(I.unverified||0)+(I.unique||0)+(I.new||0),oe=ee||1,me=h===O.taskId,j=[{key:"confirmed",count:I.agreement||0,color:"bg-confirmed",text:"text-confirmed",label:"confirmed"},{key:"disputed",count:(I.disagreement||0)+(I.hallucination||0),color:"bg-disputed",text:"text-disputed",label:"disputed"},{key:"unverified",count:I.unverified||0,color:"bg-unverified",text:"text-unverified",label:"unverified"},{key:"unique",count:(I.unique||0)+(I.new||0),color:"bg-unique",text:"text-unique",label:"unique"}],H=O.signals.filter(W=>{if(W.signal==="signal_retracted")return!1;if(g==="all")return!!iu[W.signal];const q=iu[W.signal];return q&&q.filter===g}),le=!!O.retracted;return a.jsxs("div",{className:`rounded-md border transition ${me?"border-primary/25":"border-border"} ${le?"opacity-60":""}`,style:{background:"var(--surface-elev)"},"data-retracted":le?"true":void 0,title:le&&O.retractionReason?`Retracted: ${O.retractionReason}`:void 0,children:[le&&a.jsxs("div",{className:"rounded-t-md border-b border-disputed/30 bg-disputed/10 px-3 py-1.5 font-mono text-[10px] text-disputed",style:{textDecoration:"none"},children:[a.jsx("span",{className:"font-bold uppercase tracking-wider",children:"⚠ Retracted"}),O.retractedAt&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",O.retractedAt.slice(0,10)]}),O.retractionReason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",O.retractionReason]})]}),a.jsxs("button",{"aria-expanded":me,onClick:()=>{const W=!me;x(W?O.taskId:null),W&&(b("all"),_("all"))},className:"flex w-full items-center p-3 text-left transition hover:bg-accent/10",children:[a.jsx("span",{className:"mr-3 font-mono text-xs transition",style:{color:me?"var(--ink)":"var(--text-dim)",fontWeight:me?600:400},children:me?"▾":"▸"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:O.taskId}),a.jsxs("span",{className:`font-mono text-sm font-semibold ${le?"line-through decoration-disputed/40":""}`,style:{color:"var(--text)"},children:[ee," findings"]}),a.jsxs("div",{className:"flex gap-1.5",children:[O.agents.slice(0,4).map(W=>a.jsx("span",{className:"rounded-sm px-1.5 py-0.5 font-mono text-[10px]",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:W.split("-").map(q=>q[0]).join("").toUpperCase().slice(0,2)},W)),O.agents.length>4&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:["+",O.agents.length-4]})]})]}),a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:wt(O.timestamp)})]}),a.jsx("div",{className:"mt-2 flex gap-2",children:j.map(W=>W.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${W.text} ${le?"line-through decoration-disputed/40":""}`,children:[W.count," ",W.label]},W.key))}),a.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-sm",children:j.map(W=>W.count>0&&a.jsx("div",{className:`${W.color} transition-all`,style:{width:`${W.count/oe*100}%`}},W.key))})]})]}),me&&a.jsxs("div",{className:"border-t border-border px-4 pb-3 pt-3",children:[a.jsx("div",{className:"mb-3 flex gap-1.5",children:Ch.map(W=>a.jsx("button",{onClick:()=>b(W.key),className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${g===W.key?W.activeCls:W.cls} hover:opacity-80`,style:g===W.key?W.activeStyle:W.inactiveStyle,...W.tooltip?{"data-tooltip":W.tooltip}:{},children:W.label},W.key))}),H.length===0?a.jsx("div",{className:"py-4 text-center text-xs",style:{color:"var(--text-dim)"},children:"No findings match this filter."}):a.jsx("div",{className:"space-y-2",children:H.map((W,q)=>{const de=iu[W.signal];return de?a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${de.cls}`,children:de.label}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"text-xs [&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-[var(--cite-fn)]",style:{color:"var(--text-dim)"},children:a.jsx("span",{className:"finding-md",dangerouslySetInnerHTML:{__html:ii(W.evidence||"")}})}),a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[W.agentId,W.counterpartId?` + ${W.counterpartId}`:""]})]})]},q):null})})]})]},O.taskId+M)})})]})}const Tr=25;function B0({commits:s}){const[r,u]=S.useState(!1);if(s.length===0)return a.jsx("span",{style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"—"});const o=s[0],d=o.includes(" ")?o.slice(o.indexOf(" ")+1):o,f=s.length-1;return a.jsxs("span",{className:"font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--text)"},children:d}),f>0&&a.jsxs(a.Fragment,{children:[" ",a.jsx("button",{type:"button","aria-expanded":r,onClick:()=>u(p=>!p),className:"font-mono text-[10px] underline",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:r?"(collapse)":`(+${f} more)`}),r&&a.jsx("ul",{className:"mt-1 space-y-0.5 pl-2",children:s.slice(1).map((p,h)=>{const x=p.includes(" ")?p.slice(p.indexOf(" ")+1):p;return a.jsx("li",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:x},h)})})]})]})}function H0({row:s}){const r=s.preSha.slice(0,8),u=s.postSha.slice(0,8);return a.jsxs("tr",{className:"border-t border-border/20 align-top transition-colors hover:bg-accent/20",children:[a.jsx("td",{className:"whitespace-nowrap py-3 pl-4 pr-4 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:wt(s.detectedAt)}),a.jsx("td",{className:"max-w-[160px] truncate whitespace-nowrap py-3 pr-4",children:a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(s.agentId)}`,className:"font-mono text-[11px] hover:underline",style:{color:"var(--text)"},onMouseEnter:o=>o.currentTarget.style.color="var(--accent)",onMouseLeave:o=>o.currentTarget.style.color="var(--text)",children:s.agentId})}),a.jsxs("td",{className:"whitespace-nowrap py-3 pr-4 font-mono text-[10px]",children:[a.jsx("span",{style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:r}),a.jsx("span",{className:"mx-1",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:"→"}),a.jsx("span",{style:{color:"var(--text)"},children:u})]}),a.jsx("td",{className:"py-3 pr-4",children:a.jsx(B0,{commits:s.commits})})]})}function $0(){const[s,r]=S.useState([]),[u,o]=S.useState(0),[d,f]=S.useState(1),[p,h]=S.useState(!1),[x,g]=S.useState(null);S.useEffect(()=>{let y=!1;return h(!0),g(null),ut(`violations?page=${d}&pageSize=${Tr}`).then(_=>{y||(r(_.items??[]),o(_.total??0))}).catch(_=>{y||g(String((_==null?void 0:_.message)??_))}).finally(()=>{y||h(!1)}),()=>{y=!0}},[d]);const b=Math.max(1,Math.ceil(u/Tr));return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Process Violations"}),u>0&&a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:u})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:"Direct master pushes detected by the ref-allowlist enforcer"})]}),a.jsxs("div",{className:"overflow-hidden rounded-md border border-border/40",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[x&&a.jsx("div",{className:"border-b border-border/60 bg-disputed/10 px-3 py-2 font-mono text-[10px] text-disputed",children:x}),!x&&a.jsxs("table",{className:"w-full table-fixed text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/40 font-mono text-[10px] uppercase tracking-wider",style:{background:"color-mix(in oklch, var(--surface-sunk) 20%, transparent)",color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:[a.jsx("th",{className:"py-2.5 pl-4 pr-4",children:"When"}),a.jsx("th",{className:"py-2.5 pr-4",children:"Agent"}),a.jsx("th",{className:"py-2.5 pr-4",children:"Commit Range"}),a.jsx("th",{className:"py-2.5 pr-4",children:"Commits"})]})}),a.jsxs("tbody",{children:[!p&&s.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center font-mono text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"No violations recorded"})}),p&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Loading…"})}),!p&&s.map(y=>a.jsx(H0,{row:y},`${y.taskId}-${y.detectedAt}`))]})]}),a.jsxs("div",{className:"flex items-center justify-between border-t border-border/60 px-3 py-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:p?"loading…":u===0?"no violations":`${(d-1)*Tr+1}–${Math.min(d*Tr,u)} of ${u}`}),a.jsxs("div",{className:`flex items-center gap-2 font-mono text-[10px] ${b<=1?"invisible":""}`,style:{color:"var(--text-dim)"},children:[a.jsx("button",{type:"button",onClick:()=>f(y=>Math.max(1,y-1)),disabled:d===1||p,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[d," / ",b]}),a.jsx("button",{type:"button",onClick:()=>f(y=>Math.min(b,y+1)),disabled:d>=b||p,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]})]})]})}function q0({categoryAccuracy:s,categoryCorrect:r,categoryHallucinated:u}){const o=Object.keys(s??{});if(o.length===0)return a.jsx(ls,{title:"No category data yet",hint:"Accuracy accrues after ≥5 signals per category.",compact:!0});const d=o.map(f=>{const p=Math.max(0,Math.min(1,s[f]??0)),h=(r==null?void 0:r[f])??0,x=(u==null?void 0:u[f])??0;return{key:f,acc:p,c:h,h:x,n:h+x}}).sort((f,p)=>p.acc-f.acc);return a.jsx("div",{className:"space-y-2",children:d.map(f=>{const p=f.acc>=.7?"bg-confirmed":f.acc>=.4?"bg-unverified":"bg-disputed",h=f.n>0?`${f.c} correct / ${f.h} hallucinated / ${f.n} total`:void 0;return a.jsxs("div",{className:`grid grid-cols-[128px_1fr_auto_44px] items-center gap-3 ${f.n>0&&f.n<10?"opacity-50":""}`,title:f.n>0&&f.n<10?`${h} — low sample (n<10)`:h,children:[a.jsx("span",{className:"truncate font-mono text-[11px]",style:{color:"var(--text-dim)"},children:f.key.replace(/_/g," ")}),a.jsx("div",{className:"h-2 overflow-hidden rounded-sm",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:a.jsx("div",{className:`h-full rounded-sm transition-all ${p}`,style:{width:`${f.acc*100}%`}})}),a.jsx("span",{className:"shrink-0 text-right font-mono text-[10px] tabular-nums w-16",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:f.n>0?a.jsxs(a.Fragment,{children:[f.c,"/",f.n,f.h>0&&a.jsxs("span",{className:"ml-1 text-disputed/70",children:["·",f.h,"✗"]})]}):"—"}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums",style:{color:"var(--text)"},children:[Math.round(f.acc*100),"%"]})]},f.key)})})}const G0=new Set(["passed","failed","silent_skill","insufficient_evidence","flagged_for_manual_review"]);function I0(s,r,u){return(!s||!G0.has(s))&&r!==void 0&&u!==void 0&&u>0}const Y0={silent_skill:"No signals recorded after bind — skill may not be injecting correctly",insufficient_evidence:"Fewer than 80 post-bind signals — verdict pending more data",inconclusive:"Mixed signals — needs further evaluation",passed:"Skill verified effective",failed:"Skill verified ineffective",pending:"Awaiting evidence",flagged_for_manual_review:"Manual review required"},X0={pending:"border-border/50",passed:"border-confirmed/40 bg-confirmed/10 text-confirmed",failed:"border-disputed/40 bg-disputed/10 text-disputed",silent_skill:"border-unverified/40 bg-unverified/10 text-unverified",insufficient_evidence:"border-unverified/40 bg-unverified/10 text-unverified",inconclusive:"border-[color:var(--warn)]/40 bg-[color:var(--warn)]/10 text-[color:var(--warn)]",flagged_for_manual_review:"border-disputed/40 bg-disputed/10 text-disputed"};function V0(s){const r=Math.round(s*100),u=r>0?"+":"";return r>0?{text:`${u}${r}pp`,cls:"text-confirmed"}:r<0?{text:`${u}${r}pp`,cls:"text-disputed"}:{text:`${u}${r}pp`,cls:"",clsStyle:{color:"var(--text-dim)"}}}function K0({slot:s}){const r=s.status,u=r?X0[r]:"border-border/50",o=!r||r==="pending"?{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"var(--text-dim)"}:void 0,d=r==="inconclusive"&&(s.inconclusiveStrikes??0)>0,f=s.forcedDevelops??[],p=f.length>0?f[f.length-1]:null,h=typeof s.effectiveness=="number"?V0(s.effectiveness):null,x=I0(r,s.postBindSignals,s.minEvidence);return a.jsxs("div",{className:`rounded-md border p-3 ${s.enabled?"border-border/50":"border-border/30 opacity-60"}`,style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsxs("span",{className:`font-mono text-xs font-semibold ${s.enabled?"":"line-through"}`,style:{color:s.enabled?"var(--text)":"var(--text-dim)"},children:[s.mode==="contextual"&&"⚡ ",s.name]}),a.jsx("span",{className:"rounded-sm px-1.5 py-0.5 font-mono text-[9px]",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:s.source}),s.mode==="contextual"&&a.jsx("span",{className:"warn-badge rounded-sm px-1.5 py-0.5 font-mono text-[9px]",children:"contextual"})]}),a.jsxs("div",{className:"mt-1 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:["bound ",wt(s.boundAt)]}),x&&(()=>{const g=s.postBindSignals,b=s.minEvidence,y=Math.round(g/b*100),_=Math.min(g/b,1)*100;return a.jsxs("div",{className:"mt-1.5",title:`MIN_EVIDENCE gate: ${g} of ${b} post-bind signals (${y}%)`,children:[a.jsxs("div",{className:"mb-0.5 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:["post-bind: ",g," / ",b]}),a.jsx("div",{className:"relative h-1 w-full overflow-hidden rounded-full border border-border/40",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:a.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full border-r border-confirmed/40 bg-confirmed/20",style:{width:`${_}%`}})})]})})()]}),r&&a.jsx("span",{className:`shrink-0 rounded-sm border px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${u}`,style:o,title:Y0[r],children:r.replace(/_/g," ")})]}),a.jsxs("div",{className:"mt-2 flex items-center gap-3 font-mono text-[10px]",children:[h&&a.jsx("span",{className:h.cls,style:h.clsStyle,title:"Effectiveness: change in hallucination rate pre/post",children:h.text}),d&&a.jsxs("span",{className:"text-unique",title:s.inconclusiveAt?`last strike ${wt(s.inconclusiveAt)}`:void 0,children:[s.inconclusiveStrikes," strike",s.inconclusiveStrikes===1?"":"s"]})]}),f.length>0&&a.jsxs("div",{className:"mt-2 border-t border-border/40 pt-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},title:p!=null&&p.reason?`latest: ${p.reason}`:void 0,children:["forced ",f.length," time",f.length===1?"":"s",p&&` · last ${wt(p.timestamp)}`]})]})}function Z0({open:s,onOpenChange:r,children:u}){return S.useEffect(()=>{if(!s)return;const o=f=>{f.key==="Escape"&&r(!1)};document.addEventListener("keydown",o);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=d}},[s,r]),s?a.jsxs("div",{className:"fixed inset-0 z-50",children:[a.jsx("div",{className:"absolute inset-0 backdrop-blur-sm",style:{background:"color-mix(in oklch, var(--surface) 70%, transparent)"},onClick:()=>r(!1)}),a.jsx("div",{className:"absolute inset-y-0 right-0 flex",children:a.jsx("div",{onClick:o=>o.stopPropagation(),className:"contents",children:u})})]}):null}function Q0({side:s="right",className:r="",children:u,style:o,...d}){return a.jsx("div",{className:`h-full p-6 ${r}`,style:{background:"var(--surface-elev)",...o},...d,children:u})}function F0({className:s="",...r}){return a.jsx("div",{className:`mb-2 ${s}`,...r})}function J0({className:s="",...r}){return a.jsx("h2",{className:`font-semibold ${s}`,...r})}function W0({citation:s}){const r=s.snippet.split(`
80
+ `);return a.jsxs("div",{className:"rounded-md border border-border/40 overflow-hidden",style:{background:"color-mix(in oklch, var(--surface-elev) 60%, transparent)"},children:[a.jsx("div",{className:"flex items-center justify-between px-3 py-1 border-b border-border/40",style:{background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"},children:a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[s.file,":",s.line]})}),a.jsx("pre",{className:"overflow-x-auto",style:{background:"var(--surface-sunk)",borderLeft:"3px solid var(--border-strong)",padding:"12px 16px",borderRadius:"6px",fontFamily:"var(--font-mono)",fontSize:"12px",color:"var(--text)"},children:r.map((u,o)=>a.jsx("div",{className:"whitespace-pre",children:u||" "},o))})]})}const Rh={critical:"text-red-400 bg-red-500/10",high:"text-severity-high bg-severity-high/10",medium:"text-yellow-400 bg-yellow-500/10",low:""},P0={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},Oh={confirmed:"text-confirmed bg-confirmed/10 border border-confirmed/20",disputed:"text-disputed bg-disputed/10 border border-disputed/20",unverified:"text-unverified bg-unverified/10 border border-unverified/20",unique:"text-unique bg-unique/10 border border-unique/20",insight:"text-insight bg-insight/10 border border-insight/20",newFinding:"text-unique bg-unique/10 border border-unique/20"},ey={background:"var(--surface-elev)",borderRadius:"16px 0 0 16px",boxShadow:"var(--shadow-overlay)",border:"1px solid var(--border)",color:"var(--text)",fontFamily:"var(--font-sans)"};function ty(){const s=(r,u)=>a.jsx("div",{className:`${r} ${u} rounded`,style:{background:"var(--border)",opacity:.4}});return a.jsxs("div",{className:"mt-4 space-y-4","aria-busy":"true",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[s("h-3.5","w-12"),s("h-3.5","w-14"),s("h-3.5","w-16")]}),a.jsxs("div",{className:"space-y-2",children:[s("h-2","w-full"),s("h-2","w-[92%]"),s("h-2","w-[70%]")]}),a.jsxs("div",{className:"space-y-2",children:[s("h-2","w-16"),s("h-12","w-full")]}),a.jsxs("div",{className:"space-y-2",children:[s("h-2","w-16"),s("h-2","w-[60%]"),s("h-2","w-[45%]")]}),a.jsxs("div",{className:"space-y-2",children:[s("h-2","w-20"),s("h-2","w-full"),s("h-2","w-[80%]")]})]})}function Ur({open:s,onOpenChange:r,consensusId:u,findingId:o}){const[d,f]=S.useState(null),[p,h]=S.useState(null);return S.useEffect(()=>{if(!s||!u||!o){f(null),h(null);return}f(null),h(null),ut(`finding/${encodeURIComponent(u)}/${encodeURIComponent(o)}`).then(f).catch(x=>h(x.message||"failed to load finding"))},[s,u,o]),a.jsx(Z0,{open:s,onOpenChange:r,children:a.jsxs(Q0,{side:"right",className:"w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto",style:ey,children:[a.jsx(F0,{children:a.jsx(J0,{className:"font-mono text-sm",style:{color:"var(--text)"},children:"Finding detail"})}),p&&a.jsx("div",{className:"mt-4",children:a.jsx(_u,{message:p})}),!p&&!d&&a.jsx(ty,{}),d&&a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded ${Oh[d.finding.tag]||""}`,style:Oh[d.finding.tag]?void 0:{background:"var(--surface-sunk)"},children:d.finding.tag}),d.finding.severity&&a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded ${Rh[d.finding.severity]||""}`,style:d.finding.severity==="low"?P0:Rh[d.finding.severity]?void 0:{background:"var(--surface-sunk)"},children:d.finding.severity}),a.jsxs("span",{className:"font-mono text-[9px]",style:{color:"var(--text-dim)"},children:["by ",d.finding.originalAgentId]}),d.retracted&&a.jsx("span",{className:"font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded bg-disputed/50",children:"retracted"})]}),a.jsx("div",{className:"font-mono text-[12px] leading-relaxed whitespace-pre-wrap",children:d.finding.finding.replace(/<cite tag="file">[^<]+<\/cite>/g,"").trim()}),d.citations.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},children:"Citations"}),d.citations.map((x,g)=>a.jsx(W0,{citation:x},g))]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},children:"Coverage"}),d.finding.confirmedBy.length>0&&a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-confirmed",children:"✓"})," confirmed by ",d.finding.confirmedBy.join(", ")]}),d.finding.disputedBy.map((x,g)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-disputed",children:"✗"})," disputed by ",x.agentId,": ",a.jsx("span",{style:{color:"var(--text-dim)"},children:x.reason})]},g)),d.finding.confirmedBy.length===0&&d.finding.disputedBy.length===0&&a.jsx("div",{className:"text-[11px]",style:{color:"var(--text-dim)"},children:"No peer review"})]}),d.signals.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},children:["Signals (",d.signals.length,")"]}),a.jsx("div",{className:"space-y-1",children:d.signals.map((x,g)=>a.jsxs("div",{className:"text-[11px] border-l-2 border-border/40 pl-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono font-semibold",children:x.signal}),a.jsx("span",{style:{color:"var(--text-dim)"},children:"·"}),a.jsx("span",{children:x.agentId}),x.counterpartId&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"var(--text-dim)"},children:"→"}),a.jsx("span",{children:x.counterpartId})]}),a.jsx("span",{className:"ml-auto",style:{color:"var(--text-dim)"},children:wt(x.timestamp)})]}),x.evidence&&a.jsx("div",{className:"mt-0.5",style:{color:"var(--text-dim)"},children:x.evidence.slice(0,200)})]},g))})]}),a.jsx("div",{className:"pt-2 border-t border-border/40",children:a.jsxs("a",{href:ua(`/consensus/${d.consensusId}`),className:"font-mono text-[10px] hover:underline",style:{color:"var(--accent)"},children:["→ consensus round ",d.consensusId]})})]})]})})}const ny={agreement:"text-confirmed bg-confirmed/10",consensus_verified:"text-confirmed bg-confirmed/10",unique_confirmed:"text-unique bg-unique/10",unique_unconfirmed:"text-unique bg-unique/10",new_finding:"text-unique bg-unique/10",disagreement:"text-disputed bg-disputed/10",hallucination_caught:"text-disputed bg-disputed/10",unverified:"text-unverified bg-unverified/10"};function ay({agentId:s}){const[r,u]=S.useState([]),[o,d]=S.useState(!0),[f,p]=S.useState("all"),[h,x]=S.useState(null);S.useEffect(()=>{let _=!1;return d(!0),ut(`signals?agent=${encodeURIComponent(s)}&limit=100`).then(B=>{_||(u(B.items||[]),d(!1))}).catch(()=>{_||(u([]),d(!1))}),()=>{_=!0}},[s]);const g=[...r].sort((_,B)=>(B.timestamp||"").localeCompare(_.timestamp||"")),b=f==="all"||f==="signals"?g:[],y=({k:_,label:B,enabled:U})=>a.jsx("button",{type:"button",onClick:()=>U&&p(_),disabled:!U,className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${U?"":"opacity-40 cursor-not-allowed"}`,style:f===_?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:B});return a.jsxs("div",{className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsx("span",{className:"h-section",children:"Activity"}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(y,{k:"all",label:"All",enabled:!0}),a.jsx(y,{k:"signals",label:"Signals",enabled:!0}),a.jsx(y,{k:"tasks",label:"Tasks (none yet)",enabled:!1}),a.jsx(y,{k:"skills",label:"Skills (none yet)",enabled:!1})]})]}),o?a.jsx("div",{className:"py-6 text-center text-xs",style:{color:"var(--text-dim)"},children:"Loading…"}):b.length===0?a.jsx(ls,{title:"No activity yet",hint:"Signals, task completions, and skill binds will appear here.",compact:!0}):a.jsx("div",{className:"space-y-1",children:b.map((_,B)=>{const U=ny[_.signal]||"text-text-dim",A=!!(_.consensusId&&_.findingId),T=a.jsxs("div",{className:"flex items-start gap-2 py-1.5",children:[a.jsx("span",{className:"shrink-0 font-mono text-[9px] tabular-nums w-16",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:wt(_.timestamp)}),a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${U}`,children:_.signal}),a.jsxs("div",{className:"min-w-0 flex-1 text-[11px]",style:{color:"var(--text-dim)"},children:[_.counterpartId&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:["→ ",_.counterpartId," · "]}),_.evidence&&a.jsx("span",{children:_.evidence.length>160?_.evidence.slice(0,160)+"…":_.evidence})]})]});return A?a.jsx("button",{type:"button",onClick:()=>x({consensusId:_.consensusId,findingId:_.findingId}),className:"w-full rounded-sm text-left transition hover:bg-accent/10",children:T},B):a.jsx("div",{children:T},B)})}),a.jsx(Ur,{open:!!h,onOpenChange:_=>{_||x(null)},consensusId:(h==null?void 0:h.consensusId)??null,findingId:(h==null?void 0:h.findingId)??null})]})}function ly(){const s=S.useRef(null),[r,u]=S.useState(0);return S.useEffect(()=>{const o=s.current;if(!o||typeof ResizeObserver>"u")return;const d=new ResizeObserver(f=>{for(const p of f)u(p.contentRect.width)});return d.observe(o),()=>d.disconnect()},[]),[s,r]}const Dh={agreement:"bg-confirmed",consensus_verified:"bg-confirmed",unique_confirmed:"bg-unique",unique_unconfirmed:"bg-unique/50",disagreement:"bg-disputed/70",hallucination_caught:"bg-disputed",new_finding:"bg-unique",unverified:"bg-unverified",citation_fabricated:"bg-amber-500",boundary_escape:"bg-destructive"},sy={agreement:"Confirmed",consensus_verified:"Confirmed",unique_confirmed:"Unique (confirmed)",unique_unconfirmed:"Unique (unconfirmed)",disagreement:"Disputed",hallucination_caught:"Hallucination",new_finding:"New finding",unverified:"Unverified",citation_fabricated:"Fabricated citation",boundary_escape:"Process violation"},iy=6,ry=500,pp=100,cy=150;function oy(s){if(s<=0)return pp;const r=Math.floor(s/iy);return Math.max(1,Math.min(r,ry))}function uy({agentId:s}){const[r,u]=S.useState([]),[o,d]=S.useState(0),[f,p]=S.useState(!1),[h,x]=S.useState(null),[g,b]=ly(),[y,_]=S.useState(pp),B=S.useRef(null);S.useEffect(()=>{if(b<=0)return;const Y=oy(b);return B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{_(ae=>ae===Y?ae:Y)},cy),()=>{B.current&&clearTimeout(B.current)}},[b]),S.useEffect(()=>{ut(`signals?agent=${encodeURIComponent(s)}&limit=${y}`).then(Y=>{u(Y.items||[]),d(Y.total||0)}).catch(()=>{})},[s,y]);const U=S.useMemo(()=>[...r].reverse(),[r]),A={confirmed:0,disputed:0,unique:0,unverified:0,fabricated:0};for(const Y of r)Y.signal==="agreement"||Y.signal==="consensus_verified"?A.confirmed++:Y.signal==="disagreement"||Y.signal==="hallucination_caught"?A.disputed++:Y.signal==="unique_confirmed"||Y.signal==="unique_unconfirmed"||Y.signal==="new_finding"?A.unique++:Y.signal==="unverified"?A.unverified++:Y.signal==="citation_fabricated"&&A.fabricated++;const T=r.length,F=o>T;return r.length===0?a.jsx("div",{ref:g,className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:a.jsx(ls,{title:"No signal history yet",hint:"Signals are recorded during consensus rounds.",compact:!0})}):a.jsxs("div",{ref:g,className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsx("span",{className:"h-section",children:"Signal Timeline"}),a.jsx("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:F?`last ${T} of ${o}`:`${o} total`})]}),a.jsxs("div",{className:"flex items-center gap-3 font-mono text-[10px]",children:[a.jsxs("span",{className:"text-confirmed",children:[A.confirmed," confirmed"]}),A.disputed>0&&a.jsxs("span",{className:"text-disputed",children:[A.disputed," disputed"]}),A.unique>0&&a.jsxs("span",{className:"text-unique",children:[A.unique," unique"]}),A.unverified>0&&a.jsxs("span",{className:"text-unverified",children:[A.unverified," unverified"]}),A.fabricated>0&&a.jsxs("span",{className:"text-amber-500",children:[A.fabricated," fabricated"]})]})]}),a.jsx("div",{className:"flex items-center gap-0.5",children:U.map((Y,ae)=>{const V=!!(Y.consensusId&&Y.findingId);return a.jsx("button",{type:"button",disabled:!V,onClick:()=>{Y.consensusId&&Y.findingId&&(x({consensusId:Y.consensusId,findingId:Y.findingId}),p(!0))},className:`h-4 min-w-[4px] flex-1 rounded-sm transition-opacity hover:opacity-80 ${Dh[Y.signal]||""} ${V?"cursor-pointer":"cursor-default"}`,style:Dh[Y.signal]?void 0:{background:"var(--surface-sunk)"},title:`${sy[Y.signal]||Y.signal} — ${wt(Y.timestamp)}${V?" (click for detail)":""}`},ae)})}),a.jsx("div",{className:"mt-2 flex flex-wrap gap-3",children:[{color:"bg-confirmed",label:"Confirmed"},{color:"bg-disputed",label:"Disputed"},{color:"bg-unique",label:"Unique (confirmed)"},{color:"bg-unique/50",label:"Unique (unconfirmed)"},{color:"bg-unverified",label:"Unverified"},{color:"bg-amber-500",label:"Fabricated citation"}].map(Y=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:`h-2 w-2 rounded-sm ${Y.color}`}),a.jsx("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:Y.label})]},Y.label))}),a.jsx(Ur,{open:f,onOpenChange:p,consensusId:(h==null?void 0:h.consensusId)??null,findingId:(h==null?void 0:h.findingId)??null})]})}function dy(s){const r=s.toLowerCase();return r==="completed"||r==="done"||r==="success"||r==="succeeded"?"completed":r==="running"||r==="active"||r==="in_progress"||r==="pending"?"running":r==="failed"||r==="error"||r==="errored"||r==="timeout"||r==="timed_out"?"failed":r==="cancelled"||r==="canceled"||r==="queued"||r==="waiting"?"cancelled":"unknown"}const fy={completed:{label:"Done",iconBox:"bg-confirmed/10 border-confirmed/30",text:"text-confirmed",pulse:!1},running:{label:"Running",iconBox:"bg-unverified/10 border-unverified/30",text:"text-unverified",pulse:!0},failed:{label:"Failed",iconBox:"bg-bad/10 border-bad/30",text:"text-bad",pulse:!1},cancelled:{label:"Cancelled",iconBox:"border-muted-foreground/25",text:"",textStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"},pulse:!1},unknown:{label:"Unknown",iconBox:"border-muted-foreground/25",text:"",textStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"},pulse:!1}},my={completed:a.jsx("polyline",{points:"5 12 10 17 19 7"}),running:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.45"})]}),failed:a.jsxs(a.Fragment,{children:[a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]}),cancelled:a.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),unknown:a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .9-1 1.7"}),a.jsx("line",{x1:"12",y1:"16.5",x2:"12",y2:"16.5"})]})};function hy(s){if(!s)return"—";if(s<1e3)return"< 1s";if(s<6e4)return Math.floor(s/1e3)+"s";if(s<36e5){const o=Math.floor(s/6e4),d=Math.floor(s%6e4/1e3);return d>0?`${o}m ${d}s`:`${o}m`}const r=Math.floor(s/36e5),u=Math.floor(s%36e5/6e4);return u>0?`${r}h ${u}m`:`${r}h`}function xp({task:s,onClick:r}){const u=dy(s.status),o=fy[u];return a.jsxs("tr",{className:`border-b border-border hover:bg-accent/10 transition-colors ${r?"cursor-pointer":""}`,onClick:r?d=>{d.target.closest("a")||r(s)}:void 0,children:[a.jsx("td",{className:"py-2.5 pl-4 pr-2",children:a.jsxs("span",{className:"inline-flex items-center gap-2","aria-label":`Status: ${o.label}`,children:[a.jsx("span",{className:`flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full border ${o.iconBox} ${o.text} ${o.pulse?"animate-pulse":""}`,style:o.textStyle,"aria-hidden":!0,children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:my[u]})}),a.jsx("span",{className:`font-mono text-[10px] font-semibold uppercase tracking-wider ${o.text}`,style:o.textStyle,children:o.label})]})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsx("span",{className:"warn-badge rounded px-2 py-1 font-mono text-[10px] font-semibold",title:s.taskId,children:s.taskId.slice(0,8)})}),a.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs",style:{color:"var(--text-dim)"},children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(s.agentId)}`,className:"inline-flex items-center gap-1.5 transition",children:[a.jsx("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:qn(s.agentId)}}),s.agentId]})}),a.jsx("td",{className:"py-2.5 pr-3 text-xs leading-snug",style:{color:"color-mix(in oklch, var(--text) 80%, transparent)"},children:(()=>{const d=s.task.replace(/\n.*/s,"");return d.length>100?d.slice(0,100)+"…":d})()}),a.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs",style:{color:"var(--text-dim)"},children:u==="running"?"running":hy(s.duration)}),a.jsx("td",{className:"py-2.5 pr-4 text-right font-mono text-xs",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:wt(s.timestamp)})]})}function bt({className:s="",style:r}){return a.jsx("div",{className:`rounded ${s}`,style:{background:"color-mix(in oklch, var(--border) 40%, transparent)",...r}})}function py(){return a.jsxs("div",{className:"mx-auto max-w-5xl space-y-6 px-6 py-6",children:[a.jsx(bt,{className:"h-48 w-full"}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[a.jsx(bt,{className:"h-36"}),a.jsx(bt,{className:"h-36"}),a.jsx(bt,{className:"h-36"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[a.jsx(bt,{className:"h-48"}),a.jsx(bt,{className:"h-48"})]})]})}function xy(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(bt,{className:"mb-2 h-7 w-32"}),a.jsx(bt,{className:"h-3 w-48"})]}),a.jsx("div",{className:"grid grid-cols-2 gap-px sm:grid-cols-4",children:Array.from({length:4}).map((s,r)=>a.jsx(bt,{className:"h-16"},r))}),a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:6}).map((s,r)=>a.jsx(bt,{className:"h-12"},r))})]})}function gy(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(bt,{className:"mb-2 h-7 w-24"}),a.jsx(bt,{className:"h-3 w-32"})]}),a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:8}).map((s,r)=>a.jsx(bt,{className:"h-11"},r))})]})}function vy(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(bt,{className:"mb-2 h-7 w-48"}),a.jsx(bt,{className:"h-3 w-64"})]}),a.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((s,r)=>a.jsxs("div",{className:"overflow-hidden rounded-md",children:[a.jsx(bt,{className:"h-14"}),a.jsx("div",{className:"mt-px space-y-px",children:Array.from({length:3}).map((u,o)=>a.jsx(bt,{className:"h-10"},o))})]},r))})]})}function by(){return a.jsx("div",{className:"space-y-2",children:Array.from({length:4}).map((s,r)=>a.jsxs("div",{className:"flex items-start gap-3 py-2",children:[a.jsx(bt,{className:"mt-0.5 h-4 w-4 shrink-0 rounded-sm"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(bt,{className:"h-3 w-3/4"}),a.jsx(bt,{className:"h-3 w-1/2"})]})]},r))})}function yy(){return a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:5}).map((s,r)=>a.jsx(bt,{className:"h-10"},r))})}const Ny=3,jy=720*60*60*1e3;function Sy({agentId:s,agents:r,tasks:u,consensus:o}){const d=r.find(q=>q.id===s),[f,p]=S.useState([]),[h,x]=S.useState(!0),[g,b]=S.useState([]),[y,_]=S.useState(!0),[B,U]=S.useState(null),[A,T]=S.useState(null),[F,Y]=S.useState(null),[ae,V]=S.useState(0),[E,G]=S.useState(0),[C,K]=S.useState(null);S.useEffect(()=>{x(!0),ut(`memory/${s}`).then(q=>{p(q.knowledge||[])}).catch(()=>p([])).finally(()=>x(!1))},[s]),S.useEffect(()=>{let q=!1;return _(!0),ut("consensus-reports?page=1&pageSize=200").then(de=>{q||b(de.reports||[])}).catch(()=>{q||b([])}).finally(()=>{q||_(!1)}),()=>{q=!0}},[]);const te=S.useMemo(()=>{var Ie;const q=Date.now(),de=new Map;for(const Re of g){const it=Date.parse(Re.timestamp);if(Number.isNaN(it)||q-it>jy)continue;const Vt=(Ie=Re.authorDiagnostics)==null?void 0:Ie[s];if(Vt)for(const Lt of Vt)de.set(Lt.code,(de.get(Lt.code)??0)+1)}const xe=[];for(const[Re,it]of de)it>=Ny&&xe.push({code:Re,count:it});return xe},[g,s]);if(!d)return a.jsxs("div",{className:"py-20 text-center",style:{color:"var(--text-dim)"},children:["Agent not found: ",s]});const P=d.scores,he=(u==null?void 0:u.items.filter(q=>q.agentId===s))||[],ne=(o==null?void 0:o.runs.filter(q=>q.agents.includes(s)))||[],ue=[{label:"accuracy",value:P.accuracy,fill:P.accuracy>=.7?"bg-confirmed":P.accuracy>=.4?"bg-unverified":"bg-disputed"},{label:"unique",value:P.uniqueness,fill:"bg-unique"},{label:"impact",value:P.impactScore,fill:"bg-[var(--c8)]"}],ye=P.unverifiedsEmitted??0,O=P.unverifiedsReceived??0,M=ye+O,I=[{label:"Signals",value:String(P.signals),color:"",colorStyle:{color:"var(--text)"}},{label:"Agreements",value:String(P.agreements),color:"text-confirmed",colorStyle:void 0},{label:"Disagreements",value:String(P.disagreements),color:"text-disputed",colorStyle:void 0},{label:"Hallucinations",value:String(P.hallucinations),color:P.hallucinations>0?"text-disputed":"",colorStyle:P.hallucinations>0?void 0:{color:"var(--text-dim)"}},{label:"Unverified",value:M>0?`${ye}↑ ${O}↓`:"0",color:M>0?"text-unverified":"",colorStyle:M>0?void 0:{color:"var(--text-dim)"},title:M>0?`${ye} emitted (as reviewer) · ${O} received (as author)`:void 0},{label:"Tokens",value:d.totalTokens.toLocaleString(),color:"",colorStyle:{color:"var(--text)"}}],ee=10,oe=Math.max(1,Math.ceil(he.length/ee)),me=Math.min(ae,oe-1),j=he.slice(me*ee,(me+1)*ee),H=S.useMemo(()=>{const q=new Map;for(const de of f){const xe=de.filename.match(/^(\d{4}-\d{2}-\d{2})/),Ie=xe?xe[1]:"undated",Re=q.get(Ie)||[];Re.push(de),q.set(Ie,Re)}return Array.from(q.entries()).sort(([de],[xe])=>de==="undated"?1:xe==="undated"?-1:xe.localeCompare(de)).map(([de,xe])=>({day:de,items:xe}))},[f]),le=Math.min(E,Math.max(0,H.length-1)),W=H[le];return a.jsxs(a.Fragment,{children:[(()=>{const q=Su(P);return q==="benched"?a.jsx("div",{className:"mb-6 rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs font-bold text-destructive",children:"BENCHED"}),a.jsxs("span",{className:"text-xs text-destructive/70",children:["Auto-bench rule fired (",P.bench.reason??"unknown","). Agent excluded from dispatch until scores recover."]})]})}):q==="struggling"?a.jsx("div",{className:"mb-6 rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"STRUGGLING"}),a.jsxs("span",{className:"text-xs text-unverified/70",children:[P.consecutiveFailures,"+ consecutive failures. Deprioritized until clean signals recorded."]})]})}):q==="kept-for-coverage"?a.jsx("div",{className:"mb-6 rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"KEPT FOR COVERAGE"}),a.jsxs("span",{className:"text-xs text-unverified/70",children:["Would be benched (",P.bench.reason??"rule","), but is the sole provider of a category — kept to preserve coverage."]})]})}):null})(),te.length>0&&a.jsx("div",{className:"mb-6 space-y-2",children:te.map(({code:q,count:de})=>a.jsxs("div",{className:"rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3","data-diagnostic-code":q,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"PARSE DIAGNOSTIC"}),a.jsx("span",{className:"font-mono text-[11px] text-unverified/80",dangerouslySetInnerHTML:{__html:bu(q)}}),a.jsxs("span",{className:"font-mono text-[11px] text-unverified/60",children:["· ",de," fires in 30d"]})]}),a.jsxs("div",{className:"mt-1 text-xs",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["This agent's raw output has repeatedly tripped ",a.jsx("span",{className:"font-mono",children:q}),". Inspect recent consensus rounds on this page for the per-finding banner, or check upstream pipeline layers (sanitizer / renderer / relay encoding)."]})]},q))}),a.jsx("div",{"data-theme":"dark",className:"relative mb-6 rounded-xl border border-border p-5",style:{background:"var(--surface-elev)",color:"var(--text)"},children:a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsx("div",{className:"relative shrink-0","data-tooltip":`Accuracy ${Math.round(P.accuracy*100)}% · Uniqueness ${Math.round(P.uniqueness*100)}% · Impact ${Math.round(P.impactScore*100)}%`,children:a.jsx(ri,{agentId:d.id,size:120,signals:P.signals,accuracy:P.accuracy,uniqueness:P.uniqueness,impact:P.impactScore})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("h1",{className:"truncate font-mono text-2xl font-bold",style:{color:"var(--text)"},children:d.id}),a.jsxs("p",{className:"mt-1 text-sm",style:{color:"var(--text-dim)"},children:[d.provider,"/",d.model]}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold ${d.native?"":"text-confirmed bg-confirmed/10"}`,style:d.native?{color:"var(--idle)",background:"color-mix(in oklch, var(--idle) 10%, transparent)"}:void 0,children:d.native?"NATIVE":"RELAY"}),d.preset&&a.jsx("span",{className:"rounded-sm px-2 py-0.5 font-mono text-[10px]",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:d.preset}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[P.signals," signals",d.lastTask?` · ${wt(d.lastTask.timestamp)}`:""]})]})]}),a.jsxs("div",{className:"flex shrink-0 flex-col items-end rounded-md border border-border px-3 py-2",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)"},"data-tooltip":`Dispatch weight ${P.dispatchWeight.toFixed(2)}
81
+ Scale 0.3 → 2.0`,"data-tooltip-pos":"left",children:[a.jsx("span",{className:"font-mono text-2xl font-bold tabular-nums leading-none",style:{color:"var(--text)"},children:P.dispatchWeight.toFixed(2)}),a.jsx("span",{className:"mt-1 font-mono text-[9px] uppercase",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"weight"})]})]})}),a.jsx("section",{className:"mb-6",children:a.jsx(uy,{agentId:s})}),a.jsxs("section",{className:"mb-8 grid grid-cols-1 gap-6 lg:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"mb-3 h-section",children:"Metrics"}),a.jsxs("div",{className:"rounded-lg border border-border/40 p-4",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsx("div",{className:"space-y-2.5",children:ue.map(q=>a.jsxs("div",{className:"grid grid-cols-[72px_1fr_44px] items-center gap-3",children:[a.jsx("span",{className:"h-section",style:{color:"var(--text-dim)",fontSize:"10px"},children:q.label}),a.jsx("div",{className:"h-1.5 overflow-hidden rounded-full",style:{background:"color-mix(in oklch, var(--surface) 80%, transparent)"},children:a.jsx("div",{className:`h-full rounded-full transition-all ${q.fill}`,style:{width:`${Math.max(0,Math.min(100,q.value*100))}%`}})}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums",style:{color:"var(--text)"},children:[Math.round(q.value*100),"%"]})]},q.label))}),a.jsx("div",{className:"mt-4 grid grid-cols-6 gap-px overflow-hidden rounded-md border border-border/30 bg-border/30",children:I.map(q=>a.jsxs("div",{className:"px-2 py-2 text-center",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)"},title:q.title,children:[a.jsx("div",{className:`font-mono text-sm font-bold tabular-nums ${q.color}`,style:q.colorStyle,children:q.value}),a.jsx("div",{className:"mt-0.5 font-mono text-[9px] uppercase tracking-wider",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:q.label})]},q.label))})]})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"mb-1 h-section",children:"Category Competency"}),a.jsx("p",{className:"mb-3 mt-0.5 font-mono text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:"◆ Raw per-category ratio — unweighted. Overall accuracy in Metrics applies a hallucination penalty."}),a.jsx(q0,{categoryAccuracy:P.categoryAccuracy,categoryCorrect:P.categoryCorrect,categoryHallucinated:P.categoryHallucinated})]})]}),(d.skillSlots.length>0||d.skills.length>0)&&a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 h-section",children:["Skills ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:d.skillSlots.length||d.skills.length})]}),d.skillSlots.length>0?a.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:d.skillSlots.map(q=>a.jsx(K0,{slot:q},q.name))}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:d.skills.map(q=>a.jsx("span",{className:"rounded-sm border border-border px-2.5 py-1 font-mono text-xs",style:{background:"var(--surface-elev)",color:"var(--text-dim)"},children:q},q))})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Tasks ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:he.length})]}),oe>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{onClick:()=>V(q=>Math.max(0,q-1)),disabled:me===0,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{children:[me+1," / ",oe]}),a.jsx("button",{onClick:()=>V(q=>Math.min(oe-1,q+1)),disabled:me>=oe-1,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]}),he.length>0?a.jsx("div",{className:"overflow-hidden rounded-md border border-border/40",children:a.jsxs("table",{className:"w-full text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border",style:{background:"var(--surface-elev)"},children:[a.jsx("th",{className:"py-2 pl-4 pr-2 text-xs font-medium",style:{width:32,color:"var(--text-dim)"}}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium",style:{color:"var(--text-dim)"},children:"ID"}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium",style:{color:"var(--text-dim)"},children:"Agent"}),a.jsx("th",{className:"py-2 pr-3 text-xs font-medium",style:{color:"var(--text-dim)"},children:"Description"}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium",style:{color:"var(--text-dim)"},children:"Duration"}),a.jsx("th",{className:"py-2 pr-4 text-right font-mono text-xs font-medium",style:{color:"var(--text-dim)"},children:"When"})]})}),a.jsx("tbody",{children:j.map(q=>a.jsx(xp,{task:q,onClick:K},q.taskId))})]})}):a.jsx("div",{className:"py-6 text-center text-sm",style:{color:"var(--text-dim)"},children:"No tasks recorded."})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 h-section",children:["Consensus Runs",!y&&a.jsxs("span",{style:{color:"var(--ink)",fontWeight:700},children:[" ",ne.length]})]}),y?a.jsx(yy,{}):ne.length>0?a.jsx("div",{className:"space-y-2",children:ne.slice(0,20).map((q,de)=>{const xe=q.counts,Ie=(xe.agreement||0)+(xe.disagreement||0)+(xe.hallucination||0)+(xe.unverified||0)+(xe.unique||0)+(xe.new||0),Re=Ie||1,it=[{key:"confirmed",count:xe.agreement||0,color:"bg-confirmed",text:"text-confirmed"},{key:"disputed",count:(xe.disagreement||0)+(xe.hallucination||0),color:"bg-disputed",text:"text-disputed"},{key:"unverified",count:xe.unverified||0,color:"bg-unverified",text:"text-unverified"},{key:"unique",count:(xe.unique||0)+(xe.new||0),color:"bg-unique",text:"text-unique"}],Vt={agreement:{label:"CONFIRMED",cls:"text-confirmed bg-confirmed/10"},consensus_verified:{label:"CONFIRMED",cls:"text-confirmed bg-confirmed/10"},disagreement:{label:"DISPUTED",cls:"text-disputed bg-disputed/10"},hallucination_caught:{label:"DISPUTED",cls:"text-disputed bg-disputed/10"},unverified:{label:"UNVERIFIED",cls:"text-unverified bg-unverified/10"},unique_confirmed:{label:"UNIQUE",cls:"text-unique bg-unique/10"},unique_unconfirmed:{label:"UNIQUE",cls:"text-unique bg-unique/10"},new_finding:{label:"NEW",cls:"text-unique bg-unique/10"}},Lt=q.signals.filter(Ye=>Ye.signal!=="signal_retracted"&&Vt[Ye.signal]),Cn=q.taskId+":"+de,qt=A===Cn;return a.jsxs("div",{className:"rounded-md border border-border/40",style:{background:"var(--surface-elev)"},children:[a.jsx("button",{type:"button",onClick:()=>T(qt?null:Cn),disabled:Lt.length===0,className:`flex w-full items-center p-3 text-left transition ${Lt.length>0?"hover:bg-accent/20":"cursor-default"}`,children:a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"font-mono text-sm font-semibold",style:{color:"var(--text)"},children:[Lt.length>0&&a.jsx("span",{className:"mr-1.5 inline-block",style:{color:"var(--text-dim)"},children:qt?"▾":"▸"}),Ie," findings"]}),a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:wt(q.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex gap-2",children:it.map(Ye=>Ye.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${Ye.text}`,children:[Ye.count," ",Ye.key]},Ye.key))}),a.jsx("div",{className:"mt-1.5 flex h-1.5 overflow-hidden rounded-sm",children:it.map(Ye=>Ye.count>0&&a.jsx("div",{className:Ye.color,style:{width:`${Ye.count/Re*100}%`}},Ye.key))})]})}),qt&&Lt.length>0&&a.jsx("div",{className:"border-t border-border/30 px-3 pb-2 pt-2",children:a.jsx("div",{className:"space-y-1",children:Lt.map((Ye,wn)=>{const hn=Vt[Ye.signal],Rn=!!(Ye.findingId&&q.taskId),ie=a.jsxs("div",{className:"flex items-start gap-2 py-1",children:[a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${hn.cls}`,children:hn.label}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"finding-md text-xs [&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-[var(--cite-fn)]",style:{color:"var(--text-dim)"},dangerouslySetInnerHTML:{__html:ii(Ye.evidence||"")}}),a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[Ye.agentId,Ye.counterpartId?` + ${Ye.counterpartId}`:""]})]})]});return Rn?a.jsx("button",{type:"button",onClick:()=>Y({consensusId:q.taskId,findingId:Ye.findingId}),className:"block w-full rounded-sm text-left transition hover:bg-accent/10",children:ie},wn):a.jsx("div",{children:ie},wn)})})})]},Cn)})}):a.jsx("div",{className:"py-6 text-center text-sm",style:{color:"var(--text-dim)"},children:"No consensus participation recorded."})]}),a.jsx("section",{className:"mb-8",children:a.jsx(ay,{agentId:s})}),a.jsx(Ur,{open:!!F,onOpenChange:q=>{q||Y(null)},consensusId:(F==null?void 0:F.consensusId)??null,findingId:(F==null?void 0:F.findingId)??null}),a.jsx(hp,{task:C,onClose:()=>K(null)}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Memory",!h&&a.jsxs("span",{style:{color:"var(--ink)",fontWeight:700},children:[" ",f.length," files"]}),!h&&W&&a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:["· ",W.day," (",W.items.length,")"]})]}),!h&&H.length>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{onClick:()=>G(q=>Math.max(0,q-1)),disabled:le===0,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Newer"}),a.jsxs("span",{children:[le+1," / ",H.length]}),a.jsx("button",{onClick:()=>G(q=>Math.min(H.length-1,q+1)),disabled:le>=H.length-1,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Older ▸"})]})]}),h?a.jsx(by,{}):W&&W.items.length>0?a.jsx("div",{className:"space-y-1.5",children:W.items.map(q=>{var Re,it;const de=B===q.filename,xe=((Re=q.frontmatter)==null?void 0:Re.type)||"memory",Ie=((it=q.frontmatter)==null?void 0:it.name)||q.filename.replace(/\.md$/,"");return a.jsxs("div",{className:"rounded-md border border-border/40",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("button",{onClick:()=>U(de?null:q.filename),className:"flex w-full items-center gap-2 p-3 text-left transition hover:bg-accent/10",children:[a.jsx("span",{className:"font-mono text-xs",style:{color:de?"var(--text)":"var(--text-dim)"},children:de?"▾":"▸"}),a.jsx("span",{className:"shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:xe}),a.jsx("span",{className:"truncate font-mono text-xs font-semibold",style:{color:"var(--text)"},children:Ie}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:q.filename})]}),de&&a.jsx("div",{className:"border-t border-border px-4 py-3",children:a.jsx("pre",{className:"whitespace-pre-wrap font-mono text-xs leading-relaxed",style:{color:"var(--text-dim)"},children:q.content})})]},q.filename)})}):a.jsx("div",{className:"py-6 text-center text-sm",style:{color:"var(--text-dim)"},children:"No memory files."})]})]})}const zh={dispatch:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},consensus:{color:"color-mix(in oklch, var(--info) 80%, transparent)"},error:{},timeout:{},worker:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},gemini:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},skill:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},boot:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},relay:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},gossip:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},utility:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},memory:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},persist:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},toolserver:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},other:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"}},_y={error:"text-disputed",timeout:"text-unverified"},ky=[[/^\[gossipcat\]\s*\[worker:/,"worker"],[/^\[gossipcat\]\s*\[Gemini\]/,"gemini"],[/^\[gossipcat\]\s*\[ToolServer\]/,"toolserver"],[/^\[gossipcat\]\s*dispatch\b/,"dispatch"],[/^\[gossipcat\]\s*relay\b/,"relay"],[/^\[gossipcat\]\s*Cross-review\b/,"consensus"],[/^\[gossipcat\]\s*Consensus\b/,"consensus"],[/^\[gossipcat\]\s*Skill\b/,"skill"],[/^\[gossipcat\]\s*Bootstrap\b/,"boot"],[/^\[gossipcat\]\s*Booted:/,"boot"],[/^\[gossipcat\]\s*Dashboard:/,"boot"],[/^\[gossipcat\]\s*Adaptive\b/,"boot"],[/^\[gossipcat\]\s*Gossip\b/,"gossip"],[/^\[gossipcat\]\s*utility\b/,"utility"],[/^\[gossipcat\]\s*Compacted\b/,"memory"],[/native agent/,"boot"],[/persist|Persist/,"persist"],[/timeout|Timeout|timed.out/,"timeout"],[/^\[gossipcat\].*(?:Error|error|failed|Failed)/,"error"]];function Ey(s){for(const[r,u]of ky)if(r.test(s))return u;return"other"}const wy=[{key:"all",label:"All"},{key:"dispatch",label:"Dispatch"},{key:"consensus",label:"Consensus"},{key:"error",label:"Errors"},{key:"timeout",label:"Timeouts"},{key:"worker",label:"Workers"},{key:"skill",label:"Skills"},{key:"relay",label:"Relay"},{key:"boot",label:"Boot"}],Lh=1e3;function Ty(){const[s,r]=S.useState([]),[u,o]=S.useState(0),[d,f]=S.useState(0),[p,h]=S.useState("all"),[x,g]=S.useState(!0),[b,y]=S.useState(!0),_=S.useRef(null),B=S.useRef(0);S.useEffect(()=>{let T=!1;return(async()=>{try{const Y=await ut("logs?tail=500");if(T)return;r(Y.entries),o(Y.totalLines),f(Y.fileSize),B.current=Y.totalLines+1}catch{}})(),()=>{T=!0}},[]),S.useEffect(()=>{if(b)return cp(T=>{var Y;if(T.type!=="log_lines")return;const F=(Y=T.data)==null?void 0:Y.lines;F!=null&&F.length&&r(ae=>{const V=F.map((G,C)=>({line:B.current+C,text:G,category:Ey(G)}));B.current+=F.length,o(G=>G+F.length);const E=[...ae,...V];return E.length>Lh?E.slice(-Lh):E})})},[b]),S.useEffect(()=>{x&&_.current&&_.current.scrollIntoView({behavior:"smooth"})},[s,x]);const U=p==="all"?s:s.filter(T=>T.category===p),A=S.useCallback(T=>T<1024?`${T} B`:T<1048576?`${(T/1024).toFixed(1)} KB`:`${(T/1048576).toFixed(1)} MB`,[]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-4 flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"MCP Log"}),a.jsxs("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:[u," lines"]}),a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:A(d)}),b&&a.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] text-confirmed",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-confirmed"}),"live"]})]}),a.jsxs("div",{className:"mb-3 flex items-center gap-1.5",children:[wy.map(T=>a.jsx("button",{onClick:()=>h(T.key),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:p===T.key?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:T.label},T.key)),a.jsxs("div",{className:"ml-auto flex gap-1.5",children:[a.jsx("button",{onClick:()=>y(!b),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${b?"bg-confirmed/10 text-confirmed":""}`,style:b?void 0:{color:"var(--text-dim)"},children:b?"● Live":"○ Paused"}),a.jsx("button",{onClick:()=>g(!x),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:x?{color:"var(--ok)",background:"color-mix(in oklch, var(--ok) 10%, transparent)"}:{color:"var(--text-dim)"},children:x?"⤓ Auto":"⤓ Scroll"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border",style:{background:"var(--surface-elev)"},children:a.jsxs("div",{className:"max-h-[70vh] overflow-y-auto p-3 font-mono text-xs leading-relaxed",children:[U.map(T=>a.jsxs("div",{className:"flex gap-2 hover:bg-accent/10",children:[a.jsx("span",{className:"w-10 shrink-0 select-none text-right",style:{color:"color-mix(in oklch, var(--text-dim) 30%, transparent)"},children:T.line}),a.jsx("span",{className:_y[T.category]??"",style:zh[T.category]??zh.other,children:T.text})]},T.line)),U.length===0&&a.jsx("div",{className:"py-8 text-center font-mono text-xs",style:{color:"var(--text-dim)"},children:s.length===0?"Loading...":p==="all"?"No log entries in current tail.":`No ${p} entries in current tail.`}),a.jsx("div",{ref:_})]})})]})}const Ay=["critical","high","medium","low"],My=["manual","impl","meta","auto-provisional"];function Uh(s,r){return s.includes(r)?s.filter(u=>u!==r):[...s,r]}const Hn="mb-1 block h-section",$n={},Ha="w-full rounded border border-border px-2 py-1 font-mono text-[10px] focus:border-primary focus:outline-none",$a={background:"var(--surface)",color:"var(--text)"};function Cy({filters:s,onChange:r,agents:u,signalTypes:o}){const d=f=>p=>{const h=p.target.value;r({[f]:h===""?void 0:h})};return a.jsxs("aside",{className:"space-y-3 rounded-md border border-border/60 p-3",style:{background:"color-mix(in oklch, var(--surface-elev) 70%, transparent)"},children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"h-section",children:"Filters"}),a.jsx("button",{type:"button",className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},onClick:()=>r({agents:[],counterpart:void 0,signals:[],category:void 0,severity:void 0,since:void 0,until:void 0,consensusId:void 0,findingId:void 0,source:void 0}),children:"clear"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:Hn,style:$n,children:["Agents (",s.agents.length," selected)"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 p-1",style:{background:"var(--surface)"},children:[u.length===0&&a.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"no agents"}),u.map(f=>a.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] hover:bg-accent/20",style:{color:"var(--text)"},children:[a.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:s.agents.includes(f),onChange:()=>r({agents:Uh(s.agents,f)})}),a.jsx("span",{children:f})]},f))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Hn,style:$n,children:"Counterpart"}),a.jsxs("select",{className:Ha,style:$a,value:s.counterpart??"",onChange:d("counterpart"),children:[a.jsx("option",{value:"",children:"any"}),u.map(f=>a.jsx("option",{value:f,children:f},f))]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:Hn,style:$n,children:["Signal types (",s.signals.length,")"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 p-1",style:{background:"var(--surface)"},children:[o.length===0&&a.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"no signals"}),o.map(f=>a.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] hover:bg-accent/20",style:{color:"var(--text)"},children:[a.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:s.signals.includes(f),onChange:()=>r({signals:Uh(s.signals,f)})}),a.jsx("span",{children:f})]},f))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Hn,style:$n,children:"Severity"}),a.jsxs("select",{className:Ha,style:$a,value:s.severity??"",onChange:d("severity"),children:[a.jsx("option",{value:"",children:"any"}),Ay.map(f=>a.jsx("option",{value:f,children:f},f))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Hn,style:$n,"data-tooltip":"manual = operator-recorded · impl = implementer pipeline · meta = orchestrator self-telemetry · auto-provisional = unvalidated",children:"Source"}),a.jsxs("select",{className:Ha,style:$a,value:s.source??"",onChange:d("source"),children:[a.jsx("option",{value:"",children:"any"}),My.map(f=>a.jsx("option",{value:f,children:f},f))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Hn,style:$n,children:"Category"}),a.jsx("input",{type:"text",className:Ha,style:$a,value:s.category??"",onChange:d("category"),placeholder:"e.g. trust_boundaries"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:Hn,style:$n,children:"Since"}),a.jsx("input",{type:"datetime-local",className:Ha,style:$a,value:s.since?s.since.slice(0,16):"",onChange:f=>r({since:f.target.value?new Date(f.target.value).toISOString():void 0})})]}),a.jsxs("div",{children:[a.jsx("label",{className:Hn,style:$n,children:"Until"}),a.jsx("input",{type:"datetime-local",className:Ha,style:$a,value:s.until?s.until.slice(0,16):"",onChange:f=>r({until:f.target.value?new Date(f.target.value).toISOString():void 0})})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Hn,style:$n,children:"Consensus ID (prefix)"}),a.jsx("input",{type:"text",className:Ha,style:$a,value:s.consensusId??"",onChange:d("consensusId"),placeholder:"e.g. d07eac46"})]}),a.jsxs("div",{children:[a.jsx("label",{className:Hn,style:$n,children:"Finding ID (prefix)"}),a.jsx("input",{type:"text",className:Ha,style:$a,value:s.findingId??"",onChange:d("findingId"),placeholder:"e.g. d07eac46-5f464e89:sonnet"})]})]})}const Bh={agents:[],signals:[]},Ry=["agreement","consensus_verified","unique_confirmed","unique_unconfirmed","disagreement","hallucination_caught","new_finding","unverified","impl_test_pass","impl_test_fail","impl_typecheck_pass","impl_typecheck_fail","task_completed","tool_turns","format_compliance"],Oy={agreement:"Agreement",consensus_verified:"Consensus verified",unique_confirmed:"Unique (confirmed)",unique_unconfirmed:"Unique (unconfirmed)",disagreement:"Disagreement",hallucination_caught:"Hallucination",new_finding:"New finding",unverified:"Unverified",impl_test_pass:"Test pass",impl_test_fail:"Test fail",impl_typecheck_pass:"Typecheck pass",impl_typecheck_fail:"Typecheck fail",impl_peer_approved:"Peer approved",impl_peer_rejected:"Peer rejected",boundary_escape:"Boundary escape"},Dy={agreement:"var(--ok)",consensus_verified:"var(--ok)",impl_test_pass:"var(--ok)",impl_typecheck_pass:"var(--ok)",impl_peer_approved:"var(--ok)",disagreement:"var(--bad)",hallucination_caught:"var(--bad)",impl_test_fail:"var(--bad)",impl_typecheck_fail:"var(--bad)",impl_peer_rejected:"var(--bad)",boundary_escape:"var(--bad)",unique_confirmed:"var(--unique)",unique_unconfirmed:"var(--unique)",new_finding:"var(--unique)",unverified:"var(--info)"},zy={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--ink-3)"},ni=100;function Ly(){if(typeof window>"u")return{filters:Bh,hadAny:!1};const s=new URLSearchParams(window.location.search),r=s.getAll("signal").filter(Boolean),u=s.get("agent"),o=s.get("counterpart")??void 0,d=s.get("category")??void 0,f=s.get("severity"),p=f==="critical"||f==="high"||f==="medium"||f==="low"?f:void 0,h=s.get("since")??void 0,x=s.get("until")??void 0,g=s.get("consensus_id")??void 0,b=s.get("finding_id")??void 0,y=s.get("source"),_=y==="manual"||y==="impl"||y==="meta"||y==="auto-provisional"?y:void 0;return r.length>0||u||o||d||p||h||x||g||b||_?{filters:{agents:u?[u]:[],signals:r,counterpart:o,category:d,severity:p,since:h,until:x,consensusId:g,findingId:b,source:_},hadAny:!0}:{filters:Bh,hadAny:!1}}function Uy(s,r,u=ni){const o=new URLSearchParams;o.set("limit",String(u)),o.set("offset",String(r)),s.agents.length===1&&o.set("agent",s.agents[0]),s.counterpart&&o.set("counterpart",s.counterpart);for(const d of s.signals)o.append("signal",d);return s.category&&o.set("category",s.category),s.severity&&o.set("severity",s.severity),s.since&&o.set("since",s.since),s.until&&o.set("until",s.until),s.consensusId&&o.set("consensus_id",s.consensusId),s.findingId&&o.set("finding_id",s.findingId),s.source&&o.set("source",s.source),o}function ru(s,r){return s?s.length>r?s.slice(0,r)+"…":s:""}function By(){const[{filters:s,hadAny:r}]=S.useState(Ly),[u,o]=S.useState(s),[d,f]=S.useState([]),[p,h]=S.useState(0),[x,g]=S.useState(0),[b,y]=S.useState(!1),[_,B]=S.useState(null),[U,A]=S.useState([]),[T,F]=S.useState(!1),[Y,ae]=S.useState(null),[V,E]=S.useState(null),G=S.useRef(null),C=S.useRef(0),K=S.useCallback(async(O,M)=>{const I=++C.current;y(!0),B(null);try{const ee=Uy(O,M*ni),oe=await ut(`signals?${ee.toString()}`);if(I!==C.current)return;f(oe.items??[]),g(oe.total??0)}catch(ee){if(I!==C.current)return;B(ee instanceof Error?ee.message:"fetch failed")}finally{I===C.current&&y(!1)}},[]);S.useEffect(()=>{ut("agents").then(O=>{const M=(O??[]).map(I=>I.id).filter(Boolean).sort();M.length>0&&A(M)}).catch(()=>{})},[]),S.useEffect(()=>{h(0)},[u]),S.useEffect(()=>(G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{K(u,p)},250),()=>{G.current&&clearTimeout(G.current)}),[u,p,K]);const te=S.useCallback(O=>{o(M=>({...M,...O}))},[]),P=Math.max(1,Math.ceil(x/ni)),he=Math.min(p,P-1),ne=x>0||r||b,ue=(O,M)=>{!O||!M||(ae(O),E(M),F(!0))},ye=S.useMemo(()=>{const O=[];return u.agents.length&&O.push(`${u.agents.length} agents`),u.signals.length&&O.push(`${u.signals.length} signals`),u.severity&&O.push(u.severity),u.source&&O.push(u.source),(u.since||u.until)&&O.push("time window"),O.length?O.join(" · "):"all signals"},[u]);return a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-baseline justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"h-route",children:"Signals"}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:"Scored events emitted by agents during consensus review."}),a.jsxs("p",{className:"mt-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:[ye," — showing ",d.length," of ",x]})]})}),r&&a.jsxs("div",{className:"rounded-md border border-border/40 px-3 py-2 font-mono text-[10px]",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"var(--text-dim)"},children:["Filtered view — ",u.signals.length," signal type",u.signals.length!==1?"s":"",u.agents.length>0?` · ${u.agents.length} agent${u.agents.length!==1?"s":""}`:"",u.severity?` · severity: ${u.severity}`:"",u.source?` · source: ${u.source}`:"",". ",a.jsx("a",{href:ua("/signals"),style:{color:"var(--accent)"},children:"Clear filters"})]}),a.jsxs("div",{className:`grid grid-cols-1 gap-4 ${ne?"lg:grid-cols-[260px_1fr]":""} lg:items-start`,children:[ne&&a.jsx("div",{className:r?"opacity-70 transition-opacity hover:opacity-100 focus-within:opacity-100":void 0,children:a.jsx(Cy,{filters:u,onChange:te,agents:U,signalTypes:Ry})}),a.jsxs("section",{className:"min-w-0 overflow-hidden rounded-md border border-border/60",style:{background:"color-mix(in oklch, var(--surface-elev) 70%, transparent)"},children:[_&&a.jsx("div",{className:"border-b border-border/60 px-3 py-2 font-mono text-[10px]",style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 10%, transparent)"},children:_}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full border-collapse text-[10px]",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"h-section border-b border-border/60 text-left",style:{color:"color-mix(in oklch, var(--ink-2) 80%, transparent)"},children:[a.jsx("th",{className:"w-[6px] p-0","aria-label":"severity"}),a.jsx("th",{className:"px-2 py-1.5",children:"time"}),a.jsx("th",{className:"px-2 py-1.5",children:"agent"}),a.jsx("th",{className:"px-2 py-1.5",children:"verdict"}),a.jsx("th",{className:"px-2 py-1.5",children:"finding"}),a.jsx("th",{className:"px-2 py-1.5","data-tooltip":"The other agent in this signal — e.g. the peer who agreed or disputed",children:"counterpart"}),a.jsx("th",{className:"px-2 py-1.5","data-tooltip":"Finding ID — click row to open finding detail",children:"id"}),a.jsx("th",{className:"px-2 py-1.5",children:"consensus"})]})}),a.jsxs("tbody",{children:[d.length===0&&!b&&a.jsx("tr",{children:a.jsx("td",{colSpan:8,className:"px-2 py-8 text-center font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"no signals match these filters"})}),d.map((O,M)=>{const I=!!(O.consensusId&&O.findingId),ee=O.severity?zy[O.severity]:"transparent",oe=Dy[O.signal]??"var(--ink-2)",me=Oy[O.signal]??O.signal;return a.jsxs("tr",{className:`border-b border-border/30 ${I?"cursor-pointer transition-colors":""}`,style:I?{"--row-hover-bg":"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"}:void 0,role:I?"button":void 0,tabIndex:I?0:void 0,"aria-label":I?`View finding ${O.findingId??""}`:void 0,onMouseEnter:j=>{I&&(j.currentTarget.style.background="color-mix(in oklch, var(--surface-sunk) 40%, transparent)")},onMouseLeave:j=>{I&&(j.currentTarget.style.background="")},onClick:()=>I&&ue(O.consensusId,O.findingId),onKeyDown:j=>{I&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),ue(O.consensusId,O.findingId))},children:[a.jsx("td",{className:"p-0",style:{background:ee,width:6},title:O.severity??"no severity"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono tabular-nums",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},title:O.timestamp,children:wt(O.timestamp)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"var(--text)"},children:O.agentId}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1",children:a.jsx("span",{className:"h-section",style:{color:oe,fontSize:11},children:me})}),a.jsx("td",{className:"max-w-[320px] truncate px-2 py-1",style:{fontFamily:"var(--font-mono)",fontSize:12,lineHeight:1.45,color:"var(--text)"},title:O.evidence,children:ru(O.evidence,80)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:O.counterpartId??"—"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},title:O.findingId,children:O.findingId?ru(O.findingId,24):"—"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},title:O.consensusId,children:O.consensusId?ru(O.consensusId,16):"—"})]},`${O.timestamp}-${O.agentId}-${M}`)})]})]})}),a.jsxs("div",{className:"flex items-center justify-between border-t border-border/60 px-3 py-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:b?"loading…":`${he*ni+1}–${he*ni+d.length} of ${x}`}),a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{type:"button",onClick:()=>h(O=>Math.max(0,O-1)),disabled:he===0||b,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-[color-mix(in_oklch,var(--surface-sunk)_50%,transparent)] disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[he+1," / ",P]}),a.jsx("button",{type:"button",onClick:()=>h(O=>Math.min(P-1,O+1)),disabled:he>=P-1||b,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-[color-mix(in_oklch,var(--surface-sunk)_50%,transparent)] disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]})]})]}),a.jsx(Ur,{open:T,onOpenChange:F,consensusId:Y,findingId:V})]})}function Hy(){if(typeof window>"u")return null;const s=new URLSearchParams(window.location.search),r=s.get("key");if(r===null)return null;s.delete("key");const u=s.toString(),o=window.location.pathname+(u?`?${u}`:"")+window.location.hash;return window.history.replaceState(null,"",o),r.trim()||null}function $y(){const[s,r]=S.useState(null),[u,o]=S.useState(null),d=S.useRef(!1),f=S.useCallback(async h=>{o(null);const x=await wv(h);x.ok?r(!0):(o(x.kind),r(!1))},[]),p=S.useCallback(async()=>{if(d.current)return s===!0;d.current=!0;try{const h=await du();return r(h),h}finally{d.current=!1}},[s]);return S.useEffect(()=>{let h=!1;const x=Hy();return d.current=!0,(async()=>{try{if(await du()){h||r(!0);return}if(x){h||await f(x);return}h||r(!1)}finally{d.current=!1}})(),()=>{h=!0}},[f]),{authed:s,login:f,error:u,recheck:p}}function qy(s,r){const u=r.match(/^API error: (\d+)$/),o=u?`HTTP ${u[1]}`:r;return`${s}: ${o}`}const Gy=5e3;async function Ar(s,r){try{return await ut(r)}catch(u){const o=u instanceof Error?u.message:String(u);throw new Error(qy(s,o))}}function Iy(s){const[r,u]=S.useState({overview:null,agents:null,tasks:null,consensus:null,consensusReports:null,fleetTrend:null,signalActivity:null,skills:null,nativeMemories:null,gossipMemories:null,memories:null,loading:!0,error:null}),o=S.useRef(!1),d=S.useRef(s);d.current=s;const f=S.useCallback(async()=>{var p;if(!o.current){o.current=!0;try{const[h,x,g,b,y,_,B,U,A,T]=await Promise.all([Ar("overview","overview"),Ar("agents","agents"),Ar("tasks","tasks?limit=2000"),Ar("consensus","consensus?pageSize=500"),ut("consensus-reports?page=1&pageSize=200").catch(()=>({reports:[]})),ut("fleet-trend?days=7").catch(()=>({days:7,points:[]})),ut("signal-activity").catch(()=>({agents:[],total:0,generatedAt:""})),ut("skills").catch(()=>({index:{},suggestions:[],effectiveness:[]})),ut("native-memory").catch(()=>({knowledge:[]})),ut("gossip-memory").catch(()=>({knowledge:[]}))]),F=[...A.knowledge||[]].map(ae=>({...ae,origin:"native"})).sort((ae,V)=>V.filename>ae.filename?1:-1),Y=[...T.knowledge||[]].map(ae=>({...ae,origin:"gossip"})).sort((ae,V)=>V.filename>ae.filename?1:-1);u({overview:h,agents:x,tasks:g,consensus:b,consensusReports:y,fleetTrend:_,signalActivity:B,skills:U,nativeMemories:F,gossipMemories:Y,memories:F,loading:!1,error:null})}catch(h){Ev(h)?((p=d.current)==null||p.call(d),u(x=>({...x,loading:!1}))):u(x=>({...x,loading:!1,error:h.message}))}finally{o.current=!1}}},[]);return S.useEffect(()=>{f()},[f]),S.useEffect(()=>{const p=setInterval(()=>{f()},Gy);return()=>clearInterval(p)},[f]),{...r,refresh:f}}const gp="dashboard:lastEventId";function Yy(){if(typeof window>"u")return 0;const s=window.localStorage.getItem(gp);if(!s)return 0;const r=parseInt(s,10);return Number.isFinite(r)?r:0}function Xy(s){typeof window>"u"||window.localStorage.setItem(gp,String(s))}const Hh=1e3,Vy=5e3;function vp(s){S.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let r=null,u=null,o=Hh,d=!1;function f(){if(d)return;const p=Yy();r=new window.EventSource(`/dashboard/api/events?last_id=${p}`),r.onmessage=h=>{try{const x=JSON.parse(h.data);s(x),Xy(x.id),o=Hh}catch{}},r.onerror=()=>{r&&(r.close(),r=null),!d&&(u=setTimeout(()=>{f()},o),o=Math.min(o*2,Vy))}}return f(),()=>{d=!0,u!==null&&clearTimeout(u),r&&(r.close(),r=null)}},[])}const $h=5,Ky=6e3;function Zy({toast:s,onDismiss:r}){const u=S.useRef(null),o=S.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),d=S.useCallback(()=>{o(),u.current=setTimeout(()=>r(s.id),Ky)},[s.id,r,o]);S.useEffect(()=>(d(),o),[d,o]);const{type:f,payload:p}=s.event,h=f==="task.completed"?a.jsx("span",{style:{color:"var(--text-dim)"},children:"✓"}):p.confirmed>p.disputed?a.jsx("span",{className:"text-confirmed",children:"◎"}):a.jsx("span",{className:"text-disputed",children:"◎"});let x;if(f==="task.completed"){const b=String(p.agentId??"agent"),y=typeof p.durationMs=="number"?p.durationMs:null,_=y!==null?`${(y/1e3).toFixed(1)}s`:"—";x=`${b} finished in ${_}`}else{const b=Number(p.confirmed??0),y=Number(p.disputed??0);x=`Consensus done — ${b} confirmed · ${y} disputed`}const g=()=>{o(),f==="task.completed"&&p.taskId?ns("/tasks"):f==="consensus.completed"&&p.consensusId&&ns("/debates"),r(s.id)};return a.jsx("div",{className:["pointer-events-auto border rounded px-4 py-3 max-w-sm cursor-pointer","transition-all duration-200","motion-reduce:transition-none motion-reduce:transform-none","hover:border-border",s.exiting?"opacity-0 scale-95 opacity-0 translate-y-2":"opacity-100 scale-100 translate-x-0"].join(" "),style:{background:"var(--surface-elev)",boxShadow:"var(--shadow-card)"},onClick:g,onMouseEnter:o,onMouseLeave:d,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"shrink-0 text-sm font-bold",children:h}),a.jsx("span",{title:x,className:"font-mono text-[11px] min-w-0 truncate",style:{color:"var(--text)"},children:x}),a.jsx("button",{className:"ml-auto shrink-0 hover:[color:var(--text-dim)] text-xs leading-none",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},onClick:b=>{b.stopPropagation(),o(),r(s.id)},"aria-label":"Dismiss notification",children:"×"})]})})}function Qy(){const[s,r]=S.useState([]),u=S.useCallback(d=>{r(f=>f.map(p=>p.id===d?{...p,exiting:!0}:p)),setTimeout(()=>{r(f=>f.filter(p=>p.id!==d))},250)},[]),o=S.useCallback(d=>{r(f=>{const p={id:d.id,event:d,exiting:!1},h=[...f,p];if(h.length>$h){const x=h.length-$h;return h.slice(x)}return h})},[]);return vp(o),a.jsx("div",{className:"fixed bottom-20 right-4 z-50 flex flex-col-reverse gap-2 pointer-events-none",role:"region","aria-label":"Notifications","aria-live":"polite","aria-atomic":"false",children:s.map(d=>a.jsx(Zy,{toast:d,onDismiss:u},d.id))})}const cu=1e3,Fy=5e3,Jy="/dashboard/api/bridge/stream",Wy=4,Py="/dashboard/api/bridge",e1=3e4;function t1(s){switch(s){case 400:return"message rejected — invalid or empty";case 429:return"rate limited — slow down";case 503:return"no live Claude Code session — start `gossipcat code`";case 401:return"session expired — reload to re-authenticate";default:return`send failed — HTTP ${s}`}}let n1=1;function ti(s,r,u,o){return{id:n1++,role:s,text:r,ts:u??new Date().toISOString(),serverId:o}}function Mr(s,r){const u=s[s.length-1];if(!u||r.ts>=u.ts)return[...s,r];const o=s.findIndex(d=>d.ts>r.ts);return o<0?[...s,r]:[...s.slice(0,o),r,...s.slice(o)]}function a1(){const[s,r]=S.useState([]),[u,o]=S.useState("connecting"),[d,f]=S.useState(!1),[p,h]=S.useState(null),[x,g]=S.useState(null),b=S.useRef(null),y=S.useCallback(A=>{b.current=A,h(A)},[]),_=S.useRef(0),B=S.useRef(null);S.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let A=null,T=null,F=cu,Y=!1,ae=0;function V(){if(Y)return;o("connecting");const C=_.current;A=new window.EventSource(`${Jy}?last_id=${C}`),A.onopen=()=>{Y||(ae=0,o("open"),F=cu)},A.onmessage=K=>{var he;let te;try{te=JSON.parse(K.data)}catch{return}const P=b.current;!P||te.chat_id!==P||(te.type==="reply"?(f(!1),r(ne=>Mr(ne,ti("assistant",te.text??"",te.ts)))):te.type==="ack"?r(ne=>Mr(ne,ti("ack","received — working…",te.ts))):te.type==="error"?(f(!1),r(ne=>Mr(ne,ti("error",te.text??"the live session reported an error",te.ts)))):te.type==="mirror"?E(te):te.type==="restart"&&(_.current=0,(he=B.current)==null||he.call(B)))},A.onerror=()=>{A&&(A.close(),A=null),!Y&&(ae+=1,ae>=Wy?o("error"):o("connecting"),T=setTimeout(()=>V(),F),F=Math.min(F*2,Fy))}}function E(C){const K=C.role;if(K!=="user"&&K!=="assistant"&&K!=="activity")return;typeof C.id=="number"&&C.id>_.current&&(_.current=C.id),K==="assistant"&&f(!1);const te=typeof C.text=="string"?C.text:"",P=typeof C.ts=="string"&&/^\d{4}-\d{2}-\d{2}T/.test(C.ts)?C.ts:void 0;r(he=>Mr(he,ti(K,te,P,C.id)))}function G(){Y||(T!==null&&(clearTimeout(T),T=null),A&&(A.close(),A=null),F=cu,V())}return B.current=G,V(),()=>{Y=!0,B.current=null,o("closed"),T!==null&&clearTimeout(T),A&&(A.close(),A=null)}},[]);const U=S.useCallback(async A=>{const T=A.trim();if(T.length===0)return;g(null),r(E=>[...E,ti("user",T)]),f(!0);const F=b.current,Y={message:T};F&&(Y.chat_id=F);const ae=new AbortController,V=setTimeout(()=>ae.abort(),e1);try{const E=await fetch(Py,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(Y),signal:ae.signal});let G={};try{G=await E.json()}catch{}if(typeof G.chat_id=="string"&&G.chat_id.length>0&&!b.current&&y(G.chat_id),E.status===202)return;f(!1),g(G.error??t1(E.status))}catch(E){f(!1);const G=E instanceof Error&&E.name==="AbortError";g(G?"send timed out — relay unreachable":"send failed — relay unreachable")}finally{clearTimeout(V)}},[y]);return{messages:s,status:u,awaitingReply:d,chatId:p,send:U,sendError:x}}const bp=S.createContext(null);function l1({children:s}){const r=a1();return a.jsx(bp.Provider,{value:r,children:s})}function yp(){const s=S.useContext(bp);if(s===null)throw new Error("useBridgeContext must be used inside <BridgeProvider>");return s}function Np({status:s,compact:r=!1}){const u={open:{color:"var(--ok)",label:"live"},connecting:{color:"var(--warn)",label:"connecting"},closed:{color:"var(--idle)",label:"offline"},error:{color:"var(--bad)",label:"relay down"}},{color:o,label:d}=u[s]??u.closed,f=r?"h-1.5 w-1.5":"h-2 w-2",p=r?"font-mono text-[10px]":"font-mono text-[12px]";return a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:`inline-block ${f} rounded-full ${s==="connecting"?"animate-pulse motion-reduce:animate-none":""}`,style:{background:o},"aria-hidden":!0}),a.jsx("span",{className:p,style:{color:"var(--ink-3)"},children:d})]})}function jp({compact:s=!1}){const r=s?"h-1.5 w-1.5":"h-2 w-2",u=s?"text-[10px]":"text-[12px]",o=s?"px-1 py-1":"px-1 py-2";return a.jsxs("div",{className:`flex items-center gap-2 ${o}`,children:[a.jsxs("span",{className:"inline-flex gap-1","aria-hidden":!0,children:[a.jsx("span",{className:`${r} animate-pulse motion-reduce:animate-none rounded-full`,style:{background:"var(--ink-4)"}}),a.jsx("span",{className:`${r} animate-pulse motion-reduce:animate-none rounded-full`,style:{background:"var(--ink-4)",animationDelay:"150ms"}}),a.jsx("span",{className:`${r} animate-pulse motion-reduce:animate-none rounded-full`,style:{background:"var(--ink-4)",animationDelay:"300ms"}})]}),a.jsx("span",{className:u,style:{color:"var(--ink-3)"},children:"working…"})]})}function s1({msg:s}){return a.jsxs("div",{className:"cx-turn user",children:[a.jsx("div",{className:"cx-gutter","aria-hidden":!0,children:"›"}),a.jsx("div",{className:"cx-body whitespace-pre-wrap break-words",children:s.text})]})}function i1({text:s}){return a.jsx("div",{className:"cx-prose finding-md",dangerouslySetInnerHTML:{__html:ii(s)}})}const r1=/^([\p{Emoji_Presentation}\p{Extended_Pictographic}🔧📡🗒]+)\s*/u;function c1(s){let r="",u=s.trim();const o=u.match(r1);o&&(r=o[1],u=u.slice(o[0].length).trim());const d=u.indexOf("→");if(d>=0){const p=u.slice(0,d+1).trim(),h=u.slice(d+1).trim();return{icon:r,label:p,agent:h}}const f=u.indexOf("·");if(f>=0){const p=u.slice(0,f+1).trim(),h=u.slice(f+1).trim();return{icon:r,label:p,cmd:h}}return{icon:r,label:"",cmd:u}}function o1({text:s}){const{icon:r,label:u,cmd:o,agent:d}=c1(s);return a.jsxs("div",{className:"cx-activity",children:[r&&a.jsx("span",{className:"cx-ic","aria-hidden":!0,children:r}),u&&a.jsx("span",{className:"cx-label",children:u}),d&&a.jsx("span",{className:"cx-agent",children:d}),o&&a.jsx("span",{className:!u&&!d?"cx-cmd cx-cmd-bare":"cx-cmd",children:o})]})}function u1({text:s}){return a.jsx("div",{className:"cx-activity",children:a.jsx("span",{className:"cx-cmd cx-cmd-bare",children:s})})}function d1({text:s}){return a.jsxs("div",{className:"cx-state err",role:"alert",children:[a.jsx("span",{className:"cx-chip-bad",children:"session error"}),a.jsx("span",{children:s})]})}function f1({msg:s}){switch(s.role){case"user":return a.jsx(s1,{msg:s});case"activity":return a.jsx("div",{className:"cx-turn assistant",children:a.jsxs("div",{className:"cx-row",children:[a.jsx("div",{className:"cx-bullet","aria-hidden":!0}),a.jsx("div",{className:"cx-body",children:a.jsx(o1,{text:s.text})})]})});case"ack":return a.jsx("div",{className:"cx-turn assistant",children:a.jsxs("div",{className:"cx-row",children:[a.jsx("div",{className:"cx-bullet","aria-hidden":!0}),a.jsx("div",{className:"cx-body",children:a.jsx(u1,{text:s.text})})]})});case"error":return a.jsx("div",{className:"cx-turn assistant",children:a.jsxs("div",{className:"cx-row",children:[a.jsx("div",{className:"cx-bullet","aria-hidden":!0}),a.jsx("div",{className:"cx-body",children:a.jsx(d1,{text:s.text})})]})});case"assistant":default:return a.jsx("div",{className:"cx-turn assistant",children:a.jsxs("div",{className:"cx-row",children:[a.jsx("div",{className:"cx-bullet","aria-hidden":!0,children:"●"}),a.jsx("div",{className:"cx-body",children:a.jsx(i1,{text:s.text})})]})})}}function m1(){return a.jsxs("div",{"aria-busy":"true","aria-label":"Loading transcript",children:[a.jsx("div",{className:"cx-skel",style:{width:"46%"}}),a.jsx("div",{className:"cx-skel",style:{width:"72%"}}),a.jsx("div",{className:"cx-skel",style:{width:"38%"}})]})}function h1(){return a.jsxs("div",{className:"cx-state",children:[a.jsx("span",{"aria-hidden":!0,children:"○"}),a.jsx("span",{children:"No activity yet — terminal session idle"})]})}function Sp({messages:s,status:r}){const u=s.length>0;if(!u&&r==="connecting")return a.jsx(m1,{});if(!u)return a.jsx(h1,{});const o=r==="error";return a.jsxs("div",{children:[o&&a.jsxs("div",{className:"cx-state err",role:"status",children:[a.jsx("span",{className:"cx-chip-bad",children:"relay disconnected"}),a.jsx("span",{className:"cx-dimmed",children:"showing last-known frames"})]}),a.jsx("div",{className:o?"cx-dimmed":void 0,children:s.map(d=>a.jsx(f1,{msg:d},d.id))})]})}function p1(){const[s,r]=S.useState(!1),[u,o]=S.useState(""),{messages:d,status:f,awaitingReply:p,chatId:h,send:x,sendError:g}=yp(),b=S.useRef(null),y=S.useRef(null);S.useEffect(()=>{if(!s)return;const A=b.current;A&&(A.scrollTop=A.scrollHeight)},[d,p,s]),S.useEffect(()=>{var A;s&&((A=y.current)==null||A.focus())},[s]);const _=()=>{const A=u.trim();A&&(x(A),o(""))},B=A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),_())},U=()=>{r(!1),ns("/chat")};return s?a.jsxs("div",{className:"fixed bottom-5 right-5 z-50 flex w-[360px] max-w-[calc(100vw-2rem)] flex-col rounded-xl",style:{height:"min(560px, calc(100vh - 6rem))",background:"var(--surface-elev)",border:"1px solid var(--border)",boxShadow:"var(--shadow-card)"},role:"region","aria-label":"Live Claude Code session chat",children:[a.jsxs("div",{className:"flex items-center gap-2 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"h-section",children:"live claude code"}),a.jsx(Np,{status:f,compact:!0})]}),a.jsx("div",{className:"mt-0.5 truncate font-mono text-[10px]",style:{color:"var(--ink-3)"},children:h?`chat ${h.slice(0,8)}`:"same session as your terminal"})]}),a.jsx("button",{type:"button",onClick:U,className:"shrink-0 rounded px-2 py-1 text-sm leading-none transition-colors hover:[background:var(--surface-sunk)]",style:{color:"var(--ink-3)"},"aria-label":"Open full Chat page","data-tooltip":"Open full Chat page","data-tooltip-pos":"left",children:"⤢"}),a.jsx("button",{type:"button",onClick:()=>r(!1),className:"shrink-0 rounded px-2 py-1 text-sm leading-none transition-colors hover:[background:var(--surface-sunk)]",style:{color:"var(--ink-3)"},"aria-label":"Minimize chat","data-tooltip":"Minimize chat","data-tooltip-pos":"left",children:"–"})]}),a.jsxs("div",{ref:b,className:"chat-surface flex-1 overflow-y-auto px-3 py-3",children:[a.jsx(Sp,{messages:d,status:f}),p&&a.jsx(jp,{compact:!0})]}),g&&a.jsx("div",{role:"alert",className:"mx-3 mb-1 rounded-sm px-2 py-1 font-mono text-[10px]",style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 10%, transparent)",border:"1px solid color-mix(in oklch, var(--bad) 30%, transparent)"},children:g}),a.jsxs("div",{className:"flex items-end gap-2 border-t px-3 py-3",style:{borderColor:"var(--border)"},children:[a.jsx("textarea",{ref:y,value:u,onChange:A=>o(A.target.value),onKeyDown:B,rows:1,placeholder:"Message the live session…",className:"max-h-28 min-h-[36px] flex-1 resize-none rounded-md border px-3 py-2 text-[13px] focus:outline-none",style:{background:"var(--surface)",color:"var(--text)",borderColor:"var(--border)"}}),a.jsx("button",{type:"button",onClick:_,disabled:u.trim().length===0,className:"shrink-0 rounded-md px-3 py-2 text-sm font-medium transition-opacity disabled:opacity-40",style:{background:"var(--accent)",color:"var(--accent-foreground, #fff)"},"aria-label":"Send message",children:"Send"})]})]}):a.jsxs("button",{type:"button",onClick:()=>r(!0),className:"fixed bottom-5 right-5 z-50 flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-colors",style:{position:"fixed",background:"var(--accent)",color:"var(--accent-foreground, #fff)"},"aria-label":"Open live Claude Code chat","data-tooltip":"Talk to the live Claude Code session","data-tooltip-pos":"left",children:[a.jsx("span",{"aria-hidden":!0,children:"◎"}),a.jsx("span",{children:"Live session"})]})}function x1(s){const r=new Map;for(const u of s)r.set(u.day,(r.get(u.day)??0)+u.signals);return Array.from(r.entries()).sort(([u],[o])=>u.localeCompare(o)).map(([u,o])=>({day:u,agentId:"_fleet",accuracy:0,signals:o}))}function g1(){const[s,r]=S.useState(null);return S.useEffect(()=>{const u=new AbortController;return ut("fleet-trend?days=7").then(o=>{u.signal.aborted||r(x1(o.points))}).catch(()=>{u.signal.aborted||r([])}),()=>u.abort()},[]),s===null?null:s.length<2?a.jsx("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-4)"},"aria-label":"no trend data yet",children:"—"}):a.jsx("div",{style:{width:"100%",paddingTop:"4px",paddingBottom:"4px"},children:a.jsx(np,{points:s,width:240,height:28,color:"var(--c1)"})})}const v1=8;function b1({agents:s}){const r=s.map(o=>{const d=(o.scores.agreements??0)+(o.scores.uniqueFindings??0),f=(o.scores.hallucinations??0)+(o.scores.disagreements??0),p=d+f;return{id:o.id,pos:d,neg:f,total:p}}).filter(o=>o.total>0).sort((o,d)=>d.total-o.total).slice(0,v1);if(r.length===0)return null;const u=r[0].total;return a.jsxs("div",{style:{marginTop:"6px"},children:[a.jsx("span",{style:{display:"block",fontSize:"10px",fontVariant:"small-caps",letterSpacing:"0.04em",color:"var(--ink-4)",marginBottom:"6px"},children:"by agent"}),a.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:"5px"},children:r.map(({id:o,pos:d,neg:f,total:p})=>{const h=u>0?p/u:0,x=p>0?d/p:0,g=p>0?f/p:0;return a.jsxs("li",{style:{display:"flex",flexDirection:"column",gap:"3px"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"6px",minWidth:0},children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:"1 1 0",minWidth:0},title:o,children:o}),a.jsxs("span",{className:"font-mono text-[10px]",style:{flexShrink:0,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:[d>0&&a.jsxs("span",{style:{color:"var(--ok)"},children:["↑",d]}),d>0&&f>0&&a.jsx("span",{style:{color:"var(--ink-4)",margin:"0 2px"},children:" "}),f>0&&a.jsxs("span",{style:{color:"var(--bad)"},children:["↓",f]})]})]}),a.jsx("div",{style:{height:"3px",borderRadius:"1.5px",background:"var(--border)",overflow:"hidden"},"aria-hidden":!0,children:a.jsxs("div",{style:{height:"100%",width:`${Math.round(h*100)}%`,display:"flex",borderRadius:"1.5px",overflow:"hidden",transition:"width 200ms ease-out"},children:[d>0&&a.jsx("div",{style:{height:"100%",width:`${Math.round(x*100)}%`,background:"var(--ok)",flexShrink:0}}),f>0&&a.jsx("div",{style:{height:"100%",width:`${Math.round(g*100)}%`,background:"var(--bad)",flexShrink:0}})]})})]},o)})})]})}const qh=6;function y1(s){const{type:r,payload:u}=s;if(r==="task.completed"){const o=typeof u.agentId=="string"?u.agentId:"";return o?`task completed → ${o}`:"task completed"}if(r==="consensus.completed"){const o=typeof u.consensusId=="string"?u.consensusId.slice(0,8):"";return o?`consensus completed ${o}`:"consensus completed"}return r}function N1(s){const r=new Date(s);return Number.isNaN(r.getTime())?"":r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function j1({status:s,chatId:r}){const[u,o]=S.useState([]),[d,f]=S.useState({gitBranch:null,projectName:null,activeTasks:0}),[p,h]=S.useState(null),[x,g]=S.useState(null);S.useEffect(()=>{const _=new AbortController;return ut("session").then(B=>{_.signal.aborted||f({gitBranch:B.gitBranch??null,projectName:B.projectName??null,activeTasks:typeof B.activeTasks=="number"?B.activeTasks:0})}).catch(()=>{}),()=>_.abort()},[]),S.useEffect(()=>{const _=new AbortController;return ut("signal-activity").then(B=>{_.signal.aborted||typeof B.total=="number"&&h(B.total)}).catch(()=>{}),()=>_.abort()},[]),S.useEffect(()=>{const _=new AbortController;return ut("agents").then(B=>{if(!_.signal.aborted&&Array.isArray(B)){const U=B.filter(A=>typeof A=="object"&&A!==null&&typeof A.id=="string"&&typeof A.scores=="object"&&A.scores!==null);g(U)}}).catch(()=>{}),()=>_.abort()},[]);const b=S.useCallback(_=>{o(B=>{const U=[_,...B];return U.length>qh?U.slice(0,qh):U})},[]);vp(b);const y=typeof d.gitBranch=="string"&&d.gitBranch.length>0;return a.jsxs("aside",{style:{width:"100%",minWidth:0,border:"1px solid var(--border)",borderRadius:"var(--r-lg)",background:"var(--surface-elev)",padding:"20px",display:"flex",flexDirection:"column",gap:"20px",alignSelf:"stretch"},"aria-label":"Session info",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"h-section",style:{marginBottom:"12px",borderBottom:"1px solid var(--border)",paddingBottom:"8px"},children:"session"}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[a.jsx(Np,{status:s,compact:!1}),r&&a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:a.jsx("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-3)",wordBreak:"break-all"},children:r})}),y&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},title:"directory the gossipcat relay was launched in (worktree dispatches may differ)",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--ink-3)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:"working dir"}),a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-3)",wordBreak:"break-all"},children:[d.projectName," · ",d.gitBranch]})]}),a.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"6px"},children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--ink-3)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:"tasks"}),a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[d.activeTasks," active"]})]}),p!==null&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0px"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"6px"},children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--ink-3)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:"signals"}),a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[p," · 24h"]})]}),x!==null&&x.length>0&&a.jsx(b1,{agents:x})]}),a.jsx("p",{className:"text-[12px]",style:{color:"var(--ink-3)",lineHeight:1.5,margin:0},children:"Same Claude Code session as your terminal."})]})]}),a.jsxs("section",{style:{flex:1,minHeight:0},children:[a.jsx("h2",{className:"h-section",style:{marginBottom:"12px",borderBottom:"1px solid var(--border)",paddingBottom:"8px"},children:"activity"}),a.jsx(g1,{}),u.length===0?a.jsx("p",{className:"text-[12px]",style:{color:"var(--ink-3)",margin:0},children:"no recent activity"}):a.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:"8px"},children:u.map(_=>a.jsxs("li",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[a.jsx("span",{className:"text-[12px]",style:{color:"var(--ink-2)",lineHeight:1.4},children:y1(_)}),a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},"aria-hidden":!0,children:N1(_.ts)})]},_.id))})]})]})}function S1(){const{messages:s,status:r,awaitingReply:u,chatId:o,send:d,sendError:f}=yp(),[p,h]=S.useState(""),x=S.useRef(null),g=S.useRef(null);S.useEffect(()=>{const _=x.current;_&&(_.scrollTop=_.scrollHeight)},[s,u]),S.useEffect(()=>{var _;(_=g.current)==null||_.focus()},[]);const b=()=>{const _=p.trim();_&&(d(_),h(""))},y=_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),b())};return a.jsxs("div",{className:"flex flex-col",style:{minHeight:"calc(100vh - 56px)",padding:"48px 32px 32px",boxSizing:"border-box"},children:[a.jsxs("div",{className:"mb-5 flex flex-col gap-1",children:[a.jsx("h1",{className:"h-route",children:"Chat"}),a.jsx("p",{className:"mt-1 text-[14px]",style:{color:"var(--ink-3)"},children:"Steer the live Claude Code session running in your terminal."})]}),a.jsxs("div",{className:"flex flex-col gap-5 lg:grid",style:{flex:1,minHeight:0,gridTemplateColumns:"1fr 300px",alignItems:"stretch"},children:[a.jsxs("div",{className:"chat-surface flex flex-col",style:{minHeight:0,border:"1px solid var(--border)",borderRadius:"var(--r-lg)",overflow:"hidden"},children:[a.jsxs("div",{ref:x,className:"flex-1 overflow-y-auto",style:{padding:"20px 20px 8px",minHeight:0},children:[a.jsx(Sp,{messages:s,status:r}),u&&a.jsx(jp,{compact:!1})]}),f&&a.jsx("div",{role:"alert",className:"mx-5 mb-2 rounded px-3 py-1.5 font-mono text-[11px]",style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 10%, transparent)",border:"1px solid color-mix(in oklch, var(--bad) 30%, transparent)"},children:f}),a.jsxs("div",{className:"flex items-end gap-3 border-t",style:{borderColor:"var(--border)",padding:"16px 20px",background:"var(--surface-elev)"},children:[a.jsx("textarea",{ref:g,value:p,onChange:_=>h(_.target.value),onKeyDown:y,rows:2,placeholder:"Message the live session… (Enter to send, Shift+Enter for newline)",className:"max-h-40 flex-1 resize-none rounded-lg border px-4 py-3 text-[14px] focus:outline-none focus:ring-2",style:{background:"var(--surface)",color:"var(--text)",borderColor:"var(--border)",minHeight:"64px","--tw-ring-color":"color-mix(in oklch, var(--accent) 30%, transparent)"}}),a.jsx("button",{type:"button",onClick:b,disabled:p.trim().length===0,className:"shrink-0 rounded-lg px-5 py-3 text-[14px] font-medium transition-opacity disabled:opacity-40",style:{background:"var(--accent)",color:"var(--accent-foreground, #fff)"},"aria-label":"Send message",children:"Send"})]})]}),a.jsx(j1,{status:r,chatId:o})]})]})}function _1({agents:s,tasks:r,consensusReports:u,fleetTrend:o}){const[d,f]=S.useState("weight"),[p,h]=S.useState("desc"),[x,g]=S.useState(""),b=S.useMemo(()=>{const E=new Map;if(r)for(const G of r.items){const C=E.get(G.agentId);(!C||G.timestamp>C.timestamp)&&E.set(G.agentId,G)}return E},[r]);dp(u==null?void 0:u.reports),S.useMemo(()=>{const E=new Map;if(o){for(const G of o.points){const C=E.get(G.agentId)??[];C.push(G),E.set(G.agentId,C)}for(const G of E.values())G.sort((C,K)=>C.day.localeCompare(K.day))}return E},[o]);const y=s.filter(Hv).length,_=s.filter(E=>E.scores.accuracy>=.5).length,B=s.reduce((E,G)=>E+G.scores.signals,0),U=s.reduce((E,G)=>E+G.totalTokens,0),A=x.trim().toLowerCase(),T=A?s.filter(E=>E.id.toLowerCase().includes(A)||E.provider.toLowerCase().includes(A)||E.model.toLowerCase().includes(A)):s,F=E=>{const G=E.scores;switch(d){case"weight":return G.dispatchWeight;case"accuracy":return G.accuracy;case"uniqueness":return G.uniqueness;case"impact":return G.impactScore;case"signals":return G.signals;case"agreements":return G.agreements;case"hallucinations":return G.hallucinations;case"lastTask":{const C=b.get(E.id);return C?new Date(C.timestamp).getTime():0}}},Y=[...T].sort((E,G)=>{const C=F(E),K=F(G);return p==="desc"?K-C:C-K}),ae=E=>{d===E?h(G=>G==="desc"?"asc":"desc"):(f(E),h("desc"))},V=E=>d===E?p==="desc"?"▾":"▴":"";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Team"}),a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:s.length})]}),a.jsx("p",{className:"mt-0.5 text-[13px]",style:{color:"var(--ink-3)"},children:"Per-agent accuracy, signal counts, and dispatch weights."}),a.jsx("div",{className:"mt-2 grid grid-cols-2 gap-px overflow-hidden rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border [background:color-mix(in_oklch,var(--border)_30%,transparent)] sm:grid-cols-4",children:[{label:"Healthy",value:_,varColor:"var(--ok)"},{label:"Benched",value:y,varColor:y>0?"var(--bad)":"var(--ink-3)"},{label:"Total Signals",value:B.toLocaleString(),varColor:"var(--ink)"},{label:"Tokens Used",value:U.toLocaleString(),varColor:"var(--ink)"}].map(E=>a.jsxs("div",{style:{background:"var(--surface-elev)"},className:"px-4 py-3",children:[a.jsx("div",{className:"font-mono text-lg font-bold tabular-nums",style:{color:E.varColor},children:E.value}),a.jsx("div",{className:"h-section mt-0.5",children:E.label})]},E.label))})]}),a.jsx("div",{className:"mb-3",children:a.jsx("input",{type:"text",value:x,onChange:E=>g(E.target.value),placeholder:"Search agents by id, provider, or model...",className:"w-full max-w-md rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-3 py-1.5 font-mono text-xs focus:[border-color:var(--ink-3)] focus:outline-none",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)",color:"var(--ink)"}})}),a.jsx("div",{className:"overflow-hidden rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:a.jsxs("table",{className:"w-full text-left",children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:44}}),a.jsx("col",{}),a.jsx("col",{style:{width:80}}),a.jsx("col",{style:{width:260}}),a.jsx("col",{style:{width:80}}),a.jsx("col",{style:{width:60}}),a.jsx("col",{})]}),a.jsx("thead",{children:a.jsxs("tr",{className:"border-b [border-color:color-mix(in_oklch,var(--border)_40%,transparent)]",style:{background:"color-mix(in oklch, var(--surface-sunk) 20%, transparent)"},children:[a.jsx("th",{className:"h-section py-2.5 pl-5 pr-2 text-center",children:"#"}),a.jsx("th",{className:"h-section py-2.5 pr-3 text-left",children:"Agent"}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>ae("weight"),children:["Weight ",V("weight")]}),a.jsx("th",{className:"h-section py-2.5 pr-4 text-left align-top",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>ae("accuracy"),className:"flex items-center gap-1 hover:[color:var(--ink)]","data-tooltip":"Accuracy — fraction of findings confirmed by cross-review (with hallucination penalty)",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-confirmed"}),"Acc",V("accuracy")]}),a.jsx("span",{style:{color:"color-mix(in oklch, var(--ink-3) 30%, transparent)"},children:"·"}),a.jsxs("button",{onClick:()=>ae("uniqueness"),className:"flex items-center gap-1 hover:[color:var(--ink)]","data-tooltip":"Uniqueness — findings this agent surfaced that no peer found",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-unique"}),"Unq",V("uniqueness")]}),a.jsx("span",{style:{color:"color-mix(in oklch, var(--ink-3) 30%, transparent)"},children:"·"}),a.jsxs("button",{onClick:()=>ae("impact"),className:"flex items-center gap-1 hover:[color:var(--ink)]","data-tooltip":"Impact — severity-weighted finding score",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-[var(--c8)]"}),"Imp",V("impact")]})]})}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>ae("signals"),children:["Signals ",V("signals")]}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>ae("hallucinations"),"data-tooltip":"Hallucinations — fabricated findings caught by cross-review",children:["Halluc ",V("hallucinations")]}),a.jsxs("th",{className:"h-section py-2.5 pr-5 text-left cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>ae("lastTask"),children:["Last Task ",V("lastTask")]})]})}),a.jsx("tbody",{children:Y.map((E,G)=>{const C=E.scores,K=b.get(E.id),te=C.dispatchWeight>=1.2?"var(--ok)":C.dispatchWeight>=.8?"var(--ink)":"var(--bad)",P=G+1;return a.jsxs("tr",{className:"group border-t [border-color:color-mix(in_oklch,var(--border)_20%,transparent)] align-top transition-colors hover:bg-accent/20",children:[a.jsx("td",{className:"py-3 pl-5 pr-2 text-center align-top",children:a.jsx("span",{className:"font-mono text-[11px] tabular-nums",style:{color:P===1?"var(--ink)":P===2||P===3?"color-mix(in oklch, var(--ink-2) 80%, transparent)":"var(--ink-3)",fontWeight:P===1?"bold":P<=3?600:void 0},children:P})}),a.jsx("td",{className:"py-2.5 pr-3 align-top",children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(E.id)}`,className:"flex items-center gap-3",children:[a.jsx(ri,{agentId:E.id,size:32,signals:C.signals,accuracy:C.accuracy,uniqueness:C.uniqueness,impact:C.impactScore}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"truncate font-mono text-xs font-semibold group-hover:[color:var(--accent)]",style:{color:"var(--ink)"},children:E.id}),(()=>{const he=Su(C);return he==="benched"?a.jsx("span",{className:"shrink-0 rounded px-1 text-[8px] font-bold",style:{background:"color-mix(in oklch, var(--bad) 15%, transparent)",color:"var(--bad)",fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":`Benched (${C.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"benched"}):he==="struggling"?a.jsx("span",{className:"shrink-0 rounded bg-unverified/15 px-1 text-[8px] font-bold text-unverified",style:{fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":"Struggling: consecutive failures tripped the circuit breaker. Deprioritized until new clean signals recover the score.",children:"struggling"}):he==="kept-for-coverage"?a.jsx("span",{className:"shrink-0 rounded border border-unverified/40 px-1 text-[8px] font-bold text-unverified",style:{fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":`Would bench (${C.bench.reason??"rule"}), but kept as sole provider of a category.`,children:"kept for coverage"}):null})()]}),a.jsxs("div",{className:"truncate font-mono text-[10px]",style:{color:"var(--ink-3)"},children:[E.provider,"/",E.model]})]})]})}),a.jsx("td",{className:"py-3 pr-4 text-right align-top",children:a.jsx("span",{className:"font-mono text-sm font-bold tabular-nums",style:{color:te},children:C.dispatchWeight.toFixed(2)})}),a.jsx("td",{className:"py-3 pr-4 align-top",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(ou,{label:"A",value:C.accuracy,fillClass:C.accuracy>=.7?"bg-confirmed":C.accuracy>=.4?"bg-unverified":"bg-disputed",tooltip:"Adjusted accuracy = raw signal ratio × 1/(1 + weighted hallucinations × 0.3). The penalty is recoverable via skill-gated multiplier in the same category."}),a.jsx(ou,{label:"U",value:C.uniqueness,fillClass:"bg-unique",tooltip:"Uniqueness — findings this agent surfaced that no other agent found"}),a.jsx(ou,{label:"I",value:C.impactScore,fillClass:"bg-[var(--c8)]",tooltip:"Impact — severity-weighted finding score; critical and high findings count more"})]})}),a.jsx("td",{className:"py-3 pr-4 text-right align-top font-mono text-xs tabular-nums",style:{color:"var(--ink)"},children:C.signals.toLocaleString()}),a.jsx("td",{className:"py-3 pr-4 text-right align-top font-mono text-xs tabular-nums",children:a.jsx("span",{style:{color:C.hallucinations>0?"var(--bad)":"var(--ink-3)",fontWeight:C.hallucinations>10?"bold":void 0},"data-tooltip":`Agreements ${C.agreements} · Disagreements ${C.disagreements} · Hallucinations ${C.hallucinations}`,children:C.hallucinations})}),a.jsx("td",{className:"py-3 pr-5 align-top",children:K?a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx("span",{className:"warn-badge shrink-0 rounded px-1.5 py-0.5 font-mono text-[9px] font-semibold",children:K.taskId.slice(0,8)}),a.jsx("span",{className:"truncate text-[11px]",style:{maxWidth:260,color:"var(--ink-2)"},children:K.task}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--ink-3)"},children:wt(K.timestamp)})]}):a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:"no tasks"})})]},E.id)})})]})})]})}function ou({label:s,value:r,fillClass:u,tooltip:o}){return a.jsxs("div",{className:"flex items-center gap-2","data-tooltip":o,"data-tooltip-pos":"top",children:[a.jsx("span",{className:"w-6 text-[10px]",style:{color:"var(--ink-3)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:s}),a.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)"},children:a.jsx("div",{className:`h-full rounded-full ${u}`,style:{width:`${Math.max(0,Math.min(100,r*100))}%`}})}),a.jsxs("span",{className:"w-8 text-right font-mono text-[10px] tabular-nums",style:{color:"var(--ink-2)"},children:[Math.round(r*100),"%"]})]})}function k1({tasks:s}){const[r,u]=S.useState(""),[o,d]=S.useState(0),[f,p]=S.useState(null),h=100,x=s.items.filter(T=>T.status==="completed").length,g=s.items.filter(T=>T.status==="failed").length,b=s.items.filter(T=>T.status==="running").length,y=r.trim().toLowerCase(),_=y?s.items.filter(T=>{var F,Y,ae,V;return((F=T.task)==null?void 0:F.toLowerCase().includes(y))||((Y=T.agentId)==null?void 0:Y.toLowerCase().includes(y))||((ae=T.taskId)==null?void 0:ae.toLowerCase().includes(y))||((V=T.status)==null?void 0:V.toLowerCase().includes(y))}):s.items,B=Math.max(1,Math.ceil(_.length/h)),U=Math.min(o,B-1),A=_.slice(U*h,(U+1)*h);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Tasks"}),a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:s.total})]}),a.jsx("p",{className:"mt-0.5 text-[13px]",style:{color:"var(--ink-3)"},children:"Live dispatched tasks and their relay status."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--ok)"},children:x})," completed"]}),g>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:g})," failed"]}),b>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:b})," running"]}),a.jsxs("span",{children:["showing ",A.length," of ",_.length,y&&` (filtered from ${s.items.length})`]})]})]}),a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[a.jsx("input",{type:"text",value:r,onChange:T=>{u(T.target.value),d(0)},placeholder:"Search tasks by description, agent, id, status...",className:"w-full max-w-md rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-3 py-1.5 font-mono text-xs focus:[border-color:color-mix(in_oklch,var(--accent)_40%,transparent)] focus:outline-none",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)",color:"var(--ink)"}}),a.jsxs("div",{className:`flex shrink-0 items-center gap-2 font-mono text-[11px] ${B<=1?"invisible":""}`,style:{color:"var(--ink-3)"},children:[a.jsx("button",{onClick:()=>d(T=>Math.max(0,T-1)),disabled:U===0,className:"rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{children:[U+1," / ",B]}),a.jsx("button",{onClick:()=>d(T=>Math.min(B-1,T+1)),disabled:U>=B-1,className:"rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:A.length===0?a.jsx("div",{className:"py-12 text-center text-sm",style:{color:"var(--ink-3)"},children:y?"No tasks match your search.":"No tasks yet."}):a.jsxs("table",{className:"w-full text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b [border-color:color-mix(in_oklch,var(--border)_40%,transparent)]",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:[a.jsx("th",{className:"py-2.5 pl-4 pr-2 h-section",style:{width:32}}),a.jsx("th",{className:"py-2.5 pr-3 h-section",children:"ID"}),a.jsx("th",{className:"py-2.5 pr-3 h-section",children:"Agent"}),a.jsx("th",{className:"py-2.5 pr-3 h-section",children:"Description"}),a.jsx("th",{className:"py-2.5 pr-3 h-section",children:"Duration"}),a.jsx("th",{className:"py-2.5 pr-4 text-right h-section",children:"When"})]})}),a.jsx("tbody",{children:A.map(T=>a.jsx(xp,{task:T,onClick:p},T.taskId))})]})}),a.jsx(hp,{task:f,onClose:()=>p(null)})]})}function E1({consensus:s,consensusReports:r}){const[u,o]=S.useState(!1),d=u?s.runs:s.runs.filter(g=>!g.retracted),f=s.runs.filter(g=>g.retracted).length,p=d.reduce((g,b)=>g+(b.counts.agreement||0),0),h=d.reduce((g,b)=>g+((b.counts.disagreement||0)+(b.counts.hallucination||0)),0),x=d.reduce((g,b)=>g+(b.counts.unverified||0),0);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Consensus Rounds"}),a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:d.length}),!u&&f>0&&a.jsxs("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:["/ ",s.totalRuns??s.runs.length," total"]})]}),a.jsx("p",{className:"mt-0.5 text-[13px]",style:{color:"var(--ink-3)"},children:"Multi-agent review rounds — findings confirmed when ≥2 agents agree."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--ok)"},children:p})," confirmed"]}),a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:h})," disputed"]}),x>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:x})," unverified"]}),a.jsxs("span",{children:[s.totalSignals," total signals"]})]}),f>0&&a.jsxs("div",{className:"mt-2 flex items-center gap-2 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[a.jsx("span",{children:u?`${f} retracted run${f===1?"":"s"} shown`:`${f} retracted run${f===1?"":"s"} hidden`}),a.jsx("button",{type:"button",onClick:()=>o(g=>!g),className:"rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 text-[10px] transition hover:bg-accent/10 hover:[color:var(--ink)]",style:{background:"var(--surface-elev)"},children:u?"hide":"show"})]})]}),a.jsx(U0,{consensus:s,filteredRuns:d,reports:r,showAll:!0,hideHeader:!0})]})}function w1({onUnauthorized:s}){const r=Gh(),{overview:u,agents:o,tasks:d,consensus:f,consensusReports:p,fleetTrend:h,signalActivity:x,skills:g,loading:b,error:y,refresh:_}=Iy(s),[B,U]=S.useState(0),A=S.useCallback(E=>{E.type!=="log_lines"&&_()},[_]);if(op(A),!b&&y&&(!u||!f))return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(lu,{}),a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsxs("div",{className:"w-full max-w-sm rounded-xl border p-8 text-center",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:[a.jsx("p",{className:"mb-2 text-sm font-semibold",style:{color:"var(--bad)"},children:"Dashboard fetch failed"}),a.jsx("p",{className:"mb-4 font-mono text-xs",style:{color:"var(--bad)"},children:y}),a.jsx("p",{className:"text-xs",style:{color:"var(--ink-3)"},children:"Relay may be restarting — retrying every 5s. Check the relay terminal if this persists."})]})})]});if(b||!u||!f)return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(lu,{}),a.jsx(py,{})]});let T;const F=r.match(/^\/agent\/(.+)$/),Y=r.match(/^\/consensus\/(.+)$/);if(F&&o){const E=decodeURIComponent(F[1]);T=a.jsx(Sy,{agentId:E,agents:o,tasks:d,consensus:f})}else if(Y){const E=decodeURIComponent(Y[1]);T=a.jsx(v0,{consensusId:E})}else r==="/team"?T=o?a.jsx(_1,{agents:o,tasks:d,consensusReports:p,fleetTrend:h}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(xy,{})}):r==="/tasks"?T=d?a.jsx(k1,{tasks:d}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(gy,{})}):r==="/debates"?T=f?a.jsx(E1,{consensus:f,consensusReports:p}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(vy,{})}):r==="/chat"?T=a.jsx(S1,{}):r==="/logs"?T=a.jsx(Ty,{}):r==="/signals"?T=a.jsx(By,{}):r==="/violations"?T=a.jsx($0,{}):T=a.jsx(i0,{overview:u,agents:o,tasks:d,consensus:f,consensusReports:p,fleetTrend:h,signalActivity:x,skills:g,activeTaskCount:B,setActiveTaskCount:U});const V=r==="/"||r==="/overview"||!/^\/(agent\/|consensus\/|team|tasks|debates|logs|signals|violations|chat)/.test(r)?"px-6 py-6":"mx-auto max-w-7xl space-y-6 px-6 py-6";return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(lu,{}),a.jsx("main",{className:V,children:T})]})}function T1(){const{authed:s,login:r,error:u,recheck:o}=$y();return s===null?a.jsx("div",{className:"flex min-h-screen items-center justify-center",style:{color:"var(--ink-3)"},children:"Loading..."}):s?a.jsxs(l1,{children:[a.jsx(w1,{onUnauthorized:o}),a.jsx(Qy,{}),a.jsx(p1,{})]}):a.jsx(b0,{onLogin:r,error:u})}Bg.createRoot(document.getElementById("root")).render(a.jsx(S.StrictMode,{children:a.jsx(T1,{})}));