gossipcat 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-dashboard/assets/index-BLbA9JYk.css +1 -0
- package/dist-dashboard/assets/index-Jl6prXe-.js +79 -0
- package/dist-dashboard/index.html +2 -2
- package/dist-mcp/mcp-server.js +69485 -47572
- package/package.json +3 -3
- package/dist-dashboard/assets/index-CUTIQoLn.css +0 -1
- package/dist-dashboard/assets/index-tSxgrLeq.js +0 -79
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var Pp=Object.defineProperty;var ev=(i,c,u)=>c in i?Pp(i,c,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[c]=u;var nt=(i,c,u)=>ev(i,typeof c!="symbol"?c+"":c,u);(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const v of m.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&o(v)}).observe(document,{childList:!0,subtree:!0});function u(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(d){if(d.ep)return;d.ep=!0;const m=u(d);fetch(d.href,m)}})();var to={exports:{}},is={};/**
|
|
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 Om;function tv(){if(Om)return is;Om=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function u(o,d,m){var v=null;if(m!==void 0&&(v=""+m),d.key!==void 0&&(v=""+d.key),"key"in d){m={};for(var h in d)h!=="key"&&(m[h]=d[h])}else m=d;return d=m.ref,{$$typeof:i,type:o,key:v,ref:d!==void 0?d:null,props:m}}return is.Fragment=c,is.jsx=u,is.jsxs=u,is}var Um;function nv(){return Um||(Um=1,to.exports=tv()),to.exports}var a=nv(),no={exports:{}},xe={};/**
|
|
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 qm;function lv(){if(qm)return xe;qm=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),v=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),R=Symbol.iterator;function X(j){return j===null||typeof j!="object"?null:(j=R&&j[R]||j["@@iterator"],typeof j=="function"?j:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G=Object.assign,E={};function I(j,B,ee){this.props=j,this.context=B,this.refs=E,this.updater=ee||O}I.prototype.isReactComponent={},I.prototype.setState=function(j,B){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,B,"setState")},I.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function K(){}K.prototype=I.prototype;function P(j,B,ee){this.props=j,this.context=B,this.refs=E,this.updater=ee||O}var $=P.prototype=new K;$.constructor=P,G($,I.prototype),$.isPureReactComponent=!0;var T=Array.isArray;function Z(){}var z={H:null,A:null,T:null,S:null},J=Object.prototype.hasOwnProperty;function le(j,B,ee){var Q=ee.ref;return{$$typeof:i,type:j,key:B,ref:Q!==void 0?Q:null,props:ee}}function F(j,B){return le(j.type,B,j.props)}function de(j){return typeof j=="object"&&j!==null&&j.$$typeof===i}function te(j){var B={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ee){return B[ee]})}var ae=/\/+/g;function he(j,B){return typeof j=="object"&&j!==null&&j.key!=null?te(""+j.key):B.toString(36)}function M(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(Z,Z):(j.status="pending",j.then(function(B){j.status==="pending"&&(j.status="fulfilled",j.value=B)},function(B){j.status==="pending"&&(j.status="rejected",j.reason=B)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function w(j,B,ee,Q,q){var se=typeof j;(se==="undefined"||se==="boolean")&&(j=null);var oe=!1;if(j===null)oe=!0;else switch(se){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(j.$$typeof){case i:case c:oe=!0;break;case y:return oe=j._init,w(oe(j._payload),B,ee,Q,q)}}if(oe)return q=q(j),oe=Q===""?"."+he(j,0):Q,T(q)?(ee="",oe!=null&&(ee=oe.replace(ae,"$&/")+"/"),w(q,B,ee,"",function(Je){return Je})):q!=null&&(de(q)&&(q=F(q,ee+(q.key==null||j&&j.key===q.key?"":(""+q.key).replace(ae,"$&/")+"/")+oe)),B.push(q)),1;oe=0;var Me=Q===""?".":Q+":";if(T(j))for(var ye=0;ye<j.length;ye++)Q=j[ye],se=Me+he(Q,ye),oe+=w(Q,B,ee,se,q);else if(ye=X(j),typeof ye=="function")for(j=ye.call(j),ye=0;!(Q=j.next()).done;)Q=Q.value,se=Me+he(Q,ye++),oe+=w(Q,B,ee,se,q);else if(se==="object"){if(typeof j.then=="function")return w(M(j),B,ee,Q,q);throw B=String(j),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return oe}function H(j,B,ee){if(j==null)return j;var Q=[],q=0;return w(j,Q,"","",function(se){return B.call(ee,se,q++)}),Q}function ne(j){if(j._status===-1){var B=j._result;B=B(),B.then(function(ee){(j._status===0||j._status===-1)&&(j._status=1,j._result=ee)},function(ee){(j._status===0||j._status===-1)&&(j._status=2,j._result=ee)}),j._status===-1&&(j._status=0,j._result=B)}if(j._status===1)return j._result.default;throw j._result}var ce=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=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(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},fe={map:H,forEach:function(j,B,ee){H(j,function(){B.apply(this,arguments)},ee)},count:function(j){var B=0;return H(j,function(){B++}),B},toArray:function(j){return H(j,function(B){return B})||[]},only:function(j){if(!de(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return xe.Activity=k,xe.Children=fe,xe.Component=I,xe.Fragment=u,xe.Profiler=d,xe.PureComponent=P,xe.StrictMode=o,xe.Suspense=p,xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,xe.__COMPILER_RUNTIME={__proto__:null,c:function(j){return z.H.useMemoCache(j)}},xe.cache=function(j){return function(){return j.apply(null,arguments)}},xe.cacheSignal=function(){return null},xe.cloneElement=function(j,B,ee){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var Q=G({},j.props),q=j.key;if(B!=null)for(se in B.key!==void 0&&(q=""+B.key),B)!J.call(B,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&B.ref===void 0||(Q[se]=B[se]);var se=arguments.length-2;if(se===1)Q.children=ee;else if(1<se){for(var oe=Array(se),Me=0;Me<se;Me++)oe[Me]=arguments[Me+2];Q.children=oe}return le(j.type,q,Q)},xe.createContext=function(j){return j={$$typeof:v,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:m,_context:j},j},xe.createElement=function(j,B,ee){var Q,q={},se=null;if(B!=null)for(Q in B.key!==void 0&&(se=""+B.key),B)J.call(B,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(q[Q]=B[Q]);var oe=arguments.length-2;if(oe===1)q.children=ee;else if(1<oe){for(var Me=Array(oe),ye=0;ye<oe;ye++)Me[ye]=arguments[ye+2];q.children=Me}if(j&&j.defaultProps)for(Q in oe=j.defaultProps,oe)q[Q]===void 0&&(q[Q]=oe[Q]);return le(j,se,q)},xe.createRef=function(){return{current:null}},xe.forwardRef=function(j){return{$$typeof:h,render:j}},xe.isValidElement=de,xe.lazy=function(j){return{$$typeof:y,_payload:{_status:-1,_result:j},_init:ne}},xe.memo=function(j,B){return{$$typeof:g,type:j,compare:B===void 0?null:B}},xe.startTransition=function(j){var B=z.T,ee={};z.T=ee;try{var Q=j(),q=z.S;q!==null&&q(ee,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(Z,ce)}catch(se){ce(se)}finally{B!==null&&ee.types!==null&&(B.types=ee.types),z.T=B}},xe.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},xe.use=function(j){return z.H.use(j)},xe.useActionState=function(j,B,ee){return z.H.useActionState(j,B,ee)},xe.useCallback=function(j,B){return z.H.useCallback(j,B)},xe.useContext=function(j){return z.H.useContext(j)},xe.useDebugValue=function(){},xe.useDeferredValue=function(j,B){return z.H.useDeferredValue(j,B)},xe.useEffect=function(j,B){return z.H.useEffect(j,B)},xe.useEffectEvent=function(j){return z.H.useEffectEvent(j)},xe.useId=function(){return z.H.useId()},xe.useImperativeHandle=function(j,B,ee){return z.H.useImperativeHandle(j,B,ee)},xe.useInsertionEffect=function(j,B){return z.H.useInsertionEffect(j,B)},xe.useLayoutEffect=function(j,B){return z.H.useLayoutEffect(j,B)},xe.useMemo=function(j,B){return z.H.useMemo(j,B)},xe.useOptimistic=function(j,B){return z.H.useOptimistic(j,B)},xe.useReducer=function(j,B,ee){return z.H.useReducer(j,B,ee)},xe.useRef=function(j){return z.H.useRef(j)},xe.useState=function(j){return z.H.useState(j)},xe.useSyncExternalStore=function(j,B,ee){return z.H.useSyncExternalStore(j,B,ee)},xe.useTransition=function(){return z.H.useTransition()},xe.version="19.2.6",xe}var Bm;function Ao(){return Bm||(Bm=1,no.exports=lv()),no.exports}var N=Ao(),lo={exports:{}},rs={},ao={exports:{}},so={};/**
|
|
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 Lm;function av(){return Lm||(Lm=1,(function(i){function c(w,H){var ne=w.length;w.push(H);e:for(;0<ne;){var ce=ne-1>>>1,fe=w[ce];if(0<d(fe,H))w[ce]=H,w[ne]=fe,ne=ce;else break e}}function u(w){return w.length===0?null:w[0]}function o(w){if(w.length===0)return null;var H=w[0],ne=w.pop();if(ne!==H){w[0]=ne;e:for(var ce=0,fe=w.length,j=fe>>>1;ce<j;){var B=2*(ce+1)-1,ee=w[B],Q=B+1,q=w[Q];if(0>d(ee,ne))Q<fe&&0>d(q,ee)?(w[ce]=q,w[Q]=ne,ce=Q):(w[ce]=ee,w[B]=ne,ce=B);else if(Q<fe&&0>d(q,ne))w[ce]=q,w[Q]=ne,ce=Q;else break e}}return H}function d(w,H){var ne=w.sortIndex-H.sortIndex;return ne!==0?ne:w.id-H.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var v=Date,h=v.now();i.unstable_now=function(){return v.now()-h}}var p=[],g=[],y=1,k=null,R=3,X=!1,O=!1,G=!1,E=!1,I=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function $(w){for(var H=u(g);H!==null;){if(H.callback===null)o(g);else if(H.startTime<=w)o(g),H.sortIndex=H.expirationTime,c(p,H);else break;H=u(g)}}function T(w){if(G=!1,$(w),!O)if(u(p)!==null)O=!0,Z||(Z=!0,te());else{var H=u(g);H!==null&&M(T,H.startTime-w)}}var Z=!1,z=-1,J=5,le=-1;function F(){return E?!0:!(i.unstable_now()-le<J)}function de(){if(E=!1,Z){var w=i.unstable_now();le=w;var H=!0;try{e:{O=!1,G&&(G=!1,K(z),z=-1),X=!0;var ne=R;try{t:{for($(w),k=u(p);k!==null&&!(k.expirationTime>w&&F());){var ce=k.callback;if(typeof ce=="function"){k.callback=null,R=k.priorityLevel;var fe=ce(k.expirationTime<=w);if(w=i.unstable_now(),typeof fe=="function"){k.callback=fe,$(w),H=!0;break t}k===u(p)&&o(p),$(w)}else o(p);k=u(p)}if(k!==null)H=!0;else{var j=u(g);j!==null&&M(T,j.startTime-w),H=!1}}break e}finally{k=null,R=ne,X=!1}H=void 0}}finally{H?te():Z=!1}}}var te;if(typeof P=="function")te=function(){P(de)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,he=ae.port2;ae.port1.onmessage=de,te=function(){he.postMessage(null)}}else te=function(){I(de,0)};function M(w,H){z=I(function(){w(i.unstable_now())},H)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(w){w.callback=null},i.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<w?Math.floor(1e3/w):5},i.unstable_getCurrentPriorityLevel=function(){return R},i.unstable_next=function(w){switch(R){case 1:case 2:case 3:var H=3;break;default:H=R}var ne=R;R=H;try{return w()}finally{R=ne}},i.unstable_requestPaint=function(){E=!0},i.unstable_runWithPriority=function(w,H){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var ne=R;R=w;try{return H()}finally{R=ne}},i.unstable_scheduleCallback=function(w,H,ne){var ce=i.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?ce+ne:ce):ne=ce,w){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=ne+fe,w={id:y++,callback:H,priorityLevel:w,startTime:ne,expirationTime:fe,sortIndex:-1},ne>ce?(w.sortIndex=ne,c(g,w),u(p)===null&&w===u(g)&&(G?(K(z),z=-1):G=!0,M(T,ne-ce))):(w.sortIndex=fe,c(p,w),O||X||(O=!0,Z||(Z=!0,te()))),w},i.unstable_shouldYield=F,i.unstable_wrapCallback=function(w){var H=R;return function(){var ne=R;R=H;try{return w.apply(this,arguments)}finally{R=ne}}}})(so)),so}var Hm;function sv(){return Hm||(Hm=1,ao.exports=av()),ao.exports}var io={exports:{}},ot={};/**
|
|
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 $m;function iv(){if($m)return ot;$m=1;var i=Ao();function c(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)g+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; 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(c(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 m(p,g,y){var k=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:k==null?null:""+k,children:p,containerInfo:g,implementation:y}}var v=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,ot.createPortal=function(p,g){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(c(299));return m(p,g,null,y)},ot.flushSync=function(p){var g=v.T,y=o.p;try{if(v.T=null,o.p=2,p)return p()}finally{v.T=g,o.p=y,o.d.f()}},ot.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,o.d.C(p,g))},ot.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},ot.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var y=g.as,k=h(y,g.crossOrigin),R=typeof g.integrity=="string"?g.integrity:void 0,X=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;y==="style"?o.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:k,integrity:R,fetchPriority:X}):y==="script"&&o.d.X(p,{crossOrigin:k,integrity:R,fetchPriority:X,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},ot.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var y=h(g.as,g.crossOrigin);o.d.M(p,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&o.d.M(p)},ot.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,k=h(y,g.crossOrigin);o.d.L(p,y,{crossOrigin:k,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})}},ot.preloadModule=function(p,g){if(typeof p=="string")if(g){var y=h(g.as,g.crossOrigin);o.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else o.d.m(p)},ot.requestFormReset=function(p){o.d.r(p)},ot.unstable_batchedUpdates=function(p,g){return p(g)},ot.useFormState=function(p,g,y){return v.H.useFormState(p,g,y)},ot.useFormStatus=function(){return v.H.useHostTransitionStatus()},ot.version="19.2.6",ot}var Gm;function rv(){if(Gm)return io.exports;Gm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),io.exports=iv(),io.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 Ym;function cv(){if(Ym)return rs;Ym=1;var i=sv(),c=Ao(),u=rv();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 m(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 v(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 p(e){if(m(e)!==e)throw Error(o(188))}function g(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var s=n.return;if(s===null)break;var r=s.alternate;if(r===null){if(l=s.return,l!==null){n=l;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===n)return p(s),e;if(r===l)return p(s),t;r=r.sibling}throw Error(o(188))}if(n.return!==l.return)n=s,l=r;else{for(var f=!1,x=s.child;x;){if(x===n){f=!0,n=s,l=r;break}if(x===l){f=!0,l=s,n=r;break}x=x.sibling}if(!f){for(x=r.child;x;){if(x===n){f=!0,n=r,l=s;break}if(x===l){f=!0,l=r,n=s;break}x=x.sibling}if(!f)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 y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var k=Object.assign,R=Symbol.for("react.element"),X=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),P=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var ae=Symbol.for("react.client.reference");function he(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case G:return"Fragment";case I:return"Profiler";case E:return"StrictMode";case T:return"Suspense";case Z:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case P:return e.displayName||"Context";case K:return(e._context.displayName||"Context")+".Consumer";case $:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:he(e.type)||"Memo";case J:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var M=Array.isArray,w=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},ce=[],fe=-1;function j(e){return{current:e}}function B(e){0>fe||(e.current=ce[fe],ce[fe]=null,fe--)}function ee(e,t){fe++,ce[fe]=e.current,e.current=t}var Q=j(null),q=j(null),se=j(null),oe=j(null);function Me(e,t){switch(ee(se,t),ee(q,e),ee(Q,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?am(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=am(t),e=sm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(Q),ee(Q,e)}function ye(){B(Q),B(q),B(se)}function Je(e){e.memoizedState!==null&&ee(oe,e);var t=Q.current,n=sm(t,e.type);t!==n&&(ee(q,e),ee(Q,n))}function Ct(e){q.current===e&&(B(Q),B(q)),oe.current===e&&(B(oe),ns._currentValue=ne)}var mt,kn;function jt(e){if(mt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);mt=t&&t[1]||"",kn=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+mt+e+kn}var Ae=!1;function nn(e,t){if(!e||Ae)return"";Ae=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var V=function(){throw Error()};if(Object.defineProperty(V.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(V,[])}catch(U){var D=U}Reflect.construct(e,[],V)}else{try{V.call()}catch(U){D=U}e.call(V.prototype)}}else{try{throw Error()}catch(U){D=U}(V=e())&&typeof V.catch=="function"&&V.catch(function(){})}}catch(U){if(U&&D&&typeof U.stack=="string")return[U.stack,D.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=l.DetermineComponentFrameRoot(),f=r[0],x=r[1];if(f&&x){var b=f.split(`
|
|
44
|
+
`),C=x.split(`
|
|
45
|
+
`);for(s=l=0;l<b.length&&!b[l].includes("DetermineComponentFrameRoot");)l++;for(;s<C.length&&!C[s].includes("DetermineComponentFrameRoot");)s++;if(l===b.length||s===C.length)for(l=b.length-1,s=C.length-1;1<=l&&0<=s&&b[l]!==C[s];)s--;for(;1<=l&&0<=s;l--,s--)if(b[l]!==C[s]){if(l!==1||s!==1)do if(l--,s--,0>s||b[l]!==C[s]){var L=`
|
|
46
|
+
`+b[l].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=l&&0<=s);break}}}finally{Ae=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?jt(n):""}function Zt(e,t){switch(e.tag){case 26:case 27:case 5:return jt(e.type);case 16:return jt("Lazy");case 13:return e.child!==t&&t!==null?jt("Suspense Fallback"):jt("Suspense");case 19:return jt("SuspenseList");case 0:case 15:return nn(e.type,!1);case 11:return nn(e.type.render,!1);case 1:return nn(e.type,!0);case 31:return jt("Activity");default:return""}}function _n(e){try{var t="",n=null;do t+=Zt(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
+
Error generating stack: `+l.message+`
|
|
48
|
+
`+l.stack}}var W=Object.prototype.hasOwnProperty,pe=i.unstable_scheduleCallback,Te=i.unstable_cancelCallback,Fe=i.unstable_shouldYield,Yt=i.unstable_requestPaint,lt=i.unstable_now,ut=i.unstable_getCurrentPriorityLevel,ma=i.unstable_ImmediatePriority,Pn=i.unstable_UserBlockingPriority,ms=i.unstable_NormalPriority,Dh=i.unstable_LowPriority,qo=i.unstable_IdlePriority,Oh=i.log,Uh=i.unstable_setDisableYieldValue,ha=null,Nt=null;function En(e){if(typeof Oh=="function"&&Uh(e),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(ha,e)}catch{}}var St=Math.clz32?Math.clz32:Lh,qh=Math.log,Bh=Math.LN2;function Lh(e){return e>>>=0,e===0?32:31-(qh(e)/Bh|0)|0}var hs=256,xs=262144,ps=4194304;function el(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 vs(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var s=0,r=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var x=l&134217727;return x!==0?(l=x&~r,l!==0?s=el(l):(f&=x,f!==0?s=el(f):n||(n=x&~e,n!==0&&(s=el(n))))):(x=l&~r,x!==0?s=el(x):f!==0?s=el(f):n||(n=l&~e,n!==0&&(s=el(n)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:s}function xa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Hh(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 Bo(){var e=ps;return ps<<=1,(ps&62914560)===0&&(ps=4194304),e}function Yi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $h(e,t,n,l,s,r){var f=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 x=e.entanglements,b=e.expirationTimes,C=e.hiddenUpdates;for(n=f&~n;0<n;){var L=31-St(n),V=1<<L;x[L]=0,b[L]=-1;var D=C[L];if(D!==null)for(C[L]=null,L=0;L<D.length;L++){var U=D[L];U!==null&&(U.lane&=-536870913)}n&=~V}l!==0&&Lo(e,l,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(f&~t))}function Lo(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-St(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Ho(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-St(n),s=1<<l;s&t|e[l]&t&&(e[l]|=t),n&=~s}}function $o(e,t){var n=t&-t;return n=(n&42)!==0?1:Xi(n),(n&(e.suspendedLanes|t))!==0?0:n}function Xi(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 Vi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Go(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:wm(e.type))}function Yo(e,t){var n=H.p;try{return H.p=e,t()}finally{H.p=n}}var Tn=Math.random().toString(36).slice(2),at="__reactFiber$"+Tn,ht="__reactProps$"+Tn,kl="__reactContainer$"+Tn,Qi="__reactEvents$"+Tn,Gh="__reactListeners$"+Tn,Yh="__reactHandles$"+Tn,Xo="__reactResources$"+Tn,va="__reactMarker$"+Tn;function Zi(e){delete e[at],delete e[ht],delete e[Qi],delete e[Gh],delete e[Yh]}function _l(e){var t=e[at];if(t)return t;for(var n=e.parentNode;n;){if(t=n[kl]||n[at]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[at])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function El(e){if(e=e[at]||e[kl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ga(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Tl(e){var t=e[Xo];return t||(t=e[Xo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[va]=!0}var Vo=new Set,Qo={};function tl(e,t){wl(e,t),wl(e+"Capture",t)}function wl(e,t){for(Qo[e]=t,e=0;e<t.length;e++)Vo.add(t[e])}var Xh=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]*$"),Zo={},Ko={};function Vh(e){return W.call(Ko,e)?!0:W.call(Zo,e)?!1:Xh.test(e)?Ko[e]=!0:(Zo[e]=!0,!1)}function gs(e,t,n){if(Vh(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 ys(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 ln(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 zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Qh(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 s=l.get,r=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(f){n=""+f,r.call(this,f)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ki(e){if(!e._valueTracker){var t=Jo(e)?"checked":"value";e._valueTracker=Qh(e,t,""+e[t])}}function Fo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Jo(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function bs(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 Zh=/[\n"\\]/g;function Rt(e){return e.replace(Zh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ji(e,t,n,l,s,r,f,x){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+zt(t)):e.value!==""+zt(t)&&(e.value=""+zt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Fi(e,f,zt(t)):n!=null?Fi(e,f,zt(n)):l!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+zt(x):e.removeAttribute("name")}function Io(e,t,n,l,s,r,f,x){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){Ki(e);return}n=n!=null?""+zt(n):"",t=t!=null?""+zt(t):n,x||t===e.value||(e.value=t),e.defaultValue=t}l=l??s,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=x?e.checked:!!l,e.defaultChecked=!!l,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Ki(e)}function Fi(e,t,n){t==="number"&&bs(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ml(e,t,n,l){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&l&&(e[n].defaultSelected=!0)}else{for(n=""+zt(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,l&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Wo(e,t,n){if(t!=null&&(t=""+zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+zt(n):""}function Po(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if(M(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=zt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Ki(e)}function Al(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kh=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 eu(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||Kh.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function tu(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 s in t)l=t[s],t.hasOwnProperty(s)&&n[s]!==l&&eu(e,s,l)}else for(var r in t)t.hasOwnProperty(r)&&eu(e,r,t[r])}function Ii(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 Jh=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"]]),Fh=/^[\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 js(e){return Fh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function an(){}var Wi=null;function Pi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cl=null,zl=null;function nu(e){var t=El(e);if(t&&(e=t.stateNode)){var n=e[ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ji(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="'+Rt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var s=l[ht]||null;if(!s)throw Error(o(90));Ji(l,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Fo(l)}break e;case"textarea":Wo(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ml(e,!!n.multiple,t,!1)}}}var er=!1;function lu(e,t,n){if(er)return e(t,n);er=!0;try{var l=e(t);return l}finally{if(er=!1,(Cl!==null||zl!==null)&&(ci(),Cl&&(t=Cl,e=zl,zl=Cl=null,nu(t),e)))for(t=0;t<e.length;t++)nu(e[t])}}function ya(e,t){var n=e.stateNode;if(n===null)return null;var l=n[ht]||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 sn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),tr=!1;if(sn)try{var ba={};Object.defineProperty(ba,"passive",{get:function(){tr=!0}}),window.addEventListener("test",ba,ba),window.removeEventListener("test",ba,ba)}catch{tr=!1}var wn=null,nr=null,Ns=null;function au(){if(Ns)return Ns;var e,t=nr,n=t.length,l,s="value"in wn?wn.value:wn.textContent,r=s.length;for(e=0;e<n&&t[e]===s[e];e++);var f=n-e;for(l=1;l<=f&&t[n-l]===s[r-l];l++);return Ns=s.slice(e,1<l?1-l:void 0)}function Ss(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 ks(){return!0}function su(){return!1}function xt(e){function t(n,l,s,r,f){this._reactName=n,this._targetInst=s,this.type=l,this.nativeEvent=r,this.target=f,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(n=e[x],this[x]=n?n(r):r[x]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?ks:su,this.isPropagationStopped=su,this}return k(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ks)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ks)},persist:function(){},isPersistent:ks}),t}var nl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_s=xt(nl),ja=k({},nl,{view:0,detail:0}),Ih=xt(ja),lr,ar,Na,Es=k({},ja,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ir,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!==Na&&(Na&&e.type==="mousemove"?(lr=e.screenX-Na.screenX,ar=e.screenY-Na.screenY):ar=lr=0,Na=e),lr)},movementY:function(e){return"movementY"in e?e.movementY:ar}}),iu=xt(Es),Wh=k({},Es,{dataTransfer:0}),Ph=xt(Wh),ex=k({},ja,{relatedTarget:0}),sr=xt(ex),tx=k({},nl,{animationName:0,elapsedTime:0,pseudoElement:0}),nx=xt(tx),lx=k({},nl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ax=xt(lx),sx=k({},nl,{data:0}),ru=xt(sx),ix={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rx={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"},cx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ox(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cx[e])?!!t[e]:!1}function ir(){return ox}var ux=k({},ja,{key:function(e){if(e.key){var t=ix[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ss(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?rx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ir,charCode:function(e){return e.type==="keypress"?Ss(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ss(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),dx=xt(ux),fx=k({},Es,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cu=xt(fx),mx=k({},ja,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ir}),hx=xt(mx),xx=k({},nl,{propertyName:0,elapsedTime:0,pseudoElement:0}),px=xt(xx),vx=k({},Es,{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}),gx=xt(vx),yx=k({},nl,{newState:0,oldState:0}),bx=xt(yx),jx=[9,13,27,32],rr=sn&&"CompositionEvent"in window,Sa=null;sn&&"documentMode"in document&&(Sa=document.documentMode);var Nx=sn&&"TextEvent"in window&&!Sa,ou=sn&&(!rr||Sa&&8<Sa&&11>=Sa),uu=" ",du=!1;function fu(e,t){switch(e){case"keyup":return jx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rl=!1;function Sx(e,t){switch(e){case"compositionend":return mu(t);case"keypress":return t.which!==32?null:(du=!0,uu);case"textInput":return e=t.data,e===uu&&du?null:e;default:return null}}function kx(e,t){if(Rl)return e==="compositionend"||!rr&&fu(e,t)?(e=au(),Ns=nr=wn=null,Rl=!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 ou&&t.locale!=="ko"?null:t.data;default:return null}}var _x={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 hu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_x[e.type]:t==="textarea"}function xu(e,t,n,l){Cl?zl?zl.push(l):zl=[l]:Cl=l,t=xi(t,"onChange"),0<t.length&&(n=new _s("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var ka=null,_a=null;function Ex(e){Wf(e,0)}function Ts(e){var t=ga(e);if(Fo(t))return e}function pu(e,t){if(e==="change")return t}var vu=!1;if(sn){var cr;if(sn){var or="oninput"in document;if(!or){var gu=document.createElement("div");gu.setAttribute("oninput","return;"),or=typeof gu.oninput=="function"}cr=or}else cr=!1;vu=cr&&(!document.documentMode||9<document.documentMode)}function yu(){ka&&(ka.detachEvent("onpropertychange",bu),_a=ka=null)}function bu(e){if(e.propertyName==="value"&&Ts(_a)){var t=[];xu(t,_a,e,Pi(e)),lu(Ex,t)}}function Tx(e,t,n){e==="focusin"?(yu(),ka=t,_a=n,ka.attachEvent("onpropertychange",bu)):e==="focusout"&&yu()}function wx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ts(_a)}function Mx(e,t){if(e==="click")return Ts(t)}function Ax(e,t){if(e==="input"||e==="change")return Ts(t)}function Cx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:Cx;function Ea(e,t){if(kt(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 s=n[l];if(!W.call(t,s)||!kt(e[s],t[s]))return!1}return!0}function ju(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Nu(e,t){var n=ju(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=ju(n)}}function Su(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Su(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ku(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=bs(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=bs(e.document)}return t}function ur(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 zx=sn&&"documentMode"in document&&11>=document.documentMode,Dl=null,dr=null,Ta=null,fr=!1;function _u(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;fr||Dl==null||Dl!==bs(l)||(l=Dl,"selectionStart"in l&&ur(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}),Ta&&Ea(Ta,l)||(Ta=l,l=xi(dr,"onSelect"),0<l.length&&(t=new _s("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Dl)))}function ll(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ol={animationend:ll("Animation","AnimationEnd"),animationiteration:ll("Animation","AnimationIteration"),animationstart:ll("Animation","AnimationStart"),transitionrun:ll("Transition","TransitionRun"),transitionstart:ll("Transition","TransitionStart"),transitioncancel:ll("Transition","TransitionCancel"),transitionend:ll("Transition","TransitionEnd")},mr={},Eu={};sn&&(Eu=document.createElement("div").style,"AnimationEvent"in window||(delete Ol.animationend.animation,delete Ol.animationiteration.animation,delete Ol.animationstart.animation),"TransitionEvent"in window||delete Ol.transitionend.transition);function al(e){if(mr[e])return mr[e];if(!Ol[e])return e;var t=Ol[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Eu)return mr[e]=t[n];return e}var Tu=al("animationend"),wu=al("animationiteration"),Mu=al("animationstart"),Rx=al("transitionrun"),Dx=al("transitionstart"),Ox=al("transitioncancel"),Au=al("transitionend"),Cu=new Map,hr="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(" ");hr.push("scrollEnd");function Xt(e,t){Cu.set(e,t),tl(t,[e])}var ws=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)},Dt=[],Ul=0,xr=0;function Ms(){for(var e=Ul,t=xr=Ul=0;t<e;){var n=Dt[t];Dt[t++]=null;var l=Dt[t];Dt[t++]=null;var s=Dt[t];Dt[t++]=null;var r=Dt[t];if(Dt[t++]=null,l!==null&&s!==null){var f=l.pending;f===null?s.next=s:(s.next=f.next,f.next=s),l.pending=s}r!==0&&zu(n,s,r)}}function As(e,t,n,l){Dt[Ul++]=e,Dt[Ul++]=t,Dt[Ul++]=n,Dt[Ul++]=l,xr|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function pr(e,t,n,l){return As(e,t,n,l),Cs(e)}function sl(e,t){return As(e,null,null,t),Cs(e)}function zu(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var s=!1,r=e.return;r!==null;)r.childLanes|=n,l=r.alternate,l!==null&&(l.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(s=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,s&&t!==null&&(s=31-St(n),e=r.hiddenUpdates,l=e[s],l===null?e[s]=[t]:l.push(t),t.lane=n|536870912),r):null}function Cs(e){if(50<Ja)throw Ja=0,_c=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ql={};function Ux(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 _t(e,t,n,l){return new Ux(e,t,n,l)}function vr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rn(e,t){var n=e.alternate;return n===null?(n=_t(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 Ru(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 zs(e,t,n,l,s,r){var f=0;if(l=e,typeof e=="function")vr(e)&&(f=1);else if(typeof e=="string")f=$p(e,n,Q.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=_t(31,n,t,s),e.elementType=le,e.lanes=r,e;case G:return il(n.children,s,r,t);case E:f=8,s|=24;break;case I:return e=_t(12,n,t,s|2),e.elementType=I,e.lanes=r,e;case T:return e=_t(13,n,t,s),e.elementType=T,e.lanes=r,e;case Z:return e=_t(19,n,t,s),e.elementType=Z,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case P:f=10;break e;case K:f=9;break e;case $:f=11;break e;case z:f=14;break e;case J:f=16,l=null;break e}f=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=_t(f,n,t,s),t.elementType=e,t.type=l,t.lanes=r,t}function il(e,t,n,l){return e=_t(7,e,l,t),e.lanes=n,e}function gr(e,t,n){return e=_t(6,e,null,t),e.lanes=n,e}function Du(e){var t=_t(18,null,null,0);return t.stateNode=e,t}function yr(e,t,n){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ou=new WeakMap;function Ot(e,t){if(typeof e=="object"&&e!==null){var n=Ou.get(e);return n!==void 0?n:(t={value:e,source:t,stack:_n(t)},Ou.set(e,t),t)}return{value:e,source:t,stack:_n(t)}}var Bl=[],Ll=0,Rs=null,wa=0,Ut=[],qt=0,Mn=null,Kt=1,Jt="";function cn(e,t){Bl[Ll++]=wa,Bl[Ll++]=Rs,Rs=e,wa=t}function Uu(e,t,n){Ut[qt++]=Kt,Ut[qt++]=Jt,Ut[qt++]=Mn,Mn=e;var l=Kt;e=Jt;var s=32-St(l)-1;l&=~(1<<s),n+=1;var r=32-St(t)+s;if(30<r){var f=s-s%5;r=(l&(1<<f)-1).toString(32),l>>=f,s-=f,Kt=1<<32-St(t)+s|n<<s|l,Jt=r+e}else Kt=1<<r|n<<s|l,Jt=e}function br(e){e.return!==null&&(cn(e,1),Uu(e,1,0))}function jr(e){for(;e===Rs;)Rs=Bl[--Ll],Bl[Ll]=null,wa=Bl[--Ll],Bl[Ll]=null;for(;e===Mn;)Mn=Ut[--qt],Ut[qt]=null,Jt=Ut[--qt],Ut[qt]=null,Kt=Ut[--qt],Ut[qt]=null}function qu(e,t){Ut[qt++]=Kt,Ut[qt++]=Jt,Ut[qt++]=Mn,Kt=t.id,Jt=t.overflow,Mn=e}var st=null,qe=null,ke=!1,An=null,Bt=!1,Nr=Error(o(519));function Cn(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ma(Ot(t,e)),Nr}function Bu(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[at]=e,t[ht]=l,n){case"dialog":je("cancel",t),je("close",t);break;case"iframe":case"object":case"embed":je("load",t);break;case"video":case"audio":for(n=0;n<Ia.length;n++)je(Ia[n],t);break;case"source":je("error",t);break;case"img":case"image":case"link":je("error",t),je("load",t);break;case"details":je("toggle",t);break;case"input":je("invalid",t),Io(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":je("invalid",t);break;case"textarea":je("invalid",t),Po(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||nm(t.textContent,n)?(l.popover!=null&&(je("beforetoggle",t),je("toggle",t)),l.onScroll!=null&&je("scroll",t),l.onScrollEnd!=null&&je("scrollend",t),l.onClick!=null&&(t.onclick=an),t=!0):t=!1,t||Cn(e,!0)}function Lu(e){for(st=e.return;st;)switch(st.tag){case 5:case 31:case 13:Bt=!1;return;case 27:case 3:Bt=!0;return;default:st=st.return}}function Hl(e){if(e!==st)return!1;if(!ke)return Lu(e),ke=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Hc(e.type,e.memoizedProps)),n=!n),n&&qe&&Cn(e),Lu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));qe=dm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));qe=dm(e)}else t===27?(t=qe,Vn(e.type)?(e=Vc,Vc=null,qe=e):qe=t):qe=st?Ht(e.stateNode.nextSibling):null;return!0}function rl(){qe=st=null,ke=!1}function Sr(){var e=An;return e!==null&&(yt===null?yt=e:yt.push.apply(yt,e),An=null),e}function Ma(e){An===null?An=[e]:An.push(e)}var kr=j(null),cl=null,on=null;function zn(e,t,n){ee(kr,t._currentValue),t._currentValue=n}function un(e){e._currentValue=kr.current,B(kr)}function _r(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 Er(e,t,n,l){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var f=s.child;r=r.firstContext;e:for(;r!==null;){var x=r;r=s;for(var b=0;b<t.length;b++)if(x.context===t[b]){r.lanes|=n,x=r.alternate,x!==null&&(x.lanes|=n),_r(r.return,n,e),l||(f=null);break e}r=x.next}}else if(s.tag===18){if(f=s.return,f===null)throw Error(o(341));f.lanes|=n,r=f.alternate,r!==null&&(r.lanes|=n),_r(f,n,e),f=null}else f=s.child;if(f!==null)f.return=s;else for(f=s;f!==null;){if(f===e){f=null;break}if(s=f.sibling,s!==null){s.return=f.return,f=s;break}f=f.return}s=f}}function $l(e,t,n,l){e=null;for(var s=t,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var f=s.alternate;if(f===null)throw Error(o(387));if(f=f.memoizedProps,f!==null){var x=s.type;kt(s.pendingProps.value,f.value)||(e!==null?e.push(x):e=[x])}}else if(s===oe.current){if(f=s.alternate,f===null)throw Error(o(387));f.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(ns):e=[ns])}s=s.return}e!==null&&Er(t,e,n,l),t.flags|=262144}function Ds(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ol(e){cl=e,on=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function it(e){return Hu(cl,e)}function Os(e,t){return cl===null&&ol(e),Hu(e,t)}function Hu(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},on===null){if(e===null)throw Error(o(308));on=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else on=on.next=t;return n}var qx=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()})}},Bx=i.unstable_scheduleCallback,Lx=i.unstable_NormalPriority,Ve={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tr(){return{controller:new qx,data:new Map,refCount:0}}function Aa(e){e.refCount--,e.refCount===0&&Bx(Lx,function(){e.controller.abort()})}var Ca=null,wr=0,Gl=0,Yl=null;function Hx(e,t){if(Ca===null){var n=Ca=[];wr=0,Gl=Cc(),Yl={status:"pending",value:void 0,then:function(l){n.push(l)}}}return wr++,t.then($u,$u),t}function $u(){if(--wr===0&&Ca!==null){Yl!==null&&(Yl.status="fulfilled");var e=Ca;Ca=null,Gl=0,Yl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function $x(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(s){n.push(s)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var s=0;s<n.length;s++)(0,n[s])(t)},function(s){for(l.status="rejected",l.reason=s,s=0;s<n.length;s++)(0,n[s])(void 0)}),l}var Gu=w.S;w.S=function(e,t){Ef=lt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Hx(e,t),Gu!==null&&Gu(e,t)};var ul=j(null);function Mr(){var e=ul.current;return e!==null?e:Ue.pooledCache}function Us(e,t){t===null?ee(ul,ul.current):ee(ul,t.pool)}function Yu(){var e=Mr();return e===null?null:{parent:Ve._currentValue,pool:e}}var Xl=Error(o(460)),Ar=Error(o(474)),qs=Error(o(542)),Bs={then:function(){}};function Xu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Vu(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(an,an),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zu(e),e;default:if(typeof t.status=="string")t.then(an,an);else{if(e=Ue,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=l}},function(l){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zu(e),e}throw fl=t,Xl}}function dl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(fl=n,Xl):n}}var fl=null;function Qu(){if(fl===null)throw Error(o(459));var e=fl;return fl=null,e}function Zu(e){if(e===Xl||e===qs)throw Error(o(483))}var Vl=null,za=0;function Ls(e){var t=za;return za+=1,Vl===null&&(Vl=[]),Vu(Vl,e,t)}function Ra(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Hs(e,t){throw t.$$typeof===R?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ku(e){function t(_,S){if(e){var A=_.deletions;A===null?(_.deletions=[S],_.flags|=16):A.push(S)}}function n(_,S){if(!e)return null;for(;S!==null;)t(_,S),S=S.sibling;return null}function l(_){for(var S=new Map;_!==null;)_.key!==null?S.set(_.key,_):S.set(_.index,_),_=_.sibling;return S}function s(_,S){return _=rn(_,S),_.index=0,_.sibling=null,_}function r(_,S,A){return _.index=A,e?(A=_.alternate,A!==null?(A=A.index,A<S?(_.flags|=67108866,S):A):(_.flags|=67108866,S)):(_.flags|=1048576,S)}function f(_){return e&&_.alternate===null&&(_.flags|=67108866),_}function x(_,S,A,Y){return S===null||S.tag!==6?(S=gr(A,_.mode,Y),S.return=_,S):(S=s(S,A),S.return=_,S)}function b(_,S,A,Y){var ue=A.type;return ue===G?L(_,S,A.props.children,Y,A.key):S!==null&&(S.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===J&&dl(ue)===S.type)?(S=s(S,A.props),Ra(S,A),S.return=_,S):(S=zs(A.type,A.key,A.props,null,_.mode,Y),Ra(S,A),S.return=_,S)}function C(_,S,A,Y){return S===null||S.tag!==4||S.stateNode.containerInfo!==A.containerInfo||S.stateNode.implementation!==A.implementation?(S=yr(A,_.mode,Y),S.return=_,S):(S=s(S,A.children||[]),S.return=_,S)}function L(_,S,A,Y,ue){return S===null||S.tag!==7?(S=il(A,_.mode,Y,ue),S.return=_,S):(S=s(S,A),S.return=_,S)}function V(_,S,A){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return S=gr(""+S,_.mode,A),S.return=_,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case X:return A=zs(S.type,S.key,S.props,null,_.mode,A),Ra(A,S),A.return=_,A;case O:return S=yr(S,_.mode,A),S.return=_,S;case J:return S=dl(S),V(_,S,A)}if(M(S)||te(S))return S=il(S,_.mode,A,null),S.return=_,S;if(typeof S.then=="function")return V(_,Ls(S),A);if(S.$$typeof===P)return V(_,Os(_,S),A);Hs(_,S)}return null}function D(_,S,A,Y){var ue=S!==null?S.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return ue!==null?null:x(_,S,""+A,Y);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case X:return A.key===ue?b(_,S,A,Y):null;case O:return A.key===ue?C(_,S,A,Y):null;case J:return A=dl(A),D(_,S,A,Y)}if(M(A)||te(A))return ue!==null?null:L(_,S,A,Y,null);if(typeof A.then=="function")return D(_,S,Ls(A),Y);if(A.$$typeof===P)return D(_,S,Os(_,A),Y);Hs(_,A)}return null}function U(_,S,A,Y,ue){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return _=_.get(A)||null,x(S,_,""+Y,ue);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case X:return _=_.get(Y.key===null?A:Y.key)||null,b(S,_,Y,ue);case O:return _=_.get(Y.key===null?A:Y.key)||null,C(S,_,Y,ue);case J:return Y=dl(Y),U(_,S,A,Y,ue)}if(M(Y)||te(Y))return _=_.get(A)||null,L(S,_,Y,ue,null);if(typeof Y.then=="function")return U(_,S,A,Ls(Y),ue);if(Y.$$typeof===P)return U(_,S,A,Os(S,Y),ue);Hs(S,Y)}return null}function ie(_,S,A,Y){for(var ue=null,_e=null,re=S,ge=S=0,Se=null;re!==null&&ge<A.length;ge++){re.index>ge?(Se=re,re=null):Se=re.sibling;var Ee=D(_,re,A[ge],Y);if(Ee===null){re===null&&(re=Se);break}e&&re&&Ee.alternate===null&&t(_,re),S=r(Ee,S,ge),_e===null?ue=Ee:_e.sibling=Ee,_e=Ee,re=Se}if(ge===A.length)return n(_,re),ke&&cn(_,ge),ue;if(re===null){for(;ge<A.length;ge++)re=V(_,A[ge],Y),re!==null&&(S=r(re,S,ge),_e===null?ue=re:_e.sibling=re,_e=re);return ke&&cn(_,ge),ue}for(re=l(re);ge<A.length;ge++)Se=U(re,_,ge,A[ge],Y),Se!==null&&(e&&Se.alternate!==null&&re.delete(Se.key===null?ge:Se.key),S=r(Se,S,ge),_e===null?ue=Se:_e.sibling=Se,_e=Se);return e&&re.forEach(function(Fn){return t(_,Fn)}),ke&&cn(_,ge),ue}function me(_,S,A,Y){if(A==null)throw Error(o(151));for(var ue=null,_e=null,re=S,ge=S=0,Se=null,Ee=A.next();re!==null&&!Ee.done;ge++,Ee=A.next()){re.index>ge?(Se=re,re=null):Se=re.sibling;var Fn=D(_,re,Ee.value,Y);if(Fn===null){re===null&&(re=Se);break}e&&re&&Fn.alternate===null&&t(_,re),S=r(Fn,S,ge),_e===null?ue=Fn:_e.sibling=Fn,_e=Fn,re=Se}if(Ee.done)return n(_,re),ke&&cn(_,ge),ue;if(re===null){for(;!Ee.done;ge++,Ee=A.next())Ee=V(_,Ee.value,Y),Ee!==null&&(S=r(Ee,S,ge),_e===null?ue=Ee:_e.sibling=Ee,_e=Ee);return ke&&cn(_,ge),ue}for(re=l(re);!Ee.done;ge++,Ee=A.next())Ee=U(re,_,ge,Ee.value,Y),Ee!==null&&(e&&Ee.alternate!==null&&re.delete(Ee.key===null?ge:Ee.key),S=r(Ee,S,ge),_e===null?ue=Ee:_e.sibling=Ee,_e=Ee);return e&&re.forEach(function(Wp){return t(_,Wp)}),ke&&cn(_,ge),ue}function Oe(_,S,A,Y){if(typeof A=="object"&&A!==null&&A.type===G&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case X:e:{for(var ue=A.key;S!==null;){if(S.key===ue){if(ue=A.type,ue===G){if(S.tag===7){n(_,S.sibling),Y=s(S,A.props.children),Y.return=_,_=Y;break e}}else if(S.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===J&&dl(ue)===S.type){n(_,S.sibling),Y=s(S,A.props),Ra(Y,A),Y.return=_,_=Y;break e}n(_,S);break}else t(_,S);S=S.sibling}A.type===G?(Y=il(A.props.children,_.mode,Y,A.key),Y.return=_,_=Y):(Y=zs(A.type,A.key,A.props,null,_.mode,Y),Ra(Y,A),Y.return=_,_=Y)}return f(_);case O:e:{for(ue=A.key;S!==null;){if(S.key===ue)if(S.tag===4&&S.stateNode.containerInfo===A.containerInfo&&S.stateNode.implementation===A.implementation){n(_,S.sibling),Y=s(S,A.children||[]),Y.return=_,_=Y;break e}else{n(_,S);break}else t(_,S);S=S.sibling}Y=yr(A,_.mode,Y),Y.return=_,_=Y}return f(_);case J:return A=dl(A),Oe(_,S,A,Y)}if(M(A))return ie(_,S,A,Y);if(te(A)){if(ue=te(A),typeof ue!="function")throw Error(o(150));return A=ue.call(A),me(_,S,A,Y)}if(typeof A.then=="function")return Oe(_,S,Ls(A),Y);if(A.$$typeof===P)return Oe(_,S,Os(_,A),Y);Hs(_,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,S!==null&&S.tag===6?(n(_,S.sibling),Y=s(S,A),Y.return=_,_=Y):(n(_,S),Y=gr(A,_.mode,Y),Y.return=_,_=Y),f(_)):n(_,S)}return function(_,S,A,Y){try{za=0;var ue=Oe(_,S,A,Y);return Vl=null,ue}catch(re){if(re===Xl||re===qs)throw re;var _e=_t(29,re,null,_.mode);return _e.lanes=Y,_e.return=_,_e}finally{}}}var ml=Ku(!0),Ju=Ku(!1),Rn=!1;function Cr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zr(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 Dn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function On(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(we&2)!==0){var s=l.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),l.pending=t,t=Cs(e),zu(e,null,n),t}return As(e,l,t,n),Cs(e)}function Da(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,Ho(e,n)}}function Rr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var s=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?s=r=f:r=r.next=f,n=n.next}while(n!==null);r===null?s=r=t:r=r.next=t}else s=r=t;n={baseState:l.baseState,firstBaseUpdate:s,lastBaseUpdate:r,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Dr=!1;function Oa(){if(Dr){var e=Yl;if(e!==null)throw e}}function Ua(e,t,n,l){Dr=!1;var s=e.updateQueue;Rn=!1;var r=s.firstBaseUpdate,f=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var b=x,C=b.next;b.next=null,f===null?r=C:f.next=C,f=b;var L=e.alternate;L!==null&&(L=L.updateQueue,x=L.lastBaseUpdate,x!==f&&(x===null?L.firstBaseUpdate=C:x.next=C,L.lastBaseUpdate=b))}if(r!==null){var V=s.baseState;f=0,L=C=b=null,x=r;do{var D=x.lane&-536870913,U=D!==x.lane;if(U?(Ne&D)===D:(l&D)===D){D!==0&&D===Gl&&(Dr=!0),L!==null&&(L=L.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var ie=e,me=x;D=t;var Oe=n;switch(me.tag){case 1:if(ie=me.payload,typeof ie=="function"){V=ie.call(Oe,V,D);break e}V=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=me.payload,D=typeof ie=="function"?ie.call(Oe,V,D):ie,D==null)break e;V=k({},V,D);break e;case 2:Rn=!0}}D=x.callback,D!==null&&(e.flags|=64,U&&(e.flags|=8192),U=s.callbacks,U===null?s.callbacks=[D]:U.push(D))}else U={lane:D,tag:x.tag,payload:x.payload,callback:x.callback,next:null},L===null?(C=L=U,b=V):L=L.next=U,f|=D;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;U=x,x=U.next,U.next=null,s.lastBaseUpdate=U,s.shared.pending=null}}while(!0);L===null&&(b=V),s.baseState=b,s.firstBaseUpdate=C,s.lastBaseUpdate=L,r===null&&(s.shared.lanes=0),Hn|=f,e.lanes=f,e.memoizedState=V}}function Fu(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Iu(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Fu(n[e],t)}var Ql=j(null),$s=j(0);function Wu(e,t){e=yn,ee($s,e),ee(Ql,t),yn=e|t.baseLanes}function Or(){ee($s,yn),ee(Ql,Ql.current)}function Ur(){yn=$s.current,B(Ql),B($s)}var Et=j(null),Lt=null;function Un(e){var t=e.alternate;ee(Ge,Ge.current&1),ee(Et,e),Lt===null&&(t===null||Ql.current!==null||t.memoizedState!==null)&&(Lt=e)}function qr(e){ee(Ge,Ge.current),ee(Et,e),Lt===null&&(Lt=e)}function Pu(e){e.tag===22?(ee(Ge,Ge.current),ee(Et,e),Lt===null&&(Lt=e)):qn()}function qn(){ee(Ge,Ge.current),ee(Et,Et.current)}function Tt(e){B(Et),Lt===e&&(Lt=null),B(Ge)}var Ge=j(0);function Gs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Yc(n)||Xc(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 dn=0,ve=null,Re=null,Qe=null,Ys=!1,Zl=!1,hl=!1,Xs=0,qa=0,Kl=null,Gx=0;function He(){throw Error(o(321))}function Br(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kt(e[n],t[n]))return!1;return!0}function Lr(e,t,n,l,s,r){return dn=r,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,w.H=e===null||e.memoizedState===null?Ud:ec,hl=!1,r=n(l,s),hl=!1,Zl&&(r=td(t,n,l,s)),ed(e),r}function ed(e){w.H=Ha;var t=Re!==null&&Re.next!==null;if(dn=0,Qe=Re=ve=null,Ys=!1,qa=0,Kl=null,t)throw Error(o(300));e===null||Ze||(e=e.dependencies,e!==null&&Ds(e)&&(Ze=!0))}function td(e,t,n,l){ve=e;var s=0;do{if(Zl&&(Kl=null),qa=0,Zl=!1,25<=s)throw Error(o(301));if(s+=1,Qe=Re=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}w.H=qd,r=t(n,l)}while(Zl);return r}function Yx(){var e=w.H,t=e.useState()[0];return t=typeof t.then=="function"?Ba(t):t,e=e.useState()[0],(Re!==null?Re.memoizedState:null)!==e&&(ve.flags|=1024),t}function Hr(){var e=Xs!==0;return Xs=0,e}function $r(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Gr(e){if(Ys){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ys=!1}dn=0,Qe=Re=ve=null,Zl=!1,qa=Xs=0,Kl=null}function dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?ve.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function Ye(){if(Re===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=Qe===null?ve.memoizedState:Qe.next;if(t!==null)Qe=t,Re=e;else{if(e===null)throw ve.alternate===null?Error(o(467)):Error(o(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},Qe===null?ve.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}function Vs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ba(e){var t=qa;return qa+=1,Kl===null&&(Kl=[]),e=Vu(Kl,e,t),t=ve,(Qe===null?t.memoizedState:Qe.next)===null&&(t=t.alternate,w.H=t===null||t.memoizedState===null?Ud:ec),e}function Qs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ba(e);if(e.$$typeof===P)return it(e)}throw Error(o(438,String(e)))}function Yr(e){var t=null,n=ve.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=ve.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Vs(),ve.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]=F;return t.index++,n}function fn(e,t){return typeof t=="function"?t(e):t}function Zs(e){var t=Ye();return Xr(t,Re,e)}function Xr(e,t,n){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=n;var s=e.baseQueue,r=l.pending;if(r!==null){if(s!==null){var f=s.next;s.next=r.next,r.next=f}t.baseQueue=s=r,l.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var x=f=null,b=null,C=t,L=!1;do{var V=C.lane&-536870913;if(V!==C.lane?(Ne&V)===V:(dn&V)===V){var D=C.revertLane;if(D===0)b!==null&&(b=b.next={lane:0,revertLane:0,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null}),V===Gl&&(L=!0);else if((dn&D)===D){C=C.next,D===Gl&&(L=!0);continue}else V={lane:0,revertLane:C.revertLane,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},b===null?(x=b=V,f=r):b=b.next=V,ve.lanes|=D,Hn|=D;V=C.action,hl&&n(r,V),r=C.hasEagerState?C.eagerState:n(r,V)}else D={lane:V,revertLane:C.revertLane,gesture:C.gesture,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},b===null?(x=b=D,f=r):b=b.next=D,ve.lanes|=V,Hn|=V;C=C.next}while(C!==null&&C!==t);if(b===null?f=r:b.next=x,!kt(r,e.memoizedState)&&(Ze=!0,L&&(n=Yl,n!==null)))throw n;e.memoizedState=r,e.baseState=f,e.baseQueue=b,l.lastRenderedState=r}return s===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Vr(e){var t=Ye(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var l=n.dispatch,s=n.pending,r=t.memoizedState;if(s!==null){n.pending=null;var f=s=s.next;do r=e(r,f.action),f=f.next;while(f!==s);kt(r,t.memoizedState)||(Ze=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,l]}function nd(e,t,n){var l=ve,s=Ye(),r=ke;if(r){if(n===void 0)throw Error(o(407));n=n()}else n=t();var f=!kt((Re||s).memoizedState,n);if(f&&(s.memoizedState=n,Ze=!0),s=s.queue,Kr(sd.bind(null,l,s,e),[e]),s.getSnapshot!==t||f||Qe!==null&&Qe.memoizedState.tag&1){if(l.flags|=2048,Jl(9,{destroy:void 0},ad.bind(null,l,s,n,t),null),Ue===null)throw Error(o(349));r||(dn&127)!==0||ld(l,t,n)}return n}function ld(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ve.updateQueue,t===null?(t=Vs(),ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ad(e,t,n,l){t.value=n,t.getSnapshot=l,id(t)&&rd(e)}function sd(e,t,n){return n(function(){id(t)&&rd(e)})}function id(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kt(e,n)}catch{return!0}}function rd(e){var t=sl(e,2);t!==null&&bt(t,e,2)}function Qr(e){var t=dt();if(typeof e=="function"){var n=e;if(e=n(),hl){En(!0);try{n()}finally{En(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:e},t}function cd(e,t,n,l){return e.baseState=n,Xr(e,Re,typeof l=="function"?l:fn)}function Xx(e,t,n,l,s){if(Fs(e))throw Error(o(485));if(e=t.action,e!==null){var r={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){r.listeners.push(f)}};w.T!==null?n(!0):r.isTransition=!1,l(r),n=t.pending,n===null?(r.next=t.pending=r,od(t,r)):(r.next=n.next,t.pending=n.next=r)}}function od(e,t){var n=t.action,l=t.payload,s=e.state;if(t.isTransition){var r=w.T,f={};w.T=f;try{var x=n(s,l),b=w.S;b!==null&&b(f,x),ud(e,t,x)}catch(C){Zr(e,t,C)}finally{r!==null&&f.types!==null&&(r.types=f.types),w.T=r}}else try{r=n(s,l),ud(e,t,r)}catch(C){Zr(e,t,C)}}function ud(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){dd(e,t,l)},function(l){return Zr(e,t,l)}):dd(e,t,n)}function dd(e,t,n){t.status="fulfilled",t.value=n,fd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,od(e,n)))}function Zr(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,fd(t),t=t.next;while(t!==l)}e.action=null}function fd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function md(e,t){return t}function hd(e,t){if(ke){var n=Ue.formState;if(n!==null){e:{var l=ve;if(ke){if(qe){t:{for(var s=qe,r=Bt;s.nodeType!==8;){if(!r){s=null;break t}if(s=Ht(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){qe=Ht(s.nextSibling),l=s.data==="F!";break e}}Cn(l)}l=!1}l&&(t=n[0])}}return n=dt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:md,lastRenderedState:t},n.queue=l,n=Rd.bind(null,ve,l),l.dispatch=n,l=Qr(!1),r=Pr.bind(null,ve,!1,l.queue),l=dt(),s={state:t,dispatch:null,action:e,pending:null},l.queue=s,n=Xx.bind(null,ve,s,r,n),s.dispatch=n,l.memoizedState=e,[t,n,!1]}function xd(e){var t=Ye();return pd(t,Re,e)}function pd(e,t,n){if(t=Xr(e,t,md)[0],e=Zs(fn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ba(t)}catch(f){throw f===Xl?qs:f}else l=t;t=Ye();var s=t.queue,r=s.dispatch;return n!==t.memoizedState&&(ve.flags|=2048,Jl(9,{destroy:void 0},Vx.bind(null,s,n),null)),[l,r,e]}function Vx(e,t){e.action=t}function vd(e){var t=Ye(),n=Re;if(n!==null)return pd(t,n,e);Ye(),t=t.memoizedState,n=Ye();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Jl(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=ve.updateQueue,t===null&&(t=Vs(),ve.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function gd(){return Ye().memoizedState}function Ks(e,t,n,l){var s=dt();ve.flags|=e,s.memoizedState=Jl(1|t,{destroy:void 0},n,l===void 0?null:l)}function Js(e,t,n,l){var s=Ye();l=l===void 0?null:l;var r=s.memoizedState.inst;Re!==null&&l!==null&&Br(l,Re.memoizedState.deps)?s.memoizedState=Jl(t,r,n,l):(ve.flags|=e,s.memoizedState=Jl(1|t,r,n,l))}function yd(e,t){Ks(8390656,8,e,t)}function Kr(e,t){Js(2048,8,e,t)}function Qx(e){ve.flags|=4;var t=ve.updateQueue;if(t===null)t=Vs(),ve.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function bd(e){var t=Ye().memoizedState;return Qx({ref:t,nextImpl:e}),function(){if((we&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function jd(e,t){return Js(4,2,e,t)}function Nd(e,t){return Js(4,4,e,t)}function Sd(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function kd(e,t,n){n=n!=null?n.concat([e]):null,Js(4,4,Sd.bind(null,t,e),n)}function Jr(){}function _d(e,t){var n=Ye();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Br(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Ed(e,t){var n=Ye();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Br(t,l[1]))return l[0];if(l=e(),hl){En(!0);try{e()}finally{En(!1)}}return n.memoizedState=[l,t],l}function Fr(e,t,n){return n===void 0||(dn&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=wf(),ve.lanes|=e,Hn|=e,n)}function Td(e,t,n,l){return kt(n,t)?n:Ql.current!==null?(e=Fr(e,n,l),kt(e,t)||(Ze=!0),e):(dn&42)===0||(dn&1073741824)!==0&&(Ne&261930)===0?(Ze=!0,e.memoizedState=n):(e=wf(),ve.lanes|=e,Hn|=e,t)}function wd(e,t,n,l,s){var r=H.p;H.p=r!==0&&8>r?r:8;var f=w.T,x={};w.T=x,Pr(e,!1,t,n);try{var b=s(),C=w.S;if(C!==null&&C(x,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var L=$x(b,l);La(e,t,L,At(e))}else La(e,t,l,At(e))}catch(V){La(e,t,{then:function(){},status:"rejected",reason:V},At())}finally{H.p=r,f!==null&&x.types!==null&&(f.types=x.types),w.T=f}}function Zx(){}function Ir(e,t,n,l){if(e.tag!==5)throw Error(o(476));var s=Md(e).queue;wd(e,s,t,ne,n===null?Zx:function(){return Ad(e),n(l)})}function Md(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ad(e){var t=Md(e);t.next===null&&(t=e.alternate.memoizedState),La(e,t.next.queue,{},At())}function Wr(){return it(ns)}function Cd(){return Ye().memoizedState}function zd(){return Ye().memoizedState}function Kx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=At();e=Dn(n);var l=On(t,e,n);l!==null&&(bt(l,t,n),Da(l,t,n)),t={cache:Tr()},e.payload=t;return}t=t.return}}function Jx(e,t,n){var l=At();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fs(e)?Dd(t,n):(n=pr(e,t,n,l),n!==null&&(bt(n,e,l),Od(n,t,l)))}function Rd(e,t,n){var l=At();La(e,t,n,l)}function La(e,t,n,l){var s={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fs(e))Dd(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var f=t.lastRenderedState,x=r(f,n);if(s.hasEagerState=!0,s.eagerState=x,kt(x,f))return As(e,t,s,0),Ue===null&&Ms(),!1}catch{}finally{}if(n=pr(e,t,s,l),n!==null)return bt(n,e,l),Od(n,t,l),!0}return!1}function Pr(e,t,n,l){if(l={lane:2,revertLane:Cc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Fs(e)){if(t)throw Error(o(479))}else t=pr(e,n,l,2),t!==null&&bt(t,e,2)}function Fs(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function Dd(e,t){Zl=Ys=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Od(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Ho(e,n)}}var Ha={readContext:it,use:Qs,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useLayoutEffect:He,useInsertionEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useSyncExternalStore:He,useId:He,useHostTransitionStatus:He,useFormState:He,useActionState:He,useOptimistic:He,useMemoCache:He,useCacheRefresh:He};Ha.useEffectEvent=He;var Ud={readContext:it,use:Qs,useCallback:function(e,t){return dt().memoizedState=[e,t===void 0?null:t],e},useContext:it,useEffect:yd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ks(4194308,4,Sd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ks(4194308,4,e,t)},useInsertionEffect:function(e,t){Ks(4,2,e,t)},useMemo:function(e,t){var n=dt();t=t===void 0?null:t;var l=e();if(hl){En(!0);try{e()}finally{En(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=dt();if(n!==void 0){var s=n(t);if(hl){En(!0);try{n(t)}finally{En(!1)}}}else s=t;return l.memoizedState=l.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},l.queue=e,e=e.dispatch=Jx.bind(null,ve,e),[l.memoizedState,e]},useRef:function(e){var t=dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Qr(e);var t=e.queue,n=Rd.bind(null,ve,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Jr,useDeferredValue:function(e,t){var n=dt();return Fr(n,e,t)},useTransition:function(){var e=Qr(!1);return e=wd.bind(null,ve,e.queue,!0,!1),dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=ve,s=dt();if(ke){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Ue===null)throw Error(o(349));(Ne&127)!==0||ld(l,t,n)}s.memoizedState=n;var r={value:n,getSnapshot:t};return s.queue=r,yd(sd.bind(null,l,r,e),[e]),l.flags|=2048,Jl(9,{destroy:void 0},ad.bind(null,l,r,n,t),null),n},useId:function(){var e=dt(),t=Ue.identifierPrefix;if(ke){var n=Jt,l=Kt;n=(l&~(1<<32-St(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Xs++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Gx++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Wr,useFormState:hd,useActionState:hd,useOptimistic:function(e){var t=dt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Pr.bind(null,ve,!0,n),n.dispatch=t,[e,t]},useMemoCache:Yr,useCacheRefresh:function(){return dt().memoizedState=Kx.bind(null,ve)},useEffectEvent:function(e){var t=dt(),n={impl:e};return t.memoizedState=n,function(){if((we&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},ec={readContext:it,use:Qs,useCallback:_d,useContext:it,useEffect:Kr,useImperativeHandle:kd,useInsertionEffect:jd,useLayoutEffect:Nd,useMemo:Ed,useReducer:Zs,useRef:gd,useState:function(){return Zs(fn)},useDebugValue:Jr,useDeferredValue:function(e,t){var n=Ye();return Td(n,Re.memoizedState,e,t)},useTransition:function(){var e=Zs(fn)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:Ba(e),t]},useSyncExternalStore:nd,useId:Cd,useHostTransitionStatus:Wr,useFormState:xd,useActionState:xd,useOptimistic:function(e,t){var n=Ye();return cd(n,Re,e,t)},useMemoCache:Yr,useCacheRefresh:zd};ec.useEffectEvent=bd;var qd={readContext:it,use:Qs,useCallback:_d,useContext:it,useEffect:Kr,useImperativeHandle:kd,useInsertionEffect:jd,useLayoutEffect:Nd,useMemo:Ed,useReducer:Vr,useRef:gd,useState:function(){return Vr(fn)},useDebugValue:Jr,useDeferredValue:function(e,t){var n=Ye();return Re===null?Fr(n,e,t):Td(n,Re.memoizedState,e,t)},useTransition:function(){var e=Vr(fn)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:Ba(e),t]},useSyncExternalStore:nd,useId:Cd,useHostTransitionStatus:Wr,useFormState:vd,useActionState:vd,useOptimistic:function(e,t){var n=Ye();return Re!==null?cd(n,Re,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Yr,useCacheRefresh:zd};qd.useEffectEvent=bd;function tc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:k({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var nc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=At(),s=Dn(l);s.payload=t,n!=null&&(s.callback=n),t=On(e,s,l),t!==null&&(bt(t,e,l),Da(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=At(),s=Dn(l);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=On(e,s,l),t!==null&&(bt(t,e,l),Da(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=At(),l=Dn(n);l.tag=2,t!=null&&(l.callback=t),t=On(e,l,n),t!==null&&(bt(t,e,n),Da(t,e,n))}};function Bd(e,t,n,l,s,r,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,r,f):t.prototype&&t.prototype.isPureReactComponent?!Ea(n,l)||!Ea(s,r):!0}function Ld(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&&nc.enqueueReplaceState(t,t.state,null)}function xl(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=k({},n));for(var s in e)n[s]===void 0&&(n[s]=e[s])}return n}function Hd(e){ws(e)}function $d(e){console.error(e)}function Gd(e){ws(e)}function Is(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Yd(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function lc(e,t,n){return n=Dn(n),n.tag=3,n.payload={element:null},n.callback=function(){Is(e,t)},n}function Xd(e){return e=Dn(e),e.tag=3,e}function Vd(e,t,n,l){var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var r=l.value;e.payload=function(){return s(r)},e.callback=function(){Yd(t,n,l)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){Yd(t,n,l),typeof s!="function"&&($n===null?$n=new Set([this]):$n.add(this));var x=l.stack;this.componentDidCatch(l.value,{componentStack:x!==null?x:""})})}function Fx(e,t,n,l,s){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&$l(t,n,s,!0),n=Et.current,n!==null){switch(n.tag){case 31:case 13:return Lt===null?oi():n.alternate===null&&$e===0&&($e=3),n.flags&=-257,n.flags|=65536,n.lanes=s,l===Bs?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),wc(e,l,s)),!1;case 22:return n.flags|=65536,l===Bs?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)),wc(e,l,s)),!1}throw Error(o(435,n.tag))}return wc(e,l,s),oi(),!1}if(ke)return t=Et.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,l!==Nr&&(e=Error(o(422),{cause:l}),Ma(Ot(e,n)))):(l!==Nr&&(t=Error(o(423),{cause:l}),Ma(Ot(t,n))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,l=Ot(l,n),s=lc(e.stateNode,l,s),Rr(e,s),$e!==4&&($e=2)),!1;var r=Error(o(520),{cause:l});if(r=Ot(r,n),Ka===null?Ka=[r]:Ka.push(r),$e!==4&&($e=2),t===null)return!0;l=Ot(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,e=lc(n.stateNode,l,e),Rr(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&($n===null||!$n.has(r))))return n.flags|=65536,s&=-s,n.lanes|=s,s=Xd(s),Vd(s,e,n,l),Rr(n,s),!1}n=n.return}while(n!==null);return!1}var ac=Error(o(461)),Ze=!1;function rt(e,t,n,l){t.child=e===null?Ju(t,null,n,l):ml(t,e.child,n,l)}function Qd(e,t,n,l,s){n=n.render;var r=t.ref;if("ref"in l){var f={};for(var x in l)x!=="ref"&&(f[x]=l[x])}else f=l;return ol(t),l=Lr(e,t,n,f,r,s),x=Hr(),e!==null&&!Ze?($r(e,t,s),mn(e,t,s)):(ke&&x&&br(t),t.flags|=1,rt(e,t,l,s),t.child)}function Zd(e,t,n,l,s){if(e===null){var r=n.type;return typeof r=="function"&&!vr(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,Kd(e,t,r,l,s)):(e=zs(n.type,null,l,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!fc(e,s)){var f=r.memoizedProps;if(n=n.compare,n=n!==null?n:Ea,n(f,l)&&e.ref===t.ref)return mn(e,t,s)}return t.flags|=1,e=rn(r,l),e.ref=t.ref,e.return=t,t.child=e}function Kd(e,t,n,l,s){if(e!==null){var r=e.memoizedProps;if(Ea(r,l)&&e.ref===t.ref)if(Ze=!1,t.pendingProps=l=r,fc(e,s))(e.flags&131072)!==0&&(Ze=!0);else return t.lanes=e.lanes,mn(e,t,s)}return sc(e,t,n,l,s)}function Jd(e,t,n,l){var s=l.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|n:n,e!==null){for(l=t.child=e.child,s=0;l!==null;)s=s|l.lanes|l.childLanes,l=l.sibling;l=s&~r}else l=0,t.child=null;return Fd(e,t,r,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Us(t,r!==null?r.cachePool:null),r!==null?Wu(t,r):Or(),Pu(t);else return l=t.lanes=536870912,Fd(e,t,r!==null?r.baseLanes|n:n,n,l)}else r!==null?(Us(t,r.cachePool),Wu(t,r),qn(),t.memoizedState=null):(e!==null&&Us(t,null),Or(),qn());return rt(e,t,s,n),t.child}function $a(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Fd(e,t,n,l,s){var r=Mr();return r=r===null?null:{parent:Ve._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Us(t,null),Or(),Pu(t),e!==null&&$l(e,t,l,!0),t.childLanes=s,null}function Ws(e,t){return t=ei({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Id(e,t,n){return ml(t,e.child,null,n),e=Ws(t,t.pendingProps),e.flags|=2,Tt(t),t.memoizedState=null,e}function Ix(e,t,n){var l=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ke){if(l.mode==="hidden")return e=Ws(t,l),t.lanes=536870912,$a(null,e);if(qr(t),(e=qe)?(e=um(e,Bt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mn!==null?{id:Kt,overflow:Jt}:null,retryLane:536870912,hydrationErrors:null},n=Du(e),n.return=t,t.child=n,st=t,qe=null)):e=null,e===null)throw Cn(t);return t.lanes=536870912,null}return Ws(t,l)}var r=e.memoizedState;if(r!==null){var f=r.dehydrated;if(qr(t),s)if(t.flags&256)t.flags&=-257,t=Id(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ze||$l(e,t,n,!1),s=(n&e.childLanes)!==0,Ze||s){if(l=Ue,l!==null&&(f=$o(l,n),f!==0&&f!==r.retryLane))throw r.retryLane=f,sl(e,f),bt(l,e,f),ac;oi(),t=Id(e,t,n)}else e=r.treeContext,qe=Ht(f.nextSibling),st=t,ke=!0,An=null,Bt=!1,e!==null&&qu(t,e),t=Ws(t,l),t.flags|=4096;return t}return e=rn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ps(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 sc(e,t,n,l,s){return ol(t),n=Lr(e,t,n,l,void 0,s),l=Hr(),e!==null&&!Ze?($r(e,t,s),mn(e,t,s)):(ke&&l&&br(t),t.flags|=1,rt(e,t,n,s),t.child)}function Wd(e,t,n,l,s,r){return ol(t),t.updateQueue=null,n=td(t,l,n,s),ed(e),l=Hr(),e!==null&&!Ze?($r(e,t,r),mn(e,t,r)):(ke&&l&&br(t),t.flags|=1,rt(e,t,n,r),t.child)}function Pd(e,t,n,l,s){if(ol(t),t.stateNode===null){var r=ql,f=n.contextType;typeof f=="object"&&f!==null&&(r=it(f)),r=new n(l,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=nc,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=l,r.state=t.memoizedState,r.refs={},Cr(t),f=n.contextType,r.context=typeof f=="object"&&f!==null?it(f):ql,r.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(tc(t,n,f,l),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(f=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),f!==r.state&&nc.enqueueReplaceState(r,r.state,null),Ua(t,l,r,s),Oa(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){r=t.stateNode;var x=t.memoizedProps,b=xl(n,x);r.props=b;var C=r.context,L=n.contextType;f=ql,typeof L=="object"&&L!==null&&(f=it(L));var V=n.getDerivedStateFromProps;L=typeof V=="function"||typeof r.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,L||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(x||C!==f)&&Ld(t,r,l,f),Rn=!1;var D=t.memoizedState;r.state=D,Ua(t,l,r,s),Oa(),C=t.memoizedState,x||D!==C||Rn?(typeof V=="function"&&(tc(t,n,V,l),C=t.memoizedState),(b=Rn||Bd(t,n,b,l,D,C,f))?(L||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=C),r.props=l,r.state=C,r.context=f,l=b):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{r=t.stateNode,zr(e,t),f=t.memoizedProps,L=xl(n,f),r.props=L,V=t.pendingProps,D=r.context,C=n.contextType,b=ql,typeof C=="object"&&C!==null&&(b=it(C)),x=n.getDerivedStateFromProps,(C=typeof x=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f!==V||D!==b)&&Ld(t,r,l,b),Rn=!1,D=t.memoizedState,r.state=D,Ua(t,l,r,s),Oa();var U=t.memoizedState;f!==V||D!==U||Rn||e!==null&&e.dependencies!==null&&Ds(e.dependencies)?(typeof x=="function"&&(tc(t,n,x,l),U=t.memoizedState),(L=Rn||Bd(t,n,L,l,D,U,b)||e!==null&&e.dependencies!==null&&Ds(e.dependencies))?(C||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(l,U,b),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(l,U,b)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=U),r.props=l,r.state=U,r.context=b,l=L):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),l=!1)}return r=l,Ps(e,t),l=(t.flags&128)!==0,r||l?(r=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&l?(t.child=ml(t,e.child,null,s),t.child=ml(t,null,n,s)):rt(e,t,n,s),t.memoizedState=r.state,e=t.child):e=mn(e,t,s),e}function ef(e,t,n,l){return rl(),t.flags|=256,rt(e,t,n,l),t.child}var ic={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rc(e){return{baseLanes:e,cachePool:Yu()}}function cc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Mt),e}function tf(e,t,n){var l=t.pendingProps,s=!1,r=(t.flags&128)!==0,f;if((f=r)||(f=e!==null&&e.memoizedState===null?!1:(Ge.current&2)!==0),f&&(s=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(s?Un(t):qn(),(e=qe)?(e=um(e,Bt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mn!==null?{id:Kt,overflow:Jt}:null,retryLane:536870912,hydrationErrors:null},n=Du(e),n.return=t,t.child=n,st=t,qe=null)):e=null,e===null)throw Cn(t);return Xc(e)?t.lanes=32:t.lanes=536870912,null}var x=l.children;return l=l.fallback,s?(qn(),s=t.mode,x=ei({mode:"hidden",children:x},s),l=il(l,s,n,null),x.return=t,l.return=t,x.sibling=l,t.child=x,l=t.child,l.memoizedState=rc(n),l.childLanes=cc(e,f,n),t.memoizedState=ic,$a(null,l)):(Un(t),oc(t,x))}var b=e.memoizedState;if(b!==null&&(x=b.dehydrated,x!==null)){if(r)t.flags&256?(Un(t),t.flags&=-257,t=uc(e,t,n)):t.memoizedState!==null?(qn(),t.child=e.child,t.flags|=128,t=null):(qn(),x=l.fallback,s=t.mode,l=ei({mode:"visible",children:l.children},s),x=il(x,s,n,null),x.flags|=2,l.return=t,x.return=t,l.sibling=x,t.child=l,ml(t,e.child,null,n),l=t.child,l.memoizedState=rc(n),l.childLanes=cc(e,f,n),t.memoizedState=ic,t=$a(null,l));else if(Un(t),Xc(x)){if(f=x.nextSibling&&x.nextSibling.dataset,f)var C=f.dgst;f=C,l=Error(o(419)),l.stack="",l.digest=f,Ma({value:l,source:null,stack:null}),t=uc(e,t,n)}else if(Ze||$l(e,t,n,!1),f=(n&e.childLanes)!==0,Ze||f){if(f=Ue,f!==null&&(l=$o(f,n),l!==0&&l!==b.retryLane))throw b.retryLane=l,sl(e,l),bt(f,e,l),ac;Yc(x)||oi(),t=uc(e,t,n)}else Yc(x)?(t.flags|=192,t.child=e.child,t=null):(e=b.treeContext,qe=Ht(x.nextSibling),st=t,ke=!0,An=null,Bt=!1,e!==null&&qu(t,e),t=oc(t,l.children),t.flags|=4096);return t}return s?(qn(),x=l.fallback,s=t.mode,b=e.child,C=b.sibling,l=rn(b,{mode:"hidden",children:l.children}),l.subtreeFlags=b.subtreeFlags&65011712,C!==null?x=rn(C,x):(x=il(x,s,n,null),x.flags|=2),x.return=t,l.return=t,l.sibling=x,t.child=l,$a(null,l),l=t.child,x=e.child.memoizedState,x===null?x=rc(n):(s=x.cachePool,s!==null?(b=Ve._currentValue,s=s.parent!==b?{parent:b,pool:b}:s):s=Yu(),x={baseLanes:x.baseLanes|n,cachePool:s}),l.memoizedState=x,l.childLanes=cc(e,f,n),t.memoizedState=ic,$a(e.child,l)):(Un(t),n=e.child,e=n.sibling,n=rn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function oc(e,t){return t=ei({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ei(e,t){return e=_t(22,e,null,t),e.lanes=0,e}function uc(e,t,n){return ml(t,e.child,null,n),e=oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nf(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),_r(e.return,t,n)}function dc(e,t,n,l,s,r){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:s,treeForkCount:r}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=l,f.tail=n,f.tailMode=s,f.treeForkCount=r)}function lf(e,t,n){var l=t.pendingProps,s=l.revealOrder,r=l.tail;l=l.children;var f=Ge.current,x=(f&2)!==0;if(x?(f=f&1|2,t.flags|=128):f&=1,ee(Ge,f),rt(e,t,l,n),l=ke?wa:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nf(e,n,t);else if(e.tag===19)nf(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(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Gs(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),dc(t,!1,s,n,r,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Gs(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}dc(t,!0,n,null,r,l);break;case"together":dc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function mn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if($l(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=rn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=rn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ds(e)))}function Wx(e,t,n){switch(t.tag){case 3:Me(t,t.stateNode.containerInfo),zn(t,Ve,e.memoizedState.cache),rl();break;case 27:case 5:Je(t);break;case 4:Me(t,t.stateNode.containerInfo);break;case 10:zn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,qr(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Un(t),t.flags|=128,null):(n&t.child.childLanes)!==0?tf(e,t,n):(Un(t),e=mn(e,t,n),e!==null?e.sibling:null);Un(t);break;case 19:var s=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||($l(e,t,n,!1),l=(n&t.childLanes)!==0),s){if(l)return lf(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ee(Ge,Ge.current),l)break;return null;case 22:return t.lanes=0,Jd(e,t,n,t.pendingProps);case 24:zn(t,Ve,e.memoizedState.cache)}return mn(e,t,n)}function af(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ze=!0;else{if(!fc(e,n)&&(t.flags&128)===0)return Ze=!1,Wx(e,t,n);Ze=(e.flags&131072)!==0}else Ze=!1,ke&&(t.flags&1048576)!==0&&Uu(t,wa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=dl(t.elementType),t.type=e,typeof e=="function")vr(e)?(l=xl(e,l),t.tag=1,t=Pd(null,t,e,l,n)):(t.tag=0,t=sc(null,t,e,l,n));else{if(e!=null){var s=e.$$typeof;if(s===$){t.tag=11,t=Qd(null,t,e,l,n);break e}else if(s===z){t.tag=14,t=Zd(null,t,e,l,n);break e}}throw t=he(e)||e,Error(o(306,t,""))}}return t;case 0:return sc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,s=xl(l,t.pendingProps),Pd(e,t,l,s,n);case 3:e:{if(Me(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var r=t.memoizedState;s=r.element,zr(e,t),Ua(t,l,null,n);var f=t.memoizedState;if(l=f.cache,zn(t,Ve,l),l!==r.cache&&Er(t,[Ve],n,!0),Oa(),l=f.element,r.isDehydrated)if(r={element:l,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=ef(e,t,l,n);break e}else if(l!==s){s=Ot(Error(o(424)),t),Ma(s),t=ef(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(qe=Ht(e.firstChild),st=t,ke=!0,An=null,Bt=!0,n=Ju(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(rl(),l===s){t=mn(e,t,n);break e}rt(e,t,l,n)}t=t.child}return t;case 26:return Ps(e,t),e===null?(n=pm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ke||(n=t.type,e=t.pendingProps,l=pi(se.current).createElement(n),l[at]=t,l[ht]=e,ct(l,n,e),et(l),t.stateNode=l):t.memoizedState=pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Je(t),e===null&&ke&&(l=t.stateNode=mm(t.type,t.pendingProps,se.current),st=t,Bt=!0,s=qe,Vn(t.type)?(Vc=s,qe=Ht(l.firstChild)):qe=s),rt(e,t,t.pendingProps.children,n),Ps(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((s=l=qe)&&(l=wp(l,t.type,t.pendingProps,Bt),l!==null?(t.stateNode=l,st=t,qe=Ht(l.firstChild),Bt=!1,s=!0):s=!1),s||Cn(t)),Je(t),s=t.type,r=t.pendingProps,f=e!==null?e.memoizedProps:null,l=r.children,Hc(s,r)?l=null:f!==null&&Hc(s,f)&&(t.flags|=32),t.memoizedState!==null&&(s=Lr(e,t,Yx,null,null,n),ns._currentValue=s),Ps(e,t),rt(e,t,l,n),t.child;case 6:return e===null&&ke&&((e=n=qe)&&(n=Mp(n,t.pendingProps,Bt),n!==null?(t.stateNode=n,st=t,qe=null,e=!0):e=!1),e||Cn(t)),null;case 13:return tf(e,t,n);case 4:return Me(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ml(t,null,l,n):rt(e,t,l,n),t.child;case 11:return Qd(e,t,t.type,t.pendingProps,n);case 7:return rt(e,t,t.pendingProps,n),t.child;case 8:return rt(e,t,t.pendingProps.children,n),t.child;case 12:return rt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,zn(t,t.type,l.value),rt(e,t,l.children,n),t.child;case 9:return s=t.type._context,l=t.pendingProps.children,ol(t),s=it(s),l=l(s),t.flags|=1,rt(e,t,l,n),t.child;case 14:return Zd(e,t,t.type,t.pendingProps,n);case 15:return Kd(e,t,t.type,t.pendingProps,n);case 19:return lf(e,t,n);case 31:return Ix(e,t,n);case 22:return Jd(e,t,n,t.pendingProps);case 24:return ol(t),l=it(Ve),e===null?(s=Mr(),s===null&&(s=Ue,r=Tr(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=n),s=r),t.memoizedState={parent:l,cache:s},Cr(t),zn(t,Ve,s)):((e.lanes&n)!==0&&(zr(e,t),Ua(t,null,null,n),Oa()),s=e.memoizedState,r=t.memoizedState,s.parent!==l?(s={parent:l,cache:l},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),zn(t,Ve,l)):(l=r.cache,zn(t,Ve,l),l!==s.cache&&Er(t,[Ve],n,!0))),rt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function hn(e){e.flags|=4}function mc(e,t,n,l,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(zf())e.flags|=8192;else throw fl=Bs,Ar}else e.flags&=-16777217}function sf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!jm(t))if(zf())e.flags|=8192;else throw fl=Bs,Ar}function ti(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Bo():536870912,e.lanes|=t,Pl|=t)}function Ga(e,t){if(!ke)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 Be(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,l|=s.subtreeFlags&65011712,l|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,l|=s.subtreeFlags,l|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Px(e,t,n){var l=t.pendingProps;switch(jr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(t),null;case 1:return Be(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),un(Ve),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hl(t)?hn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Sr())),Be(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(hn(t),r!==null?(Be(t),sf(t,r)):(Be(t),mc(t,s,null,l,n))):r?r!==e.memoizedState?(hn(t),Be(t),sf(t,r)):(Be(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&hn(t),Be(t),mc(t,s,e,l,n)),null;case 27:if(Ct(t),n=se.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&hn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Be(t),null}e=Q.current,Hl(t)?Bu(t):(e=mm(s,l,n),t.stateNode=e,hn(t))}return Be(t),null;case 5:if(Ct(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&hn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Be(t),null}if(r=Q.current,Hl(t))Bu(t);else{var f=pi(se.current);switch(r){case 1:r=f.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=f.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=f.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?r.multiple=!0:l.size&&(r.size=l.size);break;default:r=typeof l.is=="string"?f.createElement(s,{is:l.is}):f.createElement(s)}}r[at]=t,r[ht]=l;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)r.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=r;e:switch(ct(r,s,l),s){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&hn(t)}}return Be(t),mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&hn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=se.current,Hl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,s=st,s!==null)switch(s.tag){case 27:case 5:l=s.memoizedProps}e[at]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||nm(e.nodeValue,n)),e||Cn(t,!0)}else e=pi(e).createTextNode(l),e[at]=t,t.stateNode=e}return Be(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Hl(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[at]=t}else rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Be(t),e=!1}else n=Sr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Tt(t),t):(Tt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Be(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Hl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!s)throw Error(o(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));s[at]=t}else rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Be(t),s=!1}else s=Sr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Tt(t),t):(Tt(t),null)}return Tt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,s=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(s=l.alternate.memoizedState.cachePool.pool),r=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(r=l.memoizedState.cachePool.pool),r!==s&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ti(t,t.updateQueue),Be(t),null);case 4:return ye(),e===null&&Oc(t.stateNode.containerInfo),Be(t),null;case 10:return un(t.type),Be(t),null;case 19:if(B(Ge),l=t.memoizedState,l===null)return Be(t),null;if(s=(t.flags&128)!==0,r=l.rendering,r===null)if(s)Ga(l,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Gs(e),r!==null){for(t.flags|=128,Ga(l,!1),e=r.updateQueue,t.updateQueue=e,ti(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ru(n,e),n=n.sibling;return ee(Ge,Ge.current&1|2),ke&&cn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&<()>ii&&(t.flags|=128,s=!0,Ga(l,!1),t.lanes=4194304)}else{if(!s)if(e=Gs(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,ti(t,e),Ga(l,!0),l.tail===null&&l.tailMode==="hidden"&&!r.alternate&&!ke)return Be(t),null}else 2*lt()-l.renderingStartTime>ii&&n!==536870912&&(t.flags|=128,s=!0,Ga(l,!1),t.lanes=4194304);l.isBackwards?(r.sibling=t.child,t.child=r):(e=l.last,e!==null?e.sibling=r:t.child=r,l.last=r)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=lt(),e.sibling=null,n=Ge.current,ee(Ge,s?n&1|2:n&1),ke&&cn(t,l.treeForkCount),e):(Be(t),null);case 22:case 23:return Tt(t),Ur(),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&&(Be(t),t.subtreeFlags&6&&(t.flags|=8192)):Be(t),n=t.updateQueue,n!==null&&ti(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&&B(ul),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),un(Ve),Be(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function ep(e,t){switch(jr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return un(Ve),ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ct(t),null;case 31:if(t.memoizedState!==null){if(Tt(t),t.alternate===null)throw Error(o(340));rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Tt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(Ge),null;case 4:return ye(),null;case 10:return un(t.type),null;case 22:case 23:return Tt(t),Ur(),e!==null&&B(ul),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return un(Ve),null;case 25:return null;default:return null}}function rf(e,t){switch(jr(t),t.tag){case 3:un(Ve),ye();break;case 26:case 27:case 5:Ct(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&Tt(t);break;case 13:Tt(t);break;case 19:B(Ge);break;case 10:un(t.type);break;case 22:case 23:Tt(t),Ur(),e!==null&&B(ul);break;case 24:un(Ve)}}function Ya(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var s=l.next;n=s;do{if((n.tag&e)===e){l=void 0;var r=n.create,f=n.inst;l=r(),f.destroy=l}n=n.next}while(n!==s)}}catch(x){ze(t,t.return,x)}}function Bn(e,t,n){try{var l=t.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var r=s.next;l=r;do{if((l.tag&e)===e){var f=l.inst,x=f.destroy;if(x!==void 0){f.destroy=void 0,s=t;var b=n,C=x;try{C()}catch(L){ze(s,b,L)}}}l=l.next}while(l!==r)}}catch(L){ze(t,t.return,L)}}function cf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Iu(t,n)}catch(l){ze(e,e.return,l)}}}function of(e,t,n){n.props=xl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){ze(e,t,l)}}function Xa(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(s){ze(e,t,s)}}function Ft(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(s){ze(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){ze(e,t,s)}else n.current=null}function uf(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(s){ze(e,e.return,s)}}function hc(e,t,n){try{var l=e.stateNode;Np(l,e.type,n,t),l[ht]=t}catch(s){ze(e,e.return,s)}}function df(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vn(e.type)||e.tag===4}function xc(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&&Vn(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 pc(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=an));else if(l!==4&&(l===27&&Vn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(pc(e,t,n),e=e.sibling;e!==null;)pc(e,t,n),e=e.sibling}function ni(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&&Vn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ni(e,t,n),e=e.sibling;e!==null;)ni(e,t,n),e=e.sibling}function ff(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ct(t,l,n),t[at]=e,t[ht]=n}catch(r){ze(e,e.return,r)}}var xn=!1,Ke=!1,vc=!1,mf=typeof WeakSet=="function"?WeakSet:Set,tt=null;function tp(e,t){if(e=e.containerInfo,Bc=Si,e=ku(e),ur(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 s=l.anchorOffset,r=l.focusNode;l=l.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var f=0,x=-1,b=-1,C=0,L=0,V=e,D=null;t:for(;;){for(var U;V!==n||s!==0&&V.nodeType!==3||(x=f+s),V!==r||l!==0&&V.nodeType!==3||(b=f+l),V.nodeType===3&&(f+=V.nodeValue.length),(U=V.firstChild)!==null;)D=V,V=U;for(;;){if(V===e)break t;if(D===n&&++C===s&&(x=f),D===r&&++L===l&&(b=f),(U=V.nextSibling)!==null)break;V=D,D=V.parentNode}V=U}n=x===-1||b===-1?null:{start:x,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(Lc={focusedElem:e,selectionRange:n},Si=!1,tt=t;tt!==null;)if(t=tt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,tt=e;else for(;tt!==null;){switch(t=tt,r=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)s=e[n],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,n=t,s=r.memoizedProps,r=r.memoizedState,l=n.stateNode;try{var ie=xl(n.type,s);e=l.getSnapshotBeforeUpdate(ie,r),l.__reactInternalSnapshotBeforeUpdate=e}catch(me){ze(n,n.return,me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Gc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gc(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,tt=e;break}tt=t.return}}function hf(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:vn(e,n),l&4&&Ya(5,n);break;case 1:if(vn(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){ze(n,n.return,f)}else{var s=xl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){ze(n,n.return,f)}}l&64&&cf(n),l&512&&Xa(n,n.return);break;case 3:if(vn(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{Iu(e,t)}catch(f){ze(n,n.return,f)}}break;case 27:t===null&&l&4&&ff(n);case 26:case 5:vn(e,n),t===null&&l&4&&uf(n),l&512&&Xa(n,n.return);break;case 12:vn(e,n);break;case 31:vn(e,n),l&4&&vf(e,n);break;case 13:vn(e,n),l&4&&gf(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=up.bind(null,n),Ap(e,n))));break;case 22:if(l=n.memoizedState!==null||xn,!l){t=t!==null&&t.memoizedState!==null||Ke,s=xn;var r=Ke;xn=l,(Ke=t)&&!r?gn(e,n,(n.subtreeFlags&8772)!==0):vn(e,n),xn=s,Ke=r}break;case 30:break;default:vn(e,n)}}function xf(e){var t=e.alternate;t!==null&&(e.alternate=null,xf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Zi(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 Le=null,pt=!1;function pn(e,t,n){for(n=n.child;n!==null;)pf(e,t,n),n=n.sibling}function pf(e,t,n){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(ha,n)}catch{}switch(n.tag){case 26:Ke||Ft(n,t),pn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ke||Ft(n,t);var l=Le,s=pt;Vn(n.type)&&(Le=n.stateNode,pt=!1),pn(e,t,n),Pa(n.stateNode),Le=l,pt=s;break;case 5:Ke||Ft(n,t);case 6:if(l=Le,s=pt,Le=null,pn(e,t,n),Le=l,pt=s,Le!==null)if(pt)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(n.stateNode)}catch(r){ze(n,t,r)}else try{Le.removeChild(n.stateNode)}catch(r){ze(n,t,r)}break;case 18:Le!==null&&(pt?(e=Le,cm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ra(e)):cm(Le,n.stateNode));break;case 4:l=Le,s=pt,Le=n.stateNode.containerInfo,pt=!0,pn(e,t,n),Le=l,pt=s;break;case 0:case 11:case 14:case 15:Bn(2,n,t),Ke||Bn(4,n,t),pn(e,t,n);break;case 1:Ke||(Ft(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&of(n,t,l)),pn(e,t,n);break;case 21:pn(e,t,n);break;case 22:Ke=(l=Ke)||n.memoizedState!==null,pn(e,t,n),Ke=l;break;default:pn(e,t,n)}}function vf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ra(e)}catch(n){ze(t,t.return,n)}}}function gf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ra(e)}catch(n){ze(t,t.return,n)}}function np(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new mf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new mf),t;default:throw Error(o(435,e.tag))}}function li(e,t){var n=np(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var s=dp.bind(null,e,l);l.then(s,s)}})}function vt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var s=n[l],r=e,f=t,x=f;e:for(;x!==null;){switch(x.tag){case 27:if(Vn(x.type)){Le=x.stateNode,pt=!1;break e}break;case 5:Le=x.stateNode,pt=!1;break e;case 3:case 4:Le=x.stateNode.containerInfo,pt=!0;break e}x=x.return}if(Le===null)throw Error(o(160));pf(r,f,s),Le=null,pt=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yf(t,e),t=t.sibling}var Vt=null;function yf(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:vt(t,e),gt(e),l&4&&(Bn(3,e,e.return),Ya(3,e),Bn(5,e,e.return));break;case 1:vt(t,e),gt(e),l&512&&(Ke||n===null||Ft(n,n.return)),l&64&&xn&&(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 s=Vt;if(vt(t,e),gt(e),l&512&&(Ke||n===null||Ft(n,n.return)),l&4){var r=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,s=s.ownerDocument||s;t:switch(l){case"title":r=s.getElementsByTagName("title")[0],(!r||r[va]||r[at]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(l),s.head.insertBefore(r,s.querySelector("head > title"))),ct(r,l,n),r[at]=e,et(r),l=r;break e;case"link":var f=ym("link","href",s).get(l+(n.href||""));if(f){for(var x=0;x<f.length;x++)if(r=f[x],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){f.splice(x,1);break t}}r=s.createElement(l),ct(r,l,n),s.head.appendChild(r);break;case"meta":if(f=ym("meta","content",s).get(l+(n.content||""))){for(x=0;x<f.length;x++)if(r=f[x],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){f.splice(x,1);break t}}r=s.createElement(l),ct(r,l,n),s.head.appendChild(r);break;default:throw Error(o(468,l))}r[at]=e,et(r),l=r}e.stateNode=l}else bm(s,e.type,e.stateNode);else e.stateNode=gm(s,l,e.memoizedProps);else r!==l?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,l===null?bm(s,e.type,e.stateNode):gm(s,l,e.memoizedProps)):l===null&&e.stateNode!==null&&hc(e,e.memoizedProps,n.memoizedProps)}break;case 27:vt(t,e),gt(e),l&512&&(Ke||n===null||Ft(n,n.return)),n!==null&&l&4&&hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(vt(t,e),gt(e),l&512&&(Ke||n===null||Ft(n,n.return)),e.flags&32){s=e.stateNode;try{Al(s,"")}catch(ie){ze(e,e.return,ie)}}l&4&&e.stateNode!=null&&(s=e.memoizedProps,hc(e,s,n!==null?n.memoizedProps:s)),l&1024&&(vc=!0);break;case 6:if(vt(t,e),gt(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ie){ze(e,e.return,ie)}}break;case 3:if(yi=null,s=Vt,Vt=vi(t.containerInfo),vt(t,e),Vt=s,gt(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{ra(t.containerInfo)}catch(ie){ze(e,e.return,ie)}vc&&(vc=!1,bf(e));break;case 4:l=Vt,Vt=vi(e.stateNode.containerInfo),vt(t,e),gt(e),Vt=l;break;case 12:vt(t,e),gt(e);break;case 31:vt(t,e),gt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,li(e,l)));break;case 13:vt(t,e),gt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(si=lt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,li(e,l)));break;case 22:s=e.memoizedState!==null;var b=n!==null&&n.memoizedState!==null,C=xn,L=Ke;if(xn=C||s,Ke=L||b,vt(t,e),Ke=L,xn=C,gt(e),l&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(n===null||b||xn||Ke||pl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){b=n=t;try{if(r=b.stateNode,s)f=r.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{x=b.stateNode;var V=b.memoizedProps.style,D=V!=null&&V.hasOwnProperty("display")?V.display:null;x.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(ie){ze(b,b.return,ie)}}}else if(t.tag===6){if(n===null){b=t;try{b.stateNode.nodeValue=s?"":b.memoizedProps}catch(ie){ze(b,b.return,ie)}}}else if(t.tag===18){if(n===null){b=t;try{var U=b.stateNode;s?om(U,!0):om(b.stateNode,!1)}catch(ie){ze(b,b.return,ie)}}}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,li(e,n))));break;case 19:vt(t,e),gt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,li(e,l)));break;case 30:break;case 21:break;default:vt(t,e),gt(e)}}function gt(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 s=n.stateNode,r=xc(e);ni(e,r,s);break;case 5:var f=n.stateNode;n.flags&32&&(Al(f,""),n.flags&=-33);var x=xc(e);ni(e,x,f);break;case 3:case 4:var b=n.stateNode.containerInfo,C=xc(e);pc(e,C,b);break;default:throw Error(o(161))}}catch(L){ze(e,e.return,L)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hf(e,t.alternate,t),t=t.sibling}function pl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bn(4,t,t.return),pl(t);break;case 1:Ft(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&of(t,t.return,n),pl(t);break;case 27:Pa(t.stateNode);case 26:case 5:Ft(t,t.return),pl(t);break;case 22:t.memoizedState===null&&pl(t);break;case 30:pl(t);break;default:pl(t)}e=e.sibling}}function gn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,s=e,r=t,f=r.flags;switch(r.tag){case 0:case 11:case 15:gn(s,r,n),Ya(4,r);break;case 1:if(gn(s,r,n),l=r,s=l.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(C){ze(l,l.return,C)}if(l=r,s=l.updateQueue,s!==null){var x=l.stateNode;try{var b=s.shared.hiddenCallbacks;if(b!==null)for(s.shared.hiddenCallbacks=null,s=0;s<b.length;s++)Fu(b[s],x)}catch(C){ze(l,l.return,C)}}n&&f&64&&cf(r),Xa(r,r.return);break;case 27:ff(r);case 26:case 5:gn(s,r,n),n&&l===null&&f&4&&uf(r),Xa(r,r.return);break;case 12:gn(s,r,n);break;case 31:gn(s,r,n),n&&f&4&&vf(s,r);break;case 13:gn(s,r,n),n&&f&4&&gf(s,r);break;case 22:r.memoizedState===null&&gn(s,r,n),Xa(r,r.return);break;case 30:break;default:gn(s,r,n)}t=t.sibling}}function gc(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&&Aa(n))}function yc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e))}function Qt(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jf(e,t,n,l),t=t.sibling}function jf(e,t,n,l){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Qt(e,t,n,l),s&2048&&Ya(9,t);break;case 1:Qt(e,t,n,l);break;case 3:Qt(e,t,n,l),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e)));break;case 12:if(s&2048){Qt(e,t,n,l),e=t.stateNode;try{var r=t.memoizedProps,f=r.id,x=r.onPostCommit;typeof x=="function"&&x(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(b){ze(t,t.return,b)}}else Qt(e,t,n,l);break;case 31:Qt(e,t,n,l);break;case 13:Qt(e,t,n,l);break;case 23:break;case 22:r=t.stateNode,f=t.alternate,t.memoizedState!==null?r._visibility&2?Qt(e,t,n,l):Va(e,t):r._visibility&2?Qt(e,t,n,l):(r._visibility|=2,Fl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),s&2048&&gc(f,t);break;case 24:Qt(e,t,n,l),s&2048&&yc(t.alternate,t);break;default:Qt(e,t,n,l)}}function Fl(e,t,n,l,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,f=t,x=n,b=l,C=f.flags;switch(f.tag){case 0:case 11:case 15:Fl(r,f,x,b,s),Ya(8,f);break;case 23:break;case 22:var L=f.stateNode;f.memoizedState!==null?L._visibility&2?Fl(r,f,x,b,s):Va(r,f):(L._visibility|=2,Fl(r,f,x,b,s)),s&&C&2048&&gc(f.alternate,f);break;case 24:Fl(r,f,x,b,s),s&&C&2048&&yc(f.alternate,f);break;default:Fl(r,f,x,b,s)}t=t.sibling}}function Va(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,s=l.flags;switch(l.tag){case 22:Va(n,l),s&2048&&gc(l.alternate,l);break;case 24:Va(n,l),s&2048&&yc(l.alternate,l);break;default:Va(n,l)}t=t.sibling}}var Qa=8192;function Il(e,t,n){if(e.subtreeFlags&Qa)for(e=e.child;e!==null;)Nf(e,t,n),e=e.sibling}function Nf(e,t,n){switch(e.tag){case 26:Il(e,t,n),e.flags&Qa&&e.memoizedState!==null&&Gp(n,Vt,e.memoizedState,e.memoizedProps);break;case 5:Il(e,t,n);break;case 3:case 4:var l=Vt;Vt=vi(e.stateNode.containerInfo),Il(e,t,n),Vt=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Qa,Qa=16777216,Il(e,t,n),Qa=l):Il(e,t,n));break;default:Il(e,t,n)}}function Sf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Za(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];tt=l,_f(l,e)}Sf(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:Za(e),e.flags&2048&&Bn(9,e,e.return);break;case 3:Za(e);break;case 12:Za(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ai(e)):Za(e);break;default:Za(e)}}function ai(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];tt=l,_f(l,e)}Sf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bn(8,t,t.return),ai(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ai(t));break;default:ai(t)}e=e.sibling}}function _f(e,t){for(;tt!==null;){var n=tt;switch(n.tag){case 0:case 11:case 15:Bn(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:Aa(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,tt=l;else e:for(n=e;tt!==null;){l=tt;var s=l.sibling,r=l.return;if(xf(l),l===n){tt=null;break e}if(s!==null){s.return=r,tt=s;break e}tt=r}}}var lp={getCacheForType:function(e){var t=it(Ve),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return it(Ve).controller.signal}},ap=typeof WeakMap=="function"?WeakMap:Map,we=0,Ue=null,be=null,Ne=0,Ce=0,wt=null,Ln=!1,Wl=!1,bc=!1,yn=0,$e=0,Hn=0,vl=0,jc=0,Mt=0,Pl=0,Ka=null,yt=null,Nc=!1,si=0,Ef=0,ii=1/0,ri=null,$n=null,Ie=0,Gn=null,ea=null,bn=0,Sc=0,kc=null,Tf=null,Ja=0,_c=null;function At(){return(we&2)!==0&&Ne!==0?Ne&-Ne:w.T!==null?Cc():Go()}function wf(){if(Mt===0)if((Ne&536870912)===0||ke){var e=xs;xs<<=1,(xs&3932160)===0&&(xs=262144),Mt=e}else Mt=536870912;return e=Et.current,e!==null&&(e.flags|=32),Mt}function bt(e,t,n){(e===Ue&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)&&(ta(e,0),Yn(e,Ne,Mt,!1)),pa(e,n),((we&2)===0||e!==Ue)&&(e===Ue&&((we&2)===0&&(vl|=n),$e===4&&Yn(e,Ne,Mt,!1)),It(e))}function Mf(e,t,n){if((we&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||xa(e,t),s=l?rp(e,t):Tc(e,t,!0),r=l;do{if(s===0){Wl&&!l&&Yn(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!sp(n)){s=Tc(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var x=e;s=Ka;var b=x.current.memoizedState.isDehydrated;if(b&&(ta(x,f).flags|=256),f=Tc(x,f,!1),f!==2){if(bc&&!b){x.errorRecoveryDisabledLanes|=r,vl|=r,s=4;break e}r=yt,yt=s,r!==null&&(yt===null?yt=r:yt.push.apply(yt,r))}s=f}if(r=!1,s!==2)continue}}if(s===1){ta(e,0),Yn(e,t,0,!0);break}e:{switch(l=e,r=s,r){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Yn(l,t,Mt,!Ln);break e;case 2:yt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(s=si+300-lt(),10<s)){if(Yn(l,t,Mt,!Ln),vs(l,0,!0)!==0)break e;bn=t,l.timeoutHandle=im(Af.bind(null,l,n,yt,ri,Nc,t,Mt,vl,Pl,Ln,r,"Throttled",-0,0),s);break e}Af(l,n,yt,ri,Nc,t,Mt,vl,Pl,Ln,r,null,-0,0)}}break}while(!0);It(e)}function Af(e,t,n,l,s,r,f,x,b,C,L,V,D,U){if(e.timeoutHandle=-1,V=t.subtreeFlags,V&8192||(V&16785408)===16785408){V={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:an},Nf(t,r,V);var ie=(r&62914560)===r?si-lt():(r&4194048)===r?Ef-lt():0;if(ie=Yp(V,ie),ie!==null){bn=r,e.cancelPendingCommit=ie(Bf.bind(null,e,t,r,n,l,s,f,x,b,L,V,null,D,U)),Yn(e,r,f,!C);return}}Bf(e,t,r,n,l,s,f,x,b)}function sp(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 s=n[l],r=s.getSnapshot;s=s.value;try{if(!kt(r(),s))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 Yn(e,t,n,l){t&=~jc,t&=~vl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var s=t;0<s;){var r=31-St(s),f=1<<r;l[r]=-1,s&=~f}n!==0&&Lo(e,n,t)}function ci(){return(we&6)===0?(Fa(0),!1):!0}function Ec(){if(be!==null){if(Ce===0)var e=be.return;else e=be,on=cl=null,Gr(e),Vl=null,za=0,e=be;for(;e!==null;)rf(e.alternate,e),e=e.return;be=null}}function ta(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bn=0,Ec(),Ue=e,be=n=rn(e.current,null),Ne=t,Ce=0,wt=null,Ln=!1,Wl=xa(e,t),bc=!1,Pl=Mt=jc=vl=Hn=$e=0,yt=Ka=null,Nc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var s=31-St(l),r=1<<s;t|=e[s],l&=~r}return yn=t,Ms(),n}function Cf(e,t){ve=null,w.H=Ha,t===Xl||t===qs?(t=Qu(),Ce=3):t===Ar?(t=Qu(),Ce=4):Ce=t===ac?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,wt=t,be===null&&($e=1,Is(e,Ot(t,e.current)))}function zf(){var e=Et.current;return e===null?!0:(Ne&4194048)===Ne?Lt===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===Lt:!1}function Rf(){var e=w.H;return w.H=Ha,e===null?Ha:e}function Df(){var e=w.A;return w.A=lp,e}function oi(){$e=4,Ln||(Ne&4194048)!==Ne&&Et.current!==null||(Wl=!0),(Hn&134217727)===0&&(vl&134217727)===0||Ue===null||Yn(Ue,Ne,Mt,!1)}function Tc(e,t,n){var l=we;we|=2;var s=Rf(),r=Df();(Ue!==e||Ne!==t)&&(ri=null,ta(e,t)),t=!1;var f=$e;e:do try{if(Ce!==0&&be!==null){var x=be,b=wt;switch(Ce){case 8:Ec(),f=6;break e;case 3:case 2:case 9:case 6:Et.current===null&&(t=!0);var C=Ce;if(Ce=0,wt=null,na(e,x,b,C),n&&Wl){f=0;break e}break;default:C=Ce,Ce=0,wt=null,na(e,x,b,C)}}ip(),f=$e;break}catch(L){Cf(e,L)}while(!0);return t&&e.shellSuspendCounter++,on=cl=null,we=l,w.H=s,w.A=r,be===null&&(Ue=null,Ne=0,Ms()),f}function ip(){for(;be!==null;)Of(be)}function rp(e,t){var n=we;we|=2;var l=Rf(),s=Df();Ue!==e||Ne!==t?(ri=null,ii=lt()+500,ta(e,t)):Wl=xa(e,t);e:do try{if(Ce!==0&&be!==null){t=be;var r=wt;t:switch(Ce){case 1:Ce=0,wt=null,na(e,t,r,1);break;case 2:case 9:if(Xu(r)){Ce=0,wt=null,Uf(t);break}t=function(){Ce!==2&&Ce!==9||Ue!==e||(Ce=7),It(e)},r.then(t,t);break e;case 3:Ce=7;break e;case 4:Ce=5;break e;case 7:Xu(r)?(Ce=0,wt=null,Uf(t)):(Ce=0,wt=null,na(e,t,r,7));break;case 5:var f=null;switch(be.tag){case 26:f=be.memoizedState;case 5:case 27:var x=be;if(f?jm(f):x.stateNode.complete){Ce=0,wt=null;var b=x.sibling;if(b!==null)be=b;else{var C=x.return;C!==null?(be=C,ui(C)):be=null}break t}}Ce=0,wt=null,na(e,t,r,5);break;case 6:Ce=0,wt=null,na(e,t,r,6);break;case 8:Ec(),$e=6;break e;default:throw Error(o(462))}}cp();break}catch(L){Cf(e,L)}while(!0);return on=cl=null,w.H=l,w.A=s,we=n,be!==null?0:(Ue=null,Ne=0,Ms(),$e)}function cp(){for(;be!==null&&!Fe();)Of(be)}function Of(e){var t=af(e.alternate,e,yn);e.memoizedProps=e.pendingProps,t===null?ui(e):be=t}function Uf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wd(n,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=Wd(n,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:Gr(t);default:rf(n,t),t=be=Ru(t,yn),t=af(n,t,yn)}e.memoizedProps=e.pendingProps,t===null?ui(e):be=t}function na(e,t,n,l){on=cl=null,Gr(t),Vl=null,za=0;var s=t.return;try{if(Fx(e,s,t,n,Ne)){$e=1,Is(e,Ot(n,e.current)),be=null;return}}catch(r){if(s!==null)throw be=s,r;$e=1,Is(e,Ot(n,e.current)),be=null;return}t.flags&32768?(ke||l===1?e=!0:Wl||(Ne&536870912)!==0?e=!1:(Ln=e=!0,(l===2||l===9||l===3||l===6)&&(l=Et.current,l!==null&&l.tag===13&&(l.flags|=16384))),qf(t,e)):ui(t)}function ui(e){var t=e;do{if((t.flags&32768)!==0){qf(t,Ln);return}e=t.return;var n=Px(t.alternate,t,yn);if(n!==null){be=n;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);$e===0&&($e=5)}function qf(e,t){do{var n=ep(e.alternate,e);if(n!==null){n.flags&=32767,be=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){be=e;return}be=e=n}while(e!==null);$e=6,be=null}function Bf(e,t,n,l,s,r,f,x,b){e.cancelPendingCommit=null;do di();while(Ie!==0);if((we&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(r=t.lanes|t.childLanes,r|=xr,$h(e,n,r,f,x,b),e===Ue&&(be=Ue=null,Ne=0),ea=t,Gn=e,bn=n,Sc=r,kc=s,Tf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,fp(ms,function(){return Yf(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=w.T,w.T=null,s=H.p,H.p=2,f=we,we|=4;try{tp(e,t,n)}finally{we=f,H.p=s,w.T=l}}Ie=1,Lf(),Hf(),$f()}}function Lf(){if(Ie===1){Ie=0;var e=Gn,t=ea,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=w.T,w.T=null;var l=H.p;H.p=2;var s=we;we|=4;try{yf(t,e);var r=Lc,f=ku(e.containerInfo),x=r.focusedElem,b=r.selectionRange;if(f!==x&&x&&x.ownerDocument&&Su(x.ownerDocument.documentElement,x)){if(b!==null&&ur(x)){var C=b.start,L=b.end;if(L===void 0&&(L=C),"selectionStart"in x)x.selectionStart=C,x.selectionEnd=Math.min(L,x.value.length);else{var V=x.ownerDocument||document,D=V&&V.defaultView||window;if(D.getSelection){var U=D.getSelection(),ie=x.textContent.length,me=Math.min(b.start,ie),Oe=b.end===void 0?me:Math.min(b.end,ie);!U.extend&&me>Oe&&(f=Oe,Oe=me,me=f);var _=Nu(x,me),S=Nu(x,Oe);if(_&&S&&(U.rangeCount!==1||U.anchorNode!==_.node||U.anchorOffset!==_.offset||U.focusNode!==S.node||U.focusOffset!==S.offset)){var A=V.createRange();A.setStart(_.node,_.offset),U.removeAllRanges(),me>Oe?(U.addRange(A),U.extend(S.node,S.offset)):(A.setEnd(S.node,S.offset),U.addRange(A))}}}}for(V=[],U=x;U=U.parentNode;)U.nodeType===1&&V.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<V.length;x++){var Y=V[x];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}Si=!!Bc,Lc=Bc=null}finally{we=s,H.p=l,w.T=n}}e.current=t,Ie=2}}function Hf(){if(Ie===2){Ie=0;var e=Gn,t=ea,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=w.T,w.T=null;var l=H.p;H.p=2;var s=we;we|=4;try{hf(e,t.alternate,t)}finally{we=s,H.p=l,w.T=n}}Ie=3}}function $f(){if(Ie===4||Ie===3){Ie=0,Yt();var e=Gn,t=ea,n=bn,l=Tf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ie=5:(Ie=0,ea=Gn=null,Gf(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&($n=null),Vi(n),t=t.stateNode,Nt&&typeof Nt.onCommitFiberRoot=="function")try{Nt.onCommitFiberRoot(ha,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=w.T,s=H.p,H.p=2,w.T=null;try{for(var r=e.onRecoverableError,f=0;f<l.length;f++){var x=l[f];r(x.value,{componentStack:x.stack})}}finally{w.T=t,H.p=s}}(bn&3)!==0&&di(),It(e),s=e.pendingLanes,(n&261930)!==0&&(s&42)!==0?e===_c?Ja++:(Ja=0,_c=e):Ja=0,Fa(0)}}function Gf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Aa(t)))}function di(){return Lf(),Hf(),$f(),Yf()}function Yf(){if(Ie!==5)return!1;var e=Gn,t=Sc;Sc=0;var n=Vi(bn),l=w.T,s=H.p;try{H.p=32>n?32:n,w.T=null,n=kc,kc=null;var r=Gn,f=bn;if(Ie=0,ea=Gn=null,bn=0,(we&6)!==0)throw Error(o(331));var x=we;if(we|=4,kf(r.current),jf(r,r.current,f,n),we=x,Fa(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(ha,r)}catch{}return!0}finally{H.p=s,w.T=l,Gf(e,t)}}function Xf(e,t,n){t=Ot(n,t),t=lc(e.stateNode,t,2),e=On(e,t,2),e!==null&&(pa(e,2),It(e))}function ze(e,t,n){if(e.tag===3)Xf(e,e,n);else for(;t!==null;){if(t.tag===3){Xf(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&($n===null||!$n.has(l))){e=Ot(n,e),n=Xd(2),l=On(t,n,2),l!==null&&(Vd(n,l,t,e),pa(l,2),It(l));break}}t=t.return}}function wc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new ap;var s=new Set;l.set(t,s)}else s=l.get(t),s===void 0&&(s=new Set,l.set(t,s));s.has(n)||(bc=!0,s.add(n),e=op.bind(null,e,t,n),t.then(e,e))}function op(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ue===e&&(Ne&n)===n&&($e===4||$e===3&&(Ne&62914560)===Ne&&300>lt()-si?(we&2)===0&&ta(e,0):jc|=n,Pl===Ne&&(Pl=0)),It(e)}function Vf(e,t){t===0&&(t=Bo()),e=sl(e,t),e!==null&&(pa(e,t),It(e))}function up(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Vf(e,n)}function dp(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,s=e.memoizedState;s!==null&&(n=s.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),Vf(e,n)}function fp(e,t){return pe(e,t)}var fi=null,la=null,Mc=!1,mi=!1,Ac=!1,Xn=0;function It(e){e!==la&&e.next===null&&(la===null?fi=la=e:la=la.next=e),mi=!0,Mc||(Mc=!0,hp())}function Fa(e,t){if(!Ac&&mi){Ac=!0;do for(var n=!1,l=fi;l!==null;){if(e!==0){var s=l.pendingLanes;if(s===0)var r=0;else{var f=l.suspendedLanes,x=l.pingedLanes;r=(1<<31-St(42|e)+1)-1,r&=s&~(f&~x),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,Jf(l,r))}else r=Ne,r=vs(l,l===Ue?r:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(r&3)===0||xa(l,r)||(n=!0,Jf(l,r));l=l.next}while(n);Ac=!1}}function mp(){Qf()}function Qf(){mi=Mc=!1;var e=0;Xn!==0&&kp()&&(e=Xn);for(var t=lt(),n=null,l=fi;l!==null;){var s=l.next,r=Zf(l,t);r===0?(l.next=null,n===null?fi=s:n.next=s,s===null&&(la=n)):(n=l,(e!==0||(r&3)!==0)&&(mi=!0)),l=s}Ie!==0&&Ie!==5||Fa(e),Xn!==0&&(Xn=0)}function Zf(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var f=31-St(r),x=1<<f,b=s[f];b===-1?((x&n)===0||(x&l)!==0)&&(s[f]=Hh(x,t)):b<=t&&(e.expiredLanes|=x),r&=~x}if(t=Ue,n=Ne,n=vs(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Te(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||xa(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Te(l),Vi(n)){case 2:case 8:n=Pn;break;case 32:n=ms;break;case 268435456:n=qo;break;default:n=ms}return l=Kf.bind(null,e),n=pe(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Te(l),e.callbackPriority=2,e.callbackNode=null,2}function Kf(e,t){if(Ie!==0&&Ie!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(di()&&e.callbackNode!==n)return null;var l=Ne;return l=vs(e,e===Ue?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Mf(e,l,t),Zf(e,lt()),e.callbackNode!=null&&e.callbackNode===n?Kf.bind(null,e):null)}function Jf(e,t){if(di())return null;Mf(e,t,!0)}function hp(){Ep(function(){(we&6)!==0?pe(ma,mp):Qf()})}function Cc(){if(Xn===0){var e=Gl;e===0&&(e=hs,hs<<=1,(hs&261888)===0&&(hs=256)),Xn=e}return Xn}function Ff(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:js(""+e)}function If(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 xp(e,t,n,l,s){if(t==="submit"&&n&&n.stateNode===s){var r=Ff((s[ht]||null).action),f=l.submitter;f&&(t=(t=f[ht]||null)?Ff(t.formAction):f.getAttribute("formAction"),t!==null&&(r=t,f=null));var x=new _s("action","action",null,l,s);e.push({event:x,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Xn!==0){var b=f?If(s,f):new FormData(s);Ir(n,{pending:!0,data:b,method:s.method,action:r},null,b)}}else typeof r=="function"&&(x.preventDefault(),b=f?If(s,f):new FormData(s),Ir(n,{pending:!0,data:b,method:s.method,action:r},r,b))},currentTarget:s}]})}}for(var zc=0;zc<hr.length;zc++){var Rc=hr[zc],pp=Rc.toLowerCase(),vp=Rc[0].toUpperCase()+Rc.slice(1);Xt(pp,"on"+vp)}Xt(Tu,"onAnimationEnd"),Xt(wu,"onAnimationIteration"),Xt(Mu,"onAnimationStart"),Xt("dblclick","onDoubleClick"),Xt("focusin","onFocus"),Xt("focusout","onBlur"),Xt(Rx,"onTransitionRun"),Xt(Dx,"onTransitionStart"),Xt(Ox,"onTransitionCancel"),Xt(Au,"onTransitionEnd"),wl("onMouseEnter",["mouseout","mouseover"]),wl("onMouseLeave",["mouseout","mouseover"]),wl("onPointerEnter",["pointerout","pointerover"]),wl("onPointerLeave",["pointerout","pointerover"]),tl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),tl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),tl("onBeforeInput",["compositionend","keypress","textInput","paste"]),tl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),tl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),tl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ia="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(" "),gp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ia));function Wf(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],s=l.event;l=l.listeners;e:{var r=void 0;if(t)for(var f=l.length-1;0<=f;f--){var x=l[f],b=x.instance,C=x.currentTarget;if(x=x.listener,b!==r&&s.isPropagationStopped())break e;r=x,s.currentTarget=C;try{r(s)}catch(L){ws(L)}s.currentTarget=null,r=b}else for(f=0;f<l.length;f++){if(x=l[f],b=x.instance,C=x.currentTarget,x=x.listener,b!==r&&s.isPropagationStopped())break e;r=x,s.currentTarget=C;try{r(s)}catch(L){ws(L)}s.currentTarget=null,r=b}}}}function je(e,t){var n=t[Qi];n===void 0&&(n=t[Qi]=new Set);var l=e+"__bubble";n.has(l)||(Pf(t,e,2,!1),n.add(l))}function Dc(e,t,n){var l=0;t&&(l|=4),Pf(n,e,l,t)}var hi="_reactListening"+Math.random().toString(36).slice(2);function Oc(e){if(!e[hi]){e[hi]=!0,Vo.forEach(function(n){n!=="selectionchange"&&(gp.has(n)||Dc(n,!1,e),Dc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[hi]||(t[hi]=!0,Dc("selectionchange",!1,t))}}function Pf(e,t,n,l){switch(wm(t)){case 2:var s=Qp;break;case 8:s=Zp;break;default:s=Fc}n=s.bind(null,t,n,e),s=void 0,!tr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),l?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Uc(e,t,n,l,s){var r=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var f=l.tag;if(f===3||f===4){var x=l.stateNode.containerInfo;if(x===s)break;if(f===4)for(f=l.return;f!==null;){var b=f.tag;if((b===3||b===4)&&f.stateNode.containerInfo===s)return;f=f.return}for(;x!==null;){if(f=_l(x),f===null)return;if(b=f.tag,b===5||b===6||b===26||b===27){l=r=f;continue e}x=x.parentNode}}l=l.return}lu(function(){var C=r,L=Pi(n),V=[];e:{var D=Cu.get(e);if(D!==void 0){var U=_s,ie=e;switch(e){case"keypress":if(Ss(n)===0)break e;case"keydown":case"keyup":U=dx;break;case"focusin":ie="focus",U=sr;break;case"focusout":ie="blur",U=sr;break;case"beforeblur":case"afterblur":U=sr;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":U=iu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=Ph;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=hx;break;case Tu:case wu:case Mu:U=nx;break;case Au:U=px;break;case"scroll":case"scrollend":U=Ih;break;case"wheel":U=gx;break;case"copy":case"cut":case"paste":U=ax;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=cu;break;case"toggle":case"beforetoggle":U=bx}var me=(t&4)!==0,Oe=!me&&(e==="scroll"||e==="scrollend"),_=me?D!==null?D+"Capture":null:D;me=[];for(var S=C,A;S!==null;){var Y=S;if(A=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||A===null||_===null||(Y=ya(S,_),Y!=null&&me.push(Wa(S,Y,A))),Oe)break;S=S.return}0<me.length&&(D=new U(D,ie,null,n,L),V.push({event:D,listeners:me}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",D&&n!==Wi&&(ie=n.relatedTarget||n.fromElement)&&(_l(ie)||ie[kl]))break e;if((U||D)&&(D=L.window===L?L:(D=L.ownerDocument)?D.defaultView||D.parentWindow:window,U?(ie=n.relatedTarget||n.toElement,U=C,ie=ie?_l(ie):null,ie!==null&&(Oe=m(ie),me=ie.tag,ie!==Oe||me!==5&&me!==27&&me!==6)&&(ie=null)):(U=null,ie=C),U!==ie)){if(me=iu,Y="onMouseLeave",_="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(me=cu,Y="onPointerLeave",_="onPointerEnter",S="pointer"),Oe=U==null?D:ga(U),A=ie==null?D:ga(ie),D=new me(Y,S+"leave",U,n,L),D.target=Oe,D.relatedTarget=A,Y=null,_l(L)===C&&(me=new me(_,S+"enter",ie,n,L),me.target=A,me.relatedTarget=Oe,Y=me),Oe=Y,U&&ie)t:{for(me=yp,_=U,S=ie,A=0,Y=_;Y;Y=me(Y))A++;Y=0;for(var ue=S;ue;ue=me(ue))Y++;for(;0<A-Y;)_=me(_),A--;for(;0<Y-A;)S=me(S),Y--;for(;A--;){if(_===S||S!==null&&_===S.alternate){me=_;break t}_=me(_),S=me(S)}me=null}else me=null;U!==null&&em(V,D,U,me,!1),ie!==null&&Oe!==null&&em(V,Oe,ie,me,!0)}}e:{if(D=C?ga(C):window,U=D.nodeName&&D.nodeName.toLowerCase(),U==="select"||U==="input"&&D.type==="file")var _e=pu;else if(hu(D))if(vu)_e=Ax;else{_e=wx;var re=Tx}else U=D.nodeName,!U||U.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?C&&Ii(C.elementType)&&(_e=pu):_e=Mx;if(_e&&(_e=_e(e,C))){xu(V,_e,n,L);break e}re&&re(e,D,C),e==="focusout"&&C&&D.type==="number"&&C.memoizedProps.value!=null&&Fi(D,"number",D.value)}switch(re=C?ga(C):window,e){case"focusin":(hu(re)||re.contentEditable==="true")&&(Dl=re,dr=C,Ta=null);break;case"focusout":Ta=dr=Dl=null;break;case"mousedown":fr=!0;break;case"contextmenu":case"mouseup":case"dragend":fr=!1,_u(V,n,L);break;case"selectionchange":if(zx)break;case"keydown":case"keyup":_u(V,n,L)}var ge;if(rr)e:{switch(e){case"compositionstart":var Se="onCompositionStart";break e;case"compositionend":Se="onCompositionEnd";break e;case"compositionupdate":Se="onCompositionUpdate";break e}Se=void 0}else Rl?fu(e,n)&&(Se="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Se="onCompositionStart");Se&&(ou&&n.locale!=="ko"&&(Rl||Se!=="onCompositionStart"?Se==="onCompositionEnd"&&Rl&&(ge=au()):(wn=L,nr="value"in wn?wn.value:wn.textContent,Rl=!0)),re=xi(C,Se),0<re.length&&(Se=new ru(Se,e,null,n,L),V.push({event:Se,listeners:re}),ge?Se.data=ge:(ge=mu(n),ge!==null&&(Se.data=ge)))),(ge=Nx?Sx(e,n):kx(e,n))&&(Se=xi(C,"onBeforeInput"),0<Se.length&&(re=new ru("onBeforeInput","beforeinput",null,n,L),V.push({event:re,listeners:Se}),re.data=ge)),xp(V,e,C,n,L)}Wf(V,t)})}function Wa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function xi(e,t){for(var n=t+"Capture",l=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=ya(e,n),s!=null&&l.unshift(Wa(e,s,r)),s=ya(e,t),s!=null&&l.push(Wa(e,s,r))),e.tag===3)return l;e=e.return}return[]}function yp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function em(e,t,n,l,s){for(var r=t._reactName,f=[];n!==null&&n!==l;){var x=n,b=x.alternate,C=x.stateNode;if(x=x.tag,b!==null&&b===l)break;x!==5&&x!==26&&x!==27||C===null||(b=C,s?(C=ya(n,r),C!=null&&f.unshift(Wa(n,C,b))):s||(C=ya(n,r),C!=null&&f.push(Wa(n,C,b)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var bp=/\r\n?/g,jp=/\u0000|\uFFFD/g;function tm(e){return(typeof e=="string"?e:""+e).replace(bp,`
|
|
49
|
+
`).replace(jp,"")}function nm(e,t){return t=tm(t),tm(e)===t}function De(e,t,n,l,s,r){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Al(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Al(e,""+l);break;case"className":ys(e,"class",l);break;case"tabIndex":ys(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ys(e,n,l);break;case"style":tu(e,l,r);break;case"data":if(t!=="object"){ys(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=js(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(n==="formAction"?(t!=="input"&&De(e,t,"name",s.name,s,null),De(e,t,"formEncType",s.formEncType,s,null),De(e,t,"formMethod",s.formMethod,s,null),De(e,t,"formTarget",s.formTarget,s,null)):(De(e,t,"encType",s.encType,s,null),De(e,t,"method",s.method,s,null),De(e,t,"target",s.target,s,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=js(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=an);break;case"onScroll":l!=null&&je("scroll",e);break;case"onScrollEnd":l!=null&&je("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(s.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=js(""+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":je("beforetoggle",e),je("toggle",e),gs(e,"popover",l);break;case"xlinkActuate":ln(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":ln(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":ln(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":ln(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":ln(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":ln(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":ln(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":ln(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":ln(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":gs(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=Jh.get(n)||n,gs(e,n,l))}}function qc(e,t,n,l,s,r){switch(n){case"style":tu(e,l,r);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(s.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof l=="string"?Al(e,l):(typeof l=="number"||typeof l=="bigint")&&Al(e,""+l);break;case"onScroll":l!=null&&je("scroll",e);break;case"onScrollEnd":l!=null&&je("scrollend",e);break;case"onClick":l!=null&&(e.onclick=an);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qo.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),r=e[ht]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,s),typeof l=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,s);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):gs(e,n,l)}}}function ct(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",e),je("load",e);var l=!1,s=!1,r;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case"src":l=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:De(e,t,r,f,n,null)}}s&&De(e,t,"srcSet",n.srcSet,n,null),l&&De(e,t,"src",n.src,n,null);return;case"input":je("invalid",e);var x=r=f=s=null,b=null,C=null;for(l in n)if(n.hasOwnProperty(l)){var L=n[l];if(L!=null)switch(l){case"name":s=L;break;case"type":f=L;break;case"checked":b=L;break;case"defaultChecked":C=L;break;case"value":r=L;break;case"defaultValue":x=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(o(137,t));break;default:De(e,t,l,L,n,null)}}Io(e,r,x,b,C,f,s,!1);return;case"select":je("invalid",e),l=f=r=null;for(s in n)if(n.hasOwnProperty(s)&&(x=n[s],x!=null))switch(s){case"value":r=x;break;case"defaultValue":f=x;break;case"multiple":l=x;default:De(e,t,s,x,n,null)}t=r,n=f,e.multiple=!!l,t!=null?Ml(e,!!l,t,!1):n!=null&&Ml(e,!!l,n,!0);return;case"textarea":je("invalid",e),r=s=l=null;for(f in n)if(n.hasOwnProperty(f)&&(x=n[f],x!=null))switch(f){case"value":l=x;break;case"defaultValue":s=x;break;case"children":r=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(o(91));break;default:De(e,t,f,x,n,null)}Po(e,l,s,r);return;case"option":for(b in n)if(n.hasOwnProperty(b)&&(l=n[b],l!=null))switch(b){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:De(e,t,b,l,n,null)}return;case"dialog":je("beforetoggle",e),je("toggle",e),je("cancel",e),je("close",e);break;case"iframe":case"object":je("load",e);break;case"video":case"audio":for(l=0;l<Ia.length;l++)je(Ia[l],e);break;case"image":je("error",e),je("load",e);break;case"details":je("toggle",e);break;case"embed":case"source":case"link":je("error",e),je("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(C in n)if(n.hasOwnProperty(C)&&(l=n[C],l!=null))switch(C){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:De(e,t,C,l,n,null)}return;default:if(Ii(t)){for(L in n)n.hasOwnProperty(L)&&(l=n[L],l!==void 0&&qc(e,t,L,l,n,void 0));return}}for(x in n)n.hasOwnProperty(x)&&(l=n[x],l!=null&&De(e,t,x,l,n,null))}function Np(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 s=null,r=null,f=null,x=null,b=null,C=null,L=null;for(U in n){var V=n[U];if(n.hasOwnProperty(U)&&V!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":b=V;default:l.hasOwnProperty(U)||De(e,t,U,null,l,V)}}for(var D in l){var U=l[D];if(V=n[D],l.hasOwnProperty(D)&&(U!=null||V!=null))switch(D){case"type":r=U;break;case"name":s=U;break;case"checked":C=U;break;case"defaultChecked":L=U;break;case"value":f=U;break;case"defaultValue":x=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(o(137,t));break;default:U!==V&&De(e,t,D,U,l,V)}}Ji(e,f,x,b,C,L,r,s);return;case"select":U=f=x=D=null;for(r in n)if(b=n[r],n.hasOwnProperty(r)&&b!=null)switch(r){case"value":break;case"multiple":U=b;default:l.hasOwnProperty(r)||De(e,t,r,null,l,b)}for(s in l)if(r=l[s],b=n[s],l.hasOwnProperty(s)&&(r!=null||b!=null))switch(s){case"value":D=r;break;case"defaultValue":x=r;break;case"multiple":f=r;default:r!==b&&De(e,t,s,r,l,b)}t=x,n=f,l=U,D!=null?Ml(e,!!n,D,!1):!!l!=!!n&&(t!=null?Ml(e,!!n,t,!0):Ml(e,!!n,n?[]:"",!1));return;case"textarea":U=D=null;for(x in n)if(s=n[x],n.hasOwnProperty(x)&&s!=null&&!l.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:De(e,t,x,null,l,s)}for(f in l)if(s=l[f],r=n[f],l.hasOwnProperty(f)&&(s!=null||r!=null))switch(f){case"value":D=s;break;case"defaultValue":U=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(o(91));break;default:s!==r&&De(e,t,f,s,l,r)}Wo(e,D,U);return;case"option":for(var ie in n)if(D=n[ie],n.hasOwnProperty(ie)&&D!=null&&!l.hasOwnProperty(ie))switch(ie){case"selected":e.selected=!1;break;default:De(e,t,ie,null,l,D)}for(b in l)if(D=l[b],U=n[b],l.hasOwnProperty(b)&&D!==U&&(D!=null||U!=null))switch(b){case"selected":e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:De(e,t,b,D,l,U)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var me in n)D=n[me],n.hasOwnProperty(me)&&D!=null&&!l.hasOwnProperty(me)&&De(e,t,me,null,l,D);for(C in l)if(D=l[C],U=n[C],l.hasOwnProperty(C)&&D!==U&&(D!=null||U!=null))switch(C){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(o(137,t));break;default:De(e,t,C,D,l,U)}return;default:if(Ii(t)){for(var Oe in n)D=n[Oe],n.hasOwnProperty(Oe)&&D!==void 0&&!l.hasOwnProperty(Oe)&&qc(e,t,Oe,void 0,l,D);for(L in l)D=l[L],U=n[L],!l.hasOwnProperty(L)||D===U||D===void 0&&U===void 0||qc(e,t,L,D,l,U);return}}for(var _ in n)D=n[_],n.hasOwnProperty(_)&&D!=null&&!l.hasOwnProperty(_)&&De(e,t,_,null,l,D);for(V in l)D=l[V],U=n[V],!l.hasOwnProperty(V)||D===U||D==null&&U==null||De(e,t,V,D,l,U)}function lm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Sp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var s=n[l],r=s.transferSize,f=s.initiatorType,x=s.duration;if(r&&x&&lm(f)){for(f=0,x=s.responseEnd,l+=1;l<n.length;l++){var b=n[l],C=b.startTime;if(C>x)break;var L=b.transferSize,V=b.initiatorType;L&&lm(V)&&(b=b.responseEnd,f+=L*(b<x?1:(x-C)/(b-C)))}if(--l,t+=8*(r+f)/(s.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 Bc=null,Lc=null;function pi(e){return e.nodeType===9?e:e.ownerDocument}function am(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 sm(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 Hc(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 $c=null;function kp(){var e=window.event;return e&&e.type==="popstate"?e===$c?!1:($c=e,!0):($c=null,!1)}var im=typeof setTimeout=="function"?setTimeout:void 0,_p=typeof clearTimeout=="function"?clearTimeout:void 0,rm=typeof Promise=="function"?Promise:void 0,Ep=typeof queueMicrotask=="function"?queueMicrotask:typeof rm<"u"?function(e){return rm.resolve(null).then(e).catch(Tp)}:im;function Tp(e){setTimeout(function(){throw e})}function Vn(e){return e==="head"}function cm(e,t){var n=t,l=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(s),ra(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Pa(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Pa(n);for(var r=n.firstChild;r;){var f=r.nextSibling,x=r.nodeName;r[va]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=f}}else n==="body"&&Pa(e.ownerDocument.body);n=s}while(n);ra(t)}function om(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 Gc(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":Gc(n),Zi(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function wp(e,t,n,l){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[va])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Ht(e.nextSibling),e===null)break}return null}function Mp(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ht(e.nextSibling),e===null))return null;return e}function um(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ht(e.nextSibling),e===null))return null;return e}function Yc(e){return e.data==="$?"||e.data==="$~"}function Xc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ap(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 Ht(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 Vc=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 Ht(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function fm(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 mm(e,t,n){switch(t=pi(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 Pa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Zi(e)}var $t=new Map,hm=new Set;function vi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var jn=H.d;H.d={f:Cp,r:zp,D:Rp,C:Dp,L:Op,m:Up,X:Bp,S:qp,M:Lp};function Cp(){var e=jn.f(),t=ci();return e||t}function zp(e){var t=El(e);t!==null&&t.tag===5&&t.type==="form"?Ad(t):jn.r(e)}var aa=typeof document>"u"?null:document;function xm(e,t,n){var l=aa;if(l&&typeof t=="string"&&t){var s=Rt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),hm.has(s)||(hm.add(s),e={rel:e,crossOrigin:n,href:t},l.querySelector(s)===null&&(t=l.createElement("link"),ct(t,"link",e),et(t),l.head.appendChild(t)))}}function Rp(e){jn.D(e),xm("dns-prefetch",e,null)}function Dp(e,t){jn.C(e,t),xm("preconnect",e,t)}function Op(e,t,n){jn.L(e,t,n);var l=aa;if(l&&e&&t){var s='link[rel="preload"][as="'+Rt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+Rt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+Rt(n.imageSizes)+'"]')):s+='[href="'+Rt(e)+'"]';var r=s;switch(t){case"style":r=sa(e);break;case"script":r=ia(e)}$t.has(r)||(e=k({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),$t.set(r,e),l.querySelector(s)!==null||t==="style"&&l.querySelector(es(r))||t==="script"&&l.querySelector(ts(r))||(t=l.createElement("link"),ct(t,"link",e),et(t),l.head.appendChild(t)))}}function Up(e,t){jn.m(e,t);var n=aa;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Rt(l)+'"][href="'+Rt(e)+'"]',r=s;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=ia(e)}if(!$t.has(r)&&(e=k({rel:"modulepreload",href:e},t),$t.set(r,e),n.querySelector(s)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ts(r)))return}l=n.createElement("link"),ct(l,"link",e),et(l),n.head.appendChild(l)}}}function qp(e,t,n){jn.S(e,t,n);var l=aa;if(l&&e){var s=Tl(l).hoistableStyles,r=sa(e);t=t||"default";var f=s.get(r);if(!f){var x={loading:0,preload:null};if(f=l.querySelector(es(r)))x.loading=5;else{e=k({rel:"stylesheet",href:e,"data-precedence":t},n),(n=$t.get(r))&&Qc(e,n);var b=f=l.createElement("link");et(b),ct(b,"link",e),b._p=new Promise(function(C,L){b.onload=C,b.onerror=L}),b.addEventListener("load",function(){x.loading|=1}),b.addEventListener("error",function(){x.loading|=2}),x.loading|=4,gi(f,t,l)}f={type:"stylesheet",instance:f,count:1,state:x},s.set(r,f)}}}function Bp(e,t){jn.X(e,t);var n=aa;if(n&&e){var l=Tl(n).hoistableScripts,s=ia(e),r=l.get(s);r||(r=n.querySelector(ts(s)),r||(e=k({src:e,async:!0},t),(t=$t.get(s))&&Zc(e,t),r=n.createElement("script"),et(r),ct(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},l.set(s,r))}}function Lp(e,t){jn.M(e,t);var n=aa;if(n&&e){var l=Tl(n).hoistableScripts,s=ia(e),r=l.get(s);r||(r=n.querySelector(ts(s)),r||(e=k({src:e,async:!0,type:"module"},t),(t=$t.get(s))&&Zc(e,t),r=n.createElement("script"),et(r),ct(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},l.set(s,r))}}function pm(e,t,n,l){var s=(s=se.current)?vi(s):null;if(!s)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=sa(n.href),n=Tl(s).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=sa(n.href);var r=Tl(s).hoistableStyles,f=r.get(e);if(f||(s=s.ownerDocument||s,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,f),(r=s.querySelector(es(e)))&&!r._p&&(f.instance=r,f.state.loading=5),$t.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},$t.set(e,n),r||Hp(s,e,n,f.state))),t&&l===null)throw Error(o(528,""));return f}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=ia(n),n=Tl(s).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 sa(e){return'href="'+Rt(e)+'"'}function es(e){return'link[rel="stylesheet"]['+e+"]"}function vm(e){return k({},e,{"data-precedence":e.precedence,precedence:null})}function Hp(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}),ct(t,"link",n),et(t),e.head.appendChild(t))}function ia(e){return'[src="'+Rt(e)+'"]'}function ts(e){return"script[async]"+e}function gm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Rt(n.href)+'"]');if(l)return t.instance=l,et(l),l;var s=k({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),et(l),ct(l,"style",s),gi(l,n.precedence,e),t.instance=l;case"stylesheet":s=sa(n.href);var r=e.querySelector(es(s));if(r)return t.state.loading|=4,t.instance=r,et(r),r;l=vm(n),(s=$t.get(s))&&Qc(l,s),r=(e.ownerDocument||e).createElement("link"),et(r);var f=r;return f._p=new Promise(function(x,b){f.onload=x,f.onerror=b}),ct(r,"link",l),t.state.loading|=4,gi(r,n.precedence,e),t.instance=r;case"script":return r=ia(n.src),(s=e.querySelector(ts(r)))?(t.instance=s,et(s),s):(l=n,(s=$t.get(r))&&(l=k({},n),Zc(l,s)),e=e.ownerDocument||e,s=e.createElement("script"),et(s),ct(s,"link",l),e.head.appendChild(s),t.instance=s);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,gi(l,n.precedence,e));return t.instance}function gi(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=l.length?l[l.length-1]:null,r=s,f=0;f<l.length;f++){var x=l[f];if(x.dataset.precedence===t)r=x;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Qc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Zc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var yi=null;function ym(e,t,n){if(yi===null){var l=new Map,s=yi=new Map;s.set(n,l)}else s=yi,l=s.get(n),l||(l=new Map,s.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var r=n[s];if(!(r[va]||r[at]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var f=r.getAttribute(t)||"";f=e+f;var x=l.get(f);x?x.push(r):l.set(f,[r])}}return l}function bm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function $p(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 jm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Gp(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 s=sa(l.href),r=t.querySelector(es(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=bi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,et(r);return}r=t.ownerDocument||t,l=vm(l),(s=$t.get(s))&&Qc(l,s),r=r.createElement("link"),et(r);var f=r;f._p=new Promise(function(x,b){f.onload=x,f.onerror=b}),ct(r,"link",l),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=bi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Kc=0;function Yp(e,t){return e.stylesheets&&e.count===0&&Ni(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Ni(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Kc===0&&(Kc=62500*Sp());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ni(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Kc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(s)}}:null}function bi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ni(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ji=null;function Ni(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ji=new Map,t.forEach(Xp,e),ji=null,bi.call(e))}function Xp(e,t){if(!(t.state.loading&4)){var n=ji.get(e);if(n)var l=n.get(null);else{n=new Map,ji.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var f=s[r];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),l=f)}l&&n.set(null,l)}s=t.instance,f=s.getAttribute("data-precedence"),r=n.get(f)||l,r===l&&n.set(null,s),n.set(f,s),this.count++,l=bi.bind(this),s.addEventListener("load",l),s.addEventListener("error",l),r?r.parentNode.insertBefore(s,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var ns={$$typeof:P,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function Vp(e,t,n,l,s,r,f,x,b){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=Yi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yi(0),this.hiddenUpdates=Yi(null),this.identifierPrefix=l,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function Nm(e,t,n,l,s,r,f,x,b,C,L,V){return e=new Vp(e,t,n,f,b,C,L,V,x),t=1,r===!0&&(t|=24),r=_t(3,null,null,t),e.current=r,r.stateNode=e,t=Tr(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:l,isDehydrated:n,cache:t},Cr(r),e}function Sm(e){return e?(e=ql,e):ql}function km(e,t,n,l,s,r){s=Sm(s),l.context===null?l.context=s:l.pendingContext=s,l=Dn(t),l.payload={element:n},r=r===void 0?null:r,r!==null&&(l.callback=r),n=On(e,l,t),n!==null&&(bt(n,e,t),Da(n,e,t))}function _m(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Jc(e,t){_m(e,t),(e=e.alternate)&&_m(e,t)}function Em(e){if(e.tag===13||e.tag===31){var t=sl(e,67108864);t!==null&&bt(t,e,67108864),Jc(e,67108864)}}function Tm(e){if(e.tag===13||e.tag===31){var t=At();t=Xi(t);var n=sl(e,t);n!==null&&bt(n,e,t),Jc(e,t)}}var Si=!0;function Qp(e,t,n,l){var s=w.T;w.T=null;var r=H.p;try{H.p=2,Fc(e,t,n,l)}finally{H.p=r,w.T=s}}function Zp(e,t,n,l){var s=w.T;w.T=null;var r=H.p;try{H.p=8,Fc(e,t,n,l)}finally{H.p=r,w.T=s}}function Fc(e,t,n,l){if(Si){var s=Ic(l);if(s===null)Uc(e,t,l,ki,n),Mm(e,l);else if(Jp(s,e,t,n,l))l.stopPropagation();else if(Mm(e,l),t&4&&-1<Kp.indexOf(e)){for(;s!==null;){var r=El(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var f=el(r.pendingLanes);if(f!==0){var x=r;for(x.pendingLanes|=2,x.entangledLanes|=2;f;){var b=1<<31-St(f);x.entanglements[1]|=b,f&=~b}It(r),(we&6)===0&&(ii=lt()+500,Fa(0))}}break;case 31:case 13:x=sl(r,2),x!==null&&bt(x,r,2),ci(),Jc(r,2)}if(r=Ic(l),r===null&&Uc(e,t,l,ki,n),r===s)break;s=r}s!==null&&l.stopPropagation()}else Uc(e,t,l,null,n)}}function Ic(e){return e=Pi(e),Wc(e)}var ki=null;function Wc(e){if(ki=null,e=_l(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=v(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 ki=e,null}function wm(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(ut()){case ma:return 2;case Pn:return 8;case ms:case Dh:return 32;case qo:return 268435456;default:return 32}default:return 32}}var Pc=!1,Qn=null,Zn=null,Kn=null,ls=new Map,as=new Map,Jn=[],Kp="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 Mm(e,t){switch(e){case"focusin":case"focusout":Qn=null;break;case"dragenter":case"dragleave":Zn=null;break;case"mouseover":case"mouseout":Kn=null;break;case"pointerover":case"pointerout":ls.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":as.delete(t.pointerId)}}function ss(e,t,n,l,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:r,targetContainers:[s]},t!==null&&(t=El(t),t!==null&&Em(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Jp(e,t,n,l,s){switch(t){case"focusin":return Qn=ss(Qn,e,t,n,l,s),!0;case"dragenter":return Zn=ss(Zn,e,t,n,l,s),!0;case"mouseover":return Kn=ss(Kn,e,t,n,l,s),!0;case"pointerover":var r=s.pointerId;return ls.set(r,ss(ls.get(r)||null,e,t,n,l,s)),!0;case"gotpointercapture":return r=s.pointerId,as.set(r,ss(as.get(r)||null,e,t,n,l,s)),!0}return!1}function Am(e){var t=_l(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=v(n),t!==null){e.blockedOn=t,Yo(e.priority,function(){Tm(n)});return}}else if(t===31){if(t=h(n),t!==null){e.blockedOn=t,Yo(e.priority,function(){Tm(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 _i(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ic(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Wi=l,n.target.dispatchEvent(l),Wi=null}else return t=El(n),t!==null&&Em(t),e.blockedOn=n,!1;t.shift()}return!0}function Cm(e,t,n){_i(e)&&n.delete(t)}function Fp(){Pc=!1,Qn!==null&&_i(Qn)&&(Qn=null),Zn!==null&&_i(Zn)&&(Zn=null),Kn!==null&&_i(Kn)&&(Kn=null),ls.forEach(Cm),as.forEach(Cm)}function Ei(e,t){e.blockedOn===t&&(e.blockedOn=null,Pc||(Pc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Fp)))}var Ti=null;function zm(e){Ti!==e&&(Ti=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Ti===e&&(Ti=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],s=e[t+2];if(typeof l!="function"){if(Wc(l||n)===null)continue;break}var r=El(n);r!==null&&(e.splice(t,3),t-=3,Ir(r,{pending:!0,data:s,method:n.method,action:l},l,s))}}))}function ra(e){function t(b){return Ei(b,e)}Qn!==null&&Ei(Qn,e),Zn!==null&&Ei(Zn,e),Kn!==null&&Ei(Kn,e),ls.forEach(t),as.forEach(t);for(var n=0;n<Jn.length;n++){var l=Jn[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Jn.length&&(n=Jn[0],n.blockedOn===null);)Am(n),n.blockedOn===null&&Jn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var s=n[l],r=n[l+1],f=s[ht]||null;if(typeof r=="function")f||zm(n);else if(f){var x=null;if(r&&r.hasAttribute("formAction")){if(s=r,f=r[ht]||null)x=f.formAction;else if(Wc(s)!==null)continue}else x=f.action;typeof x=="function"?n[l+1]=x:(n.splice(l,3),l-=3),zm(n)}}}function Rm(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(f){return s=f})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,s=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),s!==null&&(s(),s=null)}}}function eo(e){this._internalRoot=e}wi.prototype.render=eo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=At();km(n,l,e,t,null,null)},wi.prototype.unmount=eo.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),ci(),t[kl]=null}};function wi(e){this._internalRoot=e}wi.prototype.unstable_scheduleHydration=function(e){if(e){var t=Go();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Jn.length&&t!==0&&t<Jn[n].priority;n++);Jn.splice(n,0,e),n===0&&Am(e)}};var Dm=c.version;if(Dm!=="19.2.6")throw Error(o(527,Dm,"19.2.6"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Ip={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:w,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mi.isDisabled&&Mi.supportsFiber)try{ha=Mi.inject(Ip),Nt=Mi}catch{}}return rs.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,l="",s=Hd,r=$d,f=Gd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=Nm(e,1,!1,null,null,n,l,null,s,r,f,Rm),e[kl]=t.current,Oc(e),new eo(t)},rs.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var l=!1,s="",r=Hd,f=$d,x=Gd,b=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError),n.formState!==void 0&&(b=n.formState)),t=Nm(e,1,!0,t,n??null,l,s,b,r,f,x,Rm),t.context=Sm(null),n=t.current,l=At(),l=Xi(l),s=Dn(l),s.callback=null,On(n,s,l),n=l,t.current.lanes=n,pa(t,n),It(t),e[kl]=t.current,Oc(e),new wi(t)},rs.version="19.2.6",rs}var Xm;function ov(){if(Xm)return lo.exports;Xm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),lo.exports=cv(),lo.exports}var uv=ov();const bl="/dashboard";function Vm(){const i=window.location.pathname;return i===bl||i===bl+"/"?"/":i.startsWith(bl+"/")?i.slice(bl.length):i||"/"}function Sn(i){return i==="/"||i===""?bl+"/":bl+(i.startsWith("/")?i:"/"+i)}function us(i){const c=Sn(i);c!==window.location.pathname+window.location.search&&window.history.pushState({},"",c),window.dispatchEvent(new Event("dashboard:navigate"))}typeof document<"u"&&!window.__dashboardRouterInstalled&&(window.__dashboardRouterInstalled=!0,document.addEventListener("click",i=>{var o,d;if(i.defaultPrevented||i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;const c=(d=(o=i.target)==null?void 0:o.closest)==null?void 0:d.call(o,"a");if(!c)return;const u=c.getAttribute("href");u&&(c.hasAttribute("target")||c.hasAttribute("download")||u.startsWith(bl)&&(i.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 ph(){const[i,c]=N.useState(Vm());return N.useEffect(()=>{const u=()=>c(Vm());return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),i}function dv(i){let c=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");c=c.replace(/```(\w*)\n?([\s\S]*?)```/g,(m,v,h)=>`<pre class="md-code-block"><code>${h.trimEnd()}</code></pre>`),c=c.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),c=c.replace(/\*\*([^*\n]+)\*\*/g,"<strong>$1</strong>"),c=c.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const u=c.split(`
|
|
50
|
+
`),o=[];let d=!1;for(let m=0;m<u.length;m++){const v=u[m],h=v.match(/^###\s+(.+)$/),p=v.match(/^##\s+(.+)$/),g=v.match(/^#\s+(.+)$/);if(h){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${h[1]}</h3>`);continue}if(p){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${p[1]}</h2>`);continue}if(g){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${g[1]}</h1>`);continue}const y=v.match(/^(\s*)[*-]\s+(.+)$/);if(y){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${y[2]}</li>`);continue}if(v.trim()===""){d&&(o.push("</ul>"),d=!1),o.push("");continue}d&&(o.push("</ul>"),d=!1),o.push(v)}return d&&o.push("</ul>"),o.join(`
|
|
51
|
+
`)}function Hi(i){let c=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");c=c.replace(/^\[(FINDING|SUGGESTION|INSIGHT)\]\s*/i,""),c=c.replace(/<agent_finding[^&]*>/g,""),c=c.replace(/<\/agent_finding>/g,""),c=c.replace(/<cite\s+tag="file">([^&]+)<\/cite>/g,'<code class="cite-file">$1</code>'),c=c.replace(/<cite\s+tag="fn">([^&]+)<\/cite>/g,'<code class="cite-fn">$1</code>'),c=c.replace(/<fn>([^&]+)<\/fn>/g,'<code class="cite-fn">$1</code>'),c=c.replace(/```(\w*)\n?([\s\S]*?)```/g,'<pre class="md-code-block"><code>$2</code></pre>'),c=c.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),c=c.replace(/\*\*([^*\n]+)\*\*/g,'<strong class="font-semibold text-foreground">$1</strong>'),c=c.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const u=c.split(`
|
|
52
|
+
`),o=[];let d=!1;for(const m of u){const v=m.match(/^###\s+(.+)$/),h=m.match(/^##\s+(.+)$/),p=m.match(/^#\s+(.+)$/);if(v){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${v[1]}</h3>`);continue}if(h){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${h[1]}</h2>`);continue}if(p){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${p[1]}</h1>`);continue}const g=m.match(/^(\s*)[*-]\s+(.+)$/);if(g){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${g[2]}</li>`);continue}if(m.trim()===""){d&&(o.push("</ul>"),d=!1),o.push("");continue}d&&(o.push("</ul>"),d=!1),o.push(m)}return d&&o.push("</ul>"),o.join(`
|
|
53
|
+
`)}function Pe(i){const c=Date.now(),u=typeof i=="string"?new Date(i).getTime():i,o=Math.max(0,Math.floor((c-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 fv(i){if(!i)return"—";const c=Math.round(i/1e3);return c<60?c+"s":Math.floor(c/60)+"m "+c%60+"s"}function bo(i){const c=i.split("-").filter(Boolean);return c.length>=2?(c[0][0]+c[1][0]).toUpperCase():(c[0]||i).slice(0,2).toUpperCase()}const Qm=["#3F8B86","#8C5E97","#B47A2A","#2F7D5B","#A53A4A","#6B6862","#C8A45A"],Zm={"sonnet-reviewer":"#8C5E97","sonnet-designer":"#C8A45A","sonnet-implementer":"#A53A4A","opus-implementer":"#C97056","gemini-reviewer":"#3F8B86","gemini-tester":"#2F7D5B","haiku-researcher":"#6B7A85"};function en(i){if(Zm[i])return Zm[i];let c=0;for(let u=0;u<i.length;u++)c=c*31+i.charCodeAt(u)>>>0;return Qm[c%Qm.length]}function fa({title:i,hint:c,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:i}),c&&a.jsx("div",{className:"mt-1 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:c})]})}function mv(i){return i==null||i<=0?"—":i<1e3?`${i}ms`:i<6e4?`${(i/1e3).toFixed(1)}s`:`${(i/6e4).toFixed(1)}m`}function gl({value:i,unit:c,label:u,valueClass:o="",valueColor:d,pulse:m,tooltip:v}){return a.jsxs("div",{className:"flex flex-col items-center py-4 px-3 text-center","data-tooltip":v,children:[a.jsxs("div",{className:"flex items-baseline gap-1",children:[m&&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:i}),c&&a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--ink-3)"},children:c})]}),a.jsx("div",{className:"h-section mt-1.5",style:{color:"var(--ink-3)",fontSize:"10px"},children:u})]})}function hv({overview:i,activeTasks:c,mode:u="dense",showActivity:o}){const d=i.relayCount+i.nativeCount,m=i.tasksCompleted+i.tasksFailed>0?Math.round(i.tasksCompleted/(i.tasksCompleted+i.tasksFailed)*100):null,v=i.totalFindings>0?Math.round(i.confirmedFindings/i.totalFindings*100):0,h=u==="calm",p=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(fa,{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(gl,{value:i.agentsOnline,label:"Agents Working",valueColor:i.agentsOnline>0?"var(--ok)":"var(--text)"})}),a.jsx("div",{className:"border-r border-border",children:a.jsx(gl,{value:c,label:"Active Tasks",valueClass:c>0?"text-unverified":"",valueColor:c>0?void 0:"var(--ink-3)",pulse:c>0})}),a.jsx(gl,{value:`${v}%`,label:"Confirmed",valueClass:v>=50?"text-confirmed":v>0?"text-unverified":"",valueColor:v===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:i.agentsOnline>0?"var(--ok)":"var(--text)"},children:i.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 ${i.relayConnected>0?"text-confirmed":""}`,style:i.relayConnected>0?void 0:{color:"var(--ink-3)"},children:i.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(gl,{value:c,label:"Active Tasks",valueClass:c>0?"text-unverified":"",valueColor:c>0?void 0:"var(--ink-3)",pulse:c>0}),a.jsx(gl,{value:i.consensusRuns,label:"Consensus",valueColor:"var(--text)"}),a.jsx(gl,{value:`${v}%`,label:"Confirmed",valueClass:"text-confirmed"})]}),a.jsx("a",{href:Sn("/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(gl,{value:i.actionableFindings,label:"Actionable",valueClass:i.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:i.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:i.totalSignals})]}),i.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:i.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:mv(i.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 ${m!==null&&m>=95?"text-confirmed":m!==null&&m>=80?"text-unverified":m!==null?"text-bad":""}`,style:m===null?{color:"var(--ink-3)"}:void 0,children:m===null?"—":`${m}%`})]})]}),p&&a.jsx(xv,{hourly:i.hourlyActivity||[]}),i.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 ",Pe(i.lastConsensusTimestamp)]})]})}function xv({hourly:i}){const c=i.length===12?i:new Array(12).fill(0),u=Math.max(1,...c);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:c.map((o,d)=>{const m=11-d,v=o/u*100,h=d===11,p=m===0?"last hour":`${m}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,v)}%`},"data-tooltip":`${p}
|
|
54
|
+
${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 tn=24;function pv(i,c){const u=new Map;for(const o of c)u.set(o.id,new Array(tn).fill(0));for(const o of(i==null?void 0:i.agents)??[]){const d=u.get(o.id);if(!d)continue;const m=o.buckets??[];for(let v=0;v<tn;v++)d[v]=m[v]??0}return u}function vv(i,c){if(c<=0||i<=0)return 0;const u=i/c;return u<.18?1:u<.4?2:u<.68?3:4}const gv={0:.18,1:.35,2:.55,3:.78,4:1};function yv({agents:i,activity:c,loading:u=!1,error:o=null}){const d=N.useMemo(()=>pv(c,i),[c,i]),m=N.useMemo(()=>{const h=new Map;for(const[p,g]of d)h.set(p,g.reduce((y,k)=>y+k,0));return h},[d]),v=N.useMemo(()=>{let h=0;for(const p of m.values())h+=p;return h},[m]);if(u&&i.length===0)return a.jsx(Ai,{error:null,fleetTotal:null,children:Array.from({length:4}).map((h,p)=>a.jsx(bv,{},p))});if(i.length===0)return a.jsx(Ai,{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(v===0){const h=c==null?"Activity data unavailable — relay may be disconnected. Showing idle rows from the agent registry.":"No active dispatches — fleet idle.";return a.jsxs(Ai,{error:o,fleetTotal:0,children:[i.map(p=>a.jsx(jv,{agent:p},p.id)),a.jsx("div",{className:"px-5 py-3 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:h})]})}return a.jsx(Ai,{error:o,fleetTotal:v,children:i.map(h=>{const p=d.get(h.id)??new Array(tn).fill(0),g=Math.max(0,...p),y=m.get(h.id)??0,k=v>0?Math.round(y/v*100):0,R=en(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:R}}),a.jsx("span",{className:"truncate",children:h.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${tn}, 1fr)`},role:"img","aria-label":`${h.id} 24h activity — ${y} signals`,children:p.map((X,O)=>{const G=vv(X,g);return a.jsx("div",{className:"rounded-sm",title:`hour ${O}: ${X} signal${X===1?"":"s"}`,style:{background:G===0?"var(--surface-sunk)":R,opacity:gv[G]}},O)})}),a.jsxs("div",{className:"text-right font-mono text-[12px] tabular-nums",style:{color:"var(--ink)"},children:[y,a.jsxs("span",{className:"ml-1.5 text-[11px]",style:{color:"var(--ink-3)"},children:[k,"%"]})]})]},h.id)})})}function Ai({children:i,error:c,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(${tn}, 1fr)`,color:"var(--ink-3)"},children:Array.from({length:tn}).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:c?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:c}):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})]}),i]})}function bv(){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(${tn}, 1fr)`},children:Array.from({length:tn}).map((i,c)=>a.jsx("div",{className:"rounded-sm",style:{background:"var(--border)",opacity:.4}},c))}),a.jsx("div",{className:"ml-auto h-3 w-12 rounded",style:{background:"var(--border)",opacity:.4}})]})}function jv({agent:i}){const c=en(i.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:c,opacity:.5}}),a.jsx("span",{className:"truncate",children:i.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${tn}, 1fr)`},children:Array.from({length:tn}).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 Co="/dashboard/api",vh="unauthorized";function Nv(i){return i instanceof Error&&i.message.includes(vh)}const Bi=3e4;function gh(i){return`timeout after ${i/1e3}s`}function zo(i){if(typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function")return{signal:AbortSignal.timeout(i),cleanup:()=>{}};const c=new AbortController,u=setTimeout(()=>c.abort(new Error(gh(i))),i);return{signal:c.signal,cleanup:()=>clearTimeout(u)}}async function We(i,c){const{signal:u,cleanup:o}=zo(Bi);try{const d=await fetch(`${Co}/${i}`,{credentials:"include",...c,signal:u});if(d.status===401)throw new Error(vh);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(gh(Bi)):d}finally{o()}}async function Sv(i){const{signal:c,cleanup:u}=zo(Bi);try{const o=await fetch(`${Co}/auth`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:i}),signal:c});return o.ok?await jo()?{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 jo(){const{signal:i,cleanup:c}=zo(Bi);try{return(await fetch(`${Co}/auth/check`,{credentials:"include",signal:i})).ok}catch{return!1}finally{c()}}const kv=7200*1e3;function _v(i){const c=Date.now()-new Date(i).getTime();return c<0?"0s":c<6e4?`${Math.floor(c/1e3)}s`:c<36e5?`${Math.floor(c/6e4)}m ${Math.floor(c%6e4/1e3)}s`:`${Math.floor(c/36e5)}h ${Math.floor(c%36e5/6e4)}m`}function Ev({onCountChange:i}){const[c,u]=N.useState([]),[,o]=N.useState(0);N.useEffect(()=>{let h=!1;const p=async()=>{var y;try{const k=await We("active-tasks");h||(u(k.tasks||[]),i==null||i(((y=k.tasks)==null?void 0:y.length)||0))}catch{}};p();const g=setInterval(p,5e3);return()=>{h=!0,clearInterval(g)}},[i]),N.useEffect(()=>{if(c.length===0)return;const h=setInterval(()=>o(p=>p+1),1e3);return()=>clearInterval(h)},[c.length]);const d=Date.now(),m=c.filter(h=>d-new Date(h.startedAt).getTime()<kv),v=c.length-m.length;return m.length===0?v===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:[v," stale task",v===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:[m.length," active"]}),v>0&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:["· ",v," stale"]})]}),a.jsx("div",{className:"max-h-40 space-y-1 overflow-y-auto",children:m.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:_v(h.startedAt)})]},h.taskId))})]})}function Tv(i,c,u,o){const d=Math.max(0,Math.min(.9999,o)),m=-Math.PI/2,v=m+d*2*Math.PI,h=i+u*Math.cos(m),p=c+u*Math.sin(m),g=i+u*Math.cos(v),y=c+u*Math.sin(v),k=d>.5?1:0;return`M ${h.toFixed(2)} ${p.toFixed(2)} A ${u} ${u} 0 ${k} 1 ${g.toFixed(2)} ${y.toFixed(2)}`}function wv(i,c,u){return`M ${i} ${c-u} A ${u} ${u} 0 1 1 ${i} ${c+u} A ${u} ${u} 0 1 1 ${i} ${c-u}`}function Mv({accuracy:i,size:c=90,color:u="var(--ink)"}){const o=Number.isFinite(i)?Math.max(0,Math.min(1,i)):0,d=c/2,m=c/2,v=c*.089,h=(c-v)/2-2,p=Math.round(o*100),g=Math.round(c*.22);return a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[a.jsxs("svg",{width:c,height:c,viewBox:`0 0 ${c} ${c}`,role:"img","aria-label":`Accuracy ${p}%`,children:[a.jsx("path",{d:wv(d,m,h),fill:"none",stroke:"var(--ink)",strokeOpacity:.08,strokeWidth:v,strokeLinecap:"round"}),o>0&&a.jsx("path",{d:Tv(d,m,h,o),fill:"none",stroke:u,strokeWidth:v,strokeLinecap:"round"}),a.jsxs("text",{x:d,y:m,textAnchor:"middle",dominantBaseline:"middle",dy:"0.08em",fill:"var(--ink)",style:{fontSize:g,fontFamily:"'Fraunces', serif",fontVariantNumeric:"tabular-nums",fontWeight:700},children:[p,"%"]})]}),a.jsx("span",{style:{fontSize:10,color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},children:"accuracy"})]})}const Km={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--idle)"},Jm=["critical","high","medium","low"];function Av({counts:i,height:c=10}){const u=i??{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:c,borderRadius:c/2,overflow:"hidden",gap:2,border:"1px solid color-mix(in oklch, var(--border) 60%, transparent)",width:"100%"},children:Jm.map(m=>a.jsx("div",{style:{flex:1,background:Km[m],opacity:.4}},m))}):a.jsx("div",{role:"img","aria-label":`Severity distribution — ${d}`,title:d,style:{display:"flex",height:c,borderRadius:c/2,overflow:"hidden",width:"100%"},children:Jm.map(m=>{const v=u[m];if(v===0)return null;const h=v/o*100;return a.jsx("div",{style:{width:`${h.toFixed(2)}%`,background:Km[m],flexShrink:0}},m)})})}function Cv(i){return i.map(c=>c.signals)}function zv(i,c,u){if(i.length===0)return{line:`M 0 ${u} L ${c} ${u}`,area:""};if(i.length===1){const p=u/2;return{line:`M 0 ${p} L ${c} ${p}`,area:`M 0 ${u} L 0 ${p} L ${c} ${p} L ${c} ${u} Z`}}const o=Math.max(...i,1),d=c/(i.length-1),m=i.map((p,g)=>{const y=(g*d).toFixed(2),k=(u-p/o*u).toFixed(2);return`${y},${k}`}),v=`M ${m.join(" L ")}`,h=`M 0,${u} L ${m.join(" L ")} L ${((i.length-1)*d).toFixed(2)},${u} Z`;return{line:v,area:h}}const Rv=5,No=999;function Dv(i){if(i.length<2)return null;const c=Math.floor(i.length/2),u=i.slice(0,c),o=i.slice(i.length-c),d=y=>y.reduce((k,R)=>k+R.signals,0),m=d(u),v=d(o);if(m<Rv)return null;const h=m/u.length,p=v/o.length,g=Math.round((p-h)/h*100);return Math.max(-No,Math.min(No,g))}function Ov({points:i,width:c=80,height:u=20,reducedMotion:o=!1,color:d="var(--c1)"}){const m=N.useMemo(()=>Cv(i),[i]),{line:v,area:h}=N.useMemo(()=>zv(m,c,u),[m,c,u]),p=N.useMemo(()=>Dv(i),[i]),g=m.length===0||m.every(y=>y===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 ${c} ${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:v,fill:"none",stroke:g?"var(--idle)":d,strokeOpacity:g?.3:1,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),p!==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:[p>=0?"+":"",p,"%",Math.abs(p)>=No?"+":""]})]})}function Ro(i){var c,u;return((c=i.bench)==null?void 0:c.state)==="benched"?"benched":i.circuitOpen?"struggling":((u=i.bench)==null?void 0:u.state)==="kept-for-coverage"?"kept-for-coverage":null}function Uv(i){var c;return((c=i.scores.bench)==null?void 0:c.state)==="benched"||i.scores.circuitOpen}function So(i){return`${Math.round(i*100)}%`}function qv(i){var c,u,o;return i.accuracy>=.7&&((c=i.bench)==null?void 0:c.state)==="none"?{label:"healthy",dotColor:"var(--ok)",tooltip:`Accuracy ${Math.round(i.accuracy*100)}% — above 70% baseline.`}:{label:"needs skills",dotColor:"var(--warn)",tooltip:((u=i.bench)==null?void 0:u.state)!=="none"?`Benched (${((o=i.bench)==null?void 0:o.reason)??"auto"})`:`Accuracy ${Math.round(i.accuracy*100)}% — below 70% baseline.`}}function Fm({label:i,value:c,color:u,tooltip:o}){const d=Number.isFinite(c)?Math.max(0,Math.min(1,c)):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:i}),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:So(d)})]})}function Bv({agent:i,severityCounts:c,trendPoints:u}){var h;const o=i.scores,d=(h=i.lastTask)!=null&&h.timestamp?Pe(i.lastTask.timestamp):"",m=en(i.id),v=qv(o);return a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(i.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":v.tooltip,"data-tooltip-pos":"bottom",children:[a.jsx("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:"50%",background:v.dotColor,flexShrink:0}}),v.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(Mv,{accuracy:o.accuracy,size:90,color:m}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,width:"100%"},children:[a.jsx(Av,{counts:c}),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:i.id}),(()=>{const p=Ro(o);return p==="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"}):p==="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"}):p==="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(Fm,{label:"unique",value:o.uniqueness,color:m,tooltip:`Uniqueness ${So(o.uniqueness)}
|
|
55
|
+
Findings others missed.`}),a.jsx(Fm,{label:"impact",value:o.impactScore,color:m,tooltip:`Impact ${So(o.impactScore)}
|
|
56
|
+
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(Ov,{points:u,width:240,height:28,color:m})}),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 Lv({agents:i,highlightedAgentId:c,severityMap:u,trendByAgent:o}){const d=[...i].sort((h,p)=>{var X,O,G,E;const g=((X=h.lastTask)==null?void 0:X.timestamp)??"",y=((O=p.lastTask)==null?void 0:O.timestamp)??"";if(g!==y)return y.localeCompare(g);const k=((G=h.scores)==null?void 0:G.signals)||0,R=((E=p.scores)==null?void 0:E.signals)||0;return k!==R?R-k:h.id.localeCompare(p.id)}),m=d.slice(0,4),v=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:i.length})]}),v&&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:m.map(h=>{const p=h.id===c;return a.jsx("div",{style:{borderRadius:"0.5rem",outline:p?"2px solid var(--border-strong)":void 0,transition:"outline-color 200ms cubic-bezier(0.4,0,0.2,1)"},children:a.jsx(Bv,{agent:h,severityCounts:u==null?void 0:u.get(h.id),trendPoints:o==null?void 0:o.get(h.id)})},h.id)})})]})}const Hv=8;function $v(i){const c=i.toLowerCase();return c==="completed"||c==="done"||c==="success"||c==="succeeded"?"completed":c==="running"||c==="active"||c==="in_progress"||c==="pending"?"running":c==="failed"||c==="error"||c==="errored"||c==="timeout"||c==="timed_out"?"failed":c==="cancelled"||c==="canceled"||c==="queued"||c==="waiting"?"cancelled":"unknown"}const Gv={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}},Yv={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 Xv(i){return i.length>8?i.slice(0,8):i}function Vv(i){return i.endsWith("-implementer")?{label:"IMPL",cls:"text-unique"}:i.endsWith("-reviewer")?{label:"REVIEW",cls:"text-chart"}:i.endsWith("-tester")?{label:"TEST",cls:"text-unique"}:i.endsWith("-researcher")?{label:"RESEARCH",cls:"",clsStyle:{color:"var(--text-dim)"}}:i.endsWith("-designer")?{label:"DESIGN",cls:"text-chart"}:null}function Qv({tasks:i,limit:c=Hv}){const u=i.items.slice(0,c),o=i.items.length>c;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:i.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(fa,{title:"No tasks yet",hint:"Dispatch with gossip_run to populate this view."}):u.map((d,m)=>{const v=$v(d.status),h=Gv[v],p=Vv(d.agentId);return a.jsxs("div",{className:`flex items-start gap-3 px-3.5 py-2.5 hover:bg-accent/20 transition-colors ${m>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:Yv[v]})}),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:Xv(d.taskId)}),p&&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 ${p.cls}`,style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",...p.clsStyle},"data-tooltip":d.agentId,children:p.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:Pe(d.timestamp)})]},d.taskId)})})]})}function Do({message:i,className:c}){return a.jsxs("span",{role:"alert",className:`inline-flex items-center gap-1 rounded-sm px-2 py-0.5 font-mono text-[10px] ${c??""}`,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 · ",i]})]})}const Zv={agreement:"confirmed",consensus_verified:"confirmed",unique_confirmed:"unique",unique_unconfirmed:"unique?",disagreement:"disputed",hallucination_caught:"hallucination",new_finding:"new",unverified:"unverified"},Kv={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)"},Jv={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--ink-3)"};function Fv(i,c){return i?i.length>c?i.slice(0,c-1)+"…":i:""}function Iv(i){return i.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 Wv(){const[i,c]=N.useState(null),[u,o]=N.useState(null);N.useEffect(()=>{We("signals?limit=7").then(m=>c(m.items??[])).catch(m=>o(String((m==null?void 0:m.message)??m)))},[]);const d=i?i.filter(m=>Date.now()-Date.parse(m.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:()=>us("/signals"),className:"font-mono text-[11px] hover:underline",style:{color:"var(--text-dim)"},children:"all signals →"}),u&&a.jsx(Do,{message:u,className:"ml-2"})]}),a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[!u&&i===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((m,v)=>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%"}})})]},v))})]})}),!u&&i&&i.length===0&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"no signals recorded"}),u&&(!i||i.length===0)&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"no cached signals to display"}),i&&i.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:i.map((m,v)=>{const h=m.severity?Jv[m.severity]:"transparent",p=Kv[m.signal]??"var(--ink-2)",g=Zv[m.signal]??m.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:Pe(m.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":m.severity?`severity: ${m.severity}`:"severity: unspecified",style:{display:"inline-block",width:3,height:14,background:h,borderRadius:1,flexShrink:0},title:m.severity??""}),a.jsx("span",{className:"h-section truncate",style:{color:p,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:m.agentId})}),a.jsx("td",{className:"py-2.5 pr-4 align-middle text-[12px]",style:{color:"var(--text)",lineHeight:1.45},children:Iv(Fv(m.evidence??"",120))})]},`${m.timestamp}-${v}`)})})]})]})]})}const ro=[{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 Pv({overview:i}){const c=i==null?void 0:i.skillVerdictSummary,u=c?ro.reduce((o,d)=>o+(c[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"]})]}),!c||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:ro.map(o=>{const d=c[o.key]??0;if(d===0)return null;const m=d/u*100;return a.jsx("div",{style:{width:`${m}%`,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:ro.map(o=>{const d=c[o.key]??0,m=d===0;return a.jsxs("li",{className:`flex items-center gap-1.5 ${m?"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:m?{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"}:{color:o.color},children:d})]},o.key)})})]})]})}const yl=1,os=2,e0=5;function t0({curve:i,threshold:c,stroke:u,width:o=140,height:d=30}){const m=N.useMemo(()=>l0(i),[i]),v=m.reduce((R,X)=>R+X.length,0);if(i.length===0||v<e0)return a.jsx(n0,{width:o,height:d,threshold:c});const h=o-yl*2,p=d-os*2,g=os+(1-ko(c))*p,y=R=>i.length<=1?yl+h/2:yl+R/(i.length-1)*h,k=R=>os+(1-ko(R))*p;return a.jsxs("svg",{width:o,height:d,viewBox:`0 0 ${o} ${d}`,"aria-hidden":!0,style:{display:"block"},children:[a.jsx("line",{x1:yl,x2:o-yl,y1:g,y2:g,stroke:"var(--ink-4)",strokeWidth:1,strokeDasharray:"2 3",opacity:.7}),m.map((R,X)=>{if(R.length===1){const{idx:G,value:E}=R[0];return a.jsx("circle",{className:"skill-spark-curve",cx:y(G),cy:k(E),r:1.4,fill:u},X)}const O=R.map((G,E)=>`${E===0?"M":"L"} ${y(G.idx).toFixed(2)} ${k(G.value).toFixed(2)}`).join(" ");return a.jsx("path",{className:"skill-spark-curve",d:O,fill:"none",stroke:u,strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},X)})]})}function n0({width:i,height:c,threshold:u}){const o=c-os*2,d=u!==void 0?os+(1-ko(u))*o:c/2;return a.jsx("svg",{width:i,height:c,viewBox:`0 0 ${i} ${c}`,"aria-hidden":!0,style:{display:"block"},children:a.jsx("line",{x1:yl,x2:i-yl,y1:d,y2:d,stroke:"var(--ok)",strokeWidth:1,strokeDasharray:"2 2",opacity:.4})})}function l0(i){const c=[];let u=[];for(let o=0;o<i.length;o++){const d=i[o].value;if(d==null||!Number.isFinite(d)){u.length>0&&(c.push(u),u=[]);continue}u.push({idx:o,value:d})}return u.length>0&&c.push(u),c}function ko(i){return!Number.isFinite(i)||i<0?0:i>1?1:i}const yh={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)"},a0={passed:"passed",pending:"pending",insufficient_evidence:"insufficient",inconclusive:"inconclusive",silent_skill:"silent",failed:"failed",flagged_for_manual_review:"flagged"},Im={failed:0,flagged_for_manual_review:1,inconclusive:2,insufficient_evidence:3,passed:4,pending:5,silent_skill:6},s0="var(--ink-3)";function Ui(i){return i!=null&&i in yh}function i0({skills:i,loading:c,error:u}){const{known:o,unknown:d,total:m,transitions:v}=N.useMemo(()=>r0(i==null?void 0:i.effectiveness),[i]);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:m}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:["skills · ",v," transitions /24h"]})]}),a.jsx("a",{href:Sn("/"),className:"text-[11px] transition hover:underline",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:"skill detail →"}),u&&a.jsx(Do,{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."}),c&&!i&&a.jsx(o0,{}),!c&&m===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."}),m>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(Pm,{entry:h},Wm(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(Pm,{entry:h},Wm(h)))}),a.jsx("style",{children:`
|
|
57
|
+
details[open] > summary > .chevron { transform: rotate(90deg); }
|
|
58
|
+
`})]})]})]})}function Wm(i){return`${i.agentId}::${i.skill}`}function r0(i){if(!i)return{known:[],unknown:[],total:0,transitions:0};const c=[],u=[];let o=0;for(const d of i)if(Ui(d.status)?c.push(d):u.push(d),d.curve.length>=2){const m=d.curve.slice(-2),v=m.filter(p=>p.value!=null&&p.value>=d.threshold).length,h=m.filter(p=>p.value!=null&&p.value<d.threshold).length;v>=1&&h>=1&&o++}return c.sort((d,m)=>{const v=Ui(d.status)?Im[d.status]:99,h=Ui(m.status)?Im[m.status]:99;return v!==h?v-h:d.skill.localeCompare(m.skill)}),u.sort((d,m)=>d.skill.localeCompare(m.skill)),{known:c,unknown:u,total:c.length+u.length,transitions:o}}function Pm({entry:i}){const c=Ui(i.status)?i.status:null,u=c?yh[c]:s0,o=c?a0[c]:i.status??"unknown",d=typeof i.storedEffectiveness=="number"?i.storedEffectiveness:null,m=d!==null?Math.round(d*100):null,v=i.verdictAt?c0(i.verdictAt):null,h=i.liveRecovered===!0;return a.jsxs("li",{className:"flex flex-col rounded-lg border",style:{background:"var(--surface-elev)",borderColor:"var(--border)"},title:`${i.agentId} · ${i.skill} · ${o} · N=${i.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:i.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:en(i.agentId)}}),a.jsx("span",{className:"truncate text-[10px]",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},children:i.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"})]}),(m!==null||v)&&a.jsxs("div",{className:"flex items-baseline gap-1.5 flex-wrap",children:[m!==null&&a.jsxs("span",{className:"text-[10px] tabular-nums",style:{color:m<0&&(c==="failed"||c==="flagged_for_manual_review")?"var(--bad)":m>0?"var(--ok)":"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:`Stored effectiveness delta: ${m>0?"+":""}${m}pp (basis for this verdict)`,children:[m>0?"+":"",m,"pp"]}),m!==null&&a.jsxs("span",{className:"text-[10px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:["vs ",i.threshold.toFixed(2)]}),v&&a.jsx("span",{className:"text-[10px] tabular-nums",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:`Verdict as of: ${i.verdictAt}`,children:v})]})]}),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:i.n})]})]}),a.jsx(t0,{curve:i.curve,threshold:i.threshold,stroke:en(i.agentId),width:120,height:28})]})]})}function c0(i){try{const c=new Date(i);if(!Number.isFinite(c.getTime()))return null;const u=new Date,o=c.getFullYear()===u.getFullYear(),d=c.toLocaleString("en-US",{month:"short"}),m=c.getDate();return o?`${d} ${m}`:`${d} ${m} '${String(c.getFullYear()).slice(-2)}`}catch{return null}}function o0(){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((i,c)=>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)"}})]})]},c))})}function u0(i){let c=0;for(let u=0;u<i.length;u++)c=(c<<5)-c+i.charCodeAt(u)|0;return Math.abs(c)}class d0{constructor(c){nt(this,"s");this.s=c}next(){return this.s=this.s*1103515245+12345&2147483647,this.s%1e4/1e4}range(c,u){return c+this.next()*(u-c)}}function ft(i,c){const u=parseInt(i.slice(1,3),16),o=parseInt(i.slice(3,5),16),d=parseInt(i.slice(5,7),16);return`rgba(${u},${o},${d},${Math.max(0,Math.min(1,c))})`}function f0(i){const c=Math.max(0,i);return Math.min(1.4,Math.pow(c/2e3,.55))}class m0{constructor(c,u,o,d,m,v,h=.5){nt(this,"ctx");nt(this,"size");nt(this,"accuracy");nt(this,"uniqueness");nt(this,"impact");nt(this,"colorHex");nt(this,"time",0);nt(this,"variant");nt(this,"scale");nt(this,"exp");nt(this,"particles",[]);nt(this,"baseRotation");nt(this,"armSeeds");nt(this,"binaryCenters");nt(this,"jetAxis");nt(this,"tailAngle");const p=c.getContext("2d");if(!p)throw new Error("Canvas 2D context unavailable");this.ctx=p,this.size=c.width/2,this.accuracy=Math.max(0,Math.min(1,d)),this.uniqueness=Math.max(0,Math.min(1,m)),this.impact=Math.max(0,Math.min(1,h)),this.colorHex=v;const g=u0(u);this.variant=g%12;const y=new d0(g),k=f0(o);this.exp=k,this.scale=.2+k*.95;const R=Math.max(3,Math.round(4+k*180));this._buildVariant(y,R),this.baseRotation=y.next()*Math.PI*2}_buildVariant(c,u){const o=this.variant;if(o===0){this.armSeeds=[];for(let m=0;m<2;m++)this.armSeeds.push(c.next()*Math.PI*2);for(let m=0;m<u;m++){const v=m%2,h=c.next(),p=this.armSeeds[v]+h*Math.PI*2.4,g=c.range(-.04,.04)*Math.PI*2,y=p+g,k=(.08+h*.38)*this.size*this.scale;this.particles.push(this._mkParticle(c,k,y,1,1))}}else if(o===1)for(let d=0;d<u;d++){const m=c.range(.34,.42)*this.size*this.scale,v=c.next()*Math.PI*2;this.particles.push(this._mkParticle(c,m,v,1,1))}else if(o===2){const d=[.16,.28,.42];for(let m=0;m<u;m++){const v=m%3,h=(d[v]+c.range(-.015,.015))*this.size*this.scale,p=c.next()*Math.PI*2;this.particles.push(this._mkParticle(c,h,p,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 m=0;m<u;m++){const v=m%2,h=c.range(.04,.22)*this.size*this.scale,p=c.next()*Math.PI*2,g=this._mkParticle(c,h,p,1,1);g.binaryCore=v,g.angularVelocity*=v===0?1:-1,this.particles.push(g)}}else if(o===4)for(let d=0;d<u;d++){const m=c.range(.05,.32)*this.size*this.scale,v=c.next()*Math.PI*2,h=c.range(.7,1.3),p=c.range(.7,1.3),g=this._mkParticle(c,m,v,h,p);g.orbitTilt=c.range(0,Math.PI),this.particles.push(g)}else if(o===5){this.jetAxis=c.next()*Math.PI*2;const d=Math.floor(u*.7),m=u-d;for(let v=0;v<d;v++){const h=v%2===0?1:-1,p=c.next(),g=c.range(-.18,.18),y=this._mkParticle(c,p*.44*this.size*this.scale,0,1,1);y.jetSide=h,y.jetProgress=p,y.jetSpread=g,y.jetSpeed=c.range(.15,.35)*.001,y.size=c.range(.6,1.4),this.particles.push(y)}for(let v=0;v<m;v++){const h=c.range(.35,.42)*this.size*this.scale,p=c.next()*Math.PI*2,g=this._mkParticle(c,h,p,1,1);g.isDisk=!0,g.brightness*=.35,this.particles.push(g)}}else if(o===6)for(let d=0;d<u;d++){const m=c.next()*Math.PI*2,v=c.range(.05,.45)*this.size*this.scale,h=this._mkParticle(c,v,m,1,1);h.isNebula=!0,h.driftAngle=c.next()*Math.PI*2,h.driftSpeed=c.range(6e-4,.0014),h.driftPhase=c.next()*Math.PI*2,h.size=c.range(.8,2.2),h.brightness*=.6,this.particles.push(h)}else if(o===7){this.tailAngle=c.next()*Math.PI*2;const d=.1*this.size*this.scale,m=Math.floor(u*.3);for(let h=0;h<m;h++){const p=c.range(0,d),g=c.next()*Math.PI*2,y=this._mkParticle(c,p,g,1,1);y.size=c.range(.8,1.8),this.particles.push(y)}const v=u-m;for(let h=0;h<v;h++){const p=c.next(),g=d+p*.26*this.size*this.scale,y=(1-p*.5)*c.range(-.05,.05)*this.size*this.scale,k=this._mkParticle(c,0,0,1,1);k.isComet=!0,k.cometTailDist=g,k.cometPerp=y,k.cometT=p,k.brightness*=1-p*.6,k.size=(1-p*.5)*c.range(.6,1.2),this.particles.push(k)}}else if(o===8)for(let d=0;d<u;d++){const m=d%3,v=c.range(.3,.42)*this.size*this.scale,h=c.next()*Math.PI*2,p=this._mkParticle(c,v,h,1,1);p.gyroPlane=m,p.gyroAxis=m===0?"z":m===1?"x":"y",this.particles.push(p)}else if(o===9)for(let d=0;d<u;d++){const m=c.range(.06,.42)*this.size*this.scale,h=m/(.42*this.size*this.scale)*4*Math.PI+c.range(-.2,.2),p=this._mkParticle(c,m,h,1,1);p.isMaelstrom=!0,this.particles.push(p)}else if(o===10)for(let d=0;d<u;d++){const m=d/u,v=c.range(.35,.4)*this.size*this.scale,h=m*Math.PI*2+c.range(-.03,.03),p=this._mkParticle(c,v,h,1,1);p.ouroT=m,this.particles.push(p)}else for(let d=0;d<u;d++){const m=d%2,v=c.next(),h=this._mkParticle(c,0,0,1,1);h.isHelix=!0,h.helixStrand=m,h.helixT=v,h.helixSpeed=c.range(.3,.6)*.001,this.particles.push(h)}}_mkParticle(c,u,o,d,m){const v=8e-4+(.42*this.size-u)*4e-5,h=c.next()*Math.PI*2,p=c.range(.05,.3)*this.size;return{baseRadius:u,angle:o,angularVelocity:v*(c.next()>.5?1:.85),size:c.range(.5,1.8),brightness:c.range(.4,1),wobblePhase:c.next()*Math.PI*2,wobbleSpeed:c.range(.5,1.2),ellipX:d,ellipY:m,orbitTilt:0,binaryCore:0,chaosX:Math.cos(h)*p,chaosY:Math.sin(h)*p,chaosDriftPhase:c.next()*Math.PI*2,chaosDriftSpeed:c.range(3e-4,8e-4)}}update(c){this.time+=c}draw(){const{ctx:c,size:u,time:o,accuracy:d,uniqueness:m,impact:v,colorHex:h,variant:p}=this,g=u/2,y=u/2;c.clearRect(0,0,u,u);const k=.4+this.exp*.6,R=d*k,X=m*k,O=v*k,G=.2+R*.8,E=.3+O*1.9,I=X,K=Math.min(1,Math.max(0,(this.exp-.15)*1.8)),P=1-K,$=c.createRadialGradient(g,y,0,g,y,u*.45);if($.addColorStop(0,ft(h,.05*G)),$.addColorStop(.4,ft(h,.015)),$.addColorStop(1,"transparent"),c.fillStyle=$,c.fillRect(0,0,u,u),p===0&&this.armSeeds){const T=o*5e-4*E;for(const Z of this.armSeeds){const z=Z+T;c.beginPath();for(let J=0;J<1;J+=.02){const le=z+J*Math.PI*2.4,F=(.08+J*.38)*u*this.scale,de=g+Math.cos(le)*F,te=y+Math.sin(le)*F;J===0?c.moveTo(de,te):c.lineTo(de,te)}c.strokeStyle=ft(h,.12*G),c.lineWidth=1,c.stroke()}}for(const T of this.particles){const Z=Math.sin(o*T.wobbleSpeed*.001+T.wobblePhase)*1.2,z=T.baseRadius+Z,J=T.angle+o*T.angularVelocity*E;let le,F;if(p===3&&this.binaryCenters){const te=this.binaryCenters[T.binaryCore];le=g+te.x+Math.cos(J)*z,F=y+te.y+Math.sin(J)*z}else if(p===4){const te=Math.cos(T.orbitTilt),ae=Math.sin(T.orbitTilt),he=Math.cos(J)*z*T.ellipX,M=Math.sin(J)*z*T.ellipY;le=g+he*te-M*ae,F=y+he*ae+M*te}else if(p===5&&T.jetSide!==void 0&&!T.isDisk&&this.jetAxis!==void 0){const te=(T.jetProgress+o*T.jetSpeed*E)%1,ae=te*.44*u*this.scale,he=this.jetAxis+Math.PI/2;le=g+Math.cos(this.jetAxis)*ae*T.jetSide+Math.cos(he)*T.jetSpread*ae,F=y+Math.sin(this.jetAxis)*ae*T.jetSide+Math.sin(he)*T.jetSpread*ae,T._fadeMul=Math.sin(te*Math.PI)*.9+.1}else if(p===6&&T.isNebula){const te=o*T.driftSpeed*E,ae=Math.sin(te+T.driftPhase)*2;le=g+Math.cos(T.angle+te*.3)*z+Math.cos(T.driftAngle)*ae,F=y+Math.sin(T.angle+te*.3)*z+Math.sin(T.driftAngle)*ae}else if(p===7&&T.isComet&&this.tailAngle!==void 0){const te=(T.cometT+o*3e-4*E)%1,ae=T.cometTailDist+te*.06*u*this.scale,he=this.tailAngle+Math.PI/2;le=g+Math.cos(this.tailAngle)*ae+Math.cos(he)*T.cometPerp,F=y+Math.sin(this.tailAngle)*ae+Math.sin(he)*T.cometPerp}else if(p===8&&T.gyroAxis){const te=o*1e-4*E;T.gyroAxis==="z"?(le=g+Math.cos(J)*z,F=y+Math.sin(J)*z*.3):T.gyroAxis==="x"?(le=g+Math.cos(J)*z*.3+Math.sin(te)*z*.1,F=y+Math.sin(J)*z):(le=g+Math.sin(J+te)*z*.6,F=y+Math.cos(J+te)*z*.8)}else if(p===9){const te=(o*5e-4*E+T.wobblePhase)%1,ae=z*(1-te*.85);le=g+Math.cos(J)*ae,F=y+Math.sin(J)*ae,T._fadeMul=1-te}else if(p===10&&T.ouroT!==void 0){const te=(T.ouroT+o*3e-4*E)%1,ae=te*Math.PI*2;le=g+Math.cos(ae)*z,F=y+Math.sin(ae)*z;const he=Math.cos(te*Math.PI*2)*.5+.5;T._fadeMul=.3+he*.9}else if(p===11&&T.helixT!==void 0){const te=(T.helixT+o*T.helixSpeed*E)%1,ae=(te-.5)*.65*u*this.scale,he=T.helixStrand===0?0:Math.PI,M=.15*u*this.scale,w=Math.sin(te*Math.PI*3+he)*M;le=g+w,F=y+ae,T._fadeMul=.4+(Math.cos(te*Math.PI*3+he)+1)/2*.6}else le=g+Math.cos(J)*z*T.ellipX,F=y+Math.sin(J)*z*T.ellipY;if(P>.01){const te=o*T.chaosDriftSpeed,ae=Math.cos(te+T.chaosDriftPhase)*2,he=Math.sin(te*1.13+T.chaosDriftPhase)*2,M=g+T.chaosX+ae,w=y+T.chaosY+he;le=M*P+le*K,F=w*P+F*K}const de=T._fadeMul!==void 0?T._fadeMul:1;if(p<=4&&K>.5){const te=2+Math.floor(v*3);for(let ae=0;ae<te;ae++){const he=T.angularVelocity*E*(ae+1)*80,M=J-he;let w,H;if(p===3&&this.binaryCenters){const ce=this.binaryCenters[T.binaryCore];w=g+ce.x+Math.cos(M)*z,H=y+ce.y+Math.sin(M)*z}else if(p===4){const ce=Math.cos(T.orbitTilt),fe=Math.sin(T.orbitTilt),j=Math.cos(M)*z*T.ellipX,B=Math.sin(M)*z*T.ellipY;w=g+j*ce-B*fe,H=y+j*fe+B*ce}else w=g+Math.cos(M)*z*T.ellipX,H=y+Math.sin(M)*z*T.ellipY;const ne=(1-ae/te)*.3*T.brightness*G*K;c.beginPath(),c.arc(w,H,T.size*(1-ae*.25),0,Math.PI*2),c.fillStyle=ft(h,ne),c.fill()}}else if(p===6&&T.isNebula){const te=T.size*3,ae=c.createRadialGradient(le,F,0,le,F,te);ae.addColorStop(0,ft(h,T.brightness*G*.4)),ae.addColorStop(1,"transparent"),c.fillStyle=ae,c.beginPath(),c.arc(le,F,te,0,Math.PI*2),c.fill()}c.beginPath(),c.arc(le,F,T.size,0,Math.PI*2),c.fillStyle=ft(h,T.brightness*G*de),c.fill()}if(I>.05)for(let Z=0;Z<3;Z++){const z=(o*7e-4*I+Z*.33)%1;if(z>.5)continue;const J=(Z*1.618*Math.PI+o*1e-4)%(Math.PI*2),le=u*.5*(1-z*1.6);if(le<3)continue;const F=g+Math.cos(J)*le,de=y+Math.sin(J)*le,te=z<.2?z/.2:1-(z-.2)/.3,ae=5+(1-z)*4,he=c.createRadialGradient(F,de,0,F,de,ae);he.addColorStop(0,ft("#ffffff",te*.95)),he.addColorStop(.3,ft(h,te*.7)),he.addColorStop(1,"transparent"),c.fillStyle=he,c.beginPath(),c.arc(F,de,ae,0,Math.PI*2),c.fill()}if(p!==3){const T=.9+.1*Math.sin(o*.003),Z=(1+this.exp*9+d*2)*this.scale,z=Math.min(Z*(3+v*2),u*.4),J=c.createRadialGradient(g,y,0,g,y,z);J.addColorStop(0,ft("#ffffff",.95*T*G)),J.addColorStop(.2,ft(h,.75*T*G)),J.addColorStop(.5,ft(h,.2*G)),J.addColorStop(1,"transparent"),c.fillStyle=J,c.beginPath(),c.arc(g,y,z,0,Math.PI*2),c.fill(),c.beginPath(),c.arc(g,y,Z*T,0,Math.PI*2),c.fillStyle=ft("#ffffff",.95),c.fill()}else if(this.binaryCenters)for(const T of this.binaryCenters){const Z=g+T.x,z=y+T.y,J=(.8+this.exp*5+d*1.5)*this.scale,le=Math.min(J*3.5,u*.22),F=c.createRadialGradient(Z,z,0,Z,z,le);F.addColorStop(0,ft("#ffffff",.9*G)),F.addColorStop(.3,ft(h,.6*G)),F.addColorStop(1,"transparent"),c.fillStyle=F,c.beginPath(),c.arc(Z,z,le,0,Math.PI*2),c.fill(),c.beginPath(),c.arc(Z,z,J,0,Math.PI*2),c.fillStyle=ft("#ffffff",.9),c.fill()}}}const Sl=globalThis,ca=new Set;let Nl=0,oa=0;const h0=100;function bh(i){const c=oa===0?16:Math.min(h0,Math.max(0,i-oa));oa=i;for(const u of ca)try{u(c)}catch(o){console.error("[AnimationScheduler] subscriber threw, continuing",o)}ca.size>0?Nl=Sl.requestAnimationFrame(bh):(Nl=0,oa=0)}function x0(){Nl===0&&(oa=0,Nl=Sl.requestAnimationFrame(bh))}function p0(){Nl!==0&&(Sl.cancelAnimationFrame&&Sl.cancelAnimationFrame(Nl),Nl=0,oa=0)}function v0(){return Sl.matchMedia?Sl.matchMedia("(prefers-reduced-motion: reduce)").matches:!1}function jh(i){if(!Sl.requestAnimationFrame)return()=>{};if(v0())return()=>{};ca.add(i),ca.size===1&&x0();let c=!1;return function(){c||(c=!0,ca.delete(i),ca.size===0&&p0())}}function fs({agentId:i,size:c=64,animate:u=!0,signals:o=0,accuracy:d=.5,uniqueness:m=.5,impact:v=.5}){const h=N.useRef(null),p=N.useRef(null),g=N.useRef(!0),y=N.useRef(u);return y.current=u,N.useEffect(()=>{const k=h.current;if(!k)return;k.width=c*2,k.height=c*2;const R=k.getContext("2d");if(!R)return;R.scale(2,2);const X=en(i),O=new m0(k,i,o,d,m,X,v);p.current=O,O.draw();const G=jh(E=>{g.current&&y.current&&(O.update(E),O.draw())});return()=>{G(),p.current=null}},[i,c,o,d,m,v]),N.useEffect(()=>{const k=h.current;if(!k)return;const R=new IntersectionObserver(([X])=>{g.current=X.isIntersecting},{threshold:.1});return R.observe(k),()=>R.disconnect()},[]),a.jsx("canvas",{ref:h,"aria-hidden":"true",className:"shrink-0",style:{width:c,height:c,borderRadius:"50%"}})}function g0(i){return i.hallucinationsCaught>0?"catch":i.disputed>0?"mixed":i.confirmed>0?"trust":null}function y0(i){return Math.max(1,Math.min(2.5,1+i*.15))}function ds(i,c){return i<=c?`${i}::${c}`:`${c}::${i}`}const b0=new Set(["agreement","unique_confirmed","impl_peer_approved"]),j0=new Set(["disagreement","impl_peer_rejected"]),N0=new Set(["hallucination_caught"]);function S0(i){const c=new Map,u=new Map;for(const o of i)if(!o.retracted)for(const d of o.signals){if(!d.counterpartId||!d.agentId)continue;const m=b0.has(d.signal),v=j0.has(d.signal),h=N0.has(d.signal);if(!m&&!v&&!h)continue;const p=ds(d.agentId,d.counterpartId);let g=c.get(p);g||(g={rounds:0,confirmed:0,disputed:0,hallucinationsCaught:0,lastInteraction:o.timestamp},c.set(p,g)),m&&(g.confirmed+=1),v&&(g.disputed+=1),h&&(g.hallucinationsCaught+=1);let y=u.get(p);y||(y=new Set,u.set(p,y)),y.has(o.taskId)||(y.add(o.taskId),g.rounds+=1),o.timestamp>g.lastInteraction&&(g.lastInteraction=o.timestamp)}return c}function qi(i){return i>=2e3?84:i>=800?72:i>=200?60:48}function k0(i,c,u){var y;const o={x:c/2,y:u/2},m=Math.max(80,Math.min(c,u)/2-24),v=new Map;if(i.length===0)return v;const h=[...i].sort((k,R)=>{var G,E;const X=((G=R.scores)==null?void 0:G.accuracy)??0,O=((E=k.scores)==null?void 0:E.accuracy)??0;return X!==O?O-X:k.id.localeCompare(R.id)}),p=h.length,g=Math.PI*(3-Math.sqrt(5));for(let k=0;k<p;k++){const R=h[k],X=_0(((y=R.scores)==null?void 0:y.accuracy)??0,0,1),O=Math.max(m*.22,(1-X)*m),G=-Math.PI/2+k*g;v.set(R.id,{x:o.x+O*Math.cos(G),y:o.y+O*Math.sin(G),role:"fleet",angle:G})}return v}function _0(i,c,u){return Math.min(Math.max(i,c),u)}function eh(i){let c=i>>>0;return()=>{c=c+1831565813>>>0;let u=c;return u=Math.imul(u^u>>>15,u|1),u^=u+Math.imul(u^u>>>7,u|61),((u^u>>>14)>>>0)/4294967296}}function E0({width:i,height:c,agentPositions:u}){const o=N.useRef(null),d=N.useRef([]),m=N.useRef([]);N.useEffect(()=>{if(i<=0||c<=0)return;const h=eh(7311),p=170;d.current=Array.from({length:p},()=>{const g=h();let y,k;return g<.07?(y=2+h()*.6,k=.75+h()*.25):g<.32?(y=1.2+h()*.4,k=.45+h()*.35):(y=.5+h()*.4,k=.25+h()*.3),{x:h()*i,y:h()*c,baseR:y,r:y,baseO:k,o:k,consumed:null,phase:h()*Math.PI*2,twinkleHz:.25+h()*1.4}})},[i,c]),N.useEffect(()=>{if(i<=0||c<=0)return;const h=eh(919),p=60,g=90,y=1.5,k=1.8;let R=0;const O=jh(G=>{const E=G/1e3;R+=E;const I=d.current,K=m.current;for(let P=0;P<I.length;P++){const $=I[P];if($.consumed===null)for(let Z=0;Z<u.length;Z++){const z=u[Z].x-$.x,J=u[Z].y-$.y;if(z*z+J*J<p*p){$.consumed=Z;break}}if($.consumed===null){const Z=.8+.35*Math.sin(R*$.twinkleHz*Math.PI*2+$.phase);$.o=Math.min(1,$.baseO*Z)}if($.consumed!==null){const Z=u[$.consumed];if(Z){const z=Z.x-$.x,J=Z.y-$.y,le=Math.sqrt(z*z+J*J)||1,F=Math.min(le,g*E);$.x+=z/le*F,$.y+=J/le*F,$.o=Math.max(0,$.o-y*E),$.r=Math.max(0,$.r-k*E)}if($.o<=.01||$.r<=.1){let z=0,J=0,le=!1;for(let F=0;F<8;F++){z=h()*i,J=h()*c,le=!0;for(const de of u){const te=de.x-z,ae=de.y-J;if(te*te+ae*ae<p*p*1.5){le=!1;break}}if(le)break}$.x=z,$.y=J,$.r=$.baseR,$.o=$.baseO,$.consumed=null}}const T=K[P];T&&(T.setAttribute("cx",String($.x)),T.setAttribute("cy",String($.y)),T.setAttribute("r",String($.r)),T.setAttribute("opacity",String($.o)))}});return()=>O()},[i,c,u]);const v=d.current;return a.jsx("svg",{ref:o,width:"100%",height:c,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:v.map((h,p)=>a.jsx("circle",{ref:g=>{m.current[p]=g},cx:h.x,cy:h.y,r:h.r,fill:"#F2EDE3",opacity:h.o},p))})}function T0({variant:i}){const c=(()=>{switch(i){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:c})}function w0(){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 M0({width:i,height:c,hideLabels:u=!1}){const o=i/2,d=c/2,v=Math.max(80,Math.min(i,c)/2-40),h=[{r:v,accLabel:"0%"},{r:v*.75,accLabel:"25%"},{r:v*.5,accLabel:"50%"},{r:v*.25,accLabel:"75%"}];return a.jsx("svg",{width:"100%",height:c,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:h.map(({r:p,accLabel:g})=>a.jsxs("g",{children:[a.jsx("circle",{cx:o,cy:d,r:p,fill:"none",stroke:"var(--border-strong)",strokeDasharray:"2 4",opacity:.5}),!u&&a.jsx("text",{x:o+6,y:d-p-4,fontFamily:"var(--font-mono)",fontSize:"9",fill:"var(--ink-3)",letterSpacing:"0.06em",children:g})]},g))})}function A0(i,c,u,o,d){const m={x:o/2,y:d/2},v=new Map;v.set(i,{x:m.x,y:m.y,role:"center"});const h=[];for(const X of c){if(X===i)continue;const O=u.get(ds(i,X));O&&h.push({id:X,rel:O})}const p=Math.max(1,...h.map(X=>X.rel.rounds)),g=Math.max(120,Math.min(o,d)*.2),y=Math.min(o,d)*.42,k=h.slice().sort((X,O)=>X.id.localeCompare(O.id)),R=k.length;for(let X=0;X<R;X++){const{id:O,rel:G}=k[X],E=X/Math.max(1,R)*Math.PI*2-Math.PI/2,I=G.rounds/p,K=y-I*(y-g);v.set(O,{x:m.x+K*Math.cos(E),y:m.y+K*Math.sin(E),role:"peer"})}for(const X of c)v.has(X)||v.set(X,{x:m.x,y:m.y,role:"hidden"});return v}function C0({agents:i,peerRelationships:c,selectedAgentId:u,onSelectAgent:o,height:d=420}){if(i.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(i.length===1){const m=i[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(fs,{agentId:m.id,signals:m.scores.signals,accuracy:m.scores.accuracy,uniqueness:m.scores.uniqueness,impact:m.scores.impactScore,size:qi(m.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(z0,{agents:i,peerRelationships:c,selectedAgentId:u,onSelectAgent:o,height:d})}function z0({agents:i,peerRelationships:c,selectedAgentId:u,onSelectAgent:o,height:d=420}){const m=N.useRef(null),[v,h]=N.useState(800),[p,g]=N.useState(d),[y,k]=N.useState(0);N.useEffect(()=>{const E=m.current;if(!E)return;const I=new ResizeObserver(([K])=>{const P=K.contentRect.width,$=K.contentRect.height;P>0&&h(P),$>0&&g($)});return I.observe(E),()=>I.disconnect()},[]);const R=N.useMemo(()=>{const E=i.map(I=>I.id);return u&&E.includes(u)?A0(u,E,c,v,p):k0(i,v,p)},[i,c,u,v,p]),X=N.useMemo(()=>{if(!u)return[];const E=R.get(u);if(!E)return[];const I=[];for(const P of i){if(P.id===u)continue;const $=R.get(P.id);if(!$||$.role!=="peer")continue;const T=c.get(ds(u,P.id));if(!T)continue;const Z=g0(T);Z&&I.push({peerId:P.id,x1:E.x,y1:E.y,x2:$.x,y2:$.y,cls:Z,width:y0(T.rounds),rounds:T.rounds})}const K={mixed:0,trust:1,catch:2};return I.sort((P,$)=>K[P.cls]-K[$.cls]),I},[i,c,u,R]),O=u?X.length:0,G=N.useMemo(()=>{const E=[];for(const I of i){const K=R.get(I.id);K&&E.push({x:K.x,y:K.y})}return E},[i,R]);return a.jsxs("div",{ref:m,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(E0,{width:v,height:p,agentPositions:G}),a.jsx(M0,{width:v,height:p,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:O}),a.jsxs("span",{style:{opacity:.7},children:["peer",O===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:i.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:p,style:{position:"absolute",inset:0,pointerEvents:"none"},children:X.map(E=>{const I=i.find(w=>w.id===u),K=i.find(w=>w.id===E.peerId);if(!I||!K)return null;const P=qi(I.scores.signals)/2,$=qi(K.scores.signals)/2,T=E.x2-E.x1,Z=E.y2-E.y1,z=Math.max(1,Math.hypot(T,Z)),J=T/z,le=Z/z,F=E.x1+J*P,de=E.y1+le*P,te=E.x2-J*$,ae=E.y2-le*$,he=E.cls==="trust"?"var(--success)":E.cls==="mixed"?"var(--warn)":"var(--danger)",M=E.cls==="mixed"?"8,2":void 0;return a.jsx("line",{x1:F,y1:de,x2:te,y2:ae,stroke:he,strokeWidth:E.width,strokeDasharray:M,strokeLinecap:"round",style:{opacity:.55,transition:"opacity 200ms cubic-bezier(0.4,0,0.2,1)"}},E.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(co,{stroke:"var(--success)",label:"Trust"}),a.jsx(co,{stroke:"var(--warn)",label:"Mixed",dash:"8,2"}),a.jsx(co,{stroke:"var(--danger)",label:"Caught"})]}),!u&&p>0&&a.jsxs("div",{className:"absolute z-[1] -translate-x-1/2 -translate-y-1/2",style:{left:v/2,top:p/2,cursor:"pointer"},onClick:E=>{E.stopPropagation(),k(I=>I+1)},title:y>=10?"♥":y>=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"})]}),y>0&&a.jsx(T0,{variant:(y-1)%4},y),y>0&&a.jsx(w0,{},`ripple-${y}`),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:y>=10?"var(--accent)":"var(--stage-text-dim)",whiteSpace:"nowrap",opacity:.7,pointerEvents:"none",transition:"color 400ms ease-out"},children:y>=10?"♥ orchestrator ♥":"orchestrator"})]}),i.map(E=>{const I=R.get(E.id);if(!I)return null;const K=qi(E.scores.signals),P=I.role==="center",$=I.role==="hidden",T=I.role==="peer",Z=$?0:1,z=P?"#F2EDE3":"var(--stage-text-dim)",J=I.angle??Math.PI/2,le=K/2+14,F=Math.cos(J)*le,de=Math.sin(J)*le,te=Math.abs(Math.cos(J))>.7?Math.cos(J)>0?"left":"right":"center";return a.jsxs("button",{type:"button",onClick:ae=>{ae.stopPropagation(),o(E.id)},className:"absolute -translate-x-1/2 -translate-y-1/2",style:{left:I.x,top:I.y,opacity:Z,pointerEvents:$?"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 ${E.id}`,title:E.id,children:[a.jsx("div",{className:"rounded-full",style:{width:K,height:K,boxShadow:P?"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(fs,{agentId:E.id,signals:E.scores.signals,accuracy:E.scores.accuracy,uniqueness:E.scores.uniqueness,impact:E.scores.impactScore,size:K})}),a.jsx("div",{className:"absolute font-mono text-[10px] font-bold tracking-wider",style:{left:"50%",top:"50%",transform:`translate(calc(-50% + ${F}px), calc(-50% + ${de}px))${te==="left"?" translateX(calc(50% + 4px))":te==="right"?" translateX(calc(-50% - 4px))":""}`,color:z,textAlign:te==="right"?"right":te==="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:E.id}),T&&a.jsx("div",{className:"font-mono text-[9px]",style:{color:"var(--stage-text-dim)",textAlign:"center",whiteSpace:"nowrap",marginTop:2},children:(()=>{const ae=c.get(ds(u??"",E.id));return ae?`${ae.rounds} round${ae.rounds===1?"":"s"}`:""})()})]},E.id)})]})}function co({stroke:i,label:c,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:i,strokeWidth:"1.5",strokeDasharray:u})}),a.jsx("span",{children:c})]})}function th(i){const c=new URLSearchParams(i).get("agent");return c&&c.length>0?c:null}function R0(i,c,u){const o=new URLSearchParams(c);u===null?o.delete("agent"):o.set("agent",u);const d=o.toString();return d.length>0?`${i}?${d}`:i}function Nh(i){const c=globalThis;if(typeof c.window>"u")return;const u=c.window,o=R0(u.location.pathname,u.location.search,i);o!==u.location.pathname+u.location.search&&(u.history.pushState({},"",o),u.dispatchEvent(new Event("dashboard:navigate")))}function D0({selectedAgent:i,agents:c,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":i?`Agent detail: ${i.id}`:"Fleet summary",children:i?a.jsx(q0,{agent:i,peerRelationships:u,agents:c}):a.jsx(O0,{agents:c,peerRelationships:u})})}function O0({agents:i,peerRelationships:c}){const u=[...i].filter(m=>m.scores.signals>0).sort((m,v)=>v.scores.accuracy-m.scores.accuracy).slice(0,3),o=[];for(const[m,v]of c.entries())if(v.hallucinationsCaught>0){const[h,p]=m.split("::");o.push({pair:[h,p],catches:v.hallucinationsCaught,ts:v.lastInteraction})}o.sort((m,v)=>new Date(v.ts).getTime()-new Date(m.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(nh,{label:"Top performers",tone:"success",children:u.length===0?a.jsx(_o,{text:"No agent has logged a signal yet."}):u.map(m=>a.jsxs("button",{type:"button",onClick:()=>Nh(m.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:m.id}),a.jsxs("div",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[Math.round(m.scores.accuracy*100),"% accuracy · ",m.scores.signals," signals"]})]}),a.jsx("span",{className:"opacity-0 transition group-hover:opacity-100 font-mono text-[11px]",style:{color:"var(--accent)"},children:"→"})]},m.id))}),a.jsx(nh,{label:"Recent hallucination catches",tone:"danger",children:d.length===0?a.jsx(_o,{text:"No catches in the active window."}):d.map(m=>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:"◆"})," ",m.pair[0]," ↔ ",m.pair[1]]}),a.jsxs("div",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[m.catches," caught · ",U0(m.ts)]})]},`${m.pair[0]}::${m.pair[1]}`))})]})}function nh({label:i,tone:c,children:u}){const o=c==="success"?"var(--success)":c==="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}}),i]}),a.jsx("div",{className:"space-y-1",children:u})]})}function _o({text:i}){return a.jsx("div",{className:"px-2 py-1.5 font-mono text-[11px]",style:{color:"var(--ink-4)"},children:i})}function U0(i){const c=new Date(i).getTime(),u=Date.now(),o=Math.max(0,Math.floor((u-c)/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 q0({agent:i,peerRelationships:c,agents:u}){const o=i.scores.bench.state==="benched"?{label:"BENCHED",color:"var(--danger)"}:i.native?{label:"READY",color:"var(--success)"}:i.online?{label:"ONLINE",color:"var(--success)"}:{label:"OFFLINE",color:"var(--ink-3)"},d=[];for(const v of u){if(v.id===i.id)continue;const h=c.get(ds(i.id,v.id));if(!h)continue;const p=h.confirmed+h.disputed+h.hallucinationsCaught;d.push({other:v.id,rel:h,total:p})}d.sort((v,h)=>h.total-v.total);const m=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(fs,{agentId:i.id,signals:i.scores.signals,accuracy:i.scores.accuracy,uniqueness:i.scores.uniqueness,impact:i.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:i.id}),a.jsx("div",{className:"truncate font-mono text-[11px]",style:{color:"var(--ink-3)"},children:i.model})]})]}),a.jsxs("div",{className:"mx-4 mt-4 grid grid-cols-2 gap-2",children:[a.jsx(Ci,{label:"Accuracy",value:`${Math.round(i.scores.accuracy*100)}%`}),a.jsx(Ci,{label:"Reliability",value:i.scores.taskCompletionRate==null?"—":`${Math.round(i.scores.taskCompletionRate*100)}%`}),a.jsx(Ci,{label:"Signals",value:i.scores.signals.toLocaleString()}),a.jsx(Ci,{label:"Impact",value:`${Math.round(i.scores.impactScore*100)}%`})]}),a.jsxs("div",{className:"mt-4 px-4",children:[a.jsx("div",{className:"mb-1.5 h-section",children:"Top peers"}),m.length===0?a.jsx(_o,{text:"No cross-review history yet."}):a.jsx("div",{className:"space-y-1",children:m.map(({other:v,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:v}),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"]})]})]},v))})]}),i.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:i.skills.length})]}),a.jsx("div",{className:"flex flex-wrap gap-1",children:i.skills.slice(0,6).map(v=>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:v},v))})]}),a.jsxs("div",{className:"mt-auto flex flex-col gap-1.5 border-t p-3",style:{borderColor:"var(--border)"},children:[a.jsx(oo,{label:"Open dispatch log",kbd:"⏎",href:`/agent/${encodeURIComponent(i.id)}`}),a.jsx(oo,{label:"View skill graph",kbd:"G",href:`/agent/${encodeURIComponent(i.id)}#skills`,disabled:i.skills.length===0}),a.jsx(oo,{label:"Dispatch consensus",kbd:"⌘D",href:"#",disabled:!0})]})]})}function Ci({label:i,value:c}){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:i}),a.jsx("div",{className:"mt-0.5 font-mono text-[16px] font-medium tabular-nums",style:{color:"var(--text)"},children:c})]})}function oo({label:i,kbd:c,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:i}),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:c})]})}let Gt=null,zi=3e3,uo=null;const Eo=new Set;function Sh(){if((Gt==null?void 0:Gt.readyState)===WebSocket.OPEN||(Gt==null?void 0:Gt.readyState)===WebSocket.CONNECTING)return;const i=location.protocol==="https:"?"wss:":"ws:";Gt=new WebSocket(`${i}//${location.host}/dashboard/ws`),Gt.onopen=()=>{zi=3e3},Gt.onmessage=c=>{try{const u=JSON.parse(c.data);Eo.forEach(o=>o(u))}catch{}},Gt.onclose=()=>{Gt=null,uo&&clearTimeout(uo),uo=setTimeout(()=>{zi=Math.min(zi*1.5,3e4),Sh()},zi)},Gt.onerror=()=>{}}function kh(i){return Eo.add(i),()=>Eo.delete(i)}function _h(i){const c=N.useRef(i);c.current=i,N.useEffect(()=>(Sh(),kh(u=>c.current(u))),[])}const B0=6e4;function L0(){const[i,c]=N.useState(null),[u,o]=N.useState(null),d=N.useRef(null),m=()=>{c(null),o(null),d.current!=null&&(window.clearTimeout(d.current),d.current=null)};if(_h(h=>{if(h.type==="task_dispatched"){c(h.taskId),o(h.agentId),d.current!=null&&window.clearTimeout(d.current),d.current=window.setTimeout(m,B0);return}if(h.type==="consensus_complete"||h.type==="task_completed"||h.type==="task_failed"){if(h.taskId!==i)return;m()}}),N.useEffect(()=>()=>m(),[]),i===null)return null;const v=i.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:v}),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 jl=24,H0={"1h":36e5,"24h":24*36e5,"7d":168*36e5,"30d":720*36e5};function Eh(i){return H0[i]}function $0(i,c,u){const o=Eh(c),d=o/jl,m=u-o,v=new Array(jl).fill(0);for(const h of i){const p=new Date(h).getTime();if(!Number.isFinite(p)||p<m||p>u)continue;const g=p-m;let y=Math.floor(g/d);y>=jl&&(y=jl-1),v[y]+=1}return v}const G0=["1h","24h","7d","30d"],Y0={"1h":"1h ago","24h":"24h ago","7d":"7d ago","30d":"30d ago"};function X0({runs:i,range:c,onRangeChange:u,height:o=52}){const[d,m]=N.useState(()=>Date.now());N.useEffect(()=>{const p=Eh(c)/jl,g=window.setInterval(()=>m(Date.now()),p);return()=>window.clearInterval(g)},[c]);const v=N.useMemo(()=>{var g;const p=[];for(const y of i){const k=((g=y.signals)==null?void 0:g.length)??0;for(let R=0;R<k;R++)p.push(y.timestamp)}return $0(p,c,d)},[i,c,d]),h=Math.max(1,...v);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:G0.map(p=>{const g=p===c;return a.jsx("button",{type:"button",onClick:()=>u(p),"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:p},p)})})]}),a.jsxs("svg",{viewBox:`0 0 ${jl} 1`,preserveAspectRatio:"none",style:{width:"100%",height:o,color:"var(--c1)",display:"block"},children:[a.jsx("rect",{x:0,y:.985,width:jl,height:.015,fill:"var(--ink)",opacity:.08}),v.map((p,g)=>{const y=p===0?0:p/h,k=1-y;return a.jsx("rect",{x:g+.15,y:k,width:.7,height:Math.max(y,p>0?.04:0),rx:.06,ry:.06,fill:"currentColor",opacity:p===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:Y0[c]}),a.jsx("span",{children:"now"})]})]})}function V0(i){const c=[];for(const[u,o]of i.entries())c.push(`${u}:${o.rounds}:${o.confirmed}:${o.disputed}:${o.hallucinationsCaught}`);return c.sort(),c.join("|")}function Q0(i){const c=N.useRef(""),u=N.useRef(new Map);return N.useMemo(()=>{const o=S0(i??[]),d=V0(o);return d===c.current?u.current:(c.current=d,u.current=o,o)},[i])}function Z0(i){const c=[];for(const[u,o]of i.entries())c.push(`${u}:${o.critical}:${o.high}:${o.medium}:${o.low}`);return c.sort(),c.join("|")}function Th(i){const c=N.useRef(""),u=N.useRef(new Map);return N.useMemo(()=>{const o=new Map;if(i)for(const m of i){const v=[...m.confirmed??[],...m.disputed??[],...m.unique??[],...m.unverified??[]];for(const h of v){const p=h.originalAgentId;if(!p)continue;const g=o.get(p)??{critical:0,high:0,medium:0,low:0},y=h.severity??"low";y==="critical"?g.critical+=1:y==="high"?g.high+=1:y==="medium"?g.medium+=1:g.low+=1,o.set(p,g)}}const d=Z0(o);return d===c.current?u.current:(c.current=d,u.current=o,o)},[i])}function K0(){const[i,c]=N.useState(()=>typeof window>"u"?null:th(window.location.search));return N.useEffect(()=>{const u=()=>{const o=typeof window>"u"?null:th(window.location.search);c(d=>d===o?d:o)};return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),[i,Nh]}const J0=["1h","24h","7d","30d"];function F0(i){return typeof i=="string"&&J0.includes(i)}function fo(i){const c=new URLSearchParams(i).get("range");return F0(c)?c:null}function I0(i,c,u){const o=new URLSearchParams(c);u===null?o.delete("range"):o.set("range",u);const d=o.toString();return d.length>0?`${i}?${d}`:i}function lh(i){const c=globalThis;if(!c.window)return;const u=c.window,o=I0(u.location.pathname,u.location.search,i);o!==u.location.pathname+u.location.search&&(u.history.pushState({},"",o),u.dispatchEvent(new Event("dashboard:navigate")))}function W0(){const[i,c]=N.useState(()=>typeof window>"u"?"7d":fo(window.location.search)??"7d");return N.useEffect(()=>{typeof window<"u"&&fo(window.location.search)===null&&lh(i);const u=()=>{const o=typeof window>"u"?"7d":fo(window.location.search)??"7d";c(d=>d===o?d:o)};return window.addEventListener("dashboard:navigate",u),()=>window.removeEventListener("dashboard:navigate",u)},[]),[i,lh]}const P0=new Set(["textbox","combobox","listbox","spinbutton","searchbox"]);function eg(i){if(!(i instanceof Element))return!1;const c=i.tagName;if(c==="INPUT"||c==="TEXTAREA"||c==="SELECT"||i.isContentEditable===!0)return!0;const u=i.getAttribute("role");return u!==null&&P0.has(u)}function tg(i){N.useEffect(()=>{if(!i)return;function c(u){eg(u.target)||(u.metaKey||u.ctrlKey)&&(u.key==="d"||u.key==="D")||u.metaKey||u.ctrlKey||u.altKey||(u.key==="Enter"?(u.preventDefault(),us("/agent/"+encodeURIComponent(i))):(u.key==="g"||u.key==="G")&&(u.preventDefault(),us("/agent/"+encodeURIComponent(i)+"#skills")))}return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[i])}function ng(i){const c=globalThis.window,u=c!=null?c.location.search:"";return new URLSearchParams(u).get("graph")==="0"}function lg({overview:i,agents:c,tasks:u,consensus:o,consensusReports:d,fleetTrend:m,signalActivity:v,skills:h,activeTaskCount:p,setActiveTaskCount:g}){const y=i.actionableFindings,k=ng(),R=Q0(o==null?void 0:o.runs),X=Th(d==null?void 0:d.reports),O=N.useMemo(()=>{const z=new Map;if(m){for(const J of m.points){const le=z.get(J.agentId)??[];le.push(J),z.set(J.agentId,le)}for(const J of z.values())J.sort((le,F)=>le.day.localeCompare(F.day))}return z},[m]),[G,E]=K0(),[I,K]=W0();tg(G);const P=c&&G?c.find(z=>z.id===G)??null:null,[$,T]=N.useState(!k);function Z(){const z=!$;T(z);const J=new URL(window.location.href);z?J.searchParams.delete("graph"):J.searchParams.set("graph","0"),window.history.replaceState(null,"",J.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:[y>0&&a.jsxs("a",{href:Sn("/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:[y," actionable →"]}),c&&a.jsx("button",{type:"button",onClick:Z,className:"font-mono text-[10px] transition hover:underline",style:{color:"var(--text-dim)"},children:$?"[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."})]}),$&&c&&a.jsxs("div",{className:"space-y-3",children:[a.jsx(L0,{}),a.jsxs("div",{className:"flex items-stretch gap-3",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsx(C0,{agents:c,peerRelationships:R,selectedAgentId:G,onSelectAgent:E})}),a.jsx(D0,{selectedAgent:P,agents:c,peerRelationships:R})]}),o&&a.jsx(X0,{runs:o.runs,range:I,onRangeChange:K})]}),a.jsx(hv,{overview:i,activeTasks:p,mode:"calm"}),a.jsx(Ev,{onCountChange:g}),c&&a.jsx(yv,{agents:c,activity:v}),a.jsx(Wv,{}),u&&a.jsx(Qv,{tasks:u,limit:3}),c&&a.jsx(Lv,{agents:c,highlightedAgentId:$?G:null,severityMap:X,trendByAgent:O}),a.jsx(Pv,{overview:i}),a.jsx(i0,{skills:h??null})]})}const da={confirmed:"var(--ok)",disputed:"var(--bad)",unverified:"var(--info)",unique:"var(--ink-3)"},$i={confirmed:"confirmed",disputed:"disputed",unverified:"unverified",unique:"unique"},Oo={sonnet:"Sonnet",gemini:"Gemini",opus:"Opus",haiku:"Haiku",other:"Other"},ua=["confirmed","disputed","unverified","unique"],ag=.01;function sg({consensusId:i,data:c,onError:u}){const[o,d]=N.useState(c?{kind:"full",data:c}:i?{kind:"loading"}:{kind:"empty"});return N.useEffect(()=>{if(c)return;let m=!1;return d(v=>v.kind==="error"?v:{kind:"loading"}),fetch(`/dashboard/api/consensus-flow?consensusId=${encodeURIComponent(i)}`).then(async v=>{const h=await v.json().catch(()=>({}));if(!v.ok){const p=typeof(h==null?void 0:h.error)=="string"?h.error:`HTTP ${v.status}`;throw new Error(p)}return h}).then(v=>{m||d({kind:"full",data:v})}).catch(v=>{m||(d(h=>({kind:"error",error:v.message,stale:h.kind==="full"?h.data:void 0})),u==null||u(v))}),()=>{m=!0}},[i,c,u]),o.kind==="loading"?a.jsx(dg,{}):o.kind==="empty"?a.jsx(fg,{}):o.kind==="error"?a.jsx(mg,{error:o.error,stale:o.stale}):a.jsx(wh,{data:o.data})}function wh({data:i}){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:[i.summary.totalFindings," findings across ",i.agentCount," agents"]})]}),i.coverageDegraded&&a.jsx(ig,{degraded:i.coverageDegraded})]}),a.jsx("div",{className:"hidden lg:block",children:a.jsx(rg,{data:i})}),a.jsx("div",{className:"block lg:hidden",children:a.jsx(og,{data:i})}),a.jsx(ug,{data:i})]})}function ig({degraded:i}){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 ${i.expected}, received ${i.received}. Dropped: ${i.droppedAgents.join(", ")||"none"}`,children:"coverage degraded"})}const Uo=720,Li=320,Nn=120,To=0,wo=(Uo-Nn)/2,ah=Uo-Nn,mo=8;function rg({data:i}){const c=N.useMemo(()=>cg(i),[i]),u=N.useMemo(()=>c.edges,[c.edges]),o=hg();return a.jsxs("div",{className:"overflow-x-auto",children:[a.jsxs("svg",{viewBox:`0 0 ${Uo} ${Li}`,width:"100%",height:Li,role:"img","aria-label":`Consensus flow: ${i.summary.confirmed} confirmed, ${i.summary.disputed} disputed, ${i.summary.unverified} unverified, ${i.summary.unique} unique of ${i.summary.totalFindings} findings across ${i.agentCount} agents`,style:{display:"block"},children:[a.jsx("g",{children:u.map((d,m)=>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 ${m*40}ms both`},children:a.jsx("title",{children:d.tooltip})},`${d.fromFamily}-${d.toVerdict}`))}),a.jsx("g",{children:c.left.map(d=>a.jsxs("g",{children:[a.jsx("rect",{x:To,y:d.y,width:Nn,height:d.h,fill:"var(--ink-4)",fillOpacity:.18}),a.jsxs("text",{x:To+Nn-6,y:d.y+d.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)"},children:[Oo[d.family]," · ",d.agentCount]})]},d.family))}),a.jsx("g",{children:c.right.map(d=>a.jsxs("g",{children:[a.jsx("rect",{x:wo,y:d.y,width:Nn,height:d.h,fill:da[d.verdict],fillOpacity:.16}),a.jsxs("text",{x:wo+Nn/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:[$i[d.verdict]," · ",d.count]})]},d.verdict))}),a.jsx("g",{children:c.right.map(d=>{const m=i.summary.totalFindings>0?Math.round(d.count/i.summary.totalFindings*100):0;return a.jsxs("g",{children:[a.jsx("rect",{x:ah,y:d.y,width:Nn,height:d.h,fill:da[d.verdict],fillOpacity:.32}),a.jsxs("text",{x:ah+Nn-6,y:d.y+d.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)"},children:[d.count," · ",m,"%"]})]},d.verdict)})})]}),a.jsx("style",{children:`
|
|
59
|
+
@keyframes consensus-flow-ribbon-in {
|
|
60
|
+
from { opacity: 0; }
|
|
61
|
+
to { opacity: 1; }
|
|
62
|
+
}
|
|
63
|
+
@media (prefers-reduced-motion: reduce) {
|
|
64
|
+
svg * { animation: none !important; }
|
|
65
|
+
}
|
|
66
|
+
`})]})}function cg(i){const c=i.summary.totalFindings,u=Li-mo*2,o=new Map;for(const O of i.familyToOutcome)o.set(O.from.family,(o.get(O.from.family)??0)+O.to.count);const d=i.modelFamilyToFindings.reduce((O,G)=>O+(o.get(G.family)??0),0)||1;let m=mo;const v=i.modelFamilyToFindings.map(O=>{const G=o.get(O.family)??0,E=Math.max(20,G/d*u),I={family:O.family,y:m,h:E,agentCount:O.agentCount};return m+=E,I}),h=24;let p=mo;const g=ua.map(O=>{const G=i.summary[O],E=c>0?G/c:0,I=Math.max(h,E*u),K={verdict:O,y:p,h:I,count:G};return p+=I,K}),y=new Map,k=new Map,R=[],X=[...i.familyToOutcome].sort((O,G)=>O.from.family!==G.from.family?O.from.family.localeCompare(G.from.family):ua.indexOf(O.to.verdict)-ua.indexOf(G.to.verdict));for(const O of X){const G=v.find(ne=>ne.family===O.from.family),E=g.find(ne=>ne.verdict===O.to.verdict);if(!G||!E)continue;const I=o.get(O.from.family)??0,K=I>0?O.to.count/I*G.h:0,P=E.count||1,$=O.to.count/P*E.h,T=y.get(O.from.family)??0,Z=k.get(O.to.verdict)??0;if(y.set(O.from.family,T+K),k.set(O.to.verdict,Z+$),O.weight<ag)continue;const z=G.y+T,J=z+K,le=E.y+Z,F=le+$,de=To+Nn,te=wo,ae=de+(te-de)*.5,he=te-(te-de)*.5,M=`M ${de} ${z} C ${ae} ${z}, ${he} ${le}, ${te} ${le} L ${te} ${F} C ${he} ${F}, ${ae} ${J}, ${de} ${J} Z`,w=i.modelFamilyToFindings.find(ne=>ne.family===O.from.family),H=(w==null?void 0:w.agentCount)??0;R.push({path:M,color:da[O.to.verdict],tooltip:`${H} ${Oo[O.from.family]} agent${H===1?"":"s"} → ${O.to.count} ${$i[O.to.verdict]} finding${O.to.count===1?"":"s"} (${Math.round(O.weight*100)}%)`,fromFamily:O.from.family,toVerdict:O.to.verdict})}return{left:v,right:g,edges:R}}function og({data:i}){const c=i.summary.totalFindings||1;return a.jsxs("div",{className:"space-y-4",children:[a.jsx(ho,{label:"Model families",items:i.modelFamilyToFindings.map(u=>({key:u.family,label:`${Oo[u.family]} (${u.agentCount})`,value:u.agentCount,color:"var(--ink-4)"}))}),a.jsx(ho,{label:"Findings reviewed",items:ua.map(u=>({key:u,label:`${$i[u]} (${i.summary[u]})`,value:i.summary[u],color:da[u]}))}),a.jsx(ho,{label:"Outcome verdicts",items:ua.map(u=>({key:u,label:`${i.summary[u]} · ${Math.round(i.summary[u]/c*100)}%`,value:i.summary[u],color:da[u]}))})]})}function ho({label:i,items:c}){const u=c.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:i}),a.jsx("div",{className:"flex h-6 overflow-hidden rounded-sm border",style:{borderColor:"var(--border)"},children:c.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 ug({data:i}){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:[ua.map(c=>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:da[c]}}),$i[c]," · ",i.summary[c]]},c)),i.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 · ",i.summary.newFindings]})]})}function dg(){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:Li},children:[0,1,2].map(i=>a.jsx("div",{className:"flex flex-col gap-2",children:[0,1,2,3].map(c=>a.jsx("div",{className:"flex-1 animate-pulse rounded-sm",style:{background:"var(--border)",opacity:.6}},c))},i))}),a.jsx("style",{children:`
|
|
67
|
+
@media (prefers-reduced-motion: reduce) {
|
|
68
|
+
.animate-pulse { animation: none !important; }
|
|
69
|
+
}
|
|
70
|
+
`})]})}function fg(){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 mg({error:i,stale:c}){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:i,children:["error · ",i]})}),c?a.jsx("div",{style:{opacity:.5,pointerEvents:"none"},children:a.jsx(wh,{data:c})}):a.jsx("p",{className:"py-10 text-center font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"Failed to load consensus flow."})]})}function hg(){const[i,c]=N.useState(!1);return N.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const u=window.matchMedia("(prefers-reduced-motion: reduce)");c(u.matches);const o=d=>c(d.matches);return u.addEventListener("change",o),()=>u.removeEventListener("change",o)},[]),i}function xg({consensusId:i}){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:Sn("/"),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:i})]}),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(sg,{consensusId:i})]})}function pg({onLogin:i,error:c}){const[u,o]=N.useState(""),[d,m]=N.useState(!1),v=async p=>{if(p.preventDefault(),!(!u.trim()||d)){m(!0);try{await i(u.trim())}finally{m(!1)}}},h=c==="bad_key"?"Invalid key. Check your terminal for the correct key.":c==="network"?"Connection error — relay may be offline.":c==="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:v,children:[a.jsx("input",{type:"password",value:u,onChange:p=>o(p.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 Mh="dashboard:theme",vg=["light","dark"];function gg(i){return i==="light"||i==="dark"?i:i==="editorial"?"light":i==="default"?"dark":null}function yg(i,c){const u=gg(i);return u!==null?u:c?"dark":"light"}function bg(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function jg(){if(typeof window>"u")return"light";let i=null;try{i=window.localStorage.getItem(Mh)}catch{}return yg(i,bg())}function Ng(){const[i,c]=N.useState(jg);N.useEffect(()=>{typeof document>"u"||(i==="light"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=i)},[i]);function u(d){if(vg.includes(d)&&(c(d),typeof window<"u"))try{window.localStorage.setItem(Mh,d)}catch{}}return{theme:i,setTheme:u,toggle:()=>{u(i==="light"?"dark":"light")}}}const Sg=[{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."}],kg={background:"var(--surface-elev)",borderRadius:"16px",boxShadow:"var(--shadow-overlay)",border:"1px solid var(--border)",color:"var(--text)",fontFamily:"var(--font-sans)"};function _g({open:i,onClose:c}){const u=N.useRef(null);return N.useEffect(()=>{if(!i)return;const o=requestAnimationFrame(()=>{var m;(m=u.current)==null||m.focus()}),d=m=>{m.key==="Escape"&&c()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{cancelAnimationFrame(o),document.removeEventListener("keydown",d),document.body.style.overflow=""}},[i,c]),i?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:c,role:"presentation",children:a.jsxs("div",{className:"relative flex max-h-[calc(100vh-48px)] w-full max-w-2xl flex-col overflow-hidden",style:kg,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:c,"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:Sg.map(({term:o,definition:d,seeAlso:m})=>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}),m&&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: ",m]})]},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 Eg=[{to:"/",label:"Dashboard",match:i=>i==="/"||i==="/overview"},{to:"/team",label:"Team",match:i=>i==="/team"||i.startsWith("/agent/")},{to:"/debates",label:"Consensus Rounds",match:i=>i==="/debates"},{to:"/tasks",label:"Tasks",match:i=>i==="/tasks"},{to:"/signals",label:"Signals",match:i=>i==="/signals"},{to:"/logs",label:"Logs",match:i=>i==="/logs"}];function xo(){const[i,c]=N.useState(!1),u=ph(),{theme:o,toggle:d}=Ng();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:Sn("/"),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:Eg.map(m=>{const v=m.match(u);return a.jsx("a",{href:Sn(m.to),className:`rounded-md px-3.5 py-1.5 font-mono text-[13px] transition ${v?"font-semibold":"hover:bg-accent/10"}`,style:v?{background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"var(--accent)"}:{color:"var(--ink-3)"},children:m.label},m.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:()=>c(!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(_g,{open:i,onClose:()=>c(!1)})]})}const Tg={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 Ah({task:i,onClose:c}){if(N.useEffect(()=>{if(!i)return;const d=m=>{m.key==="Escape"&&c()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[i,c]),!i)return null;const u=Tg[i.status],o=(i.inputTokens||0)+(i.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:c,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:i.taskId.slice(0,8)}),a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(i.agentId)}`,className:"truncate font-mono text-xs transition",style:{color:"var(--text-dim)"},children:i.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:Pe(i.timestamp)}),i.duration!=null&&a.jsxs("span",{children:["· ",fv(i.duration)]}),o>0&&a.jsxs("span",{children:["· ",o.toLocaleString()," tokens (",(i.inputTokens||0).toLocaleString()," in / ",(i.outputTokens||0).toLocaleString()," out)"]})]})]}),a.jsx("button",{onClick:c,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:dv(i.task)}})]}),i.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:Hi(i.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:i.status==="running"?"Task is still running...":"No result recorded."})]})]})]})})}function Mo(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const po=5,vo={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"}},sh=[{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."}],wg=[{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)"}}],Mg={critical:"text-bad bg-bad/10",high:"text-severity-high bg-severity-high/10",medium:"text-severity-medium bg-severity-medium/10",low:""},Ag={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},Cg="[&_.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",zg={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 Rg({f:i,reviewInfo:c,diagnostics:u}){const o=i.tag==="confirmed"?"text-confirmed bg-confirmed/10 border-confirmed/20":i.tag==="disputed"?"text-disputed bg-disputed/10 border-disputed/20":i.tag==="unverified"?"text-unverified bg-unverified/10 border-unverified/20":"text-unique bg-unique/10 border-unique/20",d=i.severity&&Mg[i.severity]||"",m=i.severity==="low"?Ag:void 0,v=i.findingType==="suggestion"?"SUGGESTION":i.findingType==="insight"?"INSIGHT":null,h=i.findingType==="suggestion"?"text-info bg-info/10":i.findingType==="insight"?"text-text-dim bg-text-dim/10":"",p=i.finding.match(/<cite\s+tag="file">([^<]+)<\/cite>/),g=p?p[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:i.tag.toUpperCase()}),i.severity&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${d}`,style:m,children:i.severity.toUpperCase()}),v&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${h}`,children:v}),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:i.originalAgentId}),i.confirmedBy&&i.confirmedBy.length>0&&(()=>{const y=[...new Set(i.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:
|
|
71
|
+
${y.join(", ")}`,"data-tooltip-pos":"left",children:["+",y.length," ✓"]})})(),i.disputedBy&&i.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:
|
|
72
|
+
${i.disputedBy.map(y=>y.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[i.disputedBy.length," ⚡"]}),i.unverifiedBy&&i.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:
|
|
73
|
+
${i.unverifiedBy.map(y=>y.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[i.unverifiedBy.length," ◇"]})]}),u&&u.length>0&&a.jsx("div",{className:"mt-1.5 mb-1 space-y-1",children:u.map((y,k)=>a.jsxs("div",{className:"rounded border border-unverified/20 bg-unverified/5 px-2.5 py-1.5","data-diagnostic-code":y.code,children:[a.jsxs("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-unverified/80",children:["⚠ ",y.code]}),a.jsx("div",{className:"mt-0.5 text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},dangerouslySetInnerHTML:{__html:Mo(zg[y.code])+" — "+Mo(y.message)}})]},k))}),i.disputedBy&&i.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:i.disputedBy.map((y,k)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"font-mono font-bold text-disputed/70",children:y.agentId}),a.jsxs("span",{style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[" — ",y.reason||y.evidence||"No reason given"]})]},k))}),a.jsx("div",{className:`finding-md font-inter text-xs leading-relaxed ${Cg}`,style:{color:"var(--text-dim)"},dangerouslySetInnerHTML:{__html:Hi(i.finding)}}),c&&a.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[c.reviewers.map(y=>a.jsx("span",{title:y,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:en(y)},children:bo(y)},y)),a.jsxs("span",{className:`rounded px-1.5 py-0.5 font-mono text-[9px] font-bold ${c.assigned>=c.targetK?"text-confirmed/70 bg-confirmed/5":"text-unverified/70 bg-unverified/5"}`,children:[c.assigned>=c.targetK?"✓":"⚠"," ",c.assigned,"/",c.targetK]})]})]})}function Dg({consensus:i,reports:c,showAll:u=!1,hideHeader:o=!1,filteredRuns:d}){const m=d??i.runs,v=u?m:m.slice(0,po);!u&&m.length>po;const[h,p]=N.useState(null),[g,y]=N.useState("all"),[k,R]=N.useState("all"),[X,O]=N.useState(1),[G,E]=N.useState([]),[I,K]=N.useState(0),[P,$]=N.useState(!1),[T,Z]=N.useState({});N.useEffect(()=>{if(!u&&(c!=null&&c.reports)&&(E(c.reports),K(c.totalReports??c.reports.length),O(1)),c!=null&&c.roundRetractions){const M={};for(const w of c.roundRetractions)M[w.consensus_id]={reason:w.reason,retracted_at:w.retracted_at};Z(M)}},[c,u]),N.useEffect(()=>{if(!u)return;let M=!1;return(async()=>{var w;try{const H=await We("consensus-reports?page=1&pageSize=200");if(M)return;if(E(H.reports||[]),K(H.totalReports??(((w=H.reports)==null?void 0:w.length)||0)),O(1),H.roundRetractions){const ne={};for(const ce of H.roundRetractions)ne[ce.consensus_id]={reason:ce.reason,retracted_at:ce.retracted_at};Z(ne)}}catch{}})(),()=>{M=!0}},[u]);const z=G.slice().sort((M,w)=>w.timestamp.localeCompare(M.timestamp)),J=10,[le,F]=N.useState(0),de=Math.max(1,Math.ceil(z.length/J)),te=Math.min(le,de-1),ae=u?z.slice(te*J,(te+1)*J):z.slice(0,po),he=M=>{const w=new Date,H=new Date(M),ne=fe=>new Date(fe.getFullYear(),fe.getMonth(),fe.getDate()).getTime(),ce=Math.round((ne(w)-ne(H))/864e5);return ce<=0?"Today":ce===1?"Yesterday":ce<7?`${ce} days ago`:ce<30?`${Math.floor(ce/7)} weeks ago`:H.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:i.totalRuns??i.runs.length})]}),!u&&a.jsx("a",{href:"/dashboard/debates",className:"font-mono text-xs transition",style:{color:"var(--text-dim)"},children:"view all"})]}),ae.length>0?a.jsxs("div",{className:"space-y-2",children:[ae.map((M,w)=>{const H=w>0?ae[w-1]:null,ne=u?he(M.timestamp):null,ce=u&&H?he(H.timestamp):null,fe=u&&ne!==ce,j={};if(M.crossReviewAssignments||M.crossReviewCoverage){const W={};if(M.crossReviewAssignments)for(const[pe,Te]of Object.entries(M.crossReviewAssignments))for(const Fe of Te)(W[Fe]??(W[Fe]=[])).push(pe);if(M.crossReviewCoverage)for(const pe of M.crossReviewCoverage)j[pe.findingId]={reviewers:W[pe.findingId]||[],assigned:pe.assigned,targetK:pe.targetK};else for(const[pe,Te]of Object.entries(W))j[pe]={reviewers:Te,assigned:Te.length,targetK:Te.length}}const B=[...M.confirmed,...M.disputed,...M.unverified,...M.unique,...M.insights||[]],ee=g==="all"?B:g==="insight"?B.filter(W=>W.findingType==="insight"||W.findingType==="suggestion"):B.filter(W=>W.tag===g),Q=k==="all"?ee:ee.filter(W=>W.severity===k),q=h===M.id,se=(()=>{const W=new Set;return pe=>{var Yt;const Te=(Yt=M.authorDiagnostics)==null?void 0:Yt[pe.originalAgentId];if(!Te||Te.length===0)return;const Fe=Te.filter(lt=>{const ut=`${pe.originalAgentId}:${lt.code}`;return W.has(ut)?!1:(W.add(ut),!0)});return Fe.length>0?Fe:void 0}})(),oe=B.length||1,Me=M.confirmed.length,ye=M.disputed.length,Je=M.unverified.length,Ct=M.unique.length,mt=(M.insights||[]).length,kn=(()=>{if(oe===0)return"border-l-border/40";const W=Me/oe,pe=ye/oe;return W>=.5?"border-l-confirmed/60":pe>=.4?"border-l-disputed/60":"border-l-unverified/50"})(),jt=[{count:Me,textCls:"text-confirmed",label:"confirmed"},{count:ye,textCls:"text-disputed",label:"disputed"},{count:Je,textCls:"text-unverified",label:"unverified"},{count:Ct,textCls:"text-unique",label:"unique"},{count:mt,textCls:"text-zinc-400",label:"insights"}].filter(W=>W.count>0),Ae=[...new Set(B.map(W=>W.originalAgentId).filter(Boolean))],nn=Ae.slice(0,5),Zt=T[M.id],_n=!!Zt;return a.jsxs("div",{children:[fe&&a.jsxs("div",{className:`mb-2 flex items-center gap-3 ${w>0?"mt-4":""}`,children:[a.jsx("span",{className:"h-section",children:ne}),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
|
|
74
|
+
${kn}
|
|
75
|
+
${_n?"opacity-60 line-through decoration-disputed/40":""}
|
|
76
|
+
${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":_n?"true":void 0,children:[_n&&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"}),Zt.retracted_at&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",Zt.retracted_at.slice(0,10)]}),Zt.reason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",Zt.reason]})]}),a.jsxs("button",{className:"flex w-full items-start gap-3 px-3 py-2.5 text-left","aria-expanded":q,onClick:()=>{const W=!q;p(W?M.id:null),W&&(y("all"),R("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:B.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:[M.rounds,"r"]}),nn.length>0&&a.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[nn.map(W=>a.jsx("span",{title:W,className:"inline-flex h-4 w-4 items-center justify-center rounded-full font-mono text-[8px] font-bold",style:{color:"var(--surface)",backgroundColor:en(W)},children:bo(W)},W)),Ae.length>5&&a.jsxs("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["+",Ae.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:M.id,children:M.id.slice(0,8)}),M.zeroTagAgents&&M.zeroTagAgents.length>0&&(()=>{const W=M.zeroTagAgents,pe=M.zeroTagOverflow??0,Te=W.length+pe,Fe=pe>0?`${W.join(", ")} (+${pe} more)`:W.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: ${Fe}`,children:[Te," zero-tag"]})})(),M.droppedFindingsByType&&Object.keys(M.droppedFindingsByType).length>0&&(()=>{const W=Object.entries(M.droppedFindingsByType),pe=W.reduce((Fe,[,Yt])=>Fe+Yt,0),Te=W.map(([Fe,Yt])=>`${Fe}:${Yt}`).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=: ${Te}. These never reach the dashboard, scores, or signals.`,children:[pe," dropped"]})})(),M.warnings&&M.warnings.length>0&&(()=>{const W=new Map;for(const pe of M.warnings){const Te=W.get(pe.code)??[];Te.push(pe.agentId?`${pe.agentId}: ${pe.message}`:pe.message),W.set(pe.code,Te)}return Array.from(W.entries()).map(([pe,Te])=>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:Te.join(`
|
|
77
|
+
`),children:[pe,Te.length>1?` ×${Te.length}`:""]},pe))})(),a.jsx("span",{className:"ml-auto font-mono text-[10px] shrink-0",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:Pe(M.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex items-center gap-3",children:jt.map(W=>a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${W.textCls}`,children:[W.count," ",W.label]},W.label))}),M.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:M.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:"}),sh.map(W=>a.jsx("button",{onClick:()=>y(W.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${g===W.key?W.activeCls:W.cls}`,style:g===W.key?W.activeStyle:W.inactiveStyle,...W.tooltip?{"data-tooltip":W.tooltip}:{},children:W.label},W.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:"}),wg.map(W=>a.jsx("button",{onClick:()=>R(W.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${k===W.key?W.activeCls:W.cls}`,style:k===W.key?W.activeStyle:W.inactiveStyle,children:W.label},W.key))]}),(M.warnings??[]).filter(W=>W.code==="coverage_degraded").map((W,pe)=>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:["⚠ ",W.message]})},`cd-${pe}`)),M.zeroTagAgents&&M.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 — ",M.zeroTagAgents.length+(M.zeroTagOverflow??0)," agent",M.zeroTagAgents.length+(M.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:[M.zeroTagAgents.join(", "),M.zeroTagOverflow&&M.zeroTagOverflow>0?` (+${M.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 W=(M.warnings??[]).filter(Te=>Te.code==="cross_review_skipped");if(W.length===0)return null;const pe=W.map(Te=>Te.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: ",W.length," relay agent",W.length===1?"":"s"," failed Phase 2"]}),pe.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:pe.join(", ")})]})})(),(M.crossReviewAssignments||M.crossReviewCoverage)&&(()=>{const W=M.crossReviewAssignments||{},pe=Object.entries(W),Te=M.crossReviewCoverage||[],Fe=Te.length,Yt=Te.filter(ut=>ut.assigned<ut.targetK),lt=(M.warnings??[]).some(ut=>ut.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",lt&&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:[pe.length," reviewers · ",Fe," findings"]})]}),a.jsxs("div",{className:"border-t border-border/20 px-3 pb-3 pt-2 space-y-2",children:[pe.map(([ut,ma])=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{title:ut,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:en(ut)},children:bo(ut)}),a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:ut}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["(",ma.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1 ml-1",children:ma.map(Pn=>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:Pn.length>12?Pn.slice(0,12)+"…":Pn},Pn))})]},ut)),Fe>0&&a.jsx("div",{className:"mt-1 pt-1.5 border-t border-border/15",children:Yt.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:["⚠ ",Yt.length," of ",Fe," findings under-reviewed"]}):a.jsxs("span",{className:"font-mono text-[10px] font-semibold text-confirmed/60",children:["✓ All ",Fe," findings fully covered"]})})]})]})})(),a.jsx("div",{className:"space-y-3",children:Q.length===0?a.jsx("div",{className:"py-4 text-center text-xs",style:{color:"var(--text-dim)"},children:"No findings match this filter."}):Q.map((W,pe)=>a.jsx(Rg,{f:W,reviewInfo:W.id?j[W.id]:void 0,diagnostics:se(W)},pe))})]})]})]},M.id)}),u&&de>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:()=>F(M=>Math.max(0,M-1)),disabled:te===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 ",te+1," of ",de]}),a.jsx("button",{onClick:()=>F(M=>Math.min(de-1,M+1)),disabled:te>=de-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 ▸"})]})]}):v.length===0?a.jsx(fa,{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:v.map((M,w)=>{const H=M.counts,ne=(H.agreement||0)+(H.disagreement||0)+(H.hallucination||0)+(H.unverified||0)+(H.unique||0)+(H.new||0),ce=ne||1,fe=h===M.taskId,j=[{key:"confirmed",count:H.agreement||0,color:"bg-confirmed",text:"text-confirmed",label:"confirmed"},{key:"disputed",count:(H.disagreement||0)+(H.hallucination||0),color:"bg-disputed",text:"text-disputed",label:"disputed"},{key:"unverified",count:H.unverified||0,color:"bg-unverified",text:"text-unverified",label:"unverified"},{key:"unique",count:(H.unique||0)+(H.new||0),color:"bg-unique",text:"text-unique",label:"unique"}],B=M.signals.filter(Q=>{if(Q.signal==="signal_retracted")return!1;if(g==="all")return!!vo[Q.signal];const q=vo[Q.signal];return q&&q.filter===g}),ee=!!M.retracted;return a.jsxs("div",{className:`rounded-md border transition ${fe?"border-primary/25":"border-border"} ${ee?"opacity-60":""}`,style:{background:"var(--surface-elev)"},"data-retracted":ee?"true":void 0,title:ee&&M.retractionReason?`Retracted: ${M.retractionReason}`:void 0,children:[ee&&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"}),M.retractedAt&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",M.retractedAt.slice(0,10)]}),M.retractionReason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",M.retractionReason]})]}),a.jsxs("button",{"aria-expanded":fe,onClick:()=>{const Q=!fe;p(Q?M.taskId:null),Q&&(y("all"),R("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:fe?"var(--ink)":"var(--text-dim)",fontWeight:fe?600:400},children:fe?"▾":"▸"}),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:M.taskId}),a.jsxs("span",{className:`font-mono text-sm font-semibold ${ee?"line-through decoration-disputed/40":""}`,style:{color:"var(--text)"},children:[ne," findings"]}),a.jsxs("div",{className:"flex gap-1.5",children:[M.agents.slice(0,4).map(Q=>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:Q.split("-").map(q=>q[0]).join("").toUpperCase().slice(0,2)},Q)),M.agents.length>4&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:["+",M.agents.length-4]})]})]}),a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:Pe(M.timestamp)})]}),a.jsx("div",{className:"mt-2 flex gap-2",children:j.map(Q=>Q.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${Q.text} ${ee?"line-through decoration-disputed/40":""}`,children:[Q.count," ",Q.label]},Q.key))}),a.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-sm",children:j.map(Q=>Q.count>0&&a.jsx("div",{className:`${Q.color} transition-all`,style:{width:`${Q.count/ce*100}%`}},Q.key))})]})]}),fe&&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:sh.map(Q=>a.jsx("button",{onClick:()=>y(Q.key),className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${g===Q.key?Q.activeCls:Q.cls} hover:opacity-80`,style:g===Q.key?Q.activeStyle:Q.inactiveStyle,...Q.tooltip?{"data-tooltip":Q.tooltip}:{},children:Q.label},Q.key))}),B.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:B.map((Q,q)=>{const se=vo[Q.signal];return se?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 ${se.cls}`,children:se.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:Hi(Q.evidence||"")}})}),a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[Q.agentId,Q.counterpartId?` + ${Q.counterpartId}`:""]})]})]},q):null})})]})]},M.taskId+w)})})]})}const Ri=25;function Og({commits:i}){const[c,u]=N.useState(!1);if(i.length===0)return a.jsx("span",{style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"—"});const o=i[0],d=o.includes(" ")?o.slice(o.indexOf(" ")+1):o,m=i.length-1;return a.jsxs("span",{className:"font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--text)"},children:d}),m>0&&a.jsxs(a.Fragment,{children:[" ",a.jsx("button",{type:"button","aria-expanded":c,onClick:()=>u(v=>!v),className:"font-mono text-[10px] underline",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:c?"(collapse)":`(+${m} more)`}),c&&a.jsx("ul",{className:"mt-1 space-y-0.5 pl-2",children:i.slice(1).map((v,h)=>{const p=v.includes(" ")?v.slice(v.indexOf(" ")+1):v;return a.jsx("li",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:p},h)})})]})]})}function Ug({row:i}){const c=i.preSha.slice(0,8),u=i.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:Pe(i.detectedAt)}),a.jsx("td",{className:"max-w-[160px] truncate whitespace-nowrap py-3 pr-4",children:a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(i.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:i.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:c}),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(Og,{commits:i.commits})})]})}function qg(){const[i,c]=N.useState([]),[u,o]=N.useState(0),[d,m]=N.useState(1),[v,h]=N.useState(!1),[p,g]=N.useState(null);N.useEffect(()=>{let k=!1;return h(!0),g(null),We(`violations?page=${d}&pageSize=${Ri}`).then(R=>{k||(c(R.items??[]),o(R.total??0))}).catch(R=>{k||g(String((R==null?void 0:R.message)??R))}).finally(()=>{k||h(!1)}),()=>{k=!0}},[d]);const y=Math.max(1,Math.ceil(u/Ri));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:[p&&a.jsx("div",{className:"border-b border-border/60 bg-disputed/10 px-3 py-2 font-mono text-[10px] text-disputed",children:p}),!p&&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:[!v&&i.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"})}),v&&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…"})}),!v&&i.map(k=>a.jsx(Ug,{row:k},`${k.taskId}-${k.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:v?"loading…":u===0?"no violations":`${(d-1)*Ri+1}–${Math.min(d*Ri,u)} of ${u}`}),a.jsxs("div",{className:`flex items-center gap-2 font-mono text-[10px] ${y<=1?"invisible":""}`,style:{color:"var(--text-dim)"},children:[a.jsx("button",{type:"button",onClick:()=>m(k=>Math.max(1,k-1)),disabled:d===1||v,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," / ",y]}),a.jsx("button",{type:"button",onClick:()=>m(k=>Math.min(y,k+1)),disabled:d>=y||v,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 Bg({categoryAccuracy:i,categoryCorrect:c,categoryHallucinated:u}){const o=Object.keys(i??{});if(o.length===0)return a.jsx(fa,{title:"No category data yet",hint:"Accuracy accrues after ≥5 signals per category.",compact:!0});const d=o.map(m=>{const v=Math.max(0,Math.min(1,i[m]??0)),h=(c==null?void 0:c[m])??0,p=(u==null?void 0:u[m])??0;return{key:m,acc:v,c:h,h:p,n:h+p}}).sort((m,v)=>v.acc-m.acc);return a.jsx("div",{className:"space-y-2",children:d.map(m=>{const v=m.acc>=.7?"bg-confirmed":m.acc>=.4?"bg-unverified":"bg-disputed",h=m.n>0?`${m.c} correct / ${m.h} hallucinated / ${m.n} total`:void 0;return a.jsxs("div",{className:`grid grid-cols-[128px_1fr_auto_44px] items-center gap-3 ${m.n>0&&m.n<10?"opacity-50":""}`,title:m.n>0&&m.n<10?`${h} — low sample (n<10)`:h,children:[a.jsx("span",{className:"truncate font-mono text-[11px]",style:{color:"var(--text-dim)"},children:m.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 ${v}`,style:{width:`${m.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:m.n>0?a.jsxs(a.Fragment,{children:[m.c,"/",m.n,m.h>0&&a.jsxs("span",{className:"ml-1 text-disputed/70",children:["·",m.h,"✗"]})]}):"—"}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums",style:{color:"var(--text)"},children:[Math.round(m.acc*100),"%"]})]},m.key)})})}const Lg=new Set(["passed","failed","silent_skill","insufficient_evidence","flagged_for_manual_review"]);function Hg(i,c,u){return(!i||!Lg.has(i))&&c!==void 0&&u!==void 0&&u>0}const $g={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"},Gg={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 Yg(i){const c=Math.round(i*100),u=c>0?"+":"";return c>0?{text:`${u}${c}pp`,cls:"text-confirmed"}:c<0?{text:`${u}${c}pp`,cls:"text-disputed"}:{text:`${u}${c}pp`,cls:"",clsStyle:{color:"var(--text-dim)"}}}function Xg({slot:i}){const c=i.status,u=c?Gg[c]:"border-border/50",o=!c||c==="pending"?{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"var(--text-dim)"}:void 0,d=c==="inconclusive"&&(i.inconclusiveStrikes??0)>0,m=i.forcedDevelops??[],v=m.length>0?m[m.length-1]:null,h=typeof i.effectiveness=="number"?Yg(i.effectiveness):null,p=Hg(c,i.postBindSignals,i.minEvidence);return a.jsxs("div",{className:`rounded-md border p-3 ${i.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 ${i.enabled?"":"line-through"}`,style:{color:i.enabled?"var(--text)":"var(--text-dim)"},children:[i.mode==="contextual"&&"⚡ ",i.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:i.source}),i.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 ",Pe(i.boundAt)]}),p&&(()=>{const g=i.postBindSignals,y=i.minEvidence,k=Math.round(g/y*100),R=Math.min(g/y,1)*100;return a.jsxs("div",{className:"mt-1.5",title:`MIN_EVIDENCE gate: ${g} of ${y} post-bind signals (${k}%)`,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," / ",y]}),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}%`}})})]})})()]}),c&&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:$g[c],children:c.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:i.inconclusiveAt?`last strike ${Pe(i.inconclusiveAt)}`:void 0,children:[i.inconclusiveStrikes," strike",i.inconclusiveStrikes===1?"":"s"]})]}),m.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:v!=null&&v.reason?`latest: ${v.reason}`:void 0,children:["forced ",m.length," time",m.length===1?"":"s",v&&` · last ${Pe(v.timestamp)}`]})]})}function Vg({open:i,onOpenChange:c,children:u}){return N.useEffect(()=>{if(!i)return;const o=m=>{m.key==="Escape"&&c(!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}},[i,c]),i?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:()=>c(!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 Qg({side:i="right",className:c="",children:u,style:o,...d}){return a.jsx("div",{className:`h-full p-6 ${c}`,style:{background:"var(--surface-elev)",...o},...d,children:u})}function Zg({className:i="",...c}){return a.jsx("div",{className:`mb-2 ${i}`,...c})}function Kg({className:i="",...c}){return a.jsx("h2",{className:`font-semibold ${i}`,...c})}function Jg({citation:i}){const c=i.snippet.split(`
|
|
78
|
+
`);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:[i.file,":",i.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:c.map((u,o)=>a.jsx("div",{className:"whitespace-pre",children:u||" "},o))})]})}const ih={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:""},Fg={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},rh={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"},Ig={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 Wg(){const i=(c,u)=>a.jsx("div",{className:`${c} ${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:[i("h-3.5","w-12"),i("h-3.5","w-14"),i("h-3.5","w-16")]}),a.jsxs("div",{className:"space-y-2",children:[i("h-2","w-full"),i("h-2","w-[92%]"),i("h-2","w-[70%]")]}),a.jsxs("div",{className:"space-y-2",children:[i("h-2","w-16"),i("h-12","w-full")]}),a.jsxs("div",{className:"space-y-2",children:[i("h-2","w-16"),i("h-2","w-[60%]"),i("h-2","w-[45%]")]}),a.jsxs("div",{className:"space-y-2",children:[i("h-2","w-20"),i("h-2","w-full"),i("h-2","w-[80%]")]})]})}function Gi({open:i,onOpenChange:c,consensusId:u,findingId:o}){const[d,m]=N.useState(null),[v,h]=N.useState(null);return N.useEffect(()=>{if(!i||!u||!o){m(null),h(null);return}m(null),h(null),We(`finding/${encodeURIComponent(u)}/${encodeURIComponent(o)}`).then(m).catch(p=>h(p.message||"failed to load finding"))},[i,u,o]),a.jsx(Vg,{open:i,onOpenChange:c,children:a.jsxs(Qg,{side:"right",className:"w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto",style:Ig,children:[a.jsx(Zg,{children:a.jsx(Kg,{className:"font-mono text-sm",style:{color:"var(--text)"},children:"Finding detail"})}),v&&a.jsx("div",{className:"mt-4",children:a.jsx(Do,{message:v})}),!v&&!d&&a.jsx(Wg,{}),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 ${rh[d.finding.tag]||""}`,style:rh[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 ${ih[d.finding.severity]||""}`,style:d.finding.severity==="low"?Fg:ih[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((p,g)=>a.jsx(Jg,{citation:p},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((p,g)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-disputed",children:"✗"})," disputed by ",p.agentId,": ",a.jsx("span",{style:{color:"var(--text-dim)"},children:p.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((p,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:p.signal}),a.jsx("span",{style:{color:"var(--text-dim)"},children:"·"}),a.jsx("span",{children:p.agentId}),p.counterpartId&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"var(--text-dim)"},children:"→"}),a.jsx("span",{children:p.counterpartId})]}),a.jsx("span",{className:"ml-auto",style:{color:"var(--text-dim)"},children:Pe(p.timestamp)})]}),p.evidence&&a.jsx("div",{className:"mt-0.5",style:{color:"var(--text-dim)"},children:p.evidence.slice(0,200)})]},g))})]}),a.jsx("div",{className:"pt-2 border-t border-border/40",children:a.jsxs("a",{href:Sn(`/consensus/${d.consensusId}`),className:"font-mono text-[10px] hover:underline",style:{color:"var(--accent)"},children:["→ consensus round ",d.consensusId]})})]})]})})}const Pg={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 ey({agentId:i}){const[c,u]=N.useState([]),[o,d]=N.useState(!0),[m,v]=N.useState("all"),[h,p]=N.useState(null);N.useEffect(()=>{let R=!1;return d(!0),We(`signals?agent=${encodeURIComponent(i)}&limit=100`).then(X=>{R||(u(X.items||[]),d(!1))}).catch(()=>{R||(u([]),d(!1))}),()=>{R=!0}},[i]);const g=[...c].sort((R,X)=>(X.timestamp||"").localeCompare(R.timestamp||"")),y=m==="all"||m==="signals"?g:[],k=({k:R,label:X,enabled:O})=>a.jsx("button",{type:"button",onClick:()=>O&&v(R),disabled:!O,className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${O?"":"opacity-40 cursor-not-allowed"}`,style:m===R?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:X});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(k,{k:"all",label:"All",enabled:!0}),a.jsx(k,{k:"signals",label:"Signals",enabled:!0}),a.jsx(k,{k:"tasks",label:"Tasks (none yet)",enabled:!1}),a.jsx(k,{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…"}):y.length===0?a.jsx(fa,{title:"No activity yet",hint:"Signals, task completions, and skill binds will appear here.",compact:!0}):a.jsx("div",{className:"space-y-1",children:y.map((R,X)=>{const O=Pg[R.signal]||"text-text-dim",G=!!(R.consensusId&&R.findingId),E=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:Pe(R.timestamp)}),a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${O}`,children:R.signal}),a.jsxs("div",{className:"min-w-0 flex-1 text-[11px]",style:{color:"var(--text-dim)"},children:[R.counterpartId&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:["→ ",R.counterpartId," · "]}),R.evidence&&a.jsx("span",{children:R.evidence.length>160?R.evidence.slice(0,160)+"…":R.evidence})]})]});return G?a.jsx("button",{type:"button",onClick:()=>p({consensusId:R.consensusId,findingId:R.findingId}),className:"w-full rounded-sm text-left transition hover:bg-accent/10",children:E},X):a.jsx("div",{children:E},X)})}),a.jsx(Gi,{open:!!h,onOpenChange:R=>{R||p(null)},consensusId:(h==null?void 0:h.consensusId)??null,findingId:(h==null?void 0:h.findingId)??null})]})}function ty(){const i=N.useRef(null),[c,u]=N.useState(0);return N.useEffect(()=>{const o=i.current;if(!o||typeof ResizeObserver>"u")return;const d=new ResizeObserver(m=>{for(const v of m)u(v.contentRect.width)});return d.observe(o),()=>d.disconnect()},[]),[i,c]}const ch={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"},ny={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"},ly=6,ay=500,Ch=100,sy=150;function iy(i){if(i<=0)return Ch;const c=Math.floor(i/ly);return Math.max(1,Math.min(c,ay))}function ry({agentId:i}){const[c,u]=N.useState([]),[o,d]=N.useState(0),[m,v]=N.useState(!1),[h,p]=N.useState(null),[g,y]=ty(),[k,R]=N.useState(Ch),X=N.useRef(null);N.useEffect(()=>{if(y<=0)return;const K=iy(y);return X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{R(P=>P===K?P:K)},sy),()=>{X.current&&clearTimeout(X.current)}},[y]),N.useEffect(()=>{We(`signals?agent=${encodeURIComponent(i)}&limit=${k}`).then(K=>{u(K.items||[]),d(K.total||0)}).catch(()=>{})},[i,k]);const O=N.useMemo(()=>[...c].reverse(),[c]),G={confirmed:0,disputed:0,unique:0,unverified:0,fabricated:0};for(const K of c)K.signal==="agreement"||K.signal==="consensus_verified"?G.confirmed++:K.signal==="disagreement"||K.signal==="hallucination_caught"?G.disputed++:K.signal==="unique_confirmed"||K.signal==="unique_unconfirmed"||K.signal==="new_finding"?G.unique++:K.signal==="unverified"?G.unverified++:K.signal==="citation_fabricated"&&G.fabricated++;const E=c.length,I=o>E;return c.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(fa,{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:I?`last ${E} 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:[G.confirmed," confirmed"]}),G.disputed>0&&a.jsxs("span",{className:"text-disputed",children:[G.disputed," disputed"]}),G.unique>0&&a.jsxs("span",{className:"text-unique",children:[G.unique," unique"]}),G.unverified>0&&a.jsxs("span",{className:"text-unverified",children:[G.unverified," unverified"]}),G.fabricated>0&&a.jsxs("span",{className:"text-amber-500",children:[G.fabricated," fabricated"]})]})]}),a.jsx("div",{className:"flex items-center gap-0.5",children:O.map((K,P)=>{const $=!!(K.consensusId&&K.findingId);return a.jsx("button",{type:"button",disabled:!$,onClick:()=>{K.consensusId&&K.findingId&&(p({consensusId:K.consensusId,findingId:K.findingId}),v(!0))},className:`h-4 min-w-[4px] flex-1 rounded-sm transition-opacity hover:opacity-80 ${ch[K.signal]||""} ${$?"cursor-pointer":"cursor-default"}`,style:ch[K.signal]?void 0:{background:"var(--surface-sunk)"},title:`${ny[K.signal]||K.signal} — ${Pe(K.timestamp)}${$?" (click for detail)":""}`},P)})}),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(K=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:`h-2 w-2 rounded-sm ${K.color}`}),a.jsx("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:K.label})]},K.label))}),a.jsx(Gi,{open:m,onOpenChange:v,consensusId:(h==null?void 0:h.consensusId)??null,findingId:(h==null?void 0:h.findingId)??null})]})}function cy(i){const c=i.toLowerCase();return c==="completed"||c==="done"||c==="success"||c==="succeeded"?"completed":c==="running"||c==="active"||c==="in_progress"||c==="pending"?"running":c==="failed"||c==="error"||c==="errored"||c==="timeout"||c==="timed_out"?"failed":c==="cancelled"||c==="canceled"||c==="queued"||c==="waiting"?"cancelled":"unknown"}const oy={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}},uy={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 dy(i){if(!i)return"—";if(i<1e3)return"< 1s";if(i<6e4)return Math.floor(i/1e3)+"s";if(i<36e5){const o=Math.floor(i/6e4),d=Math.floor(i%6e4/1e3);return d>0?`${o}m ${d}s`:`${o}m`}const c=Math.floor(i/36e5),u=Math.floor(i%36e5/6e4);return u>0?`${c}h ${u}m`:`${c}h`}function zh({task:i,onClick:c}){const u=cy(i.status),o=oy[u];return a.jsxs("tr",{className:`border-b border-border hover:bg-accent/10 transition-colors ${c?"cursor-pointer":""}`,onClick:c?d=>{d.target.closest("a")||c(i)}: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:uy[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:i.taskId,children:i.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(i.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:en(i.agentId)}}),i.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=i.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":dy(i.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:Pe(i.timestamp)})]})}function Xe({className:i="",style:c}){return a.jsx("div",{className:`rounded ${i}`,style:{background:"color-mix(in oklch, var(--border) 40%, transparent)",...c}})}function fy(){return a.jsxs("div",{className:"mx-auto max-w-5xl space-y-6 px-6 py-6",children:[a.jsx(Xe,{className:"h-48 w-full"}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[a.jsx(Xe,{className:"h-36"}),a.jsx(Xe,{className:"h-36"}),a.jsx(Xe,{className:"h-36"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[a.jsx(Xe,{className:"h-48"}),a.jsx(Xe,{className:"h-48"})]})]})}function my(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(Xe,{className:"mb-2 h-7 w-32"}),a.jsx(Xe,{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((i,c)=>a.jsx(Xe,{className:"h-16"},c))}),a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:6}).map((i,c)=>a.jsx(Xe,{className:"h-12"},c))})]})}function hy(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(Xe,{className:"mb-2 h-7 w-24"}),a.jsx(Xe,{className:"h-3 w-32"})]}),a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:8}).map((i,c)=>a.jsx(Xe,{className:"h-11"},c))})]})}function xy(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(Xe,{className:"mb-2 h-7 w-48"}),a.jsx(Xe,{className:"h-3 w-64"})]}),a.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((i,c)=>a.jsxs("div",{className:"overflow-hidden rounded-md",children:[a.jsx(Xe,{className:"h-14"}),a.jsx("div",{className:"mt-px space-y-px",children:Array.from({length:3}).map((u,o)=>a.jsx(Xe,{className:"h-10"},o))})]},c))})]})}function py(){return a.jsx("div",{className:"space-y-2",children:Array.from({length:4}).map((i,c)=>a.jsxs("div",{className:"flex items-start gap-3 py-2",children:[a.jsx(Xe,{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(Xe,{className:"h-3 w-3/4"}),a.jsx(Xe,{className:"h-3 w-1/2"})]})]},c))})}function vy(){return a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:5}).map((i,c)=>a.jsx(Xe,{className:"h-10"},c))})}const gy=3,yy=720*60*60*1e3;function by({agentId:i,agents:c,tasks:u,consensus:o}){const d=c.find(q=>q.id===i),[m,v]=N.useState([]),[h,p]=N.useState(!0),[g,y]=N.useState([]),[k,R]=N.useState(!0),[X,O]=N.useState(null),[G,E]=N.useState(null),[I,K]=N.useState(null),[P,$]=N.useState(0),[T,Z]=N.useState(0),[z,J]=N.useState(null);N.useEffect(()=>{p(!0),We(`memory/${i}`).then(q=>{v(q.knowledge||[])}).catch(()=>v([])).finally(()=>p(!1))},[i]),N.useEffect(()=>{let q=!1;return R(!0),We("consensus-reports?page=1&pageSize=200").then(se=>{q||y(se.reports||[])}).catch(()=>{q||y([])}).finally(()=>{q||R(!1)}),()=>{q=!0}},[]);const le=N.useMemo(()=>{var Me;const q=Date.now(),se=new Map;for(const ye of g){const Je=Date.parse(ye.timestamp);if(Number.isNaN(Je)||q-Je>yy)continue;const Ct=(Me=ye.authorDiagnostics)==null?void 0:Me[i];if(Ct)for(const mt of Ct)se.set(mt.code,(se.get(mt.code)??0)+1)}const oe=[];for(const[ye,Je]of se)Je>=gy&&oe.push({code:ye,count:Je});return oe},[g,i]);if(!d)return a.jsxs("div",{className:"py-20 text-center",style:{color:"var(--text-dim)"},children:["Agent not found: ",i]});const F=d.scores,de=(u==null?void 0:u.items.filter(q=>q.agentId===i))||[],te=(o==null?void 0:o.runs.filter(q=>q.agents.includes(i)))||[],ae=[{label:"accuracy",value:F.accuracy,fill:F.accuracy>=.7?"bg-confirmed":F.accuracy>=.4?"bg-unverified":"bg-disputed"},{label:"unique",value:F.uniqueness,fill:"bg-unique"},{label:"impact",value:F.impactScore,fill:"bg-[var(--c8)]"}],he=F.unverifiedsEmitted??0,M=F.unverifiedsReceived??0,w=he+M,H=[{label:"Signals",value:String(F.signals),color:"",colorStyle:{color:"var(--text)"}},{label:"Agreements",value:String(F.agreements),color:"text-confirmed",colorStyle:void 0},{label:"Disagreements",value:String(F.disagreements),color:"text-disputed",colorStyle:void 0},{label:"Hallucinations",value:String(F.hallucinations),color:F.hallucinations>0?"text-disputed":"",colorStyle:F.hallucinations>0?void 0:{color:"var(--text-dim)"}},{label:"Unverified",value:w>0?`${he}↑ ${M}↓`:"0",color:w>0?"text-unverified":"",colorStyle:w>0?void 0:{color:"var(--text-dim)"},title:w>0?`${he} emitted (as reviewer) · ${M} received (as author)`:void 0},{label:"Tokens",value:d.totalTokens.toLocaleString(),color:"",colorStyle:{color:"var(--text)"}}],ne=10,ce=Math.max(1,Math.ceil(de.length/ne)),fe=Math.min(P,ce-1),j=de.slice(fe*ne,(fe+1)*ne),B=N.useMemo(()=>{const q=new Map;for(const se of m){const oe=se.filename.match(/^(\d{4}-\d{2}-\d{2})/),Me=oe?oe[1]:"undated",ye=q.get(Me)||[];ye.push(se),q.set(Me,ye)}return Array.from(q.entries()).sort(([se],[oe])=>se==="undated"?1:oe==="undated"?-1:oe.localeCompare(se)).map(([se,oe])=>({day:se,items:oe}))},[m]),ee=Math.min(T,Math.max(0,B.length-1)),Q=B[ee];return a.jsxs(a.Fragment,{children:[(()=>{const q=Ro(F);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 (",F.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:[F.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 (",F.bench.reason??"rule","), but is the sole provider of a category — kept to preserve coverage."]})]})}):null})(),le.length>0&&a.jsx("div",{className:"mb-6 space-y-2",children:le.map(({code:q,count:se})=>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:Mo(q)}}),a.jsxs("span",{className:"font-mono text-[11px] text-unverified/60",children:["· ",se," 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(F.accuracy*100)}% · Uniqueness ${Math.round(F.uniqueness*100)}% · Impact ${Math.round(F.impactScore*100)}%`,children:a.jsx(fs,{agentId:d.id,size:120,signals:F.signals,accuracy:F.accuracy,uniqueness:F.uniqueness,impact:F.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:[F.signals," signals",d.lastTask?` · ${Pe(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 ${F.dispatchWeight.toFixed(2)}
|
|
79
|
+
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:F.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(ry,{agentId:i})}),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:ae.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:H.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(Bg,{categoryAccuracy:F.categoryAccuracy,categoryCorrect:F.categoryCorrect,categoryHallucinated:F.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(Xg,{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:de.length})]}),ce>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{onClick:()=>$(q=>Math.max(0,q-1)),disabled:fe===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:[fe+1," / ",ce]}),a.jsx("button",{onClick:()=>$(q=>Math.min(ce-1,q+1)),disabled:fe>=ce-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 ▸"})]})]}),de.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(zh,{task:q,onClick:J},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",!k&&a.jsxs("span",{style:{color:"var(--ink)",fontWeight:700},children:[" ",te.length]})]}),k?a.jsx(vy,{}):te.length>0?a.jsx("div",{className:"space-y-2",children:te.slice(0,20).map((q,se)=>{const oe=q.counts,Me=(oe.agreement||0)+(oe.disagreement||0)+(oe.hallucination||0)+(oe.unverified||0)+(oe.unique||0)+(oe.new||0),ye=Me||1,Je=[{key:"confirmed",count:oe.agreement||0,color:"bg-confirmed",text:"text-confirmed"},{key:"disputed",count:(oe.disagreement||0)+(oe.hallucination||0),color:"bg-disputed",text:"text-disputed"},{key:"unverified",count:oe.unverified||0,color:"bg-unverified",text:"text-unverified"},{key:"unique",count:(oe.unique||0)+(oe.new||0),color:"bg-unique",text:"text-unique"}],Ct={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"}},mt=q.signals.filter(Ae=>Ae.signal!=="signal_retracted"&&Ct[Ae.signal]),kn=q.taskId+":"+se,jt=G===kn;return a.jsxs("div",{className:"rounded-md border border-border/40",style:{background:"var(--surface-elev)"},children:[a.jsx("button",{type:"button",onClick:()=>E(jt?null:kn),disabled:mt.length===0,className:`flex w-full items-center p-3 text-left transition ${mt.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:[mt.length>0&&a.jsx("span",{className:"mr-1.5 inline-block",style:{color:"var(--text-dim)"},children:jt?"▾":"▸"}),Me," findings"]}),a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:Pe(q.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex gap-2",children:Je.map(Ae=>Ae.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${Ae.text}`,children:[Ae.count," ",Ae.key]},Ae.key))}),a.jsx("div",{className:"mt-1.5 flex h-1.5 overflow-hidden rounded-sm",children:Je.map(Ae=>Ae.count>0&&a.jsx("div",{className:Ae.color,style:{width:`${Ae.count/ye*100}%`}},Ae.key))})]})}),jt&&mt.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:mt.map((Ae,nn)=>{const Zt=Ct[Ae.signal],_n=!!(Ae.findingId&&q.taskId),W=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 ${Zt.cls}`,children:Zt.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:Hi(Ae.evidence||"")}}),a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[Ae.agentId,Ae.counterpartId?` + ${Ae.counterpartId}`:""]})]})]});return _n?a.jsx("button",{type:"button",onClick:()=>K({consensusId:q.taskId,findingId:Ae.findingId}),className:"block w-full rounded-sm text-left transition hover:bg-accent/10",children:W},nn):a.jsx("div",{children:W},nn)})})})]},kn)})}):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(ey,{agentId:i})}),a.jsx(Gi,{open:!!I,onOpenChange:q=>{q||K(null)},consensusId:(I==null?void 0:I.consensusId)??null,findingId:(I==null?void 0:I.findingId)??null}),a.jsx(Ah,{task:z,onClose:()=>J(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:[" ",m.length," files"]}),!h&&Q&&a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:["· ",Q.day," (",Q.items.length,")"]})]}),!h&&B.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:()=>Z(q=>Math.max(0,q-1)),disabled:ee===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:[ee+1," / ",B.length]}),a.jsx("button",{onClick:()=>Z(q=>Math.min(B.length-1,q+1)),disabled:ee>=B.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(py,{}):Q&&Q.items.length>0?a.jsx("div",{className:"space-y-1.5",children:Q.items.map(q=>{var ye,Je;const se=X===q.filename,oe=((ye=q.frontmatter)==null?void 0:ye.type)||"memory",Me=((Je=q.frontmatter)==null?void 0:Je.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:()=>O(se?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:se?"var(--text)":"var(--text-dim)"},children:se?"▾":"▸"}),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:oe}),a.jsx("span",{className:"truncate font-mono text-xs font-semibold",style:{color:"var(--text)"},children:Me}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:q.filename})]}),se&&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 oh={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)"}},jy={error:"text-disputed",timeout:"text-unverified"},Ny=[[/^\[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 Sy(i){for(const[c,u]of Ny)if(c.test(i))return u;return"other"}const ky=[{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"}],uh=1e3;function _y(){const[i,c]=N.useState([]),[u,o]=N.useState(0),[d,m]=N.useState(0),[v,h]=N.useState("all"),[p,g]=N.useState(!0),[y,k]=N.useState(!0),R=N.useRef(null),X=N.useRef(0);N.useEffect(()=>{let E=!1;return(async()=>{try{const K=await We("logs?tail=500");if(E)return;c(K.entries),o(K.totalLines),m(K.fileSize),X.current=K.totalLines+1}catch{}})(),()=>{E=!0}},[]),N.useEffect(()=>{if(y)return kh(E=>{var K;if(E.type!=="log_lines")return;const I=(K=E.data)==null?void 0:K.lines;I!=null&&I.length&&c(P=>{const $=I.map((Z,z)=>({line:X.current+z,text:Z,category:Sy(Z)}));X.current+=I.length,o(Z=>Z+I.length);const T=[...P,...$];return T.length>uh?T.slice(-uh):T})})},[y]),N.useEffect(()=>{p&&R.current&&R.current.scrollIntoView({behavior:"smooth"})},[i,p]);const O=v==="all"?i:i.filter(E=>E.category===v),G=N.useCallback(E=>E<1024?`${E} B`:E<1048576?`${(E/1024).toFixed(1)} KB`:`${(E/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:G(d)}),y&&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:[ky.map(E=>a.jsx("button",{onClick:()=>h(E.key),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:v===E.key?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:E.label},E.key)),a.jsxs("div",{className:"ml-auto flex gap-1.5",children:[a.jsx("button",{onClick:()=>k(!y),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${y?"bg-confirmed/10 text-confirmed":""}`,style:y?void 0:{color:"var(--text-dim)"},children:y?"● Live":"○ Paused"}),a.jsx("button",{onClick:()=>g(!p),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:p?{color:"var(--ok)",background:"color-mix(in oklch, var(--ok) 10%, transparent)"}:{color:"var(--text-dim)"},children:p?"⤓ 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:[O.map(E=>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:E.line}),a.jsx("span",{className:jy[E.category]??"",style:oh[E.category]??oh.other,children:E.text})]},E.line)),O.length===0&&a.jsx("div",{className:"py-8 text-center font-mono text-xs",style:{color:"var(--text-dim)"},children:i.length===0?"Loading...":v==="all"?"No log entries in current tail.":`No ${v} entries in current tail.`}),a.jsx("div",{ref:R})]})})]})}const Ey=["critical","high","medium","low"],Ty=["manual","impl","meta","auto-provisional"];function dh(i,c){return i.includes(c)?i.filter(u=>u!==c):[...i,c]}const Wt="mb-1 block h-section",Pt={},In="w-full rounded border border-border px-2 py-1 font-mono text-[10px] focus:border-primary focus:outline-none",Wn={background:"var(--surface)",color:"var(--text)"};function wy({filters:i,onChange:c,agents:u,signalTypes:o}){const d=m=>v=>{const h=v.target.value;c({[m]: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:()=>c({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:Wt,style:Pt,children:["Agents (",i.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(m=>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:i.agents.includes(m),onChange:()=>c({agents:dh(i.agents,m)})}),a.jsx("span",{children:m})]},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Counterpart"}),a.jsxs("select",{className:In,style:Wn,value:i.counterpart??"",onChange:d("counterpart"),children:[a.jsx("option",{value:"",children:"any"}),u.map(m=>a.jsx("option",{value:m,children:m},m))]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:Wt,style:Pt,children:["Signal types (",i.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(m=>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:i.signals.includes(m),onChange:()=>c({signals:dh(i.signals,m)})}),a.jsx("span",{children:m})]},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Severity"}),a.jsxs("select",{className:In,style:Wn,value:i.severity??"",onChange:d("severity"),children:[a.jsx("option",{value:"",children:"any"}),Ey.map(m=>a.jsx("option",{value:m,children:m},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,"data-tooltip":"manual = operator-recorded · impl = implementer pipeline · meta = orchestrator self-telemetry · auto-provisional = unvalidated",children:"Source"}),a.jsxs("select",{className:In,style:Wn,value:i.source??"",onChange:d("source"),children:[a.jsx("option",{value:"",children:"any"}),Ty.map(m=>a.jsx("option",{value:m,children:m},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Category"}),a.jsx("input",{type:"text",className:In,style:Wn,value:i.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:Wt,style:Pt,children:"Since"}),a.jsx("input",{type:"datetime-local",className:In,style:Wn,value:i.since?i.since.slice(0,16):"",onChange:m=>c({since:m.target.value?new Date(m.target.value).toISOString():void 0})})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Until"}),a.jsx("input",{type:"datetime-local",className:In,style:Wn,value:i.until?i.until.slice(0,16):"",onChange:m=>c({until:m.target.value?new Date(m.target.value).toISOString():void 0})})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Consensus ID (prefix)"}),a.jsx("input",{type:"text",className:In,style:Wn,value:i.consensusId??"",onChange:d("consensusId"),placeholder:"e.g. d07eac46"})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Finding ID (prefix)"}),a.jsx("input",{type:"text",className:In,style:Wn,value:i.findingId??"",onChange:d("findingId"),placeholder:"e.g. d07eac46-5f464e89:sonnet"})]})]})}const fh={agents:[],signals:[]},My=["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"],Ay={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"},Cy={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)"},cs=100;function Ry(){if(typeof window>"u")return{filters:fh,hadAny:!1};const i=new URLSearchParams(window.location.search),c=i.getAll("signal").filter(Boolean),u=i.get("agent"),o=i.get("counterpart")??void 0,d=i.get("category")??void 0,m=i.get("severity"),v=m==="critical"||m==="high"||m==="medium"||m==="low"?m:void 0,h=i.get("since")??void 0,p=i.get("until")??void 0,g=i.get("consensus_id")??void 0,y=i.get("finding_id")??void 0,k=i.get("source"),R=k==="manual"||k==="impl"||k==="meta"||k==="auto-provisional"?k:void 0;return c.length>0||u||o||d||v||h||p||g||y||R?{filters:{agents:u?[u]:[],signals:c,counterpart:o,category:d,severity:v,since:h,until:p,consensusId:g,findingId:y,source:R},hadAny:!0}:{filters:fh,hadAny:!1}}function Dy(i,c,u=cs){const o=new URLSearchParams;o.set("limit",String(u)),o.set("offset",String(c)),i.agents.length===1&&o.set("agent",i.agents[0]),i.counterpart&&o.set("counterpart",i.counterpart);for(const d of i.signals)o.append("signal",d);return i.category&&o.set("category",i.category),i.severity&&o.set("severity",i.severity),i.since&&o.set("since",i.since),i.until&&o.set("until",i.until),i.consensusId&&o.set("consensus_id",i.consensusId),i.findingId&&o.set("finding_id",i.findingId),i.source&&o.set("source",i.source),o}function go(i,c){return i?i.length>c?i.slice(0,c)+"…":i:""}function Oy(){const[{filters:i,hadAny:c}]=N.useState(Ry),[u,o]=N.useState(i),[d,m]=N.useState([]),[v,h]=N.useState(0),[p,g]=N.useState(0),[y,k]=N.useState(!1),[R,X]=N.useState(null),[O,G]=N.useState([]),[E,I]=N.useState(!1),[K,P]=N.useState(null),[$,T]=N.useState(null),Z=N.useRef(null),z=N.useRef(0),J=N.useCallback(async(M,w)=>{const H=++z.current;k(!0),X(null);try{const ne=Dy(M,w*cs),ce=await We(`signals?${ne.toString()}`);if(H!==z.current)return;m(ce.items??[]),g(ce.total??0)}catch(ne){if(H!==z.current)return;X(ne instanceof Error?ne.message:"fetch failed")}finally{H===z.current&&k(!1)}},[]);N.useEffect(()=>{We("agents").then(M=>{const w=(M??[]).map(H=>H.id).filter(Boolean).sort();w.length>0&&G(w)}).catch(()=>{})},[]),N.useEffect(()=>{h(0)},[u]),N.useEffect(()=>(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{J(u,v)},250),()=>{Z.current&&clearTimeout(Z.current)}),[u,v,J]);const le=N.useCallback(M=>{o(w=>({...w,...M}))},[]),F=Math.max(1,Math.ceil(p/cs)),de=Math.min(v,F-1),te=p>0||c||y,ae=(M,w)=>{!M||!w||(P(M),T(w),I(!0))},he=N.useMemo(()=>{const M=[];return u.agents.length&&M.push(`${u.agents.length} agents`),u.signals.length&&M.push(`${u.signals.length} signals`),u.severity&&M.push(u.severity),u.source&&M.push(u.source),(u.since||u.until)&&M.push("time window"),M.length?M.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:[he," — showing ",d.length," of ",p]})]})}),c&&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:Sn("/signals"),style:{color:"var(--accent)"},children:"Clear filters"})]}),a.jsxs("div",{className:`grid grid-cols-1 gap-4 ${te?"lg:grid-cols-[260px_1fr]":""} lg:items-start`,children:[te&&a.jsx("div",{className:c?"opacity-70 transition-opacity hover:opacity-100 focus-within:opacity-100":void 0,children:a.jsx(wy,{filters:u,onChange:le,agents:O,signalTypes:My})}),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:[R&&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:R}),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&&!y&&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((M,w)=>{const H=!!(M.consensusId&&M.findingId),ne=M.severity?zy[M.severity]:"transparent",ce=Cy[M.signal]??"var(--ink-2)",fe=Ay[M.signal]??M.signal;return a.jsxs("tr",{className:`border-b border-border/30 ${H?"cursor-pointer transition-colors":""}`,style:H?{"--row-hover-bg":"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"}:void 0,role:H?"button":void 0,tabIndex:H?0:void 0,"aria-label":H?`View finding ${M.findingId??""}`:void 0,onMouseEnter:j=>{H&&(j.currentTarget.style.background="color-mix(in oklch, var(--surface-sunk) 40%, transparent)")},onMouseLeave:j=>{H&&(j.currentTarget.style.background="")},onClick:()=>H&&ae(M.consensusId,M.findingId),onKeyDown:j=>{H&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),ae(M.consensusId,M.findingId))},children:[a.jsx("td",{className:"p-0",style:{background:ne,width:6},title:M.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:M.timestamp,children:Pe(M.timestamp)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"var(--text)"},children:M.agentId}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1",children:a.jsx("span",{className:"h-section",style:{color:ce,fontSize:11},children:fe})}),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:M.evidence,children:go(M.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:M.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:M.findingId,children:M.findingId?go(M.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:M.consensusId,children:M.consensusId?go(M.consensusId,16):"—"})]},`${M.timestamp}-${M.agentId}-${w}`)})]})]})}),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:y?"loading…":`${de*cs+1}–${de*cs+d.length} of ${p}`}),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(M=>Math.max(0,M-1)),disabled:de===0||y,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:[de+1," / ",F]}),a.jsx("button",{type:"button",onClick:()=>h(M=>Math.min(F-1,M+1)),disabled:de>=F-1||y,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(Gi,{open:E,onOpenChange:I,consensusId:K,findingId:$})]})}function Uy(){if(typeof window>"u")return null;const i=new URLSearchParams(window.location.search),c=i.get("key");if(c===null)return null;i.delete("key");const u=i.toString(),o=window.location.pathname+(u?`?${u}`:"")+window.location.hash;return window.history.replaceState(null,"",o),c.trim()||null}function qy(){const[i,c]=N.useState(null),[u,o]=N.useState(null),d=N.useRef(!1),m=N.useCallback(async h=>{o(null);const p=await Sv(h);p.ok?c(!0):(o(p.kind),c(!1))},[]),v=N.useCallback(async()=>{if(d.current)return i===!0;d.current=!0;try{const h=await jo();return c(h),h}finally{d.current=!1}},[i]);return N.useEffect(()=>{let h=!1;const p=Uy();return d.current=!0,(async()=>{try{if(await jo()){h||c(!0);return}if(p){h||await m(p);return}h||c(!1)}finally{d.current=!1}})(),()=>{h=!0}},[m]),{authed:i,login:m,error:u,recheck:v}}function By(i,c){const u=c.match(/^API error: (\d+)$/),o=u?`HTTP ${u[1]}`:c;return`${i}: ${o}`}const Ly=5e3;async function Di(i,c){try{return await We(c)}catch(u){const o=u instanceof Error?u.message:String(u);throw new Error(By(i,o))}}function Hy(i){const[c,u]=N.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=N.useRef(!1),d=N.useRef(i);d.current=i;const m=N.useCallback(async()=>{var v;if(!o.current){o.current=!0;try{const[h,p,g,y,k,R,X,O,G,E]=await Promise.all([Di("overview","overview"),Di("agents","agents"),Di("tasks","tasks?limit=2000"),Di("consensus","consensus?pageSize=500"),We("consensus-reports?page=1&pageSize=200").catch(()=>({reports:[]})),We("fleet-trend?days=7").catch(()=>({days:7,points:[]})),We("signal-activity").catch(()=>({agents:[],total:0,generatedAt:""})),We("skills").catch(()=>({index:{},suggestions:[],effectiveness:[]})),We("native-memory").catch(()=>({knowledge:[]})),We("gossip-memory").catch(()=>({knowledge:[]}))]),I=[...G.knowledge||[]].map(P=>({...P,origin:"native"})).sort((P,$)=>$.filename>P.filename?1:-1),K=[...E.knowledge||[]].map(P=>({...P,origin:"gossip"})).sort((P,$)=>$.filename>P.filename?1:-1);u({overview:h,agents:p,tasks:g,consensus:y,consensusReports:k,fleetTrend:R,signalActivity:X,skills:O,nativeMemories:I,gossipMemories:K,memories:I,loading:!1,error:null})}catch(h){Nv(h)?((v=d.current)==null||v.call(d),u(p=>({...p,loading:!1}))):u(p=>({...p,loading:!1,error:h.message}))}finally{o.current=!1}}},[]);return N.useEffect(()=>{m()},[m]),N.useEffect(()=>{const v=setInterval(()=>{m()},Ly);return()=>clearInterval(v)},[m]),{...c,refresh:m}}const Rh="dashboard:lastEventId";function $y(){if(typeof window>"u")return 0;const i=window.localStorage.getItem(Rh);if(!i)return 0;const c=parseInt(i,10);return Number.isFinite(c)?c:0}function Gy(i){typeof window>"u"||window.localStorage.setItem(Rh,String(i))}const mh=1e3,Yy=5e3;function Xy(i){N.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let c=null,u=null,o=mh,d=!1;function m(){if(d)return;const v=$y();c=new window.EventSource(`/dashboard/api/events?last_id=${v}`),c.onmessage=h=>{try{const p=JSON.parse(h.data);i(p),Gy(p.id),o=mh}catch{}},c.onerror=()=>{c&&(c.close(),c=null),!d&&(u=setTimeout(()=>{m()},o),o=Math.min(o*2,Yy))}}return m(),()=>{d=!0,u!==null&&clearTimeout(u),c&&(c.close(),c=null)}},[])}const hh=5,Vy=6e3;function Qy({toast:i,onDismiss:c}){const u=N.useRef(null),o=N.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),d=N.useCallback(()=>{o(),u.current=setTimeout(()=>c(i.id),Vy)},[i.id,c,o]);N.useEffect(()=>(d(),o),[d,o]);const{type:m,payload:v}=i.event,h=m==="task.completed"?a.jsx("span",{style:{color:"var(--text-dim)"},children:"✓"}):v.confirmed>v.disputed?a.jsx("span",{className:"text-confirmed",children:"◎"}):a.jsx("span",{className:"text-disputed",children:"◎"});let p;if(m==="task.completed"){const y=String(v.agentId??"agent"),k=typeof v.durationMs=="number"?v.durationMs:null,R=k!==null?`${(k/1e3).toFixed(1)}s`:"—";p=`${y} finished in ${R}`}else{const y=Number(v.confirmed??0),k=Number(v.disputed??0);p=`Consensus done — ${y} confirmed · ${k} disputed`}const g=()=>{o(),m==="task.completed"&&v.taskId?us("/tasks"):m==="consensus.completed"&&v.consensusId&&us("/debates"),c(i.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",i.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:p,className:"font-mono text-[11px] min-w-0 truncate",style:{color:"var(--text)"},children:p}),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:y=>{y.stopPropagation(),o(),c(i.id)},"aria-label":"Dismiss notification",children:"×"})]})})}function Zy(){const[i,c]=N.useState([]),u=N.useCallback(d=>{c(m=>m.map(v=>v.id===d?{...v,exiting:!0}:v)),setTimeout(()=>{c(m=>m.filter(v=>v.id!==d))},250)},[]),o=N.useCallback(d=>{c(m=>{const v={id:d.id,event:d,exiting:!1},h=[...m,v];if(h.length>hh){const p=h.length-hh;return h.slice(p)}return h})},[]);return Xy(o),a.jsx("div",{className:"fixed bottom-4 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:i.map(d=>a.jsx(Qy,{toast:d,onDismiss:u},d.id))})}const xh=1e3,Ky=5e3,Jy="/dashboard/api/bridge/stream",Fy=4,Iy="/dashboard/api/bridge",Wy=3e4;function Py(i){switch(i){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 ${i}`}}let eb=1;function Oi(i,c,u){return{id:eb++,role:i,text:c,ts:u??new Date().toISOString()}}function tb(){const[i,c]=N.useState([]),[u,o]=N.useState("connecting"),[d,m]=N.useState(!1),[v,h]=N.useState(null),[p,g]=N.useState(null),y=N.useRef(null),k=N.useCallback(X=>{y.current=X,h(X)},[]);N.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let X=null,O=null,G=xh,E=!1,I=0;function K(){E||(o("connecting"),X=new window.EventSource(Jy),X.onopen=()=>{E||(I=0,o("open"),G=xh)},X.onmessage=P=>{let $;try{$=JSON.parse(P.data)}catch{return}const T=y.current;!T||$.chat_id!==T||($.type==="reply"?(m(!1),c(Z=>[...Z,Oi("assistant",$.text??"",$.ts)])):$.type==="ack"?c(Z=>[...Z,Oi("ack","received — working…",$.ts)]):$.type==="error"&&(m(!1),c(Z=>[...Z,Oi("error",$.text??"the live session reported an error",$.ts)])))},X.onerror=()=>{X&&(X.close(),X=null),!E&&(I+=1,I>=Fy?o("error"):o("connecting"),O=setTimeout(()=>K(),G),G=Math.min(G*2,Ky))})}return K(),()=>{E=!0,o("closed"),O!==null&&clearTimeout(O),X&&(X.close(),X=null)}},[]);const R=N.useCallback(async X=>{const O=X.trim();if(O.length===0)return;g(null),c(P=>[...P,Oi("user",O)]),m(!0);const G=y.current,E={message:O};G&&(E.chat_id=G);const I=new AbortController,K=setTimeout(()=>I.abort(),Wy);try{const P=await fetch(Iy,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(E),signal:I.signal});let $={};try{$=await P.json()}catch{}if(typeof $.chat_id=="string"&&$.chat_id.length>0&&!y.current&&k($.chat_id),P.status===202)return;m(!1),g($.error??Py(P.status))}catch(P){m(!1);const $=P instanceof Error&&P.name==="AbortError";g($?"send timed out — relay unreachable":"send failed — relay unreachable")}finally{clearTimeout(K)}},[k]);return{messages:i,status:u,awaitingReply:d,chatId:v,send:R,sendError:p}}function nb(i){const c=new Date(i);return Number.isNaN(c.getTime())?"":c.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function lb({msg:i}){const c=i.role==="user",u=i.role==="error";if(i.role==="ack")return a.jsx("div",{className:"flex justify-center py-0.5",children:a.jsx("span",{className:"rounded-full px-2 py-0.5 font-mono text-[10px]",style:{color:"var(--idle)",background:"color-mix(in oklch, var(--idle) 12%, transparent)"},children:i.text})});const d=u?{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 10%, transparent)",border:"1px solid color-mix(in oklch, var(--bad) 30%, transparent)"}:c?{color:"var(--text)",background:"var(--surface-sunk)",border:"1px solid var(--border)"}:{color:"var(--text)",background:"var(--surface-elev)",border:"1px solid var(--border)"};return a.jsxs("div",{className:`flex flex-col ${c?"items-end":"items-start"} gap-0.5`,children:[a.jsxs("div",{className:"max-w-[85%] whitespace-pre-wrap break-words rounded-lg px-3 py-2 text-[13px] leading-snug",style:d,children:[u&&a.jsx("span",{className:"h-section mb-0.5 block",style:{color:"var(--bad)"},children:"session error"}),i.text]}),a.jsx("span",{className:"px-1 font-mono text-[11px]",style:{color:"var(--text-dim)"},children:nb(i.ts)})]})}function ab({status:i}){const c={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:u,label:o}=c[i]??c.closed;return a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${i==="connecting"?"animate-pulse":""}`,style:{background:u},"aria-hidden":!0}),a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:o})]})}function sb(){const[i,c]=N.useState(!1),[u,o]=N.useState(""),{messages:d,status:m,awaitingReply:v,chatId:h,send:p,sendError:g}=tb(),y=N.useRef(null),k=N.useRef(null);N.useEffect(()=>{if(!i)return;const O=y.current;O&&(O.scrollTop=O.scrollHeight)},[d,v,i]),N.useEffect(()=>{var O;i&&((O=k.current)==null||O.focus())},[i]);const R=()=>{const O=u.trim();O&&(p(O),o(""))},X=O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),R())};return i?a.jsxs("div",{className:"fixed bottom-4 left-4 z-50 flex w-[360px] max-w-[calc(100vw-2rem)] flex-col rounded-xl",style:{height:"min(560px, calc(100vh - 2rem))",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(ab,{status:m})]}),a.jsx("div",{className:"mt-0.5 truncate font-mono text-[10px]",style:{color:"var(--text-dim)"},children:h?`chat ${h.slice(0,8)}`:"same session as your terminal"})]}),a.jsx("button",{type:"button",onClick:()=>c(!1),className:"shrink-0 rounded px-2 py-1 text-sm leading-none transition-colors hover:[background:var(--surface-sunk)]",style:{color:"var(--text-dim)"},"aria-label":"Collapse chat dock",children:"–"})]}),a.jsxs("div",{ref:y,className:"flex-1 space-y-2 overflow-y-auto px-3 py-3",children:[d.length===0?a.jsxs("div",{className:"flex h-full flex-col items-center justify-center px-4 text-center",children:[a.jsx("div",{className:"text-xs",style:{color:"var(--text-dim)"},children:m==="connecting"?"connecting to the live session…":"no messages yet"}),a.jsx("div",{className:"mt-1 text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:"Type below to steer or start work. This reaches the same Claude Code session running in your terminal."})]}):d.map(O=>a.jsx(lb,{msg:O},O.id)),v&&a.jsxs("div",{className:"flex items-center gap-2 px-1 py-1",children:[a.jsx("span",{className:"inline-flex gap-1","aria-hidden":!0,children:a.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full",style:{background:"var(--text-faint)"}})}),a.jsx("span",{className:"text-[10px]",style:{color:"var(--text-dim)"},children:"working…"})]})]}),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:k,value:u,onChange:O=>o(O.target.value),onKeyDown:X,rows:1,placeholder:"Message the live session… (Enter to send)",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:R,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:()=>c(!0),className:"fixed bottom-4 left-4 z-50 flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-colors",style:{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":"right",children:[a.jsx("span",{"aria-hidden":!0,children:"◎"}),a.jsx("span",{children:"Live session"})]})}function ib({agents:i,tasks:c,consensusReports:u,fleetTrend:o}){const[d,m]=N.useState("weight"),[v,h]=N.useState("desc"),[p,g]=N.useState(""),y=N.useMemo(()=>{const T=new Map;if(c)for(const Z of c.items){const z=T.get(Z.agentId);(!z||Z.timestamp>z.timestamp)&&T.set(Z.agentId,Z)}return T},[c]);Th(u==null?void 0:u.reports),N.useMemo(()=>{const T=new Map;if(o){for(const Z of o.points){const z=T.get(Z.agentId)??[];z.push(Z),T.set(Z.agentId,z)}for(const Z of T.values())Z.sort((z,J)=>z.day.localeCompare(J.day))}return T},[o]);const k=i.filter(Uv).length,R=i.filter(T=>T.scores.accuracy>=.5).length,X=i.reduce((T,Z)=>T+Z.scores.signals,0),O=i.reduce((T,Z)=>T+Z.totalTokens,0),G=p.trim().toLowerCase(),E=G?i.filter(T=>T.id.toLowerCase().includes(G)||T.provider.toLowerCase().includes(G)||T.model.toLowerCase().includes(G)):i,I=T=>{const Z=T.scores;switch(d){case"weight":return Z.dispatchWeight;case"accuracy":return Z.accuracy;case"uniqueness":return Z.uniqueness;case"impact":return Z.impactScore;case"signals":return Z.signals;case"agreements":return Z.agreements;case"hallucinations":return Z.hallucinations;case"lastTask":{const z=y.get(T.id);return z?new Date(z.timestamp).getTime():0}}},K=[...E].sort((T,Z)=>{const z=I(T),J=I(Z);return v==="desc"?J-z:z-J}),P=T=>{d===T?h(Z=>Z==="desc"?"asc":"desc"):(m(T),h("desc"))},$=T=>d===T?v==="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:i.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:R,varColor:"var(--ok)"},{label:"Benched",value:k,varColor:k>0?"var(--bad)":"var(--ink-3)"},{label:"Total Signals",value:X.toLocaleString(),varColor:"var(--ink)"},{label:"Tokens Used",value:O.toLocaleString(),varColor:"var(--ink)"}].map(T=>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:T.varColor},children:T.value}),a.jsx("div",{className:"h-section mt-0.5",children:T.label})]},T.label))})]}),a.jsx("div",{className:"mb-3",children:a.jsx("input",{type:"text",value:p,onChange:T=>g(T.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:()=>P("weight"),children:["Weight ",$("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:()=>P("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",$("accuracy")]}),a.jsx("span",{style:{color:"color-mix(in oklch, var(--ink-3) 30%, transparent)"},children:"·"}),a.jsxs("button",{onClick:()=>P("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",$("uniqueness")]}),a.jsx("span",{style:{color:"color-mix(in oklch, var(--ink-3) 30%, transparent)"},children:"·"}),a.jsxs("button",{onClick:()=>P("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",$("impact")]})]})}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>P("signals"),children:["Signals ",$("signals")]}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>P("hallucinations"),"data-tooltip":"Hallucinations — fabricated findings caught by cross-review",children:["Halluc ",$("hallucinations")]}),a.jsxs("th",{className:"h-section py-2.5 pr-5 text-left cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>P("lastTask"),children:["Last Task ",$("lastTask")]})]})}),a.jsx("tbody",{children:K.map((T,Z)=>{const z=T.scores,J=y.get(T.id),le=z.dispatchWeight>=1.2?"var(--ok)":z.dispatchWeight>=.8?"var(--ink)":"var(--bad)",F=Z+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:F===1?"var(--ink)":F===2||F===3?"color-mix(in oklch, var(--ink-2) 80%, transparent)":"var(--ink-3)",fontWeight:F===1?"bold":F<=3?600:void 0},children:F})}),a.jsx("td",{className:"py-2.5 pr-3 align-top",children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(T.id)}`,className:"flex items-center gap-3",children:[a.jsx(fs,{agentId:T.id,size:32,signals:z.signals,accuracy:z.accuracy,uniqueness:z.uniqueness,impact:z.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:T.id}),(()=>{const de=Ro(z);return de==="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 (${z.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"benched"}):de==="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"}):de==="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 (${z.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:[T.provider,"/",T.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:le},children:z.dispatchWeight.toFixed(2)})}),a.jsx("td",{className:"py-3 pr-4 align-top",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(yo,{label:"A",value:z.accuracy,fillClass:z.accuracy>=.7?"bg-confirmed":z.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(yo,{label:"U",value:z.uniqueness,fillClass:"bg-unique",tooltip:"Uniqueness — findings this agent surfaced that no other agent found"}),a.jsx(yo,{label:"I",value:z.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:z.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:z.hallucinations>0?"var(--bad)":"var(--ink-3)",fontWeight:z.hallucinations>10?"bold":void 0},"data-tooltip":`Agreements ${z.agreements} · Disagreements ${z.disagreements} · Hallucinations ${z.hallucinations}`,children:z.hallucinations})}),a.jsx("td",{className:"py-3 pr-5 align-top",children:J?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:J.taskId.slice(0,8)}),a.jsx("span",{className:"truncate text-[11px]",style:{maxWidth:260,color:"var(--ink-2)"},children:J.task}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--ink-3)"},children:Pe(J.timestamp)})]}):a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:"no tasks"})})]},T.id)})})]})})]})}function yo({label:i,value:c,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:i}),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,c*100))}%`}})}),a.jsxs("span",{className:"w-8 text-right font-mono text-[10px] tabular-nums",style:{color:"var(--ink-2)"},children:[Math.round(c*100),"%"]})]})}function rb({tasks:i}){const[c,u]=N.useState(""),[o,d]=N.useState(0),[m,v]=N.useState(null),h=100,p=i.items.filter(E=>E.status==="completed").length,g=i.items.filter(E=>E.status==="failed").length,y=i.items.filter(E=>E.status==="running").length,k=c.trim().toLowerCase(),R=k?i.items.filter(E=>{var I,K,P,$;return((I=E.task)==null?void 0:I.toLowerCase().includes(k))||((K=E.agentId)==null?void 0:K.toLowerCase().includes(k))||((P=E.taskId)==null?void 0:P.toLowerCase().includes(k))||(($=E.status)==null?void 0:$.toLowerCase().includes(k))}):i.items,X=Math.max(1,Math.ceil(R.length/h)),O=Math.min(o,X-1),G=R.slice(O*h,(O+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:i.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:p})," completed"]}),g>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:g})," failed"]}),y>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:y})," running"]}),a.jsxs("span",{children:["showing ",G.length," of ",R.length,k&&` (filtered from ${i.items.length})`]})]})]}),a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[a.jsx("input",{type:"text",value:c,onChange:E=>{u(E.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] ${X<=1?"invisible":""}`,style:{color:"var(--ink-3)"},children:[a.jsx("button",{onClick:()=>d(E=>Math.max(0,E-1)),disabled:O===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:[O+1," / ",X]}),a.jsx("button",{onClick:()=>d(E=>Math.min(X-1,E+1)),disabled:O>=X-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:G.length===0?a.jsx("div",{className:"py-12 text-center text-sm",style:{color:"var(--ink-3)"},children:k?"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:G.map(E=>a.jsx(zh,{task:E,onClick:v},E.taskId))})]})}),a.jsx(Ah,{task:m,onClose:()=>v(null)})]})}function cb({consensus:i,consensusReports:c}){const[u,o]=N.useState(!1),d=u?i.runs:i.runs.filter(g=>!g.retracted),m=i.runs.filter(g=>g.retracted).length,v=d.reduce((g,y)=>g+(y.counts.agreement||0),0),h=d.reduce((g,y)=>g+((y.counts.disagreement||0)+(y.counts.hallucination||0)),0),p=d.reduce((g,y)=>g+(y.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&&m>0&&a.jsxs("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:["/ ",i.totalRuns??i.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:v})," confirmed"]}),a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:h})," disputed"]}),p>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:p})," unverified"]}),a.jsxs("span",{children:[i.totalSignals," total signals"]})]}),m>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?`${m} retracted run${m===1?"":"s"} shown`:`${m} retracted run${m===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(Dg,{consensus:i,filteredRuns:d,reports:c,showAll:!0,hideHeader:!0})]})}function ob({onUnauthorized:i}){const c=ph(),{overview:u,agents:o,tasks:d,consensus:m,consensusReports:v,fleetTrend:h,signalActivity:p,skills:g,loading:y,error:k,refresh:R}=Hy(i),[X,O]=N.useState(0),G=N.useCallback(T=>{T.type!=="log_lines"&&R()},[R]);if(_h(G),!y&&k&&(!u||!m))return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(xo,{}),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:k}),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(y||!u||!m)return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(xo,{}),a.jsx(fy,{})]});let E;const I=c.match(/^\/agent\/(.+)$/),K=c.match(/^\/consensus\/(.+)$/);if(I&&o){const T=decodeURIComponent(I[1]);E=a.jsx(by,{agentId:T,agents:o,tasks:d,consensus:m})}else if(K){const T=decodeURIComponent(K[1]);E=a.jsx(xg,{consensusId:T})}else c==="/team"?E=o?a.jsx(ib,{agents:o,tasks:d,consensusReports:v,fleetTrend:h}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(my,{})}):c==="/tasks"?E=d?a.jsx(rb,{tasks:d}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(hy,{})}):c==="/debates"?E=m?a.jsx(cb,{consensus:m,consensusReports:v}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(xy,{})}):c==="/logs"?E=a.jsx(_y,{}):c==="/signals"?E=a.jsx(Oy,{}):c==="/violations"?E=a.jsx(qg,{}):E=a.jsx(lg,{overview:u,agents:o,tasks:d,consensus:m,consensusReports:v,fleetTrend:h,signalActivity:p,skills:g,activeTaskCount:X,setActiveTaskCount:O});const $=c==="/"||c==="/overview"||!/^\/(agent\/|consensus\/|team|tasks|debates|logs|signals|violations)/.test(c)?"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(xo,{}),a.jsx("main",{className:$,children:E})]})}function ub(){const{authed:i,login:c,error:u,recheck:o}=qy();return i===null?a.jsx("div",{className:"flex min-h-screen items-center justify-center",style:{color:"var(--ink-3)"},children:"Loading..."}):i?a.jsxs(a.Fragment,{children:[a.jsx(ob,{onUnauthorized:o}),a.jsx(Zy,{}),a.jsx(sb,{})]}):a.jsx(pg,{onLogin:c,error:u})}uv.createRoot(document.getElementById("root")).render(a.jsx(N.StrictMode,{children:a.jsx(ub,{})}));
|